@eihrteam/xml-lsp 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +47 -2
- package/dist/npm/LICENSE +201 -0
- package/dist/npm/ThirdPartyNotices.txt +384 -0
- package/dist/npm/ace-client/index.d.ts +12 -0
- package/dist/npm/ace-client/index.js +15 -0
- package/dist/npm/browser-client/index.d.ts +33 -0
- package/dist/npm/browser-client/index.js +12 -0
- package/dist/npm/cli.js +3 -0
- package/dist/npm/language-server/browser.d.ts +2 -0
- package/dist/npm/language-server/browser.js +41 -0
- package/dist/npm/language-server/index.d.ts +1 -0
- package/dist/npm/language-server/index.js +28 -0
- package/dist/npm/language-server/node-api.d.ts +2 -0
- package/dist/npm/language-server/node-api.js +43 -0
- package/dist/npm/language-server/server.d.ts +9 -0
- package/dist/npm/language-server/worker.d.ts +1 -0
- package/dist/npm/language-server/worker.js +41 -0
- package/dist/npm/language-service/content-model.d.ts +18 -0
- package/dist/npm/language-service/document.d.ts +32 -0
- package/dist/npm/language-service/edits.d.ts +14 -0
- package/dist/npm/language-service/index.d.ts +24 -0
- package/dist/npm/language-service/index.js +28 -0
- package/dist/npm/language-service/intelligence.d.ts +8 -0
- package/dist/npm/language-service/parser.d.ts +68 -0
- package/dist/npm/language-service/schema-model.d.ts +43 -0
- package/dist/npm/language-service/schema.generated.d.ts +2 -0
- package/dist/npm/language-service/validation.d.ts +9 -0
- package/dist/npm/monaco-client/index.d.ts +7 -0
- package/dist/npm/monaco-client/index.js +14 -0
- package/docs/api.md +48 -0
- package/docs/architecture.md +45 -0
- package/docs/editor-integration.md +51 -0
- package/docs/implementation.md +57 -0
- package/docs/releasing.md +30 -0
- package/package.json +128 -4
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import{createRequire as e}from"node:module";import{fileURLToPath as t}from"node:url";var n=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},r=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),i=/* @__PURE__ */ e(import.meta.url),a=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.thenable=e.typedArray=e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0,e.boolean=function(e){return e===!0||e===!1};function t(e){return typeof e==`string`||e instanceof String}e.string=t,e.number=function(e){return typeof e==`number`||e instanceof Number},e.error=function(e){return e instanceof Error};function n(e){return typeof e==`function`}e.func=n;function r(e){return Array.isArray(e)}e.array=r,e.stringArray=function(e){return r(e)&&e.every(e=>t(e))},e.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)},e.thenable=function(e){return e&&n(e.then)}})),o=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0,e.boolean=function(e){return e===!0||e===!1};function t(e){return typeof e==`string`||e instanceof String}e.string=t,e.number=function(e){return typeof e==`number`||e instanceof Number},e.error=function(e){return e instanceof Error},e.func=function(e){return typeof e==`function`};function n(e){return Array.isArray(e)}e.array=n,e.stringArray=function(e){return n(e)&&e.every(e=>t(e))}})),s=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Message=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType=e.RequestType0=e.AbstractMessageSignature=e.ParameterStructures=e.ResponseError=e.ErrorCodes=void 0;let t=o();var n;(function(e){e.ParseError=-32700,e.InvalidRequest=-32600,e.MethodNotFound=-32601,e.InvalidParams=-32602,e.InternalError=-32603,e.jsonrpcReservedErrorRangeStart=-32099,e.serverErrorStart=-32099,e.MessageWriteError=-32099,e.MessageReadError=-32098,e.PendingResponseRejected=-32097,e.ConnectionInactive=-32096,e.ServerNotInitialized=-32002,e.UnknownErrorCode=-32001,e.jsonrpcReservedErrorRangeEnd=-32e3,e.serverErrorEnd=-32e3})(n||(e.ErrorCodes=n={})),e.ResponseError=class e extends Error{constructor(r,i,a){super(i),this.code=t.number(r)?r:n.UnknownErrorCode,this.data=a,Object.setPrototypeOf(this,e.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};var r=class e{constructor(e){this.kind=e}static is(t){return t===e.auto||t===e.byName||t===e.byPosition}toString(){return this.kind}};e.ParameterStructures=r,r.auto=new r(`auto`),r.byPosition=new r(`byPosition`),r.byName=new r(`byName`);var i=class{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return r.auto}};e.AbstractMessageSignature=i,e.RequestType0=class extends i{constructor(e){super(e,0)}},e.RequestType=class extends i{constructor(e,t=r.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},e.RequestType1=class extends i{constructor(e,t=r.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},e.RequestType2=class extends i{constructor(e){super(e,2)}},e.RequestType3=class extends i{constructor(e){super(e,3)}},e.RequestType4=class extends i{constructor(e){super(e,4)}},e.RequestType5=class extends i{constructor(e){super(e,5)}},e.RequestType6=class extends i{constructor(e){super(e,6)}},e.RequestType7=class extends i{constructor(e){super(e,7)}},e.RequestType8=class extends i{constructor(e){super(e,8)}},e.RequestType9=class extends i{constructor(e){super(e,9)}},e.NotificationType=class extends i{constructor(e,t=r.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},e.NotificationType0=class extends i{constructor(e){super(e,0)}},e.NotificationType1=class extends i{constructor(e,t=r.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}},e.NotificationType2=class extends i{constructor(e){super(e,2)}},e.NotificationType3=class extends i{constructor(e){super(e,3)}},e.NotificationType4=class extends i{constructor(e){super(e,4)}},e.NotificationType5=class extends i{constructor(e){super(e,5)}},e.NotificationType6=class extends i{constructor(e){super(e,6)}},e.NotificationType7=class extends i{constructor(e){super(e,7)}},e.NotificationType8=class extends i{constructor(e){super(e,8)}},e.NotificationType9=class extends i{constructor(e){super(e,9)}};var a;(function(e){e.isRequest=function(e){let n=e;return n&&t.string(n.method)&&(t.string(n.id)||t.number(n.id))},e.isNotification=function(e){let n=e;return n&&t.string(n.method)&&e.id===void 0},e.isResponse=function(e){let n=e;return n&&(n.result!==void 0||!!n.error)&&(t.string(n.id)||t.number(n.id)||n.id===null)}})(a||(e.Message=a={}))})),c=/* @__PURE__ */ r((e=>{var t;Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=e.LinkedMap=e.Touch=void 0;var n;(function(e){e.None=0,e.First=1,e.AsOld=e.First,e.Last=2,e.AsNew=e.Last})(n||(e.Touch=n={}));var r=class{constructor(){this[t]=`LinkedMap`,this._map=/* @__PURE__ */ new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=n.None){let r=this._map.get(e);if(r)return t!==n.None&&this.touch(r,t),r.value}set(e,t,r=n.None){let i=this._map.get(e);if(i)i.value=t,r!==n.None&&this.touch(i,r);else{switch(i={key:e,value:t,next:void 0,previous:void 0},r){case n.None:this.addItemLast(i);break;case n.First:this.addItemFirst(i);break;case n.Last:default:this.addItemLast(i)}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw Error(`Invalid list`);let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let n=this._state,r=this._head;for(;r;){if(t?e.bind(t)(r.value,r.key,this):e(r.value,r.key,this),this._state!==n)throw Error(`LinkedMap got modified during iteration.`);r=r.next}}keys(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw Error(`LinkedMap got modified during iteration.`);if(t){let e={value:t.key,done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}values(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw Error(`LinkedMap got modified during iteration.`);if(t){let e={value:t.value,done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}entries(){let e=this._state,t=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw Error(`LinkedMap got modified during iteration.`);if(t){let e={value:[t.key,t.value],done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}[(t=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw Error(`Invalid list`);this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw Error(`Invalid list`);this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw Error(`Invalid list`);e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw Error(`Invalid list`);e.previous.next=void 0,this._tail=e.previous}else{let t=e.next,n=e.previous;if(!t||!n)throw Error(`Invalid list`);t.previous=n,n.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw Error(`Invalid list`);if(t===n.First||t===n.Last){if(t===n.First){if(e===this._head)return;let t=e.next,n=e.previous;e===this._tail?(n.next=void 0,this._tail=n):(t.previous=n,n.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===n.Last){if(e===this._tail)return;let t=e.next,n=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=n,n.next=t),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((t,n)=>{e.push([n,t])}),e}fromJSON(e){this.clear();for(let[t,n]of e)this.set(t,n)}};e.LinkedMap=r,e.LRUCache=class extends r{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,t=n.AsNew){return super.get(e,t)}peek(e){return super.get(e,n.None)}set(e,t){return super.set(e,t,n.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}})),l=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Disposable=void 0;var t;(function(e){e.create=function(e){return{dispose:e}}})(t||(e.Disposable=t={}))})),u=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t;function n(){if(t===void 0)throw Error(`No runtime abstraction layer installed`);return t}(function(e){e.install=function(e){if(e===void 0)throw Error(`No runtime abstraction layer provided`);t=e}})(n||={}),e.default=n})),d=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Emitter=e.Event=void 0;let t=u();var n;(function(e){let t={dispose(){}};e.None=function(){return t}})(n||(e.Event=n={}));var r=class{add(e,t=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let n=!1;for(let r=0,i=this._callbacks.length;r<i;r++)if(this._callbacks[r]===e){if(this._contexts[r]===t){this._callbacks.splice(r,1),this._contexts.splice(r,1);return}n=!0}if(n)throw Error(`When adding a listener with a context, you should remove it with the same context`)}invoke(...e){if(!this._callbacks)return[];let n=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let a=0,o=r.length;a<o;a++)try{n.push(r[a].apply(i[a],e))}catch(e){(0,t.default)().console.error(e)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},i=class e{constructor(e){this._options=e}get event(){return this._event||=(t,n,i)=>{this._callbacks||=new r,this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(t,n);let a={dispose:()=>{this._callbacks&&(this._callbacks.remove(t,n),a.dispose=e._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(i)&&i.push(a),a},this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&=(this._callbacks.dispose(),void 0)}};e.Emitter=i,i._noop=function(){}})),f=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CancellationTokenSource=e.CancellationToken=void 0;let t=u(),n=o(),r=d();var i;(function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:r.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:r.Event.None}),e.is=function(t){let r=t;return r&&(r===e.None||r===e.Cancelled||n.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}})(i||(e.CancellationToken=i={}));let a=Object.freeze(function(e,n){let r=(0,t.default)().timer.setTimeout(e.bind(n),0);return{dispose(){r.dispose()}}});var s=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?a:(this._emitter||=new r.Emitter,this._emitter.event)}dispose(){this._emitter&&=(this._emitter.dispose(),void 0)}};e.CancellationTokenSource=class{get token(){return this._token||=new s,this._token}cancel(){this._token?this._token.cancel():this._token=i.Cancelled}dispose(){this._token?this._token instanceof s&&this._token.dispose():this._token=i.None}}})),p=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=void 0;let t=f();var n;(function(e){e.Continue=0,e.Cancelled=1})(n||={}),e.SharedArraySenderStrategy=class{constructor(){this.buffers=/* @__PURE__ */ new Map}enableCancellation(e){if(e.id===null)return;let t=new SharedArrayBuffer(4),r=new Int32Array(t,0,1);r[0]=n.Continue,this.buffers.set(e.id,t),e.$cancellationData=t}async sendCancellation(e,t){let r=this.buffers.get(t);if(r===void 0)return;let i=new Int32Array(r,0,1);Atomics.store(i,0,n.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};var r=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===n.Cancelled}get onCancellationRequested(){throw Error(`Cancellation over SharedArrayBuffer doesn't support cancellation events`)}},i=class{constructor(e){this.token=new r(e)}cancel(){}dispose(){}};e.SharedArrayReceiverStrategy=class{constructor(){this.kind=`request`}createCancellationTokenSource(e){let n=e.$cancellationData;return n===void 0?new t.CancellationTokenSource:new i(n)}}})),m=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Semaphore=void 0;let t=u();e.Semaphore=class{constructor(e=1){if(e<=0)throw Error(`Capacity must be greater than 0`);this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((t,n)=>{this._waiting.push({thunk:e,resolve:t,reject:n}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length!==0&&this._active!==this._capacity&&(0,t.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw Error(`To many thunks active`);try{let t=e.thunk();t instanceof Promise?t.then(t=>{this._active--,e.resolve(t),this.runNext()},t=>{this._active--,e.reject(t),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}}})),h=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=void 0;let t=u(),n=o(),r=d(),i=m();var a;(function(e){e.is=function(e){let t=e;return t&&n.func(t.listen)&&n.func(t.dispose)&&n.func(t.onError)&&n.func(t.onClose)&&n.func(t.onPartialMessage)}})(a||(e.MessageReader=a={}));var s=class{constructor(){this.errorEmitter=new r.Emitter,this.closeEmitter=new r.Emitter,this.partialMessageEmitter=new r.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:/* @__PURE__ */ Error(`Reader received error. Reason: ${n.string(e.message)?e.message:`unknown`}`)}};e.AbstractMessageReader=s;var c;(function(e){e.fromOptions=function(e){let n,r,i=/* @__PURE__ */ new Map,a,o=/* @__PURE__ */ new Map;if(e===void 0||typeof e==`string`)n=e??`utf-8`;else{if(n=e.charset??`utf-8`,e.contentDecoder!==void 0&&(r=e.contentDecoder,i.set(r.name,r)),e.contentDecoders!==void 0)for(let t of e.contentDecoders)i.set(t.name,t);if(e.contentTypeDecoder!==void 0&&(a=e.contentTypeDecoder,o.set(a.name,a)),e.contentTypeDecoders!==void 0)for(let t of e.contentTypeDecoders)o.set(t.name,t)}return a===void 0&&(a=(0,t.default)().applicationJson.decoder,o.set(a.name,a)),{charset:n,contentDecoder:r,contentDecoders:i,contentTypeDecoder:a,contentTypeDecoders:o}}})(c||={}),e.ReadableStreamMessageReader=class extends s{constructor(e,n){super(),this.readable=e,this.options=c.fromOptions(n),this.buffer=(0,t.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new i.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let t=this.readable.onData(e=>{this.onData(e)});return this.readable.onError(e=>this.fireError(e)),this.readable.onClose(()=>this.fireClose()),t}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let e=this.buffer.tryReadHeaders(!0);if(!e)return;let t=e.get(`content-length`);if(!t){this.fireError(/* @__PURE__ */ Error(`Header must provide a Content-Length property.\n${JSON.stringify(Object.fromEntries(e))}`));return}let n=parseInt(t);if(isNaN(n)){this.fireError(/* @__PURE__ */ Error(`Content-Length value must be a number. Got ${t}`));return}this.nextMessageLength=n}let e=this.buffer.tryReadBody(this.nextMessageLength);if(e===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let t=this.options.contentDecoder===void 0?e:await this.options.contentDecoder.decode(e),n=await this.options.contentTypeDecoder.decode(t,this.options);this.callback(n)}).catch(e=>{this.fireError(e)})}}catch(e){this.fireError(e)}}clearPartialMessageTimer(){this.partialMessageTimer&&=(this.partialMessageTimer.dispose(),void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),this._partialMessageTimeout<=0||(this.partialMessageTimer=(0,t.default)().timer.setTimeout((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}})),g=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=void 0;let t=u(),n=o(),r=m(),i=d();var a;(function(e){e.is=function(e){let t=e;return t&&n.func(t.dispose)&&n.func(t.onClose)&&n.func(t.onError)&&n.func(t.write)}})(a||(e.MessageWriter=a={}));var s=class{constructor(){this.errorEmitter=new i.Emitter,this.closeEmitter=new i.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,n){this.errorEmitter.fire([this.asError(e),t,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:/* @__PURE__ */ Error(`Writer received error. Reason: ${n.string(e.message)?e.message:`unknown`}`)}};e.AbstractMessageWriter=s;var c;(function(e){e.fromOptions=function(e){return e===void 0||typeof e==`string`?{charset:e??`utf-8`,contentTypeEncoder:(0,t.default)().applicationJson.encoder}:{charset:e.charset??`utf-8`,contentEncoder:e.contentEncoder,contentTypeEncoder:e.contentTypeEncoder??(0,t.default)().applicationJson.encoder}}})(c||={}),e.WriteableStreamMessageWriter=class extends s{constructor(e,t){super(),this.writable=e,this.options=c.fromOptions(t),this.errorCount=0,this.writeSemaphore=new r.Semaphore(1),this.writable.onError(e=>this.fireError(e)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(e=>this.options.contentEncoder===void 0?e:this.options.contentEncoder.encode(e)).then(t=>{let n=[];return n.push(`Content-Length: `,t.byteLength.toString(),`\r
|
|
2
|
+
`),n.push(`\r
|
|
3
|
+
`),this.doWrite(e,n,t)},e=>{throw this.fireError(e),e}))}async doWrite(e,t,n){try{return await this.writable.write(t.join(``),`ascii`),this.writable.write(n)}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){this.writable.end()}}})),_=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractMessageBuffer=void 0,e.AbstractMessageBuffer=class{constructor(e=`utf-8`){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let t=typeof e==`string`?this.fromString(e,this._encoding):e;this._chunks.push(t),this._totalLength+=t.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let t=0,n=0,r=0,i=0;e:for(;n<this._chunks.length;){let e=this._chunks[n];for(r=0;r<e.length;){switch(e[r]){case 13:switch(t){case 0:t=1;break;case 2:t=3;break;default:t=0}break;case 10:switch(t){case 1:t=2;break;case 3:t=4,r++;break e;default:t=0}break;default:t=0}r++}i+=e.byteLength,n++}if(t!==4)return;let a=this._read(i+r),o=/* @__PURE__ */ new Map,s=this.toString(a,`ascii`).split(`\r
|
|
4
|
+
`);if(s.length<2)return o;for(let t=0;t<s.length-2;t++){let n=s[t],r=n.indexOf(`:`);if(r===-1)throw Error(`Message header must separate key and value using ':'\n${n}`);let i=n.substr(0,r),a=n.substr(r+1).trim();o.set(e?i.toLowerCase():i,a)}return o}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw Error(`Cannot read so many bytes!`);if(this._chunks[0].byteLength===e){let t=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(t)}if(this._chunks[0].byteLength>e){let t=this._chunks[0],n=this.asNative(t,e);return this._chunks[0]=t.slice(e),this._totalLength-=e,n}let t=this.allocNative(e),n=0;for(;e>0;){let r=this._chunks[0];if(r.byteLength>e){let i=r.slice(0,e);t.set(i,n),n+=e,this._chunks[0]=r.slice(e),this._totalLength-=e,e-=e}else t.set(r,n),n+=r.byteLength,this._chunks.shift(),this._totalLength-=r.byteLength,e-=r.byteLength}return t}}})),v=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.ConnectionOptions=e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.RequestCancellationReceiverStrategy=e.IdCancellationReceiverStrategy=e.ConnectionStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=e.NullLogger=e.ProgressType=e.ProgressToken=void 0;let t=u(),n=o(),r=s(),i=c(),a=d(),l=f();var p;(function(e){e.type=new r.NotificationType(`$/cancelRequest`)})(p||={});var m;(function(e){e.is=function(e){return typeof e==`string`||typeof e==`number`}})(m||(e.ProgressToken=m={}));var h;(function(e){e.type=new r.NotificationType(`$/progress`)})(h||={}),e.ProgressType=class{constructor(){}};var g;(function(e){e.is=function(e){return n.func(e)}})(g||={}),e.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var _;(function(e){e[e.Off=0]=`Off`,e[e.Messages=1]=`Messages`,e[e.Compact=2]=`Compact`,e[e.Verbose=3]=`Verbose`})(_||(e.Trace=_={}));var v;(function(e){e.Off=`off`,e.Messages=`messages`,e.Compact=`compact`,e.Verbose=`verbose`})(v||(e.TraceValues=v={})),(function(e){e.fromString=function(t){if(!n.string(t))return e.Off;switch(t=t.toLowerCase(),t){case`off`:return e.Off;case`messages`:return e.Messages;case`compact`:return e.Compact;case`verbose`:return e.Verbose;default:return e.Off}},e.toString=function(t){switch(t){case e.Off:return`off`;case e.Messages:return`messages`;case e.Compact:return`compact`;case e.Verbose:return`verbose`;default:return`off`}}})(_||(e.Trace=_={}));var y;(function(e){e.Text=`text`,e.JSON=`json`})(y||(e.TraceFormat=y={})),(function(e){e.fromString=function(t){return n.string(t)?(t=t.toLowerCase(),t===`json`?e.JSON:e.Text):e.Text}})(y||(e.TraceFormat=y={}));var b;(function(e){e.type=new r.NotificationType(`$/setTrace`)})(b||(e.SetTraceNotification=b={}));var x;(function(e){e.type=new r.NotificationType(`$/logTrace`)})(x||(e.LogTraceNotification=x={}));var S;(function(e){e[e.Closed=1]=`Closed`,e[e.Disposed=2]=`Disposed`,e[e.AlreadyListening=3]=`AlreadyListening`})(S||(e.ConnectionErrors=S={}));var C=class e extends Error{constructor(t,n){super(n),this.code=t,Object.setPrototypeOf(this,e.prototype)}};e.ConnectionError=C;var w;(function(e){e.is=function(e){let t=e;return t&&n.func(t.cancelUndispatched)}})(w||(e.ConnectionStrategy=w={}));var T;(function(e){e.is=function(e){let t=e;return t&&(t.kind===void 0||t.kind===`id`)&&n.func(t.createCancellationTokenSource)&&(t.dispose===void 0||n.func(t.dispose))}})(T||(e.IdCancellationReceiverStrategy=T={}));var E;(function(e){e.is=function(e){let t=e;return t&&t.kind===`request`&&n.func(t.createCancellationTokenSource)&&(t.dispose===void 0||n.func(t.dispose))}})(E||(e.RequestCancellationReceiverStrategy=E={}));var D;(function(e){e.Message=Object.freeze({createCancellationTokenSource(e){return new l.CancellationTokenSource}}),e.is=function(e){return T.is(e)||E.is(e)}})(D||(e.CancellationReceiverStrategy=D={}));var O;(function(e){e.Message=Object.freeze({sendCancellation(e,t){return e.sendNotification(p.type,{id:t})},cleanup(e){}}),e.is=function(e){let t=e;return t&&n.func(t.sendCancellation)&&n.func(t.cleanup)}})(O||(e.CancellationSenderStrategy=O={}));var k;(function(e){e.Message=Object.freeze({receiver:D.Message,sender:O.Message}),e.is=function(e){let t=e;return t&&D.is(t.receiver)&&O.is(t.sender)}})(k||(e.CancellationStrategy=k={}));var ee;(function(e){e.is=function(e){let t=e;return t&&n.func(t.handleMessage)}})(ee||(e.MessageStrategy=ee={}));var A;(function(e){e.is=function(e){let t=e;return t&&(k.is(t.cancellationStrategy)||w.is(t.connectionStrategy)||ee.is(t.messageStrategy))}})(A||(e.ConnectionOptions=A={}));var j;(function(e){e[e.New=1]=`New`,e[e.Listening=2]=`Listening`,e[e.Closed=3]=`Closed`,e[e.Disposed=4]=`Disposed`})(j||={}),e.createMessageConnection=function(o,s,c,u){let d=c===void 0?e.NullLogger:c,f=0,v=0,w=0,E,D=/* @__PURE__ */ new Map,O,A=/* @__PURE__ */ new Map,te=/* @__PURE__ */ new Map,M,N=new i.LinkedMap,P=/* @__PURE__ */ new Map,F=/* @__PURE__ */ new Set,I=/* @__PURE__ */ new Map,L=_.Off,R=y.Text,z,B=j.New,V=new a.Emitter,ne=new a.Emitter,H=new a.Emitter,re=new a.Emitter,ie=new a.Emitter,ae=u&&u.cancellationStrategy?u.cancellationStrategy:k.Message;function oe(e){if(e===null)throw Error(`Can't send requests with id null since the response can't be correlated.`);return`req-`+e.toString()}function U(e){return e===null?`res-unknown-`+(++w).toString():`res-`+e.toString()}function se(){return`not-`+(++v).toString()}function ce(e,t){r.Message.isRequest(t)?e.set(oe(t.id),t):r.Message.isResponse(t)?e.set(U(t.id),t):e.set(se(),t)}function W(e){}function le(){return B===j.Listening}function ue(){return B===j.Closed}function G(){return B===j.Disposed}function de(){(B===j.New||B===j.Listening)&&(B=j.Closed,ne.fire(void 0))}function fe(e){V.fire([e,void 0,void 0])}function pe(e){V.fire(e)}o.onClose(de),o.onError(fe),s.onClose(de),s.onError(pe);function me(){M||N.size===0||(M=(0,t.default)().timer.setImmediate(()=>{M=void 0,ge()}))}function he(e){r.Message.isRequest(e)?ve(e):r.Message.isNotification(e)?be(e):r.Message.isResponse(e)?ye(e):xe(e)}function ge(){if(N.size===0)return;let e=N.shift();try{let t=u?.messageStrategy;ee.is(t)?t.handleMessage(e,he):he(e)}finally{me()}}let _e=e=>{try{if(r.Message.isNotification(e)&&e.method===p.type.method){let t=e.params.id,n=oe(t),i=N.get(n);if(r.Message.isRequest(i)){let r=u?.connectionStrategy,a=r&&r.cancelUndispatched?r.cancelUndispatched(i,W):void 0;if(a&&(a.error!==void 0||a.result!==void 0)){N.delete(n),I.delete(t),a.id=i.id,Te(a,e.method,Date.now()),s.write(a).catch(()=>d.error(`Sending response for canceled message failed.`));return}}let a=I.get(t);if(a!==void 0){a.cancel(),De(e);return}F.add(t)}ce(N,e)}finally{me()}};function ve(e){if(G())return;function t(t,n,i){let a={jsonrpc:`2.0`,id:e.id};t instanceof r.ResponseError?a.error=t.toJson():a.result=t===void 0?null:t,Te(a,n,i),s.write(a).catch(()=>d.error(`Sending response failed.`))}function i(t,n,r){let i={jsonrpc:`2.0`,id:e.id,error:t.toJson()};Te(i,n,r),s.write(i).catch(()=>d.error(`Sending response failed.`))}function a(t,n,r){t===void 0&&(t=null);let i={jsonrpc:`2.0`,id:e.id,result:t};Te(i,n,r),s.write(i).catch(()=>d.error(`Sending response failed.`))}Ee(e);let o=D.get(e.method),c,l;o&&(c=o.type,l=o.handler);let u=Date.now();if(l||E){let o=e.id??String(Date.now()),s=T.is(ae.receiver)?ae.receiver.createCancellationTokenSource(o):ae.receiver.createCancellationTokenSource(e);e.id!==null&&F.has(e.id)&&s.cancel(),e.id!==null&&I.set(o,s);try{let d;if(l){if(e.params===void 0){if(c!==void 0&&c.numberOfParams!==0){i(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${e.method} defines ${c.numberOfParams} params but received none.`),e.method,u);return}d=l(s.token)}else if(Array.isArray(e.params)){if(c!==void 0&&c.parameterStructures===r.ParameterStructures.byName){i(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${e.method} defines parameters by name but received parameters by position`),e.method,u);return}d=l(...e.params,s.token)}else{if(c!==void 0&&c.parameterStructures===r.ParameterStructures.byPosition){i(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${e.method} defines parameters by position but received parameters by name`),e.method,u);return}d=l(e.params,s.token)}}else E&&(d=E(e.method,e.params,s.token));let f=d;d?f.then?f.then(n=>{I.delete(o),t(n,e.method,u)},t=>{I.delete(o),t instanceof r.ResponseError?i(t,e.method,u):t&&n.string(t.message)?i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${t.message}`),e.method,u):i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,u)}):(I.delete(o),t(d,e.method,u)):(I.delete(o),a(d,e.method,u))}catch(a){I.delete(o),a instanceof r.ResponseError?t(a,e.method,u):a&&n.string(a.message)?i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${a.message}`),e.method,u):i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,u)}}else i(new r.ResponseError(r.ErrorCodes.MethodNotFound,`Unhandled method ${e.method}`),e.method,u)}function ye(e){if(!G()){if(e.id===null)e.error?d.error(`Received response message without id: Error is: \n${JSON.stringify(e.error,void 0,4)}`):d.error(`Received response message without id. No further error information provided.`);else{let t=e.id,n=P.get(t);if(Oe(e,n),n!==void 0){P.delete(t);try{if(e.error){let t=e.error;n.reject(new r.ResponseError(t.code,t.message,t.data))}else if(e.result!==void 0)n.resolve(e.result);else throw Error(`Should never happen.`)}catch(e){e.message?d.error(`Response handler '${n.method}' failed with message: ${e.message}`):d.error(`Response handler '${n.method}' failed unexpectedly.`)}}}}}function be(e){if(G())return;let t,n;if(e.method===p.type.method){let t=e.params.id;F.delete(t),De(e)}else{{let r=A.get(e.method);r&&(n=r.handler,t=r.type)}if(n||O)try{if(De(e),n){if(e.params===void 0)t!==void 0&&t.numberOfParams!==0&&t.parameterStructures!==r.ParameterStructures.byName&&d.error(`Notification ${e.method} defines ${t.numberOfParams} params but received none.`),n();else if(Array.isArray(e.params)){let i=e.params;e.method===h.type.method&&i.length===2&&m.is(i[0])?n({token:i[0],value:i[1]}):(t!==void 0&&(t.parameterStructures===r.ParameterStructures.byName&&d.error(`Notification ${e.method} defines parameters by name but received parameters by position`),t.numberOfParams!==e.params.length&&d.error(`Notification ${e.method} defines ${t.numberOfParams} params but received ${i.length} arguments`)),n(...i))}else t!==void 0&&t.parameterStructures===r.ParameterStructures.byPosition&&d.error(`Notification ${e.method} defines parameters by position but received parameters by name`),n(e.params)}else O&&O(e.method,e.params)}catch(t){t.message?d.error(`Notification handler '${e.method}' failed with message: ${t.message}`):d.error(`Notification handler '${e.method}' failed unexpectedly.`)}else H.fire(e)}}function xe(e){if(!e){d.error(`Received empty message.`);return}d.error(`Received message which is neither a response nor a notification message:\n${JSON.stringify(e,null,4)}`);let t=e;if(n.string(t.id)||n.number(t.id)){let e=t.id,n=P.get(e);n&&n.reject(/* @__PURE__ */ Error(`The received response has neither a result nor an error property.`))}}function Se(e){if(e!=null)switch(L){case _.Verbose:return JSON.stringify(e,null,4);case _.Compact:return JSON.stringify(e);default:return}}function Ce(e){if(L!==_.Off&&z){if(R===y.Text){let t;(L===_.Verbose||L===_.Compact)&&e.params&&(t=`Params: ${Se(e.params)}\n\n`),z.log(`Sending request '${e.method} - (${e.id})'.`,t)}else ke(`send-request`,e)}}function we(e){if(L!==_.Off&&z){if(R===y.Text){let t;(L===_.Verbose||L===_.Compact)&&(t=e.params?`Params: ${Se(e.params)}\n\n`:`No parameters provided.
|
|
5
|
+
|
|
6
|
+
`),z.log(`Sending notification '${e.method}'.`,t)}else ke(`send-notification`,e)}}function Te(e,t,n){if(L!==_.Off&&z){if(R===y.Text){let r;(L===_.Verbose||L===_.Compact)&&(e.error&&e.error.data?r=`Error data: ${Se(e.error.data)}\n\n`:e.result?r=`Result: ${Se(e.result)}\n\n`:e.error===void 0&&(r=`No result returned.
|
|
7
|
+
|
|
8
|
+
`)),z.log(`Sending response '${t} - (${e.id})'. Processing request took ${Date.now()-n}ms`,r)}else ke(`send-response`,e)}}function Ee(e){if(L!==_.Off&&z){if(R===y.Text){let t;(L===_.Verbose||L===_.Compact)&&e.params&&(t=`Params: ${Se(e.params)}\n\n`),z.log(`Received request '${e.method} - (${e.id})'.`,t)}else ke(`receive-request`,e)}}function De(e){if(L!==_.Off&&z&&e.method!==x.type.method){if(R===y.Text){let t;(L===_.Verbose||L===_.Compact)&&(t=e.params?`Params: ${Se(e.params)}\n\n`:`No parameters provided.
|
|
9
|
+
|
|
10
|
+
`),z.log(`Received notification '${e.method}'.`,t)}else ke(`receive-notification`,e)}}function Oe(e,t){if(L!==_.Off&&z){if(R===y.Text){let n;if((L===_.Verbose||L===_.Compact)&&(e.error&&e.error.data?n=`Error data: ${Se(e.error.data)}\n\n`:e.result?n=`Result: ${Se(e.result)}\n\n`:e.error===void 0&&(n=`No result returned.
|
|
11
|
+
|
|
12
|
+
`)),t){let r=e.error?` Request failed: ${e.error.message} (${e.error.code}).`:``;z.log(`Received response '${t.method} - (${e.id})' in ${Date.now()-t.timerStart}ms.${r}`,n)}else z.log(`Received response ${e.id} without active response promise.`,n)}else ke(`receive-response`,e)}}function ke(e,t){if(!z||L===_.Off)return;let n={isLSPMessage:!0,type:e,message:t,timestamp:Date.now()};z.log(n)}function Ae(){if(ue())throw new C(S.Closed,`Connection is closed.`);if(G())throw new C(S.Disposed,`Connection is disposed.`)}function je(){if(le())throw new C(S.AlreadyListening,`Connection is already listening`)}function Me(){if(!le())throw Error(`Call listen() first.`)}function Ne(e){return e===void 0?null:e}function Pe(e){if(e!==null)return e}function K(e){return e!=null&&!Array.isArray(e)&&typeof e==`object`}function Fe(e,t){switch(e){case r.ParameterStructures.auto:return K(t)?Pe(t):[Ne(t)];case r.ParameterStructures.byName:if(!K(t))throw Error(`Received parameters by name but param is not an object literal.`);return Pe(t);case r.ParameterStructures.byPosition:return[Ne(t)];default:throw Error(`Unknown parameter structure ${e.toString()}`)}}function Ie(e,t){let n,r=e.numberOfParams;switch(r){case 0:n=void 0;break;case 1:n=Fe(e.parameterStructures,t[0]);break;default:n=[];for(let e=0;e<t.length&&e<r;e++)n.push(Ne(t[e]));if(t.length<r)for(let e=t.length;e<r;e++)n.push(null)}return n}let q={sendNotification:(e,...t)=>{Ae();let i,a;if(n.string(e)){i=e;let n=t[0],o=0,s=r.ParameterStructures.auto;r.ParameterStructures.is(n)&&(o=1,s=n);let c=t.length,l=c-o;switch(l){case 0:a=void 0;break;case 1:a=Fe(s,t[o]);break;default:if(s===r.ParameterStructures.byName)throw Error(`Received ${l} parameters for 'by Name' notification parameter structure.`);a=t.slice(o,c).map(e=>Ne(e))}}else{let n=t;i=e.method,a=Ie(e,n)}let o={jsonrpc:`2.0`,method:i,params:a};return we(o),s.write(o).catch(e=>{throw d.error(`Sending notification failed.`),e})},onNotification:(e,t)=>{Ae();let r;return n.func(e)?O=e:t&&(n.string(e)?(r=e,A.set(e,{type:void 0,handler:t})):(r=e.method,A.set(e.method,{type:e,handler:t}))),{dispose:()=>{r===void 0?O=void 0:A.delete(r)}}},onProgress:(e,t,n)=>{if(te.has(t))throw Error(`Progress handler for token ${t} already registered`);return te.set(t,n),{dispose:()=>{te.delete(t)}}},sendProgress:(e,t,n)=>q.sendNotification(h.type,{token:t,value:n}),onUnhandledProgress:re.event,sendRequest:(e,...t)=>{Ae(),Me();let i,a,o;if(n.string(e)){i=e;let n=t[0],s=t[t.length-1],c=0,u=r.ParameterStructures.auto;r.ParameterStructures.is(n)&&(c=1,u=n);let d=t.length;l.CancellationToken.is(s)&&(--d,o=s);let f=d-c;switch(f){case 0:a=void 0;break;case 1:a=Fe(u,t[c]);break;default:if(u===r.ParameterStructures.byName)throw Error(`Received ${f} parameters for 'by Name' request parameter structure.`);a=t.slice(c,d).map(e=>Ne(e))}}else{let n=t;i=e.method,a=Ie(e,n);let r=e.numberOfParams;o=l.CancellationToken.is(n[r])?n[r]:void 0}let c=f++,u;o&&(u=o.onCancellationRequested(()=>{let e=ae.sender.sendCancellation(q,c);return e===void 0?(d.log(`Received no promise from cancellation strategy when cancelling id ${c}`),Promise.resolve()):e.catch(()=>{d.log(`Sending cancellation messages for id ${c} failed`)})}));let p={jsonrpc:`2.0`,id:c,method:i,params:a};return Ce(p),typeof ae.sender.enableCancellation==`function`&&ae.sender.enableCancellation(p),new Promise(async(e,t)=>{let n={method:i,timerStart:Date.now(),resolve:t=>{e(t),ae.sender.cleanup(c),u?.dispose()},reject:e=>{t(e),ae.sender.cleanup(c),u?.dispose()}};try{await s.write(p),P.set(c,n)}catch(e){throw d.error(`Sending request failed.`),n.reject(new r.ResponseError(r.ErrorCodes.MessageWriteError,e.message?e.message:`Unknown reason`)),e}})},onRequest:(e,t)=>{Ae();let r=null;return g.is(e)?(r=void 0,E=e):n.string(e)?(r=null,t!==void 0&&(r=e,D.set(e,{handler:t,type:void 0}))):t!==void 0&&(r=e.method,D.set(e.method,{type:e,handler:t})),{dispose:()=>{r!==null&&(r===void 0?E=void 0:D.delete(r))}}},hasPendingResponse:()=>P.size>0,trace:async(e,t,r)=>{let i=!1,a=y.Text;r!==void 0&&(n.boolean(r)?i=r:(i=r.sendNotification||!1,a=r.traceFormat||y.Text)),L=e,R=a,z=L===_.Off?void 0:t,i&&!ue()&&!G()&&await q.sendNotification(b.type,{value:_.toString(e)})},onError:V.event,onClose:ne.event,onUnhandledNotification:H.event,onDispose:ie.event,end:()=>{s.end()},dispose:()=>{if(G())return;B=j.Disposed,ie.fire(void 0);let e=new r.ResponseError(r.ErrorCodes.PendingResponseRejected,`Pending response rejected since connection got disposed`);for(let t of P.values())t.reject(e);P=/* @__PURE__ */ new Map,I=/* @__PURE__ */ new Map,F=/* @__PURE__ */ new Set,N=new i.LinkedMap,n.func(s.dispose)&&s.dispose(),n.func(o.dispose)&&o.dispose()},listen:()=>{Ae(),je(),B=j.Listening,o.listen(_e)},inspect:()=>{(0,t.default)().console.log(`inspect`)}};return q.onNotification(x.type,e=>{if(L===_.Off||!z)return;let t=L===_.Verbose||L===_.Compact;z.log(e.message,t?e.verbose:void 0)}),q.onNotification(h.type,e=>{let t=te.get(e.token);t?t(e.value):re.fire(e)}),q}})),y=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProgressType=e.ProgressToken=e.createMessageConnection=e.NullLogger=e.ConnectionOptions=e.ConnectionStrategy=e.AbstractMessageBuffer=e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=e.CancellationToken=e.CancellationTokenSource=e.Emitter=e.Event=e.Disposable=e.LRUCache=e.Touch=e.LinkedMap=e.ParameterStructures=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.ErrorCodes=e.ResponseError=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType0=e.RequestType=e.Message=e.RAL=void 0,e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=void 0;let t=s();Object.defineProperty(e,"Message",{enumerable:!0,get:function(){return t.Message}}),Object.defineProperty(e,"RequestType",{enumerable:!0,get:function(){return t.RequestType}}),Object.defineProperty(e,"RequestType0",{enumerable:!0,get:function(){return t.RequestType0}}),Object.defineProperty(e,"RequestType1",{enumerable:!0,get:function(){return t.RequestType1}}),Object.defineProperty(e,"RequestType2",{enumerable:!0,get:function(){return t.RequestType2}}),Object.defineProperty(e,"RequestType3",{enumerable:!0,get:function(){return t.RequestType3}}),Object.defineProperty(e,"RequestType4",{enumerable:!0,get:function(){return t.RequestType4}}),Object.defineProperty(e,"RequestType5",{enumerable:!0,get:function(){return t.RequestType5}}),Object.defineProperty(e,"RequestType6",{enumerable:!0,get:function(){return t.RequestType6}}),Object.defineProperty(e,"RequestType7",{enumerable:!0,get:function(){return t.RequestType7}}),Object.defineProperty(e,"RequestType8",{enumerable:!0,get:function(){return t.RequestType8}}),Object.defineProperty(e,"RequestType9",{enumerable:!0,get:function(){return t.RequestType9}}),Object.defineProperty(e,"ResponseError",{enumerable:!0,get:function(){return t.ResponseError}}),Object.defineProperty(e,"ErrorCodes",{enumerable:!0,get:function(){return t.ErrorCodes}}),Object.defineProperty(e,"NotificationType",{enumerable:!0,get:function(){return t.NotificationType}}),Object.defineProperty(e,"NotificationType0",{enumerable:!0,get:function(){return t.NotificationType0}}),Object.defineProperty(e,"NotificationType1",{enumerable:!0,get:function(){return t.NotificationType1}}),Object.defineProperty(e,"NotificationType2",{enumerable:!0,get:function(){return t.NotificationType2}}),Object.defineProperty(e,"NotificationType3",{enumerable:!0,get:function(){return t.NotificationType3}}),Object.defineProperty(e,"NotificationType4",{enumerable:!0,get:function(){return t.NotificationType4}}),Object.defineProperty(e,"NotificationType5",{enumerable:!0,get:function(){return t.NotificationType5}}),Object.defineProperty(e,"NotificationType6",{enumerable:!0,get:function(){return t.NotificationType6}}),Object.defineProperty(e,"NotificationType7",{enumerable:!0,get:function(){return t.NotificationType7}}),Object.defineProperty(e,"NotificationType8",{enumerable:!0,get:function(){return t.NotificationType8}}),Object.defineProperty(e,"NotificationType9",{enumerable:!0,get:function(){return t.NotificationType9}}),Object.defineProperty(e,"ParameterStructures",{enumerable:!0,get:function(){return t.ParameterStructures}});let n=c();Object.defineProperty(e,"LinkedMap",{enumerable:!0,get:function(){return n.LinkedMap}}),Object.defineProperty(e,"LRUCache",{enumerable:!0,get:function(){return n.LRUCache}}),Object.defineProperty(e,"Touch",{enumerable:!0,get:function(){return n.Touch}});let r=l();Object.defineProperty(e,"Disposable",{enumerable:!0,get:function(){return r.Disposable}});let i=d();Object.defineProperty(e,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(e,"Emitter",{enumerable:!0,get:function(){return i.Emitter}});let a=f();Object.defineProperty(e,"CancellationTokenSource",{enumerable:!0,get:function(){return a.CancellationTokenSource}}),Object.defineProperty(e,"CancellationToken",{enumerable:!0,get:function(){return a.CancellationToken}});let o=p();Object.defineProperty(e,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return o.SharedArraySenderStrategy}}),Object.defineProperty(e,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return o.SharedArrayReceiverStrategy}});let m=h();Object.defineProperty(e,"MessageReader",{enumerable:!0,get:function(){return m.MessageReader}}),Object.defineProperty(e,"AbstractMessageReader",{enumerable:!0,get:function(){return m.AbstractMessageReader}}),Object.defineProperty(e,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return m.ReadableStreamMessageReader}});let y=g();Object.defineProperty(e,"MessageWriter",{enumerable:!0,get:function(){return y.MessageWriter}}),Object.defineProperty(e,"AbstractMessageWriter",{enumerable:!0,get:function(){return y.AbstractMessageWriter}}),Object.defineProperty(e,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return y.WriteableStreamMessageWriter}});let b=_();Object.defineProperty(e,"AbstractMessageBuffer",{enumerable:!0,get:function(){return b.AbstractMessageBuffer}});let x=v();Object.defineProperty(e,"ConnectionStrategy",{enumerable:!0,get:function(){return x.ConnectionStrategy}}),Object.defineProperty(e,"ConnectionOptions",{enumerable:!0,get:function(){return x.ConnectionOptions}}),Object.defineProperty(e,"NullLogger",{enumerable:!0,get:function(){return x.NullLogger}}),Object.defineProperty(e,"createMessageConnection",{enumerable:!0,get:function(){return x.createMessageConnection}}),Object.defineProperty(e,"ProgressToken",{enumerable:!0,get:function(){return x.ProgressToken}}),Object.defineProperty(e,"ProgressType",{enumerable:!0,get:function(){return x.ProgressType}}),Object.defineProperty(e,"Trace",{enumerable:!0,get:function(){return x.Trace}}),Object.defineProperty(e,"TraceValues",{enumerable:!0,get:function(){return x.TraceValues}}),Object.defineProperty(e,"TraceFormat",{enumerable:!0,get:function(){return x.TraceFormat}}),Object.defineProperty(e,"SetTraceNotification",{enumerable:!0,get:function(){return x.SetTraceNotification}}),Object.defineProperty(e,"LogTraceNotification",{enumerable:!0,get:function(){return x.LogTraceNotification}}),Object.defineProperty(e,"ConnectionErrors",{enumerable:!0,get:function(){return x.ConnectionErrors}}),Object.defineProperty(e,"ConnectionError",{enumerable:!0,get:function(){return x.ConnectionError}}),Object.defineProperty(e,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return x.CancellationReceiverStrategy}}),Object.defineProperty(e,"CancellationSenderStrategy",{enumerable:!0,get:function(){return x.CancellationSenderStrategy}}),Object.defineProperty(e,"CancellationStrategy",{enumerable:!0,get:function(){return x.CancellationStrategy}}),Object.defineProperty(e,"MessageStrategy",{enumerable:!0,get:function(){return x.MessageStrategy}}),e.RAL=u().default})),b=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0});let t=i(`util`),n=y();var r=class e extends n.AbstractMessageBuffer{constructor(e=`utf-8`){super(e)}emptyBuffer(){return e.emptyBuffer}fromString(e,t){return Buffer.from(e,t)}toString(e,n){return e instanceof Buffer?e.toString(n):new t.TextDecoder(n).decode(e)}asNative(e,t){return t===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,t):Buffer.from(e,0,t)}allocNative(e){return Buffer.allocUnsafe(e)}};r.emptyBuffer=Buffer.allocUnsafe(0);var a=class{constructor(e){this.stream=e}onClose(e){return this.stream.on(`close`,e),n.Disposable.create(()=>this.stream.off(`close`,e))}onError(e){return this.stream.on(`error`,e),n.Disposable.create(()=>this.stream.off(`error`,e))}onEnd(e){return this.stream.on(`end`,e),n.Disposable.create(()=>this.stream.off(`end`,e))}onData(e){return this.stream.on(`data`,e),n.Disposable.create(()=>this.stream.off(`data`,e))}},o=class{constructor(e){this.stream=e}onClose(e){return this.stream.on(`close`,e),n.Disposable.create(()=>this.stream.off(`close`,e))}onError(e){return this.stream.on(`error`,e),n.Disposable.create(()=>this.stream.off(`error`,e))}onEnd(e){return this.stream.on(`end`,e),n.Disposable.create(()=>this.stream.off(`end`,e))}write(e,t){return new Promise((n,r)=>{let i=e=>{e==null?n():r(e)};typeof e==`string`?this.stream.write(e,t,i):this.stream.write(e,i)})}end(){this.stream.end()}};let s=Object.freeze({messageBuffer:Object.freeze({create:e=>new r(e)}),applicationJson:Object.freeze({encoder:Object.freeze({name:`application/json`,encode:(e,t)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(e,void 0,0),t.charset))}catch(e){return Promise.reject(e)}}}),decoder:Object.freeze({name:`application/json`,decode:(e,n)=>{try{return e instanceof Buffer?Promise.resolve(JSON.parse(e.toString(n.charset))):Promise.resolve(JSON.parse(new t.TextDecoder(n.charset).decode(e)))}catch(e){return Promise.reject(e)}}})}),stream:Object.freeze({asReadableStream:e=>new a(e),asWritableStream:e=>new o(e)}),console,timer:Object.freeze({setTimeout(e,t,...n){let r=setTimeout(e,t,...n);return{dispose:()=>clearTimeout(r)}},setImmediate(e,...t){let n=setImmediate(e,...t);return{dispose:()=>clearImmediate(n)}},setInterval(e,t,...n){let r=setInterval(e,t,...n);return{dispose:()=>clearInterval(r)}}})});function c(){return s}(function(e){e.install=function(){n.RAL.install(s)}})(c||={}),e.default=c})),x=/* @__PURE__ */ r(((e,t,n)=>{var r=n&&n.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),a=n&&n.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.createServerSocketTransport=e.createClientSocketTransport=e.createServerPipeTransport=e.createClientPipeTransport=e.generateRandomPipeName=e.StreamMessageWriter=e.StreamMessageReader=e.SocketMessageWriter=e.SocketMessageReader=e.PortMessageWriter=e.PortMessageReader=e.IPCMessageWriter=e.IPCMessageReader=void 0;let o=b();o.default.install();let s=i(`path`),c=i(`os`),l=i(`crypto`),u=i(`net`),d=y();a(y(),e),e.IPCMessageReader=class extends d.AbstractMessageReader{constructor(e){super(),this.process=e;let t=this.process;t.on(`error`,e=>this.fireError(e)),t.on(`close`,()=>this.fireClose())}listen(e){return this.process.on(`message`,e),d.Disposable.create(()=>this.process.off(`message`,e))}},e.IPCMessageWriter=class extends d.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let t=this.process;t.on(`error`,e=>this.fireError(e)),t.on(`close`,()=>this.fireClose)}write(e){try{return typeof this.process.send==`function`&&this.process.send(e,void 0,void 0,t=>{t?(this.errorCount++,this.handleError(t,e)):this.errorCount=0}),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}},e.PortMessageReader=class extends d.AbstractMessageReader{constructor(e){super(),this.onData=new d.Emitter,e.on(`close`,()=>this.fireClose),e.on(`error`,e=>this.fireError(e)),e.on(`message`,e=>{this.onData.fire(e)})}listen(e){return this.onData.event(e)}},e.PortMessageWriter=class extends d.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on(`close`,()=>this.fireClose()),e.on(`error`,e=>this.fireError(e))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}};var f=class extends d.ReadableStreamMessageReader{constructor(e,t=`utf-8`){super((0,o.default)().stream.asReadableStream(e),t)}};e.SocketMessageReader=f;var p=class extends d.WriteableStreamMessageWriter{constructor(e,t){super((0,o.default)().stream.asWritableStream(e),t),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}};e.SocketMessageWriter=p;var m=class extends d.ReadableStreamMessageReader{constructor(e,t){super((0,o.default)().stream.asReadableStream(e),t)}};e.StreamMessageReader=m;var h=class extends d.WriteableStreamMessageWriter{constructor(e,t){super((0,o.default)().stream.asWritableStream(e),t)}};e.StreamMessageWriter=h;let g=process.env.XDG_RUNTIME_DIR,_=/* @__PURE__ */ new Map([[`linux`,107],[`darwin`,103]]);e.generateRandomPipeName=function(){let e=(0,l.randomBytes)(21).toString(`hex`);if(process.platform===`win32`)return`\\\\.\\pipe\\vscode-jsonrpc-${e}-sock`;let t;t=g?s.join(g,`vscode-ipc-${e}.sock`):s.join(c.tmpdir(),`vscode-${e}.sock`);let n=_.get(process.platform);return n!==void 0&&t.length>n&&(0,o.default)().console.warn(`WARNING: IPC handle "${t}" is longer than ${n} characters.`),t},e.createClientPipeTransport=function(e,t=`utf-8`){let n,r=new Promise((e,t)=>{n=e});return new Promise((i,a)=>{let o=(0,u.createServer)(e=>{o.close(),n([new f(e,t),new p(e,t)])});o.on(`error`,a),o.listen(e,()=>{o.removeListener(`error`,a),i({onConnected:()=>r})})})},e.createServerPipeTransport=function(e,t=`utf-8`){let n=(0,u.createConnection)(e);return[new f(n,t),new p(n,t)]},e.createClientSocketTransport=function(e,t=`utf-8`){let n,r=new Promise((e,t)=>{n=e});return new Promise((i,a)=>{let o=(0,u.createServer)(e=>{o.close(),n([new f(e,t),new p(e,t)])});o.on(`error`,a),o.listen(e,`127.0.0.1`,()=>{o.removeListener(`error`,a),i({onConnected:()=>r})})})},e.createServerSocketTransport=function(e,t=`utf-8`){let n=(0,u.createConnection)(e,`127.0.0.1`);return[new f(n,t),new p(n,t)]};function v(e){let t=e;return t.read!==void 0&&t.addListener!==void 0}function x(e){let t=e;return t.write!==void 0&&t.addListener!==void 0}e.createMessageConnection=function(e,t,n,r){n||=d.NullLogger;let i=v(e)?new m(e):e,a=x(t)?new h(t):t;return d.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,d.createMessageConnection)(i,a,n,r)}})),S=/* @__PURE__ */ r(((e,t)=>{t.exports=x()})),C=/* @__PURE__ */ r(((e,t)=>{var n;(function(r){if(typeof t==`object`&&typeof t.exports==`object`){var a=r(i,e);a!==void 0&&(t.exports=a)}else typeof n==`function`&&n.amd&&n([`require`,`exports`],r)})(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.TextDocument=t.EOL=t.WorkspaceFolder=t.InlineCompletionContext=t.SelectedCompletionInfo=t.InlineCompletionTriggerKind=t.InlineCompletionList=t.InlineCompletionItem=t.StringValue=t.InlayHint=t.InlayHintLabelPart=t.InlayHintKind=t.InlineValueContext=t.InlineValueEvaluatableExpression=t.InlineValueVariableLookup=t.InlineValueText=t.SemanticTokens=t.SemanticTokenModifiers=t.SemanticTokenTypes=t.SelectionRange=t.DocumentLink=t.FormattingOptions=t.CodeLens=t.CodeAction=t.CodeActionContext=t.CodeActionTriggerKind=t.CodeActionKind=t.DocumentSymbol=t.WorkspaceSymbol=t.SymbolInformation=t.SymbolTag=t.SymbolKind=t.DocumentHighlight=t.DocumentHighlightKind=t.SignatureInformation=t.ParameterInformation=t.Hover=t.MarkedString=t.CompletionList=t.CompletionItem=t.CompletionItemLabelDetails=t.InsertTextMode=t.InsertReplaceEdit=t.CompletionItemTag=t.InsertTextFormat=t.CompletionItemKind=t.MarkupContent=t.MarkupKind=t.TextDocumentItem=t.OptionalVersionedTextDocumentIdentifier=t.VersionedTextDocumentIdentifier=t.TextDocumentIdentifier=t.WorkspaceChange=t.WorkspaceEdit=t.DeleteFile=t.RenameFile=t.CreateFile=t.TextDocumentEdit=t.AnnotatedTextEdit=t.ChangeAnnotationIdentifier=t.ChangeAnnotation=t.TextEdit=t.Command=t.Diagnostic=t.CodeDescription=t.DiagnosticTag=t.DiagnosticSeverity=t.DiagnosticRelatedInformation=t.FoldingRange=t.FoldingRangeKind=t.ColorPresentation=t.ColorInformation=t.Color=t.LocationLink=t.Location=t.Range=t.Position=t.uinteger=t.integer=t.URI=t.DocumentUri=void 0;var n;(function(e){e.is=function(e){return typeof e==`string`}})(n||(t.DocumentUri=n={}));var r;(function(e){e.is=function(e){return typeof e==`string`}})(r||(t.URI=r={}));var i;(function(e){e.MIN_VALUE=-0x80000000,e.MAX_VALUE=0x7fffffff,e.is=function(t){return typeof t==`number`&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}})(i||(t.integer=i={}));var a;(function(e){e.MIN_VALUE=0,e.MAX_VALUE=0x7fffffff,e.is=function(t){return typeof t==`number`&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}})(a||(t.uinteger=a={}));var o;(function(e){e.create=function(e,t){return e===Number.MAX_VALUE&&(e=a.MAX_VALUE),t===Number.MAX_VALUE&&(t=a.MAX_VALUE),{line:e,character:t}},e.is=function(e){var t=e;return q.objectLiteral(t)&&q.uinteger(t.line)&&q.uinteger(t.character)}})(o||(t.Position=o={}));var s;(function(e){e.create=function(e,t,n,r){if(q.uinteger(e)&&q.uinteger(t)&&q.uinteger(n)&&q.uinteger(r))return{start:o.create(e,t),end:o.create(n,r)};if(o.is(e)&&o.is(t))return{start:e,end:t};throw Error(`Range#create called with invalid arguments[${e}, ${t}, ${n}, ${r}]`)},e.is=function(e){var t=e;return q.objectLiteral(t)&&o.is(t.start)&&o.is(t.end)}})(s||(t.Range=s={}));var c;(function(e){e.create=function(e,t){return{uri:e,range:t}},e.is=function(e){var t=e;return q.objectLiteral(t)&&s.is(t.range)&&(q.string(t.uri)||q.undefined(t.uri))}})(c||(t.Location=c={}));var l;(function(e){e.create=function(e,t,n,r){return{targetUri:e,targetRange:t,targetSelectionRange:n,originSelectionRange:r}},e.is=function(e){var t=e;return q.objectLiteral(t)&&s.is(t.targetRange)&&q.string(t.targetUri)&&s.is(t.targetSelectionRange)&&(s.is(t.originSelectionRange)||q.undefined(t.originSelectionRange))}})(l||(t.LocationLink=l={}));var u;(function(e){e.create=function(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}},e.is=function(e){var t=e;return q.objectLiteral(t)&&q.numberRange(t.red,0,1)&&q.numberRange(t.green,0,1)&&q.numberRange(t.blue,0,1)&&q.numberRange(t.alpha,0,1)}})(u||(t.Color=u={}));var d;(function(e){e.create=function(e,t){return{range:e,color:t}},e.is=function(e){var t=e;return q.objectLiteral(t)&&s.is(t.range)&&u.is(t.color)}})(d||(t.ColorInformation=d={}));var f;(function(e){e.create=function(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}},e.is=function(e){var t=e;return q.objectLiteral(t)&&q.string(t.label)&&(q.undefined(t.textEdit)||x.is(t))&&(q.undefined(t.additionalTextEdits)||q.typedArray(t.additionalTextEdits,x.is))}})(f||(t.ColorPresentation=f={}));var p;(function(e){e.Comment=`comment`,e.Imports=`imports`,e.Region=`region`})(p||(t.FoldingRangeKind=p={}));var m;(function(e){e.create=function(e,t,n,r,i,a){var o={startLine:e,endLine:t};return q.defined(n)&&(o.startCharacter=n),q.defined(r)&&(o.endCharacter=r),q.defined(i)&&(o.kind=i),q.defined(a)&&(o.collapsedText=a),o},e.is=function(e){var t=e;return q.objectLiteral(t)&&q.uinteger(t.startLine)&&q.uinteger(t.startLine)&&(q.undefined(t.startCharacter)||q.uinteger(t.startCharacter))&&(q.undefined(t.endCharacter)||q.uinteger(t.endCharacter))&&(q.undefined(t.kind)||q.string(t.kind))}})(m||(t.FoldingRange=m={}));var h;(function(e){e.create=function(e,t){return{location:e,message:t}},e.is=function(e){var t=e;return q.defined(t)&&c.is(t.location)&&q.string(t.message)}})(h||(t.DiagnosticRelatedInformation=h={}));var g;(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(g||(t.DiagnosticSeverity=g={}));var _;(function(e){e.Unnecessary=1,e.Deprecated=2})(_||(t.DiagnosticTag=_={}));var v;(function(e){e.is=function(e){var t=e;return q.objectLiteral(t)&&q.string(t.href)}})(v||(t.CodeDescription=v={}));var y;(function(e){e.create=function(e,t,n,r,i,a){var o={range:e,message:t};return q.defined(n)&&(o.severity=n),q.defined(r)&&(o.code=r),q.defined(i)&&(o.source=i),q.defined(a)&&(o.relatedInformation=a),o},e.is=function(e){var t=e;return q.defined(t)&&s.is(t.range)&&q.string(t.message)&&(q.number(t.severity)||q.undefined(t.severity))&&(q.integer(t.code)||q.string(t.code)||q.undefined(t.code))&&(q.undefined(t.codeDescription)||q.string(t.codeDescription?.href))&&(q.string(t.source)||q.undefined(t.source))&&(q.undefined(t.relatedInformation)||q.typedArray(t.relatedInformation,h.is))}})(y||(t.Diagnostic=y={}));var b;(function(e){e.create=function(e,t){var n=[...arguments].slice(2),r={title:e,command:t};return q.defined(n)&&n.length>0&&(r.arguments=n),r},e.is=function(e){var t=e;return q.defined(t)&&q.string(t.title)&&q.string(t.command)}})(b||(t.Command=b={}));var x;(function(e){e.replace=function(e,t){return{range:e,newText:t}},e.insert=function(e,t){return{range:{start:e,end:e},newText:t}},e.del=function(e){return{range:e,newText:``}},e.is=function(e){var t=e;return q.objectLiteral(t)&&q.string(t.newText)&&s.is(t.range)}})(x||(t.TextEdit=x={}));var S;(function(e){e.create=function(e,t,n){var r={label:e};return t!==void 0&&(r.needsConfirmation=t),n!==void 0&&(r.description=n),r},e.is=function(e){var t=e;return q.objectLiteral(t)&&q.string(t.label)&&(q.boolean(t.needsConfirmation)||t.needsConfirmation===void 0)&&(q.string(t.description)||t.description===void 0)}})(S||(t.ChangeAnnotation=S={}));var C;(function(e){e.is=function(e){var t=e;return q.string(t)}})(C||(t.ChangeAnnotationIdentifier=C={}));var w;(function(e){e.replace=function(e,t,n){return{range:e,newText:t,annotationId:n}},e.insert=function(e,t,n){return{range:{start:e,end:e},newText:t,annotationId:n}},e.del=function(e,t){return{range:e,newText:``,annotationId:t}},e.is=function(e){var t=e;return x.is(t)&&(S.is(t.annotationId)||C.is(t.annotationId))}})(w||(t.AnnotatedTextEdit=w={}));var T;(function(e){e.create=function(e,t){return{textDocument:e,edits:t}},e.is=function(e){var t=e;return q.defined(t)&&M.is(t.textDocument)&&Array.isArray(t.edits)}})(T||(t.TextDocumentEdit=T={}));var E;(function(e){e.create=function(e,t,n){var r={kind:`create`,uri:e};return t!==void 0&&(t.overwrite!==void 0||t.ignoreIfExists!==void 0)&&(r.options=t),n!==void 0&&(r.annotationId=n),r},e.is=function(e){var t=e;return t&&t.kind===`create`&&q.string(t.uri)&&(t.options===void 0||(t.options.overwrite===void 0||q.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||q.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||C.is(t.annotationId))}})(E||(t.CreateFile=E={}));var D;(function(e){e.create=function(e,t,n,r){var i={kind:`rename`,oldUri:e,newUri:t};return n!==void 0&&(n.overwrite!==void 0||n.ignoreIfExists!==void 0)&&(i.options=n),r!==void 0&&(i.annotationId=r),i},e.is=function(e){var t=e;return t&&t.kind===`rename`&&q.string(t.oldUri)&&q.string(t.newUri)&&(t.options===void 0||(t.options.overwrite===void 0||q.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||q.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||C.is(t.annotationId))}})(D||(t.RenameFile=D={}));var O;(function(e){e.create=function(e,t,n){var r={kind:`delete`,uri:e};return t!==void 0&&(t.recursive!==void 0||t.ignoreIfNotExists!==void 0)&&(r.options=t),n!==void 0&&(r.annotationId=n),r},e.is=function(e){var t=e;return t&&t.kind===`delete`&&q.string(t.uri)&&(t.options===void 0||(t.options.recursive===void 0||q.boolean(t.options.recursive))&&(t.options.ignoreIfNotExists===void 0||q.boolean(t.options.ignoreIfNotExists)))&&(t.annotationId===void 0||C.is(t.annotationId))}})(O||(t.DeleteFile=O={}));var k;(function(e){e.is=function(e){var t=e;return t&&(t.changes!==void 0||t.documentChanges!==void 0)&&(t.documentChanges===void 0||t.documentChanges.every(function(e){return q.string(e.kind)?E.is(e)||D.is(e)||O.is(e):T.is(e)}))}})(k||(t.WorkspaceEdit=k={}));var ee=function(){function e(e,t){this.edits=e,this.changeAnnotations=t}return e.prototype.insert=function(e,t,n){var r,i;if(n===void 0?r=x.insert(e,t):C.is(n)?(i=n,r=w.insert(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=w.insert(e,t,i)),this.edits.push(r),i!==void 0)return i},e.prototype.replace=function(e,t,n){var r,i;if(n===void 0?r=x.replace(e,t):C.is(n)?(i=n,r=w.replace(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=w.replace(e,t,i)),this.edits.push(r),i!==void 0)return i},e.prototype.delete=function(e,t){var n,r;if(t===void 0?n=x.del(e):C.is(t)?(r=t,n=w.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),r=this.changeAnnotations.manage(t),n=w.del(e,r)),this.edits.push(n),r!==void 0)return r},e.prototype.add=function(e){this.edits.push(e)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e.prototype.assertChangeAnnotations=function(e){if(e===void 0)throw Error(`Text edit change is not configured to manage change annotations.`)},e}(),A=function(){function e(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}return e.prototype.all=function(){return this._annotations},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),e.prototype.manage=function(e,t){var n;if(C.is(e)?n=e:(n=this.nextId(),t=e),this._annotations[n]!==void 0)throw Error(`Id ${n} is already in use.`);if(t===void 0)throw Error(`No annotation provided for id ${n}`);return this._annotations[n]=t,this._size++,n},e.prototype.nextId=function(){return this._counter++,this._counter.toString()},e}();t.WorkspaceChange=function(){function e(e){var t=this;this._textEditChanges=Object.create(null),e===void 0?this._workspaceEdit={}:(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new A(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(function(e){if(T.is(e)){var n=new ee(e.edits,t._changeAnnotations);t._textEditChanges[e.textDocument.uri]=n}})):e.changes&&Object.keys(e.changes).forEach(function(n){var r=new ee(e.changes[n]);t._textEditChanges[n]=r}))}return Object.defineProperty(e.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),e.prototype.getTextEditChange=function(e){if(M.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw Error(`Workspace edit is not configured for document changes.`);var t={uri:e.uri,version:e.version},n=this._textEditChanges[t.uri];if(!n){var r=[],i={textDocument:t,edits:r};this._workspaceEdit.documentChanges.push(i),n=new ee(r,this._changeAnnotations),this._textEditChanges[t.uri]=n}return n}if(this.initChanges(),this._workspaceEdit.changes===void 0)throw Error(`Workspace edit is not configured for normal text edit changes.`);var n=this._textEditChanges[e];if(!n){var r=[];this._workspaceEdit.changes[e]=r,n=new ee(r),this._textEditChanges[e]=n}return n},e.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new A,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},e.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},e.prototype.createFile=function(e,t,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw Error(`Workspace edit is not configured for document changes.`);var r;S.is(t)||C.is(t)?r=t:n=t;var i,a;if(r===void 0?i=E.create(e,n):(a=C.is(r)?r:this._changeAnnotations.manage(r),i=E.create(e,n,a)),this._workspaceEdit.documentChanges.push(i),a!==void 0)return a},e.prototype.renameFile=function(e,t,n,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw Error(`Workspace edit is not configured for document changes.`);var i;S.is(n)||C.is(n)?i=n:r=n;var a,o;if(i===void 0?a=D.create(e,t,r):(o=C.is(i)?i:this._changeAnnotations.manage(i),a=D.create(e,t,r,o)),this._workspaceEdit.documentChanges.push(a),o!==void 0)return o},e.prototype.deleteFile=function(e,t,n){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw Error(`Workspace edit is not configured for document changes.`);var r;S.is(t)||C.is(t)?r=t:n=t;var i,a;if(r===void 0?i=O.create(e,n):(a=C.is(r)?r:this._changeAnnotations.manage(r),i=O.create(e,n,a)),this._workspaceEdit.documentChanges.push(i),a!==void 0)return a},e}();var j;(function(e){e.create=function(e){return{uri:e}},e.is=function(e){var t=e;return q.defined(t)&&q.string(t.uri)}})(j||(t.TextDocumentIdentifier=j={}));var te;(function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return q.defined(t)&&q.string(t.uri)&&q.integer(t.version)}})(te||(t.VersionedTextDocumentIdentifier=te={}));var M;(function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return q.defined(t)&&q.string(t.uri)&&(t.version===null||q.integer(t.version))}})(M||(t.OptionalVersionedTextDocumentIdentifier=M={}));var N;(function(e){e.create=function(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}},e.is=function(e){var t=e;return q.defined(t)&&q.string(t.uri)&&q.string(t.languageId)&&q.integer(t.version)&&q.string(t.text)}})(N||(t.TextDocumentItem=N={}));var P;(function(e){e.PlainText=`plaintext`,e.Markdown=`markdown`,e.is=function(t){var n=t;return n===e.PlainText||n===e.Markdown}})(P||(t.MarkupKind=P={}));var F;(function(e){e.is=function(e){var t=e;return q.objectLiteral(e)&&P.is(t.kind)&&q.string(t.value)}})(F||(t.MarkupContent=F={}));var I;(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(I||(t.CompletionItemKind=I={}));var L;(function(e){e.PlainText=1,e.Snippet=2})(L||(t.InsertTextFormat=L={}));var R;(function(e){e.Deprecated=1})(R||(t.CompletionItemTag=R={}));var z;(function(e){e.create=function(e,t,n){return{newText:e,insert:t,replace:n}},e.is=function(e){var t=e;return t&&q.string(t.newText)&&s.is(t.insert)&&s.is(t.replace)}})(z||(t.InsertReplaceEdit=z={}));var B;(function(e){e.asIs=1,e.adjustIndentation=2})(B||(t.InsertTextMode=B={}));var V;(function(e){e.is=function(e){var t=e;return t&&(q.string(t.detail)||t.detail===void 0)&&(q.string(t.description)||t.description===void 0)}})(V||(t.CompletionItemLabelDetails=V={}));var ne;(function(e){e.create=function(e){return{label:e}}})(ne||(t.CompletionItem=ne={}));var H;(function(e){e.create=function(e,t){return{items:e||[],isIncomplete:!!t}}})(H||(t.CompletionList=H={}));var re;(function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,`\\$&`)},e.is=function(e){var t=e;return q.string(t)||q.objectLiteral(t)&&q.string(t.language)&&q.string(t.value)}})(re||(t.MarkedString=re={}));var ie;(function(e){e.is=function(e){var t=e;return!!t&&q.objectLiteral(t)&&(F.is(t.contents)||re.is(t.contents)||q.typedArray(t.contents,re.is))&&(e.range===void 0||s.is(e.range))}})(ie||(t.Hover=ie={}));var ae;(function(e){e.create=function(e,t){return t?{label:e,documentation:t}:{label:e}}})(ae||(t.ParameterInformation=ae={}));var oe;(function(e){e.create=function(e,t){var n=[...arguments].slice(2),r={label:e};return q.defined(t)&&(r.documentation=t),r.parameters=q.defined(n)?n:[],r}})(oe||(t.SignatureInformation=oe={}));var U;(function(e){e.Text=1,e.Read=2,e.Write=3})(U||(t.DocumentHighlightKind=U={}));var se;(function(e){e.create=function(e,t){var n={range:e};return q.number(t)&&(n.kind=t),n}})(se||(t.DocumentHighlight=se={}));var ce;(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(ce||(t.SymbolKind=ce={}));var W;(function(e){e.Deprecated=1})(W||(t.SymbolTag=W={}));var le;(function(e){e.create=function(e,t,n,r,i){var a={name:e,kind:t,location:{uri:r,range:n}};return i&&(a.containerName=i),a}})(le||(t.SymbolInformation=le={}));var ue;(function(e){e.create=function(e,t,n,r){return r===void 0?{name:e,kind:t,location:{uri:n}}:{name:e,kind:t,location:{uri:n,range:r}}}})(ue||(t.WorkspaceSymbol=ue={}));var G;(function(e){e.create=function(e,t,n,r,i,a){var o={name:e,detail:t,kind:n,range:r,selectionRange:i};return a!==void 0&&(o.children=a),o},e.is=function(e){var t=e;return t&&q.string(t.name)&&q.number(t.kind)&&s.is(t.range)&&s.is(t.selectionRange)&&(t.detail===void 0||q.string(t.detail))&&(t.deprecated===void 0||q.boolean(t.deprecated))&&(t.children===void 0||Array.isArray(t.children))&&(t.tags===void 0||Array.isArray(t.tags))}})(G||(t.DocumentSymbol=G={}));var de;(function(e){e.Empty=``,e.QuickFix=`quickfix`,e.Refactor=`refactor`,e.RefactorExtract=`refactor.extract`,e.RefactorInline=`refactor.inline`,e.RefactorRewrite=`refactor.rewrite`,e.Source=`source`,e.SourceOrganizeImports=`source.organizeImports`,e.SourceFixAll=`source.fixAll`})(de||(t.CodeActionKind=de={}));var fe;(function(e){e.Invoked=1,e.Automatic=2})(fe||(t.CodeActionTriggerKind=fe={}));var pe;(function(e){e.create=function(e,t,n){var r={diagnostics:e};return t!=null&&(r.only=t),n!=null&&(r.triggerKind=n),r},e.is=function(e){var t=e;return q.defined(t)&&q.typedArray(t.diagnostics,y.is)&&(t.only===void 0||q.typedArray(t.only,q.string))&&(t.triggerKind===void 0||t.triggerKind===fe.Invoked||t.triggerKind===fe.Automatic)}})(pe||(t.CodeActionContext=pe={}));var me;(function(e){e.create=function(e,t,n){var r={title:e},i=!0;return typeof t==`string`?(i=!1,r.kind=t):b.is(t)?r.command=t:r.edit=t,i&&n!==void 0&&(r.kind=n),r},e.is=function(e){var t=e;return t&&q.string(t.title)&&(t.diagnostics===void 0||q.typedArray(t.diagnostics,y.is))&&(t.kind===void 0||q.string(t.kind))&&(t.edit!==void 0||t.command!==void 0)&&(t.command===void 0||b.is(t.command))&&(t.isPreferred===void 0||q.boolean(t.isPreferred))&&(t.edit===void 0||k.is(t.edit))}})(me||(t.CodeAction=me={}));var he;(function(e){e.create=function(e,t){var n={range:e};return q.defined(t)&&(n.data=t),n},e.is=function(e){var t=e;return q.defined(t)&&s.is(t.range)&&(q.undefined(t.command)||b.is(t.command))}})(he||(t.CodeLens=he={}));var ge;(function(e){e.create=function(e,t){return{tabSize:e,insertSpaces:t}},e.is=function(e){var t=e;return q.defined(t)&&q.uinteger(t.tabSize)&&q.boolean(t.insertSpaces)}})(ge||(t.FormattingOptions=ge={}));var _e;(function(e){e.create=function(e,t,n){return{range:e,target:t,data:n}},e.is=function(e){var t=e;return q.defined(t)&&s.is(t.range)&&(q.undefined(t.target)||q.string(t.target))}})(_e||(t.DocumentLink=_e={}));var ve;(function(e){e.create=function(e,t){return{range:e,parent:t}},e.is=function(t){var n=t;return q.objectLiteral(n)&&s.is(n.range)&&(n.parent===void 0||e.is(n.parent))}})(ve||(t.SelectionRange=ve={}));var ye;(function(e){e.namespace=`namespace`,e.type=`type`,e.class=`class`,e.enum=`enum`,e.interface=`interface`,e.struct=`struct`,e.typeParameter=`typeParameter`,e.parameter=`parameter`,e.variable=`variable`,e.property=`property`,e.enumMember=`enumMember`,e.event=`event`,e.function=`function`,e.method=`method`,e.macro=`macro`,e.keyword=`keyword`,e.modifier=`modifier`,e.comment=`comment`,e.string=`string`,e.number=`number`,e.regexp=`regexp`,e.operator=`operator`,e.decorator=`decorator`})(ye||(t.SemanticTokenTypes=ye={}));var be;(function(e){e.declaration=`declaration`,e.definition=`definition`,e.readonly=`readonly`,e.static=`static`,e.deprecated=`deprecated`,e.abstract=`abstract`,e.async=`async`,e.modification=`modification`,e.documentation=`documentation`,e.defaultLibrary=`defaultLibrary`})(be||(t.SemanticTokenModifiers=be={}));var xe;(function(e){e.is=function(e){var t=e;return q.objectLiteral(t)&&(t.resultId===void 0||typeof t.resultId==`string`)&&Array.isArray(t.data)&&(t.data.length===0||typeof t.data[0]==`number`)}})(xe||(t.SemanticTokens=xe={}));var Se;(function(e){e.create=function(e,t){return{range:e,text:t}},e.is=function(e){var t=e;return t!=null&&s.is(t.range)&&q.string(t.text)}})(Se||(t.InlineValueText=Se={}));var Ce;(function(e){e.create=function(e,t,n){return{range:e,variableName:t,caseSensitiveLookup:n}},e.is=function(e){var t=e;return t!=null&&s.is(t.range)&&q.boolean(t.caseSensitiveLookup)&&(q.string(t.variableName)||t.variableName===void 0)}})(Ce||(t.InlineValueVariableLookup=Ce={}));var we;(function(e){e.create=function(e,t){return{range:e,expression:t}},e.is=function(e){var t=e;return t!=null&&s.is(t.range)&&(q.string(t.expression)||t.expression===void 0)}})(we||(t.InlineValueEvaluatableExpression=we={}));var Te;(function(e){e.create=function(e,t){return{frameId:e,stoppedLocation:t}},e.is=function(e){var t=e;return q.defined(t)&&s.is(e.stoppedLocation)}})(Te||(t.InlineValueContext=Te={}));var Ee;(function(e){e.Type=1,e.Parameter=2,e.is=function(e){return e===1||e===2}})(Ee||(t.InlayHintKind=Ee={}));var De;(function(e){e.create=function(e){return{value:e}},e.is=function(e){var t=e;return q.objectLiteral(t)&&(t.tooltip===void 0||q.string(t.tooltip)||F.is(t.tooltip))&&(t.location===void 0||c.is(t.location))&&(t.command===void 0||b.is(t.command))}})(De||(t.InlayHintLabelPart=De={}));var Oe;(function(e){e.create=function(e,t,n){var r={position:e,label:t};return n!==void 0&&(r.kind=n),r},e.is=function(e){var t=e;return q.objectLiteral(t)&&o.is(t.position)&&(q.string(t.label)||q.typedArray(t.label,De.is))&&(t.kind===void 0||Ee.is(t.kind))&&t.textEdits===void 0||q.typedArray(t.textEdits,x.is)&&(t.tooltip===void 0||q.string(t.tooltip)||F.is(t.tooltip))&&(t.paddingLeft===void 0||q.boolean(t.paddingLeft))&&(t.paddingRight===void 0||q.boolean(t.paddingRight))}})(Oe||(t.InlayHint=Oe={}));var ke;(function(e){e.createSnippet=function(e){return{kind:`snippet`,value:e}}})(ke||(t.StringValue=ke={}));var Ae;(function(e){e.create=function(e,t,n,r){return{insertText:e,filterText:t,range:n,command:r}}})(Ae||(t.InlineCompletionItem=Ae={}));var je;(function(e){e.create=function(e){return{items:e}}})(je||(t.InlineCompletionList=je={}));var Me;(function(e){e.Invoked=0,e.Automatic=1})(Me||(t.InlineCompletionTriggerKind=Me={}));var Ne;(function(e){e.create=function(e,t){return{range:e,text:t}}})(Ne||(t.SelectedCompletionInfo=Ne={}));var Pe;(function(e){e.create=function(e,t){return{triggerKind:e,selectedCompletionInfo:t}}})(Pe||(t.InlineCompletionContext=Pe={}));var K;(function(e){e.is=function(e){var t=e;return q.objectLiteral(t)&&r.is(t.uri)&&q.string(t.name)}})(K||(t.WorkspaceFolder=K={})),t.EOL=[`
|
|
13
|
+
`,`\r
|
|
14
|
+
`,`\r`];var Fe;(function(e){e.create=function(e,t,n,r){return new Ie(e,t,n,r)},e.is=function(e){var t=e;return!!(q.defined(t)&&q.string(t.uri)&&(q.undefined(t.languageId)||q.string(t.languageId))&&q.uinteger(t.lineCount)&&q.func(t.getText)&&q.func(t.positionAt)&&q.func(t.offsetAt))},e.applyEdits=function(e,n){for(var r=e.getText(),i=t(n,function(e,t){var n=e.range.start.line-t.range.start.line;return n===0?e.range.start.character-t.range.start.character:n}),a=r.length,o=i.length-1;o>=0;o--){var s=i[o],c=e.offsetAt(s.range.start),l=e.offsetAt(s.range.end);if(l<=a)r=r.substring(0,c)+s.newText+r.substring(l,r.length);else throw Error(`Overlapping edit`);a=c}return r};function t(e,n){if(e.length<=1)return e;var r=e.length/2|0,i=e.slice(0,r),a=e.slice(r);t(i,n),t(a,n);for(var o=0,s=0,c=0;o<i.length&&s<a.length;)n(i[o],a[s])<=0?e[c++]=i[o++]:e[c++]=a[s++];for(;o<i.length;)e[c++]=i[o++];for(;s<a.length;)e[c++]=a[s++];return e}})(Fe||(t.TextDocument=Fe={}));var Ie=function(){function e(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),e.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content},e.prototype.update=function(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0},e.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var e=[],t=this._content,n=!0,r=0;r<t.length;r++){n&&=(e.push(r),!1);var i=t.charAt(r);n=i===`\r`||i===`
|
|
15
|
+
`,i===`\r`&&r+1<t.length&&t.charAt(r+1)===`
|
|
16
|
+
`&&r++}n&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),n=0,r=t.length;if(r===0)return o.create(0,e);for(;n<r;){var i=Math.floor((n+r)/2);t[i]>e?r=i:n=i+1}var a=n-1;return o.create(a,e-t[a])},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,r),n)},Object.defineProperty(e.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),e}(),q;(function(e){var t=Object.prototype.toString;e.defined=function(e){return e!==void 0},e.undefined=function(e){return e===void 0},e.boolean=function(e){return e===!0||e===!1},e.string=function(e){return t.call(e)===`[object String]`},e.number=function(e){return t.call(e)===`[object Number]`},e.numberRange=function(e,n,r){return t.call(e)===`[object Number]`&&n<=e&&e<=r},e.integer=function(e){return t.call(e)===`[object Number]`&&-0x80000000<=e&&e<=0x7fffffff},e.uinteger=function(e){return t.call(e)===`[object Number]`&&0<=e&&e<=0x7fffffff},e.func=function(e){return t.call(e)===`[object Function]`},e.objectLiteral=function(e){return typeof e==`object`&&!!e},e.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)}})(q||={})})})),w=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ProtocolNotificationType=e.ProtocolNotificationType0=e.ProtocolRequestType=e.ProtocolRequestType0=e.RegistrationType=e.MessageDirection=void 0;let t=x();var n;(function(e){e.clientToServer=`clientToServer`,e.serverToClient=`serverToClient`,e.both=`both`})(n||(e.MessageDirection=n={})),e.RegistrationType=class{constructor(e){this.method=e}},e.ProtocolRequestType0=class extends t.RequestType0{constructor(e){super(e)}},e.ProtocolRequestType=class extends t.RequestType{constructor(e){super(e,t.ParameterStructures.byName)}},e.ProtocolNotificationType0=class extends t.NotificationType0{constructor(e){super(e)}},e.ProtocolNotificationType=class extends t.NotificationType{constructor(e){super(e,t.ParameterStructures.byName)}}})),T=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.objectLiteral=e.typedArray=e.stringArray=e.array=e.func=e.error=e.number=e.string=e.boolean=void 0,e.boolean=function(e){return e===!0||e===!1};function t(e){return typeof e==`string`||e instanceof String}e.string=t,e.number=function(e){return typeof e==`number`||e instanceof Number},e.error=function(e){return e instanceof Error},e.func=function(e){return typeof e==`function`};function n(e){return Array.isArray(e)}e.array=n,e.stringArray=function(e){return n(e)&&e.every(e=>t(e))},e.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)},e.objectLiteral=function(e){return typeof e==`object`&&!!e}})),E=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ImplementationRequest=void 0;let t=w();var n;(function(e){e.method=`textDocument/implementation`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.ImplementationRequest=n={}))})),D=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeDefinitionRequest=void 0;let t=w();var n;(function(e){e.method=`textDocument/typeDefinition`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.TypeDefinitionRequest=n={}))})),O=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=void 0;let t=w();var n;(function(e){e.method=`workspace/workspaceFolders`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method)})(n||(e.WorkspaceFoldersRequest=n={}));var r;(function(e){e.method=`workspace/didChangeWorkspaceFolders`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(r||(e.DidChangeWorkspaceFoldersNotification=r={}))})),k=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigurationRequest=void 0;let t=w();var n;(function(e){e.method=`workspace/configuration`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(e.method)})(n||(e.ConfigurationRequest=n={}))})),ee=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ColorPresentationRequest=e.DocumentColorRequest=void 0;let t=w();var n;(function(e){e.method=`textDocument/documentColor`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.DocumentColorRequest=n={}));var r;(function(e){e.method=`textDocument/colorPresentation`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(r||(e.ColorPresentationRequest=r={}))})),A=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=void 0;let t=w();var n;(function(e){e.method=`textDocument/foldingRange`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.FoldingRangeRequest=n={}));var r;(function(e){e.method=`workspace/foldingRange/refresh`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method)})(r||(e.FoldingRangeRefreshRequest=r={}))})),j=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DeclarationRequest=void 0;let t=w();var n;(function(e){e.method=`textDocument/declaration`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.DeclarationRequest=n={}))})),te=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionRangeRequest=void 0;let t=w();var n;(function(e){e.method=`textDocument/selectionRange`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.SelectionRangeRequest=n={}))})),M=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=void 0;let t=x(),n=w();var r;(function(e){e.type=new t.ProgressType,e.is=function(t){return t===e.type}})(r||(e.WorkDoneProgress=r={}));var i;(function(e){e.method=`window/workDoneProgress/create`,e.messageDirection=n.MessageDirection.serverToClient,e.type=new n.ProtocolRequestType(e.method)})(i||(e.WorkDoneProgressCreateRequest=i={}));var a;(function(e){e.method=`window/workDoneProgress/cancel`,e.messageDirection=n.MessageDirection.clientToServer,e.type=new n.ProtocolNotificationType(e.method)})(a||(e.WorkDoneProgressCancelNotification=a={}))})),N=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.CallHierarchyPrepareRequest=void 0;let t=w();var n;(function(e){e.method=`textDocument/prepareCallHierarchy`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.CallHierarchyPrepareRequest=n={}));var r;(function(e){e.method=`callHierarchy/incomingCalls`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(r||(e.CallHierarchyIncomingCallsRequest=r={}));var i;(function(e){e.method=`callHierarchy/outgoingCalls`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(i||(e.CallHierarchyOutgoingCallsRequest=i={}))})),P=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.SemanticTokensRegistrationType=e.TokenFormat=void 0;let t=w();var n;(function(e){e.Relative=`relative`})(n||(e.TokenFormat=n={}));var r;(function(e){e.method=`textDocument/semanticTokens`,e.type=new t.RegistrationType(e.method)})(r||(e.SemanticTokensRegistrationType=r={}));var i;(function(e){e.method=`textDocument/semanticTokens/full`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.registrationMethod=r.method})(i||(e.SemanticTokensRequest=i={}));var a;(function(e){e.method=`textDocument/semanticTokens/full/delta`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.registrationMethod=r.method})(a||(e.SemanticTokensDeltaRequest=a={}));var o;(function(e){e.method=`textDocument/semanticTokens/range`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method),e.registrationMethod=r.method})(o||(e.SemanticTokensRangeRequest=o={}));var s;(function(e){e.method=`workspace/semanticTokens/refresh`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method)})(s||(e.SemanticTokensRefreshRequest=s={}))})),F=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ShowDocumentRequest=void 0;let t=w();var n;(function(e){e.method=`window/showDocument`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(e.method)})(n||(e.ShowDocumentRequest=n={}))})),I=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LinkedEditingRangeRequest=void 0;let t=w();var n;(function(e){e.method=`textDocument/linkedEditingRange`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.LinkedEditingRangeRequest=n={}))})),L=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.DidRenameFilesNotification=e.WillRenameFilesRequest=e.DidCreateFilesNotification=e.WillCreateFilesRequest=e.FileOperationPatternKind=void 0;let t=w();var n;(function(e){e.file=`file`,e.folder=`folder`})(n||(e.FileOperationPatternKind=n={}));var r;(function(e){e.method=`workspace/willCreateFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(r||(e.WillCreateFilesRequest=r={}));var i;(function(e){e.method=`workspace/didCreateFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(i||(e.DidCreateFilesNotification=i={}));var a;(function(e){e.method=`workspace/willRenameFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(a||(e.WillRenameFilesRequest=a={}));var o;(function(e){e.method=`workspace/didRenameFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(o||(e.DidRenameFilesNotification=o={}));var s;(function(e){e.method=`workspace/didDeleteFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(s||(e.DidDeleteFilesNotification=s={}));var c;(function(e){e.method=`workspace/willDeleteFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(c||(e.WillDeleteFilesRequest=c={}))})),R=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=void 0;let t=w();var n;(function(e){e.document=`document`,e.project=`project`,e.group=`group`,e.scheme=`scheme`,e.global=`global`})(n||(e.UniquenessLevel=n={}));var r;(function(e){e.$import=`import`,e.$export=`export`,e.local=`local`})(r||(e.MonikerKind=r={}));var i;(function(e){e.method=`textDocument/moniker`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(i||(e.MonikerRequest=i={}))})),z=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHierarchySubtypesRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchyPrepareRequest=void 0;let t=w();var n;(function(e){e.method=`textDocument/prepareTypeHierarchy`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.TypeHierarchyPrepareRequest=n={}));var r;(function(e){e.method=`typeHierarchy/supertypes`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(r||(e.TypeHierarchySupertypesRequest=r={}));var i;(function(e){e.method=`typeHierarchy/subtypes`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(i||(e.TypeHierarchySubtypesRequest=i={}))})),B=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlineValueRefreshRequest=e.InlineValueRequest=void 0;let t=w();var n;(function(e){e.method=`textDocument/inlineValue`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.InlineValueRequest=n={}));var r;(function(e){e.method=`workspace/inlineValue/refresh`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method)})(r||(e.InlineValueRefreshRequest=r={}))})),V=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=void 0;let t=w();var n;(function(e){e.method=`textDocument/inlayHint`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.InlayHintRequest=n={}));var r;(function(e){e.method=`inlayHint/resolve`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(r||(e.InlayHintResolveRequest=r={}));var i;(function(e){e.method=`workspace/inlayHint/refresh`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method)})(i||(e.InlayHintRefreshRequest=i={}))})),ne=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=void 0;let t=x(),n=T(),r=w();var i;(function(e){e.is=function(e){let t=e;return t&&n.boolean(t.retriggerRequest)}})(i||(e.DiagnosticServerCancellationData=i={}));var a;(function(e){e.Full=`full`,e.Unchanged=`unchanged`})(a||(e.DocumentDiagnosticReportKind=a={}));var o;(function(e){e.method=`textDocument/diagnostic`,e.messageDirection=r.MessageDirection.clientToServer,e.type=new r.ProtocolRequestType(e.method),e.partialResult=new t.ProgressType})(o||(e.DocumentDiagnosticRequest=o={}));var s;(function(e){e.method=`workspace/diagnostic`,e.messageDirection=r.MessageDirection.clientToServer,e.type=new r.ProtocolRequestType(e.method),e.partialResult=new t.ProgressType})(s||(e.WorkspaceDiagnosticRequest=s={}));var c;(function(e){e.method=`workspace/diagnostic/refresh`,e.messageDirection=r.MessageDirection.serverToClient,e.type=new r.ProtocolRequestType0(e.method)})(c||(e.DiagnosticRefreshRequest=c={}))})),H=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=void 0;let t=C(),n=T(),r=w();var i;(function(e){e.Markup=1,e.Code=2,e.is=function(e){return e===1||e===2}})(i||(e.NotebookCellKind=i={}));var a;(function(e){e.create=function(e,t){let n={executionOrder:e};return(t===!0||t===!1)&&(n.success=t),n},e.is=function(e){let r=e;return n.objectLiteral(r)&&t.uinteger.is(r.executionOrder)&&(r.success===void 0||n.boolean(r.success))},e.equals=function(e,t){return e===t?!0:e==null||t==null?!1:e.executionOrder===t.executionOrder&&e.success===t.success}})(a||(e.ExecutionSummary=a={}));var o;(function(e){e.create=function(e,t){return{kind:e,document:t}},e.is=function(e){let r=e;return n.objectLiteral(r)&&i.is(r.kind)&&t.DocumentUri.is(r.document)&&(r.metadata===void 0||n.objectLiteral(r.metadata))},e.diff=function(e,t){let n=/* @__PURE__ */ new Set;return e.document!==t.document&&n.add(`document`),e.kind!==t.kind&&n.add(`kind`),e.executionSummary!==t.executionSummary&&n.add(`executionSummary`),e.metadata===void 0&&t.metadata===void 0||r(e.metadata,t.metadata)||n.add(`metadata`),e.executionSummary===void 0&&t.executionSummary===void 0||a.equals(e.executionSummary,t.executionSummary)||n.add(`executionSummary`),n};function r(e,t){if(e===t)return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!=`object`)return!1;let i=Array.isArray(e),a=Array.isArray(t);if(i!==a)return!1;if(i&&a){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!r(e[n],t[n]))return!1}if(n.objectLiteral(e)&&n.objectLiteral(t)){let n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length||(n.sort(),i.sort(),!r(n,i)))return!1;for(let i=0;i<n.length;i++){let a=n[i];if(!r(e[a],t[a]))return!1}}return!0}})(o||(e.NotebookCell=o={}));var s;(function(e){e.create=function(e,t,n,r){return{uri:e,notebookType:t,version:n,cells:r}},e.is=function(e){let r=e;return n.objectLiteral(r)&&n.string(r.uri)&&t.integer.is(r.version)&&n.typedArray(r.cells,o.is)}})(s||(e.NotebookDocument=s={}));var c;(function(e){e.method=`notebookDocument/sync`,e.messageDirection=r.MessageDirection.clientToServer,e.type=new r.RegistrationType(e.method)})(c||(e.NotebookDocumentSyncRegistrationType=c={}));var l;(function(e){e.method=`notebookDocument/didOpen`,e.messageDirection=r.MessageDirection.clientToServer,e.type=new r.ProtocolNotificationType(e.method),e.registrationMethod=c.method})(l||(e.DidOpenNotebookDocumentNotification=l={}));var u;(function(e){e.is=function(e){let r=e;return n.objectLiteral(r)&&t.uinteger.is(r.start)&&t.uinteger.is(r.deleteCount)&&(r.cells===void 0||n.typedArray(r.cells,o.is))},e.create=function(e,t,n){let r={start:e,deleteCount:t};return n!==void 0&&(r.cells=n),r}})(u||(e.NotebookCellArrayChange=u={}));var d;(function(e){e.method=`notebookDocument/didChange`,e.messageDirection=r.MessageDirection.clientToServer,e.type=new r.ProtocolNotificationType(e.method),e.registrationMethod=c.method})(d||(e.DidChangeNotebookDocumentNotification=d={}));var f;(function(e){e.method=`notebookDocument/didSave`,e.messageDirection=r.MessageDirection.clientToServer,e.type=new r.ProtocolNotificationType(e.method),e.registrationMethod=c.method})(f||(e.DidSaveNotebookDocumentNotification=f={}));var p;(function(e){e.method=`notebookDocument/didClose`,e.messageDirection=r.MessageDirection.clientToServer,e.type=new r.ProtocolNotificationType(e.method),e.registrationMethod=c.method})(p||(e.DidCloseNotebookDocumentNotification=p={}))})),re=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlineCompletionRequest=void 0;let t=w();var n;(function(e){e.method=`textDocument/inlineCompletion`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(n||(e.InlineCompletionRequest=n={}))})),ie=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceSymbolRequest=e.CodeActionResolveRequest=e.CodeActionRequest=e.DocumentSymbolRequest=e.DocumentHighlightRequest=e.ReferencesRequest=e.DefinitionRequest=e.SignatureHelpRequest=e.SignatureHelpTriggerKind=e.HoverRequest=e.CompletionResolveRequest=e.CompletionRequest=e.CompletionTriggerKind=e.PublishDiagnosticsNotification=e.WatchKind=e.RelativePattern=e.FileChangeType=e.DidChangeWatchedFilesNotification=e.WillSaveTextDocumentWaitUntilRequest=e.WillSaveTextDocumentNotification=e.TextDocumentSaveReason=e.DidSaveTextDocumentNotification=e.DidCloseTextDocumentNotification=e.DidChangeTextDocumentNotification=e.TextDocumentContentChangeEvent=e.DidOpenTextDocumentNotification=e.TextDocumentSyncKind=e.TelemetryEventNotification=e.LogMessageNotification=e.ShowMessageRequest=e.ShowMessageNotification=e.MessageType=e.DidChangeConfigurationNotification=e.ExitNotification=e.ShutdownRequest=e.InitializedNotification=e.InitializeErrorCodes=e.InitializeRequest=e.WorkDoneProgressOptions=e.TextDocumentRegistrationOptions=e.StaticRegistrationOptions=e.PositionEncodingKind=e.FailureHandlingKind=e.ResourceOperationKind=e.UnregistrationRequest=e.RegistrationRequest=e.DocumentSelector=e.NotebookCellTextDocumentFilter=e.NotebookDocumentFilter=e.TextDocumentFilter=void 0,e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.WillRenameFilesRequest=e.DidRenameFilesNotification=e.WillCreateFilesRequest=e.DidCreateFilesNotification=e.FileOperationPatternKind=e.LinkedEditingRangeRequest=e.ShowDocumentRequest=e.SemanticTokensRegistrationType=e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.TokenFormat=e.CallHierarchyPrepareRequest=e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=e.SelectionRangeRequest=e.DeclarationRequest=e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=e.ColorPresentationRequest=e.DocumentColorRequest=e.ConfigurationRequest=e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=e.TypeDefinitionRequest=e.ImplementationRequest=e.ApplyWorkspaceEditRequest=e.ExecuteCommandRequest=e.PrepareRenameRequest=e.RenameRequest=e.PrepareSupportDefaultBehavior=e.DocumentOnTypeFormattingRequest=e.DocumentRangesFormattingRequest=e.DocumentRangeFormattingRequest=e.DocumentFormattingRequest=e.DocumentLinkResolveRequest=e.DocumentLinkRequest=e.CodeLensRefreshRequest=e.CodeLensResolveRequest=e.CodeLensRequest=e.WorkspaceSymbolResolveRequest=void 0,e.InlineCompletionRequest=e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=e.InlineValueRefreshRequest=e.InlineValueRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchySubtypesRequest=e.TypeHierarchyPrepareRequest=void 0;let t=w(),n=C(),r=T(),i=E();Object.defineProperty(e,"ImplementationRequest",{enumerable:!0,get:function(){return i.ImplementationRequest}});let a=D();Object.defineProperty(e,"TypeDefinitionRequest",{enumerable:!0,get:function(){return a.TypeDefinitionRequest}});let o=O();Object.defineProperty(e,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return o.WorkspaceFoldersRequest}}),Object.defineProperty(e,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return o.DidChangeWorkspaceFoldersNotification}});let s=k();Object.defineProperty(e,"ConfigurationRequest",{enumerable:!0,get:function(){return s.ConfigurationRequest}});let c=ee();Object.defineProperty(e,"DocumentColorRequest",{enumerable:!0,get:function(){return c.DocumentColorRequest}}),Object.defineProperty(e,"ColorPresentationRequest",{enumerable:!0,get:function(){return c.ColorPresentationRequest}});let l=A();Object.defineProperty(e,"FoldingRangeRequest",{enumerable:!0,get:function(){return l.FoldingRangeRequest}}),Object.defineProperty(e,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return l.FoldingRangeRefreshRequest}});let u=j();Object.defineProperty(e,"DeclarationRequest",{enumerable:!0,get:function(){return u.DeclarationRequest}});let d=te();Object.defineProperty(e,"SelectionRangeRequest",{enumerable:!0,get:function(){return d.SelectionRangeRequest}});let f=M();Object.defineProperty(e,"WorkDoneProgress",{enumerable:!0,get:function(){return f.WorkDoneProgress}}),Object.defineProperty(e,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return f.WorkDoneProgressCreateRequest}}),Object.defineProperty(e,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return f.WorkDoneProgressCancelNotification}});let p=N();Object.defineProperty(e,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return p.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(e,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return p.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(e,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return p.CallHierarchyPrepareRequest}});let m=P();Object.defineProperty(e,"TokenFormat",{enumerable:!0,get:function(){return m.TokenFormat}}),Object.defineProperty(e,"SemanticTokensRequest",{enumerable:!0,get:function(){return m.SemanticTokensRequest}}),Object.defineProperty(e,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return m.SemanticTokensDeltaRequest}}),Object.defineProperty(e,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return m.SemanticTokensRangeRequest}}),Object.defineProperty(e,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return m.SemanticTokensRefreshRequest}}),Object.defineProperty(e,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return m.SemanticTokensRegistrationType}});let h=F();Object.defineProperty(e,"ShowDocumentRequest",{enumerable:!0,get:function(){return h.ShowDocumentRequest}});let g=I();Object.defineProperty(e,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return g.LinkedEditingRangeRequest}});let _=L();Object.defineProperty(e,"FileOperationPatternKind",{enumerable:!0,get:function(){return _.FileOperationPatternKind}}),Object.defineProperty(e,"DidCreateFilesNotification",{enumerable:!0,get:function(){return _.DidCreateFilesNotification}}),Object.defineProperty(e,"WillCreateFilesRequest",{enumerable:!0,get:function(){return _.WillCreateFilesRequest}}),Object.defineProperty(e,"DidRenameFilesNotification",{enumerable:!0,get:function(){return _.DidRenameFilesNotification}}),Object.defineProperty(e,"WillRenameFilesRequest",{enumerable:!0,get:function(){return _.WillRenameFilesRequest}}),Object.defineProperty(e,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return _.DidDeleteFilesNotification}}),Object.defineProperty(e,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return _.WillDeleteFilesRequest}});let v=R();Object.defineProperty(e,"UniquenessLevel",{enumerable:!0,get:function(){return v.UniquenessLevel}}),Object.defineProperty(e,"MonikerKind",{enumerable:!0,get:function(){return v.MonikerKind}}),Object.defineProperty(e,"MonikerRequest",{enumerable:!0,get:function(){return v.MonikerRequest}});let y=z();Object.defineProperty(e,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return y.TypeHierarchyPrepareRequest}}),Object.defineProperty(e,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return y.TypeHierarchySubtypesRequest}}),Object.defineProperty(e,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return y.TypeHierarchySupertypesRequest}});let b=B();Object.defineProperty(e,"InlineValueRequest",{enumerable:!0,get:function(){return b.InlineValueRequest}}),Object.defineProperty(e,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return b.InlineValueRefreshRequest}});let x=V();Object.defineProperty(e,"InlayHintRequest",{enumerable:!0,get:function(){return x.InlayHintRequest}}),Object.defineProperty(e,"InlayHintResolveRequest",{enumerable:!0,get:function(){return x.InlayHintResolveRequest}}),Object.defineProperty(e,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return x.InlayHintRefreshRequest}});let S=ne();Object.defineProperty(e,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return S.DiagnosticServerCancellationData}}),Object.defineProperty(e,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return S.DocumentDiagnosticReportKind}}),Object.defineProperty(e,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return S.DocumentDiagnosticRequest}}),Object.defineProperty(e,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return S.WorkspaceDiagnosticRequest}}),Object.defineProperty(e,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return S.DiagnosticRefreshRequest}});let ie=H();Object.defineProperty(e,"NotebookCellKind",{enumerable:!0,get:function(){return ie.NotebookCellKind}}),Object.defineProperty(e,"ExecutionSummary",{enumerable:!0,get:function(){return ie.ExecutionSummary}}),Object.defineProperty(e,"NotebookCell",{enumerable:!0,get:function(){return ie.NotebookCell}}),Object.defineProperty(e,"NotebookDocument",{enumerable:!0,get:function(){return ie.NotebookDocument}}),Object.defineProperty(e,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return ie.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(e,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return ie.DidOpenNotebookDocumentNotification}}),Object.defineProperty(e,"NotebookCellArrayChange",{enumerable:!0,get:function(){return ie.NotebookCellArrayChange}}),Object.defineProperty(e,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return ie.DidChangeNotebookDocumentNotification}}),Object.defineProperty(e,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return ie.DidSaveNotebookDocumentNotification}}),Object.defineProperty(e,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return ie.DidCloseNotebookDocumentNotification}});let ae=re();Object.defineProperty(e,"InlineCompletionRequest",{enumerable:!0,get:function(){return ae.InlineCompletionRequest}});var oe;(function(e){e.is=function(e){let t=e;return r.string(t)||r.string(t.language)||r.string(t.scheme)||r.string(t.pattern)}})(oe||(e.TextDocumentFilter=oe={}));var U;(function(e){e.is=function(e){let t=e;return r.objectLiteral(t)&&(r.string(t.notebookType)||r.string(t.scheme)||r.string(t.pattern))}})(U||(e.NotebookDocumentFilter=U={}));var se;(function(e){e.is=function(e){let t=e;return r.objectLiteral(t)&&(r.string(t.notebook)||U.is(t.notebook))&&(t.language===void 0||r.string(t.language))}})(se||(e.NotebookCellTextDocumentFilter=se={}));var ce;(function(e){e.is=function(e){if(!Array.isArray(e))return!1;for(let t of e)if(!r.string(t)&&!oe.is(t)&&!se.is(t))return!1;return!0}})(ce||(e.DocumentSelector=ce={}));var W;(function(e){e.method=`client/registerCapability`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(e.method)})(W||(e.RegistrationRequest=W={}));var le;(function(e){e.method=`client/unregisterCapability`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(e.method)})(le||(e.UnregistrationRequest=le={}));var ue;(function(e){e.Create=`create`,e.Rename=`rename`,e.Delete=`delete`})(ue||(e.ResourceOperationKind=ue={}));var G;(function(e){e.Abort=`abort`,e.Transactional=`transactional`,e.TextOnlyTransactional=`textOnlyTransactional`,e.Undo=`undo`})(G||(e.FailureHandlingKind=G={}));var de;(function(e){e.UTF8=`utf-8`,e.UTF16=`utf-16`,e.UTF32=`utf-32`})(de||(e.PositionEncodingKind=de={}));var fe;(function(e){e.hasId=function(e){let t=e;return t&&r.string(t.id)&&t.id.length>0}})(fe||(e.StaticRegistrationOptions=fe={}));var pe;(function(e){e.is=function(e){let t=e;return t&&(t.documentSelector===null||ce.is(t.documentSelector))}})(pe||(e.TextDocumentRegistrationOptions=pe={}));var me;(function(e){e.is=function(e){let t=e;return r.objectLiteral(t)&&(t.workDoneProgress===void 0||r.boolean(t.workDoneProgress))},e.hasWorkDoneProgress=function(e){let t=e;return t&&r.boolean(t.workDoneProgress)}})(me||(e.WorkDoneProgressOptions=me={}));var he;(function(e){e.method=`initialize`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(he||(e.InitializeRequest=he={}));var ge;(function(e){e.unknownProtocolVersion=1})(ge||(e.InitializeErrorCodes=ge={}));var _e;(function(e){e.method=`initialized`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(_e||(e.InitializedNotification=_e={}));var ve;(function(e){e.method=`shutdown`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType0(e.method)})(ve||(e.ShutdownRequest=ve={}));var ye;(function(e){e.method=`exit`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType0(e.method)})(ye||(e.ExitNotification=ye={}));var be;(function(e){e.method=`workspace/didChangeConfiguration`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(be||(e.DidChangeConfigurationNotification=be={}));var xe;(function(e){e.Error=1,e.Warning=2,e.Info=3,e.Log=4,e.Debug=5})(xe||(e.MessageType=xe={}));var Se;(function(e){e.method=`window/showMessage`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolNotificationType(e.method)})(Se||(e.ShowMessageNotification=Se={}));var Ce;(function(e){e.method=`window/showMessageRequest`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(e.method)})(Ce||(e.ShowMessageRequest=Ce={}));var we;(function(e){e.method=`window/logMessage`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolNotificationType(e.method)})(we||(e.LogMessageNotification=we={}));var Te;(function(e){e.method=`telemetry/event`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolNotificationType(e.method)})(Te||(e.TelemetryEventNotification=Te={}));var Ee;(function(e){e.None=0,e.Full=1,e.Incremental=2})(Ee||(e.TextDocumentSyncKind=Ee={}));var De;(function(e){e.method=`textDocument/didOpen`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(De||(e.DidOpenTextDocumentNotification=De={}));var Oe;(function(e){e.isIncremental=function(e){let t=e;return t!=null&&typeof t.text==`string`&&t.range!==void 0&&(t.rangeLength===void 0||typeof t.rangeLength==`number`)},e.isFull=function(e){let t=e;return t!=null&&typeof t.text==`string`&&t.range===void 0&&t.rangeLength===void 0}})(Oe||(e.TextDocumentContentChangeEvent=Oe={}));var ke;(function(e){e.method=`textDocument/didChange`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(ke||(e.DidChangeTextDocumentNotification=ke={}));var Ae;(function(e){e.method=`textDocument/didClose`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(Ae||(e.DidCloseTextDocumentNotification=Ae={}));var je;(function(e){e.method=`textDocument/didSave`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(je||(e.DidSaveTextDocumentNotification=je={}));var Me;(function(e){e.Manual=1,e.AfterDelay=2,e.FocusOut=3})(Me||(e.TextDocumentSaveReason=Me={}));var Ne;(function(e){e.method=`textDocument/willSave`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(Ne||(e.WillSaveTextDocumentNotification=Ne={}));var Pe;(function(e){e.method=`textDocument/willSaveWaitUntil`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Pe||(e.WillSaveTextDocumentWaitUntilRequest=Pe={}));var K;(function(e){e.method=`workspace/didChangeWatchedFiles`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)})(K||(e.DidChangeWatchedFilesNotification=K={}));var Fe;(function(e){e.Created=1,e.Changed=2,e.Deleted=3})(Fe||(e.FileChangeType=Fe={}));var Ie;(function(e){e.is=function(e){let t=e;return r.objectLiteral(t)&&(n.URI.is(t.baseUri)||n.WorkspaceFolder.is(t.baseUri))&&r.string(t.pattern)}})(Ie||(e.RelativePattern=Ie={}));var q;(function(e){e.Create=1,e.Change=2,e.Delete=4})(q||(e.WatchKind=q={}));var Le;(function(e){e.method=`textDocument/publishDiagnostics`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolNotificationType(e.method)})(Le||(e.PublishDiagnosticsNotification=Le={}));var Re;(function(e){e.Invoked=1,e.TriggerCharacter=2,e.TriggerForIncompleteCompletions=3})(Re||(e.CompletionTriggerKind=Re={}));var ze;(function(e){e.method=`textDocument/completion`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(ze||(e.CompletionRequest=ze={}));var J;(function(e){e.method=`completionItem/resolve`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(J||(e.CompletionResolveRequest=J={}));var Be;(function(e){e.method=`textDocument/hover`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Be||(e.HoverRequest=Be={}));var Ve;(function(e){e.Invoked=1,e.TriggerCharacter=2,e.ContentChange=3})(Ve||(e.SignatureHelpTriggerKind=Ve={}));var He;(function(e){e.method=`textDocument/signatureHelp`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(He||(e.SignatureHelpRequest=He={}));var Ue;(function(e){e.method=`textDocument/definition`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ue||(e.DefinitionRequest=Ue={}));var We;(function(e){e.method=`textDocument/references`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(We||(e.ReferencesRequest=We={}));var Ge;(function(e){e.method=`textDocument/documentHighlight`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ge||(e.DocumentHighlightRequest=Ge={}));var Ke;(function(e){e.method=`textDocument/documentSymbol`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ke||(e.DocumentSymbolRequest=Ke={}));var qe;(function(e){e.method=`textDocument/codeAction`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(qe||(e.CodeActionRequest=qe={}));var Je;(function(e){e.method=`codeAction/resolve`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Je||(e.CodeActionResolveRequest=Je={}));var Ye;(function(e){e.method=`workspace/symbol`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ye||(e.WorkspaceSymbolRequest=Ye={}));var Xe;(function(e){e.method=`workspaceSymbol/resolve`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Xe||(e.WorkspaceSymbolResolveRequest=Xe={}));var Ze;(function(e){e.method=`textDocument/codeLens`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Ze||(e.CodeLensRequest=Ze={}));var Qe;(function(e){e.method=`codeLens/resolve`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(Qe||(e.CodeLensResolveRequest=Qe={}));var $e;(function(e){e.method=`workspace/codeLens/refresh`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method)})($e||(e.CodeLensRefreshRequest=$e={}));var et;(function(e){e.method=`textDocument/documentLink`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(et||(e.DocumentLinkRequest=et={}));var tt;(function(e){e.method=`documentLink/resolve`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(tt||(e.DocumentLinkResolveRequest=tt={}));var nt;(function(e){e.method=`textDocument/formatting`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(nt||(e.DocumentFormattingRequest=nt={}));var rt;(function(e){e.method=`textDocument/rangeFormatting`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(rt||(e.DocumentRangeFormattingRequest=rt={}));var it;(function(e){e.method=`textDocument/rangesFormatting`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(it||(e.DocumentRangesFormattingRequest=it={}));var at;(function(e){e.method=`textDocument/onTypeFormatting`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(at||(e.DocumentOnTypeFormattingRequest=at={}));var ot;(function(e){e.Identifier=1})(ot||(e.PrepareSupportDefaultBehavior=ot={}));var st;(function(e){e.method=`textDocument/rename`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(st||(e.RenameRequest=st={}));var ct;(function(e){e.method=`textDocument/prepareRename`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(ct||(e.PrepareRenameRequest=ct={}));var lt;(function(e){e.method=`workspace/executeCommand`,e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)})(lt||(e.ExecuteCommandRequest=lt={}));var ut;(function(e){e.method=`workspace/applyEdit`,e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(`workspace/applyEdit`)})(ut||(e.ApplyWorkspaceEditRequest=ut={}))})),ae=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;let t=x();e.createProtocolConnection=function(e,n,r,i){return t.ConnectionStrategy.is(i)&&(i={connectionStrategy:i}),(0,t.createMessageConnection)(e,n,r,i)}})),oe=/* @__PURE__ */ r(((e,t,n)=>{var r=n&&n.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),i=n&&n.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.LSPErrorCodes=e.createProtocolConnection=void 0,i(x(),e),i(C(),e),i(w(),e),i(ie(),e);var a=ae();Object.defineProperty(e,"createProtocolConnection",{enumerable:!0,get:function(){return a.createProtocolConnection}});var o;(function(e){e.lspReservedErrorRangeStart=-32899,e.RequestFailed=-32803,e.ServerCancelled=-32802,e.ContentModified=-32801,e.RequestCancelled=-32800,e.lspReservedErrorRangeEnd=-32800})(o||(e.LSPErrorCodes=o={}))})),U=/* @__PURE__ */ r(((e,t,n)=>{var r=n&&n.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),i=n&&n.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;let a=S();i(S(),e),i(oe(),e),e.createProtocolConnection=function(e,t,n,r){return(0,a.createMessageConnection)(e,t,n,r)}})),se=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.generateUuid=e.parse=e.isUUID=e.v4=e.empty=void 0;var t=class{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},n=class e extends t{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return e._oneOf(e._chars)}constructor(){super([e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),`-`,e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),`-`,`4`,e._randomHex(),e._randomHex(),e._randomHex(),`-`,e._oneOf(e._timeHighBits),e._randomHex(),e._randomHex(),e._randomHex(),`-`,e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex()].join(``))}};n._chars=[`0`,`1`,`2`,`3`,`4`,`5`,`6`,`6`,`7`,`8`,`9`,`a`,`b`,`c`,`d`,`e`,`f`],n._timeHighBits=[`8`,`9`,`a`,`b`],e.empty=new t(`00000000-0000-0000-0000-000000000000`);function r(){return new n}e.v4=r;let i=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function a(e){return i.test(e)}e.isUUID=a,e.parse=function(e){if(!a(e))throw Error(`invalid uuid`);return new t(e)},e.generateUuid=function(){return r().asHex()}})),ce=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.attachPartialResult=e.ProgressFeature=e.attachWorkDone=void 0;let t=U(),n=se();var r=class e{constructor(t,n){this._connection=t,this._token=n,e.Instances.set(this._token,this)}begin(e,n,r,i){let a={kind:`begin`,title:e,percentage:n,message:r,cancellable:i};this._connection.sendProgress(t.WorkDoneProgress.type,this._token,a)}report(e,n){let r={kind:`report`};typeof e==`number`?(r.percentage=e,n!==void 0&&(r.message=n)):r.message=e,this._connection.sendProgress(t.WorkDoneProgress.type,this._token,r)}done(){e.Instances.delete(this._token),this._connection.sendProgress(t.WorkDoneProgress.type,this._token,{kind:`end`})}};r.Instances=/* @__PURE__ */ new Map;var i=class extends r{constructor(e,n){super(e,n),this._source=new t.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}},a=class{constructor(){}begin(){}report(){}done(){}},o=class extends a{constructor(){super(),this._source=new t.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}};e.attachWorkDone=function(e,t){if(t===void 0||t.workDoneToken===void 0)return new a;let n=t.workDoneToken;return delete t.workDoneToken,new r(e,n)},e.ProgressFeature=e=>class extends e{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(t.WorkDoneProgressCancelNotification.type,e=>{let t=r.Instances.get(e.token);(t instanceof i||t instanceof o)&&t.cancel()}))}attachWorkDoneProgress(e){return e===void 0?new a:new r(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0,n.generateUuid)();return this.connection.sendRequest(t.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new i(this.connection,e))}return Promise.resolve(new o)}};var s;(function(e){e.type=new t.ProgressType})(s||={});var c=class{constructor(e,t){this._connection=e,this._token=t}report(e){this._connection.sendProgress(s.type,this._token,e)}};e.attachPartialResult=function(e,t){if(t===void 0||t.partialResultToken===void 0)return;let n=t.partialResultToken;return delete t.partialResultToken,new c(e,n)}})),W=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigurationFeature=void 0;let t=U(),n=a();e.ConfigurationFeature=e=>class extends e{getConfiguration(e){return e?n.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let n={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(t.ConfigurationRequest.type,n).then(t=>Array.isArray(t)?Array.isArray(e)?t:t[0]:Array.isArray(e)?[]:null)}}})),le=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceFoldersFeature=void 0;let t=U();e.WorkspaceFoldersFeature=e=>class extends e{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let n=e.workspace;n&&n.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new t.Emitter,this.connection.onNotification(t.DidChangeWorkspaceFoldersNotification.type,e=>{this._onDidChangeWorkspaceFolders.fire(e.event)}))}fillServerCapabilities(e){super.fillServerCapabilities(e);let t=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=t===!0||typeof t==`string`}getWorkspaceFolders(){return this.connection.sendRequest(t.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw Error(`Client doesn't support sending workspace folder change events.`);return!this._notificationIsAutoRegistered&&!this._unregistration&&(this._unregistration=this.connection.client.register(t.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}}})),ue=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CallHierarchyFeature=void 0;let t=U();e.CallHierarchyFeature=e=>class extends e{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(t.CallHierarchyPrepareRequest.type,(t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0)),onIncomingCalls:e=>{let n=t.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(n,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(n,t)))},onOutgoingCalls:e=>{let n=t.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(n,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(n,t)))}}}}})),G=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SemanticTokensBuilder=e.SemanticTokensDiff=e.SemanticTokensFeature=void 0;let t=U();e.SemanticTokensFeature=e=>class extends e{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(t.SemanticTokensRefreshRequest.type),on:e=>{let n=t.SemanticTokensRequest.type;return this.connection.onRequest(n,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(n,t)))},onDelta:e=>{let n=t.SemanticTokensDeltaRequest.type;return this.connection.onRequest(n,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(n,t)))},onRange:e=>{let n=t.SemanticTokensRangeRequest.type;return this.connection.onRequest(n,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(n,t)))}}}};var n=class{constructor(e,t){this.originalSequence=e,this.modifiedSequence=t}computeDiff(){let e=this.originalSequence.length,t=this.modifiedSequence.length,n=0;for(;n<t&&n<e&&this.originalSequence[n]===this.modifiedSequence[n];)n++;if(n<t&&n<e){let r=e-1,i=t-1;for(;r>=n&&i>=n&&this.originalSequence[r]===this.modifiedSequence[i];)r--,i--;(r<n||i<n)&&(r++,i++);let a=r-n+1,o=this.modifiedSequence.slice(n,i+1);return o.length===1&&o[0]===this.originalSequence[r]?[{start:n,deleteCount:a-1}]:[{start:n,deleteCount:a,data:o}]}return n<t?[{start:n,deleteCount:0,data:this.modifiedSequence.slice(n)}]:n<e?[{start:n,deleteCount:e-n}]:[]}};e.SemanticTokensDiff=n,e.SemanticTokensBuilder=class{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(e,t,n,r,i){let a=e,o=t;this._dataLen>0&&(a-=this._prevLine,a===0&&(o-=this._prevChar)),this._data[this._dataLen++]=a,this._data[this._dataLen++]=o,this._data[this._dataLen++]=n,this._data[this._dataLen++]=r,this._data[this._dataLen++]=i,this._prevLine=e,this._prevChar=t}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData===void 0?this.build():{resultId:this.id,edits:new n(this._prevData,this._data).computeDiff()}}}})),de=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ShowDocumentFeature=void 0;let t=U();e.ShowDocumentFeature=e=>class extends e{showDocument(e){return this.connection.sendRequest(t.ShowDocumentRequest.type,e)}}})),fe=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FileOperationsFeature=void 0;let t=U();e.FileOperationsFeature=e=>class extends e{onDidCreateFiles(e){return this.connection.onNotification(t.DidCreateFilesNotification.type,t=>{e(t)})}onDidRenameFiles(e){return this.connection.onNotification(t.DidRenameFilesNotification.type,t=>{e(t)})}onDidDeleteFiles(e){return this.connection.onNotification(t.DidDeleteFilesNotification.type,t=>{e(t)})}onWillCreateFiles(e){return this.connection.onRequest(t.WillCreateFilesRequest.type,(t,n)=>e(t,n))}onWillRenameFiles(e){return this.connection.onRequest(t.WillRenameFilesRequest.type,(t,n)=>e(t,n))}onWillDeleteFiles(e){return this.connection.onRequest(t.WillDeleteFilesRequest.type,(t,n)=>e(t,n))}}})),pe=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LinkedEditingRangeFeature=void 0;let t=U();e.LinkedEditingRangeFeature=e=>class extends e{onLinkedEditingRange(e){return this.connection.onRequest(t.LinkedEditingRangeRequest.type,(t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0))}}})),me=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHierarchyFeature=void 0;let t=U();e.TypeHierarchyFeature=e=>class extends e{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(t.TypeHierarchyPrepareRequest.type,(t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0)),onSupertypes:e=>{let n=t.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(n,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(n,t)))},onSubtypes:e=>{let n=t.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(n,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(n,t)))}}}}})),he=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlineValueFeature=void 0;let t=U();e.InlineValueFeature=e=>class extends e{get inlineValue(){return{refresh:()=>this.connection.sendRequest(t.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(t.InlineValueRequest.type,(t,n)=>e(t,n,this.attachWorkDoneProgress(t)))}}}})),ge=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FoldingRangeFeature=void 0;let t=U();e.FoldingRangeFeature=e=>class extends e{get foldingRange(){return{refresh:()=>this.connection.sendRequest(t.FoldingRangeRefreshRequest.type),on:e=>{let n=t.FoldingRangeRequest.type;return this.connection.onRequest(n,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(n,t)))}}}}})),_e=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlayHintFeature=void 0;let t=U();e.InlayHintFeature=e=>class extends e{get inlayHint(){return{refresh:()=>this.connection.sendRequest(t.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(t.InlayHintRequest.type,(t,n)=>e(t,n,this.attachWorkDoneProgress(t))),resolve:e=>this.connection.onRequest(t.InlayHintResolveRequest.type,(t,n)=>e(t,n))}}}})),ve=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiagnosticFeature=void 0;let t=U();e.DiagnosticFeature=e=>class extends e{get diagnostics(){return{refresh:()=>this.connection.sendRequest(t.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(t.DocumentDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t.DocumentDiagnosticRequest.partialResult,n))),onWorkspace:e=>this.connection.onRequest(t.WorkspaceDiagnosticRequest.type,(n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t.WorkspaceDiagnosticRequest.partialResult,n)))}}}})),ye=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocuments=void 0;let t=U();e.TextDocuments=class{constructor(e){this._configuration=e,this._syncedDocuments=/* @__PURE__ */ new Map,this._onDidChangeContent=new t.Emitter,this._onDidOpen=new t.Emitter,this._onDidClose=new t.Emitter,this._onDidSave=new t.Emitter,this._onWillSave=new t.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._syncedDocuments.get(e)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=t.TextDocumentSyncKind.Incremental;let n=[];return n.push(e.onDidOpenTextDocument(e=>{let t=e.textDocument,n=this._configuration.create(t.uri,t.languageId,t.version,t.text);this._syncedDocuments.set(t.uri,n);let r=Object.freeze({document:n});this._onDidOpen.fire(r),this._onDidChangeContent.fire(r)})),n.push(e.onDidChangeTextDocument(e=>{let t=e.textDocument,n=e.contentChanges;if(n.length===0)return;let{version:r}=t;if(r==null)throw Error(`Received document change event for ${t.uri} without valid version identifier`);let i=this._syncedDocuments.get(t.uri);i!==void 0&&(i=this._configuration.update(i,n,r),this._syncedDocuments.set(t.uri,i),this._onDidChangeContent.fire(Object.freeze({document:i})))})),n.push(e.onDidCloseTextDocument(e=>{let t=this._syncedDocuments.get(e.textDocument.uri);t!==void 0&&(this._syncedDocuments.delete(e.textDocument.uri),this._onDidClose.fire(Object.freeze({document:t})))})),n.push(e.onWillSaveTextDocument(e=>{let t=this._syncedDocuments.get(e.textDocument.uri);t!==void 0&&this._onWillSave.fire(Object.freeze({document:t,reason:e.reason}))})),n.push(e.onWillSaveTextDocumentWaitUntil((e,t)=>{let n=this._syncedDocuments.get(e.textDocument.uri);return n!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:n,reason:e.reason}),t):[]})),n.push(e.onDidSaveTextDocument(e=>{let t=this._syncedDocuments.get(e.textDocument.uri);t!==void 0&&this._onDidSave.fire(Object.freeze({document:t}))})),t.Disposable.create(()=>{n.forEach(e=>e.dispose())})}}})),be=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NotebookDocuments=e.NotebookSyncFeature=void 0;let t=U(),n=ye();e.NotebookSyncFeature=e=>class extends e{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(t.DidOpenNotebookDocumentNotification.type,t=>{e(t)}),onDidChangeNotebookDocument:e=>this.connection.onNotification(t.DidChangeNotebookDocumentNotification.type,t=>{e(t)}),onDidSaveNotebookDocument:e=>this.connection.onNotification(t.DidSaveNotebookDocumentNotification.type,t=>{e(t)}),onDidCloseNotebookDocument:e=>this.connection.onNotification(t.DidCloseNotebookDocumentNotification.type,t=>{e(t)})}}};var r=class e{onDidOpenTextDocument(e){return this.openHandler=e,t.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,t.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,t.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return e.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return e.NULL_DISPOSE}onDidSaveTextDocument(){return e.NULL_DISPOSE}};r.NULL_DISPOSE=Object.freeze({dispose:()=>{}}),e.NotebookDocuments=class{constructor(e){this._cellTextDocuments=e instanceof n.TextDocuments?e:new n.TextDocuments(e),this.notebookDocuments=/* @__PURE__ */ new Map,this.notebookCellMap=/* @__PURE__ */ new Map,this._onDidOpen=new t.Emitter,this._onDidChange=new t.Emitter,this._onDidSave=new t.Emitter,this._onDidClose=new t.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let t=this.notebookCellMap.get(e);return t&&t[0]}findNotebookDocumentForCell(e){let t=typeof e==`string`?e:e.document,n=this.notebookCellMap.get(t);return n&&n[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){let n=new r,i=[];return i.push(this.cellTextDocuments.listen(n)),i.push(e.notebooks.synchronization.onDidOpenNotebookDocument(e=>{this.notebookDocuments.set(e.notebookDocument.uri,e.notebookDocument);for(let t of e.cellTextDocuments)n.openTextDocument({textDocument:t});this.updateCellMap(e.notebookDocument),this._onDidOpen.fire(e.notebookDocument)})),i.push(e.notebooks.synchronization.onDidChangeNotebookDocument(e=>{let t=this.notebookDocuments.get(e.notebookDocument.uri);if(t===void 0)return;t.version=e.notebookDocument.version;let r=t.metadata,i=!1,a=e.change;a.metadata!==void 0&&(i=!0,t.metadata=a.metadata);let o=[],s=[],c=[],l=[];if(a.cells!==void 0){let e=a.cells;if(e.structure!==void 0){let r=e.structure.array;if(t.cells.splice(r.start,r.deleteCount,...r.cells===void 0?[]:r.cells),e.structure.didOpen!==void 0)for(let t of e.structure.didOpen)n.openTextDocument({textDocument:t}),o.push(t.uri);if(e.structure.didClose)for(let t of e.structure.didClose)n.closeTextDocument({textDocument:t}),s.push(t.uri)}if(e.data!==void 0){let n=new Map(e.data.map(e=>[e.document,e]));for(let e=0;e<=t.cells.length;e++){let r=n.get(t.cells[e].document);if(r!==void 0){let i=t.cells.splice(e,1,r);if(c.push({old:i[0],new:r}),n.delete(r.document),n.size===0)break}}}if(e.textContent!==void 0)for(let t of e.textContent)n.changeTextDocument({textDocument:t.document,contentChanges:t.changes}),l.push(t.document.uri)}this.updateCellMap(t);let u={notebookDocument:t};i&&(u.metadata={old:r,new:t.metadata});let d=[];for(let e of o)d.push(this.getNotebookCell(e));let f=[];for(let e of s)f.push(this.getNotebookCell(e));let p=[];for(let e of l)p.push(this.getNotebookCell(e));(d.length>0||f.length>0||c.length>0||p.length>0)&&(u.cells={added:d,removed:f,changed:{data:c,textContent:p}}),(u.metadata!==void 0||u.cells!==void 0)&&this._onDidChange.fire(u)})),i.push(e.notebooks.synchronization.onDidSaveNotebookDocument(e=>{let t=this.notebookDocuments.get(e.notebookDocument.uri);t!==void 0&&this._onDidSave.fire(t)})),i.push(e.notebooks.synchronization.onDidCloseNotebookDocument(e=>{let t=this.notebookDocuments.get(e.notebookDocument.uri);if(t!==void 0){this._onDidClose.fire(t);for(let t of e.cellTextDocuments)n.closeTextDocument({textDocument:t});this.notebookDocuments.delete(e.notebookDocument.uri);for(let e of t.cells)this.notebookCellMap.delete(e.document)}})),t.Disposable.create(()=>{i.forEach(e=>e.dispose())})}updateCellMap(e){for(let t of e.cells)this.notebookCellMap.set(t.document,[t,e])}}})),xe=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MonikerFeature=void 0;let t=U();e.MonikerFeature=e=>class extends e{get moniker(){return{on:e=>{let n=t.MonikerRequest.type;return this.connection.onRequest(n,(t,r)=>e(t,r,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(n,t)))}}}}})),Se=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createConnection=e.combineFeatures=e.combineNotebooksFeatures=e.combineLanguagesFeatures=e.combineWorkspaceFeatures=e.combineWindowFeatures=e.combineClientFeatures=e.combineTracerFeatures=e.combineTelemetryFeatures=e.combineConsoleFeatures=e._NotebooksImpl=e._LanguagesImpl=e.BulkUnregistration=e.BulkRegistration=e.ErrorMessageTracker=void 0;let t=U(),n=a(),r=se(),i=ce(),o=W(),s=le(),c=ue(),l=G(),u=de(),d=fe(),f=pe(),p=me(),m=he(),h=ge(),g=_e(),_=ve(),v=be(),y=xe();function b(e){if(e!==null)return e}e.ErrorMessageTracker=class{constructor(){this._messages=Object.create(null)}add(e){let t=this._messages[e];t||=0,t++,this._messages[e]=t}sendErrors(e){Object.keys(this._messages).forEach(t=>{e.window.showErrorMessage(t)})}};var x=class{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw Error(`Remote is not attached to a connection yet.`);return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(t.MessageType.Error,e)}warn(e){this.send(t.MessageType.Warning,e)}info(e){this.send(t.MessageType.Info,e)}log(e){this.send(t.MessageType.Log,e)}debug(e){this.send(t.MessageType.Debug,e)}send(e,n){this._rawConnection&&this._rawConnection.sendNotification(t.LogMessageNotification.type,{type:e,message:n}).catch(()=>{(0,t.RAL)().console.error(`Sending log message failed`)})}},S=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw Error(`Remote is not attached to a connection yet.`);return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...n){let r={type:t.MessageType.Error,message:e,actions:n};return this.connection.sendRequest(t.ShowMessageRequest.type,r).then(b)}showWarningMessage(e,...n){let r={type:t.MessageType.Warning,message:e,actions:n};return this.connection.sendRequest(t.ShowMessageRequest.type,r).then(b)}showInformationMessage(e,...n){let r={type:t.MessageType.Info,message:e,actions:n};return this.connection.sendRequest(t.ShowMessageRequest.type,r).then(b)}};let C=(0,u.ShowDocumentFeature)((0,i.ProgressFeature)(S));var w;(function(e){e.create=function(){return new T}})(w||(e.BulkRegistration=w={}));var T=class{constructor(){this._registrations=[],this._registered=/* @__PURE__ */ new Set}add(e,t){let i=n.string(e)?e:e.method;if(this._registered.has(i))throw Error(`${i} is already added to this registration`);let a=r.generateUuid();this._registrations.push({id:a,method:i,registerOptions:t||{}}),this._registered.add(i)}asRegistrationParams(){return{registrations:this._registrations}}},E;(function(e){e.create=function(){return new D(void 0,[])}})(E||(e.BulkUnregistration=E={}));var D=class{constructor(e,t){this._connection=e,this._unregistrations=/* @__PURE__ */ new Map,t.forEach(e=>{this._unregistrations.set(e.method,e)})}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let t of this._unregistrations.values())e.push(t);let n={unregisterations:e};this._connection.sendRequest(t.UnregistrationRequest.type,n).catch(()=>{this._connection.console.info(`Bulk unregistration failed.`)})}disposeSingle(e){let r=n.string(e)?e:e.method,i=this._unregistrations.get(r);if(!i)return!1;let a={unregisterations:[i]};return this._connection.sendRequest(t.UnregistrationRequest.type,a).then(()=>{this._unregistrations.delete(r)},e=>{this._connection.console.info(`Un-registering request handler for ${i.id} failed.`)}),!0}},O=class{attach(e){this._connection=e}get connection(){if(!this._connection)throw Error(`Remote is not attached to a connection yet.`);return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,t,n){return e instanceof T?this.registerMany(e):e instanceof D?this.registerSingle1(e,t,n):this.registerSingle2(e,t)}registerSingle1(e,i,a){let o=n.string(i)?i:i.method,s=r.generateUuid(),c={registrations:[{id:s,method:o,registerOptions:a||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(t.RegistrationRequest.type,c).then(t=>(e.add({id:s,method:o}),e),e=>(this.connection.console.info(`Registering request handler for ${o} failed.`),Promise.reject(e)))}registerSingle2(e,i){let a=n.string(e)?e:e.method,o=r.generateUuid(),s={registrations:[{id:o,method:a,registerOptions:i||{}}]};return this.connection.sendRequest(t.RegistrationRequest.type,s).then(e=>t.Disposable.create(()=>{this.unregisterSingle(o,a).catch(()=>{this.connection.console.info(`Un-registering capability with id ${o} failed.`)})}),e=>(this.connection.console.info(`Registering request handler for ${a} failed.`),Promise.reject(e)))}unregisterSingle(e,n){let r={unregisterations:[{id:e,method:n}]};return this.connection.sendRequest(t.UnregistrationRequest.type,r).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)})}registerMany(e){let n=e.asRegistrationParams();return this.connection.sendRequest(t.RegistrationRequest.type,n).then(()=>new D(this._connection,n.registrations.map(e=>({id:e.id,method:e.method}))),e=>(this.connection.console.info(`Bulk registration failed.`),Promise.reject(e)))}},k=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw Error(`Remote is not attached to a connection yet.`);return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function n(e){return e&&!!e.edit}let r=n(e)?e:{edit:e};return this.connection.sendRequest(t.ApplyWorkspaceEditRequest.type,r)}};let ee=(0,d.FileOperationsFeature)((0,s.WorkspaceFoldersFeature)((0,o.ConfigurationFeature)(k)));var A=class{constructor(){this._trace=t.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw Error(`Remote is not attached to a connection yet.`);return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,n){this._trace!==t.Trace.Off&&this.connection.sendNotification(t.LogTraceNotification.type,{message:e,verbose:this._trace===t.Trace.Verbose?n:void 0}).catch(()=>{})}},j=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw Error(`Remote is not attached to a connection yet.`);return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(t.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log(`Sending TelemetryEventNotification failed`)})}},te=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw Error(`Remote is not attached to a connection yet.`);return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,i.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,i.attachPartialResult)(this.connection,t)}};e._LanguagesImpl=te;let M=(0,h.FoldingRangeFeature)((0,y.MonikerFeature)((0,_.DiagnosticFeature)((0,g.InlayHintFeature)((0,m.InlineValueFeature)((0,p.TypeHierarchyFeature)((0,f.LinkedEditingRangeFeature)((0,l.SemanticTokensFeature)((0,c.CallHierarchyFeature)(te)))))))));var N=class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw Error(`Remote is not attached to a connection yet.`);return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,i.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,i.attachPartialResult)(this.connection,t)}};e._NotebooksImpl=N;let P=(0,v.NotebookSyncFeature)(N);function F(e,t){return function(n){return t(e(n))}}e.combineConsoleFeatures=F;function I(e,t){return function(n){return t(e(n))}}e.combineTelemetryFeatures=I;function L(e,t){return function(n){return t(e(n))}}e.combineTracerFeatures=L;function R(e,t){return function(n){return t(e(n))}}e.combineClientFeatures=R;function z(e,t){return function(n){return t(e(n))}}e.combineWindowFeatures=z;function B(e,t){return function(n){return t(e(n))}}e.combineWorkspaceFeatures=B;function V(e,t){return function(n){return t(e(n))}}e.combineLanguagesFeatures=V;function ne(e,t){return function(n){return t(e(n))}}e.combineNotebooksFeatures=ne,e.combineFeatures=function(e,t){function n(e,t,n){return e&&t?n(e,t):e||t}return{__brand:`features`,console:n(e.console,t.console,F),tracer:n(e.tracer,t.tracer,L),telemetry:n(e.telemetry,t.telemetry,I),client:n(e.client,t.client,R),window:n(e.window,t.window,z),workspace:n(e.workspace,t.workspace,B),languages:n(e.languages,t.languages,V),notebooks:n(e.notebooks,t.notebooks,ne)}},e.createConnection=function(e,r,a){let o=a&&a.console?new(a.console(x)):new x,s=e(o);o.rawAttach(s);let c=a&&a.tracer?new(a.tracer(A)):new A,l=a&&a.telemetry?new(a.telemetry(j)):new j,u=a&&a.client?new(a.client(O)):new O,d=a&&a.window?new(a.window(C)):new C,f=a&&a.workspace?new(a.workspace(ee)):new ee,p=a&&a.languages?new(a.languages(M)):new M,m=a&&a.notebooks?new(a.notebooks(P)):new P,h=[o,c,l,u,d,f,p,m];function g(e){return e instanceof Promise?e:n.thenable(e)?new Promise((t,n)=>{e.then(e=>t(e),e=>n(e))}):Promise.resolve(e)}let _,v,y,b={listen:()=>s.listen(),sendRequest:(e,...t)=>s.sendRequest(n.string(e)?e:e.method,...t),onRequest:(e,t)=>s.onRequest(e,t),sendNotification:(e,t)=>{let r=n.string(e)?e:e.method;return s.sendNotification(r,t)},onNotification:(e,t)=>s.onNotification(e,t),onProgress:s.onProgress,sendProgress:s.sendProgress,onInitialize:e=>(v=e,{dispose:()=>{v=void 0}}),onInitialized:e=>s.onNotification(t.InitializedNotification.type,e),onShutdown:e=>(_=e,{dispose:()=>{_=void 0}}),onExit:e=>(y=e,{dispose:()=>{y=void 0}}),get console(){return o},get telemetry(){return l},get tracer(){return c},get client(){return u},get window(){return d},get workspace(){return f},get languages(){return p},get notebooks(){return m},onDidChangeConfiguration:e=>s.onNotification(t.DidChangeConfigurationNotification.type,e),onDidChangeWatchedFiles:e=>s.onNotification(t.DidChangeWatchedFilesNotification.type,e),__textDocumentSync:void 0,onDidOpenTextDocument:e=>s.onNotification(t.DidOpenTextDocumentNotification.type,e),onDidChangeTextDocument:e=>s.onNotification(t.DidChangeTextDocumentNotification.type,e),onDidCloseTextDocument:e=>s.onNotification(t.DidCloseTextDocumentNotification.type,e),onWillSaveTextDocument:e=>s.onNotification(t.WillSaveTextDocumentNotification.type,e),onWillSaveTextDocumentWaitUntil:e=>s.onRequest(t.WillSaveTextDocumentWaitUntilRequest.type,e),onDidSaveTextDocument:e=>s.onNotification(t.DidSaveTextDocumentNotification.type,e),sendDiagnostics:e=>s.sendNotification(t.PublishDiagnosticsNotification.type,e),onHover:e=>s.onRequest(t.HoverRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),void 0)),onCompletion:e=>s.onRequest(t.CompletionRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),(0,i.attachPartialResult)(s,t))),onCompletionResolve:e=>s.onRequest(t.CompletionResolveRequest.type,e),onSignatureHelp:e=>s.onRequest(t.SignatureHelpRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),void 0)),onDeclaration:e=>s.onRequest(t.DeclarationRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),(0,i.attachPartialResult)(s,t))),onDefinition:e=>s.onRequest(t.DefinitionRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),(0,i.attachPartialResult)(s,t))),onTypeDefinition:e=>s.onRequest(t.TypeDefinitionRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),(0,i.attachPartialResult)(s,t))),onImplementation:e=>s.onRequest(t.ImplementationRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),(0,i.attachPartialResult)(s,t))),onReferences:e=>s.onRequest(t.ReferencesRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),(0,i.attachPartialResult)(s,t))),onDocumentHighlight:e=>s.onRequest(t.DocumentHighlightRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),(0,i.attachPartialResult)(s,t))),onDocumentSymbol:e=>s.onRequest(t.DocumentSymbolRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),(0,i.attachPartialResult)(s,t))),onWorkspaceSymbol:e=>s.onRequest(t.WorkspaceSymbolRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),(0,i.attachPartialResult)(s,t))),onWorkspaceSymbolResolve:e=>s.onRequest(t.WorkspaceSymbolResolveRequest.type,e),onCodeAction:e=>s.onRequest(t.CodeActionRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),(0,i.attachPartialResult)(s,t))),onCodeActionResolve:e=>s.onRequest(t.CodeActionResolveRequest.type,(t,n)=>e(t,n)),onCodeLens:e=>s.onRequest(t.CodeLensRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),(0,i.attachPartialResult)(s,t))),onCodeLensResolve:e=>s.onRequest(t.CodeLensResolveRequest.type,(t,n)=>e(t,n)),onDocumentFormatting:e=>s.onRequest(t.DocumentFormattingRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),void 0)),onDocumentRangeFormatting:e=>s.onRequest(t.DocumentRangeFormattingRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),void 0)),onDocumentOnTypeFormatting:e=>s.onRequest(t.DocumentOnTypeFormattingRequest.type,(t,n)=>e(t,n)),onRenameRequest:e=>s.onRequest(t.RenameRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),void 0)),onPrepareRename:e=>s.onRequest(t.PrepareRenameRequest.type,(t,n)=>e(t,n)),onDocumentLinks:e=>s.onRequest(t.DocumentLinkRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),(0,i.attachPartialResult)(s,t))),onDocumentLinkResolve:e=>s.onRequest(t.DocumentLinkResolveRequest.type,(t,n)=>e(t,n)),onDocumentColor:e=>s.onRequest(t.DocumentColorRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),(0,i.attachPartialResult)(s,t))),onColorPresentation:e=>s.onRequest(t.ColorPresentationRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),(0,i.attachPartialResult)(s,t))),onFoldingRanges:e=>s.onRequest(t.FoldingRangeRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),(0,i.attachPartialResult)(s,t))),onSelectionRanges:e=>s.onRequest(t.SelectionRangeRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),(0,i.attachPartialResult)(s,t))),onExecuteCommand:e=>s.onRequest(t.ExecuteCommandRequest.type,(t,n)=>e(t,n,(0,i.attachWorkDone)(s,t),void 0)),dispose:()=>s.dispose()};for(let e of h)e.attach(b);return s.onRequest(t.InitializeRequest.type,e=>{r.initialize(e),n.string(e.trace)&&(c.trace=t.Trace.fromString(e.trace));for(let t of h)t.initialize(e.capabilities);if(v)return g(v(e,new t.CancellationTokenSource().token,(0,i.attachWorkDone)(s,e),void 0)).then(e=>{if(e instanceof t.ResponseError)return e;let r=e;r||={capabilities:{}};let i=r.capabilities;i||(i={},r.capabilities=i),i.textDocumentSync===void 0||i.textDocumentSync===null?i.textDocumentSync=n.number(b.__textDocumentSync)?b.__textDocumentSync:t.TextDocumentSyncKind.None:!n.number(i.textDocumentSync)&&!n.number(i.textDocumentSync.change)&&(i.textDocumentSync.change=n.number(b.__textDocumentSync)?b.__textDocumentSync:t.TextDocumentSyncKind.None);for(let e of h)e.fillServerCapabilities(i);return r});{let e={capabilities:{textDocumentSync:t.TextDocumentSyncKind.None}};for(let t of h)t.fillServerCapabilities(e.capabilities);return e}}),s.onRequest(t.ShutdownRequest.type,()=>{if(r.shutdownReceived=!0,_)return _(new t.CancellationTokenSource().token)}),s.onNotification(t.ExitNotification.type,()=>{try{y&&y()}finally{r.shutdownReceived?r.exit(0):r.exit(1)}}),s.onNotification(t.SetTraceNotification.type,e=>{c.trace=t.Trace.fromString(e.value)}),b}})),Ce,we,Te=n((()=>{Ce=()=>t(import.meta.url),we=/* @__PURE__ */ Ce()})),Ee=/* @__PURE__ */ r((e=>{Te(),Object.defineProperty(e,"__esModule",{value:!0}),e.resolveModulePath=e.FileSystem=e.resolveGlobalYarnPath=e.resolveGlobalNodePath=e.resolve=e.uriToFilePath=void 0;let t=i(`url`),n=i(`path`),r=i(`fs`),a=i(`child_process`);e.uriToFilePath=function(e){let r=t.parse(e);if(r.protocol!==`file:`||!r.path)return;let i=r.path.split(`/`);for(var a=0,o=i.length;a<o;a++)i[a]=decodeURIComponent(i[a]);if(process.platform===`win32`&&i.length>1){let e=i[0],t=i[1];e.length===0&&t.length>1&&t[1]===`:`&&i.shift()}return n.normalize(i.join(`/`))};function o(){return process.platform===`win32`}function s(e,t,i,o){let s=`NODE_PATH`;return new Promise((c,l)=>{let u=process.env,d=Object.create(null);Object.keys(u).forEach(e=>d[e]=u[e]),t&&r.existsSync(t)&&(d[s]?d[s]=t+n.delimiter+d[s]:d[s]=t,o&&o(`NODE_PATH value is: ${d[s]}`)),d.ELECTRON_RUN_AS_NODE=`1`;try{let t=(0,a.fork)(``,[],{cwd:i,env:d,execArgv:[`-e`,`var p = process;p.on('message',function(m){if(m.c==='e'){p.exit(0);}else if(m.c==='rs'){try{var r=require.resolve(m.a);p.send({c:'r',s:true,r:r});}catch(err){p.send({c:'r',s:false});}}});`]});if(t.pid===void 0){l(/* @__PURE__ */ Error(`Starting process to resolve node module ${e} failed`));return}t.on(`error`,e=>{l(e)}),t.on(`message`,n=>{n.c===`r`&&(t.send({c:`e`}),n.s?c(n.r):l(/* @__PURE__ */ Error(`Failed to resolve module: ${e}`)))});let n={c:`rs`,a:e};t.send(n)}catch(e){l(e)}})}e.resolve=s;function c(e){let t=`npm`,r=Object.create(null);Object.keys(process.env).forEach(e=>r[e]=process.env[e]),r.NO_UPDATE_NOTIFIER=`true`;let i={encoding:`utf8`,env:r};o()&&(t=`npm.cmd`,i.shell=!0);let s=()=>{};try{process.on(`SIGPIPE`,s);let r=(0,a.spawnSync)(t,[`config`,`get`,`prefix`],i).stdout;if(!r){e&&e(`'npm config get prefix' didn't return a value.`);return}let c=r.trim();return e&&e(`'npm config get prefix' value is: ${c}`),c.length>0?o()?n.join(c,`node_modules`):n.join(c,`lib`,`node_modules`):void 0}catch{return}finally{process.removeListener(`SIGPIPE`,s)}}e.resolveGlobalNodePath=c,e.resolveGlobalYarnPath=function(e){let t=`yarn`,r={encoding:`utf8`};o()&&(t=`yarn.cmd`,r.shell=!0);let i=()=>{};try{process.on(`SIGPIPE`,i);let o=(0,a.spawnSync)(t,[`global`,`dir`,`--json`],r),s=o.stdout;if(!s){e&&(e(`'yarn global dir' didn't return a value.`),o.stderr&&e(o.stderr));return}let c=s.trim().split(/\r?\n/);for(let e of c)try{let t=JSON.parse(e);if(t.type===`log`)return n.join(t.data,`node_modules`)}catch{}return}catch{return}finally{process.removeListener(`SIGPIPE`,i)}};var l;(function(e){let t;function i(){return t===void 0&&(t=process.platform===`win32`?!1:!r.existsSync(we.toUpperCase())||!r.existsSync(we.toLowerCase())),t}e.isCaseSensitive=i,e.isParent=function(e,t){return i()?n.normalize(t).indexOf(n.normalize(e))===0:n.normalize(t).toLowerCase().indexOf(n.normalize(e).toLowerCase())===0}})(l||(e.FileSystem=l={})),e.resolveModulePath=function(e,t,r,i){return r?(n.isAbsolute(r)||(r=n.join(e,r)),s(t,r,r,i).then(e=>l.isParent(r,e)?e:Promise.reject(/* @__PURE__ */ Error(`Failed to load ${t} from node path location.`))).then(void 0,n=>s(t,c(i),e,i))):s(t,c(i),e,i)}})),De=/* @__PURE__ */ r(((e,t)=>{t.exports=U()})),Oe=/* @__PURE__ */ r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.InlineCompletionFeature=void 0;let t=U();e.InlineCompletionFeature=e=>class extends e{get inlineCompletion(){return{on:e=>this.connection.onRequest(t.InlineCompletionRequest.type,(t,n)=>e(t,n,this.attachWorkDoneProgress(t)))}}}})),ke=/* @__PURE__ */ r(((e,t,n)=>{var r=n&&n.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),i=n&&n.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.ProposedFeatures=e.NotebookDocuments=e.TextDocuments=e.SemanticTokensBuilder=void 0;let a=G();Object.defineProperty(e,"SemanticTokensBuilder",{enumerable:!0,get:function(){return a.SemanticTokensBuilder}});let o=Oe();i(U(),e);let s=ye();Object.defineProperty(e,"TextDocuments",{enumerable:!0,get:function(){return s.TextDocuments}});let c=be();Object.defineProperty(e,"NotebookDocuments",{enumerable:!0,get:function(){return c.NotebookDocuments}}),i(Se(),e);var l;(function(e){e.all={__brand:`features`,languages:o.InlineCompletionFeature}})(l||(e.ProposedFeatures=l={}))})),Ae=/* @__PURE__ */ r(((e,t,n)=>{var r=n&&n.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),o=n&&n.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.createConnection=e.Files=void 0;let s=i(`node:util`),c=a(),l=Se(),u=Ee(),d=De();o(De(),e),o(ke(),e);var f;(function(e){e.uriToFilePath=u.uriToFilePath,e.resolveGlobalNodePath=u.resolveGlobalNodePath,e.resolveGlobalYarnPath=u.resolveGlobalYarnPath,e.resolve=u.resolve,e.resolveModulePath=u.resolveModulePath})(f||(e.Files=f={}));let p=!1,m;function h(){let e=`--clientProcessId`;function t(e){try{let t=parseInt(e);isNaN(t)||(m=setInterval(()=>{try{process.kill(t,0)}catch{process.exit(+!p)}},3e3))}catch{}}for(let n=2;n<process.argv.length;n++){let r=process.argv[n];if(r===e&&n+1<process.argv.length){t(process.argv[n+1]);return}{let n=r.split(`=`);n[0]===e&&t(n[1])}}}h();let g={initialize:e=>{let t=e.processId;c.number(t)&&m===void 0&&setInterval(()=>{try{process.kill(t,0)}catch{process.exit(+!p)}},3e3)},get shutdownReceived(){return p},set shutdownReceived(e){p=e},exit:e=>{process.exit(e)}};e.createConnection=function(e,t,n,r){let i,a,o,s;return e!==void 0&&e.__brand===`features`&&(i=e,e=t,t=n,n=r),d.ConnectionStrategy.is(e)||d.ConnectionOptions.is(e)?s=e:(a=e,o=t,s=n),_(a,o,s,i)};function _(e,t,n,r){let i=!1;if(!e&&!t&&process.argv.length>2){let n,r,o=process.argv.slice(2);for(let s=0;s<o.length;s++){let c=o[s];if(c===`--node-ipc`){e=new d.IPCMessageReader(process),t=new d.IPCMessageWriter(process);break}if(c===`--stdio`){i=!0,e=process.stdin,t=process.stdout;break}if(c===`--socket`){n=parseInt(o[s+1]);break}if(c===`--pipe`){r=o[s+1];break}var a=c.split(`=`);if(a[0]===`--socket`){n=parseInt(a[1]);break}if(a[0]===`--pipe`){r=a[1];break}}if(n){let r=(0,d.createServerSocketTransport)(n);e=r[0],t=r[1]}else if(r){let n=(0,d.createServerPipeTransport)(r);e=n[0],t=n[1]}}var o=`Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'`;if(!e)throw Error(`Connection input stream is not set. `+o);if(!t)throw Error(`Connection output stream is not set. `+o);if(c.func(e.read)&&c.func(e.on)){let t=e;t.on(`end`,()=>{process.exit(+!p)}),t.on(`close`,()=>{process.exit(+!p)})}return(0,l.createConnection)(r=>{let a=(0,d.createProtocolConnection)(e,t,r,n);return i&&v(r),a},g,r)}function v(e){function t(e){return e.map(e=>typeof e==`string`?e:(0,s.inspect)(e)).join(` `)}let n=/* @__PURE__ */ new Map;console.assert=function(n,...r){if(!n){if(r.length===0)e.error(`Assertion failed`);else{let[n,...i]=r;e.error(`Assertion failed: ${n} ${t(i)}`)}}},console.count=function(t=`default`){let r=String(t),i=n.get(r)??0;i+=1,n.set(r,i),e.log(`${r}: ${r}`)},console.countReset=function(e){e===void 0?n.clear():n.delete(String(e))},console.debug=function(...n){e.log(t(n))},console.dir=function(t,n){e.log((0,s.inspect)(t,n))},console.log=function(...n){e.log(t(n))},console.error=function(...n){e.error(t(n))},console.trace=function(...n){let r=(/* @__PURE__ */ Error()).stack.replace(/(.+\n){2}/,``),i=`Trace`;n.length!==0&&(i+=`: ${t(n)}`),e.log(`${i}\n${r}`)},console.warn=function(...n){e.warn(t(n))}}})),je=(/* @__PURE__ */ r(((e,t)=>{t.exports=Ae()})))();const Me=1024;let Ne=0;var Pe=class{constructor(e,t){this.from=e,this.to=t}},K=class{constructor(e={}){this.id=Ne++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error(`This node type doesn't define a deserialize function`)}),this.combine=e.combine||null}add(e){if(this.perNode)throw RangeError(`Can't add per-node props to node types`);return typeof e!=`function`&&(e=q.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};K.closedBy=new K({deserialize:e=>e.split(` `)}),K.openedBy=new K({deserialize:e=>e.split(` `)}),K.group=new K({deserialize:e=>e.split(` `)}),K.isolate=new K({deserialize:e=>{if(e&&e!=`rtl`&&e!=`ltr`&&e!=`auto`)throw RangeError(`Invalid value for isolate: `+e);return e||`auto`}}),K.contextHash=new K({perNode:!0}),K.lookAhead=new K({perNode:!0}),K.mounted=new K({perNode:!0});var Fe=class{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[K.mounted.id]}};const Ie=Object.create(null);var q=class e{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):Ie,r=+!!t.top|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new e(t.name||``,n,t.id,r);if(t.props){for(let e of t.props)if(Array.isArray(e)||(e=e(i)),e){if(e[0].perNode)throw RangeError(`Can't store a per-node prop on a node type`);n[e[0].id]=e[1]}}return i}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(K.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(` `))t[r]=e[n];return e=>{for(let n=e.prop(K.group),r=-1;r<(n?n.length:0);r++){let i=t[r<0?e.name:n[r]];if(i)return i}}}};q.none=new q(``,Object.create(null),0,8);var Le=class e{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw RangeError(`Node type ids should correspond to array positions when creating a node set`)}extend(...t){let n=[];for(let e of this.types){let r=null;for(let n of t){let t=n(e);if(t){r||=Object.assign({},e.props);let n=t[1],i=t[0];i.combine&&i.id in r&&(n=i.combine(r[i.id],n)),r[i.id]=n}}n.push(r?new q(e.name,r,e.id,e.flags):e)}return new e(n)}};const Re=/* @__PURE__ */ new WeakMap,ze=/* @__PURE__ */ new WeakMap;var J;(function(e){e[e.ExcludeBuffers=1]=`ExcludeBuffers`,e[e.IncludeAnonymous=2]=`IncludeAnonymous`,e[e.IgnoreMounts=4]=`IgnoreMounts`,e[e.IgnoreOverlays=8]=`IgnoreOverlays`,e[e.EnterBracketed=16]=`EnterBracketed`})(J||={});var Be=class e{constructor(e,t,n,r,i){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,i&&i.length){this.props=Object.create(null);for(let[e,t]of i)this.props[typeof e==`number`?e:e.id]=t}}toString(){let e=Fe.get(this);if(e&&!e.overlay)return e.tree.toString();let t=``;for(let e of this.children){let n=e.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 et(this.topNode,e)}cursorAt(e,t=0,n=0){let r=new et(Re.get(this)||this.topNode);return r.moveTo(e,t),Re.set(this,r._tree),r}get topNode(){return new Ke(this,0,0,null)}resolve(e,t=0){let n=We(Re.get(this)||this.topNode,e,t,!1);return Re.set(this,n),n}resolveInner(e,t=0){let n=We(ze.get(this)||this.topNode,e,t,!0);return ze.set(this,n),n}resolveStack(e,t=0){return $e(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:i=this.length}=e,a=e.mode||0,o=(a&J.IncludeAnonymous)>0;for(let e=this.cursor(a|J.IncludeAnonymous);;){let a=!1;if(e.from<=i&&e.to>=r&&(!o&&e.type.isAnonymous||t(e)!==!1)){if(e.firstChild())continue;a=!0}for(;a&&n&&(o||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;a=!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(t={}){return this.children.length<=8?this:at(q.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new e(this.type,t,n,r,this.propValues),t.makeTree||((t,n,r)=>new e(q.none,t,n,r)))}static build(e){return nt(e)}};Be.empty=new Be(q.none,[],[],0);var Ve=class e{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 e(this.buffer,this.index)}},He=class e{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return q.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],n=this.buffer[e+3],r=this.set.types[t],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),e+=4,n==e)return i;let a=[];for(;e<n;)a.push(this.childString(e)),e=this.buffer[e+3];return i+`(`+a.join(`,`)+`)`}findChild(e,t,n,r,i){let{buffer:a}=this,o=-1;for(let s=e;s!=t&&!(Ue(i,r,a[s+1],a[s+2])&&(o=s,n>0));s=a[s+3]);return o}slice(t,n,r){let i=this.buffer,a=new Uint16Array(n-t),o=0;for(let e=t,s=0;e<n;){a[s++]=i[e++],a[s++]=i[e++]-r;let n=a[s++]=i[e++]-r;a[s++]=i[e++]-t,o=Math.max(o,n)}return new e(a,o,this.set)}};function Ue(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function We(e,t,n,r){for(;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!r&&e instanceof Ke&&e.index<0?null:e.parent;if(!t)return e;e=t}let i=r?0:J.IgnoreOverlays;if(r)for(let r=e,a=r.parent;a;r=a,a=r.parent)r instanceof Ke&&r.index<0&&a.enter(t,n,i)?.from!=r.from&&(e=a);for(;;){let r=e.enter(t,n,i);if(!r)return e;e=r}}var Ge=class{cursor(e=0){return new et(this,e)}getChild(e,t=null,n=null){let r=qe(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return qe(this,e,t,n)}resolve(e,t=0){return We(this,e,t,!1)}resolveInner(e,t=0){return We(this,e,t,!0)}matchContext(e){return Je(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}},Ke=class e extends Ge{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,n,r,i,a=0){for(let o=this;;){for(let{children:s,positions:c}=o._tree,l=n>0?s.length:-1;t!=l;t+=n){let l=s[t],u=c[t]+o.from;if(a&J.EnterBracketed&&l instanceof Be&&Fe.get(l)?.overlay===null&&(u>=r||u+l.length<=r)||Ue(i,r,u,u+l.length)){if(l instanceof He){if(a&J.ExcludeBuffers)continue;let e=l.findChild(0,l.buffer.length,n,r-u,i);if(e>-1)return new Xe(new Ye(o,l,t,u),null,e)}else if(a&J.IncludeAnonymous||!l.type.isAnonymous||tt(l)){let s;if(!(a&J.IgnoreMounts)&&(s=Fe.get(l))&&!s.overlay)return new e(s.tree,u,t,o);let c=new e(l,u,t,o);return a&J.IncludeAnonymous||!c.type.isAnonymous?c:c.nextChild(n<0?l.children.length-1:0,n,r,i,a)}}}if(a&J.IncludeAnonymous||!o.type.isAnonymous||(t=o.index>=0?o.index+n:n<0?-1:o._parent._tree.children.length,o=o._parent,!o))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(t,n,r=0){let i;if(!(r&J.IgnoreOverlays)&&(i=Fe.get(this._tree))&&i.overlay){let a=t-this.from,o=r&J.EnterBracketed&&i.bracketed;for(let{from:t,to:r}of i.overlay)if((n>0||o?t<=a:t<a)&&(n<0||o?r>=a:r>a))return new e(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,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 qe(e,t,n,r){let i=e.cursor(),a=[];if(!i.firstChild())return a;if(n!=null){for(let e=!1;!e;)if(e=i.type.is(n),!i.nextSibling())return a}for(;;){if(r!=null&&i.type.is(r))return a;if(i.type.is(t)&&a.push(i.node),!i.nextSibling())return r==null?a:[]}}function Je(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}var Ye=class{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}},Xe=class e extends Ge{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,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(t,n,r){let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return a<0?null:new e(this.context,this,a)}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(t,n,r=0){if(r&J.ExcludeBuffers)return null;let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return a<0?null:new e(this.context,this,a)}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:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new e(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new e(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,i=n.buffer[this.index+3];if(i>r){let a=n.buffer[this.index+1];e.push(n.slice(r,i,a)),t.push(0)}return new Be(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function Ze(e){if(!e.length)return null;let t=0,n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(i.from>n.from||i.to<n.to)&&(n=i,t=r)}let r=n instanceof Ke&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new Qe(i,n)}var Qe=class{constructor(e,t){this.heads=e,this.node=t}get next(){return Ze(this.heads)}};function $e(e,t,n){let r=e.resolveInner(t,n),i=null;for(let e=r instanceof Ke?r:r.context.parent;e;e=e.parent)if(e.index<0){let a=e.parent;(i||=[r]).push(a.resolve(t,n)),e=a}else{let a=Fe.get(e.tree);if(a&&a.overlay&&a.overlay[0].from<=t&&a.overlay[a.overlay.length-1].to>=t){let o=new Ke(a.tree,a.overlay[0].from+e.from,-1,e);(i||=[r]).push(We(o,t,n,!1))}}return i?Ze(i):r}var et=class{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&~J.EnterBracketed,e instanceof Ke)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.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:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof Ke?(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,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}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,n=this.mode){return this.buffer?n&J.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&J.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&J.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,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(r.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=r)}else({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let r=t+e,i=e<0?-1:n._tree.children.length;r!=i;r+=e){let e=n._tree.children[r];if(this.mode&J.IncludeAnonymous||e instanceof He||!e.type.isAnonymous||tt(e))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,n=0;if(e&&e.context==this.buffer)e:for(let r=this.index,i=this.stack.length;i>=0;){for(let a=e;a;a=a._parent)if(a.index==r){if(r==this.index)return a;t=a,n=i+1;break e}r=this.stack[--i]}for(let e=n;e<this.stack.length;e++)t=new Xe(this.buffer,t,this.stack[e]);return this.bufferNode=new Xe(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return Je(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,i=this.stack.length-1;r>=0;i--){if(i<0)return Je(this._tree,e,r);let a=n[t.buffer[this.stack[i]]];if(!a.isAnonymous){if(e[r]&&e[r]!=a.name)return!1;r--}}return!0}};function tt(e){return e.children.some(e=>e instanceof He||!e.type.isAnonymous||tt(e))}function nt(e){let{buffer:t,nodeSet:n,maxBufferLength:r=Me,reused:i=[],minRepeatType:a=n.types.length}=e,o=Array.isArray(t)?new Ve(t,t.length):t,s=n.types,c=0,l=0;function u(e,t,_,v,y,b){let{id:x,start:S,end:C,size:w}=o,T=l,E=c;if(w<0){if(o.next(),w==-1){let t=i[x];_.push(t),v.push(S-e);return}if(w==-3){c=x;return}if(w==-4){l=x;return}throw RangeError(`Unrecognized record size: ${w}`)}let D=s[x],O,k,ee=S-e;if(C-S<=r&&(k=h(o.pos-t,y))){let t=new Uint16Array(k.size-k.skip),r=o.pos-k.size,i=t.length;for(;o.pos>r;)i=g(k.start,t,i);O=new He(t,C-k.start,n),ee=k.start-e}else{let e=o.pos-w;o.next();let t=[],n=[],i=x>=a?x:-1,s=0,c=C;for(;o.pos>e;)i>=0&&o.id==i&&o.size>=0?(o.end<=c-r&&(p(t,n,S,s,o.end,c,i,T,E),s=t.length,c=o.end),o.next()):b>2500?d(S,e,t,n):u(S,e,t,n,i,b+1);if(i>=0&&s>0&&s<t.length&&p(t,n,S,s,S,c,i,T,E),t.reverse(),n.reverse(),i>-1&&s>0){let e=f(D,E);O=at(D,t,n,0,t.length,0,C-S,e,e)}else O=m(D,t,n,C-S,T-C,E)}_.push(O),v.push(ee)}function d(e,t,i,a){let s=[],c=0,l=-1;for(;o.pos>t;){let{id:e,start:t,end:n,size:i}=o;if(i>4)o.next();else if(l>-1&&t<l)break;else l<0&&(l=n-r),s.push(e,t,n),c++,o.next()}if(c){let t=new Uint16Array(c*4),r=s[s.length-2];for(let e=s.length-3,n=0;e>=0;e-=3)t[n++]=s[e],t[n++]=s[e+1]-r,t[n++]=s[e+2]-r,t[n++]=n;i.push(new He(t,s[2]-r,n)),a.push(r-e)}}function f(e,t){return(n,r,i)=>{let a=0,o=n.length-1,s,c;if(o>=0&&(s=n[o])instanceof Be){if(!o&&s.type==e&&s.length==i)return s;(c=s.prop(K.lookAhead))&&(a=r[o]+s.length+c)}return m(e,n,r,i,a,t)}}function p(e,t,r,i,a,o,s,c,l){let u=[],d=[];for(;e.length>i;)u.push(e.pop()),d.push(t.pop()+r-a);e.push(m(n.types[s],u,d,o-a,c-o,l)),t.push(a-r)}function m(e,t,n,r,i,a,o){if(a){let e=[K.contextHash,a];o=o?[e].concat(o):[e]}if(i>25){let e=[K.lookAhead,i];o=o?[e].concat(o):[e]}return new Be(e,t,n,r,o)}function h(e,t){let n=o.fork(),i=0,s=0,c=0,l=n.end-r,u={size:0,start:0,skip:0};e:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){u.size=i,u.start=s,u.skip=c,c+=4,i+=4,n.next();continue}let o=n.pos-e;if(e<0||o<r||n.start<l)break;let d=n.id>=a?4:0,f=n.start;for(n.next();n.pos>o;){if(n.size<0){if(n.size==-3||n.size==-4)d+=4;else break e}else n.id>=a&&(d+=4);n.next()}s=f,i+=e,c+=d}return(t<0||i==e)&&(u.size=i,u.start=s,u.skip=c),u.size>4?u:void 0}function g(e,t,n){let{id:r,start:i,end:s,size:u}=o;if(o.next(),u>=0&&r<a){let a=n;if(u>4){let r=o.pos-(u-4);for(;o.pos>r;)n=g(e,t,n)}t[--n]=a,t[--n]=s-e,t[--n]=i-e,t[--n]=r}else u==-3?c=r:u==-4&&(l=r);return n}let _=[],v=[];for(;o.pos>0;)u(e.start||0,e.bufferStart||0,_,v,-1,0);let y=e.length??(_.length?v[0]+_[0].length:0);return new Be(s[e.topID],_.reverse(),v.reverse(),y)}const rt=/* @__PURE__ */ new WeakMap;function it(e,t){if(!e.isAnonymous||t instanceof He||t.type!=e)return 1;let n=rt.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof Be)){n=1;break}n+=it(e,r)}rt.set(t,n)}return n}function at(e,t,n,r,i,a,o,s,c){let l=0;for(let n=r;n<i;n++)l+=it(e,t[n]);let u=Math.ceil(l*1.5/8),d=[],f=[];function p(t,n,r,i,o){for(let s=r;s<i;){let r=s,l=n[s],m=it(e,t[s]);for(s++;s<i;s++){let n=it(e,t[s]);if(m+n>=u)break;m+=n}if(s==r+1){if(m>u){let e=t[r];p(e.children,e.positions,0,e.children.length,n[r]+o);continue}d.push(t[r])}else{let i=n[s-1]+t[s-1].length-l;d.push(at(e,t,n,r,s,l,i,null,c))}f.push(l+o-a)}}return p(t,n,r,i,0),(s||c)(d,f,o)}var ot=class e{constructor(e,t,n,r,i=!1,a=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=!!i|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],r=!1){let i=[new e(0,t.length,t,0,!1,r)];for(let e of n)e.to>t.length&&i.push(e);return i}static applyChanges(t,n,r=128){if(!n.length)return t;let i=[],a=1,o=t.length?t[0]:null;for(let s=0,c=0,l=0;;s++){let u=s<n.length?n[s]:null,d=u?u.fromA:1e9;if(d-c>=r)for(;o&&o.from<d;){let n=o;if(c>=n.from||d<=n.to||l){let t=Math.max(n.from,c)-l,r=Math.min(n.to,d)-l;n=t>=r?null:new e(t,r,n.tree,n.offset+l,s>0,!!u)}if(n&&i.push(n),o.to>d)break;o=a<t.length?t[a++]:null}if(!u)break;c=u.toA,l=u.toA-u.toB}return i}},st=class{startParse(e,t,n){return typeof e==`string`&&(e=new ct(e)),n=n?n.length?n.map(e=>new Pe(e.from,e.to)):[new Pe(0,0)]:[new Pe(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}},ct=class{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)}};new K({perNode:!0});var lt=class e{constructor(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(t,n){for(let n of t)if(e.isIncremental(n)){let e=mt(n.range),t=this.offsetAt(e.start),r=this.offsetAt(e.end);this._content=this._content.substring(0,t)+n.text+this._content.substring(r,this._content.length);let i=Math.max(e.start.line,0),a=Math.max(e.end.line,0),o=this._lineOffsets,s=ft(n.text,!1,t);if(a-i===s.length)for(let e=0,t=s.length;e<t;e++)o[e+i+1]=s[e];else s.length<1e4?o.splice(i+1,a-i,...s):this._lineOffsets=o=o.slice(0,i+1).concat(s,o.slice(a+1));let c=n.text.length-(r-t);if(c!==0)for(let e=i+1+s.length,t=o.length;e<t;e++)o[e]=o[e]+c}else if(e.isFull(n))this._content=n.text,this._lineOffsets=void 0;else throw Error(`Unknown change event received`);this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=ft(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),n=0,r=t.length;if(r===0)return{line:0,character:e};for(;n<r;){let i=Math.floor((n+r)/2);t[i]>e?r=i:n=i+1}let i=n-1;return e=this.ensureBeforeEOL(e,t[i]),{line:i,character:e-t[i]}}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let n=t[e.line];if(e.character<=0)return n;let r=e.line+1<t.length?t[e.line+1]:this._content.length,i=Math.min(n+e.character,r);return this.ensureBeforeEOL(i,n)}ensureBeforeEOL(e,t){for(;e>t&&pt(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let t=e;return t!=null&&typeof t.text==`string`&&t.range!==void 0&&(t.rangeLength===void 0||typeof t.rangeLength==`number`)}static isFull(e){let t=e;return t!=null&&typeof t.text==`string`&&t.range===void 0&&t.rangeLength===void 0}},ut;(function(e){e.create=function(e,t,n,r){return new lt(e,t,n,r)},e.update=function(e,t,n){if(e instanceof lt)return e.update(t,n),e;throw Error(`TextDocument.update: document must be created by TextDocument.create`)},e.applyEdits=function(e,t){let n=e.getText(),r=dt(t.map(ht),(e,t)=>{let n=e.range.start.line-t.range.start.line;return n===0?e.range.start.character-t.range.start.character:n}),i=0,a=[];for(let t of r){let r=e.offsetAt(t.range.start);if(r<i)throw Error(`Overlapping edit`);r>i&&a.push(n.substring(i,r)),t.newText.length&&a.push(t.newText),i=e.offsetAt(t.range.end)}return a.push(n.substr(i)),a.join(``)}})(ut||={});function dt(e,t){if(e.length<=1)return e;let n=e.length/2|0,r=e.slice(0,n),i=e.slice(n);dt(r,t),dt(i,t);let a=0,o=0,s=0;for(;a<r.length&&o<i.length;)t(r[a],i[o])<=0?e[s++]=r[a++]:e[s++]=i[o++];for(;a<r.length;)e[s++]=r[a++];for(;o<i.length;)e[s++]=i[o++];return e}function ft(e,t,n=0){let r=t?[n]:[];for(let t=0;t<e.length;t++){let i=e.charCodeAt(t);pt(i)&&(i===13&&t+1<e.length&&e.charCodeAt(t+1)===10&&t++,r.push(n+t+1))}return r}function pt(e){return e===13||e===10}function mt(e){let t=e.start,n=e.end;return t.line>n.line||t.line===n.line&&t.character>n.character?{start:n,end:t}:e}function ht(e){let t=mt(e.range);return t===e.range?e:{newText:e.newText,range:t}}var gt;(function(e){e.is=function(e){return typeof e==`string`}})(gt||={});var _t;(function(e){e.is=function(e){return typeof e==`string`}})(_t||={});var vt;(function(e){e.MIN_VALUE=-0x80000000,e.MAX_VALUE=0x7fffffff,e.is=function(t){return typeof t==`number`&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}})(vt||={});var yt;(function(e){e.MIN_VALUE=0,e.MAX_VALUE=0x7fffffff,e.is=function(t){return typeof t==`number`&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}})(yt||={});var bt;(function(e){e.create=function(e,t){return e===Number.MAX_VALUE&&(e=yt.MAX_VALUE),t===Number.MAX_VALUE&&(t=yt.MAX_VALUE),{line:e,character:t}},e.is=function(e){let t=e;return X.objectLiteral(t)&&X.uinteger(t.line)&&X.uinteger(t.character)}})(bt||={});var Y;(function(e){e.create=function(e,t,n,r){if(X.uinteger(e)&&X.uinteger(t)&&X.uinteger(n)&&X.uinteger(r))return{start:bt.create(e,t),end:bt.create(n,r)};if(bt.is(e)&&bt.is(t))return{start:e,end:t};throw Error(`Range#create called with invalid arguments[${e}, ${t}, ${n}, ${r}]`)},e.is=function(e){let t=e;return X.objectLiteral(t)&&bt.is(t.start)&&bt.is(t.end)}})(Y||={});var xt;(function(e){e.create=function(e,t){return{uri:e,range:t}},e.is=function(e){let t=e;return X.objectLiteral(t)&&Y.is(t.range)&&(X.string(t.uri)||X.undefined(t.uri))}})(xt||={});var St;(function(e){e.create=function(e,t,n,r){return{targetUri:e,targetRange:t,targetSelectionRange:n,originSelectionRange:r}},e.is=function(e){let t=e;return X.objectLiteral(t)&&Y.is(t.targetRange)&&X.string(t.targetUri)&&Y.is(t.targetSelectionRange)&&(Y.is(t.originSelectionRange)||X.undefined(t.originSelectionRange))}})(St||={});var Ct;(function(e){e.create=function(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}},e.is=function(e){let t=e;return X.objectLiteral(t)&&X.numberRange(t.red,0,1)&&X.numberRange(t.green,0,1)&&X.numberRange(t.blue,0,1)&&X.numberRange(t.alpha,0,1)}})(Ct||={});var wt;(function(e){e.create=function(e,t){return{range:e,color:t}},e.is=function(e){let t=e;return X.objectLiteral(t)&&Y.is(t.range)&&Ct.is(t.color)}})(wt||={});var Tt;(function(e){e.create=function(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}},e.is=function(e){let t=e;return X.objectLiteral(t)&&X.string(t.label)&&(X.undefined(t.textEdit)||Pt.is(t))&&(X.undefined(t.additionalTextEdits)||X.typedArray(t.additionalTextEdits,Pt.is))}})(Tt||={});var Et;(function(e){e.Comment=`comment`,e.Imports=`imports`,e.Region=`region`})(Et||={});var Dt;(function(e){e.create=function(e,t,n,r,i,a){let o={startLine:e,endLine:t};return X.defined(n)&&(o.startCharacter=n),X.defined(r)&&(o.endCharacter=r),X.defined(i)&&(o.kind=i),X.defined(a)&&(o.collapsedText=a),o},e.is=function(e){let t=e;return X.objectLiteral(t)&&X.uinteger(t.startLine)&&X.uinteger(t.startLine)&&(X.undefined(t.startCharacter)||X.uinteger(t.startCharacter))&&(X.undefined(t.endCharacter)||X.uinteger(t.endCharacter))&&(X.undefined(t.kind)||X.string(t.kind))}})(Dt||={});var Ot;(function(e){e.create=function(e,t){return{location:e,message:t}},e.is=function(e){let t=e;return X.defined(t)&&xt.is(t.location)&&X.string(t.message)}})(Ot||={});var kt;(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(kt||={});var At;(function(e){e.Unnecessary=1,e.Deprecated=2})(At||={});var jt;(function(e){e.is=function(e){let t=e;return X.objectLiteral(t)&&X.string(t.href)}})(jt||={});var Mt;(function(e){e.create=function(e,t,n,r,i,a){let o={range:e,message:t};return X.defined(n)&&(o.severity=n),X.defined(r)&&(o.code=r),X.defined(i)&&(o.source=i),X.defined(a)&&(o.relatedInformation=a),o},e.is=function(e){let t=e;return X.defined(t)&&Y.is(t.range)&&X.string(t.message)&&(X.number(t.severity)||X.undefined(t.severity))&&(X.integer(t.code)||X.string(t.code)||X.undefined(t.code))&&(X.undefined(t.codeDescription)||X.string(t.codeDescription?.href))&&(X.string(t.source)||X.undefined(t.source))&&(X.undefined(t.relatedInformation)||X.typedArray(t.relatedInformation,Ot.is))}})(Mt||={});var Nt;(function(e){e.create=function(e,t,...n){let r={title:e,command:t};return X.defined(n)&&n.length>0&&(r.arguments=n),r},e.is=function(e){let t=e;return X.defined(t)&&X.string(t.title)&&X.string(t.command)}})(Nt||={});var Pt;(function(e){e.replace=function(e,t){return{range:e,newText:t}},e.insert=function(e,t){return{range:{start:e,end:e},newText:t}},e.del=function(e){return{range:e,newText:``}},e.is=function(e){let t=e;return X.objectLiteral(t)&&X.string(t.newText)&&Y.is(t.range)}})(Pt||={});var Ft;(function(e){e.create=function(e,t,n){let r={label:e};return t!==void 0&&(r.needsConfirmation=t),n!==void 0&&(r.description=n),r},e.is=function(e){let t=e;return X.objectLiteral(t)&&X.string(t.label)&&(X.boolean(t.needsConfirmation)||t.needsConfirmation===void 0)&&(X.string(t.description)||t.description===void 0)}})(Ft||={});var It;(function(e){e.is=function(e){let t=e;return X.string(t)}})(It||={});var Lt;(function(e){e.replace=function(e,t,n){return{range:e,newText:t,annotationId:n}},e.insert=function(e,t,n){return{range:{start:e,end:e},newText:t,annotationId:n}},e.del=function(e,t){return{range:e,newText:``,annotationId:t}},e.is=function(e){let t=e;return Pt.is(t)&&(Ft.is(t.annotationId)||It.is(t.annotationId))}})(Lt||={});var Rt;(function(e){e.create=function(e,t){return{textDocument:e,edits:t}},e.is=function(e){let t=e;return X.defined(t)&&Gt.is(t.textDocument)&&Array.isArray(t.edits)}})(Rt||={});var zt;(function(e){e.create=function(e,t,n){let r={kind:`create`,uri:e};return t!==void 0&&(t.overwrite!==void 0||t.ignoreIfExists!==void 0)&&(r.options=t),n!==void 0&&(r.annotationId=n),r},e.is=function(e){let t=e;return t&&t.kind===`create`&&X.string(t.uri)&&(t.options===void 0||(t.options.overwrite===void 0||X.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||X.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||It.is(t.annotationId))}})(zt||={});var Bt;(function(e){e.create=function(e,t,n,r){let i={kind:`rename`,oldUri:e,newUri:t};return n!==void 0&&(n.overwrite!==void 0||n.ignoreIfExists!==void 0)&&(i.options=n),r!==void 0&&(i.annotationId=r),i},e.is=function(e){let t=e;return t&&t.kind===`rename`&&X.string(t.oldUri)&&X.string(t.newUri)&&(t.options===void 0||(t.options.overwrite===void 0||X.boolean(t.options.overwrite))&&(t.options.ignoreIfExists===void 0||X.boolean(t.options.ignoreIfExists)))&&(t.annotationId===void 0||It.is(t.annotationId))}})(Bt||={});var Vt;(function(e){e.create=function(e,t,n){let r={kind:`delete`,uri:e};return t!==void 0&&(t.recursive!==void 0||t.ignoreIfNotExists!==void 0)&&(r.options=t),n!==void 0&&(r.annotationId=n),r},e.is=function(e){let t=e;return t&&t.kind===`delete`&&X.string(t.uri)&&(t.options===void 0||(t.options.recursive===void 0||X.boolean(t.options.recursive))&&(t.options.ignoreIfNotExists===void 0||X.boolean(t.options.ignoreIfNotExists)))&&(t.annotationId===void 0||It.is(t.annotationId))}})(Vt||={});var Ht;(function(e){e.is=function(e){let t=e;return t&&(t.changes!==void 0||t.documentChanges!==void 0)&&(t.documentChanges===void 0||t.documentChanges.every(e=>X.string(e.kind)?zt.is(e)||Bt.is(e)||Vt.is(e):Rt.is(e)))}})(Ht||={});var Ut;(function(e){e.create=function(e){return{uri:e}},e.is=function(e){let t=e;return X.defined(t)&&X.string(t.uri)}})(Ut||={});var Wt;(function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){let t=e;return X.defined(t)&&X.string(t.uri)&&X.integer(t.version)}})(Wt||={});var Gt;(function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){let t=e;return X.defined(t)&&X.string(t.uri)&&(t.version===null||X.integer(t.version))}})(Gt||={});var Kt;(function(e){e.create=function(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}},e.is=function(e){let t=e;return X.defined(t)&&X.string(t.uri)&&X.string(t.languageId)&&X.integer(t.version)&&X.string(t.text)}})(Kt||={});var qt;(function(e){e.PlainText=`plaintext`,e.Markdown=`markdown`,e.is=function(t){let n=t;return n===e.PlainText||n===e.Markdown}})(qt||={});var Jt;(function(e){e.is=function(e){let t=e;return X.objectLiteral(e)&&qt.is(t.kind)&&X.string(t.value)}})(Jt||={});var Yt;(function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25})(Yt||={});var Xt;(function(e){e.PlainText=1,e.Snippet=2})(Xt||={});var Zt;(function(e){e.Deprecated=1})(Zt||={});var Qt;(function(e){e.create=function(e,t,n){return{newText:e,insert:t,replace:n}},e.is=function(e){let t=e;return t&&X.string(t.newText)&&Y.is(t.insert)&&Y.is(t.replace)}})(Qt||={});var $t;(function(e){e.asIs=1,e.adjustIndentation=2})($t||={});var en;(function(e){e.is=function(e){let t=e;return t&&(X.string(t.detail)||t.detail===void 0)&&(X.string(t.description)||t.description===void 0)}})(en||={});var tn;(function(e){e.create=function(e){return{label:e}}})(tn||={});var nn;(function(e){e.create=function(e,t){return{items:e||[],isIncomplete:!!t}}})(nn||={});var rn;(function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,`\\$&`)},e.is=function(e){let t=e;return X.string(t)||X.objectLiteral(t)&&X.string(t.language)&&X.string(t.value)}})(rn||={});var an;(function(e){e.is=function(e){let t=e;return!!t&&X.objectLiteral(t)&&(Jt.is(t.contents)||rn.is(t.contents)||X.typedArray(t.contents,rn.is))&&(e.range===void 0||Y.is(e.range))}})(an||={});var on;(function(e){e.create=function(e,t){return t?{label:e,documentation:t}:{label:e}}})(on||={});var sn;(function(e){e.create=function(e,t,...n){let r={label:e};return X.defined(t)&&(r.documentation=t),r.parameters=X.defined(n)?n:[],r}})(sn||={});var cn;(function(e){e.Text=1,e.Read=2,e.Write=3})(cn||={});var ln;(function(e){e.create=function(e,t){let n={range:e};return X.number(t)&&(n.kind=t),n}})(ln||={});var un;(function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26})(un||={});var dn;(function(e){e.Deprecated=1})(dn||={});var fn;(function(e){e.create=function(e,t,n,r,i){let a={name:e,kind:t,location:{uri:r,range:n}};return i&&(a.containerName=i),a}})(fn||={});var pn;(function(e){e.create=function(e,t,n,r){return r===void 0?{name:e,kind:t,location:{uri:n}}:{name:e,kind:t,location:{uri:n,range:r}}}})(pn||={});var mn;(function(e){e.create=function(e,t,n,r,i,a){let o={name:e,detail:t,kind:n,range:r,selectionRange:i};return a!==void 0&&(o.children=a),o},e.is=function(e){let t=e;return t&&X.string(t.name)&&X.number(t.kind)&&Y.is(t.range)&&Y.is(t.selectionRange)&&(t.detail===void 0||X.string(t.detail))&&(t.deprecated===void 0||X.boolean(t.deprecated))&&(t.children===void 0||Array.isArray(t.children))&&(t.tags===void 0||Array.isArray(t.tags))}})(mn||={});var hn;(function(e){e.Empty=``,e.QuickFix=`quickfix`,e.Refactor=`refactor`,e.RefactorExtract=`refactor.extract`,e.RefactorInline=`refactor.inline`,e.RefactorRewrite=`refactor.rewrite`,e.Source=`source`,e.SourceOrganizeImports=`source.organizeImports`,e.SourceFixAll=`source.fixAll`})(hn||={});var gn;(function(e){e.Invoked=1,e.Automatic=2})(gn||={});var _n;(function(e){e.create=function(e,t,n){let r={diagnostics:e};return t!=null&&(r.only=t),n!=null&&(r.triggerKind=n),r},e.is=function(e){let t=e;return X.defined(t)&&X.typedArray(t.diagnostics,Mt.is)&&(t.only===void 0||X.typedArray(t.only,X.string))&&(t.triggerKind===void 0||t.triggerKind===gn.Invoked||t.triggerKind===gn.Automatic)}})(_n||={});var vn;(function(e){e.create=function(e,t,n){let r={title:e},i=!0;return typeof t==`string`?(i=!1,r.kind=t):Nt.is(t)?r.command=t:r.edit=t,i&&n!==void 0&&(r.kind=n),r},e.is=function(e){let t=e;return t&&X.string(t.title)&&(t.diagnostics===void 0||X.typedArray(t.diagnostics,Mt.is))&&(t.kind===void 0||X.string(t.kind))&&(t.edit!==void 0||t.command!==void 0)&&(t.command===void 0||Nt.is(t.command))&&(t.isPreferred===void 0||X.boolean(t.isPreferred))&&(t.edit===void 0||Ht.is(t.edit))}})(vn||={});var yn;(function(e){e.create=function(e,t){let n={range:e};return X.defined(t)&&(n.data=t),n},e.is=function(e){let t=e;return X.defined(t)&&Y.is(t.range)&&(X.undefined(t.command)||Nt.is(t.command))}})(yn||={});var bn;(function(e){e.create=function(e,t){return{tabSize:e,insertSpaces:t}},e.is=function(e){let t=e;return X.defined(t)&&X.uinteger(t.tabSize)&&X.boolean(t.insertSpaces)}})(bn||={});var xn;(function(e){e.create=function(e,t,n){return{range:e,target:t,data:n}},e.is=function(e){let t=e;return X.defined(t)&&Y.is(t.range)&&(X.undefined(t.target)||X.string(t.target))}})(xn||={});var Sn;(function(e){e.create=function(e,t){return{range:e,parent:t}},e.is=function(t){let n=t;return X.objectLiteral(n)&&Y.is(n.range)&&(n.parent===void 0||e.is(n.parent))}})(Sn||={});var Cn;(function(e){e.namespace=`namespace`,e.type=`type`,e.class=`class`,e.enum=`enum`,e.interface=`interface`,e.struct=`struct`,e.typeParameter=`typeParameter`,e.parameter=`parameter`,e.variable=`variable`,e.property=`property`,e.enumMember=`enumMember`,e.event=`event`,e.function=`function`,e.method=`method`,e.macro=`macro`,e.keyword=`keyword`,e.modifier=`modifier`,e.comment=`comment`,e.string=`string`,e.number=`number`,e.regexp=`regexp`,e.operator=`operator`,e.decorator=`decorator`})(Cn||={});var wn;(function(e){e.declaration=`declaration`,e.definition=`definition`,e.readonly=`readonly`,e.static=`static`,e.deprecated=`deprecated`,e.abstract=`abstract`,e.async=`async`,e.modification=`modification`,e.documentation=`documentation`,e.defaultLibrary=`defaultLibrary`})(wn||={});var Tn;(function(e){e.is=function(e){let t=e;return X.objectLiteral(t)&&(t.resultId===void 0||typeof t.resultId==`string`)&&Array.isArray(t.data)&&(t.data.length===0||typeof t.data[0]==`number`)}})(Tn||={});var En;(function(e){e.create=function(e,t){return{range:e,text:t}},e.is=function(e){let t=e;return t!=null&&Y.is(t.range)&&X.string(t.text)}})(En||={});var Dn;(function(e){e.create=function(e,t,n){return{range:e,variableName:t,caseSensitiveLookup:n}},e.is=function(e){let t=e;return t!=null&&Y.is(t.range)&&X.boolean(t.caseSensitiveLookup)&&(X.string(t.variableName)||t.variableName===void 0)}})(Dn||={});var On;(function(e){e.create=function(e,t){return{range:e,expression:t}},e.is=function(e){let t=e;return t!=null&&Y.is(t.range)&&(X.string(t.expression)||t.expression===void 0)}})(On||={});var kn;(function(e){e.create=function(e,t){return{frameId:e,stoppedLocation:t}},e.is=function(e){let t=e;return X.defined(t)&&Y.is(e.stoppedLocation)}})(kn||={});var An;(function(e){e.Type=1,e.Parameter=2,e.is=function(e){return e===1||e===2}})(An||={});var jn;(function(e){e.create=function(e){return{value:e}},e.is=function(e){let t=e;return X.objectLiteral(t)&&(t.tooltip===void 0||X.string(t.tooltip)||Jt.is(t.tooltip))&&(t.location===void 0||xt.is(t.location))&&(t.command===void 0||Nt.is(t.command))}})(jn||={});var Mn;(function(e){e.create=function(e,t,n){let r={position:e,label:t};return n!==void 0&&(r.kind=n),r},e.is=function(e){let t=e;return X.objectLiteral(t)&&bt.is(t.position)&&(X.string(t.label)||X.typedArray(t.label,jn.is))&&(t.kind===void 0||An.is(t.kind))&&t.textEdits===void 0||X.typedArray(t.textEdits,Pt.is)&&(t.tooltip===void 0||X.string(t.tooltip)||Jt.is(t.tooltip))&&(t.paddingLeft===void 0||X.boolean(t.paddingLeft))&&(t.paddingRight===void 0||X.boolean(t.paddingRight))}})(Mn||={});var Nn;(function(e){e.createSnippet=function(e){return{kind:`snippet`,value:e}}})(Nn||={});var Pn;(function(e){e.create=function(e,t,n,r){return{insertText:e,filterText:t,range:n,command:r}}})(Pn||={});var Fn;(function(e){e.create=function(e){return{items:e}}})(Fn||={});var In;(function(e){e.Invoked=0,e.Automatic=1})(In||={});var Ln;(function(e){e.create=function(e,t){return{range:e,text:t}}})(Ln||={});var Rn;(function(e){e.create=function(e,t){return{triggerKind:e,selectedCompletionInfo:t}}})(Rn||={});var zn;(function(e){e.is=function(e){let t=e;return X.objectLiteral(t)&&_t.is(t.uri)&&X.string(t.name)}})(zn||={});var Bn;(function(e){e.create=function(e,t,n,r){return new Vn(e,t,n,r)},e.is=function(e){let t=e;return!!(X.defined(t)&&X.string(t.uri)&&(X.undefined(t.languageId)||X.string(t.languageId))&&X.uinteger(t.lineCount)&&X.func(t.getText)&&X.func(t.positionAt)&&X.func(t.offsetAt))},e.applyEdits=function(e,n){let r=e.getText(),i=t(n,(e,t)=>{let n=e.range.start.line-t.range.start.line;return n===0?e.range.start.character-t.range.start.character:n}),a=r.length;for(let t=i.length-1;t>=0;t--){let n=i[t],o=e.offsetAt(n.range.start),s=e.offsetAt(n.range.end);if(s<=a)r=r.substring(0,o)+n.newText+r.substring(s,r.length);else throw Error(`Overlapping edit`);a=o}return r};function t(e,n){if(e.length<=1)return e;let r=e.length/2|0,i=e.slice(0,r),a=e.slice(r);t(i,n),t(a,n);let o=0,s=0,c=0;for(;o<i.length&&s<a.length;)n(i[o],a[s])<=0?e[c++]=i[o++]:e[c++]=a[s++];for(;o<i.length;)e[c++]=i[o++];for(;s<a.length;)e[c++]=a[s++];return e}})(Bn||={});var Vn=class{constructor(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],t=this._content,n=!0;for(let r=0;r<t.length;r++){n&&=(e.push(r),!1);let i=t.charAt(r);n=i===`\r`||i===`
|
|
17
|
+
`,i===`\r`&&r+1<t.length&&t.charAt(r+1)===`
|
|
18
|
+
`&&r++}n&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),n=0,r=t.length;if(r===0)return bt.create(0,e);for(;n<r;){let i=Math.floor((n+r)/2);t[i]>e?r=i:n=i+1}let i=n-1;return bt.create(i,e-t[i])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let n=t[e.line],r=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,r),n)}get lineCount(){return this.getLineOffsets().length}},X;(function(e){let t=Object.prototype.toString;e.defined=function(e){return e!==void 0},e.undefined=function(e){return e===void 0},e.boolean=function(e){return e===!0||e===!1},e.string=function(e){return t.call(e)===`[object String]`},e.number=function(e){return t.call(e)===`[object Number]`},e.numberRange=function(e,n,r){return t.call(e)===`[object Number]`&&n<=e&&e<=r},e.integer=function(e){return t.call(e)===`[object Number]`&&-0x80000000<=e&&e<=0x7fffffff},e.uinteger=function(e){return t.call(e)===`[object Number]`&&0<=e&&e<=0x7fffffff},e.func=function(e){return t.call(e)===`[object Function]`},e.objectLiteral=function(e){return typeof e==`object`&&!!e},e.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)}})(X||={});var Hn=class e{constructor(e,t,n,r,i,a,o,s,c,l=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=a,this.buffer=o,this.bufferBase=s,this.curContext=c,this.lookAhead=l,this.parent=u}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?`!`+this.score:``}`}static start(t,n,r=0){let i=t.parser.context;return new e(t,[],n,r,r,0,[],0,i?new Un(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,n=e&65535,{parser:r}=this.p,i=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=r.dynamicPrecedence(n);if(a&&(this.score+=a),t==0){n<r.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(r.getGoto(this.state,n,!0),this.reducePos),n<r.minRepeatTerm&&this.storeNode(n,this.reducePos,this.reducePos,i?8:4,!0),this.reduceContext(n,this.reducePos);return}let o=this.stack.length-(t-1)*3-(e&262144?6:0),s=o?this.stack[o-2]:this.p.ranges[0].from;n<r.minRepeatTerm&&s==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let c=this.reducePos-s;c>=2e3&&!this.p.parser.nodeSet.types[n]?.isAnonymous&&(s==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=s,this.p.lastBigReductionSize=c));let l=o?this.stack[o-1]:0,u=this.bufferBase+this.buffer.length-l;if(n<r.minRepeatTerm||e&131072){let e=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(n,s,e,u+4,!0)}if(e&262144)this.state=this.stack[o];else{let e=this.stack[o-3];this.state=r.getGoto(e,n,!0)}for(;this.stack.length>o;)this.stack.pop();this.reduceContext(n,s)}storeNode(e,t,n,r=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this.buffer.length;if(e>0&&this.buffer[e-4]==0&&this.buffer[e-1]>-1){if(t==n)return;if(this.buffer[e-2]>=t){this.buffer[e-2]=n;return}}}if(!i||this.pos==n)this.buffer.push(e,t,n,r);else{let i=this.buffer.length;if(i>0&&(this.buffer[i-4]!=0||this.buffer[i-1]<0)){let e=!1;for(let t=i;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let i=e,{parser:a}=this.p;this.pos=r;let o=a.stateFlag(i,1);!o&&(r>n||t<=a.maxNode)&&(this.reducePos=r),this.pushState(i,o?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=a.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.reducePos=this.pos=n+e.length;this.pushState(t,n),this.buffer.push(r,n,i,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let t=this,n=t.buffer.length;for(n&&t.buffer[n-4]==0&&(n-=4);n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let r=t.buffer.slice(n),i=t.bufferBase+n;for(;t&&i==t.bufferBase;)t=t.parent;return new e(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new Wn(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let r=0,i;r<t.length;r+=2)(i=t[r+1])!=this.state&&this.p.parser.hasAction(i,e)&&n.push(t[r],i);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let r=t[e+1];n.some((e,t)=>t&1&&e==r)||n.push(t[e],r)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let r=t[e+1];if(r==this.state)continue;let i=this.split();i.pushState(r,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(t[e],this.pos),i.reducePos=this.pos,i.score-=200,n.push(i)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(t&65536))return!1;if(!e.validAction(this.state,t)){let n=t>>19,r=t&65535,i=this.stack.length-n*3;if(i<0||e.getGoto(this.stack[i],r,!1)<0){let e=this.findForcedReduction();if(e==null)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,i)=>{if(!t.includes(r))return t.push(r),e.allActions(r,t=>{if(!(t&393216)){if(t&65536){let n=(t>>19)-i;if(n>1){let r=t&65535,i=this.stack.length-n*3;if(i>=0&&e.getGoto(this.stack[i],r,!1)>=0)return n<<19|65536|r}}else{let e=n(t,i+1);if(e!=null)return e}}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.storeNode(this.curContext.hash,this.reducePos,this.reducePos,-3,!0)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new Un(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},Un=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},Wn=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}},Gn=class e{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new e(t,n,n-t.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}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]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new e(this.stack,this.pos,this.index)}};function Kn(e,t=Uint16Array){if(typeof e!=`string`)return e;let n=null;for(let r=0,i=0;r<e.length;){let a=0;for(;;){let t=e.charCodeAt(r++),n=!1;if(t==126){a=65535;break}t>=92&&t--,t>=34&&t--;let i=t-32;if(i>=46&&(i-=46,n=!0),a+=i,n)break;a*=46}n?n[i++]=a:n=new t(a)}return n}var qn=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}};const Jn=new qn;var Yn=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk=``,this.chunkOff=0,this.chunk2=``,this.chunk2Pos=0,this.next=-1,this.token=Jn,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,i=this.pos+e;for(;i<n.from;){if(!r)return null;let e=this.ranges[--r];i-=n.from-e.to,n=e}for(;t<0?i>n.to:i>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];i+=e.from-n.to,n=e}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t<this.chunk.length)n=this.pos+e,r=this.chunk.charCodeAt(t);else{let t=this.resolveOffset(e,1);if(t==null)return-1;if(n=t,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let e=this.rangeIndex,t=this.range;for(;t.to<=n;)t=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>t.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n<this.token.start)throw RangeError(`Token end out of bounds`);this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.next=this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?-1:this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk=``,this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=Jn,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk=``,this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n=``;for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}},Xn=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;$n(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};Xn.prototype.contextual=Xn.prototype.fallback=Xn.prototype.extend=!1;var Zn=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e==`string`?Kn(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if($n(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(n||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}};Zn.prototype.contextual=Xn.prototype.fallback=Xn.prototype.extend=!1;var Qn=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}};function $n(e,t,n,r,i,a){let o=0,s=1<<r,{dialect:c}=n.p.parser;e:for(;(s&e[o])!=0;){let n=e[o+1];for(let r=o+3;r<n;r+=2)if((e[r+1]&s)>0){let n=e[r];if(c.allows(n)&&(t.token.value==-1||t.token.value==n||tr(n,t.token.value,i,a))){t.acceptToken(n);break}}let r=t.next,l=0,u=e[o+2];if(t.next<0&&u>l&&e[n+u*3-3]==65535)o=e[n+u*3-1];else{for(;l<u;){let i=l+u>>1,a=n+i+(i<<1),s=e[a],c=e[a+1]||65536;if(r<s)u=i;else if(r>=c)l=i+1;else{o=e[a+2],t.advance();continue e}}break}}}function er(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function tr(e,t,n,r){let i=er(n,r,t);return i<0||er(n,r,e)<i}const nr=typeof process<`u`&&process.env&&/\bparse\b/.test(process.env.LOG);let rr=null;function ir(e,t,n){let r=e.cursor(J.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}var ar=class{constructor(e,t){this.fragments=e,this.minRepeat=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.lastRepeat=null,this.lastRepeatPos=-1,this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?ir(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?ir(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;if(e<this.safeFrom)return null;let n=this.trees[t],r=this.index[t];if(r==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let i=n.children[r],a=this.start[t]+n.positions[r];if(a>e)return this.nextStart=a,null;if(i instanceof Be){let n=a>this.lastRepeatPos&&i.type.id>=this.minRepeat;if(a==e||n){let t=a+i.length,r;if(a>=this.safeFrom&&t<=this.safeTo&&(!(r=i.prop(K.lookAhead))||t+r<this.fragment.to)&&(n&&(this.lastRepeat=i,this.lastRepeatPos=a),a==e))return i}this.index[t]++,a+i.length>=Math.max(this.safeFrom,e)&&(this.trees.push(i),this.start.push(a),this.index.push(0))}else this.index[t]++,this.nextStart=a+i.length}}},or=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new qn)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:i}=r,a=r.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,s=0;for(let r=0;r<i.length;r++){if(!(1<<r&a))continue;let c=i[r],l=this.tokens[r];if((!n||c.fallback)&&((c.contextual||l.start!=e.pos||l.mask!=a||l.context!=o)&&(this.updateCachedToken(l,c,e),l.mask=a,l.context=o),l.lookAhead>l.end+25&&(s=Math.max(l.lookAhead,s)),l.value!=0)){let r=t;if(l.extended>-1&&(t=this.addActions(e,l.extended,l.end,t)),t=this.addActions(e,l.value,l.end,t),!c.extend&&(n=l,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return s&&e.setLookAhead(s),!n&&e.pos==this.stream.end&&(n=new qn,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new qn,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r<t.specialized.length;r++)if(t.specialized[r]==e.value){let i=t.specializers[r](this.stream.read(e.start,e.end),n);if(i>=0&&n.p.parser.dialect.allows(i>>1)){i&1?e.extended=i>>1:e.value=i>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let t=0;t<r;t+=3)if(this.actions[t]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:i}=e,{parser:a}=e.p,{data:o}=a;for(let e=0;e<2;e++)for(let s=a.stateSlot(i,e?2:1);;s+=3){if(o[s]==65535){if(o[s+1]==1)s=pr(o,s+2);else{r==0&&o[s+1]==2&&(r=this.putAction(pr(o,s+2),t,n,r));break}}o[s]==t&&(r=this.putAction(pr(o,s+1),t,n,r))}return r}},sr=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new Yn(t,r),this.tokens=new or(e,this.stream),this.topTerm=e.top[1];let{from:i}=r[0];this.stacks=[Hn.start(this,e.top[0],i)],this.fragments=n.length&&this.stream.end-i>e.bufferLength*4?new ar(n,e.minRepeatTerm):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,i;if(this.bigReductionCount>300&&e.length==1){let[t]=e;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let o=e[a];for(;;){if(this.tokens.mainToken=null,o.pos>t)n.push(o);else if(this.advanceStack(o,n,e))continue;else{r||(r=[],i=[]),r.push(o);let e=this.tokens.getMainToken(o);i.push(e.value,e.end)}break}}if(!n.length){let e=r&&mr(r);if(e)return nr&&console.log(`Finish with `+this.stackID(e)),this.stackToTree(e);if(this.parser.strict)throw nr&&r&&console.log(`Stuck with token `+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):`none`)),SyntaxError(`No parse at `+t);this.recovering||=5}if(this.recovering&&r){let e=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,i,n);if(e)return nr&&console.log(`Force-finish `+this.stackID(e)),this.stackToTree(e.forceAll())}if(this.recovering){let e=this.recovering==1?1:this.recovering*3;if(n.length>e)for(n.sort((e,t)=>t.score-e.score);n.length>e;)n.pop();n.some(e=>e.reducePos>t)&&this.recovering--}else if(n.length>1){e:for(let e=0;e<n.length-1;e++){let t=n[e];for(let r=e+1;r<n.length;r++){let i=n[r];if(t.sameState(i)||t.buffer.length>500&&i.buffer.length>500){if((t.score-i.score||t.buffer.length-i.buffer.length)>0)n.splice(r--,1);else{n.splice(e--,1);continue e}}}}n.length>12&&(n.sort((e,t)=>t.score-e.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let e=1;e<n.length;e++)n[e].pos<this.minStackPos&&(this.minStackPos=n[e].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}tryReuse(e,t,n,r){if(!n)return null;let i=e.curContext&&e.curContext.tracker.strict,a=i?e.curContext.hash:0;for(;n;){let o=this.parser.nodeSet.types[n.type.id]==n.type?this.parser.getGoto(e.state,n.type.id):-1;if(o>-1&&n.length&&(!i||(n.prop(K.contextHash)||0)==a))return e.useNode(n,o,t),n;if(n.children.length==0||n.positions[0]>0)break;let s=n.children[0];if(s instanceof Be&&(!r||s.type.id>=this.parser.minRepeatTerm))n=s;else break}return null}advanceStack(e,t,n){let r=e.pos,{parser:i}=this,a=nr?this.stackID(e)+` -> `:``;if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.reducePos<r&&e.buffer.length&&e.buffer[e.buffer.length-2]<=e.reducePos&&this.fragments.lastRepeatPos==e.reducePos&&this.tryReuse(e,e.reducePos,this.fragments.lastRepeat,!0)||this.tryReuse(e,r,this.fragments.nodeAt(r),!1);if(t)return nr&&console.log(a+this.stackID(e)+` (via reuse of ${i.getName(t.type.id)})`),!0}let o=i.stateSlot(e.state,4);if(o>0)return e.reduce(o),nr&&console.log(a+this.stackID(e)+` (via always-reduce ${i.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let o=0;o<s.length;){let c=s[o++],l=s[o++],u=s[o++],d=o==s.length||!n,f=d?e:e.split(),p=this.tokens.mainToken;if(f.apply(c,l,p?p.start:f.pos,u),nr&&console.log(a+this.stackID(f)+` (via ${c&65536?`reduce of ${i.getName(c&65535)}`:`shift`} for ${i.getName(l)} @ ${r}${f==e?``:`, split`})`),d)return!0;f.pos>r?t.push(f):n.push(f)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return cr(e,t),!0}}runRecovery(e,t,n){let r=null,i=!1;for(let a=0;a<e.length;a++){let o=e[a],s=t[a<<1],c=t[(a<<1)+1],l=nr?this.stackID(o)+` -> `:``;if(o.deadEnd&&(i||(i=!0,o.restart(),nr&&console.log(l+this.stackID(o)+` (restarted)`),this.advanceFully(o,n))))continue;let u=o.split(),d=l;for(let e=0;e<10&&u.forceReduce()&&(nr&&console.log(d+this.stackID(u)+` (via force-reduce)`),!this.advanceFully(u,n));e++)nr&&(d=this.stackID(u)+` -> `);for(let e of o.recoverByInsert(s))nr&&console.log(l+this.stackID(e)+` (via recover-insert)`),this.advanceFully(e,n);this.stream.end>o.pos?(c==o.pos&&(c++,s=0),o.recoverByDelete(s,c),nr&&console.log(l+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),cr(o,n)):(!r||r.score<u.score)&&(r=u)}return r}stackToTree(e){return e.close(),Be.build({buffer:Gn.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(rr||=/* @__PURE__ */ new WeakMap).get(e);return t||rr.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}};function cr(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}var lr=class{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}};const ur=e=>e;var dr=class{constructor(e){this.start=e.start,this.shift=e.shift||ur,this.reduce=e.reduce||ur,this.reuse=e.reuse||ur,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}},fr=class e extends st{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(` `);this.minRepeatTerm=t.length;for(let n=0;n<e.repeatNodeCount;n++)t.push(``);let n=Object.keys(e.topRules).map(t=>e.topRules[t][1]),r=[];for(let e=0;e<t.length;e++)r.push([]);function i(e,t,n){r[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];typeof e==`string`&&(e=K[e]);for(let n=1;n<t.length;){let r=t[n++];if(r>=0)i(r,e,t[n++]);else{let a=t[n+-r];for(let o=-r;o>0;o--)i(t[n++],e,a);n++}}}this.nodeSet=new Le(t.map((t,i)=>q.define({name:i>=this.minRepeatTerm?void 0:t,id:i,props:r[i],top:n.indexOf(i)>-1,error:i==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(i)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Me;let a=Kn(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(hr),this.states=Kn(e.states,Uint32Array),this.data=Kn(e.stateData),this.goto=Kn(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>typeof e==`number`?new Xn(a,e):e),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new sr(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let i=r[t+1];;){let t=r[i++],a=t&1,o=r[i++];if(a&&n)return o;for(let n=i+(t>>1);i<n;i++)if(r[i]==e)return o;if(a)return-1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let i=this.stateSlot(e,r?2:1),a;;i+=3){if((a=n[i])==65535){if(n[i+1]==1)a=n[i=pr(n,i+2)];else if(n[i+1]==2)return pr(n,i+2);else break}if(a==t||a==0)return pr(n,i+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t||null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let n=this.stateSlot(e,1);r==null;n+=3){if(this.data[n]==65535){if(this.data[n+1]==1)n=pr(this.data,n+2);else break}r=t(pr(this.data,n+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535){if(this.data[n+1]==1)n=pr(this.data,n+2);else break}if(!(this.data[n+2]&1)){let e=this.data[n+1];t.some((t,n)=>n&1&&t==e)||t.push(this.data[n],e)}}return t}configure(t){let n=Object.assign(Object.create(e.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let e=this.topRules[t.top];if(!e)throw RangeError(`Invalid top rule name ${t.top}`);n.top=e}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(e=>{let n=t.tokenizers.find(t=>t.from==e);return n?n.to:e})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((e,r)=>{let i=t.specializers.find(t=>t.from==e.external);if(!i)return e;let a=Object.assign(Object.assign({},e),{external:i.to});return n.specializers[r]=hr(a),a})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let r of e.split(` `)){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],i;(i=this.data[n++])!=65535;)(r||=new Uint8Array(this.maxTerm+1))[i]=1;return new lr(e,n,r)}static deserialize(t){return new e(t)}};function pr(e,t){return e[t]|e[t+1]<<16}function mr(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||e!=null&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}function hr(e){if(e.external){let t=+!!e.extend;return(n,r)=>e.external(n,r)<<1|t}return e.get}let gr=0;var _r=class e{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=gr++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(t,n){let r=typeof t==`string`?t:`?`;if(t instanceof e&&(n=t),n?.base)throw Error(`Can not derive from a modified tag`);let i=new e(r,[],null,[]);if(i.set.push(i),n)for(let e of n.set)i.set.push(e);return i}static defineModifier(e){let t=new yr(e);return e=>e.modified.indexOf(t)>-1?e:yr.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}};let vr=0;var yr=class e{constructor(e){this.name=e,this.instances=[],this.id=vr++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(e=>e.base==t&&br(n,e.modified));if(r)return r;let i=[],a=new _r(t.name,i,t,n);for(let e of n)e.instances.push(a);let o=xr(n);for(let n of t.set)if(!n.modified.length)for(let t of o)i.push(e.get(n,t));return a}};function br(e,t){return e.length==t.length&&e.every((e,n)=>e==t[n])}function xr(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}function Sr(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let e of n.split(` `))if(e){let n=[],i=2,a=e;for(let t=0;;){if(a==`...`&&t>0&&t+3==e.length){i=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!r)throw RangeError(`Invalid path: `+e);if(n.push(r[0]==`*`?``:r[0][0]==`"`?JSON.parse(r[0]):r[0]),t+=r[0].length,t==e.length)break;let o=e[t++];if(t==e.length&&o==`!`){i=0;break}if(o!=`/`)throw RangeError(`Invalid path: `+e);a=e.slice(t)}let o=n.length-1,s=n[o];if(!s)throw RangeError(`Invalid path: `+e);t[s]=new wr(r,i,o>0?n.slice(0,o):null).sort(t[s])}}return Cr.add(t)}const Cr=new K({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth<=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let a=new wr(i.tags,i.mode,i.context);n?n.next=a:r=a,n=a}return r}});var wr=class{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}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}};wr.empty=new wr([],2,null);function Tr(e,t){let n=Object.create(null);for(let t of e)if(!Array.isArray(t.tag))n[t.tag.id]=t.class;else for(let e of t.tag)n[e.id]=t.class;let{scope:r,all:i=null}=t||{};return{style:e=>{let t=i;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+` `+r:r;break}}return t},scope:r}}const Z=_r.define,Er=Z(),Dr=Z(),Or=Z(Dr),kr=Z(Dr),Ar=Z(),jr=Z(Ar),Mr=Z(Ar),Nr=Z(),Pr=Z(Nr),Fr=Z(),Ir=Z(),Lr=Z(),Rr=Z(Lr),zr=Z(),Q={comment:Er,lineComment:Z(Er),blockComment:Z(Er),docComment:Z(Er),name:Dr,variableName:Z(Dr),typeName:Or,tagName:Z(Or),propertyName:kr,attributeName:Z(kr),className:Z(Dr),labelName:Z(Dr),namespace:Z(Dr),macroName:Z(Dr),literal:Ar,string:jr,docString:Z(jr),character:Z(jr),attributeValue:Z(jr),number:Mr,integer:Z(Mr),float:Z(Mr),bool:Z(Ar),regexp:Z(Ar),escape:Z(Ar),color:Z(Ar),url:Z(Ar),keyword:Fr,self:Z(Fr),null:Z(Fr),atom:Z(Fr),unit:Z(Fr),modifier:Z(Fr),operatorKeyword:Z(Fr),controlKeyword:Z(Fr),definitionKeyword:Z(Fr),moduleKeyword:Z(Fr),operator:Ir,derefOperator:Z(Ir),arithmeticOperator:Z(Ir),logicOperator:Z(Ir),bitwiseOperator:Z(Ir),compareOperator:Z(Ir),updateOperator:Z(Ir),definitionOperator:Z(Ir),typeOperator:Z(Ir),controlOperator:Z(Ir),punctuation:Lr,separator:Z(Lr),bracket:Rr,angleBracket:Z(Rr),squareBracket:Z(Rr),paren:Z(Rr),brace:Z(Rr),content:Nr,heading:Pr,heading1:Z(Pr),heading2:Z(Pr),heading3:Z(Pr),heading4:Z(Pr),heading5:Z(Pr),heading6:Z(Pr),contentSeparator:Z(Nr),list:Z(Nr),quote:Z(Nr),emphasis:Z(Nr),strong:Z(Nr),link:Z(Nr),monospace:Z(Nr),strikethrough:Z(Nr),inserted:Z(),deleted:Z(),changed:Z(),invalid:Z(),meta:zr,documentMeta:Z(zr),annotation:Z(zr),processingInstruction:Z(zr),definition:_r.defineModifier(`definition`),constant:_r.defineModifier(`constant`),function:_r.defineModifier(`function`),standard:_r.defineModifier(`standard`),local:_r.defineModifier(`local`),special:_r.defineModifier(`special`)};for(let e in Q){let t=Q[e];t instanceof _r&&(t.name=e)}Tr([{tag:Q.link,class:`tok-link`},{tag:Q.heading,class:`tok-heading`},{tag:Q.emphasis,class:`tok-emphasis`},{tag:Q.strong,class:`tok-strong`},{tag:Q.keyword,class:`tok-keyword`},{tag:Q.atom,class:`tok-atom`},{tag:Q.bool,class:`tok-bool`},{tag:Q.url,class:`tok-url`},{tag:Q.labelName,class:`tok-labelName`},{tag:Q.inserted,class:`tok-inserted`},{tag:Q.deleted,class:`tok-deleted`},{tag:Q.literal,class:`tok-literal`},{tag:Q.string,class:`tok-string`},{tag:Q.number,class:`tok-number`},{tag:[Q.regexp,Q.escape,Q.special(Q.string)],class:`tok-string2`},{tag:Q.variableName,class:`tok-variableName`},{tag:Q.local(Q.variableName),class:`tok-variableName tok-local`},{tag:Q.definition(Q.variableName),class:`tok-variableName tok-definition`},{tag:Q.special(Q.variableName),class:`tok-variableName2`},{tag:Q.definition(Q.propertyName),class:`tok-propertyName tok-definition`},{tag:Q.typeName,class:`tok-typeName`},{tag:Q.namespace,class:`tok-namespace`},{tag:Q.className,class:`tok-className`},{tag:Q.macroName,class:`tok-macroName`},{tag:Q.propertyName,class:`tok-propertyName`},{tag:Q.operator,class:`tok-operator`},{tag:Q.comment,class:`tok-comment`},{tag:Q.meta,class:`tok-meta`},{tag:Q.invalid,class:`tok-invalid`},{tag:Q.punctuation,class:`tok-punctuation`}]);function Br(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function Vr(e){return e==9||e==10||e==13||e==32}let Hr=null,Ur=null,Wr=0;function Gr(e,t){let n=e.pos+t;if(Ur==e&&Wr==n)return Hr;for(;Vr(e.peek(t));)t++;let r=``;for(;;){let n=e.peek(t);if(!Br(n))break;r+=String.fromCharCode(n),t++}return Ur=e,Wr=n,Hr=r||null}function Kr(e,t){this.name=e,this.parent=t}const qr=new dr({start:null,shift(e,t,n,r){return t==1?new Kr(Gr(r,1)||``,e):e},reduce(e,t){return t==11&&e?e.parent:e},reuse(e,t,n,r){let i=t.type.id;return i==1||i==13?new Kr(Gr(r,1)||``,e):e},strict:!1}),Jr=new Qn((e,t)=>{if(e.next==60){if(e.advance(),e.next==47){e.advance();let n=Gr(e,0);if(!n)return e.acceptToken(5);if(t.context&&n==t.context.name)return e.acceptToken(2);for(let r=t.context;r;r=r.parent)if(r.name==n)return e.acceptToken(3,-2);e.acceptToken(4)}else if(e.next!=33&&e.next!=63)return e.acceptToken(1)}},{contextual:!0});function Yr(e,t){return new Qn(n=>{let r=0,i=t.charCodeAt(0);e:for(;!(n.next<0);n.advance(),r++)if(n.next==i){for(let e=1;e<t.length;e++)if(n.peek(e)!=t.charCodeAt(e))continue e;break}r&&n.acceptToken(e)})}const Xr=Yr(36,`-->`),Zr=Yr(37,`?>`),Qr=Yr(38,`]]>`),$r=Sr({Text:Q.content,"StartTag StartCloseTag EndTag SelfCloseEndTag":Q.angleBracket,TagName:Q.tagName,"MismatchedCloseTag/TagName":[Q.tagName,Q.invalid],AttributeName:Q.attributeName,AttributeValue:Q.attributeValue,Is:Q.definitionOperator,"EntityReference CharacterReference":Q.character,Comment:Q.blockComment,ProcessingInst:Q.processingInstruction,DoctypeDecl:Q.documentMeta,Cdata:Q.special(Q.string)}),ei=fr.deserialize({version:14,states:",lOQOaOOOrOxO'#CfOzOpO'#CiO!tOaO'#CgOOOP'#Cg'#CgO!{OrO'#CrO#TOtO'#CsO#]OpO'#CtOOOP'#DT'#DTOOOP'#Cv'#CvQQOaOOOOOW'#Cw'#CwO#eOxO,59QOOOP,59Q,59QOOOO'#Cx'#CxO#mOpO,59TO#uO!bO,59TOOOP'#C|'#C|O$TOaO,59RO$[OpO'#CoOOOP,59R,59ROOOQ'#C}'#C}O$dOrO,59^OOOP,59^,59^OOOS'#DO'#DOO$lOtO,59_OOOP,59_,59_O$tOpO,59`O$|OpO,59`OOOP-E6t-E6tOOOW-E6u-E6uOOOP1G.l1G.lOOOO-E6v-E6vO%UO!bO1G.oO%UO!bO1G.oO%dOpO'#CkO%lO!bO'#CyO%zO!bO1G.oOOOP1G.o1G.oOOOP1G.w1G.wOOOP-E6z-E6zOOOP1G.m1G.mO&VOpO,59ZO&_OpO,59ZOOOQ-E6{-E6{OOOP1G.x1G.xOOOS-E6|-E6|OOOP1G.y1G.yO&gOpO1G.zO&gOpO1G.zOOOP1G.z1G.zO&oO!bO7+$ZO&}O!bO7+$ZOOOP7+$Z7+$ZOOOP7+$c7+$cO'YOpO,59VO'bOpO,59VO'mO!bO,59eOOOO-E6w-E6wO'{OpO1G.uO'{OpO1G.uOOOP1G.u1G.uO(TOpO7+$fOOOP7+$f7+$fO(]O!bO<<GuOOOP<<Gu<<GuOOOP<<G}<<G}O'bOpO1G.qO'bOpO1G.qO(hO#tO'#CnO(vO&jO'#CnOOOO1G.q1G.qO)UOpO7+$aOOOP7+$a7+$aOOOP<<HQ<<HQOOOPAN=aAN=aOOOPAN=iAN=iO'bOpO7+$]OOOO7+$]7+$]OOOO'#Cz'#CzO)^O#tO,59YOOOO,59Y,59YOOOO'#C{'#C{O)lO&jO,59YOOOP<<G{<<G{OOOO<<Gw<<GwOOOO-E6x-E6xOOOO1G.t1G.tOOOO-E6y-E6y",stateData:")z~OPQOSVOTWOVWOWWOXWOiXOyPO!QTO!SUO~OvZOx]O~O^`Oz^O~OPQOQcOSVOTWOVWOWWOXWOyPO!QTO!SUO~ORdO~P!SOteO!PgO~OuhO!RjO~O^lOz^O~OvZOxoO~O^qOz^O~O[vO`sOdwOz^O~ORyO~P!SO^{Oz^O~OteO!P}O~OuhO!R!PO~O^!QOz^O~O[!SOz^O~O[!VO`sOd!WOz^O~Oa!YOz^O~Oz^O[mX`mXdmX~O[!VO`sOd!WO~O^!]Oz^O~O[!_Oz^O~O[!aOz^O~O[!cO`sOd!dOz^O~O[!cO`sOd!dO~Oa!eOz^O~Oz^O{!gO}!hO~Oz^O[ma`madma~O[!kOz^O~O[!lOz^O~O[!mO`sOd!nO~OW!qOX!qO{!sO|!qO~OW!tOX!tO}!sO!O!tO~O[!vOz^O~OW!qOX!qO{!yO|!qO~OW!tOX!tO}!yO!O!tO~O",goto:"%cxPPPPPPPPPPyyP!PP!VPP!`!jP!pyyyP!v!|#S$[$k$q$w$}%TPPPP%ZXWORYbXRORYb_t`qru!T!U!bQ!i!YS!p!e!fR!w!oQdRRybXSORYbQYORmYQ[PRn[Q_QQkVjp_krz!R!T!X!Z!^!`!f!j!oQr`QzcQ!RlQ!TqQ!XsQ!ZtQ!^{Q!`!QQ!f!YQ!j!]R!o!eQu`S!UqrU![u!U!bR!b!TQ!r!gR!x!rQ!u!hR!z!uQbRRxbQfTR|fQiUR!OiSXOYTaRb",nodeNames:`⚠ StartTag StartCloseTag MissingCloseTag StartCloseTag StartCloseTag Document Text EntityReference CharacterReference Cdata Element EndTag OpenTag TagName Attribute AttributeName Is AttributeValue CloseTag SelfCloseEndTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag DoctypeDecl`,maxTerm:50,context:qr,nodeProps:[[`closedBy`,1,`SelfCloseEndTag EndTag`,13,`CloseTag MissingCloseTag`],[`openedBy`,12,`StartTag StartCloseTag`,19,`OpenTag`,20,`StartTag`],[`isolate`,-6,13,18,19,21,22,24,``]],propSources:[$r],skippedNodes:[0],repeatNodeCount:9,tokenData:"!)v~R!YOX$qXY)iYZ)iZ]$q]^)i^p$qpq)iqr$qrs*vsv$qvw+fwx/ix}$q}!O0[!O!P$q!P!Q2z!Q![$q![!]4n!]!^$q!^!_8U!_!`!#t!`!a!$l!a!b!%d!b!c$q!c!}4n!}#P$q#P#Q!'W#Q#R$q#R#S4n#S#T$q#T#o4n#o%W$q%W%o4n%o%p$q%p&a4n&a&b$q&b1p4n1p4U$q4U4d4n4d4e$q4e$IS4n$IS$I`$q$I`$Ib4n$Ib$Kh$q$Kh%#t4n%#t&/x$q&/x&Et4n&Et&FV$q&FV;'S4n;'S;:j8O;:j;=`)c<%l?&r$q?&r?Ah4n?Ah?BY$q?BY?Mn4n?MnO$qi$zXVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qa%nVVP!O`Ov%gwx&Tx!^%g!^!_&o!_;'S%g;'S;=`'W<%lO%gP&YTVPOv&Tw!^&T!_;'S&T;'S;=`&i<%lO&TP&lP;=`<%l&T`&tS!O`Ov&ox;'S&o;'S;=`'Q<%lO&o`'TP;=`<%l&oa'ZP;=`<%l%gX'eWVP|WOr'^rs&Tsv'^w!^'^!^!_'}!_;'S'^;'S;=`(i<%lO'^W(ST|WOr'}sv'}w;'S'};'S;=`(c<%lO'}W(fP;=`<%l'}X(lP;=`<%l'^h(vV|W!O`Or(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(oh)`P;=`<%l(oi)fP;=`<%l$qo)t`VP|W!O`zUOX$qXY)iYZ)iZ]$q]^)i^p$qpq)iqr$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk+PV{YVP!O`Ov%gwx&Tx!^%g!^!_&o!_;'S%g;'S;=`'W<%lO%g~+iast,n![!]-r!c!}-r#R#S-r#T#o-r%W%o-r%p&a-r&b1p-r4U4d-r4e$IS-r$I`$Ib-r$Kh%#t-r&/x&Et-r&FV;'S-r;'S;:j/c?&r?Ah-r?BY?Mn-r~,qQ!Q![,w#l#m-V~,zQ!Q![,w!]!^-Q~-VOX~~-YR!Q![-c!c!i-c#T#Z-c~-fS!Q![-c!]!^-Q!c!i-c#T#Z-c~-ug}!O-r!O!P-r!Q![-r![!]-r!]!^/^!c!}-r#R#S-r#T#o-r$}%O-r%W%o-r%p&a-r&b1p-r1p4U-r4U4d-r4e$IS-r$I`$Ib-r$Je$Jg-r$Kh%#t-r&/x&Et-r&FV;'S-r;'S;:j/c?&r?Ah-r?BY?Mn-r~/cOW~~/fP;=`<%l-rk/rW}bVP|WOr'^rs&Tsv'^w!^'^!^!_'}!_;'S'^;'S;=`(i<%lO'^k0eZVP|W!O`Or$qrs%gsv$qwx'^x}$q}!O1W!O!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk1aZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a2S!a;'S$q;'S;=`)c<%lO$qk2_X!PQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qm3TZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a3v!a;'S$q;'S;=`)c<%lO$qm4RXdSVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qo4{!P`S^QVP|W!O`Or$qrs%gsv$qwx'^x}$q}!O4n!O!P4n!P!Q$q!Q![4n![!]4n!]!^$q!^!_(o!_!c$q!c!}4n!}#R$q#R#S4n#S#T$q#T#o4n#o$}$q$}%O4n%O%W$q%W%o4n%o%p$q%p&a4n&a&b$q&b1p4n1p4U4n4U4d4n4d4e$q4e$IS4n$IS$I`$q$I`$Ib4n$Ib$Je$q$Je$Jg4n$Jg$Kh$q$Kh%#t4n%#t&/x$q&/x&Et4n&Et&FV$q&FV;'S4n;'S;:j8O;:j;=`)c<%l?&r$q?&r?Ah4n?Ah?BY$q?BY?Mn4n?MnO$qo8RP;=`<%l4ni8]Y|W!O`Oq(oqr8{rs&osv(owx'}x!a(o!a!b!#U!b;'S(o;'S;=`)]<%lO(oi9S_|W!O`Or(ors&osv(owx'}x}(o}!O:R!O!f(o!f!g;e!g!}(o!}#ODh#O#W(o#W#XLp#X;'S(o;'S;=`)]<%lO(oi:YX|W!O`Or(ors&osv(owx'}x}(o}!O:u!O;'S(o;'S;=`)]<%lO(oi;OV!QP|W!O`Or(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(oi;lX|W!O`Or(ors&osv(owx'}x!q(o!q!r<X!r;'S(o;'S;=`)]<%lO(oi<`X|W!O`Or(ors&osv(owx'}x!e(o!e!f<{!f;'S(o;'S;=`)]<%lO(oi=SX|W!O`Or(ors&osv(owx'}x!v(o!v!w=o!w;'S(o;'S;=`)]<%lO(oi=vX|W!O`Or(ors&osv(owx'}x!{(o!{!|>c!|;'S(o;'S;=`)]<%lO(oi>jX|W!O`Or(ors&osv(owx'}x!r(o!r!s?V!s;'S(o;'S;=`)]<%lO(oi?^X|W!O`Or(ors&osv(owx'}x!g(o!g!h?y!h;'S(o;'S;=`)]<%lO(oi@QY|W!O`Or?yrs@psv?yvwA[wxBdx!`?y!`!aCr!a;'S?y;'S;=`Db<%lO?ya@uV!O`Ov@pvxA[x!`@p!`!aAy!a;'S@p;'S;=`B^<%lO@pPA_TO!`A[!`!aAn!a;'SA[;'S;=`As<%lOA[PAsOiPPAvP;=`<%lA[aBQSiP!O`Ov&ox;'S&o;'S;=`'Q<%lO&oaBaP;=`<%l@pXBiX|WOrBdrsA[svBdvwA[w!`Bd!`!aCU!a;'SBd;'S;=`Cl<%lOBdXC]TiP|WOr'}sv'}w;'S'};'S;=`(c<%lO'}XCoP;=`<%lBdiC{ViP|W!O`Or(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(oiDeP;=`<%l?yiDoZ|W!O`Or(ors&osv(owx'}x!e(o!e!fEb!f#V(o#V#WIr#W;'S(o;'S;=`)]<%lO(oiEiX|W!O`Or(ors&osv(owx'}x!f(o!f!gFU!g;'S(o;'S;=`)]<%lO(oiF]X|W!O`Or(ors&osv(owx'}x!c(o!c!dFx!d;'S(o;'S;=`)]<%lO(oiGPX|W!O`Or(ors&osv(owx'}x!v(o!v!wGl!w;'S(o;'S;=`)]<%lO(oiGsX|W!O`Or(ors&osv(owx'}x!c(o!c!dH`!d;'S(o;'S;=`)]<%lO(oiHgX|W!O`Or(ors&osv(owx'}x!}(o!}#OIS#O;'S(o;'S;=`)]<%lO(oiI]V|W!O`yPOr(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(oiIyX|W!O`Or(ors&osv(owx'}x#W(o#W#XJf#X;'S(o;'S;=`)]<%lO(oiJmX|W!O`Or(ors&osv(owx'}x#T(o#T#UKY#U;'S(o;'S;=`)]<%lO(oiKaX|W!O`Or(ors&osv(owx'}x#h(o#h#iK|#i;'S(o;'S;=`)]<%lO(oiLTX|W!O`Or(ors&osv(owx'}x#T(o#T#UH`#U;'S(o;'S;=`)]<%lO(oiLwX|W!O`Or(ors&osv(owx'}x#c(o#c#dMd#d;'S(o;'S;=`)]<%lO(oiMkX|W!O`Or(ors&osv(owx'}x#V(o#V#WNW#W;'S(o;'S;=`)]<%lO(oiN_X|W!O`Or(ors&osv(owx'}x#h(o#h#iNz#i;'S(o;'S;=`)]<%lO(oi! RX|W!O`Or(ors&osv(owx'}x#m(o#m#n! n#n;'S(o;'S;=`)]<%lO(oi! uX|W!O`Or(ors&osv(owx'}x#d(o#d#e!!b#e;'S(o;'S;=`)]<%lO(oi!!iX|W!O`Or(ors&osv(owx'}x#X(o#X#Y?y#Y;'S(o;'S;=`)]<%lO(oi!#_V!SP|W!O`Or(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(ok!$PXaQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qo!$wX[UVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!%mZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!&`!a;'S$q;'S;=`)c<%lO$qk!&kX!RQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!'aZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_#P$q#P#Q!(S#Q;'S$q;'S;=`)c<%lO$qk!(]ZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!)O!a;'S$q;'S;=`)c<%lO$qk!)ZXxQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$q",tokenizers:[Jr,Xr,Zr,Qr,0,1,2,3,4],topRules:{Document:[0,6]},tokenPrec:0}),ti=/^[\u0009\u000A\u000D\u0020-\uD7FF\uE000-\uFFFD\u{10000}-\u{10FFFF}]$/u,ni=/[^\u0009\u000A\u000D\u0020-\uD7FF\uE000-\uFFFD\u{10000}-\u{10FFFF}]/u,ri=e=>/[^\t\n\r ]/.test(e),ii=/* @__PURE__ */ new Map([[`amp`,`&`],[`apos`,`'`],[`quot`,`"`],[`lt`,`<`],[`gt`,`>`]]);function ai(e){let t=e.slice(1,-1);if(t[0]!==`#`)return ii.get(t);let n=t[1]===`x`?Number.parseInt(t.slice(2),16):Number(t.slice(1));if(!Number.isInteger(n)||n<0||n>1114111)return;let r=String.fromCodePoint(n);return ti.test(r)?r:void 0}function oi(e){return e.replace(/&(?:#x[\da-fA-F]+|#\d+|[\w.:-]+);/g,e=>ai(e)??e)}function si(e,t=[]){return e.length<=5242880?ei.parse(e,t):void 0}function ci(e,t,n){return e?{from:e.from,to:e.to,name:t.slice(e.from,e.to)}:{from:n,to:n,name:``}}function li(e,t){let n=ci(e.getChild(`AttributeName`),t,e.from),r=e.getChild(`Is`)?.to,i=e.getChild(`AttributeValue`),a={from:e.from,to:e.to};if(!i)return{name:n,span:a,equals:r,closed:!1};let o=t[i.from],s=o===`"`||o===`'`?o:void 0,c=!!s&&i.to>i.from+1&&t[i.to-1]===s&&!i.lastChild?.type.isError,l=i.from+ +!!s,u=i.to-+!!c,d=oi(t.slice(l,u).replace(/\r\n|[\t\r\n]/g,` `));return{name:n,span:a,equals:r,quote:s,closed:c,value:{from:l,to:u},decoded:d}}function ui(e,t){if(t===`xml`)return`http://www.w3.org/XML/1998/namespace`;if(t===`xmlns`)return`http://www.w3.org/2000/xmlns/`;for(let n=e;n;n=n.parent){let e=n.attributes.find(e=>e.name.name===(t?`xmlns:`+t:`xmlns`));if(e?.closed)return e.decoded}return t?void 0:``}function di(e,t){let n=[],r=[],i=[],a=!t,o=0,s=(t,n,i,a)=>{if(r.length>=100)return;let o={from:n.from,to:n.to};o.to===o.from&&!a?.fix&&o.to<e.length&&o.to++,r.push({source:`syntax`,code:t,span:o,message:i,...a})};if(t&&t.iterate({enter(t){if(a)return!1;let c=t.node,{name:l,from:u,to:d}=c;if(++o>5e5||i.length>=128)return a=!0,!1;let f=i.at(-1);if(l===`Element`){let t=c.firstChild;if(!t)return!1;let r=t.lastChild,a=t.getChildren(`Attribute`).map(t=>li(t,e)),o={name:ci(t.getChild(`TagName`),e,u+1),span:{from:u,to:d},open:{from:t.from,to:t.to},parent:f,attributes:a,children:[],content:[],complete:r?.name===`EndTag`||r?.name===`SelfCloseEndTag`,selfClosing:r?.name===`SelfCloseEndTag`,namespace:``,preserveSpace:f?.preserveSpace??!1},l=a.find(e=>e.name.name===`xml:space`)?.decoded;(l===`preserve`||l==="default")&&(o.preserveSpace=l===`preserve`);let p=e=>{let t=e.name.split(`:`);if(t.length===1)return ui(o,``)??``;let n=ui(o,t[0]);return t.length===2&&t[1]&&n||s(`invalid-namespace`,e,`Invalid or unbound XML namespace prefix.`),n||`?`};o.namespace=p(o.name);let m=/* @__PURE__ */ new Map;for(let t of a){let n=t.name.name.split(`:`).at(-1),r=t.name.name.includes(`:`)?`${p(t.name)}:${n}`:`:`+n,i=m.get(r);i?s(`duplicate-attribute`,t.name,`Duplicate XML attribute.`,{related:{span:i,message:`First occurrence.`}}):m.set(r,t.name),t.value&&e.slice(t.value.from,t.value.to).includes(`<`)&&s(`invalid-attribute-value`,t.value,`Escape “<” as < in attribute values.`)}f?f.children.push(o):(n.length&&o.name.name&&s(`multiple-roots`,o.name,`An XML document has one root element.`),n.push(o)),i.push(o)}else if(l===`CloseTag`&&f)f.close={span:{from:u,to:d},name:ci(c.getChild(`TagName`),e,u+2),complete:c.lastChild?.name===`EndTag`};else if(l===`MismatchedCloseTag`&&f){let t=ci(c.getChild(`TagName`),e,u+2),n=f.name.name;s(`mismatched-close-tag`,t,`Expected </${n}>.`,{fix:{span:t,text:n,title:`Change closing tag to </${n}>`},related:{span:f.name,message:`Opening tag.`}})}else if(l===`MissingCloseTag`&&f){let e=f.name.name;s(`missing-close-tag`,{from:u,to:d},`Missing </${e}>.`,{fix:{span:{from:u,to:u},text:`</${e}>`,title:`Insert </${e}>`},related:{span:f.name,message:`Opening tag.`}})}else if(l===`DoctypeDecl`)return s(`doctype-disabled`,{from:u,to:d},`Document type declarations are disabled.`),!1;else if(t.type.isError){if(c.parent?.name===`Element`&&f?.complete&&!f.selfClosing&&!f.close&&!f.content.some(e=>e.kind===`MismatchedCloseTag`))s(`unclosed-element`,f.name,`Missing closing tag for <${f.name.name}>.`);else if(c.parent?.name!==`Element`){let e=r.at(-1);(e?.span.from!==u||e.code!==`invalid-xml`)&&s(`invalid-xml`,{from:u,to:d},`Incomplete or invalid XML syntax.`)}}(c.parent?.name===`Element`||c.parent?.name===`Document`)&&[`Text`,`CharacterReference`,`EntityReference`,`Cdata`,`Comment`,`ProcessingInst`,`MismatchedCloseTag`].includes(l)&&(f?f.content.push({span:{from:u,to:d},kind:l}):[`Text`,`CharacterReference`,`EntityReference`,`Cdata`].includes(l)&&ri(e.slice(u,d).replace(/^\uFEFF/,``))&&s(`text-outside-root`,{from:u,to:d},`Text must be inside the root element.`)),(l===`EntityReference`||l===`CharacterReference`)&&ai(e.slice(u,d))===void 0&&s(`invalid-reference`,{from:u,to:d},`Unknown entity or invalid XML character reference.`)},leave(e){e.name===`Element`&&i.pop()}}),a)return{roots:[],limited:!0,issues:[{source:`syntax`,code:`resource-limit`,span:{from:0,to:0},message:`The XML document exceeds the analysis size, nesting, or syntax-node budget.`,severity:kt.Warning}]};let c=ni.exec(e);return c&&s(`invalid-character`,{from:c.index,to:c.index+c[0].length},`Character is invalid in XML 1.0.`),!n.length&&!r.length&&s(`missing-root`,{from:e.length,to:e.length},`Expected a root element.`),{roots:n,issues:r,limited:a}}function fi(e){let t=[],n=[...e].reverse();for(;n.length;){let e=n.pop();t.push(e);for(let t=e.children.length-1;t>=0;t--)n.push(e.children[t])}return t}var pi=/* @__PURE__ */ r((e=>{function t(e,t){return t===void 0&&(t=Object),t&&typeof t.getOwnPropertyDescriptors==`function`&&(e=t.create(null,t.getOwnPropertyDescriptors(e))),t&&typeof t.freeze==`function`?t.freeze(e):e}function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var r=t({allowfullscreen:!0,async:!0,autofocus:!0,autoplay:!0,checked:!0,controls:!0,default:!0,defer:!0,disabled:!0,formnovalidate:!0,hidden:!0,ismap:!0,itemscope:!0,loop:!0,multiple:!0,muted:!0,nomodule:!0,novalidate:!0,open:!0,playsinline:!0,readonly:!0,required:!0,reversed:!0,selected:!0}),i=t({area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),a=t({script:!1,style:!1,textarea:!0,title:!0});function o(e){return e===s.HTML}var s=t({HTML:`text/html`,XML_APPLICATION:`application/xml`,XML_TEXT:`text/xml`,XML_XHTML_APPLICATION:`application/xhtml+xml`,XML_SVG_IMAGE:`image/svg+xml`}),c=Object.keys(s).map(function(e){return s[e]}),l=t({HTML:`http://www.w3.org/1999/xhtml`,SVG:`http://www.w3.org/2000/svg`,XML:`http://www.w3.org/XML/1998/namespace`,XMLNS:`http://www.w3.org/2000/xmlns/`});e.assign=function(e,t){if(typeof e!=`object`||!e)throw TypeError(`target is not an object`);for(var r in t)n(t,r)&&(e[r]=t[r]);return e},e.find=function(e,t,r){if(r===void 0&&(r=Array.prototype),e&&typeof r.find==`function`)return r.find.call(e,t);for(var i=0;i<e.length;i++)if(n(e,i)){var a=e[i];if(t.call(void 0,a,i,e))return a}},e.freeze=t,e.HTML_BOOLEAN_ATTRIBUTES=r,e.HTML_RAW_TEXT_ELEMENTS=a,e.HTML_VOID_ELEMENTS=i,e.hasDefaultHTMLNamespace=function(e){return o(e)||e===s.XML_XHTML_APPLICATION},e.hasOwn=n,e.isHTMLBooleanAttribute=function(e){return n(r,e.toLowerCase())},e.isHTMLRawTextElement=function(e){var t=e.toLowerCase();return n(a,t)&&!a[t]},e.isHTMLEscapableRawTextElement=function(e){var t=e.toLowerCase();return n(a,t)&&a[t]},e.isHTMLMimeType=o,e.isHTMLVoidElement=function(e){return n(i,e.toLowerCase())},e.isValidMimeType=function(e){return c.indexOf(e)>-1},e.MIME_TYPE=s,e.NAMESPACE=l})),mi=/* @__PURE__ */ r((e=>{var t=pi();function n(e,t){e.prototype=Object.create(Error.prototype,{constructor:{value:e},name:{value:e.name,enumerable:!0,writable:t}})}var r=t.freeze({Error:`Error`,IndexSizeError:`IndexSizeError`,DomstringSizeError:`DomstringSizeError`,HierarchyRequestError:`HierarchyRequestError`,WrongDocumentError:`WrongDocumentError`,InvalidCharacterError:`InvalidCharacterError`,NoDataAllowedError:`NoDataAllowedError`,NoModificationAllowedError:`NoModificationAllowedError`,NotFoundError:`NotFoundError`,NotSupportedError:`NotSupportedError`,InUseAttributeError:`InUseAttributeError`,InvalidStateError:`InvalidStateError`,SyntaxError:`SyntaxError`,InvalidModificationError:`InvalidModificationError`,NamespaceError:`NamespaceError`,InvalidAccessError:`InvalidAccessError`,ValidationError:`ValidationError`,TypeMismatchError:`TypeMismatchError`,SecurityError:`SecurityError`,NetworkError:`NetworkError`,AbortError:`AbortError`,URLMismatchError:`URLMismatchError`,QuotaExceededError:`QuotaExceededError`,TimeoutError:`TimeoutError`,InvalidNodeTypeError:`InvalidNodeTypeError`,DataCloneError:`DataCloneError`,EncodingError:`EncodingError`,NotReadableError:`NotReadableError`,UnknownError:`UnknownError`,ConstraintError:`ConstraintError`,DataError:`DataError`,TransactionInactiveError:`TransactionInactiveError`,ReadOnlyError:`ReadOnlyError`,VersionError:`VersionError`,OperationError:`OperationError`,NotAllowedError:`NotAllowedError`,OptOutError:`OptOutError`}),i=Object.keys(r);function a(e){return typeof e==`number`&&e>=1&&e<=25}function o(e){return typeof e==`string`&&e.substring(e.length-r.Error.length)===r.Error}function s(e,t){a(e)?(this.name=i[e],this.message=t||``):(this.message=e,this.name=o(t)?t:r.Error),Error.captureStackTrace&&Error.captureStackTrace(this,s)}n(s,!0),Object.defineProperties(s.prototype,{code:{enumerable:!0,get:function(){var e=i.indexOf(this.name);return a(e)?e:0}}});for(var c={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25},l=Object.entries(c),u=0;u<l.length;u++){var d=l[u][0];s[d]=l[u][1]}function f(e,t,n){this.message=e,this.locator=t,this.cause=n,Error.captureStackTrace&&Error.captureStackTrace(this,f)}n(f),e.DOMException=s,e.DOMExceptionName=r,e.ExceptionCode=c,e.ParseError=f})),hi=/* @__PURE__ */ r((e=>{function t(e){try{typeof e!=`function`&&(e=RegExp);var t=new e(`𝌆`,`u`).exec(`𝌆`);return!!t&&t[0].length===2}catch{}return!1}var n=t();function r(e){if(e.source[0]!==`[`)throw Error(e+` can not be used with chars`);return e.source.slice(1,e.source.lastIndexOf(`]`))}function i(e,t){if(e.source[0]!==`[`)throw Error(`/`+e.source+`/ can not be used with chars_without`);if(!t||typeof t!=`string`)throw Error(JSON.stringify(t)+` is not a valid search`);if(e.source.indexOf(t)===-1)throw Error(`"`+t+`" is not is /`+e.source+`/`);if(t===`-`&&e.source.indexOf(t)!==1)throw Error(`"`+t+`" is not at the first postion of /`+e.source+`/`);return new RegExp(e.source.replace(t,``),n?`u`:``)}function a(e){var t=this;return new RegExp(Array.prototype.slice.call(arguments).map(function(e){var n=typeof e==`string`;if(n&&t===void 0&&e===`|`)throw Error("use regg instead of reg to wrap expressions with `|`!");return n?e:e.source}).join(``),n?`u`:``)}function o(e){if(arguments.length===0)throw Error(`no parameters provided`);return a.apply(o,[`(?:`].concat(Array.prototype.slice.call(arguments),[`)`]))}var s=`�`,c=/[-\x09\x0A\x0D\x20-\x2C\x2E-\uD7FF\uE000-\uFFFD]/;n&&(c=a(`[`,r(c),`\\u{10000}-\\u{10FFFF}`,`]`));var l=RegExp(`[^`+r(c)+`]`,n?`u`:``),u=/[\x20\x09\x0D\x0A]/,d=r(u),f=a(u,`+`),p=a(u,`*`),m=/[:_a-zA-Z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;n&&(m=a(`[`,r(m),`\\u{10000}-\\u{10FFFF}`,`]`));var h=a(`[`,r(m),r(/[-.0-9\xB7]/),r(/[\u0300-\u036F\u203F-\u2040]/),`]`),g=a(m,h,`*`),_=a(`^`,g,`$`),v=a(h,`+`),y=o(a(`&`,g,`;`),`|`,o(/&#[0-9]+;|&#x[0-9a-fA-F]+;/)),b=a(`%`,g,`;`),x=o(a(`"`,o(/[^%&"]/,`|`,b,`|`,y),`*`,`"`),`|`,a(`'`,o(/[^%&']/,`|`,b,`|`,y),`*`,`'`)),S=o(`"`,o(/[^<&"]/,`|`,y),`*`,`"`,`|`,`'`,o(/[^<&']/,`|`,y),`*`,`'`),C=a(i(m,`:`),i(h,`:`),`*`),w=a(`^`,C,`$`),T=a(C,o(`:`,C),`?`),E=a(`^`,T,`$`),D=a(`(`,T,`)`),O=o(/"[^"]*"|'[^']*'/),k=a(/^<\?/,`(`,g,`)`,o(f,`(?!`,u,`)(`,c,`*?)`),`?`,/\?>/),ee=/[\x20\x0D\x0Aa-zA-Z0-9-'()+,./:=?;!*#@$_%]/,A=o(`"`,ee,`*"`,`|`,`'`,i(ee,`'`),`*'`),j=`<!--`,te=`-->`,M=a(j,o(i(c,`-`),`|`,a(`-`,i(c,`-`))),`*`,te),N=`#PCDATA`,P=o(`EMPTY`,`|`,`ANY`,`|`,o(a(/\(/,p,N,o(p,/\|/,p,T),`*`,p,/\)\*/),`|`,a(/\(/,p,N,p,/\)/)),`|`,a(/\([^>]+\)/,/[?*+]?/)),F=a(`<!ELEMENT`,f,o(T,`|`,b),f,o(P,`|`,b),p,`>`),I=a(`<!ATTLIST`,f,g,o(f,g,f,o(/CDATA|ID|IDREF|IDREFS|ENTITY|ENTITIES|NMTOKEN|NMTOKENS/,`|`,o(a(`NOTATION`,f,/\(/,p,g,o(p,/\|/,p,g),`*`,p,/\)/),`|`,a(/\(/,p,v,o(p,/\|/,p,v),`*`,p,/\)/))),f,o(/#REQUIRED|#IMPLIED/,`|`,o(o(`#FIXED`,f),`?`,S))),`*`,p,`>`),L=`about:legacy-compat`,R=o(`"`+L+`"`,`|`,`'`+L+`'`),z=`SYSTEM`,B=`PUBLIC`,V=o(o(z,f,O),`|`,o(B,f,A,f,O)),ne=a(`^`,o(o(z,f,`(?<SystemLiteralOnly>`,O,`)`),`|`,o(B,f,`(?<PubidLiteral>`,A,`)`,f,`(?<SystemLiteral>`,O,`)`))),H=a(`^`,A,`$`),re=a(`^`,O,`$`),ie=o(x,`|`,o(V,o(f,`NDATA`,f,g),`?`)),ae=`<!ENTITY`,oe=o(a(ae,f,g,f,ie,p,`>`),`|`,a(ae,f,`%`,f,g,f,o(x,`|`,V),p,`>`)),U=a(`<!NOTATION`,f,g,f,o(V,`|`,a(B,f,A)),p,`>`),se=a(p,`=`,p),ce=/1[.]\d+/,W=a(f,`version`,se,o(`'`,ce,`'`,`|`,`"`,ce,`"`)),le=/[A-Za-z][-A-Za-z0-9._]*/,ue=a(/^<\?xml/,W,o(f,`encoding`,se,o(`"`,le,`"`,`|`,`'`,le,`'`)),`?`,o(f,`standalone`,se,o(`'`,o(`yes`,`|`,`no`),`'`,`|`,`"`,o(`yes`,`|`,`no`),`"`)),`?`,p,/\?>/),G=`<!DOCTYPE`,de=`<![CDATA[`,fe=`]]>`,pe=a(/<!\[CDATA\[/,a(c,`*?`,/\]\]>/));e.chars=r,e.chars_without=i,e.detectUnicodeSupport=t,e.reg=a,e.regg=o,e.ABOUT_LEGACY_COMPAT=L,e.ABOUT_LEGACY_COMPAT_SystemLiteral=R,e.AttlistDecl=I,e.CDATA_START=de,e.CDATA_END=fe,e.CDSect=pe,e.Char=c,e.Comment=M,e.COMMENT_START=j,e.COMMENT_END=te,e.DOCTYPE_DECL_START=G,e.elementdecl=F,e.EntityDecl=oe,e.EntityValue=x,e.ExternalID=V,e.ExternalID_match=ne,e.Name=g,e.Name_exact=_,e.NCName_exact=w,e.NotationDecl=U,e.Reference=y,e.PEReference=b,e.PI=k,e.PUBLIC=B,e.PubidLiteral=A,e.PubidLiteral_match=H,e.QName=T,e.QName_exact=E,e.QName_group=D,e.S=f,e.SChar_s=d,e.S_OPT=p,e.SYSTEM=z,e.SystemLiteral=O,e.SystemLiteral_match=re,e.InvalidChar=l,e.UNICODE_REPLACEMENT_CHARACTER=s,e.UNICODE_SUPPORT=n,e.XMLDecl=ue})),gi=/* @__PURE__ */ r((e=>{var t=pi(),n=t.find,r=t.hasDefaultHTMLNamespace,i=t.hasOwn,a=t.isHTMLMimeType,o=t.isHTMLRawTextElement,s=t.isHTMLVoidElement,c=t.MIME_TYPE,l=t.NAMESPACE,u=Symbol(),d=mi(),f=d.DOMException,p=d.DOMExceptionName,m=hi();function h(e){if(e!==u)throw TypeError(`Illegal constructor`)}function g(e){return e!==``}function _(e){return e?e.split(/[\t\n\f\r ]+/).filter(g):[]}function v(e,t){return i(e,t)||(e[t]=!0),e}function y(e){if(!e)return[];var t=_(e);return Object.keys(t.reduce(v,{}))}function b(e){return function(t){return e&&e.indexOf(t)!==-1}}function x(e){if(!m.QName_exact.test(e))throw new f(f.INVALID_CHARACTER_ERR,`invalid character in qualified name "`+e+`"`)}function S(e,n){x(n),e||=null;var r=null,i=n;if(n.indexOf(`:`)>=0){var a=n.split(`:`);r=a[0],i=a[1]}if(r!==null&&e===null)throw new f(f.NAMESPACE_ERR,`prefix is non-null and namespace is null`);if(r===`xml`&&e!==t.NAMESPACE.XML)throw new f(f.NAMESPACE_ERR,`prefix is "xml" and namespace is not the XML namespace`);if((r===`xmlns`||n===`xmlns`)&&e!==t.NAMESPACE.XMLNS)throw new f(f.NAMESPACE_ERR,`either qualifiedName or prefix is "xmlns" and namespace is not the XMLNS namespace`);if(e===t.NAMESPACE.XMLNS&&r!==`xmlns`&&n!==`xmlns`)throw new f(f.NAMESPACE_ERR,`namespace is the XMLNS namespace and neither qualifiedName nor prefix is "xmlns"`);return[e,r,i]}function C(e,t){for(var n in e)i(e,n)&&(t[n]=e[n])}function w(e,t){var n=e.prototype;if(!(n instanceof t)){function r(){}r.prototype=t.prototype,r=new r,C(n,r),e.prototype=n=r}n.constructor!=e&&(typeof e!=`function`&&console.error(`unknown Class:`+e),n.constructor=e)}var T={},E=T.ELEMENT_NODE=1,D=T.ATTRIBUTE_NODE=2,O=T.TEXT_NODE=3,k=T.CDATA_SECTION_NODE=4,ee=T.ENTITY_REFERENCE_NODE=5,A=T.ENTITY_NODE=6,j=T.PROCESSING_INSTRUCTION_NODE=7,te=T.COMMENT_NODE=8,M=T.DOCUMENT_NODE=9,N=T.DOCUMENT_TYPE_NODE=10,P=T.DOCUMENT_FRAGMENT_NODE=11,F=T.NOTATION_NODE=12,I=t.freeze({DOCUMENT_POSITION_DISCONNECTED:1,DOCUMENT_POSITION_PRECEDING:2,DOCUMENT_POSITION_FOLLOWING:4,DOCUMENT_POSITION_CONTAINS:8,DOCUMENT_POSITION_CONTAINED_BY:16,DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:32});function L(e,t){if(t.length<e.length)return L(t,e);var n=null;for(var r in e){if(e[r]!==t[r])return n;n=e[r]}return n}function R(e){return e.guid||=Math.random(),e.guid}function z(){}z.prototype={length:0,item:function(e){return e>=0&&e<this.length?this[e]:null},toString:function(e){for(var t=typeof e==`function`?{requireWellFormed:!1,splitCDATASections:!0,nodeFilter:e}:e?{requireWellFormed:!!e.requireWellFormed,splitCDATASections:e.splitCDATASections!==!1,nodeFilter:e.nodeFilter||null}:{requireWellFormed:!1,splitCDATASections:!0,nodeFilter:null},n=[],r=0;r<this.length;r++)Be(this[r],n,null,t);return n.join(``)},filter:function(e){return Array.prototype.filter.call(this,e)},indexOf:function(e){return Array.prototype.indexOf.call(this,e)}},z.prototype[Symbol.iterator]=function(){var e=this,t=0;return{next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0}},return:function(){return{done:!0}}}};function B(e,t){this._node=e,this._refresh=t,V(this)}function V(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!==t){var n=e._refresh(e._node);if(Ue(e,`length`,n.length),!e.$$length||n.length<e.$$length)for(var r=n.length;r in e;r++)i(e,r)&&delete e[r];C(n,e),e._inc=t}}B.prototype.item=function(e){return V(this),this[e]||null},w(B,z);function ne(){this._nsIndex=Object.create(null),this._noNsIndex=Object.create(null)}function H(e,t){for(var n=0;n<e.length;){if(e[n]===t)return n;n++}}function re(e,t,n){if(!t)return e._noNsIndex;var r=e._nsIndex[t];return!r&&n&&(r=e._nsIndex[t]=Object.create(null)),r}function ie(e,t,n){var r=re(e,t,!1);return r&&r[n]||null}function ae(e,t){re(e,t.namespaceURI,!0)[t.localName]=t}function oe(e,t){var n=re(e,t.namespaceURI,!1);n&&delete n[t.localName]}function U(e,t,n,r){if(r?t[H(t,r)]=n:(t[t.length]=n,t.length++),ae(t,n),e){n.ownerElement=e;var i=e.ownerDocument;i&&(r&&pe(i,e,r),fe(i,e,n))}}function se(e,t,n){var r=H(t,n);if(r>=0){for(var i=t.length-1;r<=i;)t[r]=t[++r];if(t.length=i,oe(t,n),e){var a=e.ownerDocument;a&&pe(a,e,n),n.ownerElement=null}}}ne.prototype={length:0,item:z.prototype.item,getNamedItem:function(e){this._ownerElement&&this._ownerElement._isInHTMLDocumentAndNamespace()&&(e=e.toLowerCase());for(var t=0;t<this.length;){var n=this[t];if(n.nodeName===e)return n;t++}return null},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!==this._ownerElement)throw new f(f.INUSE_ATTRIBUTE_ERR);var n=ie(this,e.namespaceURI,e.localName);return n===e?e:(U(this._ownerElement,this,e,n),n)},setNamedItemNS:function(e){return this.setNamedItem(e)},removeNamedItem:function(e){var t=this.getNamedItem(e);if(!t)throw new f(f.NOT_FOUND_ERR,e);return se(this._ownerElement,this,t),t},removeNamedItemNS:function(e,t){var n=this.getNamedItemNS(e,t);if(!n)throw new f(f.NOT_FOUND_ERR,e?e+` : `+t:t);return se(this._ownerElement,this,n),n},getNamedItemNS:function(e,t){e||=null;for(var n=0;n<this.length;){var r=this[n];if(r.localName===t&&r.namespaceURI===e)return r;n++}return null}},ne.prototype[Symbol.iterator]=function(){var e=this,t=0;return{next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0}},return:function(){return{done:!0}}}};function ce(){}ce.prototype={hasFeature:function(e,t){return!0},createDocument:function(e,t,n){var r=c.XML_APPLICATION;e===l.HTML?r=c.XML_XHTML_APPLICATION:e===l.SVG&&(r=c.XML_SVG_IMAGE);var i=new de(u,{contentType:r});if(i.implementation=this,i.childNodes=new z,i.doctype=n||null,n&&i.appendChild(n),t){var a=i.createElementNS(e,t);i.appendChild(a)}return i},createDocumentType:function(e,t,n,r){x(e);var i=new Ne(u);return i.name=e,i.nodeName=e,i.publicId=t||``,i.systemId=n||``,i.internalSubset=r||``,i.childNodes=new z,i},createHTMLDocument:function(e){var t=new de(u,{contentType:c.HTML});if(t.implementation=this,t.childNodes=new z,e!==!1){t.doctype=this.createDocumentType(`html`),t.doctype.ownerDocument=t,t.appendChild(t.doctype);var n=t.createElement(`html`);t.appendChild(n);var r=t.createElement(`head`);if(n.appendChild(r),typeof e==`string`){var i=t.createElement(`title`);i.appendChild(t.createTextNode(e)),r.appendChild(i)}n.appendChild(t.createElement(`body`))}return t}};function W(e){h(e)}W.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,parentNode:null,get parentElement(){return this.parentNode&&this.parentNode.nodeType===this.ELEMENT_NODE?this.parentNode:null},childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,baseURI:`about:blank`,get isConnected(){var e=this.getRootNode();return e&&e.nodeType===e.DOCUMENT_NODE},contains:function(e){if(!e)return!1;var t=e;do{if(this===t)return!0;t=t.parentNode}while(t);return!1},getRootNode:function(e){var t=this;do{if(!t.parentNode)return t;t=t.parentNode}while(t)},isEqualNode:function(e){if(!e)return!1;for(var t=[{node:this,other:e}];t.length>0;){var n=t.pop(),r=n.node,i=n.other;if(r.nodeType!==i.nodeType)return!1;switch(r.nodeType){case r.DOCUMENT_TYPE_NODE:if(r.name!==i.name||r.publicId!==i.publicId||r.systemId!==i.systemId)return!1;break;case r.ELEMENT_NODE:if(r.namespaceURI!==i.namespaceURI||r.prefix!==i.prefix||r.localName!==i.localName||r.attributes.length!==i.attributes.length)return!1;for(var a=0;a<r.attributes.length;a++){var o=r.attributes.item(a),s=i.getAttributeNodeNS(o.namespaceURI,o.localName);if(!s)return!1;t.push({node:o,other:s})}break;case r.ATTRIBUTE_NODE:if(r.namespaceURI!==i.namespaceURI||r.localName!==i.localName||r.value!==i.value)return!1;break;case r.PROCESSING_INSTRUCTION_NODE:if(r.target!==i.target||r.data!==i.data)return!1;break;case r.TEXT_NODE:case r.CDATA_SECTION_NODE:case r.COMMENT_NODE:if(r.data!==i.data)return!1}if(r.childNodes.length!==i.childNodes.length)return!1;for(var a=r.childNodes.length-1;a>=0;a--)t.push({node:r.childNodes[a],other:i.childNodes[a]})}return!0},isSameNode:function(e){return this===e},insertBefore:function(e,t){return Ee(this,e,t)},replaceChild:function(e,t){Ee(this,e,t,Te),t&&this.removeChild(t)},removeChild:function(e){return he(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(e){return He(this.ownerDocument||this,this,e)},normalize:function(){G(this,null,{enter:function(e){for(var t=e.firstChild;t;){var n=t.nextSibling;if(n!==null&&n.nodeType===O&&t.nodeType===O){for(var r=[],i=n;i!==null&&i.nodeType===O;)r.push(i.data),i=i.nextSibling;for(var a=t.nextSibling;a!==i;){var o=a.nextSibling;a.parentNode=null,a.previousSibling=null,a.nextSibling=null,a=o}t.nextSibling=i,i===null?e.lastChild=t:i.previousSibling=t,t.appendData(r.join(``)),me(e.ownerDocument,e),t=i}else t=n}return!0}})},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n){for(var r in n)if(i(n,r)&&n[r]===e)return r}t=t.nodeType==D?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&i(n,e))return n[e];t=t.nodeType==D?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return this.lookupPrefix(e)==null},compareDocumentPosition:function(e){if(this===e)return 0;var t=e,n=this,r=null,i=null;if(t instanceof Oe&&(r=t,t=r.ownerElement),n instanceof Oe&&(i=n,n=i.ownerElement,r&&t&&n===t))for(var a=0,o;o=n.attributes[a];a++){if(o===r)return I.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+I.DOCUMENT_POSITION_PRECEDING;if(o===i)return I.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+I.DOCUMENT_POSITION_FOLLOWING}if(!t||!n||n.ownerDocument!==t.ownerDocument)return I.DOCUMENT_POSITION_DISCONNECTED+I.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC+(R(n.ownerDocument)>R(t.ownerDocument)?I.DOCUMENT_POSITION_FOLLOWING:I.DOCUMENT_POSITION_PRECEDING);if(i&&t===n)return I.DOCUMENT_POSITION_CONTAINS+I.DOCUMENT_POSITION_PRECEDING;if(r&&t===n)return I.DOCUMENT_POSITION_CONTAINED_BY+I.DOCUMENT_POSITION_FOLLOWING;for(var s=[],c=t.parentNode;c;){if(!i&&c===n)return I.DOCUMENT_POSITION_CONTAINED_BY+I.DOCUMENT_POSITION_FOLLOWING;s.push(c),c=c.parentNode}s.reverse();for(var l=[],u=n.parentNode;u;){if(!r&&u===t)return I.DOCUMENT_POSITION_CONTAINS+I.DOCUMENT_POSITION_PRECEDING;l.push(u),u=u.parentNode}l.reverse();var d=L(s,l);for(var f in d.childNodes){var p=d.childNodes[f];if(p===n)return I.DOCUMENT_POSITION_FOLLOWING;if(p===t)return I.DOCUMENT_POSITION_PRECEDING;if(l.indexOf(p)>=0)return I.DOCUMENT_POSITION_FOLLOWING;if(s.indexOf(p)>=0)return I.DOCUMENT_POSITION_PRECEDING}return 0}};function le(e){return e==`<`&&`<`||e==`>`&&`>`||e==`&`&&`&`||e==`"`&&`"`||`&#`+e.charCodeAt()+`;`}C(T,W),C(T,W.prototype),C(I,W),C(I,W.prototype);function ue(e,t){G(e,null,{enter:function(e){return!t(e)||G.STOP}})}function G(e,t,n){for(var r=[{node:e,context:t,phase:G.ENTER}];r.length>0;){var i=r.pop();if(i.phase===G.ENTER){var a=n.enter(i.node,i.context);if(a===G.STOP)return G.STOP;if(r.push({node:i.node,context:a,phase:G.EXIT}),a==null)continue;for(var o=i.node.lastChild;o;)r.push({node:o,context:a,phase:G.ENTER}),o=o.previousSibling}else n.exit&&n.exit(i.node,i.context)}}G.STOP=Symbol(`walkDOM.STOP`),G.ENTER=0,G.EXIT=1;function de(e,t){h(e);var n=t||{};this.ownerDocument=this,this.contentType=n.contentType||c.XML_APPLICATION,this.type=a(this.contentType)?`html`:`xml`}function fe(e,t,n){e&&e._inc++,n.namespaceURI===l.XMLNS&&(t._nsMap[n.prefix?n.localName:``]=n.value)}function pe(e,t,n,r){e&&e._inc++,n.namespaceURI===l.XMLNS&&delete t._nsMap[n.prefix?n.localName:``]}function me(e,t,n){if(e&&e._inc){e._inc++;var r=t.childNodes;if(n&&!n.nextSibling)r[r.length++]=n;else{for(var i=t.firstChild,a=0;i;)r[a++]=i,i=i.nextSibling;r.length=a,delete r[r.length]}}}function he(e,t){if(e!==t.parentNode)throw new f(f.NOT_FOUND_ERR,`child's parent is not parent`);var n=t.previousSibling,r=t.nextSibling;return n?n.nextSibling=r:e.firstChild=r,r?r.previousSibling=n:e.lastChild=n,me(e.ownerDocument,e),t.parentNode=null,t.previousSibling=null,t.nextSibling=null,t}function ge(e){return e&&(e.nodeType===W.DOCUMENT_NODE||e.nodeType===W.DOCUMENT_FRAGMENT_NODE||e.nodeType===W.ELEMENT_NODE)}function _e(e){return e&&(e.nodeType===W.CDATA_SECTION_NODE||e.nodeType===W.COMMENT_NODE||e.nodeType===W.DOCUMENT_FRAGMENT_NODE||e.nodeType===W.DOCUMENT_TYPE_NODE||e.nodeType===W.ELEMENT_NODE||e.nodeType===W.PROCESSING_INSTRUCTION_NODE||e.nodeType===W.TEXT_NODE)}function ve(e){return e&&e.nodeType===W.DOCUMENT_TYPE_NODE}function ye(e){return e&&e.nodeType===W.ELEMENT_NODE}function be(e){return e&&e.nodeType===W.TEXT_NODE}function xe(e,t){var r=e.childNodes||[];if(n(r,ye)||ve(t))return!1;var i=n(r,ve);return!(t&&i&&r.indexOf(i)>r.indexOf(t))}function Se(e,t){var r=e.childNodes||[];function i(e){return ye(e)&&e!==t}if(n(r,i))return!1;var a=n(r,ve);return!(t&&a&&r.indexOf(a)>r.indexOf(t))}function Ce(e,t,n){if(!ge(e))throw new f(f.HIERARCHY_REQUEST_ERR,`Unexpected parent node type `+e.nodeType);if(n&&n.parentNode!==e)throw new f(f.NOT_FOUND_ERR,`child not in parent`);if(!_e(t)||ve(t)&&e.nodeType!==W.DOCUMENT_NODE)throw new f(f.HIERARCHY_REQUEST_ERR,`Unexpected node type `+t.nodeType+` for parent node type `+e.nodeType)}function we(e,t,r){var i=e.childNodes||[],a=t.childNodes||[];if(t.nodeType===W.DOCUMENT_FRAGMENT_NODE){var o=a.filter(ye);if(o.length>1||n(a,be))throw new f(f.HIERARCHY_REQUEST_ERR,`More than one element or text in fragment`);if(o.length===1&&!xe(e,r))throw new f(f.HIERARCHY_REQUEST_ERR,`Element in fragment can not be inserted before doctype`)}if(ye(t)&&!xe(e,r))throw new f(f.HIERARCHY_REQUEST_ERR,`Only one element can be added and only after doctype`);if(ve(t)){if(n(i,ve))throw new f(f.HIERARCHY_REQUEST_ERR,`Only one doctype is allowed`);var s=n(i,ye);if(r&&i.indexOf(s)<i.indexOf(r))throw new f(f.HIERARCHY_REQUEST_ERR,`Doctype can only be inserted before an element`);if(!r&&s)throw new f(f.HIERARCHY_REQUEST_ERR,`Doctype can not be appended since element is present`)}}function Te(e,t,r){var i=e.childNodes||[],a=t.childNodes||[];if(t.nodeType===W.DOCUMENT_FRAGMENT_NODE){var o=a.filter(ye);if(o.length>1||n(a,be))throw new f(f.HIERARCHY_REQUEST_ERR,`More than one element or text in fragment`);if(o.length===1&&!Se(e,r))throw new f(f.HIERARCHY_REQUEST_ERR,`Element in fragment can not be inserted before doctype`)}if(ye(t)&&!Se(e,r))throw new f(f.HIERARCHY_REQUEST_ERR,`Only one element can be added and only after doctype`);if(ve(t)){function e(e){return ve(e)&&e!==r}if(n(i,e))throw new f(f.HIERARCHY_REQUEST_ERR,`Only one doctype is allowed`);var s=n(i,ye);if(r&&i.indexOf(s)<i.indexOf(r))throw new f(f.HIERARCHY_REQUEST_ERR,`Doctype can only be inserted before an element`)}}function Ee(e,t,n,r){Ce(e,t,n),e.nodeType===W.DOCUMENT_NODE&&(r||we)(e,t,n);var i=t.parentNode;if(i&&i.removeChild(t),t.nodeType===P){var a=t.firstChild;if(a==null)return t;var o=t.lastChild}else a=o=t;var s=n?n.previousSibling:e.lastChild;a.previousSibling=s,o.nextSibling=n,s?s.nextSibling=a:e.firstChild=a,n==null?e.lastChild=o:n.previousSibling=o;do a.parentNode=e;while(a!==o&&(a=a.nextSibling));return me(e.ownerDocument||e,e,t),t.nodeType==P&&(t.firstChild=t.lastChild=null),t}de.prototype={implementation:null,nodeName:`#document`,nodeType:M,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType===P){for(var n=e.firstChild;n;){var r=n.nextSibling;this.insertBefore(n,t),n=r}return e}return Ee(this,e,t),e.ownerDocument=this,this.documentElement===null&&e.nodeType===E&&(this.documentElement=e),e},removeChild:function(e){var t=he(this,e);return t===this.documentElement&&(this.documentElement=null),t},replaceChild:function(e,t){Ee(this,e,t,Te),e.ownerDocument=this,t&&this.removeChild(t),ye(e)&&(this.documentElement=e)},importNode:function(e,t){return Ve(this,e,t)},getElementById:function(e){var t=null;return ue(this.documentElement,function(n){if(n.nodeType==E&&n.getAttribute(`id`)==e)return t=n,!0}),t},createElement:function(e){var t=new De(u);t.ownerDocument=this,this.type===`html`&&(e=e.toLowerCase()),r(this.contentType)&&(t.namespaceURI=l.HTML),t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new z;var n=t.attributes=new ne;return n._ownerElement=t,t},createDocumentFragment:function(){var e=new Ie(u);return e.ownerDocument=this,e.childNodes=new z,e},createTextNode:function(e){var t=new Ae(u);return t.ownerDocument=this,t.childNodes=new z,t.appendData(e),t},createComment:function(e){var t=new je(u);return t.ownerDocument=this,t.childNodes=new z,t.appendData(e),t},createCDATASection:function(e){if(e.indexOf(`]]>`)!==-1)throw new f(f.INVALID_CHARACTER_ERR,`data contains "]]>"`);var t=new Me(u);return t.ownerDocument=this,t.childNodes=new z,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new q(u);return n.ownerDocument=this,n.childNodes=new z,n.nodeName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){if(!m.QName_exact.test(e))throw new f(f.INVALID_CHARACTER_ERR,`invalid character in name "`+e+`"`);return this.type===`html`&&(e=e.toLowerCase()),this._createAttribute(e)},_createAttribute:function(e){var t=new Oe(u);return t.ownerDocument=this,t.childNodes=new z,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){if(!m.Name_exact.test(e))throw new f(f.INVALID_CHARACTER_ERR,`not a valid xml name "`+e+`"`);if(this.type===`html`)throw new f(`document is an html document`,p.NotSupportedError);var t=new Fe(u);return t.ownerDocument=this,t.childNodes=new z,t.nodeName=e,t},createElementNS:function(e,t){var n=S(e,t),r=new De(u),i=r.attributes=new ne;return r.childNodes=new z,r.ownerDocument=this,r.nodeName=t,r.tagName=t,r.namespaceURI=n[0],r.prefix=n[1],r.localName=n[2],i._ownerElement=r,r},createAttributeNS:function(e,t){var n=S(e,t),r=new Oe(u);return r.ownerDocument=this,r.childNodes=new z,r.nodeName=t,r.name=t,r.specified=!0,r.namespaceURI=n[0],r.prefix=n[1],r.localName=n[2],r}},w(de,W);function De(e){h(e),this._nsMap=Object.create(null)}De.prototype={nodeType:E,attributes:null,getQualifiedName:function(){return this.prefix?this.prefix+`:`+this.localName:this.localName},_isInHTMLDocumentAndNamespace:function(){return this.ownerDocument.type===`html`&&this.namespaceURI===l.HTML},hasAttributes:function(){return!!(this.attributes&&this.attributes.length)},hasAttribute:function(e){return!!this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t?t.value:null},getAttributeNode:function(e){return this._isInHTMLDocumentAndNamespace()&&(e=e.toLowerCase()),this.attributes.getNamedItem(e)},setAttribute:function(e,t){this._isInHTMLDocumentAndNamespace()&&(e=e.toLowerCase());var n=this.getAttributeNode(e);n?n.value=n.nodeValue=``+t:(n=this.ownerDocument._createAttribute(e),n.value=n.nodeValue=``+t,this.setAttributeNode(n))},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return this.getAttributeNodeNS(e,t)!=null},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n?n.value:null},setAttributeNS:function(e,t,n){var r=S(e,t)[2],i=this.getAttributeNodeNS(e,r);i?i.value=i.nodeValue=``+n:(i=this.ownerDocument.createAttributeNS(e,t),i.value=i.nodeValue=``+n,this.setAttributeNode(i))},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByClassName:function(e){var t=y(e);return new B(this,function(n){var r=[];return t.length>0&&ue(n,function(i){if(i!==n&&i.nodeType===E){var a=i.getAttribute(`class`);if(a){var o=e===a;if(!o){var s=y(a);o=t.every(b(s))}o&&r.push(i)}}}),r})},getElementsByTagName:function(e){var t=(this.nodeType===M?this:this.ownerDocument).type===`html`,n=e.toLowerCase();return new B(this,function(r){var i=[];return ue(r,function(a){a!==r&&a.nodeType===E&&(e===`*`||a.getQualifiedName()===(t&&a.namespaceURI===l.HTML?n:e))&&i.push(a)}),i})},getElementsByTagNameNS:function(e,t){return new B(this,function(n){var r=[];return ue(n,function(i){i===n||i.nodeType!==E||e!==`*`&&i.namespaceURI!==e||t!==`*`&&i.localName!=t||r.push(i)}),r})}},de.prototype.getElementsByClassName=De.prototype.getElementsByClassName,de.prototype.getElementsByTagName=De.prototype.getElementsByTagName,de.prototype.getElementsByTagNameNS=De.prototype.getElementsByTagNameNS,w(De,W);function Oe(e){h(e),this.namespaceURI=null,this.prefix=null,this.ownerElement=null}Oe.prototype.nodeType=D,w(Oe,W);function ke(e){h(e)}ke.prototype={data:``,substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},deleteData:function(e,t){this.replaceData(e,t,``)},replaceData:function(e,t,n){var r=this.data.substring(0,e),i=this.data.substring(e+t);n=r+n+i,this.nodeValue=this.data=n,this.length=n.length}},w(ke,W);function Ae(e){h(e)}Ae.prototype={nodeName:`#text`,nodeType:O,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var r=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}},w(Ae,ke);function je(e){h(e)}je.prototype={nodeName:`#comment`,nodeType:te},w(je,ke);function Me(e){h(e)}Me.prototype={nodeName:`#cdata-section`,nodeType:k},w(Me,Ae);function Ne(e){h(e)}Ne.prototype.nodeType=N,w(Ne,W);function Pe(e){h(e)}Pe.prototype.nodeType=F,w(Pe,W);function K(e){h(e)}K.prototype.nodeType=A,w(K,W);function Fe(e){h(e)}Fe.prototype.nodeType=ee,w(Fe,W);function Ie(e){h(e)}Ie.prototype.nodeName=`#document-fragment`,Ie.prototype.nodeType=P,w(Ie,W);function q(e){h(e)}q.prototype.nodeType=j,w(q,ke);function Le(){}Le.prototype.serializeToString=function(e,t){return Re.call(e,t)},W.prototype.toString=Re;function Re(e){var t=typeof e==`function`?{requireWellFormed:!1,splitCDATASections:!0,nodeFilter:e}:e==null?{requireWellFormed:!1,splitCDATASections:!0,nodeFilter:null}:{requireWellFormed:!!e.requireWellFormed,splitCDATASections:e.splitCDATASections!==!1,nodeFilter:e.nodeFilter||null},n=[],r=this.nodeType===M&&this.documentElement||this,i=r.prefix,a=r.namespaceURI;if(a&&i==null){var i=r.lookupPrefix(a);if(i==null)var o=[{namespace:a,prefix:null}]}return Be(this,n,o,t),n.join(``)}function ze(e,t,n){var r=e.prefix||``,i=e.namespaceURI;if(!i||r===`xml`&&i===l.XML||i===l.XMLNS)return!1;for(var a=n.length;a--;){var o=n[a];if(o.prefix===r)return o.namespace!==i}return!0}function J(e,t,n,r){if(r&&!m.QName_exact.test(t))throw new f(`The attribute name "`+t+`" is not a valid XML QName`,p.InvalidStateError);e.push(` `,t,`="`,n.replace(/[<>&"\t\n\r]/g,le),`"`)}function Be(e,t,n,r){n||=[];var i=r.nodeFilter,a=r.requireWellFormed,c=r.splitCDATASections,u=(e.nodeType===M?e:e.ownerDocument).type===`html`;G(e,{ns:n},{enter:function(e,n){var d=n.ns;if(i){if(e=i(e),e){if(typeof e==`string`)return t.push(e),null}else return null}switch(e.nodeType){case E:var h=e.attributes,g=h.length,_=e.tagName,v=_;if(!u&&!e.prefix&&e.namespaceURI){for(var y,b=0;b<h.length;b++)if(h.item(b).name===`xmlns`){y=h.item(b).value;break}if(!y)for(var x=d.length-1;x>=0;x--){var S=d[x];if(S.prefix===``&&S.namespace===e.namespaceURI){y=S.namespace;break}}if(y!==e.namespaceURI)for(var x=d.length-1;x>=0;x--){var S=d[x];if(S.namespace===e.namespaceURI){S.prefix&&(v=S.prefix+`:`+_);break}}}if(a&&!m.QName_exact.test(v))throw new f(`The element name "`+v+`" is not a valid XML QName`,p.InvalidStateError);t.push(`<`,v);for(var C=d.slice(),w=0;w<g;w++){var T=h.item(w);T.prefix==`xmlns`?C.push({prefix:T.localName,namespace:T.value}):T.nodeName==`xmlns`&&C.push({prefix:``,namespace:T.value})}for(var w=0;w<g;w++){var T=h.item(w);if(ze(T,u,C)){var A=T.prefix||``,F=T.namespaceURI;J(t,A?`xmlns:`+A:`xmlns`,F,a),C.push({prefix:A,namespace:F})}var I=i?i(T):T;I&&(typeof I==`string`?t.push(I):J(t,I.name,I.value,a))}if(_===v&&ze(e,u,C)){var L=e.prefix||``,F=e.namespaceURI;J(t,L?`xmlns:`+L:`xmlns`,F,a),C.push({prefix:L,namespace:F})}var R=!e.firstChild;if(R&&(u||e.namespaceURI===l.HTML)&&(R=s(_)),R)return t.push(`/>`),null;if(t.push(`>`),u&&o(_)){for(var z=e.firstChild;z;)z.data?t.push(z.data):Be(z,t,C.slice(),r),z=z.nextSibling;return t.push(`</`,v,`>`),null}return{ns:C,tag:v};case M:case P:if(a&&e.nodeType===M&&e.documentElement==null)throw new f(`The Document has no documentElement`,p.InvalidStateError);return{ns:d};case D:return J(t,e.name,e.value,a),null;case O:if(a&&m.InvalidChar.test(e.data))throw new f(`The Text node data contains characters outside the XML Char production`,p.InvalidStateError);return t.push(e.data.replace(/[<&>]/g,le)),null;case k:if(a&&e.data.indexOf(`]]>`)!==-1)throw new f(`The CDATASection data contains "]]>"`,p.InvalidStateError);return c?t.push(m.CDATA_START,e.data.replace(/]]>/g,`]]]]><![CDATA[>`),m.CDATA_END):t.push(m.CDATA_START,e.data,m.CDATA_END),null;case te:if(a){if(m.InvalidChar.test(e.data))throw new f(`The comment node data contains characters outside the XML Char production`,p.InvalidStateError);if(e.data.indexOf(`--`)!==-1||e.data[e.data.length-1]===`-`)throw new f(`The comment node data contains "--" or ends with "-"`,p.InvalidStateError)}return t.push(m.COMMENT_START,e.data,m.COMMENT_END),null;case N:var B=e.publicId,V=e.systemId;if(a){if(!m.Name_exact.test(e.name))throw new f(`The doctype name "`+e.name+`" is not a valid XML Name`,p.InvalidStateError);if(B&&!m.PubidLiteral_match.test(B))throw new f(`DocumentType publicId is not a valid PubidLiteral`,p.InvalidStateError);if(V&&V!==`.`&&!m.SystemLiteral_match.test(V))throw new f(`DocumentType systemId is not a valid SystemLiteral`,p.InvalidStateError);if(e.internalSubset&&e.internalSubset.indexOf(`]>`)!==-1)throw new f(`DocumentType internalSubset contains "]>"`,p.InvalidStateError)}return t.push(m.DOCTYPE_DECL_START,` `,e.name),B?(t.push(` `,m.PUBLIC,` `,B),V&&V!==`.`&&t.push(` `,V)):V&&V!==`.`&&t.push(` `,m.SYSTEM,` `,V),e.internalSubset&&t.push(` [`,e.internalSubset,`]`),t.push(`>`),null;case j:if(a){if(!m.NCName_exact.test(e.target)||e.target.toLowerCase()===`xml`)throw new f(`The processing instruction target "`+e.target+`" is not a valid XML NCName or is reserved`,p.InvalidStateError);if(m.InvalidChar.test(e.data))throw new f(`The ProcessingInstruction data contains characters outside the XML Char production`,p.InvalidStateError);if(e.data.indexOf(`?>`)!==-1)throw new f(`The ProcessingInstruction data contains "?>"`,p.InvalidStateError)}return t.push(`<?`,e.target,` `,e.data,`?>`),null;case ee:if(a&&!m.Name_exact.test(e.nodeName))throw new f(`The entity reference name "`+e.nodeName+`" is not a valid XML Name`,p.InvalidStateError);return t.push(`&`,e.nodeName,`;`),null;default:return t.push(`??`,e.nodeName),null}},exit:function(e,n){n&&n.tag&&t.push(`</`,n.tag,`>`)}})}function Ve(e,t,n){var r;return G(t,null,{enter:function(t,i){var a=t.cloneNode(!1);return a.ownerDocument=e,a.parentNode=null,i===null?r=a:i.appendChild(a),t.nodeType===D||n?a:null}}),r}function He(e,t,n){var r;return G(t,null,{enter:function(t,a){var o=new t.constructor(u);for(var s in t)if(i(t,s)){var c=t[s];typeof c!=`object`&&c!=o[s]&&(o[s]=c)}t.childNodes&&(o.childNodes=new z),o.ownerDocument=e;var l=n;switch(o.nodeType){case E:var d=t.attributes,f=o.attributes=new ne,p=d.length;f._ownerElement=o;for(var m=0;m<p;m++)o.setAttributeNode(He(e,d.item(m),!0));break;case D:l=!0}return a===null?r=o:a.appendChild(o),l?o:null}}),r}function Ue(e,t,n){e[t]=n}function We(e){for(var t=[],n=e.firstChild;n;)n.nodeType===E&&t.push(n),n=n.nextSibling;return t}try{Object.defineProperty&&(Object.defineProperty(B.prototype,"length",{get:function(){return V(this),this.$$length}}),Object.defineProperty(W.prototype,"textContent",{get:function(){if(this.nodeType===E||this.nodeType===P){var e=[];return G(this,null,{enter:function(t){if(t.nodeType===E||t.nodeType===P)return!0;if(t.nodeType===j||t.nodeType===te)return null;e.push(t.nodeValue)}}),e.join(``)}return this.nodeValue},set:function(e){switch(this.nodeType){case E:case P:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),Object.defineProperty(ke.prototype,"data",{get:function(){return this._data==null?``:this._data},set:function(e){this._data=e,this.length=typeof e==`string`?e.length:0}}),Object.defineProperty(ke.prototype,"nodeValue",{get:function(){return this.data},set:function(e){this.data=e},enumerable:!0,configurable:!0}),Object.defineProperty(De.prototype,"children",{get:function(){return new B(this,We)}}),Object.defineProperty(de.prototype,"children",{get:function(){return new B(this,We)}}),Object.defineProperty(Ie.prototype,"children",{get:function(){return new B(this,We)}}),Ue=function(e,t,n){e[`$$`+t]=n})}catch{}e._updateLiveList=V,e.Attr=Oe,e.CDATASection=Me,e.CharacterData=ke,e.Comment=je,e.Document=de,e.DocumentFragment=Ie,e.DocumentType=Ne,e.DOMImplementation=ce,e.Element=De,e.Entity=K,e.EntityReference=Fe,e.LiveNodeList=B,e.NamedNodeMap=ne,e.Node=W,e.NodeList=z,e.Notation=Pe,e.Text=Ae,e.ProcessingInstruction=q,e.walkDOM=G,e.XMLSerializer=Le})),_i=/* @__PURE__ */ r((e=>{var t=pi().freeze;e.XML_ENTITIES=t({amp:`&`,apos:`'`,gt:`>`,lt:`<`,quot:`"`}),e.HTML_ENTITIES=t({Aacute:`Á`,aacute:`á`,Abreve:`Ă`,abreve:`ă`,ac:`∾`,acd:`∿`,acE:`∾̳`,Acirc:`Â`,acirc:`â`,acute:`´`,Acy:`А`,acy:`а`,AElig:`Æ`,aelig:`æ`,af:``,Afr:`𝔄`,afr:`𝔞`,Agrave:`À`,agrave:`à`,alefsym:`ℵ`,aleph:`ℵ`,Alpha:`Α`,alpha:`α`,Amacr:`Ā`,amacr:`ā`,amalg:`⨿`,AMP:`&`,amp:`&`,And:`⩓`,and:`∧`,andand:`⩕`,andd:`⩜`,andslope:`⩘`,andv:`⩚`,ang:`∠`,ange:`⦤`,angle:`∠`,angmsd:`∡`,angmsdaa:`⦨`,angmsdab:`⦩`,angmsdac:`⦪`,angmsdad:`⦫`,angmsdae:`⦬`,angmsdaf:`⦭`,angmsdag:`⦮`,angmsdah:`⦯`,angrt:`∟`,angrtvb:`⊾`,angrtvbd:`⦝`,angsph:`∢`,angst:`Å`,angzarr:`⍼`,Aogon:`Ą`,aogon:`ą`,Aopf:`𝔸`,aopf:`𝕒`,ap:`≈`,apacir:`⩯`,apE:`⩰`,ape:`≊`,apid:`≋`,apos:`'`,ApplyFunction:``,approx:`≈`,approxeq:`≊`,Aring:`Å`,aring:`å`,Ascr:`𝒜`,ascr:`𝒶`,Assign:`≔`,ast:`*`,asymp:`≈`,asympeq:`≍`,Atilde:`Ã`,atilde:`ã`,Auml:`Ä`,auml:`ä`,awconint:`∳`,awint:`⨑`,backcong:`≌`,backepsilon:`϶`,backprime:`‵`,backsim:`∽`,backsimeq:`⋍`,Backslash:`∖`,Barv:`⫧`,barvee:`⊽`,Barwed:`⌆`,barwed:`⌅`,barwedge:`⌅`,bbrk:`⎵`,bbrktbrk:`⎶`,bcong:`≌`,Bcy:`Б`,bcy:`б`,bdquo:`„`,becaus:`∵`,Because:`∵`,because:`∵`,bemptyv:`⦰`,bepsi:`϶`,bernou:`ℬ`,Bernoullis:`ℬ`,Beta:`Β`,beta:`β`,beth:`ℶ`,between:`≬`,Bfr:`𝔅`,bfr:`𝔟`,bigcap:`⋂`,bigcirc:`◯`,bigcup:`⋃`,bigodot:`⨀`,bigoplus:`⨁`,bigotimes:`⨂`,bigsqcup:`⨆`,bigstar:`★`,bigtriangledown:`▽`,bigtriangleup:`△`,biguplus:`⨄`,bigvee:`⋁`,bigwedge:`⋀`,bkarow:`⤍`,blacklozenge:`⧫`,blacksquare:`▪`,blacktriangle:`▴`,blacktriangledown:`▾`,blacktriangleleft:`◂`,blacktriangleright:`▸`,blank:`␣`,blk12:`▒`,blk14:`░`,blk34:`▓`,block:`█`,bne:`=⃥`,bnequiv:`≡⃥`,bNot:`⫭`,bnot:`⌐`,Bopf:`𝔹`,bopf:`𝕓`,bot:`⊥`,bottom:`⊥`,bowtie:`⋈`,boxbox:`⧉`,boxDL:`╗`,boxDl:`╖`,boxdL:`╕`,boxdl:`┐`,boxDR:`╔`,boxDr:`╓`,boxdR:`╒`,boxdr:`┌`,boxH:`═`,boxh:`─`,boxHD:`╦`,boxHd:`╤`,boxhD:`╥`,boxhd:`┬`,boxHU:`╩`,boxHu:`╧`,boxhU:`╨`,boxhu:`┴`,boxminus:`⊟`,boxplus:`⊞`,boxtimes:`⊠`,boxUL:`╝`,boxUl:`╜`,boxuL:`╛`,boxul:`┘`,boxUR:`╚`,boxUr:`╙`,boxuR:`╘`,boxur:`└`,boxV:`║`,boxv:`│`,boxVH:`╬`,boxVh:`╫`,boxvH:`╪`,boxvh:`┼`,boxVL:`╣`,boxVl:`╢`,boxvL:`╡`,boxvl:`┤`,boxVR:`╠`,boxVr:`╟`,boxvR:`╞`,boxvr:`├`,bprime:`‵`,Breve:`˘`,breve:`˘`,brvbar:`¦`,Bscr:`ℬ`,bscr:`𝒷`,bsemi:`⁏`,bsim:`∽`,bsime:`⋍`,bsol:`\\`,bsolb:`⧅`,bsolhsub:`⟈`,bull:`•`,bullet:`•`,bump:`≎`,bumpE:`⪮`,bumpe:`≏`,Bumpeq:`≎`,bumpeq:`≏`,Cacute:`Ć`,cacute:`ć`,Cap:`⋒`,cap:`∩`,capand:`⩄`,capbrcup:`⩉`,capcap:`⩋`,capcup:`⩇`,capdot:`⩀`,CapitalDifferentialD:`ⅅ`,caps:`∩︀`,caret:`⁁`,caron:`ˇ`,Cayleys:`ℭ`,ccaps:`⩍`,Ccaron:`Č`,ccaron:`č`,Ccedil:`Ç`,ccedil:`ç`,Ccirc:`Ĉ`,ccirc:`ĉ`,Cconint:`∰`,ccups:`⩌`,ccupssm:`⩐`,Cdot:`Ċ`,cdot:`ċ`,cedil:`¸`,Cedilla:`¸`,cemptyv:`⦲`,cent:`¢`,CenterDot:`·`,centerdot:`·`,Cfr:`ℭ`,cfr:`𝔠`,CHcy:`Ч`,chcy:`ч`,check:`✓`,checkmark:`✓`,Chi:`Χ`,chi:`χ`,cir:`○`,circ:`ˆ`,circeq:`≗`,circlearrowleft:`↺`,circlearrowright:`↻`,circledast:`⊛`,circledcirc:`⊚`,circleddash:`⊝`,CircleDot:`⊙`,circledR:`®`,circledS:`Ⓢ`,CircleMinus:`⊖`,CirclePlus:`⊕`,CircleTimes:`⊗`,cirE:`⧃`,cire:`≗`,cirfnint:`⨐`,cirmid:`⫯`,cirscir:`⧂`,ClockwiseContourIntegral:`∲`,CloseCurlyDoubleQuote:`”`,CloseCurlyQuote:`’`,clubs:`♣`,clubsuit:`♣`,Colon:`∷`,colon:`:`,Colone:`⩴`,colone:`≔`,coloneq:`≔`,comma:`,`,commat:`@`,comp:`∁`,compfn:`∘`,complement:`∁`,complexes:`ℂ`,cong:`≅`,congdot:`⩭`,Congruent:`≡`,Conint:`∯`,conint:`∮`,ContourIntegral:`∮`,Copf:`ℂ`,copf:`𝕔`,coprod:`∐`,Coproduct:`∐`,COPY:`©`,copy:`©`,copysr:`℗`,CounterClockwiseContourIntegral:`∳`,crarr:`↵`,Cross:`⨯`,cross:`✗`,Cscr:`𝒞`,cscr:`𝒸`,csub:`⫏`,csube:`⫑`,csup:`⫐`,csupe:`⫒`,ctdot:`⋯`,cudarrl:`⤸`,cudarrr:`⤵`,cuepr:`⋞`,cuesc:`⋟`,cularr:`↶`,cularrp:`⤽`,Cup:`⋓`,cup:`∪`,cupbrcap:`⩈`,CupCap:`≍`,cupcap:`⩆`,cupcup:`⩊`,cupdot:`⊍`,cupor:`⩅`,cups:`∪︀`,curarr:`↷`,curarrm:`⤼`,curlyeqprec:`⋞`,curlyeqsucc:`⋟`,curlyvee:`⋎`,curlywedge:`⋏`,curren:`¤`,curvearrowleft:`↶`,curvearrowright:`↷`,cuvee:`⋎`,cuwed:`⋏`,cwconint:`∲`,cwint:`∱`,cylcty:`⌭`,Dagger:`‡`,dagger:`†`,daleth:`ℸ`,Darr:`↡`,dArr:`⇓`,darr:`↓`,dash:`‐`,Dashv:`⫤`,dashv:`⊣`,dbkarow:`⤏`,dblac:`˝`,Dcaron:`Ď`,dcaron:`ď`,Dcy:`Д`,dcy:`д`,DD:`ⅅ`,dd:`ⅆ`,ddagger:`‡`,ddarr:`⇊`,DDotrahd:`⤑`,ddotseq:`⩷`,deg:`°`,Del:`∇`,Delta:`Δ`,delta:`δ`,demptyv:`⦱`,dfisht:`⥿`,Dfr:`𝔇`,dfr:`𝔡`,dHar:`⥥`,dharl:`⇃`,dharr:`⇂`,DiacriticalAcute:`´`,DiacriticalDot:`˙`,DiacriticalDoubleAcute:`˝`,DiacriticalGrave:"`",DiacriticalTilde:`˜`,diam:`⋄`,Diamond:`⋄`,diamond:`⋄`,diamondsuit:`♦`,diams:`♦`,die:`¨`,DifferentialD:`ⅆ`,digamma:`ϝ`,disin:`⋲`,div:`÷`,divide:`÷`,divideontimes:`⋇`,divonx:`⋇`,DJcy:`Ђ`,djcy:`ђ`,dlcorn:`⌞`,dlcrop:`⌍`,dollar:`$`,Dopf:`𝔻`,dopf:`𝕕`,Dot:`¨`,dot:`˙`,DotDot:`⃜`,doteq:`≐`,doteqdot:`≑`,DotEqual:`≐`,dotminus:`∸`,dotplus:`∔`,dotsquare:`⊡`,doublebarwedge:`⌆`,DoubleContourIntegral:`∯`,DoubleDot:`¨`,DoubleDownArrow:`⇓`,DoubleLeftArrow:`⇐`,DoubleLeftRightArrow:`⇔`,DoubleLeftTee:`⫤`,DoubleLongLeftArrow:`⟸`,DoubleLongLeftRightArrow:`⟺`,DoubleLongRightArrow:`⟹`,DoubleRightArrow:`⇒`,DoubleRightTee:`⊨`,DoubleUpArrow:`⇑`,DoubleUpDownArrow:`⇕`,DoubleVerticalBar:`∥`,DownArrow:`↓`,Downarrow:`⇓`,downarrow:`↓`,DownArrowBar:`⤓`,DownArrowUpArrow:`⇵`,DownBreve:`̑`,downdownarrows:`⇊`,downharpoonleft:`⇃`,downharpoonright:`⇂`,DownLeftRightVector:`⥐`,DownLeftTeeVector:`⥞`,DownLeftVector:`↽`,DownLeftVectorBar:`⥖`,DownRightTeeVector:`⥟`,DownRightVector:`⇁`,DownRightVectorBar:`⥗`,DownTee:`⊤`,DownTeeArrow:`↧`,drbkarow:`⤐`,drcorn:`⌟`,drcrop:`⌌`,Dscr:`𝒟`,dscr:`𝒹`,DScy:`Ѕ`,dscy:`ѕ`,dsol:`⧶`,Dstrok:`Đ`,dstrok:`đ`,dtdot:`⋱`,dtri:`▿`,dtrif:`▾`,duarr:`⇵`,duhar:`⥯`,dwangle:`⦦`,DZcy:`Џ`,dzcy:`џ`,dzigrarr:`⟿`,Eacute:`É`,eacute:`é`,easter:`⩮`,Ecaron:`Ě`,ecaron:`ě`,ecir:`≖`,Ecirc:`Ê`,ecirc:`ê`,ecolon:`≕`,Ecy:`Э`,ecy:`э`,eDDot:`⩷`,Edot:`Ė`,eDot:`≑`,edot:`ė`,ee:`ⅇ`,efDot:`≒`,Efr:`𝔈`,efr:`𝔢`,eg:`⪚`,Egrave:`È`,egrave:`è`,egs:`⪖`,egsdot:`⪘`,el:`⪙`,Element:`∈`,elinters:`⏧`,ell:`ℓ`,els:`⪕`,elsdot:`⪗`,Emacr:`Ē`,emacr:`ē`,empty:`∅`,emptyset:`∅`,EmptySmallSquare:`◻`,emptyv:`∅`,EmptyVerySmallSquare:`▫`,emsp:` `,emsp13:` `,emsp14:` `,ENG:`Ŋ`,eng:`ŋ`,ensp:` `,Eogon:`Ę`,eogon:`ę`,Eopf:`𝔼`,eopf:`𝕖`,epar:`⋕`,eparsl:`⧣`,eplus:`⩱`,epsi:`ε`,Epsilon:`Ε`,epsilon:`ε`,epsiv:`ϵ`,eqcirc:`≖`,eqcolon:`≕`,eqsim:`≂`,eqslantgtr:`⪖`,eqslantless:`⪕`,Equal:`⩵`,equals:`=`,EqualTilde:`≂`,equest:`≟`,Equilibrium:`⇌`,equiv:`≡`,equivDD:`⩸`,eqvparsl:`⧥`,erarr:`⥱`,erDot:`≓`,Escr:`ℰ`,escr:`ℯ`,esdot:`≐`,Esim:`⩳`,esim:`≂`,Eta:`Η`,eta:`η`,ETH:`Ð`,eth:`ð`,Euml:`Ë`,euml:`ë`,euro:`€`,excl:`!`,exist:`∃`,Exists:`∃`,expectation:`ℰ`,ExponentialE:`ⅇ`,exponentiale:`ⅇ`,fallingdotseq:`≒`,Fcy:`Ф`,fcy:`ф`,female:`♀`,ffilig:`ffi`,fflig:`ff`,ffllig:`ffl`,Ffr:`𝔉`,ffr:`𝔣`,filig:`fi`,FilledSmallSquare:`◼`,FilledVerySmallSquare:`▪`,fjlig:`fj`,flat:`♭`,fllig:`fl`,fltns:`▱`,fnof:`ƒ`,Fopf:`𝔽`,fopf:`𝕗`,ForAll:`∀`,forall:`∀`,fork:`⋔`,forkv:`⫙`,Fouriertrf:`ℱ`,fpartint:`⨍`,frac12:`½`,frac13:`⅓`,frac14:`¼`,frac15:`⅕`,frac16:`⅙`,frac18:`⅛`,frac23:`⅔`,frac25:`⅖`,frac34:`¾`,frac35:`⅗`,frac38:`⅜`,frac45:`⅘`,frac56:`⅚`,frac58:`⅝`,frac78:`⅞`,frasl:`⁄`,frown:`⌢`,Fscr:`ℱ`,fscr:`𝒻`,gacute:`ǵ`,Gamma:`Γ`,gamma:`γ`,Gammad:`Ϝ`,gammad:`ϝ`,gap:`⪆`,Gbreve:`Ğ`,gbreve:`ğ`,Gcedil:`Ģ`,Gcirc:`Ĝ`,gcirc:`ĝ`,Gcy:`Г`,gcy:`г`,Gdot:`Ġ`,gdot:`ġ`,gE:`≧`,ge:`≥`,gEl:`⪌`,gel:`⋛`,geq:`≥`,geqq:`≧`,geqslant:`⩾`,ges:`⩾`,gescc:`⪩`,gesdot:`⪀`,gesdoto:`⪂`,gesdotol:`⪄`,gesl:`⋛︀`,gesles:`⪔`,Gfr:`𝔊`,gfr:`𝔤`,Gg:`⋙`,gg:`≫`,ggg:`⋙`,gimel:`ℷ`,GJcy:`Ѓ`,gjcy:`ѓ`,gl:`≷`,gla:`⪥`,glE:`⪒`,glj:`⪤`,gnap:`⪊`,gnapprox:`⪊`,gnE:`≩`,gne:`⪈`,gneq:`⪈`,gneqq:`≩`,gnsim:`⋧`,Gopf:`𝔾`,gopf:`𝕘`,grave:"`",GreaterEqual:`≥`,GreaterEqualLess:`⋛`,GreaterFullEqual:`≧`,GreaterGreater:`⪢`,GreaterLess:`≷`,GreaterSlantEqual:`⩾`,GreaterTilde:`≳`,Gscr:`𝒢`,gscr:`ℊ`,gsim:`≳`,gsime:`⪎`,gsiml:`⪐`,Gt:`≫`,GT:`>`,gt:`>`,gtcc:`⪧`,gtcir:`⩺`,gtdot:`⋗`,gtlPar:`⦕`,gtquest:`⩼`,gtrapprox:`⪆`,gtrarr:`⥸`,gtrdot:`⋗`,gtreqless:`⋛`,gtreqqless:`⪌`,gtrless:`≷`,gtrsim:`≳`,gvertneqq:`≩︀`,gvnE:`≩︀`,Hacek:`ˇ`,hairsp:` `,half:`½`,hamilt:`ℋ`,HARDcy:`Ъ`,hardcy:`ъ`,hArr:`⇔`,harr:`↔`,harrcir:`⥈`,harrw:`↭`,Hat:`^`,hbar:`ℏ`,Hcirc:`Ĥ`,hcirc:`ĥ`,hearts:`♥`,heartsuit:`♥`,hellip:`…`,hercon:`⊹`,Hfr:`ℌ`,hfr:`𝔥`,HilbertSpace:`ℋ`,hksearow:`⤥`,hkswarow:`⤦`,hoarr:`⇿`,homtht:`∻`,hookleftarrow:`↩`,hookrightarrow:`↪`,Hopf:`ℍ`,hopf:`𝕙`,horbar:`―`,HorizontalLine:`─`,Hscr:`ℋ`,hscr:`𝒽`,hslash:`ℏ`,Hstrok:`Ħ`,hstrok:`ħ`,HumpDownHump:`≎`,HumpEqual:`≏`,hybull:`⁃`,hyphen:`‐`,Iacute:`Í`,iacute:`í`,ic:``,Icirc:`Î`,icirc:`î`,Icy:`И`,icy:`и`,Idot:`İ`,IEcy:`Е`,iecy:`е`,iexcl:`¡`,iff:`⇔`,Ifr:`ℑ`,ifr:`𝔦`,Igrave:`Ì`,igrave:`ì`,ii:`ⅈ`,iiiint:`⨌`,iiint:`∭`,iinfin:`⧜`,iiota:`℩`,IJlig:`IJ`,ijlig:`ij`,Im:`ℑ`,Imacr:`Ī`,imacr:`ī`,image:`ℑ`,ImaginaryI:`ⅈ`,imagline:`ℐ`,imagpart:`ℑ`,imath:`ı`,imof:`⊷`,imped:`Ƶ`,Implies:`⇒`,in:`∈`,incare:`℅`,infin:`∞`,infintie:`⧝`,inodot:`ı`,Int:`∬`,int:`∫`,intcal:`⊺`,integers:`ℤ`,Integral:`∫`,intercal:`⊺`,Intersection:`⋂`,intlarhk:`⨗`,intprod:`⨼`,InvisibleComma:``,InvisibleTimes:``,IOcy:`Ё`,iocy:`ё`,Iogon:`Į`,iogon:`į`,Iopf:`𝕀`,iopf:`𝕚`,Iota:`Ι`,iota:`ι`,iprod:`⨼`,iquest:`¿`,Iscr:`ℐ`,iscr:`𝒾`,isin:`∈`,isindot:`⋵`,isinE:`⋹`,isins:`⋴`,isinsv:`⋳`,isinv:`∈`,it:``,Itilde:`Ĩ`,itilde:`ĩ`,Iukcy:`І`,iukcy:`і`,Iuml:`Ï`,iuml:`ï`,Jcirc:`Ĵ`,jcirc:`ĵ`,Jcy:`Й`,jcy:`й`,Jfr:`𝔍`,jfr:`𝔧`,jmath:`ȷ`,Jopf:`𝕁`,jopf:`𝕛`,Jscr:`𝒥`,jscr:`𝒿`,Jsercy:`Ј`,jsercy:`ј`,Jukcy:`Є`,jukcy:`є`,Kappa:`Κ`,kappa:`κ`,kappav:`ϰ`,Kcedil:`Ķ`,kcedil:`ķ`,Kcy:`К`,kcy:`к`,Kfr:`𝔎`,kfr:`𝔨`,kgreen:`ĸ`,KHcy:`Х`,khcy:`х`,KJcy:`Ќ`,kjcy:`ќ`,Kopf:`𝕂`,kopf:`𝕜`,Kscr:`𝒦`,kscr:`𝓀`,lAarr:`⇚`,Lacute:`Ĺ`,lacute:`ĺ`,laemptyv:`⦴`,lagran:`ℒ`,Lambda:`Λ`,lambda:`λ`,Lang:`⟪`,lang:`⟨`,langd:`⦑`,langle:`⟨`,lap:`⪅`,Laplacetrf:`ℒ`,laquo:`«`,Larr:`↞`,lArr:`⇐`,larr:`←`,larrb:`⇤`,larrbfs:`⤟`,larrfs:`⤝`,larrhk:`↩`,larrlp:`↫`,larrpl:`⤹`,larrsim:`⥳`,larrtl:`↢`,lat:`⪫`,lAtail:`⤛`,latail:`⤙`,late:`⪭`,lates:`⪭︀`,lBarr:`⤎`,lbarr:`⤌`,lbbrk:`❲`,lbrace:`{`,lbrack:`[`,lbrke:`⦋`,lbrksld:`⦏`,lbrkslu:`⦍`,Lcaron:`Ľ`,lcaron:`ľ`,Lcedil:`Ļ`,lcedil:`ļ`,lceil:`⌈`,lcub:`{`,Lcy:`Л`,lcy:`л`,ldca:`⤶`,ldquo:`“`,ldquor:`„`,ldrdhar:`⥧`,ldrushar:`⥋`,ldsh:`↲`,lE:`≦`,le:`≤`,LeftAngleBracket:`⟨`,LeftArrow:`←`,Leftarrow:`⇐`,leftarrow:`←`,LeftArrowBar:`⇤`,LeftArrowRightArrow:`⇆`,leftarrowtail:`↢`,LeftCeiling:`⌈`,LeftDoubleBracket:`⟦`,LeftDownTeeVector:`⥡`,LeftDownVector:`⇃`,LeftDownVectorBar:`⥙`,LeftFloor:`⌊`,leftharpoondown:`↽`,leftharpoonup:`↼`,leftleftarrows:`⇇`,LeftRightArrow:`↔`,Leftrightarrow:`⇔`,leftrightarrow:`↔`,leftrightarrows:`⇆`,leftrightharpoons:`⇋`,leftrightsquigarrow:`↭`,LeftRightVector:`⥎`,LeftTee:`⊣`,LeftTeeArrow:`↤`,LeftTeeVector:`⥚`,leftthreetimes:`⋋`,LeftTriangle:`⊲`,LeftTriangleBar:`⧏`,LeftTriangleEqual:`⊴`,LeftUpDownVector:`⥑`,LeftUpTeeVector:`⥠`,LeftUpVector:`↿`,LeftUpVectorBar:`⥘`,LeftVector:`↼`,LeftVectorBar:`⥒`,lEg:`⪋`,leg:`⋚`,leq:`≤`,leqq:`≦`,leqslant:`⩽`,les:`⩽`,lescc:`⪨`,lesdot:`⩿`,lesdoto:`⪁`,lesdotor:`⪃`,lesg:`⋚︀`,lesges:`⪓`,lessapprox:`⪅`,lessdot:`⋖`,lesseqgtr:`⋚`,lesseqqgtr:`⪋`,LessEqualGreater:`⋚`,LessFullEqual:`≦`,LessGreater:`≶`,lessgtr:`≶`,LessLess:`⪡`,lesssim:`≲`,LessSlantEqual:`⩽`,LessTilde:`≲`,lfisht:`⥼`,lfloor:`⌊`,Lfr:`𝔏`,lfr:`𝔩`,lg:`≶`,lgE:`⪑`,lHar:`⥢`,lhard:`↽`,lharu:`↼`,lharul:`⥪`,lhblk:`▄`,LJcy:`Љ`,ljcy:`љ`,Ll:`⋘`,ll:`≪`,llarr:`⇇`,llcorner:`⌞`,Lleftarrow:`⇚`,llhard:`⥫`,lltri:`◺`,Lmidot:`Ŀ`,lmidot:`ŀ`,lmoust:`⎰`,lmoustache:`⎰`,lnap:`⪉`,lnapprox:`⪉`,lnE:`≨`,lne:`⪇`,lneq:`⪇`,lneqq:`≨`,lnsim:`⋦`,loang:`⟬`,loarr:`⇽`,lobrk:`⟦`,LongLeftArrow:`⟵`,Longleftarrow:`⟸`,longleftarrow:`⟵`,LongLeftRightArrow:`⟷`,Longleftrightarrow:`⟺`,longleftrightarrow:`⟷`,longmapsto:`⟼`,LongRightArrow:`⟶`,Longrightarrow:`⟹`,longrightarrow:`⟶`,looparrowleft:`↫`,looparrowright:`↬`,lopar:`⦅`,Lopf:`𝕃`,lopf:`𝕝`,loplus:`⨭`,lotimes:`⨴`,lowast:`∗`,lowbar:`_`,LowerLeftArrow:`↙`,LowerRightArrow:`↘`,loz:`◊`,lozenge:`◊`,lozf:`⧫`,lpar:`(`,lparlt:`⦓`,lrarr:`⇆`,lrcorner:`⌟`,lrhar:`⇋`,lrhard:`⥭`,lrm:``,lrtri:`⊿`,lsaquo:`‹`,Lscr:`ℒ`,lscr:`𝓁`,Lsh:`↰`,lsh:`↰`,lsim:`≲`,lsime:`⪍`,lsimg:`⪏`,lsqb:`[`,lsquo:`‘`,lsquor:`‚`,Lstrok:`Ł`,lstrok:`ł`,Lt:`≪`,LT:`<`,lt:`<`,ltcc:`⪦`,ltcir:`⩹`,ltdot:`⋖`,lthree:`⋋`,ltimes:`⋉`,ltlarr:`⥶`,ltquest:`⩻`,ltri:`◃`,ltrie:`⊴`,ltrif:`◂`,ltrPar:`⦖`,lurdshar:`⥊`,luruhar:`⥦`,lvertneqq:`≨︀`,lvnE:`≨︀`,macr:`¯`,male:`♂`,malt:`✠`,maltese:`✠`,Map:`⤅`,map:`↦`,mapsto:`↦`,mapstodown:`↧`,mapstoleft:`↤`,mapstoup:`↥`,marker:`▮`,mcomma:`⨩`,Mcy:`М`,mcy:`м`,mdash:`—`,mDDot:`∺`,measuredangle:`∡`,MediumSpace:` `,Mellintrf:`ℳ`,Mfr:`𝔐`,mfr:`𝔪`,mho:`℧`,micro:`µ`,mid:`∣`,midast:`*`,midcir:`⫰`,middot:`·`,minus:`−`,minusb:`⊟`,minusd:`∸`,minusdu:`⨪`,MinusPlus:`∓`,mlcp:`⫛`,mldr:`…`,mnplus:`∓`,models:`⊧`,Mopf:`𝕄`,mopf:`𝕞`,mp:`∓`,Mscr:`ℳ`,mscr:`𝓂`,mstpos:`∾`,Mu:`Μ`,mu:`μ`,multimap:`⊸`,mumap:`⊸`,nabla:`∇`,Nacute:`Ń`,nacute:`ń`,nang:`∠⃒`,nap:`≉`,napE:`⩰̸`,napid:`≋̸`,napos:`ʼn`,napprox:`≉`,natur:`♮`,natural:`♮`,naturals:`ℕ`,nbsp:`\xA0`,nbump:`≎̸`,nbumpe:`≏̸`,ncap:`⩃`,Ncaron:`Ň`,ncaron:`ň`,Ncedil:`Ņ`,ncedil:`ņ`,ncong:`≇`,ncongdot:`⩭̸`,ncup:`⩂`,Ncy:`Н`,ncy:`н`,ndash:`–`,ne:`≠`,nearhk:`⤤`,neArr:`⇗`,nearr:`↗`,nearrow:`↗`,nedot:`≐̸`,NegativeMediumSpace:``,NegativeThickSpace:``,NegativeThinSpace:``,NegativeVeryThinSpace:``,nequiv:`≢`,nesear:`⤨`,nesim:`≂̸`,NestedGreaterGreater:`≫`,NestedLessLess:`≪`,NewLine:`
|
|
19
|
+
`,nexist:`∄`,nexists:`∄`,Nfr:`𝔑`,nfr:`𝔫`,ngE:`≧̸`,nge:`≱`,ngeq:`≱`,ngeqq:`≧̸`,ngeqslant:`⩾̸`,nges:`⩾̸`,nGg:`⋙̸`,ngsim:`≵`,nGt:`≫⃒`,ngt:`≯`,ngtr:`≯`,nGtv:`≫̸`,nhArr:`⇎`,nharr:`↮`,nhpar:`⫲`,ni:`∋`,nis:`⋼`,nisd:`⋺`,niv:`∋`,NJcy:`Њ`,njcy:`њ`,nlArr:`⇍`,nlarr:`↚`,nldr:`‥`,nlE:`≦̸`,nle:`≰`,nLeftarrow:`⇍`,nleftarrow:`↚`,nLeftrightarrow:`⇎`,nleftrightarrow:`↮`,nleq:`≰`,nleqq:`≦̸`,nleqslant:`⩽̸`,nles:`⩽̸`,nless:`≮`,nLl:`⋘̸`,nlsim:`≴`,nLt:`≪⃒`,nlt:`≮`,nltri:`⋪`,nltrie:`⋬`,nLtv:`≪̸`,nmid:`∤`,NoBreak:``,NonBreakingSpace:`\xA0`,Nopf:`ℕ`,nopf:`𝕟`,Not:`⫬`,not:`¬`,NotCongruent:`≢`,NotCupCap:`≭`,NotDoubleVerticalBar:`∦`,NotElement:`∉`,NotEqual:`≠`,NotEqualTilde:`≂̸`,NotExists:`∄`,NotGreater:`≯`,NotGreaterEqual:`≱`,NotGreaterFullEqual:`≧̸`,NotGreaterGreater:`≫̸`,NotGreaterLess:`≹`,NotGreaterSlantEqual:`⩾̸`,NotGreaterTilde:`≵`,NotHumpDownHump:`≎̸`,NotHumpEqual:`≏̸`,notin:`∉`,notindot:`⋵̸`,notinE:`⋹̸`,notinva:`∉`,notinvb:`⋷`,notinvc:`⋶`,NotLeftTriangle:`⋪`,NotLeftTriangleBar:`⧏̸`,NotLeftTriangleEqual:`⋬`,NotLess:`≮`,NotLessEqual:`≰`,NotLessGreater:`≸`,NotLessLess:`≪̸`,NotLessSlantEqual:`⩽̸`,NotLessTilde:`≴`,NotNestedGreaterGreater:`⪢̸`,NotNestedLessLess:`⪡̸`,notni:`∌`,notniva:`∌`,notnivb:`⋾`,notnivc:`⋽`,NotPrecedes:`⊀`,NotPrecedesEqual:`⪯̸`,NotPrecedesSlantEqual:`⋠`,NotReverseElement:`∌`,NotRightTriangle:`⋫`,NotRightTriangleBar:`⧐̸`,NotRightTriangleEqual:`⋭`,NotSquareSubset:`⊏̸`,NotSquareSubsetEqual:`⋢`,NotSquareSuperset:`⊐̸`,NotSquareSupersetEqual:`⋣`,NotSubset:`⊂⃒`,NotSubsetEqual:`⊈`,NotSucceeds:`⊁`,NotSucceedsEqual:`⪰̸`,NotSucceedsSlantEqual:`⋡`,NotSucceedsTilde:`≿̸`,NotSuperset:`⊃⃒`,NotSupersetEqual:`⊉`,NotTilde:`≁`,NotTildeEqual:`≄`,NotTildeFullEqual:`≇`,NotTildeTilde:`≉`,NotVerticalBar:`∤`,npar:`∦`,nparallel:`∦`,nparsl:`⫽⃥`,npart:`∂̸`,npolint:`⨔`,npr:`⊀`,nprcue:`⋠`,npre:`⪯̸`,nprec:`⊀`,npreceq:`⪯̸`,nrArr:`⇏`,nrarr:`↛`,nrarrc:`⤳̸`,nrarrw:`↝̸`,nRightarrow:`⇏`,nrightarrow:`↛`,nrtri:`⋫`,nrtrie:`⋭`,nsc:`⊁`,nsccue:`⋡`,nsce:`⪰̸`,Nscr:`𝒩`,nscr:`𝓃`,nshortmid:`∤`,nshortparallel:`∦`,nsim:`≁`,nsime:`≄`,nsimeq:`≄`,nsmid:`∤`,nspar:`∦`,nsqsube:`⋢`,nsqsupe:`⋣`,nsub:`⊄`,nsubE:`⫅̸`,nsube:`⊈`,nsubset:`⊂⃒`,nsubseteq:`⊈`,nsubseteqq:`⫅̸`,nsucc:`⊁`,nsucceq:`⪰̸`,nsup:`⊅`,nsupE:`⫆̸`,nsupe:`⊉`,nsupset:`⊃⃒`,nsupseteq:`⊉`,nsupseteqq:`⫆̸`,ntgl:`≹`,Ntilde:`Ñ`,ntilde:`ñ`,ntlg:`≸`,ntriangleleft:`⋪`,ntrianglelefteq:`⋬`,ntriangleright:`⋫`,ntrianglerighteq:`⋭`,Nu:`Ν`,nu:`ν`,num:`#`,numero:`№`,numsp:` `,nvap:`≍⃒`,nVDash:`⊯`,nVdash:`⊮`,nvDash:`⊭`,nvdash:`⊬`,nvge:`≥⃒`,nvgt:`>⃒`,nvHarr:`⤄`,nvinfin:`⧞`,nvlArr:`⤂`,nvle:`≤⃒`,nvlt:`<⃒`,nvltrie:`⊴⃒`,nvrArr:`⤃`,nvrtrie:`⊵⃒`,nvsim:`∼⃒`,nwarhk:`⤣`,nwArr:`⇖`,nwarr:`↖`,nwarrow:`↖`,nwnear:`⤧`,Oacute:`Ó`,oacute:`ó`,oast:`⊛`,ocir:`⊚`,Ocirc:`Ô`,ocirc:`ô`,Ocy:`О`,ocy:`о`,odash:`⊝`,Odblac:`Ő`,odblac:`ő`,odiv:`⨸`,odot:`⊙`,odsold:`⦼`,OElig:`Œ`,oelig:`œ`,ofcir:`⦿`,Ofr:`𝔒`,ofr:`𝔬`,ogon:`˛`,Ograve:`Ò`,ograve:`ò`,ogt:`⧁`,ohbar:`⦵`,ohm:`Ω`,oint:`∮`,olarr:`↺`,olcir:`⦾`,olcross:`⦻`,oline:`‾`,olt:`⧀`,Omacr:`Ō`,omacr:`ō`,Omega:`Ω`,omega:`ω`,Omicron:`Ο`,omicron:`ο`,omid:`⦶`,ominus:`⊖`,Oopf:`𝕆`,oopf:`𝕠`,opar:`⦷`,OpenCurlyDoubleQuote:`“`,OpenCurlyQuote:`‘`,operp:`⦹`,oplus:`⊕`,Or:`⩔`,or:`∨`,orarr:`↻`,ord:`⩝`,order:`ℴ`,orderof:`ℴ`,ordf:`ª`,ordm:`º`,origof:`⊶`,oror:`⩖`,orslope:`⩗`,orv:`⩛`,oS:`Ⓢ`,Oscr:`𝒪`,oscr:`ℴ`,Oslash:`Ø`,oslash:`ø`,osol:`⊘`,Otilde:`Õ`,otilde:`õ`,Otimes:`⨷`,otimes:`⊗`,otimesas:`⨶`,Ouml:`Ö`,ouml:`ö`,ovbar:`⌽`,OverBar:`‾`,OverBrace:`⏞`,OverBracket:`⎴`,OverParenthesis:`⏜`,par:`∥`,para:`¶`,parallel:`∥`,parsim:`⫳`,parsl:`⫽`,part:`∂`,PartialD:`∂`,Pcy:`П`,pcy:`п`,percnt:`%`,period:`.`,permil:`‰`,perp:`⊥`,pertenk:`‱`,Pfr:`𝔓`,pfr:`𝔭`,Phi:`Φ`,phi:`φ`,phiv:`ϕ`,phmmat:`ℳ`,phone:`☎`,Pi:`Π`,pi:`π`,pitchfork:`⋔`,piv:`ϖ`,planck:`ℏ`,planckh:`ℎ`,plankv:`ℏ`,plus:`+`,plusacir:`⨣`,plusb:`⊞`,pluscir:`⨢`,plusdo:`∔`,plusdu:`⨥`,pluse:`⩲`,PlusMinus:`±`,plusmn:`±`,plussim:`⨦`,plustwo:`⨧`,pm:`±`,Poincareplane:`ℌ`,pointint:`⨕`,Popf:`ℙ`,popf:`𝕡`,pound:`£`,Pr:`⪻`,pr:`≺`,prap:`⪷`,prcue:`≼`,prE:`⪳`,pre:`⪯`,prec:`≺`,precapprox:`⪷`,preccurlyeq:`≼`,Precedes:`≺`,PrecedesEqual:`⪯`,PrecedesSlantEqual:`≼`,PrecedesTilde:`≾`,preceq:`⪯`,precnapprox:`⪹`,precneqq:`⪵`,precnsim:`⋨`,precsim:`≾`,Prime:`″`,prime:`′`,primes:`ℙ`,prnap:`⪹`,prnE:`⪵`,prnsim:`⋨`,prod:`∏`,Product:`∏`,profalar:`⌮`,profline:`⌒`,profsurf:`⌓`,prop:`∝`,Proportion:`∷`,Proportional:`∝`,propto:`∝`,prsim:`≾`,prurel:`⊰`,Pscr:`𝒫`,pscr:`𝓅`,Psi:`Ψ`,psi:`ψ`,puncsp:` `,Qfr:`𝔔`,qfr:`𝔮`,qint:`⨌`,Qopf:`ℚ`,qopf:`𝕢`,qprime:`⁗`,Qscr:`𝒬`,qscr:`𝓆`,quaternions:`ℍ`,quatint:`⨖`,quest:`?`,questeq:`≟`,QUOT:`"`,quot:`"`,rAarr:`⇛`,race:`∽̱`,Racute:`Ŕ`,racute:`ŕ`,radic:`√`,raemptyv:`⦳`,Rang:`⟫`,rang:`⟩`,rangd:`⦒`,range:`⦥`,rangle:`⟩`,raquo:`»`,Rarr:`↠`,rArr:`⇒`,rarr:`→`,rarrap:`⥵`,rarrb:`⇥`,rarrbfs:`⤠`,rarrc:`⤳`,rarrfs:`⤞`,rarrhk:`↪`,rarrlp:`↬`,rarrpl:`⥅`,rarrsim:`⥴`,Rarrtl:`⤖`,rarrtl:`↣`,rarrw:`↝`,rAtail:`⤜`,ratail:`⤚`,ratio:`∶`,rationals:`ℚ`,RBarr:`⤐`,rBarr:`⤏`,rbarr:`⤍`,rbbrk:`❳`,rbrace:`}`,rbrack:`]`,rbrke:`⦌`,rbrksld:`⦎`,rbrkslu:`⦐`,Rcaron:`Ř`,rcaron:`ř`,Rcedil:`Ŗ`,rcedil:`ŗ`,rceil:`⌉`,rcub:`}`,Rcy:`Р`,rcy:`р`,rdca:`⤷`,rdldhar:`⥩`,rdquo:`”`,rdquor:`”`,rdsh:`↳`,Re:`ℜ`,real:`ℜ`,realine:`ℛ`,realpart:`ℜ`,reals:`ℝ`,rect:`▭`,REG:`®`,reg:`®`,ReverseElement:`∋`,ReverseEquilibrium:`⇋`,ReverseUpEquilibrium:`⥯`,rfisht:`⥽`,rfloor:`⌋`,Rfr:`ℜ`,rfr:`𝔯`,rHar:`⥤`,rhard:`⇁`,rharu:`⇀`,rharul:`⥬`,Rho:`Ρ`,rho:`ρ`,rhov:`ϱ`,RightAngleBracket:`⟩`,RightArrow:`→`,Rightarrow:`⇒`,rightarrow:`→`,RightArrowBar:`⇥`,RightArrowLeftArrow:`⇄`,rightarrowtail:`↣`,RightCeiling:`⌉`,RightDoubleBracket:`⟧`,RightDownTeeVector:`⥝`,RightDownVector:`⇂`,RightDownVectorBar:`⥕`,RightFloor:`⌋`,rightharpoondown:`⇁`,rightharpoonup:`⇀`,rightleftarrows:`⇄`,rightleftharpoons:`⇌`,rightrightarrows:`⇉`,rightsquigarrow:`↝`,RightTee:`⊢`,RightTeeArrow:`↦`,RightTeeVector:`⥛`,rightthreetimes:`⋌`,RightTriangle:`⊳`,RightTriangleBar:`⧐`,RightTriangleEqual:`⊵`,RightUpDownVector:`⥏`,RightUpTeeVector:`⥜`,RightUpVector:`↾`,RightUpVectorBar:`⥔`,RightVector:`⇀`,RightVectorBar:`⥓`,ring:`˚`,risingdotseq:`≓`,rlarr:`⇄`,rlhar:`⇌`,rlm:``,rmoust:`⎱`,rmoustache:`⎱`,rnmid:`⫮`,roang:`⟭`,roarr:`⇾`,robrk:`⟧`,ropar:`⦆`,Ropf:`ℝ`,ropf:`𝕣`,roplus:`⨮`,rotimes:`⨵`,RoundImplies:`⥰`,rpar:`)`,rpargt:`⦔`,rppolint:`⨒`,rrarr:`⇉`,Rrightarrow:`⇛`,rsaquo:`›`,Rscr:`ℛ`,rscr:`𝓇`,Rsh:`↱`,rsh:`↱`,rsqb:`]`,rsquo:`’`,rsquor:`’`,rthree:`⋌`,rtimes:`⋊`,rtri:`▹`,rtrie:`⊵`,rtrif:`▸`,rtriltri:`⧎`,RuleDelayed:`⧴`,ruluhar:`⥨`,rx:`℞`,Sacute:`Ś`,sacute:`ś`,sbquo:`‚`,Sc:`⪼`,sc:`≻`,scap:`⪸`,Scaron:`Š`,scaron:`š`,sccue:`≽`,scE:`⪴`,sce:`⪰`,Scedil:`Ş`,scedil:`ş`,Scirc:`Ŝ`,scirc:`ŝ`,scnap:`⪺`,scnE:`⪶`,scnsim:`⋩`,scpolint:`⨓`,scsim:`≿`,Scy:`С`,scy:`с`,sdot:`⋅`,sdotb:`⊡`,sdote:`⩦`,searhk:`⤥`,seArr:`⇘`,searr:`↘`,searrow:`↘`,sect:`§`,semi:`;`,seswar:`⤩`,setminus:`∖`,setmn:`∖`,sext:`✶`,Sfr:`𝔖`,sfr:`𝔰`,sfrown:`⌢`,sharp:`♯`,SHCHcy:`Щ`,shchcy:`щ`,SHcy:`Ш`,shcy:`ш`,ShortDownArrow:`↓`,ShortLeftArrow:`←`,shortmid:`∣`,shortparallel:`∥`,ShortRightArrow:`→`,ShortUpArrow:`↑`,shy:``,Sigma:`Σ`,sigma:`σ`,sigmaf:`ς`,sigmav:`ς`,sim:`∼`,simdot:`⩪`,sime:`≃`,simeq:`≃`,simg:`⪞`,simgE:`⪠`,siml:`⪝`,simlE:`⪟`,simne:`≆`,simplus:`⨤`,simrarr:`⥲`,slarr:`←`,SmallCircle:`∘`,smallsetminus:`∖`,smashp:`⨳`,smeparsl:`⧤`,smid:`∣`,smile:`⌣`,smt:`⪪`,smte:`⪬`,smtes:`⪬︀`,SOFTcy:`Ь`,softcy:`ь`,sol:`/`,solb:`⧄`,solbar:`⌿`,Sopf:`𝕊`,sopf:`𝕤`,spades:`♠`,spadesuit:`♠`,spar:`∥`,sqcap:`⊓`,sqcaps:`⊓︀`,sqcup:`⊔`,sqcups:`⊔︀`,Sqrt:`√`,sqsub:`⊏`,sqsube:`⊑`,sqsubset:`⊏`,sqsubseteq:`⊑`,sqsup:`⊐`,sqsupe:`⊒`,sqsupset:`⊐`,sqsupseteq:`⊒`,squ:`□`,Square:`□`,square:`□`,SquareIntersection:`⊓`,SquareSubset:`⊏`,SquareSubsetEqual:`⊑`,SquareSuperset:`⊐`,SquareSupersetEqual:`⊒`,SquareUnion:`⊔`,squarf:`▪`,squf:`▪`,srarr:`→`,Sscr:`𝒮`,sscr:`𝓈`,ssetmn:`∖`,ssmile:`⌣`,sstarf:`⋆`,Star:`⋆`,star:`☆`,starf:`★`,straightepsilon:`ϵ`,straightphi:`ϕ`,strns:`¯`,Sub:`⋐`,sub:`⊂`,subdot:`⪽`,subE:`⫅`,sube:`⊆`,subedot:`⫃`,submult:`⫁`,subnE:`⫋`,subne:`⊊`,subplus:`⪿`,subrarr:`⥹`,Subset:`⋐`,subset:`⊂`,subseteq:`⊆`,subseteqq:`⫅`,SubsetEqual:`⊆`,subsetneq:`⊊`,subsetneqq:`⫋`,subsim:`⫇`,subsub:`⫕`,subsup:`⫓`,succ:`≻`,succapprox:`⪸`,succcurlyeq:`≽`,Succeeds:`≻`,SucceedsEqual:`⪰`,SucceedsSlantEqual:`≽`,SucceedsTilde:`≿`,succeq:`⪰`,succnapprox:`⪺`,succneqq:`⪶`,succnsim:`⋩`,succsim:`≿`,SuchThat:`∋`,Sum:`∑`,sum:`∑`,sung:`♪`,Sup:`⋑`,sup:`⊃`,sup1:`¹`,sup2:`²`,sup3:`³`,supdot:`⪾`,supdsub:`⫘`,supE:`⫆`,supe:`⊇`,supedot:`⫄`,Superset:`⊃`,SupersetEqual:`⊇`,suphsol:`⟉`,suphsub:`⫗`,suplarr:`⥻`,supmult:`⫂`,supnE:`⫌`,supne:`⊋`,supplus:`⫀`,Supset:`⋑`,supset:`⊃`,supseteq:`⊇`,supseteqq:`⫆`,supsetneq:`⊋`,supsetneqq:`⫌`,supsim:`⫈`,supsub:`⫔`,supsup:`⫖`,swarhk:`⤦`,swArr:`⇙`,swarr:`↙`,swarrow:`↙`,swnwar:`⤪`,szlig:`ß`,Tab:` `,target:`⌖`,Tau:`Τ`,tau:`τ`,tbrk:`⎴`,Tcaron:`Ť`,tcaron:`ť`,Tcedil:`Ţ`,tcedil:`ţ`,Tcy:`Т`,tcy:`т`,tdot:`⃛`,telrec:`⌕`,Tfr:`𝔗`,tfr:`𝔱`,there4:`∴`,Therefore:`∴`,therefore:`∴`,Theta:`Θ`,theta:`θ`,thetasym:`ϑ`,thetav:`ϑ`,thickapprox:`≈`,thicksim:`∼`,ThickSpace:` `,thinsp:` `,ThinSpace:` `,thkap:`≈`,thksim:`∼`,THORN:`Þ`,thorn:`þ`,Tilde:`∼`,tilde:`˜`,TildeEqual:`≃`,TildeFullEqual:`≅`,TildeTilde:`≈`,times:`×`,timesb:`⊠`,timesbar:`⨱`,timesd:`⨰`,tint:`∭`,toea:`⤨`,top:`⊤`,topbot:`⌶`,topcir:`⫱`,Topf:`𝕋`,topf:`𝕥`,topfork:`⫚`,tosa:`⤩`,tprime:`‴`,TRADE:`™`,trade:`™`,triangle:`▵`,triangledown:`▿`,triangleleft:`◃`,trianglelefteq:`⊴`,triangleq:`≜`,triangleright:`▹`,trianglerighteq:`⊵`,tridot:`◬`,trie:`≜`,triminus:`⨺`,TripleDot:`⃛`,triplus:`⨹`,trisb:`⧍`,tritime:`⨻`,trpezium:`⏢`,Tscr:`𝒯`,tscr:`𝓉`,TScy:`Ц`,tscy:`ц`,TSHcy:`Ћ`,tshcy:`ћ`,Tstrok:`Ŧ`,tstrok:`ŧ`,twixt:`≬`,twoheadleftarrow:`↞`,twoheadrightarrow:`↠`,Uacute:`Ú`,uacute:`ú`,Uarr:`↟`,uArr:`⇑`,uarr:`↑`,Uarrocir:`⥉`,Ubrcy:`Ў`,ubrcy:`ў`,Ubreve:`Ŭ`,ubreve:`ŭ`,Ucirc:`Û`,ucirc:`û`,Ucy:`У`,ucy:`у`,udarr:`⇅`,Udblac:`Ű`,udblac:`ű`,udhar:`⥮`,ufisht:`⥾`,Ufr:`𝔘`,ufr:`𝔲`,Ugrave:`Ù`,ugrave:`ù`,uHar:`⥣`,uharl:`↿`,uharr:`↾`,uhblk:`▀`,ulcorn:`⌜`,ulcorner:`⌜`,ulcrop:`⌏`,ultri:`◸`,Umacr:`Ū`,umacr:`ū`,uml:`¨`,UnderBar:`_`,UnderBrace:`⏟`,UnderBracket:`⎵`,UnderParenthesis:`⏝`,Union:`⋃`,UnionPlus:`⊎`,Uogon:`Ų`,uogon:`ų`,Uopf:`𝕌`,uopf:`𝕦`,UpArrow:`↑`,Uparrow:`⇑`,uparrow:`↑`,UpArrowBar:`⤒`,UpArrowDownArrow:`⇅`,UpDownArrow:`↕`,Updownarrow:`⇕`,updownarrow:`↕`,UpEquilibrium:`⥮`,upharpoonleft:`↿`,upharpoonright:`↾`,uplus:`⊎`,UpperLeftArrow:`↖`,UpperRightArrow:`↗`,Upsi:`ϒ`,upsi:`υ`,upsih:`ϒ`,Upsilon:`Υ`,upsilon:`υ`,UpTee:`⊥`,UpTeeArrow:`↥`,upuparrows:`⇈`,urcorn:`⌝`,urcorner:`⌝`,urcrop:`⌎`,Uring:`Ů`,uring:`ů`,urtri:`◹`,Uscr:`𝒰`,uscr:`𝓊`,utdot:`⋰`,Utilde:`Ũ`,utilde:`ũ`,utri:`▵`,utrif:`▴`,uuarr:`⇈`,Uuml:`Ü`,uuml:`ü`,uwangle:`⦧`,vangrt:`⦜`,varepsilon:`ϵ`,varkappa:`ϰ`,varnothing:`∅`,varphi:`ϕ`,varpi:`ϖ`,varpropto:`∝`,vArr:`⇕`,varr:`↕`,varrho:`ϱ`,varsigma:`ς`,varsubsetneq:`⊊︀`,varsubsetneqq:`⫋︀`,varsupsetneq:`⊋︀`,varsupsetneqq:`⫌︀`,vartheta:`ϑ`,vartriangleleft:`⊲`,vartriangleright:`⊳`,Vbar:`⫫`,vBar:`⫨`,vBarv:`⫩`,Vcy:`В`,vcy:`в`,VDash:`⊫`,Vdash:`⊩`,vDash:`⊨`,vdash:`⊢`,Vdashl:`⫦`,Vee:`⋁`,vee:`∨`,veebar:`⊻`,veeeq:`≚`,vellip:`⋮`,Verbar:`‖`,verbar:`|`,Vert:`‖`,vert:`|`,VerticalBar:`∣`,VerticalLine:`|`,VerticalSeparator:`❘`,VerticalTilde:`≀`,VeryThinSpace:` `,Vfr:`𝔙`,vfr:`𝔳`,vltri:`⊲`,vnsub:`⊂⃒`,vnsup:`⊃⃒`,Vopf:`𝕍`,vopf:`𝕧`,vprop:`∝`,vrtri:`⊳`,Vscr:`𝒱`,vscr:`𝓋`,vsubnE:`⫋︀`,vsubne:`⊊︀`,vsupnE:`⫌︀`,vsupne:`⊋︀`,Vvdash:`⊪`,vzigzag:`⦚`,Wcirc:`Ŵ`,wcirc:`ŵ`,wedbar:`⩟`,Wedge:`⋀`,wedge:`∧`,wedgeq:`≙`,weierp:`℘`,Wfr:`𝔚`,wfr:`𝔴`,Wopf:`𝕎`,wopf:`𝕨`,wp:`℘`,wr:`≀`,wreath:`≀`,Wscr:`𝒲`,wscr:`𝓌`,xcap:`⋂`,xcirc:`◯`,xcup:`⋃`,xdtri:`▽`,Xfr:`𝔛`,xfr:`𝔵`,xhArr:`⟺`,xharr:`⟷`,Xi:`Ξ`,xi:`ξ`,xlArr:`⟸`,xlarr:`⟵`,xmap:`⟼`,xnis:`⋻`,xodot:`⨀`,Xopf:`𝕏`,xopf:`𝕩`,xoplus:`⨁`,xotime:`⨂`,xrArr:`⟹`,xrarr:`⟶`,Xscr:`𝒳`,xscr:`𝓍`,xsqcup:`⨆`,xuplus:`⨄`,xutri:`△`,xvee:`⋁`,xwedge:`⋀`,Yacute:`Ý`,yacute:`ý`,YAcy:`Я`,yacy:`я`,Ycirc:`Ŷ`,ycirc:`ŷ`,Ycy:`Ы`,ycy:`ы`,yen:`¥`,Yfr:`𝔜`,yfr:`𝔶`,YIcy:`Ї`,yicy:`ї`,Yopf:`𝕐`,yopf:`𝕪`,Yscr:`𝒴`,yscr:`𝓎`,YUcy:`Ю`,yucy:`ю`,Yuml:`Ÿ`,yuml:`ÿ`,Zacute:`Ź`,zacute:`ź`,Zcaron:`Ž`,zcaron:`ž`,Zcy:`З`,zcy:`з`,Zdot:`Ż`,zdot:`ż`,zeetrf:`ℨ`,ZeroWidthSpace:``,Zeta:`Ζ`,zeta:`ζ`,Zfr:`ℨ`,zfr:`𝔷`,ZHcy:`Ж`,zhcy:`ж`,zigrarr:`⇝`,Zopf:`ℤ`,zopf:`𝕫`,Zscr:`𝒵`,zscr:`𝓏`,zwj:``,zwnj:``}),e.entityMap=e.HTML_ENTITIES})),vi=/* @__PURE__ */ r((e=>{var t=pi(),n=hi(),r=mi(),i=t.isHTMLEscapableRawTextElement,a=t.isHTMLMimeType,o=t.isHTMLRawTextElement,s=t.hasOwn,c=t.NAMESPACE,l=r.ParseError,u=r.DOMException,d=0,f=1,p=2,m=3,h=4,g=5,_=6,v=7;function y(){}y.prototype={parse:function(e,t,n){var r=this.domBuilder;r.startDocument(),E(t,t=Object.create(null)),x(e,t,n,r,this.errorHandler),r.endDocument()}};var b=/&#?\w+;?/g;function x(e,r,i,o,c){var d=a(o.mimeType);e.indexOf(n.UNICODE_REPLACEMENT_CHARACTER)>=0&&c.warning(`Unicode replacement character detected, source encoding issues?`);function f(e){if(e>65535){e-=65536;var t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}function p(e){var t=e[e.length-1]===`;`?e:e+`;`;if(!d&&t!==e)return c.error(`EntityRef: expecting ;`),e;var r=n.Reference.exec(t);if(!r||r[0].length!==t.length)return c.error(`entity not matching Reference production: `+e),e;var a=t.slice(1,-1);return s(i,a)?i[a]:a.charAt(0)===`#`?f(parseInt(a.substring(1).replace(`x`,`0x`))):(c.error(`entity not found:`+e),e)}function m(t){if(t>D){var n=e.substring(D,t).replace(b,p);v&&y(D),o.characters(n,0,t-D),D=t}}var h=0,g=0,_=/\r\n?|\n|$/g,v=o.locator;function y(t,n){for(;t>=g&&(n=_.exec(e));)h=g,g=n.index+n[0].length,v.lineNumber++;v.columnNumber=t-h+1}for(var x=[{currentNSMap:r}],E=[],D=0;;){try{var O=e.indexOf(`<`,D);if(O<0){if(!d&&E.length>0)return c.fatalError(`unclosed xml tag(s): `+E.join(`, `));if(!e.substring(D).match(/^\s*$/)){var j=o.doc,te=j.createTextNode(e.substring(D));if(j.documentElement)return c.error(`Extra content at the end of the document`);j.appendChild(te),o.currentElement=te}return}if(O>D){var M=e.substring(D,O);!d&&E.length===0&&(M=M.replace(new RegExp(n.S_OPT.source,`g`),``),M&&c.error(`Unexpected content outside root element: '`+M+`'`)),m(O)}switch(e.charAt(O+1)){case`/`:var N=e.indexOf(`>`,O+2),P=e.substring(O+2,N>0?N:void 0);if(!P)return c.fatalError(`end tag name missing`);var F=n.reg(`^`,n.QName_group,n.S_OPT,`$`),I=N>0&&F.exec(P);if(!I){var L=N>0&&n.reg(`^`,n.QName_group).exec(P);if(d&&L)c.warning(`end tag name contains invalid trailing characters: "`+P+`"`),I=L;else if(L&&new RegExp(F.source,F.flags+`m`).test(P))c.error(`end tag name is followed by a line break and trailing content: "`+P+`"`),I=L;else return c.fatalError(`end tag name contains invalid characters: "`+P+`"`)}if(!o.currentElement&&!o.doc.documentElement)return;var R=E[E.length-1]||o.currentElement.tagName||o.doc.documentElement.tagName||``;if(R!==I[1]){var z=I[1].toLowerCase();if(!d||R.toLowerCase()!==z)return c.fatalError(`Opening and ending tag mismatch: "`+R+`" != "`+P+`"`)}var B=x.pop();E.pop();var V=B.localNSMap;if(o.endElement(B.uri,B.localName,R),V)for(var ne in V)s(V,ne)&&o.endPrefixMapping(ne);N++;break;case`?`:v&&y(O),N=ee(e,O,o,c);break;case`!`:v&&y(O),N=k(e,O,o,c,d);break;default:v&&y(O);var H=new A,re=x[x.length-1].currentNSMap,N=C(e,O,H,re,p,c,d),ie=H.length;if(H.closed||(d&&t.isHTMLVoidElement(H.tagName)?H.closed=!0:E.push(H.tagName)),v&&ie){for(var ae=S(v,{}),oe=0;oe<ie;oe++){var U=H[oe];y(U.offset),U.locator=S(v,{})}o.locator=ae,w(H,o,re)&&x.push(H),o.locator=v}else w(H,o,re)&&x.push(H);d&&!H.closed?N=T(e,N,H.tagName,p,o):N++}}catch(e){if(e instanceof l)throw e;if(e instanceof u)return c.fatalError(`Error constructing the DOM: `+e.name+`: `+e.message,e);c.error(`element parse error: `+e),N=-1}N>D?D=N:m(Math.max(O,D)+1)}}function S(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function C(e,t,n,r,i,a,o){function c(e,t,r){if(s(n.attributeNames,e))return a.fatalError(`Attribute `+e+` redefined`);if(!o&&t.indexOf(`<`)>=0)return a.fatalError(`Unescaped '<' not allowed in attributes values`);n.addValue(e,t.replace(/[\t\n\r]/g,` `).replace(b,i),r)}for(var l,u,y=++t,x=d;;){var S=e.charAt(y);if(x===d&&S===`<`)throw Error(`unexpected < in tag name: `+e.slice(t,y));switch(S){case`=`:if(x===f)l=e.slice(t,y),x=m;else if(x===p)x=m;else throw Error(`attribute equal must after attrName`);break;case`'`:case`"`:if(x===m||x===f){if(x===f&&(a.warning(`attribute value must after "="`),l=e.slice(t,y)),t=y+1,y=e.indexOf(S,t),y>0)u=e.slice(t,y),c(l,u,t-1),x=g;else throw Error(`attribute value no end '`+S+`' match`)}else if(x==h)u=e.slice(t,y),c(l,u,t),a.warning(`attribute "`+l+`" missed start quot(`+S+`)!!`),t=y+1,x=g;else throw Error(`attribute value must after "="`);break;case`/`:switch(x){case d:n.setTagName(e.slice(t,y));case g:case _:case v:x=v,n.closed=!0;case h:case f:break;case p:n.closed=!0;break;default:throw Error(`attribute invalid close char('/')`)}break;case``:return a.error(`unexpected end of input`),x==d&&n.setTagName(e.slice(t,y)),y;case`>`:switch(x){case d:n.setTagName(e.slice(t,y));case g:case _:case v:break;case h:case f:u=e.slice(t,y),u.slice(-1)===`/`&&(n.closed=!0,u=u.slice(0,-1));case p:x===p&&(u=l),x==h?(a.warning(`attribute "`+u+`" missed quot(")!`),c(l,u,t)):(o||a.warning(`attribute "`+u+`" missed value!! "`+u+`" instead!!`),c(u,u,t));break;case m:if(!o)return a.fatalError(`AttValue: ' or " expected`)}return y;case``:S=` `;default:if(S<=` `)switch(x){case d:n.setTagName(e.slice(t,y)),x=_;break;case f:l=e.slice(t,y),x=p;break;case h:var u=e.slice(t,y);a.warning(`attribute "`+u+`" missed quot(")!!`),c(l,u,t);case g:x=_}else switch(x){case p:o||a.warning(`attribute "`+l+`" missed value!! "`+l+`" instead2!!`),c(l,l,t),t=y,x=f;break;case g:a.warning(`attribute space is required"`+l+`"!!`);case _:x=f,t=y;break;case m:x=h,t=y;break;case v:throw Error(`elements closed character '/' and '>' must be connected to`)}}y++}}function w(e,t,n){for(var r=e.tagName,i=null,a=e.length;a--;){var o=e[a],l=o.qName,u=o.value,d=l.indexOf(`:`);if(d>0)var f=o.prefix=l.slice(0,d),p=l.slice(d+1),m=f===`xmlns`&&p;else p=l,f=null,m=l===`xmlns`&&``;o.localName=p,m!==!1&&(i??(i=Object.create(null),n=Object.create(n)),n[m]=i[m]=u,o.uri=c.XMLNS,t.startPrefixMapping(m,u))}for(var a=e.length;a--;)o=e[a],o.prefix&&(o.prefix===`xml`&&(o.uri=c.XML),o.prefix!==`xmlns`&&(o.uri=n[o.prefix]));var d=r.indexOf(`:`);d>0?(f=e.prefix=r.slice(0,d),p=e.localName=r.slice(d+1)):(f=null,p=e.localName=r);var h=e.uri=n[f||``];if(t.startElement(h,p,r,e),e.closed){if(t.endElement(h,p,r),i)for(f in i)s(i,f)&&t.endPrefixMapping(f)}else return e.currentNSMap=n,e.localNSMap=i,!0}function T(e,t,n,r,a){var s=i(n);if(s||o(n)){var c=RegExp(`</`+n.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)+`>`,`ig`);c.lastIndex=t;var l=c.exec(e),u=l?l.index:-1;if(u<0)return t+1;var d=e.substring(t+1,u);return s&&(d=d.replace(b,r)),a.characters(d,0,d.length),u}return t+1}function E(e,t){for(var n in e)s(e,n)&&(t[n]=e[n])}function D(e,t){var r=t;function i(t){return t||=0,e.charAt(r+t)}function a(e){e||=1,r+=e}function o(){for(var t=0;r<e.length;){var n=i();if(n!==` `&&n!==`
|
|
20
|
+
`&&n!==` `&&n!==`\r`)return t;t++,a()}return-1}function s(){return e.substring(r)}function c(t){return e.substring(r,r+t.length)===t}function l(t){return e.substring(r,r+t.length).toUpperCase()===t.toUpperCase()}function u(e){var t=n.reg(`^`,e).exec(s());return t?(a(t[0].length),t[0]):null}return{char:i,getIndex:function(){return r},getMatch:u,getSource:function(){return e},skip:a,skipBlanks:o,substringFromIndex:s,substringStartsWith:c,substringStartsWithCaseInsensitive:l}}function O(e,t){function r(e,t){var r=n.PI.exec(e.substringFromIndex());return r?r[1].toLowerCase()===`xml`?t.fatalError(`xml declaration is only allowed at the start of the document, but found at position `+e.getIndex()):(e.skip(r[0].length),r[0]):t.fatalError(`processing instruction is not well-formed at position `+e.getIndex())}var i=e.getSource();if(e.char()===`[`){e.skip(1);for(var a=e.getIndex();e.getIndex()<i.length;){if(e.skipBlanks(),e.char()===`]`){var o=i.substring(a,e.getIndex());return e.skip(1),o}var s=null;if(e.char()===`<`&&e.char(1)===`!`)switch(e.char(2)){case`E`:e.char(3)===`L`?s=e.getMatch(n.elementdecl):e.char(3)===`N`&&(s=e.getMatch(n.EntityDecl));break;case`A`:s=e.getMatch(n.AttlistDecl);break;case`N`:s=e.getMatch(n.NotationDecl);break;case`-`:s=e.getMatch(n.Comment)}else if(e.char()===`<`&&e.char(1)===`?`)s=r(e,t);else if(e.char()===`%`)s=e.getMatch(n.PEReference);else return t.fatalError(`Error detected in Markup declaration`);if(!s)return t.fatalError(`Error in internal subset at position `+e.getIndex())}return t.fatalError(`doctype internal subset is not well-formed, missing ]`)}}function k(e,t,r,i,a){var o=D(e,t);switch(a?o.char(2).toUpperCase():o.char(2)){case`-`:var s=o.getMatch(n.Comment);return s?(r.comment(s,n.COMMENT_START.length,s.length-n.COMMENT_START.length-n.COMMENT_END.length),o.getIndex()):i.fatalError(`comment is not well-formed at position `+o.getIndex());case`[`:var c=o.getMatch(n.CDSect);return c?!a&&!r.currentElement?i.fatalError(`CDATA outside of element`):(r.startCDATA(),r.characters(c,n.CDATA_START.length,c.length-n.CDATA_START.length-n.CDATA_END.length),r.endCDATA(),o.getIndex()):i.fatalError(`Invalid CDATA starting at position `+t);case`D`:if(r.doc&&r.doc.documentElement)return i.fatalError(`Doctype not allowed inside or after documentElement at position `+o.getIndex());if(a?!o.substringStartsWithCaseInsensitive(n.DOCTYPE_DECL_START):!o.substringStartsWith(n.DOCTYPE_DECL_START))return i.fatalError(`Expected `+n.DOCTYPE_DECL_START+` at position `+o.getIndex());if(o.skip(n.DOCTYPE_DECL_START.length),o.skipBlanks()<1)return i.fatalError(`Expected whitespace after `+n.DOCTYPE_DECL_START+` at position `+o.getIndex());var l={name:void 0,publicId:void 0,systemId:void 0,internalSubset:void 0};if(l.name=o.getMatch(n.Name),!l.name)return i.fatalError(`doctype name missing or contains unexpected characters at position `+o.getIndex());if(a&&l.name.toLowerCase()!==`html`&&i.warning(`Unexpected DOCTYPE in HTML document at position `+o.getIndex()),o.skipBlanks(),o.substringStartsWith(n.PUBLIC)||o.substringStartsWith(n.SYSTEM)){var u=n.ExternalID_match.exec(o.substringFromIndex());if(!u)return i.fatalError(`doctype external id is not well-formed at position `+o.getIndex());u.groups.SystemLiteralOnly===void 0?(l.systemId=u.groups.SystemLiteral,l.publicId=u.groups.PubidLiteral):l.systemId=u.groups.SystemLiteralOnly,o.skip(u[0].length)}else if(a&&o.substringStartsWithCaseInsensitive(n.SYSTEM)){if(o.skip(n.SYSTEM.length),o.skipBlanks()<1)return i.fatalError(`Expected whitespace after `+n.SYSTEM+` at position `+o.getIndex());if(l.systemId=o.getMatch(n.ABOUT_LEGACY_COMPAT_SystemLiteral),!l.systemId)return i.fatalError(`Expected `+n.ABOUT_LEGACY_COMPAT+` in single or double quotes after `+n.SYSTEM+` at position `+o.getIndex())}return a&&l.systemId&&!n.ABOUT_LEGACY_COMPAT_SystemLiteral.test(l.systemId)&&i.warning(`Unexpected doctype.systemId in HTML document at position `+o.getIndex()),a||(o.skipBlanks(),l.internalSubset=O(o,i)),o.skipBlanks(),o.char()===`>`?(o.skip(1),r.startDTD(l.name,l.publicId,l.systemId,l.internalSubset),r.endDTD(),o.getIndex()):i.fatalError(`doctype not terminated with > at position `+o.getIndex());default:return i.fatalError(`Not well-formed XML starting with "<!" at position `+t)}}function ee(e,t,r,i){var a=e.substring(t).match(n.PI);if(!a)return i.fatalError(`Invalid processing instruction starting at position `+t);if(a[1].toLowerCase()===`xml`){if(t>0)return i.fatalError(`processing instruction at position `+t+` is an xml declaration which is only at the start of the document`);if(!n.XMLDecl.test(e.substring(t)))return i.fatalError(`xml declaration is not well-formed`)}return r.processingInstruction(a[1],a[2]),t+a[0].length}function A(){this.attributeNames=Object.create(null)}A.prototype={setTagName:function(e){if(!n.QName_exact.test(e))throw Error(`invalid tagName:`+e);this.tagName=e},addValue:function(e,t,r){if(!n.QName_exact.test(e))throw Error(`invalid attribute:`+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:r}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},e.XMLReader=y,e.parseUtils=D,e.parseDoctypeCommentOrCData=k})),yi=/* @__PURE__ */ r((e=>{var t=pi(),n=gi(),r=mi(),i=_i(),a=vi(),o=n.DOMImplementation,s=t.hasDefaultHTMLNamespace,c=t.isHTMLMimeType,l=t.isValidMimeType,u=t.MIME_TYPE,d=t.NAMESPACE,f=r.ParseError,p=a.XMLReader;function m(e){return e.replace(/\r[\n\u0085]/g,`
|
|
21
|
+
`).replace(/[\r\u0085\u2028\u2029]/g,`
|
|
22
|
+
`)}function h(e){if(e||={},e.locator===void 0&&(e.locator=!0),this.assign=e.assign||t.assign,this.domHandler=e.domHandler||g,this.onError=e.onError||e.errorHandler,e.errorHandler&&typeof e.errorHandler!=`function`)throw TypeError(`errorHandler object is no longer supported, switch to onError!`);e.errorHandler&&e.errorHandler(`warning`,"The `errorHandler` option has been deprecated, use `onError` instead!",this),this.normalizeLineEndings=e.normalizeLineEndings||m,this.locator=!!e.locator,this.xmlns=this.assign(Object.create(null),e.xmlns)}h.prototype.parseFromString=function(e,n){if(!l(n))throw TypeError(`DOMParser.parseFromString: the provided mimeType "`+n+`" is not valid.`);var r=this.assign(Object.create(null),this.xmlns),a=i.XML_ENTITIES,o=r[``]||null;s(n)?(a=i.HTML_ENTITIES,o=d.HTML):n===u.XML_SVG_IMAGE&&(o=d.SVG),r[``]=o,r.xml=r.xml||d.XML;var c=new this.domHandler({mimeType:n,defaultNamespace:o,onError:this.onError}),f=this.locator?{}:void 0;this.locator&&c.setDocumentLocator(f);var m=new p;return m.errorHandler=c,m.domBuilder=c,!t.isHTMLMimeType(n)&&typeof e!=`string`&&m.errorHandler.fatalError(`source is not a string`),m.parse(this.normalizeLineEndings(String(e)),r,a),c.doc.documentElement||m.errorHandler.fatalError(`missing root element`),c.doc};function g(e){var t=e||{};this.mimeType=t.mimeType||u.XML_APPLICATION,this.defaultNamespace=t.defaultNamespace||null,this.cdata=!1,this.currentElement=void 0,this.doc=void 0,this.locator=void 0,this.onError=t.onError}function _(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}g.prototype={startDocument:function(){var e=new o;this.doc=c(this.mimeType)?e.createHTMLDocument(!1):e.createDocument(this.defaultNamespace,``)},startElement:function(e,t,n,r){var i=this.doc,a=i.createElementNS(e,n||t),o=r.length;b(this,a),this.currentElement=a,this.locator&&_(this.locator,a);for(var s=0;s<o;s++){var e=r.getURI(s),c=r.getValue(s),n=r.getQName(s),l=i.createAttributeNS(e,n);this.locator&&_(r.getLocator(s),l),l.value=l.nodeValue=c,a.setAttributeNode(l)}},endElement:function(e,t,n){this.currentElement=this.currentElement.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){var n=this.doc.createProcessingInstruction(e,t);this.locator&&_(this.locator,n),b(this,n)},ignorableWhitespace:function(e,t,n){},characters:function(e,t,n){if(e=y.apply(this,arguments),e){if(this.cdata)var r=this.doc.createCDATASection(e);else var r=this.doc.createTextNode(e);this.currentElement?this.currentElement.appendChild(r):/^\s*$/.test(e)&&this.doc.appendChild(r),this.locator&&_(this.locator,r)}},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){e&&(e.lineNumber=0),this.locator=e},comment:function(e,t,n){e=y.apply(this,arguments);var r=this.doc.createComment(e);this.locator&&_(this.locator,r),b(this,r)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,n,r){var i=this.doc.implementation;if(i&&i.createDocumentType){var a=i.createDocumentType(e,t,n,r);this.locator&&_(this.locator,a),b(this,a),this.doc.doctype=a}},reportError:function(e,t){if(typeof this.onError==`function`)try{this.onError(e,t,this)}catch(n){throw new f(`Reporting `+e+` "`+t+`" caused `+n,this.locator)}else console.error(`[xmldom `+e+`] `+t,v(this.locator))},warning:function(e){this.reportError(`warning`,e)},error:function(e){this.reportError(`error`,e)},fatalError:function(e,t){throw this.reportError(`fatalError`,e),new f(e,this.locator,t)}};function v(e){if(e)return`
|
|
23
|
+
@#[line:`+e.lineNumber+`,col:`+e.columnNumber+`]`}function y(e,t,n){return typeof e==`string`?e.substr(t,n):e.length>=t+n||t?new java.lang.String(e,t,n)+``:e}`endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl`.replace(/\w+/g,function(e){g.prototype[e]=function(){return null}});function b(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}e.__DOMHandler=g,e.DOMParser=h,e.normalizeLineEndings=m,e.onErrorStopParsing=function(e){if(e===`error`)throw`onErrorStopParsing`},e.onWarningStopParsing=function(){throw`onWarningStopParsing`}})),bi=(/* @__PURE__ */ r((e=>{var t=pi();e.assign=t.assign,e.hasDefaultHTMLNamespace=t.hasDefaultHTMLNamespace,e.isHTMLMimeType=t.isHTMLMimeType,e.isValidMimeType=t.isValidMimeType,e.MIME_TYPE=t.MIME_TYPE,e.NAMESPACE=t.NAMESPACE;var n=mi();e.DOMException=n.DOMException,e.DOMExceptionName=n.DOMExceptionName,e.ExceptionCode=n.ExceptionCode,e.ParseError=n.ParseError;var r=gi();e.Attr=r.Attr,e.CDATASection=r.CDATASection,e.CharacterData=r.CharacterData,e.Comment=r.Comment,e.Document=r.Document,e.DocumentFragment=r.DocumentFragment,e.DocumentType=r.DocumentType,e.DOMImplementation=r.DOMImplementation,e.Element=r.Element,e.Entity=r.Entity,e.EntityReference=r.EntityReference,e.LiveNodeList=r.LiveNodeList,e.NamedNodeMap=r.NamedNodeMap,e.Node=r.Node,e.NodeList=r.NodeList,e.Notation=r.Notation,e.ProcessingInstruction=r.ProcessingInstruction,e.Text=r.Text,e.XMLSerializer=r.XMLSerializer;var i=yi();e.DOMParser=i.DOMParser,e.normalizeLineEndings=i.normalizeLineEndings,e.onErrorStopParsing=i.onErrorStopParsing,e.onWarningStopParsing=i.onWarningStopParsing})))();const xi=/* @__PURE__ */ new WeakMap;function Si(e,t){let n=xi.get(e);return n&&xi.set(t,n),t}var $=class extends Error{constructor(e){super(e),this.name=`XmlWikiConversionError`}};const Ci=$,wi=/* @__PURE__ */ new Set([`none`,`row`,`col`,`both`]);function Ti(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ei(e){return e.blockType===`paragraph`}function Di(e){return e.blockType===`quote`}function Oi(e){return e.blockType===`list`}function ki(e){return e.blockType===`image`}function Ai(e){return e.blockType===`complexTable`}function ji(e){return e.inlineType===`text`}function Mi(e,t){return{inlineType:`text`,text:e,bold:t?.bold??!1,italic:t?.italic??!1,underline:t?.underline??!1,strike:t?.strike??!1,color:t?.color??null}}function Ni(e=[],t=`body`,n=`left`){return{blockType:`paragraph`,kind:t,align:n,inlines:e}}function Pi(e,t,n){if(e===`none`)return!1;if(e===`row`)return t===0;if(e===`col`)return n===0;if(e===`both`)return t===0||n===0;throw new Ci(`Unsupported table header mode '${e}'.`)}function Fi(e){return ji(e)?!!e.text:e.inlineType===`pronunciation`?!!e.content:e.inlineType===`link`?!!(e.text||e.href):e.inlineType===`emoji`||e.inlineType===`annotation`||!!e.targetId}function Ii(e){return Ei(e)&&e.kind===`body`&&!e.inlines.some(e=>Fi(e))}function Li(e){let t=[];for(let n of e){let e=t[t.length-1];e&&ji(e)&&ji(n)&&e.bold===n.bold&&e.italic===n.italic&&e.underline===n.underline&&e.strike===n.strike&&e.color===n.color?e.text+=n.text:t.push(n)}return t}function Ri(e){let t=[[]];for(let n of e){if(n.inlineType===`entry`||n.inlineType===`emoji`||n.inlineType===`annotation`){t[t.length-1].push(n);continue}let e=(n.inlineType===`pronunciation`?n.content:n.text).replace(/\r\n|\r/g,`
|
|
24
|
+
`).split(`
|
|
25
|
+
`);for(let[r,i]of e.entries())r>0&&t.push([]),i&&t[t.length-1].push(n.inlineType===`pronunciation`?{...n,content:i}:{...n,text:i})}return t}function zi(e,t=!1){let n=[];for(let r of e)if(Ei(r)){let e=Ri(r.inlines.map(e=>e.inlineType===`annotation`?Si(e,{...e,title:Li(e.title.map(e=>({...e}))),content:zi(e.content)}):e)).map(Li);for(let t of e){for(;t[0]&&ji(t[0])&&(t[0].text=t[0].text.trimStart(),!t[0].text);)t.shift();for(;t.length&&ji(t[t.length-1]);){let e=t[t.length-1];if(e.text=e.text.trimEnd(),e.text)break;t.pop()}}if(!t&&e.length>1){for(;e.length&&!e[0].length;)e.shift();for(;e.length&&!e[e.length-1].length;)e.pop()}for(let[t,i]of e.entries()){let e=i.length?Ni(i,r.kind,r.align):Ni();n.push(t===0?Si(r,e):e)}}else if(Di(r)){let e=zi(r.children);e.length&&n.push(Si(r,{blockType:`quote`,children:e}))}else if(Oi(r)){let e=[];for(let t of r.items){let n=zi(t.blocks);n.length&&e.push(Si(t,{blocks:n}))}e.length&&n.push(Si(r,{blockType:`list`,ordered:r.ordered,items:e}))}else if(Ai(r)){let e=[...r.cells].sort((e,t)=>e.rowIndex===t.rowIndex?e.columnIndex-t.columnIndex:e.rowIndex-t.rowIndex).map(e=>({rowIndex:e.rowIndex,columnIndex:e.columnIndex,blocks:zi(e.blocks),rowSpan:e.rowSpan,colSpan:e.colSpan})),t={blockType:`complexTable`,headerMode:r.headerMode,columnWidths:[...r.columnWidths],cells:e,rowCount:r.rowCount,columnCount:r.columnCount};Gi(t),n.push(Si(r,t))}else n.push(r);if(!t){for(;n.length>0&&Ii(n[0]);)n.shift();for(;n.length>0&&Ii(n[n.length-1]);)n.pop()}return Si(e,n)}function Bi(e){let t=zi(e,!0);return t.length||t.push(Ni()),t}function*Vi(e){for(let t of e)if(Ei(t))for(let e of t.inlines)e.inlineType===`annotation`&&(yield*Vi(e.content));else if(ki(t))yield t;else if(Di(t))yield*Vi(t.children);else if(Oi(t))for(let e of t.items)yield*Vi(e.blocks);else if(Ai(t))for(let e of t.cells)yield*Vi(e.blocks)}function Hi(e,t){for(let n of e){if(!Ei(n)||n.kind!==`body`||n.align!==`left`)throw new $(`${t} only supports left-aligned body paragraphs.`);for(let e of n.inlines)if(e.inlineType===`emoji`){if(typeof e.id!=`string`||!e.id.trim())throw new $(`${t} emoji must include a nonempty id.`)}else if(!ji(e)||e.bold||e.italic||e.underline||e.strike||e.color!==null)throw new $(`${t} only supports unstyled text and emoji.`)}}function Ui(e,t){if(e.type!==`message`||e.side!==`me`&&e.side!==`other`)throw new $(`${t} must be a message with side 'me' or 'other'.`);if(typeof e.avatarUrl!=`string`||!e.avatarUrl.trim())throw new $(`${t} must include a nonempty avatar.`);for(let[n,r]of e.contents.entries()){let e=`${t}.contents[${n}]`;if(r.type===`text`)Hi(r.blocks,e);else if(r.type===`image`){if(typeof r.src!=`string`||!r.src.trim())throw new $(`${e} must include a nonempty image src.`)}else throw new $(`${e} must be text or an image.`)}}function Wi(e){let t=`Dialog chapter '${e.title}'`;if(e.chapterType!==`dialog`||e.content.length||e.tabs.length||e.audios.length||e.audioTabs?.length||e.tableRows.length)throw new $(`${t} cannot mix chapter modes.`);if(!Array.isArray(e.dialog)||!e.dialog.length)throw new $(`${t} must contain at least one dialog entry.`);for(let[n,r]of e.dialog.entries()){let e=`${t}.dialogList[${n}]`;switch(r.type){case`message`:Ui(r,e);break;case`divider`:if(typeof r.kind!=`string`||!r.kind.trim())throw new $(`${e} must include a nonempty divider kind.`);break;case`branches`:if(!r.branches.length)throw new $(`${e} must contain at least one branch.`);for(let[t,n]of r.branches.entries()){let r=`${e}.branchList[${t}]`;for(let[e,t]of n.messages.entries())Ui(t,`${r}.dialogList[${e}]`);let i=n.messages[0];if(i?.side!==`me`||n.messages.at(-1)?.side!==`other`)throw new $(`${r} must start with 'me' and end with 'other'.`);if(i.contents.some(e=>e.type===`image`))throw new $(`${r} first message cannot contain an image.`)}break;default:throw new $(`${e} must be a message, a divider or a branch group.`)}}}function Gi(e){if(!wi.has(e.headerMode))throw new Ci(`Unsupported table header mode '${e.headerMode}'.`);if(e.rowCount<=0||e.columnCount<=0)throw new Ci(`Complex tables must contain at least one row and one column.`);if(e.columnWidths.length!==e.columnCount)throw new Ci(`Complex table column widths length ${e.columnWidths.length} does not match column count ${e.columnCount}.`);for(let t=0;t<e.columnWidths.length;t+=1){let n=e.columnWidths[t];if(!Number.isFinite(n)||n<=0)throw new Ci(`Complex table column ${t+1} width ${n} must be a positive number.`)}let t=/* @__PURE__ */ new Map;for(let n of e.cells){if(n.rowIndex<0||n.columnIndex<0)throw new Ci(`Complex table cell positions must be non-negative.`);if(n.rowSpan<1||n.colSpan<1)throw new Ci(`Complex table cell spans must be positive integers.`);if(n.rowIndex+n.rowSpan>e.rowCount)throw new Ci(`Complex table cell row span exceeds the table bounds.`);if(n.columnIndex+n.colSpan>e.columnCount)throw new Ci(`Complex table cell column span exceeds the table bounds.`);for(let e=n.rowIndex;e<n.rowIndex+n.rowSpan;e+=1)for(let r=n.columnIndex;r<n.columnIndex+n.colSpan;r+=1){let i=`${e}:${r}`;t.set(i,n)}}for(let n=0;n<e.rowCount;n+=1)for(let r=0;r<e.columnCount;r+=1){let e=`${n}:${r}`;if(!t.has(e))throw new Ci(`Complex table contains uncovered grid positions.`)}for(let t of e.cells)for(let e of Vi(t.blocks)){let t=Number.parseFloat(e.width);if(!Number.isFinite(t))throw new Ci(`Image width '${e.width}' is not numeric.`)}}const Ki=Object.fromEntries(Object.entries({light_text_primary:`s_1`,light_text_secondary:`s_2`,light_text_tertiary:`s_3`,light_text_quaternary:`s_4`,light_rank_gray:`r_1`,light_rank_green:`r_2`,light_rank_blue:`r_3`,light_rank_purple:`r_4`,light_rank_yellow:`r_5`,light_rank_orange:`r_6`,light_function_orange:`f_orange`,light_function_turquoise:`f_turquoise`,light_function_green:`f_green`,light_function_sandstone:`f_sandstone`,light_function_yellow:`f_yellow`,light_function_red:`f_red`,light_function_blue:`f_blue`,light_function_brown:`f_brown`,light_function_violet:`f_violet`,light_function_blueness:`f_blueness`}).map(([e,t])=>[t,e]));Object.fromEntries(Object.entries({"card-big":`card-big`,"link-img":`link-imgText`,"link-txt":`link-text`}).map(([e,t])=>[t,e]));const qi=/* @__PURE__ */ new Set([`b`,`i`,`u`,`s`,`color`,`pron`,`a`,`entry`,`emoji`,`annotation`,`br`]),Ji=/* @__PURE__ */ new Set([`h1`,`h2`,`h3`,`quote`,`ul`,`ol`,`align`,`img`,`line`,`video`]),Yi=/* @__PURE__ */ new Set([`skland`,`bilibili`]),Xi={large:1160,middle:754.7,small:349.3};function Zi(e){return typeof structuredClone==`function`?structuredClone(e):JSON.parse(JSON.stringify(e))}function Qi(e){return Ti(e)?Zi(e):{}}function $i(){let e=globalThis.DOMParser;return typeof e==`function`?e:null}function ea(e){let t=$i();if(t)return new t().parseFromString(e,`application/xml`);let n=[],r=new bi.DOMParser({errorHandler(e,t){e!==`warning`&&n.push(t)}}).parseFromString(e,`application/xml`);if(n.length){let e=r.createElement(`parsererror`);e.appendChild(r.createTextNode(n[0])),r.documentElement?.appendChild(e)}return r}function ta(e){let t;try{t=ea(e)}catch(e){throw new $((e instanceof Error?e.message:String(e))||`Invalid XML.`)}let n=t.getElementsByTagName(`parsererror`)[0];if(n)throw new $(ia(n.textContent,`Invalid XML.`));let r=t.documentElement;if(!r)throw new $(`Invalid XML.`);return r}function na(e){let t=[];for(let n of Array.from(e.childNodes))n.nodeType===1&&t.push(n);return t}function ra(e){let t=``;for(let n of Array.from(e.childNodes))(n.nodeType===3||n.nodeType===4)&&(t+=n.nodeValue||``);return t}function ia(e,t=``){return e==null?t:e.replace(/\s+/g,` `).trim()}function aa(e){if(e==null)return``;let t=e.replace(/\r\n/g,`
|
|
26
|
+
`).replace(/\r/g,`
|
|
27
|
+
`).split(`
|
|
28
|
+
`).map(e=>e.trim());for(;t.length>0&&!t[0];)t.shift();for(;t.length>0&&!t[t.length-1];)t.pop();return t.join(`
|
|
29
|
+
`)}function oa(e){return ra(e).trim()?!0:na(e).length>0}function sa(e,t){for(let n of na(e))if(n.tagName===t)return n;throw new $(`Expected <${t}> inside <${e.tagName}>.`)}function ca(e,t){return na(e).filter(e=>e.tagName===t)}function la(e,t){for(let n of na(e))if(n.tagName===t)return n;return null}function ua(e){let t=la(e,`publicMeta`);if(!t)return{infoRoot:{},item:{},brief:{},documentExtraInfo:{}};let n=ra(t).trim();if(!n)return{infoRoot:{},item:{},brief:{},documentExtraInfo:{}};let r;try{r=JSON.parse(n)}catch(e){throw new $(`Invalid <publicMeta> JSON: ${e instanceof Error?e.message:String(e)}`)}if(!Ti(r))throw new $(`<publicMeta> must contain a JSON object.`);let i=Qi(r.item??r);return delete i.commitMsg,{infoRoot:Qi(r.infoRoot),item:i,brief:Qi(r.brief),documentExtraInfo:Qi(r.documentExtraInfo)}}function da(e){let t=ta(e);if(t.tagName!==`sklandDocument`)throw new $(`Expected root element <sklandDocument>.`);ma(t);let n=ua(t),r=la(t,`commitMsg`),i=sa(t,`metainfo`),a=sa(i,`cover`),o=sa(i,`subTypes`),s=sa(t,`description`),c=[];for(let e of ca(t,`chapters`)){let t=e.getAttribute(`name`);if(t==null)throw new $(`Each <chapters> element must have a name attribute.`);let n=ca(e,`chapter`).map(e=>fa(e));c.push({title:t,chapters:n})}let l=ca(o,`subType`).map(e=>{let t=e.getAttribute(`id`);if(t==null)throw new $(`<subType> must include an id attribute.`);return{subTypeId:t,value:ra(e)}});return[{itemId:ia(ra(sa(t,`itemId`))),infoRootMeta:n.infoRoot,publicMeta:n.item,briefExtra:n.brief,documentExtraInfo:n.documentExtraInfo,name:ra(sa(i,`name`)),cover:ra(a),showInDetail:(a.getAttribute(`showInDetail`)||`false`).toLowerCase()===`true`,subTypes:l,descriptionWasNull:(s.getAttribute(`source`)||``).toLowerCase()===`null`,description:Ca(s,{allowTables:!0}),chapterGroups:c,...r?{commitMsg:ra(r)}:{}},[]]}function fa(e){let t=e.getAttribute(`name`);if(t==null)throw new $(`Each <chapter> element must have a name attribute.`);let n=e.getAttribute(`size`)||``;if(e.getAttribute(`dialog`)===`true`){let r=`Dialog chapter '${t}'`;if(e.getAttribute(`table`)===`true`||e.getAttribute(`audio`)===`true`)throw new $(`${r} cannot mix chapter modes.`);let i={title:t,size:n,chapterType:`dialog`,content:[],tabs:[],audios:[],tableRows:[],dialog:ha(e,r).map((e,t)=>_a(e,`${r}.dialogList[${t}]`))};return Wi(i),i}if(e.getAttribute(`table`)===`true`){let r=sa(e,`table`),i=[];for(let[e,n]of ca(r,`row`).entries()){let r=ca(n,`cell`);if(r.length!==2)throw new $(`Simple table chapter '${t}' row ${e+1} must contain exactly 2 cells.`);i.push({cells:r.map(e=>[e.getAttribute(`label`)||``,Ma(e)])})}return{title:t,size:n,chapterType:`simple_table`,content:[],tabs:[],audios:[],tableRows:i}}if(e.getAttribute(`audio`)===`true`){let r=ca(e,`tab`),i=ca(e,`audios`);if(r.length&&i.length)throw new $(`Audio chapter '${t}' cannot contain both direct <audios> and <tab> elements.`);return r.length?{title:t,size:n,chapterType:`audio`,content:[],tabs:[],audios:[],audioTabs:r.map((e,n)=>{let r=ca(e,`audios`);if(r.length!==1)throw new $(`Audio chapter '${t}' tab ${n+1} must contain exactly one <audios> element.`);return{title:e.getAttribute(`name`),icon:e.getAttribute(`icon`),audios:xa(r[0])}}),tableRows:[]}:{title:t,size:n,chapterType:`audio`,content:[],tabs:[],audios:xa(sa(e,`audios`)),tableRows:[]}}let r=ca(e,`tab`);return r.length?{title:t,size:n,chapterType:`common`,content:[],tabs:r.map(e=>Sa(e,n)),audios:[],tableRows:[]}:{title:t,size:n,chapterType:`common`,content:Ca(e,{chapterSize:n,allowTables:!0}),tabs:[],audios:[],tableRows:[]}}const pa=/* @__PURE__ */ new Set([`message`,`text`,`image`,`branches`,`branch`,`divider`]);function ma(e){let t=/* @__PURE__ */ new Set;for(let n of Array.from(e.getElementsByTagName(`*`))){if(n.tagName===`chapter`&&n.getAttribute(`dialog`)===`true`){let r=n.parentElement;if(r?.tagName!==`chapters`||r.parentElement!==e)throw new $(`A dialog <chapter> must be directly inside a top-level <chapters> element.`);t.add(n)}if(!pa.has(n.tagName))continue;let r=n.parentElement;for(;r&&r.tagName!==`chapter`;)r=r.parentElement;if(!r||!t.has(r))throw new $(`<${n.tagName}> must be inside a dialog chapter.`)}}function ha(e,t){if(ra(e).trim())throw new $(`${t} cannot contain text directly inside <${e.tagName}>.`);return na(e)}function ga(e,t,n){for(let r of Array.from(e.attributes))if(!t.includes(r.name))throw new $(`${n} has unsupported attribute '${r.name}' on <${e.tagName}>.`)}function _a(e,t){switch(e.tagName){case`message`:return va(e,t);case`divider`:if(ga(e,[`kind`],t),na(e).length)throw new $(`${t} <divider> only supports plain text.`);return{type:`divider`,kind:e.getAttribute(`kind`)||``,text:ra(e)};case`branches`:return ga(e,[],t),{type:`branches`,branches:ha(e,t).map((e,n)=>{let r=`${t}.branchList[${n}]`;if(e.tagName!==`branch`||!e.hasAttribute(`name`))throw new $(`${r} must be a <branch> with a name attribute.`);return ga(e,[`name`],r),{title:e.getAttribute(`name`)||``,messages:ha(e,r).map((e,t)=>va(e,`${r}.dialogList[${t}]`))}})};default:throw new $(`${t} cannot contain <${e.tagName}>.`)}}function va(e,t){let n=e.getAttribute(`side`);if(e.tagName!==`message`||n!==`me`&&n!==`other`)throw new $(`${t} must be a <message> with side 'me' or 'other'.`);return ga(e,[`side`,`avatar`,`name`],t),{type:`message`,side:n,avatarUrl:e.getAttribute(`avatar`)||``,name:e.getAttribute(`name`)||``,contents:ha(e,t).map((e,n)=>ya(e,`${t}.contents[${n}]`))}}function ya(e,t){if(e.tagName===`text`)return{type:`text`,blocks:ba(e,t)};if(e.tagName===`image`){if(ga(e,[`src`],t),oa(e))throw new $(`${t} <image> cannot contain content.`);return{type:`image`,src:e.getAttribute(`src`)||``}}throw new $(`${t} must be <text> or <image>.`)}function ba(e,t){ga(e,[],t);let n=[],r=``,i=!0;function a(e){let t=i?r.trimStart():r,a=e?t.trimEnd():t;a&&n.push(Mi(a)),r=``}for(let o of Array.from(e.childNodes))if(o.nodeType===3||o.nodeType===4)r+=o.nodeValue??``;else if(o.nodeType===1){let e=o,r=e.tagName===`br`;if(!r&&e.tagName!==`emoji`)throw new $(`${t} cannot contain <${e.tagName}> inside <text>.`);a(r),n.push(...Oa(e)),i=r}return a(!0),Bi([Ni(n)])}function xa(e){return ca(e,`audio`).map(e=>({title:e.getAttribute(`name`)||``,profile:Ma(e,!0),resourceUrl:e.getAttribute(`src`)||``}))}function Sa(e,t){let n=null,r=Ca(e,{chapterSize:t,allowTables:!0,specialHandlers:{imgIntro:e=>{n={name:ia(ra(sa(e,`name`))),introType:ia(ra(sa(e,`type`))),imageUrl:ia(ra(sa(e,`imgUrl`))),description:Da(sa(e,`description`),{preserveNewlines:!0})}}}});return{title:e.getAttribute(`name`),icon:e.getAttribute(`icon`),intro:n,content:r}}function Ca(e,t){let n=t?.specialHandlers||{},r=t?.chapterSize,i=t?.allowTables??!0,a=[],o=null,s=!1,c=()=>(o||=[],o),l=()=>{o&&=(a.push(Ni(Li(o))),null)},u=e=>{if(!e)return;let t=e.replace(/\r\n|\r/g,`
|
|
30
|
+
`).split(`
|
|
31
|
+
`);for(let[e,n]of t.entries())e>0&&(o?l():s||a.push(Ni()),s=!1),(n.trim()||o)&&c().push(Mi(n))};for(let t of Array.from(e.childNodes)){if(t.nodeType===3||t.nodeType===4){u(t.nodeValue);continue}if(t.nodeType!==1)continue;let e=t,o=e.tagName;if(n[o])l(),n[o](e),s=!0;else if(qi.has(o))c().push(...Oa(e));else if(Ji.has(o)||i&&o===`table`)l(),a.push(wa(e,{chapterSize:r,allowTables:i})),s=!0;else{if(o===`table`&&!i)throw new $(`Nested tables are not supported inside table cells.`);if(oa(e))throw new $(`Unsupported XML tag <${o}> in content container.`)}}return l(),zi(a)}function wa(e,t){if(e.tagName===`h1`)return{blockType:`paragraph`,kind:`heading1`,align:`left`,inlines:Da(e)};if(e.tagName===`h2`)return{blockType:`paragraph`,kind:`heading2`,align:`left`,inlines:Da(e)};if(e.tagName===`h3`)return{blockType:`paragraph`,kind:`heading3`,align:`left`,inlines:Da(e)};if(e.tagName===`quote`)return{blockType:`quote`,children:Ca(e,{chapterSize:t.chapterSize,allowTables:t.allowTables})};if(e.tagName===`ul`)return Ea(e,{ordered:!1,chapterSize:t.chapterSize,allowTables:t.allowTables});if(e.tagName===`ol`)return Ea(e,{ordered:!0,chapterSize:t.chapterSize,allowTables:t.allowTables});if(e.tagName===`align`)return{blockType:`paragraph`,kind:`body`,align:e.getAttribute(`value`)||`left`,inlines:Da(e)};if(e.tagName===`img`){let t=ia(ra(sa(e,`url`))),n=la(e,`id`),r=la(e,`format`),i=n&&r?null:Na(t);return{blockType:`image`,url:t,width:ia(ra(sa(e,`width`))),height:ia(ra(sa(e,`height`))),size:ia(ra(sa(e,`size`))),imageId:n?ia(ra(n)):i[0],imageFormat:r?ia(ra(r)):i[1],description:Ma(sa(e,`description`))}}if(e.tagName===`line`)return{blockType:`horizontalLine`,kind:e.getAttribute(`kind`)||``};if(e.tagName===`video`){let t=e.getAttribute(`kind`);if(!t)throw new $(`<video> must include a kind attribute.`);if(!Yi.has(t))throw new $(`Unsupported external video kind '${t}'.`);let n=e.getAttribute(`id`);if(!n)throw new $(`<video> must include an id attribute.`);return{blockType:`externalVideo`,videoKind:t,videoId:n}}if(e.tagName===`table`){if(!t.allowTables)throw new $(`Nested tables are not supported inside table cells.`);return Ta(e,t.chapterSize)}throw new $(`Unsupported block tag <${e.tagName}>.`)}function Ta(e,t){let n=(e.getAttribute(`header`)||`none`).trim()||`none`;if(!wi.has(n))throw new $(`Unsupported table header mode '${n}'.`);let r=ca(e,`tr`);if(!r.length)throw new $(`Complex tables must contain at least one <tr>.`);let i=/* @__PURE__ */ new Map,a=[],o=0;for(let[e,s]of r.entries()){if((s.getAttribute(`width`)||``).trim())throw new $(`Row-level width is not supported; use the table widths attribute instead.`);let r=!1,c=0;for(let o of Array.from(s.childNodes)){if(o.nodeType===3||o.nodeType===4){if((o.nodeValue||``).trim())throw new $(r?`Unexpected trailing text inside a table row.`:`Unexpected text directly inside a table row.`);continue}if(o.nodeType!==1)continue;r=!0;let s=o;if(s.tagName!==`td`&&s.tagName!==`th`){if(oa(s))throw new $(`Unsupported tag <${s.tagName}> inside <tr>.`);continue}for(;i.has(`${e}:${c}`);)c+=1;let l=s.getAttribute(`col`);l!==null&&(c=Fa(l,`row ${e+1} col`)-1);let u=Fa((s.getAttribute(`rowspan`)||`1`).trim(),`row ${e+1} rowspan`),d=Fa((s.getAttribute(`colspan`)||`1`).trim(),`row ${e+1} colspan`),f=Ca(s,{chapterSize:t,allowTables:!1});if(s.tagName===`th`!==Pi(n,e,c))throw new $(`Table header mode '${n}' conflicts with cell at row ${e+1}, column ${c+1}.`);a.push({rowIndex:e,columnIndex:c,rowSpan:u,colSpan:d,blocks:f});for(let t=0;t<u;t+=1)for(let n=0;n<d;n+=1){let r=`${e+t}:${c+n}`;i.set(r,{rowIndex:e,columnIndex:c})}c+=d}for(;i.has(`${e}:${c}`);)c+=1;o=Math.max(o,c)}let s={blockType:`complexTable`,headerMode:n,columnWidths:Pa(e.getAttribute(`widths`),t,o),cells:a,rowCount:r.length,columnCount:o};return Gi(s),s}function Ea(e,t){if(ra(e).trim())throw new $(`Unexpected text directly inside a list container.`);let n=[],r=null;for(let i of Array.from(e.childNodes)){if(i.nodeType===3||i.nodeType===4){if((i.nodeValue||``).trim())throw new $(`Unexpected trailing text after a list child element.`);continue}if(i.nodeType!==1)continue;let e=i;if(e.tagName===`li`){let i=Ca(e,{chapterSize:t.chapterSize,allowTables:t.allowTables});i.length||(i=[Ni()]),r={blocks:i},n.push(r)}else if(e.tagName===`ul`||e.tagName===`ol`){if(!r)throw new $(`Nested list must follow a list item.`);r.blocks.push(Ea(e,{ordered:e.tagName===`ol`,chapterSize:t.chapterSize,allowTables:t.allowTables}))}else if(oa(e))throw new $(`Unsupported tag <${e.tagName}> inside list.`)}return{blockType:`list`,ordered:t.ordered,items:n}}function Da(e,t){let n=t?.bold??!1,r=t?.italic??!1,i=t?.underline??!1,a=t?.strike??!1,o=t?.color??null,s=t?.preserveNewlines??!1,c=t?.preserveWhitespace??!1,l=t?.preserveBoundarySpaces??!!(e.getElementsByTagName(`emoji`).length||e.getElementsByTagName(`annotation`).length),u=[];for(let t of Array.from(e.childNodes))t.nodeType===3||t.nodeType===4?Aa(u,t.nodeValue,{bold:n,italic:r,underline:i,strike:a,color:o,preserveNewlines:s,preserveWhitespace:c,preserveBoundarySpaces:l}):t.nodeType===1&&u.push(...Oa(t,{bold:n,italic:r,underline:i,strike:a,color:o,preserveNewlines:s,preserveWhitespace:c,preserveBoundarySpaces:l}));return Li(u)}function Oa(e,t){let n=t?.bold??!1,r=t?.italic??!1,i=t?.underline??!1,a=t?.strike??!1,o=t?.color??null,s=t?.preserveNewlines??!1,c=t?.preserveWhitespace??!1,l=t?.preserveBoundarySpaces??!!(e.getElementsByTagName(`emoji`).length||e.getElementsByTagName(`annotation`).length);if(e.tagName===`emoji`){let t=e.getAttribute(`id`);if(!t?.trim())throw new $(`Emoji must include a nonempty id.`);if(na(e).length||ra(e).trim())throw new $(`<emoji> must not contain content.`);if(Array.from(e.attributes).some(e=>e.name!==`id`))throw new $(`<emoji> only supports the id attribute.`);return[{inlineType:`emoji`,id:t}]}if(e.tagName===`annotation`)return[ka(e)];if(e.tagName===`br`)return ja(e),[Mi(`
|
|
32
|
+
`,{bold:n,italic:r,underline:i,strike:a,color:o})];if(e.tagName===`b`)return Da(e,{bold:!0,italic:r,underline:i,strike:a,color:o,preserveNewlines:s,preserveWhitespace:c,preserveBoundarySpaces:l});if(e.tagName===`i`)return Da(e,{bold:n,italic:!0,underline:i,strike:a,color:o,preserveNewlines:s,preserveWhitespace:c,preserveBoundarySpaces:l});if(e.tagName===`u`)return Da(e,{bold:n,italic:r,underline:!0,strike:a,color:o,preserveNewlines:s,preserveWhitespace:c,preserveBoundarySpaces:l});if(e.tagName===`s`)return Da(e,{bold:n,italic:r,underline:i,strike:!0,color:o,preserveNewlines:s,preserveWhitespace:c,preserveBoundarySpaces:l});if(e.tagName===`color`){let t=e.getAttribute(`value`);if(!t)throw new $(`<color> must include a value attribute.`);if(!Ki[t])throw new $(`Unsupported XML color '${t}'.`);return Da(e,{bold:n,italic:r,underline:i,strike:a,color:t,preserveNewlines:s,preserveWhitespace:c,preserveBoundarySpaces:l})}if(e.tagName===`pron`)return[{inlineType:`pronunciation`,content:Ma(e)}];if(e.tagName===`a`)return[{inlineType:`link`,href:e.getAttribute(`href`)||``,text:Ma(e)}];if(e.tagName===`entry`){let t=e.getAttribute(`type`);if(!t)throw new $(`<entry> must include a type attribute.`);return[{inlineType:`entry`,entryType:t,targetId:e.getAttribute(`id`)||``,count:e.getAttribute(`count`)||`0`}]}throw new $(`Unsupported inline tag <${e.tagName}>.`)}function ka(e){if(e.getElementsByTagName(`annotation`).length)throw new $(`Nested annotations are not supported.`);let t=na(e),n=ca(e,`title`),r=ca(e,`content`);if(n.length!==1||r.length!==1||t.length!==2||ra(e).trim())throw new $(`<annotation> must contain exactly one <title> and one <content>.`);let i=!0,a;for(let t=e.parentNode;t;t=t.parentNode){if(t.nodeType!==1)continue;let e=t;if(e.tagName===`annotation`)throw new $(`Nested annotations are not supported.`);(e.tagName===`td`||e.tagName===`th`)&&(i=!1),e.tagName===`chapter`&&(a=e.getAttribute(`size`)||void 0)}return{inlineType:`annotation`,title:Da(n[0],{preserveWhitespace:!0}),content:Ca(r[0],{allowTables:i,chapterSize:a})}}function Aa(e,t,n){if(!t)return;let r;n.preserveWhitespace?r=t.replace(/\r\n|\r/g,`
|
|
33
|
+
`):n.preserveNewlines?(r=t.replace(/\r\n/g,`
|
|
34
|
+
`).replace(/\r/g,`
|
|
35
|
+
`).replace(/[^\S\n]+/g,` `),n.preserveBoundarySpaces||(r=r.replace(/^[^\S\n]+/,``).replace(/[^\S\n]+$/,``))):(r=t.replace(/\s+/g,` `),n.preserveBoundarySpaces||(r=r.trim())),r&&e.push(Mi(r,{bold:n.bold,italic:n.italic,underline:n.underline,strike:n.strike,color:n.color}))}function ja(e){if(Array.from(e.childNodes).some(e=>e.nodeType===1||!!e.nodeValue?.trim()))throw new $(`<br> must not contain content.`)}function Ma(e,t=!1){let n=[``];function r(t){for(let i of Array.from(t.childNodes))if(i.nodeType===3||i.nodeType===4)n[n.length-1]+=i.nodeValue??``;else if(i.nodeType===1){let t=i;if(t.tagName===`emoji`||t.tagName===`annotation`)throw new $(`Unsupported <${t.tagName}> inside text-only <${e.tagName}>.`);t.tagName===`br`?(ja(t),n.push(``)):r(t)}}return r(e),n.map(e=>t?aa(e):ia(e)).join(`
|
|
36
|
+
`)}function Na(e){let t=e.split(`/`).pop()||``;if(!t.includes(`_`)||!t.includes(`.`))throw new $(`Could not infer image id and format from url '${e}'.`);let n=t.indexOf(`_`),r=t.lastIndexOf(`.`);return[t.slice(0,n),t.slice(r+1)]}function Pa(e,t,n){if(n<=0)throw new $(`Complex tables must contain at least one column.`);let r;if(!e||!e.trim()){if(!t)throw new $(`Complex tables require a chapter size to derive default widths.`);let e=Xi[t];if(e==null)throw new $(`Unsupported chapter size '${t}' for default table widths.`);let i=e/n;r=Array.from({length:n},()=>i)}else{let t=e.split(`,`).map(e=>e.trim());if(t.length!==n)throw new $(`Table widths count ${t.length} does not match logical column count ${n}.`);r=t.map((e,t)=>{let n=Number.parseFloat(e);if(!Number.isFinite(n))throw new $(`Table width '${e}' for column ${t+1} is not numeric.`);return n})}for(let e=0;e<r.length;e+=1){let t=r[e];if(!Number.isFinite(t)||t<=0)throw new $(`Table column ${e+1} width ${t} must be a positive number.`)}return r}function Fa(e,t){let n=Number.parseInt(e,10);if(!Number.isInteger(n))throw new $(`Expected integer for ${t}.`);if(n<1)throw new $(`Expected positive integer for ${t}.`);return n}var Ia=class{graph=[];end;start;members;constructor(e){let t=this.node();this.end=this.node(),e?this.particle(e,t,this.end):this.connect(t,this.end),this.start=this.closure([t]),this.members=new Map(this.graph.flatMap(e=>e.flatMap(({element:e})=>e?[[e.name,e]]:[])))}node(){return this.graph.push([])-1}connect(e,t,n){this.graph[e].push({to:t,element:n})}particle(e,t,n){let r=t;for(let t=0;t<e.min;t++){let t=this.node();this.unit(e,r,t),r=t}if(e.max===null){this.connect(r,n);let t=this.node();this.unit(e,r,t),this.connect(t,r)}else{for(let t=e.min;t<e.max;t++){this.connect(r,n);let t=this.node();this.unit(e,r,t),r=t}this.connect(r,n)}}unit(e,t,n){if(e.kind===`element`)this.connect(t,n,e.element);else if(e.kind===`choice`)for(let r of e.children)this.particle(r,t,n);else if(e.kind===`all`){let r=[t,...Array.from({length:(1<<e.children.length)-1},()=>this.node())],i=e.children.reduce((e,t,n)=>e|(t.min>0?1<<n:0),0);for(let[t,a]of r.entries()){(t&i)===i&&this.connect(a,n);for(let[n,i]of e.children.entries())!(t&1<<n)&&i.kind===`element`&&this.connect(a,r[t|1<<n],i.element)}}else{let r=t;for(let t of e.children){let e=this.node();this.particle(t,r,e),r=e}this.connect(r,n)}}closure(e){let t=new Set(e);for(let e of t)for(let n of this.graph[e])n.element||t.add(n.to);return[...t]}advance(e,t){let n=[];for(let r of e)for(let e of this.graph[r])e.element?.name===t&&n.push(e.to);return this.closure(n)}candidates(e){let t=/* @__PURE__ */ new Map;for(let n of e)for(let e of this.graph[n])e.element&&t.set(e.element.name,e.element);return[...t.values()]}accepts(e){return e.includes(this.end)}};const La={source:`reference/skland-wiki-v1.xsd`,version:`1.0`,hash:`bbade900644352de2c11db2b44ba5534c4654f60e37cb1d333f40b6369c6d121`,documentation:`SKLAND Wiki XML, based on @eihrteam/xml 1.0.0. Use the converter to check chapter modes, table geometry, and other conversion rules.`,roots:[{name:`sklandDocument`,type:`#12`}],simpleTypes:{ColorValue:{base:`string`,values:[`s_1`,`s_2`,`s_3`,`s_4`,`r_1`,`r_2`,`r_3`,`r_4`,`r_5`,`r_6`,`f_orange`,`f_turquoise`,`f_green`,`f_sandstone`,`f_yellow`,`f_red`,`f_blue`,`f_brown`,`f_violet`,`f_blueness`]},EntryType:{base:`string`,values:[`card-big`,`link-img`,`link-txt`]},VideoKind:{base:`string`,values:[`skland`,`bilibili`]},TableHeader:{base:`token`,values:[``,`none`,`row`,`col`,`both`]},DialogSide:{base:`string`,values:[`me`,`other`]},NonEmptyString:{base:`string`,minLength:1},NonBlankText:{base:`token`,minLength:1}},complexTypes:{PlainText:{text:`xs:string`,mixed:!1,attributes:[],anyAttribute:!0},Break:{mixed:!1,attributes:[],anyAttribute:!0},TextWithBreaks:{content:{kind:`sequence`,min:1,max:1,children:[{kind:`element`,min:0,max:null,element:{name:`br`,type:`Break`}}]},mixed:!0,attributes:[],anyAttribute:!1},Emoji:{mixed:!1,attributes:[{name:`id`,type:`NonBlankText`,required:!0}],anyAttribute:!1},"#1":{content:{kind:`sequence`,min:1,max:1,children:[{kind:`element`,min:0,max:null,element:{name:`br`,type:`Break`}}]},mixed:!0,attributes:[],anyAttribute:!0},"#2":{content:{kind:`sequence`,min:1,max:1,children:[{kind:`element`,min:0,max:null,element:{name:`br`,type:`Break`}}]},mixed:!0,attributes:[{name:`href`,type:`xs:string`,required:!1}],anyAttribute:!0},"#3":{mixed:!1,attributes:[{name:`type`,type:`EntryType`,required:!0},{name:`id`,type:`xs:string`,required:!1},{name:`count`,type:`xs:string`,required:!1}],anyAttribute:!0},InlineContent:{content:{kind:`sequence`,min:0,max:null,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`ColorContent`}},{kind:`element`,min:1,max:1,element:{name:`annotation`,type:`Annotation`}}]}]},mixed:!0,attributes:[],anyAttribute:!0},CellInlineContent:{content:{kind:`sequence`,min:0,max:null,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`CellColorContent`}},{kind:`element`,min:1,max:1,element:{name:`annotation`,type:`CellAnnotation`}}]}]},mixed:!0,attributes:[],anyAttribute:!0},AnnotationInlineContent:{content:{kind:`sequence`,min:0,max:null,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`AnnotationColorContent`}}]}]},mixed:!0,attributes:[],anyAttribute:!0},ColorContent:{content:{kind:`sequence`,min:0,max:null,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`ColorContent`}},{kind:`element`,min:1,max:1,element:{name:`annotation`,type:`Annotation`}}]}]},mixed:!0,attributes:[{name:`value`,type:`ColorValue`,required:!0}],anyAttribute:!0},CellColorContent:{content:{kind:`sequence`,min:0,max:null,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`CellColorContent`}},{kind:`element`,min:1,max:1,element:{name:`annotation`,type:`CellAnnotation`}}]}]},mixed:!0,attributes:[{name:`value`,type:`ColorValue`,required:!0}],anyAttribute:!0},AnnotationColorContent:{content:{kind:`sequence`,min:0,max:null,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`AnnotationColorContent`}}]}]},mixed:!0,attributes:[{name:`value`,type:`ColorValue`,required:!0}],anyAttribute:!0},Annotation:{content:{kind:`all`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`title`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`content`,type:`AnnotationContent`}}]},mixed:!1,attributes:[],anyAttribute:!0},CellAnnotation:{content:{kind:`all`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`title`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`content`,type:`CellAnnotationContent`}}]},mixed:!1,attributes:[],anyAttribute:!0},"#4":{mixed:!1,attributes:[{name:`kind`,type:`xs:string`,required:!1}],anyAttribute:!0},"#5":{mixed:!1,attributes:[{name:`kind`,type:`VideoKind`,required:!0},{name:`id`,type:`NonEmptyString`,required:!0}],anyAttribute:!0},Align:{content:{kind:`sequence`,min:0,max:null,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`ColorContent`}},{kind:`element`,min:1,max:1,element:{name:`annotation`,type:`Annotation`}}]}]},mixed:!0,attributes:[{name:`value`,type:`xs:string`,required:!1}],anyAttribute:!0},CellAlign:{content:{kind:`sequence`,min:0,max:null,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`CellColorContent`}},{kind:`element`,min:1,max:1,element:{name:`annotation`,type:`CellAnnotation`}}]}]},mixed:!0,attributes:[{name:`value`,type:`xs:string`,required:!1}],anyAttribute:!0},AnnotationAlign:{content:{kind:`sequence`,min:0,max:null,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`AnnotationColorContent`}}]}]},mixed:!0,attributes:[{name:`value`,type:`xs:string`,required:!1}],anyAttribute:!0},BodyContent:{content:{kind:`sequence`,min:0,max:null,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`ColorContent`}},{kind:`element`,min:1,max:1,element:{name:`annotation`,type:`Annotation`}}]}]},{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`img`,type:`ImageBlock`}},{kind:`element`,min:1,max:1,element:{name:`line`,type:`#4`}},{kind:`element`,min:1,max:1,element:{name:`video`,type:`#5`}}]}]},{kind:`element`,min:1,max:1,element:{name:`h1`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h2`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h3`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`align`,type:`Align`}},{kind:`element`,min:1,max:1,element:{name:`quote`,type:`BodyContent`}},{kind:`element`,min:1,max:1,element:{name:`ul`,type:`List`}},{kind:`element`,min:1,max:1,element:{name:`ol`,type:`List`}}]}]},{kind:`element`,min:1,max:1,element:{name:`table`,type:`ComplexTable`}}]}]},mixed:!0,attributes:[],anyAttribute:!0},CellContent:{content:{kind:`choice`,min:0,max:null,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`CellColorContent`}},{kind:`element`,min:1,max:1,element:{name:`annotation`,type:`CellAnnotation`}}]}]},{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`img`,type:`ImageBlock`}},{kind:`element`,min:1,max:1,element:{name:`line`,type:`#4`}},{kind:`element`,min:1,max:1,element:{name:`video`,type:`#5`}}]}]},{kind:`element`,min:1,max:1,element:{name:`h1`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h2`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h3`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`align`,type:`CellAlign`}},{kind:`element`,min:1,max:1,element:{name:`quote`,type:`CellContent`}},{kind:`element`,min:1,max:1,element:{name:`ul`,type:`CellList`}},{kind:`element`,min:1,max:1,element:{name:`ol`,type:`CellList`}}]},mixed:!0,attributes:[],anyAttribute:!0},AnnotationContent:{content:{kind:`choice`,min:0,max:null,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`AnnotationColorContent`}}]}]},{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`img`,type:`ImageBlock`}},{kind:`element`,min:1,max:1,element:{name:`line`,type:`#4`}},{kind:`element`,min:1,max:1,element:{name:`video`,type:`#5`}}]}]},{kind:`element`,min:1,max:1,element:{name:`h1`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h2`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h3`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`align`,type:`AnnotationAlign`}}]}]},{kind:`element`,min:1,max:1,element:{name:`quote`,type:`AnnotationContent`}},{kind:`element`,min:1,max:1,element:{name:`ul`,type:`AnnotationList`}},{kind:`element`,min:1,max:1,element:{name:`ol`,type:`AnnotationList`}},{kind:`element`,min:1,max:1,element:{name:`table`,type:`AnnotationTable`}}]},mixed:!0,attributes:[],anyAttribute:!0},CellAnnotationContent:{content:{kind:`choice`,min:0,max:null,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`AnnotationColorContent`}}]}]},{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`img`,type:`ImageBlock`}},{kind:`element`,min:1,max:1,element:{name:`line`,type:`#4`}},{kind:`element`,min:1,max:1,element:{name:`video`,type:`#5`}}]}]},{kind:`element`,min:1,max:1,element:{name:`h1`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h2`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h3`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`align`,type:`AnnotationAlign`}}]}]},{kind:`element`,min:1,max:1,element:{name:`quote`,type:`CellAnnotationContent`}},{kind:`element`,min:1,max:1,element:{name:`ul`,type:`CellAnnotationList`}},{kind:`element`,min:1,max:1,element:{name:`ol`,type:`CellAnnotationList`}}]},mixed:!0,attributes:[],anyAttribute:!0},List:{content:{kind:`sequence`,min:0,max:null,children:[{kind:`element`,min:1,max:1,element:{name:`li`,type:`BodyContent`}},{kind:`choice`,min:0,max:null,children:[{kind:`element`,min:1,max:1,element:{name:`ul`,type:`List`}},{kind:`element`,min:1,max:1,element:{name:`ol`,type:`List`}}]}]},mixed:!1,attributes:[],anyAttribute:!0},CellList:{content:{kind:`sequence`,min:0,max:null,children:[{kind:`element`,min:1,max:1,element:{name:`li`,type:`CellContent`}},{kind:`choice`,min:0,max:null,children:[{kind:`element`,min:1,max:1,element:{name:`ul`,type:`CellList`}},{kind:`element`,min:1,max:1,element:{name:`ol`,type:`CellList`}}]}]},mixed:!1,attributes:[],anyAttribute:!0},AnnotationList:{content:{kind:`sequence`,min:0,max:null,children:[{kind:`element`,min:1,max:1,element:{name:`li`,type:`AnnotationContent`}},{kind:`choice`,min:0,max:null,children:[{kind:`element`,min:1,max:1,element:{name:`ul`,type:`AnnotationList`}},{kind:`element`,min:1,max:1,element:{name:`ol`,type:`AnnotationList`}}]}]},mixed:!1,attributes:[],anyAttribute:!0},CellAnnotationList:{content:{kind:`sequence`,min:0,max:null,children:[{kind:`element`,min:1,max:1,element:{name:`li`,type:`CellAnnotationContent`}},{kind:`choice`,min:0,max:null,children:[{kind:`element`,min:1,max:1,element:{name:`ul`,type:`CellAnnotationList`}},{kind:`element`,min:1,max:1,element:{name:`ol`,type:`CellAnnotationList`}}]}]},mixed:!1,attributes:[],anyAttribute:!0},ImageBlock:{content:{kind:`all`,min:1,max:1,children:[{kind:`element`,min:0,max:1,element:{name:`id`,type:`PlainText`}},{kind:`element`,min:0,max:1,element:{name:`format`,type:`PlainText`}},{kind:`element`,min:1,max:1,element:{name:`width`,type:`PlainText`}},{kind:`element`,min:1,max:1,element:{name:`height`,type:`PlainText`}},{kind:`element`,min:1,max:1,element:{name:`size`,type:`PlainText`}},{kind:`element`,min:1,max:1,element:{name:`url`,type:`PlainText`}},{kind:`element`,min:1,max:1,element:{name:`description`,type:`TextWithBreaks`}}]},mixed:!1,attributes:[],anyAttribute:!0},ComplexCell:{content:{kind:`choice`,min:0,max:null,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`CellColorContent`}},{kind:`element`,min:1,max:1,element:{name:`annotation`,type:`CellAnnotation`}}]}]},{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`img`,type:`ImageBlock`}},{kind:`element`,min:1,max:1,element:{name:`line`,type:`#4`}},{kind:`element`,min:1,max:1,element:{name:`video`,type:`#5`}}]}]},{kind:`element`,min:1,max:1,element:{name:`h1`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h2`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h3`,type:`CellInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`align`,type:`CellAlign`}},{kind:`element`,min:1,max:1,element:{name:`quote`,type:`CellContent`}},{kind:`element`,min:1,max:1,element:{name:`ul`,type:`CellList`}},{kind:`element`,min:1,max:1,element:{name:`ol`,type:`CellList`}}]},mixed:!0,attributes:[{name:`col`,type:`xs:string`,required:!1},{name:`rowspan`,type:`xs:string`,required:!1},{name:`colspan`,type:`xs:string`,required:!1}],anyAttribute:!0},AnnotationTableCell:{content:{kind:`choice`,min:0,max:null,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`AnnotationColorContent`}}]}]},{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`img`,type:`ImageBlock`}},{kind:`element`,min:1,max:1,element:{name:`line`,type:`#4`}},{kind:`element`,min:1,max:1,element:{name:`video`,type:`#5`}}]}]},{kind:`element`,min:1,max:1,element:{name:`h1`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h2`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h3`,type:`AnnotationInlineContent`}},{kind:`element`,min:1,max:1,element:{name:`align`,type:`AnnotationAlign`}}]}]},{kind:`element`,min:1,max:1,element:{name:`quote`,type:`CellAnnotationContent`}},{kind:`element`,min:1,max:1,element:{name:`ul`,type:`CellAnnotationList`}},{kind:`element`,min:1,max:1,element:{name:`ol`,type:`CellAnnotationList`}}]},mixed:!0,attributes:[{name:`col`,type:`xs:string`,required:!1},{name:`rowspan`,type:`xs:string`,required:!1},{name:`colspan`,type:`xs:string`,required:!1}],anyAttribute:!0},ComplexRow:{content:{kind:`choice`,min:0,max:null,children:[{kind:`element`,min:1,max:1,element:{name:`td`,type:`ComplexCell`}},{kind:`element`,min:1,max:1,element:{name:`th`,type:`ComplexCell`}}]},mixed:!1,attributes:[],anyAttribute:!0},AnnotationTableRow:{content:{kind:`choice`,min:0,max:null,children:[{kind:`element`,min:1,max:1,element:{name:`td`,type:`AnnotationTableCell`}},{kind:`element`,min:1,max:1,element:{name:`th`,type:`AnnotationTableCell`}}]},mixed:!1,attributes:[],anyAttribute:!0},ComplexTable:{content:{kind:`sequence`,min:1,max:1,children:[{kind:`element`,min:1,max:null,element:{name:`tr`,type:`ComplexRow`}}]},mixed:!1,attributes:[{name:`header`,type:`TableHeader`,required:!1},{name:`widths`,type:`xs:string`,required:!1}],anyAttribute:!0},AnnotationTable:{content:{kind:`sequence`,min:1,max:1,children:[{kind:`element`,min:1,max:null,element:{name:`tr`,type:`AnnotationTableRow`}}]},mixed:!1,attributes:[{name:`header`,type:`TableHeader`,required:!1},{name:`widths`,type:`xs:string`,required:!1}],anyAttribute:!0},"#6":{content:{kind:`sequence`,min:1,max:1,children:[{kind:`element`,min:0,max:null,element:{name:`br`,type:`Break`}}]},mixed:!0,attributes:[{name:`label`,type:`xs:string`,required:!1}],anyAttribute:!0},SimpleRow:{content:{kind:`sequence`,min:1,max:1,children:[{kind:`element`,min:2,max:2,element:{name:`cell`,type:`#6`}}]},mixed:!1,attributes:[],anyAttribute:!0},ChapterTable:{content:{kind:`choice`,min:0,max:1,children:[{kind:`element`,min:1,max:null,element:{name:`row`,type:`SimpleRow`}},{kind:`element`,min:1,max:null,element:{name:`tr`,type:`ComplexRow`}}]},mixed:!1,attributes:[{name:`header`,type:`TableHeader`,required:!1},{name:`widths`,type:`xs:string`,required:!1}],anyAttribute:!0},AudioItem:{content:{kind:`sequence`,min:1,max:1,children:[{kind:`element`,min:0,max:null,element:{name:`br`,type:`Break`}}]},mixed:!0,attributes:[{name:`name`,type:`xs:string`,required:!1},{name:`src`,type:`xs:string`,required:!1}],anyAttribute:!0},Audios:{content:{kind:`sequence`,min:1,max:1,children:[{kind:`element`,min:0,max:null,element:{name:`audio`,type:`AudioItem`}}]},mixed:!1,attributes:[],anyAttribute:!0},ImageIntro:{content:{kind:`all`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`name`,type:`PlainText`}},{kind:`element`,min:1,max:1,element:{name:`type`,type:`PlainText`}},{kind:`element`,min:1,max:1,element:{name:`imgUrl`,type:`PlainText`}},{kind:`element`,min:1,max:1,element:{name:`description`,type:`InlineContent`}}]},mixed:!1,attributes:[],anyAttribute:!0},Tab:{content:{kind:`choice`,min:0,max:null,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`ColorContent`}},{kind:`element`,min:1,max:1,element:{name:`annotation`,type:`Annotation`}}]}]},{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`img`,type:`ImageBlock`}},{kind:`element`,min:1,max:1,element:{name:`line`,type:`#4`}},{kind:`element`,min:1,max:1,element:{name:`video`,type:`#5`}}]}]},{kind:`element`,min:1,max:1,element:{name:`h1`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h2`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h3`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`align`,type:`Align`}},{kind:`element`,min:1,max:1,element:{name:`quote`,type:`BodyContent`}},{kind:`element`,min:1,max:1,element:{name:`ul`,type:`List`}},{kind:`element`,min:1,max:1,element:{name:`ol`,type:`List`}}]}]},{kind:`element`,min:1,max:1,element:{name:`table`,type:`ComplexTable`}}]}]},{kind:`element`,min:1,max:1,element:{name:`imgIntro`,type:`ImageIntro`}},{kind:`element`,min:1,max:1,element:{name:`audios`,type:`Audios`}}]},mixed:!0,attributes:[{name:`name`,type:`xs:string`,required:!1},{name:`icon`,type:`xs:string`,required:!1}],anyAttribute:!0},DialogText:{content:{kind:`choice`,min:0,max:null,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}}]},mixed:!0,attributes:[],anyAttribute:!1},"#7":{mixed:!1,attributes:[{name:`src`,type:`NonBlankText`,required:!0}],anyAttribute:!1},DialogMessage:{content:{kind:`choice`,min:0,max:null,children:[{kind:`element`,min:1,max:1,element:{name:`text`,type:`DialogText`}},{kind:`element`,min:1,max:1,element:{name:`image`,type:`#7`}}]},mixed:!1,attributes:[{name:`side`,type:`DialogSide`,required:!0},{name:`avatar`,type:`NonBlankText`,required:!0},{name:`name`,type:`xs:string`,required:!1}],anyAttribute:!1},"#8":{content:{kind:`sequence`,min:1,max:1,children:[{kind:`element`,min:2,max:null,element:{name:`message`,type:`DialogMessage`}}]},mixed:!1,attributes:[{name:`name`,type:`xs:string`,required:!0}],anyAttribute:!1},DialogBranches:{content:{kind:`sequence`,min:1,max:1,children:[{kind:`element`,min:1,max:null,element:{name:`branch`,type:`#8`}}]},mixed:!1,attributes:[],anyAttribute:!1},DialogDivider:{text:`xs:string`,mixed:!1,attributes:[{name:`kind`,type:`NonBlankText`,required:!0}],anyAttribute:!1},Chapter:{content:{kind:`choice`,min:0,max:null,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`ColorContent`}},{kind:`element`,min:1,max:1,element:{name:`annotation`,type:`Annotation`}}]}]},{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`img`,type:`ImageBlock`}},{kind:`element`,min:1,max:1,element:{name:`line`,type:`#4`}},{kind:`element`,min:1,max:1,element:{name:`video`,type:`#5`}}]}]},{kind:`element`,min:1,max:1,element:{name:`h1`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h2`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h3`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`align`,type:`Align`}},{kind:`element`,min:1,max:1,element:{name:`quote`,type:`BodyContent`}},{kind:`element`,min:1,max:1,element:{name:`ul`,type:`List`}},{kind:`element`,min:1,max:1,element:{name:`ol`,type:`List`}}]}]},{kind:`element`,min:1,max:1,element:{name:`table`,type:`ChapterTable`}},{kind:`element`,min:1,max:1,element:{name:`tab`,type:`Tab`}},{kind:`element`,min:1,max:1,element:{name:`audios`,type:`Audios`}},{kind:`element`,min:1,max:1,element:{name:`message`,type:`DialogMessage`}},{kind:`element`,min:1,max:1,element:{name:`branches`,type:`DialogBranches`}},{kind:`element`,min:1,max:1,element:{name:`divider`,type:`DialogDivider`}}]},mixed:!0,attributes:[{name:`name`,type:`xs:string`,required:!0},{name:`size`,type:`xs:string`,required:!1},{name:`table`,type:`xs:string`,required:!1},{name:`audio`,type:`xs:string`,required:!1},{name:`dialog`,type:`xs:string`,required:!1}],anyAttribute:!0},ChapterGroup:{content:{kind:`sequence`,min:1,max:1,children:[{kind:`element`,min:0,max:null,element:{name:`chapter`,type:`Chapter`}}]},mixed:!1,attributes:[{name:`name`,type:`xs:string`,required:!0}],anyAttribute:!0},"#9":{text:`xs:string`,mixed:!1,attributes:[{name:`showInDetail`,type:`xs:string`,required:!1}],anyAttribute:!0},"#11":{text:`xs:string`,mixed:!1,attributes:[{name:`id`,type:`xs:string`,required:!0}],anyAttribute:!0},"#10":{content:{kind:`sequence`,min:1,max:1,children:[{kind:`element`,min:0,max:null,element:{name:`subType`,type:`#11`}}]},mixed:!1,attributes:[],anyAttribute:!0},MetaInfo:{content:{kind:`all`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`name`,type:`PlainText`}},{kind:`element`,min:1,max:1,element:{name:`cover`,type:`#9`}},{kind:`element`,min:1,max:1,element:{name:`subTypes`,type:`#10`}}]},mixed:!1,attributes:[],anyAttribute:!0},"#13":{content:{kind:`sequence`,min:0,max:null,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`br`,type:`Break`}},{kind:`element`,min:1,max:1,element:{name:`emoji`,type:`Emoji`}},{kind:`element`,min:1,max:1,element:{name:`pron`,type:`#1`}},{kind:`element`,min:1,max:1,element:{name:`a`,type:`#2`}},{kind:`element`,min:1,max:1,element:{name:`entry`,type:`#3`}}]}]},{kind:`element`,min:1,max:1,element:{name:`b`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`i`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`u`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`s`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`color`,type:`ColorContent`}},{kind:`element`,min:1,max:1,element:{name:`annotation`,type:`Annotation`}}]}]},{kind:`sequence`,min:1,max:1,children:[{kind:`choice`,min:1,max:1,children:[{kind:`element`,min:1,max:1,element:{name:`img`,type:`ImageBlock`}},{kind:`element`,min:1,max:1,element:{name:`line`,type:`#4`}},{kind:`element`,min:1,max:1,element:{name:`video`,type:`#5`}}]}]},{kind:`element`,min:1,max:1,element:{name:`h1`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h2`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`h3`,type:`InlineContent`}},{kind:`element`,min:1,max:1,element:{name:`align`,type:`Align`}},{kind:`element`,min:1,max:1,element:{name:`quote`,type:`BodyContent`}},{kind:`element`,min:1,max:1,element:{name:`ul`,type:`List`}},{kind:`element`,min:1,max:1,element:{name:`ol`,type:`List`}}]}]},{kind:`element`,min:1,max:1,element:{name:`table`,type:`ComplexTable`}}]}]},mixed:!0,attributes:[{name:`source`,type:`xs:string`,required:!1}],anyAttribute:!0},"#12":{content:{kind:`choice`,min:0,max:null,children:[{kind:`element`,min:1,max:1,element:{name:`itemId`,type:`PlainText`}},{kind:`element`,min:1,max:1,element:{name:`commitMsg`,type:`PlainText`}},{kind:`element`,min:1,max:1,element:{name:`publicMeta`,type:`PlainText`}},{kind:`element`,min:1,max:1,element:{name:`metainfo`,type:`MetaInfo`}},{kind:`element`,min:1,max:1,element:{name:`description`,type:`#13`}},{kind:`element`,min:1,max:1,element:{name:`chapters`,type:`ChapterGroup`}}]},mixed:!1,attributes:[],anyAttribute:!0}}},Ra=/* @__PURE__ */ new Map,za=new Ia,Ba=new Map(La.roots.map(e=>[e.name,e]));function Va(e){return Object.hasOwn(La.complexTypes,e)?La.complexTypes[e]:void 0}function Ha(e){return Object.hasOwn(La.simpleTypes,e)?La.simpleTypes[e]:{base:e===`xs:token`?`token`:`string`}}function Ua(e){let t=Va(e)?.content;if(!t)return za;let n=Ra.get(e);return n||(n=new Ia(t),Ra.set(e,n)),n}function Wa(e){if(e.namespace||!e.name.name)return;if(!e.parent)return Ba.get(e.name.name);let t=Wa(e.parent);return t?Ua(t.type).members.get(e.name.name):void 0}function Ga(e,t){return t.base===`token`?e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``):e}function Ka(e,t){return(t.values===void 0||t.values.includes(e))&&(t.minLength===void 0||Array.from(e).length>=t.minLength)}function qa(e){return e.fixed===void 0?Ha(e.type).values??[]:[e.fixed]}function Ja(e,t,n){let r=(e,t,r)=>{n.length<100&&n.push({source:`schema`,code:e,span:t,message:r})};function i(e,a){if(n.length>=100)return;let o=Va(a.type),s=new Map(o?.attributes.map(e=>[e.name,e])),c=/* @__PURE__ */ new Set;for(let t of e.attributes){let n=t.name.name;c.add(n);let i=s.get(n);if(!i)o?.anyAttribute||n===`xmlns`||n.startsWith(`xmlns:`)||n===`xsi:schemaLocation`||n===`xsi:noNamespaceSchemaLocation`||n===`xml:space`&&e.namespace!==`http://www.w3.org/XML/1998/namespace`||r(`unknown-attribute`,t.name,`Attribute “${n}” is unsupported on <${e.name.name}>.`);else if(t.closed&&t.decoded!==void 0){let e=Ha(i.type),a=Ga(t.decoded,e);if(!Ka(a,e)||i.fixed!==void 0&&a!==Ga(i.fixed,e)){let e=qa(i);r(`invalid-attribute-value`,t.value??t.name,e.length?`Expected one of: ${e.map(e=>JSON.stringify(e)).join(`, `)}.`:`Attribute “${n}” must contain text.`)}}}if(e.complete)for(let t of s.values())t.required&&!c.has(t.name)&&r(`required-attribute`,e.name,`Missing required attribute “${t.name}”.`);let l=Ua(a.type),u=l.start,d=!1;for(let t of e.children){if(n.length>=100)break;let a=t.name.name;if(!a||!t.complete){d=!0;continue}let o=!t.namespace&&l.members.get(a);if(!o){r(`unexpected-element`,t.name,`<${a}> is unsupported inside <${e.name.name}>.`),d=!0;continue}let s=l.advance(u,a);s.length?u=s:(d||r(`child-order-or-occurrence`,t.name,`<${a}> cannot occur here inside <${e.name.name}>.`),d=!0),i(t,o)}if(!d&&(e.selfClosing||e.close?.complete)&&!l.accepts(u)){let t=l.candidates(u).map(e=>`<${e.name}>`).join(`, `);r(`missing-child`,e.close?.name??e.name,`Incomplete content for <${e.name.name}>. Expected ${t}.`)}let f=e.content.flatMap(e=>{let n=t.slice(e.span.from,e.span.to);switch(e.kind){case`Text`:return[{span:e.span,value:n}];case`Cdata`:return[{span:e.span,value:n.slice(9,-3)}];case`EntityReference`:case`CharacterReference`:return[{span:e.span,value:oi(n)}];default:return[]}});if(o&&!o.mixed&&!o.text){let t=f.find(e=>ri(e.value));t&&r(`unexpected-text`,t.span,`Text is unsupported inside <${e.name.name}>.`)}else if((!o||o.text)&&(e.selfClosing||e.close?.complete)){let t=Ha(o?.text??a.type);(t.values||t.minLength)&&(Ka(Ga(f.map(e=>e.value).join(``),t),t)||r(`invalid-element-value`,e.name,`Invalid value for <${e.name.name}> (${o?.text??a.type}).`))}}for(let t of e.roots){let e=t.name.name,n=!t.namespace&&Ba.get(e);n?i(t,n):t.complete&&e&&r(`unexpected-root`,t.name,`Expected the unqualified root <${La.roots[0]?.name}>.`)}}function Ya(e){let t=0;for(let n of e){if(![`td`,`th`].includes(n.name.name))continue;let e=e=>{let t=n.attributes.find(t=>t.name.name===e)?.decoded;return t?Number.parseInt(t,10):1},r=e(`rowspan`),i=e(`colspan`),a=e(`col`);if(r>1e4||i>1e4||a>1e4||(t+=(r>0?r:1)*(i>0?i:1),t>25e4))return n.name}}function Xa(e){try{return new bi.DOMParser({onError(){throw Error(`Malformed XML`)}}).parseFromString(e,`application/xml`),!0}catch{return!1}}function Za(e,t,n){let r=[...t.issues],i=t.roots[0]?.name??{from:0,to:0};if(t.limited||r.some(e=>e.code===`doctype-disabled`)||(r.length===0&&!Xa(e)&&r.push({source:`syntax`,code:`strict-xml`,span:i,message:`The document fails strict XML parsing.`}),Ja(t,e,r),r.length||!t.roots.length))return r;let a=Ya(n());if(a)return[{source:`semantic`,code:`table-resource-limit`,span:a,severity:kt.Warning,message:`Skipped conversion validation because the expanded table exceeds the analysis budget.`}];try{let[,t]=da(e);for(let e of t.slice(0,100))r.push({source:`semantic`,code:`converter-warning`,message:e,span:i,severity:kt.Warning})}catch(e){if(!(e instanceof $))throw e;r.push({source:`semantic`,code:`conversion-error`,message:e.message,span:i})}return r}var Qa=class{document;fragments=[];syntaxTree;projection;cachedElements;cachedIssues;constructor({uri:e,version:t,text:n}){this.document=ut.create(e,`skland-xml`,t,n)}get version(){return this.document.version}get text(){return this.document.getText()}get uri(){return this.document.uri}update(e,t){if(e<=this.version)return!1;this.syntaxTree&&(this.fragments=ot.addTree(this.syntaxTree,this.fragments));for(let n of t)if(n.range){let t=this.offset(n.range.start),r=Math.max(t,this.offset(n.range.end));this.fragments=ot.applyChanges(this.fragments,[{fromA:t,toA:r,fromB:t,toB:t+n.text.length}]),ut.update(this.document,[{range:n.range,text:n.text}],e)}else this.fragments=[],ut.update(this.document,[{text:n.text}],e);return t.length||ut.update(this.document,[],e),this.syntaxTree=void 0,this.projection=void 0,this.cachedElements=void 0,this.cachedIssues=void 0,!0}get analysis(){return this.projection||=(this.syntaxTree=si(this.text,this.fragments),this.fragments=[],di(this.text,this.syntaxTree)),this.projection}get elements(){return this.cachedElements??=fi(this.analysis.roots)}get issues(){return this.cachedIssues??=Za(this.text,this.analysis,()=>this.elements)}offset(e){return this.document.offsetAt(e)}position(e){return this.document.positionAt(e)}range(e){return Y.create(this.position(e.from),this.position(e.to))}elementAt(e,t=!1){let n,r=this.analysis.roots;for(;r.length;){let i=0,a=r.length-1;for(;i<=a;){let t=i+a>>>1;r[t].span.from<=e?i=t+1:a=t-1}let o=r[a];if(!o||(t?o.span.to<e:o.span.to<=e))break;n=o,r=o.children}return n}opaqueAt(e){if(this.analysis.limited)return!0;for(let t=this.syntaxTree?.resolveInner(e,-1);t;t=t.parent??void 0)if([`Comment`,`Cdata`,`ProcessingInst`,`DoctypeDecl`].includes(t.name)){let n=t.name===`Comment`?`-->`:t.name===`Cdata`?`]]>`:t.name===`ProcessingInst`?`?>`:`>`;return t.to>e||this.text.slice(t.to-n.length,t.to)!==n}return!1}};function $a(e,t){return{range:e.range(t.span),message:t.message,code:t.code,source:`skland-xml/`+t.source,severity:t.severity??kt.Error,...t.related&&{relatedInformation:[{location:{uri:e.uri,range:e.range(t.related.span)},message:t.related.message}]}}}function eo(e,t){return e.from<=t.to&&t.from<=e.to}function to(e,t){return{from:e.offset(t.start),to:e.offset(t.end)}}function no(e,t,n){if(e.issues.some(e=>e.source!==`semantic`))return[];let{text:r}=e,i=/\r\n|[\r\n]/.exec(r)?.[0]??`
|
|
37
|
+
`,a=Math.min(16,Math.max(1,t.tabSize||1)),o=t.insertSpaces?` `.repeat(a):` `,s=[],c=n&&to(e,n);function l(t,n,a){if(c&&(t<c.from||n>c.to||t===n&&(t===c.from||n===c.to)))return;let l=r.slice(t,n);if(ri(l))return;let u=i+o.repeat(a);if(l===u)return;let d=0,f=0;for(;d<l.length&&l[d]===u[d];)d++;for(;f<Math.min(l.length,u.length)-d&&l[l.length-f-1]===u[u.length-f-1];)f++;d>0&&l.slice(d-1,d+1)===`\r
|
|
38
|
+
`&&d--,f>0&&l.slice(l.length-f-1,l.length-f+1)===`\r
|
|
39
|
+
`&&f--,s.push(Pt.replace(e.range({from:t+d,to:n-f}),u.slice(d,u.length-f)))}function u(e,t){let n=Wa(e),r=n&&Va(n.type);if(!r||r.mixed||r.text||e.preserveSpace||!e.close?.complete)return;let i=[...e.children.map(e=>e.span),...e.content.filter(e=>e.kind!==`Text`).map(e=>e.span)].sort((e,t)=>e.from-t.from);if(i.length){let n=e.open.to;for(let e of i)l(n,e.from,t+1),n=e.to;l(n,e.close.span.from,t)}for(let n of e.children)u(n,t+1)}for(let t of e.analysis.roots)u(t,0);return s.sort((t,n)=>e.offset(t.range.start)-e.offset(n.range.start))}function ro(e){function t(n){if(!n.name.name)return[];let r=n.attributes.find(e=>e.name.name===`name`)?.decoded,{name:i}=n.name;return[{name:r?`${i} · ${r}`:i,kind:un.Object,range:e.range(n.span),selectionRange:e.range(n.name),children:n.children.flatMap(t)}]}return e.analysis.roots.flatMap(t)}function io(e,t){let n=[];function r(r,i){let a=e.position(r.from),o=e.position(r.to),s=t&&!i?o.line-1:o.line;s<=a.line||n.push({startLine:a.line,endLine:s,...!t&&{startCharacter:a.character,endCharacter:o.character},...i&&{kind:i}})}for(let t of e.elements){t.close?.complete&&r({from:t.open.to,to:t.close.span.from});for(let e of t.content)e.kind===`Comment`&&r(e.span,`comment`)}return n.sort((e,t)=>e.startLine-t.startLine||t.endLine-e.endLine)}function ao(e,t){let n=e.offset(t),r=e.elementAt(n,!0),i=r?.close;return!r?.name.name||!i?.complete?null:eo(r.name,{from:n,to:n})||eo(i.name,{from:n,to:n})?{ranges:[e.range(r.name),e.range(i.name)]}:null}function oo(e){if(/^https?:\/\//i.test(e)&&!/[\u0000-\u0020]/.test(e))try{let t=new URL(e);if(!t.username&&!t.password)return t.href}catch{return}}function so(e){let t=[];for(let n of e.elements){if(!Wa(n))continue;for(let r of n.attributes){if(![`href`,`src`].includes(r.name.name)||!r.closed||!r.value)continue;let n=oo(r.decoded??``);n&&t.push({target:n,range:e.range(r.value)})}if(![`url`,`imgUrl`,`cover`].includes(n.name.name)||!n.close?.complete)continue;let r={from:n.open.to,to:n.close.span.from},i=e.text.slice(r.from,r.to),a=i.trim(),o=oo(oi(a));if(o&&!/[<>]/.test(a)){let n=r.from+i.indexOf(a);t.push({target:o,range:e.range({from:n,to:n+a.length})})}}return t}function co(e,t,n){let r=to(e,t),i=[];for(let t of e.issues){if(!t.fix||!eo(r,t.span))continue;let a=$a(e,t);if(!n.find(n=>n.source===a.source&&n.code===a.code&&to(e,n.range).from===t.span.from&&to(e,n.range).to===t.span.to))continue;let o={title:t.fix.title,kind:hn.QuickFix,diagnostics:[a],edit:{documentChanges:[{textDocument:{uri:e.uri,version:e.version},edits:[Pt.replace(e.range(t.fix.span),t.fix.text)]}]}};i.push(o)}return i}function lo(e,t){return e.from<=t&&t<=e.to}function uo(e,t,n){if(!e)return La.roots;let r=Wa(e);if(!r)return[];let i=Ua(r.type),a=i.start,o=[];for(let r of e.children)if(r!==t&&r.name.name&&!r.namespace){if(r.span.from>=n){if(o.push(r.name.name),o.length>128)break}else if(r.span.to<=n){let e=i.advance(a,r.name.name);e.length&&(a=e)}}let s=i.candidates(a);if(o.length&&o.length<=128){let e=s.filter(e=>{let t=i.advance(a,e.name);for(let e of o)if(t=i.advance(t,e),!t.length)return!1;return!0});if(e.length)return e;let t=a;for(let e of o)t=i.advance(t,e);if(t.length&&i.accepts(t))return[]}return s}function fo(e,t,n,r,i,a,o){return{label:n,kind:i,textEdit:Pt.replace(e.range(t),r),...a&&{documentation:a},...o&&{insertTextFormat:Xt.Snippet}}}function po(e){return e.fixed??e.default??``}function mo(e,t){return e.replaceAll(`&`,`&`).replaceAll(`<`,`<`).replaceAll(t,t===`"`?`"`:`'`)}const ho=e=>e.replace(/[\\$}]/g,`\\$&`);function go(e,t,n){let r=e.offset(t),{text:i}=e,a=[],o={isIncomplete:!1,items:a};if(e.analysis.limited||e.opaqueAt(r))return o;let s=e.elementAt(r,!0),c=/<\/([\w.:-]*)$/.exec(i.slice(Math.max(0,r-256),r)),l=s?.close;if(c&&!(s&&r<s.open.to)&&!s?.selfClosing){let t=r-c[1].length,n=t;for(;n<i.length&&/[\w.:-]/.test(i[n]);)n++;let u=i.slice(n,n+256),d=/* @__PURE__ */ new Set;for(let r=s;r;r=r.parent){let i=r.name.name;if(!(!i||d.has(i)||r.close&&r.close.span.from<t-2)&&(d.add(i),a.push(fo(e,{from:t,to:n},i,i+(/^[\t\r\n ]*>/.test(u)?``:`>`),Yt.Property)),l?.span.from===t-2&&l.complete))break}return o}let u=s&&lo(s.open,r)&&(!s.complete||r<s.open.to);if(u&&s&&(lo(s.name,r)||!s.name.name)){let t=s.attributes.length>0;for(let r of uo(s.parent,s,s.span.from)){let i=Va(r.type)?.attributes.filter(e=>e.required)??[],o=n.snippets&&!s.complete&&!t&&i.length>0,c=o?r.name+i.map((e,t)=>` `+e.name+'="${'+(t+1)+`:`+ho(mo(po(e),`"`))+`}"`).join(``):r.name;a.push(fo(e,s.name,r.name,c,Yt.Property,r.documentation,o))}return o}if(u&&s){let t=Wa(s),i=t&&Va(t.type);if(!i)return o;let c=s.attributes.find(e=>lo(e.span,r));if(c?.equals!==void 0&&r>=c.equals){if(c.closed&&c.value&&r>c.value.to)return o;let t=i.attributes.find(e=>e.name===c.name.name);if(!t)return o;let n=c.value??{from:r,to:r};for(let r of qa(t)){let i=mo(r,c.quote??`"`),o=c.quote?i+(c.closed?``:c.quote):`"`+i+`"`;a.push(fo(e,n,r||`""`,o,Yt.Value,t.documentation))}return o}let l=c&&lo(c.name,r)?c.name:{from:r,to:r};if(c&&l!==c.name)return o;for(let t of i.attributes){if(s.attributes.some(e=>e!==c&&e.name.name===t.name))continue;let r=mo(po(t),`"`),i=!!n.snippets&&c?.equals===void 0,o=c?.equals===void 0?i?t.name+'="${1:'+ho(r)+`}"`:t.name+`="`+r+`"`:t.name;a.push(fo(e,l,t.name,o,Yt.Field,t.documentation,i))}return o}if(s?.close&&lo(s.close.span,r))return o;let d=s?.span.to===r&&(s.selfClosing||s.close?.complete)?s.parent:s;if(!d&&e.analysis.roots.some(e=>e.complete))return o;for(let t of uo(d,void 0,r))a.push(fo(e,{from:r,to:r},t.name,`<`+t.name,Yt.Property,t.documentation));return o}function _o(e,t,n){let r=e.offset(t),i=e.elementAt(r,!0);if(!i)return null;let a=Wa(i);if(!a)return null;let o=Va(a.type),s=i.attributes.find(e=>lo(e.name,r)||e.value&&lo(e.value,r)),c=n.markdown!==!1,l=e=>c?"`"+e+"`":e,u=e=>l(e.startsWith(`#`)?`anonymous type`:e);if(s){let t=o?.attributes.find(e=>e.name===s.name.name);if(!t)return null;let n=Ha(t.type),i=[l(t.name)+` · `+u(t.type)+(t.required?` · Required`:``),t.documentation??n.documentation,n.values&&`Allowed values: `+n.values.map(e=>l(JSON.stringify(e))).join(`, `),t.default!==void 0&&`Default: `+l(JSON.stringify(t.default)),t.fixed!==void 0&&`Fixed: `+l(JSON.stringify(t.fixed)),n.minLength!==void 0&&`Minimum length: `+n.minLength];return{range:e.range(s.value&&lo(s.value,r)?s.value:s.name),contents:{kind:c?qt.Markdown:qt.PlainText,value:i.filter(Boolean).join(`
|
|
40
|
+
|
|
41
|
+
`)}}}let d=i.close&&lo(i.close.name,r)?i.close.name:i.name;if(!lo(d,r))return null;let f=[...Ua(a.type).members.keys()],p=o?.attributes.filter(e=>e.required).map(e=>e.name)??[],m=[l(`<`+a.name+`>`)+` · `+u(a.type),a.documentation??o?.documentation??(i.parent?void 0:La.documentation),p.length&&`Required attributes: `+p.map(l).join(`, `),f.length&&`Children: `+f.map(e=>l(`<`+e+`>`)).join(`, `),o?.mixed&&`Supports mixed text and child elements.`,`SKLand Wiki XML schema `+La.version];return{range:e.range(d),contents:{kind:c?qt.Markdown:qt.PlainText,value:m.filter(Boolean).join(`
|
|
42
|
+
|
|
43
|
+
`)}}}Object.freeze({version:La.version,hash:La.hash,source:La.source});function vo(){let e=/* @__PURE__ */ new Map;return{openDocument(t){return!e.has(t.uri)&&(e.set(t.uri,new Qa(t)),!0)},updateDocument:(t,n,r)=>e.get(t)?.update(n,r)??!1,closeDocument:t=>e.delete(t),getVersion:t=>e.get(t)?.version,diagnostics(t){let n=e.get(t);return n?n.issues.map(e=>$a(n,e)):[]},completion(t,n,r={}){let i=e.get(t);return i?go(i,n,r):{isIncomplete:!1,items:[]}},hover(t,n,r={}){let i=e.get(t);return i?_o(i,n,r):null},formatting(t,n,r){let i=e.get(t);return i?no(i,n,r):[]},documentSymbols(t){let n=e.get(t);return n?ro(n):[]},foldingRanges(t,n=!1){let r=e.get(t);return r?io(r,n):[]},linkedEditing(t,n){let r=e.get(t);return r?ao(r,n):null},documentLinks(t){let n=e.get(t);return n?so(n):[]},codeActions(t,n,r){let i=e.get(t);return i?co(i,n,r):[]},dispose:()=>e.clear()}}var yo=y();function bo(e,t,n){return e.flatMap(e=>[{name:e.name,kind:e.kind,location:{uri:t,range:e.range},...n&&{containerName:n}},...bo(e.children??[],t,e.name)])}function xo(e,t={}){let n=vo(),r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Map,a=`created`,o=()=>a===`stopped`,s={snippets:!1,hoverMarkdown:!1,relatedDiagnostics:!1,diagnosticVersions:!1,hierarchicalSymbols:!1,lineOnlyFolding:!1,codeActions:!1,versionedEdits:!1},c=()=>{a=`stopped`;for(let e of r.values())clearTimeout(e);r.clear(),n.dispose(),i.clear()};function l(e){let t=r.get(e);t!==void 0&&clearTimeout(t),r.delete(e)}function u(t,n,r){e.sendDiagnostics({uri:t,diagnostics:s.relatedDiagnostics?r:r.map(e=>{let t={...e};return delete t.relatedInformation,t}),...s.diagnosticVersions&&n!==void 0&&{version:n}}).catch(()=>void 0)}function d(i,o){l(i),r.set(i,setTimeout(()=>{if(r.delete(i),a===`running`&&n.getVersion(i)===o)try{u(i,o,n.diagnostics(i))}catch{e.console.error(`SKLand XML diagnostics failed unexpectedly.`)}},t.diagnosticDelayMs??200))}async function f(e,t,r){if(a===`created`||a===`initializing`)throw new yo.ResponseError(-32002,`Server not initialized`);if(a===`stopped`)throw new yo.ResponseError(yo.ErrorCodes.InvalidRequest,`Server has shut down`);let s=n.getVersion(e),c=i.get(e);if(await new Promise(e=>setTimeout(e,0)),t.isCancellationRequested)throw new yo.ResponseError(-32800,`Request cancelled`);if(o())throw new yo.ResponseError(yo.ErrorCodes.InvalidRequest,`Server has shut down`);if(s!==n.getVersion(e)||c!==i.get(e))throw new yo.ResponseError(-32801,`Document changed`);try{return r()}catch{throw new yo.ResponseError(yo.ErrorCodes.InternalError,`SKLand XML analysis failed`)}}return e.onInitialize(({capabilities:e})=>{if(a!==`created`)throw new yo.ResponseError(yo.ErrorCodes.InvalidRequest,`Already initialized`);a=`initializing`;let t=e.textDocument;return s={snippets:!!t?.completion?.completionItem?.snippetSupport,hoverMarkdown:t?.hover?.contentFormat?.[0]===`markdown`,relatedDiagnostics:!!t?.publishDiagnostics?.relatedInformation,diagnosticVersions:!!t?.publishDiagnostics?.versionSupport,hierarchicalSymbols:!!t?.documentSymbol?.hierarchicalDocumentSymbolSupport,lineOnlyFolding:!!t?.foldingRange?.lineFoldingOnly,codeActions:!!t?.codeAction?.codeActionLiteralSupport,versionedEdits:!!e.workspace?.workspaceEdit?.documentChanges},{serverInfo:{name:`SKLand XML Language Server`,version:`0.1.0`},capabilities:{positionEncoding:`utf-16`,textDocumentSync:{openClose:!0,change:2},completionProvider:{triggerCharacters:[`<`,`/`,` `,`=`,`"`,`'`]},hoverProvider:!0,documentSymbolProvider:!0,documentFormattingProvider:!0,documentRangeFormattingProvider:!0,foldingRangeProvider:!0,linkedEditingRangeProvider:!0,documentLinkProvider:{resolveProvider:!1},...s.codeActions&&{codeActionProvider:{codeActionKinds:[`quickfix`]}}}}}),e.onInitialized(()=>{a===`initializing`&&(a=`running`)}),e.onDidOpenTextDocument(({textDocument:e})=>{if(a!==`running`)return;let{uri:t,version:r}=e;n.openDocument(e)&&(i.set(t,{}),d(t,r))}),e.onDidChangeTextDocument(({textDocument:{uri:e,version:t},contentChanges:r})=>{a===`running`&&n.updateDocument(e,t,r)&&d(e,t)}),e.onDidCloseTextDocument(({textDocument:{uri:e}})=>{if(a!==`running`)return;let t=n.closeDocument(e);i.delete(e),l(e),t&&u(e,void 0,[])}),e.onCompletion(({textDocument:{uri:e},position:t},r)=>f(e,r,()=>n.completion(e,t,{snippets:s.snippets}))),e.onHover(({textDocument:{uri:e},position:t},r)=>f(e,r,()=>n.hover(e,t,{markdown:s.hoverMarkdown}))),e.onDocumentFormatting(({textDocument:{uri:e},options:t},r)=>f(e,r,()=>n.formatting(e,t))),e.onDocumentRangeFormatting(({textDocument:{uri:e},range:t,options:r},i)=>f(e,i,()=>n.formatting(e,r,t))),e.onDocumentSymbol(({textDocument:{uri:e}},t)=>f(e,t,()=>{let t=n.documentSymbols(e);return s.hierarchicalSymbols?t:bo(t,e)})),e.onFoldingRanges(({textDocument:{uri:e}},t)=>f(e,t,()=>n.foldingRanges(e,s.lineOnlyFolding))),e.onDocumentLinks(({textDocument:{uri:e}},t)=>f(e,t,()=>n.documentLinks(e))),e.onRequest(`textDocument/linkedEditingRange`,({textDocument:{uri:e},position:t},r)=>f(e,r,()=>n.linkedEditing(e,t))),e.onCodeAction(({textDocument:{uri:e},range:t,context:r},i)=>f(e,i,()=>{if(!s.codeActions||r.only&&!r.only.includes(`quickfix`))return[];let i=n.codeActions(e,t,r.diagnostics);return s.versionedEdits?i:i.map(t=>{let n=t.edit?.documentChanges?.[0];return n&&`edits`in n?{...t,edit:{changes:{[e]:n.edits}}}:t})})),e.onShutdown(c),e.onExit(()=>{c(),t.onExit?.()}),{dispose:c}}function So(e){let t=(0,je.createConnection)(process.stdin,process.stdout);xo(t,e),t.listen()}export{So as startNodeServer};
|