@karmaniverous/jeeves-server 3.0.0-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/.env.local +13 -0
- package/.env.local.template +13 -0
- package/.tsbuildinfo +1 -0
- package/CHANGELOG.md +450 -0
- package/about.md +82 -0
- package/client/README.md +73 -0
- package/client/eslint.config.js +23 -0
- package/client/index.html +14 -0
- package/client/package-lock.json +5181 -0
- package/client/package.json +60 -0
- package/client/public/vite.svg +1 -0
- package/client/src/App.tsx +22 -0
- package/client/src/components/AccountMenu.tsx +167 -0
- package/client/src/components/ActionDropdown.tsx +120 -0
- package/client/src/components/CodeEditor.tsx +143 -0
- package/client/src/components/CodeViewer.tsx +113 -0
- package/client/src/components/ConfirmDialog.tsx +32 -0
- package/client/src/components/DirectoryRow.tsx +62 -0
- package/client/src/components/DirectoryTable.tsx +42 -0
- package/client/src/components/DownloadDropdown.tsx +116 -0
- package/client/src/components/DriveList.tsx +54 -0
- package/client/src/components/EmbeddedDiagramPanzoom.ts +28 -0
- package/client/src/components/FileContentView.tsx +155 -0
- package/client/src/components/InlineSvgPanzoom.ts +60 -0
- package/client/src/components/LazyDiagram.ts +93 -0
- package/client/src/components/LinkDropdown.tsx +134 -0
- package/client/src/components/MarkdownView.tsx +115 -0
- package/client/src/components/MermaidViewer.tsx +21 -0
- package/client/src/components/PlantUmlViewer.tsx +21 -0
- package/client/src/components/SearchModal.tsx +424 -0
- package/client/src/components/SvgViewer.tsx +107 -0
- package/client/src/components/TabBar.tsx +96 -0
- package/client/src/components/layout/Header.tsx +270 -0
- package/client/src/components/panzoom.ts +203 -0
- package/client/src/components/renderableUtils.ts +15 -0
- package/client/src/components/runner/JobTable.tsx +153 -0
- package/client/src/components/runner/RunHistory.tsx +140 -0
- package/client/src/components/runner/StatsBar.tsx +43 -0
- package/client/src/components/runner/StatusPill.tsx +27 -0
- package/client/src/components/runner/jobTableUtils.ts +65 -0
- package/client/src/components/scrollUtils.ts +39 -0
- package/client/src/components/ui/alert-dialog.tsx +107 -0
- package/client/src/components/ui/button.tsx +40 -0
- package/client/src/components/ui/dropdown-menu.tsx +79 -0
- package/client/src/components/ui/input.tsx +26 -0
- package/client/src/components/useActionState.ts +43 -0
- package/client/src/hooks/useFileBrowser.ts +102 -0
- package/client/src/hooks/useFileData.ts +78 -0
- package/client/src/hooks/useScrollAnchor.ts +70 -0
- package/client/src/hooks/useShareSettings.ts +22 -0
- package/client/src/hooks/useTopBar.ts +27 -0
- package/client/src/index.css +281 -0
- package/client/src/lib/AuthContext.ts +27 -0
- package/client/src/lib/api.ts +239 -0
- package/client/src/lib/auth.tsx +50 -0
- package/client/src/lib/codeBlockCm6.ts +129 -0
- package/client/src/lib/codeBlockCopy.ts +43 -0
- package/client/src/lib/codemirror.ts +77 -0
- package/client/src/lib/runner-api.ts +172 -0
- package/client/src/lib/svg.ts +50 -0
- package/client/src/lib/theme.ts +34 -0
- package/client/src/lib/utils.ts +6 -0
- package/client/src/main.tsx +11 -0
- package/client/src/pages/FileBrowser.tsx +135 -0
- package/client/src/pages/Home.tsx +46 -0
- package/client/src/pages/Runner.tsx +151 -0
- package/client/src/pages/RunnerJob.tsx +170 -0
- package/client/tsconfig.app.json +32 -0
- package/client/tsconfig.json +7 -0
- package/client/tsconfig.node.json +26 -0
- package/client/vite.config.ts +35 -0
- package/content/privacy.md +61 -0
- package/content/terms.md +41 -0
- package/dist/client/assets/CodeEditor-0XHVI8Nu.js +1 -0
- package/dist/client/assets/CodeViewer-CykMVsfX.js +1 -0
- package/dist/client/assets/index--MBieNJA.js +1 -0
- package/dist/client/assets/index-BENeXQI_.js +1 -0
- package/dist/client/assets/index-BbBpoOxz.js +1 -0
- package/dist/client/assets/index-BdV9g5AM.js +6 -0
- package/dist/client/assets/index-BjAilRri.js +2 -0
- package/dist/client/assets/index-BqbhWo2I.js +3 -0
- package/dist/client/assets/index-CVbycZ0H.js +1 -0
- package/dist/client/assets/index-Cs5oz2oJ.js +5 -0
- package/dist/client/assets/index-D8KZVveX.js +1 -0
- package/dist/client/assets/index-DC4HMHxY.js +13 -0
- package/dist/client/assets/index-DbMebkkd.css +1 -0
- package/dist/client/assets/index-DcY2RXqX.js +1 -0
- package/dist/client/assets/index-Duy-tZYV.js +1 -0
- package/dist/client/assets/index-Dw7rDFmE.js +7 -0
- package/dist/client/assets/index-FlCUvrjv.js +2 -0
- package/dist/client/assets/index-K6OVmfhg.js +1 -0
- package/dist/client/assets/index-LjwgzZ7F.js +62 -0
- package/dist/client/assets/index-MLwyFRN0.js +1 -0
- package/dist/client/assets/index-OpqBpSjn.js +1 -0
- package/dist/client/assets/index-SsHei0HE.js +1 -0
- package/dist/client/assets/index-uQa2yckk.js +1 -0
- package/dist/client/assets/index-udkXoIER.js +1 -0
- package/dist/client/index.html +15 -0
- package/dist/client/vite.svg +1 -0
- package/dist/src/auth/google.js +57 -0
- package/dist/src/auth/keys.js +185 -0
- package/dist/src/auth/resolve.js +102 -0
- package/dist/src/auth/session.js +57 -0
- package/dist/src/cli/commands/config.js +100 -0
- package/dist/src/cli/commands/config.test.js +84 -0
- package/dist/src/cli/commands/service.js +93 -0
- package/dist/src/cli/commands/start.js +24 -0
- package/dist/src/cli/index.js +20 -0
- package/dist/src/config/index.js +90 -0
- package/dist/src/config/loadConfig.test.js +127 -0
- package/dist/src/config/resolve.js +134 -0
- package/dist/src/config/resolve.test.js +148 -0
- package/dist/src/config/schema.js +159 -0
- package/dist/src/config/substituteEnvVars.js +45 -0
- package/dist/src/config/substituteEnvVars.test.js +51 -0
- package/dist/src/config/types.js +5 -0
- package/dist/src/routes/api/auth-status.js +56 -0
- package/dist/src/routes/api/diagrams.js +35 -0
- package/dist/src/routes/api/directory.js +93 -0
- package/dist/src/routes/api/drives.js +15 -0
- package/dist/src/routes/api/export.js +218 -0
- package/dist/src/routes/api/fileContent.js +286 -0
- package/dist/src/routes/api/index.js +33 -0
- package/dist/src/routes/api/linkInfo.js +71 -0
- package/dist/src/routes/api/linkInfo.test.js +104 -0
- package/dist/src/routes/api/middleware.js +117 -0
- package/dist/src/routes/api/raw.js +38 -0
- package/dist/src/routes/api/runner.js +59 -0
- package/dist/src/routes/api/search.js +236 -0
- package/dist/src/routes/api/sharing.js +203 -0
- package/dist/src/routes/api/status.js +68 -0
- package/dist/src/routes/api/status.test.js +62 -0
- package/dist/src/routes/auth.js +99 -0
- package/dist/src/routes/event.js +77 -0
- package/dist/src/routes/event.test.js +206 -0
- package/dist/src/routes/health.js +10 -0
- package/dist/src/routes/keys.js +129 -0
- package/dist/src/routes/path/index.js +17 -0
- package/dist/src/routes/static.js +30 -0
- package/dist/src/server.js +90 -0
- package/dist/src/services/deepShareLinks.js +163 -0
- package/dist/src/services/diagramCache.js +104 -0
- package/dist/src/services/embeddedDiagrams.js +136 -0
- package/dist/src/services/eventLog.js +55 -0
- package/dist/src/services/eventLog.test.js +113 -0
- package/dist/src/services/eventQueue.js +154 -0
- package/dist/src/services/eventQueue.test.js +104 -0
- package/dist/src/services/export.js +220 -0
- package/dist/src/services/exportCache.js +196 -0
- package/dist/src/services/markdown.js +147 -0
- package/dist/src/services/mermaid.js +97 -0
- package/dist/src/services/plantuml.js +145 -0
- package/dist/src/services/puppeteer.js +156 -0
- package/dist/src/util/breadcrumbs.js +22 -0
- package/dist/src/util/crypto.js +56 -0
- package/dist/src/util/crypto.test.js +99 -0
- package/dist/src/util/fileDetection.js +66 -0
- package/dist/src/util/fileDetection.test.js +89 -0
- package/dist/src/util/formatters.js +43 -0
- package/dist/src/util/formatters.test.js +83 -0
- package/dist/src/util/packageVersion.js +25 -0
- package/dist/src/util/platform.js +148 -0
- package/dist/src/util/state.js +46 -0
- package/dist/vitest.config.js +12 -0
- package/favicon.svg +3 -0
- package/guides/access-decision-flow.mmd +24 -0
- package/guides/access-decision-flow.svg +1 -0
- package/guides/api-integration.md +236 -0
- package/guides/deployment.md +287 -0
- package/guides/event-gateway.md +204 -0
- package/guides/event-gateway.mmd +17 -0
- package/guides/event-gateway.svg +1 -0
- package/guides/exports.md +239 -0
- package/guides/setup.md +313 -0
- package/guides/sharing.md +204 -0
- package/jeeves-server.config.template.json +25 -0
- package/package.json +124 -0
- package/scripts/download-plantuml.js +70 -0
- package/src/auth/google.ts +93 -0
- package/src/auth/keys.ts +252 -0
- package/src/auth/resolve.ts +157 -0
- package/src/auth/session.ts +77 -0
- package/src/cli/commands/config.test.ts +107 -0
- package/src/cli/commands/config.ts +113 -0
- package/src/cli/commands/service.ts +129 -0
- package/src/cli/commands/start.ts +27 -0
- package/src/cli/index.ts +25 -0
- package/src/config/index.ts +113 -0
- package/src/config/loadConfig.test.ts +155 -0
- package/src/config/resolve.test.ts +192 -0
- package/src/config/resolve.ts +173 -0
- package/src/config/schema.ts +179 -0
- package/src/config/substituteEnvVars.test.ts +64 -0
- package/src/config/substituteEnvVars.ts +52 -0
- package/src/config/types.ts +129 -0
- package/src/routes/api/auth-status.ts +85 -0
- package/src/routes/api/diagrams.ts +53 -0
- package/src/routes/api/directory.ts +123 -0
- package/src/routes/api/drives.ts +23 -0
- package/src/routes/api/export.ts +314 -0
- package/src/routes/api/fileContent.ts +414 -0
- package/src/routes/api/index.ts +37 -0
- package/src/routes/api/linkInfo.test.ts +132 -0
- package/src/routes/api/linkInfo.ts +83 -0
- package/src/routes/api/middleware.ts +156 -0
- package/src/routes/api/raw.ts +54 -0
- package/src/routes/api/runner.ts +107 -0
- package/src/routes/api/search.ts +321 -0
- package/src/routes/api/sharing.ts +259 -0
- package/src/routes/api/status.test.ts +72 -0
- package/src/routes/api/status.ts +82 -0
- package/src/routes/auth.ts +143 -0
- package/src/routes/event.test.ts +248 -0
- package/src/routes/event.ts +109 -0
- package/src/routes/health.ts +13 -0
- package/src/routes/keys.ts +192 -0
- package/src/routes/path/index.ts +24 -0
- package/src/routes/static.ts +54 -0
- package/src/server.ts +104 -0
- package/src/services/deepShareLinks.ts +203 -0
- package/src/services/diagramCache.ts +128 -0
- package/src/services/embeddedDiagrams.ts +168 -0
- package/src/services/eventLog.test.ts +144 -0
- package/src/services/eventLog.ts +68 -0
- package/src/services/eventQueue.test.ts +127 -0
- package/src/services/eventQueue.ts +196 -0
- package/src/services/export.ts +267 -0
- package/src/services/exportCache.ts +216 -0
- package/src/services/markdown.ts +189 -0
- package/src/services/mermaid.ts +113 -0
- package/src/services/plantuml.ts +172 -0
- package/src/services/puppeteer.ts +188 -0
- package/src/types/fastify.d.ts +13 -0
- package/src/types/jsonmap.d.ts +10 -0
- package/src/types/plantuml-encoder.d.ts +4 -0
- package/src/util/breadcrumbs.ts +33 -0
- package/src/util/crypto.test.ts +132 -0
- package/src/util/crypto.ts +79 -0
- package/src/util/fileDetection.test.ts +115 -0
- package/src/util/fileDetection.ts +70 -0
- package/src/util/formatters.test.ts +105 -0
- package/src/util/formatters.ts +44 -0
- package/src/util/packageVersion.ts +30 -0
- package/src/util/platform.ts +178 -0
- package/src/util/state.ts +55 -0
- package/test-docs/diagram-retry-test.md +18 -0
- package/test-docs/embedded-diagrams.md +52 -0
- package/test-docs/lazy-diagrams-test.md +333 -0
- package/test-docs/page-a.md +7 -0
- package/test-docs/page-b.md +7 -0
- package/test-docs/page-c.md +7 -0
- package/test-docs/sub/page-d.md +7 -0
- package/test-docs/test-diagram.puml +13 -0
- package/test-docs/validate-deep-share.js +318 -0
- package/tsconfig.json +37 -0
- package/tsdoc.json +13 -0
- package/vendor/.plantuml-version +1 -0
- package/vendor/plantuml.jar +0 -0
- package/vitest.config.js +12 -0
- package/vitest.config.ts +13 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{RangeSetBuilder as St,RangeSet as Qt,EditorState as me,Facet as Y,StateField as Ct,StateEffect as De,Prec as Xt,combineConfig as At,countColumn as Yt}from"./index-Cs5oz2oJ.js";import{V as Ee,t as Zt,E as re,G as er,a as U,S as rt,p as tr,W as Nt,D as nt}from"./index-Dw7rDFmE.js";const rr=1024;let nr=0;class W{constructor(e,t){this.from=e,this.to=t}}class x{constructor(e={}){this.id=nr++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=z.match(e)),t=>{let r=e(t);return r===void 0?null:[this,r]}}}x.closedBy=new x({deserialize:i=>i.split(" ")});x.openedBy=new x({deserialize:i=>i.split(" ")});x.group=new x({deserialize:i=>i.split(" ")});x.isolate=new x({deserialize:i=>{if(i&&i!="rtl"&&i!="ltr"&&i!="auto")throw new RangeError("Invalid value for isolate: "+i);return i||"auto"}});x.contextHash=new x({perNode:!0});x.lookAhead=new x({perNode:!0});x.mounted=new x({perNode:!0});class ue{constructor(e,t,r,n=!1){this.tree=e,this.overlay=t,this.parser=r,this.bracketed=n}static get(e){return e&&e.props&&e.props[x.mounted.id]}}const ir=Object.create(null);class z{constructor(e,t,r,n=0){this.name=e,this.props=t,this.id=r,this.flags=n}static define(e){let t=e.props&&e.props.length?Object.create(null):ir,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),n=new z(e.name||"",t,e.id,r);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(n)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[s[0].id]=s[1]}}return n}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(x.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let r in e)for(let n of r.split(" "))t[n]=e[r];return r=>{for(let n=r.prop(x.group),s=-1;s<(n?n.length:0);s++){let l=t[s<0?r.name:n[s]];if(l)return l}}}}z.none=new z("",Object.create(null),0,8);class Tt{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let r of this.types){let n=null;for(let s of e){let l=s(r);if(l){n||(n=Object.assign({},r.props));let o=l[1],a=l[0];a.combine&&a.id in n&&(o=a.combine(n[a.id],o)),n[a.id]=o}}t.push(n?new z(r.name,n,r.id,r.flags):r)}return new Tt(t)}}const ve=new WeakMap,it=new WeakMap;var v;(function(i){i[i.ExcludeBuffers=1]="ExcludeBuffers",i[i.IncludeAnonymous=2]="IncludeAnonymous",i[i.IgnoreMounts=4]="IgnoreMounts",i[i.IgnoreOverlays=8]="IgnoreOverlays",i[i.EnterBracketed=16]="EnterBracketed"})(v||(v={}));class D{constructor(e,t,r,n,s){if(this.type=e,this.children=t,this.positions=r,this.length=n,this.props=null,s&&s.length){this.props=Object.create(null);for(let[l,o]of s)this.props[typeof l=="number"?l:l.id]=o}}toString(){let e=ue.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let r of this.children){let n=r.toString();n&&(t&&(t+=","),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new Be(this.topNode,e)}cursorAt(e,t=0,r=0){let n=ve.get(this)||this.topNode,s=new Be(n);return s.moveTo(e,t),ve.set(this,s._tree),s}get topNode(){return new F(this,0,0,null)}resolve(e,t=0){let r=ye(ve.get(this)||this.topNode,e,t,!1);return ve.set(this,r),r}resolveInner(e,t=0){let r=ye(it.get(this)||this.topNode,e,t,!0);return it.set(this,r),r}resolveStack(e,t=0){return or(this,e,t)}iterate(e){let{enter:t,leave:r,from:n=0,to:s=this.length}=e,l=e.mode||0,o=(l&v.IncludeAnonymous)>0;for(let a=this.cursor(l|v.IncludeAnonymous);;){let f=!1;if(a.from<=s&&a.to>=n&&(!o&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;f=!0}for(;f&&r&&(o||!a.type.isAnonymous)&&r(a),!a.nextSibling();){if(!a.parent())return;f=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Ye(z.none,this.children,this.positions,0,this.children.length,0,this.length,(t,r,n)=>new D(this.type,t,r,n,this.propValues),e.makeTree||((t,r,n)=>new D(z.none,t,r,n)))}static build(e){return ar(e)}}D.empty=new D(z.none,[],[],0);class Qe{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Qe(this.buffer,this.index)}}class ne{constructor(e,t,r){this.buffer=e,this.length=t,this.set=r}get type(){return z.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],r=this.buffer[e+3],n=this.set.types[t],s=n.name;if(/\W/.test(s)&&!n.isError&&(s=JSON.stringify(s)),e+=4,r==e)return s;let l=[];for(;e<r;)l.push(this.childString(e)),e=this.buffer[e+3];return s+"("+l.join(",")+")"}findChild(e,t,r,n,s){let{buffer:l}=this,o=-1;for(let a=e;a!=t&&!(Bt(s,n,l[a+1],l[a+2])&&(o=a,r>0));a=l[a+3]);return o}slice(e,t,r){let n=this.buffer,s=new Uint16Array(t-e),l=0;for(let o=e,a=0;o<t;){s[a++]=n[o++],s[a++]=n[o++]-r;let f=s[a++]=n[o++]-r;s[a++]=n[o++]-e,l=Math.max(l,f)}return new ne(s,l,this.set)}}function Bt(i,e,t,r){switch(i){case-2:return t<e;case-1:return r>=e&&t<e;case 0:return t<e&&r>e;case 1:return t<=e&&r>e;case 2:return r>e;case 4:return!0}}function ye(i,e,t,r){for(var n;i.from==i.to||(t<1?i.from>=e:i.from>e)||(t>-1?i.to<=e:i.to<e);){let l=!r&&i instanceof F&&i.index<0?null:i.parent;if(!l)return i;i=l}let s=r?0:v.IgnoreOverlays;if(r)for(let l=i,o=l.parent;o;l=o,o=l.parent)l instanceof F&&l.index<0&&((n=o.enter(e,t,s))===null||n===void 0?void 0:n.from)!=l.from&&(i=o);for(;;){let l=i.enter(e,t,s);if(!l)return i;i=l}}class Pt{cursor(e=0){return new Be(this,e)}getChild(e,t=null,r=null){let n=st(this,e,t,r);return n.length?n[0]:null}getChildren(e,t=null,r=null){return st(this,e,t,r)}resolve(e,t=0){return ye(this,e,t,!1)}resolveInner(e,t=0){return ye(this,e,t,!0)}matchContext(e){return Ue(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),r=this;for(;t;){let n=t.lastChild;if(!n||n.to!=t.to)break;n.type.isError&&n.from==n.to?(r=t,t=n.prevSibling):t=n}return r}get node(){return this}get next(){return this.parent}}class F extends Pt{constructor(e,t,r,n){super(),this._tree=e,this.from=t,this.index=r,this._parent=n}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,r,n,s=0){for(let l=this;;){for(let{children:o,positions:a}=l._tree,f=t>0?o.length:-1;e!=f;e+=t){let h=o[e],c=a[e]+l.from,p;if(!(!(s&v.EnterBracketed&&h instanceof D&&(p=ue.get(h))&&!p.overlay&&p.bracketed&&r>=c&&r<=c+h.length)&&!Bt(n,r,c,c+h.length))){if(h instanceof ne){if(s&v.ExcludeBuffers)continue;let g=h.findChild(0,h.buffer.length,t,r-c,n);if(g>-1)return new G(new sr(l,h,e,c),null,g)}else if(s&v.IncludeAnonymous||!h.type.isAnonymous||Xe(h)){let g;if(!(s&v.IgnoreMounts)&&(g=ue.get(h))&&!g.overlay)return new F(g.tree,c,e,l);let k=new F(h,c,e,l);return s&v.IncludeAnonymous||!k.type.isAnonymous?k:k.nextChild(t<0?h.children.length-1:0,t,r,n,s)}}}if(s&v.IncludeAnonymous||!l.type.isAnonymous||(l.index>=0?e=l.index+t:e=t<0?-1:l._parent._tree.children.length,l=l._parent,!l))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,r=0){let n;if(!(r&v.IgnoreOverlays)&&(n=ue.get(this._tree))&&n.overlay){let s=e-this.from,l=r&v.EnterBracketed&&n.bracketed;for(let{from:o,to:a}of n.overlay)if((t>0||l?o<=s:o<s)&&(t<0||l?a>=s:a>s))return new F(n.tree,n.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function st(i,e,t,r){let n=i.cursor(),s=[];if(!n.firstChild())return s;if(t!=null){for(let l=!1;!l;)if(l=n.type.is(t),!n.nextSibling())return s}for(;;){if(r!=null&&n.type.is(r))return s;if(n.type.is(e)&&s.push(n.node),!n.nextSibling())return r==null?s:[]}}function Ue(i,e,t=e.length-1){for(let r=i;t>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[t]&&e[t]!=r.name)return!1;t--}}return!0}class sr{constructor(e,t,r,n){this.parent=e,this.buffer=t,this.index=r,this.start=n}}class G extends Pt{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,r){super(),this.context=e,this._parent=t,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,t,r){let{buffer:n}=this.context,s=n.findChild(this.index+4,n.buffer[this.index+3],e,t-this.context.start,r);return s<0?null:new G(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,r=0){if(r&v.ExcludeBuffers)return null;let{buffer:n}=this.context,s=n.findChild(this.index+4,n.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new G(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new G(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new G(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:r}=this.context,n=this.index+4,s=r.buffer[this.index+3];if(s>n){let l=r.buffer[this.index+1];e.push(r.slice(n,s,l)),t.push(0)}return new D(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function It(i){if(!i.length)return null;let e=0,t=i[0];for(let s=1;s<i.length;s++){let l=i[s];(l.from>t.from||l.to<t.to)&&(t=l,e=s)}let r=t instanceof F&&t.index<0?null:t.parent,n=i.slice();return r?n[e]=r:n.splice(e,1),new lr(n,t)}class lr{constructor(e,t){this.heads=e,this.node=t}get next(){return It(this.heads)}}function or(i,e,t){let r=i.resolveInner(e,t),n=null;for(let s=r instanceof F?r:r.context.parent;s;s=s.parent)if(s.index<0){let l=s.parent;(n||(n=[r])).push(l.resolve(e,t)),s=l}else{let l=ue.get(s.tree);if(l&&l.overlay&&l.overlay[0].from<=e&&l.overlay[l.overlay.length-1].to>=e){let o=new F(l.tree,l.overlay[0].from+s.from,-1,s);(n||(n=[r])).push(ye(o,e,t,!1))}}return n?It(n):r}class Be{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~v.EnterBracketed,e instanceof F)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:r,buffer:n}=this.buffer;return this.type=t||n.set.types[n.buffer[e]],this.from=r+n.buffer[e+1],this.to=r+n.buffer[e+2],!0}yield(e){return e?e instanceof F?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,r,this.mode));let{buffer:n}=this.buffer,s=n.findChild(this.index+4,n.buffer[this.index+3],e,t-this.buffer.start,r);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,r=this.mode){return this.buffer?r&v.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&v.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&v.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,r=this.stack.length-1;if(e<0){let n=r<0?0:this.stack[r]+4;if(this.index!=n)return this.yieldBuf(t.findChild(n,this.index,-1,0,4))}else{let n=t.buffer[this.index+3];if(n<(r<0?t.buffer.length:t.buffer[this.stack[r]+3]))return this.yieldBuf(n)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,r,{buffer:n}=this;if(n){if(e>0){if(this.index<n.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(n.buffer.buffer[s+3]<this.index)return!1;({index:t,parent:r}=n)}else({index:t,_parent:r}=this._tree);for(;r;{index:t,_parent:r}=r)if(t>-1)for(let s=t+e,l=e<0?-1:r._tree.children.length;s!=l;s+=e){let o=r._tree.children[s];if(this.mode&v.IncludeAnonymous||o instanceof ne||!o.type.isAnonymous||Xe(o))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,r=0;if(e&&e.context==this.buffer)e:for(let n=this.index,s=this.stack.length;s>=0;){for(let l=e;l;l=l._parent)if(l.index==n){if(n==this.index)return l;t=l,r=s+1;break e}n=this.stack[--s]}for(let n=r;n<this.stack.length;n++)t=new G(this.buffer,t,this.stack[n]);return this.bufferNode=new G(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let r=0;;){let n=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(n=!0)}for(;;){if(n&&t&&t(this),n=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,n=!0}}}matchContext(e){if(!this.buffer)return Ue(this.node.parent,e);let{buffer:t}=this.buffer,{types:r}=t.set;for(let n=e.length-1,s=this.stack.length-1;n>=0;s--){if(s<0)return Ue(this._tree,e,n);let l=r[t.buffer[this.stack[s]]];if(!l.isAnonymous){if(e[n]&&e[n]!=l.name)return!1;n--}}return!0}}function Xe(i){return i.children.some(e=>e instanceof ne||!e.type.isAnonymous||Xe(e))}function ar(i){var e;let{buffer:t,nodeSet:r,maxBufferLength:n=rr,reused:s=[],minRepeatType:l=r.types.length}=i,o=Array.isArray(t)?new Qe(t,t.length):t,a=r.types,f=0,h=0;function c(w,T,m,P,C,I){let{id:b,start:y,end:N,size:B}=o,_=h,Z=f;if(B<0)if(o.next(),B==-1){let Q=s[b];m.push(Q),P.push(y-w);return}else if(B==-3){f=b;return}else if(B==-4){h=b;return}else throw new RangeError(`Unrecognized record size: ${B}`);let de=a[b],xe,se,et=y-w;if(N-y<=n&&(se=O(o.pos-T,C))){let Q=new Uint16Array(se.size-se.skip),L=o.pos-se.size,$=Q.length;for(;o.pos>L;)$=M(se.start,Q,$);xe=new ne(Q,N-se.start,r),et=se.start-w}else{let Q=o.pos-B;o.next();let L=[],$=[],le=b>=l?b:-1,fe=0,we=N;for(;o.pos>Q;)le>=0&&o.id==le&&o.size>=0?(o.end<=we-n&&(k(L,$,y,fe,o.end,we,le,_,Z),fe=L.length,we=o.end),o.next()):I>2500?p(y,Q,L,$):c(y,Q,L,$,le,I+1);if(le>=0&&fe>0&&fe<L.length&&k(L,$,y,fe,y,we,le,_,Z),L.reverse(),$.reverse(),le>-1&&fe>0){let tt=g(de,Z);xe=Ye(de,L,$,0,L.length,0,N-y,tt,tt)}else xe=S(de,L,$,N-y,_-N,Z)}m.push(xe),P.push(et)}function p(w,T,m,P){let C=[],I=0,b=-1;for(;o.pos>T;){let{id:y,start:N,end:B,size:_}=o;if(_>4)o.next();else{if(b>-1&&N<b)break;b<0&&(b=B-n),C.push(y,N,B),I++,o.next()}}if(I){let y=new Uint16Array(I*4),N=C[C.length-2];for(let B=C.length-3,_=0;B>=0;B-=3)y[_++]=C[B],y[_++]=C[B+1]-N,y[_++]=C[B+2]-N,y[_++]=_;m.push(new ne(y,C[2]-N,r)),P.push(N-w)}}function g(w,T){return(m,P,C)=>{let I=0,b=m.length-1,y,N;if(b>=0&&(y=m[b])instanceof D){if(!b&&y.type==w&&y.length==C)return y;(N=y.prop(x.lookAhead))&&(I=P[b]+y.length+N)}return S(w,m,P,C,I,T)}}function k(w,T,m,P,C,I,b,y,N){let B=[],_=[];for(;w.length>P;)B.push(w.pop()),_.push(T.pop()+m-C);w.push(S(r.types[b],B,_,I-C,y-I,N)),T.push(C-m)}function S(w,T,m,P,C,I,b){if(I){let y=[x.contextHash,I];b=b?[y].concat(b):[y]}if(C>25){let y=[x.lookAhead,C];b=b?[y].concat(b):[y]}return new D(w,T,m,P,b)}function O(w,T){let m=o.fork(),P=0,C=0,I=0,b=m.end-n,y={size:0,start:0,skip:0};e:for(let N=m.pos-w;m.pos>N;){let B=m.size;if(m.id==T&&B>=0){y.size=P,y.start=C,y.skip=I,I+=4,P+=4,m.next();continue}let _=m.pos-B;if(B<0||_<N||m.start<b)break;let Z=m.id>=l?4:0,de=m.start;for(m.next();m.pos>_;){if(m.size<0)if(m.size==-3||m.size==-4)Z+=4;else break e;else m.id>=l&&(Z+=4);m.next()}C=de,P+=B,I+=Z}return(T<0||P==w)&&(y.size=P,y.start=C,y.skip=I),y.size>4?y:void 0}function M(w,T,m){let{id:P,start:C,end:I,size:b}=o;if(o.next(),b>=0&&P<l){let y=m;if(b>4){let N=o.pos-(b-4);for(;o.pos>N;)m=M(w,T,m)}T[--m]=y,T[--m]=I-w,T[--m]=C-w,T[--m]=P}else b==-3?f=P:b==-4&&(h=P);return m}let E=[],A=[];for(;o.pos>0;)c(i.start||0,i.bufferStart||0,E,A,-1,0);let R=(e=i.length)!==null&&e!==void 0?e:E.length?A[0]+E[0].length:0;return new D(a[i.topID],E.reverse(),A.reverse(),R)}const lt=new WeakMap;function Te(i,e){if(!i.isAnonymous||e instanceof ne||e.type!=i)return 1;let t=lt.get(e);if(t==null){t=1;for(let r of e.children){if(r.type!=i||!(r instanceof D)){t=1;break}t+=Te(i,r)}lt.set(e,t)}return t}function Ye(i,e,t,r,n,s,l,o,a){let f=0;for(let k=r;k<n;k++)f+=Te(i,e[k]);let h=Math.ceil(f*1.5/8),c=[],p=[];function g(k,S,O,M,E){for(let A=O;A<M;){let R=A,w=S[A],T=Te(i,k[A]);for(A++;A<M;A++){let m=Te(i,k[A]);if(T+m>=h)break;T+=m}if(A==R+1){if(T>h){let m=k[R];g(m.children,m.positions,0,m.children.length,S[R]+E);continue}c.push(k[R])}else{let m=S[A-1]+k[A-1].length-w;c.push(Ye(i,k,S,R,A,w,m,null,a))}p.push(w+E-s)}}return g(e,t,r,n,0),(o||a)(c,p,l)}class kn{constructor(){this.map=new WeakMap}setBuffer(e,t,r){let n=this.map.get(e);n||this.map.set(e,n=new Map),n.set(t,r)}getBuffer(e,t){let r=this.map.get(e);return r&&r.get(t)}set(e,t){e instanceof G?this.setBuffer(e.context.buffer,e.index,t):e instanceof F&&this.map.set(e.tree,t)}get(e){return e instanceof G?this.getBuffer(e.context.buffer,e.index):e instanceof F?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class X{constructor(e,t,r,n,s=!1,l=!1){this.from=e,this.to=t,this.tree=r,this.offset=n,this.open=(s?1:0)|(l?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],r=!1){let n=[new X(0,e.length,e,0,!1,r)];for(let s of t)s.to>e.length&&n.push(s);return n}static applyChanges(e,t,r=128){if(!t.length)return e;let n=[],s=1,l=e.length?e[0]:null;for(let o=0,a=0,f=0;;o++){let h=o<t.length?t[o]:null,c=h?h.fromA:1e9;if(c-a>=r)for(;l&&l.from<c;){let p=l;if(a>=p.from||c<=p.to||f){let g=Math.max(p.from,a)-f,k=Math.min(p.to,c)-f;p=g>=k?null:new X(g,k,p.tree,p.offset+f,o>0,!!h)}if(p&&n.push(p),l.to>c)break;l=s<e.length?e[s++]:null}if(!h)break;a=h.toA,f=h.toA-h.toB}return n}}class fr{startParse(e,t,r){return typeof e=="string"&&(e=new hr(e)),r=r?r.length?r.map(n=>new W(n.from,n.to)):[new W(0,0)]:[new W(0,e.length)],this.createParse(e,t||[],r)}parse(e,t,r){let n=this.startParse(e,t,r);for(;;){let s=n.advance();if(s)return s}}}class hr{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function bn(i){return(e,t,r,n)=>new cr(e,i,t,r,n)}class ot{constructor(e,t,r,n,s,l){this.parser=e,this.parse=t,this.overlay=r,this.bracketed=n,this.target=s,this.from=l}}function at(i){if(!i.length||i.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(i))}class ur{constructor(e,t,r,n,s,l,o,a){this.parser=e,this.predicate=t,this.mounts=r,this.index=n,this.start=s,this.bracketed=l,this.target=o,this.prev=a,this.depth=0,this.ranges=[]}}const $e=new x({perNode:!0});class cr{constructor(e,t,r,n,s){this.nest=t,this.input=r,this.fragments=n,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let r=this.baseParse.advance();if(!r)return null;if(this.baseParse=null,this.baseTree=r,this.startInner(),this.stoppedAt!=null)for(let n of this.inner)n.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let r=this.baseTree;return this.stoppedAt!=null&&(r=new D(r.type,r.children,r.positions,r.length,r.propValues.concat([[$e,this.stoppedAt]]))),r}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let r=Object.assign(Object.create(null),e.target.props);r[x.mounted.id]=new ue(t,e.overlay,e.parser,e.bracketed),e.target.props=r}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].from<e&&(e=Math.min(e,this.inner[t].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].parse.stopAt(e)}startInner(){let e=new gr(this.fragments),t=null,r=null,n=new Be(new F(this.baseTree,this.ranges[0].from,0,null),v.IncludeAnonymous|v.IgnoreMounts);e:for(let s,l;;){let o=!0,a;if(this.stoppedAt!=null&&n.from>=this.stoppedAt)o=!1;else if(e.hasNode(n)){if(t){let f=t.mounts.find(h=>h.frag.from<=n.from&&h.frag.to>=n.to&&h.mount.overlay);if(f)for(let h of f.mount.overlay){let c=h.from+f.pos,p=h.to+f.pos;c>=n.from&&p<=n.to&&!t.ranges.some(g=>g.from<p&&g.to>c)&&t.ranges.push({from:c,to:p})}}o=!1}else if(r&&(l=dr(r.ranges,n.from,n.to)))o=l!=2;else if(!n.type.isAnonymous&&(s=this.nest(n,this.input))&&(n.from<n.to||!s.overlay)){n.tree||(pr(n),t&&t.depth++,r&&r.depth++);let f=e.findMounts(n.from,s.parser);if(typeof s.overlay=="function")t=new ur(s.parser,s.overlay,f,this.inner.length,n.from,!!s.bracketed,n.tree,t);else{let h=ut(this.ranges,s.overlay||(n.from<n.to?[new W(n.from,n.to)]:[]));h.length&&at(h),(h.length||!s.overlay)&&this.inner.push(new ot(s.parser,h.length?s.parser.startParse(this.input,ct(f,h),h):s.parser.startParse(""),s.overlay?s.overlay.map(c=>new W(c.from-n.from,c.to-n.from)):null,!!s.bracketed,n.tree,h.length?h[0].from:n.from)),s.overlay?h.length&&(r={ranges:h,depth:0,prev:r}):o=!1}}else if(t&&(a=t.predicate(n))&&(a===!0&&(a=new W(n.from,n.to)),a.from<a.to)){let f=t.ranges.length-1;f>=0&&t.ranges[f].to==a.from?t.ranges[f]={from:t.ranges[f].from,to:a.to}:t.ranges.push(a)}if(o&&n.firstChild())t&&t.depth++,r&&r.depth++;else for(;!n.nextSibling();){if(!n.parent())break e;if(t&&!--t.depth){let f=ut(this.ranges,t.ranges);f.length&&(at(f),this.inner.splice(t.index,0,new ot(t.parser,t.parser.startParse(this.input,ct(t.mounts,f),f),t.ranges.map(h=>new W(h.from-t.start,h.to-t.start)),t.bracketed,t.target,f[0].from))),t=t.prev}r&&!--r.depth&&(r=r.prev)}}}}function dr(i,e,t){for(let r of i){if(r.from>=t)break;if(r.to>e)return r.from<=e&&r.to>=t?2:1}return 0}function ft(i,e,t,r,n,s){if(e<t){let l=i.buffer[e+1];r.push(i.slice(e,t,l)),n.push(l-s)}}function pr(i){let{node:e}=i,t=[],r=e.context.buffer;do t.push(i.index),i.parent();while(!i.tree);let n=i.tree,s=n.children.indexOf(r),l=n.children[s],o=l.buffer,a=[s];function f(h,c,p,g,k,S){let O=t[S],M=[],E=[];ft(l,h,O,M,E,g);let A=o[O+1],R=o[O+2];a.push(M.length);let w=S?f(O+4,o[O+3],l.set.types[o[O]],A,R-A,S-1):e.toTree();return M.push(w),E.push(A-g),ft(l,o[O+3],c,M,E,g),new D(p,M,E,k)}n.children[s]=f(0,o.length,z.none,0,l.length,t.length-1);for(let h of a){let c=i.tree.children[h],p=i.tree.positions[h];i.yield(new F(c,p+i.from,h,i._tree))}}class ht{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(v.IncludeAnonymous|v.IgnoreMounts)}moveTo(e){let{cursor:t}=this,r=e-this.offset;for(;!this.done&&t.from<r;)t.to>=e&&t.enter(r,1,v.IgnoreOverlays|v.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof D)t=t.children[0];else break}return!1}}class gr{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let r=this.curFrag=e[0];this.curTo=(t=r.tree.prop($e))!==null&&t!==void 0?t:r.to,this.inner=new ht(r.tree,-r.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop($e))!==null&&e!==void 0?e:t.to,this.inner=new ht(t.tree,-t.offset)}}findMounts(e,t){var r;let n=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let l=(r=s.tree)===null||r===void 0?void 0:r.prop(x.mounted);if(l&&l.parser==t)for(let o=this.fragI;o<this.fragments.length;o++){let a=this.fragments[o];if(a.from>=s.to)break;a.tree==this.curFrag.tree&&n.push({frag:a,pos:s.from-a.offset,mount:l})}}}return n}}function ut(i,e){let t=null,r=e;for(let n=1,s=0;n<i.length;n++){let l=i[n-1].to,o=i[n].from;for(;s<r.length;s++){let a=r[s];if(a.from>=o)break;a.to<=l||(t||(r=t=e.slice()),a.from<l?(t[s]=new W(a.from,l),a.to>o&&t.splice(s+1,0,new W(o,a.to))):a.to>o?t[s--]=new W(o,a.to):t.splice(s--,1))}}return r}function mr(i,e,t,r){let n=0,s=0,l=!1,o=!1,a=-1e9,f=[];for(;;){let h=n==i.length?1e9:l?i[n].to:i[n].from,c=s==e.length?1e9:o?e[s].to:e[s].from;if(l!=o){let p=Math.max(a,t),g=Math.min(h,c,r);p<g&&f.push(new W(p,g))}if(a=Math.min(h,c),a==1e9)break;h==a&&(l?(l=!1,n++):l=!0),c==a&&(o?(o=!1,s++):o=!0)}return f}function ct(i,e){let t=[];for(let{pos:r,mount:n,frag:s}of i){let l=r+(n.overlay?n.overlay[0].from:0),o=l+n.tree.length,a=Math.max(s.from,l),f=Math.min(s.to,o);if(n.overlay){let h=n.overlay.map(p=>new W(p.from+r,p.to+r)),c=mr(e,h,a,f);for(let p=0,g=a;;p++){let k=p==c.length,S=k?f:c[p].from;if(S>g&&t.push(new X(g,S,n.tree,-l,s.from>=g||s.openStart,s.to<=S||s.openEnd)),k)break;g=c[p].to}}else t.push(new X(a,f,n.tree,-l,s.from>=l||s.openStart,s.to<=o||s.openEnd))}return t}let yr=0;class j{constructor(e,t,r,n){this.name=e,this.set=t,this.base=r,this.modified=n,this.id=yr++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let r=typeof e=="string"?e:"?";if(e instanceof j&&(t=e),t?.base)throw new Error("Can not derive from a modified tag");let n=new j(r,[],null,[]);if(n.set.push(n),t)for(let s of t.set)n.set.push(s);return n}static defineModifier(e){let t=new Pe(e);return r=>r.modified.indexOf(t)>-1?r:Pe.get(r.base||r,r.modified.concat(t).sort((n,s)=>n.id-s.id))}}let kr=0;class Pe{constructor(e){this.name=e,this.instances=[],this.id=kr++}static get(e,t){if(!t.length)return e;let r=t[0].instances.find(o=>o.base==e&&br(t,o.modified));if(r)return r;let n=[],s=new j(e.name,n,e,t);for(let o of t)o.instances.push(s);let l=xr(t);for(let o of e.set)if(!o.modified.length)for(let a of l)n.push(Pe.get(o,a));return s}}function br(i,e){return i.length==e.length&&i.every((t,r)=>t==e[r])}function xr(i){let e=[[]];for(let t=0;t<i.length;t++)for(let r=0,n=e.length;r<n;r++)e.push(e[r].concat(i[t]));return e.sort((t,r)=>r.length-t.length)}function wr(i){let e=Object.create(null);for(let t in i){let r=i[t];Array.isArray(r)||(r=[r]);for(let n of t.split(" "))if(n){let s=[],l=2,o=n;for(let c=0;;){if(o=="..."&&c>0&&c+3==n.length){l=1;break}let p=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!p)throw new RangeError("Invalid path: "+n);if(s.push(p[0]=="*"?"":p[0][0]=='"'?JSON.parse(p[0]):p[0]),c+=p[0].length,c==n.length)break;let g=n[c++];if(c==n.length&&g=="!"){l=0;break}if(g!="/")throw new RangeError("Invalid path: "+n);o=n.slice(c)}let a=s.length-1,f=s[a];if(!f)throw new RangeError("Invalid path: "+n);let h=new ke(r,l,a>0?s.slice(0,a):null);e[f]=h.sort(e[f])}}return Mt.add(e)}const Mt=new x({combine(i,e){let t,r,n;for(;i||e;){if(!i||e&&i.depth>=e.depth?(n=e,e=e.next):(n=i,i=i.next),t&&t.mode==n.mode&&!n.context&&!t.context)continue;let s=new ke(n.tags,n.mode,n.context);t?t.next=s:r=s,t=s}return r}});class ke{constructor(e,t,r,n){this.tags=e,this.mode=t,this.context=r,this.next=n}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}ke.empty=new ke([],2,null);function Ot(i,e){let t=Object.create(null);for(let s of i)if(!Array.isArray(s.tag))t[s.tag.id]=s.class;else for(let l of s.tag)t[l.id]=s.class;let{scope:r,all:n=null}=e||{};return{style:s=>{let l=n;for(let o of s)for(let a of o.set){let f=t[a.id];if(f){l=l?l+" "+f:f;break}}return l},scope:r}}function vr(i,e){let t=null;for(let r of i){let n=r.style(e);n&&(t=t?t+" "+n:n)}return t}function Sr(i,e,t,r=0,n=i.length){let s=new Cr(r,Array.isArray(e)?e:[e],t);s.highlightRange(i.cursor(),r,n,"",s.highlighters),s.flush(n)}class Cr{constructor(e,t,r){this.at=e,this.highlighters=t,this.span=r,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,r,n,s){let{type:l,from:o,to:a}=e;if(o>=r||a<=t)return;l.isTop&&(s=this.highlighters.filter(g=>!g.scope||g.scope(l)));let f=n,h=Ar(e)||ke.empty,c=vr(s,h.tags);if(c&&(f&&(f+=" "),f+=c,h.mode==1&&(n+=(n?" ":"")+c)),this.startSpan(Math.max(t,o),f),h.opaque)return;let p=e.tree&&e.tree.prop(x.mounted);if(p&&p.overlay){let g=e.node.enter(p.overlay[0].from+o,1),k=this.highlighters.filter(O=>!O.scope||O.scope(p.tree.type)),S=e.firstChild();for(let O=0,M=o;;O++){let E=O<p.overlay.length?p.overlay[O]:null,A=E?E.from+o:a,R=Math.max(t,M),w=Math.min(r,A);if(R<w&&S)for(;e.from<w&&(this.highlightRange(e,R,w,n,s),this.startSpan(Math.min(w,e.to),f),!(e.to>=A||!e.nextSibling())););if(!E||A>r)break;M=E.to+o,M>t&&(this.highlightRange(g.cursor(),Math.max(t,E.from+o),Math.min(r,M),"",k),this.startSpan(Math.min(r,M),f))}S&&e.parent()}else if(e.firstChild()){p&&(n="");do if(!(e.to<=t)){if(e.from>=r)break;this.highlightRange(e,t,r,n,s),this.startSpan(Math.min(r,e.to),f)}while(e.nextSibling());e.parent()}}}function Ar(i){let e=i.type.prop(Mt);for(;e&&e.context&&!i.matchContext(e.context);)e=e.next;return e||null}const u=j.define,Se=u(),ee=u(),dt=u(ee),pt=u(ee),te=u(),Ce=u(te),ze=u(te),V=u(),oe=u(V),q=u(),J=u(),qe=u(),pe=u(qe),Ae=u(),d={comment:Se,lineComment:u(Se),blockComment:u(Se),docComment:u(Se),name:ee,variableName:u(ee),typeName:dt,tagName:u(dt),propertyName:pt,attributeName:u(pt),className:u(ee),labelName:u(ee),namespace:u(ee),macroName:u(ee),literal:te,string:Ce,docString:u(Ce),character:u(Ce),attributeValue:u(Ce),number:ze,integer:u(ze),float:u(ze),bool:u(te),regexp:u(te),escape:u(te),color:u(te),url:u(te),keyword:q,self:u(q),null:u(q),atom:u(q),unit:u(q),modifier:u(q),operatorKeyword:u(q),controlKeyword:u(q),definitionKeyword:u(q),moduleKeyword:u(q),operator:J,derefOperator:u(J),arithmeticOperator:u(J),logicOperator:u(J),bitwiseOperator:u(J),compareOperator:u(J),updateOperator:u(J),definitionOperator:u(J),typeOperator:u(J),controlOperator:u(J),punctuation:qe,separator:u(qe),bracket:pe,angleBracket:u(pe),squareBracket:u(pe),paren:u(pe),brace:u(pe),content:V,heading:oe,heading1:u(oe),heading2:u(oe),heading3:u(oe),heading4:u(oe),heading5:u(oe),heading6:u(oe),contentSeparator:u(V),list:u(V),quote:u(V),emphasis:u(V),strong:u(V),link:u(V),monospace:u(V),strikethrough:u(V),inserted:u(),deleted:u(),changed:u(),invalid:u(),meta:Ae,documentMeta:u(Ae),annotation:u(Ae),processingInstruction:u(Ae),definition:j.defineModifier("definition"),constant:j.defineModifier("constant"),function:j.defineModifier("function"),standard:j.defineModifier("standard"),local:j.defineModifier("local"),special:j.defineModifier("special")};for(let i in d){let e=d[i];e instanceof j&&(e.name=i)}Ot([{tag:d.link,class:"tok-link"},{tag:d.heading,class:"tok-heading"},{tag:d.emphasis,class:"tok-emphasis"},{tag:d.strong,class:"tok-strong"},{tag:d.keyword,class:"tok-keyword"},{tag:d.atom,class:"tok-atom"},{tag:d.bool,class:"tok-bool"},{tag:d.url,class:"tok-url"},{tag:d.labelName,class:"tok-labelName"},{tag:d.inserted,class:"tok-inserted"},{tag:d.deleted,class:"tok-deleted"},{tag:d.literal,class:"tok-literal"},{tag:d.string,class:"tok-string"},{tag:d.number,class:"tok-number"},{tag:[d.regexp,d.escape,d.special(d.string)],class:"tok-string2"},{tag:d.variableName,class:"tok-variableName"},{tag:d.local(d.variableName),class:"tok-variableName tok-local"},{tag:d.definition(d.variableName),class:"tok-variableName tok-definition"},{tag:d.special(d.variableName),class:"tok-variableName2"},{tag:d.definition(d.propertyName),class:"tok-propertyName tok-definition"},{tag:d.typeName,class:"tok-typeName"},{tag:d.namespace,class:"tok-namespace"},{tag:d.className,class:"tok-className"},{tag:d.macroName,class:"tok-macroName"},{tag:d.propertyName,class:"tok-propertyName"},{tag:d.operator,class:"tok-operator"},{tag:d.comment,class:"tok-comment"},{tag:d.meta,class:"tok-meta"},{tag:d.invalid,class:"tok-invalid"},{tag:d.punctuation,class:"tok-punctuation"}]);var Re;const he=new x;function Nr(i){return Y.define({combine:i?e=>e.concat(i):void 0})}const Tr=new x;class H{constructor(e,t,r=[],n=""){this.data=e,this.name=n,me.prototype.hasOwnProperty("tree")||Object.defineProperty(me.prototype,"tree",{get(){return K(this)}}),this.parser=t,this.extension=[ie.of(this),me.languageData.of((s,l,o)=>{let a=gt(s,l,o),f=a.type.prop(he);if(!f)return[];let h=s.facet(f),c=a.type.prop(Tr);if(c){let p=a.resolve(l-a.from,o);for(let g of c)if(g.test(p,s)){let k=s.facet(g.facet);return g.type=="replace"?k:k.concat(h)}}return h})].concat(r)}isActiveAt(e,t,r=-1){return gt(e,t,r).type.prop(he)==this.data}findRegions(e){let t=e.facet(ie);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let r=[],n=(s,l)=>{if(s.prop(he)==this.data){r.push({from:l,to:l+s.length});return}let o=s.prop(x.mounted);if(o){if(o.tree.prop(he)==this.data){if(o.overlay)for(let a of o.overlay)r.push({from:a.from+l,to:a.to+l});else r.push({from:l,to:l+s.length});return}else if(o.overlay){let a=r.length;if(n(o.tree,o.overlay[0].from+l),r.length>a)return}}for(let a=0;a<s.children.length;a++){let f=s.children[a];f instanceof D&&n(f,s.positions[a]+l)}};return n(K(e),0),r}get allowsNesting(){return!0}}H.setState=De.define();function gt(i,e,t){let r=i.facet(ie),n=K(i).topNode;if(!r||r.allowsNesting)for(let s=n;s;s=s.enter(e,t,v.ExcludeBuffers|v.EnterBracketed))s.type.isTop&&(n=s);return n}class Je extends H{constructor(e,t,r){super(e,t,[],r),this.parser=t}static define(e){let t=Nr(e.languageData);return new Je(t,e.parser.configure({props:[he.add(r=>r.isTop?t:void 0)]}),e.name)}configure(e,t){return new Je(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function K(i){let e=i.field(H.state,!1);return e?e.tree:D.empty}class Br{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let r=this.cursorPos-this.string.length;return e<r||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-r,t-r)}}let ge=null;class Ie{constructor(e,t,r=[],n,s,l,o,a){this.parser=e,this.state=t,this.fragments=r,this.tree=n,this.treeLen=s,this.viewport=l,this.skipped=o,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,r){return new Ie(e,t,[],D.empty,0,r,[],null)}startParse(){return this.parser.startParse(new Br(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=D.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let n=Date.now()+e;e=()=>Date.now()>n}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let n=this.parse.advance();if(n)if(this.fragments=this.withoutTempSkipped(X.addTree(n,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=n,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(X.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=ge;ge=this;try{return e()}finally{ge=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=mt(e,t.from,t.to);return e}changes(e,t){let{fragments:r,tree:n,treeLen:s,viewport:l,skipped:o}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((f,h,c,p)=>a.push({fromA:f,toA:h,fromB:c,toB:p})),r=X.applyChanges(r,a),n=D.empty,s=0,l={from:e.mapPos(l.from,-1),to:e.mapPos(l.to,1)},this.skipped.length){o=[];for(let f of this.skipped){let h=e.mapPos(f.from,1),c=e.mapPos(f.to,-1);h<c&&o.push({from:h,to:c})}}}return new Ie(this.parser,t,r,n,s,l,o,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:n,to:s}=this.skipped[r];n<e.to&&s>e.from&&(this.fragments=mt(this.fragments,n,s),this.skipped.splice(r--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends fr{createParse(t,r,n){let s=n[0].from,l=n[n.length-1].to;return{parsedPos:s,advance(){let a=ge;if(a){for(let f of n)a.tempSkipped.push(f);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=l,new D(z.none,[],[],l-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return ge}}function mt(i,e,t){return X.applyChanges(i,[{fromA:e,toA:t,fromB:e,toB:t}])}class ce{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,r)||t.takeTree(),new ce(t)}static init(e){let t=Math.min(3e3,e.doc.length),r=Ie.create(e.facet(ie).parser,e,{from:0,to:t});return r.work(20,t)||r.takeTree(),new ce(r)}}H.state=Ct.define({create:ce.init,update(i,e){for(let t of e.effects)if(t.is(H.setState))return t.value;return e.startState.facet(ie)!=e.state.facet(ie)?ce.init(e.state):i.apply(e)}});let Dt=i=>{let e=setTimeout(()=>i(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Dt=i=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(i,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const Le=typeof navigator<"u"&&(!((Re=navigator.scheduling)===null||Re===void 0)&&Re.isInputPending)?()=>navigator.scheduling.isInputPending():null,Pr=Ee.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(H.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(H.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Dt(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:n}}=this.view,s=r.field(H.state);if(s.tree==s.context.tree&&s.context.isDone(n+1e5))return;let l=Date.now()+Math.min(this.chunkBudget,100,e&&!Le?Math.max(25,e.timeRemaining()-5):1e9),o=s.context.treeLen<n&&r.doc.length>n+1e3,a=s.context.work(()=>Le&&Le()||Date.now()>l,n+(o?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:H.setState.of(new ce(s.context))})),this.chunkBudget>0&&!(a&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>tr(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),ie=Y.define({combine(i){return i.length?i[0]:null},enables:i=>[H.state,Pr,re.contentAttributes.compute([i],e=>{let t=e.facet(i);return t&&t.name?{"data-language":t.name}:{}})]});class wn{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class Et{constructor(e,t,r,n,s,l=void 0){this.name=e,this.alias=t,this.extensions=r,this.filename=n,this.loadFunc=s,this.support=l,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:r}=e;if(!t){if(!r)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(r)}return new Et(e.name,(e.alias||[]).concat(e.name).map(n=>n.toLowerCase()),e.extensions||[],e.filename,t,r)}static matchFilename(e,t){for(let n of e)if(n.filename&&n.filename.test(t))return n;let r=/\.([^.]+)$/.exec(t);if(r){for(let n of e)if(n.extensions.indexOf(r[1])>-1)return n}return null}static matchLanguageName(e,t,r=!0){t=t.toLowerCase();for(let n of e)if(n.alias.some(s=>s==t))return n;if(r)for(let n of e)for(let s of n.alias){let l=t.indexOf(s);if(l>-1&&(s.length>2||!/\w/.test(t[l-1])&&!/\w/.test(t[l+s.length])))return n}return null}}const Ir=Y.define(),_t=Y.define({combine:i=>{if(!i.length)return" ";let e=i[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(i[0]));return e}});function Mr(i){let e=i.facet(_t);return e.charCodeAt(0)==9?i.tabSize*e.length:e.length}function Or(i,e){let t="",r=i.tabSize,n=i.facet(_t)[0];if(n==" "){for(;e>=r;)t+=" ",e-=r;n=" "}for(let s=0;s<e;s++)t+=n;return t}function Dr(i,e){i instanceof me&&(i=new Ft(i));for(let r of i.state.facet(Ir)){let n=r(i,e);if(n!==void 0)return n}let t=K(i.state);return t.length>=e?_r(i,t,e):null}class Ft{constructor(e,t={}){this.state=e,this.options=t,this.unit=Mr(e)}lineAt(e,t=1){let r=this.state.doc.lineAt(e),{simulateBreak:n,simulateDoubleBreak:s}=this.options;return n!=null&&n>=r.from&&n<=r.to?s&&n==e?{text:"",from:e}:(t<0?n<e:n<=e)?{text:r.text.slice(n-r.from),from:n}:{text:r.text.slice(0,n-r.from),from:r.from}:r}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:n}=this.lineAt(e,t);return r.slice(e-n,Math.min(r.length,e+100-n))}column(e,t=1){let{text:r,from:n}=this.lineAt(e,t),s=this.countColumn(r,e-n),l=this.options.overrideIndentation?this.options.overrideIndentation(n):-1;return l>-1&&(s+=l-this.countColumn(r,r.search(/\S|$/))),s}countColumn(e,t=e.length){return Yt(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:r,from:n}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let l=s(n);if(l>-1)return l}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Er=new x;function _r(i,e,t){let r=e.resolveStack(t),n=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(n!=r.node){let s=[];for(let l=n;l&&!(l.from<r.node.from||l.to>r.node.to||l.from==r.node.from&&l.type==r.node.type);l=l.parent)s.push(l);for(let l=s.length-1;l>=0;l--)r={node:s[l],next:r}}return zt(r,i,t)}function zt(i,e,t){for(let r=i;r;r=r.next){let n=zr(r.node);if(n)return n(Ze.create(e,t,r))}return 0}function Fr(i){return i.pos==i.options.simulateBreak&&i.options.simulateDoubleBreak}function zr(i){let e=i.type.prop(Er);if(e)return e;let t=i.firstChild,r;if(t&&(r=t.type.prop(x.closedBy))){let n=i.lastChild,s=n&&r.indexOf(n.name)>-1;return l=>Rt(l,!0,1,void 0,s&&!Fr(l)?n.from:void 0)}return i.parent==null?Rr:null}function Rr(){return 0}class Ze extends Ft{constructor(e,t,r){super(e.state,e.options),this.base=e,this.pos=t,this.context=r}get node(){return this.context.node}static create(e,t,r){return new Ze(e,t,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(t.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(Lr(r,e))break;t=this.state.doc.lineAt(r.from)}return this.lineIndent(t.from)}continue(){return zt(this.context.next,this.base,this.pos)}}function Lr(i,e){for(let t=e;t;t=t.parent)if(i==t)return!0;return!1}function jr(i){let e=i.node,t=e.childAfter(e.from),r=e.lastChild;if(!t)return null;let n=i.options.simulateBreak,s=i.state.doc.lineAt(t.from),l=n==null||n<=s.from?s.to:Math.min(s.to,n);for(let o=t.to;;){let a=e.childAfter(o);if(!a||a==r)return null;if(!a.type.isSkipped){if(a.from>=l)return null;let f=/^ */.exec(s.text.slice(t.to-s.from))[0].length;return{from:t.from,to:t.to+f}}o=a.to}}function vn({closing:i,align:e=!0,units:t=1}){return r=>Rt(r,e,t,i)}function Rt(i,e,t,r,n){let s=i.textAfter,l=s.match(/^\s*/)[0].length,o=r&&s.slice(l,l+r.length)==r||n==i.pos+l,a=e?jr(i):null;return a?o?i.column(a.from):i.column(a.to):i.baseIndent+(o?0:i.unit*t)}const Sn=i=>i.baseIndent;function Cn({except:i,units:e=1}={}){return t=>{let r=i&&i.test(t.textAfter);return t.baseIndent+(r?0:e*t.unit)}}const Wr=200;function An(){return me.transactionFilter.of(i=>{if(!i.docChanged||!i.isUserEvent("input.type")&&!i.isUserEvent("input.complete"))return i;let e=i.startState.languageDataAt("indentOnInput",i.startState.selection.main.head);if(!e.length)return i;let t=i.newDoc,{head:r}=i.newSelection.main,n=t.lineAt(r);if(r>n.from+Wr)return i;let s=t.sliceString(n.from,r);if(!e.some(f=>f.test(s)))return i;let{state:l}=i,o=-1,a=[];for(let{head:f}of l.selection.ranges){let h=l.doc.lineAt(f);if(h.from==o)continue;o=h.from;let c=Dr(l,h.from);if(c==null)continue;let p=/^\s*/.exec(h.text)[0],g=Or(l,c);p!=g&&a.push({from:h.from,to:h.from+p.length,insert:g})}return a.length?[i,{changes:a,sequential:!0}]:i})}const Hr=Y.define(),Ur=new x;function Nn(i){let e=i.firstChild,t=i.lastChild;return e&&e.to<t.from?{from:e.to,to:t.type.isError?i.to:t.from}:null}function $r(i,e,t){let r=K(i);if(r.length<t)return null;let n=r.resolveStack(t,1),s=null;for(let l=n;l;l=l.next){let o=l.node;if(o.to<=t||o.from>t)continue;if(s&&o.from<e)break;let a=o.type.prop(Ur);if(a&&(o.to<r.length-50||r.length==i.doc.length||!qr(o))){let f=a(o,i);f&&f.from<=t&&f.from>=e&&f.to>t&&(s=f)}}return s}function qr(i){let e=i.lastChild;return e&&e.to==i.to&&e.type.isError}function Me(i,e,t){for(let r of i.facet(Hr)){let n=r(i,e,t);if(n)return n}return $r(i,e,t)}function Lt(i,e){let t=e.mapPos(i.from,1),r=e.mapPos(i.to,-1);return t>=r?void 0:{from:t,to:r}}const _e=De.define({map:Lt}),be=De.define({map:Lt});function jt(i){let e=[];for(let{head:t}of i.state.selection.ranges)e.some(r=>r.from<=t&&r.to>=t)||e.push(i.lineBlockAt(t));return e}const ae=Ct.define({create(){return U.none},update(i,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((t,r)=>i=yt(i,t,r)),i=i.map(e.changes);for(let t of e.effects)if(t.is(_e)&&!Jr(i,t.value.from,t.value.to)){let{preparePlaceholder:r}=e.state.facet(Ut),n=r?U.replace({widget:new Yr(r(e.state,t.value))}):kt;i=i.update({add:[n.range(t.value.from,t.value.to)]})}else t.is(be)&&(i=i.update({filter:(r,n)=>t.value.from!=r||t.value.to!=n,filterFrom:t.value.from,filterTo:t.value.to}));return e.selection&&(i=yt(i,e.selection.main.head)),i},provide:i=>re.decorations.from(i),toJSON(i,e){let t=[];return i.between(0,e.doc.length,(r,n)=>{t.push(r,n)}),t},fromJSON(i){if(!Array.isArray(i)||i.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t<i.length;){let r=i[t++],n=i[t++];if(typeof r!="number"||typeof n!="number")throw new RangeError("Invalid JSON for fold state");e.push(kt.range(r,n))}return U.set(e,!0)}});function yt(i,e,t=e){let r=!1;return i.between(e,t,(n,s)=>{n<t&&s>e&&(r=!0)}),r?i.update({filterFrom:e,filterTo:t,filter:(n,s)=>n>=t||s<=e}):i}function Oe(i,e,t){var r;let n=null;return(r=i.field(ae,!1))===null||r===void 0||r.between(e,t,(s,l)=>{(!n||n.from>s)&&(n={from:s,to:l})}),n}function Jr(i,e,t){let r=!1;return i.between(e,e,(n,s)=>{n==e&&s==t&&(r=!0)}),r}function Wt(i,e){return i.field(ae,!1)?e:e.concat(De.appendConfig.of($t()))}const Vr=i=>{for(let e of jt(i)){let t=Me(i.state,e.from,e.to);if(t)return i.dispatch({effects:Wt(i.state,[_e.of(t),Ht(i,t)])}),!0}return!1},Gr=i=>{if(!i.state.field(ae,!1))return!1;let e=[];for(let t of jt(i)){let r=Oe(i.state,t.from,t.to);r&&e.push(be.of(r),Ht(i,r,!1))}return e.length&&i.dispatch({effects:e}),e.length>0};function Ht(i,e,t=!0){let r=i.state.doc.lineAt(e.from).number,n=i.state.doc.lineAt(e.to).number;return re.announce.of(`${i.state.phrase(t?"Folded lines":"Unfolded lines")} ${r} ${i.state.phrase("to")} ${n}.`)}const Kr=i=>{let{state:e}=i,t=[];for(let r=0;r<e.doc.length;){let n=i.lineBlockAt(r),s=Me(e,n.from,n.to);s&&t.push(_e.of(s)),r=(s?i.lineBlockAt(s.to):n).to+1}return t.length&&i.dispatch({effects:Wt(i.state,t)}),!!t.length},Qr=i=>{let e=i.state.field(ae,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,i.state.doc.length,(r,n)=>{t.push(be.of({from:r,to:n}))}),i.dispatch({effects:t}),!0},Tn=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:Vr},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:Gr},{key:"Ctrl-Alt-[",run:Kr},{key:"Ctrl-Alt-]",run:Qr}],Xr={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Ut=Y.define({combine(i){return At(i,Xr)}});function $t(i){return[ae,en]}function qt(i,e){let{state:t}=i,r=t.facet(Ut),n=l=>{let o=i.lineBlockAt(i.posAtDOM(l.target)),a=Oe(i.state,o.from,o.to);a&&i.dispatch({effects:be.of(a)}),l.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(i,n,e);let s=document.createElement("span");return s.textContent=r.placeholderText,s.setAttribute("aria-label",t.phrase("folded code")),s.title=t.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=n,s}const kt=U.replace({widget:new class extends Nt{toDOM(i){return qt(i,null)}}});class Yr extends Nt{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return qt(e,this.value)}}const Zr={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class je extends er{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function Bn(i={}){let e={...Zr,...i},t=new je(e,!0),r=new je(e,!1),n=Ee.fromClass(class{constructor(l){this.from=l.viewport.from,this.markers=this.buildMarkers(l)}update(l){(l.docChanged||l.viewportChanged||l.startState.facet(ie)!=l.state.facet(ie)||l.startState.field(ae,!1)!=l.state.field(ae,!1)||K(l.startState)!=K(l.state)||e.foldingChanged(l))&&(this.markers=this.buildMarkers(l.view))}buildMarkers(l){let o=new St;for(let a of l.viewportLineBlocks){let f=Oe(l.state,a.from,a.to)?r:Me(l.state,a.from,a.to)?t:null;f&&o.add(a.from,a.from,f)}return o.finish()}}),{domEventHandlers:s}=e;return[n,Zt({class:"cm-foldGutter",markers(l){var o;return((o=l.plugin(n))===null||o===void 0?void 0:o.markers)||Qt.empty},initialSpacer(){return new je(e,!1)},domEventHandlers:{...s,click:(l,o,a)=>{if(s.click&&s.click(l,o,a))return!0;let f=Oe(l.state,o.from,o.to);if(f)return l.dispatch({effects:be.of(f)}),!0;let h=Me(l.state,o.from,o.to);return h?(l.dispatch({effects:_e.of(h)}),!0):!1}}}),$t()]}const en=re.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Fe{constructor(e,t){this.specs=e;let r;function n(o){let a=rt.newName();return(r||(r=Object.create(null)))["."+a]=o,a}const s=typeof t.all=="string"?t.all:t.all?n(t.all):void 0,l=t.scope;this.scope=l instanceof H?o=>o.prop(he)==l.data:l?o=>o==l:void 0,this.style=Ot(e.map(o=>({tag:o.tag,class:o.class||n(Object.assign({},o,{tag:null}))})),{all:s}).style,this.module=r?new rt(r):null,this.themeType=t.themeType}static define(e,t){return new Fe(e,t||{})}}const Ve=Y.define(),Jt=Y.define({combine(i){return i.length?[i[0]]:null}});function We(i){let e=i.facet(Ve);return e.length?e:i.facet(Jt)}function Pn(i,e){let t=[rn],r;return i instanceof Fe&&(i.module&&t.push(re.styleModule.of(i.module)),r=i.themeType),e?.fallback?t.push(Jt.of(i)):r?t.push(Ve.computeN([re.darkTheme],n=>n.facet(re.darkTheme)==(r=="dark")?[i]:[])):t.push(Ve.of(i)),t}class tn{constructor(e){this.markCache=Object.create(null),this.tree=K(e.state),this.decorations=this.buildDeco(e,We(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=K(e.state),r=We(e.state),n=r!=We(e.startState),{viewport:s}=e.view,l=e.changes.mapPos(this.decoratedTo,1);t.length<s.to&&!n&&t.type==this.tree.type&&l>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=l):(t!=this.tree||e.viewportChanged||n)&&(this.tree=t,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=s.to)}buildDeco(e,t){if(!t||!this.tree.length)return U.none;let r=new St;for(let{from:n,to:s}of e.visibleRanges)Sr(this.tree,t,(l,o,a)=>{r.add(l,o,this.markCache[a]||(this.markCache[a]=U.mark({class:a})))},n,s);return r.finish()}}const rn=Xt.high(Ee.fromClass(tn,{decorations:i=>i.decorations})),In=Fe.define([{tag:d.meta,color:"#404740"},{tag:d.link,textDecoration:"underline"},{tag:d.heading,textDecoration:"underline",fontWeight:"bold"},{tag:d.emphasis,fontStyle:"italic"},{tag:d.strong,fontWeight:"bold"},{tag:d.strikethrough,textDecoration:"line-through"},{tag:d.keyword,color:"#708"},{tag:[d.atom,d.bool,d.url,d.contentSeparator,d.labelName],color:"#219"},{tag:[d.literal,d.inserted],color:"#164"},{tag:[d.string,d.deleted],color:"#a11"},{tag:[d.regexp,d.escape,d.special(d.string)],color:"#e40"},{tag:d.definition(d.variableName),color:"#00f"},{tag:d.local(d.variableName),color:"#30a"},{tag:[d.typeName,d.namespace],color:"#085"},{tag:d.className,color:"#167"},{tag:[d.special(d.variableName),d.macroName],color:"#256"},{tag:d.definition(d.propertyName),color:"#00c"},{tag:d.comment,color:"#940"},{tag:d.invalid,color:"#f00"}]),nn=re.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Vt=1e4,Gt="()[]{}",Kt=Y.define({combine(i){return At(i,{afterCursor:!0,brackets:Gt,maxScanDistance:Vt,renderMatch:on})}}),sn=U.mark({class:"cm-matchingBracket"}),ln=U.mark({class:"cm-nonmatchingBracket"});function on(i){let e=[],t=i.matched?sn:ln;return e.push(t.range(i.start.from,i.start.to)),i.end&&e.push(t.range(i.end.from,i.end.to)),e}function bt(i){let e=[],t=i.facet(Kt);for(let r of i.selection.ranges){if(!r.empty)continue;let n=Ne(i,r.head,-1,t)||r.head>0&&Ne(i,r.head-1,1,t)||t.afterCursor&&(Ne(i,r.head,1,t)||r.head<i.doc.length&&Ne(i,r.head+1,-1,t));n&&(e=e.concat(t.renderMatch(n,i)))}return U.set(e,!0)}const an=Ee.fromClass(class{constructor(i){this.paused=!1,this.decorations=bt(i.state)}update(i){(i.docChanged||i.selectionSet||this.paused)&&(i.view.composing?(this.decorations=this.decorations.map(i.changes),this.paused=!0):(this.decorations=bt(i.state),this.paused=!1))}},{decorations:i=>i.decorations}),fn=[an,nn];function Mn(i={}){return[Kt.of(i),fn]}const hn=new x;function Ge(i,e,t){let r=i.prop(e<0?x.openedBy:x.closedBy);if(r)return r;if(i.name.length==1){let n=t.indexOf(i.name);if(n>-1&&n%2==(e<0?1:0))return[t[n+e]]}return null}function Ke(i){let e=i.type.prop(hn);return e?e(i.node):i}function Ne(i,e,t,r={}){let n=r.maxScanDistance||Vt,s=r.brackets||Gt,l=K(i),o=l.resolveInner(e,t);for(let a=o;a;a=a.parent){let f=Ge(a.type,t,s);if(f&&a.from<a.to){let h=Ke(a);if(h&&(t>0?e>=h.from&&e<h.to:e>h.from&&e<=h.to))return un(i,e,t,a,h,f,s)}}return cn(i,e,t,l,o.type,n,s)}function un(i,e,t,r,n,s,l){let o=r.parent,a={from:n.from,to:n.to},f=0,h=o?.cursor();if(h&&(t<0?h.childBefore(r.from):h.childAfter(r.to)))do if(t<0?h.to<=r.from:h.from>=r.to){if(f==0&&s.indexOf(h.type.name)>-1&&h.from<h.to){let c=Ke(h);return{start:a,end:c?{from:c.from,to:c.to}:void 0,matched:!0}}else if(Ge(h.type,t,l))f++;else if(Ge(h.type,-t,l)){if(f==0){let c=Ke(h);return{start:a,end:c&&c.from<c.to?{from:c.from,to:c.to}:void 0,matched:!1}}f--}}while(t<0?h.prevSibling():h.nextSibling());return{start:a,matched:!1}}function cn(i,e,t,r,n,s,l){let o=t<0?i.sliceDoc(e-1,e):i.sliceDoc(e,e+1),a=l.indexOf(o);if(a<0||a%2==0!=t>0)return null;let f={from:t<0?e-1:e,to:t>0?e+1:e},h=i.doc.iterRange(e,t>0?i.doc.length:0),c=0;for(let p=0;!h.next().done&&p<=s;){let g=h.value;t<0&&(p+=g.length);let k=e+p*t;for(let S=t>0?0:g.length-1,O=t>0?g.length:-1;S!=O;S+=t){let M=l.indexOf(g[S]);if(!(M<0||r.resolveInner(k+S,1).type!=n))if(M%2==0==t>0)c++;else{if(c==1)return{start:f,end:{from:k+S,to:k+S+1},matched:M>>1==a>>1};c--}}t>0&&(p+=g.length)}return h.done?{start:f,matched:!1}:null}const dn=Object.create(null),xt=[z.none],wt=[],vt=Object.create(null),pn=Object.create(null);for(let[i,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])pn[i]=gn(dn,e);function He(i,e){wt.indexOf(i)>-1||(wt.push(i),console.warn(e))}function gn(i,e){let t=[];for(let o of e.split(" ")){let a=[];for(let f of o.split(".")){let h=i[f]||d[f];h?typeof h=="function"?a.length?a=a.map(h):He(f,`Modifier ${f} used at start of tag`):a.length?He(f,`Tag ${f} used as modifier`):a=Array.isArray(h)?h:[h]:He(f,`Unknown highlighting tag ${f}`)}for(let f of a)t.push(f)}if(!t.length)return 0;let r=e.replace(/ /g,"_"),n=r+" "+t.map(o=>o.id),s=vt[n];if(s)return s.id;let l=vt[n]=z.define({id:xt.length,name:r,props:[wr({[r]:t})]});return xt.push(l),l.id}nt.RTL,nt.LTR;export{he as A,Et as B,Ie as C,vn as D,kn as E,v as F,hn as G,Fe as H,Ft as I,Sn as J,Tr as K,wn as L,rr as M,x as N,fr as P,j as T,Mr as a,_t as b,An as c,Pn as d,Mn as e,Bn as f,Dr as g,Tn as h,Or as i,In as j,wr as k,Je as l,Ne as m,Er as n,Cn as o,Ur as p,Nn as q,z as r,K as s,d as t,Tt as u,D as v,bn as w,Hr as x,H as y,Nr as z};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
let re=[],Ee=[];(()=>{let l="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<l.length;e++)(e%2?Ee:re).push(t=t+l[e])})();function Ge(l){if(l<768)return!1;for(let e=0,t=re.length;;){let n=e+t>>1;if(l<re[n])t=n;else if(l>=Ee[n])e=n+1;else return!0;if(e==t)return!1}}function ke(l){return l>=127462&&l<=127487}const ye=8205;function je(l,e,t=!0,n=!0){return(t?Oe:Ze)(l,e,n)}function Oe(l,e,t){if(e==l.length)return e;e&&Me(l.charCodeAt(e))&&Re(l.charCodeAt(e-1))&&e--;let n=ie(l,e);for(e+=Se(n);e<l.length;){let i=ie(l,e);if(n==ye||i==ye||t&&Ge(i))e+=Se(i),n=i;else if(ke(i)){let s=0,r=e-2;for(;r>=0&&ke(ie(l,r));)s++,r-=2;if(s%2==0)break;e+=2}else break}return e}function Ze(l,e,t){for(;e>0;){let n=Oe(l,e-2,t);if(n<e)return n;e--}return 0}function ie(l,e){let t=l.charCodeAt(e);if(!Re(t)||e+1==l.length)return t;let n=l.charCodeAt(e+1);return Me(n)?(t-55296<<10)+(n-56320)+65536:t}function Me(l){return l>=56320&&l<57344}function Re(l){return l>=55296&&l<56320}function Se(l){return l<65536?1:2}class x{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=J(this,e,t);let i=[];return this.decompose(0,e,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(t,this.length,i,1),C.from(i,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=J(this,e,t);let n=[];return this.decompose(e,t,n,0),C.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),i=new N(this),s=new N(e);for(let r=t,h=t;;){if(i.next(r),s.next(r),r=0,i.lineBreak!=s.lineBreak||i.done!=s.done||i.value!=s.value)return!1;if(h+=i.value.length,i.done||h>=n)return!0}}iter(e=1){return new N(this,e)}iterRange(e,t=this.length){return new Te(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t==null&&(t=this.lines+1);let i=this.line(e).from;n=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Be(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?x.empty:e.length<=32?new m(e):C.from(m.split(e,[]))}}class m extends x{constructor(e,t=Ke(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,i){for(let s=0;;s++){let r=this.text[s],h=i+r.length;if((t?n:h)>=e)return new Qe(i,h,n,r);i=h+1,n++}}decompose(e,t,n,i){let s=e<=0&&t>=this.length?this:new m(Ie(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(i&1){let r=n.pop(),h=Z(s.text,r.text.slice(),0,s.length);if(h.length<=32)n.push(new m(h,r.length+s.length));else{let o=h.length>>1;n.push(new m(h.slice(0,o)),new m(h.slice(o)))}}else n.push(s)}replace(e,t,n){if(!(n instanceof m))return super.replace(e,t,n);[e,t]=J(this,e,t);let i=Z(this.text,Z(n.text,Ie(this.text,0,e)),t),s=this.length+n.length-(t-e);return i.length<=32?new m(i,s):C.from(m.split(i,[]),s)}sliceString(e,t=this.length,n=`
|
|
2
|
+
`){[e,t]=J(this,e,t);let i="";for(let s=0,r=0;s<=t&&r<this.text.length;r++){let h=this.text[r],o=s+h.length;s>e&&r&&(i+=n),e<o&&t>s&&(i+=h.slice(Math.max(0,e-s),t-s)),s=o+1}return i}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],i=-1;for(let s of e)n.push(s),i+=s.length+1,n.length==32&&(t.push(new m(n,i)),n=[],i=-1);return i>-1&&t.push(new m(n,i)),t}}class C extends x{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,t,n,i){for(let s=0;;s++){let r=this.children[s],h=i+r.length,o=n+r.lines-1;if((t?o:h)>=e)return r.lineInner(e,t,n,i);i=h+1,n=o+1}}decompose(e,t,n,i){for(let s=0,r=0;r<=t&&s<this.children.length;s++){let h=this.children[s],o=r+h.length;if(e<=o&&t>=r){let a=i&((r<=e?1:0)|(o>=t?2:0));r>=e&&o<=t&&!a?n.push(h):h.decompose(e-r,t-r,n,a)}r=o+1}}replace(e,t,n){if([e,t]=J(this,e,t),n.lines<this.lines)for(let i=0,s=0;i<this.children.length;i++){let r=this.children[i],h=s+r.length;if(e>=s&&t<=h){let o=r.replace(e-s,t-s,n),a=this.lines-r.lines+o.lines;if(o.lines<a>>4&&o.lines>a>>6){let u=this.children.slice();return u[i]=o,new C(u,this.length-(t-e)+n.length)}return super.replace(s,h,o)}s=h+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n=`
|
|
3
|
+
`){[e,t]=J(this,e,t);let i="";for(let s=0,r=0;s<this.children.length&&r<=t;s++){let h=this.children[s],o=r+h.length;r>e&&s&&(i+=n),e<o&&t>r&&(i+=h.sliceString(e-r,t-r,n)),r=o+1}return i}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof C))return 0;let n=0,[i,s,r,h]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=t,s+=t){if(i==r||s==h)return n;let o=this.children[i],a=e.children[s];if(o!=a)return n+o.scanIdentical(a,t);n+=o.length+1}}static from(e,t=e.reduce((n,i)=>n+i.length+1,-1)){let n=0;for(let c of e)n+=c.lines;if(n<32){let c=[];for(let g of e)g.flatten(c);return new m(c,t)}let i=Math.max(32,n>>5),s=i<<1,r=i>>1,h=[],o=0,a=-1,u=[];function f(c){let g;if(c.lines>s&&c instanceof C)for(let b of c.children)f(b);else c.lines>r&&(o>r||!o)?(d(),h.push(c)):c instanceof m&&o&&(g=u[u.length-1])instanceof m&&c.lines+g.lines<=32?(o+=c.lines,a+=c.length+1,u[u.length-1]=new m(g.text.concat(c.text),g.length+1+c.length)):(o+c.lines>i&&d(),o+=c.lines,a+=c.length+1,u.push(c))}function d(){o!=0&&(h.push(u.length==1?u[0]:C.from(u,a)),a=-1,o=u.length=0)}for(let c of e)f(c);return d(),h.length==1?h[0]:new C(h,t)}}x.empty=new m([""],0);function Ke(l){let e=-1;for(let t of l)e+=t.length+1;return e}function Z(l,e,t=0,n=1e9){for(let i=0,s=0,r=!0;s<l.length&&i<=n;s++){let h=l[s],o=i+h.length;o>=t&&(o>n&&(h=h.slice(0,n-i)),i<t&&(h=h.slice(t-i)),r?(e[e.length-1]+=h,r=!1):e.push(h)),i=o+1}return e}function Ie(l,e,t){return Z(l,[""],e,t)}class N{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof m?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],s=this.offsets[n],r=s>>1,h=i instanceof m?i.text.length:i.children.length;if(r==(t>0?h:0)){if(n==0)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=`
|
|
4
|
+
`,this;e--}else if(i instanceof m){let o=i.text[r+(t<0?-1:0)];if(this.offsets[n]+=t,o.length>Math.max(0,e))return this.value=e==0?o:t>0?o.slice(e):o.slice(0,o.length-e),this;e-=o.length}else{let o=i.children[r+(t<0?-1:0)];e>o.length?(e-=o.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(o),this.offsets.push(t>0?1:(o instanceof m?o.text.length:o.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Te{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new N(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*t,this.value=i.length<=n?i:t<0?i.slice(i.length-n):i.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Be{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:i}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(x.prototype[Symbol.iterator]=function(){return this.iter()},N.prototype[Symbol.iterator]=Te.prototype[Symbol.iterator]=Be.prototype[Symbol.iterator]=function(){return this});class Qe{constructor(e,t,n,i){this.from=e,this.to=t,this.number=n,this.text=i}get length(){return this.to-this.from}}function J(l,e,t){return e=Math.max(0,Math.min(l.length,e)),[e,Math.max(e,Math.min(l.length,t))]}function Q(l,e,t=!0,n=!0){return je(l,e,t,n)}function Xe(l){return l>=56320&&l<57344}function Ye(l){return l>=55296&&l<56320}function ft(l,e){let t=l.charCodeAt(e);if(!Ye(t)||e+1==l.length)return t;let n=l.charCodeAt(e+1);return Xe(n)?(t-55296<<10)+(n-56320)+65536:t}function ct(l){return l<=65535?String.fromCharCode(l):(l-=65536,String.fromCharCode((l>>10)+55296,(l&1023)+56320))}function dt(l){return l<65536?1:2}const le=/\r\n?|\n/;var O=(function(l){return l[l.Simple=0]="Simple",l[l.TrackDel=1]="TrackDel",l[l.TrackBefore=2]="TrackBefore",l[l.TrackAfter=3]="TrackAfter",l})(O||(O={}));class E{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,i=0;t<this.sections.length;){let s=this.sections[t++],r=this.sections[t++];r<0?(e(n,i,s),i+=s):i+=r,n+=s}}iterChangedRanges(e,t=!1){he(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let n=this.sections[t++],i=this.sections[t++];i<0?e.push(n,i):e.push(i,n)}return new E(e)}composeDesc(e){return this.empty?e:e.empty?this:Fe(this,e)}mapDesc(e,t=!1){return e.empty?this:oe(this,e,t)}mapPos(e,t=-1,n=O.Simple){let i=0,s=0;for(let r=0;r<this.sections.length;){let h=this.sections[r++],o=this.sections[r++],a=i+h;if(o<0){if(a>e)return s+(e-i);s+=h}else{if(n!=O.Simple&&a>=e&&(n==O.TrackDel&&i<e&&a>e||n==O.TrackBefore&&i<e||n==O.TrackAfter&&a>e))return null;if(a>e||a==e&&t<0&&!h)return e==i||t<0?s:s+o;s+=o}i=a}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return s}touchesRange(e,t=e){for(let n=0,i=0;n<this.sections.length&&i<=t;){let s=this.sections[n++],r=this.sections[n++],h=i+s;if(r>=0&&i<=t&&h>=e)return i<e&&h>t?"cover":!0;i=h}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let n=this.sections[t++],i=this.sections[t++];e+=(e?" ":"")+n+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new E(e)}static create(e){return new E(e)}}class k extends E{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return he(this,(t,n,i,s,r)=>e=e.replace(i,i+(n-t),r),!1),e}mapDesc(e,t=!1){return oe(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let i=0,s=0;i<t.length;i+=2){let r=t[i],h=t[i+1];if(h>=0){t[i]=h,t[i+1]=r;let o=i>>1;for(;n.length<o;)n.push(x.empty);n.push(r?e.slice(s,s+r):x.empty)}s+=r}return new k(t,n)}compose(e){return this.empty?e:e.empty?this:Fe(this,e,!0)}map(e,t=!1){return e.empty?this:oe(this,e,t,!0)}iterChanges(e,t=!1){he(this,e,t)}get desc(){return E.create(this.sections)}filter(e){let t=[],n=[],i=[],s=new q(this);e:for(let r=0,h=0;;){let o=r==e.length?1e9:e[r++];for(;h<o||h==o&&s.len==0;){if(s.done)break e;let u=Math.min(s.len,o-h);y(i,u,-1);let f=s.ins==-1?-1:s.off==0?s.ins:0;y(t,u,f),f>0&&M(n,t,s.text),s.forward(u),h+=u}let a=e[r++];for(;h<a;){if(s.done)break e;let u=Math.min(s.len,a-h);y(t,u,-1),y(i,u,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(u),h+=u}}return{changes:new k(t,n),filtered:E.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],i=this.sections[t+1];i<0?e.push(n):i==0?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,n){let i=[],s=[],r=0,h=null;function o(u=!1){if(!u&&!i.length)return;r<t&&y(i,t-r,-1);let f=new k(i,s);h=h?h.compose(f.map(h)):f,i=[],s=[],r=0}function a(u){if(Array.isArray(u))for(let f of u)a(f);else if(u instanceof k){if(u.length!=t)throw new RangeError(`Mismatched change set length (got ${u.length}, expected ${t})`);o(),h=h?h.compose(u.map(h)):u}else{let{from:f,to:d=f,insert:c}=u;if(f>d||f<0||d>t)throw new RangeError(`Invalid change range ${f} to ${d} (in doc of length ${t})`);let g=c?typeof c=="string"?x.of(c.split(n||le)):c:x.empty,b=g.length;if(f==d&&b==0)return;f<r&&o(),f>r&&y(i,f-r,-1),y(i,d-f,b),M(s,i,g),r=d}}return a(e),o(!h),h}static empty(e){return new k(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let i=0;i<e.length;i++){let s=e[i];if(typeof s=="number")t.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((r,h)=>h&&typeof r!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;n.length<i;)n.push(x.empty);n[i]=x.of(s.slice(1)),t.push(s[0],n[i].length)}}}return new k(t,n)}static createSet(e,t){return new k(e,t)}}function y(l,e,t,n=!1){if(e==0&&t<=0)return;let i=l.length-2;i>=0&&t<=0&&t==l[i+1]?l[i]+=e:i>=0&&e==0&&l[i]==0?l[i+1]+=t:n?(l[i]+=e,l[i+1]+=t):l.push(e,t)}function M(l,e,t){if(t.length==0)return;let n=e.length-2>>1;if(n<l.length)l[l.length-1]=l[l.length-1].append(t);else{for(;l.length<n;)l.push(x.empty);l.push(t)}}function he(l,e,t){let n=l.inserted;for(let i=0,s=0,r=0;r<l.sections.length;){let h=l.sections[r++],o=l.sections[r++];if(o<0)i+=h,s+=h;else{let a=i,u=s,f=x.empty;for(;a+=h,u+=o,o&&n&&(f=f.append(n[r-2>>1])),!(t||r==l.sections.length||l.sections[r+1]<0);)h=l.sections[r++],o=l.sections[r++];e(i,a,s,u,f),i=a,s=u}}}function oe(l,e,t,n=!1){let i=[],s=n?[]:null,r=new q(l),h=new q(e);for(let o=-1;;){if(r.done&&h.len||h.done&&r.len)throw new Error("Mismatched change set lengths");if(r.ins==-1&&h.ins==-1){let a=Math.min(r.len,h.len);y(i,a,-1),r.forward(a),h.forward(a)}else if(h.ins>=0&&(r.ins<0||o==r.i||r.off==0&&(h.len<r.len||h.len==r.len&&!t))){let a=h.len;for(y(i,h.ins,-1);a;){let u=Math.min(r.len,a);r.ins>=0&&o<r.i&&r.len<=u&&(y(i,0,r.ins),s&&M(s,i,r.text),o=r.i),r.forward(u),a-=u}h.next()}else if(r.ins>=0){let a=0,u=r.len;for(;u;)if(h.ins==-1){let f=Math.min(u,h.len);a+=f,u-=f,h.forward(f)}else if(h.ins==0&&h.len<u)u-=h.len,h.next();else break;y(i,a,o<r.i?r.ins:0),s&&o<r.i&&M(s,i,r.text),o=r.i,r.forward(r.len-u)}else{if(r.done&&h.done)return s?k.createSet(i,s):E.create(i);throw new Error("Mismatched change set lengths")}}}function Fe(l,e,t=!1){let n=[],i=t?[]:null,s=new q(l),r=new q(e);for(let h=!1;;){if(s.done&&r.done)return i?k.createSet(n,i):E.create(n);if(s.ins==0)y(n,s.len,0,h),s.next();else if(r.len==0&&!r.done)y(n,0,r.ins,h),i&&M(i,n,r.text),r.next();else{if(s.done||r.done)throw new Error("Mismatched change set lengths");{let o=Math.min(s.len2,r.len),a=n.length;if(s.ins==-1){let u=r.ins==-1?-1:r.off?0:r.ins;y(n,o,u,h),i&&u&&M(i,n,r.text)}else r.ins==-1?(y(n,s.off?0:s.len,o,h),i&&M(i,n,s.textBit(o))):(y(n,s.off?0:s.len,r.off?0:r.ins,h),i&&!r.off&&M(i,n,r.text));h=(s.ins>o||r.ins>=0&&r.len>o)&&(h||n.length>a),s.forward2(o),r.forward(o)}}}}class q{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?x.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?x.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class B{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let n,i;return this.empty?n=i=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),n==this.from&&i==this.to?this:new B(n,i,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return p.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return p.range(this.anchor,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return p.range(e.anchor,e.head)}static create(e,t,n){return new B(e,t,n)}}class p{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:p.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new p([this.main],0)}addRange(e,t=!0){return p.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let n=this.ranges.slice();return n[t]=e,p.create(n,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new p(e.ranges.map(t=>B.fromJSON(t)),e.main)}static single(e,t=e){return new p([p.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let n=0,i=0;i<e.length;i++){let s=e[i];if(s.empty?s.from<=n:s.from<n)return p.normalized(e.slice(),t);n=s.to}return new p(e,t)}static cursor(e,t=0,n,i){return B.create(e,e,(t==0?0:t<0?8:16)|(n==null?7:Math.min(6,n))|(i??16777215)<<6)}static range(e,t,n,i){let s=(n??16777215)<<6|(i==null?7:Math.min(6,i));return t<e?B.create(t,e,48|s):B.create(e,t,(t>e?8:0)|s)}static normalized(e,t=0){let n=e[t];e.sort((i,s)=>i.from-s.from),t=e.indexOf(n);for(let i=1;i<e.length;i++){let s=e[i],r=e[i-1];if(s.empty?s.from<=r.to:s.from<r.to){let h=r.from,o=Math.max(s.to,r.to);i<=t&&t--,e.splice(--i,2,s.anchor>s.head?p.range(o,h):p.range(h,o))}}return new p(e,t)}}function Je(l,e){for(let t of l.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let me=0;class A{constructor(e,t,n,i,s){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=i,this.id=me++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new A(e.combine||(t=>t),e.compareInput||((t,n)=>t===n),e.compare||(e.combine?(t,n)=>t===n:we),!!e.static,e.enables)}of(e){return new K([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new K(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new K(e,this,2,t)}from(e,t){return t||(t=n=>n),this.compute([e],n=>t(n.field(e)))}}function we(l,e){return l==e||l.length==e.length&&l.every((t,n)=>t===e[n])}class K{constructor(e,t,n,i){this.dependencies=e,this.facet=t,this.type=n,this.value=i,this.id=me++}dynamicSlot(e){var t;let n=this.value,i=this.facet.compareInput,s=this.id,r=e[s]>>1,h=this.type==2,o=!1,a=!1,u=[];for(let f of this.dependencies)f=="doc"?o=!0:f=="selection"?a=!0:(((t=e[f.id])!==null&&t!==void 0?t:1)&1)==0&&u.push(e[f.id]);return{create(f){return f.values[r]=n(f),1},update(f,d){if(o&&d.docChanged||a&&(d.docChanged||d.selection)||ae(f,u)){let c=n(f);if(h?!Pe(c,f.values[r],i):!i(c,f.values[r]))return f.values[r]=c,1}return 0},reconfigure:(f,d)=>{let c,g=d.config.address[s];if(g!=null){let b=Y(d,g);if(this.dependencies.every(v=>v instanceof A?d.facet(v)===f.facet(v):v instanceof L?d.field(v,!1)==f.field(v,!1):!0)||(h?Pe(c=n(f),b,i):i(c=n(f),b)))return f.values[r]=b,0}else c=n(f);return f.values[r]=c,1}}}}function Pe(l,e,t){if(l.length!=e.length)return!1;for(let n=0;n<l.length;n++)if(!t(l[n],e[n]))return!1;return!0}function ae(l,e){let t=!1;for(let n of e)$(l,n)&1&&(t=!0);return t}function _e(l,e,t){let n=t.map(o=>l[o.id]),i=t.map(o=>o.type),s=n.filter(o=>!(o&1)),r=l[e.id]>>1;function h(o){let a=[];for(let u=0;u<n.length;u++){let f=Y(o,n[u]);if(i[u]==2)for(let d of f)a.push(d);else a.push(f)}return e.combine(a)}return{create(o){for(let a of n)$(o,a);return o.values[r]=h(o),1},update(o,a){if(!ae(o,s))return 0;let u=h(o);return e.compare(u,o.values[r])?0:(o.values[r]=u,1)},reconfigure(o,a){let u=ae(o,n),f=a.config.facets[e.id],d=a.facet(e);if(f&&!u&&we(t,f))return o.values[r]=d,0;let c=h(o);return e.compare(c,d)?(o.values[r]=d,0):(o.values[r]=c,1)}}}const U=A.define({static:!0});class L{constructor(e,t,n,i,s){this.id=e,this.createF=t,this.updateF=n,this.compareF=i,this.spec=s,this.provides=void 0}static define(e){let t=new L(me++,e.create,e.update,e.compare||((n,i)=>n===i),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(U).find(n=>n.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:n=>(n.values[t]=this.create(n),1),update:(n,i)=>{let s=n.values[t],r=this.updateF(s,i);return this.compareF(s,r)?0:(n.values[t]=r,1)},reconfigure:(n,i)=>{let s=n.facet(U),r=i.facet(U),h;return(h=s.find(o=>o.field==this))&&h!=r.find(o=>o.field==this)?(n.values[t]=h.create(n),1):i.config.address[this.id]!=null?(n.values[t]=i.field(this),0):(n.values[t]=this.create(n),1)}}}init(e){return[this,U.of({field:this,create:e})]}get extension(){return this}}const T={lowest:4,low:3,default:2,high:1,highest:0};function D(l){return e=>new Le(e,l)}const gt={highest:D(T.highest),high:D(T.high),default:D(T.default),low:D(T.low),lowest:D(T.lowest)};class Le{constructor(e,t){this.inner=e,this.prec=t}}class te{of(e){return new ue(this,e)}reconfigure(e){return te.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class ue{constructor(e,t){this.compartment=e,this.inner=t}}class X{constructor(e,t,n,i,s,r){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=i,this.staticValues=s,this.facets=r,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,n){let i=[],s=Object.create(null),r=new Map;for(let d of et(e,t,r))d instanceof L?i.push(d):(s[d.facet.id]||(s[d.facet.id]=[])).push(d);let h=Object.create(null),o=[],a=[];for(let d of i)h[d.id]=a.length<<1,a.push(c=>d.slot(c));let u=n?.config.facets;for(let d in s){let c=s[d],g=c[0].facet,b=u&&u[d]||[];if(c.every(v=>v.type==0))if(h[g.id]=o.length<<1|1,we(b,c))o.push(n.facet(g));else{let v=g.combine(c.map(ne=>ne.value));o.push(n&&g.compare(v,n.facet(g))?n.facet(g):v)}else{for(let v of c)v.type==0?(h[v.id]=o.length<<1|1,o.push(v.value)):(h[v.id]=a.length<<1,a.push(ne=>v.dynamicSlot(ne)));h[g.id]=a.length<<1,a.push(v=>_e(v,g,c))}}let f=a.map(d=>d(h));return new X(e,r,f,h,o,s)}}function et(l,e,t){let n=[[],[],[],[],[]],i=new Map;function s(r,h){let o=i.get(r);if(o!=null){if(o<=h)return;let a=n[o].indexOf(r);a>-1&&n[o].splice(a,1),r instanceof ue&&t.delete(r.compartment)}if(i.set(r,h),Array.isArray(r))for(let a of r)s(a,h);else if(r instanceof ue){if(t.has(r.compartment))throw new RangeError("Duplicate use of compartment in extensions");let a=e.get(r.compartment)||r.inner;t.set(r.compartment,a),s(a,h)}else if(r instanceof Le)s(r.inner,r.prec);else if(r instanceof L)n[h].push(r),r.provides&&s(r.provides,h);else if(r instanceof K)n[h].push(r),r.facet.extensions&&s(r.facet.extensions,T.default);else{let a=r.extension;if(!a)throw new Error(`Unrecognized extension value in extension set (${r}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(a,h)}}return s(l,T.default),n.reduce((r,h)=>r.concat(h))}function $(l,e){if(e&1)return 2;let t=e>>1,n=l.status[t];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;l.status[t]=4;let i=l.computeSlot(l,l.config.dynamicSlots[t]);return l.status[t]=2|i}function Y(l,e){return e&1?l.config.staticValues[e>>1]:l.values[e>>1]}const De=A.define(),fe=A.define({combine:l=>l.some(e=>e),static:!0}),Ve=A.define({combine:l=>l.length?l[0]:void 0,static:!0}),Ne=A.define(),$e=A.define(),qe=A.define(),ze=A.define({combine:l=>l.length?l[0]:!1});class H{constructor(e,t){this.type=e,this.value=t}static define(){return new tt}}class tt{of(e){return new H(this,e)}}class nt{constructor(e){this.map=e}of(e){return new I(this,e)}}class I{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new I(this.type,t)}is(e){return this.type==e}static define(e={}){return new nt(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let i of e){let s=i.map(t);s&&n.push(s)}return n}}I.reconfigure=I.define();I.appendConfig=I.define();class P{constructor(e,t,n,i,s,r){this.startState=e,this.changes=t,this.selection=n,this.effects=i,this.annotations=s,this.scrollIntoView=r,this._doc=null,this._state=null,n&&Je(n,t.newLength),s.some(h=>h.type==P.time)||(this.annotations=s.concat(P.time.of(Date.now())))}static create(e,t,n,i,s,r){return new P(e,t,n,i,s,r)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(P.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}P.time=H.define();P.userEvent=H.define();P.addToHistory=H.define();P.remote=H.define();function it(l,e){let t=[];for(let n=0,i=0;;){let s,r;if(n<l.length&&(i==e.length||e[i]>=l[n]))s=l[n++],r=l[n++];else if(i<e.length)s=e[i++],r=e[i++];else return t;!t.length||t[t.length-1]<s?t.push(s,r):t[t.length-1]<r&&(t[t.length-1]=r)}}function We(l,e,t){var n;let i,s,r;return t?(i=e.changes,s=k.empty(e.changes.length),r=l.changes.compose(e.changes)):(i=e.changes.map(l.changes),s=l.changes.mapDesc(e.changes,!0),r=l.changes.compose(i)),{changes:r,selection:e.selection?e.selection.map(s):(n=l.selection)===null||n===void 0?void 0:n.map(i),effects:I.mapEffects(l.effects,i).concat(I.mapEffects(e.effects,s)),annotations:l.annotations.length?l.annotations.concat(e.annotations):e.annotations,scrollIntoView:l.scrollIntoView||e.scrollIntoView}}function ce(l,e,t){let n=e.selection,i=F(e.annotations);return e.userEvent&&(i=i.concat(P.userEvent.of(e.userEvent))),{changes:e.changes instanceof k?e.changes:k.of(e.changes||[],t,l.facet(Ve)),selection:n&&(n instanceof p?n:p.single(n.anchor,n.head)),effects:F(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function He(l,e,t){let n=ce(l,e.length?e[0]:{},l.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(t=!1);let r=!!e[s].sequential;n=We(n,ce(l,e[s],r?n.changes.newLength:l.doc.length),r)}let i=P.create(l,n.changes,n.selection,n.effects,n.annotations,n.scrollIntoView);return rt(t?st(i):i)}function st(l){let e=l.startState,t=!0;for(let i of e.facet(Ne)){let s=i(l);if(s===!1){t=!1;break}Array.isArray(s)&&(t=t===!0?s:it(t,s))}if(t!==!0){let i,s;if(t===!1)s=l.changes.invertedDesc,i=k.empty(e.doc.length);else{let r=l.changes.filter(t);i=r.changes,s=r.filtered.mapDesc(r.changes).invertedDesc}l=P.create(e,i,l.selection&&l.selection.map(s),I.mapEffects(l.effects,s),l.annotations,l.scrollIntoView)}let n=e.facet($e);for(let i=n.length-1;i>=0;i--){let s=n[i](l);s instanceof P?l=s:Array.isArray(s)&&s.length==1&&s[0]instanceof P?l=s[0]:l=He(e,F(s),!1)}return l}function rt(l){let e=l.startState,t=e.facet(qe),n=l;for(let i=t.length-1;i>=0;i--){let s=t[i](l);s&&Object.keys(s).length&&(n=We(n,ce(e,s,l.changes.newLength),!0))}return n==l?l:P.create(e,l.changes,l.selection,n.effects,n.annotations,n.scrollIntoView)}const lt=[];function F(l){return l==null?lt:Array.isArray(l)?l:[l]}var R=(function(l){return l[l.Word=0]="Word",l[l.Space=1]="Space",l[l.Other=2]="Other",l})(R||(R={}));const ht=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let de;try{de=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function ot(l){if(de)return de.test(l);for(let e=0;e<l.length;e++){let t=l[e];if(/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||ht.test(t)))return!0}return!1}function at(l){return e=>{if(!/\S/.test(e))return R.Space;if(ot(e))return R.Word;for(let t=0;t<l.length;t++)if(e.indexOf(l[t])>-1)return R.Word;return R.Other}}class w{constructor(e,t,n,i,s,r){this.config=e,this.doc=t,this.selection=n,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=s,r&&(r._state=this);for(let h=0;h<this.config.dynamicSlots.length;h++)$(this,h<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(n==null){if(t)throw new RangeError("Field is not present in this state");return}return $(this,n),Y(this,n)}update(...e){return He(this,e,!0)}applyTransaction(e){let t=this.config,{base:n,compartments:i}=t;for(let h of e.effects)h.is(te.reconfigure)?(t&&(i=new Map,t.compartments.forEach((o,a)=>i.set(a,o)),t=null),i.set(h.value.compartment,h.value.extension)):h.is(I.reconfigure)?(t=null,n=h.value):h.is(I.appendConfig)&&(t=null,n=F(n).concat(h.value));let s;t?s=e.startState.values.slice():(t=X.resolve(n,i,this),s=new w(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(o,a)=>a.reconfigure(o,this),null).values);let r=e.startState.facet(fe)?e.newSelection:e.newSelection.asSingle();new w(t,e.newDoc,r,s,(h,o)=>o.update(h,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:p.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),i=this.changes(n.changes),s=[n.range],r=F(n.effects);for(let h=1;h<t.ranges.length;h++){let o=e(t.ranges[h]),a=this.changes(o.changes),u=a.map(i);for(let d=0;d<h;d++)s[d]=s[d].map(u);let f=i.mapDesc(a,!0);s.push(o.range.map(f)),i=i.compose(u),r=I.mapEffects(r,u).concat(I.mapEffects(F(o.effects),f))}return{changes:i,selection:p.create(s,t.mainIndex),effects:r}}changes(e=[]){return e instanceof k?e:k.of(e,this.doc.length,this.facet(w.lineSeparator))}toText(e){return x.of(e.split(this.facet(w.lineSeparator)||le))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:($(this,t),Y(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let i=e[n];i instanceof L&&this.config.address[i.id]!=null&&(t[n]=i.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(e,t={},n){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(n){for(let s in n)if(Object.prototype.hasOwnProperty.call(e,s)){let r=n[s],h=e[s];i.push(r.init(o=>r.spec.fromJSON(h,o)))}}return w.create({doc:e.doc,selection:p.fromJSON(e.selection),extensions:t.extensions?i.concat([t.extensions]):i})}static create(e={}){let t=X.resolve(e.extensions||[],new Map),n=e.doc instanceof x?e.doc:x.of((e.doc||"").split(t.staticFacet(w.lineSeparator)||le)),i=e.selection?e.selection instanceof p?e.selection:p.single(e.selection.anchor,e.selection.head):p.single(0);return Je(i,n.length),t.staticFacet(fe)||(i=i.asSingle()),new w(t,n,i,t.dynamicSlots.map(()=>null),(s,r)=>r.create(s),null)}get tabSize(){return this.facet(w.tabSize)}get lineBreak(){return this.facet(w.lineSeparator)||`
|
|
5
|
+
`}get readOnly(){return this.facet(ze)}phrase(e,...t){for(let n of this.facet(w.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(n,i)=>{if(i=="$")return"$";let s=+(i||1);return!s||s>t.length?n:t[s-1]})),e}languageDataAt(e,t,n=-1){let i=[];for(let s of this.facet(De))for(let r of s(this,t,n))Object.prototype.hasOwnProperty.call(r,e)&&i.push(r[e]);return i}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return at(t.length?t[0]:"")}wordAt(e){let{text:t,from:n,length:i}=this.doc.lineAt(e),s=this.charCategorizer(e),r=e-n,h=e-n;for(;r>0;){let o=Q(t,r,!1);if(s(t.slice(o,r))!=R.Word)break;r=o}for(;h<i;){let o=Q(t,h);if(s(t.slice(h,o))!=R.Word)break;h=o}return r==h?null:p.range(r+n,h+n)}}w.allowMultipleSelections=fe;w.tabSize=A.define({combine:l=>l.length?l[0]:4});w.lineSeparator=Ve;w.readOnly=ze;w.phrases=A.define({compare(l,e){let t=Object.keys(l),n=Object.keys(e);return t.length==n.length&&t.every(i=>l[i]==e[i])}});w.languageData=De;w.changeFilter=Ne;w.transactionFilter=$e;w.transactionExtender=qe;te.reconfigure=I.define();function pt(l,e,t={}){let n={};for(let i of l)for(let s of Object.keys(i)){let r=i[s],h=n[s];if(h===void 0)n[s]=r;else if(!(h===r||r===void 0))if(Object.hasOwnProperty.call(t,s))n[s]=t[s](h,r);else throw new Error("Config merge conflict for field "+s)}for(let i in e)n[i]===void 0&&(n[i]=e[i]);return n}class _{eq(e){return this==e}range(e,t=e){return z.create(e,t,this)}}_.prototype.startSide=_.prototype.endSide=0;_.prototype.point=!1;_.prototype.mapMode=O.TrackDel;function ve(l,e){return l==e||l.constructor==e.constructor&&l.eq(e)}class z{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new z(e,t,n)}}function ge(l,e){return l.from-e.from||l.value.startSide-e.value.startSide}class xe{constructor(e,t,n,i){this.from=e,this.to=t,this.value=n,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,i=0){let s=n?this.to:this.from;for(let r=i,h=s.length;;){if(r==h)return r;let o=r+h>>1,a=s[o]-e||(n?this.value[o].endSide:this.value[o].startSide)-t;if(o==r)return a>=0?r:h;a>=0?h=o:r=o+1}}between(e,t,n,i){for(let s=this.findIndex(t,-1e9,!0),r=this.findIndex(n,1e9,!1,s);s<r;s++)if(i(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,t){let n=[],i=[],s=[],r=-1,h=-1;for(let o=0;o<this.value.length;o++){let a=this.value[o],u=this.from[o]+e,f=this.to[o]+e,d,c;if(u==f){let g=t.mapPos(u,a.startSide,a.mapMode);if(g==null||(d=c=g,a.startSide!=a.endSide&&(c=t.mapPos(u,a.endSide),c<d)))continue}else if(d=t.mapPos(u,a.startSide),c=t.mapPos(f,a.endSide),d>c||d==c&&a.startSide>0&&a.endSide<=0)continue;(c-d||a.endSide-a.startSide)<0||(r<0&&(r=d),a.point&&(h=Math.max(h,c-d)),n.push(a),i.push(d-r),s.push(c-r))}return{mapped:n.length?new xe(i,s,n,h):null,pos:r}}}class S{constructor(e,t,n,i){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=i}static create(e,t,n,i){return new S(e,t,n,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:i=0,filterTo:s=this.length}=e,r=e.filter;if(t.length==0&&!r)return this;if(n&&(t=t.slice().sort(ge)),this.isEmpty)return t.length?S.of(t):this;let h=new Ue(this,null,-1).goto(0),o=0,a=[],u=new ee;for(;h.value||o<t.length;)if(o<t.length&&(h.from-t[o].from||h.startSide-t[o].value.startSide)>=0){let f=t[o++];u.addInner(f.from,f.to,f.value)||a.push(f)}else h.rangeIndex==1&&h.chunkIndex<this.chunk.length&&(o==t.length||this.chunkEnd(h.chunkIndex)<t[o].from)&&(!r||i>this.chunkEnd(h.chunkIndex)||s<this.chunkPos[h.chunkIndex])&&u.addChunk(this.chunkPos[h.chunkIndex],this.chunk[h.chunkIndex])?h.nextChunk():((!r||i>h.to||s<h.from||r(h.from,h.to,h.value))&&(u.addInner(h.from,h.to,h.value)||a.push(z.create(h.from,h.to,h.value))),h.next());return u.finishInner(this.nextLayer.isEmpty&&!a.length?S.empty:this.nextLayer.update({add:a,filter:r,filterFrom:i,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],n=[],i=-1;for(let r=0;r<this.chunk.length;r++){let h=this.chunkPos[r],o=this.chunk[r],a=e.touchesRange(h,h+o.length);if(a===!1)i=Math.max(i,o.maxPoint),t.push(o),n.push(e.mapPos(h));else if(a===!0){let{mapped:u,pos:f}=o.map(h,e);u&&(i=Math.max(i,u.maxPoint),t.push(u),n.push(f))}}let s=this.nextLayer.map(e);return t.length==0?s:new S(n,t,s||S.empty,i)}between(e,t,n){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let s=this.chunkPos[i],r=this.chunk[i];if(t>=s&&e<=s+r.length&&r.between(s,e-s,t-s,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return W.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return W.from(e).goto(t)}static compare(e,t,n,i,s=-1){let r=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),h=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),o=Ae(r,h,n),a=new V(r,o,s),u=new V(h,o,s);n.iterGaps((f,d,c)=>be(a,f,u,d,c,i)),n.empty&&n.length==0&&be(a,0,u,0,0,i)}static eq(e,t,n=0,i){i==null&&(i=999999999);let s=e.filter(u=>!u.isEmpty&&t.indexOf(u)<0),r=t.filter(u=>!u.isEmpty&&e.indexOf(u)<0);if(s.length!=r.length)return!1;if(!s.length)return!0;let h=Ae(s,r),o=new V(s,h,0).goto(n),a=new V(r,h,0).goto(n);for(;;){if(o.to!=a.to||!pe(o.active,a.active)||o.point&&(!a.point||!ve(o.point,a.point)))return!1;if(o.to>i)return!0;o.next(),a.next()}}static spans(e,t,n,i,s=-1){let r=new V(e,null,s).goto(t),h=t,o=r.openStart;for(;;){let a=Math.min(r.to,n);if(r.point){let u=r.activeForPoint(r.to),f=r.pointFrom<t?u.length+1:r.point.startSide<0?u.length:Math.min(u.length,o);i.point(h,a,r.point,u,f,r.pointRank),o=Math.min(r.openEnd(a),u.length)}else a>h&&(i.span(h,a,r.active,o),o=r.openEnd(a));if(r.to>n)return o+(r.point&&r.to>n?1:0);h=r.to,r.next()}}static of(e,t=!1){let n=new ee;for(let i of e instanceof z?[e]:t?ut(e):e)n.add(i.from,i.to,i.value);return n.finish()}static join(e){if(!e.length)return S.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let i=e[n];i!=S.empty;i=i.nextLayer)t=new S(i.chunkPos,i.chunk,t,Math.max(i.maxPoint,t.maxPoint));return t}}S.empty=new S([],[],null,-1);function ut(l){if(l.length>1)for(let e=l[0],t=1;t<l.length;t++){let n=l[t];if(ge(e,n)>0)return l.slice().sort(ge);e=n}return l}S.empty.nextLayer=S.empty;class ee{finishChunk(e){this.chunks.push(new xe(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new ee)).add(e,t,n)}addInner(e,t,n){let i=e-this.lastTo||n.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(S.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=S.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Ae(l,e,t){let n=new Map;for(let s of l)for(let r=0;r<s.chunk.length;r++)s.chunk[r].maxPoint<=0&&n.set(s.chunk[r],s.chunkPos[r]);let i=new Set;for(let s of e)for(let r=0;r<s.chunk.length;r++){let h=n.get(s.chunk[r]);h!=null&&(t?t.mapPos(h):h)==s.chunkPos[r]&&!t?.touchesRange(h,h+s.chunk[r].length)&&i.add(s.chunk[r])}return i}class Ue{constructor(e,t,n,i=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<e||i.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class W{constructor(e){this.heap=e}static from(e,t=null,n=-1){let i=[];for(let s=0;s<e.length;s++)for(let r=e[s];!r.isEmpty;r=r.nextLayer)r.maxPoint>=n&&i.push(new Ue(r,t,n,s));return i.length==1?i[0]:new W(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let n=this.heap.length>>1;n>=0;n--)se(this.heap,n);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let n=this.heap.length>>1;n>=0;n--)se(this.heap,n);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),se(this.heap,0)}}}function se(l,e){for(let t=l[e];;){let n=(e<<1)+1;if(n>=l.length)break;let i=l[n];if(n+1<l.length&&i.compare(l[n+1])>=0&&(i=l[n+1],n++),t.compare(i)<0)break;l[n]=t,l[e]=i,e=n}}class V{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=W.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){G(this.active,e),G(this.activeTo,e),G(this.activeRank,e),this.minActive=Ce(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:i,rank:s}=this.cursor;for(;t<this.activeRank.length&&(s-this.activeRank[t]||i-this.activeTo[t])>0;)t++;j(this.active,t,n),j(this.activeTo,t,i),j(this.activeRank,t,s),e&&j(e,t,this.cursor.from),this.minActive=Ce(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),n&&G(n,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(n){this.openStart=0;for(let i=n.length-1;i>=0&&n[i]<e;i--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function be(l,e,t,n,i,s){l.goto(e),t.goto(n);let r=n+i,h=n,o=n-e,a=!!s.boundChange;for(let u=!1;;){let f=l.to+o-t.to,d=f||l.endSide-t.endSide,c=d<0?l.to+o:t.to,g=Math.min(c,r);if(l.point||t.point?(l.point&&t.point&&ve(l.point,t.point)&&pe(l.activeForPoint(l.to),t.activeForPoint(t.to))||s.comparePoint(h,g,l.point,t.point),u=!1):(u&&s.boundChange(h),g>h&&!pe(l.active,t.active)&&s.compareRange(h,g,l.active,t.active),a&&g<r&&(f||l.openEnd(c)!=t.openEnd(c))&&(u=!0)),c>r)break;h=c,d<=0&&l.next(),d>=0&&t.next()}}function pe(l,e){if(l.length!=e.length)return!1;for(let t=0;t<l.length;t++)if(l[t]!=e[t]&&!ve(l[t],e[t]))return!1;return!0}function G(l,e){for(let t=e,n=l.length-1;t<n;t++)l[t]=l[t+1];l.pop()}function j(l,e,t){for(let n=l.length-1;n>=e;n--)l[n+1]=l[n];l[e]=t}function Ce(l,e){let t=-1,n=1e9;for(let i=0;i<e.length;i++)(e[i]-n||l[i].endSide-l[t].endSide)<0&&(t=i,n=e[i]);return t}function mt(l,e,t=l.length){let n=0;for(let i=0;i<t&&i<l.length;)l.charCodeAt(i)==9?(n+=e-n%e,i++):(n++,i=Q(l,i));return n}function wt(l,e,t,n){for(let i=0,s=0;;){if(s>=e)return i;if(i==l.length)break;s+=l.charCodeAt(i)==9?t-s%t:1,i=Q(l,i)}return n===!0?-1:l.length}export{H as Annotation,tt as AnnotationType,E as ChangeDesc,k as ChangeSet,R as CharCategory,te as Compartment,p as EditorSelection,w as EditorState,A as Facet,Qe as Line,O as MapMode,gt as Prec,z as Range,S as RangeSet,ee as RangeSetBuilder,_ as RangeValue,B as SelectionRange,I as StateEffect,nt as StateEffectType,L as StateField,x as Text,P as Transaction,ft as codePointAt,dt as codePointSize,pt as combineConfig,mt as countColumn,Q as findClusterBreak,wt as findColumn,ct as fromCodePoint};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{L as be,E as $,C as he}from"./index-K6OVmfhg.js";import{w as Te,k as Pe,t as b,L as xe,l as Ve,n as ye,p as we,G as ve,s as K}from"./index-CVbycZ0H.js";import{cssLanguage as J,css as Xe}from"./index-uQa2yckk.js";import{typescriptLanguage as $e,jsxLanguage as _e,tsxLanguage as qe,javascriptLanguage as M,javascript as ke}from"./index-DC4HMHxY.js";import{E as Ce}from"./index-Dw7rDFmE.js";import{EditorSelection as Qe}from"./index-Cs5oz2oJ.js";import"./index-OpqBpSjn.js";const Ae=55,Ye=1,Me=56,Re=2,Ee=57,Ze=3,z=4,Be=5,R=6,ee=7,te=8,ae=9,le=10,ze=11,De=12,We=13,_=58,Ne=14,Ge=15,D=59,re=21,Ie=23,ne=24,je=25,A=27,se=28,Ue=29,Le=32,Fe=35,He=37,Ke=38,Je=0,et=1,tt={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},at={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},W={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function lt(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}let N=null,G=null,I=0;function Y(e,a){let r=e.pos+a;if(I==r&&G==e)return N;let l=e.peek(a),t="";for(;lt(l);)t+=String.fromCharCode(l),l=e.peek(++a);return G=e,I=r,N=t?t.toLowerCase():l==rt||l==nt?void 0:null}const oe=60,X=62,E=47,rt=63,nt=33,st=45;function j(e,a){this.name=e,this.parent=a}const ot=[R,le,ee,te,ae],it=new he({start:null,shift(e,a,r,l){return ot.indexOf(a)>-1?new j(Y(l,1)||"",e):e},reduce(e,a){return a==re&&e?e.parent:e},reuse(e,a,r,l){let t=a.type.id;return t==R||t==He?new j(Y(l,1)||"",e):e},strict:!1}),ut=new $((e,a)=>{if(e.next!=oe){e.next<0&&a.context&&e.acceptToken(_);return}e.advance();let r=e.next==E;r&&e.advance();let l=Y(e,0);if(l===void 0)return;if(!l)return e.acceptToken(r?Ge:Ne);let t=a.context?a.context.name:null;if(r){if(l==t)return e.acceptToken(ze);if(t&&at[t])return e.acceptToken(_,-2);if(a.dialectEnabled(Je))return e.acceptToken(De);for(let s=a.context;s;s=s.parent)if(s.name==l)return;e.acceptToken(We)}else{if(l=="script")return e.acceptToken(ee);if(l=="style")return e.acceptToken(te);if(l=="textarea")return e.acceptToken(ae);if(tt.hasOwnProperty(l))return e.acceptToken(le);t&&W[t]&&W[t][l]?e.acceptToken(_,-1):e.acceptToken(R)}},{contextual:!0}),Ot=new $(e=>{for(let a=0,r=0;;r++){if(e.next<0){r&&e.acceptToken(D);break}if(e.next==st)a++;else if(e.next==X&&a>=2){r>=3&&e.acceptToken(D,-2);break}else a=0;e.advance()}});function dt(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const ct=new $((e,a)=>{if(e.next==E&&e.peek(1)==X){let r=a.dialectEnabled(et)||dt(a.context);e.acceptToken(r?Be:z,2)}else e.next==X&&e.acceptToken(z,1)});function Z(e,a,r){let l=2+e.length;return new $(t=>{for(let s=0,o=0,i=0;;i++){if(t.next<0){i&&t.acceptToken(a);break}if(s==0&&t.next==oe||s==1&&t.next==E||s>=2&&s<l&&t.next==e.charCodeAt(s-2))s++,o++;else if(s==l&&t.next==X){i>o?t.acceptToken(a,-o):t.acceptToken(r,-(o-2));break}else if((t.next==10||t.next==13)&&i){t.acceptToken(a,1);break}else s=o=0;t.advance()}})}const pt=Z("script",Ae,Ye),mt=Z("style",Me,Re),ft=Z("textarea",Ee,Ze),gt=Pe({"Text RawText IncompleteTag IncompleteCloseTag":b.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":b.angleBracket,TagName:b.tagName,"MismatchedCloseTag/TagName":[b.tagName,b.invalid],AttributeName:b.attributeName,"AttributeValue UnquotedAttributeValue":b.attributeValue,Is:b.definitionOperator,"EntityReference CharacterReference":b.character,Comment:b.blockComment,ProcessingInst:b.processingInstruction,DoctypeDecl:b.documentMeta}),St=be.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:",c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:it,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[gt],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|caPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bXaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UVaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pTaPOv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!dpOv(Vx;'S(V;'S;=`(h<%lO(Vp(kP;=`<%l(Vq(qP;=`<%l&}a({WaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t`)jT!b`Or)esv)ew;'S)e;'S;=`)y<%lO)e`)|P;=`<%l)ea*SP;=`<%l(t!Q*^V!b`!dpOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!Q*vP;=`<%l*V!R*|P;=`<%l&XW+UYlWOX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+PW+wP;=`<%l+P!Z+}P;=`<%l$q!a,]`aP!b`!dp!_^OX&XXY,QYZ,QZ]&X]^,Q^p&Xpq,Qqr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!_-ljiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q[/ebiSlWOX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+PS0rXiSqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0mS1bP;=`<%l0m[1hP;=`<%l/^!V1vciSaP!b`!dpOq&Xqr1krs&}sv1kvw0mwx(tx!P1k!P!Q&X!Q!^1k!^!_*V!_!a&X!a#s1k#s$f&X$f;'S1k;'S;=`3R<%l?Ah1k?Ah?BY&X?BY?Mn1k?MnO&X!V3UP;=`<%l1k!_3[P;=`<%l-_!Z3hV!ahaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}!_4WiiSlWd!ROX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst>]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!V<QciSOp7Sqr;{rs7Sst0mtw;{wx7Sx!P;{!P!Q7S!Q!];{!]!^=]!^!a7S!a#s;{#s$f7S$f;'S;{;'S;=`>P<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[pt,mt,ft,ct,ut,Ot,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function ie(e,a){let r=Object.create(null);for(let l of e.getChildren(ne)){let t=l.getChild(je),s=l.getChild(A)||l.getChild(se);t&&(r[a.read(t.from,t.to)]=s?s.type.id==A?a.read(s.from+1,s.to-1):a.read(s.from,s.to):"")}return r}function U(e,a){let r=e.getChild(Ie);return r?a.read(r.from,r.to):" "}function q(e,a,r){let l;for(let t of r)if(!t.attrs||t.attrs(l||(l=ie(e.node.parent.firstChild,a))))return{parser:t.parser,bracketed:!0};return null}function ue(e=[],a=[]){let r=[],l=[],t=[],s=[];for(let i of e)(i.tag=="script"?r:i.tag=="style"?l:i.tag=="textarea"?t:s).push(i);let o=a.length?Object.create(null):null;for(let i of a)(o[i.name]||(o[i.name]=[])).push(i);return Te((i,u)=>{let f=i.type.id;if(f==Ue)return q(i,u,r);if(f==Le)return q(i,u,l);if(f==Fe)return q(i,u,t);if(f==re&&s.length){let p=i.node,d=p.firstChild,m=d&&U(d,u),O;if(m){for(let c of s)if(c.tag==m&&(!c.attrs||c.attrs(O||(O=ie(d,u))))){let S=p.lastChild,h=S.type.id==Ke?S.from:p.to;if(h>d.to)return{parser:c.parser,overlay:[{from:d.to,to:h}]}}}}if(o&&f==ne){let p=i.node,d;if(d=p.firstChild){let m=o[u.read(d.from,d.to)];if(m)for(let O of m){if(O.tagName&&O.tagName!=U(p.parent,u))continue;let c=p.lastChild;if(c.type.id==A){let S=c.from+1,h=c.lastChild,T=c.to-(h&&h.isError?0:1);if(T>S)return{parser:O.parser,overlay:[{from:S,to:T}],bracketed:!0}}else if(c.type.id==se)return{parser:O.parser,overlay:[{from:c.from,to:c.to}]}}}}return null})}const V=["_blank","_self","_top","_parent"],k=["ascii","utf-8","utf-16","latin1","latin1"],C=["get","post","put","delete"],Q=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],g=["true","false"],n={},bt={a:{attrs:{href:null,ping:null,type:null,media:null,target:V,hreflang:null}},abbr:n,address:n,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:n,aside:n,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:n,base:{attrs:{href:null,target:V}},bdi:n,bdo:n,blockquote:{attrs:{cite:null}},body:n,br:n,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Q,formmethod:C,formnovalidate:["novalidate"],formtarget:V,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:n,center:n,cite:n,code:n,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:n,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:n,div:n,dl:n,dt:n,em:n,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:n,figure:n,footer:n,form:{attrs:{action:null,name:null,"accept-charset":k,autocomplete:["on","off"],enctype:Q,method:C,novalidate:["novalidate"],target:V}},h1:n,h2:n,h3:n,h4:n,h5:n,h6:n,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:n,hgroup:n,hr:n,html:{attrs:{manifest:null}},i:n,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Q,formmethod:C,formnovalidate:["novalidate"],formtarget:V,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:n,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:n,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:n,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:k,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:n,noscript:n,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:n,param:{attrs:{name:null,value:null}},pre:n,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:n,rt:n,ruby:n,samp:n,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:k}},section:n,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:n,source:{attrs:{src:null,type:null,media:null}},span:n,strong:n,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:n,summary:n,sup:n,table:n,tbody:n,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:n,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:n,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:n,time:{attrs:{datetime:null}},title:n,tr:n,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:n,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:n},Oe={accesskey:null,class:null,contenteditable:g,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:g,autocorrect:g,autocapitalize:g,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":g,"aria-autocomplete":["inline","list","both","none"],"aria-busy":g,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":g,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":g,"aria-hidden":g,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":g,"aria-multiselectable":g,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":g,"aria-relevant":null,"aria-required":g,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},de="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of de)Oe[e]=null;class y{constructor(a,r){this.tags={...bt,...a},this.globalAttrs={...Oe,...r},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}y.default=new y;function P(e,a,r=e.length){if(!a)return"";let l=a.firstChild,t=l&&l.getChild("TagName");return t?e.sliceString(t.from,Math.min(t.to,r)):""}function x(e,a=!1){for(;e;e=e.parent)if(e.name=="Element")if(a)a=!1;else return e;return null}function ce(e,a,r){let l=r.tags[P(e,x(a))];return l?.children||r.allTags}function B(e,a){let r=[];for(let l=x(a);l&&!l.type.isTop;l=x(l.parent)){let t=P(e,l);if(t&&l.lastChild.name=="CloseTag")break;t&&r.indexOf(t)<0&&(a.name=="EndTag"||a.from>=l.firstChild.to)&&r.push(t)}return r}const pe=/^[:\-\.\w\u00b7-\uffff]*$/;function L(e,a,r,l,t){let s=/\s*>/.test(e.sliceDoc(t,t+5))?"":">",o=x(r,r.name=="StartTag"||r.name=="TagName");return{from:l,to:t,options:ce(e.doc,o,a).map(i=>({label:i,type:"type"})).concat(B(e.doc,r).map((i,u)=>({label:"/"+i,apply:"/"+i+s,type:"type",boost:99-u}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function F(e,a,r,l){let t=/\s*>/.test(e.sliceDoc(l,l+5))?"":">";return{from:r,to:l,options:B(e.doc,a).map((s,o)=>({label:s,apply:s+t,type:"type",boost:99-o})),validFor:pe}}function ht(e,a,r,l){let t=[],s=0;for(let o of ce(e.doc,r,a))t.push({label:"<"+o,type:"type"});for(let o of B(e.doc,r))t.push({label:"</"+o+">",type:"type",boost:99-s++});return{from:l,to:l,options:t,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Tt(e,a,r,l,t){let s=x(r),o=s?a.tags[P(e.doc,s)]:null,i=o&&o.attrs?Object.keys(o.attrs):[],u=o&&o.globalAttrs===!1?i:i.length?i.concat(a.globalAttrNames):a.globalAttrNames;return{from:l,to:t,options:u.map(f=>({label:f,type:"property"})),validFor:pe}}function Pt(e,a,r,l,t){var s;let o=(s=r.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),i=[],u;if(o){let f=e.sliceDoc(o.from,o.to),p=a.globalAttrs[f];if(!p){let d=x(r),m=d?a.tags[P(e.doc,d)]:null;p=m?.attrs&&m.attrs[f]}if(p){let d=e.sliceDoc(l,t).toLowerCase(),m='"',O='"';/^['"]/.test(d)?(u=d[0]=='"'?/^[^"]*$/:/^[^']*$/,m="",O=e.sliceDoc(t,t+1)==d[0]?"":d[0],d=d.slice(1),l++):u=/^[^\s<>='"]*$/;for(let c of p)i.push({label:c,apply:m+c+O,type:"constant"})}}return{from:l,to:t,options:i,validFor:u}}function me(e,a){let{state:r,pos:l}=a,t=K(r).resolveInner(l,-1),s=t.resolve(l);for(let o=l,i;s==t&&(i=t.childBefore(o));){let u=i.lastChild;if(!u||!u.type.isError||u.from<u.to)break;s=t=i,o=u.from}return t.name=="TagName"?t.parent&&/CloseTag$/.test(t.parent.name)?F(r,t,t.from,l):L(r,e,t,t.from,l):t.name=="StartTag"||t.name=="IncompleteTag"?L(r,e,t,l,l):t.name=="StartCloseTag"||t.name=="IncompleteCloseTag"?F(r,t,l,l):t.name=="OpenTag"||t.name=="SelfClosingTag"||t.name=="AttributeName"?Tt(r,e,t,t.name=="AttributeName"?t.from:l,l):t.name=="Is"||t.name=="AttributeValue"||t.name=="UnquotedAttributeValue"?Pt(r,e,t,t.name=="Is"?l:t.from,l):a.explicit&&(s.name=="Element"||s.name=="Text"||s.name=="Document")?ht(r,e,t,l):null}function Ct(e){return me(y.default,e)}function xt(e){let{extraTags:a,extraGlobalAttributes:r}=e,l=r||a?new y(a,r):y.default;return t=>me(l,t)}const Vt=M.parser.configure({top:"SingleExpression"}),fe=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:$e.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:_e.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:qe.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:Vt},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:M.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:J.parser}],ge=[{name:"style",parser:J.parser.configure({top:"Styles"})}].concat(de.map(e=>({name:e,parser:M.parser}))),Se=Ve.define({name:"html",parser:St.configure({props:[ye.add({Element(e){let a=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+a[0].length?e.continue():e.lineIndent(e.node.from)+(a[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let a=null,r;for(let l=e.node;;){let t=l.lastChild;if(!t||t.name!="Element"||t.to!=l.to)break;a=l=t}return a&&!((r=a.lastChild)&&(r.name=="CloseTag"||r.name=="SelfClosingTag"))?e.lineIndent(a.from)+e.unit:null}}),we.add({Element(e){let a=e.firstChild,r=e.lastChild;return!a||a.name!="OpenTag"?null:{from:a.to,to:r.name=="CloseTag"?r.from:e.to}}}),ve.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),v=Se.configure({wrap:ue(fe,ge)});function Qt(e={}){let a="",r;e.matchClosingTags===!1&&(a="noMatch"),e.selfClosingTags===!0&&(a=(a?a+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(r=ue((e.nestedLanguages||[]).concat(fe),(e.nestedAttributes||[]).concat(ge)));let l=r?Se.configure({wrap:r,dialect:a}):a?v.configure({dialect:a}):v;return new xe(l,[v.data.of({autocomplete:xt(e)}),e.autoCloseTags!==!1?yt:[],ke().support,Xe().support])}const H=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),yt=Ce.inputHandler.of((e,a,r,l,t)=>{if(e.composing||e.state.readOnly||a!=r||l!=">"&&l!="/"||!v.isActiveAt(e.state,a,-1))return!1;let s=t(),{state:o}=s,i=o.changeByRange(u=>{var f,p,d;let m=o.doc.sliceString(u.from-1,u.to)==l,{head:O}=u,c=K(o).resolveInner(O,-1),S;if(m&&l==">"&&c.name=="EndTag"){let h=c.parent;if(((p=(f=h.parent)===null||f===void 0?void 0:f.lastChild)===null||p===void 0?void 0:p.name)!="CloseTag"&&(S=P(o.doc,h.parent,O))&&!H.has(S)){let T=O+(o.doc.sliceString(O,O+1)===">"?1:0),w=`</${S}>`;return{range:u,changes:{from:O,to:T,insert:w}}}}else if(m&&l=="/"&&c.name=="IncompleteCloseTag"){let h=c.parent;if(c.from==O-2&&((d=h.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(S=P(o.doc,h,O))&&!H.has(S)){let T=O+(o.doc.sliceString(O,O+1)===">"?1:0),w=`${S}>`;return{range:Qe.cursor(O+w.length,-1),changes:{from:O,to:T,insert:w}}}}return{range:u}});return i.changes.empty?!1:(e.dispatch([s,o.update(i,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});export{yt as autoCloseTags,Qt as html,Ct as htmlCompletionSource,xt as htmlCompletionSourceWith,v as htmlLanguage};
|