@collaflow/app 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -0
- package/.next/app-build-manifest.json +29 -0
- package/.next/app-path-routes-manifest.json +4 -0
- package/.next/build-manifest.json +33 -0
- package/.next/cache/.previewinfo +1 -0
- package/.next/cache/.rscinfo +1 -0
- package/.next/cache/.tsbuildinfo +1 -0
- package/.next/cache/config.json +7 -0
- package/.next/cache/webpack/client-production/0.pack +0 -0
- package/.next/cache/webpack/client-production/1.pack +0 -0
- package/.next/cache/webpack/client-production/2.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack +0 -0
- package/.next/cache/webpack/client-production/index.pack.old +0 -0
- package/.next/cache/webpack/edge-server-production/0.pack +0 -0
- package/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/.next/cache/webpack/server-production/0.pack +0 -0
- package/.next/cache/webpack/server-production/index.pack +0 -0
- package/.next/diagnostics/build-diagnostics.json +6 -0
- package/.next/diagnostics/framework.json +1 -0
- package/.next/export-marker.json +6 -0
- package/.next/images-manifest.json +58 -0
- package/.next/next-minimal-server.js.nft.json +1 -0
- package/.next/next-server.js.nft.json +1 -0
- package/.next/package.json +1 -0
- package/.next/prerender-manifest.json +61 -0
- package/.next/react-loadable-manifest.json +6 -0
- package/.next/required-server-files.json +321 -0
- package/.next/routes-manifest.json +53 -0
- package/.next/server/app/_not-found/page.js +2 -0
- package/.next/server/app/_not-found/page.js.nft.json +1 -0
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -0
- package/.next/server/app/_not-found.html +1 -0
- package/.next/server/app/_not-found.meta +8 -0
- package/.next/server/app/_not-found.rsc +15 -0
- package/.next/server/app/index.html +1 -0
- package/.next/server/app/index.meta +7 -0
- package/.next/server/app/index.rsc +19 -0
- package/.next/server/app/page.js +86 -0
- package/.next/server/app/page.js.nft.json +1 -0
- package/.next/server/app/page_client-reference-manifest.js +1 -0
- package/.next/server/app-paths-manifest.json +4 -0
- package/.next/server/chunks/15.js +6 -0
- package/.next/server/chunks/575.js +32 -0
- package/.next/server/functions-config-manifest.json +4 -0
- package/.next/server/interception-route-rewrite-manifest.js +1 -0
- package/.next/server/middleware-build-manifest.js +1 -0
- package/.next/server/middleware-manifest.json +6 -0
- package/.next/server/middleware-react-loadable-manifest.js +1 -0
- package/.next/server/next-font-manifest.js +1 -0
- package/.next/server/next-font-manifest.json +1 -0
- package/.next/server/pages/404.html +1 -0
- package/.next/server/pages/500.html +1 -0
- package/.next/server/pages/_app.js +1 -0
- package/.next/server/pages/_app.js.nft.json +1 -0
- package/.next/server/pages/_document.js +1 -0
- package/.next/server/pages/_document.js.nft.json +1 -0
- package/.next/server/pages/_error.js +19 -0
- package/.next/server/pages/_error.js.nft.json +1 -0
- package/.next/server/pages-manifest.json +6 -0
- package/.next/server/server-reference-manifest.js +1 -0
- package/.next/server/server-reference-manifest.json +1 -0
- package/.next/server/webpack-runtime.js +1 -0
- package/.next/static/cawI4PxFre1uXaV3w_OOh/_buildManifest.js +1 -0
- package/.next/static/cawI4PxFre1uXaV3w_OOh/_ssgManifest.js +1 -0
- package/.next/static/chunks/5f994265-851b4fe5bb9f6bdf.js +1 -0
- package/.next/static/chunks/730-47357526b52cb7a3.js +1 -0
- package/.next/static/chunks/761-d78a04fe4a7f0c61.js +2 -0
- package/.next/static/chunks/7fa71398-d732f2f130f8dbf8.js +1 -0
- package/.next/static/chunks/9f40746c-e311a6f65dce894f.js +1 -0
- package/.next/static/chunks/app/_not-found/page-d0d3baa38855a614.js +1 -0
- package/.next/static/chunks/app/layout-6114418103b4dbcc.js +1 -0
- package/.next/static/chunks/app/page-a5e0c15f5813dcaf.js +1 -0
- package/.next/static/chunks/framework-b71824acec8cd700.js +1 -0
- package/.next/static/chunks/main-5d112cac3f90f4f6.js +1 -0
- package/.next/static/chunks/main-app-3133c331999859a2.js +1 -0
- package/.next/static/chunks/pages/_app-c068c4a8491e6db8.js +1 -0
- package/.next/static/chunks/pages/_error-464ab45f79bb2315.js +1 -0
- package/.next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- package/.next/static/chunks/webpack-e72e354969197063.js +1 -0
- package/.next/static/css/043b8a737f2ce68d.css +5 -0
- package/.next/trace +2 -0
- package/.next/types/app/layout.ts +84 -0
- package/.next/types/app/page.ts +84 -0
- package/.next/types/cache-life.d.ts +141 -0
- package/.next/types/package.json +1 -0
- package/.next/types/routes.d.ts +57 -0
- package/.next/types/validator.ts +61 -0
- package/LICENSE +201 -0
- package/components.json +20 -0
- package/next-env.d.ts +6 -0
- package/next.config.mjs +19 -0
- package/package.json +46 -0
- package/postcss.config.mjs +9 -0
- package/src/app/globals.css +16 -0
- package/src/app/layout.tsx +19 -0
- package/src/app/page.test.tsx +11 -0
- package/src/app/page.tsx +86 -0
- package/src/components/MarkdownEditor.tsx +432 -0
- package/src/lib/utils.ts +6 -0
- package/tailwind.config.ts +59 -0
- package/tsconfig.json +27 -0
- package/vitest.config.ts +8 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
(()=>{var a={};a.id=974,a.ids=[974],a.modules={58:(a,b,c)=>{Promise.resolve().then(c.bind(c,5179))},261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},837:()=>{},846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},1025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},2618:()=>{},2774:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GlobalError:()=>E.a,__next_app__:()=>K,handler:()=>M,pages:()=>J,routeModule:()=>L,tree:()=>I});var d=c(175),e=c(2976),f=c(1580),g=c(49),h=c(8967),i=c(9007),j=c(1606),k=c(9131),l=c(2323),m=c(2401),n=c(8599),o=c(7157),p=c(9858),q=c(8988),r=c(7997),s=c(261),t=c(8116),u=c(2785),v=c(6713),w=c(8429),x=c(8934),y=c(218),z=c(9831),A=c(5321),B=c(9379),C=c(6439),D=c(9965),E=c.n(D),F=c(8245),G=c(2444),H={};for(let a in F)0>["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(a)&&(H[a]=()=>F[a]);c.d(b,H);let I=["",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(c.bind(c,5179)),"/home/runner/work/collaflow-monorepo/collaflow-monorepo/packages/app/src/app/page.tsx"]}]},{layout:[()=>Promise.resolve().then(c.bind(c,9732)),"/home/runner/work/collaflow-monorepo/collaflow-monorepo/packages/app/src/app/layout.tsx"],"global-error":[()=>Promise.resolve().then(c.t.bind(c,9965,23)),"next/dist/client/components/builtin/global-error.js"],"not-found":[()=>Promise.resolve().then(c.t.bind(c,6489,23)),"next/dist/client/components/builtin/not-found.js"],forbidden:[()=>Promise.resolve().then(c.t.bind(c,2916,23)),"next/dist/client/components/builtin/forbidden.js"],unauthorized:[()=>Promise.resolve().then(c.t.bind(c,7703,23)),"next/dist/client/components/builtin/unauthorized.js"]}],J=["/home/runner/work/collaflow-monorepo/collaflow-monorepo/packages/app/src/app/page.tsx"],K={require:c,loadChunk:()=>Promise.resolve()},L=new d.AppPageRouteModule({definition:{kind:e.RouteKind.APP_PAGE,page:"/page",pathname:"/",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:I},distDir:".next",relativeProjectDir:""});async function M(a,b,d){var D;let H="/page";"/index"===H&&(H="/");let N=(0,h.getRequestMeta)(a,"postponed"),O=(0,h.getRequestMeta)(a,"minimalMode"),P=await L.prepare(a,b,{srcPage:H,multiZoneDraftMode:!1});if(!P)return b.statusCode=400,b.end("Bad Request"),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let{buildId:Q,query:R,params:S,parsedUrl:T,pageIsDynamic:U,buildManifest:V,nextFontManifest:W,reactLoadableManifest:X,serverActionsManifest:Y,clientReferenceManifest:Z,subresourceIntegrityManifest:$,prerenderManifest:_,isDraftMode:aa,resolvedPathname:ab,revalidateOnlyGenerated:ac,routerServerContext:ad,nextConfig:ae,interceptionRoutePatterns:af}=P,ag=T.pathname||"/",ah=(0,s.normalizeAppPath)(H),{isOnDemandRevalidate:ai}=P,aj=L.match(ag,_),ak=!!_.routes[ab],al=!!(aj||ak||_.routes[ah]),am=a.headers["user-agent"]||"",an=(0,v.getBotType)(am),ao=(0,q.isHtmlBotRequest)(a),ap=(0,h.getRequestMeta)(a,"isPrefetchRSCRequest")??"1"===a.headers[u.NEXT_ROUTER_PREFETCH_HEADER],aq=(0,h.getRequestMeta)(a,"isRSCRequest")??(0,n.f)(a.headers[u.RSC_HEADER]),ar=(0,t.getIsPossibleServerAction)(a),as=(0,m.checkIsAppPPREnabled)(ae.experimental.ppr)&&(null==(D=_.routes[ah]??_.dynamicRoutes[ah])?void 0:D.renderingMode)==="PARTIALLY_STATIC",at=!1,au=!1,av=as?N:void 0,aw=as&&aq&&!ap,ax=(0,h.getRequestMeta)(a,"segmentPrefetchRSCRequest"),ay=!am||(0,q.shouldServeStreamingMetadata)(am,ae.htmlLimitedBots);ao&&as&&(al=!1,ay=!1);let az=!0===L.isDev||!al||"string"==typeof N||aw,aA=ao&&as,aB=null;aa||!al||az||ar||av||aw||(aB=ab);let aC=aB;!aC&&L.isDev&&(aC=ab),L.isDev||aa||!al||!aq||aw||(0,k.d)(a.headers);let aD={...F,tree:I,pages:J,GlobalError:E(),handler:M,routeModule:L,__next_app__:K};Y&&Z&&(0,p.setReferenceManifestsSingleton)({page:H,clientReferenceManifest:Z,serverActionsManifest:Y,serverModuleMap:(0,r.createServerModuleMap)({serverActionsManifest:Y})});let aE=a.method||"GET",aF=(0,g.getTracer)(),aG=aF.getActiveScopeSpan();try{let f=L.getVaryHeader(ab,af);b.setHeader("Vary",f);let k=async(c,d)=>{let e=new l.NodeNextRequest(a),f=new l.NodeNextResponse(b);return L.render(e,f,d).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=aF.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==i.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${aE} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${aE} ${a.url}`)})},m=async({span:e,postponed:f,fallbackRouteParams:g})=>{let i={query:R,params:S,page:ah,sharedContext:{buildId:Q},serverComponentsHmrCache:(0,h.getRequestMeta)(a,"serverComponentsHmrCache"),fallbackRouteParams:g,renderOpts:{App:()=>null,Document:()=>null,pageConfig:{},ComponentMod:aD,Component:(0,j.T)(aD),params:S,routeModule:L,page:H,postponed:f,shouldWaitOnAllReady:aA,serveStreamingMetadata:ay,supportsDynamicResponse:"string"==typeof f||az,buildManifest:V,nextFontManifest:W,reactLoadableManifest:X,subresourceIntegrityManifest:$,serverActionsManifest:Y,clientReferenceManifest:Z,setIsrStatus:null==ad?void 0:ad.setIsrStatus,dir:c(3873).join(process.cwd(),L.relativeProjectDir),isDraftMode:aa,isRevalidate:al&&!f&&!aw,botType:an,isOnDemandRevalidate:ai,isPossibleServerAction:ar,assetPrefix:ae.assetPrefix,nextConfigOutput:ae.output,crossOrigin:ae.crossOrigin,trailingSlash:ae.trailingSlash,previewProps:_.preview,deploymentId:ae.deploymentId,enableTainting:ae.experimental.taint,htmlLimitedBots:ae.htmlLimitedBots,devtoolSegmentExplorer:ae.experimental.devtoolSegmentExplorer,reactMaxHeadersLength:ae.reactMaxHeadersLength,multiZoneDraftMode:!1,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:ae.experimental.cacheLife,basePath:ae.basePath,serverActions:ae.experimental.serverActions,...at?{nextExport:!0,supportsDynamicResponse:!1,isStaticGeneration:!0,isRevalidate:!0,isDebugDynamicAccesses:at}:{},experimental:{isRoutePPREnabled:as,expireTime:ae.expireTime,staleTimes:ae.experimental.staleTimes,cacheComponents:!!ae.experimental.cacheComponents,clientSegmentCache:!!ae.experimental.clientSegmentCache,clientParamParsing:!!ae.experimental.clientParamParsing,dynamicOnHover:!!ae.experimental.dynamicOnHover,inlineCss:!!ae.experimental.inlineCss,authInterrupts:!!ae.experimental.authInterrupts,clientTraceMetadata:ae.experimental.clientTraceMetadata||[]},waitUntil:d.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:()=>{},onInstrumentationRequestError:(b,c,d)=>L.onRequestError(a,b,d,ad),err:(0,h.getRequestMeta)(a,"invokeError"),dev:L.isDev}},l=await k(e,i),{metadata:m}=l,{cacheControl:n,headers:o={},fetchTags:p}=m;if(p&&(o[z.NEXT_CACHE_TAGS_HEADER]=p),a.fetchMetrics=m.fetchMetrics,al&&(null==n?void 0:n.revalidate)===0&&!L.isDev&&!as){let a=m.staticBailoutInfo,b=Object.defineProperty(Error(`Page changed from static to dynamic at runtime ${ab}${(null==a?void 0:a.description)?`, reason: ${a.description}`:""}
|
|
2
|
+
see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`),"__NEXT_ERROR_CODE",{value:"E132",enumerable:!1,configurable:!0});if(null==a?void 0:a.stack){let c=a.stack;b.stack=b.message+c.substring(c.indexOf("\n"))}throw b}return{value:{kind:w.CachedRouteKind.APP_PAGE,html:l,headers:o,rscData:m.flightData,postponed:m.postponed,status:m.statusCode,segmentData:m.segmentData},cacheControl:n}},n=async({hasResolved:c,previousCacheEntry:f,isRevalidating:g,span:i})=>{let j,k=!1===L.isDev,l=c||b.writableEnded;if(ai&&ac&&!f&&!O)return(null==ad?void 0:ad.render404)?await ad.render404(a,b):(b.statusCode=404,b.end("This page could not be found")),null;if(aj&&(j=(0,x.parseFallbackField)(aj.fallback)),j===x.FallbackMode.PRERENDER&&(0,v.isBot)(am)&&(!as||ao)&&(j=x.FallbackMode.BLOCKING_STATIC_RENDER),(null==f?void 0:f.isStale)===-1&&(ai=!0),ai&&(j!==x.FallbackMode.NOT_FOUND||f)&&(j=x.FallbackMode.BLOCKING_STATIC_RENDER),!O&&j!==x.FallbackMode.BLOCKING_STATIC_RENDER&&aC&&!l&&!aa&&U&&(k||!ak)){let b;if((k||aj)&&j===x.FallbackMode.NOT_FOUND)throw new C.NoFallbackError;if(as&&!aq){let c="string"==typeof(null==aj?void 0:aj.fallback)?aj.fallback:k?ah:null;if(b=await L.handleResponse({cacheKey:c,req:a,nextConfig:ae,routeKind:e.RouteKind.APP_PAGE,isFallback:!0,prerenderManifest:_,isRoutePPREnabled:as,responseGenerator:async()=>m({span:i,postponed:void 0,fallbackRouteParams:k||au?(0,o.u)(ah):null}),waitUntil:d.waitUntil}),null===b)return null;if(b)return delete b.cacheControl,b}}let n=ai||g||!av?void 0:av;if(at&&void 0!==n)return{cacheControl:{revalidate:1,expire:void 0},value:{kind:w.CachedRouteKind.PAGES,html:y.default.EMPTY,pageData:{},headers:void 0,status:void 0}};let p=U&&as&&((0,h.getRequestMeta)(a,"renderFallbackShell")||au)?(0,o.u)(ag):null;return m({span:i,postponed:n,fallbackRouteParams:p})},p=async c=>{var f,g,i,j,k;let l,o=await L.handleResponse({cacheKey:aB,responseGenerator:a=>n({span:c,...a}),routeKind:e.RouteKind.APP_PAGE,isOnDemandRevalidate:ai,isRoutePPREnabled:as,req:a,nextConfig:ae,prerenderManifest:_,waitUntil:d.waitUntil});if(aa&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),L.isDev&&b.setHeader("Cache-Control","no-store, must-revalidate"),!o){if(aB)throw Object.defineProperty(Error("invariant: cache entry required but not generated"),"__NEXT_ERROR_CODE",{value:"E62",enumerable:!1,configurable:!0});return null}if((null==(f=o.value)?void 0:f.kind)!==w.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant app-page handler received invalid cache entry ${null==(i=o.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E707",enumerable:!1,configurable:!0});let p="string"==typeof o.value.postponed;al&&!aw&&(!p||ap)&&(O||b.setHeader("x-nextjs-cache",ai?"REVALIDATED":o.isMiss?"MISS":o.isStale?"STALE":"HIT"),b.setHeader(u.NEXT_IS_PRERENDER_HEADER,"1"));let{value:q}=o;if(av)l={revalidate:0,expire:void 0};else if(O&&aq&&!ap&&as)l={revalidate:0,expire:void 0};else if(!L.isDev)if(aa)l={revalidate:0,expire:void 0};else if(al){if(o.cacheControl)if("number"==typeof o.cacheControl.revalidate){if(o.cacheControl.revalidate<1)throw Object.defineProperty(Error(`Invalid revalidate configuration provided: ${o.cacheControl.revalidate} < 1`),"__NEXT_ERROR_CODE",{value:"E22",enumerable:!1,configurable:!0});l={revalidate:o.cacheControl.revalidate,expire:(null==(j=o.cacheControl)?void 0:j.expire)??ae.expireTime}}else l={revalidate:z.CACHE_ONE_YEAR,expire:void 0}}else b.getHeader("Cache-Control")||(l={revalidate:0,expire:void 0});if(o.cacheControl=l,"string"==typeof ax&&(null==q?void 0:q.kind)===w.CachedRouteKind.APP_PAGE&&q.segmentData){b.setHeader(u.NEXT_DID_POSTPONE_HEADER,"2");let c=null==(k=q.headers)?void 0:k[z.NEXT_CACHE_TAGS_HEADER];O&&al&&c&&"string"==typeof c&&b.setHeader(z.NEXT_CACHE_TAGS_HEADER,c);let d=q.segmentData.get(ax);return void 0!==d?(0,B.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:y.default.fromStatic(d,u.RSC_CONTENT_TYPE_HEADER),cacheControl:o.cacheControl}):(b.statusCode=204,(0,B.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:y.default.EMPTY,cacheControl:o.cacheControl}))}let r=(0,h.getRequestMeta)(a,"onCacheEntry");if(r&&await r({...o,value:{...o.value,kind:"PAGE"}},{url:(0,h.getRequestMeta)(a,"initURL")}))return null;if(p&&av)throw Object.defineProperty(Error("Invariant: postponed state should not be present on a resume request"),"__NEXT_ERROR_CODE",{value:"E396",enumerable:!1,configurable:!0});if(q.headers){let a={...q.headers};for(let[c,d]of(O&&al||delete a[z.NEXT_CACHE_TAGS_HEADER],Object.entries(a)))if(void 0!==d)if(Array.isArray(d))for(let a of d)b.appendHeader(c,a);else"number"==typeof d&&(d=d.toString()),b.appendHeader(c,d)}let s=null==(g=q.headers)?void 0:g[z.NEXT_CACHE_TAGS_HEADER];if(O&&al&&s&&"string"==typeof s&&b.setHeader(z.NEXT_CACHE_TAGS_HEADER,s),!q.status||aq&&as||(b.statusCode=q.status),!O&&q.status&&G.RedirectStatusCode[q.status]&&aq&&(b.statusCode=200),p&&b.setHeader(u.NEXT_DID_POSTPONE_HEADER,"1"),aq&&!aa){if(void 0===q.rscData){if(q.postponed)throw Object.defineProperty(Error("Invariant: Expected postponed to be undefined"),"__NEXT_ERROR_CODE",{value:"E372",enumerable:!1,configurable:!0});return(0,B.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:q.html,cacheControl:aw?{revalidate:0,expire:void 0}:o.cacheControl})}return(0,B.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:y.default.fromStatic(q.rscData,u.RSC_CONTENT_TYPE_HEADER),cacheControl:o.cacheControl})}let t=q.html;if(!p||O||aq)return(0,B.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:t,cacheControl:o.cacheControl});if(at)return t.push(new ReadableStream({start(a){a.enqueue(A.ENCODED_TAGS.CLOSED.BODY_AND_HTML),a.close()}})),(0,B.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:t,cacheControl:{revalidate:0,expire:void 0}});let v=new TransformStream;return t.push(v.readable),m({span:c,postponed:q.postponed,fallbackRouteParams:null}).then(async a=>{var b,c;if(!a)throw Object.defineProperty(Error("Invariant: expected a result to be returned"),"__NEXT_ERROR_CODE",{value:"E463",enumerable:!1,configurable:!0});if((null==(b=a.value)?void 0:b.kind)!==w.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant: expected a page response, got ${null==(c=a.value)?void 0:c.kind}`),"__NEXT_ERROR_CODE",{value:"E305",enumerable:!1,configurable:!0});await a.value.html.pipeTo(v.writable)}).catch(a=>{v.writable.abort(a).catch(a=>{console.error("couldn't abort transformer",a)})}),(0,B.sendRenderResult)({req:a,res:b,generateEtags:ae.generateEtags,poweredByHeader:ae.poweredByHeader,result:t,cacheControl:{revalidate:0,expire:void 0}})};if(!aG)return await aF.withPropagatedContext(a.headers,()=>aF.trace(i.BaseServerSpan.handleRequest,{spanName:`${aE} ${a.url}`,kind:g.SpanKind.SERVER,attributes:{"http.method":aE,"http.target":a.url}},p));await p(aG)}catch(b){throw b instanceof C.NoFallbackError||await L.onRequestError(a,b,{routerKind:"App Router",routePath:H,routeType:"render",revalidateReason:(0,f.c)({isRevalidate:al,isOnDemandRevalidate:ai})},ad),b}}},3033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},3873:a=>{"use strict";a.exports=require("path")},5179:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(9905).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/collaflow-monorepo/collaflow-monorepo/packages/app/src/app/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/collaflow-monorepo/collaflow-monorepo/packages/app/src/app/page.tsx","default")},5401:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>i});var d=c(4391),e=c(5490),f=c(6677);function g({top:a,left:b,height:c,color:e,name:f}){return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"colla-rc-cursor",style:{top:a,left:b,height:c,background:e}}),(0,d.jsx)("div",{className:"colla-rc-label",style:{top:a,left:b,background:e},children:f})]})}function h({roomId:a,serverUrl:b,defaultValue:c="# Hello CollaFlow\n\n开始编辑,支持 **Markdown** 与协同光标。"}){let h=(0,e.useRef)(null),i=(0,e.useRef)(null),j=(0,e.useRef)(null),k=(0,e.useRef)(null),l=(0,e.useRef)(null),m=(0,e.useRef)(null),n=(0,e.useRef)(null),o=(0,e.useRef)([]),[p,q]=(0,e.useState)(50),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)([]),[v,w]=(0,e.useState)(0),[x,y]=(0,e.useState)([]),[z,A]=(0,e.useState)([]);(0,e.useCallback)(()=>{let a=l.current,b=m.current;if(!a||!b)return;let c=b.toString();if(a.value===c)return;let d=a.value,e=a.selectionStart,f=0,g=Math.min(d.length,c.length);for(;f<g&&d[f]===c[f];)f++;let h=c.length-d.length;if(a.value=c,document.activeElement===a){let b=Math.max(f,Math.min(c.length,e+(e<=f?0:h)));a.setSelectionRange(b,b)}},[]),(0,e.useCallback)(()=>{let a=n.current;if(!a)return;let b=a.getView();o.current=(0,f.u9)(b.state.doc,a.getMarkdown())},[]);let B=(0,e.useCallback)(a=>{let b=m.current;b&&(0,f.Cp)(b,a.currentTarget.value,f.$d)},[]),C=(0,e.useCallback)(()=>{let a=l.current,b=n.current;a&&b&&b.setLocalSelection(a.selectionStart,a.selectionEnd)},[]),D=(0,e.useCallback)(a=>{a.preventDefault();let b=h.current;if(!b)return;s(!0);let c=a=>{let c=b.getBoundingClientRect();0!==c.width&&q(Math.min(80,Math.max(20,(a.clientX-c.left)/c.width*100)))},d=()=>{s(!1),window.removeEventListener("mousemove",c),window.removeEventListener("mouseup",d)};window.addEventListener("mousemove",c),window.addEventListener("mouseup",d)},[]);return(0,d.jsxs)("div",{ref:h,className:`flex w-full overflow-hidden rounded-lg border border-border bg-card ${r?"select-none":""}`,style:{height:"70vh",minHeight:"420px"},children:[(0,d.jsxs)("section",{className:"flex h-full flex-col overflow-hidden",style:{width:`${p}%`},children:[(0,d.jsx)("div",{className:"border-b border-border px-3 py-1.5 text-xs text-muted-foreground",children:"预览"}),(0,d.jsxs)("div",{ref:i,className:"relative h-full flex-1 overflow-hidden",children:[(0,d.jsx)("div",{ref:j,className:"colla-editor h-full w-full overflow-auto p-4"}),(0,d.jsx)("div",{className:"pointer-events-none absolute inset-0 overflow-hidden",children:z.map(a=>(0,d.jsx)(g,{...a},a.id))})]})]}),(0,d.jsx)("div",{onMouseDown:D,role:"separator","aria-orientation":"vertical",className:"w-1.5 shrink-0 cursor-col-resize bg-border transition-colors hover:bg-accent"}),(0,d.jsxs)("section",{className:"flex h-full flex-col overflow-hidden",style:{width:`${100-p}%`},children:[(0,d.jsx)("div",{className:"border-b border-border px-3 py-1.5 text-xs text-muted-foreground",children:"源码(Markdown)"}),(0,d.jsxs)("div",{ref:k,className:"relative h-full flex-1 overflow-hidden",children:[(0,d.jsx)("textarea",{ref:l,defaultValue:c,onInput:B,onKeyUp:C,onMouseUp:C,onSelect:C,spellCheck:!1,placeholder:"在此编辑 Markdown 源码…",className:"h-full w-full flex-1 resize-none bg-transparent p-4 font-mono text-sm leading-relaxed text-foreground outline-none"}),(0,d.jsx)("div",{className:"pointer-events-none absolute inset-0 overflow-hidden",children:x.map(a=>(0,d.jsx)(g,{...a},a.id))})]})]})]})}function i(){let[a,b]=(0,e.useState)("ws://localhost:1234"),[c,f]=(0,e.useState)(""),[g,i]=(0,e.useState)(!1),[j,k]=(0,e.useState)(""),l=()=>{k(c.trim()),i(!0)};return(0,d.jsxs)("main",{className:"mx-auto flex min-h-screen max-w-5xl flex-col gap-6 p-8",children:[(0,d.jsxs)("header",{children:[(0,d.jsx)("h1",{className:"text-3xl font-bold tracking-tight",children:"CollaFlow"}),(0,d.jsx)("p",{className:"mt-2 text-muted-foreground",children:"高性能协同脑图 / 文档工作台 \xb7 基于 CollaMarkdown 编辑器"})]}),(0,d.jsxs)("section",{className:"flex flex-wrap items-end gap-4 rounded-lg border border-border bg-card p-4",children:[(0,d.jsxs)("label",{className:"flex flex-col gap-1 text-sm",children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:"协同服务地址"}),(0,d.jsx)("input",{className:"rounded-md border border-border bg-background px-3 py-1.5 text-sm",value:a,onChange:a=>b(a.target.value),placeholder:"ws://localhost:1234"})]}),(0,d.jsxs)("label",{className:"flex flex-col gap-1 text-sm",children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:"房间 / 文档 ID"}),(0,d.jsx)("input",{className:"rounded-md border border-border bg-background px-3 py-1.5 text-sm",value:c,onChange:a=>f(a.target.value),onKeyDown:a=>{"Enter"===a.key&&l()},placeholder:"留空则单机编辑"})]}),(0,d.jsx)("button",{type:"button",onClick:l,className:"rounded-md bg-foreground px-4 py-1.5 text-sm font-medium text-background transition-opacity hover:opacity-90",children:g?"重新进入":"进入房间"}),g&&(0,d.jsx)("button",{type:"button",onClick:()=>{i(!1)},className:"rounded-md border border-border px-4 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-muted",children:"退出"}),g&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:j?`已接入协同房间「${j}」`:"本地编辑模式(未启用协同)"})]}),g?(0,d.jsx)(h,{roomId:j||void 0,serverUrl:a}):(0,d.jsx)("div",{className:"rounded-lg border border-dashed border-border p-10 text-center text-muted-foreground",children:"输入房间 ID(可选)后点击「进入房间」开始编辑"})]})}},6439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},6485:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,9965,23)),Promise.resolve().then(c.t.bind(c,7268,23)),Promise.resolve().then(c.t.bind(c,7106,23)),Promise.resolve().then(c.t.bind(c,3133,23)),Promise.resolve().then(c.t.bind(c,9769,23)),Promise.resolve().then(c.t.bind(c,9761,23)),Promise.resolve().then(c.t.bind(c,5363,23)),Promise.resolve().then(c.t.bind(c,7460,23)),Promise.resolve().then(c.t.bind(c,3865,23))},6677:(a,b,c)=>{"use strict";let d,e;c.d(b,{$d:()=>se,u9:()=>sr,createEditor:()=>sq,Cp:()=>sf,_R:()=>ss});var f,g,h,i,j={};c.r(j),c.d(j,{attentionMarkers:()=>eU,contentInitial:()=>eO,disable:()=>eV,document:()=>eN,flow:()=>eQ,flowInitial:()=>eP,insideSpan:()=>eT,string:()=>eR,text:()=>eS});var k={};c.r(k),c.d(k,{boolean:()=>rc,booleanish:()=>rd,commaOrSpaceSeparated:()=>ri,commaSeparated:()=>rh,number:()=>rf,overloadedBoolean:()=>re,spaceSeparated:()=>rg});let l=()=>new Map,m=a=>{let b=l();return a.forEach((a,c)=>{b.set(c,a)}),b},n=(a,b,c)=>{let d=a.get(b);return void 0===d&&a.set(b,d=c()),d},o=()=>new Set,p=a=>a[a.length-1],q=(a,b)=>{for(let c=0;c<b.length;c++)a.push(b[c])},r=Array.from,s=Array.isArray;class t{constructor(){this._observers=l()}on(a,b){return n(this._observers,a,o).add(b),b}once(a,b){let c=(...d)=>{this.off(a,c),b(...d)};this.on(a,c)}off(a,b){let c=this._observers.get(a);void 0!==c&&(c.delete(b),0===c.size&&this._observers.delete(a))}emit(a,b){return r((this._observers.get(a)||l()).values()).forEach(a=>a(...b))}destroy(){this._observers=l()}}class u{constructor(){this._observers=l()}on(a,b){n(this._observers,a,o).add(b)}once(a,b){let c=(...d)=>{this.off(a,c),b(...d)};this.on(a,c)}off(a,b){let c=this._observers.get(a);void 0!==c&&(c.delete(b),0===c.size&&this._observers.delete(a))}emit(a,b){return r((this._observers.get(a)||l()).values()).forEach(a=>a(...b))}destroy(){this._observers=l()}}let v=Math.floor,w=Math.abs,x=(a,b)=>a<b?a:b,y=(a,b)=>a>b?a:b,z=a=>0!==a?a<0:1/a<0,A=Number.MAX_SAFE_INTEGER;Number.MIN_SAFE_INTEGER;let B=Number.isInteger||(a=>"number"==typeof a&&isFinite(a)&&v(a)===a);Number.parseInt,String.fromCodePoint,(0,String.fromCharCode)(65535);let C=/^\s*/g,D=/([A-Z])/g,E=(a,b)=>a.replace(D,a=>`${b}${a.toLowerCase()}`).replace(C,""),F="undefined"!=typeof TextEncoder?new TextEncoder:null,G=F?a=>F.encode(a):a=>{let b=unescape(encodeURIComponent(a)),c=b.length,d=new Uint8Array(c);for(let a=0;a<c;a++)d[a]=b.codePointAt(a);return d},H="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});H&&1===H.decode(new Uint8Array).length&&(H=null);class I{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}let J=()=>new I,K=a=>{let b=new Uint8Array((a=>{let b=a.cpos;for(let c=0;c<a.bufs.length;c++)b+=a.bufs[c].length;return b})(a)),c=0;for(let d=0;d<a.bufs.length;d++){let e=a.bufs[d];b.set(e,c),c+=e.length}return b.set(new Uint8Array(a.cbuf.buffer,0,a.cpos),c),b},L=(a,b)=>{let c=a.cbuf.length;a.cpos===c&&(a.bufs.push(a.cbuf),a.cbuf=new Uint8Array(2*c),a.cpos=0),a.cbuf[a.cpos++]=b},M=(a,b)=>{for(;b>127;)L(a,128|127&b),b=v(b/128);L(a,127&b)},N=(a,b)=>{let c=z(b);for(c&&(b=-b),L(a,128*(b>63)|64*!!c|63&b),b=v(b/64);b>0;)L(a,128*(b>127)|127&b),b=v(b/128)},O=new Uint8Array(3e4),P=O.length/3,Q=F&&F.encodeInto?(a,b)=>{if(b.length<P){let c=F.encodeInto(b,O).written||0;M(a,c);for(let b=0;b<c;b++)L(a,O[b])}else S(a,G(b))}:(a,b)=>{let c=unescape(encodeURIComponent(b)),d=c.length;M(a,d);for(let b=0;b<d;b++)L(a,c.codePointAt(b))},R=(a,b)=>{let c=a.cbuf.length,d=a.cpos,e=x(c-d,b.length),f=b.length-e;a.cbuf.set(b.subarray(0,e),d),a.cpos+=e,f>0&&(a.bufs.push(a.cbuf),a.cbuf=new Uint8Array(y(2*c,f)),a.cbuf.set(b.subarray(e)),a.cpos=f)},S=(a,b)=>{M(a,b.byteLength),R(a,b)},T=(a,b)=>{((a,b)=>{let c=a.cbuf.length;c-a.cpos<b&&(a.bufs.push(new Uint8Array(a.cbuf.buffer,0,a.cpos)),a.cbuf=new Uint8Array(2*y(c,b)),a.cpos=0)})(a,b);let c=new DataView(a.cbuf.buffer,a.cpos,b);return a.cpos+=b,c},U=new DataView(new ArrayBuffer(4)),V=(a,b)=>{switch(typeof b){case"string":L(a,119),Q(a,b);break;case"number":if(B(b)&&0x7fffffff>=w(b))L(a,125),N(a,b);else if((a=>(U.setFloat32(0,a),U.getFloat32(0)===a))(b))L(a,124),T(a,4).setFloat32(0,b,!1);else L(a,123),T(a,8).setFloat64(0,b,!1);break;case"bigint":L(a,122),T(a,8).setBigInt64(0,b,!1);break;case"object":if(null===b)L(a,126);else if(s(b)){L(a,117),M(a,b.length);for(let c=0;c<b.length;c++)V(a,b[c])}else if(b instanceof Uint8Array)L(a,116),S(a,b);else{L(a,118);let c=Object.keys(b);M(a,c.length);for(let d=0;d<c.length;d++){let e=c[d];Q(a,e),V(a,b[e])}}break;case"boolean":L(a,b?120:121);break;default:L(a,127)}};class W extends I{constructor(a){super(),this.w=a,this.s=null,this.count=0}write(a){this.s===a?this.count++:(this.count>0&&M(this,this.count-1),this.count=1,this.w(this,a),this.s=a)}}let X=a=>{a.count>0&&(N(a.encoder,1===a.count?a.s:-a.s),a.count>1&&M(a.encoder,a.count-2))};class Y{constructor(){this.encoder=new I,this.s=0,this.count=0}write(a){this.s===a?this.count++:(X(this),this.count=1,this.s=a)}toUint8Array(){return X(this),K(this.encoder)}}let Z=a=>{if(a.count>0){let b=2*a.diff+ +(1!==a.count);N(a.encoder,b),a.count>1&&M(a.encoder,a.count-2)}};class ${constructor(){this.encoder=new I,this.s=0,this.count=0,this.diff=0}write(a){this.diff===a-this.s?(this.s=a,this.count++):(Z(this),this.count=1,this.diff=a-this.s,this.s=a)}toUint8Array(){return Z(this),K(this.encoder)}}class _{constructor(){this.sarr=[],this.s="",this.lensE=new Y}write(a){this.s+=a,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(a.length)}toUint8Array(){let a=new I;return this.sarr.push(this.s),this.s="",Q(a,this.sarr.join("")),R(a,this.lensE.toUint8Array()),K(a)}}let aa=a=>Error(a),ab=()=>{throw aa("Method unimplemented")},ac=()=>{throw aa("Unexpected case")},ad=aa("Unexpected end of array"),ae=aa("Integer out of Range");class af{constructor(a){this.arr=a,this.pos=0}}let ag=a=>new af(a),ah=a=>a.pos!==a.arr.length,ai=a=>((a,b)=>{let c=new Uint8Array(a.arr.buffer,a.pos+a.arr.byteOffset,b);return a.pos+=b,c})(a,ak(a)),aj=a=>a.arr[a.pos++],ak=a=>{let b=0,c=1,d=a.arr.length;for(;a.pos<d;){let d=a.arr[a.pos++];if(b+=(127&d)*c,c*=128,d<128)return b;if(b>A)throw ae}throw ad},al=a=>{let b=a.arr[a.pos++],c=63&b,d=64,e=(64&b)>0?-1:1;if((128&b)==0)return e*c;let f=a.arr.length;for(;a.pos<f;){if(c+=(127&(b=a.arr[a.pos++]))*d,d*=128,b<128)return e*c;if(c>A)throw ae}throw ad},am=H?a=>H.decode(ai(a)):a=>{let b=ak(a);if(0===b)return"";{let c=String.fromCodePoint(aj(a));if(--b<100)for(;b--;)c+=String.fromCodePoint(aj(a));else for(;b>0;){let d=b<1e4?b:1e4,e=a.arr.subarray(a.pos,a.pos+d);a.pos+=d,c+=String.fromCodePoint.apply(null,e),b-=d}return decodeURIComponent(escape(c))}},an=(a,b)=>{let c=new DataView(a.arr.buffer,a.arr.byteOffset+a.pos,b);return a.pos+=b,c},ao=[a=>void 0,a=>null,al,a=>an(a,4).getFloat32(0,!1),a=>an(a,8).getFloat64(0,!1),a=>an(a,8).getBigInt64(0,!1),a=>!1,a=>!0,am,a=>{let b=ak(a),c={};for(let d=0;d<b;d++)c[am(a)]=ap(a);return c},a=>{let b=ak(a),c=[];for(let d=0;d<b;d++)c.push(ap(a));return c},ai],ap=a=>ao[127-aj(a)](a);class aq extends af{constructor(a,b){super(a),this.reader=b,this.s=null,this.count=0}read(){return 0===this.count&&(this.s=this.reader(this),ah(this)?this.count=ak(this)+1:this.count=-1),this.count--,this.s}}class ar extends af{constructor(a){super(a),this.s=0,this.count=0}read(){if(0===this.count){this.s=al(this);let a=z(this.s);this.count=1,a&&(this.s=-this.s,this.count=ak(this)+2)}return this.count--,this.s}}class as extends af{constructor(a){super(a),this.s=0,this.count=0,this.diff=0}read(){if(0===this.count){let a=al(this);this.diff=v(a/2),this.count=1,1&a&&(this.count=ak(this)+2)}return this.s+=this.diff,this.count--,this.s}}class at{constructor(a){this.decoder=new ar(a),this.str=am(this.decoder),this.spos=0}read(){let a=this.spos+this.decoder.read(),b=this.str.slice(this.spos,a);return this.spos=a,b}}let au=require("node:crypto");au.webcrypto.subtle;let av=au.webcrypto.getRandomValues.bind(au.webcrypto),aw=()=>av(new Uint32Array(1))[0],ax=a=>new Promise(a);Promise.all.bind(Promise);let ay=a=>void 0===a?null:a;class az{constructor(){this.map=new Map}setItem(a,b){this.map.set(a,b)}getItem(a){return this.map.get(a)}}let aA=new az;try{"undefined"!=typeof localStorage&&localStorage&&(aA=localStorage)}catch(a){}let aB=aA,aC=Symbol("Equality"),aD=Object.assign,aE=Object.keys;Object.values;let aF=a=>aE(a).length,aG=(a,b)=>Object.prototype.hasOwnProperty.call(a,b),aH=Object.freeze,aI=a=>{for(let b in a){let c=a[b];("object"==typeof c||"function"==typeof c)&&aI(a[b])}return aH(a)},aJ=(a,b,c=0)=>{try{for(;c<a.length;c++)a[c](...b)}finally{c<a.length&&aJ(a,b,c+1)}},aK=a=>a,aL=(a,b)=>{if(a===b)return!0;if(null==a||null==b||a.constructor!==b.constructor&&(a.constructor||Object)!==(b.constructor||Object))return!1;if(null!=a[aC])return a[aC](b);switch(a.constructor){case ArrayBuffer:a=new Uint8Array(a),b=new Uint8Array(b);case Uint8Array:if(a.byteLength!==b.byteLength)return!1;for(let c=0;c<a.length;c++)if(a[c]!==b[c])return!1;break;case Set:if(a.size!==b.size)return!1;for(let c of a)if(!b.has(c))return!1;break;case Map:if(a.size!==b.size)return!1;for(let c of a.keys())if(!b.has(c)||!aL(a.get(c),b.get(c)))return!1;break;case void 0:case Object:if(aF(a)!==aF(b))return!1;for(let c in a)if(!aG(a,c)||!aL(a[c],b[c]))return!1;break;case Array:if(a.length!==b.length)return!1;for(let c=0;c<a.length;c++)if(!aL(a[c],b[c]))return!1;break;default:return!1}return!0},aM="undefined"!=typeof process&&process.release&&/node|io\.js/.test(process.release.name)&&"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0);"undefined"!=typeof navigator&&/Mac/.test(navigator.platform);let aN=[],aO=a=>(()=>{if(void 0===d)if(aM){d=l();let a=process.argv,b=null;for(let c=0;c<a.length;c++){let e=a[c];"-"===e[0]?(null!==b&&d.set(b,""),b=e):null!==b?(d.set(b,e),b=null):aN.push(e)}null!==b&&d.set(b,"")}else"object"==typeof location?(d=l(),(location.search||"?").slice(1).split("&").forEach(a=>{if(0!==a.length){let[b,c]=a.split("=");d.set(`--${E(b,"-")}`,c),d.set(`-${E(b,"-")}`,c)}})):d=l();return d})().has(a),aP=a=>aM?ay(process.env[a.toUpperCase().replaceAll("-","_")]):ay(aB.getItem(a)),aQ=a=>aO("--"+a)||null!==aP(a);aQ("production");let aR=aM&&["true","1","2"].includes(process.env.FORCE_COLOR)||!aO("--no-colors")&&!aQ("no-color")&&(!aM||process.stdout.isTTY)&&(!aM||aO("--color")||null!==aP("COLORTERM")||(aP("TERM")||"").includes("color")),aS=Symbol,aT=Date.now,aU=aS(),aV=aS(),aW=aS(),aX=aS(),aY=aS(),aZ=aS(),a$=aS(),a_=aS(),a0=aS();aT();let a1={[aU]:"\x1b[1m",[aV]:"\x1b[2m",[aW]:"\x1b[34m",[aY]:"\x1b[32m",[aX]:"\x1b[37m",[aZ]:"\x1b[31m",[a$]:"\x1b[35m",[a_]:"\x1b[38;5;208m",[a0]:"\x1b[0m"},a2=aR?a=>{1===a.length&&a[0]?.constructor===Function&&(a=a[0]());let b=[],c=[],d=0;for(;d<a.length;d++){let c=a[d],e=a1[c];if(void 0!==e)b.push(e);else if(void 0===c)break;else if(c.constructor===String||c.constructor===Number)b.push(c);else break}for(d>0&&(b.push("\x1b[0m"),c.push(b.join("")));d<a.length;d++){let b=a[d];b instanceof Symbol||c.push(b)}return c}:a=>{1===a.length&&a[0]?.constructor===Function&&(a=a[0]());let b=[],c=[],d=0;for(;d<a.length;d++){let c=a[d];if(void 0===c)break;if(c.constructor===String||c.constructor===Number)b.push(c);else if(c.constructor===Object)break}for(d>0&&c.push(b.join(""));d<a.length;d++){let b=a[d];b instanceof Symbol||c.push(b)}return c},a3=a=>({[Symbol.iterator](){return this},next:a}),a4=(a,b)=>a3(()=>{let{done:c,value:d}=a.next();return{done:c,value:c?void 0:b(d)}});class a5{constructor(a,b){this.clock=a,this.len=b}}class a6{constructor(){this.clients=new Map}}let a7=(a,b,c)=>b.clients.forEach((b,d)=>{let e=a.doc.store.clients.get(d);if(null!=e){let d=e[e.length-1],f=d.id.clock+d.length;for(let d=0,g=b[d];d<b.length&&g.clock<f;g=b[++d])bS(a,e,g.clock,g.len,c)}}),a8=(a,b)=>{let c=a.clients.get(b.client);return void 0!==c&&null!==((a,b)=>{let c=0,d=a.length-1;for(;c<=d;){let e=v((c+d)/2),f=a[e],g=f.clock;if(g<=b){if(b<g+f.len)return e;c=e+1}else d=e-1}return null})(c,b.clock)},a9=a=>{a.clients.forEach(a=>{let b,c;for(a.sort((a,b)=>a.clock-b.clock),b=1,c=1;b<a.length;b++){let d=a[c-1],e=a[b];d.clock+d.len>=e.clock?a[c-1]=new a5(d.clock,y(d.len,e.clock+e.len-d.clock)):(c<b&&(a[c]=e),c++)}a.length=c})},ba=(a,b,c,d)=>{n(a.clients,b,()=>[]).push(new a5(c,d))},bb=()=>new a6,bc=(a,b)=>{M(a.restEncoder,b.clients.size),r(b.clients.entries()).sort((a,b)=>b[0]-a[0]).forEach(([b,c])=>{a.resetDsCurVal(),M(a.restEncoder,b);let d=c.length;M(a.restEncoder,d);for(let b=0;b<d;b++){let d=c[b];a.writeDsClock(d.clock),a.writeDsLen(d.len)}})},bd=a=>{let b=new a6,c=ak(a.restDecoder);for(let d=0;d<c;d++){a.resetDsCurVal();let c=ak(a.restDecoder),d=ak(a.restDecoder);if(d>0){let e=n(b.clients,c,()=>[]);for(let b=0;b<d;b++)e.push(new a5(a.readDsClock(),a.readDsLen()))}}return b},be=(a,b,c)=>{let d=new a6,e=ak(a.restDecoder);for(let f=0;f<e;f++){a.resetDsCurVal();let e=ak(a.restDecoder),f=ak(a.restDecoder),g=c.clients.get(e)||[],h=bL(c,e);for(let c=0;c<f;c++){let c=a.readDsClock(),f=c+a.readDsLen();if(c<h){h<f&&ba(d,e,h,f-h);let a=bN(g,c),i=g[a];for(!i.deleted&&i.id.clock<c&&(g.splice(a+1,0,de(b,i,c-i.id.clock)),a++);a<g.length;)if((i=g[a++]).id.clock<f)i.deleted||(f<i.id.clock+i.length&&g.splice(a,0,de(b,i,f-i.id.clock)),i.delete(b));else break}else ba(d,e,c,f-c)}}if(d.clients.size>0){let a=new bn;return M(a.restEncoder,0),bc(a,d),a.toUint8Array()}return null};class bf extends t{constructor({guid:a="10000000-1000-4000-8000-100000000000".replace(/[018]/g,a=>(a^aw()&15>>a/4).toString(16)),collectionid:b=null,gc:c=!0,gcFilter:d=()=>!0,meta:e=null,autoLoad:f=!1,shouldLoad:g=!0}={}){super(),this.gc=c,this.gcFilter=d,this.clientID=aw(),this.guid=a,this.collectionid=b,this.share=new Map,this.store=new bJ,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=g,this.autoLoad=f,this.meta=e,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=ax(a=>{this.on("load",()=>{this.isLoaded=!0,a(this)})});let h=()=>ax(a=>{let b=c=>{(void 0===c||!0===c)&&(this.off("sync",b),a())};this.on("sync",b)});this.on("sync",a=>{!1===a&&this.isSynced&&(this.whenSynced=h()),this.isSynced=void 0===a||!0===a,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=h()}load(){let a=this._item;null===a||this.shouldLoad||bY(a.parent.doc,a=>{a.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(r(this.subdocs).map(a=>a.guid))}transact(a,b=null){return bY(this,a,b)}get(a,b=ce){let c=n(this.share,a,()=>{let a=new b;return a._integrate(this,null),a}),d=c.constructor;if(b!==ce&&d!==b)if(d===ce){let d=new b;d._map=c._map,c._map.forEach(a=>{for(;null!==a;a=a.left)a.parent=d}),d._start=c._start;for(let a=d._start;null!==a;a=a.right)a.parent=d;return d._length=c._length,this.share.set(a,d),d._integrate(this,null),d}else throw Error(`Type with the name ${a} has already been defined with a different constructor`);return c}getArray(a=""){return this.get(a,cv)}getText(a=""){return this.get(a,cN)}getMap(a=""){return this.get(a,cx)}getXmlElement(a=""){return this.get(a,cQ)}getXmlFragment(a=""){return this.get(a,cP)}toJSON(){let a={};return this.share.forEach((b,c)=>{a[c]=b.toJSON()}),a}destroy(){this.isDestroyed=!0,r(this.subdocs).forEach(a=>a.destroy());let a=this._item;if(null!==a){this._item=null;let b=a.content;b.doc=new bf({guid:this.guid,...b.opts,shouldLoad:!1}),b.doc._item=a,bY(a.parent.doc,c=>{let d=b.doc;a.deleted||c.subdocsAdded.add(d),c.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class bg{constructor(a){this.restDecoder=a}resetDsCurVal(){}readDsClock(){return ak(this.restDecoder)}readDsLen(){return ak(this.restDecoder)}}class bh extends bg{readLeftID(){return bz(ak(this.restDecoder),ak(this.restDecoder))}readRightID(){return bz(ak(this.restDecoder),ak(this.restDecoder))}readClient(){return ak(this.restDecoder)}readInfo(){return aj(this.restDecoder)}readString(){return am(this.restDecoder)}readParentInfo(){return 1===ak(this.restDecoder)}readTypeRef(){return ak(this.restDecoder)}readLen(){return ak(this.restDecoder)}readAny(){return ap(this.restDecoder)}readBuf(){var a=ai(this.restDecoder);let b=new Uint8Array(a.byteLength);return b.set(a),b}readJSON(){return JSON.parse(am(this.restDecoder))}readKey(){return am(this.restDecoder)}}class bi{constructor(a){this.dsCurrVal=0,this.restDecoder=a}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=ak(this.restDecoder),this.dsCurrVal}readDsLen(){let a=ak(this.restDecoder)+1;return this.dsCurrVal+=a,a}}class bj extends bi{constructor(a){super(a),this.keys=[],ak(a),this.keyClockDecoder=new as(ai(a)),this.clientDecoder=new ar(ai(a)),this.leftClockDecoder=new as(ai(a)),this.rightClockDecoder=new as(ai(a)),this.infoDecoder=new aq(ai(a),aj),this.stringDecoder=new at(ai(a)),this.parentInfoDecoder=new aq(ai(a),aj),this.typeRefDecoder=new ar(ai(a)),this.lenDecoder=new ar(ai(a))}readLeftID(){return new bx(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new bx(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return 1===this.parentInfoDecoder.read()}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return ap(this.restDecoder)}readBuf(){return ai(this.restDecoder)}readJSON(){return ap(this.restDecoder)}readKey(){let a=this.keyClockDecoder.read();if(a<this.keys.length)return this.keys[a];{let a=this.stringDecoder.read();return this.keys.push(a),a}}}class bk{constructor(){this.restEncoder=J()}toUint8Array(){return K(this.restEncoder)}resetDsCurVal(){}writeDsClock(a){M(this.restEncoder,a)}writeDsLen(a){M(this.restEncoder,a)}}class bl extends bk{writeLeftID(a){M(this.restEncoder,a.client),M(this.restEncoder,a.clock)}writeRightID(a){M(this.restEncoder,a.client),M(this.restEncoder,a.clock)}writeClient(a){M(this.restEncoder,a)}writeInfo(a){L(this.restEncoder,a)}writeString(a){Q(this.restEncoder,a)}writeParentInfo(a){M(this.restEncoder,+!!a)}writeTypeRef(a){M(this.restEncoder,a)}writeLen(a){M(this.restEncoder,a)}writeAny(a){V(this.restEncoder,a)}writeBuf(a){S(this.restEncoder,a)}writeJSON(a){Q(this.restEncoder,JSON.stringify(a))}writeKey(a){Q(this.restEncoder,a)}}class bm{constructor(){this.restEncoder=J(),this.dsCurrVal=0}toUint8Array(){return K(this.restEncoder)}resetDsCurVal(){this.dsCurrVal=0}writeDsClock(a){let b=a-this.dsCurrVal;this.dsCurrVal=a,M(this.restEncoder,b)}writeDsLen(a){0===a&&ac(),M(this.restEncoder,a-1),this.dsCurrVal+=a}}class bn extends bm{constructor(){super(),this.keyMap=new Map,this.keyClock=0,this.keyClockEncoder=new $,this.clientEncoder=new Y,this.leftClockEncoder=new $,this.rightClockEncoder=new $,this.infoEncoder=new W(L),this.stringEncoder=new _,this.parentInfoEncoder=new W(L),this.typeRefEncoder=new Y,this.lenEncoder=new Y}toUint8Array(){let a=J();return M(a,0),S(a,this.keyClockEncoder.toUint8Array()),S(a,this.clientEncoder.toUint8Array()),S(a,this.leftClockEncoder.toUint8Array()),S(a,this.rightClockEncoder.toUint8Array()),S(a,K(this.infoEncoder)),S(a,this.stringEncoder.toUint8Array()),S(a,K(this.parentInfoEncoder)),S(a,this.typeRefEncoder.toUint8Array()),S(a,this.lenEncoder.toUint8Array()),R(a,K(this.restEncoder)),K(a)}writeLeftID(a){this.clientEncoder.write(a.client),this.leftClockEncoder.write(a.clock)}writeRightID(a){this.clientEncoder.write(a.client),this.rightClockEncoder.write(a.clock)}writeClient(a){this.clientEncoder.write(a)}writeInfo(a){this.infoEncoder.write(a)}writeString(a){this.stringEncoder.write(a)}writeParentInfo(a){this.parentInfoEncoder.write(+!!a)}writeTypeRef(a){this.typeRefEncoder.write(a)}writeLen(a){this.lenEncoder.write(a)}writeAny(a){V(this.restEncoder,a)}writeBuf(a){S(this.restEncoder,a)}writeJSON(a){V(this.restEncoder,a)}writeKey(a){let b=this.keyMap.get(a);void 0===b?(this.keyClockEncoder.write(this.keyClock++),this.stringEncoder.write(a)):this.keyClockEncoder.write(b)}}let bo=(a,b,c)=>{let d=new Map;c.forEach((a,c)=>{bL(b,c)>a&&d.set(c,a)}),bK(b).forEach((a,b)=>{c.has(b)||d.set(b,0)}),M(a.restEncoder,d.size),r(d.entries()).sort((a,b)=>b[0]-a[0]).forEach(([c,d])=>{((a,b,c,d)=>{d=y(d,b[0].id.clock);let e=bN(b,d);M(a.restEncoder,b.length-e),a.writeClient(c),M(a.restEncoder,d);let f=b[e];f.write(a,d-f.id.clock);for(let c=e+1;c<b.length;c++)b[c].write(a,0)})(a,b.clients.get(c),c,d)})},bp=(a,b,c,d=bj)=>{let e=ag(b);((a,b,c,d=new bj(a))=>bY(b,a=>{a.local=!1;let b=!1,c=a.doc,e=c.store,f=((a,b,c)=>{let d=[],e=r(c.keys()).sort((a,b)=>a-b);if(0===e.length)return null;let f=()=>{if(0===e.length)return null;let a=c.get(e[e.length-1]);for(;a.refs.length===a.i;){if(e.pop(),!(e.length>0))return null;a=c.get(e[e.length-1])}return a},g=f();if(null===g)return null;let h=new bJ,i=new Map,j=(a,b)=>{let c=i.get(a);(null==c||c>b)&&i.set(a,b)},k=g.refs[g.i++],l=new Map,m=()=>{for(let a of d){let b=a.id.client,d=c.get(b);d?(d.i--,h.clients.set(b,d.refs.slice(d.i)),c.delete(b),d.i=0,d.refs=[]):h.clients.set(b,[a]),e=e.filter(a=>a!==b)}d.length=0};for(;;){if(k.constructor!==di){let e=n(l,k.id.client,()=>bL(b,k.id.client))-k.id.clock;if(e<0)d.push(k),j(k.id.client,k.id.clock-1),m();else{let f=k.getMissing(a,b);if(null!==f){d.push(k);let a=c.get(f)||{refs:[],i:0};if(a.refs.length===a.i)j(f,bL(b,f)),m();else{k=a.refs[a.i++];continue}}else(0===e||e<k.length)&&(k.integrate(a,e),l.set(k.id.client,k.id.clock+k.length))}}if(d.length>0)k=d.pop();else if(null!==g&&g.i<g.refs.length)k=g.refs[g.i++];else{if(null===(g=f()))break;k=g.refs[g.i++]}}if(h.clients.size>0){let a=new bn;return bo(a,h,new Map),M(a.restEncoder,0),{missing:i,update:a.toUint8Array()}}return null})(a,e,((a,b)=>{let c=l(),d=ak(a.restDecoder);for(let e=0;e<d;e++){let d=ak(a.restDecoder),e=Array(d),f=a.readClient(),g=ak(a.restDecoder);c.set(f,{i:0,refs:e});for(let c=0;c<d;c++){let d=a.readInfo();switch(31&d){case 0:{let b=a.readLen();e[c]=new cV(bz(f,g),b),g+=b;break}case 10:{let b=ak(a.restDecoder);e[c]=new di(bz(f,g),b),g+=b;break}default:{let h=(192&d)==0,i=new df(bz(f,g),null,(128&d)==128?a.readLeftID():null,null,(64&d)==64?a.readRightID():null,h?a.readParentInfo()?b.get(a.readString()):a.readLeftID():null,h&&(32&d)==32?a.readString():null,dg(a,d));e[c]=i,g+=i.length}}}}return c})(d,c)),g=e.pendingStructs;if(g){for(let[a,c]of g.missing)if(c<bL(e,a)){b=!0;break}if(f){for(let[a,b]of f.missing){let c=g.missing.get(a);(null==c||c>b)&&g.missing.set(a,b)}g.update=b0([g.update,f.update])}}else e.pendingStructs=f;let h=be(d,a,e);if(e.pendingDs){let b=new bj(ag(e.pendingDs));ak(b.restDecoder);let c=be(b,a,e);h&&c?e.pendingDs=b0([h,c]):e.pendingDs=h||c}else e.pendingDs=h;if(b){let b=e.pendingStructs.update;e.pendingStructs=null,bp(a.doc,b)}},c,!1))(e,a,c,new d(e))},bq=a=>(a=>{let b=new Map,c=ak(a.restDecoder);for(let d=0;d<c;d++){let c=ak(a.restDecoder),d=ak(a.restDecoder);b.set(c,d)}return b})(new bg(ag(a))),br=(a,b)=>(M(a.restEncoder,b.size),r(b.entries()).sort((a,b)=>b[0]-a[0]).forEach(([b,c])=>{M(a.restEncoder,b),M(a.restEncoder,c)}),a);class bs{constructor(){this.l=[]}}let bt=()=>new bs,bu=(a,b)=>a.l.push(b),bv=(a,b)=>{let c=a.l,d=c.length;a.l=c.filter(a=>b!==a),d===a.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},bw=(a,b,c)=>aJ(a.l,[b,c]);class bx{constructor(a,b){this.client=a,this.clock=b}}let by=(a,b)=>a===b||null!==a&&null!==b&&a.client===b.client&&a.clock===b.clock,bz=(a,b)=>new bx(a,b),bA=(a,b)=>{M(a,b.client),M(a,b.clock)},bB=a=>bz(ak(a),ak(a)),bC=a=>{for(let[b,c]of a.doc.share.entries())if(c===a)return b;throw ac()};class bD{constructor(a,b,c,d=0){this.type=a,this.tname=b,this.item=c,this.assoc=d}}class bE{constructor(a,b,c=0){this.type=a,this.index=b,this.assoc=c}}let bF=(a,b,c)=>{let d=null,e=null;return null===a._item?e=bC(a):d=bz(a._item.id.client,a._item.id.clock),new bD(d,e,b,c)};class bG{constructor(a,b){this.ds=a,this.sv=b}}new bG(bb(),new Map);let bH=(a,b)=>void 0===b?!a.deleted:b.sv.has(a.id.client)&&(b.sv.get(a.id.client)||0)>a.id.clock&&!a8(b.ds,a.id),bI=(a,b)=>{let c=n(a.meta,bI,o),d=a.doc.store;c.has(b)||(b.sv.forEach((b,c)=>{b<bL(d,c)&&bQ(a,bz(c,b))}),a7(a,b.ds,a=>{}),c.add(b))};class bJ{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}let bK=a=>{let b=new Map;return a.clients.forEach((a,c)=>{let d=a[a.length-1];b.set(c,d.id.clock+d.length)}),b},bL=(a,b)=>{let c=a.clients.get(b);if(void 0===c)return 0;let d=c[c.length-1];return d.id.clock+d.length},bM=(a,b)=>{let c=a.clients.get(b.id.client);if(void 0===c)c=[],a.clients.set(b.id.client,c);else{let a=c[c.length-1];if(a.id.clock+a.length!==b.id.clock)throw ac()}c.push(b)},bN=(a,b)=>{let c=0,d=a.length-1,e=a[d],f=e.id.clock;if(f===b)return d;let g=v(b/(f+e.length-1)*d);for(;c<=d;){if((f=(e=a[g]).id.clock)<=b){if(b<f+e.length)return g;c=g+1}else d=g-1;g=v((c+d)/2)}throw ac()},bO=(a,b)=>{let c=a.clients.get(b.client);return c[bN(c,b.clock)]},bP=(a,b,c)=>{let d=bN(b,c),e=b[d];return e.id.clock<c&&e instanceof df?(b.splice(d+1,0,de(a,e,c-e.id.clock)),d+1):d},bQ=(a,b)=>{let c=a.doc.store.clients.get(b.client);return c[bP(a,c,b.clock)]},bR=(a,b,c)=>{let d=b.clients.get(c.client),e=bN(d,c.clock),f=d[e];return c.clock!==f.id.clock+f.length-1&&f.constructor!==cV&&d.splice(e+1,0,de(a,f,c.clock-f.id.clock+1)),f},bS=(a,b,c,d,e)=>{let f;if(0===d)return;let g=c+d,h=bP(a,b,c);do g<(f=b[h++]).id.clock+f.length&&bP(a,b,g),e(f);while(h<b.length&&b[h].id.clock<g)};class bT{constructor(a,b,c){this.doc=a,this.deleteSet=new a6,this.beforeState=bK(a.store),this.afterState=new Map,this.changed=new Map,this.changedParentTypes=new Map,this._mergeStructs=[],this.origin=b,this.meta=new Map,this.local=c,this.subdocsAdded=new Set,this.subdocsRemoved=new Set,this.subdocsLoaded=new Set,this._needFormattingCleanup=!1}}let bU=(a,b)=>(0!==b.deleteSet.clients.size||!!((a,b)=>{for(let[c,d]of a)if(b(d,c))return!0;return!1})(b.afterState,(a,c)=>b.beforeState.get(c)!==a))&&(a9(b.deleteSet),((a,b)=>bo(a,b.doc.store,b.beforeState))(a,b),bc(a,b.deleteSet),!0),bV=(a,b,c)=>{let d=b._item;(null===d||d.id.clock<(a.beforeState.get(d.id.client)||0)&&!d.deleted)&&n(a.changed,b,o).add(c)},bW=(a,b)=>{let c=a[b],d=a[b-1],e=b;for(;e>0;c=d,d=a[--e-1]){if(d.deleted===c.deleted&&d.constructor===c.constructor&&d.mergeWith(c)){c instanceof df&&null!==c.parentSub&&c.parent._map.get(c.parentSub)===c&&c.parent._map.set(c.parentSub,d);continue}break}let f=b-e;return f&&a.splice(b+1-f,f),f},bX=(a,b)=>{if(b<a.length){let c=a[b],d=c.doc,e=d.store,f=c.deleteSet,g=c._mergeStructs;try{a9(f),c.afterState=bK(c.doc.store),d.emit("beforeObserverCalls",[c,d]);let a=[];c.changed.forEach((b,d)=>a.push(()=>{null!==d._item&&d._item.deleted||d._callObserver(c,b)})),a.push(()=>{c.changedParentTypes.forEach((b,d)=>{d._dEH.l.length>0&&(null===d._item||!d._item.deleted)&&((b=b.filter(a=>null===a.target._item||!a.target._item.deleted)).forEach(a=>{a.currentTarget=d,a._path=null}),b.sort((a,b)=>a.path.length-b.path.length),a.push(()=>{bw(d._dEH,b,c)}))}),a.push(()=>d.emit("afterTransaction",[c,d])),a.push(()=>{c._needFormattingCleanup&&cK(c)})}),aJ(a,[])}finally{d.gc&&((a,b,c)=>{for(let[d,e]of a.clients.entries()){let a=b.clients.get(d);for(let d=e.length-1;d>=0;d--){let f=e[d],g=f.clock+f.len;for(let d=bN(a,f.clock),e=a[d];d<a.length&&e.id.clock<g;e=a[++d]){let e=a[d];if(f.clock+f.len<=e.id.clock)break;e instanceof df&&e.deleted&&!e.keep&&c(e)&&e.gc(b,!1)}}}})(f,e,d.gcFilter),f.clients.forEach((a,b)=>{let c=e.clients.get(b);for(let b=a.length-1;b>=0;b--){let d=a[b],e=x(c.length-1,1+bN(c,d.clock+d.len-1));for(let a=e,b=c[a];a>0&&b.id.clock>=d.clock;b=c[a])a-=1+bW(c,a)}}),c.afterState.forEach((a,b)=>{let d=c.beforeState.get(b)||0;if(d!==a){let a=e.clients.get(b),c=y(bN(a,d),1);for(let b=a.length-1;b>=c;)b-=1+bW(a,b)}});for(let a=g.length-1;a>=0;a--){let{client:b,clock:c}=g[a].id,d=e.clients.get(b),f=bN(d,c);!(f+1<d.length&&bW(d,f+1)>1)&&f>0&&bW(d,f)}if(c.local||c.afterState.get(d.clientID)===c.beforeState.get(d.clientID)||(((...a)=>{console.log(...a2(a))})(a_,aU,"[yjs] ",aV,aZ,"Changed the client-id because another client seems to be using it."),d.clientID=aw()),d.emit("afterTransactionCleanup",[c,d]),d._observers.has("update")){let a=new bl;bU(a,c)&&d.emit("update",[a.toUint8Array(),c.origin,d,c])}if(d._observers.has("updateV2")){let a=new bn;bU(a,c)&&d.emit("updateV2",[a.toUint8Array(),c.origin,d,c])}let{subdocsAdded:h,subdocsLoaded:i,subdocsRemoved:j}=c;(h.size>0||j.size>0||i.size>0)&&(h.forEach(a=>{a.clientID=d.clientID,null==a.collectionid&&(a.collectionid=d.collectionid),d.subdocs.add(a)}),j.forEach(a=>d.subdocs.delete(a)),d.emit("subdocs",[{loaded:i,added:h,removed:j},d,c]),j.forEach(a=>a.destroy())),a.length<=b+1?(d._transactionCleanups=[],d.emit("afterAllTransactions",[d,a])):bX(a,b+1)}}},bY=(a,b,c=null,d=!0)=>{let e=a._transactionCleanups,f=!1,g=null;null===a._transaction&&(f=!0,a._transaction=new bT(a,c,d),e.push(a._transaction),1===e.length&&a.emit("beforeAllTransactions",[a]),a.emit("beforeTransaction",[a._transaction,a]));try{g=b(a._transaction)}finally{if(f){let b=a._transaction===e[0];a._transaction=null,b&&bX(e,0)}}return g};class bZ{constructor(a,b){this.gen=function*(a){let b=ak(a.restDecoder);for(let c=0;c<b;c++){let b=ak(a.restDecoder),c=a.readClient(),d=ak(a.restDecoder);for(let e=0;e<b;e++){let b=a.readInfo();if(10===b){let b=ak(a.restDecoder);yield new di(bz(c,d),b),d+=b}else if((31&b)!=0){let e=(192&b)==0,f=new df(bz(c,d),null,(128&b)==128?a.readLeftID():null,null,(64&b)==64?a.readRightID():null,e?a.readParentInfo()?a.readString():a.readLeftID():null,e&&(32&b)==32?a.readString():null,dg(a,b));yield f,d+=f.length}else{let b=a.readLen();yield new cV(bz(c,d),b),d+=b}}}}(a),this.curr=null,this.done=!1,this.filterSkips=b,this.next()}next(){do this.curr=this.gen.next().value||null;while(this.filterSkips&&null!==this.curr&&this.curr.constructor===di);return this.curr}}class b${constructor(a){this.currClient=0,this.startClock=0,this.written=0,this.encoder=a,this.clientStructs=[]}}let b_=(a,b)=>{if(a.constructor===cV){let{client:c,clock:d}=a.id;return new cV(bz(c,d+b),a.length-b)}if(a.constructor===di){let{client:c,clock:d}=a.id;return new di(bz(c,d+b),a.length-b)}{let{client:c,clock:d}=a.id;return new df(bz(c,d+b),null,bz(c,d+b-1),null,a.rightOrigin,a.parent,a.parentSub,a.content.splice(b))}},b0=(a,b=bj,c=bn)=>{if(1===a.length)return a[0];let d=a.map(a=>new b(ag(a))),e=d.map(a=>new bZ(a,!0)),f=null,g=new c,h=new b$(g);for(;(e=e.filter(a=>null!==a.curr)).sort((a,b)=>{if(a.curr.id.client!==b.curr.id.client)return b.curr.id.client-a.curr.id.client;{let c=a.curr.id.clock-b.curr.id.clock;return 0===c?a.curr.constructor===b.curr.constructor?0:a.curr.constructor===di?1:-1:c}}),0!==e.length;){let a=e[0],b=a.curr.id.client;if(null!==f){let c=a.curr,d=!1;for(;null!==c&&c.id.clock+c.length<=f.struct.id.clock+f.struct.length&&c.id.client>=f.struct.id.client;)c=a.next(),d=!0;if(null===c||c.id.client!==b||d&&c.id.clock>f.struct.id.clock+f.struct.length)continue;if(b!==f.struct.id.client)b2(h,f.struct,f.offset),f={struct:c,offset:0},a.next();else if(f.struct.id.clock+f.struct.length<c.id.clock)if(f.struct.constructor===di)f.struct.length=c.id.clock+c.length-f.struct.id.clock;else{b2(h,f.struct,f.offset);let a=c.id.clock-f.struct.id.clock-f.struct.length;f={struct:new di(bz(b,f.struct.id.clock+f.struct.length),a),offset:0}}else{let b=f.struct.id.clock+f.struct.length-c.id.clock;b>0&&(f.struct.constructor===di?f.struct.length-=b:c=b_(c,b)),f.struct.mergeWith(c)||(b2(h,f.struct,f.offset),f={struct:c,offset:0},a.next())}}else f={struct:a.curr,offset:0},a.next();for(let c=a.curr;null!==c&&c.id.client===b&&c.id.clock===f.struct.id.clock+f.struct.length&&c.constructor!==di;c=a.next())b2(h,f.struct,f.offset),f={struct:c,offset:0}}return null!==f&&(b2(h,f.struct,f.offset),f=null),b3(h),bc(g,(a=>{let b=new a6;for(let c=0;c<a.length;c++)a[c].clients.forEach((d,e)=>{if(!b.clients.has(e)){let f=d.slice();for(let b=c+1;b<a.length;b++)q(f,a[b].clients.get(e)||[]);b.clients.set(e,f)}});return a9(b),b})(d.map(a=>bd(a)))),g.toUint8Array()},b1=a=>{a.written>0&&(a.clientStructs.push({written:a.written,restEncoder:K(a.encoder.restEncoder)}),a.encoder.restEncoder=J(),a.written=0)},b2=(a,b,c)=>{a.written>0&&a.currClient!==b.id.client&&b1(a),0===a.written&&(a.currClient=b.id.client,a.encoder.writeClient(b.id.client),M(a.encoder.restEncoder,b.id.clock+c)),b.write(a.encoder,c),a.written++},b3=a=>{b1(a);let b=a.encoder.restEncoder;M(b,a.clientStructs.length);for(let c=0;c<a.clientStructs.length;c++){let d=a.clientStructs[c];M(b,d.written),R(b,d.restEncoder)}},b4="You must not compute changes after the event-handler fired.";class b5{constructor(a,b){this.target=a,this.currentTarget=a,this.transaction=b,this._changes=null,this._keys=null,this._delta=null,this._path=null}get path(){return this._path||(this._path=b6(this.currentTarget,this.target))}deletes(a){return a8(this.transaction.deleteSet,a.id)}get keys(){if(null===this._keys){if(0===this.transaction.doc._transactionCleanups.length)throw aa(b4);let a=new Map,b=this.target;this.transaction.changed.get(b).forEach(c=>{if(null!==c){let d,e,f=b._map.get(c);if(this.adds(f)){let a=f.left;for(;null!==a&&this.adds(a);)a=a.left;if(this.deletes(f))if(!(null!==a&&this.deletes(a)))return;else d="delete",e=p(a.content.getContent());else null!==a&&this.deletes(a)?(d="update",e=p(a.content.getContent())):(d="add",e=void 0)}else{if(!this.deletes(f))return;d="delete",e=p(f.content.getContent())}a.set(c,{action:d,oldValue:e})}}),this._keys=a}return this._keys}get delta(){return this.changes.delta}adds(a){return a.id.clock>=(this.transaction.beforeState.get(a.id.client)||0)}get changes(){let a=this._changes;if(null===a){if(0===this.transaction.doc._transactionCleanups.length)throw aa(b4);let b=this.target,c=o(),d=o(),e=[];if(a={added:c,deleted:d,delta:e,keys:this.keys},this.transaction.changed.get(b).has(null)){let a=null,f=()=>{a&&e.push(a)};for(let e=b._start;null!==e;e=e.right)e.deleted?this.deletes(e)&&!this.adds(e)&&((null===a||void 0===a.delete)&&(f(),a={delete:0}),a.delete+=e.length,d.add(e)):this.adds(e)?((null===a||void 0===a.insert)&&(f(),a={insert:[]}),a.insert=a.insert.concat(e.content.getContent()),c.add(e)):((null===a||void 0===a.retain)&&(f(),a={retain:0}),a.retain+=e.length);null!==a&&void 0===a.retain&&f()}this._changes=a}return a}}let b6=(a,b)=>{let c=[];for(;null!==b._item&&b!==a;){if(null!==b._item.parentSub)c.unshift(b._item.parentSub);else{let a=0,d=b._item.parent._start;for(;d!==b._item&&null!==d;)!d.deleted&&d.countable&&(a+=d.length),d=d.right;c.unshift(a)}b=b._item.parent}return c},b7=()=>{((...a)=>{console.warn(...a2(a))})("Invalid access: Add Yjs type to a document before reading data.")},b8=0;class b9{constructor(a,b){a.marker=!0,this.p=a,this.index=b,this.timestamp=b8++}}let ca=(a,b,c)=>{a.p.marker=!1,a.p=b,b.marker=!0,a.index=c,a.timestamp=b8++},cb=(a,b)=>{if(null===a._start||0===b||null===a._searchMarker)return null;let c=0===a._searchMarker.length?null:a._searchMarker.reduce((a,c)=>w(b-a.index)<w(b-c.index)?a:c),d=a._start,e=0;for(null!==c&&(d=c.p,e=c.index,c.timestamp=b8++);null!==d.right&&e<b;){if(!d.deleted&&d.countable){if(b<e+d.length)break;e+=d.length}d=d.right}for(;null!==d.left&&e>b;)!(d=d.left).deleted&&d.countable&&(e-=d.length);for(;null!==d.left&&d.left.id.client===d.id.client&&d.left.id.clock+d.left.length===d.id.clock;)!(d=d.left).deleted&&d.countable&&(e-=d.length);return null!==c&&w(c.index-e)<d.parent.length/80?(ca(c,d,e),c):((a,b,c)=>{if(a.length>=80){let d=a.reduce((a,b)=>a.timestamp<b.timestamp?a:b);return ca(d,b,c),d}{let d=new b9(b,c);return a.push(d),d}})(a._searchMarker,d,e)},cc=(a,b,c)=>{for(let d=a.length-1;d>=0;d--){let e=a[d];if(c>0){let b=e.p;for(b.marker=!1;b&&(b.deleted||!b.countable);)(b=b.left)&&!b.deleted&&b.countable&&(e.index-=b.length);if(null===b||!0===b.marker){a.splice(d,1);continue}e.p=b,b.marker=!0}(b<e.index||c>0&&b===e.index)&&(e.index=y(b,e.index+c))}},cd=(a,b,c)=>{let d=a,e=b.changedParentTypes;for(;n(e,a,()=>[]).push(c),null!==a._item;)a=a._item.parent;bw(d._eH,c,b)};class ce{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=bt(),this._dEH=bt(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(a,b){this.doc=a,this._item=b}_copy(){throw ab()}clone(){throw ab()}_write(a){}get _first(){let a=this._start;for(;null!==a&&a.deleted;)a=a.right;return a}_callObserver(a,b){!a.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(a){bu(this._eH,a)}observeDeep(a){bu(this._dEH,a)}unobserve(a){bv(this._eH,a)}unobserveDeep(a){bv(this._dEH,a)}toJSON(){}}let cf=(a,b,c)=>{a.doc??b7(),b<0&&(b=a._length+b),c<0&&(c=a._length+c);let d=c-b,e=[],f=a._start;for(;null!==f&&d>0;){if(f.countable&&!f.deleted){let a=f.content.getContent();if(a.length<=b)b-=a.length;else{for(let c=b;c<a.length&&d>0;c++)e.push(a[c]),d--;b=0}}f=f.right}return e},cg=a=>{a.doc??b7();let b=[],c=a._start;for(;null!==c;){if(c.countable&&!c.deleted){let a=c.content.getContent();for(let c=0;c<a.length;c++)b.push(a[c])}c=c.right}return b},ch=(a,b)=>{let c=0,d=a._start;for(a.doc??b7();null!==d;){if(d.countable&&!d.deleted){let e=d.content.getContent();for(let d=0;d<e.length;d++)b(e[d],c++,a)}d=d.right}},ci=(a,b)=>{let c=[];return ch(a,(d,e)=>{c.push(b(d,e,a))}),c},cj=(a,b)=>{a.doc??b7();let c=cb(a,b),d=a._start;for(null!==c&&(d=c.p,b-=c.index);null!==d;d=d.right)if(!d.deleted&&d.countable){if(b<d.length)return d.content.getContent()[b];b-=d.length}},ck=(a,b,c,d)=>{let e=c,f=a.doc,g=f.clientID,h=f.store,i=null===c?b._start:c.right,j=[],k=()=>{j.length>0&&((e=new df(bz(g,bL(h,g)),e,e&&e.lastId,i,i&&i.id,b,null,new c2(j))).integrate(a,0),j=[])};d.forEach(c=>{if(null===c)j.push(c);else switch(c.constructor){case Number:case Object:case Boolean:case Array:case String:j.push(c);break;default:switch(k(),c.constructor){case Uint8Array:case ArrayBuffer:(e=new df(bz(g,bL(h,g)),e,e&&e.lastId,i,i&&i.id,b,null,new cW(new Uint8Array(c)))).integrate(a,0);break;case bf:(e=new df(bz(g,bL(h,g)),e,e&&e.lastId,i,i&&i.id,b,null,new cZ(c))).integrate(a,0);break;default:if(c instanceof ce)(e=new df(bz(g,bL(h,g)),e,e&&e.lastId,i,i&&i.id,b,null,new dc(c))).integrate(a,0);else throw Error("Unexpected content type in insert operation")}}}),k()},cl=()=>aa("Length exceeded!"),cm=(a,b,c,d)=>{if(c>b._length)throw cl();if(0===c)return b._searchMarker&&cc(b._searchMarker,c,d.length),ck(a,b,null,d);let e=c,f=cb(b,c),g=b._start;for(null!==f&&(g=f.p,0==(c-=f.index)&&(c+=(g=g.prev)&&g.countable&&!g.deleted?g.length:0));null!==g;g=g.right)if(!g.deleted&&g.countable){if(c<=g.length){c<g.length&&bQ(a,bz(g.id.client,g.id.clock+c));break}c-=g.length}return b._searchMarker&&cc(b._searchMarker,e,d.length),ck(a,b,g,d)},cn=(a,b,c,d)=>{if(0===d)return;let e=c,f=d,g=cb(b,c),h=b._start;for(null!==g&&(h=g.p,c-=g.index);null!==h&&c>0;h=h.right)!h.deleted&&h.countable&&(c<h.length&&bQ(a,bz(h.id.client,h.id.clock+c)),c-=h.length);for(;d>0&&null!==h;)h.deleted||(d<h.length&&bQ(a,bz(h.id.client,h.id.clock+d)),h.delete(a),d-=h.length),h=h.right;if(d>0)throw cl();b._searchMarker&&cc(b._searchMarker,e,-f+d)},co=(a,b,c)=>{let d=b._map.get(c);void 0!==d&&d.delete(a)},cp=(a,b,c,d)=>{let e,f=b._map.get(c)||null,g=a.doc,h=g.clientID;if(null==d)e=new c2([d]);else switch(d.constructor){case Number:case Object:case Boolean:case Array:case String:case Date:case BigInt:e=new c2([d]);break;case Uint8Array:e=new cW(d);break;case bf:e=new cZ(d);break;default:if(d instanceof ce)e=new dc(d);else throw Error("Unexpected content type")}new df(bz(h,bL(g.store,h)),f,f&&f.lastId,null,null,b,c,e).integrate(a,0)},cq=(a,b)=>{a.doc??b7();let c=a._map.get(b);return void 0===c||c.deleted?void 0:c.content.getContent()[c.length-1]},cr=a=>{let b={};return a.doc??b7(),a._map.forEach((a,c)=>{a.deleted||(b[c]=a.content.getContent()[a.length-1])}),b},cs=(a,b)=>{a.doc??b7();let c=a._map.get(b);return void 0!==c&&!c.deleted},ct=a=>{let b,c;return a.doc??b7(),b=a._map.entries(),c=a=>!a[1].deleted,a3(()=>{let a;do a=b.next();while(!a.done&&!c(a.value));return a})};class cu extends b5{}class cv extends ce{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(a){let b=new cv;return b.push(a),b}_integrate(a,b){super._integrate(a,b),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new cv}clone(){let a=new cv;return a.insert(0,this.toArray().map(a=>a instanceof ce?a.clone():a)),a}get length(){return this.doc??b7(),this._length}_callObserver(a,b){super._callObserver(a,b),cd(this,a,new cu(this,a))}insert(a,b){null!==this.doc?bY(this.doc,c=>{cm(c,this,a,b)}):this._prelimContent.splice(a,0,...b)}push(a){null!==this.doc?bY(this.doc,b=>{((a,b,c)=>{let d=(b._searchMarker||[]).reduce((a,b)=>b.index>a.index?b:a,{index:0,p:b._start}).p;if(d)for(;d.right;)d=d.right;return ck(a,b,d,c)})(b,this,a)}):this._prelimContent.push(...a)}unshift(a){this.insert(0,a)}delete(a,b=1){null!==this.doc?bY(this.doc,c=>{cn(c,this,a,b)}):this._prelimContent.splice(a,b)}get(a){return cj(this,a)}toArray(){return cg(this)}slice(a=0,b=this.length){return cf(this,a,b)}toJSON(){return this.map(a=>a instanceof ce?a.toJSON():a)}map(a){return ci(this,a)}forEach(a){ch(this,a)}[Symbol.iterator](){let a,b,c;return a=this._start,b=null,c=0,{[Symbol.iterator](){return this},next:()=>{if(null===b){for(;null!==a&&a.deleted;)a=a.right;if(null===a)return{done:!0,value:void 0};b=a.content.getContent(),c=0,a=a.right}let d=b[c++];return b.length<=c&&(b=null),{done:!1,value:d}}}}_write(a){a.writeTypeRef(c5)}}class cw extends b5{constructor(a,b,c){super(a,b),this.keysChanged=c}}class cx extends ce{constructor(a){super(),this._prelimContent=null,void 0===a?this._prelimContent=new Map:this._prelimContent=new Map(a)}_integrate(a,b){super._integrate(a,b),this._prelimContent.forEach((a,b)=>{this.set(b,a)}),this._prelimContent=null}_copy(){return new cx}clone(){let a=new cx;return this.forEach((b,c)=>{a.set(c,b instanceof ce?b.clone():b)}),a}_callObserver(a,b){cd(this,a,new cw(this,a,b))}toJSON(){this.doc??b7();let a={};return this._map.forEach((b,c)=>{if(!b.deleted){let d=b.content.getContent()[b.length-1];a[c]=d instanceof ce?d.toJSON():d}}),a}get size(){return[...ct(this)].length}keys(){return a4(ct(this),a=>a[0])}values(){return a4(ct(this),a=>a[1].content.getContent()[a[1].length-1])}entries(){return a4(ct(this),a=>[a[0],a[1].content.getContent()[a[1].length-1]])}forEach(a){this.doc??b7(),this._map.forEach((b,c)=>{b.deleted||a(b.content.getContent()[b.length-1],c,this)})}[Symbol.iterator](){return this.entries()}delete(a){null!==this.doc?bY(this.doc,b=>{co(b,this,a)}):this._prelimContent.delete(a)}set(a,b){return null!==this.doc?bY(this.doc,c=>{cp(c,this,a,b)}):this._prelimContent.set(a,b),b}get(a){return cq(this,a)}has(a){return cs(this,a)}clear(){null!==this.doc?bY(this.doc,a=>{this.forEach(function(b,c,d){co(a,d,c)})}):this._prelimContent.clear()}_write(a){a.writeTypeRef(c6)}}let cy=(a,b)=>a===b||"object"==typeof a&&"object"==typeof b&&a&&b&&((a,b)=>a===b||aF(a)===aF(b)&&((a,b)=>{for(let c in a)if(!b(a[c],c))return!1;return!0})(a,(a,c)=>(void 0!==a||aG(b,c))&&((a,b)=>a===b||!!a?.[aC]?.(b))(b[c],a)))(a,b);class cz{constructor(a,b,c,d){this.left=a,this.right=b,this.index=c,this.currentAttributes=d}forward(){null===this.right&&ac(),this.right.content.constructor===c_?this.right.deleted||cD(this.currentAttributes,this.right.content):this.right.deleted||(this.index+=this.right.length),this.left=this.right,this.right=this.right.right}}let cA=(a,b,c)=>{for(;null!==b.right&&c>0;)b.right.content.constructor===c_?b.right.deleted||cD(b.currentAttributes,b.right.content):b.right.deleted||(c<b.right.length&&bQ(a,bz(b.right.id.client,b.right.id.clock+c)),b.index+=b.right.length,c-=b.right.length),b.left=b.right,b.right=b.right.right;return b},cB=(a,b,c,d)=>{let e=new Map,f=d?cb(b,c):null;return f?cA(a,new cz(f.p.left,f.p,f.index,e),c-f.index):cA(a,new cz(null,b._start,0,e),c)},cC=(a,b,c,d)=>{for(;null!==c.right&&(!0===c.right.deleted||c.right.content.constructor===c_&&cy(d.get(c.right.content.key),c.right.content.value));)c.right.deleted||d.delete(c.right.content.key),c.forward();let e=a.doc,f=e.clientID;d.forEach((d,g)=>{let h=c.left,i=c.right,j=new df(bz(f,bL(e.store,f)),h,h&&h.lastId,i,i&&i.id,b,null,new c_(g,d));j.integrate(a,0),c.right=j,c.forward()})},cD=(a,b)=>{let{key:c,value:d}=b;null===d?a.delete(c):a.set(c,d)},cE=(a,b)=>{for(;null!==a.right&&(a.right.deleted||a.right.content.constructor===c_&&cy(b[a.right.content.key]??null,a.right.content.value));){;a.forward()}},cF=(a,b,c,d)=>{let e=a.doc,f=e.clientID,g=new Map;for(let h in d){let i=d[h],j=c.currentAttributes.get(h)??null;if(!cy(j,i)){g.set(h,j);let{left:d,right:k}=c;c.right=new df(bz(f,bL(e.store,f)),d,d&&d.lastId,k,k&&k.id,b,null,new c_(h,i)),c.right.integrate(a,0),c.forward()}}return g},cG=(a,b,c,d,e)=>{c.currentAttributes.forEach((a,b)=>{void 0===e[b]&&(e[b]=null)});let f=a.doc,g=f.clientID;cE(c,e);let h=cF(a,b,c,e),i=d.constructor===String?new c3(d):d instanceof ce?new dc(d):new c$(d),{left:j,right:k,index:l}=c;b._searchMarker&&cc(b._searchMarker,c.index,i.getLength()),(k=new df(bz(g,bL(f.store,g)),j,j&&j.lastId,k,k&&k.id,b,null,i)).integrate(a,0),c.right=k,c.index=l,c.forward(),cC(a,b,c,h)},cH=(a,b,c,d,e)=>{let f=a.doc,g=f.clientID;cE(c,e);let h=cF(a,b,c,e);for(;null!==c.right&&(d>0||h.size>0&&(c.right.deleted||c.right.content.constructor===c_));){if(!c.right.deleted)if(c.right.content.constructor===c_){let{key:b,value:f}=c.right.content,g=e[b];if(void 0!==g){if(cy(g,f))h.delete(b);else{if(0===d)break;h.set(b,f)}c.right.delete(a)}else c.currentAttributes.set(b,f)}else d<c.right.length&&bQ(a,bz(c.right.id.client,c.right.id.clock+d)),d-=c.right.length;c.forward()}if(d>0){let e="";for(;d>0;d--)e+="\n";c.right=new df(bz(g,bL(f.store,g)),c.left,c.left&&c.left.lastId,c.right,c.right&&c.right.id,b,null,new c3(e)),c.right.integrate(a,0),c.forward()}cC(a,b,c,h)},cI=(a,b,c,d,e)=>{let f=b,g=l();for(;f&&(!f.countable||f.deleted);){if(!f.deleted&&f.content.constructor===c_){let a=f.content;g.set(a.key,a)}f=f.right}let h=0,i=!1;for(;b!==f;){if(c===b&&(i=!0),!b.deleted){let c=b.content;if(c.constructor===c_){let{key:f,value:j}=c,k=d.get(f)??null;(g.get(f)!==c||k===j)&&(b.delete(a),h++,i||(e.get(f)??null)!==j||k===j||(null===k?e.delete(f):e.set(f,k))),i||b.deleted||cD(e,c)}}b=b.right}return h},cJ=a=>{let b=0;return bY(a.doc,c=>{let d=a._start,e=a._start,f=l(),g=m(f);for(;e;)!1===e.deleted&&(e.content.constructor===c_?cD(g,e.content):(b+=cI(c,d,e,f,g),f=m(g),d=e)),e=e.right}),b},cK=a=>{let b=new Set,c=a.doc;for(let[d,e]of a.afterState.entries()){let f=a.beforeState.get(d)||0;e!==f&&bS(a,c.store.clients.get(d),f,e,a=>{a.deleted||a.content.constructor!==c_||a.constructor===cV||b.add(a.parent)})}bY(c,c=>{for(let d of(a7(a,a.deleteSet,a=>{if(a instanceof cV||!a.parent._hasFormatting||b.has(a.parent))return;let d=a.parent;a.content.constructor===c_?b.add(d):((a,b)=>{for(;b&&b.right&&(b.right.deleted||!b.right.countable);)b=b.right;let c=new Set;for(;b&&(b.deleted||!b.countable);){if(!b.deleted&&b.content.constructor===c_){let d=b.content.key;c.has(d)?b.delete(a):c.add(d)}b=b.left}})(c,a)}),b))cJ(d)})},cL=(a,b,c)=>{let d=c,e=m(b.currentAttributes),f=b.right;for(;c>0&&null!==b.right;){if(!1===b.right.deleted)switch(b.right.content.constructor){case dc:case c$:case c3:c<b.right.length&&bQ(a,bz(b.right.id.client,b.right.id.clock+c)),c-=b.right.length,b.right.delete(a)}b.forward()}f&&cI(a,f,b.right,e,b.currentAttributes);let g=(b.left||b.right).parent;return g._searchMarker&&cc(g._searchMarker,b.index,-d+c),b};class cM extends b5{constructor(a,b,c){super(a,b),this.childListChanged=!1,this.keysChanged=new Set,c.forEach(a=>{null===a?this.childListChanged=!0:this.keysChanged.add(a)})}get changes(){if(null===this._changes){let a={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=a}return this._changes}get delta(){if(null===this._delta){let a=this.target.doc,b=[];bY(a,a=>{let c=new Map,d=new Map,e=this.target._start,f=null,g={},h="",i=0,j=0,k=()=>{if(null!==f){let a=null;switch(f){case"delete":j>0&&(a={delete:j}),j=0;break;case"insert":("object"==typeof h||h.length>0)&&(a={insert:h},c.size>0&&(a.attributes={},c.forEach((b,c)=>{null!==b&&(a.attributes[c]=b)}))),h="";break;case"retain":i>0&&(a={retain:i},(a=>{for(let b in a)return!1;return!0})(g)||(a.attributes=aD({},g))),i=0}a&&b.push(a),f=null}};for(;null!==e;){switch(e.content.constructor){case dc:case c$:this.adds(e)?this.deletes(e)||(k(),f="insert",h=e.content.getContent()[0],k()):this.deletes(e)?("delete"!==f&&(k(),f="delete"),j+=1):e.deleted||("retain"!==f&&(k(),f="retain"),i+=1);break;case c3:this.adds(e)?this.deletes(e)||("insert"!==f&&(k(),f="insert"),h+=e.content.str):this.deletes(e)?("delete"!==f&&(k(),f="delete"),j+=e.length):e.deleted||("retain"!==f&&(k(),f="retain"),i+=e.length);break;case c_:{let{key:b,value:h}=e.content;if(this.adds(e))this.deletes(e)||(cy(c.get(b)??null,h)?null!==h&&e.delete(a):("retain"===f&&k(),cy(h,d.get(b)??null)?delete g[b]:g[b]=h));else if(this.deletes(e)){d.set(b,h);let a=c.get(b)??null;cy(a,h)||("retain"===f&&k(),g[b]=a)}else if(!e.deleted){d.set(b,h);let c=g[b];void 0!==c&&(cy(c,h)?null!==c&&e.delete(a):("retain"===f&&k(),null===h?delete g[b]:g[b]=h))}e.deleted||("insert"===f&&k(),cD(c,e.content))}}e=e.right}for(k();b.length>0;){let a=b[b.length-1];if(void 0!==a.retain&&void 0===a.attributes)b.pop();else break}}),this._delta=b}return this._delta}}class cN extends ce{constructor(a){super(),this._pending=void 0!==a?[()=>this.insert(0,a)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??b7(),this._length}_integrate(a,b){super._integrate(a,b);try{this._pending.forEach(a=>a())}catch(a){console.error(a)}this._pending=null}_copy(){return new cN}clone(){let a=new cN;return a.applyDelta(this.toDelta()),a}_callObserver(a,b){super._callObserver(a,b);let c=new cM(this,a,b);cd(this,a,c),!a.local&&this._hasFormatting&&(a._needFormattingCleanup=!0)}toString(){this.doc??b7();let a="",b=this._start;for(;null!==b;)!b.deleted&&b.countable&&b.content.constructor===c3&&(a+=b.content.str),b=b.right;return a}toJSON(){return this.toString()}applyDelta(a,{sanitize:b=!0}={}){null!==this.doc?bY(this.doc,c=>{let d=new cz(null,this._start,0,new Map);for(let e=0;e<a.length;e++){let f=a[e];if(void 0!==f.insert){let g=b||"string"!=typeof f.insert||e!==a.length-1||null!==d.right||"\n"!==f.insert.slice(-1)?f.insert:f.insert.slice(0,-1);("string"!=typeof g||g.length>0)&&cG(c,this,d,g,f.attributes||{})}else void 0!==f.retain?cH(c,this,d,f.retain,f.attributes||{}):void 0!==f.delete&&cL(c,d,f.delete)}}):this._pending.push(()=>this.applyDelta(a))}toDelta(a,b,c){this.doc??b7();let d=[],e=new Map,f=this.doc,g="",h=this._start;function i(){if(g.length>0){let a={},b=!1;e.forEach((c,d)=>{b=!0,a[d]=c});let c={insert:g};b&&(c.attributes=a),d.push(c),g=""}}let j=()=>{for(;null!==h;){if(bH(h,a)||void 0!==b&&bH(h,b))switch(h.content.constructor){case c3:{let d=e.get("ychange");void 0===a||bH(h,a)?void 0===b||bH(h,b)?void 0!==d&&(i(),e.delete("ychange")):(void 0===d||d.user!==h.id.client||"added"!==d.type)&&(i(),e.set("ychange",c?c("added",h.id):{type:"added"})):(void 0===d||d.user!==h.id.client||"removed"!==d.type)&&(i(),e.set("ychange",c?c("removed",h.id):{type:"removed"})),g+=h.content.str;break}case dc:case c$:{i();let a={insert:h.content.getContent()[0]};if(e.size>0){let b={};a.attributes=b,e.forEach((a,c)=>{b[c]=a})}d.push(a);break}case c_:bH(h,a)&&(i(),cD(e,h.content))}h=h.right}i()};return a||b?bY(f,c=>{a&&bI(c,a),b&&bI(c,b),j()},"cleanup"):j(),d}insert(a,b,c){if(b.length<=0)return;let d=this.doc;null!==d?bY(d,d=>{let e=cB(d,this,a,!c);c||(c={},e.currentAttributes.forEach((a,b)=>{c[b]=a})),cG(d,this,e,b,c)}):this._pending.push(()=>this.insert(a,b,c))}insertEmbed(a,b,c){let d=this.doc;null!==d?bY(d,d=>{let e=cB(d,this,a,!c);cG(d,this,e,b,c||{})}):this._pending.push(()=>this.insertEmbed(a,b,c||{}))}delete(a,b){if(0===b)return;let c=this.doc;null!==c?bY(c,c=>{cL(c,cB(c,this,a,!0),b)}):this._pending.push(()=>this.delete(a,b))}format(a,b,c){if(0===b)return;let d=this.doc;null!==d?bY(d,d=>{let e=cB(d,this,a,!1);null!==e.right&&cH(d,this,e,b,c)}):this._pending.push(()=>this.format(a,b,c))}removeAttribute(a){null!==this.doc?bY(this.doc,b=>{co(b,this,a)}):this._pending.push(()=>this.removeAttribute(a))}setAttribute(a,b){null!==this.doc?bY(this.doc,c=>{cp(c,this,a,b)}):this._pending.push(()=>this.setAttribute(a,b))}getAttribute(a){return cq(this,a)}getAttributes(){return cr(this)}_write(a){a.writeTypeRef(c7)}}class cO{constructor(a,b=()=>!0){this._filter=b,this._root=a,this._currentNode=a._start,this._firstCall=!0,a.doc??b7()}[Symbol.iterator](){return this}next(){let a=this._currentNode,b=a&&a.content&&a.content.type;if(null!==a&&(!this._firstCall||a.deleted||!this._filter(b)))do if(b=a.content.type,a.deleted||b.constructor!==cQ&&b.constructor!==cP||null===b._start)for(;null!==a;){let b=a.next;if(null!==b){a=b;break}a=a.parent===this._root?null:a.parent._item}else a=b._start;while(null!==a&&(a.deleted||!this._filter(a.content.type)));return(this._firstCall=!1,null===a)?{value:void 0,done:!0}:(this._currentNode=a,{value:a.content.type,done:!1})}}class cP extends ce{constructor(){super(),this._prelimContent=[]}get firstChild(){let a=this._first;return a?a.content.getContent()[0]:null}_integrate(a,b){super._integrate(a,b),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new cP}clone(){let a=new cP;return a.insert(0,this.toArray().map(a=>a instanceof ce?a.clone():a)),a}get length(){return this.doc??b7(),null===this._prelimContent?this._length:this._prelimContent.length}createTreeWalker(a){return new cO(this,a)}querySelector(a){a=a.toUpperCase();let b=new cO(this,b=>b.nodeName&&b.nodeName.toUpperCase()===a).next();return b.done?null:b.value}querySelectorAll(a){return a=a.toUpperCase(),r(new cO(this,b=>b.nodeName&&b.nodeName.toUpperCase()===a))}_callObserver(a,b){cd(this,a,new cR(this,b,a))}toString(){return ci(this,a=>a.toString()).join("")}toJSON(){return this.toString()}toDOM(a=document,b={},c){let d=a.createDocumentFragment();return void 0!==c&&c._createAssociation(d,this),ch(this,e=>{d.insertBefore(e.toDOM(a,b,c),null)}),d}insert(a,b){null!==this.doc?bY(this.doc,c=>{cm(c,this,a,b)}):this._prelimContent.splice(a,0,...b)}insertAfter(a,b){if(null!==this.doc)bY(this.doc,c=>{ck(c,this,a&&a instanceof ce?a._item:a,b)});else{let c=this._prelimContent,d=null===a?0:c.findIndex(b=>b===a)+1;if(0===d&&null!==a)throw aa("Reference item not found");c.splice(d,0,...b)}}delete(a,b=1){null!==this.doc?bY(this.doc,c=>{cn(c,this,a,b)}):this._prelimContent.splice(a,b)}toArray(){return cg(this)}push(a){this.insert(this.length,a)}unshift(a){this.insert(0,a)}get(a){return cj(this,a)}slice(a=0,b=this.length){return cf(this,a,b)}forEach(a){ch(this,a)}_write(a){a.writeTypeRef(c9)}}class cQ extends cP{constructor(a="UNDEFINED"){super(),this.nodeName=a,this._prelimAttrs=new Map}get nextSibling(){let a=this._item?this._item.next:null;return a?a.content.type:null}get prevSibling(){let a=this._item?this._item.prev:null;return a?a.content.type:null}_integrate(a,b){super._integrate(a,b),this._prelimAttrs.forEach((a,b)=>{this.setAttribute(b,a)}),this._prelimAttrs=null}_copy(){return new cQ(this.nodeName)}clone(){let a=new cQ(this.nodeName);var b=this.getAttributes(),c=(b,c)=>{a.setAttribute(c,b)};for(let a in b)c(b[a],a);return a.insert(0,this.toArray().map(a=>a instanceof ce?a.clone():a)),a}toString(){let a=this.getAttributes(),b=[],c=[];for(let b in a)c.push(b);c.sort();let d=c.length;for(let e=0;e<d;e++){let d=c[e];b.push(d+'="'+a[d]+'"')}let e=this.nodeName.toLocaleLowerCase(),f=b.length>0?" "+b.join(" "):"";return`<${e}${f}>${super.toString()}</${e}>`}removeAttribute(a){null!==this.doc?bY(this.doc,b=>{co(b,this,a)}):this._prelimAttrs.delete(a)}setAttribute(a,b){null!==this.doc?bY(this.doc,c=>{cp(c,this,a,b)}):this._prelimAttrs.set(a,b)}getAttribute(a){return cq(this,a)}hasAttribute(a){return cs(this,a)}getAttributes(a){return a?((a,b)=>{let c={};return a._map.forEach((a,d)=>{let e=a;for(;null!==e&&(!b.sv.has(e.id.client)||e.id.clock>=(b.sv.get(e.id.client)||0));)e=e.left;null!==e&&bH(e,b)&&(c[d]=e.content.getContent()[e.length-1])}),c})(this,a):cr(this)}toDOM(a=document,b={},c){let d=a.createElement(this.nodeName),e=this.getAttributes();for(let a in e){let b=e[a];"string"==typeof b&&d.setAttribute(a,b)}return ch(this,e=>{d.appendChild(e.toDOM(a,b,c))}),void 0!==c&&c._createAssociation(d,this),d}_write(a){a.writeTypeRef(c8),a.writeKey(this.nodeName)}}class cR extends b5{constructor(a,b,c){super(a,c),this.childListChanged=!1,this.attributesChanged=new Set,b.forEach(a=>{null===a?this.childListChanged=!0:this.attributesChanged.add(a)})}}class cS extends cx{constructor(a){super(),this.hookName=a}_copy(){return new cS(this.hookName)}clone(){let a=new cS(this.hookName);return this.forEach((b,c)=>{a.set(c,b)}),a}toDOM(a=document,b={},c){let d,e=b[this.hookName];return(d=void 0!==e?e.createDom(this):document.createElement(this.hookName)).setAttribute("data-yjs-hook",this.hookName),void 0!==c&&c._createAssociation(d,this),d}_write(a){a.writeTypeRef(da),a.writeKey(this.hookName)}}class cT extends cN{get nextSibling(){let a=this._item?this._item.next:null;return a?a.content.type:null}get prevSibling(){let a=this._item?this._item.prev:null;return a?a.content.type:null}_copy(){return new cT}clone(){let a=new cT;return a.applyDelta(this.toDelta()),a}toDOM(a=document,b,c){let d=a.createTextNode(this.toString());return void 0!==c&&c._createAssociation(d,this),d}toString(){return this.toDelta().map(a=>{let b=[];for(let c in a.attributes){let d=[];for(let b in a.attributes[c])d.push({key:b,value:a.attributes[c][b]});d.sort((a,b)=>a.key<b.key?-1:1),b.push({nodeName:c,attrs:d})}b.sort((a,b)=>a.nodeName<b.nodeName?-1:1);let c="";for(let a=0;a<b.length;a++){let d=b[a];c+=`<${d.nodeName}`;for(let a=0;a<d.attrs.length;a++){let b=d.attrs[a];c+=` ${b.key}="${b.value}"`}c+=">"}c+=a.insert;for(let a=b.length-1;a>=0;a--)c+=`</${b[a].nodeName}>`;return c}).join("")}toJSON(){return this.toString()}_write(a){a.writeTypeRef(db)}}class cU{constructor(a,b){this.id=a,this.length=b}get deleted(){throw ab()}mergeWith(a){return!1}write(a,b,c){throw ab()}integrate(a,b){throw ab()}}class cV extends cU{get deleted(){return!0}delete(){}mergeWith(a){return this.constructor===a.constructor&&(this.length+=a.length,!0)}integrate(a,b){b>0&&(this.id.clock+=b,this.length-=b),bM(a.doc.store,this)}write(a,b){a.writeInfo(0),a.writeLen(this.length-b)}getMissing(a,b){return null}}class cW{constructor(a){this.content=a}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new cW(this.content)}splice(a){throw ab()}mergeWith(a){return!1}integrate(a,b){}delete(a){}gc(a){}write(a,b){a.writeBuf(this.content)}getRef(){return 3}}class cX{constructor(a){this.len=a}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new cX(this.len)}splice(a){let b=new cX(this.len-a);return this.len=a,b}mergeWith(a){return this.len+=a.len,!0}integrate(a,b){ba(a.deleteSet,b.id.client,b.id.clock,this.len),b.markDeleted()}delete(a){}gc(a){}write(a,b){a.writeLen(this.len-b)}getRef(){return 1}}let cY=(a,b)=>new bf({guid:a,...b,shouldLoad:b.shouldLoad||b.autoLoad||!1});class cZ{constructor(a){a._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=a;let b={};this.opts=b,a.gc||(b.gc=!1),a.autoLoad&&(b.autoLoad=!0),null!==a.meta&&(b.meta=a.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new cZ(cY(this.doc.guid,this.opts))}splice(a){throw ab()}mergeWith(a){return!1}integrate(a,b){this.doc._item=b,a.subdocsAdded.add(this.doc),this.doc.shouldLoad&&a.subdocsLoaded.add(this.doc)}delete(a){a.subdocsAdded.has(this.doc)?a.subdocsAdded.delete(this.doc):a.subdocsRemoved.add(this.doc)}gc(a){}write(a,b){a.writeString(this.doc.guid),a.writeAny(this.opts)}getRef(){return 9}}class c${constructor(a){this.embed=a}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new c$(this.embed)}splice(a){throw ab()}mergeWith(a){return!1}integrate(a,b){}delete(a){}gc(a){}write(a,b){a.writeJSON(this.embed)}getRef(){return 5}}class c_{constructor(a,b){this.key=a,this.value=b}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new c_(this.key,this.value)}splice(a){throw ab()}mergeWith(a){return!1}integrate(a,b){let c=b.parent;c._searchMarker=null,c._hasFormatting=!0}delete(a){}gc(a){}write(a,b){a.writeKey(this.key),a.writeJSON(this.value)}getRef(){return 6}}class c0{constructor(a){this.arr=a}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new c0(this.arr)}splice(a){let b=new c0(this.arr.slice(a));return this.arr=this.arr.slice(0,a),b}mergeWith(a){return this.arr=this.arr.concat(a.arr),!0}integrate(a,b){}delete(a){}gc(a){}write(a,b){let c=this.arr.length;a.writeLen(c-b);for(let d=b;d<c;d++){let b=this.arr[d];a.writeString(void 0===b?"undefined":JSON.stringify(b))}}getRef(){return 2}}let c1="development"===aP("node_env");class c2{constructor(a){this.arr=a,c1&&aI(a)}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new c2(this.arr)}splice(a){let b=new c2(this.arr.slice(a));return this.arr=this.arr.slice(0,a),b}mergeWith(a){return this.arr=this.arr.concat(a.arr),!0}integrate(a,b){}delete(a){}gc(a){}write(a,b){let c=this.arr.length;a.writeLen(c-b);for(let d=b;d<c;d++){let b=this.arr[d];a.writeAny(b)}}getRef(){return 8}}class c3{constructor(a){this.str=a}getLength(){return this.str.length}getContent(){return this.str.split("")}isCountable(){return!0}copy(){return new c3(this.str)}splice(a){let b=new c3(this.str.slice(a));this.str=this.str.slice(0,a);let c=this.str.charCodeAt(a-1);return c>=55296&&c<=56319&&(this.str=this.str.slice(0,a-1)+"�",b.str="�"+b.str.slice(1)),b}mergeWith(a){return this.str+=a.str,!0}integrate(a,b){}delete(a){}gc(a){}write(a,b){a.writeString(0===b?this.str:this.str.slice(b))}getRef(){return 4}}let c4=[a=>new cv,a=>new cx,a=>new cN,a=>new cQ(a.readKey()),a=>new cP,a=>new cS(a.readKey()),a=>new cT],c5=0,c6=1,c7=2,c8=3,c9=4,da=5,db=6;class dc{constructor(a){this.type=a}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new dc(this.type._copy())}splice(a){throw ab()}mergeWith(a){return!1}integrate(a,b){this.type._integrate(a.doc,b)}delete(a){let b=this.type._start;for(;null!==b;)b.deleted?b.id.clock<(a.beforeState.get(b.id.client)||0)&&a._mergeStructs.push(b):b.delete(a),b=b.right;this.type._map.forEach(b=>{b.deleted?b.id.clock<(a.beforeState.get(b.id.client)||0)&&a._mergeStructs.push(b):b.delete(a)}),a.changed.delete(this.type)}gc(a){let b=this.type._start;for(;null!==b;)b.gc(a,!0),b=b.right;this.type._start=null,this.type._map.forEach(b=>{for(;null!==b;)b.gc(a,!0),b=b.left}),this.type._map=new Map}write(a,b){this.type._write(a)}getRef(){return 7}}let dd=(a,b)=>{let c,d=b,e=0;do e>0&&(d=bz(d.client,d.clock+e)),c=bO(a,d),e=d.clock-c.id.clock,d=c.redone;while(null!==d&&c instanceof df);return{item:c,diff:e}},de=(a,b,c)=>{let{client:d,clock:e}=b.id,f=new df(bz(d,e+c),b,bz(d,e+c-1),b.right,b.rightOrigin,b.parent,b.parentSub,b.content.splice(c));return b.deleted&&f.markDeleted(),b.keep&&(f.keep=!0),null!==b.redone&&(f.redone=bz(b.redone.client,b.redone.clock+c)),b.right=f,null!==f.right&&(f.right.left=f),a._mergeStructs.push(f),null!==f.parentSub&&null===f.right&&f.parent._map.set(f.parentSub,f),b.length=c,f};class df extends cU{constructor(a,b,c,d,e,f,g,h){super(a,h.getLength()),this.origin=c,this.left=b,this.right=d,this.rightOrigin=e,this.parent=f,this.parentSub=g,this.redone=null,this.content=h,this.info=2*!!this.content.isCountable()}set marker(a){(8&this.info)>0!==a&&(this.info^=8)}get marker(){return(8&this.info)>0}get keep(){return(1&this.info)>0}set keep(a){this.keep!==a&&(this.info^=1)}get countable(){return(2&this.info)>0}get deleted(){return(4&this.info)>0}set deleted(a){this.deleted!==a&&(this.info^=4)}markDeleted(){this.info|=4}getMissing(a,b){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=bL(b,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=bL(b,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===bx&&this.id.client!==this.parent.client&&this.parent.clock>=bL(b,this.parent.client))return this.parent.client;if(this.origin&&(this.left=bR(a,b,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=bQ(a,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===cV||this.right&&this.right.constructor===cV)this.parent=null;else if(this.parent){if(this.parent.constructor===bx){let a=bO(b,this.parent);a.constructor===cV?this.parent=null:this.parent=a.content.type}}else this.left&&this.left.constructor===df?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===df&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);return null}integrate(a,b){if(b>0&&(this.id.clock+=b,this.left=bR(a,a.doc.store,bz(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(b),this.length-=b),this.parent){if(!this.left&&(!this.right||null!==this.right.left)||this.left&&this.left.right!==this.right){let b,c=this.left;if(null!==c)b=c.right;else if(null!==this.parentSub)for(b=this.parent._map.get(this.parentSub)||null;null!==b&&null!==b.left;)b=b.left;else b=this.parent._start;let d=new Set,e=new Set;for(;null!==b&&b!==this.right;){if(e.add(b),d.add(b),by(this.origin,b.origin)){if(b.id.client<this.id.client)c=b,d.clear();else if(by(this.rightOrigin,b.rightOrigin))break}else if(null!==b.origin&&e.has(bO(a.doc.store,b.origin)))d.has(bO(a.doc.store,b.origin))||(c=b,d.clear());else break;b=b.right}this.left=c}if(null!==this.left){let a=this.left.right;this.right=a,this.left.right=this}else{let a;if(null!==this.parentSub)for(a=this.parent._map.get(this.parentSub)||null;null!==a&&null!==a.left;)a=a.left;else a=this.parent._start,this.parent._start=this;this.right=a}null!==this.right?this.right.left=this:null!==this.parentSub&&(this.parent._map.set(this.parentSub,this),null!==this.left&&this.left.delete(a)),null===this.parentSub&&this.countable&&!this.deleted&&(this.parent._length+=this.length),bM(a.doc.store,this),this.content.integrate(a,this),bV(a,this.parent,this.parentSub),(null!==this.parent._item&&this.parent._item.deleted||null!==this.parentSub&&null!==this.right)&&this.delete(a)}else new cV(this.id,this.length).integrate(a,0)}get next(){let a=this.right;for(;null!==a&&a.deleted;)a=a.right;return a}get prev(){let a=this.left;for(;null!==a&&a.deleted;)a=a.left;return a}get lastId(){return 1===this.length?this.id:bz(this.id.client,this.id.clock+this.length-1)}mergeWith(a){if(this.constructor===a.constructor&&by(a.origin,this.lastId)&&this.right===a&&by(this.rightOrigin,a.rightOrigin)&&this.id.client===a.id.client&&this.id.clock+this.length===a.id.clock&&this.deleted===a.deleted&&null===this.redone&&null===a.redone&&this.content.constructor===a.content.constructor&&this.content.mergeWith(a.content)){let b=this.parent._searchMarker;return b&&b.forEach(b=>{b.p===a&&(b.p=this,!this.deleted&&this.countable&&(b.index-=this.length))}),a.keep&&(this.keep=!0),this.right=a.right,null!==this.right&&(this.right.left=this),this.length+=a.length,!0}return!1}delete(a){if(!this.deleted){let b=this.parent;this.countable&&null===this.parentSub&&(b._length-=this.length),this.markDeleted(),ba(a.deleteSet,this.id.client,this.id.clock,this.length),bV(a,b,this.parentSub),this.content.delete(a)}}gc(a,b){if(!this.deleted)throw ac();this.content.gc(a),b?((a,b,c)=>{let d=a.clients.get(b.id.client);d[bN(d,b.id.clock)]=c})(a,this,new cV(this.id,this.length)):this.content=new cX(this.length)}write(a,b){let c=b>0?bz(this.id.client,this.id.clock+b-1):this.origin,d=this.rightOrigin,e=this.parentSub,f=31&this.content.getRef()|128*(null!==c)|64*(null!==d)|32*(null!==e);if(a.writeInfo(f),null!==c&&a.writeLeftID(c),null!==d&&a.writeRightID(d),null===c&&null===d){let b=this.parent;if(void 0!==b._item){let c=b._item;if(null===c){let c=bC(b);a.writeParentInfo(!0),a.writeString(c)}else a.writeParentInfo(!1),a.writeLeftID(c.id)}else b.constructor===String?(a.writeParentInfo(!0),a.writeString(b)):b.constructor===bx?(a.writeParentInfo(!1),a.writeLeftID(b)):ac();null!==e&&a.writeString(e)}this.content.write(a,b)}}let dg=(a,b)=>dh[31&b](a),dh=[()=>{ac()},a=>new cX(a.readLen()),a=>{let b=a.readLen(),c=[];for(let d=0;d<b;d++){let b=a.readString();"undefined"===b?c.push(void 0):c.push(JSON.parse(b))}return new c0(c)},a=>new cW(a.readBuf()),a=>new c3(a.readString()),a=>new c$(a.readJSON()),a=>new c_(a.readKey(),a.readJSON()),a=>new dc(c4[a.readTypeRef()](a)),a=>{let b=a.readLen(),c=[];for(let d=0;d<b;d++)c.push(a.readAny());return new c2(c)},a=>new cZ(cY(a.readString(),a.readAny())),()=>{ac()}];class di extends cU{get deleted(){return!0}delete(){}mergeWith(a){return this.constructor===a.constructor&&(this.length+=a.length,!0)}integrate(a,b){ac()}write(a,b){a.writeInfo(10),M(a.restEncoder,this.length-b)}getMissing(a,b){return null}}let dj="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},dk="__ $YJS$ __";!0===dj[dk]&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438"),dj[dk]=!0;var dl=function(a){return a.docTypeError="docTypeError",a.contextNotFound="contextNotFound",a.timerNotFound="timerNotFound",a.ctxCallOutOfScope="ctxCallOutOfScope",a.createNodeInParserFail="createNodeInParserFail",a.stackOverFlow="stackOverFlow",a.parserMatchError="parserMatchError",a.serializerMatchError="serializerMatchError",a.getAtomFromSchemaFail="getAtomFromSchemaFail",a.expectDomTypeError="expectDomTypeError",a.callCommandBeforeEditorView="callCommandBeforeEditorView",a.missingRootElement="missingRootElement",a.missingNodeInSchema="missingNodeInSchema",a.missingMarkInSchema="missingMarkInSchema",a.ctxNotBind="ctxNotBind",a.missingYjsDoc="missingYjsDoc",a.aiProviderError="aiProviderError",a.aiBuildContextError="aiBuildContextError",a}({}),dm=class extends Error{constructor(a,b,c){super(b,c),this.name="MilkdownError",this.code=a,c?.cause!==void 0&&(this.cause=c.cause)}},dn=(a,b)=>"function"==typeof b?"[Function]":b,dp=a=>JSON.stringify(a,dn);function dq(){return new dm(dl.ctxCallOutOfScope,"Should not call a context out of the plugin.")}function dr(){return new dm(dl.stackOverFlow,"Stack over flow, cannot pop on an empty stack.")}function ds(a){return new dm(dl.expectDomTypeError,`Expect to be a dom, but get: ${dp(a)}.`)}function dt(){return new dm(dl.callCommandBeforeEditorView,"You're trying to call a command before editor view initialized, make sure to get commandManager from ctx after editor view has been initialized")}var du=class{constructor(){this.sliceMap=new Map,this.get=a=>{let b="string"==typeof a?[...this.sliceMap.values()].find(b=>b.type.name===a):this.sliceMap.get(a.id);if(!b){var c;throw c="string"==typeof a?a:a.name,new dm(dl.contextNotFound,`Context "${c}" not found, do you forget to inject it?`)}return b},this.remove=a=>{let b="string"==typeof a?[...this.sliceMap.values()].find(b=>b.type.name===a):this.sliceMap.get(a.id);b&&this.sliceMap.delete(b.type.id)},this.has=a=>"string"==typeof a?[...this.sliceMap.values()].some(b=>b.type.name===a):this.sliceMap.has(a.id)}},dv=class{#a;#b;#c;constructor(a,b,c){this.#a=[],this.#c=()=>{this.#a.forEach(a=>a(this.#b))},this.set=a=>{this.#b=a,this.#c()},this.get=()=>this.#b,this.update=a=>{this.#b=a(this.#b),this.#c()},this.type=c,this.#b=b,a.set(c.id,this)}on(a){return this.#a.push(a),()=>{this.#a=this.#a.filter(b=>b!==a)}}once(a){let b=this.on(c=>{a(c),b()});return b}off(a){this.#a=this.#a.filter(b=>b!==a)}offAll(){this.#a=[]}},dw=class{constructor(a,b){this.id=Symbol(`Context-${b}`),this.name=b,this._defaultValue=a,this._typeInfo=()=>{throw dq()}}create(a,b=this._defaultValue){return new dv(a,b,this)}},dx=(a,b)=>new dw(a,b),dy=class{#d;#e;#f;#g;#h;#i;#j;constructor(a,b,c){this.#g=new Set,this.#h=new Set,this.#i=new Map,this.#j=new Map,this.read=()=>({metadata:this.#d,injectedSlices:[...this.#g].map(a=>({name:"string"==typeof a?a:a.name,value:this.#k(a)})),consumedSlices:[...this.#h].map(a=>({name:"string"==typeof a?a:a.name,value:this.#k(a)})),recordedTimers:[...this.#i].map(([a,{duration:b}])=>({name:a.name,duration:b,status:this.#l(a)})),waitTimers:[...this.#j].map(([a,{duration:b}])=>({name:a.name,duration:b,status:this.#l(a)}))}),this.onRecord=a=>{this.#i.set(a,{start:Date.now(),duration:0})},this.onClear=a=>{this.#i.delete(a)},this.onDone=a=>{let b=this.#i.get(a);b&&(b.duration=Date.now()-b.start)},this.onWait=(a,b)=>{let c=Date.now();b.finally(()=>{this.#j.set(a,{duration:Date.now()-c})}).catch(console.error)},this.onInject=a=>{this.#g.add(a)},this.onRemove=a=>{this.#g.delete(a)},this.onUse=a=>{this.#h.add(a)},this.#k=a=>this.#e.get(a).get(),this.#l=a=>this.#f.get(a).status,this.#e=a,this.#f=b,this.#d=c}#k;#l},dz=class a{#e;#f;#d;#m;constructor(b,c,d){this.produce=b=>b&&Object.keys(b).length?new a(this.#e,this.#f,{...b}):this,this.inject=(a,b)=>{let c=a.create(this.#e.sliceMap);return null!=b&&c.set(b),this.#m?.onInject(a),this},this.remove=a=>(this.#e.remove(a),this.#m?.onRemove(a),this),this.record=a=>(a.create(this.#f.store),this.#m?.onRecord(a),this),this.clearTimer=a=>(this.#f.remove(a),this.#m?.onClear(a),this),this.isInjected=a=>this.#e.has(a),this.isRecorded=a=>this.#f.has(a),this.use=a=>(this.#m?.onUse(a),this.#e.get(a)),this.get=a=>this.use(a).get(),this.set=(a,b)=>this.use(a).set(b),this.update=(a,b)=>this.use(a).update(b),this.timer=a=>this.#f.get(a),this.done=a=>{this.timer(a).done(),this.#m?.onDone(a)},this.wait=a=>{let b=this.timer(a).start();return this.#m?.onWait(a,b),b},this.waitTimers=async a=>{await Promise.all(this.get(a).map(a=>this.wait(a)))},this.#e=b,this.#f=c,this.#d=d,d&&(this.#m=new dy(b,c,d))}get meta(){return this.#d}get inspector(){return this.#m}},dA=class{constructor(){this.store=new Map,this.get=a=>{let b=this.store.get(a.id);if(!b){var c;throw c=a.name,new dm(dl.timerNotFound,`Timer "${c}" not found, do you forget to record it?`)}return b},this.remove=a=>{this.store.delete(a.id)},this.has=a=>this.store.has(a.id)}},dB=class{#n;#o;#p;#q;constructor(a,b){this.#n=null,this.#o=null,this.#q="pending",this.start=()=>(this.#n??=new Promise((a,b)=>{this.#o=b=>{b instanceof CustomEvent&&b.detail.id===this.#p&&(this.#q="resolved",this.#r(),b.stopImmediatePropagation(),a())},this.#s(()=>{"pending"===this.#q&&(this.#q="rejected"),this.#r(),b(Error(`Timing ${this.type.name} timeout.`))}),this.#q="pending",addEventListener(this.type.name,this.#o)}),this.#n),this.done=()=>{dispatchEvent(new CustomEvent(this.type.name,{detail:{id:this.#p}}))},this.#r=()=>{this.#o&&removeEventListener(this.type.name,this.#o)},this.#s=a=>{setTimeout(()=>{a()},this.type.timeout)},this.#p=Symbol(b.name),this.type=b,a.set(b.id,this)}get status(){return this.#q}#r;#s},dC=class{constructor(a,b=3e3){this.create=a=>new dB(a,this),this.id=Symbol(`Timer-${a}`),this.name=a,this.timeout=b}},dD=(a,b=3e3)=>new dC(a,b);let dE={};function dF(a,b){let c=b||dE;return dG(a,"boolean"!=typeof c.includeImageAlt||c.includeImageAlt,"boolean"!=typeof c.includeHtml||c.includeHtml)}function dG(a,b,c){var d;if((d=a)&&"object"==typeof d){if("value"in a)return"html"!==a.type||c?a.value:"";if(b&&"alt"in a&&a.alt)return a.alt;if("children"in a)return dH(a.children,b,c)}return Array.isArray(a)?dH(a,b,c):""}function dH(a,b,c){let d=[],e=-1;for(;++e<a.length;)d[e]=dG(a[e],b,c);return d.join("")}function dI(a,b,c,d){let e,f=a.length,g=0;if(b=b<0?-b>f?0:f+b:b>f?f:b,c=c>0?c:0,d.length<1e4)(e=Array.from(d)).unshift(b,c),a.splice(...e);else for(c&&a.splice(b,c);g<d.length;)(e=d.slice(g,g+1e4)).unshift(b,0),a.splice(...e),g+=1e4,b+=1e4}function dJ(a,b){return a.length>0?(dI(a,a.length,0,b),a):b}class dK{constructor(a){this.left=a?[...a]:[],this.right=[]}get(a){if(a<0||a>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+a+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return a<this.left.length?this.left[a]:this.right[this.right.length-a+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(a,b){let c=null==b?1/0:b;return c<this.left.length?this.left.slice(a,c):a>this.left.length?this.right.slice(this.right.length-c+this.left.length,this.right.length-a+this.left.length).reverse():this.left.slice(a).concat(this.right.slice(this.right.length-c+this.left.length).reverse())}splice(a,b,c){this.setCursor(Math.trunc(a));let d=this.right.splice(this.right.length-(b||0),1/0);return c&&dL(this.left,c),d.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(a){this.setCursor(1/0),this.left.push(a)}pushMany(a){this.setCursor(1/0),dL(this.left,a)}unshift(a){this.setCursor(0),this.right.push(a)}unshiftMany(a){this.setCursor(0),dL(this.right,a.reverse())}setCursor(a){if(a!==this.left.length&&(!(a>this.left.length)||0!==this.right.length)&&(!(a<0)||0!==this.left.length))if(a<this.left.length){let b=this.left.splice(a,1/0);dL(this.right,b.reverse())}else{let b=this.right.splice(this.left.length+this.right.length-a,1/0);dL(this.left,b.reverse())}}}function dL(a,b){let c=0;if(b.length<1e4)a.push(...b);else for(;c<b.length;)a.push(...b.slice(c,c+1e4)),c+=1e4}function dM(a){let b,c,d,e,f,g,h,i={},j=-1,k=new dK(a);for(;++j<k.length;){for(;j in i;)j=i[j];if(b=k.get(j),j&&"chunkFlow"===b[1].type&&"listItemPrefix"===k.get(j-1)[1].type&&((d=0)<(g=b[1]._tokenizer.events).length&&"lineEndingBlank"===g[d][1].type&&(d+=2),d<g.length&&"content"===g[d][1].type))for(;++d<g.length&&"content"!==g[d][1].type;)"chunkText"===g[d][1].type&&(g[d][1]._isInFirstContentOfListItem=!0,d++);if("enter"===b[0])b[1].contentType&&(Object.assign(i,function(a,b){let c,d,e=a.get(b)[1],f=a.get(b)[2],g=b-1,h=[],i=e._tokenizer;!i&&(i=f.parser[e.contentType](e.start),e._contentTypeTextTrailing&&(i._contentTypeTextTrailing=!0));let j=i.events,k=[],l={},m=-1,n=e,o=0,p=0,q=[0];for(;n;){for(;a.get(++g)[1]!==n;);h.push(g),!n._tokenizer&&(c=f.sliceStream(n),n.next||c.push(null),d&&i.defineSkip(n.start),n._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(c),n._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),d=n,n=n.next}for(n=e;++m<j.length;)"exit"===j[m][0]&&"enter"===j[m-1][0]&&j[m][1].type===j[m-1][1].type&&j[m][1].start.line!==j[m][1].end.line&&(p=m+1,q.push(p),n._tokenizer=void 0,n.previous=void 0,n=n.next);for(i.events=[],n?(n._tokenizer=void 0,n.previous=void 0):q.pop(),m=q.length;m--;){let b=j.slice(q[m],q[m+1]),c=h.pop();k.push([c,c+b.length-1]),a.splice(c,2,b)}for(k.reverse(),m=-1;++m<k.length;)l[o+k[m][0]]=o+k[m][1],o+=k[m][1]-k[m][0]-1;return l}(k,j)),j=i[j],h=!0);else if(b[1]._container){for(d=j,c=void 0;d--;)if("lineEnding"===(e=k.get(d))[1].type||"lineEndingBlank"===e[1].type)"enter"===e[0]&&(c&&(k.get(c)[1].type="lineEndingBlank"),e[1].type="lineEnding",c=d);else if("linePrefix"===e[1].type||"listItemIndent"===e[1].type);else break;c&&(b[1].end={...k.get(c)[1].start},(f=k.slice(c,j)).unshift(b),k.splice(c,j-c+1,f))}}return dI(a,0,1/0,k.slice(0)),!h}let dN={}.hasOwnProperty,dO=d$(/[A-Za-z]/),dP=d$(/[\dA-Za-z]/),dQ=d$(/[#-'*+\--9=?A-Z^-~]/);function dR(a){return null!==a&&(a<32||127===a)}let dS=d$(/\d/),dT=d$(/[\dA-Fa-f]/),dU=d$(/[!-/:-@[-`{-~]/);function dV(a){return null!==a&&a<-2}function dW(a){return null!==a&&(a<0||32===a)}function dX(a){return -2===a||-1===a||32===a}let dY=d$(/\p{P}|\p{S}/u),dZ=d$(/\s/);function d$(a){return function(b){return null!==b&&b>-1&&a.test(String.fromCharCode(b))}}function d_(a,b,c,d){let e=d?d-1:1/0,f=0;return function(d){return dX(d)?(a.enter(c),function d(g){return dX(g)&&f++<e?(a.consume(g),d):(a.exit(c),b(g))}(d)):b(d)}}let d0={tokenize:function(a){let b,c=a.attempt(this.parser.constructs.contentInitial,function(b){return null===b?void a.consume(b):(a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),d_(a,c,"linePrefix"))},function(c){return a.enter("paragraph"),function c(d){let e=a.enter("chunkText",{contentType:"text",previous:b});return b&&(b.next=e),b=e,function b(d){if(null===d){a.exit("chunkText"),a.exit("paragraph"),a.consume(d);return}return dV(d)?(a.consume(d),a.exit("chunkText"),c):(a.consume(d),b)}(d)}(c)});return c}},d1={tokenize:function(a){let b,c,d,e=this,f=[],g=0;return h;function h(b){if(g<f.length){let c=f[g];return e.containerState=c[1],a.attempt(c[0].continuation,i,j)(b)}return j(b)}function i(a){if(g++,e.containerState._closeFlow){let c;e.containerState._closeFlow=void 0,b&&r();let d=e.events.length,f=d;for(;f--;)if("exit"===e.events[f][0]&&"chunkFlow"===e.events[f][1].type){c=e.events[f][1].end;break}q(g);let h=d;for(;h<e.events.length;)e.events[h][1].end={...c},h++;return dI(e.events,f+1,0,e.events.slice(d)),e.events.length=h,j(a)}return h(a)}function j(c){if(g===f.length){if(!b)return m(c);if(b.currentConstruct&&b.currentConstruct.concrete)return o(c);e.interrupt=!!(b.currentConstruct&&!b._gfmTableDynamicInterruptHack)}return e.containerState={},a.check(d2,k,l)(c)}function k(a){return b&&r(),q(g),m(a)}function l(a){return e.parser.lazy[e.now().line]=g!==f.length,d=e.now().offset,o(a)}function m(b){return e.containerState={},a.attempt(d2,n,o)(b)}function n(a){return g++,f.push([e.currentConstruct,e.containerState]),m(a)}function o(d){if(null===d){b&&r(),q(0),a.consume(d);return}return b=b||e.parser.flow(e.now()),a.enter("chunkFlow",{_tokenizer:b,contentType:"flow",previous:c}),function b(c){if(null===c){p(a.exit("chunkFlow"),!0),q(0),a.consume(c);return}return dV(c)?(a.consume(c),p(a.exit("chunkFlow")),g=0,e.interrupt=void 0,h):(a.consume(c),b)}(d)}function p(a,f){let h=e.sliceStream(a);if(f&&h.push(null),a.previous=c,c&&(c.next=a),c=a,b.defineSkip(a.start),b.write(h),e.parser.lazy[a.start.line]){let a,c,f=b.events.length;for(;f--;)if(b.events[f][1].start.offset<d&&(!b.events[f][1].end||b.events[f][1].end.offset>d))return;let h=e.events.length,i=h;for(;i--;)if("exit"===e.events[i][0]&&"chunkFlow"===e.events[i][1].type){if(a){c=e.events[i][1].end;break}a=!0}for(q(g),f=h;f<e.events.length;)e.events[f][1].end={...c},f++;dI(e.events,i+1,0,e.events.slice(h)),e.events.length=f}}function q(b){let c=f.length;for(;c-- >b;){let b=f[c];e.containerState=b[1],b[0].exit.call(e,a)}f.length=b}function r(){b.write([null]),c=void 0,b=void 0,e.containerState._closeFlow=void 0}}},d2={tokenize:function(a,b,c){return d_(a,a.attempt(this.parser.constructs.document,b,c),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},d3={partial:!0,tokenize:function(a,b,c){return function(b){return dX(b)?d_(a,d,"linePrefix")(b):d(b)};function d(a){return null===a||dV(a)?b(a):c(a)}}},d4={resolve:function(a){return dM(a),a},tokenize:function(a,b){let c;return function(b){return a.enter("content"),c=a.enter("chunkContent",{contentType:"content"}),d(b)};function d(b){return null===b?e(b):dV(b)?a.check(d5,f,e)(b):(a.consume(b),d)}function e(c){return a.exit("chunkContent"),a.exit("content"),b(c)}function f(b){return a.consume(b),a.exit("chunkContent"),c.next=a.enter("chunkContent",{contentType:"content",previous:c}),c=c.next,d}}},d5={partial:!0,tokenize:function(a,b,c){let d=this;return function(b){return a.exit("chunkContent"),a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),d_(a,e,"linePrefix")};function e(e){if(null===e||dV(e))return c(e);let f=d.events[d.events.length-1];return!d.parser.constructs.disable.null.includes("codeIndented")&&f&&"linePrefix"===f[1].type&&f[2].sliceSerialize(f[1],!0).length>=4?b(e):a.interrupt(d.parser.constructs.flow,c,b)(e)}}},d6={tokenize:function(a){let b=this,c=a.attempt(d3,function(d){return null===d?void a.consume(d):(a.enter("lineEndingBlank"),a.consume(d),a.exit("lineEndingBlank"),b.currentConstruct=void 0,c)},a.attempt(this.parser.constructs.flowInitial,d,d_(a,a.attempt(this.parser.constructs.flow,d,a.attempt(d4,d)),"linePrefix")));return c;function d(d){return null===d?void a.consume(d):(a.enter("lineEnding"),a.consume(d),a.exit("lineEnding"),b.currentConstruct=void 0,c)}}},d7={resolveAll:eb()},d8=ea("string"),d9=ea("text");function ea(a){return{resolveAll:eb("text"===a?ec:void 0),tokenize:function(b){let c=this,d=this.parser.constructs[a],e=b.attempt(d,f,g);return f;function f(a){return i(a)?e(a):g(a)}function g(a){return null===a?void b.consume(a):(b.enter("data"),b.consume(a),h)}function h(a){return i(a)?(b.exit("data"),e(a)):(b.consume(a),h)}function i(a){if(null===a)return!0;let b=d[a],e=-1;if(b)for(;++e<b.length;){let a=b[e];if(!a.previous||a.previous.call(c,c.previous))return!0}return!1}}}}function eb(a){return function(b,c){let d,e=-1;for(;++e<=b.length;)void 0===d?b[e]&&"data"===b[e][1].type&&(d=e,e++):b[e]&&"data"===b[e][1].type||(e!==d+2&&(b[d][1].end=b[e-1][1].end,b.splice(d+2,e-d-2),e=d+2),d=void 0);return a?a(b,c):b}}function ec(a,b){let c=0;for(;++c<=a.length;)if((c===a.length||"lineEnding"===a[c][1].type)&&"data"===a[c-1][1].type){let d,e=a[c-1][1],f=b.sliceStream(e),g=f.length,h=-1,i=0;for(;g--;){let a=f[g];if("string"==typeof a){for(h=a.length;32===a.charCodeAt(h-1);)i++,h--;if(h)break;h=-1}else if(-2===a)d=!0,i++;else if(-1===a);else{g++;break}}if(b._contentTypeTextTrailing&&c===a.length&&(i=0),i){let f={type:c===a.length||d||i<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:g?h:e.start._bufferIndex+h,_index:e.start._index+g,line:e.end.line,column:e.end.column-i,offset:e.end.offset-i},end:{...e.end}};e.end={...f.start},e.start.offset===e.end.offset?Object.assign(e,f):(a.splice(c,0,["enter",f,b],["exit",f,b]),c+=2)}c++}return a}let ed={name:"thematicBreak",tokenize:function(a,b,c){let d,e=0;return function(f){var g;return a.enter("thematicBreak"),d=g=f,function f(g){return g===d?(a.enter("thematicBreakSequence"),function b(c){return c===d?(a.consume(c),e++,b):(a.exit("thematicBreakSequence"),dX(c)?d_(a,f,"whitespace")(c):f(c))}(g)):e>=3&&(null===g||dV(g))?(a.exit("thematicBreak"),b(g)):c(g)}(g)}}},ee={continuation:{tokenize:function(a,b,c){let d=this;return d.containerState._closeFlow=void 0,a.check(d3,function(c){return d.containerState.furtherBlankLines=d.containerState.furtherBlankLines||d.containerState.initialBlankLine,d_(a,b,"listItemIndent",d.containerState.size+1)(c)},function(c){return d.containerState.furtherBlankLines||!dX(c)?(d.containerState.furtherBlankLines=void 0,d.containerState.initialBlankLine=void 0,e(c)):(d.containerState.furtherBlankLines=void 0,d.containerState.initialBlankLine=void 0,a.attempt(eg,b,e)(c))});function e(e){return d.containerState._closeFlow=!0,d.interrupt=void 0,d_(a,a.attempt(ee,b,c),"linePrefix",d.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(e)}}},exit:function(a){a.exit(this.containerState.type)},name:"list",tokenize:function(a,b,c){let d=this,e=d.events[d.events.length-1],f=e&&"linePrefix"===e[1].type?e[2].sliceSerialize(e[1],!0).length:0,g=0;return function(b){let e=d.containerState.type||(42===b||43===b||45===b?"listUnordered":"listOrdered");if("listUnordered"===e?!d.containerState.marker||b===d.containerState.marker:dS(b)){if(d.containerState.type||(d.containerState.type=e,a.enter(e,{_container:!0})),"listUnordered"===e)return a.enter("listItemPrefix"),42===b||45===b?a.check(ed,c,h)(b):h(b);if(!d.interrupt||49===b)return a.enter("listItemPrefix"),a.enter("listItemValue"),function b(e){return dS(e)&&++g<10?(a.consume(e),b):(!d.interrupt||g<2)&&(d.containerState.marker?e===d.containerState.marker:41===e||46===e)?(a.exit("listItemValue"),h(e)):c(e)}(b)}return c(b)};function h(b){return a.enter("listItemMarker"),a.consume(b),a.exit("listItemMarker"),d.containerState.marker=d.containerState.marker||b,a.check(d3,d.interrupt?c:i,a.attempt(ef,k,j))}function i(a){return d.containerState.initialBlankLine=!0,f++,k(a)}function j(b){return dX(b)?(a.enter("listItemPrefixWhitespace"),a.consume(b),a.exit("listItemPrefixWhitespace"),k):c(b)}function k(c){return d.containerState.size=f+d.sliceSerialize(a.exit("listItemPrefix"),!0).length,b(c)}}},ef={partial:!0,tokenize:function(a,b,c){let d=this;return d_(a,function(a){let e=d.events[d.events.length-1];return!dX(a)&&e&&"listItemPrefixWhitespace"===e[1].type?b(a):c(a)},"listItemPrefixWhitespace",d.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},eg={partial:!0,tokenize:function(a,b,c){let d=this;return d_(a,function(a){let e=d.events[d.events.length-1];return e&&"listItemIndent"===e[1].type&&e[2].sliceSerialize(e[1],!0).length===d.containerState.size?b(a):c(a)},"listItemIndent",d.containerState.size+1)}},eh={continuation:{tokenize:function(a,b,c){let d=this;return function(b){return dX(b)?d_(a,e,"linePrefix",d.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):e(b)};function e(d){return a.attempt(eh,b,c)(d)}}},exit:function(a){a.exit("blockQuote")},name:"blockQuote",tokenize:function(a,b,c){let d=this;return function(b){if(62===b){let c=d.containerState;return c.open||(a.enter("blockQuote",{_container:!0}),c.open=!0),a.enter("blockQuotePrefix"),a.enter("blockQuoteMarker"),a.consume(b),a.exit("blockQuoteMarker"),e}return c(b)};function e(c){return dX(c)?(a.enter("blockQuotePrefixWhitespace"),a.consume(c),a.exit("blockQuotePrefixWhitespace"),a.exit("blockQuotePrefix"),b):(a.exit("blockQuotePrefix"),b(c))}}};function ei(a,b,c,d,e,f,g,h,i){let j=i||1/0,k=0;return function(b){return 60===b?(a.enter(d),a.enter(e),a.enter(f),a.consume(b),a.exit(f),l):null===b||32===b||41===b||dR(b)?c(b):(a.enter(d),a.enter(g),a.enter(h),a.enter("chunkString",{contentType:"string"}),o(b))};function l(c){return 62===c?(a.enter(f),a.consume(c),a.exit(f),a.exit(e),a.exit(d),b):(a.enter(h),a.enter("chunkString",{contentType:"string"}),m(c))}function m(b){return 62===b?(a.exit("chunkString"),a.exit(h),l(b)):null===b||60===b||dV(b)?c(b):(a.consume(b),92===b?n:m)}function n(b){return 60===b||62===b||92===b?(a.consume(b),m):m(b)}function o(e){return!k&&(null===e||41===e||dW(e))?(a.exit("chunkString"),a.exit(h),a.exit(g),a.exit(d),b(e)):k<j&&40===e?(a.consume(e),k++,o):41===e?(a.consume(e),k--,o):null===e||32===e||40===e||dR(e)?c(e):(a.consume(e),92===e?p:o)}function p(b){return 40===b||41===b||92===b?(a.consume(b),o):o(b)}}function ej(a,b,c,d,e,f){let g,h=this,i=0;return function(b){return a.enter(d),a.enter(e),a.consume(b),a.exit(e),a.enter(f),j};function j(l){return i>999||null===l||91===l||93===l&&!g||94===l&&!i&&"_hiddenFootnoteSupport"in h.parser.constructs?c(l):93===l?(a.exit(f),a.enter(e),a.consume(l),a.exit(e),a.exit(d),b):dV(l)?(a.enter("lineEnding"),a.consume(l),a.exit("lineEnding"),j):(a.enter("chunkString",{contentType:"string"}),k(l))}function k(b){return null===b||91===b||93===b||dV(b)||i++>999?(a.exit("chunkString"),j(b)):(a.consume(b),g||(g=!dX(b)),92===b?l:k)}function l(b){return 91===b||92===b||93===b?(a.consume(b),i++,k):k(b)}}function ek(a,b,c,d,e,f){let g;return function(b){return 34===b||39===b||40===b?(a.enter(d),a.enter(e),a.consume(b),a.exit(e),g=40===b?41:b,h):c(b)};function h(c){return c===g?(a.enter(e),a.consume(c),a.exit(e),a.exit(d),b):(a.enter(f),i(c))}function i(b){return b===g?(a.exit(f),h(g)):null===b?c(b):dV(b)?(a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),d_(a,i,"linePrefix")):(a.enter("chunkString",{contentType:"string"}),j(b))}function j(b){return b===g||null===b||dV(b)?(a.exit("chunkString"),i(b)):(a.consume(b),92===b?k:j)}function k(b){return b===g||92===b?(a.consume(b),j):j(b)}}function el(a,b){let c;return function d(e){return dV(e)?(a.enter("lineEnding"),a.consume(e),a.exit("lineEnding"),c=!0,d):dX(e)?d_(a,d,c?"linePrefix":"lineSuffix")(e):b(e)}}function em(a){return a.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let en={partial:!0,tokenize:function(a,b,c){return function(b){return dW(b)?el(a,d)(b):c(b)};function d(b){return ek(a,e,c,"definitionTitle","definitionTitleMarker","definitionTitleString")(b)}function e(b){return dX(b)?d_(a,f,"whitespace")(b):f(b)}function f(a){return null===a||dV(a)?b(a):c(a)}}},eo={name:"codeIndented",tokenize:function(a,b,c){let d=this;return function(b){return a.enter("codeIndented"),d_(a,e,"linePrefix",5)(b)};function e(b){let e=d.events[d.events.length-1];return e&&"linePrefix"===e[1].type&&e[2].sliceSerialize(e[1],!0).length>=4?function b(c){return null===c?f(c):dV(c)?a.attempt(ep,b,f)(c):(a.enter("codeFlowValue"),function c(d){return null===d||dV(d)?(a.exit("codeFlowValue"),b(d)):(a.consume(d),c)}(c))}(b):c(b)}function f(c){return a.exit("codeIndented"),b(c)}}},ep={partial:!0,tokenize:function(a,b,c){let d=this;return e;function e(b){return d.parser.lazy[d.now().line]?c(b):dV(b)?(a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),e):d_(a,f,"linePrefix",5)(b)}function f(a){let f=d.events[d.events.length-1];return f&&"linePrefix"===f[1].type&&f[2].sliceSerialize(f[1],!0).length>=4?b(a):dV(a)?e(a):c(a)}}},eq={name:"setextUnderline",resolveTo:function(a,b){let c,d,e,f=a.length;for(;f--;)if("enter"===a[f][0]){if("content"===a[f][1].type){c=f;break}"paragraph"===a[f][1].type&&(d=f)}else"content"===a[f][1].type&&a.splice(f,1),e||"definition"!==a[f][1].type||(e=f);let g={type:"setextHeading",start:{...a[c][1].start},end:{...a[a.length-1][1].end}};return a[d][1].type="setextHeadingText",e?(a.splice(d,0,["enter",g,b]),a.splice(e+1,0,["exit",a[c][1],b]),a[c][1].end={...a[e][1].end}):a[c][1]=g,a.push(["exit",g,b]),a},tokenize:function(a,b,c){let d,e=this;return function(b){var g;let h,i=e.events.length;for(;i--;)if("lineEnding"!==e.events[i][1].type&&"linePrefix"!==e.events[i][1].type&&"content"!==e.events[i][1].type){h="paragraph"===e.events[i][1].type;break}return!e.parser.lazy[e.now().line]&&(e.interrupt||h)?(a.enter("setextHeadingLine"),d=b,g=b,a.enter("setextHeadingLineSequence"),function b(c){return c===d?(a.consume(c),b):(a.exit("setextHeadingLineSequence"),dX(c)?d_(a,f,"lineSuffix")(c):f(c))}(g)):c(b)};function f(d){return null===d||dV(d)?(a.exit("setextHeadingLine"),b(d)):c(d)}}},er=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],es=["pre","script","style","textarea"],et={partial:!0,tokenize:function(a,b,c){return function(d){return a.enter("lineEnding"),a.consume(d),a.exit("lineEnding"),a.attempt(d3,b,c)}}},eu={partial:!0,tokenize:function(a,b,c){let d=this;return function(b){return dV(b)?(a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),e):c(b)};function e(a){return d.parser.lazy[d.now().line]?c(a):b(a)}}},ev={partial:!0,tokenize:function(a,b,c){let d=this;return function(b){return null===b?c(b):(a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),e)};function e(a){return d.parser.lazy[d.now().line]?c(a):b(a)}}},ew={concrete:!0,name:"codeFenced",tokenize:function(a,b,c){let d,e=this,f={partial:!0,tokenize:function(a,b,c){let f=0;return function(b){return a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),g};function g(b){return a.enter("codeFencedFence"),dX(b)?d_(a,i,"linePrefix",e.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):i(b)}function i(b){return b===d?(a.enter("codeFencedFenceSequence"),function b(e){return e===d?(f++,a.consume(e),b):f>=h?(a.exit("codeFencedFenceSequence"),dX(e)?d_(a,j,"whitespace")(e):j(e)):c(e)}(b)):c(b)}function j(d){return null===d||dV(d)?(a.exit("codeFencedFence"),b(d)):c(d)}}},g=0,h=0;return function(b){var f=b;let j=e.events[e.events.length-1];return g=j&&"linePrefix"===j[1].type?j[2].sliceSerialize(j[1],!0).length:0,d=f,a.enter("codeFenced"),a.enter("codeFencedFence"),a.enter("codeFencedFenceSequence"),function b(e){return e===d?(h++,a.consume(e),b):h<3?c(e):(a.exit("codeFencedFenceSequence"),dX(e)?d_(a,i,"whitespace")(e):i(e))}(f)};function i(f){return null===f||dV(f)?(a.exit("codeFencedFence"),e.interrupt?b(f):a.check(ev,k,o)(f)):(a.enter("codeFencedFenceInfo"),a.enter("chunkString",{contentType:"string"}),function b(e){return null===e||dV(e)?(a.exit("chunkString"),a.exit("codeFencedFenceInfo"),i(e)):dX(e)?(a.exit("chunkString"),a.exit("codeFencedFenceInfo"),d_(a,j,"whitespace")(e)):96===e&&e===d?c(e):(a.consume(e),b)}(f))}function j(b){return null===b||dV(b)?i(b):(a.enter("codeFencedFenceMeta"),a.enter("chunkString",{contentType:"string"}),function b(e){return null===e||dV(e)?(a.exit("chunkString"),a.exit("codeFencedFenceMeta"),i(e)):96===e&&e===d?c(e):(a.consume(e),b)}(b))}function k(b){return a.attempt(f,o,l)(b)}function l(b){return a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),m}function m(b){return g>0&&dX(b)?d_(a,n,"linePrefix",g+1)(b):n(b)}function n(b){return null===b||dV(b)?a.check(ev,k,o)(b):(a.enter("codeFlowValue"),function b(c){return null===c||dV(c)?(a.exit("codeFlowValue"),n(c)):(a.consume(c),b)}(b))}function o(c){return a.exit("codeFenced"),b(c)}}},ex={AElig:"\xc6",AMP:"&",Aacute:"\xc1",Abreve:"Ă",Acirc:"\xc2",Acy:"А",Afr:"\uD835\uDD04",Agrave:"\xc0",Alpha:"Α",Amacr:"Ā",And:"⩓",Aogon:"Ą",Aopf:"\uD835\uDD38",ApplyFunction:"",Aring:"\xc5",Ascr:"\uD835\uDC9C",Assign:"≔",Atilde:"\xc3",Auml:"\xc4",Backslash:"∖",Barv:"⫧",Barwed:"⌆",Bcy:"Б",Because:"∵",Bernoullis:"ℬ",Beta:"Β",Bfr:"\uD835\uDD05",Bopf:"\uD835\uDD39",Breve:"˘",Bscr:"ℬ",Bumpeq:"≎",CHcy:"Ч",COPY:"\xa9",Cacute:"Ć",Cap:"⋒",CapitalDifferentialD:"ⅅ",Cayleys:"ℭ",Ccaron:"Č",Ccedil:"\xc7",Ccirc:"Ĉ",Cconint:"∰",Cdot:"Ċ",Cedilla:"\xb8",CenterDot:"\xb7",Cfr:"ℭ",Chi:"Χ",CircleDot:"⊙",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",Colon:"∷",Colone:"⩴",Congruent:"≡",Conint:"∯",ContourIntegral:"∮",Copf:"ℂ",Coproduct:"∐",CounterClockwiseContourIntegral:"∳",Cross:"⨯",Cscr:"\uD835\uDC9E",Cup:"⋓",CupCap:"≍",DD:"ⅅ",DDotrahd:"⤑",DJcy:"Ђ",DScy:"Ѕ",DZcy:"Џ",Dagger:"‡",Darr:"↡",Dashv:"⫤",Dcaron:"Ď",Dcy:"Д",Del:"∇",Delta:"Δ",Dfr:"\uD835\uDD07",DiacriticalAcute:"\xb4",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",Diamond:"⋄",DifferentialD:"ⅆ",Dopf:"\uD835\uDD3B",Dot:"\xa8",DotDot:"⃜",DotEqual:"≐",DoubleContourIntegral:"∯",DoubleDot:"\xa8",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",Downarrow:"⇓",Dscr:"\uD835\uDC9F",Dstrok:"Đ",ENG:"Ŋ",ETH:"\xd0",Eacute:"\xc9",Ecaron:"Ě",Ecirc:"\xca",Ecy:"Э",Edot:"Ė",Efr:"\uD835\uDD08",Egrave:"\xc8",Element:"∈",Emacr:"Ē",EmptySmallSquare:"◻",EmptyVerySmallSquare:"▫",Eogon:"Ę",Eopf:"\uD835\uDD3C",Epsilon:"Ε",Equal:"⩵",EqualTilde:"≂",Equilibrium:"⇌",Escr:"ℰ",Esim:"⩳",Eta:"Η",Euml:"\xcb",Exists:"∃",ExponentialE:"ⅇ",Fcy:"Ф",Ffr:"\uD835\uDD09",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",Fopf:"\uD835\uDD3D",ForAll:"∀",Fouriertrf:"ℱ",Fscr:"ℱ",GJcy:"Ѓ",GT:">",Gamma:"Γ",Gammad:"Ϝ",Gbreve:"Ğ",Gcedil:"Ģ",Gcirc:"Ĝ",Gcy:"Г",Gdot:"Ġ",Gfr:"\uD835\uDD0A",Gg:"⋙",Gopf:"\uD835\uDD3E",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"\uD835\uDCA2",Gt:"≫",HARDcy:"Ъ",Hacek:"ˇ",Hat:"^",Hcirc:"Ĥ",Hfr:"ℌ",HilbertSpace:"ℋ",Hopf:"ℍ",HorizontalLine:"─",Hscr:"ℋ",Hstrok:"Ħ",HumpDownHump:"≎",HumpEqual:"≏",IEcy:"Е",IJlig:"IJ",IOcy:"Ё",Iacute:"\xcd",Icirc:"\xce",Icy:"И",Idot:"İ",Ifr:"ℑ",Igrave:"\xcc",Im:"ℑ",Imacr:"Ī",ImaginaryI:"ⅈ",Implies:"⇒",Int:"∬",Integral:"∫",Intersection:"⋂",InvisibleComma:"",InvisibleTimes:"",Iogon:"Į",Iopf:"\uD835\uDD40",Iota:"Ι",Iscr:"ℐ",Itilde:"Ĩ",Iukcy:"І",Iuml:"\xcf",Jcirc:"Ĵ",Jcy:"Й",Jfr:"\uD835\uDD0D",Jopf:"\uD835\uDD41",Jscr:"\uD835\uDCA5",Jsercy:"Ј",Jukcy:"Є",KHcy:"Х",KJcy:"Ќ",Kappa:"Κ",Kcedil:"Ķ",Kcy:"К",Kfr:"\uD835\uDD0E",Kopf:"\uD835\uDD42",Kscr:"\uD835\uDCA6",LJcy:"Љ",LT:"<",Lacute:"Ĺ",Lambda:"Λ",Lang:"⟪",Laplacetrf:"ℒ",Larr:"↞",Lcaron:"Ľ",Lcedil:"Ļ",Lcy:"Л",LeftAngleBracket:"⟨",LeftArrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",LeftRightArrow:"↔",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",Leftarrow:"⇐",Leftrightarrow:"⇔",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",LessLess:"⪡",LessSlantEqual:"⩽",LessTilde:"≲",Lfr:"\uD835\uDD0F",Ll:"⋘",Lleftarrow:"⇚",Lmidot:"Ŀ",LongLeftArrow:"⟵",LongLeftRightArrow:"⟷",LongRightArrow:"⟶",Longleftarrow:"⟸",Longleftrightarrow:"⟺",Longrightarrow:"⟹",Lopf:"\uD835\uDD43",LowerLeftArrow:"↙",LowerRightArrow:"↘",Lscr:"ℒ",Lsh:"↰",Lstrok:"Ł",Lt:"≪",Map:"⤅",Mcy:"М",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"\uD835\uDD10",MinusPlus:"∓",Mopf:"\uD835\uDD44",Mscr:"ℳ",Mu:"Μ",NJcy:"Њ",Nacute:"Ń",Ncaron:"Ň",Ncedil:"Ņ",Ncy:"Н",NegativeMediumSpace:"",NegativeThickSpace:"",NegativeThinSpace:"",NegativeVeryThinSpace:"",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:"\n",Nfr:"\uD835\uDD11",NoBreak:"",NonBreakingSpace:"\xa0",Nopf:"ℕ",Not:"⫬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",Nscr:"\uD835\uDCA9",Ntilde:"\xd1",Nu:"Ν",OElig:"Œ",Oacute:"\xd3",Ocirc:"\xd4",Ocy:"О",Odblac:"Ő",Ofr:"\uD835\uDD12",Ograve:"\xd2",Omacr:"Ō",Omega:"Ω",Omicron:"Ο",Oopf:"\uD835\uDD46",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",Or:"⩔",Oscr:"\uD835\uDCAA",Oslash:"\xd8",Otilde:"\xd5",Otimes:"⨷",Ouml:"\xd6",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",PartialD:"∂",Pcy:"П",Pfr:"\uD835\uDD13",Phi:"Φ",Pi:"Π",PlusMinus:"\xb1",Poincareplane:"ℌ",Popf:"ℙ",Pr:"⪻",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",Prime:"″",Product:"∏",Proportion:"∷",Proportional:"∝",Pscr:"\uD835\uDCAB",Psi:"Ψ",QUOT:'"',Qfr:"\uD835\uDD14",Qopf:"ℚ",Qscr:"\uD835\uDCAC",RBarr:"⤐",REG:"\xae",Racute:"Ŕ",Rang:"⟫",Rarr:"↠",Rarrtl:"⤖",Rcaron:"Ř",Rcedil:"Ŗ",Rcy:"Р",Re:"ℜ",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",Rfr:"ℜ",Rho:"Ρ",RightAngleBracket:"⟩",RightArrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",Rightarrow:"⇒",Ropf:"ℝ",RoundImplies:"⥰",Rrightarrow:"⇛",Rscr:"ℛ",Rsh:"↱",RuleDelayed:"⧴",SHCHcy:"Щ",SHcy:"Ш",SOFTcy:"Ь",Sacute:"Ś",Sc:"⪼",Scaron:"Š",Scedil:"Ş",Scirc:"Ŝ",Scy:"С",Sfr:"\uD835\uDD16",ShortDownArrow:"↓",ShortLeftArrow:"←",ShortRightArrow:"→",ShortUpArrow:"↑",Sigma:"Σ",SmallCircle:"∘",Sopf:"\uD835\uDD4A",Sqrt:"√",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",Sscr:"\uD835\uDCAE",Star:"⋆",Sub:"⋐",Subset:"⋐",SubsetEqual:"⊆",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",SuchThat:"∋",Sum:"∑",Sup:"⋑",Superset:"⊃",SupersetEqual:"⊇",Supset:"⋑",THORN:"\xde",TRADE:"™",TSHcy:"Ћ",TScy:"Ц",Tab:" ",Tau:"Τ",Tcaron:"Ť",Tcedil:"Ţ",Tcy:"Т",Tfr:"\uD835\uDD17",Therefore:"∴",Theta:"Θ",ThickSpace:" ",ThinSpace:" ",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",Topf:"\uD835\uDD4B",TripleDot:"⃛",Tscr:"\uD835\uDCAF",Tstrok:"Ŧ",Uacute:"\xda",Uarr:"↟",Uarrocir:"⥉",Ubrcy:"Ў",Ubreve:"Ŭ",Ucirc:"\xdb",Ucy:"У",Udblac:"Ű",Ufr:"\uD835\uDD18",Ugrave:"\xd9",Umacr:"Ū",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",Uopf:"\uD835\uDD4C",UpArrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",UpEquilibrium:"⥮",UpTee:"⊥",UpTeeArrow:"↥",Uparrow:"⇑",Updownarrow:"⇕",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",Upsilon:"Υ",Uring:"Ů",Uscr:"\uD835\uDCB0",Utilde:"Ũ",Uuml:"\xdc",VDash:"⊫",Vbar:"⫫",Vcy:"В",Vdash:"⊩",Vdashl:"⫦",Vee:"⋁",Verbar:"‖",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"\uD835\uDD19",Vopf:"\uD835\uDD4D",Vscr:"\uD835\uDCB1",Vvdash:"⊪",Wcirc:"Ŵ",Wedge:"⋀",Wfr:"\uD835\uDD1A",Wopf:"\uD835\uDD4E",Wscr:"\uD835\uDCB2",Xfr:"\uD835\uDD1B",Xi:"Ξ",Xopf:"\uD835\uDD4F",Xscr:"\uD835\uDCB3",YAcy:"Я",YIcy:"Ї",YUcy:"Ю",Yacute:"\xdd",Ycirc:"Ŷ",Ycy:"Ы",Yfr:"\uD835\uDD1C",Yopf:"\uD835\uDD50",Yscr:"\uD835\uDCB4",Yuml:"Ÿ",ZHcy:"Ж",Zacute:"Ź",Zcaron:"Ž",Zcy:"З",Zdot:"Ż",ZeroWidthSpace:"",Zeta:"Ζ",Zfr:"ℨ",Zopf:"ℤ",Zscr:"\uD835\uDCB5",aacute:"\xe1",abreve:"ă",ac:"∾",acE:"∾̳",acd:"∿",acirc:"\xe2",acute:"\xb4",acy:"а",aelig:"\xe6",af:"",afr:"\uD835\uDD1E",agrave:"\xe0",alefsym:"ℵ",aleph:"ℵ",alpha:"α",amacr:"ā",amalg:"⨿",amp:"&",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"\xc5",angzarr:"⍼",aogon:"ą",aopf:"\uD835\uDD52",ap:"≈",apE:"⩰",apacir:"⩯",ape:"≊",apid:"≋",apos:"'",approx:"≈",approxeq:"≊",aring:"\xe5",ascr:"\uD835\uDCB6",ast:"*",asymp:"≈",asympeq:"≍",atilde:"\xe3",auml:"\xe4",awconint:"∳",awint:"⨑",bNot:"⫭",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",barvee:"⊽",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",beta:"β",beth:"ℶ",between:"≬",bfr:"\uD835\uDD1F",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bnot:"⌐",bopf:"\uD835\uDD53",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxDL:"╗",boxDR:"╔",boxDl:"╖",boxDr:"╓",boxH:"═",boxHD:"╦",boxHU:"╩",boxHd:"╤",boxHu:"╧",boxUL:"╝",boxUR:"╚",boxUl:"╜",boxUr:"╙",boxV:"║",boxVH:"╬",boxVL:"╣",boxVR:"╠",boxVh:"╫",boxVl:"╢",boxVr:"╟",boxbox:"⧉",boxdL:"╕",boxdR:"╒",boxdl:"┐",boxdr:"┌",boxh:"─",boxhD:"╥",boxhU:"╨",boxhd:"┬",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxuL:"╛",boxuR:"╘",boxul:"┘",boxur:"└",boxv:"│",boxvH:"╪",boxvL:"╡",boxvR:"╞",boxvh:"┼",boxvl:"┤",boxvr:"├",bprime:"‵",breve:"˘",brvbar:"\xa6",bscr:"\uD835\uDCB7",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",bumpeq:"≏",cacute:"ć",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",caps:"∩︀",caret:"⁁",caron:"ˇ",ccaps:"⩍",ccaron:"č",ccedil:"\xe7",ccirc:"ĉ",ccups:"⩌",ccupssm:"⩐",cdot:"ċ",cedil:"\xb8",cemptyv:"⦲",cent:"\xa2",centerdot:"\xb7",cfr:"\uD835\uDD20",chcy:"ч",check:"✓",checkmark:"✓",chi:"χ",cir:"○",cirE:"⧃",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledR:"\xae",circledS:"Ⓢ",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",clubs:"♣",clubsuit:"♣",colon:":",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",conint:"∮",copf:"\uD835\uDD54",coprod:"∐",copy:"\xa9",copysr:"℗",crarr:"↵",cross:"✗",cscr:"\uD835\uDCB8",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cup:"∪",cupbrcap:"⩈",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"\xa4",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dArr:"⇓",dHar:"⥥",dagger:"†",daleth:"ℸ",darr:"↓",dash:"‐",dashv:"⊣",dbkarow:"⤏",dblac:"˝",dcaron:"ď",dcy:"д",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",ddotseq:"⩷",deg:"\xb0",delta:"δ",demptyv:"⦱",dfisht:"⥿",dfr:"\uD835\uDD21",dharl:"⇃",dharr:"⇂",diam:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"\xa8",digamma:"ϝ",disin:"⋲",div:"\xf7",divide:"\xf7",divideontimes:"⋇",divonx:"⋇",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",dopf:"\uD835\uDD55",dot:"˙",doteq:"≐",doteqdot:"≑",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",downarrow:"↓",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",dscr:"\uD835\uDCB9",dscy:"ѕ",dsol:"⧶",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",dzcy:"џ",dzigrarr:"⟿",eDDot:"⩷",eDot:"≑",eacute:"\xe9",easter:"⩮",ecaron:"ě",ecir:"≖",ecirc:"\xea",ecolon:"≕",ecy:"э",edot:"ė",ee:"ⅇ",efDot:"≒",efr:"\uD835\uDD22",eg:"⪚",egrave:"\xe8",egs:"⪖",egsdot:"⪘",el:"⪙",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",emacr:"ē",empty:"∅",emptyset:"∅",emptyv:"∅",emsp13:" ",emsp14:" ",emsp:" ",eng:"ŋ",ensp:" ",eogon:"ę",eopf:"\uD835\uDD56",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",equals:"=",equest:"≟",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erDot:"≓",erarr:"⥱",escr:"ℯ",esdot:"≐",esim:"≂",eta:"η",eth:"\xf0",euml:"\xeb",euro:"€",excl:"!",exist:"∃",expectation:"ℰ",exponentiale:"ⅇ",fallingdotseq:"≒",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",ffr:"\uD835\uDD23",filig:"fi",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",fopf:"\uD835\uDD57",forall:"∀",fork:"⋔",forkv:"⫙",fpartint:"⨍",frac12:"\xbd",frac13:"⅓",frac14:"\xbc",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"\xbe",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"\uD835\uDCBB",gE:"≧",gEl:"⪌",gacute:"ǵ",gamma:"γ",gammad:"ϝ",gap:"⪆",gbreve:"ğ",gcirc:"ĝ",gcy:"г",gdot:"ġ",ge:"≥",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",gfr:"\uD835\uDD24",gg:"≫",ggg:"⋙",gimel:"ℷ",gjcy:"ѓ",gl:"≷",glE:"⪒",gla:"⪥",glj:"⪤",gnE:"≩",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",gopf:"\uD835\uDD58",grave:"`",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",hArr:"⇔",hairsp:" ",half:"\xbd",hamilt:"ℋ",hardcy:"ъ",harr:"↔",harrcir:"⥈",harrw:"↭",hbar:"ℏ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"\uD835\uDD25",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"\uD835\uDD59",horbar:"―",hscr:"\uD835\uDCBD",hslash:"ℏ",hstrok:"ħ",hybull:"⁃",hyphen:"‐",iacute:"\xed",ic:"",icirc:"\xee",icy:"и",iecy:"е",iexcl:"\xa1",iff:"⇔",ifr:"\uD835\uDD26",igrave:"\xec",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",ijlig:"ij",imacr:"ī",image:"ℑ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",int:"∫",intcal:"⊺",integers:"ℤ",intercal:"⊺",intlarhk:"⨗",intprod:"⨼",iocy:"ё",iogon:"į",iopf:"\uD835\uDD5A",iota:"ι",iprod:"⨼",iquest:"\xbf",iscr:"\uD835\uDCBE",isin:"∈",isinE:"⋹",isindot:"⋵",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"",itilde:"ĩ",iukcy:"і",iuml:"\xef",jcirc:"ĵ",jcy:"й",jfr:"\uD835\uDD27",jmath:"ȷ",jopf:"\uD835\uDD5B",jscr:"\uD835\uDCBF",jsercy:"ј",jukcy:"є",kappa:"κ",kappav:"ϰ",kcedil:"ķ",kcy:"к",kfr:"\uD835\uDD28",kgreen:"ĸ",khcy:"х",kjcy:"ќ",kopf:"\uD835\uDD5C",kscr:"\uD835\uDCC0",lAarr:"⇚",lArr:"⇐",lAtail:"⤛",lBarr:"⤎",lE:"≦",lEg:"⪋",lHar:"⥢",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",lambda:"λ",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",laquo:"\xab",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",latail:"⤙",late:"⪭",lates:"⪭︀",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",lcaron:"ľ",lcedil:"ļ",lceil:"⌈",lcub:"{",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",leftarrow:"←",leftarrowtail:"↢",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",leftthreetimes:"⋋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",lessgtr:"≶",lesssim:"≲",lfisht:"⥼",lfloor:"⌊",lfr:"\uD835\uDD29",lg:"≶",lgE:"⪑",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",ljcy:"љ",ll:"≪",llarr:"⇇",llcorner:"⌞",llhard:"⥫",lltri:"◺",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnE:"≨",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",longleftrightarrow:"⟷",longmapsto:"⟼",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",lopf:"\uD835\uDD5D",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"",lrtri:"⊿",lsaquo:"‹",lscr:"\uD835\uDCC1",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",lstrok:"ł",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltrPar:"⦖",ltri:"◃",ltrie:"⊴",ltrif:"◂",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",mDDot:"∺",macr:"\xaf",male:"♂",malt:"✠",maltese:"✠",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",mcy:"м",mdash:"—",measuredangle:"∡",mfr:"\uD835\uDD2A",mho:"℧",micro:"\xb5",mid:"∣",midast:"*",midcir:"⫰",middot:"\xb7",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",mopf:"\uD835\uDD5E",mp:"∓",mscr:"\uD835\uDCC2",mstpos:"∾",mu:"μ",multimap:"⊸",mumap:"⊸",nGg:"⋙̸",nGt:"≫⃒",nGtv:"≫̸",nLeftarrow:"⇍",nLeftrightarrow:"⇎",nLl:"⋘̸",nLt:"≪⃒",nLtv:"≪̸",nRightarrow:"⇏",nVDash:"⊯",nVdash:"⊮",nabla:"∇",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:"\xa0",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",ncaron:"ň",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",ncy:"н",ndash:"–",ne:"≠",neArr:"⇗",nearhk:"⤤",nearr:"↗",nearrow:"↗",nedot:"≐̸",nequiv:"≢",nesear:"⤨",nesim:"≂̸",nexist:"∄",nexists:"∄",nfr:"\uD835\uDD2B",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",ngsim:"≵",ngt:"≯",ngtr:"≯",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",njcy:"њ",nlArr:"⇍",nlE:"≦̸",nlarr:"↚",nldr:"‥",nle:"≰",nleftarrow:"↚",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nlsim:"≴",nlt:"≮",nltri:"⋪",nltrie:"⋬",nmid:"∤",nopf:"\uD835\uDD5F",not:"\xac",notin:"∉",notinE:"⋹̸",notindot:"⋵̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",nscr:"\uD835\uDCC3",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",ntilde:"\xf1",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",nu:"ν",num:"#",numero:"№",numsp:" ",nvDash:"⊭",nvHarr:"⤄",nvap:"≍⃒",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwArr:"⇖",nwarhk:"⤣",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",oS:"Ⓢ",oacute:"\xf3",oast:"⊛",ocir:"⊚",ocirc:"\xf4",ocy:"о",odash:"⊝",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",oelig:"œ",ofcir:"⦿",ofr:"\uD835\uDD2C",ogon:"˛",ograve:"\xf2",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",omacr:"ō",omega:"ω",omicron:"ο",omid:"⦶",ominus:"⊖",oopf:"\uD835\uDD60",opar:"⦷",operp:"⦹",oplus:"⊕",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"\xaa",ordm:"\xba",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oscr:"ℴ",oslash:"\xf8",osol:"⊘",otilde:"\xf5",otimes:"⊗",otimesas:"⨶",ouml:"\xf6",ovbar:"⌽",par:"∥",para:"\xb6",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",pfr:"\uD835\uDD2D",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",plusmn:"\xb1",plussim:"⨦",plustwo:"⨧",pm:"\xb1",pointint:"⨕",popf:"\uD835\uDD61",pound:"\xa3",pr:"≺",prE:"⪳",prap:"⪷",prcue:"≼",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",prime:"′",primes:"ℙ",prnE:"⪵",prnap:"⪹",prnsim:"⋨",prod:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",propto:"∝",prsim:"≾",prurel:"⊰",pscr:"\uD835\uDCC5",psi:"ψ",puncsp:" ",qfr:"\uD835\uDD2E",qint:"⨌",qopf:"\uD835\uDD62",qprime:"⁗",qscr:"\uD835\uDCC6",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',rAarr:"⇛",rArr:"⇒",rAtail:"⤜",rBarr:"⤏",rHar:"⥤",race:"∽̱",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"\xbb",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",rarrtl:"↣",rarrw:"↝",ratail:"⤚",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",rcaron:"ř",rcedil:"ŗ",rceil:"⌉",rcub:"}",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",reg:"\xae",rfisht:"⥽",rfloor:"⌋",rfr:"\uD835\uDD2F",rhard:"⇁",rharu:"⇀",rharul:"⥬",rho:"ρ",rhov:"ϱ",rightarrow:"→",rightarrowtail:"↣",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",rightthreetimes:"⋌",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"\uD835\uDD63",roplus:"⨮",rotimes:"⨵",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",rsaquo:"›",rscr:"\uD835\uDCC7",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",ruluhar:"⥨",rx:"℞",sacute:"ś",sbquo:"‚",sc:"≻",scE:"⪴",scap:"⪸",scaron:"š",sccue:"≽",sce:"⪰",scedil:"ş",scirc:"ŝ",scnE:"⪶",scnap:"⪺",scnsim:"⋩",scpolint:"⨓",scsim:"≿",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",seArr:"⇘",searhk:"⤥",searr:"↘",searrow:"↘",sect:"\xa7",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",sfr:"\uD835\uDD30",sfrown:"⌢",sharp:"♯",shchcy:"щ",shcy:"ш",shortmid:"∣",shortparallel:"∥",shy:"\xad",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",sopf:"\uD835\uDD64",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",square:"□",squarf:"▪",squf:"▪",srarr:"→",sscr:"\uD835\uDCC8",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"\xaf",sub:"⊂",subE:"⫅",subdot:"⪽",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",sum:"∑",sung:"♪",sup1:"\xb9",sup2:"\xb2",sup3:"\xb3",sup:"⊃",supE:"⫆",supdot:"⪾",supdsub:"⫘",supe:"⊇",supedot:"⫄",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swArr:"⇙",swarhk:"⤦",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"\xdf",target:"⌖",tau:"τ",tbrk:"⎴",tcaron:"ť",tcedil:"ţ",tcy:"т",tdot:"⃛",telrec:"⌕",tfr:"\uD835\uDD31",there4:"∴",therefore:"∴",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",thinsp:" ",thkap:"≈",thksim:"∼",thorn:"\xfe",tilde:"˜",times:"\xd7",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",topf:"\uD835\uDD65",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",tscr:"\uD835\uDCC9",tscy:"ц",tshcy:"ћ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",uArr:"⇑",uHar:"⥣",uacute:"\xfa",uarr:"↑",ubrcy:"ў",ubreve:"ŭ",ucirc:"\xfb",ucy:"у",udarr:"⇅",udblac:"ű",udhar:"⥮",ufisht:"⥾",ufr:"\uD835\uDD32",ugrave:"\xf9",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",umacr:"ū",uml:"\xa8",uogon:"ų",uopf:"\uD835\uDD66",uparrow:"↑",updownarrow:"↕",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",upsi:"υ",upsih:"ϒ",upsilon:"υ",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",uring:"ů",urtri:"◹",uscr:"\uD835\uDCCA",utdot:"⋰",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",uuml:"\xfc",uwangle:"⦧",vArr:"⇕",vBar:"⫨",vBarv:"⫩",vDash:"⊨",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vcy:"в",vdash:"⊢",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",verbar:"|",vert:"|",vfr:"\uD835\uDD33",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",vopf:"\uD835\uDD67",vprop:"∝",vrtri:"⊳",vscr:"\uD835\uDCCB",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",vzigzag:"⦚",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",wedgeq:"≙",weierp:"℘",wfr:"\uD835\uDD34",wopf:"\uD835\uDD68",wp:"℘",wr:"≀",wreath:"≀",wscr:"\uD835\uDCCC",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",xfr:"\uD835\uDD35",xhArr:"⟺",xharr:"⟷",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",xopf:"\uD835\uDD69",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",xscr:"\uD835\uDCCD",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",yacute:"\xfd",yacy:"я",ycirc:"ŷ",ycy:"ы",yen:"\xa5",yfr:"\uD835\uDD36",yicy:"ї",yopf:"\uD835\uDD6A",yscr:"\uD835\uDCCE",yucy:"ю",yuml:"\xff",zacute:"ź",zcaron:"ž",zcy:"з",zdot:"ż",zeetrf:"ℨ",zeta:"ζ",zfr:"\uD835\uDD37",zhcy:"ж",zigrarr:"⇝",zopf:"\uD835\uDD6B",zscr:"\uD835\uDCCF",zwj:"",zwnj:""},ey={}.hasOwnProperty;function ez(a){return!!ey.call(ex,a)&&ex[a]}let eA={name:"characterReference",tokenize:function(a,b,c){let d,e,f=this,g=0;return function(b){return a.enter("characterReference"),a.enter("characterReferenceMarker"),a.consume(b),a.exit("characterReferenceMarker"),h};function h(b){return 35===b?(a.enter("characterReferenceMarkerNumeric"),a.consume(b),a.exit("characterReferenceMarkerNumeric"),i):(a.enter("characterReferenceValue"),d=31,e=dP,j(b))}function i(b){return 88===b||120===b?(a.enter("characterReferenceMarkerHexadecimal"),a.consume(b),a.exit("characterReferenceMarkerHexadecimal"),a.enter("characterReferenceValue"),d=6,e=dT,j):(a.enter("characterReferenceValue"),d=7,e=dS,j(b))}function j(h){if(59===h&&g){let d=a.exit("characterReferenceValue");return e!==dP||ez(f.sliceSerialize(d))?(a.enter("characterReferenceMarker"),a.consume(h),a.exit("characterReferenceMarker"),a.exit("characterReference"),b):c(h)}return e(h)&&g++<d?(a.consume(h),j):c(h)}}},eB={name:"characterEscape",tokenize:function(a,b,c){return function(b){return a.enter("characterEscape"),a.enter("escapeMarker"),a.consume(b),a.exit("escapeMarker"),d};function d(d){return dU(d)?(a.enter("characterEscapeValue"),a.consume(d),a.exit("characterEscapeValue"),a.exit("characterEscape"),b):c(d)}}},eC={name:"lineEnding",tokenize:function(a,b){return function(c){return a.enter("lineEnding"),a.consume(c),a.exit("lineEnding"),d_(a,b,"linePrefix")}}};function eD(a,b,c){let d=[],e=-1;for(;++e<a.length;){let f=a[e].resolveAll;f&&!d.includes(f)&&(b=f(b,c),d.push(f))}return b}let eE={name:"labelEnd",resolveAll:function(a){let b=-1,c=[];for(;++b<a.length;){let d=a[b][1];if(c.push(a[b]),"labelImage"===d.type||"labelLink"===d.type||"labelEnd"===d.type){let a="labelImage"===d.type?4:2;d.type="data",b+=a}}return a.length!==c.length&&dI(a,0,a.length,c),a},resolveTo:function(a,b){let c,d,e,f,g=a.length,h=0;for(;g--;)if(c=a[g][1],d){if("link"===c.type||"labelLink"===c.type&&c._inactive)break;"enter"===a[g][0]&&"labelLink"===c.type&&(c._inactive=!0)}else if(e){if("enter"===a[g][0]&&("labelImage"===c.type||"labelLink"===c.type)&&!c._balanced&&(d=g,"labelLink"!==c.type)){h=2;break}}else"labelEnd"===c.type&&(e=g);let i={type:"labelLink"===a[d][1].type?"link":"image",start:{...a[d][1].start},end:{...a[a.length-1][1].end}},j={type:"label",start:{...a[d][1].start},end:{...a[e][1].end}},k={type:"labelText",start:{...a[d+h+2][1].end},end:{...a[e-2][1].start}};return f=dJ(f=[["enter",i,b],["enter",j,b]],a.slice(d+1,d+h+3)),f=dJ(f,[["enter",k,b]]),f=dJ(f,eD(b.parser.constructs.insideSpan.null,a.slice(d+h+4,e-3),b)),f=dJ(f,[["exit",k,b],a[e-2],a[e-1],["exit",j,b]]),f=dJ(f,a.slice(e+1)),f=dJ(f,[["exit",i,b]]),dI(a,d,a.length,f),a},tokenize:function(a,b,c){let d,e,f=this,g=f.events.length;for(;g--;)if(("labelImage"===f.events[g][1].type||"labelLink"===f.events[g][1].type)&&!f.events[g][1]._balanced){d=f.events[g][1];break}return function(b){return d?d._inactive?k(b):(e=f.parser.defined.includes(em(f.sliceSerialize({start:d.end,end:f.now()}))),a.enter("labelEnd"),a.enter("labelMarker"),a.consume(b),a.exit("labelMarker"),a.exit("labelEnd"),h):c(b)};function h(b){return 40===b?a.attempt(eF,j,e?j:k)(b):91===b?a.attempt(eG,j,e?i:k)(b):e?j(b):k(b)}function i(b){return a.attempt(eH,j,k)(b)}function j(a){return b(a)}function k(a){return d._balanced=!0,c(a)}}},eF={tokenize:function(a,b,c){return function(b){return a.enter("resource"),a.enter("resourceMarker"),a.consume(b),a.exit("resourceMarker"),d};function d(b){return dW(b)?el(a,e)(b):e(b)}function e(b){return 41===b?j(b):ei(a,f,g,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(b)}function f(b){return dW(b)?el(a,h)(b):j(b)}function g(a){return c(a)}function h(b){return 34===b||39===b||40===b?ek(a,i,c,"resourceTitle","resourceTitleMarker","resourceTitleString")(b):j(b)}function i(b){return dW(b)?el(a,j)(b):j(b)}function j(d){return 41===d?(a.enter("resourceMarker"),a.consume(d),a.exit("resourceMarker"),a.exit("resource"),b):c(d)}}},eG={tokenize:function(a,b,c){let d=this;return function(b){return ej.call(d,a,e,f,"reference","referenceMarker","referenceString")(b)};function e(a){return d.parser.defined.includes(em(d.sliceSerialize(d.events[d.events.length-1][1]).slice(1,-1)))?b(a):c(a)}function f(a){return c(a)}}},eH={tokenize:function(a,b,c){return function(b){return a.enter("reference"),a.enter("referenceMarker"),a.consume(b),a.exit("referenceMarker"),d};function d(d){return 93===d?(a.enter("referenceMarker"),a.consume(d),a.exit("referenceMarker"),a.exit("reference"),b):c(d)}}},eI={name:"labelStartImage",resolveAll:eE.resolveAll,tokenize:function(a,b,c){let d=this;return function(b){return a.enter("labelImage"),a.enter("labelImageMarker"),a.consume(b),a.exit("labelImageMarker"),e};function e(b){return 91===b?(a.enter("labelMarker"),a.consume(b),a.exit("labelMarker"),a.exit("labelImage"),f):c(b)}function f(a){return 94===a&&"_hiddenFootnoteSupport"in d.parser.constructs?c(a):b(a)}}};function eJ(a){return null===a||dW(a)||dZ(a)?1:dY(a)?2:void 0}let eK={name:"attention",resolveAll:function(a,b){let c,d,e,f,g,h,i,j,k=-1;for(;++k<a.length;)if("enter"===a[k][0]&&"attentionSequence"===a[k][1].type&&a[k][1]._close){for(c=k;c--;)if("exit"===a[c][0]&&"attentionSequence"===a[c][1].type&&a[c][1]._open&&b.sliceSerialize(a[c][1]).charCodeAt(0)===b.sliceSerialize(a[k][1]).charCodeAt(0)){if((a[c][1]._close||a[k][1]._open)&&(a[k][1].end.offset-a[k][1].start.offset)%3&&!((a[c][1].end.offset-a[c][1].start.offset+a[k][1].end.offset-a[k][1].start.offset)%3))continue;h=a[c][1].end.offset-a[c][1].start.offset>1&&a[k][1].end.offset-a[k][1].start.offset>1?2:1;let l={...a[c][1].end},m={...a[k][1].start};eL(l,-h),eL(m,h),f={type:h>1?"strongSequence":"emphasisSequence",start:l,end:{...a[c][1].end}},g={type:h>1?"strongSequence":"emphasisSequence",start:{...a[k][1].start},end:m},e={type:h>1?"strongText":"emphasisText",start:{...a[c][1].end},end:{...a[k][1].start}},d={type:h>1?"strong":"emphasis",start:{...f.start},end:{...g.end}},a[c][1].end={...f.start},a[k][1].start={...g.end},i=[],a[c][1].end.offset-a[c][1].start.offset&&(i=dJ(i,[["enter",a[c][1],b],["exit",a[c][1],b]])),i=dJ(i,[["enter",d,b],["enter",f,b],["exit",f,b],["enter",e,b]]),i=dJ(i,eD(b.parser.constructs.insideSpan.null,a.slice(c+1,k),b)),i=dJ(i,[["exit",e,b],["enter",g,b],["exit",g,b],["exit",d,b]]),a[k][1].end.offset-a[k][1].start.offset?(j=2,i=dJ(i,[["enter",a[k][1],b],["exit",a[k][1],b]])):j=0,dI(a,c-1,k-c+3,i),k=c+i.length-j-2;break}}for(k=-1;++k<a.length;)"attentionSequence"===a[k][1].type&&(a[k][1].type="data");return a},tokenize:function(a,b){let c,d=this.parser.constructs.attentionMarkers.null,e=this.previous,f=eJ(e);return function(g){return c=g,a.enter("attentionSequence"),function g(h){if(h===c)return a.consume(h),g;let i=a.exit("attentionSequence"),j=eJ(h),k=!j||2===j&&f||d.includes(h),l=!f||2===f&&j||d.includes(e);return i._open=!!(42===c?k:k&&(f||!l)),i._close=!!(42===c?l:l&&(j||!k)),b(h)}(g)}}};function eL(a,b){a.column+=b,a.offset+=b,a._bufferIndex+=b}let eM={name:"labelStartLink",resolveAll:eE.resolveAll,tokenize:function(a,b,c){let d=this;return function(b){return a.enter("labelLink"),a.enter("labelMarker"),a.consume(b),a.exit("labelMarker"),a.exit("labelLink"),e};function e(a){return 94===a&&"_hiddenFootnoteSupport"in d.parser.constructs?c(a):b(a)}}},eN={42:ee,43:ee,45:ee,48:ee,49:ee,50:ee,51:ee,52:ee,53:ee,54:ee,55:ee,56:ee,57:ee,62:eh},eO={91:{name:"definition",tokenize:function(a,b,c){let d,e=this;return function(b){var d;return a.enter("definition"),d=b,ej.call(e,a,f,c,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)};function f(b){return(d=em(e.sliceSerialize(e.events[e.events.length-1][1]).slice(1,-1)),58===b)?(a.enter("definitionMarker"),a.consume(b),a.exit("definitionMarker"),g):c(b)}function g(b){return dW(b)?el(a,h)(b):h(b)}function h(b){return ei(a,i,c,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function i(b){return a.attempt(en,j,j)(b)}function j(b){return dX(b)?d_(a,k,"whitespace")(b):k(b)}function k(f){return null===f||dV(f)?(a.exit("definition"),e.parser.defined.push(d),b(f)):c(f)}}}},eP={[-2]:eo,[-1]:eo,32:eo},eQ={35:{name:"headingAtx",resolve:function(a,b){let c,d,e=a.length-2,f=3;return"whitespace"===a[3][1].type&&(f+=2),e-2>f&&"whitespace"===a[e][1].type&&(e-=2),"atxHeadingSequence"===a[e][1].type&&(f===e-1||e-4>f&&"whitespace"===a[e-2][1].type)&&(e-=f+1===e?2:4),e>f&&(c={type:"atxHeadingText",start:a[f][1].start,end:a[e][1].end},d={type:"chunkText",start:a[f][1].start,end:a[e][1].end,contentType:"text"},dI(a,f,e-f+1,[["enter",c,b],["enter",d,b],["exit",d,b],["exit",c,b]])),a},tokenize:function(a,b,c){let d=0;return function(e){var f;return a.enter("atxHeading"),f=e,a.enter("atxHeadingSequence"),function e(f){return 35===f&&d++<6?(a.consume(f),e):null===f||dW(f)?(a.exit("atxHeadingSequence"),function c(d){return 35===d?(a.enter("atxHeadingSequence"),function b(d){return 35===d?(a.consume(d),b):(a.exit("atxHeadingSequence"),c(d))}(d)):null===d||dV(d)?(a.exit("atxHeading"),b(d)):dX(d)?d_(a,c,"whitespace")(d):(a.enter("atxHeadingText"),function b(d){return null===d||35===d||dW(d)?(a.exit("atxHeadingText"),c(d)):(a.consume(d),b)}(d))}(f)):c(f)}(f)}}},42:ed,45:[eq,ed],60:{concrete:!0,name:"htmlFlow",resolveTo:function(a){let b=a.length;for(;b--&&("enter"!==a[b][0]||"htmlFlow"!==a[b][1].type););return b>1&&"linePrefix"===a[b-2][1].type&&(a[b][1].start=a[b-2][1].start,a[b+1][1].start=a[b-2][1].start,a.splice(b-2,2)),a},tokenize:function(a,b,c){let d,e,f,g,h,i=this;return function(b){var c;return c=b,a.enter("htmlFlow"),a.enter("htmlFlowData"),a.consume(c),j};function j(g){return 33===g?(a.consume(g),k):47===g?(a.consume(g),e=!0,n):63===g?(a.consume(g),d=3,i.interrupt?b:G):dO(g)?(a.consume(g),f=String.fromCharCode(g),o):c(g)}function k(e){return 45===e?(a.consume(e),d=2,l):91===e?(a.consume(e),d=5,g=0,m):dO(e)?(a.consume(e),d=4,i.interrupt?b:G):c(e)}function l(d){return 45===d?(a.consume(d),i.interrupt?b:G):c(d)}function m(d){let e="CDATA[";return d===e.charCodeAt(g++)?(a.consume(d),g===e.length)?i.interrupt?b:y:m:c(d)}function n(b){return dO(b)?(a.consume(b),f=String.fromCharCode(b),o):c(b)}function o(g){if(null===g||47===g||62===g||dW(g)){let h=47===g,j=f.toLowerCase();return!h&&!e&&es.includes(j)?(d=1,i.interrupt?b(g):y(g)):er.includes(f.toLowerCase())?(d=6,h)?(a.consume(g),p):i.interrupt?b(g):y(g):(d=7,i.interrupt&&!i.parser.lazy[i.now().line]?c(g):e?function b(c){return dX(c)?(a.consume(c),b):w(c)}(g):q(g))}return 45===g||dP(g)?(a.consume(g),f+=String.fromCharCode(g),o):c(g)}function p(d){return 62===d?(a.consume(d),i.interrupt?b:y):c(d)}function q(b){return 47===b?(a.consume(b),w):58===b||95===b||dO(b)?(a.consume(b),r):dX(b)?(a.consume(b),q):w(b)}function r(b){return 45===b||46===b||58===b||95===b||dP(b)?(a.consume(b),r):s(b)}function s(b){return 61===b?(a.consume(b),t):dX(b)?(a.consume(b),s):q(b)}function t(b){return null===b||60===b||61===b||62===b||96===b?c(b):34===b||39===b?(a.consume(b),h=b,u):dX(b)?(a.consume(b),t):function b(c){return null===c||34===c||39===c||47===c||60===c||61===c||62===c||96===c||dW(c)?s(c):(a.consume(c),b)}(b)}function u(b){return b===h?(a.consume(b),h=null,v):null===b||dV(b)?c(b):(a.consume(b),u)}function v(a){return 47===a||62===a||dX(a)?q(a):c(a)}function w(b){return 62===b?(a.consume(b),x):c(b)}function x(b){return null===b||dV(b)?y(b):dX(b)?(a.consume(b),x):c(b)}function y(b){return 45===b&&2===d?(a.consume(b),C):60===b&&1===d?(a.consume(b),D):62===b&&4===d?(a.consume(b),H):63===b&&3===d?(a.consume(b),G):93===b&&5===d?(a.consume(b),F):dV(b)&&(6===d||7===d)?(a.exit("htmlFlowData"),a.check(et,I,z)(b)):null===b||dV(b)?(a.exit("htmlFlowData"),z(b)):(a.consume(b),y)}function z(b){return a.check(eu,A,I)(b)}function A(b){return a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),B}function B(b){return null===b||dV(b)?z(b):(a.enter("htmlFlowData"),y(b))}function C(b){return 45===b?(a.consume(b),G):y(b)}function D(b){return 47===b?(a.consume(b),f="",E):y(b)}function E(b){if(62===b){let c=f.toLowerCase();return es.includes(c)?(a.consume(b),H):y(b)}return dO(b)&&f.length<8?(a.consume(b),f+=String.fromCharCode(b),E):y(b)}function F(b){return 93===b?(a.consume(b),G):y(b)}function G(b){return 62===b?(a.consume(b),H):45===b&&2===d?(a.consume(b),G):y(b)}function H(b){return null===b||dV(b)?(a.exit("htmlFlowData"),I(b)):(a.consume(b),H)}function I(c){return a.exit("htmlFlow"),b(c)}}},61:eq,95:ed,96:ew,126:ew},eR={38:eA,92:eB},eS={[-5]:eC,[-4]:eC,[-3]:eC,33:eI,38:eA,42:eK,60:[{name:"autolink",tokenize:function(a,b,c){let d=0;return function(b){return a.enter("autolink"),a.enter("autolinkMarker"),a.consume(b),a.exit("autolinkMarker"),a.enter("autolinkProtocol"),e};function e(b){return dO(b)?(a.consume(b),f):64===b?c(b):h(b)}function f(b){return 43===b||45===b||46===b||dP(b)?(d=1,function b(c){return 58===c?(a.consume(c),d=0,g):(43===c||45===c||46===c||dP(c))&&d++<32?(a.consume(c),b):(d=0,h(c))}(b)):h(b)}function g(d){return 62===d?(a.exit("autolinkProtocol"),a.enter("autolinkMarker"),a.consume(d),a.exit("autolinkMarker"),a.exit("autolink"),b):null===d||32===d||60===d||dR(d)?c(d):(a.consume(d),g)}function h(b){return 64===b?(a.consume(b),i):dQ(b)?(a.consume(b),h):c(b)}function i(e){return dP(e)?function e(f){return 46===f?(a.consume(f),d=0,i):62===f?(a.exit("autolinkProtocol").type="autolinkEmail",a.enter("autolinkMarker"),a.consume(f),a.exit("autolinkMarker"),a.exit("autolink"),b):function b(f){if((45===f||dP(f))&&d++<63){let c=45===f?b:e;return a.consume(f),c}return c(f)}(f)}(e):c(e)}}},{name:"htmlText",tokenize:function(a,b,c){let d,e,f,g=this;return function(b){return a.enter("htmlText"),a.enter("htmlTextData"),a.consume(b),h};function h(b){return 33===b?(a.consume(b),i):47===b?(a.consume(b),u):63===b?(a.consume(b),s):dO(b)?(a.consume(b),w):c(b)}function i(b){return 45===b?(a.consume(b),j):91===b?(a.consume(b),e=0,n):dO(b)?(a.consume(b),r):c(b)}function j(b){return 45===b?(a.consume(b),m):c(b)}function k(b){return null===b?c(b):45===b?(a.consume(b),l):dV(b)?(f=k,E(b)):(a.consume(b),k)}function l(b){return 45===b?(a.consume(b),m):k(b)}function m(a){return 62===a?D(a):45===a?l(a):k(a)}function n(b){let d="CDATA[";return b===d.charCodeAt(e++)?(a.consume(b),e===d.length?o:n):c(b)}function o(b){return null===b?c(b):93===b?(a.consume(b),p):dV(b)?(f=o,E(b)):(a.consume(b),o)}function p(b){return 93===b?(a.consume(b),q):o(b)}function q(b){return 62===b?D(b):93===b?(a.consume(b),q):o(b)}function r(b){return null===b||62===b?D(b):dV(b)?(f=r,E(b)):(a.consume(b),r)}function s(b){return null===b?c(b):63===b?(a.consume(b),t):dV(b)?(f=s,E(b)):(a.consume(b),s)}function t(a){return 62===a?D(a):s(a)}function u(b){return dO(b)?(a.consume(b),v):c(b)}function v(b){return 45===b||dP(b)?(a.consume(b),v):function b(c){return dV(c)?(f=b,E(c)):dX(c)?(a.consume(c),b):D(c)}(b)}function w(b){return 45===b||dP(b)?(a.consume(b),w):47===b||62===b||dW(b)?x(b):c(b)}function x(b){return 47===b?(a.consume(b),D):58===b||95===b||dO(b)?(a.consume(b),y):dV(b)?(f=x,E(b)):dX(b)?(a.consume(b),x):D(b)}function y(b){return 45===b||46===b||58===b||95===b||dP(b)?(a.consume(b),y):function b(c){return 61===c?(a.consume(c),z):dV(c)?(f=b,E(c)):dX(c)?(a.consume(c),b):x(c)}(b)}function z(b){return null===b||60===b||61===b||62===b||96===b?c(b):34===b||39===b?(a.consume(b),d=b,A):dV(b)?(f=z,E(b)):dX(b)?(a.consume(b),z):(a.consume(b),B)}function A(b){return b===d?(a.consume(b),d=void 0,C):null===b?c(b):dV(b)?(f=A,E(b)):(a.consume(b),A)}function B(b){return null===b||34===b||39===b||60===b||61===b||96===b?c(b):47===b||62===b||dW(b)?x(b):(a.consume(b),B)}function C(a){return 47===a||62===a||dW(a)?x(a):c(a)}function D(d){return 62===d?(a.consume(d),a.exit("htmlTextData"),a.exit("htmlText"),b):c(d)}function E(b){return a.exit("htmlTextData"),a.enter("lineEnding"),a.consume(b),a.exit("lineEnding"),F}function F(b){return dX(b)?d_(a,G,"linePrefix",g.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):G(b)}function G(b){return a.enter("htmlTextData"),f(b)}}}],91:eM,92:[{name:"hardBreakEscape",tokenize:function(a,b,c){return function(b){return a.enter("hardBreakEscape"),a.consume(b),d};function d(d){return dV(d)?(a.exit("hardBreakEscape"),b(d)):c(d)}}},eB],93:eE,95:eK,96:{name:"codeText",previous:function(a){return 96!==a||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(a){let b,c,d=a.length-4,e=3;if(("lineEnding"===a[3][1].type||"space"===a[e][1].type)&&("lineEnding"===a[d][1].type||"space"===a[d][1].type)){for(b=e;++b<d;)if("codeTextData"===a[b][1].type){a[e][1].type="codeTextPadding",a[d][1].type="codeTextPadding",e+=2,d-=2;break}}for(b=e-1,d++;++b<=d;)void 0===c?b!==d&&"lineEnding"!==a[b][1].type&&(c=b):(b===d||"lineEnding"===a[b][1].type)&&(a[c][1].type="codeTextData",b!==c+2&&(a[c][1].end=a[b-1][1].end,a.splice(c+2,b-c-2),d-=b-c-2,b=c+2),c=void 0);return a},tokenize:function(a,b,c){let d,e,f=0;return function(b){return a.enter("codeText"),a.enter("codeTextSequence"),function b(c){return 96===c?(a.consume(c),f++,b):(a.exit("codeTextSequence"),g(c))}(b)};function g(i){return null===i?c(i):32===i?(a.enter("space"),a.consume(i),a.exit("space"),g):96===i?(e=a.enter("codeTextSequence"),d=0,function c(g){return 96===g?(a.consume(g),d++,c):d===f?(a.exit("codeTextSequence"),a.exit("codeText"),b(g)):(e.type="codeTextData",h(g))}(i)):dV(i)?(a.enter("lineEnding"),a.consume(i),a.exit("lineEnding"),g):(a.enter("codeTextData"),h(i))}function h(b){return null===b||32===b||96===b||dV(b)?(a.exit("codeTextData"),g(b)):(a.consume(b),h)}}}},eT={null:[eK,d7]},eU={null:[42,95]},eV={null:[]},eW=/[\0\t\n\r]/g;function eX(a,b){let c=Number.parseInt(a,b);return c<9||11===c||c>13&&c<32||c>126&&c<160||c>55295&&c<57344||c>64975&&c<65008||(65535&c)==65535||(65535&c)==65534||c>1114111?"�":String.fromCodePoint(c)}let eY=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function eZ(a){return a.replace(eY,e$)}function e$(a,b,c){if(b)return b;if(35===c.charCodeAt(0)){let a=c.charCodeAt(1),b=120===a||88===a;return eX(c.slice(b?2:1),b?16:10)}return ez(c)||a}function e_(a){return a&&"object"==typeof a?"position"in a||"type"in a?e1(a.position):"start"in a||"end"in a?e1(a):"line"in a||"column"in a?e0(a):"":""}function e0(a){return e2(a&&a.line)+":"+e2(a&&a.column)}function e1(a){return e0(a&&a.start)+"-"+e0(a&&a.end)}function e2(a){return a&&"number"==typeof a?a:1}let e3={}.hasOwnProperty;function e4(a){return{line:a.line,column:a.column,offset:a.offset}}function e5(a,b){if(a)throw Error("Cannot close `"+a.type+"` ("+e_({start:a.start,end:a.end})+"): a different token (`"+b.type+"`, "+e_({start:b.start,end:b.end})+") is open");throw Error("Cannot close document, a token (`"+b.type+"`, "+e_({start:b.start,end:b.end})+") is still open")}function e6(a){let b=this;b.parser=function(c){var d,e;let f,g,h,i;return"object"==typeof(d={...b.data("settings"),...a,extensions:b.data("micromarkExtensions")||[],mdastExtensions:b.data("fromMarkdownExtensions")||[]})&&(e=d,d=void 0),(function(a){let b={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:d(r),autolinkProtocol:j,autolinkEmail:j,atxHeading:d(o),blockQuote:d(function(){return{type:"blockquote",children:[]}}),characterEscape:j,characterReference:j,codeFenced:d(n),codeFencedFenceInfo:e,codeFencedFenceMeta:e,codeIndented:d(n,e),codeText:d(function(){return{type:"inlineCode",value:""}},e),codeTextData:j,data:j,codeFlowValue:j,definition:d(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:e,definitionLabelString:e,definitionTitleString:e,emphasis:d(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:d(p),hardBreakTrailing:d(p),htmlFlow:d(q,e),htmlFlowData:j,htmlText:d(q,e),htmlTextData:j,image:d(function(){return{type:"image",title:null,url:"",alt:null}}),label:e,link:d(r),listItem:d(function(a){return{type:"listItem",spread:a._spread,checked:null,children:[]}}),listItemValue:function(a){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(a),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:d(s,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:d(s),paragraph:d(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:e,resourceDestinationString:e,resourceTitleString:e,setextHeading:d(o),strong:d(function(){return{type:"strong",children:[]}}),thematicBreak:d(function(){return{type:"thematicBreak"}})},exit:{atxHeading:g(),atxHeadingSequence:function(a){let b=this.stack[this.stack.length-1];b.depth||(b.depth=this.sliceSerialize(a).length)},autolink:g(),autolinkEmail:function(a){k.call(this,a),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(a)},autolinkProtocol:function(a){k.call(this,a),this.stack[this.stack.length-1].url=this.sliceSerialize(a)},blockQuote:g(),characterEscapeValue:k,characterReferenceMarkerHexadecimal:m,characterReferenceMarkerNumeric:m,characterReferenceValue:function(a){let b,c=this.sliceSerialize(a),d=this.data.characterReferenceType;d?(b=eX(c,"characterReferenceMarkerNumeric"===d?10:16),this.data.characterReferenceType=void 0):b=ez(c);let e=this.stack[this.stack.length-1];e.value+=b},characterReference:function(a){this.stack.pop().position.end=e4(a.end)},codeFenced:g(function(){let a=this.resume();this.stack[this.stack.length-1].value=a.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){let a=this.resume();this.stack[this.stack.length-1].lang=a},codeFencedFenceMeta:function(){let a=this.resume();this.stack[this.stack.length-1].meta=a},codeFlowValue:k,codeIndented:g(function(){let a=this.resume();this.stack[this.stack.length-1].value=a.replace(/(\r?\n|\r)$/g,"")}),codeText:g(function(){let a=this.resume();this.stack[this.stack.length-1].value=a}),codeTextData:k,data:k,definition:g(),definitionDestinationString:function(){let a=this.resume();this.stack[this.stack.length-1].url=a},definitionLabelString:function(a){let b=this.resume(),c=this.stack[this.stack.length-1];c.label=b,c.identifier=em(this.sliceSerialize(a)).toLowerCase()},definitionTitleString:function(){let a=this.resume();this.stack[this.stack.length-1].title=a},emphasis:g(),hardBreakEscape:g(l),hardBreakTrailing:g(l),htmlFlow:g(function(){let a=this.resume();this.stack[this.stack.length-1].value=a}),htmlFlowData:k,htmlText:g(function(){let a=this.resume();this.stack[this.stack.length-1].value=a}),htmlTextData:k,image:g(function(){let a=this.stack[this.stack.length-1];if(this.data.inReference){let b=this.data.referenceType||"shortcut";a.type+="Reference",a.referenceType=b,delete a.url,delete a.title}else delete a.identifier,delete a.label;this.data.referenceType=void 0}),label:function(){let a=this.stack[this.stack.length-1],b=this.resume(),c=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===c.type?c.children=a.children:c.alt=b},labelText:function(a){let b=this.sliceSerialize(a),c=this.stack[this.stack.length-2];c.label=eZ(b),c.identifier=em(b).toLowerCase()},lineEnding:function(a){let c=this.stack[this.stack.length-1];if(this.data.atHardBreak){c.children[c.children.length-1].position.end=e4(a.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&b.canContainEols.includes(c.type)&&(j.call(this,a),k.call(this,a))},link:g(function(){let a=this.stack[this.stack.length-1];if(this.data.inReference){let b=this.data.referenceType||"shortcut";a.type+="Reference",a.referenceType=b,delete a.url,delete a.title}else delete a.identifier,delete a.label;this.data.referenceType=void 0}),listItem:g(),listOrdered:g(),listUnordered:g(),paragraph:g(),referenceString:function(a){let b=this.resume(),c=this.stack[this.stack.length-1];c.label=b,c.identifier=em(this.sliceSerialize(a)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){let a=this.resume();this.stack[this.stack.length-1].url=a},resourceTitleString:function(){let a=this.resume();this.stack[this.stack.length-1].title=a},resource:function(){this.data.inReference=void 0},setextHeading:g(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(a){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(a).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:g(),thematicBreak:g()}};!function a(b,c){let d=-1;for(;++d<c.length;){let e=c[d];Array.isArray(e)?a(b,e):function(a,b){let c;for(c in b)if(e3.call(b,c))switch(c){case"canContainEols":{let d=b[c];d&&a[c].push(...d);break}case"transforms":{let d=b[c];d&&a[c].push(...d);break}case"enter":case"exit":{let d=b[c];d&&Object.assign(a[c],d)}}}(b,e)}}(b,(a||{}).mdastExtensions||[]);let c={};return function(a){let d={type:"root",children:[]},g={stack:[d],tokenStack:[],config:b,enter:f,exit:h,buffer:e,resume:i,data:c},j=[],k=-1;for(;++k<a.length;)("listOrdered"===a[k][1].type||"listUnordered"===a[k][1].type)&&("enter"===a[k][0]?j.push(k):k=function(a,b,c){let d,e,f,g,h=b-1,i=-1,j=!1;for(;++h<=c;){let b=a[h];switch(b[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===b[0]?i++:i--,g=void 0;break;case"lineEndingBlank":"enter"===b[0]&&(!d||g||i||f||(f=h),g=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:g=void 0}if(!i&&"enter"===b[0]&&"listItemPrefix"===b[1].type||-1===i&&"exit"===b[0]&&("listUnordered"===b[1].type||"listOrdered"===b[1].type)){if(d){let g=h;for(e=void 0;g--;){let b=a[g];if("lineEnding"===b[1].type||"lineEndingBlank"===b[1].type){if("exit"===b[0])continue;e&&(a[e][1].type="lineEndingBlank",j=!0),b[1].type="lineEnding",e=g}else if("linePrefix"===b[1].type||"blockQuotePrefix"===b[1].type||"blockQuotePrefixWhitespace"===b[1].type||"blockQuoteMarker"===b[1].type||"listItemIndent"===b[1].type);else break}f&&(!e||f<e)&&(d._spread=!0),d.end=Object.assign({},e?a[e][1].start:b[1].end),a.splice(e||h,0,["exit",d,b[2]]),h++,c++}if("listItemPrefix"===b[1].type){let e={type:"listItem",_spread:!1,start:Object.assign({},b[1].start),end:void 0};d=e,a.splice(h,0,["enter",e,b[2]]),h++,c++,f=void 0,g=!0}}}return a[b][1]._spread=j,c}(a,j.pop(),k));for(k=-1;++k<a.length;){let c=b[a[k][0]];e3.call(c,a[k][1].type)&&c[a[k][1].type].call(Object.assign({sliceSerialize:a[k][2].sliceSerialize},g),a[k][1])}if(g.tokenStack.length>0){let a=g.tokenStack[g.tokenStack.length-1];(a[1]||e5).call(g,void 0,a[0])}for(d.position={start:e4(a.length>0?a[0][1].start:{line:1,column:1,offset:0}),end:e4(a.length>0?a[a.length-2][1].end:{line:1,column:1,offset:0})},k=-1;++k<b.transforms.length;)d=b.transforms[k](d)||d;return d};function d(a,b){return function(c){f.call(this,a(c),c),b&&b.call(this,c)}}function e(){this.stack.push({type:"fragment",children:[]})}function f(a,b,c){this.stack[this.stack.length-1].children.push(a),this.stack.push(a),this.tokenStack.push([b,c||void 0]),a.position={start:e4(b.start),end:void 0}}function g(a){return function(b){a&&a.call(this,b),h.call(this,b)}}function h(a,b){let c=this.stack.pop(),d=this.tokenStack.pop();if(d)d[0].type!==a.type&&(b?b.call(this,a,d[0]):(d[1]||e5).call(this,a,d[0]));else throw Error("Cannot close `"+a.type+"` ("+e_({start:a.start,end:a.end})+"): it’s not open");c.position.end=e4(a.end)}function i(){return dF(this.stack.pop())}function j(a){let b=this.stack[this.stack.length-1].children,c=b[b.length-1];c&&"text"===c.type||((c={type:"text",value:""}).position={start:e4(a.start),end:void 0},b.push(c)),this.stack.push(c)}function k(a){let b=this.stack.pop();b.value+=this.sliceSerialize(a),b.position.end=e4(a.end)}function l(){this.data.atHardBreak=!0}function m(a){this.data.characterReferenceType=a.type}function n(){return{type:"code",lang:null,meta:null,value:""}}function o(){return{type:"heading",depth:0,children:[]}}function p(){return{type:"break"}}function q(){return{type:"html",value:""}}function r(){return{type:"link",title:null,url:"",children:[]}}function s(a){return{type:"list",ordered:"listOrdered"===a.type,start:null,spread:a._spread,children:[]}}})(e)(function(a){for(;!dM(a););return a}((function(a){let b={constructs:function(a){let b={},c=-1;for(;++c<a.length;)!function(a,b){let c;for(c in b){let d,e=(dN.call(a,c)?a[c]:void 0)||(a[c]={}),f=b[c];if(f)for(d in f){dN.call(e,d)||(e[d]=[]);let a=f[d];!function(a,b){let c=-1,d=[];for(;++c<b.length;)("after"===b[c].add?a:d).push(b[c]);dI(a,0,0,d)}(e[d],Array.isArray(a)?a:a?[a]:[])}}}(b,a[c]);return b}([j,...(a||{}).extensions||[]]),content:c(d0),defined:[],document:c(d1),flow:c(d6),lazy:{},string:c(d8),text:c(d9)};return b;function c(a){return function(c){return function(a,b,c){let d={_bufferIndex:-1,_index:0,line:c&&c.line||1,column:c&&c.column||1,offset:c&&c.offset||0},e={},f=[],g=[],h=[],i={attempt:o(function(a,b){p(a,b.from)}),check:o(n),consume:function(a){dV(a)?(d.line++,d.column=1,d.offset+=-3===a?2:1,q()):-1!==a&&(d.column++,d.offset++),d._bufferIndex<0?d._index++:(d._bufferIndex++,d._bufferIndex===g[d._index].length&&(d._bufferIndex=-1,d._index++)),j.previous=a},enter:function(a,b){let c=b||{};return c.type=a,c.start=m(),j.events.push(["enter",c,j]),h.push(c),c},exit:function(a){let b=h.pop();return b.end=m(),j.events.push(["exit",b,j]),b},interrupt:o(n,{interrupt:!0})},j={code:null,containerState:{},defineSkip:function(a){e[a.line]=a.column,q()},events:[],now:m,parser:a,previous:null,sliceSerialize:function(a,b){return function(a,b){let c,d=-1,e=[];for(;++d<a.length;){let f,g=a[d];if("string"==typeof g)f=g;else switch(g){case -5:f="\r";break;case -4:f="\n";break;case -3:f="\r\n";break;case -2:f=b?" ":" ";break;case -1:if(!b&&c)continue;f=" ";break;default:f=String.fromCharCode(g)}c=-2===g,e.push(f)}return e.join("")}(l(a),b)},sliceStream:l,write:function(a){return(g=dJ(g,a),function(){let a;for(;d._index<g.length;){let c=g[d._index];if("string"==typeof c)for(a=d._index,d._bufferIndex<0&&(d._bufferIndex=0);d._index===a&&d._bufferIndex<c.length;){var b;b=c.charCodeAt(d._bufferIndex),k=k(b)}else k=k(c)}}(),null!==g[g.length-1])?[]:(p(b,0),j.events=eD(f,j.events,j),j.events)}},k=b.tokenize.call(j,i);return b.resolveAll&&f.push(b),j;function l(a){return function(a,b){let c,d=b.start._index,e=b.start._bufferIndex,f=b.end._index,g=b.end._bufferIndex;if(d===f)c=[a[d].slice(e,g)];else{if(c=a.slice(d,f),e>-1){let a=c[0];"string"==typeof a?c[0]=a.slice(e):c.shift()}g>0&&c.push(a[f].slice(0,g))}return c}(g,a)}function m(){let{_bufferIndex:a,_index:b,line:c,column:e,offset:f}=d;return{_bufferIndex:a,_index:b,line:c,column:e,offset:f}}function n(a,b){b.restore()}function o(a,b){return function(c,e,f){var g;let k,l,n,o;return Array.isArray(c)?p(c):"tokenize"in c?p([c]):(g=c,function(a){let b=null!==a&&g[a],c=null!==a&&g.null;return p([...Array.isArray(b)?b:b?[b]:[],...Array.isArray(c)?c:c?[c]:[]])(a)});function p(a){return(k=a,l=0,0===a.length)?f:r(a[l])}function r(a){return function(c){return(o=function(){let a=m(),b=j.previous,c=j.currentConstruct,e=j.events.length,f=Array.from(h);return{from:e,restore:function(){d=a,j.previous=b,j.currentConstruct=c,j.events.length=e,h=f,q()}}}(),n=a,a.partial||(j.currentConstruct=a),a.name&&j.parser.constructs.disable.null.includes(a.name))?t(c):a.tokenize.call(b?Object.assign(Object.create(j),b):j,i,s,t)(c)}}function s(b){return a(n,o),e}function t(a){return(o.restore(),++l<k.length)?r(k[l]):f}}}function p(a,b){a.resolveAll&&!f.includes(a)&&f.push(a),a.resolve&&dI(j.events,b,j.events.length-b,a.resolve(j.events.slice(b),j)),a.resolveTo&&(j.events=a.resolveTo(j.events,j))}function q(){d.line in e&&d.column<2&&(d.column=e[d.line],d.offset+=e[d.line]-1)}}(b,a,c)}}})(e).document().write((g=1,h="",i=!0,function(a,b,c){let d,e,j,k,l,m=[];for(a=h+("string"==typeof a?a.toString():new TextDecoder(b||void 0).decode(a)),j=0,h="",i&&(65279===a.charCodeAt(0)&&j++,i=void 0);j<a.length;){if(eW.lastIndex=j,k=(d=eW.exec(a))&&void 0!==d.index?d.index:a.length,l=a.charCodeAt(k),!d){h=a.slice(j);break}if(10===l&&j===k&&f)m.push(-3),f=void 0;else switch(f&&(m.push(-5),f=void 0),j<k&&(m.push(a.slice(j,k)),g+=k-j),l){case 0:m.push(65533),g++;break;case 9:for(e=4*Math.ceil(g/4),m.push(-2);g++<e;)m.push(-1);break;case 10:m.push(-4),g=1;break;default:f=!0,g=1}j=k+1}return c&&(f&&m.push(-5),h&&m.push(h),m.push(null)),m})(c,d,!0))))}}let e7={}.hasOwnProperty,e8={}.hasOwnProperty;function e9(a,b,c){return">"+(c?"":" ")+a}function fa(a,b){return fb(a,b.inConstruct,!0)&&!fb(a,b.notInConstruct,!1)}function fb(a,b,c){if("string"==typeof b&&(b=[b]),!b||0===b.length)return c;let d=-1;for(;++d<b.length;)if(a.includes(b[d]))return!0;return!1}function fc(a,b,c,d){let e=-1;for(;++e<c.unsafe.length;)if("\n"===c.unsafe[e].character&&fa(c.stack,c.unsafe[e]))return/[ \t]/.test(d.before)?"":" ";return"\\\n"}function fd(a,b){return!!(!1===b.options.fences&&a.value&&!a.lang&&/[^ \r\n]/.test(a.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(a.value))}function fe(a,b,c){return(c?"":" ")+a}function ff(a){let b=a.options.quote||'"';if('"'!==b&&"'"!==b)throw Error("Cannot serialize title with `"+b+"` for `options.quote`, expected `\"`, or `'`");return b}function fg(a){return"&#x"+a.toString(16).toUpperCase()+";"}function fh(a,b,c){let d=eJ(a),e=eJ(b);return void 0===d?void 0===e?"_"===c?{inside:!0,outside:!0}:{inside:!1,outside:!1}:1===e?{inside:!0,outside:!0}:{inside:!1,outside:!0}:1===d?void 0===e?{inside:!1,outside:!1}:1===e?{inside:!0,outside:!0}:{inside:!1,outside:!1}:void 0===e?{inside:!1,outside:!1}:1===e?{inside:!0,outside:!1}:{inside:!1,outside:!1}}function fi(a,b,c,d){let e=function(a){let b=a.options.emphasis||"*";if("*"!==b&&"_"!==b)throw Error("Cannot serialize emphasis with `"+b+"` for `options.emphasis`, expected `*`, or `_`");return b}(c),f=c.enter("emphasis"),g=c.createTracker(d),h=g.move(e),i=g.move(c.containerPhrasing(a,{after:e,before:h,...g.current()})),j=i.charCodeAt(0),k=fh(d.before.charCodeAt(d.before.length-1),j,e);k.inside&&(i=fg(j)+i.slice(1));let l=i.charCodeAt(i.length-1),m=fh(d.after.charCodeAt(0),l,e);m.inside&&(i=i.slice(0,-1)+fg(l));let n=g.move(e);return f(),c.attentionEncodeSurroundingInfo={after:m.outside,before:k.outside},h+i+n}fi.peek=function(a,b,c){return c.options.emphasis||"*"};let fj=function(a){var b,c;if(null==a)return fl;if("function"==typeof a)return fk(a);if("object"==typeof a){return Array.isArray(a)?function(a){let b=[],c=-1;for(;++c<a.length;)b[c]=fj(a[c]);return fk(function(...a){let c=-1;for(;++c<b.length;)if(b[c].apply(this,a))return!0;return!1})}(a):(b=a,fk(function(a){let c;for(c in b)if(a[c]!==b[c])return!1;return!0}))}if("string"==typeof a){return c=a,fk(function(a){return a&&a.type===c})}throw Error("Expected function, string, or object as test")};function fk(a){return function(b,c,d){return!!(function(a){return null!==a&&"object"==typeof a&&"type"in a}(b)&&a.call(this,b,"number"==typeof c?c:void 0,d||void 0))}}function fl(){return!0}let fm=[],fn="skip";function fo(a,b,c,d){let e;"function"==typeof b&&"function"!=typeof c?(d=c,c=b):e=b;let f=fj(e),g=d?-1:1;(function a(e,h,i){let j=e&&"object"==typeof e?e:{};if("string"==typeof j.type){let a="string"==typeof j.tagName?j.tagName:"string"==typeof j.name?j.name:void 0;Object.defineProperty(k,"name",{value:"node (\x1b[33m"+e.type+(a?"<"+a+">":"")+"\x1b[39m)"})}return k;function k(){var j;let k,l,m,n=fm;if((!b||f(e,h,i[i.length-1]||void 0))&&!1===(n=Array.isArray(j=c(e,i))?j:"number"==typeof j?[!0,j]:null==j?fm:[j])[0])return n;if("children"in e&&e.children&&e.children&&n[0]!==fn)for(l=(d?e.children.length:-1)+g,m=i.concat(e);l>-1&&l<e.children.length;){if(!1===(k=a(e.children[l],l,m)())[0])return k;l="number"==typeof k[1]?k[1]:l+g}return n}})(a,void 0,[])()}function fp(a,b,c,d){let e,f,g;"function"==typeof b&&"function"!=typeof c?(f=void 0,g=b,e=c):(f=b,g=c,e=d),fo(a,f,function(a,b){let c=b[b.length-1],d=c?c.children.indexOf(a):void 0;return g(a,d,c)},e)}function fq(a,b){let c=!1;return fp(a,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||"break"===a.type)return c=!0,!1}),!!((!a.depth||a.depth<3)&&dF(a)&&(b.options.setext||c))}function fr(a){return a.value||""}function fs(a,b,c,d){let e=ff(c),f='"'===e?"Quote":"Apostrophe",g=c.enter("image"),h=c.enter("label"),i=c.createTracker(d),j=i.move("![");return j+=i.move(c.safe(a.alt,{before:j,after:"]",...i.current()})),j+=i.move("]("),h(),!a.url&&a.title||/[\0- \u007F]/.test(a.url)?(h=c.enter("destinationLiteral"),j+=i.move("<"),j+=i.move(c.safe(a.url,{before:j,after:">",...i.current()})),j+=i.move(">")):(h=c.enter("destinationRaw"),j+=i.move(c.safe(a.url,{before:j,after:a.title?" ":")",...i.current()}))),h(),a.title&&(h=c.enter(`title${f}`),j+=i.move(" "+e),j+=i.move(c.safe(a.title,{before:j,after:e,...i.current()})),j+=i.move(e),h()),j+=i.move(")"),g(),j}function ft(a,b,c,d){let e=a.referenceType,f=c.enter("imageReference"),g=c.enter("label"),h=c.createTracker(d),i=h.move("!["),j=c.safe(a.alt,{before:i,after:"]",...h.current()});i+=h.move(j+"]["),g();let k=c.stack;c.stack=[],g=c.enter("reference");let l=c.safe(c.associationId(a),{before:i,after:"]",...h.current()});return g(),c.stack=k,f(),"full"!==e&&j&&j===l?"shortcut"===e?i=i.slice(0,-1):i+=h.move("]"):i+=h.move(l+"]"),i}function fu(a,b,c){let d=a.value||"",e="`",f=-1;for(;RegExp("(^|[^`])"+e+"([^`]|$)").test(d);)e+="`";for(/[^ \r\n]/.test(d)&&(/^[ \r\n]/.test(d)&&/[ \r\n]$/.test(d)||/^`|`$/.test(d))&&(d=" "+d+" ");++f<c.unsafe.length;){let a,b=c.unsafe[f],e=c.compilePattern(b);if(b.atBreak)for(;a=e.exec(d);){let b=a.index;10===d.charCodeAt(b)&&13===d.charCodeAt(b-1)&&b--,d=d.slice(0,b)+" "+d.slice(a.index+1)}}return e+d+e}function fv(a,b){let c=dF(a);return!!(!b.options.resourceLink&&a.url&&!a.title&&a.children&&1===a.children.length&&"text"===a.children[0].type&&(c===a.url||"mailto:"+c===a.url)&&/^[a-z][a-z+.-]+:/i.test(a.url)&&!/[\0- <>\u007F]/.test(a.url))}function fw(a,b,c,d){let e,f,g=ff(c),h='"'===g?"Quote":"Apostrophe",i=c.createTracker(d);if(fv(a,c)){let b=c.stack;c.stack=[],e=c.enter("autolink");let d=i.move("<");return d+=i.move(c.containerPhrasing(a,{before:d,after:">",...i.current()})),d+=i.move(">"),e(),c.stack=b,d}e=c.enter("link"),f=c.enter("label");let j=i.move("[");return j+=i.move(c.containerPhrasing(a,{before:j,after:"](",...i.current()})),j+=i.move("]("),f(),!a.url&&a.title||/[\0- \u007F]/.test(a.url)?(f=c.enter("destinationLiteral"),j+=i.move("<"),j+=i.move(c.safe(a.url,{before:j,after:">",...i.current()})),j+=i.move(">")):(f=c.enter("destinationRaw"),j+=i.move(c.safe(a.url,{before:j,after:a.title?" ":")",...i.current()}))),f(),a.title&&(f=c.enter(`title${h}`),j+=i.move(" "+g),j+=i.move(c.safe(a.title,{before:j,after:g,...i.current()})),j+=i.move(g),f()),j+=i.move(")"),e(),j}function fx(a,b,c,d){let e=a.referenceType,f=c.enter("linkReference"),g=c.enter("label"),h=c.createTracker(d),i=h.move("["),j=c.containerPhrasing(a,{before:i,after:"]",...h.current()});i+=h.move(j+"]["),g();let k=c.stack;c.stack=[],g=c.enter("reference");let l=c.safe(c.associationId(a),{before:i,after:"]",...h.current()});return g(),c.stack=k,f(),"full"!==e&&j&&j===l?"shortcut"===e?i=i.slice(0,-1):i+=h.move("]"):i+=h.move(l+"]"),i}function fy(a){let b=a.options.bullet||"*";if("*"!==b&&"+"!==b&&"-"!==b)throw Error("Cannot serialize items with `"+b+"` for `options.bullet`, expected `*`, `+`, or `-`");return b}function fz(a){let b=a.options.rule||"*";if("*"!==b&&"-"!==b&&"_"!==b)throw Error("Cannot serialize rules with `"+b+"` for `options.rule`, expected `*`, `-`, or `_`");return b}fr.peek=function(){return"<"},fs.peek=function(){return"!"},ft.peek=function(){return"!"},fu.peek=function(){return"`"},fw.peek=function(a,b,c){return fv(a,c)?"<":"["},fx.peek=function(){return"["};let fA=fj(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function fB(a,b,c,d){let e=function(a){let b=a.options.strong||"*";if("*"!==b&&"_"!==b)throw Error("Cannot serialize strong with `"+b+"` for `options.strong`, expected `*`, or `_`");return b}(c),f=c.enter("strong"),g=c.createTracker(d),h=g.move(e+e),i=g.move(c.containerPhrasing(a,{after:e,before:h,...g.current()})),j=i.charCodeAt(0),k=fh(d.before.charCodeAt(d.before.length-1),j,e);k.inside&&(i=fg(j)+i.slice(1));let l=i.charCodeAt(i.length-1),m=fh(d.after.charCodeAt(0),l,e);m.inside&&(i=i.slice(0,-1)+fg(l));let n=g.move(e+e);return f(),c.attentionEncodeSurroundingInfo={after:m.outside,before:k.outside},h+i+n}fB.peek=function(a,b,c){return c.options.strong||"*"};let fC={blockquote:function(a,b,c,d){let e=c.enter("blockquote"),f=c.createTracker(d);f.move("> "),f.shift(2);let g=c.indentLines(c.containerFlow(a,f.current()),e9);return e(),g},break:fc,code:function(a,b,c,d){let e=function(a){let b=a.options.fence||"`";if("`"!==b&&"~"!==b)throw Error("Cannot serialize code with `"+b+"` for `options.fence`, expected `` ` `` or `~`");return b}(c),f=a.value||"",g="`"===e?"GraveAccent":"Tilde";if(fd(a,c)){let a=c.enter("codeIndented"),b=c.indentLines(f,fe);return a(),b}let h=c.createTracker(d),i=e.repeat(Math.max(function(a,b){let c=String(a),d=c.indexOf(b),e=d,f=0,g=0;if("string"!=typeof b)throw TypeError("Expected substring");for(;-1!==d;)d===e?++f>g&&(g=f):f=1,e=d+b.length,d=c.indexOf(b,e);return g}(f,e)+1,3)),j=c.enter("codeFenced"),k=h.move(i);if(a.lang){let b=c.enter(`codeFencedLang${g}`);k+=h.move(c.safe(a.lang,{before:k,after:" ",encode:["`"],...h.current()})),b()}if(a.lang&&a.meta){let b=c.enter(`codeFencedMeta${g}`);k+=h.move(" "),k+=h.move(c.safe(a.meta,{before:k,after:"\n",encode:["`"],...h.current()})),b()}return k+=h.move("\n"),f&&(k+=h.move(f+"\n")),k+=h.move(i),j(),k},definition:function(a,b,c,d){let e=ff(c),f='"'===e?"Quote":"Apostrophe",g=c.enter("definition"),h=c.enter("label"),i=c.createTracker(d),j=i.move("[");return j+=i.move(c.safe(c.associationId(a),{before:j,after:"]",...i.current()})),j+=i.move("]: "),h(),!a.url||/[\0- \u007F]/.test(a.url)?(h=c.enter("destinationLiteral"),j+=i.move("<"),j+=i.move(c.safe(a.url,{before:j,after:">",...i.current()})),j+=i.move(">")):(h=c.enter("destinationRaw"),j+=i.move(c.safe(a.url,{before:j,after:a.title?" ":"\n",...i.current()}))),h(),a.title&&(h=c.enter(`title${f}`),j+=i.move(" "+e),j+=i.move(c.safe(a.title,{before:j,after:e,...i.current()})),j+=i.move(e),h()),g(),j},emphasis:fi,hardBreak:fc,heading:function(a,b,c,d){let e=Math.max(Math.min(6,a.depth||1),1),f=c.createTracker(d);if(fq(a,c)){let b=c.enter("headingSetext"),d=c.enter("phrasing"),g=c.containerPhrasing(a,{...f.current(),before:"\n",after:"\n"});return d(),b(),g+"\n"+(1===e?"=":"-").repeat(g.length-(Math.max(g.lastIndexOf("\r"),g.lastIndexOf("\n"))+1))}let g="#".repeat(e),h=c.enter("headingAtx"),i=c.enter("phrasing");f.move(g+" ");let j=c.containerPhrasing(a,{before:"# ",after:"\n",...f.current()});return/^[\t ]/.test(j)&&(j=fg(j.charCodeAt(0))+j.slice(1)),j=j?g+" "+j:g,c.options.closeAtx&&(j+=" "+g),i(),h(),j},html:fr,image:fs,imageReference:ft,inlineCode:fu,link:fw,linkReference:fx,list:function(a,b,c,d){let e=c.enter("list"),f=c.bulletCurrent,g=a.ordered?function(a){let b=a.options.bulletOrdered||".";if("."!==b&&")"!==b)throw Error("Cannot serialize items with `"+b+"` for `options.bulletOrdered`, expected `.` or `)`");return b}(c):fy(c),h=a.ordered?"."===g?")":".":function(a){let b=fy(a),c=a.options.bulletOther;if(!c)return"*"===b?"-":"*";if("*"!==c&&"+"!==c&&"-"!==c)throw Error("Cannot serialize items with `"+c+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(c===b)throw Error("Expected `bullet` (`"+b+"`) and `bulletOther` (`"+c+"`) to be different");return c}(c),i=!!b&&!!c.bulletLastUsed&&g===c.bulletLastUsed;if(!a.ordered){let b=a.children?a.children[0]:void 0;if("*"!==g&&"-"!==g||!b||b.children&&b.children[0]||"list"!==c.stack[c.stack.length-1]||"listItem"!==c.stack[c.stack.length-2]||"list"!==c.stack[c.stack.length-3]||"listItem"!==c.stack[c.stack.length-4]||0!==c.indexStack[c.indexStack.length-1]||0!==c.indexStack[c.indexStack.length-2]||0!==c.indexStack[c.indexStack.length-3]||(i=!0),fz(c)===g&&b){let b=-1;for(;++b<a.children.length;){let c=a.children[b];if(c&&"listItem"===c.type&&c.children&&c.children[0]&&"thematicBreak"===c.children[0].type){i=!0;break}}}}i&&(g=h),c.bulletCurrent=g;let j=c.containerFlow(a,d);return c.bulletLastUsed=g,c.bulletCurrent=f,e(),j},listItem:function(a,b,c,d){let e=function(a){let b=a.options.listItemIndent||"one";if("tab"!==b&&"one"!==b&&"mixed"!==b)throw Error("Cannot serialize items with `"+b+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return b}(c),f=c.bulletCurrent||fy(c);b&&"list"===b.type&&b.ordered&&(f=("number"==typeof b.start&&b.start>-1?b.start:1)+(!1===c.options.incrementListMarker?0:b.children.indexOf(a))+f);let g=f.length+1;("tab"===e||"mixed"===e&&(b&&"list"===b.type&&b.spread||a.spread))&&(g=4*Math.ceil(g/4));let h=c.createTracker(d);h.move(f+" ".repeat(g-f.length)),h.shift(g);let i=c.enter("listItem"),j=c.indentLines(c.containerFlow(a,h.current()),function(a,b,c){return b?(c?"":" ".repeat(g))+a:(c?f:f+" ".repeat(g-f.length))+a});return i(),j},paragraph:function(a,b,c,d){let e=c.enter("paragraph"),f=c.enter("phrasing"),g=c.containerPhrasing(a,d);return f(),e(),g},root:function(a,b,c,d){return(a.children.some(function(a){return fA(a)})?c.containerPhrasing:c.containerFlow).call(c,a,d)},strong:fB,text:function(a,b,c,d){return c.safe(a.value,d)},thematicBreak:function(a,b,c){let d=(fz(c)+(c.options.ruleSpaces?" ":"")).repeat(function(a){let b=a.options.ruleRepetition||3;if(b<3)throw Error("Cannot serialize rules with repetition `"+b+"` for `options.ruleRepetition`, expected `3` or more");return b}(c));return c.options.ruleSpaces?d.slice(0,-1):d}},fD=[function(a,b,c,d){if("code"===b.type&&fd(b,d)&&("list"===a.type||a.type===b.type&&fd(a,d)))return!1;if("spread"in c&&"boolean"==typeof c.spread){if("paragraph"===a.type&&(a.type===b.type||"definition"===b.type||"heading"===b.type&&fq(b,d)))return;return+!!c.spread}}],fE=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],fF=[{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:"\n",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:fE},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:"(?:[\r\n]|$)"},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:fE},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:"(?:[ \r\n*])"},{character:"*",inConstruct:"phrasing",notInConstruct:fE},{atBreak:!0,character:"+",after:"(?:[ \r\n])"},{atBreak:!0,character:"-",after:"(?:[ \r\n-])"},{atBreak:!0,before:"\\d+",character:".",after:"(?:[ \r\n]|$)"},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:fE},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:fE},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:fE},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:fE},{atBreak:!0,character:"~"}];function fG(a){return a.label||!a.identifier?a.label||"":eZ(a.identifier)}function fH(a){if(!a._compiled){let b=(a.atBreak?"[\\r\\n][\\t ]*":"")+(a.before?"(?:"+a.before+")":"");a._compiled=RegExp((b?"("+b+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(a.character)?"\\":"")+a.character+(a.after?"(?:"+a.after+")":""),"g")}return a._compiled}let fI=/\r?\n|\r/g;function fJ(a,b){let c,d=[],e=0,f=0;for(;c=fI.exec(a);)g(a.slice(e,c.index)),d.push(c[0]),e=c.index+c[0].length,f++;return g(a.slice(e)),d.join("");function g(a){d.push(b(a,f,!a))}}function fK(a,b){return a-b}function fL(a,b){let c,d=/\\(?=[!-/:-@[-`{-~])/g,e=[],f=[],g=a+b,h=-1,i=0;for(;c=d.exec(g);)e.push(c.index);for(;++h<e.length;)i!==e[h]&&f.push(a.slice(i,e[h])),f.push("\\"),i=e[h];return f.push(a.slice(i)),f.join("")}function fM(a){let b=a||{},c=b.now||{},d=b.lineShift||0,e=c.line||1,f=c.column||1;return{move:function(a){let b=a||"",c=b.split(/\r?\n|\r/g),g=c[c.length-1];return e+=c.length-1,f=1===c.length?f+g.length:1+g.length+d,b},current:function(){return{now:{line:e,column:f},lineShift:d}},shift:function(a){d+=a}}}function fN(a){throw Error("Cannot handle value `"+a+"`, expected node")}function fO(a){throw Error("Cannot handle unknown node `"+a.type+"`")}function fP(a,b){if("definition"===a.type&&a.type===b.type)return 0}function fQ(a,b){return function(a,b,c){let d,e=b.indexStack,f=a.children||[],g=[],h=-1,i=c.before;e.push(-1);let j=b.createTracker(c);for(;++h<f.length;){let k,l=f[h];if(e[e.length-1]=h,h+1<f.length){let c=b.handle.handlers[f[h+1].type];c&&c.peek&&(c=c.peek),k=c?c(f[h+1],a,b,{before:"",after:"",...j.current()}).charAt(0):""}else k=c.after;g.length>0&&("\r"===i||"\n"===i)&&"html"===l.type&&(g[g.length-1]=g[g.length-1].replace(/(\r?\n|\r)$/," "),i=" ",(j=b.createTracker(c)).move(g.join("")));let m=b.handle(l,a,b,{...j.current(),after:k,before:i});d&&d===m.slice(0,1)&&(m=fg(d.charCodeAt(0))+m.slice(1));let n=b.attentionEncodeSurroundingInfo;b.attentionEncodeSurroundingInfo=void 0,d=void 0,n&&(g.length>0&&n.before&&i===g[g.length-1].slice(-1)&&(g[g.length-1]=g[g.length-1].slice(0,-1)+fg(i.charCodeAt(0))),n.after&&(d=k)),j.move(m),g.push(m),i=m.slice(-1)}return e.pop(),g.join("")}(a,this,b)}function fR(a,b){return function(a,b,c){let d=b.indexStack,e=a.children||[],f=b.createTracker(c),g=[],h=-1;for(d.push(-1);++h<e.length;){let c=e[h];d[d.length-1]=h,g.push(f.move(b.handle(c,a,b,{before:"\n",after:"\n",...f.current()}))),"list"!==c.type&&(b.bulletLastUsed=void 0),h<e.length-1&&g.push(f.move(function(a,b,c,d){let e=d.join.length;for(;e--;){let f=d.join[e](a,b,c,d);if(!0===f||1===f)break;if("number"==typeof f)return"\n".repeat(1+f);if(!1===f)return"\n\n\x3c!----\x3e\n\n"}return"\n\n"}(c,e[h+1],a,b)))}return d.pop(),g.join("")}(a,this,b)}function fS(a,b){return function(a,b,c){let d=(c.before||"")+(b||"")+(c.after||""),e=[],f=[],g={},h=-1;for(;++h<a.unsafe.length;){let b,c=a.unsafe[h];if(!fa(a.stack,c))continue;let f=a.compilePattern(c);for(;b=f.exec(d);){let a="before"in c||!!c.atBreak,d="after"in c,f=b.index+(a?b[1].length:0);e.includes(f)?(g[f].before&&!a&&(g[f].before=!1),g[f].after&&!d&&(g[f].after=!1)):(e.push(f),g[f]={before:a,after:d})}}e.sort(fK);let i=c.before?c.before.length:0,j=d.length-(c.after?c.after.length:0);for(h=-1;++h<e.length;){let a=e[h];!(a<i)&&!(a>=j)&&(!(a+1<j)||e[h+1]!==a+1||!g[a].after||g[a+1].before||g[a+1].after)&&(e[h-1]!==a-1||!g[a].before||g[a-1].before||g[a-1].after)&&(i!==a&&f.push(fL(d.slice(i,a),"\\")),i=a,!/[!-/:-@[-`{-~]/.test(d.charAt(a))||c.encode&&c.encode.includes(d.charAt(a))?(f.push(fg(d.charCodeAt(a))),i++):f.push("\\"))}return f.push(fL(d.slice(i,j),c.after)),f.join("")}(this,a,b)}function fT(a){let b=this;b.compiler=function(c){var d={...b.data("settings"),...a,extensions:b.data("toMarkdownExtensions")||[]};let e={associationId:fG,containerPhrasing:fQ,containerFlow:fR,createTracker:fM,compilePattern:fH,enter:function(a){return e.stack.push(a),function(){e.stack.pop()}},handlers:{...fC},handle:void 0,indentLines:fJ,indexStack:[],join:[...fD],options:{},safe:fS,stack:[],unsafe:[...fF]};!function a(b,c){var d,e,f,g;let h,i=-1;if(c.extensions)for(;++i<c.extensions.length;)a(b,c.extensions[i]);for(h in c)if(e8.call(c,h))switch(h){case"extensions":break;case"unsafe":case"join":d=b[h],(e=c[h])&&d.push(...e);break;case"handlers":f=b[h],(g=c[h])&&Object.assign(f,g);break;default:b.options[h]=c[h]}return b}(e,d||{}),e.options.tightDefinitions&&e.join.push(fP),e.handle=function(a,b){let c=b||{};function d(b,...c){let e=d.invalid,f=d.handlers;if(b&&e7.call(b,a)){let c=String(b[a]);e=e7.call(f,c)?f[c]:d.unknown}if(e)return e.call(this,b,...c)}return d.handlers=c.handlers||{},d.invalid=c.invalid,d.unknown=c.unknown,d}("type",{invalid:fN,unknown:fO,handlers:e.handlers});let f=e.handle(c,void 0,e,{before:"\n",after:"\n",now:{line:1,column:1},lineShift:0});return f&&10!==f.charCodeAt(f.length-1)&&13!==f.charCodeAt(f.length-1)&&(f+="\n"),f}}function fU(a){if(a)throw a}var fV=c(7573);function fW(a){if("object"!=typeof a||null===a)return!1;let b=Object.getPrototypeOf(a);return(null===b||b===Object.prototype||null===Object.getPrototypeOf(b))&&!(Symbol.toStringTag in a)&&!(Symbol.iterator in a)}class fX extends Error{constructor(a,b,c){super(),"string"==typeof b&&(c=b,b=void 0);let d="",e={},f=!1;if(b&&(e="line"in b&&"column"in b||"start"in b&&"end"in b?{place:b}:"type"in b?{ancestors:[b],place:b.position}:{...b}),"string"==typeof a?d=a:!e.cause&&a&&(f=!0,d=a.message,e.cause=a),!e.ruleId&&!e.source&&"string"==typeof c){let a=c.indexOf(":");-1===a?e.ruleId=c:(e.source=c.slice(0,a),e.ruleId=c.slice(a+1))}if(!e.place&&e.ancestors&&e.ancestors){let a=e.ancestors[e.ancestors.length-1];a&&(e.place=a.position)}let g=e.place&&"start"in e.place?e.place.start:e.place;this.ancestors=e.ancestors||void 0,this.cause=e.cause||void 0,this.column=g?g.column:void 0,this.fatal=void 0,this.file="",this.message=d,this.line=g?g.line:void 0,this.name=e_(e.place)||"1:1",this.place=e.place||void 0,this.reason=this.message,this.ruleId=e.ruleId||void 0,this.source=e.source||void 0,this.stack=f&&e.cause&&"string"==typeof e.cause.stack?e.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}fX.prototype.file="",fX.prototype.name="",fX.prototype.reason="",fX.prototype.message="",fX.prototype.stack="",fX.prototype.column=void 0,fX.prototype.line=void 0,fX.prototype.ancestors=void 0,fX.prototype.cause=void 0,fX.prototype.fatal=void 0,fX.prototype.place=void 0,fX.prototype.ruleId=void 0,fX.prototype.source=void 0;let fY=require("node:path"),fZ=require("node:process");function f$(a){return!!(null!==a&&"object"==typeof a&&"href"in a&&a.href&&"protocol"in a&&a.protocol&&void 0===a.auth)}let f_=require("node:url"),f0=["history","path","basename","stem","extname","dirname"];class f1{constructor(a){let b,c;b=a?f$(a)?{path:a}:"string"==typeof a||function(a){return!!(a&&"object"==typeof a&&"byteLength"in a&&"byteOffset"in a)}(a)?{value:a}:a:{},this.cwd="cwd"in b?"":fZ.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let d=-1;for(;++d<f0.length;){let a=f0[d];a in b&&void 0!==b[a]&&null!==b[a]&&(this[a]="history"===a?[...b[a]]:b[a])}for(c in b)f0.includes(c)||(this[c]=b[c])}get basename(){return"string"==typeof this.path?fY.basename(this.path):void 0}set basename(a){f3(a,"basename"),f2(a,"basename"),this.path=fY.join(this.dirname||"",a)}get dirname(){return"string"==typeof this.path?fY.dirname(this.path):void 0}set dirname(a){f4(this.basename,"dirname"),this.path=fY.join(a||"",this.basename)}get extname(){return"string"==typeof this.path?fY.extname(this.path):void 0}set extname(a){if(f2(a,"extname"),f4(this.dirname,"extname"),a){if(46!==a.codePointAt(0))throw Error("`extname` must start with `.`");if(a.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=fY.join(this.dirname,this.stem+(a||""))}get path(){return this.history[this.history.length-1]}set path(a){f$(a)&&(a=(0,f_.fileURLToPath)(a)),f3(a,"path"),this.path!==a&&this.history.push(a)}get stem(){return"string"==typeof this.path?fY.basename(this.path,this.extname):void 0}set stem(a){f3(a,"stem"),f2(a,"stem"),this.path=fY.join(this.dirname||"",a+(this.extname||""))}fail(a,b,c){let d=this.message(a,b,c);throw d.fatal=!0,d}info(a,b,c){let d=this.message(a,b,c);return d.fatal=void 0,d}message(a,b,c){let d=new fX(a,b,c);return this.path&&(d.name=this.path+":"+d.name,d.file=this.path),d.fatal=!1,this.messages.push(d),d}toString(a){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(a||void 0).decode(this.value)}}function f2(a,b){if(a&&a.includes(fY.sep))throw Error("`"+b+"` cannot be a path: did not expect `"+fY.sep+"`")}function f3(a,b){if(!a)throw Error("`"+b+"` cannot be empty")}function f4(a,b){if(!a)throw Error("Setting `"+b+"` requires `path` to be set too")}let f5=function(a){let b=this.constructor.prototype,c=b[a],d=function(){return c.apply(d,arguments)};return Object.setPrototypeOf(d,b),d},f6={}.hasOwnProperty;class f7 extends f5{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=function(){let a=[],b={run:function(...b){let c=-1,d=b.pop();if("function"!=typeof d)throw TypeError("Expected function as last argument, not "+d);!function e(f,...g){let h=a[++c],i=-1;if(f)return void d(f);for(;++i<b.length;)(null===g[i]||void 0===g[i])&&(g[i]=b[i]);b=g,h?(function(a,b){let c;return function(...b){let f,g=a.length>b.length;g&&b.push(d);try{f=a.apply(this,b)}catch(a){if(g&&c)throw a;return d(a)}g||(f&&f.then&&"function"==typeof f.then?f.then(e,d):f instanceof Error?d(f):e(f))};function d(a,...e){c||(c=!0,b(a,...e))}function e(a){d(null,a)}})(h,e)(...g):d(null,...g)}(null,...b)},use:function(c){if("function"!=typeof c)throw TypeError("Expected `middelware` to be a function, not "+c);return a.push(c),b}};return b}()}copy(){let a=new f7,b=-1;for(;++b<this.attachers.length;){let c=this.attachers[b];a.use(...c)}return a.data(fV(!0,{},this.namespace)),a}data(a,b){return"string"==typeof a?2==arguments.length?(gb("data",this.frozen),this.namespace[a]=b,this):f6.call(this.namespace,a)&&this.namespace[a]||void 0:a?(gb("data",this.frozen),this.namespace=a,this):this.namespace}freeze(){if(this.frozen)return this;for(;++this.freezeIndex<this.attachers.length;){let[a,...b]=this.attachers[this.freezeIndex];if(!1===b[0])continue;!0===b[0]&&(b[0]=void 0);let c=a.call(this,...b);"function"==typeof c&&this.transformers.use(c)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(a){this.freeze();let b=ge(a),c=this.parser||this.Parser;return f9("parse",c),c(String(b),b)}process(a,b){let c=this;return this.freeze(),f9("process",this.parser||this.Parser),ga("process",this.compiler||this.Compiler),b?d(void 0,b):new Promise(d);function d(d,e){let f=ge(a),g=c.parse(f);function h(a,c){a||!c?e(a):d?d(c):b(void 0,c)}c.run(g,f,function(a,b,d){var e,f;if(a||!b||!d)return h(a);let g=c.stringify(b,d);"string"==typeof(e=g)||(f=e)&&"object"==typeof f&&"byteLength"in f&&"byteOffset"in f?d.value=g:d.result=g,h(a,d)})}}processSync(a){let b,c=!1;return this.freeze(),f9("processSync",this.parser||this.Parser),ga("processSync",this.compiler||this.Compiler),this.process(a,function(a,d){c=!0,fU(a),b=d}),gd("processSync","process",c),b}run(a,b,c){gc(a),this.freeze();let d=this.transformers;return c||"function"!=typeof b||(c=b,b=void 0),c?e(void 0,c):new Promise(e);function e(e,f){let g=ge(b);d.run(a,g,function(b,d,g){let h=d||a;b?f(b):e?e(h):c(void 0,h,g)})}}runSync(a,b){let c,d=!1;return this.run(a,b,function(a,b){fU(a),c=b,d=!0}),gd("runSync","run",d),c}stringify(a,b){this.freeze();let c=ge(b),d=this.compiler||this.Compiler;return ga("stringify",d),gc(a),d(a,c)}use(a,...b){let c=this.attachers,d=this.namespace;if(gb("use",this.frozen),null==a);else if("function"==typeof a)g(a,b);else if("object"==typeof a)Array.isArray(a)?f(a):e(a);else throw TypeError("Expected usable value, not `"+a+"`");return this;function e(a){if(!("plugins"in a)&&!("settings"in a))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");f(a.plugins),a.settings&&(d.settings=fV(!0,d.settings,a.settings))}function f(a){let b=-1;if(null==a);else if(Array.isArray(a))for(;++b<a.length;){var c=a[b];if("function"==typeof c)g(c,[]);else if("object"==typeof c)if(Array.isArray(c)){let[a,...b]=c;g(a,b)}else e(c);else throw TypeError("Expected usable value, not `"+c+"`")}else throw TypeError("Expected a list of plugins, not `"+a+"`")}function g(a,b){let d=-1,e=-1;for(;++d<c.length;)if(c[d][0]===a){e=d;break}if(-1===e)c.push([a,...b]);else if(b.length>0){let[d,...f]=b,g=c[e][1];fW(g)&&fW(d)&&(d=fV(!0,g,d)),c[e]=[a,d,...f]}}}}let f8=new f7().freeze();function f9(a,b){if("function"!=typeof b)throw TypeError("Cannot `"+a+"` without `parser`")}function ga(a,b){if("function"!=typeof b)throw TypeError("Cannot `"+a+"` without `compiler`")}function gb(a,b){if(b)throw Error("Cannot call `"+a+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function gc(a){if(!fW(a)||"string"!=typeof a.type)throw TypeError("Expected node, got `"+a+"`")}function gd(a,b,c){if(!c)throw Error("`"+a+"` finished async. Use `"+b+"` instead")}function ge(a){var b;return(b=a)&&"object"==typeof b&&"message"in b&&"messages"in b?a:new f1(a)}function gf(a){this.content=a}function gg(a){return a>=56320&&a<57344}function gh(a){return a>=55296&&a<56320}gf.prototype={constructor:gf,find:function(a){for(var b=0;b<this.content.length;b+=2)if(this.content[b]===a)return b;return -1},get:function(a){var b=this.find(a);return -1==b?void 0:this.content[b+1]},update:function(a,b,c){var d=c&&c!=a?this.remove(c):this,e=d.find(a),f=d.content.slice();return -1==e?f.push(c||a,b):(f[e+1]=b,c&&(f[e]=c)),new gf(f)},remove:function(a){var b=this.find(a);if(-1==b)return this;var c=this.content.slice();return c.splice(b,2),new gf(c)},addToStart:function(a,b){return new gf([a,b].concat(this.remove(a).content))},addToEnd:function(a,b){var c=this.remove(a).content.slice();return c.push(a,b),new gf(c)},addBefore:function(a,b,c){var d=this.remove(b),e=d.content.slice(),f=d.find(a);return e.splice(-1==f?e.length:f,0,b,c),new gf(e)},forEach:function(a){for(var b=0;b<this.content.length;b+=2)a(this.content[b],this.content[b+1])},prepend:function(a){return(a=gf.from(a)).size?new gf(a.content.concat(this.subtract(a).content)):this},append:function(a){return(a=gf.from(a)).size?new gf(this.subtract(a).content.concat(a.content)):this},subtract:function(a){var b=this;a=gf.from(a);for(var c=0;c<a.content.length;c+=2)b=b.remove(a.content[c]);return b},toObject:function(){var a={};return this.forEach(function(b,c){a[b]=c}),a},get size(){return this.content.length>>1}},gf.from=function(a){if(a instanceof gf)return a;var b=[];if(a)for(var c in a)b.push(c,a[c]);return new gf(b)};class gi{constructor(a,b){if(this.content=a,this.size=b||0,null==b)for(let b=0;b<a.length;b++)this.size+=a[b].nodeSize}nodesBetween(a,b,c,d=0,e){for(let f=0,g=0;g<b;f++){let h=this.content[f],i=g+h.nodeSize;if(i>a&&!1!==c(h,d+g,e||null,f)&&h.content.size){let e=g+1;h.nodesBetween(Math.max(0,a-e),Math.min(h.content.size,b-e),c,d+e)}g=i}}descendants(a){this.nodesBetween(0,this.size,a)}textBetween(a,b,c,d){let e="",f=!0;return this.nodesBetween(a,b,(g,h)=>{let i=g.isText?g.text.slice(Math.max(a,h)-h,b-h):g.isLeaf?d?"function"==typeof d?d(g):d:g.type.spec.leafText?g.type.spec.leafText(g):"":"";g.isBlock&&(g.isLeaf&&i||g.isTextblock)&&c&&(f?f=!1:e+=c),e+=i},0),e}append(a){if(!a.size)return this;if(!this.size)return a;let b=this.lastChild,c=a.firstChild,d=this.content.slice(),e=0;for(b.isText&&b.sameMarkup(c)&&(d[d.length-1]=b.withText(b.text+c.text),e=1);e<a.content.length;e++)d.push(a.content[e]);return new gi(d,this.size+a.size)}cut(a,b=this.size){if(0==a&&b==this.size)return this;let c=[],d=0;if(b>a)for(let e=0,f=0;f<b;e++){let g=this.content[e],h=f+g.nodeSize;h>a&&((f<a||h>b)&&(g=g.isText?g.cut(Math.max(0,a-f),Math.min(g.text.length,b-f)):g.cut(Math.max(0,a-f-1),Math.min(g.content.size,b-f-1))),c.push(g),d+=g.nodeSize),f=h}return new gi(c,d)}cutByIndex(a,b){return a==b?gi.empty:0==a&&b==this.content.length?this:new gi(this.content.slice(a,b))}replaceChild(a,b){let c=this.content[a];if(c==b)return this;let d=this.content.slice(),e=this.size+b.nodeSize-c.nodeSize;return d[a]=b,new gi(d,e)}addToStart(a){return new gi([a].concat(this.content),this.size+a.nodeSize)}addToEnd(a){return new gi(this.content.concat(a),this.size+a.nodeSize)}eq(a){if(this.content.length!=a.content.length)return!1;for(let b=0;b<this.content.length;b++)if(!this.content[b].eq(a.content[b]))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(a){let b=this.content[a];if(!b)throw RangeError("Index "+a+" out of range for "+this);return b}maybeChild(a){return this.content[a]||null}forEach(a){for(let b=0,c=0;b<this.content.length;b++){let d=this.content[b];a(d,c,b),c+=d.nodeSize}}findDiffStart(a,b=0){return function a(b,c,d){for(let e=0;;e++){if(e==b.childCount||e==c.childCount)return b.childCount==c.childCount?null:d;let f=b.child(e),g=c.child(e);if(f==g){d+=f.nodeSize;continue}if(!f.sameMarkup(g))return d;if(f.isText&&f.text!=g.text){let a=f.text,b=g.text,c=0;for(;a[c]==b[c];c++)d++;return c&&c<a.length&&c<b.length&&gh(a.charCodeAt(c-1))&&gg(a.charCodeAt(c))&&d--,d}if(f.content.size||g.content.size){let b=a(f.content,g.content,d+1);if(null!=b)return b}d+=f.nodeSize}}(this,a,b)}findDiffEnd(a,b=this.size,c=a.size){return function a(b,c,d,e){for(let f=b.childCount,g=c.childCount;;){if(0==f||0==g)return f==g?null:{a:d,b:e};let h=b.child(--f),i=c.child(--g),j=h.nodeSize;if(h==i){d-=j,e-=j;continue}if(!h.sameMarkup(i))return{a:d,b:e};if(h.isText&&h.text!=i.text){let a=h.text,b=i.text,c=a.length,f=b.length;for(;c>0&&f>0&&a[c-1]==b[f-1];)c--,f--,d--,e--;return c&&f&&c<a.length&&gh(a.charCodeAt(c-1))&&gg(a.charCodeAt(c))&&(d++,e++),{a:d,b:e}}if(h.content.size||i.content.size){let b=a(h.content,i.content,d-1,e-1);if(b)return b}d-=j,e-=j}}(this,a,b,c)}findIndex(a){if(0==a)return gk(0,a);if(a==this.size)return gk(this.content.length,a);if(a>this.size||a<0)throw RangeError(`Position ${a} outside of fragment (${this})`);for(let b=0,c=0;;b++){let d=c+this.child(b).nodeSize;if(d>=a){if(d==a)return gk(b+1,d);return gk(b,c)}c=d}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(a=>a.toJSON()):null}static fromJSON(a,b){if(!b)return gi.empty;if(!Array.isArray(b))throw RangeError("Invalid input for Fragment.fromJSON");return gi.fromArray(b.map(a.nodeFromJSON))}static fromArray(a){if(!a.length)return gi.empty;let b,c=0;for(let d=0;d<a.length;d++){let e=a[d];c+=e.nodeSize,d&&e.isText&&a[d-1].sameMarkup(e)?(b||(b=a.slice(0,d)),b[b.length-1]=e.withText(b[b.length-1].text+e.text)):b&&b.push(e)}return new gi(b||a,c)}static from(a){if(!a)return gi.empty;if(a instanceof gi)return a;if(Array.isArray(a))return this.fromArray(a);if(a.attrs)return new gi([a],a.nodeSize);throw RangeError("Can not convert "+a+" to a Fragment"+(a.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}gi.empty=new gi([],0);let gj={index:0,offset:0};function gk(a,b){return gj.index=a,gj.offset=b,gj}function gl(a,b){if(a===b)return!0;if(!(a&&"object"==typeof a)||!(b&&"object"==typeof b))return!1;let c=Array.isArray(a);if(Array.isArray(b)!=c)return!1;if(c){if(a.length!=b.length)return!1;for(let c=0;c<a.length;c++)if(!gl(a[c],b[c]))return!1}else{for(let c in a)if(!(c in b)||!gl(a[c],b[c]))return!1;for(let c in b)if(!(c in a))return!1}return!0}class gm{constructor(a,b){this.type=a,this.attrs=b}addToSet(a){let b,c=!1;for(let d=0;d<a.length;d++){let e=a[d];if(this.eq(e))return a;if(this.type.excludes(e.type))b||(b=a.slice(0,d));else{if(e.type.excludes(this.type))return a;!c&&e.type.rank>this.type.rank&&(b||(b=a.slice(0,d)),b.push(this),c=!0),b&&b.push(e)}}return b||(b=a.slice()),c||b.push(this),b}removeFromSet(a){for(let b=0;b<a.length;b++)if(this.eq(a[b]))return a.slice(0,b).concat(a.slice(b+1));return a}isInSet(a){for(let b=0;b<a.length;b++)if(this.eq(a[b]))return!0;return!1}eq(a){return this==a||this.type==a.type&&gl(this.attrs,a.attrs)}toJSON(){let a={type:this.type.name};for(let b in this.attrs){a.attrs=this.attrs;break}return a}static fromJSON(a,b){if(!b)throw RangeError("Invalid input for Mark.fromJSON");let c=a.marks[b.type];if(!c)throw RangeError(`There is no mark type ${b.type} in this schema`);let d=c.create(b.attrs);return c.checkAttrs(d.attrs),d}static sameSet(a,b){if(a==b)return!0;if(a.length!=b.length)return!1;for(let c=0;c<a.length;c++)if(!a[c].eq(b[c]))return!1;return!0}static setFrom(a){if(!a||Array.isArray(a)&&0==a.length)return gm.none;if(a instanceof gm)return[a];let b=a.slice();return b.sort((a,b)=>a.type.rank-b.type.rank),b}}gm.none=[];class gn extends Error{}class go{constructor(a,b,c){this.content=a,this.openStart=b,this.openEnd=c}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(a,b){let c=function a(b,c,d,e,f,g){let{index:h,offset:i}=b.findIndex(c),j=b.maybeChild(h);if(i==c||j.isText)return g&&e<=0&&f<=0&&!g.canReplace(h,h,d)?null:b.cut(0,c).append(d).append(b.cut(c));let k=a(j.content,c-i-1,d,0==h?e-1:0,h==b.childCount-1?f-1:0,j);return k&&b.replaceChild(h,j.copy(k))}(this.content,a+this.openStart,b,this.openStart+1,this.openEnd+1);return c&&new go(c,this.openStart,this.openEnd)}removeBetween(a,b){return new go(function a(b,c,d){let{index:e,offset:f}=b.findIndex(c),g=b.maybeChild(e),{index:h,offset:i}=b.findIndex(d);if(f==c||g.isText){if(i!=d&&!b.child(h).isText)throw RangeError("Removing non-flat range");return b.cut(0,c).append(b.cut(d))}if(e!=h)throw RangeError("Removing non-flat range");return b.replaceChild(e,g.copy(a(g.content,c-f-1,d-f-1)))}(this.content,a+this.openStart,b+this.openStart),this.openStart,this.openEnd)}eq(a){return this.content.eq(a.content)&&this.openStart==a.openStart&&this.openEnd==a.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let a={content:this.content.toJSON()};return this.openStart>0&&(a.openStart=this.openStart),this.openEnd>0&&(a.openEnd=this.openEnd),a}static fromJSON(a,b){if(!b)return go.empty;let c=b.openStart||0,d=b.openEnd||0;if("number"!=typeof c||"number"!=typeof d)throw RangeError("Invalid input for Slice.fromJSON");return new go(gi.fromJSON(a,b.content),c,d)}static maxOpen(a,b=!0){let c=0,d=0;for(let d=a.firstChild;d&&!d.isLeaf&&(b||!d.type.spec.isolating);d=d.firstChild)c++;for(let c=a.lastChild;c&&!c.isLeaf&&(b||!c.type.spec.isolating);c=c.lastChild)d++;return new go(a,c,d)}}function gp(a,b){if(!b.type.compatibleContent(a.type))throw new gn("Cannot join "+b.type.name+" onto "+a.type.name)}function gq(a,b,c){let d=a.node(c);return gp(d,b.node(c)),d}function gr(a,b){let c=b.length-1;c>=0&&a.isText&&a.sameMarkup(b[c])?b[c]=a.withText(b[c].text+a.text):b.push(a)}function gs(a,b,c,d){let e=(b||a).node(c),f=0,g=b?b.index(c):e.childCount;a&&(f=a.index(c),a.depth>c?f++:a.textOffset&&(gr(a.nodeAfter,d),f++));for(let a=f;a<g;a++)gr(e.child(a),d);b&&b.depth==c&&b.textOffset&&gr(b.nodeBefore,d)}function gt(a,b){if(!a.type.validContent(b))throw new gn("Invalid content for node "+a.type.name);return a.copy(b)}function gu(a,b,c){let d=[];return gs(null,a,c,d),a.depth>c&&gr(gt(gq(a,b,c+1),gu(a,b,c+1)),d),gs(b,null,c,d),new gi(d)}go.empty=new go(gi.empty,0,0);class gv{constructor(a,b,c){this.pos=a,this.path=b,this.parentOffset=c,this.depth=b.length/3-1}resolveDepth(a){return null==a?this.depth:a<0?this.depth+a:a}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(a){return this.path[3*this.resolveDepth(a)]}index(a){return this.path[3*this.resolveDepth(a)+1]}indexAfter(a){return a=this.resolveDepth(a),this.index(a)+(a!=this.depth||this.textOffset?1:0)}start(a){return 0==(a=this.resolveDepth(a))?0:this.path[3*a-1]+1}end(a){return a=this.resolveDepth(a),this.start(a)+this.node(a).content.size}before(a){if(!(a=this.resolveDepth(a)))throw RangeError("There is no position before the top-level node");return a==this.depth+1?this.pos:this.path[3*a-1]}after(a){if(!(a=this.resolveDepth(a)))throw RangeError("There is no position after the top-level node");return a==this.depth+1?this.pos:this.path[3*a-1]+this.path[3*a].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let a=this.parent,b=this.index(this.depth);if(b==a.childCount)return null;let c=this.pos-this.path[this.path.length-1],d=a.child(b);return c?a.child(b).cut(c):d}get nodeBefore(){let a=this.index(this.depth),b=this.pos-this.path[this.path.length-1];return b?this.parent.child(a).cut(0,b):0==a?null:this.parent.child(a-1)}posAtIndex(a,b){b=this.resolveDepth(b);let c=this.path[3*b],d=0==b?0:this.path[3*b-1]+1;for(let b=0;b<a;b++)d+=c.child(b).nodeSize;return d}marks(){let a=this.parent,b=this.index();if(0==a.content.size)return gm.none;if(this.textOffset)return a.child(b).marks;let c=a.maybeChild(b-1),d=a.maybeChild(b);if(!c){let a=c;c=d,d=a}let e=c.marks;for(var f=0;f<e.length;f++)!1!==e[f].type.spec.inclusive||d&&e[f].isInSet(d.marks)||(e=e[f--].removeFromSet(e));return e}marksAcross(a){let b=this.parent.maybeChild(this.index());if(!b||!b.isInline)return null;let c=b.marks,d=a.parent.maybeChild(a.index());for(var e=0;e<c.length;e++)!1!==c[e].type.spec.inclusive||d&&c[e].isInSet(d.marks)||(c=c[e--].removeFromSet(c));return c}sharedDepth(a){for(let b=this.depth;b>0;b--)if(this.start(b)<=a&&this.end(b)>=a)return b;return 0}blockRange(a=this,b){if(a.pos<this.pos)return a.blockRange(this);for(let c=this.depth-(this.parent.inlineContent||this.pos==a.pos?1:0);c>=0;c--)if(a.pos<=this.end(c)&&(!b||b(this.node(c))))return new gz(this,a,c);return null}sameParent(a){return this.pos-this.parentOffset==a.pos-a.parentOffset}max(a){return a.pos>this.pos?a:this}min(a){return a.pos<this.pos?a:this}toString(){let a="";for(let b=1;b<=this.depth;b++)a+=(a?"/":"")+this.node(b).type.name+"_"+this.index(b-1);return a+":"+this.parentOffset}static resolve(a,b){if(!(b>=0&&b<=a.content.size))throw RangeError("Position "+b+" out of range");let c=[],d=0,e=b;for(let b=a;;){let{index:a,offset:f}=b.content.findIndex(e),g=e-f;if(c.push(b,a,d+f),!g||(b=b.child(a)).isText)break;e=g-1,d+=f+1}return new gv(b,c,e)}static resolveCached(a,b){let c=gy.get(a);if(c)for(let a=0;a<c.elts.length;a++){let d=c.elts[a];if(d.pos==b)return d}else gy.set(a,c=new gw);let d=c.elts[c.i]=gv.resolve(a,b);return c.i=(c.i+1)%gx,d}}class gw{constructor(){this.elts=[],this.i=0}}let gx=12,gy=new WeakMap;class gz{constructor(a,b,c){this.$from=a,this.$to=b,this.depth=c}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 gA=Object.create(null);class gB{constructor(a,b,c,d=gm.none){this.type=a,this.attrs=b,this.marks=d,this.content=c||gi.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(a){return this.content.child(a)}maybeChild(a){return this.content.maybeChild(a)}forEach(a){this.content.forEach(a)}nodesBetween(a,b,c,d=0){this.content.nodesBetween(a,b,c,d,this)}descendants(a){this.nodesBetween(0,this.content.size,a)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(a,b,c,d){return this.content.textBetween(a,b,c,d)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(a){return this==a||this.sameMarkup(a)&&this.content.eq(a.content)}sameMarkup(a){return this.hasMarkup(a.type,a.attrs,a.marks)}hasMarkup(a,b,c){return this.type==a&&gl(this.attrs,b||a.defaultAttrs||gA)&&gm.sameSet(this.marks,c||gm.none)}copy(a=null){return a==this.content?this:new gB(this.type,this.attrs,a,this.marks)}mark(a){return a==this.marks?this:new gB(this.type,this.attrs,this.content,a)}cut(a,b=this.content.size){return 0==a&&b==this.content.size?this:this.copy(this.content.cut(a,b))}slice(a,b=this.content.size,c=!1){if(a==b)return go.empty;let d=this.resolve(a),e=this.resolve(b),f=c?0:d.sharedDepth(b),g=d.start(f);return new go(d.node(f).content.cut(d.pos-g,e.pos-g),d.depth-f,e.depth-f)}replace(a,b,c){var d=this.resolve(a),e=this.resolve(b);if(c.openStart>d.depth)throw new gn("Inserted content deeper than insertion position");if(d.depth-c.openStart!=e.depth-c.openEnd)throw new gn("Inconsistent open depths");return function a(b,c,d,e){let f=b.index(e),g=b.node(e);if(f==c.index(e)&&e<b.depth-d.openStart){let h=a(b,c,d,e+1);return g.copy(g.content.replaceChild(f,h))}if(!d.content.size)return gt(g,gu(b,c,e));if(d.openStart||d.openEnd||b.depth!=e||c.depth!=e){let{start:a,end:f}=function(a,b){let c=b.depth-a.openStart,d=b.node(c).copy(a.content);for(let a=c-1;a>=0;a--)d=b.node(a).copy(gi.from(d));return{start:d.resolveNoCache(a.openStart+c),end:d.resolveNoCache(d.content.size-a.openEnd-c)}}(d,b);return gt(g,function a(b,c,d,e,f){let g=b.depth>f&&gq(b,c,f+1),h=e.depth>f&&gq(d,e,f+1),i=[];return gs(null,b,f,i),g&&h&&c.index(f)==d.index(f)?(gp(g,h),gr(gt(g,a(b,c,d,e,f+1)),i)):(g&&gr(gt(g,gu(b,c,f+1)),i),gs(c,d,f,i),h&&gr(gt(h,gu(d,e,f+1)),i)),gs(e,null,f,i),new gi(i)}(b,a,f,c,e))}{let a=b.parent,e=a.content;return gt(a,e.cut(0,b.parentOffset).append(d.content).append(e.cut(c.parentOffset)))}}(d,e,c,0)}nodeAt(a){for(let b=this;;){let{index:c,offset:d}=b.content.findIndex(a);if(!(b=b.maybeChild(c)))return null;if(d==a||b.isText)return b;a-=d+1}}childAfter(a){let{index:b,offset:c}=this.content.findIndex(a);return{node:this.content.maybeChild(b),index:b,offset:c}}childBefore(a){if(0==a)return{node:null,index:0,offset:0};let{index:b,offset:c}=this.content.findIndex(a);if(c<a)return{node:this.content.child(b),index:b,offset:c};let d=this.content.child(b-1);return{node:d,index:b-1,offset:c-d.nodeSize}}resolve(a){return gv.resolveCached(this,a)}resolveNoCache(a){return gv.resolve(this,a)}rangeHasMark(a,b,c){let d=!1;return b>a&&this.nodesBetween(a,b,a=>(c.isInSet(a.marks)&&(d=!0),!d)),d}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 a=this.type.name;return this.content.size&&(a+="("+this.content.toStringInner()+")"),gD(this.marks,a)}contentMatchAt(a){let b=this.type.contentMatch.matchFragment(this.content,0,a);if(!b)throw Error("Called contentMatchAt on a node with invalid content");return b}canReplace(a,b,c=gi.empty,d=0,e=c.childCount){let f=this.contentMatchAt(a).matchFragment(c,d,e),g=f&&f.matchFragment(this.content,b);if(!g||!g.validEnd)return!1;for(let a=d;a<e;a++)if(!this.type.allowsMarks(c.child(a).marks))return!1;return!0}canReplaceWith(a,b,c,d){if(d&&!this.type.allowsMarks(d))return!1;let e=this.contentMatchAt(a).matchType(c),f=e&&e.matchFragment(this.content,b);return!!f&&f.validEnd}canAppend(a){return a.content.size?this.canReplace(this.childCount,this.childCount,a.content):this.type.compatibleContent(a.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let a=gm.none;for(let b=0;b<this.marks.length;b++){let c=this.marks[b];c.type.checkAttrs(c.attrs),a=c.addToSet(a)}if(!gm.sameSet(a,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(a=>a.type.name)}`);this.content.forEach(a=>a.check())}toJSON(){let a={type:this.type.name};for(let b in this.attrs){a.attrs=this.attrs;break}return this.content.size&&(a.content=this.content.toJSON()),this.marks.length&&(a.marks=this.marks.map(a=>a.toJSON())),a}static fromJSON(a,b){let c;if(!b)throw RangeError("Invalid input for Node.fromJSON");if(b.marks){if(!Array.isArray(b.marks))throw RangeError("Invalid mark data for Node.fromJSON");c=b.marks.map(a.markFromJSON)}if("text"==b.type){if("string"!=typeof b.text)throw RangeError("Invalid text node in JSON");return a.text(b.text,c)}let d=gi.fromJSON(a,b.content),e=a.nodeType(b.type).create(b.attrs,d,c);return e.type.checkAttrs(e.attrs),e}}gB.prototype.text=void 0;class gC extends gB{constructor(a,b,c,d){if(super(a,b,null,d),!c)throw RangeError("Empty text nodes are not allowed");this.text=c}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):gD(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(a,b){return this.text.slice(a,b)}get nodeSize(){return this.text.length}mark(a){return a==this.marks?this:new gC(this.type,this.attrs,this.text,a)}withText(a){return a==this.text?this:new gC(this.type,this.attrs,a,this.marks)}cut(a=0,b=this.text.length){return 0==a&&b==this.text.length?this:this.withText(this.text.slice(a,b))}eq(a){return this.sameMarkup(a)&&this.text==a.text}toJSON(){let a=super.toJSON();return a.text=this.text,a}}function gD(a,b){for(let c=a.length-1;c>=0;c--)b=a[c].type.name+"("+b+")";return b}class gE{constructor(a){this.validEnd=a,this.next=[],this.wrapCache=[]}static parse(a,b){var c;let d,e=new gF(a,b);if(null==e.next)return gE.empty;let f=function a(b){let c=[];do c.push(function(b){let c=[];do c.push(function(b){let c=function(b){if(b.eat("(")){let c=a(b);return b.eat(")")||b.err("Missing closing paren"),c}if(/\W/.test(b.next))b.err("Unexpected token '"+b.next+"'");else{let a=(function(a,b){let c=a.nodeTypes,d=c[b];if(d)return[d];let e=[];for(let a in c){let d=c[a];d.isInGroup(b)&&e.push(d)}return 0==e.length&&a.err("No node type or group '"+b+"' found"),e})(b,b.next).map(a=>(null==b.inline?b.inline=a.isInline:b.inline!=a.isInline&&b.err("Mixing inline and block content"),{type:"name",value:a}));return b.pos++,1==a.length?a[0]:{type:"choice",exprs:a}}}(b);for(;;)if(b.eat("+"))c={type:"plus",expr:c};else if(b.eat("*"))c={type:"star",expr:c};else if(b.eat("?"))c={type:"opt",expr:c};else if(b.eat("{"))c=function(a,b){let c=gG(a),d=c;return a.eat(",")&&(d="}"!=a.next?gG(a):-1),a.eat("}")||a.err("Unclosed braced range"),{type:"range",min:c,max:d,expr:b}}(b,c);else break;return c}(b));while(b.next&&")"!=b.next&&"|"!=b.next);return 1==c.length?c[0]:{type:"seq",exprs:c}}(b));while(b.eat("|"));return 1==c.length?c[0]:{type:"choice",exprs:c}}(e);e.next&&e.err("Unexpected trailing text");let g=(c=function(a){let b=[[]];return e(function a(b,f){if("choice"==b.type)return b.exprs.reduce((b,c)=>b.concat(a(c,f)),[]);if("seq"==b.type)for(let d=0;;d++){let g=a(b.exprs[d],f);if(d==b.exprs.length-1)return g;e(g,f=c())}else if("star"==b.type){let g=c();return d(f,g),e(a(b.expr,g),g),[d(g)]}else if("plus"==b.type){let g=c();return e(a(b.expr,f),g),e(a(b.expr,g),g),[d(g)]}else if("opt"==b.type)return[d(f)].concat(a(b.expr,f));else if("range"==b.type){let g=f;for(let d=0;d<b.min;d++){let d=c();e(a(b.expr,g),d),g=d}if(-1==b.max)e(a(b.expr,g),g);else for(let f=b.min;f<b.max;f++){let f=c();d(g,f),e(a(b.expr,g),f),g=f}return[d(g)]}else if("name"==b.type)return[d(f,void 0,b.value)];else throw Error("Unknown expr type")}(a,0),c()),b;function c(){return b.push([])-1}function d(a,c,d){let e={term:d,to:c};return b[a].push(e),e}function e(a,b){a.forEach(a=>a.to=b)}}(f),d=Object.create(null),function a(b){let e=[];b.forEach(a=>{c[a].forEach(({term:a,to:b})=>{let d;if(a){for(let b=0;b<e.length;b++)e[b][0]==a&&(d=e[b][1]);gI(c,b).forEach(b=>{d||e.push([a,d=[]]),-1==d.indexOf(b)&&d.push(b)})}})});let f=d[b.join(",")]=new gE(b.indexOf(c.length-1)>-1);for(let b=0;b<e.length;b++){let c=e[b][1].sort(gH);f.next.push({type:e[b][0],next:d[c.join(",")]||a(c)})}return f}(gI(c,0)));return function(a,b){for(let c=0,d=[a];c<d.length;c++){let a=d[c],e=!a.validEnd,f=[];for(let b=0;b<a.next.length;b++){let{type:c,next:g}=a.next[b];f.push(c.name),e&&!(c.isText||c.hasRequiredAttrs())&&(e=!1),-1==d.indexOf(g)&&d.push(g)}e&&b.err("Only non-generatable nodes ("+f.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(g,e),g}matchType(a){for(let b=0;b<this.next.length;b++)if(this.next[b].type==a)return this.next[b].next;return null}matchFragment(a,b=0,c=a.childCount){let d=this;for(let e=b;d&&e<c;e++)d=d.matchType(a.child(e).type);return d}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let a=0;a<this.next.length;a++){let{type:b}=this.next[a];if(!(b.isText||b.hasRequiredAttrs()))return b}return null}compatible(a){for(let b=0;b<this.next.length;b++)for(let c=0;c<a.next.length;c++)if(this.next[b].type==a.next[c].type)return!0;return!1}fillBefore(a,b=!1,c=0){let d=[this];return function e(f,g){let h=f.matchFragment(a,c);if(h&&(!b||h.validEnd))return gi.from(g.map(a=>a.createAndFill()));for(let a=0;a<f.next.length;a++){let{type:b,next:c}=f.next[a];if(!(b.isText||b.hasRequiredAttrs())&&-1==d.indexOf(c)){d.push(c);let a=e(c,g.concat(b));if(a)return a}}return null}(this,[])}findWrapping(a){for(let b=0;b<this.wrapCache.length;b+=2)if(this.wrapCache[b]==a)return this.wrapCache[b+1];let b=this.computeWrapping(a);return this.wrapCache.push(a,b),b}computeWrapping(a){let b=Object.create(null),c=[{match:this,type:null,via:null}];for(;c.length;){let d=c.shift(),e=d.match;if(e.matchType(a)){let a=[];for(let b=d;b.type;b=b.via)a.push(b.type);return a.reverse()}for(let a=0;a<e.next.length;a++){let{type:f,next:g}=e.next[a];f.isLeaf||f.hasRequiredAttrs()||f.name in b||d.type&&!g.validEnd||(c.push({match:f.contentMatch,type:f,via:d}),b[f.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(a){if(a>=this.next.length)throw RangeError(`There's no ${a}th edge in this content match`);return this.next[a]}toString(){let a=[];return!function b(c){a.push(c);for(let d=0;d<c.next.length;d++)-1==a.indexOf(c.next[d].next)&&b(c.next[d].next)}(this),a.map((b,c)=>{let d=c+(b.validEnd?"*":" ")+" ";for(let c=0;c<b.next.length;c++)d+=(c?", ":"")+b.next[c].type.name+"->"+a.indexOf(b.next[c].next);return d}).join("\n")}}gE.empty=new gE(!0);class gF{constructor(a,b){this.string=a,this.nodeTypes=b,this.inline=null,this.pos=0,this.tokens=a.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(a){return this.next==a&&(this.pos++||!0)}err(a){throw SyntaxError(a+" (in content expression '"+this.string+"')")}}function gG(a){/\D/.test(a.next)&&a.err("Expected number, got '"+a.next+"'");let b=Number(a.next);return a.pos++,b}function gH(a,b){return b-a}function gI(a,b){let c=[];return function b(d){let e=a[d];if(1==e.length&&!e[0].term)return b(e[0].to);c.push(d);for(let a=0;a<e.length;a++){let{term:d,to:f}=e[a];d||-1!=c.indexOf(f)||b(f)}}(b),c.sort(gH)}function gJ(a){let b=Object.create(null);for(let c in a){let d=a[c];if(!d.hasDefault)return null;b[c]=d.default}return b}function gK(a,b){let c=Object.create(null);for(let d in a){let e=b&&b[d];if(void 0===e){let b=a[d];if(b.hasDefault)e=b.default;else throw RangeError("No value supplied for attribute "+d)}c[d]=e}return c}function gL(a,b,c,d){for(let e in b)if(!(e in a))throw RangeError(`Unsupported attribute ${e} for ${c} of type ${d}`);for(let c in a)a[c].validate&&a[c].validate(b[c])}function gM(a,b){let c=Object.create(null);if(b)for(let d in b)c[d]=new gO(a,d,b[d]);return c}class gN{constructor(a,b,c){this.name=a,this.schema=b,this.spec=c,this.markSet=null,this.groups=c.group?c.group.split(" "):[],this.attrs=gM(a,c.attrs),this.defaultAttrs=gJ(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(c.inline||"text"==a),this.isText="text"==a}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==gE.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(a){return this.groups.indexOf(a)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let a in this.attrs)if(this.attrs[a].isRequired)return!0;return!1}compatibleContent(a){return this==a||this.contentMatch.compatible(a.contentMatch)}computeAttrs(a){return!a&&this.defaultAttrs?this.defaultAttrs:gK(this.attrs,a)}create(a=null,b,c){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new gB(this,this.computeAttrs(a),gi.from(b),gm.setFrom(c))}createChecked(a=null,b,c){return b=gi.from(b),this.checkContent(b),new gB(this,this.computeAttrs(a),b,gm.setFrom(c))}createAndFill(a=null,b,c){if(a=this.computeAttrs(a),(b=gi.from(b)).size){let a=this.contentMatch.fillBefore(b);if(!a)return null;b=a.append(b)}let d=this.contentMatch.matchFragment(b),e=d&&d.fillBefore(gi.empty,!0);return e?new gB(this,a,b.append(e),gm.setFrom(c)):null}validContent(a){let b=this.contentMatch.matchFragment(a);if(!b||!b.validEnd)return!1;for(let b=0;b<a.childCount;b++)if(!this.allowsMarks(a.child(b).marks))return!1;return!0}checkContent(a){if(!this.validContent(a))throw RangeError(`Invalid content for node ${this.name}: ${a.toString().slice(0,50)}`)}checkAttrs(a){gL(this.attrs,a,"node",this.name)}allowsMarkType(a){return null==this.markSet||this.markSet.indexOf(a)>-1}allowsMarks(a){if(null==this.markSet)return!0;for(let b=0;b<a.length;b++)if(!this.allowsMarkType(a[b].type))return!1;return!0}allowedMarks(a){let b;if(null==this.markSet)return a;for(let c=0;c<a.length;c++)this.allowsMarkType(a[c].type)?b&&b.push(a[c]):b||(b=a.slice(0,c));return b?b.length?b:gm.none:a}static compile(a,b){let c=Object.create(null);a.forEach((a,d)=>c[a]=new gN(a,b,d));let d=b.spec.topNode||"doc";if(!c[d])throw RangeError("Schema is missing its top node type ('"+d+"')");if(!c.text)throw RangeError("Every schema needs a 'text' type");for(let a in c.text.attrs)throw RangeError("The text node type should not have attributes");return c}}class gO{constructor(a,b,c){this.hasDefault=Object.prototype.hasOwnProperty.call(c,"default"),this.default=c.default,this.validate="string"==typeof c.validate?function(a,b,c){let d=c.split("|");return c=>{let e=null===c?"null":typeof c;if(0>d.indexOf(e))throw RangeError(`Expected value of type ${d} for attribute ${b} on type ${a}, got ${e}`)}}(a,b,c.validate):c.validate}get isRequired(){return!this.hasDefault}}class gP{constructor(a,b,c,d){this.name=a,this.rank=b,this.schema=c,this.spec=d,this.attrs=gM(a,d.attrs),this.excluded=null;let e=gJ(this.attrs);this.instance=e?new gm(this,e):null}create(a=null){return!a&&this.instance?this.instance:new gm(this,gK(this.attrs,a))}static compile(a,b){let c=Object.create(null),d=0;return a.forEach((a,e)=>c[a]=new gP(a,d++,b,e)),c}removeFromSet(a){for(var b=0;b<a.length;b++)a[b].type==this&&(a=a.slice(0,b).concat(a.slice(b+1)),b--);return a}isInSet(a){for(let b=0;b<a.length;b++)if(a[b].type==this)return a[b]}checkAttrs(a){gL(this.attrs,a,"mark",this.name)}excludes(a){return this.excluded.indexOf(a)>-1}}class gQ{constructor(a){this.linebreakReplacement=null,this.cached=Object.create(null);let b=this.spec={};for(let c in a)b[c]=a[c];b.nodes=gf.from(a.nodes),b.marks=gf.from(a.marks||{}),this.nodes=gN.compile(this.spec.nodes,this),this.marks=gP.compile(this.spec.marks,this);let c=Object.create(null);for(let a in this.nodes){if(a in this.marks)throw RangeError(a+" can not be both a node and a mark");let b=this.nodes[a],d=b.spec.content||"",e=b.spec.marks;if(b.contentMatch=c[d]||(c[d]=gE.parse(d,this.nodes)),b.inlineContent=b.contentMatch.inlineContent,b.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError("Multiple linebreak nodes defined");if(!b.isInline||!b.isLeaf)throw RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=b}b.markSet="_"==e?null:e?gR(this,e.split(" ")):""!=e&&b.inlineContent?null:[]}for(let a in this.marks){let b=this.marks[a],c=b.spec.excludes;b.excluded=null==c?[b]:""==c?[]:gR(this,c.split(" "))}this.nodeFromJSON=a=>gB.fromJSON(this,a),this.markFromJSON=a=>gm.fromJSON(this,a),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(a,b=null,c,d){if("string"==typeof a)a=this.nodeType(a);else if(a instanceof gN){if(a.schema!=this)throw RangeError("Node type from different schema used ("+a.name+")")}else throw RangeError("Invalid node type: "+a);return a.createChecked(b,c,d)}text(a,b){let c=this.nodes.text;return new gC(c,c.defaultAttrs,a,gm.setFrom(b))}mark(a,b){return"string"==typeof a&&(a=this.marks[a]),a.create(b)}nodeType(a){let b=this.nodes[a];if(!b)throw RangeError("Unknown node type: "+a);return b}}function gR(a,b){let c=[];for(let d=0;d<b.length;d++){let e=b[d],f=a.marks[e],g=f;if(f)c.push(f);else for(let b in a.marks){let d=a.marks[b];("_"==e||d.spec.group&&d.spec.group.split(" ").indexOf(e)>-1)&&c.push(g=d)}if(!g)throw SyntaxError("Unknown mark type: '"+b[d]+"'")}return c}class gS{constructor(a,b){this.schema=a,this.rules=b,this.tags=[],this.styles=[];let c=this.matchedStyles=[];b.forEach(a=>{if(null!=a.tag)this.tags.push(a);else if(null!=a.style){let b=/[^=]*/.exec(a.style)[0];0>c.indexOf(b)&&c.push(b),this.styles.push(a)}}),this.normalizeLists=!this.tags.some(b=>{if(!/^(ul|ol)\b/.test(b.tag)||!b.node)return!1;let c=a.nodes[b.node];return c.contentMatch.matchType(c)})}parse(a,b={}){let c=new gY(this,b,!1);return c.addAll(a,gm.none,b.from,b.to),c.finish()}parseSlice(a,b={}){let c=new gY(this,b,!0);return c.addAll(a,gm.none,b.from,b.to),go.maxOpen(c.finish())}matchTag(a,b,c){for(let f=c?this.tags.indexOf(c)+1:0;f<this.tags.length;f++){var d,e;let c=this.tags[f];if(d=a,e=c.tag,(d.matches||d.msMatchesSelector||d.webkitMatchesSelector||d.mozMatchesSelector).call(d,e)&&(void 0===c.namespace||a.namespaceURI==c.namespace)&&(!c.context||b.matchesContext(c.context))){if(c.getAttrs){let b=c.getAttrs(a);if(!1===b)continue;c.attrs=b||void 0}return c}}}matchStyle(a,b,c,d){for(let e=d?this.styles.indexOf(d)+1:0;e<this.styles.length;e++){let d=this.styles[e],f=d.style;if(0==f.indexOf(a)&&(!d.context||c.matchesContext(d.context))&&(!(f.length>a.length)||61==f.charCodeAt(a.length)&&f.slice(a.length+1)==b)){if(d.getAttrs){let a=d.getAttrs(b);if(!1===a)continue;d.attrs=a||void 0}return d}}}static schemaRules(a){let b=[];function c(a){let c=null==a.priority?50:a.priority,d=0;for(;d<b.length;d++){let a=b[d];if((null==a.priority?50:a.priority)<c)break}b.splice(d,0,a)}for(let b in a.marks){let d=a.marks[b].spec.parseDOM;d&&d.forEach(a=>{c(a=gZ(a)),a.mark||a.ignore||a.clearMark||(a.mark=b)})}for(let b in a.nodes){let d=a.nodes[b].spec.parseDOM;d&&d.forEach(a=>{c(a=gZ(a)),a.node||a.ignore||a.mark||(a.node=b)})}return b}static fromSchema(a){return a.cached.domParser||(a.cached.domParser=new gS(a,gS.schemaRules(a)))}}let gT={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},gU={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},gV={ol:!0,ul:!0};function gW(a,b,c){return null!=b?!!b|2*("full"===b):a&&"pre"==a.whitespace?3:-5&c}class gX{constructor(a,b,c,d,e,f){this.type=a,this.attrs=b,this.marks=c,this.solid=d,this.options=f,this.content=[],this.activeMarks=gm.none,this.match=e||(4&f?null:a.contentMatch)}findWrapping(a){if(!this.match){if(!this.type)return[];let b=this.type.contentMatch.fillBefore(gi.from(a));if(b)this.match=this.type.contentMatch.matchFragment(b);else{let b=this.type.contentMatch,c;return(c=b.findWrapping(a.type))?(this.match=b,c):null}}return this.match.findWrapping(a.type)}finish(a){if(!(1&this.options)){let a=this.content[this.content.length-1],b;a&&a.isText&&(b=/[ \t\r\n\u000c]+$/.exec(a.text))&&(a.text.length==b[0].length?this.content.pop():this.content[this.content.length-1]=a.withText(a.text.slice(0,a.text.length-b[0].length)))}let b=gi.from(this.content);return!a&&this.match&&(b=b.append(this.match.fillBefore(gi.empty,!0))),this.type?this.type.create(this.attrs,b,this.marks):b}inlineContext(a){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:a.parentNode&&!gT.hasOwnProperty(a.parentNode.nodeName.toLowerCase())}}class gY{constructor(a,b,c){this.parser=a,this.options=b,this.isOpen=c,this.open=0,this.localPreserveWS=!1;let d=b.topNode,e,f=gW(null,b.preserveWhitespace,0)|4*!!c;e=d?new gX(d.type,d.attrs,gm.none,!0,b.topMatch||d.type.contentMatch,f):c?new gX(null,null,gm.none,!0,null,f):new gX(a.schema.topNodeType,null,gm.none,!0,null,f),this.nodes=[e],this.find=b.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(a,b){3==a.nodeType?this.addTextNode(a,b):1==a.nodeType&&this.addElement(a,b)}addTextNode(a,b){let c=a.nodeValue,d=this.top,e=2&d.options?"full":this.localPreserveWS||(1&d.options)>0,{schema:f}=this.parser;if("full"===e||d.inlineContext(a)||/[^ \t\r\n\u000c]/.test(c)){if(e)if("full"===e)c=c.replace(/\r\n?/g,"\n");else if(f.linebreakReplacement&&/[\r\n]/.test(c)&&this.top.findWrapping(f.linebreakReplacement.create())){let a=c.split(/\r?\n|\r/);for(let c=0;c<a.length;c++)c&&this.insertNode(f.linebreakReplacement.create(),b,!0),a[c]&&this.insertNode(f.text(a[c]),b,!/\S/.test(a[c]));c=""}else c=c.replace(/\r?\n|\r/g," ");else if(c=c.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(c)&&this.open==this.nodes.length-1){let b=d.content[d.content.length-1],e=a.previousSibling;(!b||e&&"BR"==e.nodeName||b.isText&&/[ \t\r\n\u000c]$/.test(b.text))&&(c=c.slice(1))}c&&this.insertNode(f.text(c),b,!/\S/.test(c)),this.findInText(a)}else this.findInside(a)}addElement(a,b,c){let d=this.localPreserveWS,e=this.top;("PRE"==a.tagName||/pre/.test(a.style&&a.style.whiteSpace))&&(this.localPreserveWS=!0);let f=a.nodeName.toLowerCase(),g;gV.hasOwnProperty(f)&&this.parser.normalizeLists&&function(a){for(let b=a.firstChild,c=null;b;b=b.nextSibling){let a=1==b.nodeType?b.nodeName.toLowerCase():null;a&&gV.hasOwnProperty(a)&&c?(c.appendChild(b),b=c):"li"==a?c=b:a&&(c=null)}}(a);let h=this.options.ruleFromNode&&this.options.ruleFromNode(a)||(g=this.parser.matchTag(a,this,c));a:if(h?h.ignore:gU.hasOwnProperty(f))this.findInside(a),this.ignoreFallback(a,b);else if(!h||h.skip||h.closeParent){h&&h.closeParent?this.open=Math.max(0,this.open-1):h&&h.skip.nodeType&&(a=h.skip);let c,d=this.needsBlock;if(gT.hasOwnProperty(f))e.content.length&&e.content[0].isInline&&this.open&&(this.open--,e=this.top),c=!0,e.type||(this.needsBlock=!0);else if(!a.firstChild){this.leafFallback(a,b);break a}let g=h&&h.skip?b:this.readStyles(a,b);g&&this.addAll(a,g),c&&this.sync(e),this.needsBlock=d}else{let c=this.readStyles(a,b);c&&this.addElementByRule(a,h,c,!1===h.consuming?g:void 0)}this.localPreserveWS=d}leafFallback(a,b){"BR"==a.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(a.ownerDocument.createTextNode("\n"),b)}ignoreFallback(a,b){"BR"!=a.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"),b,!0)}readStyles(a,b){let c=a.style;if(c&&c.length)for(let a=0;a<this.parser.matchedStyles.length;a++){let d=this.parser.matchedStyles[a],e=c.getPropertyValue(d);if(e)for(let a;;){let c=this.parser.matchStyle(d,e,this,a);if(!c)break;if(c.ignore)return null;if(b=c.clearMark?b.filter(a=>!c.clearMark(a)):b.concat(this.parser.schema.marks[c.mark].create(c.attrs)),!1===c.consuming)a=c;else break}}return b}addElementByRule(a,b,c,d){let e,f;if(b.node)if((f=this.parser.schema.nodes[b.node]).isLeaf)this.insertNode(f.create(b.attrs),c,"BR"==a.nodeName)||this.leafFallback(a,c);else{let a=this.enter(f,b.attrs||null,c,b.preserveWhitespace);a&&(e=!0,c=a)}else{let a=this.parser.schema.marks[b.mark];c=c.concat(a.create(b.attrs))}let g=this.top;if(f&&f.isLeaf)this.findInside(a);else if(d)this.addElement(a,c,d);else if(b.getContent)this.findInside(a),b.getContent(a,this.parser.schema).forEach(a=>this.insertNode(a,c,!1));else{let d=a;"string"==typeof b.contentElement?d=a.querySelector(b.contentElement):"function"==typeof b.contentElement?d=b.contentElement(a):b.contentElement&&(d=b.contentElement),this.findAround(a,d,!0),this.addAll(d,c),this.findAround(a,d,!1)}e&&this.sync(g)&&this.open--}addAll(a,b,c,d){let e=c||0;for(let f=c?a.childNodes[c]:a.firstChild,g=null==d?null:a.childNodes[d];f!=g;f=f.nextSibling,++e)this.findAtPoint(a,e),this.addDOM(f,b);this.findAtPoint(a,e)}findPlace(a,b,c){let d,e;for(let b=this.open,f=0;b>=0;b--){let g=this.nodes[b],h=g.findWrapping(a);if(h&&(!d||d.length>h.length+f)&&(d=h,e=g,!h.length))break;if(g.solid){if(c)break;f+=2}}if(!d)return null;this.sync(e);for(let a=0;a<d.length;a++)b=this.enterInner(d[a],null,b,!1);return b}insertNode(a,b,c){if(a.isInline&&this.needsBlock&&!this.top.type){let a=this.textblockFromContext();a&&(b=this.enterInner(a,null,b))}let d=this.findPlace(a,b,c);if(d){this.closeExtra();let b=this.top;b.match&&(b.match=b.match.matchType(a.type));let c=gm.none;for(let e of d.concat(a.marks))(b.type?b.type.allowsMarkType(e.type):g$(e.type,a.type))&&(c=e.addToSet(c));return b.content.push(a.mark(c)),!0}return!1}enter(a,b,c,d){let e=this.findPlace(a.create(b),c,!1);return e&&(e=this.enterInner(a,b,c,!0,d)),e}enterInner(a,b,c,d=!1,e){this.closeExtra();let f=this.top;f.match=f.match&&f.match.matchType(a);let g=gW(a,e,f.options);4&f.options&&0==f.content.length&&(g|=4);let h=gm.none;return c=c.filter(b=>(f.type?!f.type.allowsMarkType(b.type):!g$(b.type,a))||(h=b.addToSet(h),!1)),this.nodes.push(new gX(a,b,h,d,null,g)),this.open++,c}closeExtra(a=!1){let b=this.nodes.length-1;if(b>this.open){for(;b>this.open;b--)this.nodes[b-1].content.push(this.nodes[b].finish(a));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(a){for(let b=this.open;b>=0;b--)if(this.nodes[b]==a)return this.open=b,!0;else this.localPreserveWS&&(this.nodes[b].options|=1);return!1}get currentPos(){this.closeExtra();let a=0;for(let b=this.open;b>=0;b--){let c=this.nodes[b].content;for(let b=c.length-1;b>=0;b--)a+=c[b].nodeSize;b&&a++}return a}findAtPoint(a,b){if(this.find)for(let c=0;c<this.find.length;c++)this.find[c].node==a&&this.find[c].offset==b&&(this.find[c].pos=this.currentPos)}findInside(a){if(this.find)for(let b=0;b<this.find.length;b++)null==this.find[b].pos&&1==a.nodeType&&a.contains(this.find[b].node)&&(this.find[b].pos=this.currentPos)}findAround(a,b,c){if(a!=b&&this.find)for(let d=0;d<this.find.length;d++)null==this.find[d].pos&&1==a.nodeType&&a.contains(this.find[d].node)&&b.compareDocumentPosition(this.find[d].node)&(c?2:4)&&(this.find[d].pos=this.currentPos)}findInText(a){if(this.find)for(let b=0;b<this.find.length;b++)this.find[b].node==a&&(this.find[b].pos=this.currentPos-(a.nodeValue.length-this.find[b].offset))}matchesContext(a){if(a.indexOf("|")>-1)return a.split(/\s*\|\s*/).some(this.matchesContext,this);let b=a.split("/"),c=this.options.context,d=!this.isOpen&&(!c||c.parent.type==this.nodes[0].type),e=-(c?c.depth+1:0)+ +!d,f=(a,g)=>{for(;a>=0;a--){let h=b[a];if(""==h){if(a==b.length-1||0==a)continue;for(;g>=e;g--)if(f(a-1,g))return!0;return!1}{let a=g>0||0==g&&d?this.nodes[g].type:c&&g>=e?c.node(g-e).type:null;if(!a||a.name!=h&&!a.isInGroup(h))return!1;g--}}return!0};return f(b.length-1,this.open)}textblockFromContext(){let a=this.options.context;if(a)for(let b=a.depth;b>=0;b--){let c=a.node(b).contentMatchAt(a.indexAfter(b)).defaultType;if(c&&c.isTextblock&&c.defaultAttrs)return c}for(let a in this.parser.schema.nodes){let b=this.parser.schema.nodes[a];if(b.isTextblock&&b.defaultAttrs)return b}}}function gZ(a){let b={};for(let c in a)b[c]=a[c];return b}function g$(a,b){let c=b.schema.nodes;for(let d in c){let e=c[d];if(!e.allowsMarkType(a))continue;let f=[],g=a=>{f.push(a);for(let c=0;c<a.edgeCount;c++){let{type:d,next:e}=a.edge(c);if(d==b||0>f.indexOf(e)&&g(e))return!0}};if(g(e.contentMatch))return!0}}class g_{constructor(a,b){this.nodes=a,this.marks=b}serializeFragment(a,b={},c){c||(c=g1(b).createDocumentFragment());let d=c,e=[];return a.forEach(a=>{if(e.length||a.marks.length){let c=0,f=0;for(;c<e.length&&f<a.marks.length;){let b=a.marks[f];if(!this.marks[b.type.name]){f++;continue}if(!b.eq(e[c][0])||!1===b.type.spec.spanning)break;c++,f++}for(;c<e.length;)d=e.pop()[1];for(;f<a.marks.length;){let c=a.marks[f++],g=this.serializeMark(c,a.isInline,b);g&&(e.push([c,d]),d.appendChild(g.dom),d=g.contentDOM||g.dom)}}d.appendChild(this.serializeNodeInner(a,b))}),c}serializeNodeInner(a,b){if(a.isText)return g1(b).createTextNode(a.text);let{dom:c,contentDOM:d}=g3(g1(b),this.nodes[a.type.name](a),null,a.attrs);if(d){if(a.isLeaf)throw RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(a.content,b,d)}return c}serializeNode(a,b={}){let c=this.serializeNodeInner(a,b);for(let d=a.marks.length-1;d>=0;d--){let e=this.serializeMark(a.marks[d],a.isInline,b);e&&((e.contentDOM||e.dom).appendChild(c),c=e.dom)}return c}serializeMark(a,b,c={}){let d=this.marks[a.type.name];return d&&g3(g1(c),d(a,b),null,a.attrs)}static renderSpec(a,b,c=null,d){return"string"==typeof b?{dom:a.createTextNode(b)}:g3(a,b,c,d)}static fromSchema(a){return a.cached.domSerializer||(a.cached.domSerializer=new g_(this.nodesFromSchema(a),this.marksFromSchema(a)))}static nodesFromSchema(a){let b=g0(a.nodes);return b.text||(b.text=a=>a.text),b}static marksFromSchema(a){return g0(a.marks)}}function g0(a){let b={};for(let c in a){let d=a[c].spec.toDOM;d&&(b[c]=d)}return b}function g1(a){return a.document||window.document}let g2=new WeakMap;function g3(a,b,c,d){let e,f,g;if(1==b.nodeType)return{dom:b};if(b.dom&&1==b.dom.nodeType)return b;let h=b[0],i;if("string"!=typeof h)throw RangeError("Invalid array passed to renderSpec");if(d&&(void 0===(f=g2.get(d))&&g2.set(d,(g=null,!function a(b){if(b&&"object"==typeof b)if(Array.isArray(b))if("string"==typeof b[0])g||(g=[]),g.push(b);else for(let c=0;c<b.length;c++)a(b[c]);else for(let c in b)a(b[c])}(d),f=g)),i=f)&&i.indexOf(b)>-1)throw RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let j=h.indexOf(" ");j>0&&(c=h.slice(0,j),h=h.slice(j+1));let k=c?a.createElementNS(c,h):a.createElement(h),l=b[1],m=1;if(l&&"object"==typeof l&&null==l.nodeType&&!Array.isArray(l)){for(let a in m=2,l)if(null!=l[a]){let b=a.indexOf(" ");b>0?k.setAttributeNS(a.slice(0,b),a.slice(b+1),l[a]):"style"==a&&k.style?k.style.cssText=l[a]:k.setAttribute(a,l[a])}}for(let f=m;f<b.length;f++){let g=b[f];if(0===g){if(f<b.length-1||f>m)throw RangeError("Content hole must be the only child of its parent node");return{dom:k,contentDOM:k}}if("string"==typeof g)k.appendChild(a.createTextNode(g));else{let{dom:b,contentDOM:f}=g3(a,g,c,d);if(k.appendChild(b),f){if(e)throw RangeError("Multiple content holes");e=f}}}return{dom:k,contentDOM:e}}class g4{constructor(a,b,c){this.pos=a,this.delInfo=b,this.recover=c}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 g5{constructor(a,b=!1){if(this.ranges=a,this.inverted=b,!a.length&&g5.empty)return g5.empty}recover(a){let b=0,c=65535&a;if(!this.inverted)for(let a=0;a<c;a++)b+=this.ranges[3*a+2]-this.ranges[3*a+1];return this.ranges[3*c]+b+(a-(65535&a))/65536}mapResult(a,b=1){return this._map(a,b,!1)}map(a,b=1){return this._map(a,b,!0)}_map(a,b,c){let d=0,e=this.inverted?2:1,f=this.inverted?1:2;for(let g=0;g<this.ranges.length;g+=3){let h=this.ranges[g]-(this.inverted?d:0);if(h>a)break;let i=this.ranges[g+e],j=this.ranges[g+f],k=h+i;if(a<=k){let e=i?a==h?-1:a==k?1:b:b,f=h+d+(e<0?0:j);if(c)return f;let l=a==(b<0?h:k)?null:g/3+(a-h)*65536,m=a==h?2:a==k?1:4;return(b<0?a!=h:a!=k)&&(m|=8),new g4(f,m,l)}d+=j-i}return c?a+d:new g4(a+d,0,null)}touches(a,b){let c=0,d=65535&b,e=this.inverted?2:1,f=this.inverted?1:2;for(let b=0;b<this.ranges.length;b+=3){let g=this.ranges[b]-(this.inverted?c:0);if(g>a)break;let h=this.ranges[b+e];if(a<=g+h&&b==3*d)return!0;c+=this.ranges[b+f]-h}return!1}forEach(a){let b=this.inverted?2:1,c=this.inverted?1:2;for(let d=0,e=0;d<this.ranges.length;d+=3){let f=this.ranges[d],g=f-(this.inverted?e:0),h=f+(this.inverted?0:e),i=this.ranges[d+b],j=this.ranges[d+c];a(g,g+i,h,h+j),e+=j-i}}invert(){return new g5(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(a){return 0==a?g5.empty:new g5(a<0?[0,-a,0]:[0,0,a])}}g5.empty=new g5([]);class g6{constructor(a,b,c=0,d=a?a.length:0){this.mirror=b,this.from=c,this.to=d,this._maps=a||[],this.ownData=!(a||b)}get maps(){return this._maps}slice(a=0,b=this.maps.length){return new g6(this._maps,this.mirror,a,b)}appendMap(a,b){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(a),null!=b&&this.setMirror(this._maps.length-1,b)}appendMapping(a){for(let b=0,c=this._maps.length;b<a._maps.length;b++){let d=a.getMirror(b);this.appendMap(a._maps[b],null!=d&&d<b?c+d:void 0)}}getMirror(a){if(this.mirror){for(let b=0;b<this.mirror.length;b++)if(this.mirror[b]==a)return this.mirror[b+(b%2?-1:1)]}}setMirror(a,b){this.mirror||(this.mirror=[]),this.mirror.push(a,b)}appendMappingInverted(a){for(let b=a.maps.length-1,c=this._maps.length+a._maps.length;b>=0;b--){let d=a.getMirror(b);this.appendMap(a._maps[b].invert(),null!=d&&d>b?c-d-1:void 0)}}invert(){let a=new g6;return a.appendMappingInverted(this),a}map(a,b=1){if(this.mirror)return this._map(a,b,!0);for(let c=this.from;c<this.to;c++)a=this._maps[c].map(a,b);return a}mapResult(a,b=1){return this._map(a,b,!1)}_map(a,b,c){let d=0;for(let c=this.from;c<this.to;c++){let e=this._maps[c].mapResult(a,b);if(null!=e.recover){let b=this.getMirror(c);if(null!=b&&b>c&&b<this.to){c=b,a=this._maps[b].recover(e.recover);continue}}d|=e.delInfo,a=e.pos}return c?a:new g4(a,d,null)}}let g7=Object.create(null);class g8{getMap(){return g5.empty}merge(a){return null}static fromJSON(a,b){if(!b||!b.stepType)throw RangeError("Invalid input for Step.fromJSON");let c=g7[b.stepType];if(!c)throw RangeError(`No step type ${b.stepType} defined`);return c.fromJSON(a,b)}static jsonID(a,b){if(a in g7)throw RangeError("Duplicate use of step JSON ID "+a);return g7[a]=b,b.prototype.jsonID=a,b}}class g9{constructor(a,b){this.doc=a,this.failed=b}static ok(a){return new g9(a,null)}static fail(a){return new g9(null,a)}static fromReplace(a,b,c,d){try{return g9.ok(a.replace(b,c,d))}catch(a){if(a instanceof gn)return g9.fail(a.message);throw a}}}function ha(a,b,c){let d=[];for(let e=0;e<a.childCount;e++){let f=a.child(e);f.content.size&&(f=f.copy(ha(f.content,b,f))),f.isInline&&(f=b(f,c,e)),d.push(f)}return gi.fromArray(d)}class hb extends g8{constructor(a,b,c){super(),this.from=a,this.to=b,this.mark=c}apply(a){let b=a.slice(this.from,this.to),c=a.resolve(this.from),d=c.node(c.sharedDepth(this.to)),e=new go(ha(b.content,(a,b)=>a.isAtom&&b.type.allowsMarkType(this.mark.type)?a.mark(this.mark.addToSet(a.marks)):a,d),b.openStart,b.openEnd);return g9.fromReplace(a,this.from,this.to,e)}invert(){return new hc(this.from,this.to,this.mark)}map(a){let b=a.mapResult(this.from,1),c=a.mapResult(this.to,-1);return b.deleted&&c.deleted||b.pos>=c.pos?null:new hb(b.pos,c.pos,this.mark)}merge(a){return a instanceof hb&&a.mark.eq(this.mark)&&this.from<=a.to&&this.to>=a.from?new hb(Math.min(this.from,a.from),Math.max(this.to,a.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(a,b){if("number"!=typeof b.from||"number"!=typeof b.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new hb(b.from,b.to,a.markFromJSON(b.mark))}}g8.jsonID("addMark",hb);class hc extends g8{constructor(a,b,c){super(),this.from=a,this.to=b,this.mark=c}apply(a){let b=a.slice(this.from,this.to),c=new go(ha(b.content,a=>a.mark(this.mark.removeFromSet(a.marks)),a),b.openStart,b.openEnd);return g9.fromReplace(a,this.from,this.to,c)}invert(){return new hb(this.from,this.to,this.mark)}map(a){let b=a.mapResult(this.from,1),c=a.mapResult(this.to,-1);return b.deleted&&c.deleted||b.pos>=c.pos?null:new hc(b.pos,c.pos,this.mark)}merge(a){return a instanceof hc&&a.mark.eq(this.mark)&&this.from<=a.to&&this.to>=a.from?new hc(Math.min(this.from,a.from),Math.max(this.to,a.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(a,b){if("number"!=typeof b.from||"number"!=typeof b.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new hc(b.from,b.to,a.markFromJSON(b.mark))}}g8.jsonID("removeMark",hc);class hd extends g8{constructor(a,b){super(),this.pos=a,this.mark=b}apply(a){let b=a.nodeAt(this.pos);if(!b)return g9.fail("No node at mark step's position");let c=b.type.create(b.attrs,null,this.mark.addToSet(b.marks));return g9.fromReplace(a,this.pos,this.pos+1,new go(gi.from(c),0,+!b.isLeaf))}invert(a){let b=a.nodeAt(this.pos);if(b){let a=this.mark.addToSet(b.marks);if(a.length==b.marks.length){for(let c=0;c<b.marks.length;c++)if(!b.marks[c].isInSet(a))return new hd(this.pos,b.marks[c]);return new hd(this.pos,this.mark)}}return new he(this.pos,this.mark)}map(a){let b=a.mapResult(this.pos,1);return b.deletedAfter?null:new hd(b.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(a,b){if("number"!=typeof b.pos)throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new hd(b.pos,a.markFromJSON(b.mark))}}g8.jsonID("addNodeMark",hd);class he extends g8{constructor(a,b){super(),this.pos=a,this.mark=b}apply(a){let b=a.nodeAt(this.pos);if(!b)return g9.fail("No node at mark step's position");let c=b.type.create(b.attrs,null,this.mark.removeFromSet(b.marks));return g9.fromReplace(a,this.pos,this.pos+1,new go(gi.from(c),0,+!b.isLeaf))}invert(a){let b=a.nodeAt(this.pos);return b&&this.mark.isInSet(b.marks)?new hd(this.pos,this.mark):this}map(a){let b=a.mapResult(this.pos,1);return b.deletedAfter?null:new he(b.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(a,b){if("number"!=typeof b.pos)throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new he(b.pos,a.markFromJSON(b.mark))}}g8.jsonID("removeNodeMark",he);class hf extends g8{constructor(a,b,c,d=!1){super(),this.from=a,this.to=b,this.slice=c,this.structure=d}apply(a){return this.structure&&hh(a,this.from,this.to)?g9.fail("Structure replace would overwrite content"):g9.fromReplace(a,this.from,this.to,this.slice)}getMap(){return new g5([this.from,this.to-this.from,this.slice.size])}invert(a){return new hf(this.from,this.from+this.slice.size,a.slice(this.from,this.to))}map(a){let b=a.mapResult(this.to,-1),c=this.from==this.to&&hf.MAP_BIAS<0?b:a.mapResult(this.from,1);return c.deletedAcross&&b.deletedAcross?null:new hf(c.pos,Math.max(c.pos,b.pos),this.slice,this.structure)}merge(a){if(!(a instanceof hf)||a.structure||this.structure)return null;if(this.from+this.slice.size!=a.from||this.slice.openEnd||a.slice.openStart)if(a.to!=this.from||this.slice.openStart||a.slice.openEnd)return null;else{let b=this.slice.size+a.slice.size==0?go.empty:new go(a.slice.content.append(this.slice.content),a.slice.openStart,this.slice.openEnd);return new hf(a.from,this.to,b,this.structure)}{let b=this.slice.size+a.slice.size==0?go.empty:new go(this.slice.content.append(a.slice.content),this.slice.openStart,a.slice.openEnd);return new hf(this.from,this.to+(a.to-a.from),b,this.structure)}}toJSON(){let a={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(a.slice=this.slice.toJSON()),this.structure&&(a.structure=!0),a}static fromJSON(a,b){if("number"!=typeof b.from||"number"!=typeof b.to)throw RangeError("Invalid input for ReplaceStep.fromJSON");return new hf(b.from,b.to,go.fromJSON(a,b.slice),!!b.structure)}}hf.MAP_BIAS=1,g8.jsonID("replace",hf);class hg extends g8{constructor(a,b,c,d,e,f,g=!1){super(),this.from=a,this.to=b,this.gapFrom=c,this.gapTo=d,this.slice=e,this.insert=f,this.structure=g}apply(a){if(this.structure&&(hh(a,this.from,this.gapFrom)||hh(a,this.gapTo,this.to)))return g9.fail("Structure gap-replace would overwrite content");let b=a.slice(this.gapFrom,this.gapTo);if(b.openStart||b.openEnd)return g9.fail("Gap is not a flat range");let c=this.slice.insertAt(this.insert,b.content);return c?g9.fromReplace(a,this.from,this.to,c):g9.fail("Content does not fit in gap")}getMap(){return new g5([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(a){let b=this.gapTo-this.gapFrom;return new hg(this.from,this.from+this.slice.size+b,this.from+this.insert,this.from+this.insert+b,a.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(a){let b=a.mapResult(this.from,1),c=a.mapResult(this.to,-1),d=this.from==this.gapFrom?b.pos:a.map(this.gapFrom,-1),e=this.to==this.gapTo?c.pos:a.map(this.gapTo,1);return b.deletedAcross&&c.deletedAcross||d<b.pos||e>c.pos?null:new hg(b.pos,c.pos,d,e,this.slice,this.insert,this.structure)}toJSON(){let a={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(a.slice=this.slice.toJSON()),this.structure&&(a.structure=!0),a}static fromJSON(a,b){if("number"!=typeof b.from||"number"!=typeof b.to||"number"!=typeof b.gapFrom||"number"!=typeof b.gapTo||"number"!=typeof b.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new hg(b.from,b.to,b.gapFrom,b.gapTo,go.fromJSON(a,b.slice),b.insert,!!b.structure)}}function hh(a,b,c){let d=a.resolve(b),e=c-b,f=d.depth;for(;e>0&&f>0&&d.indexAfter(f)==d.node(f).childCount;)f--,e--;if(e>0){let a=d.node(f).maybeChild(d.indexAfter(f));for(;e>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,e--}}return!1}function hi(a,b,c,d=c.contentMatch,e=!0){let f=a.doc.nodeAt(b),g=[],h=b+1;for(let b=0;b<f.childCount;b++){let i=f.child(b),j=h+i.nodeSize,k=d.matchType(i.type);if(k){d=k;for(let b=0;b<i.marks.length;b++)c.allowsMarkType(i.marks[b].type)||a.step(new hc(h,j,i.marks[b]));if(e&&i.isText&&"pre"!=c.whitespace){let a,b=/\r?\n|\r/g,d;for(;a=b.exec(i.text);)d||(d=new go(gi.from(c.schema.text(" ",c.allowedMarks(i.marks))),0,0)),g.push(new hf(h+a.index,h+a.index+a[0].length,d))}}else g.push(new hf(h,j,go.empty));h=j}if(!d.validEnd){let b=d.fillBefore(gi.empty,!0);a.replace(h,h,new go(b,0,0))}for(let b=g.length-1;b>=0;b--)a.step(g[b])}function hj(a){let b=a.parent.content.cutByIndex(a.startIndex,a.endIndex);for(let c=a.depth,d=0,e=0;;--c){let f=a.$from.node(c),g=a.$from.index(c)+d,h=a.$to.indexAfter(c)-e;if(c<a.depth&&f.canReplace(g,h,b))return c;if(0==c||f.type.spec.isolating||!((0==g||f.canReplace(g,f.childCount))&&(h==f.childCount||f.canReplace(0,h))))break;g&&(d=1),h<f.childCount&&(e=1)}return null}function hk(a,b,c=null,d=a){let e=function(a,b){let{parent:c,startIndex:d,endIndex:e}=a,f=c.contentMatchAt(d).findWrapping(b);if(!f)return null;let g=f.length?f[0]:b;return c.canReplaceWith(d,e,g)?f:null}(a,b),f=e&&function(a,b){let{parent:c,startIndex:d,endIndex:e}=a,f=c.child(d),g=b.contentMatch.findWrapping(f.type);if(!g)return null;let h=(g.length?g[g.length-1]:b).contentMatch;for(let a=d;h&&a<e;a++)h=h.matchType(c.child(a).type);return h&&h.validEnd?g:null}(d,b);return f?e.map(hl).concat({type:b,attrs:c}).concat(f.map(hl)):null}function hl(a){return{type:a,attrs:null}}function hm(a,b,c,d){b.forEach((e,f)=>{if(e.isText){let g,h=/\r?\n|\r/g;for(;g=h.exec(e.text);){let e=a.mapping.slice(d).map(c+1+f+g.index);a.replaceWith(e,e+1,b.type.schema.linebreakReplacement.create())}}})}function hn(a,b,c,d){b.forEach((e,f)=>{if(e.type==e.type.schema.linebreakReplacement){let e=a.mapping.slice(d).map(c+1+f);a.replaceWith(e,e+1,b.type.schema.text("\n"))}})}function ho(a,b,c=1,d){let e=a.resolve(b),f=e.depth-c,g=d&&d[d.length-1]||e.parent;if(f<0||e.parent.type.spec.isolating||!e.parent.canReplace(e.index(),e.parent.childCount)||!g.type.validContent(e.parent.content.cutByIndex(e.index(),e.parent.childCount)))return!1;for(let a=e.depth-1,b=c-2;a>f;a--,b--){let c=e.node(a),f=e.index(a);if(c.type.spec.isolating)return!1;let g=c.content.cutByIndex(f,c.childCount),h=d&&d[b+1];h&&(g=g.replaceChild(0,h.type.create(h.attrs)));let i=d&&d[b]||c;if(!c.canReplace(f+1,c.childCount)||!i.type.validContent(g))return!1}let h=e.indexAfter(f),i=d&&d[0];return e.node(f).canReplaceWith(h,h,i?i.type:e.node(f+1).type)}function hp(a,b){var c,d;let e=a.resolve(b),f=e.index();return c=e.nodeBefore,d=e.nodeAfter,!!(c&&d&&!c.isLeaf&&function(a,b){b.content.size||a.type.compatibleContent(b.type);let c=a.contentMatchAt(a.childCount),{linebreakReplacement:d}=a.type.schema;for(let e=0;e<b.childCount;e++){let f=b.child(e),g=f.type==d?a.type.schema.nodes.text:f.type;if(!(c=c.matchType(g))||!a.type.allowsMarks(f.marks))return!1}return c.validEnd}(c,d))&&e.parent.canReplace(f,f+1)}function hq(a,b,c=b,d=go.empty){if(b==c&&!d.size)return null;let e=a.resolve(b),f=a.resolve(c);return hr(e,f,d)?new hf(b,c,d):new hs(e,f,d).fit()}function hr(a,b,c){return!c.openStart&&!c.openEnd&&a.start()==b.start()&&a.parent.canReplace(a.index(),b.index(),c.content)}g8.jsonID("replaceAround",hg);class hs{constructor(a,b,c){this.$from=a,this.$to=b,this.unplaced=c,this.frontier=[],this.placed=gi.empty;for(let b=0;b<=a.depth;b++){let c=a.node(b);this.frontier.push({type:c.type,match:c.contentMatchAt(a.indexAfter(b))})}for(let b=a.depth;b>0;b--)this.placed=gi.from(a.node(b).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let a=this.findFittable();a?this.placeNodes(a):this.openMore()||this.dropNode()}let a=this.mustMoveInline(),b=this.placed.size-this.depth-this.$from.depth,c=this.$from,d=this.close(a<0?this.$to:c.doc.resolve(a));if(!d)return null;let e=this.placed,f=c.depth,g=d.depth;for(;f&&g&&1==e.childCount;)e=e.firstChild.content,f--,g--;let h=new go(e,f,g);return a>-1?new hg(c.pos,a,this.$to.pos,this.$to.end(),h,b):h.size||c.pos!=this.$to.pos?new hf(c.pos,d.pos,h):null}findFittable(){let a=this.unplaced.openStart;for(let b=this.unplaced.content,c=0,d=this.unplaced.openEnd;c<a;c++){let e=b.firstChild;if(b.childCount>1&&(d=0),e.type.spec.isolating&&d<=c){a=c;break}b=e.content}for(let b=1;b<=2;b++)for(let c=1==b?a:this.unplaced.openStart;c>=0;c--){let a=null,d=(c?(a=hv(this.unplaced.content,c-1).firstChild).content:this.unplaced.content).firstChild;for(let e=this.depth;e>=0;e--){let{type:f,match:g}=this.frontier[e],h,i=null;if(1==b&&(d?g.matchType(d.type)||(i=g.fillBefore(gi.from(d),!1)):a&&f.compatibleContent(a.type)))return{sliceDepth:c,frontierDepth:e,parent:a,inject:i};if(2==b&&d&&(h=g.findWrapping(d.type)))return{sliceDepth:c,frontierDepth:e,parent:a,wrap:h};if(a&&g.matchType(a.type))break}}}openMore(){let{content:a,openStart:b,openEnd:c}=this.unplaced;return!(hx(a,-1)<=b)&&(this.unplaced.size>1&&hx(a,1)>c&&c++,this.unplaced=new go(a,b+1,c),!0)}dropNode(){let{content:a,openStart:b,openEnd:c}=this.unplaced,d=hv(a,b);if(d.childCount<=1&&b>0){let e=a.size-b<=b+d.size;this.unplaced=new go(ht(a,b-1,1),b-1,e?b-1:c)}else this.unplaced=new go(ht(a,b,1),b,c)}placeNodes({sliceDepth:a,frontierDepth:b,parent:c,inject:d,wrap:e}){for(;this.depth>b;)this.closeFrontierNode();if(e)for(let a=0;a<e.length;a++)this.openFrontierNode(e[a]);let f=this.unplaced,g=c?c.content:f.content,h=f.openStart-a,i=0,j=[],{match:k,type:l}=this.frontier[b];if(d){for(let a=0;a<d.childCount;a++)j.push(d.child(a));k=k.matchFragment(d)}let m=g.size+a-(f.content.size-f.openEnd);for(;i<g.childCount;){let a=g.child(i),b=k.matchType(a.type);if(!b)break;(++i>1||0==h||a.content.size)&&(k=b,j.push(function a(b,c,d){if(c<=0)return b;let e=b.content;return c>1&&(e=e.replaceChild(0,a(e.firstChild,c-1,1==e.childCount?d-1:0))),c>0&&(e=b.type.contentMatch.fillBefore(e).append(e),d<=0&&(e=e.append(b.type.contentMatch.matchFragment(e).fillBefore(gi.empty,!0)))),b.copy(e)}(a.mark(l.allowedMarks(a.marks)),1==i?h:0,i==g.childCount?m:-1)))}let n=i==g.childCount;n||(m=-1),this.placed=hu(this.placed,b,gi.from(j)),this.frontier[b].match=k,n&&m<0&&c&&c.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let a=0,b=g;a<m;a++){let a=b.lastChild;this.frontier.push({type:a.type,match:a.contentMatchAt(a.childCount)}),b=a.content}this.unplaced=n?0==a?go.empty:new go(ht(f.content,a-1,1),a-1,m<0?f.openEnd:a-1):new go(ht(f.content,a,i),f.openStart,f.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return -1;let a=this.frontier[this.depth],b;if(!a.type.isTextblock||!hw(this.$to,this.$to.depth,a.type,a.match,!1)||this.$to.depth==this.depth&&(b=this.findCloseLevel(this.$to))&&b.depth==this.depth)return -1;let{depth:c}=this.$to,d=this.$to.after(c);for(;c>1&&d==this.$to.end(--c);)++d;return d}findCloseLevel(a){b:for(let b=Math.min(this.depth,a.depth);b>=0;b--){let{match:c,type:d}=this.frontier[b],e=b<a.depth&&a.end(b+1)==a.pos+(a.depth-(b+1)),f=hw(a,b,d,c,e);if(f){for(let c=b-1;c>=0;c--){let{match:b,type:d}=this.frontier[c],e=hw(a,c,d,b,!0);if(!e||e.childCount)continue b}return{depth:b,fit:f,move:e?a.doc.resolve(a.after(b+1)):a}}}}close(a){let b=this.findCloseLevel(a);if(!b)return null;for(;this.depth>b.depth;)this.closeFrontierNode();b.fit.childCount&&(this.placed=hu(this.placed,b.depth,b.fit)),a=b.move;for(let c=b.depth+1;c<=a.depth;c++){let b=a.node(c),d=b.type.contentMatch.fillBefore(b.content,!0,a.index(c));this.openFrontierNode(b.type,b.attrs,d)}return a}openFrontierNode(a,b=null,c){let d=this.frontier[this.depth];d.match=d.match.matchType(a),this.placed=hu(this.placed,this.depth,gi.from(a.create(b,c))),this.frontier.push({type:a,match:a.contentMatch})}closeFrontierNode(){let a=this.frontier.pop().match.fillBefore(gi.empty,!0);a.childCount&&(this.placed=hu(this.placed,this.frontier.length,a))}}function ht(a,b,c){return 0==b?a.cutByIndex(c,a.childCount):a.replaceChild(0,a.firstChild.copy(ht(a.firstChild.content,b-1,c)))}function hu(a,b,c){return 0==b?a.append(c):a.replaceChild(a.childCount-1,a.lastChild.copy(hu(a.lastChild.content,b-1,c)))}function hv(a,b){for(let c=0;c<b;c++)a=a.firstChild.content;return a}function hw(a,b,c,d,e){let f=a.node(b),g=e?a.indexAfter(b):a.index(b);if(g==f.childCount&&!c.compatibleContent(f.type))return null;let h=d.fillBefore(f.content,!0,g);return h&&!function(a,b,c){for(let d=c;d<b.childCount;d++)if(!a.allowsMarks(b.child(d).marks))return!0;return!1}(c,f.content,g)?h:null}function hx(a,b){for(let c=0;;c++){let d=b<0?a.firstChild:a.lastChild;if(!d||d.isAtom)return c;a=d.content}}function hy(a,b){let c=[],d=Math.min(a.depth,b.depth);for(let e=d;e>=0;e--){let d=a.start(e);if(d<a.pos-(a.depth-e)||b.end(e)>b.pos+(b.depth-e)||a.node(e).type.spec.isolating||b.node(e).type.spec.isolating)break;(d==b.start(e)||e==a.depth&&e==b.depth&&a.parent.inlineContent&&b.parent.inlineContent&&e&&b.start(e-1)==d-1)&&c.push(e)}return c}class hz extends g8{constructor(a,b,c){super(),this.pos=a,this.attr=b,this.value=c}apply(a){let b=a.nodeAt(this.pos);if(!b)return g9.fail("No node at attribute step's position");let c=Object.create(null);for(let a in b.attrs)c[a]=b.attrs[a];c[this.attr]=this.value;let d=b.type.create(c,null,b.marks);return g9.fromReplace(a,this.pos,this.pos+1,new go(gi.from(d),0,+!b.isLeaf))}getMap(){return g5.empty}invert(a){return new hz(this.pos,this.attr,a.nodeAt(this.pos).attrs[this.attr])}map(a){let b=a.mapResult(this.pos,1);return b.deletedAfter?null:new hz(b.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(a,b){if("number"!=typeof b.pos||"string"!=typeof b.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new hz(b.pos,b.attr,b.value)}}g8.jsonID("attr",hz);class hA extends g8{constructor(a,b){super(),this.attr=a,this.value=b}apply(a){let b=Object.create(null);for(let c in a.attrs)b[c]=a.attrs[c];b[this.attr]=this.value;let c=a.type.create(b,a.content,a.marks);return g9.ok(c)}getMap(){return g5.empty}invert(a){return new hA(this.attr,a.attrs[this.attr])}map(a){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(a,b){if("string"!=typeof b.attr)throw RangeError("Invalid input for DocAttrStep.fromJSON");return new hA(b.attr,b.value)}}g8.jsonID("docAttr",hA);let hB=class extends Error{};(hB=function a(b){let c=Error.call(this,b);return c.__proto__=a.prototype,c}).prototype=Object.create(Error.prototype),hB.prototype.constructor=hB,hB.prototype.name="TransformError";class hC{constructor(a){this.doc=a,this.steps=[],this.docs=[],this.mapping=new g6}get before(){return this.docs.length?this.docs[0]:this.doc}step(a){let b=this.maybeStep(a);if(b.failed)throw new hB(b.failed);return this}maybeStep(a){let b=a.apply(this.doc);return b.failed||this.addStep(a,b.doc),b}get docChanged(){return this.steps.length>0}changedRange(){let a=1e9,b=-1e9;for(let c=0;c<this.mapping.maps.length;c++){let d=this.mapping.maps[c];c&&(a=d.map(a,1),b=d.map(b,-1)),d.forEach((c,d,e,f)=>{a=Math.min(a,e),b=Math.max(b,f)})}return 1e9==a?null:{from:a,to:b}}addStep(a,b){this.docs.push(this.doc),this.steps.push(a),this.mapping.appendMap(a.getMap()),this.doc=b}replace(a,b=a,c=go.empty){let d=hq(this.doc,a,b,c);return d&&this.step(d),this}replaceWith(a,b,c){return this.replace(a,b,new go(gi.from(c),0,0))}delete(a,b){return this.replace(a,b,go.empty)}insert(a,b){return this.replaceWith(a,a,b)}replaceRange(a,b,c){return!function(a,b,c,d){if(!d.size)return a.deleteRange(b,c);let e=a.doc.resolve(b),f=a.doc.resolve(c);if(hr(e,f,d))return a.step(new hf(b,c,d));let g=hy(e,f);0==g[g.length-1]&&g.pop();let h=-(e.depth+1);g.unshift(h);for(let a=e.depth,b=e.pos-1;a>0;a--,b--){let c=e.node(a).type.spec;if(c.defining||c.definingAsContext||c.isolating)break;g.indexOf(a)>-1?h=a:e.before(a)==b&&g.splice(1,0,-a)}let i=g.indexOf(h),j=[],k=d.openStart;for(let a=d.content,b=0;;b++){let c=a.firstChild;if(j.push(c),b==d.openStart)break;a=c.content}for(let a=k-1;a>=0;a--){var l;let b=j[a],c=(l=b.type).spec.defining||l.spec.definingForContent;if(c&&!b.sameMarkup(e.node(Math.abs(h)-1)))k=a;else if(c||!b.type.isTextblock)break}for(let b=d.openStart;b>=0;b--){let h=(b+k+1)%(d.openStart+1),l=j[h];if(l)for(let b=0;b<g.length;b++){let j=g[(b+i)%g.length],k=!0;j<0&&(k=!1,j=-j);let m=e.node(j-1),n=e.index(j-1);if(m.canReplaceWith(n,n,l.type,l.marks))return a.replace(e.before(j),k?f.after(j):c,new go(function a(b,c,d,e,f){if(c<d){let f=b.firstChild;b=b.replaceChild(0,f.copy(a(f.content,c+1,d,e,f)))}if(c>e){let a=f.contentMatchAt(0),c=a.fillBefore(b).append(b);b=c.append(a.matchFragment(c).fillBefore(gi.empty,!0))}return b}(d.content,0,d.openStart,h),h,d.openEnd))}}let m=a.steps.length;for(let h=g.length-1;h>=0&&(a.replace(b,c,d),!(a.steps.length>m));h--){let a=g[h];a<0||(b=e.before(a),c=f.after(a))}}(this,a,b,c),this}replaceRangeWith(a,b,c){var d=a,e=b;if(!c.isInline&&d==e&&this.doc.resolve(d).parent.content.size){let a=function(a,b,c){let d=a.resolve(b);if(d.parent.canReplaceWith(d.index(),d.index(),c))return b;if(0==d.parentOffset)for(let a=d.depth-1;a>=0;a--){let b=d.index(a);if(d.node(a).canReplaceWith(b,b,c))return d.before(a+1);if(b>0)return null}if(d.parentOffset==d.parent.content.size)for(let a=d.depth-1;a>=0;a--){let b=d.indexAfter(a);if(d.node(a).canReplaceWith(b,b,c))return d.after(a+1);if(b<d.node(a).childCount)break}return null}(this.doc,d,c.type);null!=a&&(d=e=a)}return this.replaceRange(d,e,new go(gi.from(c),0,0)),this}deleteRange(a,b){return!function(a,b,c){let d=a.doc.resolve(b),e=a.doc.resolve(c);if(d.parent.isTextblock&&e.parent.isTextblock&&d.start()!=e.start()&&0==d.parentOffset&&0==e.parentOffset){let f=d.sharedDepth(c),g=!1;for(let a=d.depth;a>f;a--)d.node(a).type.spec.isolating&&(g=!0);for(let a=e.depth;a>f;a--)e.node(a).type.spec.isolating&&(g=!0);if(!g){for(let a=d.depth;a>0&&b==d.start(a);a--)b=d.before(a);for(let a=e.depth;a>0&&c==e.start(a);a--)c=e.before(a);d=a.doc.resolve(b),e=a.doc.resolve(c)}}let f=hy(d,e);for(let b=0;b<f.length;b++){let c=f[b],g=b==f.length-1;if(g&&0==c||d.node(c).type.contentMatch.validEnd)return a.delete(d.start(c),e.end(c));if(c>0&&(g||d.node(c-1).canReplace(d.index(c-1),e.indexAfter(c-1))))return a.delete(d.before(c),e.after(c))}for(let f=1;f<=d.depth&&f<=e.depth;f++)if(b-d.start(f)==d.depth-f&&c>d.end(f)&&e.end(f)-c!=e.depth-f&&d.start(f-1)==e.start(f-1)&&d.node(f-1).canReplace(d.index(f-1),e.index(f-1)))return a.delete(d.before(f),c);a.delete(b,c)}(this,a,b),this}lift(a,b){return!function(a,b,c){let{$from:d,$to:e,depth:f}=b,g=d.before(f+1),h=e.after(f+1),i=g,j=h,k=gi.empty,l=0;for(let a=f,b=!1;a>c;a--)b||d.index(a)>0?(b=!0,k=gi.from(d.node(a).copy(k)),l++):i--;let m=gi.empty,n=0;for(let a=f,b=!1;a>c;a--)b||e.after(a+1)<e.end(a)?(b=!0,m=gi.from(e.node(a).copy(m)),n++):j++;a.step(new hg(i,j,g,h,new go(k.append(m),l,n),k.size-l,!0))}(this,a,b),this}join(a,b=1){return!function(a,b,c){let d=null,{linebreakReplacement:e}=a.doc.type.schema,f=a.doc.resolve(b-c),g=f.node().type;if(e&&g.inlineContent){let a="pre"==g.whitespace,b=!!g.contentMatch.matchType(e);a&&!b?d=!1:!a&&b&&(d=!0)}let h=a.steps.length;if(!1===d){let d=a.doc.resolve(b+c);hn(a,d.node(),d.before(),h)}g.inlineContent&&hi(a,b+c-1,g,f.node().contentMatchAt(f.index()),null==d);let i=a.mapping.slice(h),j=i.map(b-c);if(a.step(new hf(j,i.map(b+c,-1),go.empty,!0)),!0===d){let b=a.doc.resolve(j);hm(a,b.node(),b.before(),a.steps.length)}}(this,a,b),this}wrap(a,b){return!function(a,b,c){let d=gi.empty;for(let a=c.length-1;a>=0;a--){if(d.size){let b=c[a].type.contentMatch.matchFragment(d);if(!b||!b.validEnd)throw RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}d=gi.from(c[a].type.create(c[a].attrs,d))}let e=b.start,f=b.end;a.step(new hg(e,f,e,f,new go(d,0,0),c.length,!0))}(this,a,b),this}setBlockType(a,b=a,c,d=null){var e=this;if(!c.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");let f=e.steps.length;return e.doc.nodesBetween(a,b,(a,b)=>{var g,h,i;let j,k,l="function"==typeof d?d(a):d;if(a.isTextblock&&!a.hasMarkup(c,l)&&(g=e.doc,h=e.mapping.slice(f).map(b),i=c,k=(j=g.resolve(h)).index(),j.parent.canReplaceWith(k,k+1,i))){let d=null;if(c.schema.linebreakReplacement){let a="pre"==c.whitespace,b=!!c.contentMatch.matchType(c.schema.linebreakReplacement);a&&!b?d=!1:!a&&b&&(d=!0)}!1===d&&hn(e,a,b,f),hi(e,e.mapping.slice(f).map(b,1),c,void 0,null===d);let g=e.mapping.slice(f),h=g.map(b,1),i=g.map(b+a.nodeSize,1);return e.step(new hg(h,i,h+1,i-1,new go(gi.from(c.create(l,null,a.marks)),0,0),1,!0)),!0===d&&hm(e,a,b,f),!1}}),this}setNodeMarkup(a,b,c=null,d){return!function(a,b,c,d,e){let f=a.doc.nodeAt(b);if(!f)throw RangeError("No node at given position");c||(c=f.type);let g=c.create(d,null,e||f.marks);if(f.isLeaf)return a.replaceWith(b,b+f.nodeSize,g);if(!c.validContent(f.content))throw RangeError("Invalid content for node type "+c.name);a.step(new hg(b,b+f.nodeSize,b+1,b+f.nodeSize-1,new go(gi.from(g),0,0),1,!0))}(this,a,b,c,d),this}setNodeAttribute(a,b,c){return this.step(new hz(a,b,c)),this}setDocAttribute(a,b){return this.step(new hA(a,b)),this}addNodeMark(a,b){return this.step(new hd(a,b)),this}removeNodeMark(a,b){let c=this.doc.nodeAt(a);if(!c)throw RangeError("No node at position "+a);if(b instanceof gm)b.isInSet(c.marks)&&this.step(new he(a,b));else{let d=c.marks,e,f=[];for(;e=b.isInSet(d);)f.push(new he(a,e)),d=e.removeFromSet(d);for(let a=f.length-1;a>=0;a--)this.step(f[a])}return this}split(a,b=1,c){return!function(a,b,c=1,d){let e=a.doc.resolve(b),f=gi.empty,g=gi.empty;for(let a=e.depth,b=e.depth-c,h=c-1;a>b;a--,h--){f=gi.from(e.node(a).copy(f));let b=d&&d[h];g=gi.from(b?b.type.create(b.attrs,g):e.node(a).copy(g))}a.step(new hf(b,b,new go(f.append(g),c,c),!0))}(this,a,b,c),this}addMark(a,b,c){var d;let e,f,g,h;return d=this,g=[],h=[],d.doc.nodesBetween(a,b,(d,i,j)=>{if(!d.isInline)return;let k=d.marks;if(!c.isInSet(k)&&j.type.allowsMarkType(c.type)){let j=Math.max(i,a),l=Math.min(i+d.nodeSize,b),m=c.addToSet(k);for(let a=0;a<k.length;a++)k[a].isInSet(m)||(e&&e.to==j&&e.mark.eq(k[a])?e.to=l:g.push(e=new hc(j,l,k[a])));f&&f.to==j?f.to=l:h.push(f=new hb(j,l,c))}}),g.forEach(a=>d.step(a)),h.forEach(a=>d.step(a)),this}removeMark(a,b,c){var d;let e,f;return d=this,e=[],f=0,d.doc.nodesBetween(a,b,(d,g)=>{if(!d.isInline)return;f++;let h=null;if(c instanceof gP){let a=d.marks,b;for(;b=c.isInSet(a);)(h||(h=[])).push(b),a=b.removeFromSet(a)}else c?c.isInSet(d.marks)&&(h=[c]):h=d.marks;if(h&&h.length){let c=Math.min(g+d.nodeSize,b);for(let b=0;b<h.length;b++){let d=h[b],i;for(let a=0;a<e.length;a++){let b=e[a];b.step==f-1&&d.eq(e[a].style)&&(i=b)}i?(i.to=c,i.step=f):e.push({style:d,from:Math.max(g,a),to:c,step:f})}}}),e.forEach(a=>d.step(new hc(a.from,a.to,a.style))),this}clearIncompatible(a,b,c){return hi(this,a,b,c),this}}let hD=Object.create(null);class hE{constructor(a,b,c){this.$anchor=a,this.$head=b,this.ranges=c||[new hF(a.min(b),a.max(b))]}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 a=this.ranges;for(let b=0;b<a.length;b++)if(a[b].$from.pos!=a[b].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(a,b=go.empty){let c=b.content.lastChild,d=null;for(let a=0;a<b.openEnd;a++)d=c,c=c.lastChild;let e=a.steps.length,f=this.ranges;for(let g=0;g<f.length;g++){let{$from:h,$to:i}=f[g],j=a.mapping.slice(e);a.replaceRange(j.map(h.pos),j.map(i.pos),g?go.empty:b),0==g&&hP(a,e,(c?c.isInline:d&&d.isTextblock)?-1:1)}}replaceWith(a,b){let c=a.steps.length,d=this.ranges;for(let e=0;e<d.length;e++){let{$from:f,$to:g}=d[e],h=a.mapping.slice(c),i=h.map(f.pos),j=h.map(g.pos);e?a.deleteRange(i,j):(a.replaceRangeWith(i,j,b),hP(a,c,b.isInline?-1:1))}}static findFrom(a,b,c=!1){let d=a.parent.inlineContent?new hI(a):hO(a.node(0),a.parent,a.pos,a.index(),b,c);if(d)return d;for(let d=a.depth-1;d>=0;d--){let e=b<0?hO(a.node(0),a.node(d),a.before(d+1),a.index(d),b,c):hO(a.node(0),a.node(d),a.after(d+1),a.index(d)+1,b,c);if(e)return e}return null}static near(a,b=1){return this.findFrom(a,b)||this.findFrom(a,-b)||new hM(a.node(0))}static atStart(a){return hO(a,a,0,0,1)||new hM(a)}static atEnd(a){return hO(a,a,a.content.size,a.childCount,-1)||new hM(a)}static fromJSON(a,b){if(!b||!b.type)throw RangeError("Invalid input for Selection.fromJSON");let c=hD[b.type];if(!c)throw RangeError(`No selection type ${b.type} defined`);return c.fromJSON(a,b)}static jsonID(a,b){if(a in hD)throw RangeError("Duplicate use of selection JSON ID "+a);return hD[a]=b,b.prototype.jsonID=a,b}getBookmark(){return hI.between(this.$anchor,this.$head).getBookmark()}}hE.prototype.visible=!0;class hF{constructor(a,b){this.$from=a,this.$to=b}}let hG=!1;function hH(a){hG||a.parent.inlineContent||(hG=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+a.parent.type.name+")"))}class hI extends hE{constructor(a,b=a){hH(a),hH(b),super(a,b)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(a,b){let c=a.resolve(b.map(this.head));if(!c.parent.inlineContent)return hE.near(c);let d=a.resolve(b.map(this.anchor));return new hI(d.parent.inlineContent?d:c,c)}replace(a,b=go.empty){if(super.replace(a,b),b==go.empty){let b=this.$from.marksAcross(this.$to);b&&a.ensureMarks(b)}}eq(a){return a instanceof hI&&a.anchor==this.anchor&&a.head==this.head}getBookmark(){return new hJ(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(a,b){if("number"!=typeof b.anchor||"number"!=typeof b.head)throw RangeError("Invalid input for TextSelection.fromJSON");return new hI(a.resolve(b.anchor),a.resolve(b.head))}static create(a,b,c=b){let d=a.resolve(b);return new this(d,c==b?d:a.resolve(c))}static between(a,b,c){let d=a.pos-b.pos;if((!c||d)&&(c=d>=0?1:-1),!b.parent.inlineContent){let a=hE.findFrom(b,c,!0)||hE.findFrom(b,-c,!0);if(!a)return hE.near(b,c);b=a.$head}return a.parent.inlineContent||(0==d?a=b:(a=(hE.findFrom(a,-c,!0)||hE.findFrom(a,c,!0)).$anchor).pos<b.pos!=d<0&&(a=b)),new hI(a,b)}}hE.jsonID("text",hI);class hJ{constructor(a,b){this.anchor=a,this.head=b}map(a){return new hJ(a.map(this.anchor),a.map(this.head))}resolve(a){return hI.between(a.resolve(this.anchor),a.resolve(this.head))}}class hK extends hE{constructor(a){let b=a.nodeAfter;super(a,a.node(0).resolve(a.pos+b.nodeSize)),this.node=b}map(a,b){let{deleted:c,pos:d}=b.mapResult(this.anchor),e=a.resolve(d);return c?hE.near(e):new hK(e)}content(){return new go(gi.from(this.node),0,0)}eq(a){return a instanceof hK&&a.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new hL(this.anchor)}static fromJSON(a,b){if("number"!=typeof b.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new hK(a.resolve(b.anchor))}static create(a,b){return new hK(a.resolve(b))}static isSelectable(a){return!a.isText&&!1!==a.type.spec.selectable}}hK.prototype.visible=!1,hE.jsonID("node",hK);class hL{constructor(a){this.anchor=a}map(a){let{deleted:b,pos:c}=a.mapResult(this.anchor);return b?new hJ(c,c):new hL(c)}resolve(a){let b=a.resolve(this.anchor),c=b.nodeAfter;return c&&hK.isSelectable(c)?new hK(b):hE.near(b)}}class hM extends hE{constructor(a){super(a.resolve(0),a.resolve(a.content.size))}replace(a,b=go.empty){if(b==go.empty){a.delete(0,a.doc.content.size);let b=hE.atStart(a.doc);b.eq(a.selection)||a.setSelection(b)}else super.replace(a,b)}toJSON(){return{type:"all"}}static fromJSON(a){return new hM(a)}map(a){return new hM(a)}eq(a){return a instanceof hM}getBookmark(){return hN}}hE.jsonID("all",hM);let hN={map(){return this},resolve:a=>new hM(a)};function hO(a,b,c,d,e,f=!1){if(b.inlineContent)return hI.create(a,c);for(let g=d-(e>0?0:1);e>0?g<b.childCount:g>=0;g+=e){let d=b.child(g);if(d.isAtom){if(!f&&hK.isSelectable(d))return hK.create(a,c-(e<0?d.nodeSize:0))}else{let b=hO(a,d,c+e,e<0?d.childCount:0,e,f);if(b)return b}c+=d.nodeSize*e}return null}function hP(a,b,c){let d,e=a.steps.length-1;if(e<b)return;let f=a.steps[e];(f instanceof hf||f instanceof hg)&&(a.mapping.maps[e].forEach((a,b,c,e)=>{null==d&&(d=e)}),a.setSelection(hE.near(a.doc.resolve(d),c)))}class hQ extends hC{constructor(a){super(a.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=a.selection,this.storedMarks=a.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(a){if(a.$from.doc!=this.doc)throw RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=a,this.curSelectionFor=this.steps.length,this.updated=(1|this.updated)&-3,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(a){return this.storedMarks=a,this.updated|=2,this}ensureMarks(a){return gm.sameSet(this.storedMarks||this.selection.$from.marks(),a)||this.setStoredMarks(a),this}addStoredMark(a){return this.ensureMarks(a.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(a){return this.ensureMarks(a.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(a,b){super.addStep(a,b),this.updated=-3&this.updated,this.storedMarks=null}setTime(a){return this.time=a,this}replaceSelection(a){return this.selection.replace(this,a),this}replaceSelectionWith(a,b=!0){let c=this.selection;return b&&(a=a.mark(this.storedMarks||(c.empty?c.$from.marks():c.$from.marksAcross(c.$to)||gm.none))),c.replaceWith(this,a),this}deleteSelection(){return this.selection.replace(this),this}insertText(a,b,c){let d=this.doc.type.schema;if(null==b)return a?this.replaceSelectionWith(d.text(a),!0):this.deleteSelection();{if(null==c&&(c=b),!a)return this.deleteRange(b,c);let e=this.storedMarks;if(!e){let a=this.doc.resolve(b);e=c==b?a.marks():a.marksAcross(this.doc.resolve(c))}return this.replaceRangeWith(b,c,d.text(a,e)),this.selection.empty||this.selection.to!=b+a.length||this.setSelection(hE.near(this.selection.$to)),this}}setMeta(a,b){return this.meta["string"==typeof a?a:a.key]=b,this}getMeta(a){return this.meta["string"==typeof a?a:a.key]}get isGeneric(){for(let a in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function hR(a,b){return b&&a?a.bind(b):a}class hS{constructor(a,b,c){this.name=a,this.init=hR(b.init,c),this.apply=hR(b.apply,c)}}let hT=[new hS("doc",{init:a=>a.doc||a.schema.topNodeType.createAndFill(),apply:a=>a.doc}),new hS("selection",{init:(a,b)=>a.selection||hE.atStart(b.doc),apply:a=>a.selection}),new hS("storedMarks",{init:a=>a.storedMarks||null,apply:(a,b,c,d)=>d.selection.$cursor?a.storedMarks:null}),new hS("scrollToSelection",{init:()=>0,apply:(a,b)=>a.scrolledIntoView?b+1:b})];class hU{constructor(a,b){this.schema=a,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=hT.slice(),b&&b.forEach(a=>{if(this.pluginsByKey[a.key])throw RangeError("Adding different instances of a keyed plugin ("+a.key+")");this.plugins.push(a),this.pluginsByKey[a.key]=a,a.spec.state&&this.fields.push(new hS(a.key,a.spec.state,a))})}}class hV{constructor(a){this.config=a}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(a){return this.applyTransaction(a).state}filterTransaction(a,b=-1){for(let c=0;c<this.config.plugins.length;c++)if(c!=b){let b=this.config.plugins[c];if(b.spec.filterTransaction&&!b.spec.filterTransaction.call(b,a,this))return!1}return!0}applyTransaction(a){if(!this.filterTransaction(a))return{state:this,transactions:[]};let b=[a],c=this.applyInner(a),d=null;for(;;){let e=!1;for(let f=0;f<this.config.plugins.length;f++){let g=this.config.plugins[f];if(g.spec.appendTransaction){let h=d?d[f].n:0,i=d?d[f].state:this,j=h<b.length&&g.spec.appendTransaction.call(g,h?b.slice(h):b,i,c);if(j&&c.filterTransaction(j,f)){if(j.setMeta("appendedTransaction",a),!d){d=[];for(let a=0;a<this.config.plugins.length;a++)d.push(a<f?{state:c,n:b.length}:{state:this,n:0})}b.push(j),c=c.applyInner(j),e=!0}d&&(d[f]={state:c,n:b.length})}}if(!e)return{state:c,transactions:b}}}applyInner(a){if(!a.before.eq(this.doc))throw RangeError("Applying a mismatched transaction");let b=new hV(this.config),c=this.config.fields;for(let d=0;d<c.length;d++){let e=c[d];b[e.name]=e.apply(a,this[e.name],this,b)}return b}get tr(){return new hQ(this)}static create(a){let b=new hU(a.doc?a.doc.type.schema:a.schema,a.plugins),c=new hV(b);for(let d=0;d<b.fields.length;d++)c[b.fields[d].name]=b.fields[d].init(a,c);return c}reconfigure(a){let b=new hU(this.schema,a.plugins),c=b.fields,d=new hV(b);for(let b=0;b<c.length;b++){let e=c[b].name;d[e]=this.hasOwnProperty(e)?this[e]:c[b].init(a,d)}return d}toJSON(a){let b={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(b.storedMarks=this.storedMarks.map(a=>a.toJSON())),a&&"object"==typeof a)for(let c in a){if("doc"==c||"selection"==c)throw RangeError("The JSON fields `doc` and `selection` are reserved");let d=a[c],e=d.spec.state;e&&e.toJSON&&(b[c]=e.toJSON.call(d,this[d.key]))}return b}static fromJSON(a,b,c){if(!b)throw RangeError("Invalid input for EditorState.fromJSON");if(!a.schema)throw RangeError("Required config field 'schema' missing");let d=new hU(a.schema,a.plugins),e=new hV(d);return d.fields.forEach(d=>{if("doc"==d.name)e.doc=gB.fromJSON(a.schema,b.doc);else if("selection"==d.name)e.selection=hE.fromJSON(e.doc,b.selection);else if("storedMarks"==d.name)b.storedMarks&&(e.storedMarks=b.storedMarks.map(a.schema.markFromJSON));else{if(c)for(let f in c){let g=c[f],h=g.spec.state;if(g.key==d.name&&h&&h.fromJSON&&Object.prototype.hasOwnProperty.call(b,f)){e[d.name]=h.fromJSON.call(g,a,b[f],e);return}}e[d.name]=d.init(a,e)}}),e}}class hW{constructor(a){this.spec=a,this.props={},a.props&&function a(b,c,d){for(let e in b){let f=b[e];f instanceof Function?f=f.bind(c):"handleDOMEvents"==e&&(f=a(f,c,{})),d[e]=f}return d}(a.props,this,this.props),this.key=a.key?a.key.key:hY("plugin")}getState(a){return a[this.key]}}let hX=Object.create(null);function hY(a){return a in hX?a+"$"+ ++hX[a]:(hX[a]=0,a+"$")}class hZ{constructor(a="key"){this.key=hY(a)}get(a){return a.config.pluginsByKey[this.key]}getState(a){return a[this.key]}}let h$=(a,b)=>!a.selection.empty&&(b&&b(a.tr.deleteSelection().scrollIntoView()),!0);function h_(a,b){let{$cursor:c}=a.selection;return c&&(b?b.endOfTextblock("backward",a):!(c.parentOffset>0))?c:null}let h0=(a,b,c)=>{let d=h_(a,c);if(!d)return!1;let e=h4(d);if(!e){let c=d.blockRange(),e=c&&hj(c);return null!=e&&(b&&b(a.tr.lift(c,e).scrollIntoView()),!0)}let f=e.nodeBefore;if(h7(a,e,b,-1))return!0;if(0==d.parent.content.size&&(h2(f,"end")||hK.isSelectable(f)))for(let c=d.depth;;c--){let g=hq(a.doc,d.before(c),d.after(c),go.empty);if(g&&g.slice.size<g.to-g.from){if(b){let c=a.tr.step(g);c.setSelection(h2(f,"end")?hE.findFrom(c.doc.resolve(c.mapping.map(e.pos,-1)),-1):hK.create(c.doc,e.pos-f.nodeSize)),b(c.scrollIntoView())}return!0}if(1==c||d.node(c-1).childCount>1)break}return!!f.isAtom&&e.depth==d.depth-1&&(b&&b(a.tr.delete(e.pos-f.nodeSize,e.pos).scrollIntoView()),!0)},h1=(a,b,c)=>{let d=h_(a,c);if(!d)return!1;let e=h4(d);return!!e&&function(a,b,c){let d=b.nodeBefore,e=b.pos-1;for(;!d.isTextblock;e--){if(d.type.spec.isolating)return!1;let a=d.lastChild;if(!a)return!1;d=a}let f=b.nodeAfter,g=b.pos+1;for(;!f.isTextblock;g++){if(f.type.spec.isolating)return!1;let a=f.firstChild;if(!a)return!1;f=a}let h=hq(a.doc,e,g,go.empty);if(!h||h.from!=e||h instanceof hf&&h.slice.size>=g-e)return!1;if(c){let b=a.tr.step(h);b.setSelection(hI.create(b.doc,e)),c(b.scrollIntoView())}return!0}(a,e,b)};function h2(a,b,c=!1){for(let d=a;d;d="start"==b?d.firstChild:d.lastChild){if(d.isTextblock)return!0;if(c&&1!=d.childCount)break}return!1}let h3=(a,b,c)=>{let{$head:d,empty:e}=a.selection,f=d;if(!e)return!1;if(d.parent.isTextblock){if(c?!c.endOfTextblock("backward",a):d.parentOffset>0)return!1;f=h4(d)}let g=f&&f.nodeBefore;return!!g&&!!hK.isSelectable(g)&&(b&&b(a.tr.setSelection(hK.create(a.doc,f.pos-g.nodeSize)).scrollIntoView()),!0)};function h4(a){if(!a.parent.type.spec.isolating)for(let b=a.depth-1;b>=0;b--){if(a.index(b)>0)return a.doc.resolve(a.before(b+1));if(a.node(b).type.spec.isolating)break}return null}function h5(a){if(!a.parent.type.spec.isolating)for(let b=a.depth-1;b>=0;b--){let c=a.node(b);if(a.index(b)+1<c.childCount)return a.doc.resolve(a.after(b+1));if(c.type.spec.isolating)break}return null}function h6(a){for(let b=0;b<a.edgeCount;b++){let{type:c}=a.edge(b);if(c.isTextblock&&!c.hasRequiredAttrs())return c}return null}function h7(a,b,c,d){let e,f,g,h=b.nodeBefore,i=b.nodeAfter,j,k,l=h.type.spec.isolating||i.type.spec.isolating;if(!l&&(e=b.nodeBefore,f=b.nodeAfter,g=b.index(),e&&f&&e.type.compatibleContent(f.type)&&(!e.content.size&&b.parent.canReplace(g-1,g)?(c&&c(a.tr.delete(b.pos-e.nodeSize,b.pos).scrollIntoView()),!0):!!b.parent.canReplace(g,g+1)&&!!(f.isTextblock||hp(a.doc,b.pos))&&(c&&c(a.tr.join(b.pos).scrollIntoView()),!0))))return!0;let m=!l&&b.parent.canReplace(b.index(),b.index()+1);if(m&&(j=(k=h.contentMatchAt(h.childCount)).findWrapping(i.type))&&k.matchType(j[0]||i.type).validEnd){if(c){let d=b.pos+i.nodeSize,e=gi.empty;for(let a=j.length-1;a>=0;a--)e=gi.from(j[a].create(null,e));e=gi.from(h.copy(e));let f=a.tr.step(new hg(b.pos-1,d,b.pos,d,new go(e,1,0),j.length,!0)),g=f.doc.resolve(d+2*j.length);g.nodeAfter&&g.nodeAfter.type==h.type&&hp(f.doc,g.pos)&&f.join(g.pos),c(f.scrollIntoView())}return!0}let n=i.type.spec.isolating||d>0&&l?null:hE.findFrom(b,1),o=n&&n.$from.blockRange(n.$to),p=o&&hj(o);if(null!=p&&p>=b.depth)return c&&c(a.tr.lift(o,p).scrollIntoView()),!0;if(m&&h2(i,"start",!0)&&h2(h,"end")){let d=h,e=[];for(;e.push(d),!d.isTextblock;)d=d.lastChild;let f=i,g=1;for(;!f.isTextblock;f=f.firstChild)g++;if(d.canReplace(d.childCount,d.childCount,f.content)){if(c){let d=gi.empty;for(let a=e.length-1;a>=0;a--)d=gi.from(e[a].copy(d));c(a.tr.step(new hg(b.pos-e.length,b.pos+i.nodeSize,b.pos+g,b.pos+i.nodeSize-g,new go(d,e.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function h8(a){return function(b,c){let d=b.selection,e=a<0?d.$from:d.$to,f=e.depth;for(;e.node(f).isInline;){if(!f)return!1;f--}return!!e.node(f).isTextblock&&(c&&c(b.tr.setSelection(hI.create(b.doc,a<0?e.start(f):e.end(f)))),!0)}}let h9=h8(-1),ia=h8(1);function ib(a,b=null){return function(c,d){let{$from:e,$to:f}=c.selection,g=e.blockRange(f),h=g&&hk(g,a,b);return!!h&&(d&&d(c.tr.wrap(g,h).scrollIntoView()),!0)}}function ic(a,b=null){return function(c,d){let e=!1;for(let d=0;d<c.selection.ranges.length&&!e;d++){let{$from:{pos:f},$to:{pos:g}}=c.selection.ranges[d];c.doc.nodesBetween(f,g,(d,f)=>{if(e)return!1;if(!(!d.isTextblock||d.hasMarkup(a,b)))if(d.type==a)e=!0;else{let b=c.doc.resolve(f),d=b.index();e=b.parent.canReplaceWith(d,d+1,a)}})}if(!e)return!1;if(d){let e=c.tr;for(let d=0;d<c.selection.ranges.length;d++){let{$from:{pos:f},$to:{pos:g}}=c.selection.ranges[d];e.setBlockType(f,g,a,b)}d(e.scrollIntoView())}return!0}}function id(a,b=null,c){let d=!1!==(c&&c.removeWhenPresent),e=!1!==(c&&c.enterInlineAtoms),f=!(c&&c.includeWhitespace);return function(c,g){let{empty:h,$cursor:i,ranges:j}=c.selection;if(h&&!i||!function(a,b,c,d){for(let e=0;e<b.length;e++){let{$from:f,$to:g}=b[e],h=0==f.depth&&a.inlineContent&&a.type.allowsMarkType(c);if(a.nodesBetween(f.pos,g.pos,(a,b)=>{if(h||!d&&a.isAtom&&a.isInline&&b>=f.pos&&b+a.nodeSize<=g.pos)return!1;h=a.inlineContent&&a.type.allowsMarkType(c)}),h)return!0}return!1}(c.doc,j,a,e))return!1;if(g)if(i)g(a.isInSet(c.storedMarks||i.marks())?c.tr.removeStoredMark(a):c.tr.addStoredMark(a.create(b)));else{let h,i=c.tr;e||(j=function(a){let b=[];for(let c=0;c<a.length;c++){let{$from:d,$to:e}=a[c];d.doc.nodesBetween(d.pos,e.pos,(a,c)=>{if(a.isAtom&&a.content.size&&a.isInline&&c>=d.pos&&c+a.nodeSize<=e.pos)return c+1>d.pos&&b.push(new hF(d,d.doc.resolve(c+1))),d=d.doc.resolve(c+1+a.content.size),!1}),d.pos<e.pos&&b.push(new hF(d,e))}return b}(j)),h=d?!j.some(b=>c.doc.rangeHasMark(b.$from.pos,b.$to.pos,a)):!j.every(b=>{let c=!1;return i.doc.nodesBetween(b.$from.pos,b.$to.pos,(d,e,f)=>{if(c)return!1;c=!a.isInSet(d.marks)&&!!f&&f.type.allowsMarkType(a)&&!(d.isText&&/^\s*$/.test(d.textBetween(Math.max(0,b.$from.pos-e),Math.min(d.nodeSize,b.$to.pos-e))))}),!c});for(let c=0;c<j.length;c++){let{$from:d,$to:e}=j[c];if(h){let c=d.pos,g=e.pos,h=d.nodeAfter,j=e.nodeBefore,k=f&&h&&h.isText?/^\s*/.exec(h.text)[0].length:0,l=f&&j&&j.isText?/\s*$/.exec(j.text)[0].length:0;c+k<g&&(c+=k,g-=l),i.addMark(c,g,a.create(b))}else i.removeMark(d.pos,e.pos,a)}g(i.scrollIntoView())}return!0}}function ie(...a){return function(b,c,d){for(let e=0;e<a.length;e++)if(a[e](b,c,d))return!0;return!1}}let ig=ie(h$,h0,h3),ih=ie(h$,(a,b,c)=>{let d=function(a,b){let{$cursor:c}=a.selection;return c&&(b?b.endOfTextblock("forward",a):!(c.parentOffset<c.parent.content.size))?c:null}(a,c);if(!d)return!1;let e=h5(d);if(!e)return!1;let f=e.nodeAfter;if(h7(a,e,b,1))return!0;if(0==d.parent.content.size&&(h2(f,"start")||hK.isSelectable(f))){let c=hq(a.doc,d.before(),d.after(),go.empty);if(c&&c.slice.size<c.to-c.from){if(b){let d=a.tr.step(c);d.setSelection(h2(f,"start")?hE.findFrom(d.doc.resolve(d.mapping.map(e.pos)),1):hK.create(d.doc,d.mapping.map(e.pos))),b(d.scrollIntoView())}return!0}}return!!f.isAtom&&e.depth==d.depth-1&&(b&&b(a.tr.delete(e.pos,e.pos+f.nodeSize).scrollIntoView()),!0)},(a,b,c)=>{let{$head:d,empty:e}=a.selection,f=d;if(!e)return!1;if(d.parent.isTextblock){if(c?!c.endOfTextblock("forward",a):d.parentOffset<d.parent.content.size)return!1;f=h5(d)}let g=f&&f.nodeAfter;return!!g&&!!hK.isSelectable(g)&&(b&&b(a.tr.setSelection(hK.create(a.doc,f.pos)).scrollIntoView()),!0)}),ii={Enter:ie((a,b)=>{let{$head:c,$anchor:d}=a.selection;return!!c.parent.type.spec.code&&!!c.sameParent(d)&&(b&&b(a.tr.insertText("\n").scrollIntoView()),!0)},(a,b)=>{let c=a.selection,{$from:d,$to:e}=c;if(c instanceof hM||d.parent.inlineContent||e.parent.inlineContent)return!1;let f=h6(e.parent.contentMatchAt(e.indexAfter()));if(!f||!f.isTextblock)return!1;if(b){let c=(!d.parentOffset&&e.index()<e.parent.childCount?d:e).pos,g=a.tr.insert(c,f.createAndFill());g.setSelection(hI.create(g.doc,c+1)),b(g.scrollIntoView())}return!0},(a,b)=>{let{$cursor:c}=a.selection;if(!c||c.parent.content.size)return!1;if(c.depth>1&&c.after()!=c.end(-1)){let d=c.before();if(ho(a.doc,d))return b&&b(a.tr.split(d).scrollIntoView()),!0}let d=c.blockRange(),e=d&&hj(d);return null!=e&&(b&&b(a.tr.lift(d,e).scrollIntoView()),!0)},(a,b)=>{if(a.selection instanceof hK&&a.selection.node.isBlock){let{$from:c}=a.selection;return!!c.parentOffset&&!!ho(a.doc,c.pos)&&(b&&b(a.tr.split(c.pos).scrollIntoView()),!0)}if(!a.selection.$from.depth)return!1;let c=a.tr;!a.selection.empty&&(a.selection instanceof hI||a.selection instanceof hM)&&c.deleteSelection();let{$from:d}=c.selection,e=c.steps.length,f=[],g,h,i=!1,j=!1;for(let a=d.depth;;a--){if(d.node(a).isBlock){let b;i=d.end(a)==d.pos+(d.depth-a),j=d.start(a)==d.pos-(d.depth-a),h=h6(d.node(a-1).contentMatchAt(d.indexAfter(a-1)));f.unshift(b||(i&&h?{type:h}:null)),g=a;break}if(1==a)return!1;f.unshift(null)}let k=d.pos,l=ho(c.doc,k,f.length,f);if(l||(f[0]=h?{type:h}:null,l=ho(c.doc,k,f.length,f)),!l)return!1;if(c.split(k,f.length,f),!i&&j&&d.node(g).type!=h){let a=c.mapping.slice(e),b=a.map(d.before(g)),f=c.doc.resolve(b);h&&d.node(g-1).canReplaceWith(f.index(),f.index()+1,h)&&c.setNodeMarkup(a.map(d.before(g)),h)}return b&&b(c.scrollIntoView()),!0}),"Mod-Enter":(a,b)=>{let{$head:c,$anchor:d}=a.selection;if(!c.parent.type.spec.code||!c.sameParent(d))return!1;let e=c.node(-1),f=c.indexAfter(-1),g=h6(e.contentMatchAt(f));if(!g||!e.canReplaceWith(f,f,g))return!1;if(b){let d=c.after(),e=a.tr.replaceWith(d,d,g.createAndFill());e.setSelection(hE.near(e.doc.resolve(d),1)),b(e.scrollIntoView())}return!0},Backspace:ig,"Mod-Backspace":ig,"Shift-Backspace":ig,Delete:ih,"Mod-Delete":ih,"Mod-a":(a,b)=>(b&&b(a.tr.setSelection(new hM(a.doc))),!0)},ij={"Ctrl-h":ii.Backspace,"Alt-Backspace":ii["Mod-Backspace"],"Ctrl-d":ii.Delete,"Ctrl-Alt-Backspace":ii["Mod-Delete"],"Alt-Delete":ii["Mod-Delete"],"Alt-d":ii["Mod-Delete"],"Ctrl-a":h9,"Ctrl-e":ia};for(let a in ii)ij[a]=ii[a];let ik=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&!!os.platform&&"darwin"==os.platform())?ij:ii;class il{constructor(a,b,c={}){var d;this.match=a,this.match=a,this.handler="string"==typeof b?(d=b,function(a,b,c,e){let f=d;if(b[1]){let a=b[0].lastIndexOf(b[1]);f+=b[0].slice(a+b[1].length);let d=(c+=a)-e;d>0&&(f=b[0].slice(a-d,a)+f,c=e)}return a.tr.insertText(f,c,e)}):b,this.undoable=!1!==c.undoable,this.inCode=c.inCode||!1,this.inCodeMark=!1!==c.inCodeMark}}let im=(a,b)=>{let c=a.plugins;for(let d=0;d<c.length;d++){let e=c[d],f;if(e.spec.isInputRules&&(f=e.getState(a))){if(b){let c=a.tr,d=f.transform;for(let a=d.steps.length-1;a>=0;a--)c.step(d.steps[a].invert(d.docs[a]));if(f.text){let b=c.doc.resolve(f.from).marks();c.replaceWith(f.from,f.to,a.schema.text(f.text,b))}else c.delete(f.from,f.to);b(c)}return!0}}return!1};function io(a,b,c=null,d){return new il(a,(a,e,f,g)=>{let h=c instanceof Function?c(e):c,i=a.tr.delete(f,g),j=i.doc.resolve(f).blockRange(),k=j&&hk(j,b,h);if(!k)return null;i.wrap(j,k);let l=i.doc.resolve(f-1).nodeBefore;return l&&l.type==b&&hp(i.doc,f-1)&&(!d||d(e,l))&&i.join(f-1),i})}function ip(a,b,c=null){return new il(a,(a,d,e,f)=>{let g=a.doc.resolve(e),h=c instanceof Function?c(d):c;return g.node(-1).canReplaceWith(g.index(-1),g.indexAfter(-1),b)?a.tr.delete(e,f).setBlockType(e,e,b,h):null})}new il(/--$/,"—",{inCodeMark:!1}),new il(/\.\.\.$/,"…",{inCodeMark:!1}),new il(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(")$/,"“",{inCodeMark:!1}),new il(/"$/,"”",{inCodeMark:!1}),new il(/(?:^|[\s\{\[\(\<'"\u2018\u201C])(')$/,"‘",{inCodeMark:!1}),new il(/'$/,"’",{inCodeMark:!1});let iq="undefined"!=typeof navigator?navigator:null,ir="undefined"!=typeof document?document:null,is=iq&&iq.userAgent||"",it=/Edge\/(\d+)/.exec(is),iu=/MSIE \d/.exec(is),iv=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(is),iw=!!(iu||iv||it),ix=iu?document.documentMode:iv?+iv[1]:it?+it[1]:0,iy=!iw&&/gecko\/(\d+)/i.test(is),iz=iy&&+(/Firefox\/(\d+)/.exec(is)||[0,0])[1],iA=!iw&&/Chrome\/(\d+)/.exec(is),iB=!!iA,iC=iA?+iA[1]:0,iD=!iw&&!!iq&&/Apple Computer/.test(iq.vendor),iE=iD&&(/Mobile\/\w+/.test(is)||!!iq&&iq.maxTouchPoints>2),iF=iE||!!iq&&/Mac/.test(iq.platform),iG=/Android \d/.test(is),iH=!!ir&&"webkitFontSmoothing"in ir.documentElement.style,iI=iH?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;var iJ=Object.freeze({__proto__:null,android:iG,chrome:iB,chrome_version:iC,gecko:iy,gecko_version:iz,ie:iw,ie_version:ix,ios:iE,mac:iF,safari:iD,webkit:iH,webkit_version:iI});function iK(a,b,c,d,e,f){if(a.composing)return!1;let g=a.state,h=g.doc.resolve(b);if(h.parent.type.spec.code)return!1;let i=h.parent.textBetween(Math.max(0,h.parentOffset-500),h.parentOffset,void 0,"")+d;for(let h of e){let e=h.match.exec(i),j=e&&e[0]&&h.handler(g,e,b-(e[0].length-d.length),c);if(j)return!1!==h.undoable&&j.setMeta(f,{transform:j,from:b,to:c,text:d}),a.dispatch(j),!0}return!1}let iL=new hZ("MILKDOWN_CUSTOM_INPUTRULES");function iM(a){return a.some(a=>a.type.spec.code)}function iN(a,b,c){if(b>=c)return!1;let d=!1;return a.doc.nodesBetween(b,c,a=>(a.isInline&&iM(a.marks)&&(d=!0),!d)),d}function iO(a,b,c={}){return new il(a,(a,d,e,f)=>{var g,h,i,j,k,l;let m,{tr:n}=a,o=d.length,p=d[o-1],q=d[0],r=[],s={group:p,fullMatch:q,start:e,end:f},t=null==(g=c.updateCaptured)?void 0:g.call(c,s);if(Object.assign(s,t),{group:p,fullMatch:q,start:e,end:f}=s,null===q||(null==p?void 0:p.trim())==="")return null;if(p){let g=q.search(/\S/),o=e+q.indexOf(p),s=o+p.length,t=iN(a,e+g,o),u=s<f&&iN(a,s,f);if(t||u||(k=f,iM(null!=(l=a.storedMarks)?l:a.doc.resolve(k).marks())))return null;r=null!=(h=n.storedMarks)?h:[],s<f&&n.delete(s,f),o>e&&n.delete(e+g,o),m=e+g+p.length;let v=null==(i=c.getAttr)?void 0:i.call(c,d);n.addMark(e,m,b.create(v)),n.setStoredMarks(r),null==(j=c.beforeDispatch)||j.call(c,{match:d,start:e,end:f,tr:n})}return n})}function iP(a){return(b,c)=>(function(a,b=!0){let c=[];return a.descendants((a,d)=>{if(c.push({node:a,pos:d}),!b)return!1}),c})(b,c).filter(b=>a(b.node))}Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;for(var iQ={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:"'"},iR={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},iS="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),iT="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),iU=0;iU<10;iU++)iQ[48+iU]=iQ[96+iU]=String(iU);for(var iU=1;iU<=24;iU++)iQ[iU+111]="F"+iU;for(var iU=65;iU<=90;iU++)iQ[iU]=String.fromCharCode(iU+32),iR[iU]=String.fromCharCode(iU);for(var iV in iQ)iR.hasOwnProperty(iV)||(iR[iV]=iQ[iV]);let iW="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),iX="undefined"!=typeof navigator&&/Win/.test(navigator.platform);function iY(a,b,c=!0){return b.altKey&&(a="Alt-"+a),b.ctrlKey&&(a="Ctrl-"+a),b.metaKey&&(a="Meta-"+a),c&&b.shiftKey&&(a="Shift-"+a),a}var iZ=class{},i$=class{constructor(){this.elements=[],this.size=()=>this.elements.length,this.top=()=>this.elements.at(-1),this.push=a=>{this.top()?.push(a)},this.open=a=>{this.elements.push(a)},this.close=()=>{let a=this.elements.pop();if(!a)throw dr();return a}}},i_=class a extends iZ{constructor(a,b,c){super(),this.type=a,this.content=b,this.attrs=c}push(a,...b){this.content.push(a,...b)}pop(){return this.content.pop()}static create(b,c,d){return new a(b,c,d)}},i0=class extends i${#t;static{this.create=(a,b)=>{let c=new this(a);return a=>(c.run(b,a),c.toDoc())}}constructor(a){super(),this.#t=gm.none,this.#u=a=>a.isText,this.#v=(a,b)=>{if(this.#u(a)&&this.#u(b)&&gm.sameSet(a.marks,b.marks))return this.schema.text(a.text+b.text,a.marks)},this.#w=a=>{let b=Object.values({...this.schema.nodes,...this.schema.marks}).find(b=>b.spec.parseMarkdown.match(a));if(!b)throw new dm(dl.parserMatchError,`Cannot match target parser for node: ${dp(a)}.`);return b},this.#x=a=>{let b=this.#w(a);b.spec.parseMarkdown.runner(this,a,b)},this.injectRoot=(a,b,c)=>(this.openNode(b,c),this.next(a.children),this),this.openNode=(a,b)=>(this.open(i_.create(a,[],b)),this),this.#y=()=>{this.#t=gm.none;let a=this.close();return this.#z(a.type,a.attrs,a.content)},this.closeNode=()=>{try{this.#y()}catch(a){console.error(a)}return this},this.#z=(a,b,c)=>{let d=a.createAndFill(b,c,this.#t);if(!d)throw function(a,b,c){let d=`Cannot create node for ${"name"in a?a.name:a}`,e=a=>{if(null==a)return"null";if(Array.isArray(a))return`[${a.map(e).join(", ")}]`;if("object"==typeof a)return"toJSON"in a&&"function"==typeof a.toJSON?JSON.stringify(a.toJSON()):"spec"in a?JSON.stringify(a.spec):JSON.stringify(a);if("string"==typeof a||"number"==typeof a||"boolean"==typeof a)return JSON.stringify(a);if("function"==typeof a)return`[Function: ${a.name||"anonymous"}]`;try{return String(a)}catch{return"[Unserializable]"}},f=[["[Description]",d],["[Attributes]",b],["[Content]",(c??[]).map(a=>a?"object"==typeof a&&"type"in a?`${a}`:e(a):"null")]].reduce((a,[b,c])=>{let d=`${b}: ${e(c)}.`;return a.concat(d)},[]);return new dm(dl.createNodeInParserFail,f.join("\n"))}(a,b,c);return this.push(d),d},this.addNode=(a,b,c)=>{try{this.#z(a,b,c)}catch(a){console.error(a)}return this},this.openMark=(a,b)=>{let c=a.create(b);return this.#t=c.addToSet(this.#t),this},this.closeMark=a=>(this.#t=a.removeFromSet(this.#t),this),this.addText=a=>{try{let b=this.top();if(!b)throw dr();let c=b.pop(),d=this.schema.text(a,this.#t);if(!c)return b.push(d),this;let e=this.#v(c,d);if(e)return b.push(e),this;return b.push(c,d),this}catch(a){return console.error(a),this}},this.build=()=>{let a;do a=this.#y();while(this.size());return a},this.next=(a=[])=>([a].flat().forEach(a=>this.#x(a)),this),this.toDoc=()=>this.build(),this.run=(a,b)=>{let c=a.runSync(a.parse(b),b);return this.next(c),this},this.schema=a}#u;#v;#w;#x;#y;#z},i1=class a extends iZ{constructor(a,b,c,d={}){super(),this.type=a,this.children=b,this.value=c,this.props=d,this.push=(a,...b)=>{this.children||(this.children=[]),this.children.push(a,...b)},this.pop=()=>this.children?.pop()}static{this.create=(b,c,d,e={})=>new a(b,c,d,e)}},i2=class extends i${#A;static{this.create=(a,b)=>{let c=new this(a);return a=>(c.run(a),c.toString(b))}}constructor(a){super(),this.#A=[],this.#w=a=>{let b=Object.values({...this.schema.nodes,...this.schema.marks}).find(b=>b.spec.toMarkdown.match(a));if(!b){var c;throw c=a.type,new dm(dl.serializerMatchError,`Cannot match target serializer for node: ${dp(c)}.`)}return b},this.#B=a=>this.#w(a).spec.toMarkdown.runner(this,a),this.#C=(a,b)=>this.#w(a).spec.toMarkdown.runner(this,a,b),this.#D=a=>{let b=a=>a.type.spec.priority??50,c=[...a].sort((a,c)=>b(a)-b(c)),d=[];return this.#A.forEach(({mark:a})=>{let b=c.findIndex(b=>b.eq(a));b>=0&&d.push(...c.splice(b,1))}),d.concat(c)},this.#E=a=>{let b=a?.marks,c=0;for(;c<this.#A.length;){let{mark:a,spanning:d}=this.#A[c];if(d&&b?.some(b=>b.eq(a)))c++;else break}for(let a=this.#A.length-1;a>=c;a--)this.#F(this.#A[a].mark)},this.#x=(a,b)=>{this.#D(a.marks).every(b=>!this.#C(b,a))&&this.#B(a),this.#E(b)},this.#G=a=>{let{children:b}=a;return b&&(a.children=b.reduce((a,b,c)=>{if(0===c)return[b];let d=a.at(-1);if(d&&d.isMark&&b.isMark){let{children:c,...e}=b,{children:f,...g}=d;if(b.type===d.type&&c&&f&&JSON.stringify(e)===JSON.stringify(g)){let b={...g,children:[...f,...c]};return a.slice(0,-1).concat(this.#G(b))}}return a.concat(b)},[])),a},this.#H=a=>{let b={...a.props,type:a.type};return a.children&&(b.children=a.children),a.value&&(b.value=a.value),b},this.openNode=(a,b,c)=>(this.open(i1.create(a,void 0,b,c)),this),this.#I=(a,b)=>{let c="",d="",e=a.children;if(e){let a=e[0],b=e.at(-1);if(b&&"text"===b.type&&b.value.endsWith(" ")){let a=b.value,c=a.trimEnd();d=a.slice(c.length),b.value=c}if(a&&"text"===a.type&&a.value.startsWith(" ")){let b=a.value,d=b.trimStart();c=b.slice(0,b.length-d.length),a.value=d}}c.length&&this.#z("text",void 0,c);let f=b();return d.length&&this.#z("text",void 0,d),f},this.#y=(a=!1)=>{let b=this.close(),c=()=>this.#z(b.type,b.children,b.value,b.props);return a?this.#I(b,c):c()},this.closeNode=()=>(this.#y(),this),this.#z=(a,b,c,d)=>{let e=i1.create(a,b,c,d),f=this.#G(this.#H(e));return this.push(f),f},this.addNode=(a,b,c,d)=>(this.#z(a,b,c,d),this),this.#J=(a,b,c,d)=>this.#A.some(b=>b.mark.eq(a))?this:(this.#A.push({mark:a,spanning:null==c}),this.openNode(b,c,{...d,isMark:!0})),this.#F=a=>{let b=-1;for(let c=this.#A.length-1;c>=0;c--)if(this.#A[c].mark.eq(a)){b=c;break}b<0||(this.#A.splice(b,1),this.#y(!0))},this.withMark=(a,b,c,d)=>(this.#J(a,b,c,d),this),this.closeMark=a=>(this.#F(a),this),this.build=()=>{let a=null;do a=this.#y();while(this.size());return a},this.next=a=>(Object.prototype.hasOwnProperty.call(a,"size")?a.forEach((b,c,d)=>{this.#x(b,a.maybeChild(d+1)??void 0)}):this.#x(a),this),this.toString=a=>a.stringify(this.build()),this.run=a=>(this.#A=[],this.next(a),this),this.schema=a}#w;#B;#C;#D;#E;#x;#G;#H;#I;#y;#z;#J;#F};let i3=function(a){for(var b=0;;b++)if(!(a=a.previousSibling))return b},i4=function(a){let b=a.assignedSlot||a.parentNode;return b&&11==b.nodeType?b.host:b},i5=null,i6=function(a,b,c){let d=i5||(i5=document.createRange());return d.setEnd(a,null==c?a.nodeValue.length:c),d.setStart(a,b||0),d},i7=function(){i5=null},i8=function(a,b,c,d){return c&&(ja(a,b,c,d,-1)||ja(a,b,c,d,1))},i9=/^(img|br|input|textarea|hr)$/i;function ja(a,b,c,d,e){for(var f;;){if(a==c&&b==d)return!0;if(b==(e<0?0:jb(a))){let c=a.parentNode;if(!c||1!=c.nodeType||jc(a)||i9.test(a.nodeName)||"false"==a.contentEditable)return!1;b=i3(a)+(e<0?0:1),a=c}else{if(1!=a.nodeType)return!1;let c=a.childNodes[b+(e<0?-1:0)];if(1==c.nodeType&&"false"==c.contentEditable)if(null==(f=c.pmViewDesc)||!f.ignoreForSelection)return!1;else b+=e;else a=c,b=e<0?jb(a):0}}}function jb(a){return 3==a.nodeType?a.nodeValue.length:a.childNodes.length}function jc(a){let b;for(let c=a;c&&!(b=c.pmViewDesc);c=c.parentNode);return b&&b.node&&b.node.isBlock&&(b.dom==a||b.contentDOM==a)}let jd=function(a){return a.focusNode&&i8(a.focusNode,a.focusOffset,a.anchorNode,a.anchorOffset)};function je(a,b){let c=document.createEvent("Event");return c.initEvent("keydown",!0,!0),c.keyCode=a,c.key=c.code=b,c}let jf="undefined"!=typeof navigator?navigator:null,jg="undefined"!=typeof document?document:null,jh=jf&&jf.userAgent||"",ji=/Edge\/(\d+)/.exec(jh),jj=/MSIE \d/.exec(jh),jk=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(jh),jl=!!(jj||jk||ji),jm=jj?document.documentMode:jk?+jk[1]:ji?+ji[1]:0,jn=!jl&&/gecko\/(\d+)/i.test(jh);jn&&(/Firefox\/(\d+)/.exec(jh)||[0,0])[1];let jo=!jl&&/Chrome\/(\d+)/.exec(jh),jp=!!jo,jq=jo?+jo[1]:0,jr=!jl&&!!jf&&/Apple Computer/.test(jf.vendor),js=jr&&(/Mobile\/\w+/.test(jh)||!!jf&&jf.maxTouchPoints>2),jt=js||!!jf&&/Mac/.test(jf.platform),ju=!!jf&&/Win/.test(jf.platform),jv=/Android \d/.test(jh),jw=!!jg&&"webkitFontSmoothing"in jg.documentElement.style,jx=jw?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function jy(a,b){return"number"==typeof a?a:a[b]}function jz(a,b,c){if(!jE(b)&&0==b.left)return;let d=a.someProp("scrollThreshold")||0,e=a.someProp("scrollMargin")||5,f=a.dom.ownerDocument;for(let g=c||a.dom;g;){if(1!=g.nodeType){g=i4(g);continue}let a=g,c=a==f.body,h=c?function(a){let b=a.defaultView&&a.defaultView.visualViewport;return b?{left:0,right:b.width,top:0,bottom:b.height}:{left:0,right:a.documentElement.clientWidth,top:0,bottom:a.documentElement.clientHeight}}(f):function(a){let b=a.getBoundingClientRect(),c=b.width/a.offsetWidth||1,d=b.height/a.offsetHeight||1;return{left:b.left,right:b.left+a.clientWidth*c,top:b.top,bottom:b.top+a.clientHeight*d}}(a),i=0,j=0;if(b.top<h.top+jy(d,"top")?j=-(h.top-b.top+jy(e,"top")):b.bottom>h.bottom-jy(d,"bottom")&&(j=b.bottom-b.top>h.bottom-h.top?b.top+jy(e,"top")-h.top:b.bottom-h.bottom+jy(e,"bottom")),b.left<h.left+jy(d,"left")?i=-(h.left-b.left+jy(e,"left")):b.right>h.right-jy(d,"right")&&(i=b.right-h.right+jy(e,"right")),i||j)if(c)f.defaultView.scrollBy(i,j);else{let c=a.scrollLeft,d=a.scrollTop;j&&(a.scrollTop+=j),i&&(a.scrollLeft+=i);let e=a.scrollLeft-c,f=a.scrollTop-d;b={left:b.left-e,top:b.top-f,right:b.right-e,bottom:b.bottom-f}}let k=c?"fixed":getComputedStyle(g).position;if(/^(fixed|sticky)$/.test(k))break;g="absolute"==k?g.offsetParent:i4(g)}}function jA(a){let b=[],c=a.ownerDocument;for(let d=a;d&&(b.push({dom:d,top:d.scrollTop,left:d.scrollLeft}),a!=c);d=i4(d));return b}function jB(a,b){for(let c=0;c<a.length;c++){let{dom:d,top:e,left:f}=a[c];d.scrollTop!=e+b&&(d.scrollTop=e+b),d.scrollLeft!=f&&(d.scrollLeft=f)}}let jC=null;function jD(a,b){return a.left>=b.left-1&&a.left<=b.right+1&&a.top>=b.top-1&&a.top<=b.bottom+1}function jE(a){return a.top<a.bottom||a.left<a.right}function jF(a,b){let c=a.getClientRects();if(c.length){let a=c[b<0?0:c.length-1];if(jE(a))return a}return Array.prototype.find.call(c,jE)||a.getBoundingClientRect()}let jG=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function jH(a,b,c){let{node:d,offset:e,atom:f}=a.docView.domFromPos(b,c<0?-1:1),g=jw||jn;if(3==d.nodeType)if(g&&(jG.test(d.nodeValue)||(c<0?!e:e==d.nodeValue.length))){let a=jF(i6(d,e,e),c);if(jn&&e&&/\s/.test(d.nodeValue[e-1])&&e<d.nodeValue.length){let b=jF(i6(d,e-1,e-1),-1);if(b.top==a.top){let c=jF(i6(d,e,e+1),-1);if(c.top!=a.top)return jI(c,c.left<b.left)}}return a}else{let a=e,b=e,f=c<0?1:-1;return c<0&&!e?(b++,f=-1):c>=0&&e==d.nodeValue.length?(a--,f=1):c<0?a--:b++,jI(jF(i6(d,a,b),f),f<0)}if(!a.state.doc.resolve(b-(f||0)).parent.inlineContent){if(null==f&&e&&(c<0||e==jb(d))){let a=d.childNodes[e-1];if(1==a.nodeType)return jJ(a.getBoundingClientRect(),!1)}if(null==f&&e<jb(d)){let a=d.childNodes[e];if(1==a.nodeType)return jJ(a.getBoundingClientRect(),!0)}return jJ(d.getBoundingClientRect(),c>=0)}if(null==f&&e&&(c<0||e==jb(d))){let a=d.childNodes[e-1],b=3==a.nodeType?i6(a,jb(a)-!g):1!=a.nodeType||"BR"==a.nodeName&&a.nextSibling?null:a;if(b)return jI(jF(b,1),!1)}if(null==f&&e<jb(d)){let a=d.childNodes[e];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let b=a?3==a.nodeType?i6(a,0,+!g):1==a.nodeType?a:null:null;if(b)return jI(jF(b,-1),!0)}return jI(jF(3==d.nodeType?i6(d):d,-c),c>=0)}function jI(a,b){if(0==a.width)return a;let c=b?a.left:a.right;return{top:a.top,bottom:a.bottom,left:c,right:c}}function jJ(a,b){if(0==a.height)return a;let c=b?a.top:a.bottom;return{top:c,bottom:c,left:a.left,right:a.right}}function jK(a,b,c){let d=a.state,e=a.root.activeElement;d!=b&&a.updateState(b),e!=a.dom&&a.focus();try{return c()}finally{d!=b&&a.updateState(d),e!=a.dom&&e&&e.focus()}}let jL=/[\u0590-\u08ac]/,jM=null,jN=null,jO=!1;class jP{constructor(a,b,c,d){this.parent=a,this.children=b,this.dom=c,this.contentDOM=d,this.dirty=0,c.pmViewDesc=this}matchesWidget(a){return!1}matchesMark(a){return!1}matchesNode(a,b,c){return!1}matchesHack(a){return!1}parseRule(a){return null}stopEvent(a){return!1}get size(){let a=0;for(let b=0;b<this.children.length;b++)a+=this.children[b].size;return a}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let a=0;a<this.children.length;a++)this.children[a].destroy()}posBeforeChild(a){for(let b=0,c=this.posAtStart;;b++){let d=this.children[b];if(d==a)return c;c+=d.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(a,b,c){let d;if(this.contentDOM&&this.contentDOM.contains(1==a.nodeType?a:a.parentNode))if(c<0){let c,d;if(a==this.contentDOM)c=a.childNodes[b-1];else{for(;a.parentNode!=this.contentDOM;)a=a.parentNode;c=a.previousSibling}for(;c&&!((d=c.pmViewDesc)&&d.parent==this);)c=c.previousSibling;return c?this.posBeforeChild(d)+d.size:this.posAtStart}else{let c,d;if(a==this.contentDOM)c=a.childNodes[b];else{for(;a.parentNode!=this.contentDOM;)a=a.parentNode;c=a.nextSibling}for(;c&&!((d=c.pmViewDesc)&&d.parent==this);)c=c.nextSibling;return c?this.posBeforeChild(d):this.posAtEnd}if(a==this.dom&&this.contentDOM)d=b>i3(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))d=2&a.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==b)for(let b=a;;b=b.parentNode){if(b==this.dom){d=!1;break}if(b.previousSibling)break}if(null==d&&b==a.childNodes.length)for(let b=a;;b=b.parentNode){if(b==this.dom){d=!0;break}if(b.nextSibling)break}}return(null==d?c>0:d)?this.posAtEnd:this.posAtStart}nearestDesc(a,b=!1){for(let c=!0,d=a;d;d=d.parentNode){let e=this.getDesc(d),f;if(e&&(!b||e.node))if(!c||!(f=e.nodeDOM)||(1==f.nodeType?f.contains(1==a.nodeType?a:a.parentNode):f==a))return e;else c=!1}}getDesc(a){let b=a.pmViewDesc;for(let a=b;a;a=a.parent)if(a==this)return b}posFromDOM(a,b,c){for(let d=a;d;d=d.parentNode){let e=this.getDesc(d);if(e)return e.localPosFromDOM(a,b,c)}return -1}descAt(a){for(let b=0,c=0;b<this.children.length;b++){let d=this.children[b],e=c+d.size;if(c==a&&e!=c){for(;!d.border&&d.children.length;)for(let a=0;a<d.children.length;a++){let b=d.children[a];if(b.size){d=b;break}}return d}if(a<e)return d.descAt(a-c-d.border);c=e}}domFromPos(a,b){if(!this.contentDOM)return{node:this.dom,offset:0,atom:a+1};let c=0,d=0;for(let b=0;c<this.children.length;c++){let e=this.children[c],f=b+e.size;if(f>a||e instanceof jW){d=a-b;break}b=f}if(d)return this.children[c].domFromPos(d-this.children[c].border,b);for(let a;c&&!(a=this.children[c-1]).size&&a instanceof jQ&&a.side>=0;c--);if(b<=0){let a,d=!0;for(;(a=c?this.children[c-1]:null)&&a.dom.parentNode!=this.contentDOM;c--,d=!1);return a&&b&&d&&!a.border&&!a.domAtom?a.domFromPos(a.size,b):{node:this.contentDOM,offset:a?i3(a.dom)+1:0}}{let a,d=!0;for(;(a=c<this.children.length?this.children[c]:null)&&a.dom.parentNode!=this.contentDOM;c++,d=!1);return a&&d&&!a.border&&!a.domAtom?a.domFromPos(0,b):{node:this.contentDOM,offset:a?i3(a.dom):this.contentDOM.childNodes.length}}}parseRange(a,b,c=0){if(0==this.children.length)return{node:this.contentDOM,from:a,to:b,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let d=-1,e=-1;for(let f=c,g=0;;g++){let c=this.children[g],h=f+c.size;if(-1==d&&a<=h){let e=f+c.border;if(a>=e&&b<=h-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(a,b,e);a=f;for(let b=g;b>0;b--){let c=this.children[b-1];if(c.size&&c.dom.parentNode==this.contentDOM&&!c.emptyChildAt(1)){d=i3(c.dom)+1;break}a-=c.size}-1==d&&(d=0)}if(d>-1&&(h>b||g==this.children.length-1)){b=h;for(let a=g+1;a<this.children.length;a++){let c=this.children[a];if(c.size&&c.dom.parentNode==this.contentDOM&&!c.emptyChildAt(-1)){e=i3(c.dom);break}b+=c.size}-1==e&&(e=this.contentDOM.childNodes.length);break}f=h}return{node:this.contentDOM,from:a,to:b,fromOffset:d,toOffset:e}}emptyChildAt(a){if(this.border||!this.contentDOM||!this.children.length)return!1;let b=this.children[a<0?0:this.children.length-1];return 0==b.size||b.emptyChildAt(a)}domAfterPos(a){let{node:b,offset:c}=this.domFromPos(a,0);if(1!=b.nodeType||c==b.childNodes.length)throw RangeError("No node after pos "+a);return b.childNodes[c]}setSelection(a,b,c,d=!1){let e=Math.min(a,b),f=Math.max(a,b);for(let g=0,h=0;g<this.children.length;g++){let i=this.children[g],j=h+i.size;if(e>h&&f<j)return i.setSelection(a-h-i.border,b-h-i.border,c,d);h=j}let g=this.domFromPos(a,a?-1:1),h=b==a?g:this.domFromPos(b,b?-1:1),i=c.root.getSelection(),j=c.domSelectionRange(),k=!1;if((jn||jr)&&a==b){let{node:a,offset:b}=g;if(3==a.nodeType){if((k=!!(b&&"\n"==a.nodeValue[b-1]))&&b==a.nodeValue.length)for(let b=a,c;b;b=b.parentNode){if(c=b.nextSibling){"BR"==c.nodeName&&(g=h={node:c.parentNode,offset:i3(c)+1});break}let a=b.pmViewDesc;if(a&&a.node&&a.node.isBlock)break}}else{let c=a.childNodes[b-1];k=c&&("BR"==c.nodeName||"false"==c.contentEditable)}}if(jn&&j.focusNode&&j.focusNode!=h.node&&1==j.focusNode.nodeType){let a=j.focusNode.childNodes[j.focusOffset];a&&"false"==a.contentEditable&&(d=!0)}if(!(d||k&&jr)&&i8(g.node,g.offset,j.anchorNode,j.anchorOffset)&&i8(h.node,h.offset,j.focusNode,j.focusOffset))return;let l=!1;if((i.extend||a==b)&&!(k&&jn)){i.collapse(g.node,g.offset);try{a!=b&&i.extend(h.node,h.offset),l=!0}catch(a){}}if(!l){if(a>b){let a=g;g=h,h=a}let c=document.createRange();c.setEnd(h.node,h.offset),c.setStart(g.node,g.offset),i.removeAllRanges(),i.addRange(c)}}ignoreMutation(a){return!this.contentDOM&&"selection"!=a.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(a,b){for(let c=0,d=0;d<this.children.length;d++){let e=this.children[d],f=c+e.size;if(c==f?a<=f&&b>=c:a<f&&b>c){let d=c+e.border,g=f-e.border;if(a>=d&&b<=g){this.dirty=a==c||b==f?2:1,a==d&&b==g&&(e.contentLost||e.dom.parentNode!=this.contentDOM)?e.dirty=3:e.markDirty(a-d,b-d);return}e.dirty=e.dom!=e.contentDOM||e.dom.parentNode!=this.contentDOM||e.children.length?3:2}c=f}this.dirty=2}markParentsDirty(){let a=1;for(let b=this.parent;b;b=b.parent,a++){let c=1==a?2:1;b.dirty<c&&(b.dirty=c)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(a){return!1}}class jQ extends jP{constructor(a,b,c,d){let e,f=b.type.toDOM;if("function"==typeof f&&(f=f(c,()=>e?e.parent?e.parent.posBeforeChild(e):void 0:d)),!b.type.spec.raw){if(1!=f.nodeType){let a=document.createElement("span");a.appendChild(f),f=a}f.hasAttribute("contenteditable")||(f.contentEditable="false"),f.classList.add("ProseMirror-widget")}super(a,[],f,null),this.widget=b,this.widget=b,e=this}matchesWidget(a){return 0==this.dirty&&a.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(a){let b=this.widget.spec.stopEvent;return!!b&&b(a)}ignoreMutation(a){return"selection"!=a.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 jR extends jP{constructor(a,b,c,d){super(a,[],b,null),this.textDOM=c,this.text=d}get size(){return this.text.length}localPosFromDOM(a,b){return a!=this.textDOM?this.posAtStart+(b?this.size:0):this.posAtStart+b}domFromPos(a){return{node:this.textDOM,offset:a}}ignoreMutation(a){return"characterData"===a.type&&a.target.nodeValue==a.oldValue}}class jS extends jP{constructor(a,b,c,d,e){super(a,[],c,d),this.mark=b,this.spec=e}static create(a,b,c,d){let e=d.nodeViews[b.type.name],f=e&&e(b,d,c);return f&&f.dom||(f=g_.renderSpec(document,b.type.spec.toDOM(b,c),null,b.attrs)),new jS(a,b,f.dom,f.contentDOM||f.dom,f)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(a){return 3!=this.dirty&&this.mark.eq(a)}markDirty(a,b){if(super.markDirty(a,b),0!=this.dirty){let a=this.parent;for(;!a.node;)a=a.parent;a.dirty<this.dirty&&(a.dirty=this.dirty),this.dirty=0}}slice(a,b,c){let d=jS.create(this.parent,this.mark,!0,c),e=this.children,f=this.size;b<f&&(e=j5(e,b,f,c)),a>0&&(e=j5(e,0,a,c));for(let a=0;a<e.length;a++)e[a].parent=d;return d.children=e,d}ignoreMutation(a){return this.spec.ignoreMutation?this.spec.ignoreMutation(a):super.ignoreMutation(a)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class jT extends jP{constructor(a,b,c,d,e,f,g){super(a,[],e,f),this.node=b,this.outerDeco=c,this.innerDeco=d,this.nodeDOM=g}static create(a,b,c,d,e,f){let g=e.nodeViews[b.type.name],h,i=g&&g(b,e,()=>h?h.parent?h.parent.posBeforeChild(h):void 0:f,c,d),j=i&&i.dom,k=i&&i.contentDOM;if(b.isText)if(j){if(3!=j.nodeType)throw RangeError("Text must be rendered as a DOM text node")}else j=document.createTextNode(b.text);else if(!j){let a=g_.renderSpec(document,b.type.spec.toDOM(b),null,b.attrs);({dom:j,contentDOM:k}=a)}k||b.isText||"BR"==j.nodeName||(j.hasAttribute("contenteditable")||(j.contentEditable="false"),b.type.spec.draggable&&(j.draggable=!0));let l=j;return(j=j0(j,c,b),i)?h=new jX(a,b,c,d,j,k||null,l,i):b.isText?new jV(a,b,c,d,j,l):new jT(a,b,c,d,j,k||null,l)}parseRule(a){if(this.node.type.spec.reparseInView)return null;let b={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(b.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let a=this.children.length-1;a>=0;a--){let c=this.children[a];if(this.dom.contains(c.dom.parentNode)){b.contentElement=c.dom.parentNode;break}}if(!b.contentElement){let c=a&&a.find(b=>1==b.nodeType&&0>a.indexOf(b.parentNode)&&this.dom.contains(b));c?b.contentElement=c:b.getContent=()=>gi.empty}}else b.contentElement=this.contentDOM;else b.getContent=()=>this.node.content;return b}matchesNode(a,b,c){return 0==this.dirty&&a.eq(this.node)&&j1(b,this.outerDeco)&&c.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(a,b){let c=this.node.inlineContent,d=b,e=a.composing?this.localCompositionInfo(a,b):null,f=e&&e.pos>-1?e:null,g=e&&e.pos<0,h=new j3(this,f&&f.node,a);(function(a,b,c,d){let e=b.locals(a),f=0;if(0==e.length){for(let c=0;c<a.childCount;c++){let g=a.child(c);d(g,e,b.forChild(f,g),c),f+=g.nodeSize}return}let g=0,h=[],i=null;for(let j=0;;){let k,l,m,n;for(;g<e.length&&e[g].to==f;){let a=e[g++];a.widget&&(k?(l||(l=[k])).push(a):k=a)}if(k)if(l){l.sort(j4);for(let a=0;a<l.length;a++)c(l[a],j,!!i)}else c(k,j,!!i);if(i)n=-1,m=i,i=null;else if(j<a.childCount)n=j,m=a.child(j++);else break;for(let a=0;a<h.length;a++)h[a].to<=f&&h.splice(a--,1);for(;g<e.length&&e[g].from<=f&&e[g].to>f;)h.push(e[g++]);let o=f+m.nodeSize;if(m.isText){let a=o;g<e.length&&e[g].from<a&&(a=e[g].from);for(let b=0;b<h.length;b++)h[b].to<a&&(a=h[b].to);a<o&&(i=m.cut(a-f),m=m.cut(0,a-f),o=a,n=-1)}else for(;g<e.length&&e[g].to<o;)g++;let p=m.isInline&&!m.isLeaf?h.filter(a=>!a.inline):h.slice();d(m,p,b.forChild(f,m),n),f=o}})(this.node,this.innerDeco,(b,e,f)=>{b.spec.marks?h.syncToMarks(b.spec.marks,c,a,e):b.type.side>=0&&!f&&h.syncToMarks(e==this.node.childCount?gm.none:this.node.child(e).marks,c,a,e),h.placeWidget(b,a,d)},(b,f,i,j)=>{let k;h.syncToMarks(b.marks,c,a,j),h.findNodeMatch(b,f,i,j)||g&&a.state.selection.from>d&&a.state.selection.to<d+b.nodeSize&&(k=h.findIndexWithChild(e.node))>-1&&h.updateNodeAt(b,f,i,k,a)||h.updateNextNode(b,f,i,a,j,d)||h.addNode(b,f,i,a,d),d+=b.nodeSize}),h.syncToMarks([],c,a,0),this.node.isTextblock&&h.addTextblockHacks(),h.destroyRest(),(h.changed||2==this.dirty)&&(f&&this.protectLocalComposition(a,f),function a(b,c,d){let e=b.firstChild,f=!1;for(let g=0;g<c.length;g++){let h=c[g],i=h.dom;if(i.parentNode==b){for(;i!=e;)e=j2(e),f=!0;e=e.nextSibling}else f=!0,b.insertBefore(i,e);if(h instanceof jS){let c=e?e.previousSibling:b.lastChild;a(h.contentDOM,h.children,d),e=c?c.nextSibling:b.firstChild}}for(;e;)e=j2(e),f=!0;f&&d.trackWrites==b&&(d.trackWrites=null)}(this.contentDOM,this.children,a),js&&function(a){if("UL"==a.nodeName||"OL"==a.nodeName){let b=a.style.cssText;a.style.cssText=b+"; list-style: square !important",window.getComputedStyle(a).listStyle,a.style.cssText=b}}(this.dom))}localCompositionInfo(a,b){let{from:c,to:d}=a.state.selection;if(!(a.state.selection instanceof hI)||c<b||d>b+this.node.content.size)return null;let e=a.input.compositionNode;if(!e||!this.dom.contains(e.parentNode))return null;if(!this.node.inlineContent)return{node:e,pos:-1,text:""};{let a=e.nodeValue,f=function(a,b,c,d){for(let e=0,f=0;e<a.childCount&&f<=d;){let g=a.child(e++),h=f;if(f+=g.nodeSize,!g.isText)continue;let i=g.text;for(;e<a.childCount;){let b=a.child(e++);if(f+=b.nodeSize,!b.isText)break;i+=b.text}if(f>=c){if(f>=d&&i.slice(d-b.length-h,d-h)==b)return d-b.length;let a=h<d?i.lastIndexOf(b,d-h-1):-1;if(a>=0&&a+b.length+h>=c)return h+a;if(c==d&&i.length>=d+b.length-h&&i.slice(d-h,d-h+b.length)==b)return d}}return -1}(this.node.content,a,c-b,d-b);return f<0?null:{node:e,pos:f,text:a}}}protectLocalComposition(a,{node:b,pos:c,text:d}){if(this.getDesc(b))return;let e=b;for(;e.parentNode!=this.contentDOM;e=e.parentNode){for(;e.previousSibling;)e.parentNode.removeChild(e.previousSibling);for(;e.nextSibling;)e.parentNode.removeChild(e.nextSibling);e.pmViewDesc&&(e.pmViewDesc=void 0)}let f=new jR(this,e,b,d);a.input.compositionNodes.push(f),this.children=j5(this.children,c,c+d.length,a,f)}update(a,b,c,d){return 3!=this.dirty&&!!a.sameMarkup(this.node)&&(this.updateInner(a,b,c,d),!0)}updateInner(a,b,c,d){this.updateOuterDeco(b),this.node=a,this.innerDeco=c,this.contentDOM&&this.updateChildren(d,this.posAtStart),this.dirty=0}updateOuterDeco(a){if(j1(a,this.outerDeco))return;let b=1!=this.nodeDOM.nodeType,c=this.dom;this.dom=j_(this.dom,this.nodeDOM,j$(this.outerDeco,this.node,b),j$(a,this.node,b)),this.dom!=c&&(c.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=a}selectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function jU(a,b,c,d,e){j0(d,b,a);let f=new jT(void 0,a,b,c,d,d,d);return f.contentDOM&&f.updateChildren(e,0),f}class jV extends jT{constructor(a,b,c,d,e,f){super(a,b,c,d,e,null,f)}parseRule(){let a=this.nodeDOM.parentNode;for(;a&&a!=this.dom&&!a.pmIsDeco;)a=a.parentNode;return{skip:a||!0}}update(a,b,c,d){return 3!=this.dirty&&(0==this.dirty||!!this.inParent())&&!!a.sameMarkup(this.node)&&(this.updateOuterDeco(b),(0!=this.dirty||a.text!=this.node.text)&&a.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=a.text,d.trackWrites==this.nodeDOM&&(d.trackWrites=null)),this.node=a,this.dirty=0,!0)}inParent(){let a=this.parent.contentDOM;for(let b=this.nodeDOM;b;b=b.parentNode)if(b==a)return!0;return!1}domFromPos(a){return{node:this.nodeDOM,offset:a}}localPosFromDOM(a,b,c){return a==this.nodeDOM?this.posAtStart+Math.min(b,this.node.text.length):super.localPosFromDOM(a,b,c)}ignoreMutation(a){return"characterData"!=a.type&&"selection"!=a.type}slice(a,b,c){let d=this.node.cut(a,b),e=document.createTextNode(d.text);return new jV(this.parent,d,this.outerDeco,this.innerDeco,e,e)}markDirty(a,b){super.markDirty(a,b),this.dom!=this.nodeDOM&&(0==a||b==this.nodeDOM.nodeValue.length)&&(this.dirty=3)}get domAtom(){return!1}isText(a){return this.node.text==a}}class jW extends jP{parseRule(){return{ignore:!0}}matchesHack(a){return 0==this.dirty&&this.dom.nodeName==a}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class jX extends jT{constructor(a,b,c,d,e,f,g,h){super(a,b,c,d,e,f,g),this.spec=h}update(a,b,c,d){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==a.type||this.spec.multiType)){let e=this.spec.update(a,b,c);return e&&this.updateInner(a,b,c,d),e}return(!!this.contentDOM||!!a.isLeaf)&&super.update(a,b,c,d)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(a,b,c,d){this.spec.setSelection?this.spec.setSelection(a,b,c.root):super.setSelection(a,b,c,d)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(a){return!!this.spec.stopEvent&&this.spec.stopEvent(a)}ignoreMutation(a){return this.spec.ignoreMutation?this.spec.ignoreMutation(a):super.ignoreMutation(a)}}let jY=function(a){a&&(this.nodeName=a)};jY.prototype=Object.create(null);let jZ=[new jY];function j$(a,b,c){if(0==a.length)return jZ;let d=c?jZ[0]:new jY,e=[d];for(let f=0;f<a.length;f++){let g=a[f].type.attrs;if(g)for(let a in g.nodeName&&e.push(d=new jY(g.nodeName)),g){let f=g[a];null!=f&&(c&&1==e.length&&e.push(d=new jY(b.isInline?"span":"div")),"class"==a?d.class=(d.class?d.class+" ":"")+f:"style"==a?d.style=(d.style?d.style+";":"")+f:"nodeName"!=a&&(d[a]=f))}}return e}function j_(a,b,c,d){if(c==jZ&&d==jZ)return b;let e=b;for(let b=0;b<d.length;b++){let f=d[b],g=c[b];if(b){let b;g&&g.nodeName==f.nodeName&&e!=a&&(b=e.parentNode)&&b.nodeName.toLowerCase()==f.nodeName||((b=document.createElement(f.nodeName)).pmIsDeco=!0,b.appendChild(e),g=jZ[0]),e=b}!function(a,b,c){for(let d in b)"class"==d||"style"==d||"nodeName"==d||d in c||a.removeAttribute(d);for(let d in c)"class"!=d&&"style"!=d&&"nodeName"!=d&&c[d]!=b[d]&&a.setAttribute(d,c[d]);if(b.class!=c.class){let d=b.class?b.class.split(" ").filter(Boolean):[],e=c.class?c.class.split(" ").filter(Boolean):[];for(let b=0;b<d.length;b++)-1==e.indexOf(d[b])&&a.classList.remove(d[b]);for(let b=0;b<e.length;b++)-1==d.indexOf(e[b])&&a.classList.add(e[b]);0==a.classList.length&&a.removeAttribute("class")}if(b.style!=c.style){if(b.style){let c=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,d;for(;d=c.exec(b.style);)a.style.removeProperty(d[1])}c.style&&(a.style.cssText+=c.style)}}(e,g||jZ[0],f)}return e}function j0(a,b,c){return j_(a,a,jZ,j$(b,c,1!=a.nodeType))}function j1(a,b){if(a.length!=b.length)return!1;for(let c=0;c<a.length;c++)if(!a[c].type.eq(b[c].type))return!1;return!0}function j2(a){let b=a.nextSibling;return a.parentNode.removeChild(a),b}class j3{constructor(a,b,c){this.lock=b,this.view=c,this.index=0,this.stack=[],this.changed=!1,this.top=a,this.preMatch=function(a,b){let c=b,d=c.children.length,e=a.childCount,f=new Map,g=[];c:for(;e>0;){let h;for(;;)if(d){let a=c.children[d-1];if(a instanceof jS)c=a,d=a.children.length;else{h=a,d--;break}}else if(c==b)break c;else d=c.parent.children.indexOf(c),c=c.parent;let i=h.node;if(i){if(i!=a.child(e-1))break;--e,f.set(h,e),g.push(h)}}return{index:e,matched:f,matches:g.reverse()}}(a.node.content,a)}destroyBetween(a,b){if(a!=b){for(let c=a;c<b;c++)this.top.children[c].destroy();this.top.children.splice(a,b-a),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(a,b,c,d){let e=0,f=this.stack.length>>1,g=Math.min(f,a.length);for(;e<g&&(e==f-1?this.top:this.stack[e+1<<1]).matchesMark(a[e])&&!1!==a[e].type.spec.spanning;)e++;for(;e<f;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),f--;for(;f<a.length;){this.stack.push(this.top,this.index+1);let e=-1,g=this.top.children.length;d<this.preMatch.index&&(g=Math.min(this.index+3,g));for(let b=this.index;b<g;b++){let c=this.top.children[b];if(c.matchesMark(a[f])&&!this.isLocked(c.dom)){e=b;break}}if(e<0&&this.index<this.top.children.length){let b=this.top.children[this.index];b instanceof jS&&3!=b.dirty&&b.mark.type==a[f].type&&b.spec.update&&!this.isLocked(b.dom)&&b.spec.update(a[f])&&(b.mark=a[f],e=this.index,this.changed=!0)}if(e>-1)e>this.index&&(this.changed=!0,this.destroyBetween(this.index,e)),this.top=this.top.children[this.index];else{let d=jS.create(this.top,a[f],b,c);this.top.children.splice(this.index,0,d),this.top=d,this.changed=!0}this.index=0,f++}}findNodeMatch(a,b,c,d){let e=-1,f;if(d>=this.preMatch.index&&(f=this.preMatch.matches[d-this.preMatch.index]).parent==this.top&&f.matchesNode(a,b,c))e=this.top.children.indexOf(f,this.index);else for(let d=this.index,f=Math.min(this.top.children.length,d+5);d<f;d++){let f=this.top.children[d];if(f.matchesNode(a,b,c)&&!this.preMatch.matched.has(f)){e=d;break}}return!(e<0)&&(this.destroyBetween(this.index,e),this.index++,!0)}updateNodeAt(a,b,c,d,e){let f=this.top.children[d];return 3==f.dirty&&f.dom==f.contentDOM&&(f.dirty=2),!!f.update(a,b,c,e)&&(this.destroyBetween(this.index,d),this.index++,!0)}findIndexWithChild(a){for(;;){let b=a.parentNode;if(!b)return -1;if(b==this.top.contentDOM){let b=a.pmViewDesc;if(b){for(let a=this.index;a<this.top.children.length;a++)if(this.top.children[a]==b)return a}return -1}a=b}}updateNextNode(a,b,c,d,e,f){for(let g=this.index;g<this.top.children.length;g++){let h=this.top.children[g];if(h instanceof jT){let i=this.preMatch.matched.get(h);if(null!=i&&i!=e)return!1;let j=h.dom,k,l=this.isLocked(j)&&!(a.isText&&h.node&&h.node.isText&&h.nodeDOM.nodeValue==a.text&&3!=h.dirty&&j1(b,h.outerDeco));if(!l&&h.update(a,b,c,d))return this.destroyBetween(this.index,g),h.dom!=j&&(this.changed=!0),this.index++,!0;if(!l&&(k=this.recreateWrapper(h,a,b,c,d,f)))return this.destroyBetween(this.index,g),this.top.children[this.index]=k,k.contentDOM&&(k.dirty=2,k.updateChildren(d,f+1),k.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(a,b,c,d,e,f){if(a.dirty||b.isAtom||!a.children.length||!a.node.content.eq(b.content)||!j1(c,a.outerDeco)||!d.eq(a.innerDeco))return null;let g=jT.create(this.top,b,c,d,e,f);if(g.contentDOM)for(let b of(g.children=a.children,a.children=[],g.children))b.parent=g;return a.destroy(),g}addNode(a,b,c,d,e){let f=jT.create(this.top,a,b,c,d,e);f.contentDOM&&f.updateChildren(d,e+1),this.top.children.splice(this.index++,0,f),this.changed=!0}placeWidget(a,b,c){let d=this.index<this.top.children.length?this.top.children[this.index]:null;if(d&&d.matchesWidget(a)&&(a==d.widget||!d.widget.type.toDOM.parentNode))this.index++;else{let d=new jQ(this.top,a,b,c);this.top.children.splice(this.index++,0,d),this.changed=!0}}addTextblockHacks(){let a=this.top.children[this.index-1],b=this.top;for(;a instanceof jS;)a=(b=a).children[b.children.length-1];(!a||!(a instanceof jV)||/\n$/.test(a.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(a.node.text))&&((jr||jp)&&a&&"false"==a.dom.contentEditable&&this.addHackNode("IMG",b),this.addHackNode("BR",this.top))}addHackNode(a,b){if(b==this.top&&this.index<b.children.length&&b.children[this.index].matchesHack(a))this.index++;else{let c=document.createElement(a);"IMG"==a&&(c.className="ProseMirror-separator",c.alt=""),"BR"==a&&(c.className="ProseMirror-trailingBreak");let d=new jW(this.top,[],c,null);b!=this.top?b.children.push(d):b.children.splice(this.index++,0,d),this.changed=!0}}isLocked(a){return this.lock&&(a==this.lock||1==a.nodeType&&a.contains(this.lock.parentNode))}}function j4(a,b){return a.type.side-b.type.side}function j5(a,b,c,d,e){let f=[];for(let g=0,h=0;g<a.length;g++){let i=a[g],j=h,k=h+=i.size;j>=c||k<=b?f.push(i):(j<b&&f.push(i.slice(0,b-j,d)),e&&(f.push(e),e=void 0),k>c&&f.push(i.slice(c-j,i.size,d)))}return f}function j6(a,b=null){let c=a.domSelectionRange(),d=a.state.doc;if(!c.focusNode)return null;let e=a.docView.nearestDesc(c.focusNode),f=e&&0==e.size,g=a.docView.posFromDOM(c.focusNode,c.focusOffset,1);if(g<0)return null;let h=d.resolve(g),i,j;if(jd(c)){for(i=g;e&&!e.node;)e=e.parent;let a=e.node;if(e&&a.isAtom&&hK.isSelectable(a)&&e.parent&&!(a.isInline&&function(a,b,c){for(let d=0==b,e=b==jb(a);d||e;){if(a==c)return!0;let b=i3(a);if(!(a=a.parentNode))return!1;d=d&&0==b,e=e&&b==jb(a)}}(c.focusNode,c.focusOffset,e.dom))){let a=e.posBefore;j=new hK(g==a?h:d.resolve(a))}}else{if(c instanceof a.dom.ownerDocument.defaultView.Selection&&c.rangeCount>1){let b=g,e=g;for(let d=0;d<c.rangeCount;d++){let f=c.getRangeAt(d);b=Math.min(b,a.docView.posFromDOM(f.startContainer,f.startOffset,1)),e=Math.max(e,a.docView.posFromDOM(f.endContainer,f.endOffset,-1))}if(b<0)return null;[i,g]=e==a.state.selection.anchor?[e,b]:[b,e],h=d.resolve(g)}else i=a.docView.posFromDOM(c.anchorNode,c.anchorOffset,1);if(i<0)return null}let k=d.resolve(i);if(!j){let c="pointer"==b||a.state.selection.head<h.pos&&!f?1:-1;j=kf(a,k,h,c)}return j}function j7(a){return a.editable?a.hasFocus():kh(a)&&document.activeElement&&document.activeElement.contains(a.dom)}function j8(a,b=!1){let c=a.state.selection;if(kd(a,c),!j7(a))return;let d=a.input.mouseDown;if(!b&&jp&&d){let b=a.domSelectionRange(),c=a.domObserver.currentSelection;if(b.anchorNode&&c.anchorNode&&i8(b.anchorNode,b.anchorOffset,c.anchorNode,c.anchorOffset)&&d.delaySelUpdate())return void a.domObserver.setCurSelection()}if(a.domObserver.disconnectSelection(),a.cursorWrapper)!function(a){let b=a.domSelection();if(!b)return;let c=a.cursorWrapper.dom,d="IMG"==c.nodeName;d?b.collapse(c.parentNode,i3(c)+1):b.collapse(c,0),!d&&!a.state.selection.visible&&jl&&jm<=11&&(c.disabled=!0,c.disabled=!1)}(a);else{var e;let d,f,g,h,{anchor:i,head:j}=c,k,l;j9&&!(c instanceof hI)&&(c.$from.parent.inlineContent||(k=ka(a,c.from)),c.empty||c.$from.parent.inlineContent||(l=ka(a,c.to))),a.docView.setSelection(i,j,a,b),j9&&(k&&kc(k),l&&kc(l)),c.visible?a.dom.classList.remove("ProseMirror-hideselection"):(a.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&((d=(e=a).dom.ownerDocument).removeEventListener("selectionchange",e.input.hideSelectionGuard),g=(f=e.domSelectionRange()).anchorNode,h=f.anchorOffset,d.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(f.anchorNode!=g||f.anchorOffset!=h)&&(d.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!j7(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})))}a.domObserver.setCurSelection(),a.domObserver.connectSelection()}let j9=jr||jp&&jq<63;function ka(a,b){let{node:c,offset:d}=a.docView.domFromPos(b,0),e=d<c.childNodes.length?c.childNodes[d]:null,f=d?c.childNodes[d-1]:null;if(jr&&e&&"false"==e.contentEditable)return kb(e);if((!e||"false"==e.contentEditable)&&(!f||"false"==f.contentEditable)){if(e)return kb(e);else if(f)return kb(f)}}function kb(a){return a.contentEditable="true",jr&&a.draggable&&(a.draggable=!1,a.wasDraggable=!0),a}function kc(a){a.contentEditable="false",a.wasDraggable&&(a.draggable=!0,a.wasDraggable=null)}function kd(a,b){if(b instanceof hK){let c=a.docView.descAt(b.from);c!=a.lastSelectedViewDesc&&(ke(a),c&&c.selectNode(),a.lastSelectedViewDesc=c)}else ke(a)}function ke(a){a.lastSelectedViewDesc&&(a.lastSelectedViewDesc.parent&&a.lastSelectedViewDesc.deselectNode(),a.lastSelectedViewDesc=void 0)}function kf(a,b,c,d){return a.someProp("createSelectionBetween",d=>d(a,b,c))||hI.between(b,c,d)}function kg(a){return(!a.editable||!!a.hasFocus())&&kh(a)}function kh(a){let b=a.domSelectionRange();if(!b.anchorNode)return!1;try{return a.dom.contains(3==b.anchorNode.nodeType?b.anchorNode.parentNode:b.anchorNode)&&(a.editable||a.dom.contains(3==b.focusNode.nodeType?b.focusNode.parentNode:b.focusNode))}catch(a){return!1}}function ki(a,b){let{$anchor:c,$head:d}=a.selection,e=b>0?c.max(d):c.min(d),f=e.parent.inlineContent?e.depth?a.doc.resolve(b>0?e.after():e.before()):null:e;return f&&hE.findFrom(f,b)}function kj(a,b){return a.dispatch(a.state.tr.setSelection(b).scrollIntoView()),!0}function kk(a,b,c){let d=a.state.selection;if(d instanceof hI){if(c.indexOf("s")>-1){let{$head:c}=d,e=c.textOffset?null:b<0?c.nodeBefore:c.nodeAfter;if(!e||e.isText||!e.isLeaf)return!1;let f=a.state.doc.resolve(c.pos+e.nodeSize*(b<0?-1:1));return kj(a,new hI(d.$anchor,f))}else if(!d.empty)return!1;else if(a.endOfTextblock(b>0?"forward":"backward")){let c=ki(a.state,b);return!!c&&c instanceof hK&&kj(a,c)}else if(!(jt&&c.indexOf("m")>-1)){let c=d.$head,e=c.textOffset?null:b<0?c.nodeBefore:c.nodeAfter,f;if(!e||e.isText)return!1;let g=b<0?c.pos-e.nodeSize:c.pos;return!!(e.isAtom||(f=a.docView.descAt(g))&&!f.contentDOM)&&(hK.isSelectable(e)?kj(a,new hK(b<0?a.state.doc.resolve(c.pos-e.nodeSize):c)):!!jw&&kj(a,new hI(a.state.doc.resolve(b<0?g:g+e.nodeSize))))}}else{if(d instanceof hK&&d.node.isInline)return kj(a,new hI(b>0?d.$to:d.$from));let c=ki(a.state,b);return!!c&&kj(a,c)}}function kl(a){return 3==a.nodeType?a.nodeValue.length:a.childNodes.length}function km(a,b){let c=a.pmViewDesc;return c&&0==c.size&&(b<0||a.nextSibling||"BR"!=a.nodeName)}function kn(a,b){return b<0?function(a){let b=a.domSelectionRange(),c=b.focusNode,d=b.focusOffset;if(!c)return;let e,f,g=!1;for(jn&&1==c.nodeType&&d<kl(c)&&km(c.childNodes[d],-1)&&(g=!0);;)if(d>0)if(1!=c.nodeType)break;else{let a=c.childNodes[d-1];if(km(a,-1))e=c,f=--d;else if(3==a.nodeType)d=(c=a).nodeValue.length;else break}else if(ko(c))break;else{let b=c.previousSibling;for(;b&&km(b,-1);)e=c.parentNode,f=i3(b),b=b.previousSibling;if(b)d=kl(c=b);else{if((c=c.parentNode)==a.dom)break;d=0}}g?kp(a,c,d):e&&kp(a,e,f)}(a):function(a){let b,c,d=a.domSelectionRange(),e=d.focusNode,f=d.focusOffset;if(!e)return;let g=kl(e);for(;;)if(f<g){if(1!=e.nodeType)break;if(km(e.childNodes[f],1))b=e,c=++f;else break}else if(ko(e))break;else{let d=e.nextSibling;for(;d&&km(d,1);)b=d.parentNode,c=i3(d)+1,d=d.nextSibling;if(d)f=0,g=kl(e=d);else{if((e=e.parentNode)==a.dom)break;f=g=0}}b&&kp(a,b,c)}(a)}function ko(a){let b=a.pmViewDesc;return b&&b.node&&b.node.isBlock}function kp(a,b,c){if(3!=b.nodeType){let a,d;(d=function(a,b){for(;a&&b==a.childNodes.length&&!jc(a);)b=i3(a)+1,a=a.parentNode;for(;a&&b<a.childNodes.length;){let c=a.childNodes[b];if(3==c.nodeType)return c;if(1==c.nodeType&&"false"==c.contentEditable)break;a=c,b=0}}(b,c))?(b=d,c=0):(a=function(a,b){for(;a&&!b&&!jc(a);)b=i3(a),a=a.parentNode;for(;a&&b;){let c=a.childNodes[b-1];if(3==c.nodeType)return c;if(1==c.nodeType&&"false"==c.contentEditable)break;b=(a=c).childNodes.length}}(b,c))&&(b=a,c=a.nodeValue.length)}let d=a.domSelection();if(!d)return;if(jd(d)){let a=document.createRange();a.setEnd(b,c),a.setStart(b,c),d.removeAllRanges(),d.addRange(a)}else d.extend&&d.extend(b,c);a.domObserver.setCurSelection();let{state:e}=a;setTimeout(()=>{a.state==e&&j8(a)},50)}function kq(a,b){let c=a.state.doc.resolve(b);if(!(jp||ju)&&c.parent.inlineContent){let d=a.coordsAtPos(b);if(b>c.start()){let c=a.coordsAtPos(b-1),e=(c.top+c.bottom)/2;if(e>d.top&&e<d.bottom&&Math.abs(c.left-d.left)>1)return c.left<d.left?"ltr":"rtl"}if(b<c.end()){let c=a.coordsAtPos(b+1),e=(c.top+c.bottom)/2;if(e>d.top&&e<d.bottom&&Math.abs(c.left-d.left)>1)return c.left>d.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(a.dom).direction?"rtl":"ltr"}function kr(a,b,c){let d=a.state.selection;if(d instanceof hI&&!d.empty||c.indexOf("s")>-1||jt&&c.indexOf("m")>-1)return!1;let{$from:e,$to:f}=d;if(!e.parent.inlineContent||a.endOfTextblock(b<0?"up":"down")){let c=ki(a.state,b);if(c&&c instanceof hK)return kj(a,c)}if(!e.parent.inlineContent){let c=b<0?e:f,g=d instanceof hM?hE.near(c,b):hE.findFrom(c,b);return!!g&&kj(a,g)}return!1}function ks(a,b){if(!(a.state.selection instanceof hI))return!0;let{$head:c,$anchor:d,empty:e}=a.state.selection;if(!c.sameParent(d))return!0;if(!e)return!1;if(a.endOfTextblock(b>0?"forward":"backward"))return!0;let f=!c.textOffset&&(b<0?c.nodeBefore:c.nodeAfter);if(f&&!f.isText){let d=a.state.tr;return b<0?d.delete(c.pos-f.nodeSize,c.pos):d.delete(c.pos,c.pos+f.nodeSize),a.dispatch(d),!0}return!1}function kt(a,b,c){a.domObserver.stop(),b.contentEditable=c,a.domObserver.start()}function ku(a,b){a.someProp("transformCopied",c=>{b=c(b,a)});let c=[],{content:d,openStart:e,openEnd:f}=b;for(;e>1&&f>1&&1==d.childCount&&1==d.firstChild.childCount;){e--,f--;let a=d.firstChild;c.push(a.type.name,a.attrs!=a.type.defaultAttrs?a.attrs:null),d=a.content}let g=a.someProp("clipboardSerializer")||g_.fromSchema(a.state.schema),h=kB(),i=h.createElement("div");i.appendChild(g.serializeFragment(d,{document:h}));let j=i.firstChild,k,l=0;for(;j&&1==j.nodeType&&(k=kA[j.nodeName.toLowerCase()]);){for(let a=k.length-1;a>=0;a--){let b=h.createElement(k[a]);for(;i.firstChild;)b.appendChild(i.firstChild);i.appendChild(b),l++}j=i.firstChild}return j&&1==j.nodeType&&j.setAttribute("data-pm-slice",`${e} ${f}${l?` -${l}`:""} ${JSON.stringify(c)}`),{dom:i,text:a.someProp("clipboardTextSerializer",c=>c(b,a))||b.content.textBetween(0,b.content.size,"\n\n"),slice:b}}function kv(a,b,c,d,e){let f,g,h=e.parent.type.spec.code;if(!c&&!b)return null;let i=!!b&&(d||h||!c);if(i){if(a.someProp("transformPastedText",c=>{b=c(b,h||d,a)}),h)return g=new go(gi.from(a.state.schema.text(b.replace(/\r\n?/g,"\n"))),0,0),a.someProp("transformPasted",b=>{g=b(g,a,!0)}),g;let c=a.someProp("clipboardTextParser",c=>c(b,e,d,a));if(c)g=c;else{let c=e.marks(),{schema:d}=a.state,g=g_.fromSchema(d);f=document.createElement("div"),b.split(/(?:\r\n?|\n)+/).forEach(a=>{let b=f.appendChild(document.createElement("p"));a&&b.appendChild(g.serializeNode(d.text(a,c)))})}}else a.someProp("transformPastedHTML",b=>{c=b(c,a)}),f=function(a){let b=/^(\s*<meta [^>]*>)*/.exec(a);b&&(a=a.slice(b[0].length));let c=kB(),d=c.body,e=/<([a-z][^>\s]+)/i.exec(a),f;if((f=e&&kA[e[1].toLowerCase()])&&(a=f.map(a=>"<"+a+">").join("")+a+f.map(a=>"</"+a+">").reverse().join("")),d.innerHTML=function(a){let b=window.trustedTypes;if(!b)return a;if(!kC){if(kC=b.defaultPolicy)try{return kC.createHTML(a)}catch(a){}kC=b.createPolicy("ProseMirrorClipboard",{createHTML:a=>a})}return kC.createHTML(a)}(a),f)for(let a=0;a<f.length;a++)d=d.querySelector(f[a])||d;for(let a=0;a<c.styleSheets.length;a++){let b=c.styleSheets[a];for(let a=0;a<b.rules.length;a++){let c=b.rules[a];if(c instanceof CSSStyleRule){let a=d.querySelectorAll(c.selectorText);for(let b=0;b<a.length;b++)a[b].style.cssText+=c.style.cssText}}}return d}(c),jw&&function(a){let b=a.querySelectorAll(jp?"span:not([class]):not([style])":"span.Apple-converted-space");for(let c=0;c<b.length;c++){let d=b[c];1==d.childNodes.length&&"\xa0"==d.textContent&&d.parentNode&&d.parentNode.replaceChild(a.ownerDocument.createTextNode(" "),d)}}(f);let j=f&&f.querySelector("[data-pm-slice]"),k=j&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(j.getAttribute("data-pm-slice")||"");if(k&&k[3])for(let a=+k[3];a>0;a--){let a=f.firstChild;for(;a&&1!=a.nodeType;)a=a.nextSibling;if(!a)break;f=a}if(g||(g=(a.someProp("clipboardParser")||a.someProp("domParser")||gS.fromSchema(a.state.schema)).parseSlice(f,{preserveWhitespace:!!(i||k),context:e,ruleFromNode:a=>"BR"!=a.nodeName||a.nextSibling||!a.parentNode||kw.test(a.parentNode.nodeName)?null:{ignore:!0}})),k)g=function(a,b){if(!a.size)return a;let c=a.content.firstChild.type.schema,d;try{d=JSON.parse(b)}catch(b){return a}let{content:e,openStart:f,openEnd:g}=a;for(let a=d.length-2;a>=0;a-=2){let b=c.nodes[d[a]];if(!b||b.hasRequiredAttrs())break;try{b.checkAttrs(d[a+1])}catch(a){break}e=gi.from(b.create(d[a+1],e)),f++,g++}return new go(e,f,g)}(kz(g,+k[1],+k[2]),k[4]);else if((g=go.maxOpen(function(a,b){if(a.childCount<2)return a;for(let c=b.depth;c>=0;c--){let d=b.node(c).contentMatchAt(b.index(c)),e,f=[];if(a.forEach(a=>{if(!f)return;let b=d.findWrapping(a.type),c;if(!b)return f=null;if(c=f.length&&e.length&&function a(b,c,d,e,f){if(f<b.length&&f<c.length&&b[f]==c[f]){let g=a(b,c,d,e.lastChild,f+1);if(g)return e.copy(e.content.replaceChild(e.childCount-1,g));if(e.contentMatchAt(e.childCount).matchType(f==b.length-1?d.type:b[f+1]))return e.copy(e.content.append(gi.from(kx(d,b,f+1))))}}(b,e,a,f[f.length-1],0))f[f.length-1]=c;else{f.length&&(f[f.length-1]=function a(b,c){if(0==c)return b;let d=b.content.replaceChild(b.childCount-1,a(b.lastChild,c-1)),e=b.contentMatchAt(b.childCount).fillBefore(gi.empty,!0);return b.copy(d.append(e))}(f[f.length-1],e.length));let c=kx(a,b);f.push(c),d=d.matchType(c.type),e=b}}),f)return gi.from(f)}return a}(g.content,e),!0)).openStart||g.openEnd){let a=0,b=0;for(let b=g.content.firstChild;a<g.openStart&&!b.type.spec.isolating;a++,b=b.firstChild);for(let a=g.content.lastChild;b<g.openEnd&&!a.type.spec.isolating;b++,a=a.lastChild);g=kz(g,a,b)}return a.someProp("transformPasted",b=>{g=b(g,a,i)}),g}let kw=/^(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 kx(a,b,c=0){for(let d=b.length-1;d>=c;d--)a=b[d].create(null,gi.from(a));return a}function ky(a,b,c,d,e,f){let g=b<0?a.firstChild:a.lastChild,h=g.content;return a.childCount>1&&(f=0),e<d-1&&(h=ky(h,b,c,d,e+1,f)),e>=c&&(h=b<0?g.contentMatchAt(0).fillBefore(h,f<=e).append(h):h.append(g.contentMatchAt(g.childCount).fillBefore(gi.empty,!0))),a.replaceChild(b<0?0:a.childCount-1,g.copy(h))}function kz(a,b,c){return b<a.openStart&&(a=new go(ky(a.content,-1,b,a.openStart,0,a.openEnd),b,a.openEnd)),c<a.openEnd&&(a=new go(ky(a.content,1,c,a.openEnd,0,0),a.openStart,c)),a}let kA={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 kB(){return document.implementation.createHTMLDocument("title")}let kC=null,kD={},kE={},kF={touchstart:!0,touchmove:!0};class kG{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function kH(a,b){a.input.lastSelectionOrigin=b,a.input.lastSelectionTime=Date.now()}function kI(a){a.someProp("handleDOMEvents",b=>{for(let c in b)a.input.eventHandlers[c]||a.dom.addEventListener(c,a.input.eventHandlers[c]=b=>kJ(a,b))})}function kJ(a,b){return a.someProp("handleDOMEvents",c=>{let d=c[b.type];return!!d&&(d(a,b)||b.defaultPrevented)})}function kK(a){return{left:a.clientX,top:a.clientY}}function kL(a,b,c,d,e){if(-1==d)return!1;let f=a.state.doc.resolve(d);for(let d=f.depth+1;d>0;d--)if(a.someProp(b,b=>d>f.depth?b(a,c,f.nodeAfter,f.before(d),e,!0):b(a,c,f.node(d),f.before(d),e,!1)))return!0;return!1}function kM(a,b,c){if(a.focused||a.focus(),a.state.selection.eq(b))return;let d=a.state.tr.setSelection(b);"pointer"==c&&d.setMeta("pointer",!0),a.dispatch(d)}function kN(a,b,c){let d=a.state.doc;if(-1==b)return d.inlineContent?hI.create(d,0,d.content.size):null;let e=d.resolve(b);for(let a=e.depth+1;a>0;a--){let b=a>e.depth?e.nodeAfter:e.node(a),f=e.before(a);if(b.inlineContent)return hI.create(d,f+1,f+1+b.content.size);if(c&&hK.isSelectable(b))return hK.create(d,f)}return null}kE.keydown=(a,b)=>{if((a.input.shiftKey=16==b.keyCode||b.shiftKey,!kS(a))&&(a.input.lastKeyCode=b.keyCode,a.input.lastKeyCodeTime=Date.now(),!jv||!jp||13!=b.keyCode))if(229!=b.keyCode&&a.domObserver.forceFlush(),!js||13!=b.keyCode||b.ctrlKey||b.altKey||b.metaKey)a.someProp("handleKeyDown",c=>c(a,b))||function(a,b){let c,d=b.keyCode,e=(c="",b.ctrlKey&&(c+="c"),b.metaKey&&(c+="m"),b.altKey&&(c+="a"),b.shiftKey&&(c+="s"),c);if(8==d||jt&&72==d&&"c"==e)return ks(a,-1)||kn(a,-1);if(46==d&&!b.shiftKey||jt&&68==d&&"c"==e)return ks(a,1)||kn(a,1);if(13==d||27==d)return!0;if(37==d||jt&&66==d&&"c"==e){let b=37==d?"ltr"==kq(a,a.state.selection.from)?-1:1:-1;return kk(a,b,e)||kn(a,b)}if(39==d||jt&&70==d&&"c"==e){let b=39==d?"ltr"==kq(a,a.state.selection.from)?1:-1:1;return kk(a,b,e)||kn(a,b)}else if(38==d||jt&&80==d&&"c"==e)return kr(a,-1,e)||kn(a,-1);else if(40==d||jt&&78==d&&"c"==e)return function(a){if(!jr||a.state.selection.$head.parentOffset>0)return!1;let{focusNode:b,focusOffset:c}=a.domSelectionRange();if(b&&1==b.nodeType&&0==c&&b.firstChild&&"false"==b.firstChild.contentEditable){let c=b.firstChild;kt(a,c,"true"),setTimeout(()=>kt(a,c,"false"),20)}return!1}(a)||kr(a,1,e)||kn(a,1);else if(e==(jt?"m":"c")&&(66==d||73==d||89==d||90==d))return!0;return!1}(a,b)?b.preventDefault():kH(a,"key");else{let b=Date.now();a.input.lastIOSEnter=b,a.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{a.input.lastIOSEnter==b&&(a.someProp("handleKeyDown",b=>b(a,je(13,"Enter"))),a.input.lastIOSEnter=0)},200)}},kE.keyup=(a,b)=>{16==b.keyCode&&(a.input.shiftKey=!1)},kE.keypress=(a,b)=>{if(kS(a)||!b.charCode||b.ctrlKey&&!b.altKey||jt&&b.metaKey)return;if(a.someProp("handleKeyPress",c=>c(a,b)))return void b.preventDefault();let c=a.state.selection;if(!(c instanceof hI)||!c.$from.sameParent(c.$to)){let d=String.fromCharCode(b.charCode),e=()=>a.state.tr.insertText(d).scrollIntoView();/[\r\n]/.test(d)||a.someProp("handleTextInput",b=>b(a,c.$from.pos,c.$to.pos,d,e))||a.dispatch(e()),b.preventDefault()}};let kO=jt?"metaKey":"ctrlKey";kD.mousedown=(a,b)=>{a.input.shiftKey=b.shiftKey;let c=kW(a),d=Date.now(),e="singleClick";d-a.input.lastClick.time<500&&function(a,b){let c=b.x-a.clientX,d=b.y-a.clientY;return c*c+d*d<100}(b,a.input.lastClick)&&!b[kO]&&a.input.lastClick.button==b.button&&("singleClick"==a.input.lastClick.type?e="doubleClick":"doubleClick"==a.input.lastClick.type&&(e="tripleClick")),a.input.lastClick={time:d,x:b.clientX,y:b.clientY,type:e,button:b.button},a.input.mouseDown&&a.input.mouseDown.done();let f=a.posAtCoords(kK(b));f&&("singleClick"==e?a.input.mouseDown=new kQ(a,f,b,!!c):("doubleClick"==e?function(a,b,c,d){return kL(a,"handleDoubleClickOn",b,c,d)||a.someProp("handleDoubleClick",c=>c(a,b,d))}:function(a,b,c,d){return kL(a,"handleTripleClickOn",b,c,d)||a.someProp("handleTripleClick",c=>c(a,b,d))||function(a,b,c){if(0!=c.button)return!1;let d=kN(a,b,!0),e=a.state.doc;return!!d&&(kM(a,d,"pointer"),d instanceof hI&&e.eq(a.state.doc)&&(a.input.mouseDown=new kR(a,d)),!0)}(a,c,d)})(a,f.pos,f.inside,b)?b.preventDefault():kH(a,"pointer"))};class kP{constructor(a){this.view=a,this.mightDrag=null,a.root.addEventListener("mouseup",this.up=this.up.bind(this)),a.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(a){this.done()}move(a){0==a.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 kQ extends kP{constructor(a,b,c,d){let e,f;if(super(a),this.pos=b,this.event=c,this.flushed=d,this.delayedSelectionSync=!1,this.startDoc=a.state.doc,this.selectNode=!!c[kO],this.allowDefault=c.shiftKey,b.inside>-1)e=a.state.doc.nodeAt(b.inside),f=b.inside;else{let c=a.state.doc.resolve(b.pos);e=c.parent,f=c.depth?c.before():0}let g=d?null:c.target,h=g?a.docView.nearestDesc(g,!0):null;this.target=h&&1==h.nodeDOM.nodeType?h.nodeDOM:null;let{selection:i}=a.state;0==c.button&&(e.type.spec.draggable&&!1!==e.type.spec.selectable||i instanceof hK&&i.from<=f&&i.to>f)&&(this.mightDrag={node:e,pos:f,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&jn&&!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()),kH(a,"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||j8(this.view)})}up(a){if(this.done(),!this.view.dom.contains(a.target))return;let b=this.pos;if(this.view.state.doc!=this.startDoc&&(b=this.view.posAtCoords(kK(a))),this.updateAllowDefault(a),this.allowDefault||!b)kH(this.view,"pointer");else{var c,d,e,f;(c=this.view,d=b.pos,e=b.inside,f=this.selectNode,kL(c,"handleClickOn",d,e,a)||c.someProp("handleClick",b=>b(c,d,a))||(f?function(a,b){if(-1==b)return!1;let c=a.state.selection,d,e;c instanceof hK&&(d=c.node);let f=a.state.doc.resolve(b);for(let a=f.depth+1;a>0;a--){let b=a>f.depth?f.nodeAfter:f.node(a);if(hK.isSelectable(b)){e=d&&c.$from.depth>0&&a>=c.$from.depth&&f.before(c.$from.depth+1)==c.$from.pos?f.before(c.$from.depth):f.before(a);break}}return null!=e&&(kM(a,hK.create(a.state.doc,e),"pointer"),!0)}(c,e):function(a,b){if(-1==b)return!1;let c=a.state.doc.resolve(b),d=c.nodeAfter;return!!(d&&d.isAtom&&hK.isSelectable(d))&&(kM(a,new hK(c),"pointer"),!0)}(c,e)))?a.preventDefault():0==a.button&&(this.flushed||jr&&this.mightDrag&&!this.mightDrag.node.isAtom||jp&&!this.view.state.selection.visible&&2>=Math.min(Math.abs(b.pos-this.view.state.selection.from),Math.abs(b.pos-this.view.state.selection.to)))?(kM(this.view,hE.near(this.view.state.doc.resolve(b.pos)),"pointer"),a.preventDefault()):kH(this.view,"pointer")}}move(a){this.updateAllowDefault(a),kH(this.view,"pointer"),super.move(a)}updateAllowDefault(a){!this.allowDefault&&(Math.abs(this.event.x-a.clientX)>4||Math.abs(this.event.y-a.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return!!this.allowDefault&&(this.delayedSelectionSync=!0,!0)}}class kR extends kP{constructor(a,b){super(a),this.startSelection=b,this.startDoc=a.state.doc}move(a){if(0==a.buttons||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc))return void this.done();a.preventDefault(),kH(this.view,"pointer");let b=this.view.posAtCoords(kK(a)),c=b&&kN(this.view,b.inside,!1);if(!c)return;let{doc:d}=this.view.state,e=this.startSelection,[f,g]=c.from<e.from?[e.to,c.from]:[e.from,c.to];kM(this.view,hI.create(d,f,g),"pointer")}}function kS(a,b){return!!a.composing||!!(jr&&500>Math.abs(Date.now()-a.input.compositionEndedAt))&&(a.input.compositionEndedAt=-2e8,!0)}kD.touchstart=a=>{a.input.lastTouch=Date.now(),kW(a),kH(a,"pointer")},kD.touchmove=a=>{a.input.lastTouch=Date.now(),kH(a,"pointer")},kD.contextmenu=a=>kW(a);let kT=jv?5e3:-1;function kU(a,b){clearTimeout(a.input.composingTimeout),b>-1&&(a.input.composingTimeout=setTimeout(()=>kW(a),b))}function kV(a){for(a.composing&&(a.input.composing=!1,a.input.compositionEndedAt=Date.now());a.input.compositionNodes.length>0;)a.input.compositionNodes.pop().markParentsDirty()}function kW(a,b=!1){if(!jv||!(a.domObserver.flushingSoon>=0)){if(a.domObserver.forceFlush(),kV(a),b||a.docView&&a.docView.dirty){let c=j6(a),d=a.state.selection;return c&&!c.eq(d)?a.dispatch(a.state.tr.setSelection(c)):(a.markCursor||b)&&!d.$from.node(d.$from.sharedDepth(d.to)).inlineContent?a.dispatch(a.state.tr.deleteSelection()):a.updateState(a.state),!0}return!1}}kE.compositionstart=kE.compositionupdate=a=>{if(!a.composing){a.domObserver.flush();let{state:b}=a,c=b.selection.$to;if(b.selection instanceof hI&&(b.storedMarks||!c.textOffset&&c.parentOffset&&c.nodeBefore.marks.some(a=>!1===a.type.spec.inclusive)||jp&&ju&&function(a){let{focusNode:b,focusOffset:c}=a.domSelectionRange();if(!b||1!=b.nodeType||c>=b.childNodes.length)return!1;let d=b.childNodes[c];return 1==d.nodeType&&"false"==d.contentEditable}(a)))a.markCursor=a.state.storedMarks||c.marks(),kW(a,!0),a.markCursor=null;else if(kW(a,!b.selection.empty),jn&&b.selection.empty&&c.parentOffset&&!c.textOffset&&c.nodeBefore.marks.length){let b=a.domSelectionRange();for(let c=b.focusNode,d=b.focusOffset;c&&1==c.nodeType&&0!=d;){let b=d<0?c.lastChild:c.childNodes[d-1];if(!b)break;if(3==b.nodeType){let c=a.domSelection();c&&c.collapse(b,b.nodeValue.length);break}c=b,d=-1}}a.input.composing=!0}kU(a,kT)},kE.compositionend=(a,b)=>{a.composing&&(a.input.composing=!1,a.input.compositionEndedAt=Date.now(),a.input.compositionPendingChanges=a.domObserver.pendingRecords().length?a.input.compositionID:0,a.input.compositionNode=null,a.input.badSafariComposition?a.domObserver.forceFlush():a.input.compositionPendingChanges&&Promise.resolve().then(()=>a.domObserver.flush()),a.input.compositionID++,kU(a,20))};let kX=jl&&jm<15||js&&jx<604;function kY(a,b,c,d,e){let f=kv(a,b,c,d,a.state.selection.$from);if(a.someProp("handlePaste",b=>b(a,e,f||go.empty)))return!0;if(!f)return!1;let g=0==f.openStart&&0==f.openEnd&&1==f.content.childCount?f.content.firstChild:null,h=g?a.state.tr.replaceSelectionWith(g,d):a.state.tr.replaceSelection(f);return a.dispatch(h.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function kZ(a){let b=a.getData("text/plain")||a.getData("Text");if(b)return b;let c=a.getData("text/uri-list");return c?c.replace(/\r?\n/g," "):""}kD.copy=kE.cut=(a,b)=>{let c=a.state.selection,d="cut"==b.type;if(c.empty)return;let e=kX?null:b.clipboardData,{dom:f,text:g}=ku(a,c.content());e?(b.preventDefault(),e.clearData(),e.setData("text/html",f.innerHTML),e.setData("text/plain",g)):function(a,b){if(!a.dom.parentNode)return;let c=a.dom.parentNode.appendChild(document.createElement("div"));c.appendChild(b),c.style.cssText="position: fixed; left: -10000px; top: 10px";let d=getSelection(),e=document.createRange();e.selectNodeContents(b),a.dom.blur(),d.removeAllRanges(),d.addRange(e),setTimeout(()=>{c.parentNode&&c.parentNode.removeChild(c),a.focus()},50)}(a,f),d&&a.dispatch(a.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},kE.paste=(a,b)=>{if(a.composing&&!jv)return;let c=kX?null:b.clipboardData,d=a.input.shiftKey&&45!=a.input.lastKeyCode;c&&kY(a,kZ(c),c.getData("text/html"),d,b)?b.preventDefault():function(a,b){if(!a.dom.parentNode)return;let c=a.input.shiftKey||a.state.selection.$from.parent.type.spec.code,d=a.dom.parentNode.appendChild(document.createElement(c?"textarea":"div"));c||(d.contentEditable="true"),d.style.cssText="position: fixed; left: -10000px; top: 10px",d.focus();let e=a.input.shiftKey&&45!=a.input.lastKeyCode;setTimeout(()=>{a.focus(),d.parentNode&&d.parentNode.removeChild(d),c?kY(a,d.value,null,e,b):kY(a,d.textContent,d.innerHTML,e,b)},50)}(a,b)};class k${constructor(a,b,c){this.slice=a,this.move=b,this.node=c}}let k_=jt?"altKey":"ctrlKey";function k0(a,b){let c;return a.someProp("dragCopies",a=>{c=c||a(b)}),null!=c?!c:!b[k_]}for(let a in kD.dragstart=(a,b)=>{let c,d=a.input.mouseDown;if(d&&d.done(),!b.dataTransfer)return;let e=a.state.selection,f=e.empty?null:a.posAtCoords(kK(b));if(f&&f.pos>=e.from&&f.pos<=(e instanceof hK?e.to-1:e.to));else if(d&&d.mightDrag)c=hK.create(a.state.doc,d.mightDrag.pos);else if(b.target&&1==b.target.nodeType){let d=a.docView.nearestDesc(b.target,!0);d&&d.node.type.spec.draggable&&d!=a.docView&&(c=hK.create(a.state.doc,d.posBefore))}let g=(c||a.state.selection).content(),{dom:h,text:i,slice:j}=ku(a,g);b.dataTransfer.files.length&&jp&&!(jq>120)||b.dataTransfer.clearData(),b.dataTransfer.setData(kX?"Text":"text/html",h.innerHTML),b.dataTransfer.effectAllowed="copyMove",kX||b.dataTransfer.setData("text/plain",i),a.dragging=new k$(j,k0(a,b),c)},kD.dragend=a=>{let b=a.dragging;window.setTimeout(()=>{a.dragging==b&&(a.dragging=null)},50)},kE.dragover=kE.dragenter=(a,b)=>b.preventDefault(),kE.drop=(a,b)=>{try{!function(a,b,c){if(!b.dataTransfer)return;let d=a.posAtCoords(kK(b));if(!d)return;let e=a.state.doc.resolve(d.pos),f=c&&c.slice;f?a.someProp("transformPasted",b=>{f=b(f,a,!1)}):f=kv(a,kZ(b.dataTransfer),kX?null:b.dataTransfer.getData("text/html"),!1,e);let g=!!(c&&k0(a,b));if(a.someProp("handleDrop",c=>c(a,b,f||go.empty,g)))return b.preventDefault();if(!f)return;b.preventDefault();let h=f?function(a,b,c){let d=a.resolve(b);if(!c.content.size)return b;let e=c.content;for(let a=0;a<c.openStart;a++)e=e.firstChild.content;for(let a=1;a<=(0==c.openStart&&c.size?2:1);a++)for(let b=d.depth;b>=0;b--){let c=b==d.depth?0:d.pos<=(d.start(b+1)+d.end(b+1))/2?-1:1,f=d.index(b)+ +(c>0),g=d.node(b),h=!1;if(1==a)h=g.canReplace(f,f,e);else{let a=g.contentMatchAt(f).findWrapping(e.firstChild.type);h=a&&g.canReplaceWith(f,f,a[0])}if(h)return 0==c?d.pos:c<0?d.before(b+1):d.after(b+1)}return null}(a.state.doc,e.pos,f):e.pos;null==h&&(h=e.pos);let i=a.state.tr;if(g){let{node:a}=c;a?a.replace(i):i.deleteSelection()}let j=i.mapping.map(h),k=0==f.openStart&&0==f.openEnd&&1==f.content.childCount,l=i.doc;if(k?i.replaceRangeWith(j,j,f.content.firstChild):i.replaceRange(j,j,f),i.doc.eq(l))return;let m=i.doc.resolve(j);if(k&&hK.isSelectable(f.content.firstChild)&&m.nodeAfter&&m.nodeAfter.sameMarkup(f.content.firstChild))i.setSelection(new hK(m));else{let b=i.mapping.map(h);i.mapping.maps[i.mapping.maps.length-1].forEach((a,c,d,e)=>b=e),i.setSelection(kf(a,m,i.doc.resolve(b)))}a.focus(),a.dispatch(i.setMeta("uiEvent","drop"))}(a,b,a.dragging)}finally{a.dragging=null}},kD.focus=a=>{a.input.lastFocus=Date.now(),a.focused||(a.domObserver.stop(),a.dom.classList.add("ProseMirror-focused"),a.domObserver.start(),a.focused=!0,setTimeout(()=>{a.docView&&a.hasFocus()&&!a.domObserver.currentSelection.eq(a.domSelectionRange())&&j8(a)},20))},kD.blur=(a,b)=>{a.focused&&(a.domObserver.stop(),a.dom.classList.remove("ProseMirror-focused"),a.domObserver.start(),b.relatedTarget&&a.dom.contains(b.relatedTarget)&&a.domObserver.currentSelection.clear(),a.focused=!1)},kD.beforeinput=(a,b)=>{if(jv&&"deleteContentBackward"==b.inputType){a.domObserver.flushSoon();let{domChangeCount:b}=a.input;setTimeout(()=>{if(a.input.domChangeCount!=b||(a.dom.blur(),a.focus(),a.someProp("handleKeyDown",b=>b(a,je(8,"Backspace")))))return;let{$cursor:c}=a.state.selection;c&&c.pos>0&&a.dispatch(a.state.tr.delete(c.pos-1,c.pos).scrollIntoView())},50)}},kE)kD[a]=kE[a];function k1(a,b){if(a==b)return!0;for(let c in a)if(a[c]!==b[c])return!1;for(let c in b)if(!(c in a))return!1;return!0}class k2{constructor(a,b){this.toDOM=a,this.spec=b||k7,this.side=this.spec.side||0}map(a,b,c,d){let{pos:e,deleted:f}=a.mapResult(b.from+d,this.side<0?-1:1);return f?null:new k5(e-c,e-c,this)}valid(){return!0}eq(a){return this==a||a instanceof k2&&(this.spec.key&&this.spec.key==a.spec.key||this.toDOM==a.toDOM&&k1(this.spec,a.spec))}destroy(a){this.spec.destroy&&this.spec.destroy(a)}}class k3{constructor(a,b){this.attrs=a,this.spec=b||k7}map(a,b,c,d){let e=a.map(b.from+d,this.spec.inclusiveStart?-1:1)-c,f=a.map(b.to+d,this.spec.inclusiveEnd?1:-1)-c;return e>=f?null:new k5(e,f,this)}valid(a,b){return b.from<b.to}eq(a){return this==a||a instanceof k3&&k1(this.attrs,a.attrs)&&k1(this.spec,a.spec)}static is(a){return a.type instanceof k3}destroy(){}}class k4{constructor(a,b){this.attrs=a,this.spec=b||k7}map(a,b,c,d){let e=a.mapResult(b.from+d,1);if(e.deleted)return null;let f=a.mapResult(b.to+d,-1);return f.deleted||f.pos<=e.pos?null:new k5(e.pos-c,f.pos-c,this)}valid(a,b){let{index:c,offset:d}=a.content.findIndex(b.from),e;return d==b.from&&!(e=a.child(c)).isText&&d+e.nodeSize==b.to}eq(a){return this==a||a instanceof k4&&k1(this.attrs,a.attrs)&&k1(this.spec,a.spec)}destroy(){}}class k5{constructor(a,b,c){this.from=a,this.to=b,this.type=c}copy(a,b){return new k5(a,b,this.type)}eq(a,b=0){return this.type.eq(a.type)&&this.from+b==a.from&&this.to+b==a.to}map(a,b,c){return this.type.map(a,this,b,c)}static widget(a,b,c){return new k5(a,a,new k2(b,c))}static inline(a,b,c,d){return new k5(a,b,new k3(c,d))}static node(a,b,c,d){return new k5(a,b,new k4(c,d))}get spec(){return this.type.spec}get inline(){return this.type instanceof k3}get widget(){return this.type instanceof k2}}let k6=[],k7={};class k8{constructor(a,b){this.local=a.length?a:k6,this.children=b.length?b:k6}static create(a,b){return b.length?le(b,a,0,k7):k9}find(a,b,c){let d=[];return this.findInner(null==a?0:a,null==b?1e9:b,d,0,c),d}findInner(a,b,c,d,e){for(let f=0;f<this.local.length;f++){let g=this.local[f];g.from<=b&&g.to>=a&&(!e||e(g.spec))&&c.push(g.copy(g.from+d,g.to+d))}for(let f=0;f<this.children.length;f+=3)if(this.children[f]<b&&this.children[f+1]>a){let g=this.children[f]+1;this.children[f+2].findInner(a-g,b-g,c,d+g,e)}}map(a,b,c){return this==k9||0==a.maps.length?this:this.mapInner(a,b,0,0,c||k7)}mapInner(a,b,c,d,e){let f;for(let g=0;g<this.local.length;g++){let h=this.local[g].map(a,c,d);h&&h.type.valid(b,h)?(f||(f=[])).push(h):e.onRemove&&e.onRemove(this.local[g].spec)}return this.children.length?function(a,b,c,d,e,f,g){let h=a.slice();for(let a=0,b=f;a<c.maps.length;a++){let d=0;c.maps[a].forEach((a,c,e,f)=>{let g=f-e-(c-a);for(let e=0;e<h.length;e+=3){let f=h[e+1];if(f<0||a>f+b-d)continue;let i=h[e]+b-d;c>=i?h[e+1]=a<=i?-2:-1:a>=b&&g&&(h[e]+=g,h[e+1]+=g)}d+=g}),b=c.maps[a].map(b,-1)}let i=!1;for(let b=0;b<h.length;b+=3)if(h[b+1]<0){if(-2==h[b+1]){i=!0,h[b+1]=-1;continue}let j=c.map(a[b]+f),k=j-e;if(k<0||k>=d.content.size){i=!0;continue}let l=c.map(a[b+1]+f,-1)-e,{index:m,offset:n}=d.content.findIndex(k),o=d.maybeChild(m);if(o&&n==k&&n+o.nodeSize==l){let d=h[b+2].mapInner(c,o,j+1,a[b]+f+1,g);d!=k9?(h[b]=k,h[b+1]=l,h[b+2]=d):(h[b+1]=-2,i=!0)}else i=!0}if(i){let i=le(function(a,b,c,d,e,f,g){for(let h=0;h<a.length;h+=3)-1==a[h+1]&&function a(b,f){for(let a=0;a<b.local.length;a++){let h=b.local[a].map(d,e,f);h?c.push(h):g.onRemove&&g.onRemove(b.local[a].spec)}for(let c=0;c<b.children.length;c+=3)a(b.children[c+2],b.children[c]+f+1)}(a[h+2],b[h]+f+1);return c}(h,a,b,c,e,f,g),d,0,g);b=i.local;for(let a=0;a<h.length;a+=3)h[a+1]<0&&(h.splice(a,3),a-=3);for(let a=0,b=0;a<i.children.length;a+=3){let c=i.children[a];for(;b<h.length&&h[b]<c;)b+=3;h.splice(b,0,i.children[a],i.children[a+1],i.children[a+2])}}return new k8(b.sort(lf),h)}(this.children,f||[],a,b,c,d,e):f?new k8(f.sort(lf),k6):k9}add(a,b){return b.length?this==k9?k8.create(a,b):this.addInner(a,b,0):this}addInner(a,b,c){let d,e=0;a.forEach((a,f)=>{let g=f+c,h;if(h=lc(b,a,g)){for(d||(d=this.children.slice());e<d.length&&d[e]<f;)e+=3;d[e]==f?d[e+2]=d[e+2].addInner(a,h,g+1):d.splice(e,0,f,f+a.nodeSize,le(h,a,g+1,k7)),e+=3}});let f=lb(e?ld(b):b,-c);for(let b=0;b<f.length;b++)f[b].type.valid(a,f[b])||f.splice(b--,1);return new k8(f.length?this.local.concat(f).sort(lf):this.local,d||this.children)}remove(a){return 0==a.length||this==k9?this:this.removeInner(a,0)}removeInner(a,b){let c=this.children,d=this.local;for(let d=0;d<c.length;d+=3){let e,f=c[d]+b,g=c[d+1]+b;for(let b=0,c;b<a.length;b++)(c=a[b])&&c.from>f&&c.to<g&&(a[b]=null,(e||(e=[])).push(c));if(!e)continue;c==this.children&&(c=this.children.slice());let h=c[d+2].removeInner(e,f+1);h!=k9?c[d+2]=h:(c.splice(d,3),d-=3)}if(d.length){for(let c=0,e;c<a.length;c++)if(e=a[c])for(let a=0;a<d.length;a++)d[a].eq(e,b)&&(d==this.local&&(d=this.local.slice()),d.splice(a--,1))}return c==this.children&&d==this.local?this:d.length||c.length?new k8(d,c):k9}forChild(a,b){let c,d;if(this==k9)return this;if(b.isLeaf)return k8.empty;for(let b=0;b<this.children.length;b+=3)if(this.children[b]>=a){this.children[b]==a&&(c=this.children[b+2]);break}let e=a+1,f=e+b.content.size;for(let a=0;a<this.local.length;a++){let b=this.local[a];if(b.from<f&&b.to>e&&b.type instanceof k3){let a=Math.max(e,b.from)-e,c=Math.min(f,b.to)-e;a<c&&(d||(d=[])).push(b.copy(a,c))}}if(d){let a=new k8(d.sort(lf),k6);return c?new la([a,c]):a}return c||k9}eq(a){if(this==a)return!0;if(!(a instanceof k8)||this.local.length!=a.local.length||this.children.length!=a.children.length)return!1;for(let b=0;b<this.local.length;b++)if(!this.local[b].eq(a.local[b]))return!1;for(let b=0;b<this.children.length;b+=3)if(this.children[b]!=a.children[b]||this.children[b+1]!=a.children[b+1]||!this.children[b+2].eq(a.children[b+2]))return!1;return!0}locals(a){return lg(this.localsInner(a))}localsInner(a){if(this==k9)return k6;if(a.inlineContent||!this.local.some(k3.is))return this.local;let b=[];for(let a=0;a<this.local.length;a++)this.local[a].type instanceof k3||b.push(this.local[a]);return b}forEachSet(a){a(this)}}k8.empty=new k8([],[]),k8.removeOverlap=lg;let k9=k8.empty;class la{constructor(a){this.members=a}map(a,b){let c=this.members.map(c=>c.map(a,b,k7));return la.from(c)}forChild(a,b){if(b.isLeaf)return k8.empty;let c=[];for(let d=0;d<this.members.length;d++){let e=this.members[d].forChild(a,b);e!=k9&&(e instanceof la?c=c.concat(e.members):c.push(e))}return la.from(c)}eq(a){if(!(a instanceof la)||a.members.length!=this.members.length)return!1;for(let b=0;b<this.members.length;b++)if(!this.members[b].eq(a.members[b]))return!1;return!0}locals(a){let b,c=!0;for(let d=0;d<this.members.length;d++){let e=this.members[d].localsInner(a);if(e.length)if(b){c&&(b=b.slice(),c=!1);for(let a=0;a<e.length;a++)b.push(e[a])}else b=e}return b?lg(c?b:b.sort(lf)):k6}static from(a){switch(a.length){case 0:return k9;case 1:return a[0];default:return new la(a.every(a=>a instanceof k8)?a:a.reduce((a,b)=>a.concat(b instanceof k8?b:b.members),[]))}}forEachSet(a){for(let b=0;b<this.members.length;b++)this.members[b].forEachSet(a)}}function lb(a,b){if(!b||!a.length)return a;let c=[];for(let d=0;d<a.length;d++){let e=a[d];c.push(new k5(e.from+b,e.to+b,e.type))}return c}function lc(a,b,c){if(b.isLeaf)return null;let d=c+b.nodeSize,e=null;for(let b=0,f;b<a.length;b++)(f=a[b])&&f.from>c&&f.to<d&&((e||(e=[])).push(f),a[b]=null);return e}function ld(a){let b=[];for(let c=0;c<a.length;c++)null!=a[c]&&b.push(a[c]);return b}function le(a,b,c,d){let e=[],f=!1;b.forEach((b,g)=>{let h=lc(a,b,g+c);if(h){f=!0;let a=le(h,b,c+g+1,d);a!=k9&&e.push(g,g+b.nodeSize,a)}});let g=lb(f?ld(a):a,-c).sort(lf);for(let a=0;a<g.length;a++)g[a].type.valid(b,g[a])||(d.onRemove&&d.onRemove(g[a].spec),g.splice(a--,1));return g.length||e.length?new k8(g,e):k9}function lf(a,b){return a.from-b.from||a.to-b.to}function lg(a){let b=a;for(let c=0;c<b.length-1;c++){let d=b[c];if(d.from!=d.to)for(let e=c+1;e<b.length;e++){let f=b[e];if(f.from==d.from){f.to!=d.to&&(b==a&&(b=a.slice()),b[e]=f.copy(f.from,d.to),lh(b,e+1,f.copy(d.to,f.to)));continue}f.from<d.to&&(b==a&&(b=a.slice()),b[c]=d.copy(d.from,f.from),lh(b,e,d.copy(f.from,d.to)));break}}return b}function lh(a,b,c){for(;b<a.length&&lf(c,a[b])>0;)b++;a.splice(b,0,c)}function li(a){let b=[];return a.someProp("decorations",c=>{let d=c(a.state);d&&d!=k9&&b.push(d)}),a.cursorWrapper&&b.push(k8.create(a.state.doc,[a.cursorWrapper.deco])),la.from(b)}let lj={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},lk=jl&&jm<=11;class ll{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(a){this.anchorNode=a.anchorNode,this.anchorOffset=a.anchorOffset,this.focusNode=a.focusNode,this.focusOffset=a.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(a){return a.anchorNode==this.anchorNode&&a.anchorOffset==this.anchorOffset&&a.focusNode==this.focusNode&&a.focusOffset==this.focusOffset}}class lm{constructor(a,b){this.view=a,this.handleDOMChange=b,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new ll,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(b=>{for(let a=0;a<b.length;a++)this.queue.push(b[a]);jl&&jm<=11&&b.some(a=>"childList"==a.type&&a.removedNodes.length||"characterData"==a.type&&a.oldValue.length>a.target.nodeValue.length)?this.flushSoon():jr&&a.composing&&b.some(a=>"childList"==a.type&&"TR"==a.target.nodeName)?(a.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),lk&&(this.onCharData=a=>{this.queue.push({target:a.target,type:"characterData",oldValue:a.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,lj)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let a=this.observer.takeRecords();if(a.length){for(let b=0;b<a.length;b++)this.queue.push(a[b]);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(kg(this.view)){if(this.suppressingSelectionUpdates)return j8(this.view);if(jl&&jm<=11&&!this.view.state.selection.empty){let a=this.view.domSelectionRange();if(a.focusNode&&i8(a.focusNode,a.focusOffset,a.anchorNode,a.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(a){if(!a.focusNode)return!0;let b=new Set,c;for(let c=a.focusNode;c;c=i4(c))b.add(c);for(let d=a.anchorNode;d;d=i4(d))if(b.has(d)){c=d;break}let d=c&&this.view.docView.nearestDesc(c);if(d&&d.ignoreMutation({type:"selection",target:3==c.nodeType?c.parentNode:c}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let a of this.observer.takeRecords())this.queue.push(a);return this.queue}flush(){var a;let{view:b}=this;if(!b.docView||this.flushingSoon>-1)return;let c=this.pendingRecords();c.length&&(this.queue=[]);let d=b.domSelectionRange(),e=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(d)&&kg(b)&&!this.ignoreSelectionChange(d),f=-1,g=-1,h=!1,i=[];if(b.editable)for(let a=0;a<c.length;a++){let b=this.registerMutation(c[a],i);b&&(f=f<0?b.from:Math.min(b.from,f),g=g<0?b.to:Math.max(b.to,g),b.typeOver&&(h=!0))}if(i.some(a=>"BR"==a.nodeName)&&(8==b.input.lastKeyCode||46==b.input.lastKeyCode||jp&&(b.composing||b.input.compositionEndedAt>Date.now()-50)&&c.some(a=>"childList"==a.type&&a.removedNodes.length))){for(let a of i)if("BR"==a.nodeName&&a.parentNode){let b=a.nextSibling;for(;b&&1==b.nodeType;){if("false"==b.contentEditable){a.parentNode.removeChild(a);break}b=b.firstChild}}}else if(jn&&i.length){let a=i.filter(a=>"BR"==a.nodeName);if(2==a.length){let[b,c]=a;b.parentNode&&b.parentNode.parentNode==c.parentNode?c.remove():b.remove()}else{let{focusNode:c}=this.currentSelection;for(let d of a){let a=d.parentNode;a&&"LI"==a.nodeName&&(!c||function(a,b){for(let c=b.parentNode;c&&c!=a.dom;c=c.parentNode){let b=a.docView.nearestDesc(c,!0);if(b&&b.node.isBlock)return c}return null}(b,c)!=a)&&d.remove()}}}let j=null;f<0&&e&&b.input.lastFocus>Date.now()-200&&Math.max(b.input.lastTouch,b.input.lastClick.time)<Date.now()-300&&jd(d)&&(j=j6(b))&&j.eq(hE.near(b.state.doc.resolve(0),1))?(b.input.lastFocus=0,j8(b),this.currentSelection.set(d),b.scrollToSelection()):(f>-1||e)&&(f>-1&&(b.docView.markDirty(f,g),a=b,!ln.has(a)&&(ln.set(a,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(a.dom).whiteSpace))&&(a.requiresGeckoHackNode=jn,lo||(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."),lo=!0))),b.input.badSafariComposition&&(b.input.badSafariComposition=!1,function(a,b){var c;let{focusNode:d,focusOffset:e}=a.domSelectionRange();for(let f of b)if((null==(c=f.parentNode)?void 0:c.nodeName)=="TR"){let b=f.nextSibling;for(;b&&"TD"!=b.nodeName&&"TH"!=b.nodeName;)b=b.nextSibling;if(b){let c=b;for(;;){let a=c.firstChild;if(!a||1!=a.nodeType||"false"==a.contentEditable||/^(BR|IMG)$/.test(a.nodeName))break;c=a}c.insertBefore(f,c.firstChild),d==f&&a.domSelection().collapse(f,e)}else f.parentNode.removeChild(f)}}(b,i)),this.handleDOMChange(f,g,h,i),b.docView&&b.docView.dirty?b.updateState(b.state):this.currentSelection.eq(d)||j8(b),this.currentSelection.set(d))}registerMutation(a,b){if(b.indexOf(a.target)>-1)return null;let c=this.view.docView.nearestDesc(a.target);if("attributes"==a.type&&(c==this.view.docView||"contenteditable"==a.attributeName||"style"==a.attributeName&&!a.oldValue&&!a.target.getAttribute("style"))||!c||c.ignoreMutation(a))return null;if("childList"==a.type){for(let c=0;c<a.addedNodes.length;c++){let d=a.addedNodes[c];b.push(d),3==d.nodeType&&(this.lastChangedTextNode=d)}if(c.contentDOM&&c.contentDOM!=c.dom&&!c.contentDOM.contains(a.target))return{from:c.posBefore,to:c.posAfter};let d=a.previousSibling,e=a.nextSibling;if(jl&&jm<=11&&a.addedNodes.length)for(let b=0;b<a.addedNodes.length;b++){let{previousSibling:c,nextSibling:f}=a.addedNodes[b];(!c||0>Array.prototype.indexOf.call(a.addedNodes,c))&&(d=c),(!f||0>Array.prototype.indexOf.call(a.addedNodes,f))&&(e=f)}let f=d&&d.parentNode==a.target?i3(d)+1:0,g=c.localPosFromDOM(a.target,f,-1),h=e&&e.parentNode==a.target?i3(e):a.target.childNodes.length;return{from:g,to:c.localPosFromDOM(a.target,h,1)}}return"attributes"==a.type?{from:c.posAtStart-c.border,to:c.posAtEnd+c.border}:(this.lastChangedTextNode=a.target,{from:c.posAtStart,to:c.posAtEnd,typeOver:a.target.nodeValue==a.oldValue})}}let ln=new WeakMap,lo=!1;function lp(a,b){let c=b.startContainer,d=b.startOffset,e=b.endContainer,f=b.endOffset,g=a.domAtPos(a.state.selection.anchor);return i8(g.node,g.offset,e,f)&&([c,d,e,f]=[e,f,c,d]),{anchorNode:c,anchorOffset:d,focusNode:e,focusOffset:f}}let lq=/^(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 lr(a,b,c){return Math.max(c.anchor,c.head)>b.content.size?null:kf(a,b.resolve(c.anchor),b.resolve(c.head))}function ls(a,b,c){let d=a.depth,e=b?a.end():a.pos;for(;d>0&&(b||a.indexAfter(d)==a.node(d).childCount);)d--,e++,b=!1;if(c){let b=a.node(d).maybeChild(a.indexAfter(d));for(;b&&!b.isLeaf;)b=b.firstChild,e++}return e}class lt{constructor(a,b){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 kG,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=b,this.state=b.state,this.directPlugins=b.plugins||[],this.directPlugins.forEach(ly),this.dispatch=this.dispatch.bind(this),this.dom=a&&a.mount||document.createElement("div"),a&&(a.appendChild?a.appendChild(this.dom):"function"==typeof a?a(this.dom):a.mount&&(this.mounted=!0)),this.editable=lw(this),lv(this),this.nodeViews=lx(this),this.docView=jU(this.state.doc,lu(this),li(this),this.dom,this),this.domObserver=new lm(this,(a,b,c,d)=>(function(a,b,c,d,e){let f,g,h,i=a.input.compositionPendingChanges||(a.composing?a.input.compositionID:0);if(a.input.compositionPendingChanges=0,b<0){let b=a.input.lastSelectionTime>Date.now()-50?a.input.lastSelectionOrigin:null,c=j6(a,b);if(c&&!a.state.selection.eq(c)){if(jp&&jv&&13===a.input.lastKeyCode&&Date.now()-100<a.input.lastKeyCodeTime&&a.someProp("handleKeyDown",b=>b(a,je(13,"Enter"))))return;let d=a.state.tr.setSelection(c);"pointer"==b?d.setMeta("pointer",!0):"key"==b&&d.scrollIntoView(),i&&d.setMeta("composition",i),a.dispatch(d)}return}let j=a.state.doc.resolve(b),k=j.sharedDepth(c);b=j.before(k+1),c=a.state.doc.resolve(c).after(k+1);let l=a.state.selection,m=function(a,b,c,d){let e,f,{node:g,fromOffset:h,toOffset:i,from:j,to:k}=a.docView.parseRange(b,c),l=a.domSelectionRange(),m=l.anchorNode;if(m&&a.dom.contains(1==m.nodeType?m:m.parentNode)&&(f=[{node:m,offset:l.anchorOffset}],jd(l)||f.push({node:l.focusNode,offset:l.focusOffset})),jp&&8===a.input.lastKeyCode)for(let a=i;a>h;a--){let b=g.childNodes[a-1],c=b.pmViewDesc;if("BR"==b.nodeName&&!c){i=a;break}if(!c||c.size)break}let n=a.state.doc,o=a.someProp("domParser")||gS.fromSchema(a.state.schema),p=n.resolve(j),q=null,r=o.parse(g,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:h,to:i,preserveWhitespace:"pre"!=p.parent.type.whitespace||"full",findPositions:f,ruleFromNode:(e=d,a=>{let b=a.pmViewDesc;if(b)return b.parseRule(e);if("BR"==a.nodeName&&a.parentNode){if(jr&&/^(ul|ol)$/i.test(a.parentNode.nodeName)){let a=document.createElement("div");return a.appendChild(document.createElement("li")),{skip:a}}else if(a.parentNode.lastChild==a||jr&&/^(tr|table)$/i.test(a.parentNode.nodeName))return{ignore:!0}}else if("IMG"==a.nodeName&&a.getAttribute("mark-placeholder"))return{ignore:!0};return null}),context:p});if(f&&null!=f[0].pos){let a=f[0].pos,b=f[1]&&f[1].pos;null==b&&(b=a),q={anchor:a+j,head:b+j}}return{doc:r,sel:q,from:j,to:k}}(a,b,c,e),n=a.state.doc,o=n.slice(m.from,m.to);8===a.input.lastKeyCode&&Date.now()-100<a.input.lastKeyCodeTime?(f=a.state.selection.to,g="end"):(f=a.state.selection.from,g="start"),a.input.lastKeyCode=null;let p=function(a,b,c,d,e){let f=a.findDiffStart(b,c),g=c+a.size,h=c+b.size;if(null==f)return null;let{a:i,b:j}=a.findDiffEnd(b,g,h);if("end"==e){let a=Math.max(0,f-Math.min(i,j));d-=i+a-f}if(i<f&&g<h){let a=d<=f&&d>=i?f-d:0;f-=a,j=f+(j-i),i=f}else if(j<f){let a=d<=f&&d>=j?f-d:0;f-=a,i=f+(i-j),j=f}return{start:f,endA:i,endB:j}}(o.content,m.doc.content,m.from,f,g);if(p&&a.input.domChangeCount++,(js&&a.input.lastIOSEnter>Date.now()-225||jv)&&e.some(a=>1==a.nodeType&&!lq.test(a.nodeName))&&(!p||p.endA>=p.endB)&&a.someProp("handleKeyDown",b=>b(a,je(13,"Enter")))){a.input.lastIOSEnter=0;return}if(!p)if(d&&l instanceof hI&&!l.empty&&l.$head.sameParent(l.$anchor)&&!a.composing&&!(m.sel&&m.sel.anchor!=m.sel.head))p={start:l.from,endA:l.to,endB:l.to};else{if(m.sel){let b=lr(a,a.state.doc,m.sel);if(b&&!b.eq(a.state.selection)){let c=a.state.tr.setSelection(b);i&&c.setMeta("composition",i),a.dispatch(c)}}return}a.state.selection.from<a.state.selection.to&&p.start==p.endB&&a.state.selection instanceof hI&&(p.start>a.state.selection.from&&p.start<=a.state.selection.from+2&&a.state.selection.from>=m.from?p.start=a.state.selection.from:p.endA<a.state.selection.to&&p.endA>=a.state.selection.to-2&&a.state.selection.to<=m.to&&(p.endB+=a.state.selection.to-p.endA,p.endA=a.state.selection.to)),jl&&jm<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>m.from&&" \xa0"==m.doc.textBetween(p.start-m.from-1,p.start-m.from+1)&&(p.start--,p.endA--,p.endB--);let q=m.doc.resolveNoCache(p.start-m.from),r=m.doc.resolveNoCache(p.endB-m.from),s=n.resolve(p.start),t=q.sameParent(r)&&q.parent.inlineContent&&s.end()>=p.endA;if((js&&a.input.lastIOSEnter>Date.now()-225&&(!t||e.some(a=>"DIV"==a.nodeName||"P"==a.nodeName))||!t&&q.pos<m.doc.content.size&&(!q.sameParent(r)||!q.parent.inlineContent)&&q.pos<r.pos&&!/\S/.test(m.doc.textBetween(q.pos,r.pos,"","")))&&a.someProp("handleKeyDown",b=>b(a,je(13,"Enter")))){a.input.lastIOSEnter=0;return}if(a.state.selection.anchor>p.start&&function(a,b,c,d,e){if(c-b<=e.pos-d.pos||ls(d,!0,!1)<e.pos)return!1;let f=a.resolve(b);if(!d.parent.isTextblock){let a=f.nodeAfter;return null!=a&&c==b+a.nodeSize}if(f.parentOffset<f.parent.content.size||!f.parent.isTextblock)return!1;let g=a.resolve(ls(f,!0,!0));return!(!g.parent.isTextblock||g.pos>c||ls(g,!0,!1)<c)&&d.parent.content.cut(d.parentOffset).eq(g.parent.content)}(n,p.start,p.endA,q,r)&&a.someProp("handleKeyDown",b=>b(a,je(8,"Backspace")))){jv&&jp&&a.domObserver.suppressSelectionUpdates();return}jp&&p.endB==p.start&&(a.input.lastChromeDelete=Date.now()),jv&&!t&&q.start()!=r.start()&&0==r.parentOffset&&q.depth==r.depth&&m.sel&&m.sel.anchor==m.sel.head&&m.sel.head==p.endA&&(p.endB-=2,r=m.doc.resolveNoCache(p.endB-m.from),setTimeout(()=>{a.someProp("handleKeyDown",function(b){return b(a,je(13,"Enter"))})},20));let u=p.start,v=p.endA,w=b=>{let c=b||a.state.tr.replace(u,v,m.doc.slice(p.start-m.from,p.endB-m.from));if(m.sel){let b=lr(a,c.doc,m.sel);b&&!(jp&&a.composing&&b.empty&&(p.start!=p.endB||a.input.lastChromeDelete<Date.now()-100)&&(b.head==u||b.head==c.mapping.map(v)-1)||jl&&b.empty&&b.head==u)&&c.setSelection(b)}return i&&c.setMeta("composition",i),c.scrollIntoView()};if(t)if(q.pos==r.pos){jl&&jm<=11&&0==q.parentOffset&&(a.domObserver.suppressSelectionUpdates(),setTimeout(()=>j8(a),20));let b=w(a.state.tr.delete(u,v)),c=n.resolve(p.start).marksAcross(n.resolve(p.endA));c&&b.ensureMarks(c),a.dispatch(b)}else if(p.endA==p.endB&&(h=function(a,b){let c=a.firstChild.marks,d=b.firstChild.marks,e=c,f=d,g,h,i;for(let a=0;a<d.length;a++)e=d[a].removeFromSet(e);for(let a=0;a<c.length;a++)f=c[a].removeFromSet(f);if(1==e.length&&0==f.length)h=e[0],g="add",i=a=>a.mark(h.addToSet(a.marks));else{if(0!=e.length||1!=f.length)return null;h=f[0],g="remove",i=a=>a.mark(h.removeFromSet(a.marks))}let j=[];for(let a=0;a<b.childCount;a++)j.push(i(b.child(a)));if(gi.from(j).eq(a))return{mark:h,type:g}}(q.parent.content.cut(q.parentOffset,r.parentOffset),s.parent.content.cut(s.parentOffset,p.endA-s.start())))){let b=w(a.state.tr);"add"==h.type?b.addMark(u,v,h.mark):b.removeMark(u,v,h.mark),a.dispatch(b)}else if(q.parent.child(q.index()).isText&&q.index()==r.index()-!r.textOffset){let b=q.parent.textBetween(q.parentOffset,r.parentOffset),c=()=>w(a.state.tr.insertText(b,u,v));a.someProp("handleTextInput",d=>d(a,u,v,b,c))||a.dispatch(c())}else a.dispatch(w());else a.dispatch(w())})(this,a,b,c,d)),this.domObserver.start(),function(a){for(let b in kD){let c=kD[b];a.dom.addEventListener(b,a.input.eventHandlers[b]=b=>{!function(a,b){if(!b.bubbles)return!0;if(b.defaultPrevented)return!1;for(let c=b.target;c!=a.dom;c=c.parentNode)if(!c||11==c.nodeType||c.pmViewDesc&&c.pmViewDesc.stopEvent(b))return!1;return!0}(a,b)||kJ(a,b)||!a.editable&&b.type in kE||c(a,b)},kF[b]?{passive:!0}:void 0)}jr&&a.dom.addEventListener("input",()=>null),kI(a)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let a=this._props;for(let b in this._props={},a)this._props[b]=a[b];this._props.state=this.state}return this._props}update(a){a.handleDOMEvents!=this._props.handleDOMEvents&&kI(this);let b=this._props;this._props=a,a.plugins&&(a.plugins.forEach(ly),this.directPlugins=a.plugins),this.updateStateInner(a.state,b)}setProps(a){let b={};for(let a in this._props)b[a]=this._props[a];for(let c in b.state=this.state,a)b[c]=a[c];this.update(b)}updateState(a){this.updateStateInner(a,this._props)}updateStateInner(a,b){var c,d,e;let f=this.state,g=!1,h=!1;a.storedMarks&&this.composing&&(kV(this),h=!0),this.state=a;let i=f.plugins!=a.plugins||this._props.plugins!=b.plugins;if(i||this._props.plugins!=b.plugins||this._props.nodeViews!=b.nodeViews){let a=lx(this);(function(a,b){let c=0,d=0;for(let d in a){if(a[d]!=b[d])return!0;c++}for(let a in b)d++;return c!=d})(a,this.nodeViews)&&(this.nodeViews=a,g=!0)}(i||b.handleDOMEvents!=this._props.handleDOMEvents)&&kI(this),this.editable=lw(this),lv(this);let j=li(this),k=lu(this),l=f.plugins==a.plugins||f.doc.eq(a.doc)?a.scrollToSelection>f.scrollToSelection?"to selection":"preserve":"reset",m=g||!this.docView.matchesNode(a.doc,k,j);(m||!a.selection.eq(f.selection))&&(h=!0);let n="preserve"==l&&h&&null==this.dom.style.overflowAnchor&&function(a){let b,c,d=a.dom.getBoundingClientRect(),e=Math.max(0,d.top);for(let f=(d.left+d.right)/2,g=e+1;g<Math.min(innerHeight,d.bottom);g+=5){let d=a.root.elementFromPoint(f,g);if(!d||d==a.dom||!a.dom.contains(d))continue;let h=d.getBoundingClientRect();if(h.top>=e-20){b=d,c=h.top;break}}return{refDOM:b,refTop:c,stack:jA(a.dom)}}(this);if(h){let b,c,h;this.domObserver.stop();let i=m&&(jl||jp)&&!this.composing&&!f.selection.empty&&!a.selection.empty&&(d=f.selection,e=a.selection,h=Math.min(d.$anchor.sharedDepth(d.head),e.$anchor.sharedDepth(e.head)),d.$anchor.start(h)!=e.$anchor.start(h));if(m){let b=jp?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=function(a){let b=a.domSelectionRange();if(!b.focusNode)return null;let c=function(a,b){for(;;){if(3==a.nodeType&&b)return a;if(1==a.nodeType&&b>0){if("false"==a.contentEditable)return null;b=jb(a=a.childNodes[b-1])}else{if(!a.parentNode||jc(a))return null;b=i3(a),a=a.parentNode}}}(b.focusNode,b.focusOffset),d=function(a,b){for(;;){if(3==a.nodeType&&b<a.nodeValue.length)return a;if(1==a.nodeType&&b<a.childNodes.length){if("false"==a.contentEditable)return null;a=a.childNodes[b],b=0}else{if(!a.parentNode||jc(a))return null;b=i3(a)+1,a=a.parentNode}}}(b.focusNode,b.focusOffset);if(c&&d&&c!=d){let b=d.pmViewDesc,e=a.domObserver.lastChangedTextNode;if(c==e||d==e)return e;if(!b||!b.isText(d.nodeValue))return d;if(a.input.compositionNode==d){let a=c.pmViewDesc;if(!(!a||!a.isText(c.nodeValue)))return d}}return c||d}(this)),(g||!this.docView.update(a.doc,k,j,this))&&(this.docView.updateOuterDeco(k),this.docView.destroy(),this.docView=jU(a.doc,k,j,this.dom,this)),!b||this.trackWrites&&this.dom.contains(this.trackWrites)||(i=!0)}let l=this.input.mouseDown;i||!(l&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&(b=this.docView.domFromPos(this.state.selection.anchor,0),c=this.domSelectionRange(),i8(b.node,b.offset,c.anchorNode,c.anchorOffset))&&l.delaySelUpdate())?j8(this,i):(kd(this,a.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(f),(null==(c=this.dragging)?void 0:c.node)&&!f.doc.eq(a.doc)&&this.updateDraggedNode(this.dragging,f),"reset"==l?this.dom.scrollTop=0:"to selection"==l?this.scrollToSelection():n&&function({refDOM:a,refTop:b,stack:c}){let d=a?a.getBoundingClientRect().top:0;jB(c,0==d?0:d-b)}(n)}scrollToSelection(){let a=this.domSelectionRange().focusNode;if(a&&this.dom.contains(1==a.nodeType?a:a.parentNode))if(this.someProp("handleScrollToSelection",a=>a(this)));else if(this.state.selection instanceof hK){let b=this.docView.domAfterPos(this.state.selection.from);1==b.nodeType&&jz(this,b.getBoundingClientRect(),a)}else jz(this,this.coordsAtPos(this.state.selection.head,1),a)}destroyPluginViews(){let a;for(;a=this.pluginViews.pop();)a.destroy&&a.destroy()}updatePluginViews(a){if(a&&a.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let b=0;b<this.pluginViews.length;b++){let c=this.pluginViews[b];c.update&&c.update(this,a)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let a=0;a<this.directPlugins.length;a++){let b=this.directPlugins[a];b.spec.view&&this.pluginViews.push(b.spec.view(this))}for(let a=0;a<this.state.plugins.length;a++){let b=this.state.plugins[a];b.spec.view&&this.pluginViews.push(b.spec.view(this))}}}updateDraggedNode(a,b){let c=a.node,d=-1;if(c.from<this.state.doc.content.size&&this.state.doc.nodeAt(c.from)==c.node)d=c.from;else{let a=c.from+(this.state.doc.content.size-b.doc.content.size);(a>0&&a<this.state.doc.content.size&&this.state.doc.nodeAt(a))==c.node&&(d=a)}this.dragging=new k$(a.slice,a.move,d<0?void 0:hK.create(this.state.doc,d))}someProp(a,b){let c=this._props&&this._props[a],d;if(null!=c&&(d=b?b(c):c))return d;for(let c=0;c<this.directPlugins.length;c++){let e=this.directPlugins[c].props[a];if(null!=e&&(d=b?b(e):e))return d}let e=this.state.plugins;if(e)for(let c=0;c<e.length;c++){let f=e[c].props[a];if(null!=f&&(d=b?b(f):f))return d}}hasFocus(){if(jl){let a=this.root.activeElement;if(a==this.dom)return!0;if(!a||!this.dom.contains(a))return!1;for(;a&&this.dom!=a&&this.dom.contains(a);){if("false"==a.contentEditable)return!1;a=a.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(a){if(a.setActive)return a.setActive();if(jC)return a.focus(jC);let b=jA(a);a.focus(null==jC?{get preventScroll(){return jC={preventScroll:!0},!0}}:void 0),jC||(jC=!1,jB(b,0))}(this.dom),j8(this),this.domObserver.start()}get root(){let a=this._root;if(null==a){for(let a=this.dom.parentNode;a;a=a.parentNode)if(9==a.nodeType||11==a.nodeType&&a.host)return a.getSelection||(Object.getPrototypeOf(a).getSelection=()=>a.ownerDocument.getSelection()),this._root=a}return a||document}updateRoot(){this._root=null}posAtCoords(a){return function(a,b){var c;let d,e,f=a.dom.ownerDocument,g,h=0,i=function(a,b,c){if(a.caretPositionFromPoint)try{let d=a.caretPositionFromPoint(b,c);if(d)return{node:d.offsetNode,offset:Math.min(jb(d.offsetNode),d.offset)}}catch(a){}if(a.caretRangeFromPoint){let d=a.caretRangeFromPoint(b,c);if(d)return{node:d.startContainer,offset:Math.min(jb(d.startContainer),d.startOffset)}}}(f,b.left,b.top);i&&({node:g,offset:h}=i);let j=(a.root.elementFromPoint?a.root:f).elementFromPoint(b.left,b.top);if(!j||!a.dom.contains(1!=j.nodeType?j.parentNode:j)){let c=a.dom.getBoundingClientRect();if(!jD(b,c)||!(j=function a(b,c,d){let e=b.childNodes.length;if(e&&d.top<d.bottom)for(let f=Math.max(0,Math.min(e-1,Math.floor(e*(c.top-d.top)/(d.bottom-d.top))-2)),g=f;;){let d=b.childNodes[g];if(1==d.nodeType){let b=d.getClientRects();for(let e=0;e<b.length;e++){let f=b[e];if(jD(c,f))return a(d,c,f)}}if((g=(g+1)%e)==f)break}return b}(a.dom,b,c)))return null}if(jr)for(let a=j;g&&a;a=i4(a))a.draggable&&(g=void 0);if(j=(d=(c=j).parentNode)&&/^li$/i.test(d.nodeName)&&b.left<c.getBoundingClientRect().left?d:c,g){let c;if(jn&&1==g.nodeType&&(h=Math.min(h,g.childNodes.length))<g.childNodes.length){let a=g.childNodes[h],c;"IMG"==a.nodeName&&(c=a.getBoundingClientRect()).right<=b.left&&c.bottom>b.top&&h++}jw&&h&&1==g.nodeType&&1==(c=g.childNodes[h-1]).nodeType&&"false"==c.contentEditable&&c.getBoundingClientRect().top>=b.top&&h--,g==a.dom&&h==g.childNodes.length-1&&1==g.lastChild.nodeType&&b.top>g.lastChild.getBoundingClientRect().bottom?e=a.state.doc.content.size:(0==h||1!=g.nodeType||"BR"!=g.childNodes[h-1].nodeName)&&(e=function(a,b,c,d){let e=-1;for(let c=b,f=!1;c!=a.dom;){let b=a.docView.nearestDesc(c,!0),g;if(!b)return null;if(1==b.dom.nodeType&&(b.node.isBlock&&b.parent||!b.contentDOM)&&((g=b.dom.getBoundingClientRect()).width||g.height)&&(b.node.isBlock&&b.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(b.dom.nodeName)&&(!f&&g.left>d.left||g.top>d.top?e=b.posBefore:(!f&&g.right<d.left||g.bottom<d.top)&&(e=b.posAfter),f=!0),!b.contentDOM&&e<0&&!b.node.isText))return(b.node.isBlock?d.top<(g.top+g.bottom)/2:d.left<(g.left+g.right)/2)?b.posBefore:b.posAfter;c=b.dom.parentNode}return e>-1?e:a.docView.posFromDOM(b,c,-1)}(a,g,h,b))}null==e&&(e=function(a,b,c){let{node:d,offset:e}=function a(b,c){let d,e,f,g=2e8,h,i=0,j=c.top,k=c.top;for(let a=b.firstChild,l=0;a;a=a.nextSibling,l++){let b;if(1==a.nodeType)b=a.getClientRects();else{if(3!=a.nodeType)continue;b=i6(a).getClientRects()}for(let m=0;m<b.length;m++){let n=b[m];if(n.top<=j&&n.bottom>=k){j=Math.max(n.bottom,j),k=Math.min(n.top,k);let b=n.left>c.left?n.left-c.left:n.right<c.left?c.left-n.right:0;if(b<g){f=a,g=b,h=b&&3==f.nodeType?{left:n.right<c.left?n.right:n.left,top:c.top}:c,1==a.nodeType&&b&&(i=l+ +(c.left>=(n.left+n.right)/2));continue}}else n.top>c.top&&!d&&n.left<=c.left&&n.right>=c.left&&(d=a,e={left:Math.max(n.left,Math.min(n.right,c.left)),top:n.top});!f&&(c.left>=n.right&&c.top>=n.top||c.left>=n.left&&c.top>=n.bottom)&&(i=l+1)}}return(!f&&d&&(f=d,h=e,g=0),f&&3==f.nodeType)?function(a,b){let c=a.nodeValue.length,d=document.createRange(),e;for(let f=0;f<c;f++){d.setEnd(a,f+1),d.setStart(a,f);let c=jF(d,1);if(c.top!=c.bottom&&jD(b,c)){e={node:a,offset:f+ +(b.left>=(c.left+c.right)/2)};break}}return d.detach(),e||{node:a,offset:0}}(f,h):!f||g&&1==f.nodeType?{node:b,offset:i}:a(f,h)}(b,c),f=-1;if(1==d.nodeType&&!d.firstChild){let a=d.getBoundingClientRect();f=a.left!=a.right&&c.left>(a.left+a.right)/2?1:-1}return a.docView.posFromDOM(d,e,f)}(a,j,b));let k=a.docView.nearestDesc(j,!0);return{pos:e,inside:k?k.posAtStart-k.border:-1}}(this,a)}coordsAtPos(a,b=1){return jH(this,a,b)}domAtPos(a,b=0){return this.docView.domFromPos(a,b)}nodeDOM(a){let b=this.docView.descAt(a);return b?b.nodeDOM:null}posAtDOM(a,b,c=-1){let d=this.docView.posFromDOM(a,b,c);if(null==d)throw RangeError("DOM position not inside the editor");return d}endOfTextblock(a,b){return function(a,b,c){let d,e;return jM==b&&jN==c?jO:(jM=b,jN=c,jO="up"==c||"down"==c?(d=b.selection,e="up"==c?d.$from:d.$to,jK(a,b,()=>{let{node:b}=a.docView.domFromPos(e.pos,"up"==c?-1:1);for(;;){let c=a.docView.nearestDesc(b,!0);if(!c)break;if(c.node.isBlock){b=c.contentDOM||c.dom;break}b=c.dom.parentNode}let d=jH(a,e.pos,1);for(let a=b.firstChild;a;a=a.nextSibling){let b;if(1==a.nodeType)b=a.getClientRects();else{if(3!=a.nodeType)continue;b=i6(a,0,a.nodeValue.length).getClientRects()}for(let a=0;a<b.length;a++){let e=b[a];if(e.bottom>e.top+1&&("up"==c?d.top-e.top>(e.bottom-d.top)*2:e.bottom-d.bottom>(d.bottom-e.top)*2))return!1}}return!0})):function(a,b,c){let{$head:d}=b.selection;if(!d.parent.isTextblock)return!1;let e=d.parentOffset,f=e==d.parent.content.size,g=a.domSelection();return g?jL.test(d.parent.textContent)&&g.modify?jK(a,b,()=>{let{focusNode:b,focusOffset:e,anchorNode:f,anchorOffset:h}=a.domSelectionRange(),i=g.caretBidiLevel;g.modify("move",c,"character");let j=d.depth?a.docView.domAfterPos(d.before()):a.dom,{focusNode:k,focusOffset:l}=a.domSelectionRange(),m=k&&!j.contains(1==k.nodeType?k:k.parentNode)||b==k&&e==l;try{g.collapse(f,h),b&&(b!=f||e!=h)&&g.extend&&g.extend(b,e)}catch(a){}return null!=i&&(g.caretBidiLevel=i),m}):"left"==c||"backward"==c?!e:f:d.pos==d.start()||d.pos==d.end()}(a,b,c))}(this,b||this.state,a)}pasteHTML(a,b){return kY(this,"",a,!1,b||new ClipboardEvent("paste"))}pasteText(a,b){return kY(this,a,null,!0,b||new ClipboardEvent("paste"))}serializeForClipboard(a){return ku(this,a)}destroy(){if(this.docView){for(let a in this.input.mouseDown&&this.input.mouseDown.done(),this.domObserver.stop(),this.input.eventHandlers)this.dom.removeEventListener(a,this.input.eventHandlers[a]);clearTimeout(this.input.composingTimeout),clearTimeout(this.input.lastIOSEnterFallbackTimeout),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],li(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,i7()}}get isDestroyed(){return null==this.docView}dispatchEvent(a){!kJ(this,a)&&kD[a.type]&&(this.editable||!(a.type in kE))&&kD[a.type](this,a)}domSelectionRange(){let a=this.domSelection();return a?jr&&11===this.root.nodeType&&function(a){let b=a.activeElement;for(;b&&b.shadowRoot;)b=b.shadowRoot.activeElement;return b}(this.dom.ownerDocument)==this.dom&&function(a,b){let c;if(b.getComposedRanges){let c=b.getComposedRanges(a.root)[0];if(c)return lp(a,c)}function d(a){a.preventDefault(),a.stopImmediatePropagation(),c=a.getTargetRanges()[0]}return a.dom.addEventListener("beforeinput",d,!0),document.execCommand("indent"),a.dom.removeEventListener("beforeinput",d,!0),c?lp(a,c):null}(this,a)||a:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function lu(a){let b=Object.create(null);return b.class="ProseMirror",b.contenteditable=String(a.editable),a.someProp("attributes",c=>{if("function"==typeof c&&(c=c(a.state)),c)for(let a in c)"class"==a?b.class+=" "+c[a]:"style"==a?b.style=(b.style?b.style+";":"")+c[a]:b[a]||"contenteditable"==a||"nodeName"==a||(b[a]=String(c[a]))}),b.translate||(b.translate="no"),[k5.node(0,a.state.doc.content.size,b)]}function lv(a){if(a.markCursor){let b=document.createElement("img");b.className="ProseMirror-separator",b.setAttribute("mark-placeholder","true"),b.setAttribute("alt",""),a.cursorWrapper={dom:b,deco:k5.widget(a.state.selection.from,b,{raw:!0,marks:a.markCursor})}}else a.cursorWrapper=null}function lw(a){return!a.someProp("editable",b=>!1===b(a.state))}function lx(a){let b=Object.create(null);function c(a){for(let c in a)Object.prototype.hasOwnProperty.call(b,c)||(b[c]=a[c])}return a.someProp("nodeViews",c),a.someProp("markViews",c),b}function ly(a){if(a.spec.state||a.spec.filterTransaction||a.spec.appendTransaction)throw RangeError("Plugins passed directly to the view must not have a state component")}function lz(a,b){return a.meta={package:"@milkdown/core",group:"System",...b},a}lt.prototype.dispatch=function(a){let b=this._props.dispatchTransaction;b?b.call(this,a):this.updateState(this.state.apply(a))};var lA={text:(a,b,c,d)=>{let e=a.value;return/^[^*_\\]*\s+$/.test(e)?e:c.safe(e,{...d,encode:[]})},strong:(a,b,c,d)=>{let e=a.marker||c.options.strong||"*",f=c.enter("strong"),g=c.createTracker(d),h=g.move(e+e);return h+=g.move(c.containerPhrasing(a,{before:h,after:e,...g.current()})),h+=g.move(e+e),f(),h},emphasis:(a,b,c,d)=>{let e=a.marker||c.options.emphasis||"*",f=c.enter("emphasis"),g=c.createTracker(d),h=g.move(e);return h+=g.move(c.containerPhrasing(a,{before:h,after:e,...g.current()})),h+=g.move(e),f(),h}},lB=dx({},"editorView"),lC=dx({},"editorState"),lD=dx([],"initTimer"),lE=dx({},"editor"),lF=dx([],"inputRules"),lG=dx([],"prosePlugins"),lH=dx([],"remarkPlugins"),lI=dx([],"nodeView"),lJ=dx([],"markView"),lK=dx(f8().use(e6).use(fT),"remark"),lL=dx({handlers:lA,encode:[]},"remarkStringifyOptions"),lM=dD("ConfigReady"),lN=dD("InitReady"),lO=dD("SchemaReady"),lP=dx([],"schemaTimer"),lQ=dx({},"schema"),lR=dx([],"nodes"),lS=dx([],"marks");function lT(a){return{...a,parseDOM:a.parseDOM?.map(b=>({priority:a.priority,...b}))}}var lU=a=>(a.inject(lQ,{}).inject(lR,[]).inject(lS,[]).inject(lP,[lN]).record(lO),async()=>{await a.waitTimers(lP);let b=a.get(lK),c=a.get(lH).reduce((a,b)=>a.use(b.plugin,b.options),b);a.set(lK,c);let d=new gQ({nodes:Object.fromEntries(a.get(lR).map(([a,b])=>[a,lT(b)])),marks:Object.fromEntries(a.get(lS).map(([a,b])=>[a,lT(b)]))});return a.set(lQ,d),a.done(lO),()=>{a.remove(lQ).remove(lR).remove(lS).remove(lP).clearTimer(lO)}});lz(lU,{displayName:"Schema"});var lV=class{constructor(){this.#e=new du,this.#K=null,this.setCtx=a=>{this.#K=a},this.chain=()=>{if(null==this.#K)throw dt();let a=this.#K,b=[],c=this.get.bind(this),d={run:()=>{let c=ie(...b),d=a.get(lB);return c(d.state,d.dispatch,d)},inline:a=>(b.push(a),d),pipe:(function(a,e){let f=c(a);return b.push(f(e)),d}).bind(this)};return d}}#e;#K;get ctx(){return this.#K}create(a,b){let c=a.create(this.#e.sliceMap);return c.set(b),c}get(a){return this.#e.get(a).get()}remove(a){return this.#e.remove(a)}call(a,b){if(null==this.#K)throw dt();let c=this.get(a)(b),d=this.#K.get(lB);return c(d.state,d.dispatch,d)}inline(a){if(null==this.#K)throw dt();let b=this.#K.get(lB);return a(b.state,b.dispatch,b)}},lW=dx(new lV,"commands"),lX=dx([lO],"commandsTimer"),lY=dD("CommandsReady"),lZ=a=>{let b=new lV;return b.setCtx(a),a.inject(lW,b).inject(lX,[lO]).record(lY),async()=>(await a.waitTimers(lX),a.done(lY),()=>{a.remove(lW).remove(lX).clearTimer(lY)})};lz(lZ,{displayName:"Commands"});var l$=class{constructor(){this.#K=null,this.#L=[],this.setCtx=a=>{this.#K=a},this.add=a=>(this.#L.push(a),()=>{this.#L=this.#L.filter(b=>b!==a)}),this.addObjectKeymap=a=>{let b=[];return Object.entries(a).forEach(([a,c])=>{if("function"==typeof c){let d={key:a,onRun:()=>c};this.#L.push(d),b.push(()=>{this.#L=this.#L.filter(a=>a!==d)})}else this.#L.push(c),b.push(()=>{this.#L=this.#L.filter(a=>a!==c)})}),()=>{b.forEach(a=>a())}},this.addBaseKeymap=()=>{let a=function(a){return a.Backspace=ie(im,h$,h1,h3),a}(ik);return this.addObjectKeymap(a)},this.build=()=>{let a={};return this.#L.forEach(b=>{a[b.key]=[...a[b.key]||[],b]}),Object.fromEntries(Object.entries(a).map(([a,b])=>{let c=b.sort((a,b)=>(b.priority??50)-(a.priority??50));return[a,(a,b,d)=>{let e=this.#K;if(null==e)throw dq();return ie(...c.map(a=>a.onRun(e)))(a,b,d)}]}))}}#K;#L;get ctx(){return this.#K}},l_=dx(new l$,"keymap"),l0=dx([lO],"keymapTimer"),l1=dD("KeymapReady"),l2=a=>{let b=new l$;return b.setCtx(a),a.inject(l_,b).inject(l0,[lO]).record(l1),async()=>(await a.waitTimers(l0),a.done(l1),()=>{a.remove(l_).remove(l0).clearTimer(l1)})},l3=dD("ParserReady"),l4=()=>{throw dq()},l5=dx(l4,"parser"),l6=dx([],"parserTimer"),l7=a=>(a.inject(l5,l4).inject(l6,[lO]).record(l3),async()=>{await a.waitTimers(l6);let b=a.get(lK),c=a.get(lQ);return a.set(l5,i0.create(c,b)),a.done(l3),()=>{a.remove(l5).remove(l6).clearTimer(l3)}});lz(l7,{displayName:"Parser"});var l8=dD("SerializerReady"),l9=dx([],"serializerTimer"),ma=()=>{throw dq()},mb=dx(ma,"serializer"),mc=a=>(a.inject(mb,ma).inject(l9,[lO]).record(l8),async()=>{await a.waitTimers(l9);let b=a.get(lK),c=a.get(lQ);return a.set(mb,i2.create(c,b)),a.done(l8),()=>{a.remove(mb).remove(l9).clearTimer(l8)}});lz(mc,{displayName:"Serializer"});var md=dx("","defaultValue"),me=dx(a=>a,"stateOptions"),mf=dx([],"editorStateTimer"),mg=dD("EditorStateReady"),mh=new hZ("MILKDOWN_STATE_TRACKER"),mi=a=>(a.inject(md,"").inject(lC,{}).inject(me,a=>a).inject(mf,[l3,l8,lY,l1]).record(mg),async()=>{await a.waitTimers(mf);let b=a.get(lQ),c=a.get(l5),d=a.get(lF),e=a.get(me),f=a.get(lG),g=function(a,b,c){if("string"==typeof a)return b(a);if("html"===a.type)return gS.fromSchema(c).parse(a.dom);if("json"===a.type)return gB.fromJSON(c,a.value);throw new dm(dl.docTypeError,`Doc type error, unsupported type: ${dp(a)}`)}(a.get(md),c,b),h=a.get(l_),i=h.addBaseKeymap(),j=[...f,new hW({key:mh,state:{init:()=>{},apply:(b,c,d,e)=>{a.set(lC,e)}}}),function({rules:a}){let b=new hW({key:iL,isInputRules:!0,state:{init:()=>null,apply(a,b){let c=a.getMeta(this);return c||(a.selectionSet||a.docChanged?null:b)}},props:{handleTextInput:(c,d,e,f)=>iK(c,d,e,f,a,b),handleDOMEvents:{compositionend:c=>(setTimeout(()=>{let{$cursor:d}=c.state.selection;d&&iK(c,d.pos,d.pos,"",a,b)}),!1),keydown:(a,b)=>!!(iG&&iB&&"Enter"===b.key)&&!a.composing&&!!a.someProp("handleKeyDown",c=>c(a,b))&&(b.preventDefault(),!0)},handleKeyDown(c,d){if("Enter"!==d.key)return!1;let{$cursor:e}=c.state.selection;return!!e&&iK(c,e.pos,e.pos,"\n",a,b)}}});return b}({rules:d}),new hW({props:{handleKeyDown:function(a){let b=function(a){let b=Object.create(null);for(let c in a)b[function(a){let b,c,d,e,f=a.split(/-(?!$)/),g=f[f.length-1];"Space"==g&&(g=" ");for(let a=0;a<f.length-1;a++){let g=f[a];if(/^(cmd|meta|m)$/i.test(g))e=!0;else if(/^a(lt)?$/i.test(g))b=!0;else if(/^(c|ctrl|control)$/i.test(g))c=!0;else if(/^s(hift)?$/i.test(g))d=!0;else if(/^mod$/i.test(g))iW?e=!0:c=!0;else throw Error("Unrecognized modifier name: "+g)}return b&&(g="Alt-"+g),c&&(g="Ctrl-"+g),e&&(g="Meta-"+g),d&&(g="Shift-"+g),g}(c)]=a[c];return b}(a);return function(a,c){var d;let e=("Esc"==(d=!(iS&&c.metaKey&&c.shiftKey&&!c.ctrlKey&&!c.altKey||iT&&c.shiftKey&&c.key&&1==c.key.length||"Unidentified"==c.key)&&c.key||(c.shiftKey?iR:iQ)[c.keyCode]||c.key||"Unidentified")&&(d="Escape"),"Del"==d&&(d="Delete"),"Left"==d&&(d="ArrowLeft"),"Up"==d&&(d="ArrowUp"),"Right"==d&&(d="ArrowRight"),"Down"==d&&(d="ArrowDown"),d),f,g=b[iY(e,c)];if(g&&g(a.state,a.dispatch,a))return!0;if(1==e.length&&" "!=e){if(c.shiftKey){let d=b[iY(e,c,!1)];if(d&&d(a.state,a.dispatch,a))return!0}if((c.altKey||c.metaKey||c.ctrlKey)&&!(iX&&c.ctrlKey&&c.altKey)&&(f=iQ[c.keyCode])&&f!=e){let d=b[iY(f,c)];if(d&&d(a.state,a.dispatch,a))return!0}}return!1}}(h.build())}})];a.set(lG,j);let k=e({schema:b,doc:g,plugins:j}),l=hV.create(k);return a.set(lC,l),a.done(mg),()=>{i(),a.remove(md).remove(lC).remove(me).remove(mf).clearTimer(mg)}});lz(mi,{displayName:"EditorState"});var mj=dx([],"pasteRule"),mk=dx([lO],"pasteRuleTimer"),ml=dD("PasteRuleReady"),mm=a=>(a.inject(mj,[]).inject(mk,[lO]).record(ml),async()=>(await a.waitTimers(mk),a.done(ml),()=>{a.remove(mj).remove(mk).clearTimer(ml)}));lz(mm,{displayName:"PasteRule"});var mn=dD("EditorViewReady"),mo=dx([],"editorViewTimer"),mp=dx({},"editorViewOptions"),mq=dx(null,"root"),mr=dx(null,"rootDOM"),ms=dx({},"rootAttrs"),mt=new hZ("MILKDOWN_VIEW_CLEAR"),mu=a=>(a.inject(mq,document.body).inject(lB,{}).inject(mp,{}).inject(mr,null).inject(ms,{}).inject(mo,[mg,ml]).record(mn),async()=>{await a.wait(lN);let b=a.get(mq)||document.body,c="string"==typeof b?document.querySelector(b):b;a.update(lG,b=>[new hW({key:mt,view:b=>{let d=c?function(a,b){let c=document.createElement("div");return c.className="milkdown",a.appendChild(c),b.set(mr,c),Object.entries(b.get(ms)).forEach(([a,b])=>c.setAttribute(a,b)),c}(c,a):void 0;return(()=>{if(d&&c){let a=b.dom;c.replaceChild(d,a),d.appendChild(a)}})(),{destroy:()=>{d?.parentNode&&d?.parentNode.replaceChild(b.dom,d),d?.remove()}}}}),...b]),await a.waitTimers(mo);let d=a.get(lC),e=a.get(mp),f=new lt(c,{state:d,nodeViews:Object.fromEntries(a.get(lI)),markViews:Object.fromEntries(a.get(lJ)),transformPasted:(b,c,d)=>(a.get(mj).sort((a,b)=>(b.priority??50)-(a.priority??50)).map(a=>a.run).forEach(a=>{b=a(b,c,d)}),b),...e});return!function(a){a.classList.add("editor"),a.setAttribute("role","textbox")}(f.dom),a.set(lB,f),a.done(mn),()=>{f?.destroy(),a.remove(mq).remove(lB).remove(mp).remove(mr).remove(ms).remove(mo).clearTimer(mn)}});lz(mu,{displayName:"EditorView"});var mv=class a{constructor(){this.#M=!1,this.#q="Idle",this.#N=[],this.#O=()=>void 0,this.#e=new du,this.#f=new dA,this.#P=new Map,this.#Q=new Map,this.#K=new dz(this.#e,this.#f),this.#R=()=>{let a=function(a){let b=b=>(b.record(lM),async()=>(await a(b),b.done(lM),()=>{b.clearTimer(lM)}));return lz(b,{displayName:"Config"}),b}(async a=>{await Promise.all(this.#N.map(b=>Promise.resolve(b(a))))}),b=[lU,l7,mc,lZ,l2,mm,mi,mu,function(a){let b=b=>(b.inject(lE,a).inject(lG,[]).inject(lH,[]).inject(lF,[]).inject(lI,[]).inject(lJ,[]).inject(lL,{handlers:lA,encode:[]}).inject(lK,f8().use(e6).use(fT)).inject(lD,[lM]).record(lN),async()=>{await b.waitTimers(lD);let a=b.get(lL);return b.set(lK,f8().use(e6).use(fT,a)),b.done(lN),()=>{b.remove(lE).remove(lG).remove(lH).remove(lF).remove(lI).remove(lJ).remove(lL).remove(lK).remove(lD).clearTimer(lN)}});return lz(b,{displayName:"Init"}),b}(this),a];this.#S(b,this.#Q)},this.#S=(a,b)=>{a.forEach(a=>{let c=this.#K.produce(this.#M?a.meta:void 0),d=a(c);b.set(a,{ctx:c,handler:d,cleanup:void 0})})},this.#T=(a,b=!1)=>Promise.all([a].flat().map(async a=>{let c=this.#P.get(a)?.cleanup;return(b?this.#P.delete(a):this.#P.set(a,{ctx:void 0,handler:void 0,cleanup:void 0}),"function"==typeof c)?c():c})),this.#U=async()=>{await Promise.all([...this.#Q.entries()].map(async([a,{cleanup:b}])=>"function"==typeof b?b():b)),this.#Q.clear()},this.#V=a=>{this.#q=a,this.#O(a)},this.#W=a=>[...a.entries()].map(async([b,c])=>{let{ctx:d,handler:e}=c;if(!e)return;let f=await e();a.set(b,{ctx:d,handler:e,cleanup:f})}),this.enableInspector=(a=!0)=>(this.#M=a,this),this.onStatusChange=a=>(this.#O=a,this),this.config=a=>(this.#N.push(a),this),this.removeConfig=a=>(this.#N=this.#N.filter(b=>b!==a),this),this.use=a=>{let b=[a].flat();return b.flat().forEach(a=>{this.#P.set(a,{ctx:void 0,handler:void 0,cleanup:void 0})}),"Created"===this.#q&&this.#S(b,this.#P),this},this.remove=async a=>"OnCreate"===this.#q?(console.warn("[Milkdown]: You are trying to remove plugins when the editor is creating, this is not recommended, please check your code."),new Promise(b=>{setTimeout(()=>{b(this.remove(a))},50)})):(await this.#T([a].flat(),!0),this),this.create=async()=>("OnCreate"===this.#q||("Created"===this.#q&&await this.destroy(),this.#V("OnCreate"),this.#R(),this.#S([...this.#P.keys()],this.#P),await Promise.all([this.#W(this.#Q),this.#W(this.#P)].flat()),this.#V("Created")),this),this.destroy=async(a=!1)=>"Destroyed"===this.#q||"OnDestroy"===this.#q?this:"OnCreate"===this.#q?new Promise(b=>{setTimeout(()=>{b(this.destroy(a))},50)}):(a&&(this.#N=[]),this.#V("OnDestroy"),await this.#T([...this.#P.keys()],a),await this.#U(),this.#V("Destroyed"),this),this.action=a=>a(this.#K),this.inspect=()=>this.#M?[...this.#Q.values(),...this.#P.values()].map(({ctx:a})=>a?.inspector?.read()).filter(a=>!!a):(console.warn("[Milkdown]: You are trying to collect inspection when inspector is disabled, please enable inspector by `editor.enableInspector()` first."),[])}static make(){return new a}#M;#q;#N;#O;#e;#f;#P;#Q;#K;#R;#S;#T;#U;#V;#W;get ctx(){return this.#K}get status(){return this.#q}};function mw(a){let b=0;for(;b<a.length;){let c=Math.min(b+65536,a.length);crypto.getRandomValues(a.subarray(b,c)),b=c}}function mx(a){if((a|=0)<0)throw RangeError("Wrong ID size");let b=Buffer.allocUnsafe(a);return mw(b),b}function my(a,b,c){let d=256-256%a.length;if(256===d){let d=a.length-1;return (e=b)=>{if(!e)return"";let f="";for(;;){let b=c(e),g=e;for(;g--;)if((f+=a[b[g]&d]).length>=e)return f}}}let e=Math.ceil(409.6*b/d);return (f=b)=>{if(!f)return"";let g="";for(;;){let b=c(e),h=e;for(;h--;)if(b[h]<d&&(g+=a[b[h]%a.length]).length>=f)return g}}}function mz(a,b=21){if("string"!=typeof a||!a||a.length>256)return my(a,b,mx);for(let c=0;c<a.length;c++)if(a.charCodeAt(c)>255)return my(a,b,mx);let c=Uint8Array.from(a,a=>a.charCodeAt(0)),d=a.length,e=(2<<31-Math.clz32(d-1|1))-1,f="",g=0,h=0;return (a=b)=>{if((a|=0)<0)throw RangeError("Wrong ID size");if(0===a)return"";if(g+a>f.length){let b=Math.max(h,a);h=Math.min(16*b,32768);let i=Buffer.allocUnsafe(b);if(e===d-1){mw(i);for(let a=0;a<b;a++)i[a]=c[i[a]&e]}else{let a=Buffer.allocUnsafe(Math.ceil(1.6*(e+1)*b/d)),f=0;for(;f<b;){mw(a);for(let g=0;g<a.length;g++){let h=a[g]&e;if(h<d&&(i[f++]=c[h],f===b))break}}}f=i.toString("latin1"),g=0}return g+=a,f.substring(g-a,g)}}function mA(a,b,c){let d=a.findIndex(([a])=>a===b);if(-1===d)return[...a,c];let e=a.slice();return e[d]=c,e}function mB(a,b){let c=function(a="cmdKey"){return dx(()=>()=>!1,a)}(a),d=e=>async()=>{d.key=c,await e.wait(lY);let f=b(e);return e.get(lW).create(c,f),d.run=b=>e.get(lW).call(a,b),()=>{e.get(lW).remove(c)}};return d}function mC(a){let b=c=>async()=>{await c.wait(lO);let d=a(c);return c.update(lF,a=>[...a,d]),b.inputRule=d,()=>{c.update(lF,a=>a.filter(a=>a!==d))}};return b}function mD(a,b){let c=d=>async()=>{let e=b(d);return d.update(lR,b=>mA(b,a,[a,e])),c.id=a,c.schema=e,()=>{d.update(lR,b=>b.filter(([b])=>b!==a))}};return c.type=b=>{let c=b.get(lQ).nodes[a];if(!c)throw new dm(dl.missingNodeInSchema,`Missing node in schema, milkdown cannot find "${a}" in schema.`);return c},c}function mE(a){let b,c=c=>async()=>(await c.wait(lO),b=a(c),c.update(lG,a=>[...a,b]),()=>{c.update(lG,a=>a.filter(a=>a!==b))});return c.plugin=()=>b,c.key=()=>b.spec.key,c}function mF(a,b){let c=dx(a,b),d=a=>(a.inject(c),()=>()=>{a.remove(c)});return d.key=c,d}function mG(a,b){let c=mF(b,a),d=mD(a,a=>a.get(c.key)(a)),e=[c,d];return e.id=d.id,e.node=d,e.type=a=>d.type(a),e.ctx=c,e.key=c.key,e.extendSchema=c=>mG(a,c(b)),e}function mH(a,b){let c=mF(b,a),d=function(a,b){let c=d=>async()=>{let e=b(d);return d.update(lS,b=>mA(b,a,[a,e])),c.id=a,c.schema=e,()=>{d.update(lS,b=>b.filter(([b])=>b!==a))}};return c.type=b=>{let c=b.get(lQ).marks[a];if(!c)throw new dm(dl.missingMarkInSchema,`Missing mark in schema, milkdown cannot find "${a}" in schema.`);return c},c}(a,a=>a.get(c.key)(a)),e=[c,d];return e.id=d.id,e.mark=d,e.type=a=>d.type(a),e.ctx=c,e.key=c.key,e.extendSchema=c=>mH(a,c(b)),e}function mI(a,b){let c=mF(Object.fromEntries(Object.entries(b).map(([a,{shortcuts:b,priority:c}])=>[a,{shortcuts:b,priority:c}])),`${a}Keymap`),d=function(a){let b=c=>async()=>{await c.wait(l1);let d=c.get(l_),e=a(c),f=d.addObjectKeymap(e);return b.keymap=e,()=>{f()}};return b}(a=>{let d=a.get(c.key);return Object.fromEntries(Object.entries(b).flatMap(([a,{command:b}])=>{let c=d[a],e=[c.shortcuts].flat(),f=c.priority;return e.map(a=>[a,{key:a,onRun:b,priority:f}])}))}),e=[c,d];return e.ctx=c,e.shortcuts=d,e.key=c.key,e.keymap=d.keymap,e}mz("useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"),mz("abcedfghicklmn",10);var mJ=(a,b=()=>({}))=>mF(b,`${a}Attr`),mK=(a,b=()=>({}))=>mF(b,`${a}Attr`);function mL(a,b,c){let d=mF(c??{},a),e=a=>async()=>{await a.wait(lN);let c={plugin:b(a),options:a.get(d.key)};return a.update(lH,a=>[...a,c]),()=>{a.update(lH,a=>a.filter(a=>a!==c))}},f=[d,e];return f.id=a,f.plugin=e,f.options=d,f}function mM(a,b=!1){return c=>{let d=c.get(lB),e=c.get(l5)(a);if(!e)return;if(!b){let{state:a}=d;return d.dispatch(a.tr.replace(0,a.doc.content.size,new go(e.content,0,0)))}let f=c.get(lQ),g=c.get(me)({schema:f,doc:e,plugins:c.get(lG)}),h=hV.create(g);d.updateState(h)}}function mN(a){return String(a||"").toUpperCase()}function mO(){return function(a){let b=function(a){let b=new Map;if(!a||!a.type)throw Error("mdast-util-definitions expected node");return fp(a,"definition",function(a){let c=mN(a.identifier);c&&!b.get(c)&&b.set(c,a)}),function(a){let c=mN(a);return b.get(c)}}(a);fp(a,function(a,c,d){if("definition"===a.type&&void 0!==d&&"number"==typeof c)return d.children.splice(c,1),[fn,c];if("imageReference"===a.type||"linkReference"===a.type){let e=b(a.identifier);if(e&&d&&"number"==typeof c)return d.children[c]="imageReference"===a.type?{type:"image",url:e.url,title:e.title,alt:a.alt}:{type:"link",url:e.url,title:e.title,children:a.children},[fn,c]}})}}function mP(a,b){if(!(b.childCount>=1&&b.lastChild?.type.name==="hardbreak"))return void a.next(b.content);let c=[];b.content.forEach((a,d,e)=>{e!==b.childCount-1&&c.push(a)}),a.next(gi.fromArray(c))}function mQ(a,b){return Object.assign(a,{meta:{package:"@milkdown/preset-commonmark",...b}}),a}var mR=mK("emphasis");mQ(mR,{displayName:"Attr<emphasis>",group:"Emphasis"});var mS=mH("emphasis",a=>({attrs:{marker:{default:a.get(lL).emphasis||"*",validate:"string"}},parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style",getAttrs:a=>"italic"===a}],toDOM:b=>["em",a.get(mR.key)(b)],parseMarkdown:{match:a=>"emphasis"===a.type,runner:(a,b,c)=>{a.openMark(c,{marker:b.marker}),a.next(b.children),a.closeMark(c)}},toMarkdown:{match:a=>"emphasis"===a.type.name,runner:(a,b)=>{a.withMark(b,"emphasis",void 0,{marker:b.attrs.marker})}}}));mQ(mS.mark,{displayName:"MarkSchema<emphasis>",group:"Emphasis"}),mQ(mS.ctx,{displayName:"MarkSchemaCtx<emphasis>",group:"Emphasis"});var mT=mB("ToggleEmphasis",a=>()=>id(mS.type(a)));mQ(mT,{displayName:"Command<toggleEmphasisCommand>",group:"Emphasis"});var mU=mC(a=>iO(/(?:^|[^*])\*([^*]+)\*$/,mS.type(a),{getAttr:()=>({marker:"*"}),updateCaptured:({fullMatch:a,start:b})=>a.startsWith("*")?{}:{fullMatch:a.slice(1),start:b+1}}));mQ(mU,{displayName:"InputRule<emphasis>|Star",group:"Emphasis"});var mV=mC(a=>iO(/\b_(?![_\s])(.*?[^_\s])_$/,mS.type(a),{getAttr:()=>({marker:"_"}),updateCaptured:({fullMatch:a,start:b})=>a.startsWith("_")?{}:{fullMatch:a.slice(1),start:b+1}}));mQ(mV,{displayName:"InputRule<emphasis>|Underscore",group:"Emphasis"});var mW=mI("emphasisKeymap",{ToggleEmphasis:{shortcuts:"Mod-i",command:a=>{let b=a.get(lW);return()=>b.call(mT.key)}}});mQ(mW.ctx,{displayName:"KeymapCtx<emphasis>",group:"Emphasis"}),mQ(mW.shortcuts,{displayName:"Keymap<emphasis>",group:"Emphasis"});var mX=mK("strong");mQ(mX,{displayName:"Attr<strong>",group:"Strong"});var mY=mH("strong",a=>({attrs:{marker:{default:a.get(lL).strong||"*",validate:"string"}},parseDOM:[{tag:"b",getAttrs:a=>"normal"!=a.style.fontWeight&&null},{tag:"strong"},{style:"font-style",getAttrs:a=>"bold"===a},{style:"font-weight=400",clearMark:a=>"strong"==a.type.name},{style:"font-weight",getAttrs:a=>/^(bold(er)?|[5-9]\d{2,})$/.test(a)&&null}],toDOM:b=>["strong",a.get(mX.key)(b)],parseMarkdown:{match:a=>"strong"===a.type,runner:(a,b,c)=>{a.openMark(c,{marker:b.marker}),a.next(b.children),a.closeMark(c)}},toMarkdown:{match:a=>"strong"===a.type.name,runner:(a,b)=>{a.withMark(b,"strong",void 0,{marker:b.attrs.marker})}}}));mQ(mY.mark,{displayName:"MarkSchema<strong>",group:"Strong"}),mQ(mY.ctx,{displayName:"MarkSchemaCtx<strong>",group:"Strong"});var mZ=mB("ToggleStrong",a=>()=>id(mY.type(a)));mQ(mZ,{displayName:"Command<toggleStrongCommand>",group:"Strong"});var m$=mC(a=>iO(/(?<![\w:/])(?:\*\*|__)([^*_]+?)(?:\*\*|__)(?![\w/])$/,mY.type(a),{getAttr:a=>({marker:a[0].startsWith("*")?"*":"_"})}));mQ(m$,{displayName:"InputRule<strong>",group:"Strong"});var m_=mI("strongKeymap",{ToggleBold:{shortcuts:["Mod-b"],command:a=>{let b=a.get(lW);return()=>b.call(mZ.key)}}});mQ(m_.ctx,{displayName:"KeymapCtx<strong>",group:"Strong"}),mQ(m_.shortcuts,{displayName:"Keymap<strong>",group:"Strong"});var m0=mK("inlineCode");mQ(m0,{displayName:"Attr<inlineCode>",group:"InlineCode"});var m1=mH("inlineCode",a=>({priority:100,code:!0,inclusive:!1,parseDOM:[{tag:"code"}],toDOM:b=>["code",a.get(m0.key)(b)],parseMarkdown:{match:a=>"inlineCode"===a.type,runner:(a,b,c)=>{a.openMark(c),a.addText(b.value),a.closeMark(c)}},toMarkdown:{match:a=>"inlineCode"===a.type.name,runner:(a,b,c)=>(a.withMark(b,"inlineCode",c.text||""),!0)}}));mQ(m1.mark,{displayName:"MarkSchema<inlineCode>",group:"InlineCode"}),mQ(m1.ctx,{displayName:"MarkSchemaCtx<inlineCode>",group:"InlineCode"});var m2=mB("ToggleInlineCode",a=>()=>(b,c)=>{let{selection:d,tr:e}=b;if(d.empty)return!1;let{from:f,to:g}=d;return b.doc.rangeHasMark(f,g,m1.type(a))?c?.(e.removeMark(f,g,m1.type(a))):(Object.keys(b.schema.marks).filter(a=>a!==m1.type.name).map(a=>b.schema.marks[a]).forEach(a=>{e.removeMark(f,g,a)}),c?.(e.addMark(f,g,m1.type(a).create()))),!0});mQ(m2,{displayName:"Command<toggleInlineCodeCommand>",group:"InlineCode"});var m3=mC(a=>iO(/(?:`)([^`]+)(?:`)$/,m1.type(a)));mQ(m3,{displayName:"InputRule<inlineCodeInputRule>",group:"InlineCode"});var m4=mI("inlineCodeKeymap",{ToggleInlineCode:{shortcuts:"Mod-e",command:a=>{let b=a.get(lW);return()=>b.call(m2.key)}}});mQ(m4.ctx,{displayName:"KeymapCtx<inlineCode>",group:"InlineCode"}),mQ(m4.shortcuts,{displayName:"Keymap<inlineCode>",group:"InlineCode"});var m5=new Set(["http:","https:","mailto:","tel:","ftp:"]),m6=mK("link");mQ(m6,{displayName:"Attr<link>",group:"Link"});var m7=mH("link",a=>({attrs:{href:{validate:"string"},title:{default:null,validate:"string|null"}},parseDOM:[{tag:"a[href]",getAttrs:a=>{if(!(a instanceof HTMLElement))throw ds(a);return{href:a.getAttribute("href"),title:a.getAttribute("title")}}}],toDOM:b=>["a",{...a.get(m6.key)(b),...b.attrs,href:function(a){if("string"!=typeof a)return"";let b=a.trim();if(!b)return"";let c=function(a){let b="";for(let d of a){var c;(c=d.codePointAt(0)??0)<=32||c>=127&&c<=160||c>=8203&&c<=8205||8232===c||8233===c||65279===c||(b+=d)}return b}(b),d=/^([a-z][a-z0-9+.-]*):/i.exec(c)?.[1];return!d||m5.has(`${d.toLowerCase()}:`)?b:""}(b.attrs.href)}],parseMarkdown:{match:a=>"link"===a.type,runner:(a,b,c)=>{let d=b.url,e=b.title;a.openMark(c,{href:d,title:e}),a.next(b.children),a.closeMark(c)}},toMarkdown:{match:a=>"link"===a.type.name,runner:(a,b)=>{a.withMark(b,"link",void 0,{title:b.attrs.title,url:b.attrs.href})}}}));mQ(m7.mark,{displayName:"MarkSchema<link>",group:"Link"});var m8=mB("ToggleLink",a=>(b={})=>id(m7.type(a),b));mQ(m8,{displayName:"Command<toggleLinkCommand>",group:"Link"});var m9=mB("UpdateLink",a=>(b={})=>(c,d)=>{let e;if(!d)return!1;let f=-1,{selection:g}=c,{from:h,to:i}=g;if(c.doc.nodesBetween(h,h===i?i+1:i,(b,c)=>{if(m7.type(a).isInSet(b.marks))return e=b,f=c,!1}),!e)return!1;let j=e.marks.find(({type:b})=>b===m7.type(a));if(!j)return!1;let k=f,l=f+e.nodeSize,{tr:m}=c,n=m7.type(a).create({...j.attrs,...b});return!!n&&(d(m.removeMark(k,l,j).addMark(k,l,n).setSelection(new hI(m.selection.$anchor)).scrollIntoView()),!0)});mQ(m9,{displayName:"Command<updateLinkCommand>",group:"Link"});var na=mD("doc",()=>({content:"block+",parseMarkdown:{match:({type:a})=>"root"===a,runner:(a,b,c)=>{a.injectRoot(b,c)}},toMarkdown:{match:a=>"doc"===a.type.name,runner:(a,b)=>{a.openNode("root"),a.next(b.content)}}}));function nb(a){return fo(a,a=>"html"===a.type&&["<br />","<br>","<br >","<br/>"].includes(a.value?.trim()),(a,b)=>{if(!b.length)return;let c=b[b.length-1];if(!c)return;let d=c.children.indexOf(a);-1!==d&&c.children.splice(d,1)},!0)}mQ(na,{displayName:"NodeSchema<doc>",group:"Doc"});var nc=mL("remark-preserve-empty-line",()=>()=>nb);mQ(nc.plugin,{displayName:"Remark<remarkPreserveEmptyLine>",group:"Remark"}),mQ(nc.options,{displayName:"RemarkConfig<remarkPreserveEmptyLine>",group:"Remark"});var nd=mJ("paragraph");mQ(nd,{displayName:"Attr<paragraph>",group:"Paragraph"});var ne=mG("paragraph",a=>({content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM:b=>["p",a.get(nd.key)(b),0],parseMarkdown:{match:a=>"paragraph"===a.type,runner:(a,b,c)=>{a.openNode(c),b.children?a.next(b.children):a.addText(b.value||""),a.closeNode()}},toMarkdown:{match:a=>"paragraph"===a.type.name,runner:(b,c)=>{let d=a.get(lB).state?.doc.lastChild;b.openNode("paragraph"),(!c.content||0===c.content.size)&&c!==d&&function(a){let b=!1;try{a.get(nc.id),b=!0}catch{b=!1}return b}(a)?b.addNode("html",void 0,"<br />"):mP(b,c),b.closeNode()}}}));mQ(ne.node,{displayName:"NodeSchema<paragraph>",group:"Paragraph"}),mQ(ne.ctx,{displayName:"NodeSchemaCtx<paragraph>",group:"Paragraph"});var nf=mB("TurnIntoText",a=>()=>ic(ne.type(a)));mQ(nf,{displayName:"Command<turnIntoTextCommand>",group:"Paragraph"});var ng=mI("paragraphKeymap",{TurnIntoText:{shortcuts:"Mod-Alt-0",command:a=>{let b=a.get(lW);return()=>b.call(nf.key)}}});mQ(ng.ctx,{displayName:"KeymapCtx<paragraph>",group:"Paragraph"}),mQ(ng.shortcuts,{displayName:"Keymap<paragraph>",group:"Paragraph"});var nh=Array(6).fill(0).map((a,b)=>b+1),ni=mF(function(a){return a.textContent.toLowerCase().trim().replace(/\s+/g,"-")},"headingIdGenerator");mQ(ni,{displayName:"Ctx<HeadingIdGenerator>",group:"Heading"});var nj=mJ("heading");mQ(nj,{displayName:"Attr<heading>",group:"Heading"});var nk=mG("heading",a=>{let b=a.get(ni.key);return{content:"inline*",group:"block",defining:!0,attrs:{id:{default:"",validate:"string"},level:{default:1,validate:"number"}},parseDOM:nh.map(a=>({tag:`h${a}`,getAttrs:b=>{if(!(b instanceof HTMLElement))throw ds(b);return{level:a,id:b.id}}})),toDOM:c=>[`h${c.attrs.level}`,{...a.get(nj.key)(c),id:c.attrs.id||b(c)},0],parseMarkdown:{match:({type:a})=>"heading"===a,runner:(a,b,c)=>{let d=b.depth;a.openNode(c,{level:d}),a.next(b.children),a.closeNode()}},toMarkdown:{match:a=>"heading"===a.type.name,runner:(a,b)=>{a.openNode("heading",void 0,{depth:b.attrs.level}),mP(a,b),a.closeNode()}}}});mQ(nk.node,{displayName:"NodeSchema<heading>",group:"Heading"}),mQ(nk.ctx,{displayName:"NodeSchemaCtx<heading>",group:"Heading"});var nl=mC(a=>ip(/^(?<hashes>#+)\s$/,nk.type(a),b=>{let c=b.groups?.hashes?.length||0,{$from:d}=a.get(lB).state.selection,e=d.node();if("heading"===e.type.name){let a=Number(e.attrs.level)+Number(c);return a>6&&(a=6),{level:a}}return{level:c}}));mQ(nl,{displayName:"InputRule<wrapInHeadingInputRule>",group:"Heading"});var nm=mB("WrapInHeading",a=>b=>(b??=1)<1?ic(ne.type(a)):ic(nk.type(a),{level:b}));mQ(nm,{displayName:"Command<wrapInHeadingCommand>",group:"Heading"});var nn=mB("DowngradeHeading",a=>()=>(b,c,d)=>{let{$from:e}=b.selection,f=e.node();if(f.type!==nk.type(a)||!b.selection.empty||0!==e.parentOffset)return!1;let g=f.attrs.level-1;return g?(c?.(b.tr.setNodeMarkup(b.selection.$from.before(),void 0,{...f.attrs,level:g})),!0):ic(ne.type(a))(b,c,d)});mQ(nn,{displayName:"Command<downgradeHeadingCommand>",group:"Heading"});var no=mI("headingKeymap",{TurnIntoH1:{shortcuts:"Mod-Alt-1",command:a=>{let b=a.get(lW);return()=>b.call(nm.key,1)}},TurnIntoH2:{shortcuts:"Mod-Alt-2",command:a=>{let b=a.get(lW);return()=>b.call(nm.key,2)}},TurnIntoH3:{shortcuts:"Mod-Alt-3",command:a=>{let b=a.get(lW);return()=>b.call(nm.key,3)}},TurnIntoH4:{shortcuts:"Mod-Alt-4",command:a=>{let b=a.get(lW);return()=>b.call(nm.key,4)}},TurnIntoH5:{shortcuts:"Mod-Alt-5",command:a=>{let b=a.get(lW);return()=>b.call(nm.key,5)}},TurnIntoH6:{shortcuts:"Mod-Alt-6",command:a=>{let b=a.get(lW);return()=>b.call(nm.key,6)}},DowngradeHeading:{shortcuts:["Delete","Backspace"],command:a=>{let b=a.get(lW);return()=>b.call(nn.key)}}});mQ(no.ctx,{displayName:"KeymapCtx<heading>",group:"Heading"}),mQ(no.shortcuts,{displayName:"Keymap<heading>",group:"Heading"});var np=mJ("blockquote");mQ(np,{displayName:"Attr<blockquote>",group:"Blockquote"});var nq=mG("blockquote",a=>({content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM:b=>["blockquote",a.get(np.key)(b),0],parseMarkdown:{match:({type:a})=>"blockquote"===a,runner:(a,b,c)=>{a.openNode(c).next(b.children).closeNode()}},toMarkdown:{match:a=>"blockquote"===a.type.name,runner:(a,b)=>{a.openNode("blockquote").next(b.content).closeNode()}}}));mQ(nq.node,{displayName:"NodeSchema<blockquote>",group:"Blockquote"}),mQ(nq.ctx,{displayName:"NodeSchemaCtx<blockquote>",group:"Blockquote"});var nr=mC(a=>io(/^\s*>\s$/,nq.type(a)));mQ(nr,{displayName:"InputRule<wrapInBlockquoteInputRule>",group:"Blockquote"});var ns=mB("WrapInBlockquote",a=>()=>ib(nq.type(a)));mQ(ns,{displayName:"Command<wrapInBlockquoteCommand>",group:"Blockquote"});var nt=mI("blockquoteKeymap",{WrapInBlockquote:{shortcuts:"Mod-Shift-b",command:a=>{let b=a.get(lW);return()=>b.call(ns.key)}}});mQ(nt.ctx,{displayName:"KeymapCtx<blockquote>",group:"Blockquote"}),mQ(nt.shortcuts,{displayName:"Keymap<blockquote>",group:"Blockquote"});var nu=mJ("codeBlock",()=>({pre:{},code:{}}));mQ(nu,{displayName:"Attr<codeBlock>",group:"CodeBlock"});var nv=mG("code_block",a=>({content:"text*",group:"block",marks:"",defining:!0,code:!0,attrs:{language:{default:"",validate:"string"}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:a=>{if(!(a instanceof HTMLElement))throw ds(a);return{language:a.dataset.language}}}],toDOM:b=>{let c=a.get(nu.key)(b),d=b.attrs.language,e=d&&d.length>0?{"data-language":d}:void 0;return["pre",{...c.pre,...e},["code",c.code,0]]},parseMarkdown:{match:({type:a})=>"code"===a,runner:(a,b,c)=>{let d=b.lang??"",e=b.value;a.openNode(c,{language:d}),e&&a.addText(e),a.closeNode()}},toMarkdown:{match:a=>"code_block"===a.type.name,runner:(a,b)=>{a.addNode("code",void 0,b.content.firstChild?.text||"",{lang:b.attrs.language})}}}));mQ(nv.node,{displayName:"NodeSchema<codeBlock>",group:"CodeBlock"}),mQ(nv.ctx,{displayName:"NodeSchemaCtx<codeBlock>",group:"CodeBlock"});var nw=mC(a=>ip(/^```(?<language>[a-z]*)?[\s\n]$/,nv.type(a),a=>({language:a.groups?.language??""})));mQ(nw,{displayName:"InputRule<createCodeBlockInputRule>",group:"CodeBlock"});var nx=mB("CreateCodeBlock",a=>(b="")=>ic(nv.type(a),{language:b}));mQ(nx,{displayName:"Command<createCodeBlockCommand>",group:"CodeBlock"}),mQ(mB("UpdateCodeBlockLanguage",()=>({pos:a,language:b}={pos:-1,language:""})=>(c,d)=>a>=0&&(d?.(c.tr.setNodeAttribute(a,"language",b)),!0)),{displayName:"Command<updateCodeBlockLanguageCommand>",group:"CodeBlock"});var ny=mI("codeBlockKeymap",{CreateCodeBlock:{shortcuts:"Mod-Alt-c",command:a=>{let b=a.get(lW);return()=>b.call(nx.key)}}});mQ(ny.ctx,{displayName:"KeymapCtx<codeBlock>",group:"CodeBlock"}),mQ(ny.shortcuts,{displayName:"Keymap<codeBlock>",group:"CodeBlock"});var nz=mJ("image");mQ(nz,{displayName:"Attr<image>",group:"Image"});var nA=mG("image",a=>({inline:!0,group:"inline",selectable:!0,draggable:!0,marks:"",atom:!0,defining:!0,isolating:!0,attrs:{src:{default:"",validate:"string"},alt:{default:"",validate:"string"},title:{default:"",validate:"string"}},parseDOM:[{tag:"img[src]",getAttrs:a=>{if(!(a instanceof HTMLElement))throw ds(a);return{src:a.getAttribute("src")||"",alt:a.getAttribute("alt")||"",title:a.getAttribute("title")||a.getAttribute("alt")||""}}}],toDOM:b=>["img",{...a.get(nz.key)(b),...b.attrs}],parseMarkdown:{match:({type:a})=>"image"===a,runner:(a,b,c)=>{let d=b.url,e=b.alt,f=b.title;a.addNode(c,{src:d,alt:e,title:f})}},toMarkdown:{match:a=>"image"===a.type.name,runner:(a,b)=>{a.addNode("image",void 0,void 0,{title:b.attrs.title,url:b.attrs.src,alt:b.attrs.alt})}}}));mQ(nA.node,{displayName:"NodeSchema<image>",group:"Image"}),mQ(nA.ctx,{displayName:"NodeSchemaCtx<image>",group:"Image"});var nB=mB("InsertImage",a=>(b={})=>(c,d)=>{if(!d)return!0;let{src:e="",alt:f="",title:g=""}=b,h=nA.type(a).create({src:e,alt:f,title:g});return!h||(d(c.tr.replaceSelectionWith(h).scrollIntoView()),!0)});mQ(nB,{displayName:"Command<insertImageCommand>",group:"Image"});var nC=mB("UpdateImage",a=>(b={})=>(c,d)=>{let e=function(a,b){if(!(a instanceof hK))return;let{node:c,$from:d}=a;if(Array.isArray(b)&&b.includes(c.type)||c.type===b)return{node:c,pos:d.pos,start:d.start(d.depth),depth:d.depth}}(c.selection,nA.type(a));if(!e)return!1;let{node:f,pos:g}=e,h={...f.attrs},{src:i,alt:j,title:k}=b;return void 0!==i&&(h.src=i),void 0!==j&&(h.alt=j),void 0!==k&&(h.title=k),d?.(c.tr.setNodeMarkup(g,void 0,h).scrollIntoView()),!0});mQ(nC,{displayName:"Command<updateImageCommand>",group:"Image"}),mQ(mC(a=>new il(/!\[(?<alt>.*?)]\((?<filename>.*?)\s*(?="|\))"?(?<title>[^"]+)?"?\)/,(b,c,d,e)=>{let[f,g,h="",i]=c;return f?b.tr.replaceWith(d,e,nA.type(a).create({src:h,alt:g,title:i})):null})),{displayName:"InputRule<insertImageInputRule>",group:"Image"});var nD=mJ("hardbreak",a=>({"data-type":"hardbreak","data-is-inline":a.attrs.isInline}));mQ(nD,{displayName:"Attr<hardbreak>",group:"Hardbreak"});var nE=mG("hardbreak",a=>({inline:!0,group:"inline",attrs:{isInline:{default:!1,validate:"boolean"}},selectable:!1,parseDOM:[{tag:"br"},{tag:'span[data-type="hardbreak"]',getAttrs:()=>({isInline:!0})}],toDOM:b=>b.attrs.isInline?["span",a.get(nD.key)(b)," "]:["br",a.get(nD.key)(b)],parseMarkdown:{match:({type:a})=>"break"===a,runner:(a,b,c)=>{a.addNode(c,{isInline:!!b.data?.isInline})}},leafText:()=>"\n",toMarkdown:{match:a=>"hardbreak"===a.type.name,runner:(a,b)=>{b.attrs.isInline?a.addNode("text",void 0,"\n"):a.addNode("break")}}}));mQ(nE.node,{displayName:"NodeSchema<hardbreak>",group:"Hardbreak"}),mQ(nE.ctx,{displayName:"NodeSchemaCtx<hardbreak>",group:"Hardbreak"});var nF=mB("InsertHardbreak",a=>()=>(b,c)=>{let{selection:d,tr:e}=b;if(!(d instanceof hI))return!1;if(d.empty){let a=d.$from.node();if(a.childCount>0&&a.lastChild?.type.name==="hardbreak")return c?.(e.replaceRangeWith(d.to-1,d.to,b.schema.node("paragraph")).setSelection(hE.near(e.doc.resolve(d.to))).scrollIntoView()),!0}return c?.(e.setMeta("hardbreak",!0).replaceSelectionWith(nE.type(a).create()).scrollIntoView()),!0});mQ(nF,{displayName:"Command<insertHardbreakCommand>",group:"Hardbreak"});var nG=mI("hardbreakKeymap",{InsertHardbreak:{shortcuts:"Shift-Enter",command:a=>{let b=a.get(lW);return()=>b.call(nF.key)}}});mQ(nG.ctx,{displayName:"KeymapCtx<hardbreak>",group:"Hardbreak"}),mQ(nG.shortcuts,{displayName:"Keymap<hardbreak>",group:"Hardbreak"});var nH=mJ("hr");mQ(nH,{displayName:"Attr<hr>",group:"Hr"});var nI=mG("hr",a=>({group:"block",parseDOM:[{tag:"hr"}],toDOM:b=>["hr",a.get(nH.key)(b)],parseMarkdown:{match:({type:a})=>"thematicBreak"===a,runner:(a,b,c)=>{a.addNode(c)}},toMarkdown:{match:a=>"hr"===a.type.name,runner:a=>{a.addNode("thematicBreak")}}}));mQ(nI.node,{displayName:"NodeSchema<hr>",group:"Hr"}),mQ(nI.ctx,{displayName:"NodeSchemaCtx<hr>",group:"Hr"});var nJ=mC(a=>new il(/^(?:---|___\s|\*\*\*\s)$/,(b,c,d,e)=>{let{tr:f}=b;return c[0]&&f.replaceWith(d-1,e,nI.type(a).create()),f}));mQ(nJ,{displayName:"InputRule<insertHrInputRule>",group:"Hr"});var nK=mB("InsertHr",a=>()=>(b,c)=>{if(!c)return!0;let d=ne.node.type(a).create(),{tr:e,selection:f}=b,{from:g}=f,h=nI.type(a).create();if(!h)return!0;let i=e.replaceSelectionWith(h).insert(g,d),j=hE.findFrom(i.doc.resolve(g),1,!0);return!j||(c(i.setSelection(j).scrollIntoView()),!0)});mQ(nK,{displayName:"Command<insertHrCommand>",group:"Hr"});var nL=mJ("bulletList");mQ(nL,{displayName:"Attr<bulletList>",group:"BulletList"});var nM=mG("bullet_list",a=>({content:"listItem+",group:"block",attrs:{spread:{default:!1,validate:"boolean"}},parseDOM:[{tag:"ul",getAttrs:a=>{if(!(a instanceof HTMLElement))throw ds(a);return{spread:"true"===a.dataset.spread}}}],toDOM:b=>["ul",{...a.get(nL.key)(b),"data-spread":b.attrs.spread},0],parseMarkdown:{match:({type:a,ordered:b})=>"list"===a&&!b,runner:(a,b,c)=>{let d=b.spread??!1;a.openNode(c,{spread:d}).next(b.children).closeNode()}},toMarkdown:{match:a=>"bullet_list"===a.type.name,runner:(a,b)=>{a.openNode("list",void 0,{ordered:!1,spread:b.attrs.spread}).next(b.content).closeNode()}}}));mQ(nM.node,{displayName:"NodeSchema<bulletList>",group:"BulletList"}),mQ(nM.ctx,{displayName:"NodeSchemaCtx<bulletList>",group:"BulletList"});var nN=mC(a=>io(/^\s*([-+*])\s$/,nM.type(a)));mQ(nN,{displayName:"InputRule<wrapInBulletListInputRule>",group:"BulletList"});var nO=mB("WrapInBulletList",a=>()=>ib(nM.type(a)));mQ(nO,{displayName:"Command<wrapInBulletListCommand>",group:"BulletList"});var nP=mI("bulletListKeymap",{WrapInBulletList:{shortcuts:"Mod-Alt-8",command:a=>{let b=a.get(lW);return()=>b.call(nO.key)}}});mQ(nP.ctx,{displayName:"KeymapCtx<bulletListKeymap>",group:"BulletList"}),mQ(nP.shortcuts,{displayName:"Keymap<bulletListKeymap>",group:"BulletList"});var nQ=mJ("orderedList");mQ(nQ,{displayName:"Attr<orderedList>",group:"OrderedList"});var nR=mG("ordered_list",a=>({content:"listItem+",group:"block",attrs:{order:{default:1,validate:"number"},spread:{default:!1,validate:"boolean"}},parseDOM:[{tag:"ol",getAttrs:a=>{if(!(a instanceof HTMLElement))throw ds(a);return{spread:"true"===a.dataset.spread,order:a.hasAttribute("start")?Number(a.getAttribute("start")):1}}}],toDOM:b=>["ol",{...a.get(nQ.key)(b),...1===b.attrs.order?{}:{start:b.attrs.order},"data-spread":b.attrs.spread},0],parseMarkdown:{match:({type:a,ordered:b})=>"list"===a&&!!b,runner:(a,b,c)=>{let d=b.spread??!0;a.openNode(c,{spread:d,order:b.start??1}).next(b.children).closeNode()}},toMarkdown:{match:a=>"ordered_list"===a.type.name,runner:(a,b)=>{a.openNode("list",void 0,{ordered:!0,start:b.attrs.order??1,spread:b.attrs.spread}),a.next(b.content),a.closeNode()}}}));mQ(nR.node,{displayName:"NodeSchema<orderedList>",group:"OrderedList"}),mQ(nR.ctx,{displayName:"NodeSchemaCtx<orderedList>",group:"OrderedList"});var nS=mC(a=>io(/^\s*(\d+)\.\s$/,nR.type(a),a=>({order:Number(a[1])}),(a,b)=>b.childCount+b.attrs.order===Number(a[1])));mQ(nS,{displayName:"InputRule<wrapInOrderedListInputRule>",group:"OrderedList"});var nT=mB("WrapInOrderedList",a=>()=>ib(nR.type(a)));mQ(nT,{displayName:"Command<wrapInOrderedListCommand>",group:"OrderedList"});var nU=mI("orderedListKeymap",{WrapInOrderedList:{shortcuts:"Mod-Alt-7",command:a=>{let b=a.get(lW);return()=>b.call(nT.key)}}});mQ(nU.ctx,{displayName:"KeymapCtx<orderedList>",group:"OrderedList"}),mQ(nU.shortcuts,{displayName:"Keymap<orderedList>",group:"OrderedList"});var nV=mJ("listItem");mQ(nV,{displayName:"Attr<listItem>",group:"ListItem"});var nW=mG("list_item",a=>({group:"listItem",content:"paragraph block*",attrs:{label:{default:"•",validate:"string"},listType:{default:"bullet",validate:"string"},spread:{default:!0,validate:"boolean"}},defining:!0,parseDOM:[{tag:"li",getAttrs:a=>{if(!(a instanceof HTMLElement))throw ds(a);return{label:a.dataset.label,listType:a.dataset.listType,spread:"true"===a.dataset.spread}}}],toDOM:b=>["li",{...a.get(nV.key)(b),"data-label":b.attrs.label,"data-list-type":b.attrs.listType,"data-spread":b.attrs.spread},0],parseMarkdown:{match:({type:a})=>"listItem"===a,runner:(a,b,c)=>{let d=null!=b.label?`${b.label}.`:"•",e=null!=b.label?"ordered":"bullet",f=b.spread??!0;a.openNode(c,{label:d,listType:e,spread:f}),a.next(b.children),a.closeNode()}},toMarkdown:{match:a=>"list_item"===a.type.name,runner:(a,b)=>{a.openNode("listItem",void 0,{spread:b.attrs.spread}),a.next(b.content),a.closeNode()}}}));mQ(nW.node,{displayName:"NodeSchema<listItem>",group:"ListItem"}),mQ(nW.ctx,{displayName:"NodeSchemaCtx<listItem>",group:"ListItem"});var nX=mB("SinkListItem",a=>()=>(function(a){return function(b,c){let{$from:d,$to:e}=b.selection,f=d.blockRange(e,b=>b.childCount>0&&b.firstChild.type==a);if(!f)return!1;let g=f.startIndex;if(0==g)return!1;let h=f.parent,i=h.child(g-1);if(i.type!=a)return!1;if(c){let d=i.lastChild&&i.lastChild.type==h.type,e=gi.from(d?a.create():null),g=new go(gi.from(a.create(null,gi.from(h.type.create(null,e)))),d?3:1,0),j=f.start,k=f.end;c(b.tr.step(new hg(j-(d?3:1),k,j,k,g,1,!0)).scrollIntoView())}return!0}})(nW.type(a)));mQ(nX,{displayName:"Command<sinkListItemCommand>",group:"ListItem"});var nY=mB("LiftListItem",a=>()=>(function(a){return function(b,c){let{$from:d,$to:e}=b.selection,f=d.blockRange(e,b=>b.childCount>0&&b.firstChild.type==a);return!!f&&(!c||(d.node(f.depth-1).type==a?function(a,b,c,d){let e=a.tr,f=d.end,g=d.$to.end(d.depth);f<g&&(e.step(new hg(f-1,g,f,g,new go(gi.from(c.create(null,d.parent.copy())),1,0),1,!0)),d=new gz(e.doc.resolve(d.$from.pos),e.doc.resolve(g),d.depth));let h=hj(d);if(null==h)return!1;e.lift(d,h);let i=e.doc.resolve(e.mapping.map(f,-1)-1);return hp(e.doc,i.pos)&&i.nodeBefore.type==i.nodeAfter.type&&e.join(i.pos),b(e.scrollIntoView()),!0}(b,c,a,f):function(a,b,c){let d=a.tr,e=c.parent;for(let a=c.end,b=c.endIndex-1,f=c.startIndex;b>f;b--)a-=e.child(b).nodeSize,d.delete(a-1,a+1);let f=d.doc.resolve(c.start),g=f.nodeAfter;if(d.mapping.map(c.end)!=c.start+f.nodeAfter.nodeSize)return!1;let h=0==c.startIndex,i=c.endIndex==e.childCount,j=f.node(-1),k=f.index(-1);if(!j.canReplace(k+ +!h,k+1,g.content.append(i?gi.empty:gi.from(e))))return!1;let l=f.pos,m=l+g.nodeSize;return d.step(new hg(l-!!h,m+ +!!i,l+1,m-1,new go((h?gi.empty:gi.from(e.copy(gi.empty))).append(i?gi.empty:gi.from(e.copy(gi.empty))),+!h,+!i),+!h)),b(d.scrollIntoView()),!0}(b,c,f)))}})(nW.type(a)));mQ(nY,{displayName:"Command<liftListItemCommand>",group:"ListItem"});var nZ=mB("SplitListItem",a=>()=>(function(a,b){return function(b,c){let{$from:d,$to:e,node:f}=b.selection;if(f&&f.isBlock||d.depth<2||!d.sameParent(e))return!1;let g=d.node(-1);if(g.type!=a)return!1;if(0==d.parent.content.size&&d.node(-1).childCount==d.indexAfter(-1)){if(3==d.depth||d.node(-3).type!=a||d.index(-2)!=d.node(-2).childCount-1)return!1;if(c){let e=gi.empty,f=d.index(-1)?1:d.index(-2)?2:3;for(let a=d.depth-f;a>=d.depth-3;a--)e=gi.from(d.node(a).copy(e));let g=d.indexAfter(-1)<d.node(-2).childCount?1:d.indexAfter(-2)<d.node(-3).childCount?2:3;e=e.append(gi.from(a.createAndFill()));let h=d.before(d.depth-(f-1)),i=b.tr.replace(h,d.after(-g),new go(e,4-f,0)),j=-1;i.doc.nodesBetween(h,i.doc.content.size,(a,b)=>{if(j>-1)return!1;a.isTextblock&&0==a.content.size&&(j=b+1)}),j>-1&&i.setSelection(hE.near(i.doc.resolve(j))),c(i.scrollIntoView())}return!0}let h=e.pos==d.end()?g.contentMatchAt(0).defaultType:null,i=b.tr.delete(d.pos,e.pos),j=h?[null,{type:h}]:void 0;return!!ho(i.doc,d.pos,2,j)&&(c&&c(i.split(d.pos,2,j).scrollIntoView()),!0)}})(nW.type(a)));mQ(nZ,{displayName:"Command<splitListItemCommand>",group:"ListItem"});var n$=mB("LiftFirstListItem",a=>()=>(b,c,d)=>{let{selection:e}=b;if(!(e instanceof hI))return!1;let{empty:f,$from:g}=e;return!!f&&0===g.parentOffset&&g.node(-1).type===nW.type(a)&&h0(b,c,d)});mQ(n$,{displayName:"Command<liftFirstListItemCommand>",group:"ListItem"});var n_=mI("listItemKeymap",{NextListItem:{shortcuts:"Enter",command:a=>{let b=a.get(lW);return()=>b.call(nZ.key)}},SinkListItem:{shortcuts:["Tab","Mod-]"],command:a=>{let b=a.get(lW);return()=>b.call(nX.key)}},LiftListItem:{shortcuts:["Shift-Tab","Mod-["],command:a=>{let b=a.get(lW);return()=>b.call(nY.key)}},LiftFirstListItem:{shortcuts:["Backspace","Delete"],command:a=>{let b=a.get(lW);return()=>b.call(n$.key)}}});mQ(n_.ctx,{displayName:"KeymapCtx<listItem>",group:"ListItem"}),mQ(n_.shortcuts,{displayName:"Keymap<listItem>",group:"ListItem"});var n0=mD("text",()=>({group:"inline",parseMarkdown:{match:({type:a})=>"text"===a,runner:(a,b)=>{a.addText(b.value)}},toMarkdown:{match:a=>"text"===a.type.name,runner:(a,b)=>{a.addNode("text",void 0,b.text)}}}));mQ(n0,{displayName:"NodeSchema<text>",group:"Text"});var n1=mJ("html");mQ(n1,{displayName:"Attr<html>",group:"Html"});var n2=mG("html",a=>({atom:!0,group:"inline",inline:!0,attrs:{value:{default:"",validate:"string"}},toDOM:b=>{let c=document.createElement("span"),d={...a.get(n1.key)(b),"data-value":b.attrs.value,"data-type":"html"};return c.textContent=b.attrs.value,["span",d,b.attrs.value]},parseDOM:[{tag:'span[data-type="html"]',getAttrs:a=>({value:a.dataset.value??""})}],parseMarkdown:{match:({type:a})=>"html"===a,runner:(a,b,c)=>{a.addNode(c,{value:b.value})}},toMarkdown:{match:a=>"html"===a.type.name,runner:(a,b)=>{a.addNode("html",void 0,b.attrs.value)}}}));mQ(n2.node,{displayName:"NodeSchema<html>",group:"Html"}),mQ(n2.ctx,{displayName:"NodeSchemaCtx<html>",group:"Html"});var n3=[na,nd,ne,ni,nj,nk,nD,nE,np,nq,nu,nv,nH,nI,nz,nA,nL,nM,nQ,nR,nV,nW,mR,mS,mX,mY,m0,m1,m6,m7,n1,n2,n0].flat(),n4=[nr,nN,nS,nw,nJ,nl].flat(),n5=[mU,mV,m3,m$],n6=[nf,ns,nm,nn,nx,nF,nK,nB,nC,nT,nO,nX,nZ,nY,n$,mT,m2,mZ,m8,m9,mB("IsMarkSelected",()=>a=>b=>{if(!a)return!1;let{doc:c,selection:d}=b;return c.rangeHasMark(d.from,d.to,a)}),mB("IsNoteSelected",()=>a=>b=>!!a&&((a,b)=>{let{selection:c,doc:d}=a;if(c instanceof hK)return{hasNode:c.node.type===b,pos:c.from,target:c.node};let{from:e,to:f}=c,g=!1,h=-1,i=null;return d.nodesBetween(e,f,(a,c)=>!i&&(a.type!==b||(g=!0,h=c,i=a,!1))),{hasNode:g,pos:h,target:i}})(b,a).hasNode),mB("ClearTextInCurrentBlock",()=>()=>(a,b)=>{let c=a.tr,{$from:d,$to:e}=c.selection,{pos:f}=d,{pos:g}=e,h=f-d.node().content.size;return!(h<0)&&(c=c.deleteRange(h,g),b?.(c),!0)}),mB("SetBlockType",()=>a=>(b,c)=>{let{nodeType:d,attrs:e=null}=a??{};if(!d)return!1;let f=b.tr,{from:g,to:h}=f.selection;try{f.setBlockType(g,h,d,e)}catch{return!1}return c?.(f),!0}),mB("WrapInBlockType",()=>a=>(b,c)=>{let{nodeType:d,attrs:e=null}=a??{};if(!d)return!1;let f=b.tr;try{let{$from:a,$to:b}=f.selection,c=a.blockRange(b),g=c&&hk(c,d,e);if(!g)return!1;f=f.wrap(c,g)}catch{return!1}return c?.(f),!0}),mB("AddBlockType",()=>a=>(b,c)=>{let{nodeType:d,attrs:e=null}=a??{};if(!d)return!1;let f=b.tr;try{let a=d instanceof gB?d:d.createAndFill(e);if(!a)return!1;f.replaceSelectionWith(a)}catch{return!1}return c?.(f),!0}),mB("SelectTextNearPos",()=>a=>(b,c)=>{let{pos:d}=a??{};if(null==d)return!1;let e=b.tr;try{let a,c=b.doc.resolve((a=b.doc.content.size,Math.min(Math.max(d,0),a)));e.setSelection(hI.near(c))}catch{return!1}return c?.(e.scrollIntoView()),!0})],n7=[nt,ny,nG,no,n_,nU,nP,ng,mW,m4,m_].flat(),n8=mL("remarkAddOrderInList",()=>()=>a=>{fp(a,"list",a=>{if(a.ordered){let b=a.start??1;a.children.forEach((a,c)=>{a.label=c+b})}})});mQ(n8.plugin,{displayName:"Remark<remarkAddOrderInListPlugin>",group:"Remark"}),mQ(n8.options,{displayName:"RemarkConfig<remarkAddOrderInListPlugin>",group:"Remark"});var n9=mL("remarkLineBreak",()=>()=>a=>{let b=/[\t ]*(?:\r?\n|\r)/g;fp(a,"text",(a,c,d)=>{if(!a.value||"string"!=typeof a.value)return;let e=[],f=0;b.lastIndex=0;let g=b.exec(a.value);for(;g;){let c=g.index;f!==c&&e.push({type:"text",value:a.value.slice(f,c)}),e.push({type:"break",data:{isInline:!0}}),f=c+g[0].length,g=b.exec(a.value)}if(e.length>0&&d&&"number"==typeof c)return f<a.value.length&&e.push({type:"text",value:a.value.slice(f)}),d.children.splice(c,1,...e),c+e.length})});mQ(n9.plugin,{displayName:"Remark<remarkLineBreak>",group:"Remark"}),mQ(n9.options,{displayName:"RemarkConfig<remarkLineBreak>",group:"Remark"});var oa=mL("remarkInlineLink",()=>mO);mQ(oa.plugin,{displayName:"Remark<remarkInlineLinkPlugin>",group:"Remark"}),mQ(oa.options,{displayName:"RemarkConfig<remarkInlineLinkPlugin>",group:"Remark"});var ob=["root","blockquote","listItem"],oc=mL("remarkHTMLTransformer",()=>()=>a=>{(function a(b,c,d){if(b.children){let c=[];for(let d=0,e=b.children.length;d<e;d++){let e=b.children[d];if(e){let f=a(e,d,b);if(f)for(let a=0,b=f.length;a<b;a++){let b=f[a];b&&c.push(b)}}}b.children=c}return((a,b,c)=>("html"!==a.type||c&&ob.includes(c.type)&&(a.children=[{...a}],delete a.value,a.type="paragraph"),[a]))(b,c,d)})(a,0,null)[0]});mQ(oc.plugin,{displayName:"Remark<remarkHtmlTransformer>",group:"Remark"}),mQ(oc.options,{displayName:"RemarkConfig<remarkHtmlTransformer>",group:"Remark"});var od=mL("remarkMarker",()=>()=>(a,b)=>{fp(a,a=>["strong","emphasis"].includes(a.type),a=>{a.marker=b.value.charAt(a.position.start.offset)})});mQ(od.plugin,{displayName:"Remark<remarkMarker>",group:"Remark"}),mQ(od.options,{displayName:"RemarkConfig<remarkMarker>",group:"Remark"});var oe=mE(()=>{let a=!1,b=new hW({key:new hZ("MILKDOWN_INLINE_NODES_CURSOR"),state:{init:()=>!1,apply(a){if(!a.selection.empty)return!1;let b=a.selection.$from,c=b.nodeBefore,d=b.nodeAfter;return!!c&&!!d&&!!c.isInline&&!c.isText&&!!d.isInline&&!d.isText}},props:{handleDOMEvents:{compositionend:(c,d)=>!!a&&(a=!1,requestAnimationFrame(()=>{if(b.getState(c.state)){let a=c.state.selection.from;d.preventDefault(),c.dispatch(c.state.tr.insertText(d.data||"",a))}}),!0),compositionstart:c=>(b.getState(c.state)&&(a=!0),!1),beforeinput:(c,d)=>{if(b.getState(c.state)&&d instanceof InputEvent&&d.data&&!a){let a=c.state.selection.from;return d.preventDefault(),c.dispatch(c.state.tr.insertText(d.data||"",a)),!0}return!1}},decorations(a){if(b.getState(a)){let b=a.selection.$from.pos,c=document.createElement("span"),d=k5.widget(b,c,{side:-1}),e=document.createElement("span"),f=k5.widget(b,e);return setTimeout(()=>{c.contentEditable="true",e.contentEditable="true"}),k8.create(a.doc,[d,f])}return k8.empty}}});return b});mQ(oe,{displayName:"Prose<inlineNodesCursorPlugin>",group:"Prose"});var of=mE(a=>new hW({key:new hZ("MILKDOWN_HARDBREAK_MARKS"),appendTransaction:(b,c,d)=>{if(!b.length)return;let[e]=b;if(!e)return;let[f]=e.steps;if(e.getMeta("hardbreak")){if(!(f instanceof hf))return;let{from:b}=f;return d.tr.setNodeMarkup(b,nE.type(a),void 0,[])}if(f instanceof hb){let b=d.tr,{from:c,to:e}=f;return d.doc.nodesBetween(c,e,(c,d)=>{c.type===nE.type(a)&&(b=b.setNodeMarkup(d,nE.type(a),void 0,[]))}),b}}}));mQ(of,{displayName:"Prose<hardbreakClearMarkPlugin>",group:"Prose"});var og=mF(["table","code_block"],"hardbreakFilterNodes");mQ(og,{displayName:"Ctx<hardbreakFilterNodes>",group:"Prose"});var oh=mE(a=>{let b=a.get(og.key);return new hW({key:new hZ("MILKDOWN_HARDBREAK_FILTER"),filterTransaction:(a,c)=>{let d=a.getMeta("hardbreak"),[e]=a.steps;if(d&&e){let{from:a}=e,d=c.doc.resolve(a),f=d.depth,g=!0;for(;f>0;)b.includes(d.node(f).type.name)&&(g=!1),f--;return g}return!0}})});mQ(oh,{displayName:"Prose<hardbreakFilterPlugin>",group:"Prose"});var oi=mE(a=>{let b=new hZ("MILKDOWN_HEADING_ID"),c=c=>{if(c.composing)return;let d=a.get(ni.key),e=c.state.tr.setMeta("addToHistory",!1),f=!1,g={};c.state.doc.descendants((c,h)=>{if(c.type===nk.type(a)){if(0===c.textContent.trim().length)return;let a=c.attrs,i=d(c);g[i]?(g[i]+=1,i+=`-#${g[i]}`):g[i]=1,a.id!==i&&(f=!0,e.setMeta(b,!0).setNodeMarkup(h,void 0,{...a,id:i}))}}),f&&c.dispatch(e)};return new hW({key:b,view:a=>(c(a),{update:(a,b)=>{a.state.doc.eq(b.doc)||c(a)}})})});mQ(oi,{displayName:"Prose<syncHeadingIdPlugin>",group:"Prose"});var oj=mE(a=>new hW({key:new hZ("MILKDOWN_KEEP_LIST_ORDER"),appendTransaction:(b,c,d)=>{if(!d.selection||b.some(a=>!1===a.getMeta("addToHistory")||!a.isGeneric))return null;let e=nR.type(a),f=nM.type(a),g=nW.type(a),h=(a,b,c=1)=>{let d=!1,e=`${b+c}.`;return a.label!==e&&(a.label=e,d=!0),d},i=d.tr,j=!1;return d.doc.descendants((a,b,c,d)=>{if(a.type===f){let c=a.maybeChild(0);c?.type===g&&"ordered"===c.attrs.listType&&(j=!0,i.setNodeMarkup(b,e,{spread:!0}),a.descendants((a,b,c,d)=>{if(a.type===g){let c={...a.attrs};h(c,d)&&(i=i.setNodeMarkup(b,void 0,c))}return!1}))}else if(a.type===g&&c?.type===e){let e={...a.attrs},f=!1;"ordered"!==e.listType&&(e.listType="ordered",f=!0),c?.maybeChild(0)&&(f=h(e,d,c?.attrs.order??1)),f&&(i=i.setNodeMarkup(b,void 0,e),j=!0)}}),j?i.setMeta("addToHistory",!1):null}}));mQ(oj,{displayName:"Prose<syncListOrderPlugin>",group:"Prose"});var ok=[n3,n4,n5,n6,n7,[of,og,oh,oe,n8,oa,n9,oc,od,nc,oi,oj].flat()].flat();let ol=function(a){var b=typeof a;return null!=a&&("object"==b||"function"==b)};var om="object"==typeof global&&global&&global.Object===Object&&global,on="object"==typeof self&&self&&self.Object===Object&&self,oo=om||on||Function("return this")();let op=function(){return oo.Date.now()};var oq=/\s/;let or=function(a){for(var b=a.length;b--&&oq.test(a.charAt(b)););return b};var ot=/^\s+/,ou=oo.Symbol,ov=Object.prototype,ow=ov.hasOwnProperty,ox=ov.toString,oy=ou?ou.toStringTag:void 0;let oz=function(a){var b=ow.call(a,oy),c=a[oy];try{a[oy]=void 0;var d=!0}catch(a){}var e=ox.call(a);return d&&(b?a[oy]=c:delete a[oy]),e};var oA=Object.prototype.toString,oB=ou?ou.toStringTag:void 0;let oC=function(a){return null==a?void 0===a?"[object Undefined]":"[object Null]":oB&&oB in Object(a)?oz(a):oA.call(a)},oD=function(a){return"symbol"==typeof a||null!=a&&"object"==typeof a&&"[object Symbol]"==oC(a)};var oE=0/0,oF=/^[-+]0x[0-9a-f]+$/i,oG=/^0b[01]+$/i,oH=/^0o[0-7]+$/i,oI=parseInt;let oJ=function(a){if("number"==typeof a)return a;if(oD(a))return oE;if(ol(a)){var b,c="function"==typeof a.valueOf?a.valueOf():a;a=ol(c)?c+"":c}if("string"!=typeof a)return 0===a?a:+a;a=(b=a)?b.slice(0,or(b)+1).replace(ot,""):b;var d=oG.test(a);return d||oH.test(a)?oI(a.slice(2),d?2:8):oF.test(a)?oE:+a};var oK=Math.max,oL=Math.min;let oM=function(a,b,c){var d,e,f,g,h,i,j=0,k=!1,l=!1,m=!0;if("function"!=typeof a)throw TypeError("Expected a function");function n(b){var c=d,f=e;return d=e=void 0,j=b,g=a.apply(f,c)}function o(a){var c=a-i,d=a-j;return void 0===i||c>=b||c<0||l&&d>=f}function p(){var a,c,d,e=op();if(o(e))return q(e);h=setTimeout(p,(a=e-i,c=e-j,d=b-a,l?oL(d,f-c):d))}function q(a){return(h=void 0,m&&d)?n(a):(d=e=void 0,g)}function r(){var a,c=op(),f=o(c);if(d=arguments,e=this,i=c,f){if(void 0===h)return j=a=i,h=setTimeout(p,b),k?n(a):g;if(l)return clearTimeout(h),h=setTimeout(p,b),n(i)}return void 0===h&&(h=setTimeout(p,b)),g}return b=oJ(b)||0,ol(c)&&(k=!!c.leading,f=(l="maxWait"in c)?oK(oJ(c.maxWait)||0,b):f,m="trailing"in c?!!c.trailing:m),r.cancel=function(){void 0!==h&&clearTimeout(h),j=0,d=i=e=h=void 0},r.flush=function(){return void 0===h?g:q(op())},r};var oN=class{constructor(){this.beforeMountedListeners=[],this.mountedListeners=[],this.updatedListeners=[],this.selectionUpdatedListeners=[],this.markdownUpdatedListeners=[],this.blurListeners=[],this.focusListeners=[],this.destroyListeners=[],this.beforeMount=a=>(this.beforeMountedListeners.push(a),this),this.mounted=a=>(this.mountedListeners.push(a),this),this.updated=a=>(this.updatedListeners.push(a),this)}get listeners(){return{beforeMount:this.beforeMountedListeners,mounted:this.mountedListeners,updated:this.updatedListeners,markdownUpdated:this.markdownUpdatedListeners,blur:this.blurListeners,focus:this.focusListeners,destroy:this.destroyListeners,selectionUpdated:this.selectionUpdatedListeners}}markdownUpdated(a){return this.markdownUpdatedListeners.push(a),this}blur(a){return this.blurListeners.push(a),this}focus(a){return this.focusListeners.push(a),this}destroy(a){return this.destroyListeners.push(a),this}selectionUpdated(a){return this.selectionUpdatedListeners.push(a),this}},oO=dx(new oN,"listener"),oP=new hZ("MILKDOWN_LISTENER"),oQ=a=>(a.inject(oO,new oN),async()=>{await a.wait(lN);let{listeners:b}=a.get(oO);b.beforeMount.forEach(b=>b(a)),await a.wait(l8);let c=a.get(mb),d=null,e=null,f=null,g=null,h=oM(()=>{if(!g)return;let{doc:f}=g;if(b.updated.length>0&&d&&!d.eq(f)&&b.updated.forEach(b=>{b(a,f,d)}),b.markdownUpdated.length>0&&d&&!d.eq(f)){let d=c(f);b.markdownUpdated.forEach(b=>{b(a,d,e)}),e=d}d=f,g=null},200),i=new hW({key:oP,view:()=>({destroy:()=>{h.cancel(),b.destroy.forEach(b=>b(a))}}),props:{handleDOMEvents:{focus:()=>(b.focus.forEach(b=>b(a)),!1),blur:()=>(b.blur.forEach(b=>b(a)),!1)}},state:{init:(a,b)=>{d=b.doc,e=c(b.doc)},apply:c=>{let d=c.selection;(!f&&d||f&&!d.eq(f))&&(b.selectionUpdated.forEach(b=>{b(a,d,f)}),f=d),(c.docChanged||c.storedMarksSet)&&!1!==c.getMeta("addToHistory")&&(g=c,h())}}});a.update(lG,a=>a.concat(i)),await a.wait(mn),b.mounted.forEach(b=>b(a))});oQ.meta={package:"@milkdown/plugin-listener",displayName:"Listener"};let oR=function(a,b,c){var d=!0,e=!0;if("function"!=typeof a)throw TypeError("Expected a function");return ol(c)&&(d="leading"in c?!!c.leading:d,e="trailing"in c?!!c.trailing:e),oM(a,b,{leading:d,maxWait:b,trailing:e})};function oS(a,b){return Object.assign(a,{meta:{package:"@milkdown/plugin-block",...b}}),a}var oT=mF({filterNodes:a=>{var b;return!(b=a=>"table"===a.type.name,a=>{for(let c=a.depth;c>0;c-=1){let d=a.node(c);if(b(d))return{from:a.before(c),to:a.after(c),node:d}}})(a)}},"blockConfig");oS(oT,{displayName:"Ctx<blockConfig>"});var oU=iJ.ie&&iJ.ie_version<15||iJ.ios&&iJ.webkit_version<604,oV=class{constructor(){this.#X=()=>{if(!this.#Y)return null;let a=this.#Y,b=this.#Z;if(this.#$=null,b&&hK.isSelectable(a.node)){let c=hK.create(b.state.doc,a.$pos.pos);return b.dispatch(b.state.tr.setSelection(c)),b.focus(),this.#$=c,c}return null},this.#$=null,this.#Y=null,this.#_=void 0,this.#aa=!1,this.#ab=()=>{this.#ac?.({type:"hide"}),this.#Y=null},this.#ad=a=>{this.#Y=a,this.#ac?.({type:"show",active:a})},this.bind=(a,b)=>{this.#K=a,this.#ac=b},this.addEvent=a=>{a.addEventListener("mousedown",this.#ae),a.addEventListener("mouseup",this.#af),a.addEventListener("dragstart",this.#ag),a.addEventListener("dragend",this.#ah)},this.removeEvent=a=>{a.removeEventListener("mousedown",this.#ae),a.removeEventListener("mouseup",this.#af),a.removeEventListener("dragstart",this.#ag),a.removeEventListener("dragend",this.#ah)},this.unBind=()=>{this.#ac=void 0},this.#ae=()=>{this.#_=this.#Y?.el.getBoundingClientRect(),this.#X()},this.#af=()=>{if(!this.#aa)return void requestAnimationFrame(()=>{this.#_&&this.#Z?.focus()});this.#aa=!1,this.#$=null},this.#ag=a=>{this.#aa=!0;let b=this.#Z;if(!b)return;b.dom.dataset.dragging="true";let c=this.#$;if(a.dataTransfer&&c){let d=c.content();a.dataTransfer.effectAllowed="copyMove";let{dom:e,text:f}=b.serializeForClipboard(d);a.dataTransfer.clearData(),a.dataTransfer.setData(oU?"Text":"text/html",e.innerHTML),oU||a.dataTransfer.setData("text/plain",f);let g=this.#Y?.el;g&&a.dataTransfer.setDragImage(g,0,0),b.dragging={slice:d,move:!0,node:c}}},this.#ah=()=>{let a=this.#Z;if(!a)return;this.#ai(a);let b=a.dragging;window.setTimeout(()=>{a.dragging===b&&(a.dragging=null)},50)},this.keydownCallback=a=>(this.#ab(),this.#aa=!1,a.dom.dataset.dragging="false",!1),this.#aj=oR((a,b)=>{if(!a.editable)return;let c=a.dom.getBoundingClientRect(),d=c.left+c.width/2;if(!(a.root.elementFromPoint(d,b.clientY)instanceof Element))return void this.#ab();let e=this.#ak;if(!e)return;let f=function(a,b,c){if(!a.dom.parentElement)return null;try{let d=a.posAtCoords({left:b.x,top:b.y})?.inside;if(null==d||d<0)return null;let e=a.state.doc.resolve(d),f=a.state.doc.nodeAt(d),g=a.nodeDOM(d),h=b=>{let d=e.depth>=1&&0===e.index(e.depth);if(!(b||d))return;let i=e.before(e.depth);f=a.state.doc.nodeAt(i),g=a.nodeDOM(i),e=a.state.doc.resolve(i),c(e,f)||h(!0)};if(h(!c(e,f)),!g||!f)return null;return{node:f,$pos:e,el:g}}catch{return null}}(a,{x:d,y:b.clientY},e);if(!f)return void this.#ab();this.#ad(f)},200),this.mousemoveCallback=(a,b)=>!a.composing&&!!a.editable&&(this.#aj(a,b),!1),this.dragoverCallback=(a,b)=>{if(this.#aa){let c=this.#Z?.dom.parentElement;if(!c)return!1;let d=c.scrollHeight>c.clientHeight,e=c.getBoundingClientRect();if(d){if(c.scrollTop>0&&20>Math.abs(b.y-e.y))return c.scrollTop=c.scrollTop>10?c.scrollTop-10:0,!1;let d=Math.round(a.dom.getBoundingClientRect().height);Math.round(c.scrollTop+e.height)<d&&20>Math.abs(b.y-(e.height+e.y))&&(c.scrollTop=c.scrollTop+10)}}return!1},this.dragenterCallback=a=>{a.dragging&&(this.#aa=!0,a.dom.dataset.dragging="true")},this.dragleaveCallback=(a,b)=>{let c=b.clientX,d=b.clientY;(c<0||d<0||c>window.innerWidth||d>window.innerHeight)&&(this.#Y=null,this.#ai(a))},this.dropCallback=a=>(this.#ai(a),!1),this.dragendCallback=a=>{this.#ai(a)},this.#ai=a=>{this.#aa=!1,a.dom.dataset.dragging="false"}}#K;#X;#$;#Y;#_;#aa;get #ak(){try{return this.#K?.get(oT.key).filterNodes}catch{return}}get #Z(){return this.#K?.get(lB)}#ac;#ab;#ad;#ae;#af;#ag;#ah;#aj;#ai},oW=mF(()=>new oV,"blockService"),oX=mF({},"blockServiceInstance");oS(oW,{displayName:"Ctx<blockService>"}),oS(oX,{displayName:"Ctx<blockServiceInstance>"});var oY=mF({},"blockSpec");oS(oY,{displayName:"Ctx<blockSpec>"});var oZ=mE(a=>{let b=new hZ("MILKDOWN_BLOCK"),c=a.get(oW.key)();a.set(oX.key,c);let d=a.get(oY.key);return new hW({key:b,...d,props:{...d.props,handleDOMEvents:{drop:a=>c.dropCallback(a),pointermove:(a,b)=>c.mousemoveCallback(a,b),keydown:a=>c.keydownCallback(a),dragover:(a,b)=>c.dragoverCallback(a,b),dragleave:(a,b)=>c.dragleaveCallback(a,b),dragenter:a=>c.dragenterCallback(a),dragend:a=>c.dragendCallback(a)}}})});oS(oZ,{displayName:"Prose<block>"});var o$=[oY,oT,oW,oX,oZ];o$.key=oY.key,o$.pluginKey=oZ.key;class o_ extends u{constructor(a){super(),this.doc=a,this.clientID=a.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{let a=aT();null!==this.getLocalState()&&15e3<=a-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());let b=[];this.meta.forEach((c,d)=>{d!==this.clientID&&3e4<=a-c.lastUpdated&&this.states.has(d)&&b.push(d)}),b.length>0&&o0(this,b,"timeout")},v(3e3)),a.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(a){let b=this.clientID,c=this.meta.get(b),d=void 0===c?0:c.clock+1,e=this.states.get(b);null===a?this.states.delete(b):this.states.set(b,a),this.meta.set(b,{clock:d,lastUpdated:aT()});let f=[],g=[],h=[],i=[];null===a?i.push(b):null==e?null!=a&&f.push(b):(g.push(b),aL(e,a)||h.push(b)),(f.length>0||h.length>0||i.length>0)&&this.emit("change",[{added:f,updated:h,removed:i},"local"]),this.emit("update",[{added:f,updated:g,removed:i},"local"])}setLocalStateField(a,b){let c=this.getLocalState();null!==c&&this.setLocalState({...c,[a]:b})}getStates(){return this.states}}let o0=(a,b,c)=>{let d=[];for(let c=0;c<b.length;c++){let e=b[c];if(a.states.has(e)){if(a.states.delete(e),e===a.clientID){let b=a.meta.get(e);a.meta.set(e,{clock:b.clock+1,lastUpdated:aT()})}d.push(e)}}d.length>0&&(a.emit("change",[{added:[],updated:[],removed:d},c]),a.emit("update",[{added:[],updated:[],removed:d},c]))},o1=Math.floor,o2=Number.MAX_SAFE_INTEGER,o3="undefined"!=typeof TextEncoder?new TextEncoder:null,o4=o3?a=>o3.encode(a):a=>{let b=unescape(encodeURIComponent(a)),c=b.length,d=new Uint8Array(c);for(let a=0;a<c;a++)d[a]=b.codePointAt(a);return d},o5="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});o5&&1===o5.decode(new Uint8Array).length&&(o5=null);let o6=(a,b)=>{let c=a.cbuf.length;a.cpos===c&&(a.bufs.push(a.cbuf),a.cbuf=new Uint8Array(2*c),a.cpos=0),a.cbuf[a.cpos++]=b},o7=(a,b)=>{for(;b>127;)o6(a,128|127&b),b=o1(b/128);o6(a,127&b)},o8=new Uint8Array(3e4),o9=o8.length/3,pa=o3&&o3.encodeInto?(a,b)=>{if(b.length<o9){let c=o3.encodeInto(b,o8).written||0;o7(a,c);for(let b=0;b<c;b++)o6(a,o8[b])}else pb(a,o4(b))}:(a,b)=>{let c=unescape(encodeURIComponent(b)),d=c.length;o7(a,d);for(let b=0;b<d;b++)o6(a,c.codePointAt(b))},pb=(a,b)=>{o7(a,b.byteLength),((a,b)=>{let c=a.cbuf.length,d=a.cpos,e=((a,b)=>a<b?a:b)(c-d,b.length),f=b.length-e;a.cbuf.set(b.subarray(0,e),d),a.cpos+=e,f>0&&(a.bufs.push(a.cbuf),a.cbuf=new Uint8Array(((a,b)=>a>b?a:b)(2*c,f)),a.cbuf.set(b.subarray(e)),a.cpos=f)})(a,b)},pc=a=>Error(a),pd=pc("Unexpected end of array"),pe=pc("Integer out of Range"),pf=a=>a.arr[a.pos++],pg=a=>{let b=0,c=1,d=a.arr.length;for(;a.pos<d;){let d=a.arr[a.pos++];if(b+=(127&d)*c,c*=128,d<128)return b;if(b>o2)throw pe}throw pd},ph=o5?a=>o5.decode((a=>((a,b)=>{let c=new Uint8Array(a.arr.buffer,a.pos+a.arr.byteOffset,b);return a.pos+=b,c})(a,pg(a)))(a)):a=>{let b=pg(a);if(0===b)return"";{let c=String.fromCodePoint(pf(a));if(--b<100)for(;b--;)c+=String.fromCodePoint(pf(a));else for(;b>0;){let d=b<1e4?b:1e4,e=a.arr.subarray(a.pos,a.pos+d);a.pos+=d,c+=String.fromCodePoint.apply(null,e),b-=d}return decodeURIComponent(escape(c))}};!function(a){a[a.Token=0]="Token",a[a.PermissionDenied=1]="PermissionDenied",a[a.Authenticated=2]="Authenticated"}(f||(f={}));let pi={code:1009},pj={code:4401,reason:"Unauthorized"},pk={code:4403},pl=a=>Array.from(a.entries()).map(([a,b])=>({clientId:a,...b}));async function pm(a){return new Promise(b=>setTimeout(b,a))}function pn(a,b){let c=b.delay;if(0===c)return 0;if(b.factor&&(c*=Math.pow(b.factor,a.attemptNum-1),0!==b.maxDelay&&(c=Math.min(c,b.maxDelay))),b.jitter){let a=Math.ceil(b.minDelay);c=Math.floor(Math.random()*(Math.floor(c)-a+1))+a}return Math.round(c)}async function po(a,b){var c;let d=((c=b)||(c={}),{delay:void 0===c.delay?200:c.delay,initialDelay:void 0===c.initialDelay?0:c.initialDelay,minDelay:void 0===c.minDelay?0:c.minDelay,maxDelay:void 0===c.maxDelay?0:c.maxDelay,factor:void 0===c.factor?0:c.factor,maxAttempts:void 0===c.maxAttempts?3:c.maxAttempts,timeout:void 0===c.timeout?0:c.timeout,jitter:!0===c.jitter,initialJitter:!0===c.initialJitter,handleError:void 0===c.handleError?null:c.handleError,handleTimeout:void 0===c.handleTimeout?null:c.handleTimeout,beforeAttempt:void 0===c.beforeAttempt?null:c.beforeAttempt,calculateDelay:void 0===c.calculateDelay?null:c.calculateDelay});for(let a of["delay","initialDelay","minDelay","maxDelay","maxAttempts","timeout"]){let b=d[a];if(!Number.isInteger(b)||b<0)throw Error(`Value for ${a} must be an integer greater than or equal to 0`)}if(d.factor.constructor!==Number||d.factor<0)throw Error("Value for factor must be a number greater than or equal to 0");if(d.delay<d.minDelay)throw Error(`delay cannot be less than minDelay (delay: ${d.delay}, minDelay: ${d.minDelay}`);let e={attemptNum:0,attemptsRemaining:d.maxAttempts?d.maxAttempts:-1,aborted:!1,abort(){e.aborted=!0}},f=d.calculateDelay||pn;async function g(){if(d.beforeAttempt&&d.beforeAttempt(e,d),e.aborted){let a=Error("Attempt aborted");throw a.code="ATTEMPT_ABORTED",a}let b=async a=>{if(d.handleError&&await d.handleError(a,e,d),e.aborted||0===e.attemptsRemaining)throw a;e.attemptNum++;let b=f(e,d);return b&&await pm(b),g()};return(e.attemptsRemaining>0&&e.attemptsRemaining--,d.timeout)?new Promise((c,f)=>{let g=setTimeout(()=>{if(d.handleTimeout)try{c(d.handleTimeout(e,d))}catch(a){f(a)}else{let a=Error(`Retry timeout (attemptNum: ${e.attemptNum}, timeout: ${d.timeout})`);a.code="ATTEMPT_TIMEOUT",f(a)}},d.timeout);a(e,d).then(a=>{clearTimeout(g),c(a)}).catch(a=>{clearTimeout(g),b(a).then(c).catch(f)})}):a(e,d).catch(b)}let h=d.calculateDelay?d.calculateDelay(e,d):d.initialDelay;if(h&&await pm(h),e.attemptNum<1&&d.initialJitter){let a=f(e,d);a&&await pm(a)}return g()}!function(a){a[a.Connecting=0]="Connecting",a[a.Open=1]="Open",a[a.Closing=2]="Closing",a[a.Closed=3]="Closed"}(g||(g={}));let pp=()=>new Map,pq=(a,b,c)=>{let d=a.get(b);return void 0===d&&a.set(b,d=c()),d},pr=()=>new Set,ps=Array.from,pt=String.fromCharCode,pu=/^\s*/g,pv=/([A-Z])/g,pw=(a,b)=>a.replace(pv,a=>`${b}${a.toLowerCase()}`).replace(pu,""),px="undefined"!=typeof TextEncoder?new TextEncoder:null,py=px?a=>px.encode(a):a=>{let b=unescape(encodeURIComponent(a)),c=b.length,d=new Uint8Array(c);for(let a=0;a<c;a++)d[a]=b.codePointAt(a);return d},pz="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});pz&&1===pz.decode(new Uint8Array).length&&(pz=null);let pA=a=>void 0===a?null:a;class pB{constructor(){this.map=new Map}setItem(a,b){this.map.set(a,b)}getItem(a){return this.map.get(a)}}let pC=new pB,pD=!0;try{"undefined"!=typeof localStorage&&localStorage&&(pC=localStorage,pD=!1)}catch(a){}let pE=pC,pF=Object.keys,pG=a=>pF(a).length,pH=(a,b)=>Object.prototype.hasOwnProperty.call(a,b),pI=(a,b)=>{if(null==a||null==b)return a===b;if(a.constructor!==b.constructor)return!1;if(a===b)return!0;switch(a.constructor){case ArrayBuffer:a=new Uint8Array(a),b=new Uint8Array(b);case Uint8Array:if(a.byteLength!==b.byteLength)return!1;for(let c=0;c<a.length;c++)if(a[c]!==b[c])return!1;break;case Set:if(a.size!==b.size)return!1;for(let c of a)if(!b.has(c))return!1;break;case Map:if(a.size!==b.size)return!1;for(let c of a.keys())if(!b.has(c)||!pI(a.get(c),b.get(c)))return!1;break;case Object:if(pG(a)!==pG(b))return!1;for(let c in a)if(!pH(a,c)||!pI(a[c],b[c]))return!1;break;case Array:if(a.length!==b.length)return!1;for(let c=0;c<a.length;c++)if(!pI(a[c],b[c]))return!1;break;default:return!1}return!0},pJ="undefined"!=typeof process&&process.release&&/node|io\.js/.test(process.release.name)&&"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0),pK="undefined"!=typeof window&&"undefined"!=typeof document&&!pJ;"undefined"!=typeof navigator&&/Mac/.test(navigator.platform);let pL=a=>(()=>{if(void 0===e)if(pJ){e=pp();let a=process.argv,b=null;for(let c=0;c<a.length;c++){let d=a[c];"-"===d[0]?(null!==b&&e.set(b,""),b=d):null!==b&&(e.set(b,d),b=null)}null!==b&&e.set(b,"")}else"object"==typeof location?(e=pp(),(location.search||"?").slice(1).split("&").forEach(a=>{if(0!==a.length){let[b,c]=a.split("=");e.set(`--${pw(b,"-")}`,c),e.set(`-${pw(b,"-")}`,c)}})):e=pp();return e})().has(a),pM=a=>pJ?pA(process.env[a.toUpperCase()]):pA(pE.getItem(a));(a=>pL("--"+a)||pM(a))("production");let pN=pJ&&["true","1","2"].includes(process.env.FORCE_COLOR);!pL("no-colors")&&(!pJ||process.stdout.isTTY||pN)&&(!pJ||pL("color")||pN||null!==pM("COLORTERM")||(pM("TERM")||"").includes("color"));let pO=Math.floor,pP=Number.MAX_SAFE_INTEGER;class pQ{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}let pR=()=>new pQ,pS=a=>{let b=a.cpos;for(let c=0;c<a.bufs.length;c++)b+=a.bufs[c].length;return b},pT=a=>{let b=new Uint8Array(pS(a)),c=0;for(let d=0;d<a.bufs.length;d++){let e=a.bufs[d];b.set(e,c),c+=e.length}return b.set(new Uint8Array(a.cbuf.buffer,0,a.cpos),c),b},pU=(a,b)=>{let c=a.cbuf.length;a.cpos===c&&(a.bufs.push(a.cbuf),a.cbuf=new Uint8Array(2*c),a.cpos=0),a.cbuf[a.cpos++]=b},pV=(a,b)=>{for(;b>127;)pU(a,128|127&b),b=pO(b/128);pU(a,127&b)},pW=new Uint8Array(3e4),pX=pW.length/3,pY=px&&px.encodeInto?(a,b)=>{if(b.length<pX){let c=px.encodeInto(b,pW).written||0;pV(a,c);for(let b=0;b<c;b++)pU(a,pW[b])}else pZ(a,py(b))}:(a,b)=>{let c=unescape(encodeURIComponent(b)),d=c.length;pV(a,d);for(let b=0;b<d;b++)pU(a,c.codePointAt(b))},pZ=(a,b)=>{pV(a,b.byteLength),((a,b)=>{let c=a.cbuf.length,d=a.cpos,e=((a,b)=>a<b?a:b)(c-d,b.length),f=b.length-e;a.cbuf.set(b.subarray(0,e),d),a.cpos+=e,f>0&&(a.bufs.push(a.cbuf),a.cbuf=new Uint8Array(((a,b)=>a>b?a:b)(2*c,f)),a.cbuf.set(b.subarray(e)),a.cpos=f)})(a,b)},p$=a=>Error(a),p_=p$("Unexpected end of array"),p0=p$("Integer out of Range");class p1{constructor(a){this.arr=a,this.pos=0}}let p2=a=>new p1(a),p3=a=>((a,b)=>{let c=new Uint8Array(a.arr.buffer,a.pos+a.arr.byteOffset,b);return a.pos+=b,c})(a,p5(a)),p4=a=>a.arr[a.pos++],p5=a=>{let b=0,c=1,d=a.arr.length;for(;a.pos<d;){let d=a.arr[a.pos++];if(b+=(127&d)*c,c*=128,d<128)return b;if(b>pP)throw p0}throw p_},p6=pz?a=>pz.decode(p3(a)):a=>{let b=p5(a);if(0===b)return"";{let c=String.fromCodePoint(p4(a));if(--b<100)for(;b--;)c+=String.fromCodePoint(p4(a));else for(;b>0;){let d=b<1e4?b:1e4,e=a.arr.subarray(a.pos,a.pos+d);a.pos+=d,c+=String.fromCodePoint.apply(null,e),b-=d}return decodeURIComponent(escape(c))}},p7=pK?a=>{let b="";for(let c=0;c<a.byteLength;c++)b+=pt(a[c]);return btoa(b)}:a=>Buffer.from(a.buffer,a.byteOffset,a.byteLength).toString("base64"),p8=pK?a=>{let b=atob(a),c=new Uint8Array(b.length);for(let a=0;a<b.length;a++)c[a]=b.charCodeAt(a);return c}:a=>{let b,c=Buffer.from(a,"base64");return b=c.buffer,new Uint8Array(b,c.byteOffset,c.byteLength)},p9=new Map;class qa{constructor(a){let b;this.room=a,this.onmessage=null,this._onChange=b=>b.key===a&&null!==this.onmessage&&this.onmessage({data:p8(b.newValue||"")}),b=this._onChange,pD||addEventListener("storage",b)}postMessage(a){pE.setItem(this.room,p7(new Uint8Array(a)))}close(){let a;a=this._onChange,pD||removeEventListener("storage",a)}}let qb="undefined"==typeof BroadcastChannel?qa:BroadcastChannel,qc=a=>pq(p9,a,()=>{let b=pr(),c=new qb(a);return c.onmessage=a=>b.forEach(b=>b(a.data,"broadcastchannel")),{bc:c,subs:b}}),qd=Date.now;class qe{constructor(){this._observers=pp()}on(a,b){pq(this._observers,a,pr).add(b)}once(a,b){let c=(...d)=>{this.off(a,c),b(...d)};this.on(a,c)}off(a,b){let c=this._observers.get(a);void 0!==c&&(c.delete(b),0===c.size&&this._observers.delete(a))}emit(a,b){return ps((this._observers.get(a)||pp()).values()).forEach(a=>a(...b))}destroy(){this._observers=pp()}}class qf extends qe{constructor(a){super(),this.doc=a,this.clientID=a.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{let a=qd();null!==this.getLocalState()&&15e3<=a-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());let b=[];this.meta.forEach((c,d)=>{d!==this.clientID&&3e4<=a-c.lastUpdated&&this.states.has(d)&&b.push(d)}),b.length>0&&qg(this,b,"timeout")},pO(3e3)),a.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(a){let b=this.clientID,c=this.meta.get(b),d=void 0===c?0:c.clock+1,e=this.states.get(b);null===a?this.states.delete(b):this.states.set(b,a),this.meta.set(b,{clock:d,lastUpdated:qd()});let f=[],g=[],h=[],i=[];null===a?i.push(b):null==e?null!=a&&f.push(b):(g.push(b),pI(e,a)||h.push(b)),(f.length>0||h.length>0||i.length>0)&&this.emit("change",[{added:f,updated:h,removed:i},"local"]),this.emit("update",[{added:f,updated:g,removed:i},"local"])}setLocalStateField(a,b){let c=this.getLocalState();null!==c&&this.setLocalState({...c,[a]:b})}getStates(){return this.states}}let qg=(a,b,c)=>{let d=[];for(let c=0;c<b.length;c++){let e=b[c];if(a.states.has(e)){if(a.states.delete(e),e===a.clientID){let b=a.meta.get(e);a.meta.set(e,{clock:b.clock+1,lastUpdated:qd()})}d.push(e)}}d.length>0&&(a.emit("change",[{added:[],updated:[],removed:d},c]),a.emit("update",[{added:[],updated:[],removed:d},c]))},qh=(a,b,c=a.states)=>{let d=b.length,e=pR();pV(e,d);for(let f=0;f<d;f++){let d=b[f],g=c.get(d)||null,h=a.meta.get(d).clock;pV(e,d),pV(e,h),pY(e,JSON.stringify(g))}return pT(e)};class qi{constructor(){this.callbacks={}}on(a,b){return this.callbacks[a]||(this.callbacks[a]=[]),this.callbacks[a].push(b),this}emit(a,...b){let c=this.callbacks[a];return c&&c.forEach(a=>a.apply(this,b)),this}off(a,b){let c=this.callbacks[a];return c&&(b?this.callbacks[a]=c.filter(a=>a!==b):delete this.callbacks[a]),this}removeAllListeners(){this.callbacks={}}}!function(a){a[a.Sync=0]="Sync",a[a.Awareness=1]="Awareness",a[a.Auth=2]="Auth",a[a.QueryAwareness=3]="QueryAwareness",a[a.Stateless=5]="Stateless",a[a.CLOSE=7]="CLOSE",a[a.SyncStatus=8]="SyncStatus"}(h||(h={})),function(a){a.Connecting="connecting",a.Connected="connected",a.Disconnected="disconnected"}(i||(i={}));class qj{constructor(a){this.data=a,this.encoder=pR(),this.decoder=p2(new Uint8Array(this.data))}peekVarString(){var a=this.decoder;let b=a.pos,c=p6(a);return a.pos=b,c}readVarUint(){return p5(this.decoder)}readVarString(){return p6(this.decoder)}readVarUint8Array(){return p3(this.decoder)}writeVarUint(a){return pV(this.encoder,a)}writeVarString(a){return pY(this.encoder,a)}writeVarUint8Array(a){return pZ(this.encoder,a)}length(){return pS(this.encoder)}}class qk extends qi{constructor(a){if(super(),this.messageQueue=[],this.configuration={url:"",document:void 0,WebSocketPolyfill:void 0,parameters:{},connect:!0,broadcast:!0,forceSyncInterval:!1,messageReconnectTimeout:3e4,delay:1e3,initialDelay:0,factor:2,maxAttempts:0,minDelay:1e3,maxDelay:3e4,jitter:!0,timeout:0,onOpen:()=>null,onConnect:()=>null,onMessage:()=>null,onOutgoingMessage:()=>null,onStatus:()=>null,onDisconnect:()=>null,onClose:()=>null,onDestroy:()=>null,onAwarenessUpdate:()=>null,onAwarenessChange:()=>null,quiet:!1,providerMap:new Map},this.webSocket=null,this.webSocketHandlers={},this.shouldConnect=!0,this.status=i.Disconnected,this.lastMessageReceived=0,this.identifier=0,this.intervals={forceSync:null,connectionChecker:null},this.connectionAttempt=null,this.receivedOnOpenPayload=void 0,this.receivedOnStatusPayload=void 0,this.closeTries=0,this.setConfiguration(a),this.configuration.WebSocketPolyfill=a.WebSocketPolyfill?a.WebSocketPolyfill:WebSocket,this.on("open",this.configuration.onOpen),this.on("open",this.onOpen.bind(this)),this.on("connect",this.configuration.onConnect),this.on("message",this.configuration.onMessage),this.on("outgoingMessage",this.configuration.onOutgoingMessage),this.on("status",this.configuration.onStatus),this.on("status",this.onStatus.bind(this)),this.on("disconnect",this.configuration.onDisconnect),this.on("close",this.configuration.onClose),this.on("destroy",this.configuration.onDestroy),this.on("awarenessUpdate",this.configuration.onAwarenessUpdate),this.on("awarenessChange",this.configuration.onAwarenessChange),this.on("close",this.onClose.bind(this)),this.on("message",this.onMessage.bind(this)),this.intervals.connectionChecker=setInterval(this.checkConnection.bind(this),this.configuration.messageReconnectTimeout/10),void 0!==a.connect&&(this.shouldConnect=a.connect),!this.shouldConnect)return;this.connect()}async onOpen(a){this.receivedOnOpenPayload=a}async onStatus(a){this.receivedOnStatusPayload=a}attach(a){let b;return this.configuration.providerMap.set(a.configuration.name,a),this.status===i.Disconnected&&this.shouldConnect&&(b=this.connect()),this.receivedOnOpenPayload&&a.onOpen(this.receivedOnOpenPayload),this.receivedOnStatusPayload&&a.onStatus(this.receivedOnStatusPayload),b}detach(a){this.configuration.providerMap.delete(a.configuration.name)}setConfiguration(a={}){this.configuration={...this.configuration,...a}}async connect(){let a;if(this.status===i.Connected)return;this.cancelWebsocketRetry&&(this.cancelWebsocketRetry(),this.cancelWebsocketRetry=void 0),this.receivedOnOpenPayload=void 0,this.receivedOnStatusPayload=void 0,this.shouldConnect=!0;let{retryPromise:b,cancelFunc:c}=(a=!1,{retryPromise:po(this.createWebSocketConnection.bind(this),{delay:this.configuration.delay,initialDelay:this.configuration.initialDelay,factor:this.configuration.factor,maxAttempts:this.configuration.maxAttempts,minDelay:this.configuration.minDelay,maxDelay:this.configuration.maxDelay,jitter:this.configuration.jitter,timeout:this.configuration.timeout,beforeAttempt:b=>{(!this.shouldConnect||a)&&b.abort()}}).catch(a=>{if(a&&"ATTEMPT_ABORTED"!==a.code)throw a}),cancelFunc:()=>{a=!0}});return this.cancelWebsocketRetry=c,b}attachWebSocketListeners(a,b){let{identifier:c}=a,d=a=>this.emit("message",a),e=a=>this.emit("close",{event:a}),f=a=>this.emit("open",a);this.webSocketHandlers[c]={message:d,close:e,open:f,error:a=>{b(a)}};let g=this.webSocketHandlers[a.identifier];Object.keys(g).forEach(b=>{a.addEventListener(b,g[b])})}cleanupWebSocket(){if(!this.webSocket)return;let{identifier:a}=this.webSocket,b=this.webSocketHandlers[a];Object.keys(b).forEach(c=>{var d;null==(d=this.webSocket)||d.removeEventListener(c,b[c]),delete this.webSocketHandlers[a]}),this.webSocket.close(),this.webSocket=null}createWebSocketConnection(){return new Promise((a,b)=>{this.webSocket&&(this.messageQueue=[],this.cleanupWebSocket()),this.lastMessageReceived=0,this.identifier+=1;let c=new this.configuration.WebSocketPolyfill(this.url);c.binaryType="arraybuffer",c.identifier=this.identifier,this.attachWebSocketListeners(c,b),this.webSocket=c,this.status=i.Connecting,this.emit("status",{status:i.Connecting}),this.connectionAttempt={resolve:a,reject:b}})}onMessage(a){var b;this.resolveConnectionAttempt(),this.lastMessageReceived=qd();let c=new qj(a.data).peekVarString();null==(b=this.configuration.providerMap.get(c))||b.onMessage(a)}resolveConnectionAttempt(){this.connectionAttempt&&(this.connectionAttempt.resolve(),this.connectionAttempt=null,this.status=i.Connected,this.emit("status",{status:i.Connected}),this.emit("connect"),this.messageQueue.forEach(a=>this.send(a)),this.messageQueue=[])}stopConnectionAttempt(){this.connectionAttempt=null}rejectConnectionAttempt(){var a;null==(a=this.connectionAttempt)||a.reject(),this.connectionAttempt=null}checkConnection(){var a;this.status===i.Connected&&this.lastMessageReceived&&(this.configuration.messageReconnectTimeout>=qd()-this.lastMessageReceived||(this.closeTries+=1,this.closeTries>2?(this.onClose({event:{code:4408,reason:"forced"}}),this.closeTries=0):(null==(a=this.webSocket)||a.close(),this.messageQueue=[])))}get serverUrl(){for(;"/"===this.configuration.url[this.configuration.url.length-1];)return this.configuration.url.slice(0,this.configuration.url.length-1);return this.configuration.url}get url(){let a=((a,b)=>{let c=[];for(let d in a)c.push(b(a[d],d));return c})(this.configuration.parameters,(a,b)=>`${encodeURIComponent(b)}=${encodeURIComponent(a)}`).join("&");return`${this.serverUrl}${0===a.length?"":`?${a}`}`}disconnect(){if(this.shouldConnect=!1,null!==this.webSocket)try{this.webSocket.close(),this.messageQueue=[]}catch{}}send(a){var b;(null==(b=this.webSocket)?void 0:b.readyState)===g.Open?this.webSocket.send(a):this.messageQueue.push(a)}onClose({event:a}){if(this.closeTries=0,this.cleanupWebSocket(),this.status===i.Connected&&(this.status=i.Disconnected,this.emit("status",{status:i.Disconnected}),this.emit("disconnect",{event:a})),a.code===pj.code&&(a.reason===pj.reason?console.warn("[HocuspocusProvider] An authentication token is required, but you didn’t send one. Try adding a `token` to your HocuspocusProvider configuration. Won’t try again."):console.warn(`[HocuspocusProvider] Connection closed with status Unauthorized: ${a.reason}`),this.shouldConnect=!1),a.code===pk.code&&!this.configuration.quiet)return void console.warn("[HocuspocusProvider] The provided authentication token isn’t allowed to connect to this server. Will try again.");a.code===pi.code&&(console.warn(`[HocuspocusProvider] Connection closed with status MessageTooBig: ${a.reason}`),this.shouldConnect=!1),this.connectionAttempt?this.rejectConnectionAttempt():this.shouldConnect&&this.connect(),this.shouldConnect||this.status!==i.Disconnected&&(this.status=i.Disconnected,this.emit("status",{status:i.Disconnected}),this.emit("disconnect",{event:a}))}destroy(){this.emit("destroy"),this.intervals.forceSync&&clearInterval(this.intervals.forceSync),clearInterval(this.intervals.connectionChecker),this.stopConnectionAttempt(),this.disconnect(),this.removeAllListeners(),this.cleanupWebSocket()}}let ql=(a,b,c)=>{pV(a,1),pZ(a,((a,b=new Uint8Array([0]),c=new bn)=>{((a,b,c=new Map)=>{bo(a,b.store,c),bc(a,(a=>{let b=bb();return a.clients.forEach((a,c)=>{let d=[];for(let b=0;b<a.length;b++){let c=a[b];if(c.deleted){let e=c.id.clock,f=c.length;if(b+1<a.length)for(let c=a[b+1];b+1<a.length&&c.deleted;c=a[++b+1])f+=c.length;d.push(new a5(e,f))}}d.length>0&&b.clients.set(c,d)}),b})(b.store))})(c,a,bq(b));let d=[c.toUint8Array()];if(a.store.pendingDs&&d.push(a.store.pendingDs),a.store.pendingStructs&&d.push(((a,b,c=bj,d=bn)=>{let e=bq(b),f=new d,g=new b$(f),h=new c(ag(a)),i=new bZ(h,!1);for(;i.curr;){let a=i.curr,b=a.id.client,c=e.get(b)||0;if(i.curr.constructor===di){i.next();continue}if(a.id.clock+a.length>c)for(b2(g,a,y(c-a.id.clock,0)),i.next();i.curr&&i.curr.id.client===b;)b2(g,i.curr,0),i.next();else for(;i.curr&&i.curr.id.client===b&&i.curr.id.clock+i.curr.length<=c;)i.next()}return b3(g),bc(f,bd(h)),f.toUint8Array()})(a.store.pendingStructs.update,b)),d.length>1){if(c.constructor===bl)return b0(d.map((a,b)=>0===b?a:((a,b,c,d)=>{let e=new c(ag(a)),f=new bZ(e,!1),g=new d,h=new b$(g);for(let a=f.curr;null!==a;a=f.next())b2(h,b(a),0);return b3(h),bc(g,bd(e)),g.toUint8Array()})(a,aK,bj,bl)),bh,bl);else if(c.constructor===bn)return b0(d)}return d[0]})(b,c,new bl))};class qm{constructor(){this.encoder=pR()}get(a){return a.encoder}toUint8Array(){return pT(this.encoder)}}class qn{constructor(a){this.broadcasted=!1,this.message=a}setBroadcasted(a){return this.broadcasted=a,this}apply(a,b){let{message:c}=this,d=c.readVarUint(),e=c.length();switch(d){case h.Sync:this.applySyncMessage(a,b);break;case h.Awareness:this.applyAwarenessMessage(a);break;case h.Auth:this.applyAuthMessage(a);break;case h.QueryAwareness:this.applyQueryAwarenessMessage(a);break;case h.Stateless:a.receiveStateless(p6(c.decoder));break;case h.SyncStatus:this.applySyncStatusMessage(a,1===(a=>{let b=a.arr[a.pos++],c=63&b,d=64,e=(64&b)>0?-1:1;if((128&b)==0)return e*c;let f=a.arr.length;for(;a.pos<f;){if(c+=(127&(b=a.arr[a.pos++]))*d,d*=128,b<128)return e*c;if(c>pP)throw p0}throw p_})(c.decoder));break;default:throw Error(`Can’t apply message of unknown type: ${d}`)}c.length()>e+1&&(this.broadcasted?a.broadcast(qm,{encoder:c.encoder}):a.send(qm,{encoder:c.encoder}))}applySyncMessage(a,b){let{message:c}=this;c.writeVarUint(h.Sync);let d=((a,b,c,d)=>{let e=p5(a);switch(e){case 0:ql(b,c,p3(a));break;case 1:case 2:var f=a,g=c,h=d;try{let a;a=p3(f),bp(g,a,h,bh)}catch(a){console.error("Caught error while handling a Yjs update",a)}break;default:throw Error("Unknown message type")}return e})(c.decoder,c.encoder,a.document,a);b&&1===d&&(a.synced=!0)}applySyncStatusMessage(a,b){b&&a.decrementUnsyncedChanges()}applyAwarenessMessage(a){if(!a.awareness)return;let{message:b}=this;((a,b,c)=>{let d=p2(b),e=qd(),f=[],g=[],h=[],i=[],j=p5(d);for(let b=0;b<j;b++){let b=p5(d),c=p5(d),j=JSON.parse(p6(d)),k=a.meta.get(b),l=a.states.get(b),m=void 0===k?0:k.clock;(m<c||m===c&&null===j&&a.states.has(b))&&(null===j?b===a.clientID&&null!=a.getLocalState()?c++:a.states.delete(b):a.states.set(b,j),a.meta.set(b,{clock:c,lastUpdated:e}),void 0===k&&null!==j?f.push(b):void 0!==k&&null===j?i.push(b):null!==j&&(pI(j,l)||h.push(b),g.push(b)))}(f.length>0||h.length>0||i.length>0)&&a.emit("change",[{added:f,updated:h,removed:i},c]),(f.length>0||g.length>0||i.length>0)&&a.emit("update",[{added:f,updated:g,removed:i},c])})(a.awareness,b.readVarUint8Array(),a)}applyAuthMessage(a){let{message:b}=this;((a,b,c)=>{switch(pg(a)){case f.PermissionDenied:b(ph(a));break;case f.Authenticated:c(ph(a))}})(b.decoder,a.permissionDeniedHandler.bind(a),a.authenticatedHandler.bind(a))}applyQueryAwarenessMessage(a){if(!a.awareness)return;let{message:b}=this;b.writeVarUint(h.Awareness),b.writeVarUint8Array(qh(a.awareness,Array.from(a.awareness.getStates().keys())))}}class qo{constructor(a,b={}){this.message=new a,this.encoder=this.message.get(b)}create(){return pT(this.encoder)}send(a){null==a||a.send(this.create())}broadcast(a){((a,b,c=null)=>{let d=qc(a);d.bc.postMessage(b),d.subs.forEach(a=>a(b,c))})(a,this.create())}}class qp extends qm{constructor(){super(...arguments),this.type=h.Auth,this.description="Authentication"}get(a){var b,c;if(void 0===a.token)throw Error("The authentication message requires `token` as an argument.");return pY(this.encoder,a.documentName),pV(this.encoder,this.type),b=this.encoder,c=a.token,o7(b,f.Token),pa(b,c),this.encoder}}class qq extends qm{constructor(){super(...arguments),this.type=h.Awareness,this.description="Awareness states update"}get(a){let b;if(void 0===a.awareness)throw Error("The awareness message requires awareness as an argument");if(void 0===a.clients)throw Error("The awareness message requires clients as an argument");return pY(this.encoder,a.documentName),pV(this.encoder,this.type),b=void 0===a.states?qh(a.awareness,a.clients):qh(a.awareness,a.clients,a.states),pZ(this.encoder,b),this.encoder}}class qr extends qm{constructor(){super(...arguments),this.type=h.CLOSE,this.description="Ask the server to close the connection"}get(a){return pY(this.encoder,a.documentName),pV(this.encoder,this.type),this.encoder}}class qs extends qm{constructor(){super(...arguments),this.type=h.QueryAwareness,this.description="Queries awareness states"}get(a){return pY(this.encoder,a.documentName),pV(this.encoder,this.type),this.encoder}}class qt extends qm{constructor(){super(...arguments),this.type=h.Stateless,this.description="A stateless message"}get(a){var b;return pY(this.encoder,a.documentName),pV(this.encoder,this.type),pY(this.encoder,null!=(b=a.payload)?b:""),this.encoder}}class qu extends qm{constructor(){super(...arguments),this.type=h.Sync,this.description="First sync step"}get(a){if(void 0===a.document)throw Error("The sync step one message requires document as an argument");pY(this.encoder,a.documentName),pV(this.encoder,this.type);var b=this.encoder,c=a.document;return pV(b,0),pZ(b,((a,b=new bm)=>(a instanceof Map?br(b,a):br(b,bK(a.store)),b.toUint8Array()))(c,new bk)),this.encoder}}class qv extends qm{constructor(){super(...arguments),this.type=h.Sync,this.description="Second sync step"}get(a){if(void 0===a.document)throw Error("The sync step two message requires document as an argument");return pY(this.encoder,a.documentName),pV(this.encoder,this.type),ql(this.encoder,a.document),this.encoder}}class qw extends qm{constructor(){super(...arguments),this.type=h.Sync,this.description="A document update"}get(a){var b,c;return pY(this.encoder,a.documentName),pV(this.encoder,this.type),b=this.encoder,c=a.update,pV(b,2),pZ(b,c),this.encoder}}class qx extends Error{constructor(){super(...arguments),this.code=1001}}class qy extends qi{constructor(a){var b,c,d;super(),this.configuration={name:"",document:void 0,awareness:void 0,token:null,parameters:{},broadcast:!0,forceSyncInterval:!1,onAuthenticated:()=>null,onAuthenticationFailed:()=>null,onOpen:()=>null,onConnect:()=>null,onMessage:()=>null,onOutgoingMessage:()=>null,onStatus:()=>null,onSynced:()=>null,onDisconnect:()=>null,onClose:()=>null,onDestroy:()=>null,onAwarenessUpdate:()=>null,onAwarenessChange:()=>null,onStateless:()=>null,quiet:!1,connect:!0,preserveConnection:!0},this.subscribedToBroadcastChannel=!1,this.isSynced=!1,this.unsyncedChanges=0,this.status=i.Disconnected,this.isAuthenticated=!1,this.authorizedScope=void 0,this.mux=(()=>{let a=!0;return(b,c)=>{if(a){a=!1;try{b()}finally{a=!0}}else void 0!==c&&c()}})(),this.intervals={forceSync:null},this.isConnected=!0,this.boundDocumentUpdateHandler=this.documentUpdateHandler.bind(this),this.boundAwarenessUpdateHandler=this.awarenessUpdateHandler.bind(this),this.boundBroadcastChannelSubscriber=this.broadcastChannelSubscriber.bind(this),this.boundPageHide=this.pageHide.bind(this),this.boundOnOpen=this.onOpen.bind(this),this.boundOnClose=this.onClose.bind(this),this.boundOnStatus=this.onStatus.bind(this),this.forwardConnect=a=>this.emit("connect",a),this.forwardOpen=a=>this.emit("open",a),this.forwardClose=a=>this.emit("close",a),this.forwardDisconnect=a=>this.emit("disconnect",a),this.forwardDestroy=a=>this.emit("destroy",a),this.setConfiguration(a),this.configuration.document=a.document?a.document:new bf,this.configuration.awareness=void 0!==a.awareness?a.awareness:new qf(this.document),this.on("open",this.configuration.onOpen),this.on("message",this.configuration.onMessage),this.on("outgoingMessage",this.configuration.onOutgoingMessage),this.on("synced",this.configuration.onSynced),this.on("destroy",this.configuration.onDestroy),this.on("awarenessUpdate",this.configuration.onAwarenessUpdate),this.on("awarenessChange",this.configuration.onAwarenessChange),this.on("stateless",this.configuration.onStateless),this.on("authenticated",this.configuration.onAuthenticated),this.on("authenticationFailed",this.configuration.onAuthenticationFailed),this.configuration.websocketProvider.on("connect",this.configuration.onConnect),this.configuration.websocketProvider.on("connect",this.forwardConnect),this.configuration.websocketProvider.on("open",this.boundOnOpen),this.configuration.websocketProvider.on("open",this.forwardOpen),this.configuration.websocketProvider.on("close",this.boundOnClose),this.configuration.websocketProvider.on("close",this.configuration.onClose),this.configuration.websocketProvider.on("close",this.forwardClose),this.configuration.websocketProvider.on("status",this.boundOnStatus),this.configuration.websocketProvider.on("disconnect",this.configuration.onDisconnect),this.configuration.websocketProvider.on("disconnect",this.forwardDisconnect),this.configuration.websocketProvider.on("destroy",this.configuration.onDestroy),this.configuration.websocketProvider.on("destroy",this.forwardDestroy),null==(b=this.awareness)||b.on("update",()=>{this.emit("awarenessUpdate",{states:pl(this.awareness.getStates())})}),null==(c=this.awareness)||c.on("change",()=>{this.emit("awarenessChange",{states:pl(this.awareness.getStates())})}),this.document.on("update",this.boundDocumentUpdateHandler),null==(d=this.awareness)||d.on("update",this.boundAwarenessUpdateHandler),this.registerEventListeners(),this.configuration.forceSyncInterval&&"number"==typeof this.configuration.forceSyncInterval&&(this.intervals.forceSync=setInterval(this.forceSync.bind(this),this.configuration.forceSyncInterval)),this.configuration.websocketProvider.attach(this)}onStatus({status:a}){this.status=a,this.configuration.onStatus({status:a}),this.emit("status",{status:a})}setConfiguration(a={}){!a.websocketProvider&&a.url&&(this.configuration.websocketProvider=new qk({url:a.url,connect:a.connect,parameters:a.parameters})),this.configuration={...this.configuration,...a}}get document(){return this.configuration.document}get awareness(){return this.configuration.awareness}get hasUnsyncedChanges(){return this.unsyncedChanges>0}resetUnsyncedChanges(){this.unsyncedChanges=1,this.emit("unsyncedChanges",this.unsyncedChanges)}incrementUnsyncedChanges(){this.unsyncedChanges+=1,this.emit("unsyncedChanges",this.unsyncedChanges)}decrementUnsyncedChanges(){this.unsyncedChanges-=1,0===this.unsyncedChanges&&(this.synced=!0),this.emit("unsyncedChanges",this.unsyncedChanges)}forceSync(){this.resetUnsyncedChanges(),this.send(qu,{document:this.document,documentName:this.configuration.name})}pageHide(){this.awareness&&qg(this.awareness,[this.document.clientID],"page hide")}registerEventListeners(){"undefined"!=typeof window&&"addEventListener"in window&&window.addEventListener("pagehide",this.boundPageHide)}sendStateless(a){this.send(qt,{documentName:this.configuration.name,payload:a})}documentUpdateHandler(a,b){b!==this&&(this.incrementUnsyncedChanges(),this.send(qw,{update:a,documentName:this.configuration.name},!0))}awarenessUpdateHandler({added:a,updated:b,removed:c},d){let e=a.concat(b).concat(c);this.send(qq,{awareness:this.awareness,clients:e,documentName:this.configuration.name},!0)}get synced(){return this.isSynced}set synced(a){this.isSynced!==a&&(this.isSynced=a,this.emit("synced",{state:a}),this.emit("sync",{state:a}))}receiveStateless(a){this.emit("stateless",{payload:a})}get isAuthenticationRequired(){return!!this.configuration.token&&!this.isAuthenticated}async connect(){return this.configuration.broadcast&&this.subscribeToBroadcastChannel(),this.configuration.websocketProvider.shouldConnect=!0,this.configuration.websocketProvider.attach(this)}disconnect(){this.disconnectBroadcastChannel(),this.configuration.websocketProvider.detach(this),this.isConnected=!1,this.configuration.preserveConnection||this.configuration.websocketProvider.disconnect()}async onOpen(a){let b;this.isAuthenticated=!1,this.isConnected=!0,this.emit("open",{event:a});try{b=await this.getToken()}catch(a){this.permissionDeniedHandler(`Failed to get token: ${a}`);return}this.isAuthenticationRequired&&this.send(qp,{token:b,documentName:this.configuration.name}),this.startSync()}async getToken(){return"function"==typeof this.configuration.token?await this.configuration.token():this.configuration.token}startSync(){this.resetUnsyncedChanges(),this.send(qu,{document:this.document,documentName:this.configuration.name}),this.awareness&&null!==this.awareness.getLocalState()&&this.send(qq,{awareness:this.awareness,clients:[this.document.clientID],documentName:this.configuration.name})}send(a,b,c=!1){if(!this.isConnected)return;c&&this.mux(()=>{this.broadcast(a,b)});let d=new qo(a,b);this.emit("outgoingMessage",{message:d.message}),d.send(this.configuration.websocketProvider)}onMessage(a){let b=new qj(a.data),c=b.readVarString();b.writeVarString(c),this.emit("message",{event:a,message:new qj(a.data)}),new qn(b).apply(this,!0)}onClose(a){this.isAuthenticated=!1,this.synced=!1,this.awareness&&qg(this.awareness,Array.from(this.awareness.getStates().keys()).filter(a=>a!==this.document.clientID),this)}destroy(){this.emit("destroy"),this.intervals.forceSync&&clearInterval(this.intervals.forceSync),this.awareness&&(qg(this.awareness,[this.document.clientID],"provider destroy"),this.awareness.off("update",this.boundAwarenessUpdateHandler),this.awareness.destroy()),this.document.off("update",this.boundDocumentUpdateHandler),this.removeAllListeners(),this.configuration.websocketProvider.off("connect",this.configuration.onConnect),this.configuration.websocketProvider.off("connect",this.forwardConnect),this.configuration.websocketProvider.off("open",this.boundOnOpen),this.configuration.websocketProvider.off("open",this.forwardOpen),this.configuration.websocketProvider.off("close",this.boundOnClose),this.configuration.websocketProvider.off("close",this.configuration.onClose),this.configuration.websocketProvider.off("close",this.forwardClose),this.configuration.websocketProvider.off("status",this.boundOnStatus),this.configuration.websocketProvider.off("disconnect",this.configuration.onDisconnect),this.configuration.websocketProvider.off("disconnect",this.forwardDisconnect),this.configuration.websocketProvider.off("destroy",this.configuration.onDestroy),this.configuration.websocketProvider.off("destroy",this.forwardDestroy),this.send(qr,{documentName:this.configuration.name}),this.disconnect(),"undefined"!=typeof window&&"removeEventListener"in window&&window.removeEventListener("pagehide",this.boundPageHide)}permissionDeniedHandler(a){this.emit("authenticationFailed",{reason:a}),this.isAuthenticated=!1,this.disconnect(),this.status=i.Disconnected}authenticatedHandler(a){this.isAuthenticated=!0,this.authorizedScope=a,this.emit("authenticated")}get broadcastChannel(){return`${this.configuration.name}`}broadcastChannelSubscriber(a){this.mux(()=>{let b=new qj(a),c=b.readVarString();b.writeVarString(c),new qn(b).setBroadcasted(!0).apply(this,!1)})}subscribeToBroadcastChannel(){if(!this.subscribedToBroadcastChannel){var a,b;a=this.broadcastChannel,b=this.boundBroadcastChannelSubscriber,qc(a).subs.add(b),this.subscribedToBroadcastChannel=!0}this.mux(()=>{this.broadcast(qu,{document:this.document,documentName:this.configuration.name}),this.broadcast(qv,{document:this.document,documentName:this.configuration.name}),this.broadcast(qs,{document:this.document,documentName:this.configuration.name}),this.awareness&&this.broadcast(qq,{awareness:this.awareness,clients:[this.document.clientID],document:this.document,documentName:this.configuration.name})})}disconnectBroadcastChannel(){this.awareness&&this.send(qq,{awareness:this.awareness,clients:[this.document.clientID],states:new Map,documentName:this.configuration.name},!0),this.subscribedToBroadcastChannel&&(((a,b)=>{let c=qc(a);return c.subs.delete(b)&&0===c.subs.size&&(c.bc.close(),p9.delete(a))})(this.broadcastChannel,this.boundBroadcastChannelSubscriber),this.subscribedToBroadcastChannel=!1)}broadcast(a,b){this.configuration.broadcast&&this.subscribedToBroadcastChannel&&new qo(a,b).broadcast(this.broadcastChannel)}setAwarenessField(a,b){if(!this.awareness)throw new qx(`Cannot set awareness field "${a}" to ${JSON.stringify(b)}. You have disabled Awareness for this provider by explicitly passing awareness: null in the provider configuration.`);this.awareness.setLocalStateField(a,b)}}function qz(a){a.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}function qA(a){a.register(qz),a.languages.c=a.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),a.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),a.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},a.languages.c.string],char:a.languages.c.char,comment:a.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:a.languages.c}}}}),a.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete a.languages.c.boolean}function qB(a){var b,c;a.register(qA),b=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,c=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return b.source}),a.languages.cpp=a.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return b.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:b,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),a.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return c})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),a.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:a.languages.cpp}}}}),a.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),a.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:a.languages.extend("cpp",{})}}),a.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},a.languages.cpp["base-clause"])}function qC(a){a.register(qB),a.languages.arduino=a.languages.extend("cpp",{keyword:/\b(?:String|array|bool|boolean|break|byte|case|catch|continue|default|do|double|else|finally|for|function|goto|if|in|instanceof|int|integer|long|loop|new|null|return|setup|string|switch|throw|try|void|while|word)\b/,constant:/\b(?:ANALOG_MESSAGE|DEFAULT|DIGITAL_MESSAGE|EXTERNAL|FIRMATA_STRING|HIGH|INPUT|INPUT_PULLUP|INTERNAL|INTERNAL1V1|INTERNAL2V56|LED_BUILTIN|LOW|OUTPUT|REPORT_ANALOG|REPORT_DIGITAL|SET_PIN_MODE|SYSEX_START|SYSTEM_RESET)\b/,builtin:/\b(?:Audio|BSSID|Bridge|Client|Console|EEPROM|Esplora|EsploraTFT|Ethernet|EthernetClient|EthernetServer|EthernetUDP|File|FileIO|FileSystem|Firmata|GPRS|GSM|GSMBand|GSMClient|GSMModem|GSMPIN|GSMScanner|GSMServer|GSMVoiceCall|GSM_SMS|HttpClient|IPAddress|IRread|Keyboard|KeyboardController|LiquidCrystal|LiquidCrystal_I2C|Mailbox|Mouse|MouseController|PImage|Process|RSSI|RobotControl|RobotMotor|SD|SPI|SSID|Scheduler|Serial|Server|Servo|SoftwareSerial|Stepper|Stream|TFT|Task|USBHost|WiFi|WiFiClient|WiFiServer|WiFiUDP|Wire|YunClient|YunServer|abs|addParameter|analogRead|analogReadResolution|analogReference|analogWrite|analogWriteResolution|answerCall|attach|attachGPRS|attachInterrupt|attached|autoscroll|available|background|beep|begin|beginPacket|beginSD|beginSMS|beginSpeaker|beginTFT|beginTransmission|beginWrite|bit|bitClear|bitRead|bitSet|bitWrite|blink|blinkVersion|buffer|changePIN|checkPIN|checkPUK|checkReg|circle|cityNameRead|cityNameWrite|clear|clearScreen|click|close|compassRead|config|connect|connected|constrain|cos|countryNameRead|countryNameWrite|createChar|cursor|debugPrint|delay|delayMicroseconds|detach|detachInterrupt|digitalRead|digitalWrite|disconnect|display|displayLogos|drawBMP|drawCompass|encryptionType|end|endPacket|endSMS|endTransmission|endWrite|exists|exitValue|fill|find|findUntil|flush|gatewayIP|get|getAsynchronously|getBand|getButton|getCurrentCarrier|getIMEI|getKey|getModifiers|getOemKey|getPINUsed|getResult|getSignalStrength|getSocket|getVoiceCallStatus|getXChange|getYChange|hangCall|height|highByte|home|image|interrupts|isActionDone|isDirectory|isListening|isPIN|isPressed|isValid|keyPressed|keyReleased|keyboardRead|knobRead|leftToRight|line|lineFollowConfig|listen|listenOnLocalhost|loadImage|localIP|lowByte|macAddress|maintain|map|max|messageAvailable|micros|millis|min|mkdir|motorsStop|motorsWrite|mouseDragged|mouseMoved|mousePressed|mouseReleased|move|noAutoscroll|noBlink|noBuffer|noCursor|noDisplay|noFill|noInterrupts|noListenOnLocalhost|noStroke|noTone|onReceive|onRequest|open|openNextFile|overflow|parseCommand|parseFloat|parseInt|parsePacket|pauseMode|peek|pinMode|playFile|playMelody|point|pointTo|position|pow|prepare|press|print|printFirmwareVersion|printVersion|println|process|processInput|pulseIn|put|random|randomSeed|read|readAccelerometer|readBlue|readButton|readBytes|readBytesUntil|readGreen|readJoystickButton|readJoystickSwitch|readJoystickX|readJoystickY|readLightSensor|readMessage|readMicrophone|readNetworks|readRed|readSlider|readString|readStringUntil|readTemperature|ready|rect|release|releaseAll|remoteIP|remoteNumber|remotePort|remove|requestFrom|retrieveCallingNumber|rewindDirectory|rightToLeft|rmdir|robotNameRead|robotNameWrite|run|runAsynchronously|runShellCommand|runShellCommandAsynchronously|running|scanNetworks|scrollDisplayLeft|scrollDisplayRight|seek|sendAnalog|sendDigitalPortPair|sendDigitalPorts|sendString|sendSysex|serialEvent|setBand|setBitOrder|setClockDivider|setCursor|setDNS|setDataMode|setFirmwareVersion|setMode|setPINUsed|setSpeed|setTextSize|setTimeout|shiftIn|shiftOut|shutdown|sin|size|sqrt|startLoop|step|stop|stroke|subnetMask|switchPIN|tan|tempoWrite|text|tone|transfer|tuneWrite|turn|updateIR|userNameRead|userNameWrite|voiceCall|waitContinue|width|write|writeBlue|writeGreen|writeJSON|writeMessage|writeMicroseconds|writeRGB|writeRed|yield)\b/}),a.languages.ino=a.languages.arduino}function qD(a){!function(a){var b="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",c={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},d={bash:c,environment:{pattern:RegExp("\\$"+b),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+b),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};a.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+b),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:d},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:c}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:d},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:d.entity}}],environment:{pattern:RegExp("\\$?"+b),alias:"constant"},variable:d.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},c.inside=a.languages.bash;for(var e=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],f=d.variable[1].inside,g=0;g<e.length;g++)f[e[g]]=a.languages.bash[e[g]];a.languages.sh=a.languages.bash,a.languages.shell=a.languages.bash}(a)}function qE(a){a.register(qz),function(a){function b(a,b){return a.replace(/<<(\d+)>>/g,function(a,c){return"(?:"+b[+c]+")"})}function c(a,c,d){return RegExp(b(a,c),d||"")}function d(a,b){for(var c=0;c<b;c++)a=a.replace(/<<self>>/g,function(){return"(?:"+a+")"});return a.replace(/<<self>>/g,"[^\\s\\S]")}var e="bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",f="class enum interface record struct",g="add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",h="abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield";function i(a){return"\\b(?:"+a.trim().replace(/ /g,"|")+")\\b"}var j=i(f),k=RegExp(i(e+" "+f+" "+g+" "+h)),l=i(f+" "+g+" "+h),m=i(e+" "+f+" "+h),n=d(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source,2),o=d(/\((?:[^()]|<<self>>)*\)/.source,2),p=/@?\b[A-Za-z_]\w*\b/.source,q=b(/<<0>>(?:\s*<<1>>)?/.source,[p,n]),r=b(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[l,q]),s=/\[\s*(?:,\s*)*\]/.source,t=b(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[r,s]),u=b(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[n,o,s]),v=b(/\(<<0>>+(?:,<<0>>+)+\)/.source,[u]),w=b(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[v,r,s]),x={keyword:k,punctuation:/[<>()?,.:[\]]/},y=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,z=/"(?:\\.|[^\\"\r\n])*"/.source,A=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;a.languages.csharp=a.languages.extend("clike",{string:[{pattern:c(/(^|[^$\\])<<0>>/.source,[A]),lookbehind:!0,greedy:!0},{pattern:c(/(^|[^@$\\])<<0>>/.source,[z]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:c(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[r]),lookbehind:!0,inside:x},{pattern:c(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[p,w]),lookbehind:!0,inside:x},{pattern:c(/(\busing\s+)<<0>>(?=\s*=)/.source,[p]),lookbehind:!0},{pattern:c(/(\b<<0>>\s+)<<1>>/.source,[j,q]),lookbehind:!0,inside:x},{pattern:c(/(\bcatch\s*\(\s*)<<0>>/.source,[r]),lookbehind:!0,inside:x},{pattern:c(/(\bwhere\s+)<<0>>/.source,[p]),lookbehind:!0},{pattern:c(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[t]),lookbehind:!0,inside:x},{pattern:c(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[w,m,p]),inside:x}],keyword:k,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),a.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),a.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:c(/([(,]\s*)<<0>>(?=\s*:)/.source,[p]),lookbehind:!0,alias:"punctuation"}}),a.languages.insertBefore("csharp","class-name",{namespace:{pattern:c(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[p]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:c(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[o]),lookbehind:!0,alias:"class-name",inside:x},"return-type":{pattern:c(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[w,r]),inside:x,alias:"class-name"},"constructor-invocation":{pattern:c(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[w]),lookbehind:!0,inside:x,alias:"class-name"},"generic-method":{pattern:c(/<<0>>\s*<<1>>(?=\s*\()/.source,[p,n]),inside:{function:c(/^<<0>>/.source,[p]),generic:{pattern:RegExp(n),alias:"class-name",inside:x}}},"type-list":{pattern:c(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[j,q,p,w,k.source,o,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:c(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[q,o]),lookbehind:!0,greedy:!0,inside:a.languages.csharp},keyword:k,"class-name":{pattern:RegExp(w),greedy:!0,inside:x},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var B=z+"|"+y,C=b(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[B]),D=d(b(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[C]),2),E=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,F=b(/<<0>>(?:\s*\(<<1>>*\))?/.source,[r,D]);a.languages.insertBefore("csharp","class-name",{attribute:{pattern:c(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[E,F]),lookbehind:!0,greedy:!0,inside:{target:{pattern:c(/^<<0>>(?=\s*:)/.source,[E]),alias:"keyword"},"attribute-arguments":{pattern:c(/\(<<0>>*\)/.source,[D]),inside:a.languages.csharp},"class-name":{pattern:RegExp(r),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var G=/:[^}\r\n]+/.source,H=d(b(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[C]),2),I=b(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[H,G]),J=d(b(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/.source,[B]),2),K=b(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[J,G]);function L(b,d){return{interpolation:{pattern:c(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[b]),lookbehind:!0,inside:{"format-string":{pattern:c(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[d,G]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:a.languages.csharp}}},string:/[\s\S]+/}}a.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:c(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[I]),lookbehind:!0,greedy:!0,inside:L(I,H)},{pattern:c(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[K]),lookbehind:!0,greedy:!0,inside:L(K,J)}],char:{pattern:RegExp(y),greedy:!0}}),a.languages.dotnet=a.languages.cs=a.languages.csharp}(a)}function qF(a){a.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},a.languages.markup.tag.inside["attr-value"].inside.entity=a.languages.markup.entity,a.languages.markup.doctype.inside["internal-subset"].inside=a.languages.markup,a.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.value.replace(/&/,"&"))}),Object.defineProperty(a.languages.markup.tag,"addInlined",{value:function(b,c){var d={};d["language-"+c]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:a.languages[c]},d.cdata=/^<!\[CDATA\[|\]\]>$/i;var e={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:d}};e["language-"+c]={pattern:/[\s\S]+/,inside:a.languages[c]};var f={};f[b]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return b}),"i"),lookbehind:!0,greedy:!0,inside:e},a.languages.insertBefore("markup","cdata",f)}}),Object.defineProperty(a.languages.markup.tag,"addAttribute",{value:function(b,c){a.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+b+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[c,"language-"+c],inside:a.languages[c]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),a.languages.html=a.languages.markup,a.languages.mathml=a.languages.markup,a.languages.svg=a.languages.markup,a.languages.xml=a.languages.extend("markup",{}),a.languages.ssml=a.languages.xml,a.languages.atom=a.languages.xml,a.languages.rss=a.languages.xml}function qG(a){var b,c;b=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,a.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+b.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+b.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+b.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+b.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:b,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},a.languages.css.atrule.inside.rest=a.languages.css,(c=a.languages.markup)&&(c.tag.addInlined("style","css"),c.tag.addAttribute("style","css"))}function qH(a){var b;a.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]},Object.keys(b={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"}).forEach(function(c){var d=b[c],e=[];/^\w+$/.test(c)||e.push(/\w+/.exec(c)[0]),"diff"===c&&e.push("bold"),a.languages.diff[c]={pattern:RegExp("^(?:["+d+"].*(?:\r\n?|\n|(?![\\s\\S])))+","m"),alias:e,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(c)[0]}}}}),Object.defineProperty(a.languages.diff,"PREFIXES",{value:b})}function qI(a){a.register(qz),a.languages.go=a.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),a.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete a.languages.go["class-name"]}function qJ(a){a.languages.ini={comment:{pattern:/(^[ \f\t\v]*)[#;][^\n\r]*/m,lookbehind:!0},section:{pattern:/(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m,lookbehind:!0,inside:{"section-name":{pattern:/(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/,lookbehind:!0,alias:"selector"},punctuation:/\[|\]/}},key:{pattern:/(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m,lookbehind:!0,alias:"attr-name"},value:{pattern:/(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/,lookbehind:!0,alias:"attr-value",inside:{"inner-value":{pattern:/^("|').+(?=\1$)/,lookbehind:!0}}},punctuation:/=/}}function qK(a){var b,c,d;a.register(qz),b=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,c=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,d={pattern:RegExp(/(^|[^\w.])/.source+c+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}},a.languages.java=a.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[d,{pattern:RegExp(/(^|[^\w.])/.source+c+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:d.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+c+/[A-Z]\w*\b/.source),lookbehind:!0,inside:d.inside}],keyword:b,function:[a.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),a.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),a.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":d,keyword:b,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+c+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:d.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+c+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:d.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return b.source})),lookbehind:!0,inside:{punctuation:/\./}}})}function qL(a){var b,c,d,e,f;b={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},e=RegExp((d="(?:[^\\\\-]|"+(c=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/).source+")")+"-"+d),f={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"},a.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:e,inside:{escape:c,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":b,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:c}},"special-escape":b,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":f}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:c,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":f}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}}function qM(a){a.register(qz),a.languages.javascript=a.languages.extend("clike",{"class-name":[a.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source)+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),a.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,a.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:a.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:a.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:a.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:a.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:a.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),a.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:a.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),a.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),a.languages.markup&&(a.languages.markup.tag.addInlined("script","javascript"),a.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),a.languages.js=a.languages.javascript}function qN(a){a.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},a.languages.webmanifest=a.languages.json}function qO(a){var b;a.register(qz),a.languages.kotlin=a.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete a.languages.kotlin["class-name"],b={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:a.languages.kotlin}},a.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:b},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:b},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete a.languages.kotlin.string,a.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),a.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),a.languages.kt=a.languages.kotlin,a.languages.kts=a.languages.kotlin}function qP(a){a.register(qG),a.languages.less=a.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),a.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}})}function qQ(a){a.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/}}function qR(a){a.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/}}function qS(a){!function(a){var b=/[*&][^\s[\]{},]+/,c=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,d="(?:"+c.source+"(?:[ ]+"+b.source+")?|"+b.source+"(?:[ ]+"+c.source+")?)",e=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),f=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function g(a,b){return b=(b||"").replace(/m/g,"")+"m",RegExp(/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return d}).replace(/<<value>>/g,function(){return a}),b)}a.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return d})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return d}).replace(/<<key>>/g,function(){return"(?:"+e+"|"+f+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:g(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:g(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:g(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:g(f),lookbehind:!0,greedy:!0},number:{pattern:g(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:c,important:b,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},a.languages.yml=a.languages.yaml}(a)}function qT(a){a.register(qF),function(a){var b=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function c(a){return a=a.replace(/<inner>/g,function(){return b}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+a+")")}var d=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,e=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return d}),f=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;a.languages.markdown=a.languages.extend("markup",{}),a.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:a.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+e+f+"(?:"+e+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+e+f+")(?:"+e+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(d),inside:a.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+e+")"+f+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+e+"$"),inside:{"table-header":{pattern:RegExp(d),alias:"important",inside:a.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:c(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:c(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:c(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:c(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(b){["url","bold","italic","strike","code-snippet"].forEach(function(c){b!==c&&(a.languages.markdown[b].inside.content.inside[c]=a.languages.markdown[c])})}),a.hooks.add("after-tokenize",function(a){("markdown"===a.language||"md"===a.language)&&function a(b){if(b&&"string"!=typeof b)for(var c=0,d=b.length;c<d;c++){var e=b[c];if("code"!==e.type){a(e.content);continue}var f=e.content[1],g=e.content[3];if(f&&g&&"code-language"===f.type&&"code-block"===g.type&&"string"==typeof f.content){var h=f.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),i="language-"+(h=(/[a-z][\w-]*/i.exec(h)||[""])[0].toLowerCase());g.alias?"string"==typeof g.alias?g.alias=[g.alias,i]:g.alias.push(i):g.alias=[i]}}}(a.tokens)}),a.hooks.add("wrap",function(b){if("code-block"===b.type){for(var c="",d=0,e=b.classes.length;d<e;d++){var f=b.classes[d],g=/language-(.+)/.exec(f);if(g){c=g[1];break}}var h=a.languages[c];if(h)b.content=a.highlight(b.content.value,h,c);else if(c&&"none"!==c&&a.plugins.autoloader){var i="md-"+new Date().valueOf()+"-"+Math.floor(1e16*Math.random());b.attributes.id=i,a.plugins.autoloader.loadLanguages(c,function(){var b=document.getElementById(i);b&&(b.innerHTML=a.highlight(b.textContent,a.languages[c],c))})}}}),RegExp(a.languages.markup.tag.pattern.source,"gi"),a.languages.md=a.languages.markdown}(a)}function qU(a){a.register(qA),a.languages.objectivec=a.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete a.languages.objectivec["class-name"],a.languages.objc=a.languages.objectivec}function qV(a){var b;b=/(?:\((?:[^()\\]|\\[\s\S])*\)|\{(?:[^{}\\]|\\[\s\S])*\}|\[(?:[^[\]\\]|\\[\s\S])*\]|<(?:[^<>\\]|\\[\s\S])*>)/.source,a.languages.perl={comment:[{pattern:/(^\s*)=\w[\s\S]*?=cut.*/m,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0,greedy:!0}],string:[{pattern:RegExp(/\b(?:q|qq|qw|qx)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,b].join("|")+")"),greedy:!0},{pattern:/("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/'(?:[^'\\\r\n]|\\.)*'/,greedy:!0}],regex:[{pattern:RegExp(/\b(?:m|qr)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,b].join("|")+")"+/[msixpodualngc]*/.source),greedy:!0},{pattern:RegExp(/(^|[^-])\b(?:s|tr|y)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,/([a-zA-Z0-9])(?:(?!\3)[^\\]|\\[\s\S])*\3(?:(?!\3)[^\\]|\\[\s\S])*\3/.source,b+/\s*/.source+b].join("|")+")"+/[msixpodualngcer]*/.source),lookbehind:!0,greedy:!0},{pattern:/\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|x|xor)\b))/,greedy:!0}],variable:[/[&*$@%]\{\^[A-Z]+\}/,/[&*$@%]\^[A-Z_]/,/[&*$@%]#?(?=\{)/,/[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/,/[&*$@%]\d+/,/(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],filehandle:{pattern:/<(?![<=])\S*?>|\b_\b/,alias:"symbol"},"v-string":{pattern:/v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,alias:"string"},function:{pattern:/(\bsub[ \t]+)\w+/,lookbehind:!0},keyword:/\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/,punctuation:/[{}[\];(),:]/}}function qW(a){a.register(qF);function b(a,b){return"___"+a.toUpperCase()+b+"___"}Object.defineProperties(a.languages["markup-templating"]={},{buildPlaceholders:{value:function(c,d,e,f){if(c.language===d){var g=c.tokenStack=[];c.code=c.code.replace(e,function(a){if("function"==typeof f&&!f(a))return a;for(var e,h=g.length;-1!==c.code.indexOf(e=b(d,h));)++h;return g[h]=a,e}),c.grammar=a.languages.markup}}},tokenizePlaceholders:{value:function(c,d){if(c.language===d&&c.tokenStack){c.grammar=a.languages[d];var e=0,f=Object.keys(c.tokenStack);!function g(h){for(var i=0;i<h.length&&!(e>=f.length);i++){var j=h[i];if("string"==typeof j||j.content&&"string"==typeof j.content){var k=f[e],l=c.tokenStack[k],m="string"==typeof j?j:j.content,n=b(d,k),o=m.indexOf(n);if(o>-1){++e;var p=m.substring(0,o),q=new a.Token(d,a.tokenize(l,c.grammar),"language-"+d,l),r=m.substring(o+n.length),s=[];p&&s.push.apply(s,g([p])),s.push(q),r&&s.push.apply(s,g([r])),"string"==typeof j?h.splice.apply(h,[i,1].concat(s)):j.content=s}}else j.content&&g(j.content)}return h}(c.tokens)}}}})}function qX(a){var b,c,d,e,f,g,h;a.register(qW),b=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,c=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],d=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,e=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,f=/[{}\[\](),:;]/,a.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:b,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:c,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:d,operator:e,punctuation:f},h=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:g={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:a.languages.php}}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:g}}],a.languages.insertBefore("php","variable",{string:h,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:b,string:h,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:c,number:d,operator:e,punctuation:f}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),a.hooks.add("before-tokenize",function(b){/<\?/.test(b.code)&&a.languages["markup-templating"].buildPlaceholders(b,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g)}),a.hooks.add("after-tokenize",function(b){a.languages["markup-templating"].tokenizePlaceholders(b,"php")})}function qY(a){a.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},a.languages.python["string-interpolation"].inside.interpolation.inside.rest=a.languages.python,a.languages.py=a.languages.python}function qZ(a){a.languages.r={comment:/#.*/,string:{pattern:/(['"])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"percent-operator":{pattern:/%[^%\s]*%/,alias:"operator"},boolean:/\b(?:FALSE|TRUE)\b/,ellipsis:/\.\.(?:\.|\d+)/,number:[/\b(?:Inf|NaN)\b/,/(?:\b0x[\dA-Fa-f]+(?:\.\d*)?|\b\d+(?:\.\d*)?|\B\.\d+)(?:[EePp][+-]?\d+)?[iL]?/],keyword:/\b(?:NA|NA_character_|NA_complex_|NA_integer_|NA_real_|NULL|break|else|for|function|if|in|next|repeat|while)\b/,operator:/->?>?|<(?:=|<?-)?|[>=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/,punctuation:/[(){}\[\],;]/}}function q$(a){var b,c,d;a.register(qz),a.languages.ruby=a.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),a.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),b={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:a.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}},delete a.languages.ruby.function,c="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",d=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source,a.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+c+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:b,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:b,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+d),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+d+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),a.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+c),greedy:!0,inside:{interpolation:b,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:b,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:b,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+c),greedy:!0,inside:{interpolation:b,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:b,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete a.languages.ruby.string,a.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),a.languages.rb=a.languages.ruby}function q_(a){for(var b=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,c=0;c<2;c++)b=b.replace(/<self>/g,function(){return b});b=b.replace(/<self>/g,function(){return/[^\s\S]/.source}),a.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+b),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},a.languages.rust["closure-params"].inside.rest=a.languages.rust,a.languages.rust.attribute.inside.string=a.languages.rust.string}function q0(a){var b,c;a.register(qG),a.languages.sass=a.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),a.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete a.languages.sass.atrule,b=/\$[-\w]+|#\{\$[-\w]+\}/,c=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}],a.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:b,operator:c}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:b,operator:c,important:a.languages.sass.important}}}),delete a.languages.sass.property,delete a.languages.sass.important,a.languages.insertBefore("sass","punctuation",{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})}function q1(a){a.register(qG),a.languages.scss=a.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),a.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),a.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),a.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),a.languages.scss.atrule.inside.rest=a.languages.scss}function q2(a){a.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}}function q3(a){a.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*")+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},a.languages.swift["string-literal"].forEach(function(b){b.inside.interpolation.inside=a.languages.swift})}function q4(a){var b;a.register(qM),a.languages.typescript=a.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),a.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete a.languages.typescript.parameter,delete a.languages.typescript["literal-property"],b=a.languages.extend("typescript",{}),delete b["class-name"],a.languages.typescript["class-name"].inside=b,a.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:b}}}}),a.languages.ts=a.languages.typescript}function q5(a){a.languages.basic={comment:{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},string:{pattern:/"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SELECT CASE|SHARED|SHELL|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i,function:/\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i,operator:/<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i,punctuation:/[,;:()]/}}function q6(a){a.register(q5),a.languages.vbnet=a.languages.extend("basic",{comment:[{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},{pattern:/(^|[^\\:])'.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(^|[^"])"(?:""|[^"])*"(?!")/,lookbehind:!0,greedy:!0},keyword:/(?:\b(?:ADDHANDLER|ADDRESSOF|ALIAS|AND|ANDALSO|AS|BEEP|BLOAD|BOOLEAN|BSAVE|BYREF|BYTE|BYVAL|CALL(?: ABSOLUTE)?|CASE|CATCH|CBOOL|CBYTE|CCHAR|CDATE|CDBL|CDEC|CHAIN|CHAR|CHDIR|CINT|CLASS|CLEAR|CLNG|CLOSE|CLS|COBJ|COM|COMMON|CONST|CONTINUE|CSBYTE|CSHORT|CSNG|CSTR|CTYPE|CUINT|CULNG|CUSHORT|DATA|DATE|DECIMAL|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DEFAULT|DELEGATE|DIM|DIRECTCAST|DO|DOUBLE|ELSE|ELSEIF|END|ENUM|ENVIRON|ERASE|ERROR|EVENT|EXIT|FALSE|FIELD|FILES|FINALLY|FOR(?: EACH)?|FRIEND|FUNCTION|GET|GETTYPE|GETXMLNAMESPACE|GLOBAL|GOSUB|GOTO|HANDLES|IF|IMPLEMENTS|IMPORTS|IN|INHERITS|INPUT|INTEGER|INTERFACE|IOCTL|IS|ISNOT|KEY|KILL|LET|LIB|LIKE|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|ME|MKDIR|MOD|MODULE|MUSTINHERIT|MUSTOVERRIDE|MYBASE|MYCLASS|NAME|NAMESPACE|NARROWING|NEW|NEXT|NOT|NOTHING|NOTINHERITABLE|NOTOVERRIDABLE|OBJECT|OF|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPERATOR|OPTION(?: BASE)?|OPTIONAL|OR|ORELSE|OUT|OVERLOADS|OVERRIDABLE|OVERRIDES|PARAMARRAY|PARTIAL|POKE|PRIVATE|PROPERTY|PROTECTED|PUBLIC|PUT|RAISEEVENT|READ|READONLY|REDIM|REM|REMOVEHANDLER|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SBYTE|SELECT(?: CASE)?|SET|SHADOWS|SHARED|SHELL|SHORT|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|STRUCTURE|SUB|SWAP|SYNCLOCK|SYSTEM|THEN|THROW|TIMER|TO|TROFF|TRON|TRUE|TRY|TRYCAST|TYPE|TYPEOF|UINTEGER|ULONG|UNLOCK|UNTIL|USHORT|USING|VIEW PRINT|WAIT|WEND|WHEN|WHILE|WIDENING|WITH|WITHEVENTS|WRITE|WRITEONLY|XOR)|\B(?:#CONST|#ELSE|#ELSEIF|#END|#IF))(?:\$|\b)/i,punctuation:/[,;:(){}]/})}crypto.getRandomValues.bind(crypto),qz.displayName="clike",qz.aliases=[],qA.displayName="c",qA.aliases=[],qB.displayName="cpp",qB.aliases=[],qC.displayName="arduino",qC.aliases=["ino"],qD.displayName="bash",qD.aliases=["sh","shell"],qE.displayName="csharp",qE.aliases=["cs","dotnet"],qF.displayName="markup",qF.aliases=["atom","html","mathml","rss","ssml","svg","xml"],qG.displayName="css",qG.aliases=[],qH.displayName="diff",qH.aliases=[],qI.displayName="go",qI.aliases=[],qJ.displayName="ini",qJ.aliases=[],qK.displayName="java",qK.aliases=[],qL.displayName="regex",qL.aliases=[],qM.displayName="javascript",qM.aliases=["js"],qN.displayName="json",qN.aliases=["webmanifest"],qO.displayName="kotlin",qO.aliases=["kt","kts"],qP.displayName="less",qP.aliases=[],qQ.displayName="lua",qQ.aliases=[],qR.displayName="makefile",qR.aliases=[],qS.displayName="yaml",qS.aliases=["yml"],qT.displayName="markdown",qT.aliases=["md"],qU.displayName="objectivec",qU.aliases=["objc"],qV.displayName="perl",qV.aliases=[],qW.displayName="markup-templating",qW.aliases=[],qX.displayName="php",qX.aliases=[],qY.displayName="python",qY.aliases=["py"],qZ.displayName="r",qZ.aliases=[],q$.displayName="ruby",q$.aliases=["rb"],q_.displayName="rust",q_.aliases=[],q0.displayName="sass",q0.aliases=[],q1.displayName="scss",q1.aliases=[],q2.displayName="sql",q2.aliases=[],q3.displayName="swift",q3.aliases=[],q4.displayName="typescript",q4.aliases=["ts"],q5.displayName="basic",q5.aliases=[],q6.displayName="vbnet",q6.aliases=[];class q7{constructor(a,b,c){this.normal=b,this.property=a,c&&(this.space=c)}}function q8(a,b){let c={},d={};for(let b of a)Object.assign(c,b.property),Object.assign(d,b.normal);return new q7(c,d,b)}function q9(a){return a.toLowerCase()}q7.prototype.normal={},q7.prototype.property={},q7.prototype.space=void 0;class ra{constructor(a,b){this.attribute=b,this.property=a}}ra.prototype.attribute="",ra.prototype.booleanish=!1,ra.prototype.boolean=!1,ra.prototype.commaOrSpaceSeparated=!1,ra.prototype.commaSeparated=!1,ra.prototype.defined=!1,ra.prototype.mustUseProperty=!1,ra.prototype.number=!1,ra.prototype.overloadedBoolean=!1,ra.prototype.property="",ra.prototype.spaceSeparated=!1,ra.prototype.space=void 0;let rb=0,rc=rj(),rd=rj(),re=rj(),rf=rj(),rg=rj(),rh=rj(),ri=rj();function rj(){return 2**++rb}let rk=Object.keys(k);class rl extends ra{constructor(a,b,c,d){let e=-1;if(super(a,b),function(a,b,c){c&&(a[b]=c)}(this,"space",d),"number"==typeof c)for(;++e<rk.length;){let a=rk[e];!function(a,b,c){c&&(a[b]=c)}(this,rk[e],(c&k[a])===k[a])}}}function rm(a){let b={},c={};for(let[d,e]of Object.entries(a.properties)){let f=new rl(d,a.transform(a.attributes||{},d),e,a.space);a.mustUseProperty&&a.mustUseProperty.includes(d)&&(f.mustUseProperty=!0),b[d]=f,c[q9(d)]=d,c[q9(f.attribute)]=d}return new q7(b,c,a.space)}rl.prototype.defined=!0;let rn=rm({properties:{ariaActiveDescendant:null,ariaAtomic:rd,ariaAutoComplete:null,ariaBusy:rd,ariaChecked:rd,ariaColCount:rf,ariaColIndex:rf,ariaColSpan:rf,ariaControls:rg,ariaCurrent:null,ariaDescribedBy:rg,ariaDetails:null,ariaDisabled:rd,ariaDropEffect:rg,ariaErrorMessage:null,ariaExpanded:rd,ariaFlowTo:rg,ariaGrabbed:rd,ariaHasPopup:null,ariaHidden:rd,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:rg,ariaLevel:rf,ariaLive:null,ariaModal:rd,ariaMultiLine:rd,ariaMultiSelectable:rd,ariaOrientation:null,ariaOwns:rg,ariaPlaceholder:null,ariaPosInSet:rf,ariaPressed:rd,ariaReadOnly:rd,ariaRelevant:null,ariaRequired:rd,ariaRoleDescription:rg,ariaRowCount:rf,ariaRowIndex:rf,ariaRowSpan:rf,ariaSelected:rd,ariaSetSize:rf,ariaSort:null,ariaValueMax:rf,ariaValueMin:rf,ariaValueNow:rf,ariaValueText:null,role:null},transform:(a,b)=>"role"===b?b:"aria-"+b.slice(4).toLowerCase()});function ro(a,b){return b in a?a[b]:b}function rp(a,b){return ro(a,b.toLowerCase())}let rq=rm({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:rh,acceptCharset:rg,accessKey:rg,action:null,allow:null,allowFullScreen:rc,allowPaymentRequest:rc,allowUserMedia:rc,alpha:rc,alt:null,as:null,async:rc,autoCapitalize:null,autoComplete:rg,autoFocus:rc,autoPlay:rc,blocking:rg,capture:null,charSet:null,checked:rc,cite:null,className:rg,closedBy:null,colorSpace:null,cols:rf,colSpan:rf,command:null,commandFor:null,content:null,contentEditable:rd,controls:rc,controlsList:rg,coords:rf|rh,crossOrigin:null,data:null,dateTime:null,decoding:null,default:rc,defer:rc,dir:null,dirName:null,disabled:rc,download:re,draggable:rd,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:rc,formTarget:null,headers:rg,height:rf,hidden:re,high:rf,href:null,hrefLang:null,htmlFor:rg,httpEquiv:rg,id:null,imageSizes:null,imageSrcSet:null,inert:rc,inputMode:null,integrity:null,is:null,isMap:rc,itemId:null,itemProp:rg,itemRef:rg,itemScope:rc,itemType:rg,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:rc,low:rf,manifest:null,max:null,maxLength:rf,media:null,method:null,min:null,minLength:rf,multiple:rc,muted:rc,name:null,nonce:null,noModule:rc,noValidate:rc,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:rc,optimum:rf,pattern:null,ping:rg,placeholder:null,playsInline:rc,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:rc,referrerPolicy:null,rel:rg,required:rc,reversed:rc,rows:rf,rowSpan:rf,sandbox:rg,scope:null,scoped:rc,seamless:rc,selected:rc,shadowRootClonable:rc,shadowRootCustomElementRegistry:rc,shadowRootDelegatesFocus:rc,shadowRootMode:null,shadowRootSerializable:rc,shape:null,size:rf,sizes:null,slot:null,span:rf,spellCheck:rd,src:null,srcDoc:null,srcLang:null,srcSet:null,start:rf,step:null,style:null,tabIndex:rf,target:null,title:null,translate:null,type:null,typeMustMatch:rc,useMap:null,value:rd,width:rf,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:rg,axis:null,background:null,bgColor:null,border:rf,borderColor:null,bottomMargin:rf,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:rc,declare:rc,event:null,face:null,frame:null,frameBorder:null,hSpace:rf,leftMargin:rf,link:null,longDesc:null,lowSrc:null,marginHeight:rf,marginWidth:rf,noResize:rc,noHref:rc,noShade:rc,noWrap:rc,object:null,profile:null,prompt:null,rev:null,rightMargin:rf,rules:null,scheme:null,scrolling:rd,standby:null,summary:null,text:null,topMargin:rf,valueType:null,version:null,vAlign:null,vLink:null,vSpace:rf,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:rc,disablePictureInPicture:rc,disableRemotePlayback:rc,exportParts:rh,part:rg,prefix:null,property:null,results:rf,security:null,unselectable:null},space:"html",transform:rp}),rr=rm({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ri,accentHeight:rf,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:rf,amplitude:rf,arabicForm:null,ascent:rf,attributeName:null,attributeType:null,azimuth:rf,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:rf,by:null,calcMode:null,capHeight:rf,className:rg,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:rf,diffuseConstant:rf,direction:null,display:null,dur:null,divisor:rf,dominantBaseline:null,download:rc,dx:null,dy:null,edgeMode:null,editable:null,elevation:rf,enableBackground:null,end:null,event:null,exponent:rf,externalResourcesRequired:null,fill:null,fillOpacity:rf,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:rh,g2:rh,glyphName:rh,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:rf,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:rf,horizOriginX:rf,horizOriginY:rf,id:null,ideographic:rf,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:rf,k:rf,k1:rf,k2:rf,k3:rf,k4:rf,kernelMatrix:ri,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:rf,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:rf,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:rf,overlineThickness:rf,paintOrder:null,panose1:null,path:null,pathLength:rf,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:rg,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:rf,pointsAtY:rf,pointsAtZ:rf,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ri,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ri,rev:ri,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ri,requiredFeatures:ri,requiredFonts:ri,requiredFormats:ri,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:rf,specularExponent:rf,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:rf,strikethroughThickness:rf,string:null,stroke:null,strokeDashArray:ri,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:rf,strokeOpacity:rf,strokeWidth:null,style:null,surfaceScale:rf,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ri,tabIndex:rf,tableValues:null,target:null,targetX:rf,targetY:rf,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ri,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:rf,underlineThickness:rf,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:rf,values:null,vAlphabetic:rf,vMathematical:rf,vectorEffect:null,vHanging:rf,vIdeographic:rf,version:null,vertAdvY:rf,vertOriginX:rf,vertOriginY:rf,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:rf,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:ro}),rs=rm({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(a,b)=>"xlink:"+b.slice(5).toLowerCase()}),rt=rm({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:rp}),ru=rm({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(a,b)=>"xml:"+b.slice(3).toLowerCase()}),rv=q8([rn,rq,rs,rt,ru],"html"),rw=q8([rn,rr,rs,rt,ru],"svg");function rx(a){let b=[],c=String(a||""),d=c.indexOf(","),e=0,f=!1;for(;!f;){-1===d&&(d=c.length,f=!0);let a=c.slice(e,d).trim();(a||!f)&&b.push(a),e=d+1,d=c.indexOf(",",e)}return b}let ry=/[#.]/g,rz=/[A-Z]/g,rA=/-[a-z]/g,rB=/^data[-\w.:]+$/i;function rC(a){return"-"+a.toLowerCase()}function rD(a){return a.charAt(1).toUpperCase()}function rE(a){let b=String(a||"").trim();return b?b.split(/[ \t\n\r\f]+/g):[]}function rF(a,b,c){let d=c?function(a){let b=new Map;for(let c of a)b.set(c.toLowerCase(),c);return b}(c):void 0;return function(c,e,...f){let g;if(null==c)g={type:"root",children:[]},f.unshift(e);else{let h=(g=function(a,b){let c,d,e=a||"",f={},g=0;for(;g<e.length;){ry.lastIndex=g;let a=ry.exec(e),b=e.slice(g,a?a.index:e.length);b&&(c?"#"===c?f.id=b:Array.isArray(f.className)?f.className.push(b):f.className=[b]:d=b,g+=b.length),a&&(c=a[0],g++)}return{type:"element",tagName:d||b||"div",properties:f,children:[]}}(c,b)).tagName.toLowerCase(),i=d?d.get(h):void 0;if(g.tagName=i||h,function(a){if(null===a||"object"!=typeof a||Array.isArray(a))return!0;if("string"!=typeof a.type)return!1;for(let b of Object.keys(a)){let c=a[b];if(c&&"object"==typeof c){if(!Array.isArray(c))return!0;for(let a of c)if("number"!=typeof a&&"string"!=typeof a)return!0}}return!!("children"in a&&Array.isArray(a.children))}(e))f.unshift(e);else for(let[b,c]of Object.entries(e))!function(a,b,c,d){let e,f=function(a,b){let c=q9(b),d=b,e=ra;if(c in a.normal)return a.property[a.normal[c]];if(c.length>4&&"data"===c.slice(0,4)&&rB.test(b)){if("-"===b.charAt(4)){let a=b.slice(5).replace(rA,rD);d="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{let a=b.slice(4);if(!rA.test(a)){let c=a.replace(rz,rC);"-"!==c.charAt(0)&&(c="-"+c),b="data"+c}}e=rl}return new e(d,b)}(a,c);if(null!=d){if("number"==typeof d){if(Number.isNaN(d))return;e=d}else e="boolean"==typeof d?d:"string"==typeof d?f.spaceSeparated?rE(d):f.commaSeparated?rx(d):f.commaOrSpaceSeparated?rE(rx(d).join(" ")):rG(f,f.property,d):Array.isArray(d)?[...d]:"style"===f.property?function(a){let b=[];for(let[c,d]of Object.entries(a))b.push([c,d].join(": "));return b.join("; ")}(d):String(d);if(Array.isArray(e)){let a=[];for(let b of e)a.push(rG(f,f.property,b));e=a}"className"===f.property&&Array.isArray(b.className)&&(e=b.className.concat(e)),b[f.property]=e}}(a,g.properties,b,c)}for(let a of f)!function a(b,c){if(null==c);else if("number"==typeof c||"string"==typeof c)b.push({type:"text",value:String(c)});else if(Array.isArray(c))for(let d of c)a(b,d);else if("object"==typeof c&&"type"in c)"root"===c.type?a(b,c.children):b.push(c);else throw Error("Expected node, nodes, or string, got `"+c+"`")}(g.children,a);return"element"===g.type&&"template"===g.tagName&&(g.content={type:"root",children:g.children},g.children=[]),g}}function rG(a,b,c){if("string"==typeof c){if(a.number&&c&&!Number.isNaN(Number(c)))return Number(c);if((a.boolean||a.overloadedBoolean)&&(""===c||q9(c)===q9(b)))return!0}return c}let rH=rF(rv,"div");rF(rw,"g",["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"]);let rI=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],rJ={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};function rK(a){let b="string"==typeof a?a.charCodeAt(0):a;return b>=48&&b<=57}function rL(a){let b="string"==typeof a?a.charCodeAt(0):a;return b>=97&&b<=102||b>=65&&b<=70||b>=48&&b<=57}function rM(a){return function(a){let b="string"==typeof a?a.charCodeAt(0):a;return b>=97&&b<=122||b>=65&&b<=90}(a)||rK(a)}let rN=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];var rO=0,rP={},rQ={util:{type:function(a){return Object.prototype.toString.call(a).slice(8,-1)},objId:function(a){return a.__id||Object.defineProperty(a,"__id",{value:++rO}),a.__id},clone:function a(b,c){var d,e;switch(c=c||{},rQ.util.type(b)){case"Object":if(c[e=rQ.util.objId(b)])return c[e];for(var f in d={},c[e]=d,b)b.hasOwnProperty(f)&&(d[f]=a(b[f],c));return d;case"Array":if(c[e=rQ.util.objId(b)])return c[e];return d=[],c[e]=d,b.forEach(function(b,e){d[e]=a(b,c)}),d;default:return b}}},languages:{plain:rP,plaintext:rP,text:rP,txt:rP,extend:function(a,b){var c=rQ.util.clone(rQ.languages[a]);for(var d in b)c[d]=b[d];return c},insertBefore:function(a,b,c,d){var e=(d=d||rQ.languages)[a],f={};for(var g in e)if(e.hasOwnProperty(g)){if(g==b)for(var h in c)c.hasOwnProperty(h)&&(f[h]=c[h]);c.hasOwnProperty(g)||(f[g]=e[g])}var i=d[a];return d[a]=f,rQ.languages.DFS(rQ.languages,function(b,c){c===i&&b!=a&&(this[b]=f)}),f},DFS:function a(b,c,d,e){e=e||{};var f=rQ.util.objId;for(var g in b)if(b.hasOwnProperty(g)){c.call(b,g,b[g],d||g);var h=b[g],i=rQ.util.type(h);"Object"!==i||e[f(h)]?"Array"!==i||e[f(h)]||(e[f(h)]=!0,a(h,c,g,e)):(e[f(h)]=!0,a(h,c,null,e))}}},plugins:{},highlight:function(a,b,c){var d={code:a,grammar:b,language:c};if(rQ.hooks.run("before-tokenize",d),!d.grammar)throw Error('The language "'+d.language+'" has no grammar.');return d.tokens=rQ.tokenize(d.code,d.grammar),rQ.hooks.run("after-tokenize",d),rR.stringify(rQ.util.encode(d.tokens),d.language)},tokenize:function(a,b){var c=b.rest;if(c){for(var d in c)b[d]=c[d];delete b.rest}var e=new rT;return rU(e,e.head,a),function a(b,c,d,e,f,g){for(var h in d)if(d.hasOwnProperty(h)&&d[h]){var i=d[h];i=Array.isArray(i)?i:[i];for(var j=0;j<i.length;++j){if(g&&g.cause==h+","+j)return;var k=i[j],l=k.inside,m=!!k.lookbehind,n=!!k.greedy,o=k.alias;if(n&&!k.pattern.global){var p=k.pattern.toString().match(/[imsuy]*$/)[0];k.pattern=RegExp(k.pattern.source,p+"g")}for(var q=k.pattern||k,r=e.next,s=f;r!==c.tail&&(!g||!(s>=g.reach));s+=r.value.length,r=r.next){var t,u=r.value;if(c.length>b.length)return;if(!(u instanceof rR)){var v=1;if(n){if(!(t=rS(q,s,b,m))||t.index>=b.length)break;var w=t.index,x=t.index+t[0].length,y=s;for(y+=r.value.length;w>=y;)y+=(r=r.next).value.length;if(y-=r.value.length,s=y,r.value instanceof rR)continue;for(var z=r;z!==c.tail&&(y<x||"string"==typeof z.value);z=z.next)v++,y+=z.value.length;v--,u=b.slice(s,y),t.index-=s}else if(!(t=rS(q,0,u,m)))continue;var w=t.index,A=t[0],B=u.slice(0,w),C=u.slice(w+A.length),D=s+u.length;g&&D>g.reach&&(g.reach=D);var E=r.prev;if(B&&(E=rU(c,E,B),s+=B.length),function(a,b,c){for(var d=b.next,e=0;e<c&&d!==a.tail;e++)d=d.next;b.next=d,d.prev=b,a.length-=e}(c,E,v),r=rU(c,E,new rR(h,l?rQ.tokenize(A,l):A,o,A)),C&&rU(c,r,C),v>1){var F={cause:h+","+j,reach:D};a(b,c,d,r.prev,s,F),g&&F.reach>g.reach&&(g.reach=F.reach)}}}}}}(a,e,b,e.head,0),function(a){for(var b=[],c=a.head.next;c!==a.tail;)b.push(c.value),c=c.next;return b}(e)},hooks:{all:{},add:function(a,b){var c=rQ.hooks.all;c[a]=c[a]||[],c[a].push(b)},run:function(a,b){var c=rQ.hooks.all[a];if(c&&c.length)for(var d,e=0;d=c[e++];)d(b)}},Token:rR};function rR(a,b,c,d){this.type=a,this.content=b,this.alias=c,this.length=0|(d||"").length}function rS(a,b,c,d){a.lastIndex=b;var e=a.exec(c);if(e&&d&&e[1]){var f=e[1].length;e.index+=f,e[0]=e[0].slice(f)}return e}function rT(){var a={value:null,prev:null,next:null},b={value:null,prev:a,next:null};a.next=b,this.head=a,this.tail=b,this.length=0}function rU(a,b,c){var d=b.next,e={value:c,prev:b,next:d};return b.next=e,d.prev=e,a.length++,e}function rV(){}rV.prototype=rQ;let rW=new rV;function rX(a,b,c,d=c.listLanguages()){let{highlight:e}=c,{language:f}=a.attrs;if(!f||!d.includes(f))return console.warn("Unsupported language detected, this language has not been supported by current prism config: ",f),[];let g=[],h=b+1;return(function a(b,c=[]){return b.flatMap(b=>"element"===b.type?a(b.children,[...c,...b.properties?.className||[]]):[{text:b.value,className:c}])})(e(a.textContent,f).children).forEach(a=>{let b=h+a.text.length;a.className.length&&g.push(k5.inline(h,b,{class:a.className.join(" ")})),h=b}),g}function rY(a,b,c){let d=c.listLanguages(),e=iP(a=>a.type.name===b)(a).flatMap(a=>rX(a.node,a.pos,c,d));return k8.create(a,e)}rW.highlight=function(a,b){let c,d;if("string"!=typeof a)throw TypeError("Expected `string` for `value`, got `"+a+"`");if(b&&"object"==typeof b)c=b;else{if("string"!=typeof(d=b))throw TypeError("Expected `string` for `name`, got `"+d+"`");if(Object.hasOwn(rW.languages,d))c=rW.languages[d];else throw Error("Unknown language: `"+d+"` is not registered")}return{type:"root",children:rQ.highlight.call(rW,a,c,d)}},rW.register=function(a){if("function"!=typeof a||!a.displayName)throw Error("Expected `function` for `syntax`, got `"+a+"`");Object.hasOwn(rW.languages,a.displayName)||a(rW)},rW.alias=function(a,b){let c,d=rW.languages,e={};for(c in"string"==typeof a?b&&(e[a]=b):e=a,e)if(Object.hasOwn(e,c)){let a=e[c],b="string"==typeof a?[a]:a,f=-1;for(;++f<b.length;)d[b[f]]=d[c]}},rW.registered=function(a){if("string"!=typeof a)throw TypeError("Expected `string` for `aliasOrLanguage`, got `"+a+"`");return Object.hasOwn(rW.languages,a)},rW.listLanguages=function(){let a,b=rW.languages,c=[];for(a in b)Object.hasOwn(b,a)&&"object"==typeof b[a]&&c.push(a);return c},rW.util.encode=function(a){return a},rW.Token.stringify=function a(b,c){if("string"==typeof b)return{type:"text",value:b};if(Array.isArray(b)){let d=[],e=-1;for(;++e<b.length;)null!==b[e]&&void 0!==b[e]&&""!==b[e]&&d.push(a(b[e],c));return d}let d={attributes:{},classes:["token",b.type],content:a(b.content,c),language:c,tag:"span",type:b.type};return b.alias&&d.classes.push(..."string"==typeof b.alias?[b.alias]:b.alias),rW.hooks.run("wrap",d),rH(d.tag+"."+d.classes.join("."),function(a){let b;for(b in a)Object.hasOwn(a,b)&&(a[b]=function(a,b){let c,d,e,f={},g="string"==typeof f.additional?f.additional.charCodeAt(0):f.additional,h=[],i=0,j=-1,k="";f.position&&("start"in f.position||"indent"in f.position?(d=f.position.indent,c=f.position.start):c=f.position);let l=(c?c.line:0)||1,m=(c?c.column:0)||1,n=q();for(i--;++i<=a.length;)if(10===e&&(m=(d?d[j]:0)||1),38===(e=a.charCodeAt(i))){let b,c=a.charCodeAt(i+1);if(9===c||10===c||12===c||32===c||38===c||60===c||Number.isNaN(c)||g&&c===g){k+=String.fromCharCode(e),m++;continue}let d=i+1,j=d,l=d;if(35===c){l=++j;let c=a.charCodeAt(l);88===c||120===c?(b="hexadecimal",l=++j):b="decimal"}else b="named";let t="",u="",v="",w="named"===b?rM:"decimal"===b?rK:rL;for(l--;++l<=a.length;){let c=a.charCodeAt(l);if(!w(c))break;v+=String.fromCharCode(c),"named"===b&&rI.includes(v)&&(t=v,u=ez(v))}let x=59===a.charCodeAt(l);if(x){l++;let a="named"===b&&ez(v);a&&(t=v,u=a)}let y=1+l-d,z="";if(x||!1!==f.nonTerminated)if(v)if("named"===b){if(x&&!u)r(5,1);else if(t!==v&&(y=1+(l=j+t.length)-j,x=!1),!x){let b=t?1:3;if(f.attribute){let c=a.charCodeAt(l);61===c?(r(b,y),u=""):rM(c)?u="":r(b,y)}else r(b,y)}z=u}else{var o,p;x||r(2,y);let a=Number.parseInt(v,"hexadecimal"===b?16:10);if((o=a)>=55296&&o<=57343||o>1114111)r(7,y),z=String.fromCharCode(65533);else if(a in rJ)r(6,y),z=rJ[a];else{let b="";((p=a)>=1&&p<=8||11===p||p>=13&&p<=31||p>=127&&p<=159||p>=64976&&p<=65007||(65535&p)==65535||(65535&p)==65534)&&r(6,y),a>65535&&(a-=65536,b+=String.fromCharCode(a>>>10|55296),a=56320|1023&a),z=b+String.fromCharCode(a)}}else"named"!==b&&r(4,y);if(z){s(),n=q(),i=l-1,m+=l-d+1,h.push(z);let b=q();b.offset++,f.reference&&f.reference.call(f.referenceContext||void 0,z,{start:n,end:b},a.slice(d-1,l)),n=b}else v=a.slice(d-1,l),k+=v,m+=v.length,i=l-1}else 10===e&&(l++,j++,m=0),Number.isNaN(e)?s():(k+=String.fromCharCode(e),m++);return h.join("");function q(){return{line:l,column:m,offset:i+((c?c.offset:0)||0)}}function r(a,b){let c;f.warning&&(c=q(),c.column+=b,c.offset+=b,f.warning.call(f.warningContext||void 0,rN[a],c,a))}function s(){k&&(h.push(k),f.text&&f.text.call(f.textContext||void 0,k,{start:n,end:q()}),k="")}}(a[b]));return a}(d.attributes),d.content)},rW.register(qz),rW.register(qA),rW.register(qB),rW.register(qC),rW.register(qD),rW.register(qE),rW.register(qF),rW.register(qG),rW.register(qH),rW.register(qI),rW.register(qJ),rW.register(qK),rW.register(qL),rW.register(qM),rW.register(qN),rW.register(qO),rW.register(qP),rW.register(qQ),rW.register(qR),rW.register(qS),rW.register(qT),rW.register(qU),rW.register(qV),rW.register(qW),rW.register(qX),rW.register(qY),rW.register(qZ),rW.register(q$),rW.register(q_),rW.register(q0),rW.register(q1),rW.register(q2),rW.register(q3),rW.register(q4),rW.register(q5),rW.register(q6);var rZ=mF({configureRefractor:()=>{}},"prismConfig");rZ.meta={package:"@milkdown/plugin-prism",displayName:"Ctx<prism>"};var r$=mE(a=>{let{configureRefractor:b}=a.get(rZ.key),c="code_block",d=b(rW)??rW;return new hW({key:new hZ("MILKDOWN_PRISM"),state:{init:(a,{doc:b})=>rY(b,c,d),apply:(a,b,e,f)=>{if(!a.docChanged)return b;let g=function(a,b){let c=a.content.findDiffStart(b.content);if(null==c)return null;let d=a.content.findDiffEnd(b.content);if(!d)return null;let e=Math.max(d.b,c),f=b.resolve(c),g=b.resolve(e);return f.sameParent(g)&&f.parent.isTextblock?{node:f.parent,pos:f.before(f.depth)}:null}(e.doc,f.doc);if(g){let e=b.map(a.mapping,a.doc);if(g.node.type.name!==c)return e;let f=g.pos,h=f+g.node.nodeSize;return e.remove(e.find(f+1,h-1)).add(a.doc,rX(g.node,f,d))}let h=f.selection.$head.parent.type.name===c,i=e.selection.$head.parent.type.name===c;return h||i||(()=>{let b=iP(a=>a.type.name===c)(e.doc),d=iP(a=>a.type.name===c)(f.doc);return b.length!==d.length||b.some((a,b)=>a.node.attrs.language!==d[b]?.node.attrs.language)||a.steps.some(a=>void 0!==a.from&&void 0!==a.to&&b.some(b=>b.pos>=a.from&&b.pos+b.node.nodeSize<=a.to))})()?rY(a.doc,c,d):b.map(a.mapping,a.doc)}},props:{decorations(a){return this.getState(a)}}})});r$.meta={package:"@milkdown/plugin-prism",displayName:"Prose<prism>"};var r_=[r$,rZ];function r0(a){a.register(qM),a.register(qF),function(a){var b=a.util.clone(a.languages.javascript),c=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,d=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,e=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function f(a,b){return RegExp(a=a.replace(/<S>/g,function(){return c}).replace(/<BRACES>/g,function(){return d}).replace(/<SPREAD>/g,function(){return e}),b)}e=f(e).source,a.languages.jsx=a.languages.extend("markup",b),a.languages.jsx.tag.pattern=f(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),a.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,a.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,a.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,a.languages.jsx.tag.inside.comment=b.comment,a.languages.insertBefore("inside","attr-name",{spread:{pattern:f(/<SPREAD>/.source),inside:a.languages.jsx}},a.languages.jsx.tag),a.languages.insertBefore("inside","special-attr",{script:{pattern:f(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:a.languages.jsx}}},a.languages.jsx.tag);var g=function(a){return a?"string"==typeof a?a:"string"==typeof a.content?a.content:a.content.map(g).join(""):""},h=function(b){for(var c=[],d=0;d<b.length;d++){var e=b[d],f=!1;if("string"!=typeof e&&("tag"===e.type&&e.content[0]&&"tag"===e.content[0].type?"</"===e.content[0].content[0].content?c.length>0&&c[c.length-1].tagName===g(e.content[0].content[1])&&c.pop():"/>"===e.content[e.content.length-1].content||c.push({tagName:g(e.content[0].content[1]),openedBraces:0}):c.length>0&&"punctuation"===e.type&&"{"===e.content?c[c.length-1].openedBraces++:c.length>0&&c[c.length-1].openedBraces>0&&"punctuation"===e.type&&"}"===e.content?c[c.length-1].openedBraces--:f=!0),(f||"string"==typeof e)&&c.length>0&&0===c[c.length-1].openedBraces){var i=g(e);d<b.length-1&&("string"==typeof b[d+1]||"plain-text"===b[d+1].type)&&(i+=g(b[d+1]),b.splice(d+1,1)),d>0&&("string"==typeof b[d-1]||"plain-text"===b[d-1].type)&&(i=g(b[d-1])+i,b.splice(d-1,1),d--),b[d]=new a.Token("plain-text",i,null,i)}e.content&&"string"!=typeof e.content&&h(e.content)}};a.hooks.add("after-tokenize",function(a){("jsx"===a.language||"tsx"===a.language)&&h(a.tokens)})}(a)}function r1(a){var b,c;a.register(r0),a.register(q4),b=a.util.clone(a.languages.typescript),a.languages.tsx=a.languages.extend("jsx",b),delete a.languages.tsx.parameter,delete a.languages.tsx["literal-property"],(c=a.languages.tsx.tag).pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+c.pattern.source+")",c.pattern.flags),c.lookbehind=!0}r0.displayName="jsx",r0.aliases=[],r1.displayName="tsx",r1.aliases=[];var r2={light:{background:{primary:"#F7F7F5",secondary:"#FFFFFF",tertiary:"#F6F5F4"},text:{primary:"#1F1F1F",secondary:"#6B6B6B",disabled:"#9B9B9B"},border:{default:"#E5E5E5",strong:"#D3D3D3"},accent:{blue:"#2383E2",green:"#0F7B6C",orange:"#DFAB01",red:"#E03E3E"}},dark:{background:{primary:"#191919",secondary:"#202020",tertiary:"#2A2A2A"},text:{primary:"#E8E8E8",secondary:"#9B9B9B",disabled:"#6B6B6B"},border:{default:"#333333",strong:"#444444"},accent:{blue:"#4A9EFF",green:"#2A9D99",orange:"#E5B73B",red:"#FF5C5C"}}},r3={fontFamily:{sans:["Inter","-apple-system","BlinkMacSystemFont","Segoe UI","sans-serif"],mono:["SFMono-Regular","Menlo","Consolas","monospace"]},fontSize:{xs:"12px",sm:"14px",base:"16px",lg:"20px",xl:"24px","2xl":"32px","3xl":"48px"},fontWeight:{normal:"400",medium:"500",semibold:"600",bold:"700"},lineHeight:{tight:1.25,normal:1.5,relaxed:1.75}},r4={0:"0px",1:"4px",2:"8px",3:"12px",4:"16px",6:"24px",8:"32px",12:"48px",16:"64px"},r5={none:"0px",sm:"4px",md:"8px",lg:"12px",full:"9999px"},r6={card:"0 1px 3px rgba(0,0,0,0.1)",popover:"0 4px 12px rgba(0,0,0,0.15)",modal:"0 8px 24px rgba(0,0,0,0.2)"},r7={name:"light",colors:r2.light,typography:r3,spacing:r4,radius:r5,shadow:r6},r8={name:"dark",colors:r2.dark,typography:r3,spacing:r4,radius:r5,shadow:r6};r2.light.background,r2.light.text.primary,r2.light.text.secondary,r2.light.border,r2.light.accent,r3.fontFamily,r3.fontSize,r3.fontWeight;var r9={defaultValue:"",highlight:!0,theme:"light"};function sa(a,b){var c=(a=>{let b=J();return((a,b)=>{let{type:c,tname:d,item:e,assoc:f}=b;if(null!==e)M(a,0),bA(a,e);else if(null!==d)L(a,1),Q(a,d);else if(null!==c)L(a,2),bA(a,c);else throw ac();return N(a,f)})(b,a),K(b)})(((a,b,c=0)=>{let d=a._start;if(c<0){if(0===b)return bF(a,null,c);b--}for(;null!==d;){if(!d.deleted&&d.countable){if(d.length>b)return bF(a,bz(d.id.client,d.id.clock+b),c);b-=d.length}if(null===d.right&&c<0)return bF(a,d.lastId,c);d=d.right}return bF(a,null,c)})(a,b));let d="";for(let a=0;a<c.length;a++)d+=String.fromCharCode(c[a]);return btoa(d)}function sb(a,b){try{let c,d=(c=function(a){let b=atob(a),c=new Uint8Array(b.length);for(let a=0;a<b.length;a++)c[a]=b.charCodeAt(a);return c}(b),(a=>{let b=null,c=null,d=null;switch(ak(a)){case 0:d=bB(a);break;case 1:c=am(a);break;case 2:b=bB(a)}return new bD(b,c,d,ah(a)?al(a):0)})(ag(c))),e=a.doc;if(!e)return null;let f=((a,b,c=!0)=>{let d=b.store,e=a.item,f=a.type,g=a.tname,h=a.assoc,i=null,j=0;if(null!==e){if(bL(d,e.client)<=e.clock)return null;let a=c?dd(d,e):((a,b)=>{let c=bO(a,b),d=b.clock-c.id.clock;return{item:c,diff:d}})(d,e),b=a.item;if(!(b instanceof df))return null;if(null===(i=b.parent)._item||!i._item.deleted){j=b.deleted||!b.countable?0:a.diff+(h>=0?0:1);let c=b.left;for(;null!==c;)!c.deleted&&c.countable&&(j+=c.length),c=c.left}}else{if(null!==g)i=b.get(g);else if(null!==f){if(bL(d,f.client)<=f.clock)return null;let{item:a}=c?dd(d,f):{item:bO(d,f)};if(!(a instanceof df)||!(a.content instanceof dc))return null;i=a.content.type}else throw ac();j=h>=0?i._length:0}return((a,b,c=0)=>new bE(a,b,c))(i,j,a.assoc)})(d,e);if(!f||f.type!==a)return null;return f.index}catch{return null}}var sc=class{constructor(a){this.connected=!1,this.doc=new bf,this.awareness=new o_(this.doc),a.user&&this.awareness.setLocalState({user:a.user}),this.provider=new qy({url:a.serverUrl,name:a.roomId,document:this.doc,awareness:this.awareness,onStatus:({status:a})=>{this.connected="connected"===a}})}get isConnected(){return this.connected}get content(){return this.doc.getText("content")}getAwarenessUsers(){let a=[];return this.awareness.getStates().forEach((b,c)=>{let d=b?.user;d?.name&&d?.color&&a.push({clientId:c,user:d})}),a}connect(){this.provider.connect()}setLocalSelection(a,b){let c={anchor:sa(this.content,a),head:sa(this.content,b)};this.awareness.setLocalStateField("selection",c)}getRemoteCursors(){let a=[];return this.awareness.getStates().forEach((b,c)=>{if(c===this.doc.clientID)return;let d=b?.user,e=b?.selection;if(!d?.name||!d?.color||!e)return;let f=function(a,b){let c=sb(a,b.anchor),d=sb(a,b.head);return null===c||null===d?null:{anchor:c,head:d}}(this.content,e);f&&a.push({clientId:c,user:d,anchor:f.anchor,head:f.head})}),a}disconnect(){this.provider.disconnect()}destroy(){this.provider.destroy(),this.awareness.destroy(),this.doc.destroy()}},sd="colla-md:milkdown",se="colla-md:textarea";function sf(a,b,c){let d=a.toString();if(d===b)return;let e=0,f=Math.min(d.length,b.length);for(;e<f&&d[e]===b[e];)e++;let g=d.length,h=b.length;for(;g>e&&h>e&&d[g-1]===b[h-1];)g--,h--;let i=g-e,j=b.slice(e,h),k=a.doc;k&&k.transact(()=>{i>0&&a.delete(e,i),j&&a.insert(e,j)},c)}function sg(a){return a.replace(/^\\#/gm,"#")}var sh=[qM,q4,r1,r0,qF,qG,qT,qN,qD,qY],si={parseMarkdown:{match:()=>!1,runner:()=>{}},toMarkdown:{match:()=>!1,runner:()=>{}}},sj=[mD("callout",()=>({group:"block",content:"block+",attrs:{type:{default:"info"}},parseDOM:[{tag:"div.callout",getAttrs:a=>({type:a.dataset.type??"info"})}],toDOM:a=>["div",{class:`callout callout--${a.attrs.type}`,"data-type":a.attrs.type},0],...si})),mD("columns",()=>({group:"block",content:"column+",attrs:{columns:{default:2}},parseDOM:[{tag:"div.columns",getAttrs:a=>({columns:Number(a.dataset.columns)||2})}],toDOM:a=>["div",{class:"columns","data-columns":a.attrs.columns},0],...si})),mD("column",()=>({group:"block",content:"block+",parseDOM:[{tag:"div.column"}],toDOM:()=>["div",{class:"column"},0],...si})),mD("card",()=>({group:"block",content:"block+",attrs:{title:{default:""}},parseDOM:[{tag:"div.card",getAttrs:a=>({title:a.dataset.title??""})}],toDOM:a=>["div",{class:"card","data-title":a.attrs.title},0],...si}))],sk='ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, "Apple Color Emoji", Arial, sans-serif',sl='SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace',sm=`
|
|
3
|
+
.colla-md {
|
|
4
|
+
font-family: ${sk};
|
|
5
|
+
font-size: 16px;
|
|
6
|
+
line-height: 1.5;
|
|
7
|
+
color: var(--cf-text-primary);
|
|
8
|
+
font-weight: 400;
|
|
9
|
+
word-break: break-word;
|
|
10
|
+
-webkit-font-smoothing: antialiased;
|
|
11
|
+
}
|
|
12
|
+
.colla-md h1 { font-size: 1.875em; font-weight: 700; line-height: 1.3; margin: 1.4em 0 0.2em; }
|
|
13
|
+
.colla-md h2 { font-size: 1.5em; font-weight: 600; line-height: 1.3; margin: 1.2em 0 0.2em; }
|
|
14
|
+
.colla-md h3 { font-size: 1.25em; font-weight: 600; line-height: 1.3; margin: 1em 0 0.2em; }
|
|
15
|
+
.colla-md h4 { font-size: 1em; font-weight: 600; line-height: 1.3; margin: 0.8em 0 0.2em; }
|
|
16
|
+
.colla-md h5, .colla-md h6 { font-size: 0.875em; font-weight: 600; line-height: 1.3; margin: 0.8em 0 0.2em; }
|
|
17
|
+
.colla-md p { margin: 0; padding: 3px 2px; line-height: 1.5; }
|
|
18
|
+
.colla-md ul, .colla-md ol { margin: 0; padding-left: 1.6em; padding-top: 2px; padding-bottom: 2px; }
|
|
19
|
+
.colla-md li { margin: 2px 0; }
|
|
20
|
+
.colla-md li > p { padding: 0; }
|
|
21
|
+
.colla-md :not(pre) > code {
|
|
22
|
+
font-family: ${sl};
|
|
23
|
+
background: rgba(135, 131, 120, 0.15);
|
|
24
|
+
color: var(--cf-text-primary);
|
|
25
|
+
border-radius: 4px;
|
|
26
|
+
padding: 0.2em 0.4em;
|
|
27
|
+
font-size: 0.85em;
|
|
28
|
+
}
|
|
29
|
+
.colla-md pre {
|
|
30
|
+
font-family: ${sl};
|
|
31
|
+
background: var(--cf-bg-tertiary);
|
|
32
|
+
color: var(--cf-text-primary);
|
|
33
|
+
border-radius: 4px;
|
|
34
|
+
padding: 1em 1.2em;
|
|
35
|
+
margin: 4px 0;
|
|
36
|
+
overflow: auto;
|
|
37
|
+
font-size: 0.85em;
|
|
38
|
+
line-height: 1.45;
|
|
39
|
+
}
|
|
40
|
+
.colla-md pre code { font-family: inherit; background: none; padding: 0; }
|
|
41
|
+
.colla-md blockquote {
|
|
42
|
+
border-left: 3px solid var(--cf-border-strong);
|
|
43
|
+
padding-left: 12px;
|
|
44
|
+
margin: 4px 0;
|
|
45
|
+
color: var(--cf-text-secondary);
|
|
46
|
+
}
|
|
47
|
+
.colla-md a { color: var(--cf-accent-blue); text-decoration: none; }
|
|
48
|
+
.colla-md a:hover { text-decoration: underline; }
|
|
49
|
+
.colla-md strong { font-weight: 600; }
|
|
50
|
+
.colla-md hr { border: none; border-top: 1px solid var(--cf-border-default); margin: 6px 0; }
|
|
51
|
+
.colla-md img { max-width: 100%; border-radius: 4px; }
|
|
52
|
+
`,sn=`
|
|
53
|
+
.colla-rc-cursor {
|
|
54
|
+
position: absolute;
|
|
55
|
+
width: 2px;
|
|
56
|
+
pointer-events: none;
|
|
57
|
+
z-index: 20;
|
|
58
|
+
}
|
|
59
|
+
.colla-rc-label {
|
|
60
|
+
position: absolute;
|
|
61
|
+
top: -1.25em;
|
|
62
|
+
left: -1px;
|
|
63
|
+
font-size: 11px;
|
|
64
|
+
line-height: 1;
|
|
65
|
+
padding: 2px 5px;
|
|
66
|
+
border-radius: 3px 3px 3px 0;
|
|
67
|
+
color: #fff;
|
|
68
|
+
white-space: nowrap;
|
|
69
|
+
font-family: ${sk};
|
|
70
|
+
pointer-events: none;
|
|
71
|
+
user-select: none;
|
|
72
|
+
z-index: 21;
|
|
73
|
+
}
|
|
74
|
+
`,so="colla-md-notion-style",sp="colla-md-collab-cursor";async function sq(a){let b={root:a.root,defaultValue:a.defaultValue??r9.defaultValue,highlight:a.highlight??r9.highlight,theme:a.theme??r9.theme,collab:a.collab,plugins:a.plugins,onChange:a.onChange,onAwarenessChange:a.onAwarenessChange},c=b.collab?new sc(b.collab):null,d=c?c.content:new bf().getText("content");0===d.length&&b.defaultValue&&d.insert(0,b.defaultValue);let{plugins:e,configureHighlight:f}=function(a,b){let c=a.highlight?function(a){if(a?.type==="shiki")return{plugins:r_};for(let a of sh)rW.register(a);return{plugins:r_,configure:a=>{a.set(rZ.key,{configureRefractor:a=>a})}}}(!0===a.highlight?void 0:a.highlight):null;return{plugins:[function(a="light"){return b=>async()=>{await b.wait(mn);let c=b.get(mr),d="dark"===a?r8.colors:r7.colors;c.classList.add("colla-md",`colla-md--${a}`),c.dataset.theme=a,c.style.cssText+=`--cf-bg-primary: ${d.background.primary};
|
|
75
|
+
--cf-bg-secondary: ${d.background.secondary};
|
|
76
|
+
--cf-bg-tertiary: ${d.background.tertiary};
|
|
77
|
+
--cf-text-primary: ${d.text.primary};
|
|
78
|
+
--cf-text-secondary: ${d.text.secondary};
|
|
79
|
+
--cf-text-disabled: ${d.text.disabled};
|
|
80
|
+
--cf-border-default: ${d.border.default};
|
|
81
|
+
--cf-border-strong: ${d.border.strong};
|
|
82
|
+
--cf-accent-blue: ${d.accent.blue};
|
|
83
|
+
--cf-accent-green: ${d.accent.green};
|
|
84
|
+
--cf-accent-orange: ${d.accent.orange};
|
|
85
|
+
--cf-accent-red: ${d.accent.red};
|
|
86
|
+
--colla-md-selection: color-mix(in srgb, ${d.accent.blue} 15%, transparent);`,function(){if(document.getElementById(so))return;let a=document.createElement("style");a.id=so,a.textContent=sm,document.head.appendChild(a)}(),function(){if(document.getElementById(sp))return;let a=document.createElement("style");a.id=sp,a.textContent=sn,document.head.appendChild(a)}()}}(a.theme),...c?.plugins??[],...sj,...a.plugins??[],a=>async()=>{await a.wait(lN);let c=a.get(lE);b.observe((a,d)=>{d.origin!==sd&&c.action(mM(b.toString()))}),a.get(oO).markdownUpdated((a,c)=>{sf(b,sg(c),sd)})}],configureHighlight:c?.configure}}(b,d),g=await mv.make().config(a=>{a.set(mq,b.root),a.set(md,b.defaultValue),f?.(a),b.onChange&&a.get(oO).markdownUpdated((a,c)=>{b.onChange(sg(c))})}).use(ok).use(oQ).use(o$).use(e).create();c&&c.connect();let h=function(a,b){if(!a||!b)return null;let c=()=>b(a.getAwarenessUsers());return a.awareness.on("change",c),c(),()=>a.awareness.off("change",c)}(c,b.onAwarenessChange);return{get editor(){return g},get content(){return d},getView:()=>g.action(a=>a.get(lB)),getMarkdown:()=>sg(g.action(a=>{let b=a.get(lB),c=(a.get(lQ),a.get(mb));return c(b.state.doc)})),async setMarkdown(a){await g.action(mM(a))},getAwarenessUsers:()=>c?.getAwarenessUsers()??[],setLocalSelection(a,b){c?.setLocalSelection(a,b)},getRemoteCursors:()=>c?.getRemoteCursors()??[],async destroy(){h?.(),c&&(c.destroy(),await new Promise(a=>setTimeout(a,0))),await g.destroy()}}}function sr(a,b){let c=Array(b.length+1).fill(0),d=0,e=0,f=a=>{for(let f=0;f<a&&d<b.length;f++)c[d]=e,d++,e++;d<=b.length&&(c[d]=e)},g=a=>{for(let f=0;f<a&&d<b.length;f++)c[d]=e,d++;d<=b.length&&(c[d]=e)},h=a=>{a.forEach(a=>{if(a.isText){let b=a.marks.map(a=>a.type.name),c=a.text;b.includes("inlineCode")||b.includes("code")?(g(1),f(c.length),g(1)):(b.includes("strong")&&g(2),(b.includes("emphasis")||b.includes("em"))&&g(1),f(c.length),(b.includes("emphasis")||b.includes("em"))&&g(1),b.includes("strong")&&g(2))}else"hardbreak"===a.type.name||"hard_break"===a.type.name?g(1):f(a.textContent.length)})},i=a=>{switch(a.type.name){case"doc":case"list_item":a.forEach(i);return;case"paragraph":h(a),g(2);return;case"heading":g(a.attrs.level+1),h(a),g(2);return;case"blockquote":g(2),h(a),g(2);return;case"code_block":let b=a.attrs.language??"";g(3),g(b.length),g(1),f(a.textContent.length),g(1),g(3),g(2);return;case"bullet_list":a.forEach(a=>{g(2),i(a)}),g(2);return;case"ordered_list":a.forEach((a,b)=>{g(String(b+1).length+2),i(a)}),g(2);return;default:f(a.textContent.length),g(2);return}};return i(a),g(b.length-d),c}function ss(a,b){let c=Math.max(0,Math.min(b,a.length-1));return a[c]}},6713:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/is-bot")},6757:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,163,23)),Promise.resolve().then(c.t.bind(c,1330,23)),Promise.resolve().then(c.t.bind(c,6796,23)),Promise.resolve().then(c.t.bind(c,6507,23)),Promise.resolve().then(c.t.bind(c,955,23)),Promise.resolve().then(c.t.bind(c,6403,23)),Promise.resolve().then(c.t.bind(c,3661,23)),Promise.resolve().then(c.t.bind(c,6682,23)),Promise.resolve().then(c.bind(c,5771))},7269:()=>{},7573:a=>{"use strict";var b=Object.prototype.hasOwnProperty,c=Object.prototype.toString,d=Object.defineProperty,e=Object.getOwnPropertyDescriptor,f=function(a){return"function"==typeof Array.isArray?Array.isArray(a):"[object Array]"===c.call(a)},g=function(a){if(!a||"[object Object]"!==c.call(a))return!1;var d,e=b.call(a,"constructor"),f=a.constructor&&a.constructor.prototype&&b.call(a.constructor.prototype,"isPrototypeOf");if(a.constructor&&!e&&!f)return!1;for(d in a);return void 0===d||b.call(a,d)},h=function(a,b){d&&"__proto__"===b.name?d(a,b.name,{enumerable:!0,configurable:!0,value:b.newValue,writable:!0}):a[b.name]=b.newValue},i=function(a,c){if("__proto__"===c){if(!b.call(a,c))return;else if(e)return e(a,c).value}return a[c]};a.exports=function a(){var b,c,d,e,j,k,l=arguments[0],m=1,n=arguments.length,o=!1;for("boolean"==typeof l&&(o=l,l=arguments[1]||{},m=2),(null==l||"object"!=typeof l&&"function"!=typeof l)&&(l={});m<n;++m)if(b=arguments[m],null!=b)for(c in b)d=i(l,c),l!==(e=i(b,c))&&(o&&e&&(g(e)||(j=f(e)))?(j?(j=!1,k=d&&f(d)?d:[]):k=d&&g(d)?d:{},h(l,{name:c,newValue:a(o,k,e)})):void 0!==e&&h(l,{name:c,newValue:e}));return l}},8354:a=>{"use strict";a.exports=require("util")},9121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},9294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},9732:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>f,metadata:()=>e});var d=c(3421);c(2618);let e={title:"CollaFlow",description:"High-performance collaborative mind map & document workspace"};function f({children:a}){return(0,d.jsx)("html",{lang:"en",children:(0,d.jsx)("body",{className:"antialiased",children:a})})}},9810:(a,b,c)=>{Promise.resolve().then(c.bind(c,5401))}};var b=require("../webpack-runtime.js");b.C(a);var c=b.X(0,[575],()=>b(b.s=2774));module.exports=c})();
|