@nowline/embed 0.0.0-dev.20261020002921.g70f418b → 0.0.0-dev.20261020011950.gce8a91f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/meta.json +21 -11
- package/dist/nowline.esm.js +52 -27
- package/dist/nowline.esm.js.map +2 -2
- package/dist/nowline.min.js +54 -54
- package/dist/nowline.min.js.map +3 -3
- package/package.json +6 -6
package/dist/nowline.min.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
/*! @nowline/embed 0.0.0-dev.
|
|
2
|
-
"use strict";var nowline=(()=>{var jN=Object.create;var Fs=Object.defineProperty;var YN=Object.getOwnPropertyDescriptor;var VN=Object.getOwnPropertyNames;var KN=Object.getPrototypeOf,qN=Object.prototype.hasOwnProperty;var ZN=(e,t,n)=>t in e?Fs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var JN=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(r){throw n=[r],r}};var Bs=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},Bp=(e,t)=>{for(var n in t)Fs(e,n,{get:t[n],enumerable:!0})},uE=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of VN(t))!qN.call(e,i)&&i!==n&&Fs(e,i,{get:()=>t[i],enumerable:!(r=YN(t,i))||r.enumerable});return e};var Wp=(e,t,n)=>(n=e!=null?jN(KN(e)):{},uE(t||!e||!e.__esModule?Fs(n,"default",{value:e,enumerable:!0}):n,e)),QN=e=>uE(Fs({},"__esModule",{value:!0}),e);var M=(e,t,n)=>ZN(e,typeof t!="symbol"?t+"":t,n);var dm=Bs(fm=>{"use strict";Object.defineProperty(fm,"__esModule",{value:!0});var cm;function um(){if(cm===void 0)throw new Error("No runtime abstraction layer installed");return cm}(function(e){function t(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");cm=n}e.install=t})(um||(um={}));fm.default=um});var pm=Bs(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.boolean=nM;Ln.string=C_;Ln.number=rM;Ln.error=iM;Ln.func=oM;Ln.array=O_;Ln.stringArray=sM;function nM(e){return e===!0||e===!1}function C_(e){return typeof e=="string"||e instanceof String}function rM(e){return typeof e=="number"||e instanceof Number}function iM(e){return e instanceof Error}function oM(e){return typeof e=="function"}function O_(e){return Array.isArray(e)}function sM(e){return O_(e)&&e.every(t=>C_(t))}});var gm=Bs(Tr=>{"use strict";var aM=Tr&&Tr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Tr,"__esModule",{value:!0});Tr.Emitter=Tr.Event=void 0;var lM=aM(dm()),$_;(function(e){let t={dispose(){}};e.None=function(){return t}})($_||(Tr.Event=$_={}));var hm=class{constructor(){M(this,"_callbacks");M(this,"_contexts")}add(t,n=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(t),this._contexts.push(n),Array.isArray(r)&&r.push({dispose:()=>this.remove(t,n)})}remove(t,n=null){if(!this._callbacks)return;let r=!1;for(let i=0,o=this._callbacks.length;i<o;i++)if(this._callbacks[i]===t)if(this._contexts[i]===n){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else r=!0;if(r)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...t){if(!this._callbacks)return[];let n=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let o=0,s=r.length;o<s;o++)try{n.push(r[o].apply(i[o],t))}catch(a){(0,lM.default)().console.error(a)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Ou=class Ou{constructor(t){M(this,"_options");M(this,"_event");M(this,"_callbacks");this._options=t}get event(){return this._event||(this._event=(t,n,r)=>{this._callbacks||(this._callbacks=new hm),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(t,n);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(t,n),i.dispose=Ou._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(t){this._callbacks&&this._callbacks.invoke.call(this._callbacks,t)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};M(Ou,"_noop",function(){});var mm=Ou;Tr.Emitter=mm});var D_=Bs(wt=>{"use strict";var cM=wt&&wt.__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]})),uM=wt&&wt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),fM=wt&&wt.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),i=0;i<r.length;i++)r[i]!=="default"&&cM(n,t,r[i]);return uM(n,t),n}})(),dM=wt&&wt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(wt,"__esModule",{value:!0});wt.CancellationTokenSource=wt.CancellationToken=void 0;var pM=dM(dm()),hM=fM(pm()),ym=gm(),$u;(function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:ym.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:ym.Event.None});function t(n){let r=n;return r&&(r===e.None||r===e.Cancelled||hM.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}e.is=t})($u||(wt.CancellationToken=$u={}));var mM=Object.freeze(function(e,t){let n=(0,pM.default)().timer.setTimeout(e.bind(t),0);return{dispose(){n.dispose()}}}),Du=class{constructor(){M(this,"_isCancelled",!1);M(this,"_emitter")}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?mM:(this._emitter||(this._emitter=new ym.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},xm=class{constructor(){M(this,"_token")}get token(){return this._token||(this._token=new Du),this._token}cancel(){this._token?this._token.cancel():this._token=$u.Cancelled}dispose(){this._token?this._token instanceof Du&&this._token.dispose():this._token=$u.None}};wt.CancellationTokenSource=xm});var F_=Bs(te=>{"use strict";var gM=te&&te.__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]})),yM=te&&te.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),xM=te&&te.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),i=0;i<r.length;i++)r[i]!=="default"&&gM(n,t,r[i]);return yM(n,t),n}})();Object.defineProperty(te,"__esModule",{value:!0});te.Message=te.NotificationType9=te.NotificationType8=te.NotificationType7=te.NotificationType6=te.NotificationType5=te.NotificationType4=te.NotificationType3=te.NotificationType2=te.NotificationType1=te.NotificationType0=te.NotificationType=te.RequestType9=te.RequestType8=te.RequestType7=te.RequestType6=te.RequestType5=te.RequestType4=te.RequestType3=te.RequestType2=te.RequestType1=te.RequestType=te.RequestType0=te.AbstractMessageSignature=te.ParameterStructures=te.ResponseError=te.ErrorCodes=void 0;var pi=xM(pm()),Em;(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})(Em||(te.ErrorCodes=Em={}));var wm=class e extends Error{constructor(n,r,i){super(r);M(this,"code");M(this,"data");this.code=pi.number(n)?n:Em.UnknownErrorCode,this.data=i,Object.setPrototypeOf(this,e.prototype)}toJson(){let n={code:this.code,message:this.message};return this.data!==void 0&&(n.data=this.data),n}};te.ResponseError=wm;var Vt=class Vt{constructor(t){M(this,"kind");this.kind=t}static is(t){return t===Vt.auto||t===Vt.byName||t===Vt.byPosition}toString(){return this.kind}};M(Vt,"auto",new Vt("auto")),M(Vt,"byPosition",new Vt("byPosition")),M(Vt,"byName",new Vt("byName"));var vr=Vt;te.ParameterStructures=vr;var Ce=class{constructor(t,n){M(this,"method");M(this,"numberOfParams");this.method=t,this.numberOfParams=n}get parameterStructures(){return vr.auto}};te.AbstractMessageSignature=Ce;var Tm=class extends Ce{constructor(n){super(n,0);M(this,"_")}};te.RequestType0=Tm;var vm=class extends Ce{constructor(n,r=vr.auto){super(n,1);M(this,"_parameterStructures");M(this,"_");this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};te.RequestType=vm;var _m=class extends Ce{constructor(n,r=vr.auto){super(n,1);M(this,"_parameterStructures");M(this,"_");this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};te.RequestType1=_m;var Am=class extends Ce{constructor(n){super(n,2);M(this,"_")}};te.RequestType2=Am;var km=class extends Ce{constructor(n){super(n,3);M(this,"_")}};te.RequestType3=km;var Im=class extends Ce{constructor(n){super(n,4);M(this,"_")}};te.RequestType4=Im;var Rm=class extends Ce{constructor(n){super(n,5);M(this,"_")}};te.RequestType5=Rm;var Sm=class extends Ce{constructor(n){super(n,6);M(this,"_")}};te.RequestType6=Sm;var bm=class extends Ce{constructor(n){super(n,7);M(this,"_")}};te.RequestType7=bm;var Nm=class extends Ce{constructor(n){super(n,8);M(this,"_")}};te.RequestType8=Nm;var Lm=class extends Ce{constructor(n){super(n,9);M(this,"_")}};te.RequestType9=Lm;var Pm=class extends Ce{constructor(n,r=vr.auto){super(n,1);M(this,"_parameterStructures");M(this,"_");this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};te.NotificationType=Pm;var Cm=class extends Ce{constructor(n){super(n,0);M(this,"_")}};te.NotificationType0=Cm;var Om=class extends Ce{constructor(n,r=vr.auto){super(n,1);M(this,"_parameterStructures");M(this,"_");this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};te.NotificationType1=Om;var $m=class extends Ce{constructor(n){super(n,2);M(this,"_")}};te.NotificationType2=$m;var Dm=class extends Ce{constructor(n){super(n,3);M(this,"_")}};te.NotificationType3=Dm;var Mm=class extends Ce{constructor(n){super(n,4);M(this,"_")}};te.NotificationType4=Mm;var Fm=class extends Ce{constructor(n){super(n,5);M(this,"_")}};te.NotificationType5=Fm;var Bm=class extends Ce{constructor(n){super(n,6);M(this,"_")}};te.NotificationType6=Bm;var Wm=class extends Ce{constructor(n){super(n,7);M(this,"_")}};te.NotificationType7=Wm;var Xm=class extends Ce{constructor(n){super(n,8);M(this,"_")}};te.NotificationType8=Xm;var Um=class extends Ce{constructor(n){super(n,9);M(this,"_")}};te.NotificationType9=Um;var M_;(function(e){function t(i){let o=i;return o&&pi.string(o.method)&&(pi.string(o.id)||pi.number(o.id))}e.isRequest=t;function n(i){let o=i;return o&&pi.string(o.method)&&i.id===void 0}e.isNotification=n;function r(i){let o=i;return o&&(o.result!==void 0||!!o.error)&&(pi.string(o.id)||pi.number(o.id)||o.id===null)}e.isResponse=r})(M_||(te.Message=M_={}))});var xI={};Bp(xI,{nodeReadFile:()=>l2});async function l2(){throw new Error("nowline: filesystem readers are unavailable in the browser embed")}var EI=JN(()=>{});var bU={};Bp(bU,{EmbedRenderError:()=>Gl,__resetForTests:()=>SU,init:()=>sE,initialize:()=>AU,parse:()=>IU,render:()=>kU,run:()=>RU,sha:()=>vU,version:()=>TU});function Ue(e){return typeof e=="object"&&e!==null&&typeof e.$type=="string"}function it(e){return typeof e=="object"&&e!==null&&typeof e.$refText=="string"&&"ref"in e}function Ct(e){return typeof e=="object"&&e!==null&&typeof e.$refText=="string"&&"items"in e}function fE(e){return typeof e=="object"&&e!==null&&typeof e.name=="string"&&typeof e.type=="string"&&typeof e.path=="string"}function Gi(e){return typeof e=="object"&&e!==null&&typeof e.info=="object"&&typeof e.message=="string"}var Ui=class{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(t){let n=this.types[t.container.$type];if(!n)throw new Error(`Type ${t.container.$type||"undefined"} not found.`);let r=n.properties[t.property]?.referenceType;if(!r)throw new Error(`Property ${t.property||"undefined"} of type ${t.container.$type} is not a reference.`);return r}getTypeMetaData(t){let n=this.types[t];return n||{name:t,properties:{},superTypes:[]}}isInstance(t,n){return Ue(t)&&this.isSubtype(t.$type,n)}isSubtype(t,n){if(t===n)return!0;let r=this.subtypes[t];r||(r=this.subtypes[t]={});let i=r[n];if(i!==void 0)return i;{let o=this.types[t],s=o?o.superTypes.some(a=>this.isSubtype(a,n)):!1;return r[n]=s,s}}getAllSubTypes(t){let n=this.allSubtypes[t];if(n)return n;{let r=this.getAllTypes(),i=[];for(let o of r)this.isSubtype(o,t)&&i.push(o);return this.allSubtypes[t]=i,i}}isComplete(t){let n=this.getTypeMetaData(t.$type);for(let r of Object.keys(n.properties)){let i=n.properties[r];if(i.optional)continue;let o=t[i.name];if(o==null)return!1}return!0}};function Jn(e){return typeof e=="object"&&e!==null&&Array.isArray(e.content)}function Kl(e){return typeof e=="object"&&e!==null&&typeof e.tokenType=="object"}function ql(e){return Jn(e)&&typeof e.fullText=="string"}var Ut=class e{constructor(t,n){this.startFn=t,this.nextFn=n}iterator(){let t={state:this.startFn(),next:()=>this.nextFn(t.state),[Symbol.iterator]:()=>t};return t}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){let t=this.iterator(),n=0,r=t.next();for(;!r.done;)n++,r=t.next();return n}toArray(){let t=[],n=this.iterator(),r;do r=n.next(),r.value!==void 0&&t.push(r.value);while(!r.done);return t}toSet(){return new Set(this)}toMap(t,n){let r=this.map(i=>[t?t(i):i,n?n(i):i]);return new Map(r)}toString(){return this.join()}concat(t){return new e(()=>({first:this.startFn(),firstDone:!1,iterator:t[Symbol.iterator]()}),n=>{let r;if(!n.firstDone){do if(r=this.nextFn(n.first),!r.done)return r;while(!r.done);n.firstDone=!0}do if(r=n.iterator.next(),!r.done)return r;while(!r.done);return gt})}join(t=","){let n=this.iterator(),r="",i,o=!1;do i=n.next(),i.done||(o&&(r+=t),r+=tL(i.value)),o=!0;while(!i.done);return r}indexOf(t,n=0){let r=this.iterator(),i=0,o=r.next();for(;!o.done;){if(i>=n&&o.value===t)return i;o=r.next(),i++}return-1}every(t){let n=this.iterator(),r=n.next();for(;!r.done;){if(!t(r.value))return!1;r=n.next()}return!0}some(t){let n=this.iterator(),r=n.next();for(;!r.done;){if(t(r.value))return!0;r=n.next()}return!1}forEach(t){let n=this.iterator(),r=0,i=n.next();for(;!i.done;)t(i.value,r),i=n.next(),r++}map(t){return new e(this.startFn,n=>{let{done:r,value:i}=this.nextFn(n);return r?gt:{done:!1,value:t(i)}})}filter(t){return new e(this.startFn,n=>{let r;do if(r=this.nextFn(n),!r.done&&t(r.value))return r;while(!r.done);return gt})}nonNullable(){return this.filter(t=>t!=null)}reduce(t,n){let r=this.iterator(),i=n,o=r.next();for(;!o.done;)i===void 0?i=o.value:i=t(i,o.value),o=r.next();return i}reduceRight(t,n){return this.recursiveReduce(this.iterator(),t,n)}recursiveReduce(t,n,r){let i=t.next();if(i.done)return r;let o=this.recursiveReduce(t,n,r);return o===void 0?i.value:n(o,i.value)}find(t){let n=this.iterator(),r=n.next();for(;!r.done;){if(t(r.value))return r.value;r=n.next()}}findIndex(t){let n=this.iterator(),r=0,i=n.next();for(;!i.done;){if(t(i.value))return r;i=n.next(),r++}return-1}includes(t){let n=this.iterator(),r=n.next();for(;!r.done;){if(r.value===t)return!0;r=n.next()}return!1}flatMap(t){return new e(()=>({this:this.startFn()}),n=>{do{if(n.iterator){let o=n.iterator.next();if(o.done)n.iterator=void 0;else return o}let{done:r,value:i}=this.nextFn(n.this);if(!r){let o=t(i);if(Zl(o))n.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}}while(n.iterator);return gt})}flat(t){if(t===void 0&&(t=1),t<=0)return this;let n=t>1?this.flat(t-1):this;return new e(()=>({this:n.startFn()}),r=>{do{if(r.iterator){let s=r.iterator.next();if(s.done)r.iterator=void 0;else return s}let{done:i,value:o}=n.nextFn(r.this);if(!i)if(Zl(o))r.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}while(r.iterator);return gt})}head(){let n=this.iterator().next();if(!n.done)return n.value}tail(t=1){return new e(()=>{let n=this.startFn();for(let r=0;r<t;r++)if(this.nextFn(n).done)return n;return n},this.nextFn)}limit(t){return new e(()=>({size:0,state:this.startFn()}),n=>(n.size++,n.size>t?gt:this.nextFn(n.state)))}distinct(t){return new e(()=>({set:new Set,internalState:this.startFn()}),n=>{let r;do if(r=this.nextFn(n.internalState),!r.done){let i=t?t(r.value):r.value;if(!n.set.has(i))return n.set.add(i),r}while(!r.done);return gt})}exclude(t,n){let r=new Set;for(let i of t){let o=n?n(i):i;r.add(o)}return this.filter(i=>{let o=n?n(i):i;return!r.has(o)})}};function tL(e){return typeof e=="string"?e:typeof e>"u"?"undefined":typeof e.toString=="function"?e.toString():Object.prototype.toString.call(e)}function Zl(e){return!!e&&typeof e[Symbol.iterator]=="function"}var Ql=new Ut(()=>{},()=>gt),gt=Object.freeze({done:!0,value:void 0});function ye(...e){if(e.length===1){let t=e[0];if(t instanceof Ut)return t;if(Zl(t))return new Ut(()=>t[Symbol.iterator](),n=>n.next());if(typeof t.length=="number")return new Ut(()=>({index:0}),n=>n.index<t.length?{done:!1,value:t[n.index++]}:gt)}return e.length>1?new Ut(()=>({collIndex:0,arrIndex:0}),t=>{do{if(t.iterator){let n=t.iterator.next();if(!n.done)return n;t.iterator=void 0}if(t.array){if(t.arrIndex<t.array.length)return{done:!1,value:t.array[t.arrIndex++]};t.array=void 0,t.arrIndex=0}if(t.collIndex<e.length){let n=e[t.collIndex++];Zl(n)?t.iterator=n[Symbol.iterator]():n&&typeof n.length=="number"&&(t.array=n)}}while(t.iterator||t.array||t.collIndex<e.length);return gt}):Ql}var Qn=class extends Ut{constructor(t,n,r){super(()=>({iterators:r?.includeRoot?[[t][Symbol.iterator]()]:[n(t)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){let s=i.iterators[i.iterators.length-1].next();if(s.done)i.iterators.pop();else return i.iterators.push(n(s.value)[Symbol.iterator]()),s}return gt})}iterator(){let t={state:this.startFn(),next:()=>this.nextFn(t.state),prune:()=>{t.state.pruned=!0},[Symbol.iterator]:()=>t};return t}},Jl;(function(e){function t(o){return o.reduce((s,a)=>s+a,0)}e.sum=t;function n(o){return o.reduce((s,a)=>s*a,0)}e.product=n;function r(o){return o.reduce((s,a)=>Math.min(s,a))}e.min=r;function i(o){return o.reduce((s,a)=>Math.max(s,a))}e.max=i})(Jl||(Jl={}));function ec(e,t={}){for(let[n,r]of Object.entries(e))n.startsWith("$")||(Array.isArray(r)?r.forEach((i,o)=>{Ue(i)&&(i.$container=e,i.$containerProperty=n,i.$containerIndex=o,t.deep&&ec(i,t))}):Ue(r)&&(r.$container=e,r.$containerProperty=n,t.deep&&ec(r,t)))}function Hi(e,t){let n=e;for(;n;){if(t(n))return n;n=n.$container}}function at(e){let n=Ws(e).$document;if(!n)throw new Error("AST node has no document.");return n}function Ws(e){for(;e.$container;)e=e.$container;return e}function Up(e){return it(e)?e.ref?[e.ref]:[]:Ct(e)?e.items.map(t=>t.ref):[]}function tc(e,t){if(!e)throw new Error("Node must be an AstNode.");let n=t?.range;return new Ut(()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0}),r=>{for(;r.keyIndex<r.keys.length;){let i=r.keys[r.keyIndex];if(!i.startsWith("$")){let o=e[i];if(Ue(o)){if(r.keyIndex++,Xp(o,n))return{done:!1,value:o}}else if(Array.isArray(o)){for(;r.arrayIndex<o.length;){let s=r.arrayIndex++,a=o[s];if(Ue(a)&&Xp(a,n))return{done:!1,value:a}}r.arrayIndex=0}}r.keyIndex++}return gt})}function rn(e,t){if(!e)throw new Error("Root node must be an AstNode.");return new Qn(e,n=>tc(n,t))}function yt(e,t){if(e){if(t?.range&&!Xp(e,t.range))return new Qn(e,()=>[])}else throw new Error("Root node must be an AstNode.");return new Qn(e,n=>tc(n,t),{includeRoot:!0})}function Xp(e,t){if(!t)return!0;let n=e.$cstNode?.range;return n?hE(n,t):!1}function Gr(e){return new Ut(()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0}),t=>{for(;t.keyIndex<t.keys.length;){let n=t.keys[t.keyIndex];if(!n.startsWith("$")){let r=e[n];if(it(r)||Ct(r))return t.keyIndex++,{done:!1,value:{reference:r,container:e,property:n}};if(Array.isArray(r)){for(;t.arrayIndex<r.length;){let i=t.arrayIndex++,o=r[i];if(it(o)||Ct(o))return{done:!1,value:{reference:o,container:e,property:n,index:i}}}t.arrayIndex=0}}t.keyIndex++}return gt})}function dE(e,t){let n=e.getTypeMetaData(t.$type),r=t;for(let i of Object.values(n.properties))i.defaultValue!==void 0&&r[i.name]===void 0&&(r[i.name]=pE(i.defaultValue))}function pE(e){return Array.isArray(e)?[...e.map(pE)]:e}var Rt={$type:"AbstractElement",cardinality:"cardinality"};function dc(e){return he.isInstance(e,Rt.$type)}var oc={$type:"AbstractParserRule"};function tr(e){return he.isInstance(e,oc.$type)}var nc={$type:"AbstractRule"};var Gt={$type:"AbstractType"};var zr={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function nr(e){return he.isInstance(e,zr.$type)}var sc={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function Jp(e){return he.isInstance(e,sc.$type)}var mE={$type:"ArrayLiteral",elements:"elements"};var Hp={$type:"ArrayType",elementType:"elementType"};function wE(e){return he.isInstance(e,Hp.$type)}var jr={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function sn(e){return he.isInstance(e,jr.$type)}var zp={$type:"BooleanLiteral",true:"true"};function TE(e){return he.isInstance(e,zp.$type)}var Yr={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function vE(e){return he.isInstance(e,Yr.$type)}var zi={$type:"Condition"};var ac={$type:"Conjunction",left:"left",right:"right"};function _E(e){return he.isInstance(e,ac.$type)}var Vr={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function an(e){return he.isInstance(e,Vr.$type)}var lc={$type:"Disjunction",left:"left",right:"right"};function AE(e){return he.isInstance(e,lc.$type)}var jp={$type:"EndOfFile",cardinality:"cardinality"};function kE(e){return he.isInstance(e,jp.$type)}var Hr={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};var gE={$type:"GrammarImport",path:"path"};var ji={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function Kr(e){return he.isInstance(e,ji.$type)}var Yp={$type:"InferredType",name:"name"};function pc(e){return he.isInstance(e,Yp.$type)}var yn={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function qr(e){return he.isInstance(e,yn.$type)}var Gp={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};var yE={$type:"InfixRuleOperators",precedences:"precedences"};var Hs={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function IE(e){return he.isInstance(e,Hs.$type)}var zs={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function Ht(e){return he.isInstance(e,zs.$type)}var rc={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};var Yi={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function RE(e){return he.isInstance(e,Yi.$type)}var Vp={$type:"Negation",value:"value"};function SE(e){return he.isInstance(e,Vp.$type)}var xE={$type:"NumberLiteral",value:"value"};var ic={$type:"Parameter",name:"name"};var Kp={$type:"ParameterReference",parameter:"parameter"};function bE(e){return he.isInstance(e,Kp.$type)}var on={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function lt(e){return he.isInstance(e,on.$type)}var cc={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function NE(e){return he.isInstance(e,cc.$type)}var Vi={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function LE(e){return he.isInstance(e,Vi.$type)}var qp={$type:"ReturnType",name:"name"};function PE(e){return he.isInstance(e,qp.$type)}var Ki={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function ln(e){return he.isInstance(e,Ki.$type)}var js={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function Qp(e){return he.isInstance(e,js.$type)}var EE={$type:"StringLiteral",value:"value"};var qi={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function CE(e){return he.isInstance(e,qi.$type)}var Ot={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};var Zi={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function OE(e){return he.isInstance(e,Zi.$type)}var er={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function xt(e){return he.isInstance(e,er.$type)}var Ji={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function eh(e){return he.isInstance(e,Ji.$type)}var uc={$type:"Type",name:"name",type:"type"};function th(e){return he.isInstance(e,uc.$type)}var Xs={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};var Us={$type:"TypeDefinition"};var Zp={$type:"UnionType",types:"types"};function $E(e){return he.isInstance(e,Zp.$type)}var fc={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function nh(e){return he.isInstance(e,fc.$type)}var Qi={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function DE(e){return he.isInstance(e,Qi.$type)}var Gs={$type:"ValueLiteral"};var Ys={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function ME(e){return he.isInstance(e,Ys.$type)}var Vs=class extends Ui{constructor(){super(...arguments),this.types={AbstractElement:{name:Rt.$type,properties:{cardinality:{name:Rt.cardinality,optional:!0}},superTypes:[]},AbstractParserRule:{name:oc.$type,properties:{},superTypes:[nc.$type,Gt.$type]},AbstractRule:{name:nc.$type,properties:{},superTypes:[]},AbstractType:{name:Gt.$type,properties:{},superTypes:[]},Action:{name:zr.$type,properties:{cardinality:{name:zr.cardinality,optional:!0},feature:{name:zr.feature,optional:!0},inferredType:{name:zr.inferredType,optional:!0},operator:{name:zr.operator,optional:!0},type:{name:zr.type,referenceType:Gt.$type,optional:!0}},superTypes:[Rt.$type]},Alternatives:{name:sc.$type,properties:{cardinality:{name:sc.cardinality,optional:!0},elements:{name:sc.elements,defaultValue:[]}},superTypes:[Rt.$type]},ArrayLiteral:{name:mE.$type,properties:{elements:{name:mE.elements,defaultValue:[]}},superTypes:[Gs.$type]},ArrayType:{name:Hp.$type,properties:{elementType:{name:Hp.elementType}},superTypes:[Us.$type]},Assignment:{name:jr.$type,properties:{cardinality:{name:jr.cardinality,optional:!0},feature:{name:jr.feature},operator:{name:jr.operator},predicate:{name:jr.predicate,optional:!0},terminal:{name:jr.terminal}},superTypes:[Rt.$type]},BooleanLiteral:{name:zp.$type,properties:{true:{name:zp.true,defaultValue:!1}},superTypes:[zi.$type,Gs.$type]},CharacterRange:{name:Yr.$type,properties:{cardinality:{name:Yr.cardinality,optional:!0},left:{name:Yr.left},lookahead:{name:Yr.lookahead,optional:!0},parenthesized:{name:Yr.parenthesized,defaultValue:!1,optional:!0},right:{name:Yr.right,optional:!0}},superTypes:[Ot.$type]},Condition:{name:zi.$type,properties:{},superTypes:[]},Conjunction:{name:ac.$type,properties:{left:{name:ac.left},right:{name:ac.right}},superTypes:[zi.$type]},CrossReference:{name:Vr.$type,properties:{cardinality:{name:Vr.cardinality,optional:!0},deprecatedSyntax:{name:Vr.deprecatedSyntax,defaultValue:!1},isMulti:{name:Vr.isMulti,defaultValue:!1},terminal:{name:Vr.terminal,optional:!0},type:{name:Vr.type,referenceType:Gt.$type}},superTypes:[Rt.$type]},Disjunction:{name:lc.$type,properties:{left:{name:lc.left},right:{name:lc.right}},superTypes:[zi.$type]},EndOfFile:{name:jp.$type,properties:{cardinality:{name:jp.cardinality,optional:!0}},superTypes:[Rt.$type]},Grammar:{name:Hr.$type,properties:{imports:{name:Hr.imports,defaultValue:[]},interfaces:{name:Hr.interfaces,defaultValue:[]},isDeclared:{name:Hr.isDeclared,defaultValue:!1},name:{name:Hr.name,optional:!0},rules:{name:Hr.rules,defaultValue:[]},types:{name:Hr.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:gE.$type,properties:{path:{name:gE.path}},superTypes:[]},Group:{name:ji.$type,properties:{cardinality:{name:ji.cardinality,optional:!0},elements:{name:ji.elements,defaultValue:[]},guardCondition:{name:ji.guardCondition,optional:!0},predicate:{name:ji.predicate,optional:!0}},superTypes:[Rt.$type]},InferredType:{name:Yp.$type,properties:{name:{name:Yp.name}},superTypes:[Gt.$type]},InfixRule:{name:yn.$type,properties:{call:{name:yn.call},dataType:{name:yn.dataType,optional:!0},inferredType:{name:yn.inferredType,optional:!0},name:{name:yn.name},operators:{name:yn.operators},parameters:{name:yn.parameters,defaultValue:[]},returnType:{name:yn.returnType,referenceType:Gt.$type,optional:!0}},superTypes:[oc.$type]},InfixRuleOperatorList:{name:Gp.$type,properties:{associativity:{name:Gp.associativity,optional:!0},operators:{name:Gp.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:yE.$type,properties:{precedences:{name:yE.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:Hs.$type,properties:{attributes:{name:Hs.attributes,defaultValue:[]},name:{name:Hs.name},superTypes:{name:Hs.superTypes,defaultValue:[],referenceType:Gt.$type}},superTypes:[Gt.$type]},Keyword:{name:zs.$type,properties:{cardinality:{name:zs.cardinality,optional:!0},predicate:{name:zs.predicate,optional:!0},value:{name:zs.value}},superTypes:[Rt.$type]},NamedArgument:{name:rc.$type,properties:{calledByName:{name:rc.calledByName,defaultValue:!1},parameter:{name:rc.parameter,referenceType:ic.$type,optional:!0},value:{name:rc.value}},superTypes:[]},NegatedToken:{name:Yi.$type,properties:{cardinality:{name:Yi.cardinality,optional:!0},lookahead:{name:Yi.lookahead,optional:!0},parenthesized:{name:Yi.parenthesized,defaultValue:!1,optional:!0},terminal:{name:Yi.terminal}},superTypes:[Ot.$type]},Negation:{name:Vp.$type,properties:{value:{name:Vp.value}},superTypes:[zi.$type]},NumberLiteral:{name:xE.$type,properties:{value:{name:xE.value}},superTypes:[Gs.$type]},Parameter:{name:ic.$type,properties:{name:{name:ic.name}},superTypes:[]},ParameterReference:{name:Kp.$type,properties:{parameter:{name:Kp.parameter,referenceType:ic.$type}},superTypes:[zi.$type]},ParserRule:{name:on.$type,properties:{dataType:{name:on.dataType,optional:!0},definition:{name:on.definition},entry:{name:on.entry,defaultValue:!1},fragment:{name:on.fragment,defaultValue:!1},inferredType:{name:on.inferredType,optional:!0},name:{name:on.name},parameters:{name:on.parameters,defaultValue:[]},returnType:{name:on.returnType,referenceType:Gt.$type,optional:!0}},superTypes:[oc.$type]},ReferenceType:{name:cc.$type,properties:{isMulti:{name:cc.isMulti,defaultValue:!1},referenceType:{name:cc.referenceType}},superTypes:[Us.$type]},RegexToken:{name:Vi.$type,properties:{cardinality:{name:Vi.cardinality,optional:!0},lookahead:{name:Vi.lookahead,optional:!0},parenthesized:{name:Vi.parenthesized,defaultValue:!1,optional:!0},regex:{name:Vi.regex}},superTypes:[Ot.$type]},ReturnType:{name:qp.$type,properties:{name:{name:qp.name}},superTypes:[]},RuleCall:{name:Ki.$type,properties:{arguments:{name:Ki.arguments,defaultValue:[]},cardinality:{name:Ki.cardinality,optional:!0},predicate:{name:Ki.predicate,optional:!0},rule:{name:Ki.rule,referenceType:nc.$type}},superTypes:[Rt.$type]},SimpleType:{name:js.$type,properties:{primitiveType:{name:js.primitiveType,optional:!0},stringType:{name:js.stringType,optional:!0},typeRef:{name:js.typeRef,referenceType:Gt.$type,optional:!0}},superTypes:[Us.$type]},StringLiteral:{name:EE.$type,properties:{value:{name:EE.value}},superTypes:[Gs.$type]},TerminalAlternatives:{name:qi.$type,properties:{cardinality:{name:qi.cardinality,optional:!0},elements:{name:qi.elements,defaultValue:[]},lookahead:{name:qi.lookahead,optional:!0},parenthesized:{name:qi.parenthesized,defaultValue:!1,optional:!0}},superTypes:[Ot.$type]},TerminalElement:{name:Ot.$type,properties:{cardinality:{name:Ot.cardinality,optional:!0},lookahead:{name:Ot.lookahead,optional:!0},parenthesized:{name:Ot.parenthesized,defaultValue:!1,optional:!0}},superTypes:[Rt.$type]},TerminalGroup:{name:Zi.$type,properties:{cardinality:{name:Zi.cardinality,optional:!0},elements:{name:Zi.elements,defaultValue:[]},lookahead:{name:Zi.lookahead,optional:!0},parenthesized:{name:Zi.parenthesized,defaultValue:!1,optional:!0}},superTypes:[Ot.$type]},TerminalRule:{name:er.$type,properties:{definition:{name:er.definition},fragment:{name:er.fragment,defaultValue:!1},hidden:{name:er.hidden,defaultValue:!1},name:{name:er.name},type:{name:er.type,optional:!0}},superTypes:[nc.$type]},TerminalRuleCall:{name:Ji.$type,properties:{cardinality:{name:Ji.cardinality,optional:!0},lookahead:{name:Ji.lookahead,optional:!0},parenthesized:{name:Ji.parenthesized,defaultValue:!1,optional:!0},rule:{name:Ji.rule,referenceType:er.$type}},superTypes:[Ot.$type]},Type:{name:uc.$type,properties:{name:{name:uc.name},type:{name:uc.type}},superTypes:[Gt.$type]},TypeAttribute:{name:Xs.$type,properties:{defaultValue:{name:Xs.defaultValue,optional:!0},isOptional:{name:Xs.isOptional,defaultValue:!1},name:{name:Xs.name},type:{name:Xs.type}},superTypes:[]},TypeDefinition:{name:Us.$type,properties:{},superTypes:[]},UnionType:{name:Zp.$type,properties:{types:{name:Zp.types,defaultValue:[]}},superTypes:[Us.$type]},UnorderedGroup:{name:fc.$type,properties:{cardinality:{name:fc.cardinality,optional:!0},elements:{name:fc.elements,defaultValue:[]}},superTypes:[Rt.$type]},UntilToken:{name:Qi.$type,properties:{cardinality:{name:Qi.cardinality,optional:!0},lookahead:{name:Qi.lookahead,optional:!0},parenthesized:{name:Qi.parenthesized,defaultValue:!1,optional:!0},terminal:{name:Qi.terminal}},superTypes:[Ot.$type]},ValueLiteral:{name:Gs.$type,properties:{},superTypes:[]},Wildcard:{name:Ys.$type,properties:{cardinality:{name:Ys.cardinality,optional:!0},lookahead:{name:Ys.lookahead,optional:!0},parenthesized:{name:Ys.parenthesized,defaultValue:!1,optional:!0}},superTypes:[Ot.$type]}}}},he=new Vs;function Ks(e){return new Qn(e,t=>Jn(t)?t.content:[],{includeRoot:!0})}function WE(e,t){for(;e.container;)if(e=e.container,e===t)return!0;return!1}function XE(e){return{start:{line:e.startLine-1,character:e.startColumn-1},end:{line:e.endLine-1,character:e.endColumn}}}function qs(e){let{startOffset:t,endOffset:n}=e;return typeof t=="number"&&Number.isFinite(t)&&t>=0&&typeof n=="number"&&Number.isFinite(n)&&n>=t}function eo(e){if(!e)return;let{offset:t,end:n,range:r}=e;return{range:r,offset:t,end:n,length:n-t}}var xn;(function(e){e[e.Before=0]="Before",e[e.After=1]="After",e[e.OverlapFront=2]="OverlapFront",e[e.OverlapBack=3]="OverlapBack",e[e.Inside=4]="Inside",e[e.Outside=5]="Outside"})(xn||(xn={}));function nL(e,t){if(e.end.line<t.start.line||e.end.line===t.start.line&&e.end.character<=t.start.character)return xn.Before;if(e.start.line>t.end.line||e.start.line===t.end.line&&e.start.character>=t.end.character)return xn.After;let n=e.start.line>t.start.line||e.start.line===t.start.line&&e.start.character>=t.start.character,r=e.end.line<t.end.line||e.end.line===t.end.line&&e.end.character<=t.end.character;return n&&r?xn.Inside:n?xn.OverlapBack:r?xn.OverlapFront:xn.Outside}function hE(e,t){return nL(e,t)>xn.After}var UE=/^[\w\p{L}]$/u;function GE(e,t){if(e){let n=rL(e,!0);if(n&&BE(n,t))return n;if(ql(e)){let r=e.content.findIndex(i=>!i.hidden);for(let i=r-1;i>=0;i--){let o=e.content[i];if(BE(o,t))return o}}}}function BE(e,t){return Kl(e)&&t.includes(e.tokenType.name)}function rL(e,t=!0){for(;e.container;){let n=e.container,r=n.content.indexOf(e);for(;r>0;){r--;let i=n.content[r];if(t||!i.hidden)return i}e=n}}var Ec={};Bp(Ec,{findAssignment:()=>mh,findNameAssignment:()=>yc,findNodeForKeyword:()=>ph,findNodeForProperty:()=>na,findNodesForKeyword:()=>uL,findNodesForKeywordInternal:()=>hh,findNodesForProperty:()=>fh,getActionAtElement:()=>ZE,getActionType:()=>QE,getAllReachableRules:()=>ta,getAllRulesUsedForCrossReferences:()=>cL,getCrossReferenceTerminal:()=>ch,getEntryRule:()=>YE,getExplicitRuleType:()=>xc,getHiddenRules:()=>VE,getRuleType:()=>gh,getRuleTypeName:()=>mL,getTypeName:()=>ir,isArrayCardinality:()=>dL,isArrayOperator:()=>pL,isCommentTerminal:()=>uh,isDataType:()=>hL,isDataTypeRule:()=>ra,isOptionalCardinality:()=>fL,terminalRegex:()=>no});var Zs=class extends Error{constructor(t,n){let r=typeof n=="string"?n:n();super(t?`${r} at ${t.range.start.line}:${t.range.start.character}`:r)}};function rr(e,t="Error: Got unexpected value."){throw new Error(typeof t=="string"?t:t())}function oe(e){return e.charCodeAt(0)}function hc(e,t){Array.isArray(e)?e.forEach(function(n){t.push(n)}):t.push(e)}function to(e,t){if(e[t]===!0)throw"duplicate flag "+t;let n=e[t];e[t]=!0}function Zr(e){if(e===void 0)throw Error("Internal Error - Should never get here!");return!0}function Js(){throw Error("Internal Error - Should never get here!")}function rh(e){return e.type==="Character"}var Qs=[];for(let e=oe("0");e<=oe("9");e++)Qs.push(e);var ea=[oe("_")].concat(Qs);for(let e=oe("a");e<=oe("z");e++)ea.push(e);for(let e=oe("A");e<=oe("Z");e++)ea.push(e);var ih=[oe(" "),oe("\f"),oe(`
|
|
3
|
-
`),oe("\r"),oe(" "),oe("\v"),oe(" "),oe("\xA0"),oe("\u1680"),oe("\u2000"),oe("\u2001"),oe("\u2002"),oe("\u2003"),oe("\u2004"),oe("\u2005"),oe("\u2006"),oe("\u2007"),oe("\u2008"),oe("\u2009"),oe("\u200A"),oe("\u2028"),oe("\u2029"),oe("\u202F"),oe("\u205F"),oe("\u3000"),oe("\uFEFF")];var iL=/[0-9a-fA-F]/,
|
|
4
|
-
`),oe("\r"),oe("\u2028"),oe("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let t,n=!1;switch(this.popChar()){case"d":t=Qs;break;case"D":t=Qs,n=!0;break;case"s":t=
|
|
1
|
+
/*! @nowline/embed 0.0.0-dev.20261020011950.gce8a91f sha=ce8a91f built=2026-10-20T01:14:35Z */
|
|
2
|
+
"use strict";var nowline=(()=>{var jN=Object.create;var Fs=Object.defineProperty;var YN=Object.getOwnPropertyDescriptor;var VN=Object.getOwnPropertyNames;var KN=Object.getPrototypeOf,qN=Object.prototype.hasOwnProperty;var ZN=(e,t,n)=>t in e?Fs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var JN=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(r){throw n=[r],r}};var Bs=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},Fp=(e,t)=>{for(var n in t)Fs(e,n,{get:t[n],enumerable:!0})},cE=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of VN(t))!qN.call(e,i)&&i!==n&&Fs(e,i,{get:()=>t[i],enumerable:!(r=YN(t,i))||r.enumerable});return e};var Bp=(e,t,n)=>(n=e!=null?jN(KN(e)):{},cE(t||!e||!e.__esModule?Fs(n,"default",{value:e,enumerable:!0}):n,e)),QN=e=>cE(Fs({},"__esModule",{value:!0}),e);var M=(e,t,n)=>ZN(e,typeof t!="symbol"?t+"":t,n);var fm=Bs(um=>{"use strict";Object.defineProperty(um,"__esModule",{value:!0});var lm;function cm(){if(lm===void 0)throw new Error("No runtime abstraction layer installed");return lm}(function(e){function t(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");lm=n}e.install=t})(cm||(cm={}));um.default=cm});var dm=Bs(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.boolean=nM;On.string=Pv;On.number=rM;On.error=iM;On.func=oM;On.array=Cv;On.stringArray=sM;function nM(e){return e===!0||e===!1}function Pv(e){return typeof e=="string"||e instanceof String}function rM(e){return typeof e=="number"||e instanceof Number}function iM(e){return e instanceof Error}function oM(e){return typeof e=="function"}function Cv(e){return Array.isArray(e)}function sM(e){return Cv(e)&&e.every(t=>Pv(t))}});var mm=Bs(_r=>{"use strict";var aM=_r&&_r.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_r,"__esModule",{value:!0});_r.Emitter=_r.Event=void 0;var lM=aM(fm()),Ov;(function(e){let t={dispose(){}};e.None=function(){return t}})(Ov||(_r.Event=Ov={}));var pm=class{constructor(){M(this,"_callbacks");M(this,"_contexts")}add(t,n=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(t),this._contexts.push(n),Array.isArray(r)&&r.push({dispose:()=>this.remove(t,n)})}remove(t,n=null){if(!this._callbacks)return;let r=!1;for(let i=0,o=this._callbacks.length;i<o;i++)if(this._callbacks[i]===t)if(this._contexts[i]===n){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else r=!0;if(r)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...t){if(!this._callbacks)return[];let n=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let o=0,s=r.length;o<s;o++)try{n.push(r[o].apply(i[o],t))}catch(a){(0,lM.default)().console.error(a)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Cu=class Cu{constructor(t){M(this,"_options");M(this,"_event");M(this,"_callbacks");this._options=t}get event(){return this._event||(this._event=(t,n,r)=>{this._callbacks||(this._callbacks=new pm),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(t,n);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(t,n),i.dispose=Cu._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(t){this._callbacks&&this._callbacks.invoke.call(this._callbacks,t)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};M(Cu,"_noop",function(){});var hm=Cu;_r.Emitter=hm});var $v=Bs(wt=>{"use strict";var cM=wt&&wt.__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]})),uM=wt&&wt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),fM=wt&&wt.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),i=0;i<r.length;i++)r[i]!=="default"&&cM(n,t,r[i]);return uM(n,t),n}})(),dM=wt&&wt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(wt,"__esModule",{value:!0});wt.CancellationTokenSource=wt.CancellationToken=void 0;var pM=dM(fm()),hM=fM(dm()),gm=mm(),Ou;(function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:gm.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:gm.Event.None});function t(n){let r=n;return r&&(r===e.None||r===e.Cancelled||hM.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}e.is=t})(Ou||(wt.CancellationToken=Ou={}));var mM=Object.freeze(function(e,t){let n=(0,pM.default)().timer.setTimeout(e.bind(t),0);return{dispose(){n.dispose()}}}),$u=class{constructor(){M(this,"_isCancelled",!1);M(this,"_emitter")}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?mM:(this._emitter||(this._emitter=new gm.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},ym=class{constructor(){M(this,"_token")}get token(){return this._token||(this._token=new $u),this._token}cancel(){this._token?this._token.cancel():this._token=Ou.Cancelled}dispose(){this._token?this._token instanceof $u&&this._token.dispose():this._token=Ou.None}};wt.CancellationTokenSource=ym});var Mv=Bs(te=>{"use strict";var gM=te&&te.__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]})),yM=te&&te.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),xM=te&&te.__importStar||(function(){var e=function(t){return e=Object.getOwnPropertyNames||function(n){var r=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[r.length]=i);return r},e(t)};return function(t){if(t&&t.__esModule)return t;var n={};if(t!=null)for(var r=e(t),i=0;i<r.length;i++)r[i]!=="default"&&gM(n,t,r[i]);return yM(n,t),n}})();Object.defineProperty(te,"__esModule",{value:!0});te.Message=te.NotificationType9=te.NotificationType8=te.NotificationType7=te.NotificationType6=te.NotificationType5=te.NotificationType4=te.NotificationType3=te.NotificationType2=te.NotificationType1=te.NotificationType0=te.NotificationType=te.RequestType9=te.RequestType8=te.RequestType7=te.RequestType6=te.RequestType5=te.RequestType4=te.RequestType3=te.RequestType2=te.RequestType1=te.RequestType=te.RequestType0=te.AbstractMessageSignature=te.ParameterStructures=te.ResponseError=te.ErrorCodes=void 0;var pi=xM(dm()),xm;(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})(xm||(te.ErrorCodes=xm={}));var Em=class e extends Error{constructor(n,r,i){super(r);M(this,"code");M(this,"data");this.code=pi.number(n)?n:xm.UnknownErrorCode,this.data=i,Object.setPrototypeOf(this,e.prototype)}toJson(){let n={code:this.code,message:this.message};return this.data!==void 0&&(n.data=this.data),n}};te.ResponseError=Em;var Vt=class Vt{constructor(t){M(this,"kind");this.kind=t}static is(t){return t===Vt.auto||t===Vt.byName||t===Vt.byPosition}toString(){return this.kind}};M(Vt,"auto",new Vt("auto")),M(Vt,"byPosition",new Vt("byPosition")),M(Vt,"byName",new Vt("byName"));var vr=Vt;te.ParameterStructures=vr;var Ce=class{constructor(t,n){M(this,"method");M(this,"numberOfParams");this.method=t,this.numberOfParams=n}get parameterStructures(){return vr.auto}};te.AbstractMessageSignature=Ce;var wm=class extends Ce{constructor(n){super(n,0);M(this,"_")}};te.RequestType0=wm;var Tm=class extends Ce{constructor(n,r=vr.auto){super(n,1);M(this,"_parameterStructures");M(this,"_");this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};te.RequestType=Tm;var _m=class extends Ce{constructor(n,r=vr.auto){super(n,1);M(this,"_parameterStructures");M(this,"_");this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};te.RequestType1=_m;var vm=class extends Ce{constructor(n){super(n,2);M(this,"_")}};te.RequestType2=vm;var Am=class extends Ce{constructor(n){super(n,3);M(this,"_")}};te.RequestType3=Am;var km=class extends Ce{constructor(n){super(n,4);M(this,"_")}};te.RequestType4=km;var Im=class extends Ce{constructor(n){super(n,5);M(this,"_")}};te.RequestType5=Im;var Rm=class extends Ce{constructor(n){super(n,6);M(this,"_")}};te.RequestType6=Rm;var Sm=class extends Ce{constructor(n){super(n,7);M(this,"_")}};te.RequestType7=Sm;var bm=class extends Ce{constructor(n){super(n,8);M(this,"_")}};te.RequestType8=bm;var Nm=class extends Ce{constructor(n){super(n,9);M(this,"_")}};te.RequestType9=Nm;var Lm=class extends Ce{constructor(n,r=vr.auto){super(n,1);M(this,"_parameterStructures");M(this,"_");this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};te.NotificationType=Lm;var Pm=class extends Ce{constructor(n){super(n,0);M(this,"_")}};te.NotificationType0=Pm;var Cm=class extends Ce{constructor(n,r=vr.auto){super(n,1);M(this,"_parameterStructures");M(this,"_");this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};te.NotificationType1=Cm;var Om=class extends Ce{constructor(n){super(n,2);M(this,"_")}};te.NotificationType2=Om;var $m=class extends Ce{constructor(n){super(n,3);M(this,"_")}};te.NotificationType3=$m;var Dm=class extends Ce{constructor(n){super(n,4);M(this,"_")}};te.NotificationType4=Dm;var Mm=class extends Ce{constructor(n){super(n,5);M(this,"_")}};te.NotificationType5=Mm;var Fm=class extends Ce{constructor(n){super(n,6);M(this,"_")}};te.NotificationType6=Fm;var Bm=class extends Ce{constructor(n){super(n,7);M(this,"_")}};te.NotificationType7=Bm;var Wm=class extends Ce{constructor(n){super(n,8);M(this,"_")}};te.NotificationType8=Wm;var Xm=class extends Ce{constructor(n){super(n,9);M(this,"_")}};te.NotificationType9=Xm;var Dv;(function(e){function t(i){let o=i;return o&&pi.string(o.method)&&(pi.string(o.id)||pi.number(o.id))}e.isRequest=t;function n(i){let o=i;return o&&pi.string(o.method)&&i.id===void 0}e.isNotification=n;function r(i){let o=i;return o&&(o.result!==void 0||!!o.error)&&(pi.string(o.id)||pi.number(o.id)||o.id===null)}e.isResponse=r})(Dv||(te.Message=Dv={}))});var xI={};Fp(xI,{nodeReadFile:()=>l2});async function l2(){throw new Error("nowline: filesystem readers are unavailable in the browser embed")}var EI=JN(()=>{});var LU={};Fp(LU,{EmbedRenderError:()=>Ul,__resetForTests:()=>NU,init:()=>oE,initialize:()=>IU,parse:()=>SU,render:()=>RU,run:()=>bU,sha:()=>AU,version:()=>vU});function Ue(e){return typeof e=="object"&&e!==null&&typeof e.$type=="string"}function it(e){return typeof e=="object"&&e!==null&&typeof e.$refText=="string"&&"ref"in e}function Ct(e){return typeof e=="object"&&e!==null&&typeof e.$refText=="string"&&"items"in e}function uE(e){return typeof e=="object"&&e!==null&&typeof e.name=="string"&&typeof e.type=="string"&&typeof e.path=="string"}function Gi(e){return typeof e=="object"&&e!==null&&typeof e.info=="object"&&typeof e.message=="string"}var Ui=class{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(t){let n=this.types[t.container.$type];if(!n)throw new Error(`Type ${t.container.$type||"undefined"} not found.`);let r=n.properties[t.property]?.referenceType;if(!r)throw new Error(`Property ${t.property||"undefined"} of type ${t.container.$type} is not a reference.`);return r}getTypeMetaData(t){let n=this.types[t];return n||{name:t,properties:{},superTypes:[]}}isInstance(t,n){return Ue(t)&&this.isSubtype(t.$type,n)}isSubtype(t,n){if(t===n)return!0;let r=this.subtypes[t];r||(r=this.subtypes[t]={});let i=r[n];if(i!==void 0)return i;{let o=this.types[t],s=o?o.superTypes.some(a=>this.isSubtype(a,n)):!1;return r[n]=s,s}}getAllSubTypes(t){let n=this.allSubtypes[t];if(n)return n;{let r=this.getAllTypes(),i=[];for(let o of r)this.isSubtype(o,t)&&i.push(o);return this.allSubtypes[t]=i,i}}isComplete(t){let n=this.getTypeMetaData(t.$type);for(let r of Object.keys(n.properties)){let i=n.properties[r];if(i.optional)continue;let o=t[i.name];if(o==null)return!1}return!0}};function Qn(e){return typeof e=="object"&&e!==null&&Array.isArray(e.content)}function Vl(e){return typeof e=="object"&&e!==null&&typeof e.tokenType=="object"}function Kl(e){return Qn(e)&&typeof e.fullText=="string"}var Ut=class e{constructor(t,n){this.startFn=t,this.nextFn=n}iterator(){let t={state:this.startFn(),next:()=>this.nextFn(t.state),[Symbol.iterator]:()=>t};return t}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){let t=this.iterator(),n=0,r=t.next();for(;!r.done;)n++,r=t.next();return n}toArray(){let t=[],n=this.iterator(),r;do r=n.next(),r.value!==void 0&&t.push(r.value);while(!r.done);return t}toSet(){return new Set(this)}toMap(t,n){let r=this.map(i=>[t?t(i):i,n?n(i):i]);return new Map(r)}toString(){return this.join()}concat(t){return new e(()=>({first:this.startFn(),firstDone:!1,iterator:t[Symbol.iterator]()}),n=>{let r;if(!n.firstDone){do if(r=this.nextFn(n.first),!r.done)return r;while(!r.done);n.firstDone=!0}do if(r=n.iterator.next(),!r.done)return r;while(!r.done);return gt})}join(t=","){let n=this.iterator(),r="",i,o=!1;do i=n.next(),i.done||(o&&(r+=t),r+=tL(i.value)),o=!0;while(!i.done);return r}indexOf(t,n=0){let r=this.iterator(),i=0,o=r.next();for(;!o.done;){if(i>=n&&o.value===t)return i;o=r.next(),i++}return-1}every(t){let n=this.iterator(),r=n.next();for(;!r.done;){if(!t(r.value))return!1;r=n.next()}return!0}some(t){let n=this.iterator(),r=n.next();for(;!r.done;){if(t(r.value))return!0;r=n.next()}return!1}forEach(t){let n=this.iterator(),r=0,i=n.next();for(;!i.done;)t(i.value,r),i=n.next(),r++}map(t){return new e(this.startFn,n=>{let{done:r,value:i}=this.nextFn(n);return r?gt:{done:!1,value:t(i)}})}filter(t){return new e(this.startFn,n=>{let r;do if(r=this.nextFn(n),!r.done&&t(r.value))return r;while(!r.done);return gt})}nonNullable(){return this.filter(t=>t!=null)}reduce(t,n){let r=this.iterator(),i=n,o=r.next();for(;!o.done;)i===void 0?i=o.value:i=t(i,o.value),o=r.next();return i}reduceRight(t,n){return this.recursiveReduce(this.iterator(),t,n)}recursiveReduce(t,n,r){let i=t.next();if(i.done)return r;let o=this.recursiveReduce(t,n,r);return o===void 0?i.value:n(o,i.value)}find(t){let n=this.iterator(),r=n.next();for(;!r.done;){if(t(r.value))return r.value;r=n.next()}}findIndex(t){let n=this.iterator(),r=0,i=n.next();for(;!i.done;){if(t(i.value))return r;i=n.next(),r++}return-1}includes(t){let n=this.iterator(),r=n.next();for(;!r.done;){if(r.value===t)return!0;r=n.next()}return!1}flatMap(t){return new e(()=>({this:this.startFn()}),n=>{do{if(n.iterator){let o=n.iterator.next();if(o.done)n.iterator=void 0;else return o}let{done:r,value:i}=this.nextFn(n.this);if(!r){let o=t(i);if(ql(o))n.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}}while(n.iterator);return gt})}flat(t){if(t===void 0&&(t=1),t<=0)return this;let n=t>1?this.flat(t-1):this;return new e(()=>({this:n.startFn()}),r=>{do{if(r.iterator){let s=r.iterator.next();if(s.done)r.iterator=void 0;else return s}let{done:i,value:o}=n.nextFn(r.this);if(!i)if(ql(o))r.iterator=o[Symbol.iterator]();else return{done:!1,value:o}}while(r.iterator);return gt})}head(){let n=this.iterator().next();if(!n.done)return n.value}tail(t=1){return new e(()=>{let n=this.startFn();for(let r=0;r<t;r++)if(this.nextFn(n).done)return n;return n},this.nextFn)}limit(t){return new e(()=>({size:0,state:this.startFn()}),n=>(n.size++,n.size>t?gt:this.nextFn(n.state)))}distinct(t){return new e(()=>({set:new Set,internalState:this.startFn()}),n=>{let r;do if(r=this.nextFn(n.internalState),!r.done){let i=t?t(r.value):r.value;if(!n.set.has(i))return n.set.add(i),r}while(!r.done);return gt})}exclude(t,n){let r=new Set;for(let i of t){let o=n?n(i):i;r.add(o)}return this.filter(i=>{let o=n?n(i):i;return!r.has(o)})}};function tL(e){return typeof e=="string"?e:typeof e>"u"?"undefined":typeof e.toString=="function"?e.toString():Object.prototype.toString.call(e)}function ql(e){return!!e&&typeof e[Symbol.iterator]=="function"}var Jl=new Ut(()=>{},()=>gt),gt=Object.freeze({done:!0,value:void 0});function ye(...e){if(e.length===1){let t=e[0];if(t instanceof Ut)return t;if(ql(t))return new Ut(()=>t[Symbol.iterator](),n=>n.next());if(typeof t.length=="number")return new Ut(()=>({index:0}),n=>n.index<t.length?{done:!1,value:t[n.index++]}:gt)}return e.length>1?new Ut(()=>({collIndex:0,arrIndex:0}),t=>{do{if(t.iterator){let n=t.iterator.next();if(!n.done)return n;t.iterator=void 0}if(t.array){if(t.arrIndex<t.array.length)return{done:!1,value:t.array[t.arrIndex++]};t.array=void 0,t.arrIndex=0}if(t.collIndex<e.length){let n=e[t.collIndex++];ql(n)?t.iterator=n[Symbol.iterator]():n&&typeof n.length=="number"&&(t.array=n)}}while(t.iterator||t.array||t.collIndex<e.length);return gt}):Jl}var er=class extends Ut{constructor(t,n,r){super(()=>({iterators:r?.includeRoot?[[t][Symbol.iterator]()]:[n(t)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){let s=i.iterators[i.iterators.length-1].next();if(s.done)i.iterators.pop();else return i.iterators.push(n(s.value)[Symbol.iterator]()),s}return gt})}iterator(){let t={state:this.startFn(),next:()=>this.nextFn(t.state),prune:()=>{t.state.pruned=!0},[Symbol.iterator]:()=>t};return t}},Zl;(function(e){function t(o){return o.reduce((s,a)=>s+a,0)}e.sum=t;function n(o){return o.reduce((s,a)=>s*a,0)}e.product=n;function r(o){return o.reduce((s,a)=>Math.min(s,a))}e.min=r;function i(o){return o.reduce((s,a)=>Math.max(s,a))}e.max=i})(Zl||(Zl={}));function Ql(e,t={}){for(let[n,r]of Object.entries(e))n.startsWith("$")||(Array.isArray(r)?r.forEach((i,o)=>{Ue(i)&&(i.$container=e,i.$containerProperty=n,i.$containerIndex=o,t.deep&&Ql(i,t))}):Ue(r)&&(r.$container=e,r.$containerProperty=n,t.deep&&Ql(r,t)))}function Hi(e,t){let n=e;for(;n;){if(t(n))return n;n=n.$container}}function at(e){let n=Ws(e).$document;if(!n)throw new Error("AST node has no document.");return n}function Ws(e){for(;e.$container;)e=e.$container;return e}function Xp(e){return it(e)?e.ref?[e.ref]:[]:Ct(e)?e.items.map(t=>t.ref):[]}function ec(e,t){if(!e)throw new Error("Node must be an AstNode.");let n=t?.range;return new Ut(()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0}),r=>{for(;r.keyIndex<r.keys.length;){let i=r.keys[r.keyIndex];if(!i.startsWith("$")){let o=e[i];if(Ue(o)){if(r.keyIndex++,Wp(o,n))return{done:!1,value:o}}else if(Array.isArray(o)){for(;r.arrayIndex<o.length;){let s=r.arrayIndex++,a=o[s];if(Ue(a)&&Wp(a,n))return{done:!1,value:a}}r.arrayIndex=0}}r.keyIndex++}return gt})}function sn(e,t){if(!e)throw new Error("Root node must be an AstNode.");return new er(e,n=>ec(n,t))}function yt(e,t){if(e){if(t?.range&&!Wp(e,t.range))return new er(e,()=>[])}else throw new Error("Root node must be an AstNode.");return new er(e,n=>ec(n,t),{includeRoot:!0})}function Wp(e,t){if(!t)return!0;let n=e.$cstNode?.range;return n?pE(n,t):!1}function Gr(e){return new Ut(()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0}),t=>{for(;t.keyIndex<t.keys.length;){let n=t.keys[t.keyIndex];if(!n.startsWith("$")){let r=e[n];if(it(r)||Ct(r))return t.keyIndex++,{done:!1,value:{reference:r,container:e,property:n}};if(Array.isArray(r)){for(;t.arrayIndex<r.length;){let i=t.arrayIndex++,o=r[i];if(it(o)||Ct(o))return{done:!1,value:{reference:o,container:e,property:n,index:i}}}t.arrayIndex=0}}t.keyIndex++}return gt})}function fE(e,t){let n=e.getTypeMetaData(t.$type),r=t;for(let i of Object.values(n.properties))i.defaultValue!==void 0&&r[i.name]===void 0&&(r[i.name]=dE(i.defaultValue))}function dE(e){return Array.isArray(e)?[...e.map(dE)]:e}var Rt={$type:"AbstractElement",cardinality:"cardinality"};function fc(e){return he.isInstance(e,Rt.$type)}var ic={$type:"AbstractParserRule"};function nr(e){return he.isInstance(e,ic.$type)}var tc={$type:"AbstractRule"};var Gt={$type:"AbstractType"};var zr={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function rr(e){return he.isInstance(e,zr.$type)}var oc={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function Zp(e){return he.isInstance(e,oc.$type)}var hE={$type:"ArrayLiteral",elements:"elements"};var Gp={$type:"ArrayType",elementType:"elementType"};function EE(e){return he.isInstance(e,Gp.$type)}var jr={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function ln(e){return he.isInstance(e,jr.$type)}var Hp={$type:"BooleanLiteral",true:"true"};function wE(e){return he.isInstance(e,Hp.$type)}var Yr={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function TE(e){return he.isInstance(e,Yr.$type)}var zi={$type:"Condition"};var sc={$type:"Conjunction",left:"left",right:"right"};function _E(e){return he.isInstance(e,sc.$type)}var Vr={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function cn(e){return he.isInstance(e,Vr.$type)}var ac={$type:"Disjunction",left:"left",right:"right"};function vE(e){return he.isInstance(e,ac.$type)}var zp={$type:"EndOfFile",cardinality:"cardinality"};function AE(e){return he.isInstance(e,zp.$type)}var Hr={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};var mE={$type:"GrammarImport",path:"path"};var ji={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function Kr(e){return he.isInstance(e,ji.$type)}var jp={$type:"InferredType",name:"name"};function dc(e){return he.isInstance(e,jp.$type)}var wn={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function qr(e){return he.isInstance(e,wn.$type)}var Up={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};var gE={$type:"InfixRuleOperators",precedences:"precedences"};var Hs={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function kE(e){return he.isInstance(e,Hs.$type)}var zs={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function Ht(e){return he.isInstance(e,zs.$type)}var nc={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};var Yi={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function IE(e){return he.isInstance(e,Yi.$type)}var Yp={$type:"Negation",value:"value"};function RE(e){return he.isInstance(e,Yp.$type)}var yE={$type:"NumberLiteral",value:"value"};var rc={$type:"Parameter",name:"name"};var Vp={$type:"ParameterReference",parameter:"parameter"};function SE(e){return he.isInstance(e,Vp.$type)}var an={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function lt(e){return he.isInstance(e,an.$type)}var lc={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function bE(e){return he.isInstance(e,lc.$type)}var Vi={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function NE(e){return he.isInstance(e,Vi.$type)}var Kp={$type:"ReturnType",name:"name"};function LE(e){return he.isInstance(e,Kp.$type)}var Ki={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function un(e){return he.isInstance(e,Ki.$type)}var js={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function Jp(e){return he.isInstance(e,js.$type)}var xE={$type:"StringLiteral",value:"value"};var qi={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function PE(e){return he.isInstance(e,qi.$type)}var Ot={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};var Zi={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function CE(e){return he.isInstance(e,Zi.$type)}var tr={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function xt(e){return he.isInstance(e,tr.$type)}var Ji={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function Qp(e){return he.isInstance(e,Ji.$type)}var cc={$type:"Type",name:"name",type:"type"};function eh(e){return he.isInstance(e,cc.$type)}var Xs={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};var Us={$type:"TypeDefinition"};var qp={$type:"UnionType",types:"types"};function OE(e){return he.isInstance(e,qp.$type)}var uc={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function th(e){return he.isInstance(e,uc.$type)}var Qi={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function $E(e){return he.isInstance(e,Qi.$type)}var Gs={$type:"ValueLiteral"};var Ys={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function DE(e){return he.isInstance(e,Ys.$type)}var Vs=class extends Ui{constructor(){super(...arguments),this.types={AbstractElement:{name:Rt.$type,properties:{cardinality:{name:Rt.cardinality,optional:!0}},superTypes:[]},AbstractParserRule:{name:ic.$type,properties:{},superTypes:[tc.$type,Gt.$type]},AbstractRule:{name:tc.$type,properties:{},superTypes:[]},AbstractType:{name:Gt.$type,properties:{},superTypes:[]},Action:{name:zr.$type,properties:{cardinality:{name:zr.cardinality,optional:!0},feature:{name:zr.feature,optional:!0},inferredType:{name:zr.inferredType,optional:!0},operator:{name:zr.operator,optional:!0},type:{name:zr.type,referenceType:Gt.$type,optional:!0}},superTypes:[Rt.$type]},Alternatives:{name:oc.$type,properties:{cardinality:{name:oc.cardinality,optional:!0},elements:{name:oc.elements,defaultValue:[]}},superTypes:[Rt.$type]},ArrayLiteral:{name:hE.$type,properties:{elements:{name:hE.elements,defaultValue:[]}},superTypes:[Gs.$type]},ArrayType:{name:Gp.$type,properties:{elementType:{name:Gp.elementType}},superTypes:[Us.$type]},Assignment:{name:jr.$type,properties:{cardinality:{name:jr.cardinality,optional:!0},feature:{name:jr.feature},operator:{name:jr.operator},predicate:{name:jr.predicate,optional:!0},terminal:{name:jr.terminal}},superTypes:[Rt.$type]},BooleanLiteral:{name:Hp.$type,properties:{true:{name:Hp.true,defaultValue:!1}},superTypes:[zi.$type,Gs.$type]},CharacterRange:{name:Yr.$type,properties:{cardinality:{name:Yr.cardinality,optional:!0},left:{name:Yr.left},lookahead:{name:Yr.lookahead,optional:!0},parenthesized:{name:Yr.parenthesized,defaultValue:!1,optional:!0},right:{name:Yr.right,optional:!0}},superTypes:[Ot.$type]},Condition:{name:zi.$type,properties:{},superTypes:[]},Conjunction:{name:sc.$type,properties:{left:{name:sc.left},right:{name:sc.right}},superTypes:[zi.$type]},CrossReference:{name:Vr.$type,properties:{cardinality:{name:Vr.cardinality,optional:!0},deprecatedSyntax:{name:Vr.deprecatedSyntax,defaultValue:!1},isMulti:{name:Vr.isMulti,defaultValue:!1},terminal:{name:Vr.terminal,optional:!0},type:{name:Vr.type,referenceType:Gt.$type}},superTypes:[Rt.$type]},Disjunction:{name:ac.$type,properties:{left:{name:ac.left},right:{name:ac.right}},superTypes:[zi.$type]},EndOfFile:{name:zp.$type,properties:{cardinality:{name:zp.cardinality,optional:!0}},superTypes:[Rt.$type]},Grammar:{name:Hr.$type,properties:{imports:{name:Hr.imports,defaultValue:[]},interfaces:{name:Hr.interfaces,defaultValue:[]},isDeclared:{name:Hr.isDeclared,defaultValue:!1},name:{name:Hr.name,optional:!0},rules:{name:Hr.rules,defaultValue:[]},types:{name:Hr.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:mE.$type,properties:{path:{name:mE.path}},superTypes:[]},Group:{name:ji.$type,properties:{cardinality:{name:ji.cardinality,optional:!0},elements:{name:ji.elements,defaultValue:[]},guardCondition:{name:ji.guardCondition,optional:!0},predicate:{name:ji.predicate,optional:!0}},superTypes:[Rt.$type]},InferredType:{name:jp.$type,properties:{name:{name:jp.name}},superTypes:[Gt.$type]},InfixRule:{name:wn.$type,properties:{call:{name:wn.call},dataType:{name:wn.dataType,optional:!0},inferredType:{name:wn.inferredType,optional:!0},name:{name:wn.name},operators:{name:wn.operators},parameters:{name:wn.parameters,defaultValue:[]},returnType:{name:wn.returnType,referenceType:Gt.$type,optional:!0}},superTypes:[ic.$type]},InfixRuleOperatorList:{name:Up.$type,properties:{associativity:{name:Up.associativity,optional:!0},operators:{name:Up.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:gE.$type,properties:{precedences:{name:gE.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:Hs.$type,properties:{attributes:{name:Hs.attributes,defaultValue:[]},name:{name:Hs.name},superTypes:{name:Hs.superTypes,defaultValue:[],referenceType:Gt.$type}},superTypes:[Gt.$type]},Keyword:{name:zs.$type,properties:{cardinality:{name:zs.cardinality,optional:!0},predicate:{name:zs.predicate,optional:!0},value:{name:zs.value}},superTypes:[Rt.$type]},NamedArgument:{name:nc.$type,properties:{calledByName:{name:nc.calledByName,defaultValue:!1},parameter:{name:nc.parameter,referenceType:rc.$type,optional:!0},value:{name:nc.value}},superTypes:[]},NegatedToken:{name:Yi.$type,properties:{cardinality:{name:Yi.cardinality,optional:!0},lookahead:{name:Yi.lookahead,optional:!0},parenthesized:{name:Yi.parenthesized,defaultValue:!1,optional:!0},terminal:{name:Yi.terminal}},superTypes:[Ot.$type]},Negation:{name:Yp.$type,properties:{value:{name:Yp.value}},superTypes:[zi.$type]},NumberLiteral:{name:yE.$type,properties:{value:{name:yE.value}},superTypes:[Gs.$type]},Parameter:{name:rc.$type,properties:{name:{name:rc.name}},superTypes:[]},ParameterReference:{name:Vp.$type,properties:{parameter:{name:Vp.parameter,referenceType:rc.$type}},superTypes:[zi.$type]},ParserRule:{name:an.$type,properties:{dataType:{name:an.dataType,optional:!0},definition:{name:an.definition},entry:{name:an.entry,defaultValue:!1},fragment:{name:an.fragment,defaultValue:!1},inferredType:{name:an.inferredType,optional:!0},name:{name:an.name},parameters:{name:an.parameters,defaultValue:[]},returnType:{name:an.returnType,referenceType:Gt.$type,optional:!0}},superTypes:[ic.$type]},ReferenceType:{name:lc.$type,properties:{isMulti:{name:lc.isMulti,defaultValue:!1},referenceType:{name:lc.referenceType}},superTypes:[Us.$type]},RegexToken:{name:Vi.$type,properties:{cardinality:{name:Vi.cardinality,optional:!0},lookahead:{name:Vi.lookahead,optional:!0},parenthesized:{name:Vi.parenthesized,defaultValue:!1,optional:!0},regex:{name:Vi.regex}},superTypes:[Ot.$type]},ReturnType:{name:Kp.$type,properties:{name:{name:Kp.name}},superTypes:[]},RuleCall:{name:Ki.$type,properties:{arguments:{name:Ki.arguments,defaultValue:[]},cardinality:{name:Ki.cardinality,optional:!0},predicate:{name:Ki.predicate,optional:!0},rule:{name:Ki.rule,referenceType:tc.$type}},superTypes:[Rt.$type]},SimpleType:{name:js.$type,properties:{primitiveType:{name:js.primitiveType,optional:!0},stringType:{name:js.stringType,optional:!0},typeRef:{name:js.typeRef,referenceType:Gt.$type,optional:!0}},superTypes:[Us.$type]},StringLiteral:{name:xE.$type,properties:{value:{name:xE.value}},superTypes:[Gs.$type]},TerminalAlternatives:{name:qi.$type,properties:{cardinality:{name:qi.cardinality,optional:!0},elements:{name:qi.elements,defaultValue:[]},lookahead:{name:qi.lookahead,optional:!0},parenthesized:{name:qi.parenthesized,defaultValue:!1,optional:!0}},superTypes:[Ot.$type]},TerminalElement:{name:Ot.$type,properties:{cardinality:{name:Ot.cardinality,optional:!0},lookahead:{name:Ot.lookahead,optional:!0},parenthesized:{name:Ot.parenthesized,defaultValue:!1,optional:!0}},superTypes:[Rt.$type]},TerminalGroup:{name:Zi.$type,properties:{cardinality:{name:Zi.cardinality,optional:!0},elements:{name:Zi.elements,defaultValue:[]},lookahead:{name:Zi.lookahead,optional:!0},parenthesized:{name:Zi.parenthesized,defaultValue:!1,optional:!0}},superTypes:[Ot.$type]},TerminalRule:{name:tr.$type,properties:{definition:{name:tr.definition},fragment:{name:tr.fragment,defaultValue:!1},hidden:{name:tr.hidden,defaultValue:!1},name:{name:tr.name},type:{name:tr.type,optional:!0}},superTypes:[tc.$type]},TerminalRuleCall:{name:Ji.$type,properties:{cardinality:{name:Ji.cardinality,optional:!0},lookahead:{name:Ji.lookahead,optional:!0},parenthesized:{name:Ji.parenthesized,defaultValue:!1,optional:!0},rule:{name:Ji.rule,referenceType:tr.$type}},superTypes:[Ot.$type]},Type:{name:cc.$type,properties:{name:{name:cc.name},type:{name:cc.type}},superTypes:[Gt.$type]},TypeAttribute:{name:Xs.$type,properties:{defaultValue:{name:Xs.defaultValue,optional:!0},isOptional:{name:Xs.isOptional,defaultValue:!1},name:{name:Xs.name},type:{name:Xs.type}},superTypes:[]},TypeDefinition:{name:Us.$type,properties:{},superTypes:[]},UnionType:{name:qp.$type,properties:{types:{name:qp.types,defaultValue:[]}},superTypes:[Us.$type]},UnorderedGroup:{name:uc.$type,properties:{cardinality:{name:uc.cardinality,optional:!0},elements:{name:uc.elements,defaultValue:[]}},superTypes:[Rt.$type]},UntilToken:{name:Qi.$type,properties:{cardinality:{name:Qi.cardinality,optional:!0},lookahead:{name:Qi.lookahead,optional:!0},parenthesized:{name:Qi.parenthesized,defaultValue:!1,optional:!0},terminal:{name:Qi.terminal}},superTypes:[Ot.$type]},ValueLiteral:{name:Gs.$type,properties:{},superTypes:[]},Wildcard:{name:Ys.$type,properties:{cardinality:{name:Ys.cardinality,optional:!0},lookahead:{name:Ys.lookahead,optional:!0},parenthesized:{name:Ys.parenthesized,defaultValue:!1,optional:!0}},superTypes:[Ot.$type]}}}},he=new Vs;function Ks(e){return new er(e,t=>Qn(t)?t.content:[],{includeRoot:!0})}function BE(e,t){for(;e.container;)if(e=e.container,e===t)return!0;return!1}function WE(e){return{start:{line:e.startLine-1,character:e.startColumn-1},end:{line:e.endLine-1,character:e.endColumn}}}function qs(e){let{startOffset:t,endOffset:n}=e;return typeof t=="number"&&Number.isFinite(t)&&t>=0&&typeof n=="number"&&Number.isFinite(n)&&n>=t}function eo(e){if(!e)return;let{offset:t,end:n,range:r}=e;return{range:r,offset:t,end:n,length:n-t}}var Tn;(function(e){e[e.Before=0]="Before",e[e.After=1]="After",e[e.OverlapFront=2]="OverlapFront",e[e.OverlapBack=3]="OverlapBack",e[e.Inside=4]="Inside",e[e.Outside=5]="Outside"})(Tn||(Tn={}));function nL(e,t){if(e.end.line<t.start.line||e.end.line===t.start.line&&e.end.character<=t.start.character)return Tn.Before;if(e.start.line>t.end.line||e.start.line===t.end.line&&e.start.character>=t.end.character)return Tn.After;let n=e.start.line>t.start.line||e.start.line===t.start.line&&e.start.character>=t.start.character,r=e.end.line<t.end.line||e.end.line===t.end.line&&e.end.character<=t.end.character;return n&&r?Tn.Inside:n?Tn.OverlapBack:r?Tn.OverlapFront:Tn.Outside}function pE(e,t){return nL(e,t)>Tn.After}var XE=/^[\w\p{L}]$/u;function UE(e,t){if(e){let n=rL(e,!0);if(n&&FE(n,t))return n;if(Kl(e)){let r=e.content.findIndex(i=>!i.hidden);for(let i=r-1;i>=0;i--){let o=e.content[i];if(FE(o,t))return o}}}}function FE(e,t){return Vl(e)&&t.includes(e.tokenType.name)}function rL(e,t=!0){for(;e.container;){let n=e.container,r=n.content.indexOf(e);for(;r>0;){r--;let i=n.content[r];if(t||!i.hidden)return i}e=n}}var xc={};Fp(xc,{findAssignment:()=>hh,findNameAssignment:()=>gc,findNodeForKeyword:()=>dh,findNodeForProperty:()=>na,findNodesForKeyword:()=>uL,findNodesForKeywordInternal:()=>ph,findNodesForProperty:()=>uh,getActionAtElement:()=>qE,getActionType:()=>JE,getAllReachableRules:()=>ta,getAllRulesUsedForCrossReferences:()=>cL,getCrossReferenceTerminal:()=>lh,getEntryRule:()=>jE,getExplicitRuleType:()=>yc,getHiddenRules:()=>YE,getRuleType:()=>mh,getRuleTypeName:()=>mL,getTypeName:()=>or,isArrayCardinality:()=>dL,isArrayOperator:()=>pL,isCommentTerminal:()=>ch,isDataType:()=>hL,isDataTypeRule:()=>ra,isOptionalCardinality:()=>fL,terminalRegex:()=>no});var Zs=class extends Error{constructor(t,n){let r=typeof n=="string"?n:n();super(t?`${r} at ${t.range.start.line}:${t.range.start.character}`:r)}};function ir(e,t="Error: Got unexpected value."){throw new Error(typeof t=="string"?t:t())}function oe(e){return e.charCodeAt(0)}function pc(e,t){Array.isArray(e)?e.forEach(function(n){t.push(n)}):t.push(e)}function to(e,t){if(e[t]===!0)throw"duplicate flag "+t;let n=e[t];e[t]=!0}function Zr(e){if(e===void 0)throw Error("Internal Error - Should never get here!");return!0}function Js(){throw Error("Internal Error - Should never get here!")}function nh(e){return e.type==="Character"}var Qs=[];for(let e=oe("0");e<=oe("9");e++)Qs.push(e);var ea=[oe("_")].concat(Qs);for(let e=oe("a");e<=oe("z");e++)ea.push(e);for(let e=oe("A");e<=oe("Z");e++)ea.push(e);var rh=[oe(" "),oe("\f"),oe(`
|
|
3
|
+
`),oe("\r"),oe(" "),oe("\v"),oe(" "),oe("\xA0"),oe("\u1680"),oe("\u2000"),oe("\u2001"),oe("\u2002"),oe("\u2003"),oe("\u2004"),oe("\u2005"),oe("\u2006"),oe("\u2007"),oe("\u2008"),oe("\u2009"),oe("\u200A"),oe("\u2028"),oe("\u2029"),oe("\u202F"),oe("\u205F"),oe("\u3000"),oe("\uFEFF")];var iL=/[0-9a-fA-F]/,hc=/[0-9]/,oL=/[1-9]/,Jr=class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(t){this.idx=t.idx,this.input=t.input,this.groupIdx=t.groupIdx}pattern(t){this.idx=0,this.input=t,this.groupIdx=0,this.consumeChar("/");let n=this.disjunction();this.consumeChar("/");let r={type:"Flags",loc:{begin:this.idx,end:t.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":to(r,"global");break;case"i":to(r,"ignoreCase");break;case"m":to(r,"multiLine");break;case"u":to(r,"unicode");break;case"y":to(r,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:r,value:n,loc:this.loc(0)}}disjunction(){let t=[],n=this.idx;for(t.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),t.push(this.alternative());return{type:"Disjunction",value:t,loc:this.loc(n)}}alternative(){let t=[],n=this.idx;for(;this.isTerm();)t.push(this.term());return{type:"Alternative",value:t,loc:this.loc(n)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){let t=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(t)};case"$":return{type:"EndAnchor",loc:this.loc(t)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(t)};case"B":return{type:"NonWordBoundary",loc:this.loc(t)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let n;switch(this.popChar()){case"=":n="Lookahead";break;case"!":n="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":n="Lookbehind";break;case"!":n="NegativeLookbehind"}break}}Zr(n);let r=this.disjunction();return this.consumeChar(")"),{type:n,value:r,loc:this.loc(t)}}return Js()}quantifier(t=!1){let n,r=this.idx;switch(this.popChar()){case"*":n={atLeast:0,atMost:1/0};break;case"+":n={atLeast:1,atMost:1/0};break;case"?":n={atLeast:0,atMost:1};break;case"{":let i=this.integerIncludingZero();switch(this.popChar()){case"}":n={atLeast:i,atMost:i};break;case",":let o;this.isDigit()?(o=this.integerIncludingZero(),n={atLeast:i,atMost:o}):n={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(t===!0&&n===void 0)return;Zr(n);break}if(!(t===!0&&n===void 0)&&Zr(n))return this.peekChar(0)==="?"?(this.consumeChar("?"),n.greedy=!1):n.greedy=!0,n.type="Quantifier",n.loc=this.loc(r),n}atom(){let t,n=this.idx;switch(this.peekChar()){case".":t=this.dotAll();break;case"\\":t=this.atomEscape();break;case"[":t=this.characterClass();break;case"(":t=this.group();break}return t===void 0&&this.isPatternCharacter()&&(t=this.patternCharacter()),Zr(t)?(t.loc=this.loc(n),this.isQuantifier()&&(t.quantifier=this.quantifier()),t):Js()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[oe(`
|
|
4
|
+
`),oe("\r"),oe("\u2028"),oe("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let t,n=!1;switch(this.popChar()){case"d":t=Qs;break;case"D":t=Qs,n=!0;break;case"s":t=rh;break;case"S":t=rh,n=!0;break;case"w":t=ea;break;case"W":t=ea,n=!0;break}return Zr(t)?{type:"Set",value:t,complement:n}:Js()}controlEscapeAtom(){let t;switch(this.popChar()){case"f":t=oe("\f");break;case"n":t=oe(`
|
|
5
5
|
`);break;case"r":t=oe("\r");break;case"t":t=oe(" ");break;case"v":t=oe("\v");break}return Zr(t)?{type:"Character",value:t}:Js()}controlLetterEscapeAtom(){this.consumeChar("c");let t=this.popChar();if(/[a-zA-Z]/.test(t)===!1)throw Error("Invalid ");return{type:"Character",value:t.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:oe("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){let t=this.popChar();return{type:"Character",value:oe(t)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
|
|
6
|
-
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:let t=this.popChar();return{type:"Character",value:oe(t)}}}characterClass(){let t=[],n=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),n=!0);this.isClassAtom();){let r=this.classAtom(),i=r.type==="Character";if(
|
|
7
|
-
`:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:oe("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let t=!0;this.consumeChar("("),this.peekChar(0)==="?"?(this.consumeChar("?"),this.consumeChar(":"),t=!1):this.groupIdx++;let n=this.disjunction();this.consumeChar(")");let r={type:"Group",capturing:t,value:n};return t&&(r.idx=this.groupIdx),r}positiveInteger(){let t=this.popChar();if(oL.test(t)===!1)throw Error("Expecting a positive integer");for(;
|
|
8
|
-
`:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:oe(t)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return
|
|
6
|
+
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:let t=this.popChar();return{type:"Character",value:oe(t)}}}characterClass(){let t=[],n=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),n=!0);this.isClassAtom();){let r=this.classAtom(),i=r.type==="Character";if(nh(r)&&this.isRangeDash()){this.consumeChar("-");let o=this.classAtom(),s=o.type==="Character";if(nh(o)){if(o.value<r.value)throw Error("Range out of order in character class");t.push({from:r.value,to:o.value})}else pc(r.value,t),t.push(oe("-")),pc(o.value,t)}else pc(r.value,t)}return this.consumeChar("]"),{type:"Set",complement:n,value:t}}classAtom(){switch(this.peekChar()){case"]":case`
|
|
7
|
+
`:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:oe("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let t=!0;this.consumeChar("("),this.peekChar(0)==="?"?(this.consumeChar("?"),this.consumeChar(":"),t=!1):this.groupIdx++;let n=this.disjunction();this.consumeChar(")");let r={type:"Group",capturing:t,value:n};return t&&(r.idx=this.groupIdx),r}positiveInteger(){let t=this.popChar();if(oL.test(t)===!1)throw Error("Expecting a positive integer");for(;hc.test(this.peekChar(0));)t+=this.popChar();return parseInt(t,10)}integerIncludingZero(){let t=this.popChar();if(hc.test(t)===!1)throw Error("Expecting an integer");for(;hc.test(this.peekChar(0));)t+=this.popChar();return parseInt(t,10)}patternCharacter(){let t=this.popChar();switch(t){case`
|
|
8
|
+
`:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:oe(t)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return hc.test(this.peekChar(0))}isClassAtom(t=0){switch(this.peekChar(t)){case"]":case`
|
|
9
9
|
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return this.peekChar(1)==="?"&&(this.peekChar(2)==="="||this.peekChar(2)==="!"||this.peekChar(2)==="<"&&(this.peekChar(3)==="="||this.peekChar(3)==="!"));default:return!1}}isQuantifier(){let t=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(t)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
|
|
10
|
-
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(t){let n="";for(let i=0;i<t;i++){let o=this.popChar();if(iL.test(o)===!1)throw Error("Expecting a HexDecimal digits");n+=o}return{type:"Character",value:parseInt(n,16)}}peekChar(t=0){return this.input[this.idx+t]}popChar(){let t=this.peekChar(0);return this.consumeChar(void 0),t}consumeChar(t){if(t!==void 0&&this.input[this.idx]!==t)throw Error("Expected: '"+t+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(t){return{begin:t,end:this.idx}}};var
|
|
10
|
+
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(t){let n="";for(let i=0;i<t;i++){let o=this.popChar();if(iL.test(o)===!1)throw Error("Expecting a HexDecimal digits");n+=o}return{type:"Character",value:parseInt(n,16)}}peekChar(t=0){return this.input[this.idx+t]}popChar(){let t=this.peekChar(0);return this.consumeChar(void 0),t}consumeChar(t){if(t!==void 0&&this.input[this.idx]!==t)throw Error("Expected: '"+t+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(t){return{begin:t,end:this.idx}}};var fn=class{visitChildren(t){for(let n in t){let r=t[n];t.hasOwnProperty(n)&&(r.type!==void 0?this.visit(r):Array.isArray(r)&&r.forEach(i=>{this.visit(i)},this))}}visit(t){switch(t.type){case"Pattern":this.visitPattern(t);break;case"Flags":this.visitFlags(t);break;case"Disjunction":this.visitDisjunction(t);break;case"Alternative":this.visitAlternative(t);break;case"StartAnchor":this.visitStartAnchor(t);break;case"EndAnchor":this.visitEndAnchor(t);break;case"WordBoundary":this.visitWordBoundary(t);break;case"NonWordBoundary":this.visitNonWordBoundary(t);break;case"Lookahead":this.visitLookahead(t);break;case"NegativeLookahead":this.visitNegativeLookahead(t);break;case"Lookbehind":this.visitLookbehind(t);break;case"NegativeLookbehind":this.visitNegativeLookbehind(t);break;case"Character":this.visitCharacter(t);break;case"Set":this.visitSet(t);break;case"Group":this.visitGroup(t);break;case"GroupBackReference":this.visitGroupBackReference(t);break;case"Quantifier":this.visitQuantifier(t);break}this.visitChildren(t)}visitPattern(t){}visitFlags(t){}visitDisjunction(t){}visitAlternative(t){}visitStartAnchor(t){}visitEndAnchor(t){}visitWordBoundary(t){}visitNonWordBoundary(t){}visitLookahead(t){}visitNegativeLookahead(t){}visitLookbehind(t){}visitNegativeLookbehind(t){}visitCharacter(t){}visitSet(t){}visitGroup(t){}visitGroupBackReference(t){}visitQuantifier(t){}};var GE=/\r?\n/gm,sL=new Jr,oh=class extends fn{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(t){this.multiline=!1,this.regex=t,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(t){t.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(t){let n=String.fromCharCode(t.value);if(!this.multiline&&n===`
|
|
11
11
|
`&&(this.multiline=!0),t.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{let r=Qr(n);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitSet(t){if(!this.multiline){let n=this.regex.substring(t.loc.begin,t.loc.end),r=new RegExp(n);this.multiline=!!`
|
|
12
|
-
`.match(r)}if(t.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{let n=this.regex.substring(t.loc.begin,t.loc.end);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitChildren(t){t.type==="Group"&&t.quantifier||super.visitChildren(t)}},
|
|
13
|
-
\r \v \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF`.split("");function gc(e){let t=typeof e=="string"?new RegExp(e):e;return aL.some(n=>t.test(n))}function Qr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function jE(e,t){let n=lL(e),r=t.match(n);return!!r&&r[0].length>0}function lL(e){typeof e=="string"&&(e=new RegExp(e));let t=e,n=e.source,r=0;function i(){let o="",s;function a(c){o+=n.substr(r,c),r+=c}function l(c){o+="(?:"+n.substr(r,c)+"|$)",r+=c}for(;r<n.length;)switch(n[r]){case"\\":switch(n[r+1]){case"c":l(3);break;case"x":l(4);break;case"u":t.unicode?n[r+2]==="{"?l(n.indexOf("}",r)-r+1):l(6):l(2);break;case"p":case"P":t.unicode?l(n.indexOf("}",r)-r+1):l(2);break;case"k":l(n.indexOf(">",r)-r+1);break;default:l(2);break}break;case"[":s=/\[(?:\\.|.)*?\]/g,s.lastIndex=r,s=s.exec(n)||[],l(s[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":a(1);break;case"{":s=/\{\d+,?\d*\}/g,s.lastIndex=r,s=s.exec(n),s?a(s[0].length):l(1);break;case"(":if(n[r+1]==="?")switch(n[r+2]){case":":o+="(?:",r+=3,o+=i()+"|$)";break;case"=":o+="(?=",r+=3,o+=i()+")";break;case"!":s=r,r+=3,i(),o+=n.substr(s,r-s);break;case"<":switch(n[r+3]){case"=":case"!":s=r,r+=4,i(),o+=n.substr(s,r-s);break;default:a(n.indexOf(">",r)-r+1),o+=i()+"|$)";break}break}else a(1),o+=i()+"|$)";break;case")":return++r,o;default:l(1);break}return o}return new RegExp(i(),e.flags)}function YE(e){return e.rules.find(t=>lt(t)&&t.entry)}function VE(e){return e.rules.filter(t=>xt(t)&&t.hidden)}function ta(e,t){let n=new Set,r=YE(e);if(!r)return new Set(e.rules);let i=[r].concat(VE(e));for(let s of i)KE(s,n,t);let o=new Set;for(let s of e.rules)(n.has(s.name)||xt(s)&&s.hidden)&&o.add(s);return o}function KE(e,t,n){t.add(e.name),rn(e).forEach(r=>{if(ln(r)||n&&eh(r)){let i=r.rule.ref;i&&!t.has(i.name)&&KE(i,t,n)}})}function cL(e){let t=new Set;return rn(e).forEach(n=>{an(n)&&(lt(n.type.ref)&&t.add(n.type.ref),pc(n.type.ref)&<(n.type.ref.$container)&&t.add(n.type.ref.$container))}),t}function ch(e){if(e.terminal)return e.terminal;if(e.type.ref)return yc(e.type.ref)?.terminal}function uh(e){return e.hidden&&!gc(no(e))}function fh(e,t){return!e||!t?[]:dh(e,t,e.astNode,!0)}function na(e,t,n){if(!e||!t)return;let r=dh(e,t,e.astNode,!0);if(r.length!==0)return n!==void 0?n=Math.max(0,Math.min(n,r.length-1)):n=0,r[n]}function dh(e,t,n,r){if(!r){let i=Hi(e.grammarSource,sn);if(i&&i.feature===t)return[e]}return Jn(e)&&e.astNode===n?e.content.flatMap(i=>dh(i,t,n,!1)):[]}function uL(e,t){return e?hh(e,t,e?.astNode):[]}function ph(e,t,n){if(!e)return;let r=hh(e,t,e?.astNode);if(r.length!==0)return n!==void 0?n=Math.max(0,Math.min(n,r.length-1)):n=0,r[n]}function hh(e,t,n){if(e.astNode!==n)return[];if(Ht(e.grammarSource)&&e.grammarSource.value===t)return[e];let r=Ks(e).iterator(),i,o=[];do if(i=r.next(),!i.done){let s=i.value;s.astNode===n?Ht(s.grammarSource)&&s.grammarSource.value===t&&o.push(s):r.prune()}while(!i.done);return o}function mh(e){let t=e.astNode;for(;t===e.container?.astNode;){let n=Hi(e.grammarSource,sn);if(n)return n;e=e.container}}function yc(e){let t=e;return pc(t)&&(nr(t.$container)?t=t.$container.$container:tr(t.$container)?t=t.$container:rr(t.$container)),qE(e,t,new Map)}function qE(e,t,n){function r(i,o){let s;return Hi(i,sn)||(s=qE(o,o,n)),n.set(e,s),s}if(n.has(e))return n.get(e);n.set(e,void 0);for(let i of rn(t)){if(sn(i)&&i.feature.toLowerCase()==="name")return n.set(e,i),i;if(ln(i)&<(i.rule.ref))return r(i,i.rule.ref);if(Qp(i)&&i.typeRef?.ref)return r(i,i.typeRef.ref)}}function ZE(e){let t=e.$container;if(Kr(t)){let n=t.elements,r=n.indexOf(e);for(let i=r-1;i>=0;i--){let o=n[i];if(nr(o))return o;{let s=rn(n[i]).find(nr);if(s)return s}}}if(dc(t))return ZE(t)}function fL(e,t){return e==="?"||e==="*"||Kr(t)&&!!t.guardCondition}function dL(e){return e==="*"||e==="+"}function pL(e){return e==="+="}function ra(e){return JE(e,new Set)}function JE(e,t){if(t.has(e))return!0;t.add(e);for(let n of rn(e))if(ln(n)){if(!n.rule.ref||lt(n.rule.ref)&&!JE(n.rule.ref,t)||qr(n.rule.ref))return!1}else{if(sn(n))return!1;if(nr(n))return!1}return!!e.definition}function hL(e){return lh(e.type,new Set)}function lh(e,t){if(t.has(e))return!0;if(t.add(e),wE(e))return!1;if(NE(e))return!1;if($E(e))return e.types.every(n=>lh(n,t));if(Qp(e)){if(e.primitiveType!==void 0)return!0;if(e.stringType!==void 0)return!0;if(e.typeRef!==void 0){let n=e.typeRef.ref;return th(n)?lh(n.type,t):!1}else return!1}else return!1}function xc(e){if(!xt(e)){if(e.inferredType)return e.inferredType.name;if(e.dataType)return e.dataType;if(e.returnType){let t=e.returnType.ref;if(t)return t.name}}}function ir(e){if(tr(e))return lt(e)&&ra(e)?e.name:xc(e)??e.name;if(IE(e)||th(e)||PE(e))return e.name;if(nr(e)){let t=QE(e);if(t)return t}else if(pc(e))return e.name;throw new Error("Cannot get name of Unknown Type")}function QE(e){if(e.inferredType)return e.inferredType.name;if(e.type?.ref)return ir(e.type.ref)}function mL(e){return xt(e)?e.type?.name??"string":lt(e)&&ra(e)?e.name:xc(e)??e.name}function gh(e){return xt(e)?e.type?.name??"string":xc(e)??e.name}function no(e){let t={s:!1,i:!1,u:!1},n=ro(e.definition,t),r=Object.entries(t).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(n,r)}var yh=/[\s\S]/.source;function ro(e,t){if(CE(e))return gL(e);if(OE(e))return yL(e);if(vE(e))return wL(e);if(eh(e)){let n=e.rule.ref;if(!n)throw new Error("Missing rule reference.");return En(ro(n.definition),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized})}else{if(RE(e))return EL(e);if(DE(e))return xL(e);if(LE(e)){let n=e.regex.lastIndexOf("/"),r=e.regex.substring(1,n),i=e.regex.substring(n+1);return t&&(t.i=i.includes("i"),t.s=i.includes("s"),t.u=i.includes("u")),En(r,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}else{if(ME(e))return En(yh,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized});throw new Error(`Invalid terminal element: ${e?.$type}, ${e?.$cstNode?.text}`)}}}function gL(e){return En(e.elements.map(t=>ro(t)).join("|"),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}function yL(e){return En(e.elements.map(t=>ro(t)).join(""),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}function xL(e){return En(`${yh}*?${ro(e.terminal)}`,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized})}function EL(e){return En(`(?!${ro(e.terminal)})${yh}*?`,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized})}function wL(e){return e.right?En(`[${ah(e.left)}-${ah(e.right)}]`,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1}):En(ah(e.left),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}function ah(e){return Qr(e.value)}function En(e,t){return(t.parenthesized||t.lookahead||t.wrap!==!1)&&(e=`(${t.lookahead??(t.parenthesized?"":"?:")}${e})`),t.cardinality?`${e}${t.cardinality}`:e}function ew(e){let t=[],n=e.Grammar;for(let r of n.rules)xt(r)&&uh(r)&&zE(no(r))&&t.push(r.name);return{multilineCommentRules:t,nameRegexp:UE}}function io(e){console&&console.error&&console.error(`Error: ${e}`)}function ia(e){console&&console.warn&&console.warn(`Warning: ${e}`)}function oa(e){let t=new Date().getTime(),n=e();return{time:new Date().getTime()-t,value:n}}function sa(e){function t(){}t.prototype=e;let n=new t;function r(){return typeof n.bar}return r(),r(),e;(0,eval)(e)}function TL(e){return vL(e)?e.LABEL:e.name}function vL(e){return typeof e.LABEL=="string"&&e.LABEL!==""}var St=class{get definition(){return this._definition}set definition(t){this._definition=t}constructor(t){this._definition=t}accept(t){t.visit(this),this.definition.forEach(n=>{n.accept(t)})}},Ee=class extends St{constructor(t){super([]),this.idx=1,Object.assign(this,un(t))}set definition(t){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(t){t.visit(this)}},ct=class extends St{constructor(t){super(t.definition),this.orgText="",Object.assign(this,un(t))}},be=class extends St{constructor(t){super(t.definition),this.ignoreAmbiguities=!1,Object.assign(this,un(t))}},we=class extends St{constructor(t){super(t.definition),this.idx=1,Object.assign(this,un(t))}},Ne=class extends St{constructor(t){super(t.definition),this.idx=1,Object.assign(this,un(t))}},Le=class extends St{constructor(t){super(t.definition),this.idx=1,Object.assign(this,un(t))}},me=class extends St{constructor(t){super(t.definition),this.idx=1,Object.assign(this,un(t))}},ke=class extends St{constructor(t){super(t.definition),this.idx=1,Object.assign(this,un(t))}},Ie=class extends St{get definition(){return this._definition}set definition(t){this._definition=t}constructor(t){super(t.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Object.assign(this,un(t))}},le=class{constructor(t){this.idx=1,Object.assign(this,un(t))}accept(t){t.visit(this)}};function wc(e){return e.map(oo)}function oo(e){function t(n){return n.map(oo)}if(e instanceof Ee){let n={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return typeof e.label=="string"&&(n.label=e.label),n}else{if(e instanceof be)return{type:"Alternative",definition:t(e.definition)};if(e instanceof we)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof Ne)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof Le)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:oo(new le({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof ke)return{type:"RepetitionWithSeparator",idx:e.idx,separator:oo(new le({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof me)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof Ie)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof le){let n={type:"Terminal",name:e.terminalType.name,label:TL(e.terminalType),idx:e.idx};typeof e.label=="string"&&(n.terminalLabel=e.label);let r=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(n.pattern=r instanceof RegExp?r.source:r),n}else{if(e instanceof ct)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}}}function un(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}var ut=class{visit(t){let n=t;switch(n.constructor){case Ee:return this.visitNonTerminal(n);case be:return this.visitAlternative(n);case we:return this.visitOption(n);case Ne:return this.visitRepetitionMandatory(n);case Le:return this.visitRepetitionMandatoryWithSeparator(n);case ke:return this.visitRepetitionWithSeparator(n);case me:return this.visitRepetition(n);case Ie:return this.visitAlternation(n);case le:return this.visitTerminal(n);case ct:return this.visitRule(n);default:throw Error("non exhaustive match")}}visitNonTerminal(t){}visitAlternative(t){}visitOption(t){}visitRepetition(t){}visitRepetitionMandatory(t){}visitRepetitionMandatoryWithSeparator(t){}visitRepetitionWithSeparator(t){}visitAlternation(t){}visitTerminal(t){}visitRule(t){}};function xh(e){return e instanceof be||e instanceof we||e instanceof me||e instanceof Ne||e instanceof Le||e instanceof ke||e instanceof le||e instanceof ct}function ei(e,t=[]){return e instanceof we||e instanceof me||e instanceof ke?!0:e instanceof Ie?e.definition.some(r=>ei(r,t)):e instanceof Ee&&t.includes(e)?!1:e instanceof St?(e instanceof Ee&&t.push(e),e.definition.every(r=>ei(r,t))):!1}function Eh(e){return e instanceof Ie}function Et(e){if(e instanceof Ee)return"SUBRULE";if(e instanceof we)return"OPTION";if(e instanceof Ie)return"OR";if(e instanceof Ne)return"AT_LEAST_ONE";if(e instanceof Le)return"AT_LEAST_ONE_SEP";if(e instanceof ke)return"MANY_SEP";if(e instanceof me)return"MANY";if(e instanceof le)return"CONSUME";throw Error("non exhaustive match")}var wn=class{walk(t,n=[]){t.definition.forEach((r,i)=>{let o=t.definition.slice(i+1);if(r instanceof Ee)this.walkProdRef(r,o,n);else if(r instanceof le)this.walkTerminal(r,o,n);else if(r instanceof be)this.walkFlat(r,o,n);else if(r instanceof we)this.walkOption(r,o,n);else if(r instanceof Ne)this.walkAtLeastOne(r,o,n);else if(r instanceof Le)this.walkAtLeastOneSep(r,o,n);else if(r instanceof ke)this.walkManySep(r,o,n);else if(r instanceof me)this.walkMany(r,o,n);else if(r instanceof Ie)this.walkOr(r,o,n);else throw Error("non exhaustive match")})}walkTerminal(t,n,r){}walkProdRef(t,n,r){}walkFlat(t,n,r){let i=n.concat(r);this.walk(t,i)}walkOption(t,n,r){let i=n.concat(r);this.walk(t,i)}walkAtLeastOne(t,n,r){let i=[new we({definition:t.definition})].concat(n,r);this.walk(t,i)}walkAtLeastOneSep(t,n,r){let i=tw(t,n,r);this.walk(t,i)}walkMany(t,n,r){let i=[new we({definition:t.definition})].concat(n,r);this.walk(t,i)}walkManySep(t,n,r){let i=tw(t,n,r);this.walk(t,i)}walkOr(t,n,r){let i=n.concat(r);t.definition.forEach(o=>{let s=new be({definition:[o]});this.walk(s,i)})}};function tw(e,t,n){return[new we({definition:[new le({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}function ti(e){if(e instanceof Ee)return ti(e.referencedRule);if(e instanceof le)return kL(e);if(xh(e))return _L(e);if(Eh(e))return AL(e);throw Error("non exhaustive match")}function _L(e){let t=[],n=e.definition,r=0,i=n.length>r,o,s=!0;for(;i&&s;)o=n[r],s=ei(o),t=t.concat(ti(o)),r=r+1,i=n.length>r;return[...new Set(t)]}function AL(e){let t=e.definition.map(n=>ti(n));return[...new Set(t.flat())]}function kL(e){return[e.terminalType]}var Tc="_~IN~_";var wh=class extends wn{constructor(t){super(),this.topProd=t,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(t,n,r){}walkProdRef(t,n,r){let i=IL(t.referencedRule,t.idx)+this.topProd.name,o=n.concat(r),s=new be({definition:o}),a=ti(s);this.follows[i]=a}};function nw(e){let t={};return e.forEach(n=>{let r=new wh(n).startWalking();Object.assign(t,r)}),t}function IL(e,t){return e.name+t+Tc}var vc={},RL=new Jr;function ni(e){let t=e.toString();if(vc.hasOwnProperty(t))return vc[t];{let n=RL.pattern(t);return vc[t]=n,n}}function rw(){vc={}}var ow="Complement Sets are not supported for first char optimization",aa=`Unable to use "first char" lexer optimizations:
|
|
14
|
-
`;function
|
|
12
|
+
`.match(r)}if(t.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{let n=this.regex.substring(t.loc.begin,t.loc.end);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitChildren(t){t.type==="Group"&&t.quantifier||super.visitChildren(t)}},ih=new oh;function HE(e){try{return typeof e=="string"&&(e=new RegExp(e)),e=e.toString(),ih.reset(e),ih.visit(sL.pattern(e)),ih.multiline}catch{return!1}}var aL=`\f
|
|
13
|
+
\r \v \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF`.split("");function mc(e){let t=typeof e=="string"?new RegExp(e):e;return aL.some(n=>t.test(n))}function Qr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function zE(e,t){let n=lL(e),r=t.match(n);return!!r&&r[0].length>0}function lL(e){typeof e=="string"&&(e=new RegExp(e));let t=e,n=e.source,r=0;function i(){let o="",s;function a(c){o+=n.substr(r,c),r+=c}function l(c){o+="(?:"+n.substr(r,c)+"|$)",r+=c}for(;r<n.length;)switch(n[r]){case"\\":switch(n[r+1]){case"c":l(3);break;case"x":l(4);break;case"u":t.unicode?n[r+2]==="{"?l(n.indexOf("}",r)-r+1):l(6):l(2);break;case"p":case"P":t.unicode?l(n.indexOf("}",r)-r+1):l(2);break;case"k":l(n.indexOf(">",r)-r+1);break;default:l(2);break}break;case"[":s=/\[(?:\\.|.)*?\]/g,s.lastIndex=r,s=s.exec(n)||[],l(s[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":a(1);break;case"{":s=/\{\d+,?\d*\}/g,s.lastIndex=r,s=s.exec(n),s?a(s[0].length):l(1);break;case"(":if(n[r+1]==="?")switch(n[r+2]){case":":o+="(?:",r+=3,o+=i()+"|$)";break;case"=":o+="(?=",r+=3,o+=i()+")";break;case"!":s=r,r+=3,i(),o+=n.substr(s,r-s);break;case"<":switch(n[r+3]){case"=":case"!":s=r,r+=4,i(),o+=n.substr(s,r-s);break;default:a(n.indexOf(">",r)-r+1),o+=i()+"|$)";break}break}else a(1),o+=i()+"|$)";break;case")":return++r,o;default:l(1);break}return o}return new RegExp(i(),e.flags)}function jE(e){return e.rules.find(t=>lt(t)&&t.entry)}function YE(e){return e.rules.filter(t=>xt(t)&&t.hidden)}function ta(e,t){let n=new Set,r=jE(e);if(!r)return new Set(e.rules);let i=[r].concat(YE(e));for(let s of i)VE(s,n,t);let o=new Set;for(let s of e.rules)(n.has(s.name)||xt(s)&&s.hidden)&&o.add(s);return o}function VE(e,t,n){t.add(e.name),sn(e).forEach(r=>{if(un(r)||n&&Qp(r)){let i=r.rule.ref;i&&!t.has(i.name)&&VE(i,t,n)}})}function cL(e){let t=new Set;return sn(e).forEach(n=>{cn(n)&&(lt(n.type.ref)&&t.add(n.type.ref),dc(n.type.ref)&<(n.type.ref.$container)&&t.add(n.type.ref.$container))}),t}function lh(e){if(e.terminal)return e.terminal;if(e.type.ref)return gc(e.type.ref)?.terminal}function ch(e){return e.hidden&&!mc(no(e))}function uh(e,t){return!e||!t?[]:fh(e,t,e.astNode,!0)}function na(e,t,n){if(!e||!t)return;let r=fh(e,t,e.astNode,!0);if(r.length!==0)return n!==void 0?n=Math.max(0,Math.min(n,r.length-1)):n=0,r[n]}function fh(e,t,n,r){if(!r){let i=Hi(e.grammarSource,ln);if(i&&i.feature===t)return[e]}return Qn(e)&&e.astNode===n?e.content.flatMap(i=>fh(i,t,n,!1)):[]}function uL(e,t){return e?ph(e,t,e?.astNode):[]}function dh(e,t,n){if(!e)return;let r=ph(e,t,e?.astNode);if(r.length!==0)return n!==void 0?n=Math.max(0,Math.min(n,r.length-1)):n=0,r[n]}function ph(e,t,n){if(e.astNode!==n)return[];if(Ht(e.grammarSource)&&e.grammarSource.value===t)return[e];let r=Ks(e).iterator(),i,o=[];do if(i=r.next(),!i.done){let s=i.value;s.astNode===n?Ht(s.grammarSource)&&s.grammarSource.value===t&&o.push(s):r.prune()}while(!i.done);return o}function hh(e){let t=e.astNode;for(;t===e.container?.astNode;){let n=Hi(e.grammarSource,ln);if(n)return n;e=e.container}}function gc(e){let t=e;return dc(t)&&(rr(t.$container)?t=t.$container.$container:nr(t.$container)?t=t.$container:ir(t.$container)),KE(e,t,new Map)}function KE(e,t,n){function r(i,o){let s;return Hi(i,ln)||(s=KE(o,o,n)),n.set(e,s),s}if(n.has(e))return n.get(e);n.set(e,void 0);for(let i of sn(t)){if(ln(i)&&i.feature.toLowerCase()==="name")return n.set(e,i),i;if(un(i)&<(i.rule.ref))return r(i,i.rule.ref);if(Jp(i)&&i.typeRef?.ref)return r(i,i.typeRef.ref)}}function qE(e){let t=e.$container;if(Kr(t)){let n=t.elements,r=n.indexOf(e);for(let i=r-1;i>=0;i--){let o=n[i];if(rr(o))return o;{let s=sn(n[i]).find(rr);if(s)return s}}}if(fc(t))return qE(t)}function fL(e,t){return e==="?"||e==="*"||Kr(t)&&!!t.guardCondition}function dL(e){return e==="*"||e==="+"}function pL(e){return e==="+="}function ra(e){return ZE(e,new Set)}function ZE(e,t){if(t.has(e))return!0;t.add(e);for(let n of sn(e))if(un(n)){if(!n.rule.ref||lt(n.rule.ref)&&!ZE(n.rule.ref,t)||qr(n.rule.ref))return!1}else{if(ln(n))return!1;if(rr(n))return!1}return!!e.definition}function hL(e){return ah(e.type,new Set)}function ah(e,t){if(t.has(e))return!0;if(t.add(e),EE(e))return!1;if(bE(e))return!1;if(OE(e))return e.types.every(n=>ah(n,t));if(Jp(e)){if(e.primitiveType!==void 0)return!0;if(e.stringType!==void 0)return!0;if(e.typeRef!==void 0){let n=e.typeRef.ref;return eh(n)?ah(n.type,t):!1}else return!1}else return!1}function yc(e){if(!xt(e)){if(e.inferredType)return e.inferredType.name;if(e.dataType)return e.dataType;if(e.returnType){let t=e.returnType.ref;if(t)return t.name}}}function or(e){if(nr(e))return lt(e)&&ra(e)?e.name:yc(e)??e.name;if(kE(e)||eh(e)||LE(e))return e.name;if(rr(e)){let t=JE(e);if(t)return t}else if(dc(e))return e.name;throw new Error("Cannot get name of Unknown Type")}function JE(e){if(e.inferredType)return e.inferredType.name;if(e.type?.ref)return or(e.type.ref)}function mL(e){return xt(e)?e.type?.name??"string":lt(e)&&ra(e)?e.name:yc(e)??e.name}function mh(e){return xt(e)?e.type?.name??"string":yc(e)??e.name}function no(e){let t={s:!1,i:!1,u:!1},n=ro(e.definition,t),r=Object.entries(t).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(n,r)}var gh=/[\s\S]/.source;function ro(e,t){if(PE(e))return gL(e);if(CE(e))return yL(e);if(TE(e))return wL(e);if(Qp(e)){let n=e.rule.ref;if(!n)throw new Error("Missing rule reference.");return _n(ro(n.definition),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized})}else{if(IE(e))return EL(e);if($E(e))return xL(e);if(NE(e)){let n=e.regex.lastIndexOf("/"),r=e.regex.substring(1,n),i=e.regex.substring(n+1);return t&&(t.i=i.includes("i"),t.s=i.includes("s"),t.u=i.includes("u")),_n(r,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}else{if(DE(e))return _n(gh,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized});throw new Error(`Invalid terminal element: ${e?.$type}, ${e?.$cstNode?.text}`)}}}function gL(e){return _n(e.elements.map(t=>ro(t)).join("|"),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}function yL(e){return _n(e.elements.map(t=>ro(t)).join(""),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}function xL(e){return _n(`${gh}*?${ro(e.terminal)}`,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized})}function EL(e){return _n(`(?!${ro(e.terminal)})${gh}*?`,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized})}function wL(e){return e.right?_n(`[${sh(e.left)}-${sh(e.right)}]`,{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1}):_n(sh(e.left),{cardinality:e.cardinality,lookahead:e.lookahead,parenthesized:e.parenthesized,wrap:!1})}function sh(e){return Qr(e.value)}function _n(e,t){return(t.parenthesized||t.lookahead||t.wrap!==!1)&&(e=`(${t.lookahead??(t.parenthesized?"":"?:")}${e})`),t.cardinality?`${e}${t.cardinality}`:e}function QE(e){let t=[],n=e.Grammar;for(let r of n.rules)xt(r)&&ch(r)&&HE(no(r))&&t.push(r.name);return{multilineCommentRules:t,nameRegexp:XE}}function io(e){console&&console.error&&console.error(`Error: ${e}`)}function ia(e){console&&console.warn&&console.warn(`Warning: ${e}`)}function oa(e){let t=new Date().getTime(),n=e();return{time:new Date().getTime()-t,value:n}}function sa(e){function t(){}t.prototype=e;let n=new t;function r(){return typeof n.bar}return r(),r(),e;(0,eval)(e)}function TL(e){return _L(e)?e.LABEL:e.name}function _L(e){return typeof e.LABEL=="string"&&e.LABEL!==""}var St=class{get definition(){return this._definition}set definition(t){this._definition=t}constructor(t){this._definition=t}accept(t){t.visit(this),this.definition.forEach(n=>{n.accept(t)})}},Ee=class extends St{constructor(t){super([]),this.idx=1,Object.assign(this,dn(t))}set definition(t){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(t){t.visit(this)}},ct=class extends St{constructor(t){super(t.definition),this.orgText="",Object.assign(this,dn(t))}},be=class extends St{constructor(t){super(t.definition),this.ignoreAmbiguities=!1,Object.assign(this,dn(t))}},we=class extends St{constructor(t){super(t.definition),this.idx=1,Object.assign(this,dn(t))}},Ne=class extends St{constructor(t){super(t.definition),this.idx=1,Object.assign(this,dn(t))}},Le=class extends St{constructor(t){super(t.definition),this.idx=1,Object.assign(this,dn(t))}},me=class extends St{constructor(t){super(t.definition),this.idx=1,Object.assign(this,dn(t))}},ke=class extends St{constructor(t){super(t.definition),this.idx=1,Object.assign(this,dn(t))}},Ie=class extends St{get definition(){return this._definition}set definition(t){this._definition=t}constructor(t){super(t.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Object.assign(this,dn(t))}},le=class{constructor(t){this.idx=1,Object.assign(this,dn(t))}accept(t){t.visit(this)}};function Ec(e){return e.map(oo)}function oo(e){function t(n){return n.map(oo)}if(e instanceof Ee){let n={type:"NonTerminal",name:e.nonTerminalName,idx:e.idx};return typeof e.label=="string"&&(n.label=e.label),n}else{if(e instanceof be)return{type:"Alternative",definition:t(e.definition)};if(e instanceof we)return{type:"Option",idx:e.idx,definition:t(e.definition)};if(e instanceof Ne)return{type:"RepetitionMandatory",idx:e.idx,definition:t(e.definition)};if(e instanceof Le)return{type:"RepetitionMandatoryWithSeparator",idx:e.idx,separator:oo(new le({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof ke)return{type:"RepetitionWithSeparator",idx:e.idx,separator:oo(new le({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof me)return{type:"Repetition",idx:e.idx,definition:t(e.definition)};if(e instanceof Ie)return{type:"Alternation",idx:e.idx,definition:t(e.definition)};if(e instanceof le){let n={type:"Terminal",name:e.terminalType.name,label:TL(e.terminalType),idx:e.idx};typeof e.label=="string"&&(n.terminalLabel=e.label);let r=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(n.pattern=r instanceof RegExp?r.source:r),n}else{if(e instanceof ct)return{type:"Rule",name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error("non exhaustive match")}}}function dn(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}var ut=class{visit(t){let n=t;switch(n.constructor){case Ee:return this.visitNonTerminal(n);case be:return this.visitAlternative(n);case we:return this.visitOption(n);case Ne:return this.visitRepetitionMandatory(n);case Le:return this.visitRepetitionMandatoryWithSeparator(n);case ke:return this.visitRepetitionWithSeparator(n);case me:return this.visitRepetition(n);case Ie:return this.visitAlternation(n);case le:return this.visitTerminal(n);case ct:return this.visitRule(n);default:throw Error("non exhaustive match")}}visitNonTerminal(t){}visitAlternative(t){}visitOption(t){}visitRepetition(t){}visitRepetitionMandatory(t){}visitRepetitionMandatoryWithSeparator(t){}visitRepetitionWithSeparator(t){}visitAlternation(t){}visitTerminal(t){}visitRule(t){}};function yh(e){return e instanceof be||e instanceof we||e instanceof me||e instanceof Ne||e instanceof Le||e instanceof ke||e instanceof le||e instanceof ct}function ei(e,t=[]){return e instanceof we||e instanceof me||e instanceof ke?!0:e instanceof Ie?e.definition.some(r=>ei(r,t)):e instanceof Ee&&t.includes(e)?!1:e instanceof St?(e instanceof Ee&&t.push(e),e.definition.every(r=>ei(r,t))):!1}function xh(e){return e instanceof Ie}function Et(e){if(e instanceof Ee)return"SUBRULE";if(e instanceof we)return"OPTION";if(e instanceof Ie)return"OR";if(e instanceof Ne)return"AT_LEAST_ONE";if(e instanceof Le)return"AT_LEAST_ONE_SEP";if(e instanceof ke)return"MANY_SEP";if(e instanceof me)return"MANY";if(e instanceof le)return"CONSUME";throw Error("non exhaustive match")}var vn=class{walk(t,n=[]){t.definition.forEach((r,i)=>{let o=t.definition.slice(i+1);if(r instanceof Ee)this.walkProdRef(r,o,n);else if(r instanceof le)this.walkTerminal(r,o,n);else if(r instanceof be)this.walkFlat(r,o,n);else if(r instanceof we)this.walkOption(r,o,n);else if(r instanceof Ne)this.walkAtLeastOne(r,o,n);else if(r instanceof Le)this.walkAtLeastOneSep(r,o,n);else if(r instanceof ke)this.walkManySep(r,o,n);else if(r instanceof me)this.walkMany(r,o,n);else if(r instanceof Ie)this.walkOr(r,o,n);else throw Error("non exhaustive match")})}walkTerminal(t,n,r){}walkProdRef(t,n,r){}walkFlat(t,n,r){let i=n.concat(r);this.walk(t,i)}walkOption(t,n,r){let i=n.concat(r);this.walk(t,i)}walkAtLeastOne(t,n,r){let i=[new we({definition:t.definition})].concat(n,r);this.walk(t,i)}walkAtLeastOneSep(t,n,r){let i=ew(t,n,r);this.walk(t,i)}walkMany(t,n,r){let i=[new we({definition:t.definition})].concat(n,r);this.walk(t,i)}walkManySep(t,n,r){let i=ew(t,n,r);this.walk(t,i)}walkOr(t,n,r){let i=n.concat(r);t.definition.forEach(o=>{let s=new be({definition:[o]});this.walk(s,i)})}};function ew(e,t,n){return[new we({definition:[new le({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}function ti(e){if(e instanceof Ee)return ti(e.referencedRule);if(e instanceof le)return kL(e);if(yh(e))return vL(e);if(xh(e))return AL(e);throw Error("non exhaustive match")}function vL(e){let t=[],n=e.definition,r=0,i=n.length>r,o,s=!0;for(;i&&s;)o=n[r],s=ei(o),t=t.concat(ti(o)),r=r+1,i=n.length>r;return[...new Set(t)]}function AL(e){let t=e.definition.map(n=>ti(n));return[...new Set(t.flat())]}function kL(e){return[e.terminalType]}var wc="_~IN~_";var Eh=class extends vn{constructor(t){super(),this.topProd=t,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(t,n,r){}walkProdRef(t,n,r){let i=IL(t.referencedRule,t.idx)+this.topProd.name,o=n.concat(r),s=new be({definition:o}),a=ti(s);this.follows[i]=a}};function tw(e){let t={};return e.forEach(n=>{let r=new Eh(n).startWalking();Object.assign(t,r)}),t}function IL(e,t){return e.name+t+wc}var Tc={},RL=new Jr;function ni(e){let t=e.toString();if(Tc.hasOwnProperty(t))return Tc[t];{let n=RL.pattern(t);return Tc[t]=n,n}}function nw(){Tc={}}var iw="Complement Sets are not supported for first char optimization",aa=`Unable to use "first char" lexer optimizations:
|
|
14
|
+
`;function ow(e,t=!1){try{let n=ni(e);return wh(n.value,{},n.flags.ignoreCase)}catch(n){if(n.message===iw)t&&ia(`${aa} Unable to optimize: < ${e.toString()} >
|
|
15
15
|
Complement Sets cannot be automatically optimized.
|
|
16
16
|
This will disable the lexer's first char optimizations.
|
|
17
17
|
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let r="";t&&(r=`
|
|
@@ -19,48 +19,48 @@
|
|
|
19
19
|
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),io(`${aa}
|
|
20
20
|
Failed parsing: < ${e.toString()} >
|
|
21
21
|
Using the @chevrotain/regexp-to-ast library
|
|
22
|
-
Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+r)}}return[]}function
|
|
23
|
-
`],tracer:(y,T)=>T()},t);let n=t.tracer;n("initCharCodeToOptimizedIndexMap",()=>{VL()});let r;n("Reject Lexer.NA",()=>{r=e.filter(y=>y[ri]!==Me.NA)});let i=!1,o;n("Transform Patterns",()=>{i=!1,o=r.map(y=>{let T=y[ri];if(T instanceof RegExp){let E=T.source;return E.length===1&&E!=="^"&&E!=="$"&&E!=="."&&!T.ignoreCase?E:E.length===2&&E[0]==="\\"&&!["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"].includes(E[1])?E[1]:
|
|
22
|
+
Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+r)}}return[]}function wh(e,t,n){switch(e.type){case"Disjunction":for(let i=0;i<e.value.length;i++)wh(e.value[i],t,n);break;case"Alternative":let r=e.value;for(let i=0;i<r.length;i++){let o=r[i];switch(o.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"Lookbehind":case"NegativeLookbehind":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}let s=o;switch(s.type){case"Character":_c(s.value,t,n);break;case"Set":if(s.complement===!0)throw Error(iw);s.value.forEach(l=>{if(typeof l=="number")_c(l,t,n);else{let c=l;if(n===!0)for(let u=c.from;u<=c.to;u++)_c(u,t,n);else{for(let u=c.from;u<=c.to&&u<so;u++)_c(u,t,n);if(c.to>=so){let u=c.from>=so?c.from:so,f=c.to,d=pn(u),p=pn(f);for(let m=d;m<=p;m++)t[m]=m}}}});break;case"Group":wh(s.value,t,n);break;default:throw Error("Non Exhaustive Match")}let a=s.quantifier!==void 0&&s.quantifier.atLeast===0;if(s.type==="Group"&&Th(s)===!1||s.type!=="Group"&&a===!1)break}break;default:throw Error("non exhaustive match!")}return Object.values(t)}function _c(e,t,n){let r=pn(e);t[r]=r,n===!0&&SL(e,t)}function SL(e,t){let n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n){let i=pn(r.charCodeAt(0));t[i]=i}else{let i=n.toLowerCase();if(i!==n){let o=pn(i.charCodeAt(0));t[o]=o}}}function rw(e,t){return e.value.find(n=>{if(typeof n=="number")return t.includes(n);{let r=n;return t.find(i=>r.from<=i&&i<=r.to)!==void 0}})}function Th(e){let t=e.quantifier;return t&&t.atLeast===0?!0:e.value?Array.isArray(e.value)?e.value.every(Th):Th(e.value):!1}var _h=class extends fn{constructor(t){super(),this.targetCharCodes=t,this.found=!1}visitChildren(t){if(this.found!==!0){switch(t.type){case"Lookahead":this.visitLookahead(t);return;case"NegativeLookahead":this.visitNegativeLookahead(t);return;case"Lookbehind":this.visitLookbehind(t);return;case"NegativeLookbehind":this.visitNegativeLookbehind(t);return}super.visitChildren(t)}}visitCharacter(t){this.targetCharCodes.includes(t.value)&&(this.found=!0)}visitSet(t){t.complement?rw(t,this.targetCharCodes)===void 0&&(this.found=!0):rw(t,this.targetCharCodes)!==void 0&&(this.found=!0)}};function vc(e,t){if(t instanceof RegExp){let n=ni(t),r=new _h(e);return r.visit(n),r.found}else{for(let n of t){let r=n.charCodeAt(0);if(e.includes(r))return!0}return!1}}var ri="PATTERN",ao="defaultMode",Ac="modes",Ic=0,la=1,Rc=2,Sc=3;function aw(e,t){t=Object.assign({safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
|
|
23
|
+
`],tracer:(y,T)=>T()},t);let n=t.tracer;n("initCharCodeToOptimizedIndexMap",()=>{VL()});let r;n("Reject Lexer.NA",()=>{r=e.filter(y=>y[ri]!==Me.NA)});let i=!1,o;n("Transform Patterns",()=>{i=!1,o=r.map(y=>{let T=y[ri];if(T instanceof RegExp){let E=T.source;return E.length===1&&E!=="^"&&E!=="$"&&E!=="."&&!T.ignoreCase?E:E.length===2&&E[0]==="\\"&&!["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"].includes(E[1])?E[1]:sw(T)}else{if(typeof T=="function")return i=!0,{exec:T};if(typeof T=="object")return i=!0,T;if(typeof T=="string"){if(T.length===1)return T;{let E=T.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),_=new RegExp(E);return sw(_)}}else throw Error("non exhaustive match")}})});let s,a,l,c,u;n("misc mapping",()=>{s=r.map(y=>y.tokenTypeIdx),a=r.map(y=>{let T=y.GROUP;if(T!==Me.SKIPPED){if(typeof T=="string")return T;if(T===void 0)return!1;throw Error("non exhaustive match")}}),l=r.map(y=>{let T=y.LONGER_ALT;if(T)return Array.isArray(T)?T.map(_=>r.indexOf(_)):[r.indexOf(T)]}),c=r.map(y=>y.PUSH_MODE),u=r.map(y=>Object.hasOwn(y,"POP_MODE"))});let f;n("Line Terminator Handling",()=>{let y=hw(t.lineTerminatorCharacters);f=r.map(T=>!1),t.positionTracking!=="onlyOffset"&&(f=r.map(T=>Object.hasOwn(T,"LINE_BREAKS")?!!T.LINE_BREAKS:pw(T,y)===!1&&vc(y,T.PATTERN)))});let d,p,m,g;n("Misc Mapping #2",()=>{d=r.map(fw),p=o.map(jL),m=r.reduce((y,T)=>{let E=T.GROUP;return typeof E=="string"&&E!==Me.SKIPPED&&(y[E]=[]),y},{}),g=o.map((y,T)=>{let E=a[T]===void 0&&l[T]===void 0?bL(r[T].PATTERN):void 0;return{pattern:o[T],asciiClass:E,longerAlt:l[T],canLineTerminator:f[T],matchType:E!==void 0?Sc:p[T]!==!1?Ic:d[T]?la:Rc,short:p[T],group:a[T],push:c[T],pop:u[T],tokenTypeIdx:s[T],tokenType:r[T]}})});let w=!0,x=[];return t.safeMode||n("First Char Optimization",()=>{x=r.reduce((y,T,E)=>{if(typeof T.PATTERN=="string"){let _=T.PATTERN.charCodeAt(0),R=pn(_);vh(y,R,g[E])}else if(Array.isArray(T.START_CHARS_HINT)){let _;T.START_CHARS_HINT.forEach(R=>{let F=typeof R=="string"?R.charCodeAt(0):R,C=pn(F);_!==C&&(_=C,vh(y,C,g[E]))})}else if(T.PATTERN instanceof RegExp)if(T.PATTERN.unicode)w=!1,t.ensureOptimizations&&io(`${aa} Unable to analyze < ${T.PATTERN.toString()} > pattern.
|
|
24
24
|
The regexp unicode flag is not currently supported by the regexp-to-ast library.
|
|
25
25
|
This will disable the lexer's first char optimizations.
|
|
26
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{let
|
|
26
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{let _=ow(T.PATTERN,t.ensureOptimizations);_.length===0&&(w=!1),_.forEach(R=>{vh(y,R,g[E])})}else t.ensureOptimizations&&io(`${aa} TokenType: <${T.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
|
|
27
27
|
This will disable the lexer's first char optimizations.
|
|
28
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),w=!1;return y},[])}),{emptyGroups:m,patternIdxToConfig:g,charCodeToPatternIdxToConfig:x,hasCustom:i,canBeOptimized:w}}function bL(e){var t,n;if(!(e instanceof RegExp)||e.flags!=="")return;let r;try{r=ni(e)}catch{return}if(r.value.value.length!==1||r.value.value[0].value.length!==1)return;let i=r.value.value[0].value[0],o;for(;i.type==="Group";){if(i.capturing||i.quantifier!==void 0&&o!==void 0||i.value.value.length!==1||i.value.value[0].value.length!==1)return;o=(t=i.quantifier)!==null&&t!==void 0?t:o,i=i.value.value[0].value[0]}if(i.type!=="Set"||i.complement||i.quantifier!==void 0&&o!==void 0||(o=(n=i.quantifier)!==null&&n!==void 0?n:o,o?.atLeast!==1||o.atMost!==1/0||!o.greedy))return;let s=new Uint8Array(128);for(let a of i.value){let l=typeof a=="number"?a:a.from,c=typeof a=="number"?a:a.to;if(l<0||c>=s.length)return;s.fill(1,l,c+1)}return s}function
|
|
28
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),w=!1;return y},[])}),{emptyGroups:m,patternIdxToConfig:g,charCodeToPatternIdxToConfig:x,hasCustom:i,canBeOptimized:w}}function bL(e){var t,n;if(!(e instanceof RegExp)||e.flags!=="")return;let r;try{r=ni(e)}catch{return}if(r.value.value.length!==1||r.value.value[0].value.length!==1)return;let i=r.value.value[0].value[0],o;for(;i.type==="Group";){if(i.capturing||i.quantifier!==void 0&&o!==void 0||i.value.value.length!==1||i.value.value[0].value.length!==1)return;o=(t=i.quantifier)!==null&&t!==void 0?t:o,i=i.value.value[0].value[0]}if(i.type!=="Set"||i.complement||i.quantifier!==void 0&&o!==void 0||(o=(n=i.quantifier)!==null&&n!==void 0?n:o,o?.atLeast!==1||o.atMost!==1/0||!o.greedy))return;let s=new Uint8Array(128);for(let a of i.value){let l=typeof a=="number"?a:a.from,c=typeof a=="number"?a:a.to;if(l<0||c>=s.length)return;s.fill(1,l,c+1)}return s}function lw(e,t){let n=[],r=LL(e);n=n.concat(r.errors);let i=PL(r.valid),o=i.valid;return n=n.concat(i.errors),n=n.concat(NL(o)),n=n.concat(WL(o)),n=n.concat(XL(o,t)),n=n.concat(UL(o)),n}function NL(e){let t=[],n=e.filter(r=>r[ri]instanceof RegExp);return t=t.concat(OL(n)),t=t.concat(ML(n)),t=t.concat(FL(n)),t=t.concat(BL(n)),t=t.concat($L(n)),t}function LL(e){let t=e.filter(i=>!Object.hasOwn(i,ri)),n=t.map(i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:De.MISSING_PATTERN,tokenTypes:[i]})),r=e.filter(i=>!t.includes(i));return{errors:n,valid:r}}function PL(e){let t=e.filter(i=>{let o=i[ri];return!(o instanceof RegExp)&&typeof o!="function"&&!Object.hasOwn(o,"exec")&&typeof o!="string"}),n=t.map(i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:De.INVALID_PATTERN,tokenTypes:[i]})),r=e.filter(i=>!t.includes(i));return{errors:n,valid:r}}var CL=/[^\\][$]/;function OL(e){class t extends fn{constructor(){super(...arguments),this.found=!1}visitEndAnchor(o){this.found=!0}}return e.filter(i=>{let o=i.PATTERN;try{let s=ni(o),a=new t;return a.visit(s),a.found}catch{return CL.test(o.source)}}).map(i=>({message:`Unexpected RegExp Anchor Error:
|
|
29
29
|
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
|
|
30
|
-
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:De.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function $L(e){return e.filter(r=>r.PATTERN.test("")).map(r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' must not match an empty string",type:De.EMPTY_MATCH_PATTERN,tokenTypes:[r]}))}var DL=/[^\\[][\^]|^\^/;function ML(e){class t extends
|
|
30
|
+
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:De.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function $L(e){return e.filter(r=>r.PATTERN.test("")).map(r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' must not match an empty string",type:De.EMPTY_MATCH_PATTERN,tokenTypes:[r]}))}var DL=/[^\\[][\^]|^\^/;function ML(e){class t extends fn{constructor(){super(...arguments),this.found=!1}visitStartAnchor(o){this.found=!0}}return e.filter(i=>{let o=i.PATTERN;try{let s=ni(o),a=new t;return a.visit(s),a.found}catch{return DL.test(o.source)}}).map(i=>({message:`Unexpected RegExp Anchor Error:
|
|
31
31
|
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
|
|
32
32
|
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:De.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function FL(e){return e.filter(r=>{let i=r[ri];return i instanceof RegExp&&(i.multiline||i.global)}).map(r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:De.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[r]}))}function BL(e){let t=[],n=e.map(o=>e.reduce((s,a)=>(o.PATTERN.source===a.PATTERN.source&&!t.includes(a)&&a.PATTERN!==Me.NA&&(t.push(a),s.push(a)),s),[]));return n=n.filter(Boolean),n.filter(o=>o.length>1).map(o=>{let s=o.map(l=>l.name);return{message:`The same RegExp pattern ->${o[0].PATTERN}<-has been used in all of the following Token Types: ${s.join(", ")} <-`,type:De.DUPLICATE_PATTERNS_FOUND,tokenTypes:o}})}function WL(e){return e.filter(r=>{if(!Object.hasOwn(r,"GROUP"))return!1;let i=r.GROUP;return i!==Me.SKIPPED&&i!==Me.NA&&typeof i!="string"}).map(r=>({message:"Token Type: ->"+r.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:De.INVALID_GROUP_TYPE_FOUND,tokenTypes:[r]}))}function XL(e,t){return e.filter(i=>i.PUSH_MODE!==void 0&&!t.includes(i.PUSH_MODE)).map(i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:De.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function UL(e){let t=[],n=e.reduce((r,i,o)=>{let s=i.PATTERN;return s===Me.NA||(typeof s=="string"?r.push({str:s,idx:o,tokenType:i}):s instanceof RegExp&&HL(s)&&r.push({str:s.source,idx:o,tokenType:i})),r},[]);return e.forEach((r,i)=>{n.forEach(({str:o,idx:s,tokenType:a})=>{if(i<s&&GL(o,r.PATTERN)){let l=`Token: ->${a.name}<- can never be matched.
|
|
33
33
|
Because it appears AFTER the Token Type ->${r.name}<-in the lexer's definition.
|
|
34
|
-
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:l,type:De.UNREACHABLE_PATTERN,tokenTypes:[r,a]})}})}),t}function GL(e,t){if(t instanceof RegExp){if(zL(t))return!1;let n=t.exec(e);return n!==null&&n.index===0}else{if(typeof t=="function")return t(e,0,[],{});if(Object.hasOwn(t,"exec"))return t.exec(e,0,[],{});if(typeof t=="string")return t===e;throw Error("non exhaustive match")}}function HL(e){return[".","\\","[","]","|","^","$","(",")","?","*","+","{"].find(n=>e.source.indexOf(n)!==-1)===void 0}function zL(e){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\?<!)/.test(e.source)}function
|
|
35
|
-
`,type:De.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Object.hasOwn(e,
|
|
36
|
-
`,type:De.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Object.hasOwn(e,
|
|
37
|
-
`,type:De.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Object.hasOwn(e,
|
|
34
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:l,type:De.UNREACHABLE_PATTERN,tokenTypes:[r,a]})}})}),t}function GL(e,t){if(t instanceof RegExp){if(zL(t))return!1;let n=t.exec(e);return n!==null&&n.index===0}else{if(typeof t=="function")return t(e,0,[],{});if(Object.hasOwn(t,"exec"))return t.exec(e,0,[],{});if(typeof t=="string")return t===e;throw Error("non exhaustive match")}}function HL(e){return[".","\\","[","]","|","^","$","(",")","?","*","+","{"].find(n=>e.source.indexOf(n)!==-1)===void 0}function zL(e){return/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\?<!)/.test(e.source)}function sw(e){let t=e.ignoreCase?"iy":"y";return new RegExp(`${e.source}`,t)}function cw(e,t,n){let r=[];return Object.hasOwn(e,ao)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+ao+`> property in its definition
|
|
35
|
+
`,type:De.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Object.hasOwn(e,Ac)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+Ac+`> property in its definition
|
|
36
|
+
`,type:De.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Object.hasOwn(e,Ac)&&Object.hasOwn(e,ao)&&!Object.hasOwn(e.modes,e.defaultMode)&&r.push({message:`A MultiMode Lexer cannot be initialized with a ${ao}: <${e.defaultMode}>which does not exist
|
|
37
|
+
`,type:De.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Object.hasOwn(e,Ac)&&Object.keys(e.modes).forEach(i=>{let o=e.modes[i];o.forEach((s,a)=>{s===void 0?r.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${i}> at index: <${a}>
|
|
38
38
|
`,type:De.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED}):Object.hasOwn(s,"LONGER_ALT")&&(Array.isArray(s.LONGER_ALT)?s.LONGER_ALT:[s.LONGER_ALT]).forEach(c=>{c!==void 0&&!o.includes(c)&&r.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${c.name}> on token <${s.name}> outside of mode <${i}>
|
|
39
|
-
`,type:De.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})}),r}function
|
|
39
|
+
`,type:De.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})}),r}function uw(e,t,n){let r=[],i=!1,s=Object.values(e.modes||{}).flat().filter(Boolean).filter(l=>l[ri]!==Me.NA),a=hw(n);return t&&s.forEach(l=>{let c=pw(l,a);if(c!==!1){let f={message:YL(l,c),type:c.issue,tokenType:l};r.push(f)}else Object.hasOwn(l,"LINE_BREAKS")?l.LINE_BREAKS===!0&&(i=!0):vc(a,l.PATTERN)&&(i=!0)}),t&&!i&&r.push({message:`Warning: No LINE_BREAKS Found.
|
|
40
40
|
This Lexer has been defined to track line and column information,
|
|
41
41
|
But none of the Token Types can be identified as matching a line terminator.
|
|
42
42
|
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
|
|
43
|
-
for details.`,type:De.NO_LINE_BREAKS_FLAGS}),r}function
|
|
43
|
+
for details.`,type:De.NO_LINE_BREAKS_FLAGS}),r}function fw(e){let t=e.PATTERN;if(t instanceof RegExp)return!1;if(typeof t=="function")return!0;if(Object.hasOwn(t,"exec"))return!0;if(typeof t=="string")return!1;throw Error("non exhaustive match")}function jL(e){return typeof e=="string"&&e.length===1?e.charCodeAt(0):!1}var dw={test:function(e){let t=e.length;for(let n=this.lastIndex;n<t;n++){let r=e.charCodeAt(n);if(r===10)return this.lastIndex=n+1,!0;if(r===13)return e.charCodeAt(n+1)===10?this.lastIndex=n+2:this.lastIndex=n+1,!0}return!1},lastIndex:0};function pw(e,t){if(Object.hasOwn(e,"LINE_BREAKS"))return!1;if(e.PATTERN instanceof RegExp){try{vc(t,e.PATTERN)}catch(n){return{issue:De.IDENTIFY_TERMINATOR,errMsg:n.message}}return!1}else{if(typeof e.PATTERN=="string")return!1;if(fw(e))return{issue:De.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function YL(e,t){if(t.issue===De.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
|
|
44
44
|
The problem is in the <${e.name}> Token Type
|
|
45
45
|
Root cause: ${t.errMsg}.
|
|
46
46
|
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===De.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
|
|
47
47
|
The problem is in the <${e.name}> Token Type
|
|
48
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function
|
|
48
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function hw(e){return e.map(n=>typeof n=="string"?n.charCodeAt(0):n)}function vh(e,t,n){e[t]===void 0?e[t]=[n]:e[t].push(n)}var so=256,kc=[];function pn(e){return e<so?e:kc[e]}function VL(){if(kc.length===0){kc=new Array(65536);for(let e=0;e<65536;e++)kc[e]=e>255?255+~~(e/255):e}}function An(e,t){let n=e.tokenTypeIdx;return n===t.tokenTypeIdx?!0:t.isParent===!0&&t.categoryMatchesMap[n]===!0}function lo(e,t){return e.tokenTypeIdx===t.tokenTypeIdx}var mw=1,yw={};function kn(e){let t=KL(e);qL(t),JL(t),ZL(t),t.forEach(n=>{n.isParent=n.categoryMatches.length>0})}function KL(e){let t=[...e],n=e,r=!0;for(;r;){n=n.map(o=>o.CATEGORIES).flat().filter(Boolean);let i=n.filter(o=>!t.includes(o));t=t.concat(i),i.length===0?r=!1:n=i}return t}function qL(e){e.forEach(t=>{Ah(t)||(yw[mw]=t,t.tokenTypeIdx=mw++),gw(t)&&!Array.isArray(t.CATEGORIES)&&(t.CATEGORIES=[t.CATEGORIES]),gw(t)||(t.CATEGORIES=[]),QL(t)||(t.categoryMatches=[]),eP(t)||(t.categoryMatchesMap={})})}function ZL(e){e.forEach(t=>{t.categoryMatches=[],Object.keys(t.categoryMatchesMap).forEach(n=>{t.categoryMatches.push(yw[n].tokenTypeIdx)})})}function JL(e){e.forEach(t=>{xw([],t)})}function xw(e,t){e.forEach(n=>{t.categoryMatchesMap[n.tokenTypeIdx]=!0}),t.CATEGORIES.forEach(n=>{let r=e.concat(t);r.includes(n)||xw(r,n)})}function Ah(e){return Object.hasOwn(e??{},"tokenTypeIdx")}function gw(e){return Object.hasOwn(e??{},"CATEGORIES")}function QL(e){return Object.hasOwn(e??{},"categoryMatches")}function eP(e){return Object.hasOwn(e??{},"categoryMatchesMap")}function Ew(e){return Object.hasOwn(e??{},"tokenTypeIdx")}var co={buildUnableToPopLexerModeMessage(e){return`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(e,t,n,r,i,o){return`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${n} characters.`}};var De;(function(e){e[e.MISSING_PATTERN=0]="MISSING_PATTERN",e[e.INVALID_PATTERN=1]="INVALID_PATTERN",e[e.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",e[e.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",e[e.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",e[e.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",e[e.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",e[e.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",e[e.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",e[e.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",e[e.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",e[e.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",e[e.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(De||(De={}));var ca={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
|
|
49
49
|
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:co,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(ca);var Me=class{constructor(t,n=ca){if(this.lexerDefinition=t,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.cachedGroupKeys=[],this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,o)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;let s=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${s}--> <${i}>`);let{time:a,value:l}=oa(o),c=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&c(`${s}<-- <${i}> time: ${a}ms`),this.traceInitIndent--,l}else return o()},typeof n=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
|
|
50
|
-
a boolean 2nd argument is no longer supported`);this.config=Object.assign({},ca,n);let r=this.config.traceInitPerf;r===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof r=="number"&&(this.traceInitMaxIdent=r,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,o=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===ca.lineTerminatorsPattern)this.config.lineTerminatorsPattern=
|
|
51
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(n.safeMode&&n.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),Array.isArray(t)?i={modes:{defaultMode:[...t]},defaultMode:ao}:(o=!1,i=Object.assign({},t))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(
|
|
50
|
+
a boolean 2nd argument is no longer supported`);this.config=Object.assign({},ca,n);let r=this.config.traceInitPerf;r===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof r=="number"&&(this.traceInitMaxIdent=r,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,o=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===ca.lineTerminatorsPattern)this.config.lineTerminatorsPattern=dw;else if(this.config.lineTerminatorCharacters===ca.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
|
|
51
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(n.safeMode&&n.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),Array.isArray(t)?i={modes:{defaultMode:[...t]},defaultMode:ao}:(o=!1,i=Object.assign({},t))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(cw(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(uw(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},Object.entries(i.modes).forEach(([a,l])=>{i.modes[a]=l.filter(c=>c!==void 0)});let s=Object.keys(i.modes);if(Object.entries(i.modes).forEach(([a,l])=>{this.TRACE_INIT(`Mode: <${a}> processing`,()=>{if(this.modes.push(a),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(lw(l,s))}),this.lexerDefinitionErrors.length===0){kn(l);let c;this.TRACE_INIT("analyzeTokenTypes",()=>{c=aw(l,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:n.positionTracking,ensureOptimizations:n.ensureOptimizations,safeMode:n.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[a]=c.patternIdxToConfig,this.charCodeToPatternIdxToConfig[a]=c.charCodeToPatternIdxToConfig,this.emptyGroups=Object.assign({},this.emptyGroups,c.emptyGroups),this.hasCustom=c.hasCustom||this.hasCustom,this.canModeBeOptimized[a]=c.canBeOptimized}})}),this.defaultMode=i.defaultMode,this.cachedGroupKeys=Object.keys(this.emptyGroups),this.lexerDefinitionErrors.length>0&&!this.config.deferDefinitionErrorsHandling){let l=this.lexerDefinitionErrors.map(c=>c.message).join(`-----------------------
|
|
52
52
|
`);throw new Error(`Errors detected in definition of Lexer:
|
|
53
53
|
`+l)}this.lexerDefinitionWarning.forEach(a=>{ia(a.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(o&&(this.handleModes=()=>{}),this.trackStartLines===!1&&(this.computeNewColumn=a=>a),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=()=>{}),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{let a=Object.entries(this.canModeBeOptimized).reduce((l,[c,u])=>(u===!1&&l.push(c),l),[]);if(n.ensureOptimizations&&a.length>0)throw Error(`Lexer Modes: < ${a.join(", ")} > cannot be optimized.
|
|
54
54
|
Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
|
|
55
|
-
Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{
|
|
55
|
+
Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{nw()}),this.TRACE_INIT("toFastProperties",()=>{sa(this)})})}tokenize(t,n=this.defaultMode){if(this.lexerDefinitionErrors.length>0){let i=this.lexerDefinitionErrors.map(o=>o.message).join(`-----------------------
|
|
56
56
|
`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
|
|
57
|
-
`+i)}return this.tokenizeInternal(t,n)}tokenizeInternal(t,n){let r,i,o,s,a,l,c,u,f,d,p,m,g,w,x,y=t,T=y.length,E=0,
|
|
58
|
-
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return Object.hasOwn(e,
|
|
57
|
+
`+i)}return this.tokenizeInternal(t,n)}tokenizeInternal(t,n){let r,i,o,s,a,l,c,u,f,d,p,m,g,w,x,y=t,T=y.length,E=0,_=0,R=this.hasCustom?0:Math.floor(t.length/10),F=new Array(R),C=[],W=this.trackStartLines?1:void 0,j=this.trackStartLines?1:void 0,P={};for(let Y=0;Y<this.cachedGroupKeys.length;Y++)P[this.cachedGroupKeys[Y]]=[];let S=this.trackStartLines,b=this.config.lineTerminatorsPattern,$=0,I=[],A=[],v=[],D=[];Object.freeze(D);let L=!1,B=Y=>{if(v.length===1&&Y.tokenType.PUSH_MODE===void 0){let ne=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(Y);C.push({offset:Y.startOffset,line:Y.startLine,column:Y.startColumn,length:Y.image.length,message:ne})}else{v.pop();let ne=v.at(-1);I=this.patternIdxToConfig[ne],A=this.charCodeToPatternIdxToConfig[ne],$=I.length;let k=this.canModeBeOptimized[ne]&&this.config.safeMode===!1;A&&k?L=!0:L=!1}};function z(Y){v.push(Y),A=this.charCodeToPatternIdxToConfig[Y],I=this.patternIdxToConfig[Y],$=I.length;let ne=this.canModeBeOptimized[Y]&&this.config.safeMode===!1;A&&ne?L=!0:L=!1}z.call(this,n);let G,ee=this.config.recoveryEnabled;for(;E<T;){l=null,f=-1;let Y=y.charCodeAt(E),ne;if(L){let O=pn(Y),X=A[O];ne=X!==void 0?X:D}else ne=I;let k=ne.length;for(r=0;r<k;r++){G=ne[r];let O=G.pattern;switch(c=null,G.matchType){case Ic:Y===G.short&&(f=1,l=O);break;case la:x=O.exec(y,E,F,P),x!==null?(l=x[0],f=l.length,x.payload!==void 0&&(c=x.payload)):l=null;break;case Sc:{let X=G.asciiClass;if(X[Y]!==1){O.lastIndex=0;break}let U=E+1;for(;X[y.charCodeAt(U)]===1;)U++;f=U-E,O.lastIndex=U;break}case Rc:O.lastIndex=E,f=this.matchLength(O,t,E);break}if(f!==-1){if(a=G.longerAlt,a!==void 0){l=t.substring(E,E+f);let X=a.length;for(o=0;o<X;o++){let U=I[a[o]],K=U.pattern;if(u=null,U.matchType===la?(x=K.exec(y,E,F,P),x!==null?(s=x[0],x.payload!==void 0&&(u=x.payload)):s=null):(K.lastIndex=E,s=this.match(K,t,E)),s&&s.length>l.length){l=s,f=s.length,c=u,G=U;break}}}break}}if(f!==-1){if(d=G.group,d!==void 0&&(l=l!==null?l:t.substring(E,E+f),p=G.tokenTypeIdx,m=this.createTokenInstance(l,E,p,G.tokenType,W,j,f),this.handlePayload(m,c),d===!1?_=this.addToken(F,_,m):P[d].push(m)),S===!0&&G.canLineTerminator===!0){let O=0,X,U;b.lastIndex=0;do l=l!==null?l:t.substring(E,E+f),X=b.test(l),X===!0&&(U=b.lastIndex-1,O++);while(X===!0);O!==0?(W=W+O,j=f-U,this.updateTokenEndLineColumnLocation(m,d,U,O,W,j,f)):j=this.computeNewColumn(j,f)}else j=this.computeNewColumn(j,f);E=E+f,this.handleModes(G,B,z,m)}else{let O=E,X=W,U=j,K=ee===!1;for(;K===!1&&E<T;)for(E++,i=0;i<$;i++){let q=I[i],J=q.pattern;switch(q.matchType){case Ic:y.charCodeAt(E)===q.short&&(K=!0);break;case la:K=J.exec(y,E,F,P)!==null;break;case Sc:case Rc:J.lastIndex=E,K=J.exec(t)!==null;break}if(K===!0)break}if(g=E-O,j=this.computeNewColumn(j,g),w=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(y,O,g,X,U,v.at(-1)),C.push({offset:O,line:X,column:U,length:g,message:w}),ee===!1)break}}return this.hasCustom||(F.length=_),{tokens:F,groups:P,errors:C}}handleModes(t,n,r,i){if(t.pop===!0){let o=t.push;n(i),o!==void 0&&r.call(this,o)}else t.push!==void 0&&r.call(this,t.push)}updateTokenEndLineColumnLocation(t,n,r,i,o,s,a){let l,c;n!==void 0&&(l=r===a-1,c=l?-1:0,i===1&&l===!0||(t.endLine=o+c,t.endColumn=s-1+-c))}computeNewColumn(t,n){return t+n}createOffsetOnlyToken(t,n,r,i){return{image:t,startOffset:n,tokenTypeIdx:r,tokenType:i}}createStartOnlyToken(t,n,r,i,o,s){return{image:t,startOffset:n,startLine:o,startColumn:s,tokenTypeIdx:r,tokenType:i}}createFullToken(t,n,r,i,o,s,a){return{image:t,startOffset:n,endOffset:n+a-1,startLine:o,endLine:o,startColumn:s,endColumn:s+a-1,tokenTypeIdx:r,tokenType:i}}addTokenUsingPush(t,n,r){return t.push(r),n}addTokenUsingMemberAccess(t,n,r){return t[n]=r,n++,n}handlePayloadNoCustom(t,n){}handlePayloadWithCustom(t,n){n!==null&&(t.payload=n)}match(t,n,r){return t.test(n)===!0?n.substring(r,t.lastIndex):null}matchLength(t,n,r){return t.test(n)===!0?t.lastIndex-r:-1}};Me.SKIPPED="This marks a skipped Token pattern, this means each token identified by it will be consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.";Me.NA=/NOT_APPLICABLE/;function In(e){return kh(e)?e.LABEL:e.name}function kh(e){return typeof e.LABEL=="string"&&e.LABEL!==""}var tP="parent",ww="categories",Tw="label",_w="group",vw="push_mode",Aw="pop_mode",kw="longer_alt",Iw="line_breaks",Rw="start_chars_hint";function sr(e){return nP(e)}function nP(e){let t=e.pattern,n={};if(n.name=e.name,t!==void 0&&(n.PATTERN=t),Object.hasOwn(e,tP))throw`The parent property is no longer supported.
|
|
58
|
+
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return Object.hasOwn(e,ww)&&(n.CATEGORIES=e[ww]),kn([n]),Object.hasOwn(e,Tw)&&(n.LABEL=e[Tw]),Object.hasOwn(e,_w)&&(n.GROUP=e[_w]),Object.hasOwn(e,Aw)&&(n.POP_MODE=e[Aw]),Object.hasOwn(e,vw)&&(n.PUSH_MODE=e[vw]),Object.hasOwn(e,kw)&&(n.LONGER_ALT=e[kw]),Object.hasOwn(e,Iw)&&(n.LINE_BREAKS=e[Iw]),Object.hasOwn(e,Rw)&&(n.START_CHARS_HINT=e[Rw]),n}var ft=sr({name:"EOF",pattern:Me.NA});kn([ft]);function Rn(e,t,n,r,i,o,s,a){return{image:t,startOffset:n,endOffset:r,startLine:i,endLine:o,startColumn:s,endColumn:a,tokenTypeIdx:e.tokenTypeIdx,tokenType:e}}function uo(e,t){return An(e,t)}var Sn={buildMismatchTokenMessage({expected:e,actual:t,previous:n,ruleName:r}){return`Expecting ${kh(e)?`--> ${In(e)} <--`:`token of type --> ${e.name} <--`} but found --> '${t.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:e,ruleName:t}){return"Redundant input, expecting EOF but found: "+e.image},buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:n,customUserDescription:r,ruleName:i}){let o="Expecting: ",a=`
|
|
59
59
|
but found: '`+t[0].image+"'";if(r)return o+r+a;{let f=`one of these possible Token sequences:
|
|
60
|
-
${e.reduce((d,p)=>d.concat(p),[]).map(d=>`[${d.map(p=>
|
|
60
|
+
${e.reduce((d,p)=>d.concat(p),[]).map(d=>`[${d.map(p=>In(p)).join(", ")}]`).map((d,p)=>` ${p+1}. ${d}`).join(`
|
|
61
61
|
`)}`;return o+f+a}},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:n,ruleName:r}){let i="Expecting: ",s=`
|
|
62
62
|
but found: '`+t[0].image+"'";if(n)return i+n+s;{let l=`expecting at least one iteration which starts with one of these possible Token sequences::
|
|
63
|
-
<${e.map(c=>`[${c.map(u=>
|
|
63
|
+
<${e.map(c=>`[${c.map(u=>In(u)).join(",")}]`).join(" ,")}>`;return i+l+s}}};Object.freeze(Sn);var Sw={buildRuleNotFoundError(e,t){return"Invalid grammar, reference to a rule which is not defined: ->"+t.nonTerminalName+`<-
|
|
64
64
|
inside top level rule: ->`+e.name+"<-"}},zt={buildDuplicateFoundError(e,t){function n(u){return u instanceof le?u.terminalType.name:u instanceof Ee?u.nonTerminalName:""}let r=e.name,i=t[0],o=i.idx,s=Et(i),a=n(i),l=o>0,c=`->${s}${l?o:""}<- ${a?`with argument: ->${a}<-`:""}
|
|
65
65
|
appears more than once (${t.length} times) in the top level rule: ->${r}<-.
|
|
66
66
|
For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
|
|
@@ -69,14 +69,14 @@ inside top level rule: ->`+e.name+"<-"}},zt={buildDuplicateFoundError(e,t){funct
|
|
|
69
69
|
The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.
|
|
70
70
|
To resolve this make sure each Terminal and Non-Terminal names are unique
|
|
71
71
|
This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
|
|
72
|
-
and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(e){let t=e.prefixPath.map(i=>
|
|
72
|
+
and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(e){let t=e.prefixPath.map(i=>In(i)).join(", "),n=e.alternation.idx===0?"":e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(" ,")}> due to common lookahead prefix
|
|
73
73
|
in <OR${n}> inside <${e.topLevelRule.name}> Rule,
|
|
74
74
|
<${t}> may appears as a prefix path in all these alternatives.
|
|
75
75
|
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
|
|
76
76
|
For Further details.`},buildAlternationAmbiguityError(e){let t=e.alternation.idx===0?"":e.alternation.idx,n=e.prefixPath.length===0,r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(" ,")}> in <OR${t}> inside <${e.topLevelRule.name}> Rule,
|
|
77
77
|
`;if(n)r+=`These alternatives are all empty (match no tokens), making them indistinguishable.
|
|
78
78
|
Only the last alternative may be empty.
|
|
79
|
-
`;else{let i=e.prefixPath.map(o=>
|
|
79
|
+
`;else{let i=e.prefixPath.map(o=>In(o)).join(", ");r+=`<${i}> may appears as a prefix path in all these alternatives.
|
|
80
80
|
`}return r+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
81
81
|
For Further details.`,r},buildEmptyRepetitionError(e){let t=Et(e.repetition);return e.repetition.idx!==0&&(t+=e.repetition.idx),`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.
|
|
82
82
|
This could lead to an infinite loop.`},buildTokenNameError(e){return"deprecated"},buildEmptyAlternationError(e){return`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in <OR${e.alternation.idx}> inside <${e.topLevelRule.name}> Rule.
|
|
@@ -87,46 +87,46 @@ rule: <${t}> can be invoked from itself (directly or indirectly)
|
|
|
87
87
|
without consuming any Tokens. The grammar path that causes this is:
|
|
88
88
|
${r}
|
|
89
89
|
To fix this refactor your grammar to remove the left recursion.
|
|
90
|
-
see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(e){return"deprecated"},buildDuplicateRuleNameError(e){let t;return e.topLevelRule instanceof ct?t=e.topLevelRule.name:t=e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};function Nw(e,t){let n=new Rh(e,t);return n.resolveRefs(),n.errors}var Rh=class extends ut{constructor(t,n){super(),this.nameToTopRule=t,this.errMsgProvider=n,this.errors=[]}resolveRefs(){Object.values(this.nameToTopRule).forEach(t=>{this.currTopLevel=t,t.accept(this)})}visitNonTerminal(t){let n=this.nameToTopRule[t.nonTerminalName];if(n)t.referencedRule=n;else{let r=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,t);this.errors.push({message:r,type:Ve.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:t.nonTerminalName})}}};var Sh=class extends wn{constructor(t,n){super(),this.topProd=t,this.path=n,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=[...this.path.ruleStack].reverse(),this.occurrenceStack=[...this.path.occurrenceStack].reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(t,n=[]){this.found||super.walk(t,n)}walkProdRef(t,n,r){if(t.referencedRule.name===this.nextProductionName&&t.idx===this.nextProductionOccurrence){let i=n.concat(r);this.updateExpectedNext(),this.walk(t.referencedRule,i)}}updateExpectedNext(){this.ruleStack.length===0?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},Nc=class extends Sh{constructor(t,n){super(t,n),this.path=n,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(t,n,r){if(this.isAtEndOfPath&&t.terminalType.name===this.nextTerminalName&&t.idx===this.nextTerminalOccurrence&&!this.found){let i=n.concat(r),o=new be({definition:i});this.possibleTokTypes=ti(o),this.found=!0}}},fo=class extends wn{constructor(t,n){super(),this.topRule=t,this.occurrence=n,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},Lc=class extends fo{walkMany(t,n,r){if(t.idx===this.occurrence){let i=n.concat(r)[0];this.result.isEndOfRule=i===void 0,i instanceof le&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(t,n,r)}},ua=class extends fo{walkManySep(t,n,r){if(t.idx===this.occurrence){let i=n.concat(r)[0];this.result.isEndOfRule=i===void 0,i instanceof le&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(t,n,r)}},Pc=class extends fo{walkAtLeastOne(t,n,r){if(t.idx===this.occurrence){let i=n.concat(r)[0];this.result.isEndOfRule=i===void 0,i instanceof le&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(t,n,r)}},fa=class extends fo{walkAtLeastOneSep(t,n,r){if(t.idx===this.occurrence){let i=n.concat(r)[0];this.result.isEndOfRule=i===void 0,i instanceof le&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(t,n,r)}};function Cc(e,t,n=[]){n=[...n];let r=[],i=0;function o(a){return a.concat(e.slice(i+1))}function s(a){let l=Cc(o(a),t,n);return r.concat(l)}for(;n.length<t&&i<e.length;){let a=e[i];if(a instanceof be)return s(a.definition);if(a instanceof Ee)return s(a.definition);if(a instanceof we)r=s(a.definition);else if(a instanceof Ne){let l=a.definition.concat([new me({definition:a.definition})]);return s(l)}else if(a instanceof Le){let l=[new be({definition:a.definition}),new me({definition:[new le({terminalType:a.separator})].concat(a.definition)})];return s(l)}else if(a instanceof ke){let l=a.definition.concat([new me({definition:[new le({terminalType:a.separator})].concat(a.definition)})]);r=s(l)}else if(a instanceof me){let l=a.definition.concat([new me({definition:a.definition})]);r=s(l)}else{if(a instanceof Ie)return a.definition.forEach(l=>{l.definition.length!==0&&(r=s(l.definition))}),r;if(a instanceof le)n.push(a.terminalType);else throw Error("non exhaustive match")}i++}return r.push({partialPath:n,suffixDef:e.slice(i)}),r}function Lw(e,t,n,r){let i="EXIT_NONE_TERMINAL",o=[i],s="EXIT_ALTERNATIVE",a=!1,l=t.length,c=l-r-1,u=[],f=[];for(f.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});f.length!==0;){let d=f.pop();if(d===s){a&&f.at(-1).idx<=c&&f.pop();continue}let p=d.def,m=d.idx,g=d.ruleStack,w=d.occurrenceStack;if(p.length===0)continue;let x=p[0];if(x===i){let y={idx:m,def:p.slice(1),ruleStack:g.slice(0,-1),occurrenceStack:w.slice(0,-1)};f.push(y)}else if(x instanceof le)if(m<l-1){let y=m+1,T=t[y];if(n(T,x.terminalType)){let E={idx:y,def:p.slice(1),ruleStack:g,occurrenceStack:w};f.push(E)}}else if(m===l-1)u.push({nextTokenType:x.terminalType,nextTokenOccurrence:x.idx,ruleStack:g,occurrenceStack:w}),a=!0;else throw Error("non exhaustive match");else if(x instanceof Ee){let y=[...g];y.push(x.nonTerminalName);let T=[...w];T.push(x.idx);let E={idx:m,def:x.definition.concat(o,p.slice(1)),ruleStack:y,occurrenceStack:T};f.push(E)}else if(x instanceof we){let y={idx:m,def:p.slice(1),ruleStack:g,occurrenceStack:w};f.push(y),f.push(s);let T={idx:m,def:x.definition.concat(p.slice(1)),ruleStack:g,occurrenceStack:w};f.push(T)}else if(x instanceof Ne){let y=new me({definition:x.definition,idx:x.idx}),T=x.definition.concat([y],p.slice(1)),E={idx:m,def:T,ruleStack:g,occurrenceStack:w};f.push(E)}else if(x instanceof Le){let y=new le({terminalType:x.separator}),T=new me({definition:[y].concat(x.definition),idx:x.idx}),E=x.definition.concat([T],p.slice(1)),v={idx:m,def:E,ruleStack:g,occurrenceStack:w};f.push(v)}else if(x instanceof ke){let y={idx:m,def:p.slice(1),ruleStack:g,occurrenceStack:w};f.push(y),f.push(s);let T=new le({terminalType:x.separator}),E=new me({definition:[T].concat(x.definition),idx:x.idx}),v=x.definition.concat([E],p.slice(1)),S={idx:m,def:v,ruleStack:g,occurrenceStack:w};f.push(S)}else if(x instanceof me){let y={idx:m,def:p.slice(1),ruleStack:g,occurrenceStack:w};f.push(y),f.push(s);let T=new me({definition:x.definition,idx:x.idx}),E=x.definition.concat([T],p.slice(1)),v={idx:m,def:E,ruleStack:g,occurrenceStack:w};f.push(v)}else if(x instanceof Ie)for(let y=x.definition.length-1;y>=0;y--){let T=x.definition[y],E={idx:m,def:T.definition.concat(p.slice(1)),ruleStack:g,occurrenceStack:w};f.push(E),f.push(s)}else if(x instanceof be)f.push({idx:m,def:x.definition.concat(p.slice(1)),ruleStack:g,occurrenceStack:w});else if(x instanceof ct)f.push(rP(x,m,g,w));else throw Error("non exhaustive match")}return u}function rP(e,t,n,r){let i=[...n];i.push(e.name);let o=[...r];return o.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:o}}var Fe;(function(e){e[e.OPTION=0]="OPTION",e[e.REPETITION=1]="REPETITION",e[e.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",e[e.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",e[e.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",e[e.ALTERNATION=5]="ALTERNATION"})(Fe||(Fe={}));function da(e){if(e instanceof we||e==="Option")return Fe.OPTION;if(e instanceof me||e==="Repetition")return Fe.REPETITION;if(e instanceof Ne||e==="RepetitionMandatory")return Fe.REPETITION_MANDATORY;if(e instanceof Le||e==="RepetitionMandatoryWithSeparator")return Fe.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof ke||e==="RepetitionWithSeparator")return Fe.REPETITION_WITH_SEPARATOR;if(e instanceof Ie||e==="Alternation")return Fe.ALTERNATION;throw Error("non exhaustive match")}function $c(e){let{occurrence:t,rule:n,prodType:r,maxLookahead:i}=e,o=da(r);return o===Fe.ALTERNATION?po(t,n,i):ho(t,n,o,i)}function Cw(e,t,n,r,i,o){let s=po(e,t,n),a=Bw(s)?lo:Tn;return o(s,r,a,i)}function Ow(e,t,n,r,i,o){let s=ho(e,t,i,n),a=Bw(s)?lo:Tn;return o(s[0],a,r)}function $w(e,t,n,r){let i=e.length,o=e.every(s=>s.every(a=>a.length===1));if(t)return function(s){let a=s.map(l=>l.GATE);for(let l=0;l<i;l++){let c=e[l],u=c.length,f=a[l];if(!(f!==void 0&&f.call(this)===!1))e:for(let d=0;d<u;d++){let p=c[d],m=p.length;for(let g=0;g<m;g++){let w=this.LA_FAST(g+1);if(n(w,p[g])===!1)continue e}return l}}};if(o&&!r){let a=e.map(l=>l.flat()).reduce((l,c,u)=>(c.forEach(f=>{f.tokenTypeIdx in l||(l[f.tokenTypeIdx]=u),f.categoryMatches.forEach(d=>{Object.hasOwn(l,d)||(l[d]=u)})}),l),{});return function(){let l=this.LA_FAST(1);return a[l.tokenTypeIdx]}}else return function(){for(let s=0;s<i;s++){let a=e[s],l=a.length;e:for(let c=0;c<l;c++){let u=a[c],f=u.length;for(let d=0;d<f;d++){let p=this.LA_FAST(d+1);if(n(p,u[d])===!1)continue e}return s}}}}function Dw(e,t,n){let r=e.every(o=>o.length===1),i=e.length;if(r&&!n){let o=e.flat();if(o.length===1&&o[0].categoryMatches.length===0){let a=o[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===a}}else{let s=o.reduce((a,l,c)=>(a[l.tokenTypeIdx]=!0,l.categoryMatches.forEach(u=>{a[u]=!0}),a),[]);return function(){let a=this.LA_FAST(1);return s[a.tokenTypeIdx]===!0}}}else return function(){e:for(let o=0;o<i;o++){let s=e[o],a=s.length;for(let l=0;l<a;l++){let c=this.LA_FAST(l+1);if(t(c,s[l])===!1)continue e}return!0}return!1}}var Nh=class extends wn{constructor(t,n,r){super(),this.topProd=t,this.targetOccurrence=n,this.targetProdType=r}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(t,n,r,i){return t.idx===this.targetOccurrence&&this.targetProdType===n?(this.restDef=r.concat(i),!0):!1}walkOption(t,n,r){this.checkIsTarget(t,Fe.OPTION,n,r)||super.walkOption(t,n,r)}walkAtLeastOne(t,n,r){this.checkIsTarget(t,Fe.REPETITION_MANDATORY,n,r)||super.walkOption(t,n,r)}walkAtLeastOneSep(t,n,r){this.checkIsTarget(t,Fe.REPETITION_MANDATORY_WITH_SEPARATOR,n,r)||super.walkOption(t,n,r)}walkMany(t,n,r){this.checkIsTarget(t,Fe.REPETITION,n,r)||super.walkOption(t,n,r)}walkManySep(t,n,r){this.checkIsTarget(t,Fe.REPETITION_WITH_SEPARATOR,n,r)||super.walkOption(t,n,r)}},Oc=class extends ut{constructor(t,n,r){super(),this.targetOccurrence=t,this.targetProdType=n,this.targetRef=r,this.result=[]}checkIsTarget(t,n){t.idx===this.targetOccurrence&&this.targetProdType===n&&(this.targetRef===void 0||t===this.targetRef)&&(this.result=t.definition)}visitOption(t){this.checkIsTarget(t,Fe.OPTION)}visitRepetition(t){this.checkIsTarget(t,Fe.REPETITION)}visitRepetitionMandatory(t){this.checkIsTarget(t,Fe.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(t){this.checkIsTarget(t,Fe.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(t){this.checkIsTarget(t,Fe.REPETITION_WITH_SEPARATOR)}visitAlternation(t){this.checkIsTarget(t,Fe.ALTERNATION)}};function Pw(e){let t=new Array(e);for(let n=0;n<e;n++)t[n]=[];return t}function bh(e){let t=[""];for(let n=0;n<e.length;n++){let r=e[n],i=[];for(let o=0;o<t.length;o++){let s=t[o];i.push(s+"_"+r.tokenTypeIdx);for(let a=0;a<r.categoryMatches.length;a++){let l="_"+r.categoryMatches[a];i.push(s+l)}}t=i}return t}function iP(e,t,n){for(let r=0;r<e.length;r++){if(r===n)continue;let i=e[r];for(let o=0;o<t.length;o++){let s=t[o];if(i[s]===!0)return!1}}return!0}function Mw(e,t){let n=e.map(s=>Cc([s],1)),r=Pw(n.length),i=n.map(s=>{let a={};return s.forEach(l=>{bh(l.partialPath).forEach(u=>{a[u]=!0})}),a}),o=n;for(let s=1;s<=t;s++){let a=o;o=Pw(a.length);for(let l=0;l<a.length;l++){let c=a[l];for(let u=0;u<c.length;u++){let f=c[u].partialPath,d=c[u].suffixDef,p=bh(f);if(iP(i,p,l)||d.length===0||f.length===t){let g=r[l];if(Dc(g,f)===!1){g.push(f);for(let w=0;w<p.length;w++){let x=p[w];i[l][x]=!0}}}else{let g=Cc(d,s+1,f);o[l]=o[l].concat(g),g.forEach(w=>{bh(w.partialPath).forEach(y=>{i[l][y]=!0})})}}}}return r}function po(e,t,n,r){let i=new Oc(e,Fe.ALTERNATION,r);return t.accept(i),Mw(i.result,n)}function ho(e,t,n,r){let i=new Oc(e,n);t.accept(i);let o=i.result,a=new Nh(t,e,n).startWalking(),l=new be({definition:o}),c=new be({definition:a});return Mw([l,c],r)}function Dc(e,t){e:for(let n=0;n<e.length;n++){let r=e[n];if(r.length===t.length){for(let i=0;i<r.length;i++){let o=t[i],s=r[i];if((o===s||s.categoryMatchesMap[o.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}function Fw(e,t){return e.length<t.length&&e.every((n,r)=>{let i=t[r];return n===i||i.categoryMatchesMap[n.tokenTypeIdx]})}function Bw(e){return e.every(t=>t.every(n=>n.every(r=>r.categoryMatches.length===0)))}function Ww(e){return e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName}).map(n=>Object.assign({type:Ve.CUSTOM_LOOKAHEAD_VALIDATION},n))}function Xw(e,t,n,r){let i=e.flatMap(l=>oP(l,n)),o=fP(e,t,n),s=e.flatMap(l=>lP(l,n)),a=e.flatMap(l=>aP(l,e,r,n));return i.concat(o,s,a)}function oP(e,t){let n=new Lh;e.accept(n);let r=n.allProductions,i=Object.groupBy(r,sP),o=Object.fromEntries(Object.entries(i).filter(([a,l])=>l.length>1));return Object.values(o).map(a=>{let l=a[0],c=t.buildDuplicateFoundError(e,a),u=Et(l),f={message:c,type:Ve.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:u,occurrence:l.idx},d=Uw(l);return d&&(f.parameter=d),f})}function sP(e){return`${Et(e)}_#_${e.idx}_#_${Uw(e)}`}function Uw(e){return e instanceof le?e.terminalType.name:e instanceof Ee?e.nonTerminalName:""}var Lh=class extends ut{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(t){this.allProductions.push(t)}visitOption(t){this.allProductions.push(t)}visitRepetitionWithSeparator(t){this.allProductions.push(t)}visitRepetitionMandatory(t){this.allProductions.push(t)}visitRepetitionMandatoryWithSeparator(t){this.allProductions.push(t)}visitRepetition(t){this.allProductions.push(t)}visitAlternation(t){this.allProductions.push(t)}visitTerminal(t){this.allProductions.push(t)}};function aP(e,t,n,r){let i=[];if(t.reduce((s,a)=>a.name===e.name?s+1:s,0)>1){let s=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});i.push({message:s,type:Ve.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}function Gw(e,t,n){let r=[],i;return t.includes(e)||(i=`Invalid rule override, rule: ->${e}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:Ve.INVALID_RULE_OVERRIDE,ruleName:e})),r}function Ch(e,t,n,r=[]){let i=[],o=Mc(t.definition);if(o.length===0)return[];{let s=e.name;o.includes(e)&&i.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:r}),type:Ve.LEFT_RECURSION,ruleName:s});let l=r.concat([e]),u=o.filter(f=>!l.includes(f)).flatMap(f=>{let d=[...r];return d.push(f),Ch(e,f,n,d)});return i.concat(u)}}function Mc(e){let t=[];if(e.length===0)return t;let n=e[0];if(n instanceof Ee)t.push(n.referencedRule);else if(n instanceof be||n instanceof we||n instanceof Ne||n instanceof Le||n instanceof ke||n instanceof me)t=t.concat(Mc(n.definition));else if(n instanceof Ie)t=n.definition.map(o=>Mc(o.definition)).flat();else if(!(n instanceof le))throw Error("non exhaustive match");let r=ei(n),i=e.length>1;if(r&&i){let o=e.slice(1);return t.concat(Mc(o))}else return t}var pa=class extends ut{constructor(){super(...arguments),this.alternations=[]}visitAlternation(t){this.alternations.push(t)}};function Hw(e,t){let n=new pa;return e.accept(n),n.alternations.flatMap(o=>o.definition.slice(0,-1).flatMap((a,l)=>Lw([a],[],Tn,1).length===0?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:o,emptyChoiceIdx:l}),type:Ve.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:o.idx,alternative:l+1}]:[]))}function zw(e,t,n){let r=new pa;e.accept(r);let i=r.alternations;return i=i.filter(s=>s.ignoreAmbiguities!==!0),i.flatMap(s=>{let a=s.idx,l=s.maxLookahead||t,c=po(a,e,l,s),u=cP(c,s,e,n),f=uP(c,s,e,n);return u.concat(f)})}var Ph=class extends ut{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(t){this.allProductions.push(t)}visitRepetitionMandatory(t){this.allProductions.push(t)}visitRepetitionMandatoryWithSeparator(t){this.allProductions.push(t)}visitRepetition(t){this.allProductions.push(t)}};function lP(e,t){let n=new pa;return e.accept(n),n.alternations.flatMap(o=>o.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:o}),type:Ve.TOO_MANY_ALTS,ruleName:e.name,occurrence:o.idx}]:[])}function jw(e,t,n){let r=[];return e.forEach(i=>{let o=new Ph;i.accept(o),o.allProductions.forEach(a=>{let l=da(a),c=a.maxLookahead||t,u=a.idx;if(ho(u,i,l,c)[0].flat().length===0){let p=n.buildEmptyRepetitionError({topLevelRule:i,repetition:a});r.push({message:p,type:Ve.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),r}function cP(e,t,n,r){let i=[];return e.reduce((a,l,c)=>(t.definition[c].ignoreAmbiguities===!0||l.forEach(u=>{let f=[c];e.forEach((d,p)=>{c!==p&&Dc(d,u)&&t.definition[p].ignoreAmbiguities!==!0&&f.push(p)}),f.length>1&&!Dc(i,u)&&(i.push(u),a.push({alts:f,path:u}))}),a),[]).map(a=>{let l=a.alts.map(u=>u+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:l,prefixPath:a.path}),type:Ve.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:t.idx,alternatives:a.alts}})}function uP(e,t,n,r){let i=e.reduce((s,a,l)=>{let c=a.map(u=>({idx:l,path:u}));return s.concat(c)},[]);return i.flatMap(s=>{if(t.definition[s.idx].ignoreAmbiguities===!0)return[];let l=s.idx,c=s.path;return i.filter(d=>t.definition[d.idx].ignoreAmbiguities!==!0&&d.idx<l&&Fw(d.path,c)).map(d=>{let p=[d.idx+1,l+1],m=t.idx===0?"":t.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:p,prefixPath:d.path}),type:Ve.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:m,alternatives:p}})})}function fP(e,t,n){let r=[],i=t.map(o=>o.name);return e.forEach(o=>{let s=o.name;if(i.includes(s)){let a=n.buildNamespaceConflictError(o);r.push({message:a,type:Ve.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),r}function Yw(e){let t=Object.assign({errMsgProvider:bw},e),n={};return e.rules.forEach(r=>{n[r.name]=r}),Nw(n,t.errMsgProvider)}function Vw(e){var t;let n=(t=e.errMsgProvider)!==null&&t!==void 0?t:zt;return Xw(e.rules,e.tokenTypes,n,e.grammarName)}var Kw="MismatchedTokenException",qw="NoViableAltException",Zw="EarlyExitException",Jw="NotAllInputParsedException",Qw=[Kw,qw,Zw,Jw];Object.freeze(Qw);function sr(e){return Qw.includes(e.name)}var mo=class extends Error{constructor(t,n){super(t),this.token=n,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},ii=class extends mo{constructor(t,n,r){super(t,n),this.previousToken=r,this.name=Kw}},ha=class extends mo{constructor(t,n,r){super(t,n),this.previousToken=r,this.name=qw}},ma=class extends mo{constructor(t,n){super(t,n),this.name=Jw}},ga=class extends mo{constructor(t,n,r){super(t,n),this.previousToken=r,this.name=Zw}};var Oh={},Dh="InRuleRecoveryException",$h=class extends Error{constructor(t){super(t),this.name=Dh}},Fc=class{initRecoverable(t){this.firstAfterRepMap=[],this.resyncFollows={},this.recoveryEnabled=Object.hasOwn(t,"recoveryEnabled")?t.recoveryEnabled:dt.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=dP)}getTokenToInsert(t){let n=An(t,"",-1,-1,-1,-1,-1,-1);return n.isInsertedInRecovery=!0,n}canTokenTypeBeInsertedInRecovery(t){return!0}canTokenTypeBeDeletedInRecovery(t){return!0}tryInRepetitionRecovery(t,n,r,i){let o=this.findReSyncTokenType(),s=this.exportLexerState(),a=[],l=!1,c=this.LA_FAST(1),u=this.LA_FAST(1),f=()=>{let d=this.LA(0),p=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:c,previous:d,ruleName:this.getCurrRuleFullName()}),m=new ii(p,c,this.LA(0));m.resyncedTokens=a.slice(0,-1),this.SAVE_ERROR(m)};for(;!l;)if(this.tokenMatcher(u,i)){f();return}else if(r.call(this)){f(),t.apply(this,n);return}else this.tokenMatcher(u,o)?l=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,a));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(t,n,r){return!(r===!1||this.tokenMatcher(this.LA_FAST(1),t)||this.isBackTracking()||this.canPerformInRuleRecovery(t,this.getFollowsForInRuleRecovery(t,n)))}getNextPossibleTokenTypes(t){let n=t.ruleStack[0],i=this.getGAstProductions()[n];return new Nc(i,t).startWalking()}getFollowsForInRuleRecovery(t,n){let r=this.getCurrentGrammarPath(t,n);return this.getNextPossibleTokenTypes(r)}tryInRuleRecovery(t,n){if(this.canRecoverWithSingleTokenInsertion(t,n))return this.getTokenToInsert(t);if(this.canRecoverWithSingleTokenDeletion(t)){let r=this.SKIP_TOKEN();return this.consumeToken(),r}throw new $h("sad sad panda")}canPerformInRuleRecovery(t,n){return this.canRecoverWithSingleTokenInsertion(t,n)||this.canRecoverWithSingleTokenDeletion(t)}canRecoverWithSingleTokenInsertion(t,n){if(!this.canTokenTypeBeInsertedInRecovery(t)||n.length===0)return!1;let r=this.LA_FAST(1);return n.find(o=>this.tokenMatcher(r,o))!==void 0}canRecoverWithSingleTokenDeletion(t){return this.canTokenTypeBeDeletedInRecovery(t)?this.tokenMatcher(this.LA(2),t):!1}isInCurrentRuleReSyncSet(t){let n=this.getCurrFollowKey();return this.getFollowSetFromFollowKey(n).includes(t)}findReSyncTokenType(){let t=this.flattenFollowSet(),n=this.LA_FAST(1),r=2;for(;;){let i=t.find(o=>uo(n,o));if(i!==void 0)return i;n=this.LA(r),r++}}getCurrFollowKey(){if(this.RULE_STACK_IDX===0)return Oh;let t=this.currRuleShortName,n=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(t),idxInCallingRule:n,inRule:this.shortRuleNameToFullName(r)}}buildFullFollowKeyStack(){let t=this.RULE_STACK,n=this.RULE_OCCURRENCE_STACK,r=this.RULE_STACK_IDX+1,i=new Array(r);for(let o=0;o<r;o++)o===0?i[o]=Oh:i[o]={ruleName:this.shortRuleNameToFullName(t[o]),idxInCallingRule:n[o],inRule:this.shortRuleNameToFullName(t[o-1])};return i}flattenFollowSet(){return this.buildFullFollowKeyStack().map(n=>this.getFollowSetFromFollowKey(n)).flat()}getFollowSetFromFollowKey(t){if(t===Oh)return[ft];let n=t.ruleName+t.idxInCallingRule+Tc+t.inRule;return this.resyncFollows[n]}addToResyncTokens(t,n){return this.tokenMatcher(t,ft)||n.push(t),n}reSyncTo(t){let n=[],r=this.LA_FAST(1);for(;this.tokenMatcher(r,t)===!1;)r=this.SKIP_TOKEN(),this.addToResyncTokens(r,n);return n.slice(0,-1)}attemptInRepetitionRecovery(t,n,r,i,o,s,a){}getCurrentGrammarPath(t,n){let r=this.getHumanReadableRuleStack(),i=this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1);return{ruleStack:r,occurrenceStack:i,lastTok:t,lastTokOccurrence:n}}getHumanReadableRuleStack(){let t=this.RULE_STACK_IDX+1,n=new Array(t);for(let r=0;r<t;r++)n[r]=this.shortRuleNameToFullName(this.RULE_STACK[r]);return n}};function dP(e,t,n,r,i,o,s){var a,l,c;let u=r|i,f=(a=(l=this.firstAfterRepMap)[c=this.currRuleShortName])!==null&&a!==void 0?a:l[c]=[],d=f[u];if(d===void 0){let w=this.getCurrRuleFullName(),x=this.getGAstProductions()[w];d=new o(x,i).startWalking(),f[u]=d}let p=d.token,m=d.occurrence,g=d.isEndOfRule;this.RULE_STACK_IDX===0&&g&&p===void 0&&(p=ft,m=1),!(p===void 0||m===void 0)&&this.shouldInRepetitionRecoveryBeTried(p,m,s)&&this.tryInRepetitionRecovery(e,t,n,p)}var In=class{constructor(t){var n;this.maxLookahead=(n=t?.maxLookahead)!==null&&n!==void 0?n:dt.maxLookahead}validate(t){let n=this.validateNoLeftRecursion(t.rules);if(n.length===0){let r=this.validateEmptyOrAlternatives(t.rules),i=this.validateAmbiguousAlternationAlternatives(t.rules,this.maxLookahead),o=this.validateSomeNonEmptyLookaheadPath(t.rules,this.maxLookahead);return[...n,...r,...i,...o]}return n}validateNoLeftRecursion(t){return t.flatMap(n=>Ch(n,n,zt))}validateEmptyOrAlternatives(t){return t.flatMap(n=>Hw(n,zt))}validateAmbiguousAlternationAlternatives(t,n){return t.flatMap(r=>zw(r,n,zt))}validateSomeNonEmptyLookaheadPath(t,n){return jw(t,n,zt)}buildLookaheadForAlternation(t){return Cw(t.prodOccurrence,t.rule,t.maxLookahead,t.hasPredicates,t.dynamicTokensEnabled,$w)}buildLookaheadForOptional(t){return Ow(t.prodOccurrence,t.rule,t.maxLookahead,t.dynamicTokensEnabled,da(t.prodType),Dw)}};var Wc=class{initLooksAhead(t){this.dynamicTokensEnabled=Object.hasOwn(t,"dynamicTokensEnabled")?t.dynamicTokensEnabled:dt.dynamicTokensEnabled,this.maxLookahead=Object.hasOwn(t,"maxLookahead")?t.maxLookahead:dt.maxLookahead,this.lookaheadStrategy=Object.hasOwn(t,"lookaheadStrategy")?t.lookaheadStrategy:new In({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=[],this.currRuleLookaheadFuncs=[]}preComputeLookaheadFunctions(t){t.forEach(n=>{this.TRACE_INIT(`${n.name} Rule Lookahead`,()=>{let{alternation:r,repetition:i,option:o,repetitionMandatory:s,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:l}=pP(n);r.forEach(c=>{let u=c.idx===0?"":c.idx;this.TRACE_INIT(`${Et(c)}${u}`,()=>{let f=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:c.idx,rule:n,maxLookahead:c.maxLookahead||this.maxLookahead,hasPredicates:c.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled});this.setLaFuncCache(this.fullRuleNameToShort[n.name],256|c.idx,f)})}),i.forEach(c=>{this.computeLookaheadFunc(n,c.idx,768,"Repetition",c.maxLookahead,Et(c))}),o.forEach(c=>{this.computeLookaheadFunc(n,c.idx,512,"Option",c.maxLookahead,Et(c))}),s.forEach(c=>{this.computeLookaheadFunc(n,c.idx,1024,"RepetitionMandatory",c.maxLookahead,Et(c))}),a.forEach(c=>{this.computeLookaheadFunc(n,c.idx,1536,"RepetitionMandatoryWithSeparator",c.maxLookahead,Et(c))}),l.forEach(c=>{this.computeLookaheadFunc(n,c.idx,1280,"RepetitionWithSeparator",c.maxLookahead,Et(c))})})})}computeLookaheadFunc(t,n,r,i,o,s){this.TRACE_INIT(`${s}${n===0?"":n}`,()=>{let a=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:n,rule:t,maxLookahead:o||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i});this.setLaFuncCache(this.fullRuleNameToShort[t.name],r|n,a)})}setLaFuncCache(t,n,r){let i=this.lookAheadFuncsCache[t];i===void 0&&(i=[],this.lookAheadFuncsCache[t]=i),i[n]=r}},Mh=class extends ut{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(t){this.dslMethods.option.push(t)}visitRepetitionWithSeparator(t){this.dslMethods.repetitionWithSeparator.push(t)}visitRepetitionMandatory(t){this.dslMethods.repetitionMandatory.push(t)}visitRepetitionMandatoryWithSeparator(t){this.dslMethods.repetitionMandatoryWithSeparator.push(t)}visitRepetition(t){this.dslMethods.repetition.push(t)}visitAlternation(t){this.dslMethods.alternation.push(t)}},Bc=new Mh;function pP(e){Bc.reset(),e.accept(Bc);let t=Bc.dslMethods;return Bc.reset(),t}function Wh(e,t){e.startOffset===-1?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset<t.endOffset&&(e.endOffset=t.endOffset)}function Xh(e,t){e.startOffset===-1?(e.startOffset=t.startOffset,e.startColumn=t.startColumn,e.startLine=t.startLine,e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine):e.endOffset<t.endOffset&&(e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine)}function eT(e,t,n){e.children[n]===void 0?e.children[n]=[t]:e.children[n].push(t)}function tT(e,t,n){e.children[t]===void 0?e.children[t]=[n]:e.children[t].push(n)}var hP="name";function Uh(e,t){Object.defineProperty(e,hP,{enumerable:!1,configurable:!0,writable:!1,value:t})}function mP(e,t){let n=Object.keys(e),r=n.length;for(let i=0;i<r;i++){let o=n[i],s=e[o],a=s.length;for(let l=0;l<a;l++){let c=s[l];c.tokenTypeIdx===void 0&&this[c.name](c.children,t)}}}function nT(e,t){let n=function(){};Uh(n,e+"BaseSemantics");let r={visit:function(i,o){if(Array.isArray(i)&&(i=i[0]),i!==void 0)return this[i.name](i.children,o)},validateVisitor:function(){let i=gP(this,t);if(i.length!==0){let o=i.map(s=>s.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
|
|
90
|
+
see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(e){return"deprecated"},buildDuplicateRuleNameError(e){let t;return e.topLevelRule instanceof ct?t=e.topLevelRule.name:t=e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}};function bw(e,t){let n=new Ih(e,t);return n.resolveRefs(),n.errors}var Ih=class extends ut{constructor(t,n){super(),this.nameToTopRule=t,this.errMsgProvider=n,this.errors=[]}resolveRefs(){Object.values(this.nameToTopRule).forEach(t=>{this.currTopLevel=t,t.accept(this)})}visitNonTerminal(t){let n=this.nameToTopRule[t.nonTerminalName];if(n)t.referencedRule=n;else{let r=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,t);this.errors.push({message:r,type:Ve.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:t.nonTerminalName})}}};var Rh=class extends vn{constructor(t,n){super(),this.topProd=t,this.path=n,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=[...this.path.ruleStack].reverse(),this.occurrenceStack=[...this.path.occurrenceStack].reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(t,n=[]){this.found||super.walk(t,n)}walkProdRef(t,n,r){if(t.referencedRule.name===this.nextProductionName&&t.idx===this.nextProductionOccurrence){let i=n.concat(r);this.updateExpectedNext(),this.walk(t.referencedRule,i)}}updateExpectedNext(){this.ruleStack.length===0?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},bc=class extends Rh{constructor(t,n){super(t,n),this.path=n,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(t,n,r){if(this.isAtEndOfPath&&t.terminalType.name===this.nextTerminalName&&t.idx===this.nextTerminalOccurrence&&!this.found){let i=n.concat(r),o=new be({definition:i});this.possibleTokTypes=ti(o),this.found=!0}}},fo=class extends vn{constructor(t,n){super(),this.topRule=t,this.occurrence=n,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},Nc=class extends fo{walkMany(t,n,r){if(t.idx===this.occurrence){let i=n.concat(r)[0];this.result.isEndOfRule=i===void 0,i instanceof le&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(t,n,r)}},ua=class extends fo{walkManySep(t,n,r){if(t.idx===this.occurrence){let i=n.concat(r)[0];this.result.isEndOfRule=i===void 0,i instanceof le&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(t,n,r)}},Lc=class extends fo{walkAtLeastOne(t,n,r){if(t.idx===this.occurrence){let i=n.concat(r)[0];this.result.isEndOfRule=i===void 0,i instanceof le&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(t,n,r)}},fa=class extends fo{walkAtLeastOneSep(t,n,r){if(t.idx===this.occurrence){let i=n.concat(r)[0];this.result.isEndOfRule=i===void 0,i instanceof le&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(t,n,r)}};function Pc(e,t,n=[]){n=[...n];let r=[],i=0;function o(a){return a.concat(e.slice(i+1))}function s(a){let l=Pc(o(a),t,n);return r.concat(l)}for(;n.length<t&&i<e.length;){let a=e[i];if(a instanceof be)return s(a.definition);if(a instanceof Ee)return s(a.definition);if(a instanceof we)r=s(a.definition);else if(a instanceof Ne){let l=a.definition.concat([new me({definition:a.definition})]);return s(l)}else if(a instanceof Le){let l=[new be({definition:a.definition}),new me({definition:[new le({terminalType:a.separator})].concat(a.definition)})];return s(l)}else if(a instanceof ke){let l=a.definition.concat([new me({definition:[new le({terminalType:a.separator})].concat(a.definition)})]);r=s(l)}else if(a instanceof me){let l=a.definition.concat([new me({definition:a.definition})]);r=s(l)}else{if(a instanceof Ie)return a.definition.forEach(l=>{l.definition.length!==0&&(r=s(l.definition))}),r;if(a instanceof le)n.push(a.terminalType);else throw Error("non exhaustive match")}i++}return r.push({partialPath:n,suffixDef:e.slice(i)}),r}function Nw(e,t,n,r){let i="EXIT_NONE_TERMINAL",o=[i],s="EXIT_ALTERNATIVE",a=!1,l=t.length,c=l-r-1,u=[],f=[];for(f.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});f.length!==0;){let d=f.pop();if(d===s){a&&f.at(-1).idx<=c&&f.pop();continue}let p=d.def,m=d.idx,g=d.ruleStack,w=d.occurrenceStack;if(p.length===0)continue;let x=p[0];if(x===i){let y={idx:m,def:p.slice(1),ruleStack:g.slice(0,-1),occurrenceStack:w.slice(0,-1)};f.push(y)}else if(x instanceof le)if(m<l-1){let y=m+1,T=t[y];if(n(T,x.terminalType)){let E={idx:y,def:p.slice(1),ruleStack:g,occurrenceStack:w};f.push(E)}}else if(m===l-1)u.push({nextTokenType:x.terminalType,nextTokenOccurrence:x.idx,ruleStack:g,occurrenceStack:w}),a=!0;else throw Error("non exhaustive match");else if(x instanceof Ee){let y=[...g];y.push(x.nonTerminalName);let T=[...w];T.push(x.idx);let E={idx:m,def:x.definition.concat(o,p.slice(1)),ruleStack:y,occurrenceStack:T};f.push(E)}else if(x instanceof we){let y={idx:m,def:p.slice(1),ruleStack:g,occurrenceStack:w};f.push(y),f.push(s);let T={idx:m,def:x.definition.concat(p.slice(1)),ruleStack:g,occurrenceStack:w};f.push(T)}else if(x instanceof Ne){let y=new me({definition:x.definition,idx:x.idx}),T=x.definition.concat([y],p.slice(1)),E={idx:m,def:T,ruleStack:g,occurrenceStack:w};f.push(E)}else if(x instanceof Le){let y=new le({terminalType:x.separator}),T=new me({definition:[y].concat(x.definition),idx:x.idx}),E=x.definition.concat([T],p.slice(1)),_={idx:m,def:E,ruleStack:g,occurrenceStack:w};f.push(_)}else if(x instanceof ke){let y={idx:m,def:p.slice(1),ruleStack:g,occurrenceStack:w};f.push(y),f.push(s);let T=new le({terminalType:x.separator}),E=new me({definition:[T].concat(x.definition),idx:x.idx}),_=x.definition.concat([E],p.slice(1)),R={idx:m,def:_,ruleStack:g,occurrenceStack:w};f.push(R)}else if(x instanceof me){let y={idx:m,def:p.slice(1),ruleStack:g,occurrenceStack:w};f.push(y),f.push(s);let T=new me({definition:x.definition,idx:x.idx}),E=x.definition.concat([T],p.slice(1)),_={idx:m,def:E,ruleStack:g,occurrenceStack:w};f.push(_)}else if(x instanceof Ie)for(let y=x.definition.length-1;y>=0;y--){let T=x.definition[y],E={idx:m,def:T.definition.concat(p.slice(1)),ruleStack:g,occurrenceStack:w};f.push(E),f.push(s)}else if(x instanceof be)f.push({idx:m,def:x.definition.concat(p.slice(1)),ruleStack:g,occurrenceStack:w});else if(x instanceof ct)f.push(rP(x,m,g,w));else throw Error("non exhaustive match")}return u}function rP(e,t,n,r){let i=[...n];i.push(e.name);let o=[...r];return o.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:o}}var Fe;(function(e){e[e.OPTION=0]="OPTION",e[e.REPETITION=1]="REPETITION",e[e.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",e[e.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",e[e.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",e[e.ALTERNATION=5]="ALTERNATION"})(Fe||(Fe={}));function da(e){if(e instanceof we||e==="Option")return Fe.OPTION;if(e instanceof me||e==="Repetition")return Fe.REPETITION;if(e instanceof Ne||e==="RepetitionMandatory")return Fe.REPETITION_MANDATORY;if(e instanceof Le||e==="RepetitionMandatoryWithSeparator")return Fe.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof ke||e==="RepetitionWithSeparator")return Fe.REPETITION_WITH_SEPARATOR;if(e instanceof Ie||e==="Alternation")return Fe.ALTERNATION;throw Error("non exhaustive match")}function Oc(e){let{occurrence:t,rule:n,prodType:r,maxLookahead:i}=e,o=da(r);return o===Fe.ALTERNATION?po(t,n,i):ho(t,n,o,i)}function Pw(e,t,n,r,i,o){let s=po(e,t,n),a=Fw(s)?lo:An;return o(s,r,a,i)}function Cw(e,t,n,r,i,o){let s=ho(e,t,i,n),a=Fw(s)?lo:An;return o(s[0],a,r)}function Ow(e,t,n,r){let i=e.length,o=e.every(s=>s.every(a=>a.length===1));if(t)return function(s){let a=s.map(l=>l.GATE);for(let l=0;l<i;l++){let c=e[l],u=c.length,f=a[l];if(!(f!==void 0&&f.call(this)===!1))e:for(let d=0;d<u;d++){let p=c[d],m=p.length;for(let g=0;g<m;g++){let w=this.LA_FAST(g+1);if(n(w,p[g])===!1)continue e}return l}}};if(o&&!r){let a=e.map(l=>l.flat()).reduce((l,c,u)=>(c.forEach(f=>{f.tokenTypeIdx in l||(l[f.tokenTypeIdx]=u),f.categoryMatches.forEach(d=>{Object.hasOwn(l,d)||(l[d]=u)})}),l),{});return function(){let l=this.LA_FAST(1);return a[l.tokenTypeIdx]}}else return function(){for(let s=0;s<i;s++){let a=e[s],l=a.length;e:for(let c=0;c<l;c++){let u=a[c],f=u.length;for(let d=0;d<f;d++){let p=this.LA_FAST(d+1);if(n(p,u[d])===!1)continue e}return s}}}}function $w(e,t,n){let r=e.every(o=>o.length===1),i=e.length;if(r&&!n){let o=e.flat();if(o.length===1&&o[0].categoryMatches.length===0){let a=o[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===a}}else{let s=o.reduce((a,l,c)=>(a[l.tokenTypeIdx]=!0,l.categoryMatches.forEach(u=>{a[u]=!0}),a),[]);return function(){let a=this.LA_FAST(1);return s[a.tokenTypeIdx]===!0}}}else return function(){e:for(let o=0;o<i;o++){let s=e[o],a=s.length;for(let l=0;l<a;l++){let c=this.LA_FAST(l+1);if(t(c,s[l])===!1)continue e}return!0}return!1}}var bh=class extends vn{constructor(t,n,r){super(),this.topProd=t,this.targetOccurrence=n,this.targetProdType=r}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(t,n,r,i){return t.idx===this.targetOccurrence&&this.targetProdType===n?(this.restDef=r.concat(i),!0):!1}walkOption(t,n,r){this.checkIsTarget(t,Fe.OPTION,n,r)||super.walkOption(t,n,r)}walkAtLeastOne(t,n,r){this.checkIsTarget(t,Fe.REPETITION_MANDATORY,n,r)||super.walkOption(t,n,r)}walkAtLeastOneSep(t,n,r){this.checkIsTarget(t,Fe.REPETITION_MANDATORY_WITH_SEPARATOR,n,r)||super.walkOption(t,n,r)}walkMany(t,n,r){this.checkIsTarget(t,Fe.REPETITION,n,r)||super.walkOption(t,n,r)}walkManySep(t,n,r){this.checkIsTarget(t,Fe.REPETITION_WITH_SEPARATOR,n,r)||super.walkOption(t,n,r)}},Cc=class extends ut{constructor(t,n,r){super(),this.targetOccurrence=t,this.targetProdType=n,this.targetRef=r,this.result=[]}checkIsTarget(t,n){t.idx===this.targetOccurrence&&this.targetProdType===n&&(this.targetRef===void 0||t===this.targetRef)&&(this.result=t.definition)}visitOption(t){this.checkIsTarget(t,Fe.OPTION)}visitRepetition(t){this.checkIsTarget(t,Fe.REPETITION)}visitRepetitionMandatory(t){this.checkIsTarget(t,Fe.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(t){this.checkIsTarget(t,Fe.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(t){this.checkIsTarget(t,Fe.REPETITION_WITH_SEPARATOR)}visitAlternation(t){this.checkIsTarget(t,Fe.ALTERNATION)}};function Lw(e){let t=new Array(e);for(let n=0;n<e;n++)t[n]=[];return t}function Sh(e){let t=[""];for(let n=0;n<e.length;n++){let r=e[n],i=[];for(let o=0;o<t.length;o++){let s=t[o];i.push(s+"_"+r.tokenTypeIdx);for(let a=0;a<r.categoryMatches.length;a++){let l="_"+r.categoryMatches[a];i.push(s+l)}}t=i}return t}function iP(e,t,n){for(let r=0;r<e.length;r++){if(r===n)continue;let i=e[r];for(let o=0;o<t.length;o++){let s=t[o];if(i[s]===!0)return!1}}return!0}function Dw(e,t){let n=e.map(s=>Pc([s],1)),r=Lw(n.length),i=n.map(s=>{let a={};return s.forEach(l=>{Sh(l.partialPath).forEach(u=>{a[u]=!0})}),a}),o=n;for(let s=1;s<=t;s++){let a=o;o=Lw(a.length);for(let l=0;l<a.length;l++){let c=a[l];for(let u=0;u<c.length;u++){let f=c[u].partialPath,d=c[u].suffixDef,p=Sh(f);if(iP(i,p,l)||d.length===0||f.length===t){let g=r[l];if($c(g,f)===!1){g.push(f);for(let w=0;w<p.length;w++){let x=p[w];i[l][x]=!0}}}else{let g=Pc(d,s+1,f);o[l]=o[l].concat(g),g.forEach(w=>{Sh(w.partialPath).forEach(y=>{i[l][y]=!0})})}}}}return r}function po(e,t,n,r){let i=new Cc(e,Fe.ALTERNATION,r);return t.accept(i),Dw(i.result,n)}function ho(e,t,n,r){let i=new Cc(e,n);t.accept(i);let o=i.result,a=new bh(t,e,n).startWalking(),l=new be({definition:o}),c=new be({definition:a});return Dw([l,c],r)}function $c(e,t){e:for(let n=0;n<e.length;n++){let r=e[n];if(r.length===t.length){for(let i=0;i<r.length;i++){let o=t[i],s=r[i];if((o===s||s.categoryMatchesMap[o.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}function Mw(e,t){return e.length<t.length&&e.every((n,r)=>{let i=t[r];return n===i||i.categoryMatchesMap[n.tokenTypeIdx]})}function Fw(e){return e.every(t=>t.every(n=>n.every(r=>r.categoryMatches.length===0)))}function Bw(e){return e.lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName}).map(n=>Object.assign({type:Ve.CUSTOM_LOOKAHEAD_VALIDATION},n))}function Ww(e,t,n,r){let i=e.flatMap(l=>oP(l,n)),o=fP(e,t,n),s=e.flatMap(l=>lP(l,n)),a=e.flatMap(l=>aP(l,e,r,n));return i.concat(o,s,a)}function oP(e,t){let n=new Nh;e.accept(n);let r=n.allProductions,i=Object.groupBy(r,sP),o=Object.fromEntries(Object.entries(i).filter(([a,l])=>l.length>1));return Object.values(o).map(a=>{let l=a[0],c=t.buildDuplicateFoundError(e,a),u=Et(l),f={message:c,type:Ve.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:u,occurrence:l.idx},d=Xw(l);return d&&(f.parameter=d),f})}function sP(e){return`${Et(e)}_#_${e.idx}_#_${Xw(e)}`}function Xw(e){return e instanceof le?e.terminalType.name:e instanceof Ee?e.nonTerminalName:""}var Nh=class extends ut{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(t){this.allProductions.push(t)}visitOption(t){this.allProductions.push(t)}visitRepetitionWithSeparator(t){this.allProductions.push(t)}visitRepetitionMandatory(t){this.allProductions.push(t)}visitRepetitionMandatoryWithSeparator(t){this.allProductions.push(t)}visitRepetition(t){this.allProductions.push(t)}visitAlternation(t){this.allProductions.push(t)}visitTerminal(t){this.allProductions.push(t)}};function aP(e,t,n,r){let i=[];if(t.reduce((s,a)=>a.name===e.name?s+1:s,0)>1){let s=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});i.push({message:s,type:Ve.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}function Uw(e,t,n){let r=[],i;return t.includes(e)||(i=`Invalid rule override, rule: ->${e}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:Ve.INVALID_RULE_OVERRIDE,ruleName:e})),r}function Ph(e,t,n,r=[]){let i=[],o=Dc(t.definition);if(o.length===0)return[];{let s=e.name;o.includes(e)&&i.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:r}),type:Ve.LEFT_RECURSION,ruleName:s});let l=r.concat([e]),u=o.filter(f=>!l.includes(f)).flatMap(f=>{let d=[...r];return d.push(f),Ph(e,f,n,d)});return i.concat(u)}}function Dc(e){let t=[];if(e.length===0)return t;let n=e[0];if(n instanceof Ee)t.push(n.referencedRule);else if(n instanceof be||n instanceof we||n instanceof Ne||n instanceof Le||n instanceof ke||n instanceof me)t=t.concat(Dc(n.definition));else if(n instanceof Ie)t=n.definition.map(o=>Dc(o.definition)).flat();else if(!(n instanceof le))throw Error("non exhaustive match");let r=ei(n),i=e.length>1;if(r&&i){let o=e.slice(1);return t.concat(Dc(o))}else return t}var pa=class extends ut{constructor(){super(...arguments),this.alternations=[]}visitAlternation(t){this.alternations.push(t)}};function Gw(e,t){let n=new pa;return e.accept(n),n.alternations.flatMap(o=>o.definition.slice(0,-1).flatMap((a,l)=>Nw([a],[],An,1).length===0?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:o,emptyChoiceIdx:l}),type:Ve.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:o.idx,alternative:l+1}]:[]))}function Hw(e,t,n){let r=new pa;e.accept(r);let i=r.alternations;return i=i.filter(s=>s.ignoreAmbiguities!==!0),i.flatMap(s=>{let a=s.idx,l=s.maxLookahead||t,c=po(a,e,l,s),u=cP(c,s,e,n),f=uP(c,s,e,n);return u.concat(f)})}var Lh=class extends ut{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(t){this.allProductions.push(t)}visitRepetitionMandatory(t){this.allProductions.push(t)}visitRepetitionMandatoryWithSeparator(t){this.allProductions.push(t)}visitRepetition(t){this.allProductions.push(t)}};function lP(e,t){let n=new pa;return e.accept(n),n.alternations.flatMap(o=>o.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:o}),type:Ve.TOO_MANY_ALTS,ruleName:e.name,occurrence:o.idx}]:[])}function zw(e,t,n){let r=[];return e.forEach(i=>{let o=new Lh;i.accept(o),o.allProductions.forEach(a=>{let l=da(a),c=a.maxLookahead||t,u=a.idx;if(ho(u,i,l,c)[0].flat().length===0){let p=n.buildEmptyRepetitionError({topLevelRule:i,repetition:a});r.push({message:p,type:Ve.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),r}function cP(e,t,n,r){let i=[];return e.reduce((a,l,c)=>(t.definition[c].ignoreAmbiguities===!0||l.forEach(u=>{let f=[c];e.forEach((d,p)=>{c!==p&&$c(d,u)&&t.definition[p].ignoreAmbiguities!==!0&&f.push(p)}),f.length>1&&!$c(i,u)&&(i.push(u),a.push({alts:f,path:u}))}),a),[]).map(a=>{let l=a.alts.map(u=>u+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:l,prefixPath:a.path}),type:Ve.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:t.idx,alternatives:a.alts}})}function uP(e,t,n,r){let i=e.reduce((s,a,l)=>{let c=a.map(u=>({idx:l,path:u}));return s.concat(c)},[]);return i.flatMap(s=>{if(t.definition[s.idx].ignoreAmbiguities===!0)return[];let l=s.idx,c=s.path;return i.filter(d=>t.definition[d.idx].ignoreAmbiguities!==!0&&d.idx<l&&Mw(d.path,c)).map(d=>{let p=[d.idx+1,l+1],m=t.idx===0?"":t.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:p,prefixPath:d.path}),type:Ve.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:m,alternatives:p}})})}function fP(e,t,n){let r=[],i=t.map(o=>o.name);return e.forEach(o=>{let s=o.name;if(i.includes(s)){let a=n.buildNamespaceConflictError(o);r.push({message:a,type:Ve.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),r}function jw(e){let t=Object.assign({errMsgProvider:Sw},e),n={};return e.rules.forEach(r=>{n[r.name]=r}),bw(n,t.errMsgProvider)}function Yw(e){var t;let n=(t=e.errMsgProvider)!==null&&t!==void 0?t:zt;return Ww(e.rules,e.tokenTypes,n,e.grammarName)}var Vw="MismatchedTokenException",Kw="NoViableAltException",qw="EarlyExitException",Zw="NotAllInputParsedException",Jw=[Vw,Kw,qw,Zw];Object.freeze(Jw);function ar(e){return Jw.includes(e.name)}var mo=class extends Error{constructor(t,n){super(t),this.token=n,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},ii=class extends mo{constructor(t,n,r){super(t,n),this.previousToken=r,this.name=Vw}},ha=class extends mo{constructor(t,n,r){super(t,n),this.previousToken=r,this.name=Kw}},ma=class extends mo{constructor(t,n){super(t,n),this.name=Zw}},ga=class extends mo{constructor(t,n,r){super(t,n),this.previousToken=r,this.name=qw}};var Ch={},$h="InRuleRecoveryException",Oh=class extends Error{constructor(t){super(t),this.name=$h}},Mc=class{initRecoverable(t){this.firstAfterRepMap=[],this.resyncFollows={},this.recoveryEnabled=Object.hasOwn(t,"recoveryEnabled")?t.recoveryEnabled:dt.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=dP)}getTokenToInsert(t){let n=Rn(t,"",-1,-1,-1,-1,-1,-1);return n.isInsertedInRecovery=!0,n}canTokenTypeBeInsertedInRecovery(t){return!0}canTokenTypeBeDeletedInRecovery(t){return!0}tryInRepetitionRecovery(t,n,r,i){let o=this.findReSyncTokenType(),s=this.exportLexerState(),a=[],l=!1,c=this.LA_FAST(1),u=this.LA_FAST(1),f=()=>{let d=this.LA(0),p=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:c,previous:d,ruleName:this.getCurrRuleFullName()}),m=new ii(p,c,this.LA(0));m.resyncedTokens=a.slice(0,-1),this.SAVE_ERROR(m)};for(;!l;)if(this.tokenMatcher(u,i)){f();return}else if(r.call(this)){f(),t.apply(this,n);return}else this.tokenMatcher(u,o)?l=!0:(u=this.SKIP_TOKEN(),this.addToResyncTokens(u,a));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(t,n,r){return!(r===!1||this.tokenMatcher(this.LA_FAST(1),t)||this.isBackTracking()||this.canPerformInRuleRecovery(t,this.getFollowsForInRuleRecovery(t,n)))}getNextPossibleTokenTypes(t){let n=t.ruleStack[0],i=this.getGAstProductions()[n];return new bc(i,t).startWalking()}getFollowsForInRuleRecovery(t,n){let r=this.getCurrentGrammarPath(t,n);return this.getNextPossibleTokenTypes(r)}tryInRuleRecovery(t,n){if(this.canRecoverWithSingleTokenInsertion(t,n))return this.getTokenToInsert(t);if(this.canRecoverWithSingleTokenDeletion(t)){let r=this.SKIP_TOKEN();return this.consumeToken(),r}throw new Oh("sad sad panda")}canPerformInRuleRecovery(t,n){return this.canRecoverWithSingleTokenInsertion(t,n)||this.canRecoverWithSingleTokenDeletion(t)}canRecoverWithSingleTokenInsertion(t,n){if(!this.canTokenTypeBeInsertedInRecovery(t)||n.length===0)return!1;let r=this.LA_FAST(1);return n.find(o=>this.tokenMatcher(r,o))!==void 0}canRecoverWithSingleTokenDeletion(t){return this.canTokenTypeBeDeletedInRecovery(t)?this.tokenMatcher(this.LA(2),t):!1}isInCurrentRuleReSyncSet(t){let n=this.getCurrFollowKey();return this.getFollowSetFromFollowKey(n).includes(t)}findReSyncTokenType(){let t=this.flattenFollowSet(),n=this.LA_FAST(1),r=2;for(;;){let i=t.find(o=>uo(n,o));if(i!==void 0)return i;n=this.LA(r),r++}}getCurrFollowKey(){if(this.RULE_STACK_IDX===0)return Ch;let t=this.currRuleShortName,n=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(t),idxInCallingRule:n,inRule:this.shortRuleNameToFullName(r)}}buildFullFollowKeyStack(){let t=this.RULE_STACK,n=this.RULE_OCCURRENCE_STACK,r=this.RULE_STACK_IDX+1,i=new Array(r);for(let o=0;o<r;o++)o===0?i[o]=Ch:i[o]={ruleName:this.shortRuleNameToFullName(t[o]),idxInCallingRule:n[o],inRule:this.shortRuleNameToFullName(t[o-1])};return i}flattenFollowSet(){return this.buildFullFollowKeyStack().map(n=>this.getFollowSetFromFollowKey(n)).flat()}getFollowSetFromFollowKey(t){if(t===Ch)return[ft];let n=t.ruleName+t.idxInCallingRule+wc+t.inRule;return this.resyncFollows[n]}addToResyncTokens(t,n){return this.tokenMatcher(t,ft)||n.push(t),n}reSyncTo(t){let n=[],r=this.LA_FAST(1);for(;this.tokenMatcher(r,t)===!1;)r=this.SKIP_TOKEN(),this.addToResyncTokens(r,n);return n.slice(0,-1)}attemptInRepetitionRecovery(t,n,r,i,o,s,a){}getCurrentGrammarPath(t,n){let r=this.getHumanReadableRuleStack(),i=this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1);return{ruleStack:r,occurrenceStack:i,lastTok:t,lastTokOccurrence:n}}getHumanReadableRuleStack(){let t=this.RULE_STACK_IDX+1,n=new Array(t);for(let r=0;r<t;r++)n[r]=this.shortRuleNameToFullName(this.RULE_STACK[r]);return n}};function dP(e,t,n,r,i,o,s){var a,l,c;let u=r|i,f=(a=(l=this.firstAfterRepMap)[c=this.currRuleShortName])!==null&&a!==void 0?a:l[c]=[],d=f[u];if(d===void 0){let w=this.getCurrRuleFullName(),x=this.getGAstProductions()[w];d=new o(x,i).startWalking(),f[u]=d}let p=d.token,m=d.occurrence,g=d.isEndOfRule;this.RULE_STACK_IDX===0&&g&&p===void 0&&(p=ft,m=1),!(p===void 0||m===void 0)&&this.shouldInRepetitionRecoveryBeTried(p,m,s)&&this.tryInRepetitionRecovery(e,t,n,p)}var bn=class{constructor(t){var n;this.maxLookahead=(n=t?.maxLookahead)!==null&&n!==void 0?n:dt.maxLookahead}validate(t){let n=this.validateNoLeftRecursion(t.rules);if(n.length===0){let r=this.validateEmptyOrAlternatives(t.rules),i=this.validateAmbiguousAlternationAlternatives(t.rules,this.maxLookahead),o=this.validateSomeNonEmptyLookaheadPath(t.rules,this.maxLookahead);return[...n,...r,...i,...o]}return n}validateNoLeftRecursion(t){return t.flatMap(n=>Ph(n,n,zt))}validateEmptyOrAlternatives(t){return t.flatMap(n=>Gw(n,zt))}validateAmbiguousAlternationAlternatives(t,n){return t.flatMap(r=>Hw(r,n,zt))}validateSomeNonEmptyLookaheadPath(t,n){return zw(t,n,zt)}buildLookaheadForAlternation(t){return Pw(t.prodOccurrence,t.rule,t.maxLookahead,t.hasPredicates,t.dynamicTokensEnabled,Ow)}buildLookaheadForOptional(t){return Cw(t.prodOccurrence,t.rule,t.maxLookahead,t.dynamicTokensEnabled,da(t.prodType),$w)}};var Bc=class{initLooksAhead(t){this.dynamicTokensEnabled=Object.hasOwn(t,"dynamicTokensEnabled")?t.dynamicTokensEnabled:dt.dynamicTokensEnabled,this.maxLookahead=Object.hasOwn(t,"maxLookahead")?t.maxLookahead:dt.maxLookahead,this.lookaheadStrategy=Object.hasOwn(t,"lookaheadStrategy")?t.lookaheadStrategy:new bn({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=[],this.currRuleLookaheadFuncs=[]}preComputeLookaheadFunctions(t){t.forEach(n=>{this.TRACE_INIT(`${n.name} Rule Lookahead`,()=>{let{alternation:r,repetition:i,option:o,repetitionMandatory:s,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:l}=pP(n);r.forEach(c=>{let u=c.idx===0?"":c.idx;this.TRACE_INIT(`${Et(c)}${u}`,()=>{let f=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:c.idx,rule:n,maxLookahead:c.maxLookahead||this.maxLookahead,hasPredicates:c.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled});this.setLaFuncCache(this.fullRuleNameToShort[n.name],256|c.idx,f)})}),i.forEach(c=>{this.computeLookaheadFunc(n,c.idx,768,"Repetition",c.maxLookahead,Et(c))}),o.forEach(c=>{this.computeLookaheadFunc(n,c.idx,512,"Option",c.maxLookahead,Et(c))}),s.forEach(c=>{this.computeLookaheadFunc(n,c.idx,1024,"RepetitionMandatory",c.maxLookahead,Et(c))}),a.forEach(c=>{this.computeLookaheadFunc(n,c.idx,1536,"RepetitionMandatoryWithSeparator",c.maxLookahead,Et(c))}),l.forEach(c=>{this.computeLookaheadFunc(n,c.idx,1280,"RepetitionWithSeparator",c.maxLookahead,Et(c))})})})}computeLookaheadFunc(t,n,r,i,o,s){this.TRACE_INIT(`${s}${n===0?"":n}`,()=>{let a=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:n,rule:t,maxLookahead:o||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i});this.setLaFuncCache(this.fullRuleNameToShort[t.name],r|n,a)})}setLaFuncCache(t,n,r){let i=this.lookAheadFuncsCache[t];i===void 0&&(i=[],this.lookAheadFuncsCache[t]=i),i[n]=r}},Dh=class extends ut{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(t){this.dslMethods.option.push(t)}visitRepetitionWithSeparator(t){this.dslMethods.repetitionWithSeparator.push(t)}visitRepetitionMandatory(t){this.dslMethods.repetitionMandatory.push(t)}visitRepetitionMandatoryWithSeparator(t){this.dslMethods.repetitionMandatoryWithSeparator.push(t)}visitRepetition(t){this.dslMethods.repetition.push(t)}visitAlternation(t){this.dslMethods.alternation.push(t)}},Fc=new Dh;function pP(e){Fc.reset(),e.accept(Fc);let t=Fc.dslMethods;return Fc.reset(),t}function Bh(e,t){e.startOffset===-1?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset<t.endOffset&&(e.endOffset=t.endOffset)}function Wh(e,t){e.startOffset===-1?(e.startOffset=t.startOffset,e.startColumn=t.startColumn,e.startLine=t.startLine,e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine):e.endOffset<t.endOffset&&(e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine)}function Qw(e,t,n){e.children[n]===void 0?e.children[n]=[t]:e.children[n].push(t)}function eT(e,t,n){e.children[t]===void 0?e.children[t]=[n]:e.children[t].push(n)}var hP="name";function Xh(e,t){Object.defineProperty(e,hP,{enumerable:!1,configurable:!0,writable:!1,value:t})}function mP(e,t){let n=Object.keys(e),r=n.length;for(let i=0;i<r;i++){let o=n[i],s=e[o],a=s.length;for(let l=0;l<a;l++){let c=s[l];c.tokenTypeIdx===void 0&&this[c.name](c.children,t)}}}function tT(e,t){let n=function(){};Xh(n,e+"BaseSemantics");let r={visit:function(i,o){if(Array.isArray(i)&&(i=i[0]),i!==void 0)return this[i.name](i.children,o)},validateVisitor:function(){let i=gP(this,t);if(i.length!==0){let o=i.map(s=>s.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
|
|
91
91
|
${o.join(`
|
|
92
92
|
|
|
93
93
|
`).replace(/\n/g,`
|
|
94
|
-
`)}`)}}};return n.prototype=r,n.prototype.constructor=n,n._RULE_NAMES=t,n}function rT(e,t,n){let r=function(){};Uh(r,e+"BaseSemanticsWithDefaults");let i=Object.create(n.prototype);return t.forEach(o=>{i[o]=mP}),r.prototype=i,r.prototype.constructor=r,r}var Gh;(function(e){e[e.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",e[e.MISSING_METHOD=1]="MISSING_METHOD"})(Gh||(Gh={}));function gP(e,t){return yP(e,t)}function yP(e,t){return t.filter(i=>typeof e[i]!="function").map(i=>({msg:`Missing visitor method: <${i}> on ${e.constructor.name} CST Visitor.`,type:Gh.MISSING_METHOD,methodName:i})).filter(Boolean)}var Hc=class{initTreeBuilder(t){if(this.CST_STACK=[],this.outputCst=t.outputCst,this.nodeLocationTracking=Object.hasOwn(t,"nodeLocationTracking")?t.nodeLocationTracking:dt.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=()=>{},this.cstFinallyStateUpdate=()=>{},this.cstPostTerminal=()=>{},this.cstPostNonTerminal=()=>{},this.cstPostRule=()=>{};else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Xh,this.setNodeLocationFromNode=Xh,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Wh,this.setNodeLocationFromNode=Wh,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=()=>{},this.setInitialNodeLocation=()=>{};else throw Error(`Invalid <nodeLocationTracking> config option: "${t.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(t){t.location={startOffset:-1,endOffset:-1}}setInitialNodeLocationOnlyOffsetRegular(t){t.location={startOffset:this.LA_FAST(1).startOffset,endOffset:-1}}setInitialNodeLocationFullRecovery(t){t.location={startOffset:-1,startLine:-1,startColumn:-1,endOffset:-1,endLine:-1,endColumn:-1}}setInitialNodeLocationFullRegular(t){let n=this.LA_FAST(1);t.location={startOffset:n.startOffset,startLine:n.startLine,startColumn:n.startColumn,endOffset:-1,endLine:-1,endColumn:-1}}cstInvocationStateUpdate(t){let n={name:t,children:Object.create(null)};this.setInitialNodeLocation(n),this.CST_STACK.push(n)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(t){let n=this.LA(0),r=t.location;r.startOffset!==-1&&r.startOffset<=n.startOffset?(r.endOffset=n.endOffset,r.endLine=n.endLine,r.endColumn=n.endColumn):(r.startOffset=-1,r.startLine=-1,r.startColumn=-1)}cstPostRuleOnlyOffset(t){let n=this.LA(0),r=t.location;r.startOffset!==-1&&r.startOffset<=n.startOffset?r.endOffset=n.endOffset:r.startOffset=-1}cstPostTerminal(t,n){let r=this.CST_STACK[this.CST_STACK.length-1];eT(r,n,t),this.setNodeLocationFromToken(r.location,n)}cstPostNonTerminal(t,n){let r=this.CST_STACK[this.CST_STACK.length-1];tT(r,n,t),this.setNodeLocationFromNode(r.location,t.location)}get currCSTNode(){let t=this;return t.CST_STACK[t.CST_STACK.length-1]}getBaseCstVisitorConstructor(){if(this.baseCstVisitorConstructor===void 0){let t=nT(this.className,Object.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=t,t}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(this.baseCstVisitorWithDefaultsConstructor===void 0){let t=rT(this.className,Object.keys(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=t,t}return this.baseCstVisitorWithDefaultsConstructor}getPreviousExplicitRuleShortName(){return this.RULE_STACK[this.RULE_STACK_IDX-1]}getLastExplicitRuleOccurrenceIndex(){return this.RULE_OCCURRENCE_STACK[this.RULE_OCCURRENCE_STACK_IDX]}};var zc=class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(t){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=t,this.tokVectorLength=t.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVectorLength-2?(this.consumeToken(),this.LA_FAST(1)):Rn}LA_FAST(t){let n=this.currIdx+t;return this.tokVector[n]}LA(t){let n=this.currIdx+t;return n<0||this.tokVectorLength<=n?Rn:this.tokVector[n]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(t){this.currIdx=t}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVectorLength-1}getLexerPosition(){return this.exportLexerState()}};var jc=class{ACTION(t){return t.call(this)}consume(t,n,r){return this.consumeInternal(n,t,r)}subrule(t,n,r){return this.subruleInternal(n,t,r)}option(t,n){return this.optionInternal(n,t)}or(t,n){return this.orInternal(n,t)}many(t,n){return this.manyInternal(t,n)}atLeastOne(t,n){return this.atLeastOneInternal(t,n)}CONSUME(t,n){return this.consumeInternal(t,0,n)}CONSUME1(t,n){return this.consumeInternal(t,1,n)}CONSUME2(t,n){return this.consumeInternal(t,2,n)}CONSUME3(t,n){return this.consumeInternal(t,3,n)}CONSUME4(t,n){return this.consumeInternal(t,4,n)}CONSUME5(t,n){return this.consumeInternal(t,5,n)}CONSUME6(t,n){return this.consumeInternal(t,6,n)}CONSUME7(t,n){return this.consumeInternal(t,7,n)}CONSUME8(t,n){return this.consumeInternal(t,8,n)}CONSUME9(t,n){return this.consumeInternal(t,9,n)}SUBRULE(t,n){return this.subruleInternal(t,0,n)}SUBRULE1(t,n){return this.subruleInternal(t,1,n)}SUBRULE2(t,n){return this.subruleInternal(t,2,n)}SUBRULE3(t,n){return this.subruleInternal(t,3,n)}SUBRULE4(t,n){return this.subruleInternal(t,4,n)}SUBRULE5(t,n){return this.subruleInternal(t,5,n)}SUBRULE6(t,n){return this.subruleInternal(t,6,n)}SUBRULE7(t,n){return this.subruleInternal(t,7,n)}SUBRULE8(t,n){return this.subruleInternal(t,8,n)}SUBRULE9(t,n){return this.subruleInternal(t,9,n)}OPTION(t){return this.optionInternal(t,0)}OPTION1(t){return this.optionInternal(t,1)}OPTION2(t){return this.optionInternal(t,2)}OPTION3(t){return this.optionInternal(t,3)}OPTION4(t){return this.optionInternal(t,4)}OPTION5(t){return this.optionInternal(t,5)}OPTION6(t){return this.optionInternal(t,6)}OPTION7(t){return this.optionInternal(t,7)}OPTION8(t){return this.optionInternal(t,8)}OPTION9(t){return this.optionInternal(t,9)}OR(t){return this.orInternal(t,0)}OR1(t){return this.orInternal(t,1)}OR2(t){return this.orInternal(t,2)}OR3(t){return this.orInternal(t,3)}OR4(t){return this.orInternal(t,4)}OR5(t){return this.orInternal(t,5)}OR6(t){return this.orInternal(t,6)}OR7(t){return this.orInternal(t,7)}OR8(t){return this.orInternal(t,8)}OR9(t){return this.orInternal(t,9)}MANY(t){this.manyInternal(0,t)}MANY1(t){this.manyInternal(1,t)}MANY2(t){this.manyInternal(2,t)}MANY3(t){this.manyInternal(3,t)}MANY4(t){this.manyInternal(4,t)}MANY5(t){this.manyInternal(5,t)}MANY6(t){this.manyInternal(6,t)}MANY7(t){this.manyInternal(7,t)}MANY8(t){this.manyInternal(8,t)}MANY9(t){this.manyInternal(9,t)}MANY_SEP(t){this.manySepFirstInternal(0,t)}MANY_SEP1(t){this.manySepFirstInternal(1,t)}MANY_SEP2(t){this.manySepFirstInternal(2,t)}MANY_SEP3(t){this.manySepFirstInternal(3,t)}MANY_SEP4(t){this.manySepFirstInternal(4,t)}MANY_SEP5(t){this.manySepFirstInternal(5,t)}MANY_SEP6(t){this.manySepFirstInternal(6,t)}MANY_SEP7(t){this.manySepFirstInternal(7,t)}MANY_SEP8(t){this.manySepFirstInternal(8,t)}MANY_SEP9(t){this.manySepFirstInternal(9,t)}AT_LEAST_ONE(t){this.atLeastOneInternal(0,t)}AT_LEAST_ONE1(t){return this.atLeastOneInternal(1,t)}AT_LEAST_ONE2(t){this.atLeastOneInternal(2,t)}AT_LEAST_ONE3(t){this.atLeastOneInternal(3,t)}AT_LEAST_ONE4(t){this.atLeastOneInternal(4,t)}AT_LEAST_ONE5(t){this.atLeastOneInternal(5,t)}AT_LEAST_ONE6(t){this.atLeastOneInternal(6,t)}AT_LEAST_ONE7(t){this.atLeastOneInternal(7,t)}AT_LEAST_ONE8(t){this.atLeastOneInternal(8,t)}AT_LEAST_ONE9(t){this.atLeastOneInternal(9,t)}AT_LEAST_ONE_SEP(t){this.atLeastOneSepFirstInternal(0,t)}AT_LEAST_ONE_SEP1(t){this.atLeastOneSepFirstInternal(1,t)}AT_LEAST_ONE_SEP2(t){this.atLeastOneSepFirstInternal(2,t)}AT_LEAST_ONE_SEP3(t){this.atLeastOneSepFirstInternal(3,t)}AT_LEAST_ONE_SEP4(t){this.atLeastOneSepFirstInternal(4,t)}AT_LEAST_ONE_SEP5(t){this.atLeastOneSepFirstInternal(5,t)}AT_LEAST_ONE_SEP6(t){this.atLeastOneSepFirstInternal(6,t)}AT_LEAST_ONE_SEP7(t){this.atLeastOneSepFirstInternal(7,t)}AT_LEAST_ONE_SEP8(t){this.atLeastOneSepFirstInternal(8,t)}AT_LEAST_ONE_SEP9(t){this.atLeastOneSepFirstInternal(9,t)}RULE(t,n,r=go){if(this.definedRulesNames.includes(t)){let s={message:zt.buildDuplicateRuleNameError({topLevelRule:t,grammarName:this.className}),type:Ve.DUPLICATE_RULE_NAME,ruleName:t};this.definitionErrors.push(s)}this.definedRulesNames.push(t);let i=this.defineRule(t,n,r);return this[t]=i,i}OVERRIDE_RULE(t,n,r=go){let i=Gw(t,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);let o=this.defineRule(t,n,r);return this[t]=o,o}BACKTRACK(t,n){var r;let i=(r=t.coreRule)!==null&&r!==void 0?r:t;return function(){this.isBackTrackingStack.push(1);let o=this.saveRecogState();try{return i.apply(this,n),!0}catch(s){if(sr(s))return!1;throw s}finally{this.reloadRecogState(o),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return wc(Object.values(this.gastProductionsCache))}};var Yc=class{initRecognizerEngine(t,n){if(this.className=this.constructor.name,this.shortRuleNameToFull=[],this.fullRuleNameToShort={},this.ruleShortNameIdx=0,this.tokenMatcher=lo,this.subruleIdx=0,this.currRuleShortName=-1,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK=[],this.RULE_OCCURRENCE_STACK_IDX=-1,this.gastProductionsCache={},Object.hasOwn(n,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
|
|
94
|
+
`)}`)}}};return n.prototype=r,n.prototype.constructor=n,n._RULE_NAMES=t,n}function nT(e,t,n){let r=function(){};Xh(r,e+"BaseSemanticsWithDefaults");let i=Object.create(n.prototype);return t.forEach(o=>{i[o]=mP}),r.prototype=i,r.prototype.constructor=r,r}var Uh;(function(e){e[e.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",e[e.MISSING_METHOD=1]="MISSING_METHOD"})(Uh||(Uh={}));function gP(e,t){return yP(e,t)}function yP(e,t){return t.filter(i=>typeof e[i]!="function").map(i=>({msg:`Missing visitor method: <${i}> on ${e.constructor.name} CST Visitor.`,type:Uh.MISSING_METHOD,methodName:i})).filter(Boolean)}var Gc=class{initTreeBuilder(t){if(this.CST_STACK=[],this.outputCst=t.outputCst,this.nodeLocationTracking=Object.hasOwn(t,"nodeLocationTracking")?t.nodeLocationTracking:dt.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=()=>{},this.cstFinallyStateUpdate=()=>{},this.cstPostTerminal=()=>{},this.cstPostNonTerminal=()=>{},this.cstPostRule=()=>{};else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Wh,this.setNodeLocationFromNode=Wh,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Bh,this.setNodeLocationFromNode=Bh,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=()=>{},this.setInitialNodeLocation=()=>{};else throw Error(`Invalid <nodeLocationTracking> config option: "${t.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(t){t.location={startOffset:-1,endOffset:-1}}setInitialNodeLocationOnlyOffsetRegular(t){t.location={startOffset:this.LA_FAST(1).startOffset,endOffset:-1}}setInitialNodeLocationFullRecovery(t){t.location={startOffset:-1,startLine:-1,startColumn:-1,endOffset:-1,endLine:-1,endColumn:-1}}setInitialNodeLocationFullRegular(t){let n=this.LA_FAST(1);t.location={startOffset:n.startOffset,startLine:n.startLine,startColumn:n.startColumn,endOffset:-1,endLine:-1,endColumn:-1}}cstInvocationStateUpdate(t){let n={name:t,children:Object.create(null)};this.setInitialNodeLocation(n),this.CST_STACK.push(n)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(t){let n=this.LA(0),r=t.location;r.startOffset!==-1&&r.startOffset<=n.startOffset?(r.endOffset=n.endOffset,r.endLine=n.endLine,r.endColumn=n.endColumn):(r.startOffset=-1,r.startLine=-1,r.startColumn=-1)}cstPostRuleOnlyOffset(t){let n=this.LA(0),r=t.location;r.startOffset!==-1&&r.startOffset<=n.startOffset?r.endOffset=n.endOffset:r.startOffset=-1}cstPostTerminal(t,n){let r=this.CST_STACK[this.CST_STACK.length-1];Qw(r,n,t),this.setNodeLocationFromToken(r.location,n)}cstPostNonTerminal(t,n){let r=this.CST_STACK[this.CST_STACK.length-1];eT(r,n,t),this.setNodeLocationFromNode(r.location,t.location)}get currCSTNode(){let t=this;return t.CST_STACK[t.CST_STACK.length-1]}getBaseCstVisitorConstructor(){if(this.baseCstVisitorConstructor===void 0){let t=tT(this.className,Object.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=t,t}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(this.baseCstVisitorWithDefaultsConstructor===void 0){let t=nT(this.className,Object.keys(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=t,t}return this.baseCstVisitorWithDefaultsConstructor}getPreviousExplicitRuleShortName(){return this.RULE_STACK[this.RULE_STACK_IDX-1]}getLastExplicitRuleOccurrenceIndex(){return this.RULE_OCCURRENCE_STACK[this.RULE_OCCURRENCE_STACK_IDX]}};var Hc=class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(t){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=t,this.tokVectorLength=t.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVectorLength-2?(this.consumeToken(),this.LA_FAST(1)):Nn}LA_FAST(t){let n=this.currIdx+t;return this.tokVector[n]}LA(t){let n=this.currIdx+t;return n<0||this.tokVectorLength<=n?Nn:this.tokVector[n]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(t){this.currIdx=t}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVectorLength-1}getLexerPosition(){return this.exportLexerState()}};var zc=class{ACTION(t){return t.call(this)}consume(t,n,r){return this.consumeInternal(n,t,r)}subrule(t,n,r){return this.subruleInternal(n,t,r)}option(t,n){return this.optionInternal(n,t)}or(t,n){return this.orInternal(n,t)}many(t,n){return this.manyInternal(t,n)}atLeastOne(t,n){return this.atLeastOneInternal(t,n)}CONSUME(t,n){return this.consumeInternal(t,0,n)}CONSUME1(t,n){return this.consumeInternal(t,1,n)}CONSUME2(t,n){return this.consumeInternal(t,2,n)}CONSUME3(t,n){return this.consumeInternal(t,3,n)}CONSUME4(t,n){return this.consumeInternal(t,4,n)}CONSUME5(t,n){return this.consumeInternal(t,5,n)}CONSUME6(t,n){return this.consumeInternal(t,6,n)}CONSUME7(t,n){return this.consumeInternal(t,7,n)}CONSUME8(t,n){return this.consumeInternal(t,8,n)}CONSUME9(t,n){return this.consumeInternal(t,9,n)}SUBRULE(t,n){return this.subruleInternal(t,0,n)}SUBRULE1(t,n){return this.subruleInternal(t,1,n)}SUBRULE2(t,n){return this.subruleInternal(t,2,n)}SUBRULE3(t,n){return this.subruleInternal(t,3,n)}SUBRULE4(t,n){return this.subruleInternal(t,4,n)}SUBRULE5(t,n){return this.subruleInternal(t,5,n)}SUBRULE6(t,n){return this.subruleInternal(t,6,n)}SUBRULE7(t,n){return this.subruleInternal(t,7,n)}SUBRULE8(t,n){return this.subruleInternal(t,8,n)}SUBRULE9(t,n){return this.subruleInternal(t,9,n)}OPTION(t){return this.optionInternal(t,0)}OPTION1(t){return this.optionInternal(t,1)}OPTION2(t){return this.optionInternal(t,2)}OPTION3(t){return this.optionInternal(t,3)}OPTION4(t){return this.optionInternal(t,4)}OPTION5(t){return this.optionInternal(t,5)}OPTION6(t){return this.optionInternal(t,6)}OPTION7(t){return this.optionInternal(t,7)}OPTION8(t){return this.optionInternal(t,8)}OPTION9(t){return this.optionInternal(t,9)}OR(t){return this.orInternal(t,0)}OR1(t){return this.orInternal(t,1)}OR2(t){return this.orInternal(t,2)}OR3(t){return this.orInternal(t,3)}OR4(t){return this.orInternal(t,4)}OR5(t){return this.orInternal(t,5)}OR6(t){return this.orInternal(t,6)}OR7(t){return this.orInternal(t,7)}OR8(t){return this.orInternal(t,8)}OR9(t){return this.orInternal(t,9)}MANY(t){this.manyInternal(0,t)}MANY1(t){this.manyInternal(1,t)}MANY2(t){this.manyInternal(2,t)}MANY3(t){this.manyInternal(3,t)}MANY4(t){this.manyInternal(4,t)}MANY5(t){this.manyInternal(5,t)}MANY6(t){this.manyInternal(6,t)}MANY7(t){this.manyInternal(7,t)}MANY8(t){this.manyInternal(8,t)}MANY9(t){this.manyInternal(9,t)}MANY_SEP(t){this.manySepFirstInternal(0,t)}MANY_SEP1(t){this.manySepFirstInternal(1,t)}MANY_SEP2(t){this.manySepFirstInternal(2,t)}MANY_SEP3(t){this.manySepFirstInternal(3,t)}MANY_SEP4(t){this.manySepFirstInternal(4,t)}MANY_SEP5(t){this.manySepFirstInternal(5,t)}MANY_SEP6(t){this.manySepFirstInternal(6,t)}MANY_SEP7(t){this.manySepFirstInternal(7,t)}MANY_SEP8(t){this.manySepFirstInternal(8,t)}MANY_SEP9(t){this.manySepFirstInternal(9,t)}AT_LEAST_ONE(t){this.atLeastOneInternal(0,t)}AT_LEAST_ONE1(t){return this.atLeastOneInternal(1,t)}AT_LEAST_ONE2(t){this.atLeastOneInternal(2,t)}AT_LEAST_ONE3(t){this.atLeastOneInternal(3,t)}AT_LEAST_ONE4(t){this.atLeastOneInternal(4,t)}AT_LEAST_ONE5(t){this.atLeastOneInternal(5,t)}AT_LEAST_ONE6(t){this.atLeastOneInternal(6,t)}AT_LEAST_ONE7(t){this.atLeastOneInternal(7,t)}AT_LEAST_ONE8(t){this.atLeastOneInternal(8,t)}AT_LEAST_ONE9(t){this.atLeastOneInternal(9,t)}AT_LEAST_ONE_SEP(t){this.atLeastOneSepFirstInternal(0,t)}AT_LEAST_ONE_SEP1(t){this.atLeastOneSepFirstInternal(1,t)}AT_LEAST_ONE_SEP2(t){this.atLeastOneSepFirstInternal(2,t)}AT_LEAST_ONE_SEP3(t){this.atLeastOneSepFirstInternal(3,t)}AT_LEAST_ONE_SEP4(t){this.atLeastOneSepFirstInternal(4,t)}AT_LEAST_ONE_SEP5(t){this.atLeastOneSepFirstInternal(5,t)}AT_LEAST_ONE_SEP6(t){this.atLeastOneSepFirstInternal(6,t)}AT_LEAST_ONE_SEP7(t){this.atLeastOneSepFirstInternal(7,t)}AT_LEAST_ONE_SEP8(t){this.atLeastOneSepFirstInternal(8,t)}AT_LEAST_ONE_SEP9(t){this.atLeastOneSepFirstInternal(9,t)}RULE(t,n,r=go){if(this.definedRulesNames.includes(t)){let s={message:zt.buildDuplicateRuleNameError({topLevelRule:t,grammarName:this.className}),type:Ve.DUPLICATE_RULE_NAME,ruleName:t};this.definitionErrors.push(s)}this.definedRulesNames.push(t);let i=this.defineRule(t,n,r);return this[t]=i,i}OVERRIDE_RULE(t,n,r=go){let i=Uw(t,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);let o=this.defineRule(t,n,r);return this[t]=o,o}BACKTRACK(t,n){var r;let i=(r=t.coreRule)!==null&&r!==void 0?r:t;return function(){this.isBackTrackingStack.push(1);let o=this.saveRecogState();try{return i.apply(this,n),!0}catch(s){if(ar(s))return!1;throw s}finally{this.reloadRecogState(o),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Ec(Object.values(this.gastProductionsCache))}};var jc=class{initRecognizerEngine(t,n){if(this.className=this.constructor.name,this.shortRuleNameToFull=[],this.fullRuleNameToShort={},this.ruleShortNameIdx=0,this.tokenMatcher=lo,this.subruleIdx=0,this.currRuleShortName=-1,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK=[],this.RULE_OCCURRENCE_STACK_IDX=-1,this.gastProductionsCache={},Object.hasOwn(n,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
|
|
95
95
|
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
|
|
96
96
|
For Further details.`);if(Array.isArray(t)){if(t.length===0)throw Error(`A Token Vocabulary cannot be empty.
|
|
97
97
|
Note that the first argument for the parser constructor
|
|
98
98
|
is no longer a Token vector (since v4.0).`);if(typeof t[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
|
|
99
99
|
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
|
|
100
|
-
For Further details.`)}if(Array.isArray(t))this.tokensMap=t.reduce((o,s)=>(o[s.name]=s,o),{});else if(Object.hasOwn(t,"modes")&&Object.values(t.modes).flat().every(
|
|
101
|
-
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);let i=Object.hasOwn(r,"resyncEnabled")?r.resyncEnabled:go.resyncEnabled,o=Object.hasOwn(r,"recoveryValueFunc")?r.recoveryValueFunc:go.recoveryValueFunc,s=this.ruleShortNameIdx++;this.shortRuleNameToFull[s]=t,this.fullRuleNameToShort[t]=s;let a;return this.outputCst===!0?a=function(...f){try{this.ruleInvocationStateUpdate(s,t,this.subruleIdx),n.apply(this,f);let d=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(d),d}catch(d){return this.invokeRuleCatch(d,i,o)}finally{this.ruleFinallyStateUpdate()}}:a=function(...f){try{return this.ruleInvocationStateUpdate(s,t,this.subruleIdx),n.apply(this,f)}catch(d){return this.invokeRuleCatch(d,i,o)}finally{this.ruleFinallyStateUpdate()}},Object.assign(function(...f){this.onBeforeParse(t);try{return a.apply(this,f)}finally{this.onAfterParse(t)}},{ruleName:t,originalGrammarAction:n,coreRule:a})}invokeRuleCatch(t,n,r){let i=this.RULE_STACK_IDX===0,o=n&&!this.isBackTracking()&&this.recoveryEnabled;if(
|
|
102
|
-
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(
|
|
103
|
-
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},
|
|
100
|
+
For Further details.`)}if(Array.isArray(t))this.tokensMap=t.reduce((o,s)=>(o[s.name]=s,o),{});else if(Object.hasOwn(t,"modes")&&Object.values(t.modes).flat().every(Ew)){let o=Object.values(t.modes).flat(),s=[...new Set(o)];this.tokensMap=s.reduce((a,l)=>(a[l.name]=l,a),{})}else if(typeof t=="object"&&t!==null)this.tokensMap=Object.assign({},t);else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=ft;let i=(Object.hasOwn(t,"modes")?Object.values(t.modes).flat():Object.values(t)).every(o=>{var s;return((s=o.categoryMatches)===null||s===void 0?void 0:s.length)==0});this.tokenMatcher=i?lo:An,kn(Object.values(this.tokensMap))}defineRule(t,n,r){if(this.selfAnalysisDone)throw Error(`Grammar rule <${t}> may not be defined after the 'performSelfAnalysis' method has been called'
|
|
101
|
+
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);let i=Object.hasOwn(r,"resyncEnabled")?r.resyncEnabled:go.resyncEnabled,o=Object.hasOwn(r,"recoveryValueFunc")?r.recoveryValueFunc:go.recoveryValueFunc,s=this.ruleShortNameIdx++;this.shortRuleNameToFull[s]=t,this.fullRuleNameToShort[t]=s;let a;return this.outputCst===!0?a=function(...f){try{this.ruleInvocationStateUpdate(s,t,this.subruleIdx),n.apply(this,f);let d=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(d),d}catch(d){return this.invokeRuleCatch(d,i,o)}finally{this.ruleFinallyStateUpdate()}}:a=function(...f){try{return this.ruleInvocationStateUpdate(s,t,this.subruleIdx),n.apply(this,f)}catch(d){return this.invokeRuleCatch(d,i,o)}finally{this.ruleFinallyStateUpdate()}},Object.assign(function(...f){this.onBeforeParse(t);try{return a.apply(this,f)}finally{this.onAfterParse(t)}},{ruleName:t,originalGrammarAction:n,coreRule:a})}invokeRuleCatch(t,n,r){let i=this.RULE_STACK_IDX===0,o=n&&!this.isBackTracking()&&this.recoveryEnabled;if(ar(t)){let s=t;if(o){let a=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(a))if(s.resyncedTokens=this.reSyncTo(a),this.outputCst){let l=this.CST_STACK[this.CST_STACK.length-1];return l.recoveredNode=!0,l}else return r(t);else{if(this.outputCst){let l=this.CST_STACK[this.CST_STACK.length-1];l.recoveredNode=!0,s.partialCstResult=l}throw s}}else{if(i)return this.moveToTerminatedState(),r(t);throw s}}else throw t}optionInternal(t,n){let r=512|n;return this.optionInternalLogic(t,n,r)}optionInternalLogic(t,n,r){let i=this.currRuleLookaheadFuncs[r],o;if(typeof t!="function"){o=t.DEF;let s=t.GATE;if(s!==void 0){let a=i;i=()=>s.call(this)&&a.call(this)}}else o=t;if(i.call(this)===!0)return o.call(this)}atLeastOneInternal(t,n){let r=1024|t;return this.atLeastOneInternalLogic(t,n,r)}atLeastOneInternalLogic(t,n,r){let i=this.currRuleLookaheadFuncs[r],o;if(typeof n!="function"){o=n.DEF;let s=n.GATE;if(s!==void 0){let a=i;i=()=>s.call(this)&&a.call(this)}}else o=n;if(i.call(this)===!0){let s=this.doSingleRepetition(o);for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(o)}else throw this.raiseEarlyExitException(t,Fe.REPETITION_MANDATORY,n.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[t,n],i,1024,t,Lc)}atLeastOneSepFirstInternal(t,n){let r=1536|t;this.atLeastOneSepFirstInternalLogic(t,n,r)}atLeastOneSepFirstInternalLogic(t,n,r){let i=n.DEF,o=n.SEP;if(this.currRuleLookaheadFuncs[r].call(this)===!0){i.call(this);let a=()=>this.tokenMatcher(this.LA_FAST(1),o);for(;this.tokenMatcher(this.LA_FAST(1),o)===!0;)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[t,o,a,i,fa],a,1536,t,fa)}else throw this.raiseEarlyExitException(t,Fe.REPETITION_MANDATORY_WITH_SEPARATOR,n.ERR_MSG)}manyInternal(t,n){let r=768|t;return this.manyInternalLogic(t,n,r)}manyInternalLogic(t,n,r){let i=this.currRuleLookaheadFuncs[r],o;if(typeof n!="function"){o=n.DEF;let a=n.GATE;if(a!==void 0){let l=i;i=()=>a.call(this)&&l.call(this)}}else o=n;let s=!0;for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(o);this.attemptInRepetitionRecovery(this.manyInternal,[t,n],i,768,t,Nc,s)}manySepFirstInternal(t,n){let r=1280|t;this.manySepFirstInternalLogic(t,n,r)}manySepFirstInternalLogic(t,n,r){let i=n.DEF,o=n.SEP;if(this.currRuleLookaheadFuncs[r].call(this)===!0){i.call(this);let a=()=>this.tokenMatcher(this.LA_FAST(1),o);for(;this.tokenMatcher(this.LA_FAST(1),o)===!0;)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[t,o,a,i,ua],a,1280,t,ua)}}repetitionSepSecondInternal(t,n,r,i,o){for(;r();)this.CONSUME(n),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[t,n,r,i,o],r,1536,t,o)}doSingleRepetition(t){let n=this.getLexerPosition();return t.call(this),this.getLexerPosition()>n}orInternal(t,n){let r=256|n,i=Array.isArray(t)?t:t.DEF,s=this.currRuleLookaheadFuncs[r].call(this,i);if(s!==void 0)return i[s].ALT.call(this);this.raiseNoAltException(n,t.ERR_MSG)}ruleFinallyStateUpdate(){this.RULE_STACK_IDX--,this.RULE_OCCURRENCE_STACK_IDX--,this.RULE_STACK_IDX>=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX],this.currRuleLookaheadFuncs=this.lookAheadFuncsCache[this.currRuleShortName]),this.cstFinallyStateUpdate()}subruleInternal(t,n,r){let i;try{let o=r!==void 0?r.ARGS:void 0;return this.subruleIdx=n,i=t.coreRule.apply(this,o),this.cstPostNonTerminal(i,r!==void 0&&r.LABEL!==void 0?r.LABEL:t.ruleName),i}catch(o){throw this.subruleInternalError(o,r,t.ruleName)}}subruleInternalError(t,n,r){throw ar(t)&&t.partialCstResult!==void 0&&(this.cstPostNonTerminal(t.partialCstResult,n!==void 0&&n.LABEL!==void 0?n.LABEL:r),delete t.partialCstResult),t}consumeInternal(t,n,r){let i;try{let o=this.LA_FAST(1);this.tokenMatcher(o,t)===!0?(this.consumeToken(),i=o):this.consumeInternalError(t,o,r)}catch(o){i=this.consumeInternalRecovery(t,n,o)}return this.cstPostTerminal(r!==void 0&&r.LABEL!==void 0?r.LABEL:t.name,i),i}consumeInternalError(t,n,r){let i,o=this.LA(0);throw r!==void 0&&r.ERR_MSG?i=r.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:t,actual:n,previous:o,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new ii(i,n,o))}consumeInternalRecovery(t,n,r){if(this.recoveryEnabled&&r.name==="MismatchedTokenException"&&!this.isBackTracking()){let i=this.getFollowsForInRuleRecovery(t,n);try{return this.tryInRuleRecovery(t,i)}catch(o){throw o.name===$h?r:o}}else throw r}saveRecogState(){let t=this.errors,n=this.RULE_STACK.slice(0,this.RULE_STACK_IDX+1);return{errors:t,lexerState:this.exportLexerState(),RULE_STACK:n,CST_STACK:this.CST_STACK}}reloadRecogState(t){this.errors=t.errors,this.importLexerState(t.lexerState);let n=t.RULE_STACK;for(let r=0;r<n.length;r++)this.RULE_STACK[r]=n[r];this.RULE_STACK_IDX=n.length-1,this.RULE_STACK_IDX>=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX],this.currRuleLookaheadFuncs=this.lookAheadFuncsCache[this.currRuleShortName])}ruleInvocationStateUpdate(t,n,r){this.RULE_OCCURRENCE_STACK[++this.RULE_OCCURRENCE_STACK_IDX]=r,this.RULE_STACK[++this.RULE_STACK_IDX]=t,this.currRuleShortName=t,this.currRuleLookaheadFuncs=this.lookAheadFuncsCache[t],this.cstInvocationStateUpdate(n)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){let t=this.currRuleShortName;return this.shortRuleNameToFull[t]}shortRuleNameToFullName(t){return this.shortRuleNameToFull[t]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),ft)}reset(){this.resetLexerState(),this.subruleIdx=0,this.currRuleShortName=-1,this.currRuleLookaheadFuncs=[],this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK_IDX=-1,this.CST_STACK=[]}onBeforeParse(t){for(let n=0;n<this.maxLookahead+1;n++)this.tokVector.push(Nn)}onAfterParse(t){if(this.isAtEndOfInput()===!1){let n=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:n,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new ma(r,n))}for(;this.tokVector.at(-1)===Nn;)this.tokVector.pop()}};var Yc=class{initErrorHandler(t){this._errors=[],this.errorMessageProvider=Object.hasOwn(t,"errorMessageProvider")?t.errorMessageProvider:dt.errorMessageProvider}SAVE_ERROR(t){if(ar(t))return t.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1)},this._errors.push(t),t;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return[...this._errors]}set errors(t){this._errors=t}raiseEarlyExitException(t,n,r){let i=this.getCurrRuleFullName(),o=this.getGAstProductions()[i],a=ho(t,o,n,this.maxLookahead)[0],l=[];for(let u=1;u<=this.maxLookahead;u++)l.push(this.LA(u));let c=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:a,actual:l,previous:this.LA(0),customUserDescription:r,ruleName:i});throw this.SAVE_ERROR(new ga(c,this.LA(1),this.LA(0)))}raiseNoAltException(t,n){let r=this.getCurrRuleFullName(),i=this.getGAstProductions()[r],o=po(t,i,this.maxLookahead),s=[];for(let c=1;c<=this.maxLookahead;c++)s.push(this.LA(c));let a=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:o,actual:s,previous:a,customUserDescription:n,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new ha(l,this.LA(1),a))}};var qc={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(qc);var rT=!0,iT=255,sT=sr({name:"RECORDING_PHASE_TOKEN",pattern:Me.NA});kn([sT]);var aT=Rn(sT,`This IToken indicates the Parser is in Recording Phase
|
|
102
|
+
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(aT);var xP={name:`This CSTNode indicates the Parser is in Recording Phase
|
|
103
|
+
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},Vc=class{initGastRecorder(t){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let t=0;t<10;t++){let n=t>0?t:"";this[`CONSUME${n}`]=function(r,i){return this.consumeInternalRecord(r,t,i)},this[`SUBRULE${n}`]=function(r,i){return this.subruleInternalRecord(r,t,i)},this[`OPTION${n}`]=function(r){return this.optionInternalRecord(r,t)},this[`OR${n}`]=function(r){return this.orInternalRecord(r,t)},this[`MANY${n}`]=function(r){this.manyInternalRecord(t,r)},this[`MANY_SEP${n}`]=function(r){this.manySepFirstInternalRecord(t,r)},this[`AT_LEAST_ONE${n}`]=function(r){this.atLeastOneInternalRecord(t,r)},this[`AT_LEAST_ONE_SEP${n}`]=function(r){this.atLeastOneSepFirstInternalRecord(t,r)}}this.consume=function(t,n,r){return this.consumeInternalRecord(n,t,r)},this.subrule=function(t,n,r){return this.subruleInternalRecord(n,t,r)},this.option=function(t,n){return this.optionInternalRecord(n,t)},this.or=function(t,n){return this.orInternalRecord(n,t)},this.many=function(t,n){this.manyInternalRecord(t,n)},this.atLeastOne=function(t,n){this.atLeastOneInternalRecord(t,n)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{let t=this;for(let n=0;n<10;n++){let r=n>0?n:"";delete t[`CONSUME${r}`],delete t[`SUBRULE${r}`],delete t[`OPTION${r}`],delete t[`OR${r}`],delete t[`MANY${r}`],delete t[`MANY_SEP${r}`],delete t[`AT_LEAST_ONE${r}`],delete t[`AT_LEAST_ONE_SEP${r}`]}delete t.consume,delete t.subrule,delete t.option,delete t.or,delete t.many,delete t.atLeastOne,delete t.ACTION,delete t.BACKTRACK,delete t.LA})}ACTION_RECORD(t){}BACKTRACK_RECORD(t,n){return()=>!0}LA_RECORD(t){return Nn}topLevelRuleRecord(t,n){try{let r=new ct({definition:[],name:t});return r.name=t,this.recordingProdStack.push(r),n.call(this),this.recordingProdStack.pop(),r}catch(r){if(r.KNOWN_RECORDER_ERROR!==!0)try{r.message=r.message+`
|
|
104
104
|
This error was thrown during the "grammar recording phase" For more info see:
|
|
105
|
-
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw r}throw r}}optionInternalRecord(t,n){return xa.call(this,we,t,n)}atLeastOneInternalRecord(t,n){xa.call(this,Ne,n,t)}atLeastOneSepFirstInternalRecord(t,n){xa.call(this,Le,n,t,
|
|
106
|
-
inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}let i=this.recordingProdStack.at(-1),o=t.ruleName,s=new Ee({idx:n,nonTerminalName:o,label:r?.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?xP:
|
|
107
|
-
inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}let i=this.recordingProdStack.at(-1),o=new le({idx:n,terminalType:t,label:r?.LABEL});return i.definition.push(o),
|
|
108
|
-
Idx value must be a none negative value smaller than ${
|
|
105
|
+
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw r}throw r}}optionInternalRecord(t,n){return xa.call(this,we,t,n)}atLeastOneInternalRecord(t,n){xa.call(this,Ne,n,t)}atLeastOneSepFirstInternalRecord(t,n){xa.call(this,Le,n,t,rT)}manyInternalRecord(t,n){xa.call(this,me,n,t)}manySepFirstInternalRecord(t,n){xa.call(this,ke,n,t,rT)}orInternalRecord(t,n){return EP.call(this,t,n)}subruleInternalRecord(t,n,r){if(Kc(n),!t||!Object.hasOwn(t,"ruleName")){let a=new Error(`<SUBRULE${oT(n)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(t)}>
|
|
106
|
+
inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}let i=this.recordingProdStack.at(-1),o=t.ruleName,s=new Ee({idx:n,nonTerminalName:o,label:r?.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?xP:qc}consumeInternalRecord(t,n,r){if(Kc(n),!Ah(t)){let s=new Error(`<CONSUME${oT(n)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(t)}>
|
|
107
|
+
inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}let i=this.recordingProdStack.at(-1),o=new le({idx:n,terminalType:t,label:r?.LABEL});return i.definition.push(o),aT}};function xa(e,t,n,r=!1){Kc(n);let i=this.recordingProdStack.at(-1),o=typeof t=="function"?t:t.DEF,s=new e({definition:[],idx:n});return r&&(s.separator=t.SEP),Object.hasOwn(t,"MAX_LOOKAHEAD")&&(s.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(s),o.call(this),i.definition.push(s),this.recordingProdStack.pop(),qc}function EP(e,t){Kc(t);let n=this.recordingProdStack.at(-1),r=Array.isArray(e)===!1,i=r===!1?e:e.DEF,o=new Ie({definition:[],idx:t,ignoreAmbiguities:r&&e.IGNORE_AMBIGUITIES===!0});Object.hasOwn(e,"MAX_LOOKAHEAD")&&(o.maxLookahead=e.MAX_LOOKAHEAD);let s=i.some(a=>typeof a.GATE=="function");return o.hasPredicates=s,n.definition.push(o),i.forEach(a=>{let l=new be({definition:[]});o.definition.push(l),Object.hasOwn(a,"IGNORE_AMBIGUITIES")?l.ignoreAmbiguities=a.IGNORE_AMBIGUITIES:Object.hasOwn(a,"GATE")&&(l.ignoreAmbiguities=!0),this.recordingProdStack.push(l),a.ALT.call(this),this.recordingProdStack.pop()}),qc}function oT(e){return e===0?"":`${e}`}function Kc(e){if(e<0||e>iT){let t=new Error(`Invalid DSL Method idx value: <${e}>
|
|
108
|
+
Idx value must be a none negative value smaller than ${iT+1}`);throw t.KNOWN_RECORDER_ERROR=!0,t}}var Zc=class{initPerformanceTracer(t){if(Object.hasOwn(t,"traceInitPerf")){let n=t.traceInitPerf,r=typeof n=="number";this.traceInitMaxIdent=r?n:1/0,this.traceInitPerf=r?n>0:n}else this.traceInitMaxIdent=0,this.traceInitPerf=dt.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(t,n){if(this.traceInitPerf===!0){this.traceInitIndent++;let r=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${r}--> <${t}>`);let{time:i,value:o}=oa(n),s=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(`${r}<-- <${t}> time: ${i}ms`),this.traceInitIndent--,o}else return n()}};function lT(e,t){t.forEach(n=>{let r=n.prototype;Object.getOwnPropertyNames(r).forEach(i=>{if(i==="constructor")return;let o=Object.getOwnPropertyDescriptor(r,i);o&&(o.get||o.set)?Object.defineProperty(e.prototype,i,o):e.prototype[i]=n.prototype[i]})})}var Nn=Rn(ft,"",-1,-1,-1,-1,-1,-1);Object.freeze(Nn);var dt=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Sn,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),go=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0}),Ve;(function(e){e[e.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",e[e.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",e[e.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",e[e.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",e[e.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",e[e.LEFT_RECURSION=5]="LEFT_RECURSION",e[e.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",e[e.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",e[e.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",e[e.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",e[e.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",e[e.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",e[e.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(Ve||(Ve={}));function Jc(e=void 0){return function(){return e}}var Ea=class e{static performSelfAnalysis(t){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let t;this.selfAnalysisDone=!0;let n=this.className;this.TRACE_INIT("toFastProps",()=>{sa(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),this.definedRulesNames.forEach(i=>{let s=this[i].originalGrammarAction,a;this.TRACE_INIT(`${i} Rule`,()=>{a=this.topLevelRuleRecord(i,s)}),this.gastProductionsCache[i]=a})}finally{this.disableRecording()}});let r=[];if(this.TRACE_INIT("Grammar Resolving",()=>{r=jw({rules:Object.values(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(r)}),this.TRACE_INIT("Grammar Validations",()=>{if(r.length===0&&this.skipValidations===!1){let i=Yw({rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),errMsgProvider:zt,grammarName:n}),o=Bw({lookaheadStrategy:this.lookaheadStrategy,rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),grammarName:n});this.definitionErrors=this.definitionErrors.concat(i,o)}}),this.definitionErrors.length===0&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{let i=tw(Object.values(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,o;(o=(i=this.lookaheadStrategy).initialize)===null||o===void 0||o.call(i,{rules:Object.values(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Object.values(this.gastProductionsCache))})),!e.DEFER_DEFINITION_ERRORS_HANDLING&&this.definitionErrors.length!==0)throw t=this.definitionErrors.map(i=>i.message),new Error(`Parser Definition Errors detected:
|
|
109
109
|
${t.join(`
|
|
110
110
|
-------------------------------
|
|
111
111
|
`)}`)})}constructor(t,n){this.definitionErrors=[],this.selfAnalysisDone=!1;let r=this;if(r.initErrorHandler(n),r.initLexerAdapter(),r.initLooksAhead(n),r.initRecognizerEngine(t,n),r.initRecoverable(n),r.initTreeBuilder(n),r.initGastRecorder(n),r.initPerformanceTracer(n),Object.hasOwn(n,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
|
|
112
112
|
Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
|
|
113
113
|
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
|
|
114
|
-
For further details.`);this.skipValidations=Object.hasOwn(n,"skipValidations")?n.skipValidations:dt.skipValidations}};Ea.DEFER_DEFINITION_ERRORS_HANDLING=!1;cT(Ea,[Fc,Wc,Hc,zc,Yc,jc,Vc,Kc,Jc]);var wa=class extends Ea{constructor(t,n=dt){let r=Object.assign({},n);r.outputCst=!1,super(t,r)}};function TP(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var eu=TP;function vP(){this.__data__=[],this.size=0}var uT=vP;function _P(e,t){return e===t||e!==e&&t!==t}var tu=_P;function AP(e,t){for(var n=e.length;n--;)if(tu(e[n][0],t))return n;return-1}var ar=AP;var kP=Array.prototype,IP=kP.splice;function RP(e){var t=this.__data__,n=ar(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():IP.call(t,n,1),--this.size,!0}var fT=RP;function SP(e){var t=this.__data__,n=ar(t,e);return n<0?void 0:t[n][1]}var dT=SP;function bP(e){return ar(this.__data__,e)>-1}var pT=bP;function NP(e,t){var n=this.__data__,r=ar(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var hT=NP;function yo(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}yo.prototype.clear=uT;yo.prototype.delete=fT;yo.prototype.get=dT;yo.prototype.has=pT;yo.prototype.set=hT;var lr=yo;function LP(){this.__data__=new lr,this.size=0}var mT=LP;function PP(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var gT=PP;function CP(e){return this.__data__.get(e)}var yT=CP;function OP(e){return this.__data__.has(e)}var xT=OP;var $P=typeof global=="object"&&global&&global.Object===Object&&global,nu=$P;var DP=typeof self=="object"&&self&&self.Object===Object&&self,MP=nu||DP||Function("return this")(),Je=MP;var FP=Je.Symbol,pt=FP;var ET=Object.prototype,BP=ET.hasOwnProperty,WP=ET.toString,Ta=pt?pt.toStringTag:void 0;function XP(e){var t=BP.call(e,Ta),n=e[Ta];try{e[Ta]=void 0;var r=!0}catch{}var i=WP.call(e);return r&&(t?e[Ta]=n:delete e[Ta]),i}var wT=XP;var UP=Object.prototype,GP=UP.toString;function HP(e){return GP.call(e)}var TT=HP;var zP="[object Null]",jP="[object Undefined]",vT=pt?pt.toStringTag:void 0;function YP(e){return e==null?e===void 0?jP:zP:vT&&vT in Object(e)?wT(e):TT(e)}var jt=YP;function VP(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var xo=VP;var KP="[object AsyncFunction]",qP="[object Function]",ZP="[object GeneratorFunction]",JP="[object Proxy]";function QP(e){if(!xo(e))return!1;var t=jt(e);return t==qP||t==ZP||t==KP||t==JP}var ru=QP;var eC=Je["__core-js_shared__"],iu=eC;var _T=(function(){var e=/[^.]+$/.exec(iu&&iu.keys&&iu.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function tC(e){return!!_T&&_T in e}var AT=tC;var nC=Function.prototype,rC=nC.toString;function iC(e){if(e!=null){try{return rC.call(e)}catch{}try{return e+""}catch{}}return""}var Sn=iC;var oC=/[\\^$.*+?()[\]{}|]/g,sC=/^\[object .+?Constructor\]$/,aC=Function.prototype,lC=Object.prototype,cC=aC.toString,uC=lC.hasOwnProperty,fC=RegExp("^"+cC.call(uC).replace(oC,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function dC(e){if(!xo(e)||AT(e))return!1;var t=ru(e)?fC:sC;return t.test(Sn(e))}var kT=dC;function pC(e,t){return e?.[t]}var IT=pC;function hC(e,t){var n=IT(e,t);return kT(n)?n:void 0}var $t=hC;var mC=$t(Je,"Map"),cr=mC;var gC=$t(Object,"create"),bn=gC;function yC(){this.__data__=bn?bn(null):{},this.size=0}var RT=yC;function xC(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var ST=xC;var EC="__lodash_hash_undefined__",wC=Object.prototype,TC=wC.hasOwnProperty;function vC(e){var t=this.__data__;if(bn){var n=t[e];return n===EC?void 0:n}return TC.call(t,e)?t[e]:void 0}var bT=vC;var _C=Object.prototype,AC=_C.hasOwnProperty;function kC(e){var t=this.__data__;return bn?t[e]!==void 0:AC.call(t,e)}var NT=kC;var IC="__lodash_hash_undefined__";function RC(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=bn&&t===void 0?IC:t,this}var LT=RC;function Eo(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Eo.prototype.clear=RT;Eo.prototype.delete=ST;Eo.prototype.get=bT;Eo.prototype.has=NT;Eo.prototype.set=LT;var Hh=Eo;function SC(){this.size=0,this.__data__={hash:new Hh,map:new(cr||lr),string:new Hh}}var PT=SC;function bC(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var CT=bC;function NC(e,t){var n=e.__data__;return CT(t)?n[typeof t=="string"?"string":"hash"]:n.map}var ur=NC;function LC(e){var t=ur(this,e).delete(e);return this.size-=t?1:0,t}var OT=LC;function PC(e){return ur(this,e).get(e)}var $T=PC;function CC(e){return ur(this,e).has(e)}var DT=CC;function OC(e,t){var n=ur(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var MT=OC;function wo(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}wo.prototype.clear=PT;wo.prototype.delete=OT;wo.prototype.get=$T;wo.prototype.has=DT;wo.prototype.set=MT;var oi=wo;var $C=200;function DC(e,t){var n=this.__data__;if(n instanceof lr){var r=n.__data__;if(!cr||r.length<$C-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new oi(r)}return n.set(e,t),this.size=n.size,this}var FT=DC;function To(e){var t=this.__data__=new lr(e);this.size=t.size}To.prototype.clear=mT;To.prototype.delete=gT;To.prototype.get=yT;To.prototype.has=xT;To.prototype.set=FT;var vo=To;var MC="__lodash_hash_undefined__";function FC(e){return this.__data__.set(e,MC),this}var BT=FC;function BC(e){return this.__data__.has(e)}var WT=BC;function ou(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new oi;++t<n;)this.add(e[t])}ou.prototype.add=ou.prototype.push=BT;ou.prototype.has=WT;var su=ou;function WC(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var XT=WC;function XC(e,t){return e.has(t)}var au=XC;var UC=1,GC=2;function HC(e,t,n,r,i,o){var s=n&UC,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var c=o.get(e),u=o.get(t);if(c&&u)return c==t&&u==e;var f=-1,d=!0,p=n&GC?new su:void 0;for(o.set(e,t),o.set(t,e);++f<a;){var m=e[f],g=t[f];if(r)var w=s?r(g,m,f,t,e,o):r(m,g,f,e,t,o);if(w!==void 0){if(w)continue;d=!1;break}if(p){if(!XT(t,function(x,y){if(!au(p,y)&&(m===x||i(m,x,n,r,o)))return p.push(y)})){d=!1;break}}else if(!(m===g||i(m,g,n,r,o))){d=!1;break}}return o.delete(e),o.delete(t),d}var lu=HC;var zC=Je.Uint8Array,zh=zC;function jC(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}var UT=jC;function YC(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var _o=YC;var VC=1,KC=2,qC="[object Boolean]",ZC="[object Date]",JC="[object Error]",QC="[object Map]",eO="[object Number]",tO="[object RegExp]",nO="[object Set]",rO="[object String]",iO="[object Symbol]",oO="[object ArrayBuffer]",sO="[object DataView]",GT=pt?pt.prototype:void 0,jh=GT?GT.valueOf:void 0;function aO(e,t,n,r,i,o,s){switch(n){case sO:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case oO:return!(e.byteLength!=t.byteLength||!o(new zh(e),new zh(t)));case qC:case ZC:case eO:return tu(+e,+t);case JC:return e.name==t.name&&e.message==t.message;case tO:case rO:return e==t+"";case QC:var a=UT;case nO:var l=r&VC;if(a||(a=_o),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;r|=KC,s.set(e,t);var u=lu(a(e),a(t),r,i,o,s);return s.delete(e),u;case iO:if(jh)return jh.call(e)==jh.call(t)}return!1}var HT=aO;function lO(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var cu=lO;var cO=Array.isArray,Te=cO;function uO(e,t,n){var r=t(e);return Te(e)?r:cu(r,n(e))}var zT=uO;function fO(e,t){for(var n=-1,r=e==null?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}var uu=fO;function dO(){return[]}var jT=dO;var pO=Object.prototype,hO=pO.propertyIsEnumerable,YT=Object.getOwnPropertySymbols,mO=YT?function(e){return e==null?[]:(e=Object(e),uu(YT(e),function(t){return hO.call(e,t)}))}:jT,VT=mO;function gO(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var KT=gO;function yO(e){return e!=null&&typeof e=="object"}var Yt=yO;var xO="[object Arguments]";function EO(e){return Yt(e)&&jt(e)==xO}var Yh=EO;var qT=Object.prototype,wO=qT.hasOwnProperty,TO=qT.propertyIsEnumerable,vO=Yh((function(){return arguments})())?Yh:function(e){return Yt(e)&&wO.call(e,"callee")&&!TO.call(e,"callee")},fr=vO;function _O(){return!1}var ZT=_O;var ev=typeof exports=="object"&&exports&&!exports.nodeType&&exports,JT=ev&&typeof module=="object"&&module&&!module.nodeType&&module,AO=JT&&JT.exports===ev,QT=AO?Je.Buffer:void 0,kO=QT?QT.isBuffer:void 0,IO=kO||ZT,si=IO;var RO=9007199254740991,SO=/^(?:0|[1-9]\d*)$/;function bO(e,t){var n=typeof e;return t=t??RO,!!t&&(n=="number"||n!="symbol"&&SO.test(e))&&e>-1&&e%1==0&&e<t}var fu=bO;var NO=9007199254740991;function LO(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=NO}var Ao=LO;var PO="[object Arguments]",CO="[object Array]",OO="[object Boolean]",$O="[object Date]",DO="[object Error]",MO="[object Function]",FO="[object Map]",BO="[object Number]",WO="[object Object]",XO="[object RegExp]",UO="[object Set]",GO="[object String]",HO="[object WeakMap]",zO="[object ArrayBuffer]",jO="[object DataView]",YO="[object Float32Array]",VO="[object Float64Array]",KO="[object Int8Array]",qO="[object Int16Array]",ZO="[object Int32Array]",JO="[object Uint8Array]",QO="[object Uint8ClampedArray]",e$="[object Uint16Array]",t$="[object Uint32Array]",Pe={};Pe[YO]=Pe[VO]=Pe[KO]=Pe[qO]=Pe[ZO]=Pe[JO]=Pe[QO]=Pe[e$]=Pe[t$]=!0;Pe[PO]=Pe[CO]=Pe[zO]=Pe[OO]=Pe[jO]=Pe[$O]=Pe[DO]=Pe[MO]=Pe[FO]=Pe[BO]=Pe[WO]=Pe[XO]=Pe[UO]=Pe[GO]=Pe[HO]=!1;function n$(e){return Yt(e)&&Ao(e.length)&&!!Pe[jt(e)]}var tv=n$;function r$(e){return function(t){return e(t)}}var nv=r$;var rv=typeof exports=="object"&&exports&&!exports.nodeType&&exports,va=rv&&typeof module=="object"&&module&&!module.nodeType&&module,i$=va&&va.exports===rv,Vh=i$&&nu.process,o$=(function(){try{var e=va&&va.require&&va.require("util").types;return e||Vh&&Vh.binding&&Vh.binding("util")}catch{}})(),Kh=o$;var iv=Kh&&Kh.isTypedArray,s$=iv?nv(iv):tv,ko=s$;var a$=Object.prototype,l$=a$.hasOwnProperty;function c$(e,t){var n=Te(e),r=!n&&fr(e),i=!n&&!r&&si(e),o=!n&&!r&&!i&&ko(e),s=n||r||i||o,a=s?KT(e.length,String):[],l=a.length;for(var c in e)(t||l$.call(e,c))&&!(s&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||fu(c,l)))&&a.push(c);return a}var ov=c$;var u$=Object.prototype;function f$(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||u$;return e===n}var du=f$;function d$(e,t){return function(n){return e(t(n))}}var sv=d$;var p$=sv(Object.keys,Object),av=p$;var h$=Object.prototype,m$=h$.hasOwnProperty;function g$(e){if(!du(e))return av(e);var t=[];for(var n in Object(e))m$.call(e,n)&&n!="constructor"&&t.push(n);return t}var pu=g$;function y$(e){return e!=null&&Ao(e.length)&&!ru(e)}var dr=y$;function x$(e){return dr(e)?ov(e):pu(e)}var Io=x$;function E$(e){return zT(e,Io,VT)}var qh=E$;var w$=1,T$=Object.prototype,v$=T$.hasOwnProperty;function _$(e,t,n,r,i,o){var s=n&w$,a=qh(e),l=a.length,c=qh(t),u=c.length;if(l!=u&&!s)return!1;for(var f=l;f--;){var d=a[f];if(!(s?d in t:v$.call(t,d)))return!1}var p=o.get(e),m=o.get(t);if(p&&m)return p==t&&m==e;var g=!0;o.set(e,t),o.set(t,e);for(var w=s;++f<l;){d=a[f];var x=e[d],y=t[d];if(r)var T=s?r(y,x,d,t,e,o):r(x,y,d,e,t,o);if(!(T===void 0?x===y||i(x,y,n,r,o):T)){g=!1;break}w||(w=d=="constructor")}if(g&&!w){var E=e.constructor,v=t.constructor;E!=v&&"constructor"in e&&"constructor"in t&&!(typeof E=="function"&&E instanceof E&&typeof v=="function"&&v instanceof v)&&(g=!1)}return o.delete(e),o.delete(t),g}var lv=_$;var A$=$t(Je,"DataView"),hu=A$;var k$=$t(Je,"Promise"),mu=k$;var I$=$t(Je,"Set"),pr=I$;var R$=$t(Je,"WeakMap"),gu=R$;var cv="[object Map]",S$="[object Object]",uv="[object Promise]",fv="[object Set]",dv="[object WeakMap]",pv="[object DataView]",b$=Sn(hu),N$=Sn(cr),L$=Sn(mu),P$=Sn(pr),C$=Sn(gu),ai=jt;(hu&&ai(new hu(new ArrayBuffer(1)))!=pv||cr&&ai(new cr)!=cv||mu&&ai(mu.resolve())!=uv||pr&&ai(new pr)!=fv||gu&&ai(new gu)!=dv)&&(ai=function(e){var t=jt(e),n=t==S$?e.constructor:void 0,r=n?Sn(n):"";if(r)switch(r){case b$:return pv;case N$:return cv;case L$:return uv;case P$:return fv;case C$:return dv}return t});var _a=ai;var O$=1,hv="[object Arguments]",mv="[object Array]",yu="[object Object]",$$=Object.prototype,gv=$$.hasOwnProperty;function D$(e,t,n,r,i,o){var s=Te(e),a=Te(t),l=s?mv:_a(e),c=a?mv:_a(t);l=l==hv?yu:l,c=c==hv?yu:c;var u=l==yu,f=c==yu,d=l==c;if(d&&si(e)){if(!si(t))return!1;s=!0,u=!1}if(d&&!u)return o||(o=new vo),s||ko(e)?lu(e,t,n,r,i,o):HT(e,t,l,n,r,i,o);if(!(n&O$)){var p=u&&gv.call(e,"__wrapped__"),m=f&&gv.call(t,"__wrapped__");if(p||m){var g=p?e.value():e,w=m?t.value():t;return o||(o=new vo),i(g,w,n,r,o)}}return d?(o||(o=new vo),lv(e,t,n,r,i,o)):!1}var yv=D$;function xv(e,t,n,r,i){return e===t?!0:e==null||t==null||!Yt(e)&&!Yt(t)?e!==e&&t!==t:yv(e,t,n,r,xv,i)}var xu=xv;var M$=1,F$=2;function B$(e,t,n,r){var i=n.length,o=i,s=!r;if(e==null)return!o;for(e=Object(e);i--;){var a=n[i];if(s&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<o;){a=n[i];var l=a[0],c=e[l],u=a[1];if(s&&a[2]){if(c===void 0&&!(l in e))return!1}else{var f=new vo;if(r)var d=r(c,u,l,e,t,f);if(!(d===void 0?xu(u,c,M$|F$,r,f):d))return!1}}return!0}var Ev=B$;function W$(e){return e===e&&!xo(e)}var Eu=W$;function X$(e){for(var t=Io(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Eu(i)]}return t}var wv=X$;function U$(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var wu=U$;function G$(e){var t=wv(e);return t.length==1&&t[0][2]?wu(t[0][0],t[0][1]):function(n){return n===e||Ev(n,e,t)}}var Tv=G$;var H$="[object Symbol]";function z$(e){return typeof e=="symbol"||Yt(e)&&jt(e)==H$}var hr=z$;var j$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Y$=/^\w*$/;function V$(e,t){if(Te(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||hr(e)?!0:Y$.test(e)||!j$.test(e)||t!=null&&e in Object(t)}var Ro=V$;var K$="Expected a function";function Zh(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(K$);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Zh.Cache||oi),n}Zh.Cache=oi;var vv=Zh;var q$=500;function Z$(e){var t=vv(e,function(r){return n.size===q$&&n.clear(),r}),n=t.cache;return t}var _v=Z$;var J$=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Q$=/\\(\\)?/g,e1=_v(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(J$,function(n,r,i,o){t.push(i?o.replace(Q$,"$1"):r||n)}),t}),Av=e1;var t1=1/0,kv=pt?pt.prototype:void 0,Iv=kv?kv.toString:void 0;function Rv(e){if(typeof e=="string")return e;if(Te(e))return eu(e,Rv)+"";if(hr(e))return Iv?Iv.call(e):"";var t=e+"";return t=="0"&&1/e==-t1?"-0":t}var Sv=Rv;function n1(e){return e==null?"":Sv(e)}var bv=n1;function r1(e,t){return Te(e)?e:Ro(e,t)?[e]:Av(bv(e))}var Tu=r1;var i1=1/0;function o1(e){if(typeof e=="string"||hr(e))return e;var t=e+"";return t=="0"&&1/e==-i1?"-0":t}var mr=o1;function s1(e,t){t=Tu(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[mr(t[n++])];return n&&n==r?e:void 0}var vu=s1;function a1(e,t,n){var r=e==null?void 0:vu(e,t);return r===void 0?n:r}var Nv=a1;function l1(e,t){return e!=null&&t in Object(e)}var Lv=l1;function c1(e,t,n){t=Tu(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var s=mr(t[r]);if(!(o=e!=null&&n(e,s)))break;e=e[s]}return o||++r!=i?o:(i=e==null?0:e.length,!!i&&Ao(i)&&fu(s,i)&&(Te(e)||fr(e)))}var Pv=c1;function u1(e,t){return e!=null&&Pv(e,t,Lv)}var Cv=u1;var f1=1,d1=2;function p1(e,t){return Ro(e)&&Eu(t)?wu(mr(e),t):function(n){var r=Nv(n,e);return r===void 0&&r===t?Cv(n,e):xu(t,r,f1|d1)}}var Ov=p1;function h1(e){return e}var So=h1;function m1(e){return function(t){return t?.[e]}}var $v=m1;function g1(e){return function(t){return vu(t,e)}}var Dv=g1;function y1(e){return Ro(e)?$v(mr(e)):Dv(e)}var Mv=y1;function x1(e){return typeof e=="function"?e:e==null?So:typeof e=="object"?Te(e)?Ov(e[0],e[1]):Tv(e):Mv(e)}var gr=x1;function E1(e){return function(t,n,r){for(var i=-1,o=Object(t),s=r(t),a=s.length;a--;){var l=s[e?a:++i];if(n(o[l],l,o)===!1)break}return t}}var Fv=E1;var w1=Fv(),Bv=w1;function T1(e,t){return e&&Bv(e,t,Io)}var Wv=T1;function v1(e,t){return function(n,r){if(n==null)return n;if(!dr(n))return e(n,r);for(var i=n.length,o=t?i:-1,s=Object(n);(t?o--:++o<i)&&r(s[o],o,s)!==!1;);return n}}var Xv=v1;var _1=Xv(Wv),yr=_1;function A1(e,t){var n=-1,r=dr(e)?Array(e.length):[];return yr(e,function(i,o,s){r[++n]=t(i,o,s)}),r}var Uv=A1;function k1(e,t){var n=Te(e)?eu:Uv;return n(e,gr(t,3))}var bt=k1;function I1(e,t){var n=[];return yr(e,function(r,i,o){t(r,i,o)&&n.push(r)}),n}var Gv=I1;function R1(e,t){var n=Te(e)?uu:Gv;return n(e,gr(t,3))}var Hv=R1;function ui(e,t,n){return`${e.name}_${t}_${n}`}var xr=1,S1=2,zv=4,jv=5;var Er=7,b1=8,N1=9,L1=10,P1=11,Yv=12,Aa=class{constructor(t){this.target=t}isEpsilon(){return!1}},li=class extends Aa{constructor(t,n){super(t),this.tokenType=n}},ka=class extends Aa{constructor(t){super(t)}isEpsilon(){return!0}},ci=class extends Aa{constructor(t,n,r){super(t),this.rule=n,this.followState=r}isEpsilon(){return!0}};function Vv(e){let t={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};C1(t,e);let n=e.length;for(let r=0;r<n;r++){let i=e[r],o=fi(t,i,i);o!==void 0&&H1(t,i,o)}return t}function C1(e,t){let n=t.length;for(let r=0;r<n;r++){let i=t[r],o=Qe(e,i,void 0,{type:S1}),s=Qe(e,i,void 0,{type:Er});o.stop=s,e.ruleToStartState.set(i,o),e.ruleToStopState.set(i,s)}}function Kv(e,t,n){return n instanceof le?Jh(e,t,n.terminalType,n):n instanceof Ee?G1(e,t,n):n instanceof Ie?F1(e,t,n):n instanceof we?B1(e,t,n):n instanceof me?O1(e,t,n):n instanceof ke?$1(e,t,n):n instanceof Ne?D1(e,t,n):n instanceof Le?M1(e,t,n):fi(e,t,n)}function O1(e,t,n){let r=Qe(e,t,n,{type:jv});wr(e,r);let i=bo(e,t,r,n,fi(e,t,n));return Zv(e,t,n,i)}function $1(e,t,n){let r=Qe(e,t,n,{type:jv});wr(e,r);let i=bo(e,t,r,n,fi(e,t,n)),o=Jh(e,t,n.separator,n);return Zv(e,t,n,i,o)}function D1(e,t,n){let r=Qe(e,t,n,{type:zv});wr(e,r);let i=bo(e,t,r,n,fi(e,t,n));return qv(e,t,n,i)}function M1(e,t,n){let r=Qe(e,t,n,{type:zv});wr(e,r);let i=bo(e,t,r,n,fi(e,t,n)),o=Jh(e,t,n.separator,n);return qv(e,t,n,i,o)}function F1(e,t,n){let r=Qe(e,t,n,{type:xr});wr(e,r);let i=bt(n.definition,s=>Kv(e,t,s));return bo(e,t,r,n,...i)}function B1(e,t,n){let r=Qe(e,t,n,{type:xr});wr(e,r);let i=bo(e,t,r,n,fi(e,t,n));return W1(e,t,n,i)}function fi(e,t,n){let r=Hv(bt(n.definition,i=>Kv(e,t,i)),i=>i!==void 0);return r.length===1?r[0]:r.length===0?void 0:U1(e,r)}function qv(e,t,n,r,i){let o=r.left,s=r.right,a=Qe(e,t,n,{type:P1});wr(e,a);let l=Qe(e,t,n,{type:Yv});return o.loopback=a,l.loopback=a,e.decisionMap[ui(t,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",n.idx)]=a,je(s,a),i===void 0?(je(a,o),je(a,l)):(je(a,l),je(a,i.left),je(i.right,o)),{left:o,right:l}}function Zv(e,t,n,r,i){let o=r.left,s=r.right,a=Qe(e,t,n,{type:L1});wr(e,a);let l=Qe(e,t,n,{type:Yv}),c=Qe(e,t,n,{type:N1});return a.loopback=c,l.loopback=c,je(a,o),je(a,l),je(s,c),i!==void 0?(je(c,l),je(c,i.left),je(i.right,o)):je(c,a),e.decisionMap[ui(t,i?"RepetitionWithSeparator":"Repetition",n.idx)]=a,{left:a,right:l}}function W1(e,t,n,r){let i=r.left,o=r.right;return je(i,o),e.decisionMap[ui(t,"Option",n.idx)]=i,r}function wr(e,t){return e.decisionStates.push(t),t.decision=e.decisionStates.length-1,t.decision}function bo(e,t,n,r,...i){let o=Qe(e,t,r,{type:b1,start:n});n.end=o;for(let a of i)a!==void 0?(je(n,a.left),je(a.right,o)):je(n,o);let s={left:n,right:o};return e.decisionMap[ui(t,X1(r),r.idx)]=n,s}function X1(e){if(e instanceof Ie)return"Alternation";if(e instanceof we)return"Option";if(e instanceof me)return"Repetition";if(e instanceof ke)return"RepetitionWithSeparator";if(e instanceof Ne)return"RepetitionMandatory";if(e instanceof Le)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function U1(e,t){let n=t.length;for(let o=0;o<n-1;o++){let s=t[o],a;s.left.transitions.length===1&&(a=s.left.transitions[0]);let l=a instanceof ci,c=a,u=t[o+1].left;s.left.type===xr&&s.right.type===xr&&a!==void 0&&(l&&c.followState===s.right||a.target===s.right)?(l?c.followState=u:a.target=u,z1(e,s.right)):je(s.right,u)}let r=t[0],i=t[n-1];return{left:r.left,right:i.right}}function Jh(e,t,n,r){let i=Qe(e,t,r,{type:xr}),o=Qe(e,t,r,{type:xr});return Qh(i,new li(o,n)),{left:i,right:o}}function G1(e,t,n){let r=n.referencedRule,i=e.ruleToStartState.get(r),o=Qe(e,t,n,{type:xr}),s=Qe(e,t,n,{type:xr}),a=new ci(i,r,s);return Qh(o,a),{left:o,right:s}}function H1(e,t,n){let r=e.ruleToStartState.get(t);je(r,n.left);let i=e.ruleToStopState.get(t);return je(n.right,i),{left:r,right:i}}function je(e,t){let n=new ka(t);Qh(e,n)}function Qe(e,t,n,r){let i=Object.assign({atn:e,production:n,epsilonOnlyTransitions:!1,rule:t,transitions:[],nextTokenWithinRule:[],stateNumber:e.states.length},r);return e.states.push(i),i}function Qh(e,t){e.transitions.length===0&&(e.epsilonOnlyTransitions=t.isEpsilon()),e.transitions.push(t)}function z1(e,t){e.states.splice(e.states.indexOf(t),1)}var Ia={},No=class{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(t){let n=em(t);n in this.map||(this.map[n]=this.configs.length,this.configs.push(t))}get elements(){return this.configs}get alts(){return bt(this.configs,t=>t.alt)}get key(){let t="";for(let n in this.map)t+=n+":";return t}};function em(e,t=!0){return`${t?`a${e.alt}`:""}s${e.state.stateNumber}:${e.stack.map(n=>n.stateNumber.toString()).join("_")}`}function j1(e,t,n){for(var r=-1,i=e.length;++r<i;){var o=e[r],s=t(o);if(s!=null&&(a===void 0?s===s&&!hr(s):n(s,a)))var a=s,l=o}return l}var Jv=j1;function Y1(e,t){return e<t}var Qv=Y1;function V1(e){return e&&e.length?Jv(e,So,Qv):void 0}var e_=V1;var t_=pt?pt.isConcatSpreadable:void 0;function K1(e){return Te(e)||fr(e)||!!(t_&&e&&e[t_])}var n_=K1;function r_(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=n_),i||(i=[]);++o<s;){var a=e[o];t>0&&n(a)?t>1?r_(a,t-1,n,r,i):cu(i,a):r||(i[i.length]=a)}return i}var _u=r_;function q1(e,t){return _u(bt(e,t),1)}var i_=q1;function Z1(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}var o_=Z1;function J1(e){return e!==e}var s_=J1;function Q1(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}var a_=Q1;function eD(e,t,n){return t===t?a_(e,t,n):o_(e,s_,n)}var l_=eD;function tD(e,t){var n=e==null?0:e.length;return!!n&&l_(e,t,0)>-1}var c_=tD;function nD(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}var u_=nD;function rD(){}var f_=rD;var iD=1/0,oD=pr&&1/_o(new pr([,-0]))[1]==iD?function(e){return new pr(e)}:f_,d_=oD;var sD=200;function aD(e,t,n){var r=-1,i=c_,o=e.length,s=!0,a=[],l=a;if(n)s=!1,i=u_;else if(o>=sD){var c=t?null:d_(e);if(c)return _o(c);s=!1,i=au,l=new su}else l=t?[]:a;e:for(;++r<o;){var u=e[r],f=t?t(u):u;if(u=n||u!==0?u:0,s&&f===f){for(var d=l.length;d--;)if(l[d]===f)continue e;t&&l.push(f),a.push(u)}else i(l,f,n)||(l!==a&&l.push(f),a.push(u))}return a}var p_=aD;function lD(e,t){return e&&e.length?p_(e,gr(t,2)):[]}var h_=lD;function cD(e){var t=e==null?0:e.length;return t?_u(e,1):[]}var m_=cD;function uD(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var g_=uD;function fD(e){return typeof e=="function"?e:So}var y_=fD;function dD(e,t){var n=Te(e)?g_:yr;return n(e,y_(t))}var Au=dD;var pD="[object Map]",hD="[object Set]",mD=Object.prototype,gD=mD.hasOwnProperty;function yD(e){if(e==null)return!0;if(dr(e)&&(Te(e)||typeof e=="string"||typeof e.splice=="function"||si(e)||ko(e)||fr(e)))return!e.length;var t=_a(e);if(t==pD||t==hD)return!e.size;if(du(e))return!pu(e).length;for(var n in e)if(gD.call(e,n))return!1;return!0}var x_=yD;function xD(e,t,n,r){var i=-1,o=e==null?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}var E_=xD;function ED(e,t,n,r,i){return i(e,function(o,s,a){n=r?(r=!1,o):t(n,o,s,a)}),n}var w_=ED;function wD(e,t,n){var r=Te(e)?E_:w_,i=arguments.length<3;return r(e,gr(t,4),n,i,yr)}var tm=wD;function TD(e,t){let n={};return r=>{let i=r.toString(),o=n[i];return o!==void 0||(o={atnStartState:e,decision:t,states:{}},n[i]=o),o}}var ku=class{constructor(){this.predicates=[]}is(t){return t>=this.predicates.length||this.predicates[t]}set(t,n){this.predicates[t]=n}toString(){let t="",n=this.predicates.length;for(let r=0;r<n;r++)t+=this.predicates[r]===!0?"1":"0";return t}},T_=new ku,Ra=class extends In{constructor(t){var n,r;super(),this.logging=(n=t?.logging)!==null&&n!==void 0?n:(i=>console.log(i)),this.incomplete=(r=t?.incomplete)!==null&&r!==void 0?r:!1}initialize(t){this.atn=Vv(t.rules),this.dfas=AD(this.atn),this.callers=vD(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(t){let{prodOccurrence:n,rule:r,hasPredicates:i,dynamicTokensEnabled:o}=t,s=this.dfas,a=this.logging,l=this.incomplete,c=ui(r,"Alternation",n),f=this.atn.decisionMap[c].decision,d=bt($c({maxLookahead:1,occurrence:n,prodType:"Alternation",rule:r}),p=>bt(p,m=>m[0]));if(v_(d,!1)&&!o){let p=tm(d,(m,g,w)=>(Au(g,x=>{x&&(m[x.tokenTypeIdx]=w,Au(x.categoryMatches,y=>{m[y]=w}))}),m),{});return i?function(m){var g;let w=this.LA_FAST(1),x=p[w.tokenTypeIdx];if(m!==void 0&&x!==void 0){let y=(g=m[x])===null||g===void 0?void 0:g.GATE;if(y!==void 0&&y.call(this)===!1)return}return x}:function(){let m=this.LA_FAST(1);return p[m.tokenTypeIdx]}}else return i?function(p){let m=new ku,g=p===void 0?0:p.length;for(let x=0;x<g;x++){let y=p?.[x].GATE;m.set(x,y===void 0||y.call(this))}let w=nm.call(this,s,f,m,a,l);return typeof w=="number"?w:void 0}:function(){let p=nm.call(this,s,f,T_,a,l);return typeof p=="number"?p:void 0}}buildLookaheadForOptional(t){let{prodOccurrence:n,rule:r,prodType:i,dynamicTokensEnabled:o}=t,s=this.dfas,a=this.logging,l=this.incomplete,c=this.callers,u=ui(r,i,n),f=this.atn.decisionMap[u],d=f.decision,p=bt($c({maxLookahead:1,occurrence:n,prodType:i,rule:r}),m=>bt(m,g=>g[0]));if(v_(p)&&p[0][0]&&!o&&!_D(f,i,c)){let m=p[0],g=m_(m);if(g.length===1&&x_(g[0].categoryMatches)){let x=g[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===x}}else{let w=tm(g,(x,y)=>(y!==void 0&&(x[y.tokenTypeIdx]=!0,Au(y.categoryMatches,T=>{x[T]=!0})),x),{});return function(){let x=this.LA_FAST(1);return w[x.tokenTypeIdx]===!0}}}return function(){let m=nm.call(this,s,d,T_,a,l);return typeof m=="object"?!1:m===0}}};function v_(e,t=!0){let n=new Set;for(let r of e){let i=new Set;for(let o of r){if(o===void 0){if(t)break;return!1}let s=[o.tokenTypeIdx].concat(o.categoryMatches);for(let a of s)if(n.has(a)){if(!i.has(a))return!1}else n.add(a),i.add(a)}}return!0}function vD(e){let t=new Map;for(let n of e.states)for(let r of n.transitions)if(r instanceof ci){let i=t.get(r.rule);i===void 0&&(i=[],t.set(r.rule,i)),i.push(r.followState)}return t}function __(e,t){let n=new Set,r=new Set,i=[e];for(;i.length>0;){let o=i.shift();if(!r.has(o)){if(r.add(o),o.type===Er){if(t!==void 0){let s=t.get(o.rule);s!==void 0&&i.push(...s)}continue}for(let s of o.transitions)if(s instanceof li){n.add(s.tokenType.tokenTypeIdx);for(let a of s.tokenType.categoryMatches)n.add(a)}else i.push(s.target)}}return n}function _D(e,t,n){let r=t==="RepetitionMandatoryWithSeparator",i=e.transitions[r?1:0],o=e.transitions[r?0:1];if(i===void 0||o===void 0)return!1;let s=__(i.target),a=__(o.target,n);for(let l of s)if(a.has(l))return!0;return!1}function AD(e){let t=e.decisionStates.length,n=Array(t);for(let r=0;r<t;r++)n[r]=TD(e.decisionStates[r],r);return n}function nm(e,t,n,r,i){let o=e[t](n),s=o.start;if(s===void 0){let l=$D(o.atnStartState);s=I_(o,k_(l)),o.start=s}return kD.apply(this,[o,s,n,r,i])}function kD(e,t,n,r,i){let o=t,s=1,a=[],l=this.LA_FAST(s++);for(;;){let c=LD(o,l);if(c===void 0&&(c=ID.apply(this,[e,o,l,s,n,r])),c===Ia)return ND(a,o,l);if(c.isAcceptState===!0){if(i===!0&&uo(l,ft)){let u=GD(o,n);if(u!==void 0)return u}return c.prediction}o=c,a.push(l),l=this.LA(s++)}}function ID(e,t,n,r,i,o){let s=PD(t.configs,n,i);if(s.size===0)return A_(e,t,n,Ia),Ia;let a=k_(s),l=OD(s,i);if(l!==void 0)a.isAcceptState=!0,a.prediction=l,a.configs.uniqueAlt=l;else if(BD(s)){let c=e_(s.alts);a.isAcceptState=!0,a.prediction=c,a.configs.uniqueAlt=c,RD.apply(this,[e,r,s.alts,o])}return a=A_(e,t,n,a),a}function RD(e,t,n,r){let i=[];for(let c=1;c<=t;c++)i.push(this.LA(c).tokenType);let o=e.atnStartState,s=o.rule,a=o.production,l=SD({topLevelRule:s,ambiguityIndices:n,production:a,prefixPath:i});r(l)}function SD(e){let t=bt(e.prefixPath,i=>_n(i)).join(", "),n=e.production.idx===0?"":e.production.idx,r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(", ")}> in <${bD(e.production)}${n}> inside <${e.topLevelRule.name}> Rule,
|
|
114
|
+
For further details.`);this.skipValidations=Object.hasOwn(n,"skipValidations")?n.skipValidations:dt.skipValidations}};Ea.DEFER_DEFINITION_ERRORS_HANDLING=!1;lT(Ea,[Mc,Bc,Gc,Hc,jc,zc,Yc,Vc,Zc]);var wa=class extends Ea{constructor(t,n=dt){let r=Object.assign({},n);r.outputCst=!1,super(t,r)}};function TP(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var Qc=TP;function _P(){this.__data__=[],this.size=0}var cT=_P;function vP(e,t){return e===t||e!==e&&t!==t}var eu=vP;function AP(e,t){for(var n=e.length;n--;)if(eu(e[n][0],t))return n;return-1}var lr=AP;var kP=Array.prototype,IP=kP.splice;function RP(e){var t=this.__data__,n=lr(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():IP.call(t,n,1),--this.size,!0}var uT=RP;function SP(e){var t=this.__data__,n=lr(t,e);return n<0?void 0:t[n][1]}var fT=SP;function bP(e){return lr(this.__data__,e)>-1}var dT=bP;function NP(e,t){var n=this.__data__,r=lr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var pT=NP;function yo(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}yo.prototype.clear=cT;yo.prototype.delete=uT;yo.prototype.get=fT;yo.prototype.has=dT;yo.prototype.set=pT;var cr=yo;function LP(){this.__data__=new cr,this.size=0}var hT=LP;function PP(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var mT=PP;function CP(e){return this.__data__.get(e)}var gT=CP;function OP(e){return this.__data__.has(e)}var yT=OP;var $P=typeof global=="object"&&global&&global.Object===Object&&global,tu=$P;var DP=typeof self=="object"&&self&&self.Object===Object&&self,MP=tu||DP||Function("return this")(),Je=MP;var FP=Je.Symbol,pt=FP;var xT=Object.prototype,BP=xT.hasOwnProperty,WP=xT.toString,Ta=pt?pt.toStringTag:void 0;function XP(e){var t=BP.call(e,Ta),n=e[Ta];try{e[Ta]=void 0;var r=!0}catch{}var i=WP.call(e);return r&&(t?e[Ta]=n:delete e[Ta]),i}var ET=XP;var UP=Object.prototype,GP=UP.toString;function HP(e){return GP.call(e)}var wT=HP;var zP="[object Null]",jP="[object Undefined]",TT=pt?pt.toStringTag:void 0;function YP(e){return e==null?e===void 0?jP:zP:TT&&TT in Object(e)?ET(e):wT(e)}var jt=YP;function VP(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var xo=VP;var KP="[object AsyncFunction]",qP="[object Function]",ZP="[object GeneratorFunction]",JP="[object Proxy]";function QP(e){if(!xo(e))return!1;var t=jt(e);return t==qP||t==ZP||t==KP||t==JP}var nu=QP;var eC=Je["__core-js_shared__"],ru=eC;var _T=(function(){var e=/[^.]+$/.exec(ru&&ru.keys&&ru.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function tC(e){return!!_T&&_T in e}var vT=tC;var nC=Function.prototype,rC=nC.toString;function iC(e){if(e!=null){try{return rC.call(e)}catch{}try{return e+""}catch{}}return""}var Ln=iC;var oC=/[\\^$.*+?()[\]{}|]/g,sC=/^\[object .+?Constructor\]$/,aC=Function.prototype,lC=Object.prototype,cC=aC.toString,uC=lC.hasOwnProperty,fC=RegExp("^"+cC.call(uC).replace(oC,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function dC(e){if(!xo(e)||vT(e))return!1;var t=nu(e)?fC:sC;return t.test(Ln(e))}var AT=dC;function pC(e,t){return e?.[t]}var kT=pC;function hC(e,t){var n=kT(e,t);return AT(n)?n:void 0}var $t=hC;var mC=$t(Je,"Map"),ur=mC;var gC=$t(Object,"create"),Pn=gC;function yC(){this.__data__=Pn?Pn(null):{},this.size=0}var IT=yC;function xC(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var RT=xC;var EC="__lodash_hash_undefined__",wC=Object.prototype,TC=wC.hasOwnProperty;function _C(e){var t=this.__data__;if(Pn){var n=t[e];return n===EC?void 0:n}return TC.call(t,e)?t[e]:void 0}var ST=_C;var vC=Object.prototype,AC=vC.hasOwnProperty;function kC(e){var t=this.__data__;return Pn?t[e]!==void 0:AC.call(t,e)}var bT=kC;var IC="__lodash_hash_undefined__";function RC(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Pn&&t===void 0?IC:t,this}var NT=RC;function Eo(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Eo.prototype.clear=IT;Eo.prototype.delete=RT;Eo.prototype.get=ST;Eo.prototype.has=bT;Eo.prototype.set=NT;var Gh=Eo;function SC(){this.size=0,this.__data__={hash:new Gh,map:new(ur||cr),string:new Gh}}var LT=SC;function bC(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var PT=bC;function NC(e,t){var n=e.__data__;return PT(t)?n[typeof t=="string"?"string":"hash"]:n.map}var fr=NC;function LC(e){var t=fr(this,e).delete(e);return this.size-=t?1:0,t}var CT=LC;function PC(e){return fr(this,e).get(e)}var OT=PC;function CC(e){return fr(this,e).has(e)}var $T=CC;function OC(e,t){var n=fr(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var DT=OC;function wo(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}wo.prototype.clear=LT;wo.prototype.delete=CT;wo.prototype.get=OT;wo.prototype.has=$T;wo.prototype.set=DT;var oi=wo;var $C=200;function DC(e,t){var n=this.__data__;if(n instanceof cr){var r=n.__data__;if(!ur||r.length<$C-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new oi(r)}return n.set(e,t),this.size=n.size,this}var MT=DC;function To(e){var t=this.__data__=new cr(e);this.size=t.size}To.prototype.clear=hT;To.prototype.delete=mT;To.prototype.get=gT;To.prototype.has=yT;To.prototype.set=MT;var _o=To;var MC="__lodash_hash_undefined__";function FC(e){return this.__data__.set(e,MC),this}var FT=FC;function BC(e){return this.__data__.has(e)}var BT=BC;function iu(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new oi;++t<n;)this.add(e[t])}iu.prototype.add=iu.prototype.push=FT;iu.prototype.has=BT;var ou=iu;function WC(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var WT=WC;function XC(e,t){return e.has(t)}var su=XC;var UC=1,GC=2;function HC(e,t,n,r,i,o){var s=n&UC,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var c=o.get(e),u=o.get(t);if(c&&u)return c==t&&u==e;var f=-1,d=!0,p=n&GC?new ou:void 0;for(o.set(e,t),o.set(t,e);++f<a;){var m=e[f],g=t[f];if(r)var w=s?r(g,m,f,t,e,o):r(m,g,f,e,t,o);if(w!==void 0){if(w)continue;d=!1;break}if(p){if(!WT(t,function(x,y){if(!su(p,y)&&(m===x||i(m,x,n,r,o)))return p.push(y)})){d=!1;break}}else if(!(m===g||i(m,g,n,r,o))){d=!1;break}}return o.delete(e),o.delete(t),d}var au=HC;var zC=Je.Uint8Array,Hh=zC;function jC(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}var XT=jC;function YC(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var vo=YC;var VC=1,KC=2,qC="[object Boolean]",ZC="[object Date]",JC="[object Error]",QC="[object Map]",eO="[object Number]",tO="[object RegExp]",nO="[object Set]",rO="[object String]",iO="[object Symbol]",oO="[object ArrayBuffer]",sO="[object DataView]",UT=pt?pt.prototype:void 0,zh=UT?UT.valueOf:void 0;function aO(e,t,n,r,i,o,s){switch(n){case sO:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case oO:return!(e.byteLength!=t.byteLength||!o(new Hh(e),new Hh(t)));case qC:case ZC:case eO:return eu(+e,+t);case JC:return e.name==t.name&&e.message==t.message;case tO:case rO:return e==t+"";case QC:var a=XT;case nO:var l=r&VC;if(a||(a=vo),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;r|=KC,s.set(e,t);var u=au(a(e),a(t),r,i,o,s);return s.delete(e),u;case iO:if(zh)return zh.call(e)==zh.call(t)}return!1}var GT=aO;function lO(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var lu=lO;var cO=Array.isArray,Te=cO;function uO(e,t,n){var r=t(e);return Te(e)?r:lu(r,n(e))}var HT=uO;function fO(e,t){for(var n=-1,r=e==null?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}var cu=fO;function dO(){return[]}var zT=dO;var pO=Object.prototype,hO=pO.propertyIsEnumerable,jT=Object.getOwnPropertySymbols,mO=jT?function(e){return e==null?[]:(e=Object(e),cu(jT(e),function(t){return hO.call(e,t)}))}:zT,YT=mO;function gO(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var VT=gO;function yO(e){return e!=null&&typeof e=="object"}var Yt=yO;var xO="[object Arguments]";function EO(e){return Yt(e)&&jt(e)==xO}var jh=EO;var KT=Object.prototype,wO=KT.hasOwnProperty,TO=KT.propertyIsEnumerable,_O=jh((function(){return arguments})())?jh:function(e){return Yt(e)&&wO.call(e,"callee")&&!TO.call(e,"callee")},dr=_O;function vO(){return!1}var qT=vO;var QT=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ZT=QT&&typeof module=="object"&&module&&!module.nodeType&&module,AO=ZT&&ZT.exports===QT,JT=AO?Je.Buffer:void 0,kO=JT?JT.isBuffer:void 0,IO=kO||qT,si=IO;var RO=9007199254740991,SO=/^(?:0|[1-9]\d*)$/;function bO(e,t){var n=typeof e;return t=t??RO,!!t&&(n=="number"||n!="symbol"&&SO.test(e))&&e>-1&&e%1==0&&e<t}var uu=bO;var NO=9007199254740991;function LO(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=NO}var Ao=LO;var PO="[object Arguments]",CO="[object Array]",OO="[object Boolean]",$O="[object Date]",DO="[object Error]",MO="[object Function]",FO="[object Map]",BO="[object Number]",WO="[object Object]",XO="[object RegExp]",UO="[object Set]",GO="[object String]",HO="[object WeakMap]",zO="[object ArrayBuffer]",jO="[object DataView]",YO="[object Float32Array]",VO="[object Float64Array]",KO="[object Int8Array]",qO="[object Int16Array]",ZO="[object Int32Array]",JO="[object Uint8Array]",QO="[object Uint8ClampedArray]",e$="[object Uint16Array]",t$="[object Uint32Array]",Pe={};Pe[YO]=Pe[VO]=Pe[KO]=Pe[qO]=Pe[ZO]=Pe[JO]=Pe[QO]=Pe[e$]=Pe[t$]=!0;Pe[PO]=Pe[CO]=Pe[zO]=Pe[OO]=Pe[jO]=Pe[$O]=Pe[DO]=Pe[MO]=Pe[FO]=Pe[BO]=Pe[WO]=Pe[XO]=Pe[UO]=Pe[GO]=Pe[HO]=!1;function n$(e){return Yt(e)&&Ao(e.length)&&!!Pe[jt(e)]}var e_=n$;function r$(e){return function(t){return e(t)}}var t_=r$;var n_=typeof exports=="object"&&exports&&!exports.nodeType&&exports,_a=n_&&typeof module=="object"&&module&&!module.nodeType&&module,i$=_a&&_a.exports===n_,Yh=i$&&tu.process,o$=(function(){try{var e=_a&&_a.require&&_a.require("util").types;return e||Yh&&Yh.binding&&Yh.binding("util")}catch{}})(),Vh=o$;var r_=Vh&&Vh.isTypedArray,s$=r_?t_(r_):e_,ko=s$;var a$=Object.prototype,l$=a$.hasOwnProperty;function c$(e,t){var n=Te(e),r=!n&&dr(e),i=!n&&!r&&si(e),o=!n&&!r&&!i&&ko(e),s=n||r||i||o,a=s?VT(e.length,String):[],l=a.length;for(var c in e)(t||l$.call(e,c))&&!(s&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||uu(c,l)))&&a.push(c);return a}var i_=c$;var u$=Object.prototype;function f$(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||u$;return e===n}var fu=f$;function d$(e,t){return function(n){return e(t(n))}}var o_=d$;var p$=o_(Object.keys,Object),s_=p$;var h$=Object.prototype,m$=h$.hasOwnProperty;function g$(e){if(!fu(e))return s_(e);var t=[];for(var n in Object(e))m$.call(e,n)&&n!="constructor"&&t.push(n);return t}var du=g$;function y$(e){return e!=null&&Ao(e.length)&&!nu(e)}var pr=y$;function x$(e){return pr(e)?i_(e):du(e)}var Io=x$;function E$(e){return HT(e,Io,YT)}var Kh=E$;var w$=1,T$=Object.prototype,_$=T$.hasOwnProperty;function v$(e,t,n,r,i,o){var s=n&w$,a=Kh(e),l=a.length,c=Kh(t),u=c.length;if(l!=u&&!s)return!1;for(var f=l;f--;){var d=a[f];if(!(s?d in t:_$.call(t,d)))return!1}var p=o.get(e),m=o.get(t);if(p&&m)return p==t&&m==e;var g=!0;o.set(e,t),o.set(t,e);for(var w=s;++f<l;){d=a[f];var x=e[d],y=t[d];if(r)var T=s?r(y,x,d,t,e,o):r(x,y,d,e,t,o);if(!(T===void 0?x===y||i(x,y,n,r,o):T)){g=!1;break}w||(w=d=="constructor")}if(g&&!w){var E=e.constructor,_=t.constructor;E!=_&&"constructor"in e&&"constructor"in t&&!(typeof E=="function"&&E instanceof E&&typeof _=="function"&&_ instanceof _)&&(g=!1)}return o.delete(e),o.delete(t),g}var a_=v$;var A$=$t(Je,"DataView"),pu=A$;var k$=$t(Je,"Promise"),hu=k$;var I$=$t(Je,"Set"),hr=I$;var R$=$t(Je,"WeakMap"),mu=R$;var l_="[object Map]",S$="[object Object]",c_="[object Promise]",u_="[object Set]",f_="[object WeakMap]",d_="[object DataView]",b$=Ln(pu),N$=Ln(ur),L$=Ln(hu),P$=Ln(hr),C$=Ln(mu),ai=jt;(pu&&ai(new pu(new ArrayBuffer(1)))!=d_||ur&&ai(new ur)!=l_||hu&&ai(hu.resolve())!=c_||hr&&ai(new hr)!=u_||mu&&ai(new mu)!=f_)&&(ai=function(e){var t=jt(e),n=t==S$?e.constructor:void 0,r=n?Ln(n):"";if(r)switch(r){case b$:return d_;case N$:return l_;case L$:return c_;case P$:return u_;case C$:return f_}return t});var va=ai;var O$=1,p_="[object Arguments]",h_="[object Array]",gu="[object Object]",$$=Object.prototype,m_=$$.hasOwnProperty;function D$(e,t,n,r,i,o){var s=Te(e),a=Te(t),l=s?h_:va(e),c=a?h_:va(t);l=l==p_?gu:l,c=c==p_?gu:c;var u=l==gu,f=c==gu,d=l==c;if(d&&si(e)){if(!si(t))return!1;s=!0,u=!1}if(d&&!u)return o||(o=new _o),s||ko(e)?au(e,t,n,r,i,o):GT(e,t,l,n,r,i,o);if(!(n&O$)){var p=u&&m_.call(e,"__wrapped__"),m=f&&m_.call(t,"__wrapped__");if(p||m){var g=p?e.value():e,w=m?t.value():t;return o||(o=new _o),i(g,w,n,r,o)}}return d?(o||(o=new _o),a_(e,t,n,r,i,o)):!1}var g_=D$;function y_(e,t,n,r,i){return e===t?!0:e==null||t==null||!Yt(e)&&!Yt(t)?e!==e&&t!==t:g_(e,t,n,r,y_,i)}var yu=y_;var M$=1,F$=2;function B$(e,t,n,r){var i=n.length,o=i,s=!r;if(e==null)return!o;for(e=Object(e);i--;){var a=n[i];if(s&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<o;){a=n[i];var l=a[0],c=e[l],u=a[1];if(s&&a[2]){if(c===void 0&&!(l in e))return!1}else{var f=new _o;if(r)var d=r(c,u,l,e,t,f);if(!(d===void 0?yu(u,c,M$|F$,r,f):d))return!1}}return!0}var x_=B$;function W$(e){return e===e&&!xo(e)}var xu=W$;function X$(e){for(var t=Io(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,xu(i)]}return t}var E_=X$;function U$(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var Eu=U$;function G$(e){var t=E_(e);return t.length==1&&t[0][2]?Eu(t[0][0],t[0][1]):function(n){return n===e||x_(n,e,t)}}var w_=G$;var H$="[object Symbol]";function z$(e){return typeof e=="symbol"||Yt(e)&&jt(e)==H$}var mr=z$;var j$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Y$=/^\w*$/;function V$(e,t){if(Te(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||mr(e)?!0:Y$.test(e)||!j$.test(e)||t!=null&&e in Object(t)}var Ro=V$;var K$="Expected a function";function qh(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(K$);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(qh.Cache||oi),n}qh.Cache=oi;var T_=qh;var q$=500;function Z$(e){var t=T_(e,function(r){return n.size===q$&&n.clear(),r}),n=t.cache;return t}var __=Z$;var J$=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Q$=/\\(\\)?/g,e1=__(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(J$,function(n,r,i,o){t.push(i?o.replace(Q$,"$1"):r||n)}),t}),v_=e1;var t1=1/0,A_=pt?pt.prototype:void 0,k_=A_?A_.toString:void 0;function I_(e){if(typeof e=="string")return e;if(Te(e))return Qc(e,I_)+"";if(mr(e))return k_?k_.call(e):"";var t=e+"";return t=="0"&&1/e==-t1?"-0":t}var R_=I_;function n1(e){return e==null?"":R_(e)}var S_=n1;function r1(e,t){return Te(e)?e:Ro(e,t)?[e]:v_(S_(e))}var wu=r1;var i1=1/0;function o1(e){if(typeof e=="string"||mr(e))return e;var t=e+"";return t=="0"&&1/e==-i1?"-0":t}var gr=o1;function s1(e,t){t=wu(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[gr(t[n++])];return n&&n==r?e:void 0}var Tu=s1;function a1(e,t,n){var r=e==null?void 0:Tu(e,t);return r===void 0?n:r}var b_=a1;function l1(e,t){return e!=null&&t in Object(e)}var N_=l1;function c1(e,t,n){t=wu(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var s=gr(t[r]);if(!(o=e!=null&&n(e,s)))break;e=e[s]}return o||++r!=i?o:(i=e==null?0:e.length,!!i&&Ao(i)&&uu(s,i)&&(Te(e)||dr(e)))}var L_=c1;function u1(e,t){return e!=null&&L_(e,t,N_)}var P_=u1;var f1=1,d1=2;function p1(e,t){return Ro(e)&&xu(t)?Eu(gr(e),t):function(n){var r=b_(n,e);return r===void 0&&r===t?P_(n,e):yu(t,r,f1|d1)}}var C_=p1;function h1(e){return e}var So=h1;function m1(e){return function(t){return t?.[e]}}var O_=m1;function g1(e){return function(t){return Tu(t,e)}}var $_=g1;function y1(e){return Ro(e)?O_(gr(e)):$_(e)}var D_=y1;function x1(e){return typeof e=="function"?e:e==null?So:typeof e=="object"?Te(e)?C_(e[0],e[1]):w_(e):D_(e)}var yr=x1;function E1(e){return function(t,n,r){for(var i=-1,o=Object(t),s=r(t),a=s.length;a--;){var l=s[e?a:++i];if(n(o[l],l,o)===!1)break}return t}}var M_=E1;var w1=M_(),F_=w1;function T1(e,t){return e&&F_(e,t,Io)}var B_=T1;function _1(e,t){return function(n,r){if(n==null)return n;if(!pr(n))return e(n,r);for(var i=n.length,o=t?i:-1,s=Object(n);(t?o--:++o<i)&&r(s[o],o,s)!==!1;);return n}}var W_=_1;var v1=W_(B_),xr=v1;function A1(e,t){var n=-1,r=pr(e)?Array(e.length):[];return xr(e,function(i,o,s){r[++n]=t(i,o,s)}),r}var X_=A1;function k1(e,t){var n=Te(e)?Qc:X_;return n(e,yr(t,3))}var bt=k1;function I1(e,t){var n=[];return xr(e,function(r,i,o){t(r,i,o)&&n.push(r)}),n}var U_=I1;function R1(e,t){var n=Te(e)?cu:U_;return n(e,yr(t,3))}var G_=R1;function ui(e,t,n){return`${e.name}_${t}_${n}`}var Er=1,S1=2,H_=4,z_=5;var wr=7,b1=8,N1=9,L1=10,P1=11,j_=12,Aa=class{constructor(t){this.target=t}isEpsilon(){return!1}},li=class extends Aa{constructor(t,n){super(t),this.tokenType=n}},ka=class extends Aa{constructor(t){super(t)}isEpsilon(){return!0}},ci=class extends Aa{constructor(t,n,r){super(t),this.rule=n,this.followState=r}isEpsilon(){return!0}};function Y_(e){let t={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};C1(t,e);let n=e.length;for(let r=0;r<n;r++){let i=e[r],o=fi(t,i,i);o!==void 0&&H1(t,i,o)}return t}function C1(e,t){let n=t.length;for(let r=0;r<n;r++){let i=t[r],o=Qe(e,i,void 0,{type:S1}),s=Qe(e,i,void 0,{type:wr});o.stop=s,e.ruleToStartState.set(i,o),e.ruleToStopState.set(i,s)}}function V_(e,t,n){return n instanceof le?Zh(e,t,n.terminalType,n):n instanceof Ee?G1(e,t,n):n instanceof Ie?F1(e,t,n):n instanceof we?B1(e,t,n):n instanceof me?O1(e,t,n):n instanceof ke?$1(e,t,n):n instanceof Ne?D1(e,t,n):n instanceof Le?M1(e,t,n):fi(e,t,n)}function O1(e,t,n){let r=Qe(e,t,n,{type:z_});Tr(e,r);let i=bo(e,t,r,n,fi(e,t,n));return q_(e,t,n,i)}function $1(e,t,n){let r=Qe(e,t,n,{type:z_});Tr(e,r);let i=bo(e,t,r,n,fi(e,t,n)),o=Zh(e,t,n.separator,n);return q_(e,t,n,i,o)}function D1(e,t,n){let r=Qe(e,t,n,{type:H_});Tr(e,r);let i=bo(e,t,r,n,fi(e,t,n));return K_(e,t,n,i)}function M1(e,t,n){let r=Qe(e,t,n,{type:H_});Tr(e,r);let i=bo(e,t,r,n,fi(e,t,n)),o=Zh(e,t,n.separator,n);return K_(e,t,n,i,o)}function F1(e,t,n){let r=Qe(e,t,n,{type:Er});Tr(e,r);let i=bt(n.definition,s=>V_(e,t,s));return bo(e,t,r,n,...i)}function B1(e,t,n){let r=Qe(e,t,n,{type:Er});Tr(e,r);let i=bo(e,t,r,n,fi(e,t,n));return W1(e,t,n,i)}function fi(e,t,n){let r=G_(bt(n.definition,i=>V_(e,t,i)),i=>i!==void 0);return r.length===1?r[0]:r.length===0?void 0:U1(e,r)}function K_(e,t,n,r,i){let o=r.left,s=r.right,a=Qe(e,t,n,{type:P1});Tr(e,a);let l=Qe(e,t,n,{type:j_});return o.loopback=a,l.loopback=a,e.decisionMap[ui(t,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",n.idx)]=a,je(s,a),i===void 0?(je(a,o),je(a,l)):(je(a,l),je(a,i.left),je(i.right,o)),{left:o,right:l}}function q_(e,t,n,r,i){let o=r.left,s=r.right,a=Qe(e,t,n,{type:L1});Tr(e,a);let l=Qe(e,t,n,{type:j_}),c=Qe(e,t,n,{type:N1});return a.loopback=c,l.loopback=c,je(a,o),je(a,l),je(s,c),i!==void 0?(je(c,l),je(c,i.left),je(i.right,o)):je(c,a),e.decisionMap[ui(t,i?"RepetitionWithSeparator":"Repetition",n.idx)]=a,{left:a,right:l}}function W1(e,t,n,r){let i=r.left,o=r.right;return je(i,o),e.decisionMap[ui(t,"Option",n.idx)]=i,r}function Tr(e,t){return e.decisionStates.push(t),t.decision=e.decisionStates.length-1,t.decision}function bo(e,t,n,r,...i){let o=Qe(e,t,r,{type:b1,start:n});n.end=o;for(let a of i)a!==void 0?(je(n,a.left),je(a.right,o)):je(n,o);let s={left:n,right:o};return e.decisionMap[ui(t,X1(r),r.idx)]=n,s}function X1(e){if(e instanceof Ie)return"Alternation";if(e instanceof we)return"Option";if(e instanceof me)return"Repetition";if(e instanceof ke)return"RepetitionWithSeparator";if(e instanceof Ne)return"RepetitionMandatory";if(e instanceof Le)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function U1(e,t){let n=t.length;for(let o=0;o<n-1;o++){let s=t[o],a;s.left.transitions.length===1&&(a=s.left.transitions[0]);let l=a instanceof ci,c=a,u=t[o+1].left;s.left.type===Er&&s.right.type===Er&&a!==void 0&&(l&&c.followState===s.right||a.target===s.right)?(l?c.followState=u:a.target=u,z1(e,s.right)):je(s.right,u)}let r=t[0],i=t[n-1];return{left:r.left,right:i.right}}function Zh(e,t,n,r){let i=Qe(e,t,r,{type:Er}),o=Qe(e,t,r,{type:Er});return Jh(i,new li(o,n)),{left:i,right:o}}function G1(e,t,n){let r=n.referencedRule,i=e.ruleToStartState.get(r),o=Qe(e,t,n,{type:Er}),s=Qe(e,t,n,{type:Er}),a=new ci(i,r,s);return Jh(o,a),{left:o,right:s}}function H1(e,t,n){let r=e.ruleToStartState.get(t);je(r,n.left);let i=e.ruleToStopState.get(t);return je(n.right,i),{left:r,right:i}}function je(e,t){let n=new ka(t);Jh(e,n)}function Qe(e,t,n,r){let i=Object.assign({atn:e,production:n,epsilonOnlyTransitions:!1,rule:t,transitions:[],nextTokenWithinRule:[],stateNumber:e.states.length},r);return e.states.push(i),i}function Jh(e,t){e.transitions.length===0&&(e.epsilonOnlyTransitions=t.isEpsilon()),e.transitions.push(t)}function z1(e,t){e.states.splice(e.states.indexOf(t),1)}var Ia={},No=class{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(t){let n=Qh(t);n in this.map||(this.map[n]=this.configs.length,this.configs.push(t))}get elements(){return this.configs}get alts(){return bt(this.configs,t=>t.alt)}get key(){let t="";for(let n in this.map)t+=n+":";return t}};function Qh(e,t=!0){return`${t?`a${e.alt}`:""}s${e.state.stateNumber}:${e.stack.map(n=>n.stateNumber.toString()).join("_")}`}function j1(e,t,n){for(var r=-1,i=e.length;++r<i;){var o=e[r],s=t(o);if(s!=null&&(a===void 0?s===s&&!mr(s):n(s,a)))var a=s,l=o}return l}var Z_=j1;function Y1(e,t){return e<t}var J_=Y1;function V1(e){return e&&e.length?Z_(e,So,J_):void 0}var Q_=V1;var ev=pt?pt.isConcatSpreadable:void 0;function K1(e){return Te(e)||dr(e)||!!(ev&&e&&e[ev])}var tv=K1;function nv(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=tv),i||(i=[]);++o<s;){var a=e[o];t>0&&n(a)?t>1?nv(a,t-1,n,r,i):lu(i,a):r||(i[i.length]=a)}return i}var _u=nv;function q1(e,t){return _u(bt(e,t),1)}var rv=q1;function Z1(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}var iv=Z1;function J1(e){return e!==e}var ov=J1;function Q1(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}var sv=Q1;function eD(e,t,n){return t===t?sv(e,t,n):iv(e,ov,n)}var av=eD;function tD(e,t){var n=e==null?0:e.length;return!!n&&av(e,t,0)>-1}var lv=tD;function nD(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}var cv=nD;function rD(){}var uv=rD;var iD=1/0,oD=hr&&1/vo(new hr([,-0]))[1]==iD?function(e){return new hr(e)}:uv,fv=oD;var sD=200;function aD(e,t,n){var r=-1,i=lv,o=e.length,s=!0,a=[],l=a;if(n)s=!1,i=cv;else if(o>=sD){var c=t?null:fv(e);if(c)return vo(c);s=!1,i=su,l=new ou}else l=t?[]:a;e:for(;++r<o;){var u=e[r],f=t?t(u):u;if(u=n||u!==0?u:0,s&&f===f){for(var d=l.length;d--;)if(l[d]===f)continue e;t&&l.push(f),a.push(u)}else i(l,f,n)||(l!==a&&l.push(f),a.push(u))}return a}var dv=aD;function lD(e,t){return e&&e.length?dv(e,yr(t,2)):[]}var pv=lD;function cD(e){var t=e==null?0:e.length;return t?_u(e,1):[]}var hv=cD;function uD(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var mv=uD;function fD(e){return typeof e=="function"?e:So}var gv=fD;function dD(e,t){var n=Te(e)?mv:xr;return n(e,gv(t))}var vu=dD;var pD="[object Map]",hD="[object Set]",mD=Object.prototype,gD=mD.hasOwnProperty;function yD(e){if(e==null)return!0;if(pr(e)&&(Te(e)||typeof e=="string"||typeof e.splice=="function"||si(e)||ko(e)||dr(e)))return!e.length;var t=va(e);if(t==pD||t==hD)return!e.size;if(fu(e))return!du(e).length;for(var n in e)if(gD.call(e,n))return!1;return!0}var yv=yD;function xD(e,t,n,r){var i=-1,o=e==null?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}var xv=xD;function ED(e,t,n,r,i){return i(e,function(o,s,a){n=r?(r=!1,o):t(n,o,s,a)}),n}var Ev=ED;function wD(e,t,n){var r=Te(e)?xv:Ev,i=arguments.length<3;return r(e,yr(t,4),n,i,xr)}var em=wD;function TD(e,t){let n={};return r=>{let i=r.toString(),o=n[i];return o!==void 0||(o={atnStartState:e,decision:t,states:{}},n[i]=o),o}}var Au=class{constructor(){this.predicates=[]}is(t){return t>=this.predicates.length||this.predicates[t]}set(t,n){this.predicates[t]=n}toString(){let t="",n=this.predicates.length;for(let r=0;r<n;r++)t+=this.predicates[r]===!0?"1":"0";return t}},wv=new Au,Ra=class extends bn{constructor(t){var n,r;super(),this.logging=(n=t?.logging)!==null&&n!==void 0?n:(i=>console.log(i)),this.incomplete=(r=t?.incomplete)!==null&&r!==void 0?r:!1}initialize(t){this.atn=Y_(t.rules),this.dfas=AD(this.atn),this.callers=_D(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(t){let{prodOccurrence:n,rule:r,hasPredicates:i,dynamicTokensEnabled:o}=t,s=this.dfas,a=this.logging,l=this.incomplete,c=ui(r,"Alternation",n),f=this.atn.decisionMap[c].decision,d=bt(Oc({maxLookahead:1,occurrence:n,prodType:"Alternation",rule:r}),p=>bt(p,m=>m[0]));if(Tv(d,!1)&&!o){let p=em(d,(m,g,w)=>(vu(g,x=>{x&&(m[x.tokenTypeIdx]=w,vu(x.categoryMatches,y=>{m[y]=w}))}),m),{});return i?function(m){var g;let w=this.LA_FAST(1),x=p[w.tokenTypeIdx];if(m!==void 0&&x!==void 0){let y=(g=m[x])===null||g===void 0?void 0:g.GATE;if(y!==void 0&&y.call(this)===!1)return}return x}:function(){let m=this.LA_FAST(1);return p[m.tokenTypeIdx]}}else return i?function(p){let m=new Au,g=p===void 0?0:p.length;for(let x=0;x<g;x++){let y=p?.[x].GATE;m.set(x,y===void 0||y.call(this))}let w=tm.call(this,s,f,m,a,l);return typeof w=="number"?w:void 0}:function(){let p=tm.call(this,s,f,wv,a,l);return typeof p=="number"?p:void 0}}buildLookaheadForOptional(t){let{prodOccurrence:n,rule:r,prodType:i,dynamicTokensEnabled:o}=t,s=this.dfas,a=this.logging,l=this.incomplete,c=this.callers,u=ui(r,i,n),f=this.atn.decisionMap[u],d=f.decision,p=bt(Oc({maxLookahead:1,occurrence:n,prodType:i,rule:r}),m=>bt(m,g=>g[0]));if(Tv(p)&&p[0][0]&&!o&&!vD(f,i,c)){let m=p[0],g=hv(m);if(g.length===1&&yv(g[0].categoryMatches)){let x=g[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===x}}else{let w=em(g,(x,y)=>(y!==void 0&&(x[y.tokenTypeIdx]=!0,vu(y.categoryMatches,T=>{x[T]=!0})),x),{});return function(){let x=this.LA_FAST(1);return w[x.tokenTypeIdx]===!0}}}return function(){let m=tm.call(this,s,d,wv,a,l);return typeof m=="object"?!1:m===0}}};function Tv(e,t=!0){let n=new Set;for(let r of e){let i=new Set;for(let o of r){if(o===void 0){if(t)break;return!1}let s=[o.tokenTypeIdx].concat(o.categoryMatches);for(let a of s)if(n.has(a)){if(!i.has(a))return!1}else n.add(a),i.add(a)}}return!0}function _D(e){let t=new Map;for(let n of e.states)for(let r of n.transitions)if(r instanceof ci){let i=t.get(r.rule);i===void 0&&(i=[],t.set(r.rule,i)),i.push(r.followState)}return t}function _v(e,t){let n=new Set,r=new Set,i=[e];for(;i.length>0;){let o=i.shift();if(!r.has(o)){if(r.add(o),o.type===wr){if(t!==void 0){let s=t.get(o.rule);s!==void 0&&i.push(...s)}continue}for(let s of o.transitions)if(s instanceof li){n.add(s.tokenType.tokenTypeIdx);for(let a of s.tokenType.categoryMatches)n.add(a)}else i.push(s.target)}}return n}function vD(e,t,n){let r=t==="RepetitionMandatoryWithSeparator",i=e.transitions[r?1:0],o=e.transitions[r?0:1];if(i===void 0||o===void 0)return!1;let s=_v(i.target),a=_v(o.target,n);for(let l of s)if(a.has(l))return!0;return!1}function AD(e){let t=e.decisionStates.length,n=Array(t);for(let r=0;r<t;r++)n[r]=TD(e.decisionStates[r],r);return n}function tm(e,t,n,r,i){let o=e[t](n),s=o.start;if(s===void 0){let l=$D(o.atnStartState);s=kv(o,Av(l)),o.start=s}return kD.apply(this,[o,s,n,r,i])}function kD(e,t,n,r,i){let o=t,s=1,a=[],l=this.LA_FAST(s++);for(;;){let c=LD(o,l);if(c===void 0&&(c=ID.apply(this,[e,o,l,s,n,r])),c===Ia)return ND(a,o,l);if(c.isAcceptState===!0){if(i===!0&&uo(l,ft)){let u=GD(o,n);if(u!==void 0)return u}return c.prediction}o=c,a.push(l),l=this.LA(s++)}}function ID(e,t,n,r,i,o){let s=PD(t.configs,n,i);if(s.size===0)return vv(e,t,n,Ia),Ia;let a=Av(s),l=OD(s,i);if(l!==void 0)a.isAcceptState=!0,a.prediction=l,a.configs.uniqueAlt=l;else if(BD(s)){let c=Q_(s.alts);a.isAcceptState=!0,a.prediction=c,a.configs.uniqueAlt=c,RD.apply(this,[e,r,s.alts,o])}return a=vv(e,t,n,a),a}function RD(e,t,n,r){let i=[];for(let c=1;c<=t;c++)i.push(this.LA(c).tokenType);let o=e.atnStartState,s=o.rule,a=o.production,l=SD({topLevelRule:s,ambiguityIndices:n,production:a,prefixPath:i});r(l)}function SD(e){let t=bt(e.prefixPath,i=>In(i)).join(", "),n=e.production.idx===0?"":e.production.idx,r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(", ")}> in <${bD(e.production)}${n}> inside <${e.topLevelRule.name}> Rule,
|
|
115
115
|
<${t}> may appears as a prefix path in all these alternatives.
|
|
116
116
|
`;return r=r+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
117
|
-
For Further details.`,r}function bD(e){if(e instanceof Ee)return"SUBRULE";if(e instanceof we)return"OPTION";if(e instanceof Ie)return"OR";if(e instanceof Ne)return"AT_LEAST_ONE";if(e instanceof Le)return"AT_LEAST_ONE_SEP";if(e instanceof ke)return"MANY_SEP";if(e instanceof me)return"MANY";if(e instanceof le)return"CONSUME";throw Error("non exhaustive match")}function ND(e,t,n){let r=i_(t.configs.elements,o=>o.state.transitions),i=h_(r.filter(o=>o instanceof li).map(o=>o.tokenType),o=>o.tokenTypeIdx);return{actualToken:n,possibleTokenTypes:i,tokenPath:e}}function LD(e,t){return e.edges[t.tokenTypeIdx]}function PD(e,t,n){let r=new No,i=[];for(let s of e.elements){if(n.is(s.alt)===!1)continue;if(s.state.type===Er){i.push(s);continue}let a=s.state.transitions.length;for(let l=0;l<a;l++){let c=s.state.transitions[l],u=CD(c,t);u!==void 0&&r.add({state:u,alt:s.alt,stack:s.stack})}}let o;if(i.length===0&&r.size===1&&(o=r),o===void 0){o=new No;for(let s of r.elements)Iu(s,o)}if(i.length>0&&!MD(o))for(let s of i)o.add(s);return o}function CD(e,t){if(e instanceof li&&uo(t,e.tokenType))return e.target}function OD(e,t){let n;for(let r of e.elements)if(t.is(r.alt)===!0){if(n===void 0)n=r.alt;else if(n!==r.alt)return}return n}function k_(e){return{configs:e,edges:{},isAcceptState:!1,prediction:-1}}function A_(e,t,n,r){return r=I_(e,r),t.edges[n.tokenTypeIdx]=r,r}function I_(e,t){if(t===Ia)return t;let n=t.configs.key,r=e.states[n];return r!==void 0?r:(t.configs.finalize(),e.states[n]=t,t)}function $D(e){let t=new No,n=e.transitions.length;for(let r=0;r<n;r++){let o={state:e.transitions[r].target,alt:r,stack:[]};Iu(o,t)}return t}function Iu(e,t){let n=e.state;if(n.type===Er){if(e.stack.length>0){let i=[...e.stack],s={state:i.pop(),alt:e.alt,stack:i};Iu(s,t)}else t.add(e);return}n.epsilonOnlyTransitions||t.add(e);let r=n.transitions.length;for(let i=0;i<r;i++){let o=n.transitions[i],s=DD(e,o);s!==void 0&&Iu(s,t)}}function DD(e,t){if(t instanceof ka)return{state:t.target,alt:e.alt,stack:e.stack};if(t instanceof ci){let n=[...e.stack,t.followState];return{state:t.target,alt:e.alt,stack:n}}}function MD(e){for(let t of e.elements)if(t.state.type===Er)return!0;return!1}function FD(e){for(let t of e.elements)if(t.state.type!==Er)return!1;return!0}function BD(e){if(FD(e))return!0;let t=WD(e.elements);return XD(t)&&!UD(t)}function WD(e){let t=new Map;for(let n of e){let r=em(n,!1),i=t.get(r);i===void 0&&(i={},t.set(r,i)),i[n.alt]=!0}return t}function XD(e){for(let t of Array.from(e.values()))if(Object.keys(t).length>1)return!0;return!1}function UD(e){for(let t of Array.from(e.values()))if(Object.keys(t).length===1)return!0;return!1}function GD(e,t){let n;for(let r of e.configs.elements)if(!(t.is(r.alt)===!1||r.state.type===Er)){if(n===void 0)n=r.alt;else if(n!==r.alt)return}return n}var Po=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(t){return this.rootNode=new ba(t),this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(t){let n=new Co;return n.grammarSource=t,this.appendChild(this.current,n),this.nodeStack.push(n),n}buildLeafNode(t,n){let r=this.createLeafNode(t,!n);return n&&(r.grammarSource=n),this.appendChild(this.current,r),r}createLeafNode(t,n){return new Sa(t.startOffset,t.image.length,t.startLine-1,t.startColumn-1,t.endLine-1,t.endColumn,t.tokenType,n)}appendChild(t,n){n.container=t,t.content.push(n)}appendChildren(t,n){for(let r of n)r.container=t;t.content.length===0?t.content=n.slice():t.content.push(...n)}insertChildren(t,n,r){for(let i of r)i.container=t;t.content.splice(n,0,...r)}removeNode(t){let n=t.container;if(n){let r=n.content.indexOf(t);r>=0&&n.content.splice(r,1)}}addHiddenNodes(t){let n=[];for(let o of t)n.push(this.createLeafNode(o,!0));let r=this.current,i=!1;if(r.content.length>0){this.appendChildren(r,n);return}for(;r.container;){let o=r.container.content.indexOf(r);if(o>0){this.insertChildren(r.container,o,n),i=!0;break}r=r.container}i||this.insertChildren(this.rootNode,0,n)}construct(t){let n=this.current;t.$cstNode=n;let r=this.nodeStack.pop();r&&(r.content.length===0?this.removeNode(r):r.content=r.content.slice())}},Ru=class{constructor(){this.container=void 0,this.grammarSource=void 0}get root(){let t=this;for(;t.container;)t=t.container;return t}get text(){return this.root.fullText.substring(this.offset,this.end)}},Sa=class extends Ru{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get astNode(){let t=this.container;if(!t)throw new Error("This node has no associated AST element");return t.astNode}get range(){return{start:{line:this._startLine,character:this._startColumn},end:{line:this._endLine,character:this._endColumn}}}constructor(t,n,r,i,o,s,a,l=!1){super(),this._hidden=l,this._offset=Lo(t),this._length=Lo(n),this._startLine=Lo(r),this._startColumn=Lo(i),this._endLine=Lo(o),this._endColumn=Lo(s),this._tokenType=a}};function Lo(e){return e|0}var Co=class extends Ru{constructor(){super(...arguments),this.content=[],this._astNode=void 0,this._rangeCache=void 0}get astNode(){let t=this;for(;t;){if(t._astNode)return t._astNode;t=t.container}throw new Error("This node has no associated AST element")}set astNode(t){this._astNode=t}get hidden(){return!1}get offset(){return this.firstNonHiddenNode?.offset??0}get length(){return this.end-this.offset}get end(){return this.lastNonHiddenNode?.end??0}get range(){let t=this._rangeCache;if(t===void 0){let n=this.firstNonHiddenNode,r=this.lastNonHiddenNode;if(n&&r){let{range:i}=n,{range:o}=r;this._rangeCache=t={start:i.start,end:o.end.line<i.start.line?i.start:o.end}}else return{start:{line:0,character:0},end:{line:0,character:0}}}return t}get firstNonHiddenNode(){for(let t of this.content)if(!t.hidden)return t;return this.content[0]}get lastNonHiddenNode(){for(let t=this.content.length-1;t>=0;t--){let n=this.content[t];if(!n.hidden)return n}return this.content[this.content.length-1]}},ba=class extends Co{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(t){super(),this._text="",this._text=t??""}};var im=Symbol("Datatype");function rm(e){return e.$type===im}var R_="\u200B",S_=e=>e.endsWith(R_)?e:e+R_,Su=class{constructor(t,n){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=t.parser.Lexer;let r=this.lexer.definition,i=t.LanguageMetaData.mode==="production";t.shared.profilers.LangiumProfiler?.isActive("parsing")?this.wrapper=new sm(r,{...t.parser.ParserConfig,skipValidations:i,errorMessageProvider:t.parser.ParserErrorMessageProvider},n,t.shared.profilers.LangiumProfiler.createTask("parsing",t.LanguageMetaData.languageId)):this.wrapper=new Lu(r,{...t.parser.ParserConfig,skipValidations:i,errorMessageProvider:t.parser.ParserErrorMessageProvider},n)}alternatives(t,n){this.wrapper.wrapOr(t,n)}optional(t,n){this.wrapper.wrapOption(t,n)}many(t,n){this.wrapper.wrapMany(t,n)}atLeastOne(t,n){this.wrapper.wrapAtLeastOne(t,n)}getRule(t){return this.allRules.get(t)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},bu=class extends Su{get current(){return this.stack[this.stack.length-1]}constructor(t){super(t,!1),this.nodeBuilder=new Po,this.stack=[],this.assignmentMap=new Map,this.operatorPrecedence=new Map,this.linker=t.references.Linker,this.converter=t.parser.ValueConverter,this.astReflection=t.shared.AstReflection}rule(t,n){let r=this.computeRuleType(t),i;qr(t)&&(i=t.name,this.registerPrecedenceMap(t));let o=this.wrapper.DEFINE_RULE(S_(t.name),this.startImplementation(r,i,n).bind(this));return this.allRules.set(t.name,o),lt(t)&&t.entry&&(this.mainRule=o),o}registerPrecedenceMap(t){let n=t.name,r=new Map;for(let i=0;i<t.operators.precedences.length;i++){let o=t.operators.precedences[i];for(let s of o.operators)r.set(s.value,{precedence:i,rightAssoc:o.associativity==="right"})}this.operatorPrecedence.set(n,r)}computeRuleType(t){return qr(t)?ir(t):t.fragment?void 0:ra(t)?im:ir(t)}parse(t,n={}){this.nodeBuilder.buildRootNode(t);let r=this.lexerResult=this.lexer.tokenize(t);this.wrapper.input=r.tokens;let i=n.rule?this.allRules.get(n.rule):this.mainRule;if(!i)throw new Error(n.rule?`No rule found with name '${n.rule}'`:"No main rule available.");let o=this.doParse(i);return this.nodeBuilder.addHiddenNodes(r.hidden),this.unorderedGroups.clear(),this.lexerResult=void 0,ec(o,{deep:!0}),{value:o,lexerErrors:r.errors,lexerReport:r.report,parserErrors:this.wrapper.errors}}doParse(t){let n=this.wrapper.rule(t);if(this.stack.length>0&&(n=this.construct()),n===void 0)throw new Error("No result from parser");if(this.stack.length>0)throw new Error("Parser stack is not empty after parsing");return this.linkCstNode(n),n}linkCstNode(t){Ue(t)&&t.$cstNode&&(t.$cstNode.astNode=t)}startImplementation(t,n,r){return i=>{let o=!this.isRecording()&&t!==void 0;if(o){let s={$type:t};this.stack.push(s),t===im?s.value="":n!==void 0&&(s.$infixName=n)}return r(i),o?this.construct():void 0}}extractHiddenTokens(t){let n=this.lexerResult.hidden;if(!n.length)return[];let r=t.startOffset;for(let i=0;i<n.length;i++)if(n[i].startOffset>r)return n.splice(0,i);return n.splice(0,n.length)}consume(t,n,r){let i=this.wrapper.wrapConsume(t,n);if(!this.isRecording()&&this.isValidToken(i)){let o=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(o);let s=this.nodeBuilder.buildLeafNode(i,r),{assignment:a,crossRef:l}=this.getAssignment(r),c=this.current;if(a){let u=Ht(r)?i.image:this.converter.convert(i.image,s);this.assign(a.operator,a.feature,u,s,l)}else if(rm(c)){let u=i.image;Ht(r)||(u=this.converter.convert(u,s).toString()),c.value+=u}}}isValidToken(t){return!t.isInsertedInRecovery&&qs(t)}subrule(t,n,r,i,o){let s;!this.isRecording()&&!r&&(s=this.nodeBuilder.buildCompositeNode(i));let a;try{a=this.wrapper.wrapSubrule(t,n,o)}finally{this.isRecording()||(a===void 0&&!r&&(a=this.construct()),a!==void 0&&s&&s.length>0&&this.performSubruleAssignment(a,i,s))}}performSubruleAssignment(t,n,r){let{assignment:i,crossRef:o}=this.getAssignment(n);if(i)this.assign(i.operator,i.feature,t,r,o);else if(!i){let s=this.current;if(rm(s))s.value+=t.toString();else if(typeof t=="object"&&t){let l=this.assignWithoutOverride(t,s);this.stack.pop(),this.stack.push(l)}}}action(t,n){if(!this.isRecording()){let r=this.current;if(n.feature&&n.operator){r=this.construct(),this.nodeBuilder.removeNode(r.$cstNode);let i=this.nodeBuilder.buildCompositeNode(n);this.nodeBuilder.appendChild(i,r.$cstNode);let o={$type:t};this.stack.push(o),this.assign(n.operator,n.feature,r,r.$cstNode)}else r.$type=t}}construct(){if(this.isRecording())return;let t=this.stack.pop();return this.nodeBuilder.construct(t),"$infixName"in t?this.constructInfix(t,this.operatorPrecedence.get(t.$infixName)):rm(t)?this.converter.convert(t.value,t.$cstNode):(dE(this.astReflection,t),t)}constructInfix(t,n){let r=t.parts;if(!Array.isArray(r)||r.length===0)return;let i=t.operators;if(!Array.isArray(i)||r.length<2)return r[0];let o=0,s=-1;for(let g=0;g<i.length;g++){let w=i[g],x=n.get(w)??{precedence:1/0,rightAssoc:!1};x.precedence>s?(s=x.precedence,o=g):x.precedence===s&&(x.rightAssoc||(o=g))}let a=i.slice(0,o),l=i.slice(o+1),c=r.slice(0,o+1),u=r.slice(o+1),f={$infixName:t.$infixName,$type:t.$type,$cstNode:t.$cstNode,parts:c,operators:a},d={$infixName:t.$infixName,$type:t.$type,$cstNode:t.$cstNode,parts:u,operators:l},p=this.constructInfix(f,n),m=this.constructInfix(d,n);return{$type:t.$type,$cstNode:t.$cstNode,left:p,operator:i[o],right:m}}getAssignment(t){if(!this.assignmentMap.has(t)){let n=Hi(t,sn);this.assignmentMap.set(t,{assignment:n,crossRef:n&&an(n.terminal)?n.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(t)}assign(t,n,r,i,o){let s=this.current,a;switch(o==="single"&&typeof r=="string"?a=this.linker.buildReference(s,n,i,r):o==="multi"&&typeof r=="string"?a=this.linker.buildMultiReference(s,n,i,r):a=r,this.linkCstNode(a),t){case"=":{s[n]=a;break}case"?=":{s[n]=!0;break}case"+=":Array.isArray(s[n])||(s[n]=[]),s[n].push(a)}}assignWithoutOverride(t,n){for(let[r,i]of Object.entries(n)){let o=t[r];o===void 0?t[r]=i:Array.isArray(o)&&Array.isArray(i)&&(i.push(...o),t[r]=i)}return t.$cstNode=void 0,t}get definitionErrors(){return this.wrapper.definitionErrors}},om=class{buildMismatchTokenMessage(t){return kn.buildMismatchTokenMessage(t)}buildNotAllInputParsedMessage(t){return kn.buildNotAllInputParsedMessage(t)}buildNoViableAltMessage(t){return kn.buildNoViableAltMessage(t)}buildEarlyExitMessage(t){return kn.buildEarlyExitMessage(t)}},Na=class extends om{buildMismatchTokenMessage({expected:t,actual:n}){return`Expecting ${t.LABEL?"`"+t.LABEL+"`":t.name.endsWith(":KW")?`keyword '${t.name.substring(0,t.name.length-3)}'`:`token of type '${t.name}'`} but found \`${n.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:t}){return`Expecting end of file but found \`${t.image}\`.`}},Nu=class extends Su{constructor(t){super(t,!0),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(t){this.resetState();let n=this.lexer.tokenize(t,{mode:"partial"});return this.tokens=n.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(t,n){let r=this.wrapper.DEFINE_RULE(S_(t.name),this.startImplementation(n).bind(this));return this.allRules.set(t.name,r),t.entry&&(this.mainRule=r),r}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(t){return n=>{let r=this.keepStackSize();try{t(n)}finally{this.resetStackSize(r)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){let t=this.elementStack.length;return this.stackSize=t,t}resetStackSize(t){this.removeUnexpectedElements(),this.stackSize=t}consume(t,n,r){this.wrapper.wrapConsume(t,n),this.isRecording()||(this.lastElementStack=[...this.elementStack,r],this.nextTokenIndex=this.currIdx+1)}subrule(t,n,r,i,o){this.before(i),this.wrapper.wrapSubrule(t,n,o),this.after(i)}before(t){this.isRecording()||this.elementStack.push(t)}after(t){if(!this.isRecording()){let n=this.elementStack.lastIndexOf(t);n>=0&&this.elementStack.splice(n)}}get currIdx(){return this.wrapper.currIdx}},HD={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Na},Lu=class extends wa{constructor(t,n,r){let i=n&&"maxLookahead"in n;super(t,{...HD,lookaheadStrategy:i?new In({maxLookahead:n.maxLookahead}):new Ra({logging:n.skipValidations?()=>{}:void 0,incomplete:r}),...n})}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(t,n,r){return this.RULE(t,n,r)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(t,n){return this.consume(t,n,void 0)}wrapSubrule(t,n,r){return this.subrule(t,n,{ARGS:[r]})}wrapOr(t,n){this.or(t,n)}wrapOption(t,n){this.option(t,n)}wrapMany(t,n){this.many(t,n)}wrapAtLeastOne(t,n){this.atLeastOne(t,n)}rule(t){return t.call(this,{})}},sm=class extends Lu{constructor(t,n,r,i){super(t,n,r),this.task=i}rule(t){this.task.start(),this.task.startSubTask(this.ruleName(t));try{return super.rule(t)}finally{this.task.stopSubTask(this.ruleName(t)),this.task.stop()}}ruleName(t){return t.ruleName}subrule(t,n,r){this.task.startSubTask(this.ruleName(n));try{return super.subrule(t,n,r)}finally{this.task.stopSubTask(this.ruleName(n))}}};function Cu(e,t,n){return zD({parser:t,tokens:n,ruleNames:new Map},e),t}function zD(e,t){let n=ta(t,!1),r=ye(t.rules).filter(lt).filter(o=>n.has(o));for(let o of r){let s={...e,consume:1,optional:1,subrule:1,many:1,or:1};e.parser.rule(o,di(s,o.definition))}let i=ye(t.rules).filter(qr).filter(o=>n.has(o));for(let o of i)e.parser.rule(o,jD(e,o))}function jD(e,t){let n=t.call.rule.ref;if(!n)throw new Error("Could not resolve reference to infix operator rule: "+t.call.rule.$refText);if(xt(n))throw new Error("Cannot use terminal rule in infix expression");let r=t.operators.precedences.flatMap(p=>p.operators),i={$type:"Group",elements:[]},o={$container:i,$type:"Assignment",feature:"parts",operator:"+=",terminal:t.call},s={$container:i,$type:"Group",elements:[],cardinality:"*"};i.elements.push(o,s);let l={$container:s,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:r}},c={...o,$container:s};s.elements.push(l,c);let f=r.map(p=>e.tokens[p.value]).map((p,m)=>({ALT:()=>e.parser.consume(m,p,l)})),d;return p=>{d??(d=lm(e,n)),e.parser.subrule(0,d,!1,o,p),e.parser.many(0,{DEF:()=>{e.parser.alternatives(0,f),e.parser.subrule(1,d,!1,c,p)}})}}function di(e,t,n=!1){let r;if(Ht(t))r=QD(e,t);else if(nr(t))r=YD(e,t);else if(sn(t))r=di(e,t.terminal);else if(an(t))r=b_(e,t);else if(ln(t))r=VD(e,t);else if(Jp(t))r=qD(e,t);else if(nh(t))r=ZD(e,t);else if(Kr(t))r=JD(e,t);else if(kE(t)){let i=e.consume++;r=()=>e.parser.consume(i,ft,t)}else throw new Zs(t.$cstNode,`Unexpected element type: ${t.$type}`);return N_(e,n?void 0:Pu(t),r,t.cardinality)}function YD(e,t){let n=ir(t);return()=>e.parser.action(n,t)}function VD(e,t){let n=t.rule.ref;if(tr(n)){let r=e.subrule++,i=lt(n)&&n.fragment,o=t.arguments.length>0?KD(n,t.arguments):()=>({}),s;return a=>{s??(s=lm(e,n)),e.parser.subrule(r,s,i,t,o(a))}}else if(xt(n)){let r=e.consume++,i=am(e,n.name);return()=>e.parser.consume(r,i,t)}else if(n)rr(n);else throw new Zs(t.$cstNode,`Undefined rule: ${t.rule.$refText}`)}function KD(e,t){if(t.some(r=>r.calledByName)){let r=t.map(i=>({parameterName:i.parameter?.ref?.name,predicate:dn(i.value)}));return i=>{let o={};for(let{parameterName:s,predicate:a}of r)s&&(o[s]=a(i));return o}}else{let r=t.map(i=>dn(i.value));return i=>{let o={};for(let s=0;s<r.length;s++)if(s<e.parameters.length){let a=e.parameters[s].name,l=r[s];o[a]=l(i)}return o}}}function dn(e){if(AE(e)){let t=dn(e.left),n=dn(e.right);return r=>t(r)||n(r)}else if(_E(e)){let t=dn(e.left),n=dn(e.right);return r=>t(r)&&n(r)}else if(SE(e)){let t=dn(e.value);return n=>!t(n)}else if(bE(e)){let t=e.parameter.ref.name;return n=>n!==void 0&&n[t]===!0}else if(TE(e)){let t=!!e.true;return()=>t}rr(e)}function qD(e,t){if(t.elements.length===1)return di(e,t.elements[0]);{let n=[];for(let i of t.elements){let o={ALT:di(e,i,!0)},s=Pu(i);s&&(o.GATE=dn(s)),n.push(o)}let r=e.or++;return i=>e.parser.alternatives(r,n.map(o=>{let s={ALT:()=>o.ALT(i)},a=o.GATE;return a&&(s.GATE=()=>a(i)),s}))}}function ZD(e,t){if(t.elements.length===1)return di(e,t.elements[0]);let n=[];for(let a of t.elements){let l={ALT:di(e,a,!0)},c=Pu(a);c&&(l.GATE=dn(c)),n.push(l)}let r=e.or++,i=(a,l)=>{let c=l.getRuleStack().join("-");return`uGroup_${a}_${c}`},o=a=>e.parser.alternatives(r,n.map((l,c)=>{let u={ALT:()=>!0},f=e.parser;u.ALT=()=>{if(l.ALT(a),!f.isRecording()){let p=i(r,f);f.unorderedGroups.get(p)||f.unorderedGroups.set(p,[]);let m=f.unorderedGroups.get(p);typeof m?.[c]>"u"&&(m[c]=!0)}};let d=l.GATE;return d?u.GATE=()=>d(a):u.GATE=()=>!f.unorderedGroups.get(i(r,f))?.[c],u})),s=N_(e,Pu(t),o,"*");return a=>{s(a),e.parser.isRecording()||e.parser.unorderedGroups.delete(i(r,e.parser))}}function JD(e,t){let n=t.elements.map(r=>di(e,r));return r=>n.forEach(i=>i(r))}function Pu(e){if(Kr(e))return e.guardCondition}function b_(e,t,n=t.terminal){if(n)if(ln(n)&<(n.rule.ref)){let r=n.rule.ref,i=e.subrule++,o;return s=>{o??(o=lm(e,r)),e.parser.subrule(i,o,!1,t,s)}}else if(ln(n)&&xt(n.rule.ref)){let r=e.consume++,i=am(e,n.rule.ref.name);return()=>e.parser.consume(r,i,t)}else if(Ht(n)){let r=e.consume++,i=am(e,n.value);return()=>e.parser.consume(r,i,t)}else throw new Error("Could not build cross reference parser");else{if(!t.type.ref)throw new Error("Could not resolve reference to type: "+t.type.$refText);let i=yc(t.type.ref)?.terminal;if(!i)throw new Error("Could not find name assignment for type: "+ir(t.type.ref));return b_(e,t,i)}}function QD(e,t){let n=e.consume++,r=e.tokens[t.value];if(!r)throw new Error("Could not find token for keyword: "+t.value);return()=>e.parser.consume(n,r,t)}function N_(e,t,n,r){let i=t&&dn(t);if(!r)if(i){let o=e.or++;return s=>e.parser.alternatives(o,[{ALT:()=>n(s),GATE:()=>i(s)},{ALT:Qc(),GATE:()=>!i(s)}])}else return n;if(r==="*"){let o=e.many++;return s=>e.parser.many(o,{DEF:()=>n(s),GATE:i?()=>i(s):void 0})}else if(r==="+"){let o=e.many++;if(i){let s=e.or++;return a=>e.parser.alternatives(s,[{ALT:()=>e.parser.atLeastOne(o,{DEF:()=>n(a)}),GATE:()=>i(a)},{ALT:Qc(),GATE:()=>!i(a)}])}else return s=>e.parser.atLeastOne(o,{DEF:()=>n(s)})}else if(r==="?"){let o=e.optional++;return s=>e.parser.optional(o,{DEF:()=>n(s),GATE:i?()=>i(s):void 0})}else rr(r)}function lm(e,t){let n=eM(e,t),r=e.parser.getRule(n);if(!r)throw new Error(`Rule "${n}" not found."`);return r}function eM(e,t){if(tr(t))return t.name;if(e.ruleNames.has(t))return e.ruleNames.get(t);{let n=t,r=n.$container,i=t.$type;for(;!lt(r);)(Kr(r)||Jp(r)||nh(r))&&(i=r.elements.indexOf(n).toString()+":"+i),n=r,r=r.$container;return i=r.name+":"+i,e.ruleNames.set(t,i),i}}function am(e,t){let n=e.tokens[t];if(!n)throw new Error(`Token "${t}" not found."`);return n}function L_(e){let t=e.Grammar,n=e.parser.Lexer,r=new Nu(e);return Cu(t,r,n.definition),r.finalize(),r}function P_(e){let t=tM(e);return t.finalize(),t}function tM(e){let t=e.Grammar,n=e.parser.Lexer,r=new bu(e);return Cu(t,r,n.definition)}var Oo=class{constructor(){this.diagnostics=[]}buildTokens(t,n){let r=ye(ta(t,!1)),i=this.buildTerminalTokens(r),o=this.buildKeywordTokens(r,i,n);return o.push(...i),o}flushLexingReport(t){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){let t=[...this.diagnostics];return this.diagnostics=[],t}buildTerminalTokens(t){return t.filter(xt).filter(n=>!n.fragment).map(n=>this.buildTerminalToken(n)).toArray()}buildTerminalToken(t){let n=no(t),r=this.requiresCustomPattern(n)?this.regexPatternFunction(n):n,i={name:t.name,PATTERN:r};return typeof r=="function"&&(i.LINE_BREAKS=!0),t.hidden&&(i.GROUP=gc(n)?Me.SKIPPED:"hidden"),i}requiresCustomPattern(t){return!!(t.flags.includes("u")||t.flags.includes("s"))}regexPatternFunction(t){let n=new RegExp(t,t.flags+"y");return(r,i)=>(n.lastIndex=i,n.exec(r))}buildKeywordTokens(t,n,r){return t.filter(tr).flatMap(i=>rn(i).filter(Ht)).distinct(i=>i.value).toArray().sort((i,o)=>o.value.length-i.value.length).map(i=>this.buildKeywordToken(i,n,!!r?.caseInsensitive))}buildKeywordToken(t,n,r){let i=this.buildKeywordPattern(t,r),o={name:t.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(t,n)};return typeof i=="function"&&(o.LINE_BREAKS=!0),o}buildKeywordPattern(t,n){return n?new RegExp(Qr(t.value),"i"):t.value}findLongerAlt(t,n){return n.reduce((r,i)=>{let o=i?.PATTERN;return o?.source&&jE("^"+o.source+"$",t.value)&&r.push(i),r},[])}};var $o=class{convert(t,n){let r=n.grammarSource;if(an(r)&&(r=ch(r)),ln(r)){let i=r.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,t,n)}return t}runConverter(t,n,r){switch(t.name.toUpperCase()){case"INT":return Nn.convertInt(n);case"STRING":return Nn.convertString(n);case"ID":return Nn.convertID(n)}switch(gh(t)?.toLowerCase()){case"number":return Nn.convertNumber(n);case"boolean":return Nn.convertBoolean(n);case"bigint":return Nn.convertBigint(n);case"date":return Nn.convertDate(n);default:return n}}},Nn;(function(e){function t(c){let u="";for(let f=1;f<c.length-1;f++){let d=c.charAt(f);if(d==="\\"){let p=c.charAt(++f);u+=n(p)}else u+=d}return u}e.convertString=t;function n(c){switch(c){case"b":return"\b";case"f":return"\f";case"n":return`
|
|
118
|
-
`;case"r":return"\r";case"t":return" ";case"v":return"\v";case"0":return"\0";default:return c}}function r(c){return c.charAt(0)==="^"?c.substring(1):c}e.convertID=r;function i(c){return parseInt(c)}e.convertInt=i;function o(c){return BigInt(c)}e.convertBigint=o;function s(c){return new Date(c)}e.convertDate=s;function a(c){return Number(c)}e.convertNumber=a;function l(c){return c.toLowerCase()==="true"}e.convertBoolean=l})(Nn||(Nn={}));var ce=Wp(D_()),Mu=Wp(gm()),Fu=Wp(F_()),Gm={lspReservedErrorRangeStart:-32899,RequestFailed:-32803,ServerCancelled:-32802,ContentModified:-32801,RequestCancelled:-32800,lspReservedErrorRangeEnd:-32800};function EM(){return new Promise(e=>{typeof setImmediate>"u"?setTimeout(e,0):setImmediate(e)})}var Bu=0,wM=10;function B_(){return Bu=performance.now(),new ce.CancellationTokenSource}var hi=Symbol("OperationCancelled");function Ar(e){return e===hi}async function Ge(e){if(e===ce.CancellationToken.None)return;let t=performance.now();if(t-Bu>=wM&&(Bu=t,await EM(),Bu=performance.now()),e.isCancellationRequested)throw hi}var _r=class{constructor(){this.promise=new Promise((t,n)=>{this.resolve=r=>(t(r),this),this.reject=r=>(n(r),this)})}};var Wu=class e{constructor(t,n,r,i){this._uri=t,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(t){if(t){let n=this.offsetAt(t.start),r=this.offsetAt(t.end);return this._content.substring(n,r)}return this._content}update(t,n){for(let r of t)if(e.isIncremental(r)){let i=U_(r.range),o=this.offsetAt(i.start),s=this.offsetAt(i.end);this._content=this._content.substring(0,o)+r.text+this._content.substring(s,this._content.length);let a=Math.max(i.start.line,0),l=Math.max(i.end.line,0),c=this._lineOffsets,u=W_(r.text,!1,o);if(l-a===u.length)for(let d=0,p=u.length;d<p;d++)c[d+a+1]=u[d];else u.length<1e4?c.splice(a+1,l-a,...u):this._lineOffsets=c=c.slice(0,a+1).concat(u,c.slice(l+1));let f=r.text.length-(s-o);if(f!==0)for(let d=a+1+u.length,p=c.length;d<p;d++)c[d]=c[d]+f}else if(e.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=W_(this._content,!0)),this._lineOffsets}positionAt(t){t=Math.max(Math.min(t,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return{line:0,character:t};for(;r<i;){let s=Math.floor((r+i)/2);n[s]>t?i=s:r=s+1}let o=r-1;return t=this.ensureBeforeEOL(t,n[o]),{line:o,character:t-n[o]}}offsetAt(t){let n=this.getLineOffsets();if(t.line>=n.length)return this._content.length;if(t.line<0)return 0;let r=n[t.line];if(t.character<=0)return r;let i=t.line+1<n.length?n[t.line+1]:this._content.length,o=Math.min(r+t.character,i);return this.ensureBeforeEOL(o,r)}getLineRange(t){let n=this.getLineOffsets();if(t>=n.length){let s=n.length-1;return{start:{line:s,character:0},end:{line:s,character:this._content.length-n[s]}}}else if(t<0)return{start:{line:0,character:0},end:{line:0,character:0}};let r=n[t],i=t+1<n.length?n[t+1]:this._content.length,o=this.ensureBeforeEOL(i,r);return{start:{line:t,character:0},end:{line:t,character:o-r}}}getEOLCharacters(t){let n=this.getLineOffsets();if(t>=n.length)return"";if(t<0)return"";let r=t+1<n.length?n[t+1]:this._content.length,i=this.ensureBeforeEOL(r,n[t]);return this._content.substring(i,r)}ensureBeforeEOL(t,n){for(;t>n&&X_(this._content.charCodeAt(t-1));)t--;return t}get lineCount(){return this.getLineOffsets().length}static isIncremental(t){let n=t;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")}static isFull(t){let n=t;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}},La;(function(e){function t(i,o,s,a){return new Wu(i,o,s,a)}e.create=t;function n(i,o,s){if(i instanceof Wu)return i.update(o,s),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}e.update=n;function r(i,o){let s=i.getText(),a=Hm(o.map(TM),(u,f)=>{let d=u.range.start.line-f.range.start.line;return d===0?u.range.start.character-f.range.start.character:d}),l=0,c=[];for(let u of a){let f=i.offsetAt(u.range.start);if(f<l)throw new Error("Overlapping edit");f>l&&c.push(s.substring(l,f)),u.newText.length&&c.push(u.newText),l=i.offsetAt(u.range.end)}return c.push(s.substr(l)),c.join("")}e.applyEdits=r})(La||(La={}));function Hm(e,t){if(e.length<=1)return e;let n=e.length/2|0,r=e.slice(0,n),i=e.slice(n);Hm(r,t),Hm(i,t);let o=0,s=0,a=0;for(;o<r.length&&s<i.length;)t(r[o],i[s])<=0?e[a++]=r[o++]:e[a++]=i[s++];for(;o<r.length;)e[a++]=r[o++];for(;s<i.length;)e[a++]=i[s++];return e}function W_(e,t,n=0){let r=t?[n]:[];for(let i=0;i<e.length;i++){let o=e.charCodeAt(i);X_(o)&&(o===13&&i+1<e.length&&e.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function X_(e){return e===13||e===10}function U_(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 TM(e){let t=U_(e.range);return t!==e.range?{newText:e.newText,range:t}:e}var G_;(()=>{"use strict";var e={975:P=>{function R(I){if(typeof I!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(I))}function N(I,A){for(var _,D="",L=0,B=-1,z=0,G=0;G<=I.length;++G){if(G<I.length)_=I.charCodeAt(G);else{if(_===47)break;_=47}if(_===47){if(!(B===G-1||z===1))if(B!==G-1&&z===2){if(D.length<2||L!==2||D.charCodeAt(D.length-1)!==46||D.charCodeAt(D.length-2)!==46){if(D.length>2){var ee=D.lastIndexOf("/");if(ee!==D.length-1){ee===-1?(D="",L=0):L=(D=D.slice(0,ee)).length-1-D.lastIndexOf("/"),B=G,z=0;continue}}else if(D.length===2||D.length===1){D="",L=0,B=G,z=0;continue}}A&&(D.length>0?D+="/..":D="..",L=2)}else D.length>0?D+="/"+I.slice(B+1,G):D=I.slice(B+1,G),L=G-B-1;B=G,z=0}else _===46&&z!==-1?++z:z=-1}return D}var $={resolve:function(){for(var I,A="",_=!1,D=arguments.length-1;D>=-1&&!_;D--){var L;D>=0?L=arguments[D]:(I===void 0&&(I=process.cwd()),L=I),R(L),L.length!==0&&(A=L+"/"+A,_=L.charCodeAt(0)===47)}return A=N(A,!_),_?A.length>0?"/"+A:"/":A.length>0?A:"."},normalize:function(I){if(R(I),I.length===0)return".";var A=I.charCodeAt(0)===47,_=I.charCodeAt(I.length-1)===47;return(I=N(I,!A)).length!==0||A||(I="."),I.length>0&&_&&(I+="/"),A?"/"+I:I},isAbsolute:function(I){return R(I),I.length>0&&I.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var I,A=0;A<arguments.length;++A){var _=arguments[A];R(_),_.length>0&&(I===void 0?I=_:I+="/"+_)}return I===void 0?".":$.normalize(I)},relative:function(I,A){if(R(I),R(A),I===A||(I=$.resolve(I))===(A=$.resolve(A)))return"";for(var _=1;_<I.length&&I.charCodeAt(_)===47;++_);for(var D=I.length,L=D-_,B=1;B<A.length&&A.charCodeAt(B)===47;++B);for(var z=A.length-B,G=L<z?L:z,ee=-1,Y=0;Y<=G;++Y){if(Y===G){if(z>G){if(A.charCodeAt(B+Y)===47)return A.slice(B+Y+1);if(Y===0)return A.slice(B+Y)}else L>G&&(I.charCodeAt(_+Y)===47?ee=Y:Y===0&&(ee=0));break}var ne=I.charCodeAt(_+Y);if(ne!==A.charCodeAt(B+Y))break;ne===47&&(ee=Y)}var k="";for(Y=_+ee+1;Y<=D;++Y)Y!==D&&I.charCodeAt(Y)!==47||(k.length===0?k+="..":k+="/..");return k.length>0?k+A.slice(B+ee):(B+=ee,A.charCodeAt(B)===47&&++B,A.slice(B))},_makeLong:function(I){return I},dirname:function(I){if(R(I),I.length===0)return".";for(var A=I.charCodeAt(0),_=A===47,D=-1,L=!0,B=I.length-1;B>=1;--B)if((A=I.charCodeAt(B))===47){if(!L){D=B;break}}else L=!1;return D===-1?_?"/":".":_&&D===1?"//":I.slice(0,D)},basename:function(I,A){if(A!==void 0&&typeof A!="string")throw new TypeError('"ext" argument must be a string');R(I);var _,D=0,L=-1,B=!0;if(A!==void 0&&A.length>0&&A.length<=I.length){if(A.length===I.length&&A===I)return"";var z=A.length-1,G=-1;for(_=I.length-1;_>=0;--_){var ee=I.charCodeAt(_);if(ee===47){if(!B){D=_+1;break}}else G===-1&&(B=!1,G=_+1),z>=0&&(ee===A.charCodeAt(z)?--z==-1&&(L=_):(z=-1,L=G))}return D===L?L=G:L===-1&&(L=I.length),I.slice(D,L)}for(_=I.length-1;_>=0;--_)if(I.charCodeAt(_)===47){if(!B){D=_+1;break}}else L===-1&&(B=!1,L=_+1);return L===-1?"":I.slice(D,L)},extname:function(I){R(I);for(var A=-1,_=0,D=-1,L=!0,B=0,z=I.length-1;z>=0;--z){var G=I.charCodeAt(z);if(G!==47)D===-1&&(L=!1,D=z+1),G===46?A===-1?A=z:B!==1&&(B=1):A!==-1&&(B=-1);else if(!L){_=z+1;break}}return A===-1||D===-1||B===0||B===1&&A===D-1&&A===_+1?"":I.slice(A,D)},format:function(I){if(I===null||typeof I!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof I);return(function(A,_){var D=_.dir||_.root,L=_.base||(_.name||"")+(_.ext||"");return D?D===_.root?D+L:D+"/"+L:L})(0,I)},parse:function(I){R(I);var A={root:"",dir:"",base:"",ext:"",name:""};if(I.length===0)return A;var _,D=I.charCodeAt(0),L=D===47;L?(A.root="/",_=1):_=0;for(var B=-1,z=0,G=-1,ee=!0,Y=I.length-1,ne=0;Y>=_;--Y)if((D=I.charCodeAt(Y))!==47)G===-1&&(ee=!1,G=Y+1),D===46?B===-1?B=Y:ne!==1&&(ne=1):B!==-1&&(ne=-1);else if(!ee){z=Y+1;break}return B===-1||G===-1||ne===0||ne===1&&B===G-1&&B===z+1?G!==-1&&(A.base=A.name=z===0&&L?I.slice(1,G):I.slice(z,G)):(z===0&&L?(A.name=I.slice(1,B),A.base=I.slice(1,G)):(A.name=I.slice(z,B),A.base=I.slice(z,G)),A.ext=I.slice(B,G)),z>0?A.dir=I.slice(0,z-1):L&&(A.dir="/"),A},sep:"/",delimiter:":",win32:null,posix:null};$.posix=$,P.exports=$}},t={};function n(P){var R=t[P];if(R!==void 0)return R.exports;var N=t[P]={exports:{}};return e[P](N,N.exports,n),N.exports}n.d=(P,R)=>{for(var N in R)n.o(R,N)&&!n.o(P,N)&&Object.defineProperty(P,N,{enumerable:!0,get:R[N]})},n.o=(P,R)=>Object.prototype.hasOwnProperty.call(P,R),n.r=P=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(P,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(P,"__esModule",{value:!0})};var r={};let i;n.r(r),n.d(r,{URI:()=>d,Utils:()=>j}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);let o=/^\w[\w\d+.-]*$/,s=/^\//,a=/^\/\//;function l(P,R){if(!P.scheme&&R)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${P.authority}", path: "${P.path}", query: "${P.query}", fragment: "${P.fragment}"}`);if(P.scheme&&!o.test(P.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(P.path){if(P.authority){if(!s.test(P.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(a.test(P.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}let c="",u="/",f=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class d{constructor(R,N,$,I,A,_=!1){M(this,"scheme");M(this,"authority");M(this,"path");M(this,"query");M(this,"fragment");typeof R=="object"?(this.scheme=R.scheme||c,this.authority=R.authority||c,this.path=R.path||c,this.query=R.query||c,this.fragment=R.fragment||c):(this.scheme=(function(D,L){return D||L?D:"file"})(R,_),this.authority=N||c,this.path=(function(D,L){switch(D){case"https":case"http":case"file":L?L[0]!==u&&(L=u+L):L=u}return L})(this.scheme,$||c),this.query=I||c,this.fragment=A||c,l(this,_))}static isUri(R){return R instanceof d||!!R&&typeof R.authority=="string"&&typeof R.fragment=="string"&&typeof R.path=="string"&&typeof R.query=="string"&&typeof R.scheme=="string"&&typeof R.fsPath=="string"&&typeof R.with=="function"&&typeof R.toString=="function"}get fsPath(){return y(this,!1)}with(R){if(!R)return this;let{scheme:N,authority:$,path:I,query:A,fragment:_}=R;return N===void 0?N=this.scheme:N===null&&(N=c),$===void 0?$=this.authority:$===null&&($=c),I===void 0?I=this.path:I===null&&(I=c),A===void 0?A=this.query:A===null&&(A=c),_===void 0?_=this.fragment:_===null&&(_=c),N===this.scheme&&$===this.authority&&I===this.path&&A===this.query&&_===this.fragment?this:new m(N,$,I,A,_)}static parse(R,N=!1){let $=f.exec(R);return $?new m($[2]||c,S($[4]||c),S($[5]||c),S($[7]||c),S($[9]||c),N):new m(c,c,c,c,c)}static file(R){let N=c;if(i&&(R=R.replace(/\\/g,u)),R[0]===u&&R[1]===u){let $=R.indexOf(u,2);$===-1?(N=R.substring(2),R=u):(N=R.substring(2,$),R=R.substring($)||u)}return new m("file",N,R,c,c)}static from(R){let N=new m(R.scheme,R.authority,R.path,R.query,R.fragment);return l(N,!0),N}toString(R=!1){return T(this,R)}toJSON(){return this}static revive(R){if(R){if(R instanceof d)return R;{let N=new m(R);return N._formatted=R.external,N._fsPath=R._sep===p?R.fsPath:null,N}}return R}}let p=i?1:void 0;class m extends d{constructor(){super(...arguments);M(this,"_formatted",null);M(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=y(this,!1)),this._fsPath}toString(N=!1){return N?T(this,!0):(this._formatted||(this._formatted=T(this,!1)),this._formatted)}toJSON(){let N={$mid:1};return this._fsPath&&(N.fsPath=this._fsPath,N._sep=p),this._formatted&&(N.external=this._formatted),this.path&&(N.path=this.path),this.scheme&&(N.scheme=this.scheme),this.authority&&(N.authority=this.authority),this.query&&(N.query=this.query),this.fragment&&(N.fragment=this.fragment),N}}let g={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function w(P,R,N){let $,I=-1;for(let A=0;A<P.length;A++){let _=P.charCodeAt(A);if(_>=97&&_<=122||_>=65&&_<=90||_>=48&&_<=57||_===45||_===46||_===95||_===126||R&&_===47||N&&_===91||N&&_===93||N&&_===58)I!==-1&&($+=encodeURIComponent(P.substring(I,A)),I=-1),$!==void 0&&($+=P.charAt(A));else{$===void 0&&($=P.substr(0,A));let D=g[_];D!==void 0?(I!==-1&&($+=encodeURIComponent(P.substring(I,A)),I=-1),$+=D):I===-1&&(I=A)}}return I!==-1&&($+=encodeURIComponent(P.substring(I))),$!==void 0?$:P}function x(P){let R;for(let N=0;N<P.length;N++){let $=P.charCodeAt(N);$===35||$===63?(R===void 0&&(R=P.substr(0,N)),R+=g[$]):R!==void 0&&(R+=P[N])}return R!==void 0?R:P}function y(P,R){let N;return N=P.authority&&P.path.length>1&&P.scheme==="file"?`//${P.authority}${P.path}`:P.path.charCodeAt(0)===47&&(P.path.charCodeAt(1)>=65&&P.path.charCodeAt(1)<=90||P.path.charCodeAt(1)>=97&&P.path.charCodeAt(1)<=122)&&P.path.charCodeAt(2)===58?R?P.path.substr(1):P.path[1].toLowerCase()+P.path.substr(2):P.path,i&&(N=N.replace(/\//g,"\\")),N}function T(P,R){let N=R?x:w,$="",{scheme:I,authority:A,path:_,query:D,fragment:L}=P;if(I&&($+=I,$+=":"),(A||I==="file")&&($+=u,$+=u),A){let B=A.indexOf("@");if(B!==-1){let z=A.substr(0,B);A=A.substr(B+1),B=z.lastIndexOf(":"),B===-1?$+=N(z,!1,!1):($+=N(z.substr(0,B),!1,!1),$+=":",$+=N(z.substr(B+1),!1,!0)),$+="@"}A=A.toLowerCase(),B=A.lastIndexOf(":"),B===-1?$+=N(A,!1,!0):($+=N(A.substr(0,B),!1,!0),$+=A.substr(B))}if(_){if(_.length>=3&&_.charCodeAt(0)===47&&_.charCodeAt(2)===58){let B=_.charCodeAt(1);B>=65&&B<=90&&(_=`/${String.fromCharCode(B+32)}:${_.substr(3)}`)}else if(_.length>=2&&_.charCodeAt(1)===58){let B=_.charCodeAt(0);B>=65&&B<=90&&(_=`${String.fromCharCode(B+32)}:${_.substr(2)}`)}$+=N(_,!0,!1)}return D&&($+="?",$+=N(D,!1,!1)),L&&($+="#",$+=R?L:w(L,!1,!1)),$}function E(P){try{return decodeURIComponent(P)}catch{return P.length>3?P.substr(0,3)+E(P.substr(3)):P}}let v=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function S(P){return P.match(v)?P.replace(v,(R=>E(R))):P}var F=n(975);let C=F.posix||F,W="/";var j;(function(P){P.joinPath=function(R,...N){return R.with({path:C.join(R.path,...N)})},P.resolvePath=function(R,...N){let $=R.path,I=!1;$[0]!==W&&($=W+$,I=!0);let A=C.resolve($,...N);return I&&A[0]===W&&!R.authority&&(A=A.substring(1)),R.with({path:A})},P.dirname=function(R){if(R.path.length===0||R.path===W)return R;let N=C.dirname(R.path);return N.length===1&&N.charCodeAt(0)===46&&(N=""),R.with({path:N})},P.basename=function(R){return C.basename(R.path)},P.extname=function(R){return C.extname(R.path)}})(j||(j={})),G_=r})();var{URI:Oe,Utils:Do}=G_;var et;(function(e){e.basename=Do.basename,e.dirname=Do.dirname,e.extname=Do.extname,e.joinPath=Do.joinPath,e.resolvePath=Do.resolvePath;let t=typeof process=="object"&&process?.platform==="win32";function n(s,a){return s?.toString()===a?.toString()}e.equals=n;function r(s,a){let l=typeof s=="string"?Oe.parse(s).path:s.path,c=typeof a=="string"?Oe.parse(a).path:a.path,u=l.split("/").filter(g=>g.length>0),f=c.split("/").filter(g=>g.length>0);if(t){let g=/^[A-Z]:$/;if(u[0]&&g.test(u[0])&&(u[0]=u[0].toLowerCase()),f[0]&&g.test(f[0])&&(f[0]=f[0].toLowerCase()),u[0]!==f[0])return c.substring(1)}let d=0;for(;d<u.length&&u[d]===f[d];d++);let p="../".repeat(u.length-d),m=f.slice(d).join("/");return p+m}e.relative=r;function i(s){return Oe.parse(s.toString()).toString()}e.normalize=i;function o(s,a){let l=typeof s=="string"?Oe.parse(s):s,c=typeof a=="string"?Oe.parse(a):a;if(l.scheme!==c.scheme)return!1;let u=l.path,f=c.path;return f.charAt(f.length-1)==="/"&&(f=f.slice(0,-1)),u.charAt(u.length-1)==="/"&&(u=u.slice(0,-1)),f===u?!0:f.length<u.length||f.charAt(u.length)!=="/"?!1:f.startsWith(u)}e.contains=o})(et||(et={}));var Xu=class{constructor(){this.root={name:"",children:new Map}}normalizeUri(t){return et.normalize(t)}clear(){this.root.children.clear()}insert(t,n){let r=this.getNode(this.normalizeUri(t),!0);r.element=n}delete(t){let n=this.getNode(this.normalizeUri(t),!1);n?.parent&&n.parent.children.delete(n.name)}has(t){return this.getNode(this.normalizeUri(t),!1)?.element!==void 0}hasNode(t){return this.getNode(this.normalizeUri(t),!1)!==void 0}find(t){return this.getNode(this.normalizeUri(t),!1)?.element}findNode(t){let n=this.normalizeUri(t),r=this.getNode(n,!1);if(r)return{name:r.name,uri:et.joinPath(Oe.parse(n),r.name).toString(),element:r.element}}findChildren(t){let n=this.normalizeUri(t),r=this.getNode(n,!1);return r?Array.from(r.children.values()).map(i=>({name:i.name,uri:et.joinPath(Oe.parse(n),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(t){let n=this.getNode(this.normalizeUri(t),!1);return n?this.collectValues(n):[]}getNode(t,n){let r=t.split("/");t.charAt(t.length-1)==="/"&&r.pop();let i=this.root;for(let o of r){let s=i.children.get(o);if(!s)if(n)s={name:o,children:new Map,parent:i},i.children.set(o,s);else return;i=s}return i}collectValues(t){let n=[];t.element&&n.push(t.element);for(let r of t.children.values())n.push(...this.collectValues(r));return n}};var ue;(function(e){e[e.Changed=0]="Changed",e[e.Parsed=1]="Parsed",e[e.IndexedContent=2]="IndexedContent",e[e.ComputedScopes=3]="ComputedScopes",e[e.Linked=4]="Linked",e[e.IndexedReferences=5]="IndexedReferences",e[e.Validated=6]="Validated"})(ue||(ue={}));var Uu=class{constructor(t){this.serviceRegistry=t.ServiceRegistry,this.textDocuments=t.workspace.TextDocuments,this.fileSystemProvider=t.workspace.FileSystemProvider}async fromUri(t,n=ce.CancellationToken.None){let r=await this.getInitialText(t,n);return this.createAsync(t,r,n)}async getInitialText(t,n){return this.fileSystemProvider.readFile(t)}fromTextDocument(t,n,r){return n=n??Oe.parse(t.uri),ce.CancellationToken.is(r)?this.createAsync(n,t,r):this.create(n,t,r)}fromString(t,n,r){return ce.CancellationToken.is(r)?this.createAsync(n,t,r):this.create(n,t,r)}fromModel(t,n){return this.create(n,{$model:t})}create(t,n,r){if(typeof n=="string"){let i=this.parse(t,n,r);return this.createLangiumDocument(i,t,void 0,n)}else if("$model"in n){let i={value:n.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,t)}else{let i=this.parse(t,n.getText(),r);return this.createLangiumDocument(i,t,n)}}async createAsync(t,n,r){if(typeof n=="string"){let i=await this.parseAsync(t,n,r);return this.createLangiumDocument(i,t,void 0,n)}else{let i=await this.parseAsync(t,n.getText(),r);return this.createLangiumDocument(i,t,n)}}createLangiumDocument(t,n,r,i){let o;if(r)o={parseResult:t,uri:n,state:ue.Parsed,references:[],textDocument:r};else{let s=this.createTextDocumentGetter(n,i);o={parseResult:t,uri:n,state:ue.Parsed,references:[],get textDocument(){return s()}}}return t.value.$document=o,o}async update(t,n){let r=t.parseResult.value.$cstNode?.root.fullText,i=this.textDocuments?.get(t.uri.toString()),o=await this.getUpdatedText(t,i,n);if(i)Object.defineProperty(t,"textDocument",{value:i});else{let s=this.createTextDocumentGetter(t.uri,o);Object.defineProperty(t,"textDocument",{get:s})}return r!==o&&(t.parseResult=await this.parseAsync(t.uri,o,n),t.parseResult.value.$document=t),t.state=ue.Parsed,t}async getUpdatedText(t,n,r){return n?n.getText():await this.fileSystemProvider.readFile(t.uri)}parse(t,n,r){return this.serviceRegistry.getServices(t).parser.LangiumParser.parse(n,r)}parseAsync(t,n,r){return this.serviceRegistry.getServices(t).parser.AsyncParser.parse(n,r)}createTextDocumentGetter(t,n){let r=this.serviceRegistry,i;return()=>i??(i=La.create(t.toString(),r.getServices(t).LanguageMetaData.languageId,0,n??""))}},Gu=class{constructor(t){this.documentTrie=new Xu,this.services=t,this.langiumDocumentFactory=t.workspace.LangiumDocumentFactory,this.documentBuilder=()=>t.workspace.DocumentBuilder}get all(){return ye(this.documentTrie.all())}addDocument(t){let n=t.uri.toString();if(this.documentTrie.has(n))throw new Error(`A document with the URI '${n}' is already present.`);this.documentTrie.insert(n,t)}getDocument(t){let n=t.toString();return this.documentTrie.find(n)}getDocuments(t){let n=t.toString();return this.documentTrie.findAll(n)}async getOrCreateDocument(t,n){let r=this.getDocument(t);return r||(r=await this.langiumDocumentFactory.fromUri(t,n),this.addDocument(r),r)}createDocument(t,n,r){if(r)return this.langiumDocumentFactory.fromString(n,t,r).then(i=>(this.addDocument(i),i));{let i=this.langiumDocumentFactory.fromString(n,t);return this.addDocument(i),i}}hasDocument(t){return this.documentTrie.has(t.toString())}invalidateDocument(t){let n=t.toString(),r=this.documentTrie.find(n);return r&&this.documentBuilder().resetToState(r,ue.Changed),r}deleteDocument(t){let n=t.toString(),r=this.documentTrie.find(n);return r&&(r.state=ue.Changed,this.documentTrie.delete(n)),r}deleteDocuments(t){let n=t.toString(),r=this.documentTrie.findAll(n);for(let i of r)i.state=ue.Changed;return this.documentTrie.delete(n),r}};var Mo=Symbol("RefResolving"),zm=class{constructor(t,n,r,i,o){this.resolver=t,this.node=n,this.property=r,this._ref=void 0,this.$refNode=i,this.$refText=o}get ref(){return this.resolver.resolveReference(this,this.node,this.property)}get $nodeDescription(){return this._nodeDescription}get error(){return Gi(this._ref)?this._ref:void 0}},jm=class{constructor(t,n,r,i,o){this.resolver=t,this.node=n,this.property=r,this._items=void 0,this.$refNode=i,this.$refText=o}get items(){return this.resolver.resolveMultiReference(this,this.node,this.property)}get error(){return this._linkingError}},Hu=class{constructor(t){this.reflection=t.shared.AstReflection,this.langiumDocuments=()=>t.shared.workspace.LangiumDocuments,this.scopeProvider=t.references.ScopeProvider,this.astNodeLocator=t.workspace.AstNodeLocator,this.profiler=t.shared.profilers.LangiumProfiler,this.languageId=t.LanguageMetaData.languageId,this.referenceResolver={resolveReference:this.resolveReference.bind(this),resolveMultiReference:this.resolveMultiReference.bind(this)}}async link(t,n=ce.CancellationToken.None){if(this.profiler?.isActive("linking")){let r=this.profiler.createTask("linking",this.languageId);r.start();try{for(let i of yt(t.parseResult.value))await Ge(n),Gr(i).forEach(o=>{let s=`${i.$type}:${o.property}`;r.startSubTask(s);try{this.doLink(o,t)}finally{r.stopSubTask(s)}})}finally{r.stop()}}else for(let r of yt(t.parseResult.value))await Ge(n),Gr(r).forEach(i=>this.doLink(i,t))}doLink(t,n){let r=t.reference;if("_ref"in r&&r._ref===void 0){r._ref=Mo;try{let i=this.getCandidate(t);if(Gi(i))r._ref=i;else{r._nodeDescription=i;let o=this.loadAstNode(i);r._ref=o??this.createLinkingError(t,i)}}catch(i){console.error(`An error occurred while resolving reference to '${r.$refText}':`,i);let o=i.message??String(i);r._ref={info:t,message:`An error occurred while resolving reference to '${r.$refText}': ${o}`}}n.references.push(r)}else if("_items"in r&&r._items===void 0){r._items=Mo;try{let i=this.getCandidates(t),o=[];if(Gi(i))r._linkingError=i;else for(let s of i){let a=this.loadAstNode(s);a&&o.push({ref:a,$nodeDescription:s})}r._items=o}catch(i){r._linkingError={info:t,message:`An error occurred while resolving reference to '${r.$refText}': ${i}`},r._items=[]}n.references.push(r)}}unlink(t){for(let n of t.references)"_ref"in n?(n._ref=void 0,delete n._nodeDescription):"_items"in n&&(n._items=void 0,delete n._linkingError);t.references=[]}getCandidate(t){return this.scopeProvider.getScope(t).getElement(t.reference.$refText)??this.createLinkingError(t)}getCandidates(t){let r=this.scopeProvider.getScope(t).getElements(t.reference.$refText).distinct(i=>`${i.documentUri}#${i.path}`).toArray();return r.length>0?r:this.createLinkingError(t)}buildReference(t,n,r,i){return new zm(this.referenceResolver,t,n,r,i)}buildMultiReference(t,n,r,i){return new jm(this.referenceResolver,t,n,r,i)}resolveReference(t,n,r){if(Ue(t._ref))return t._ref;if(fE(t._nodeDescription)){let i=this.loadAstNode(t._nodeDescription);t._ref=i??this.createLinkingError({reference:t,container:n,property:r},t._nodeDescription)}else if(t._ref===void 0){t._ref=Mo;let i=Ws(n).$document,o=this.getLinkedNode({reference:t,container:n,property:r});if(o.error&&i&&i.state<ue.ComputedScopes)return t._ref=void 0;t._ref=o.node??o.error,t._nodeDescription=o.descr,i?.references.push(t)}else t._ref===Mo&&this.throwCyclicReferenceError(n,r,t.$refText);return Ue(t._ref)?t._ref:void 0}resolveMultiReference(t,n,r){if(Array.isArray(t._items))return t._items;if(t._items===void 0){t._items=Mo;let i=Ws(n).$document,o=this.getCandidates({reference:t,container:n,property:r}),s=[];if(Gi(o))t._linkingError=o;else{for(let a of o){let l=this.loadAstNode(a);l&&s.push({ref:l,$nodeDescription:a})}s.length===0&&(t._linkingError=this.createLinkingError({reference:t,container:n,property:r}))}t._items=s,i?.references.push(t)}else t._items===Mo&&this.throwCyclicReferenceError(n,r,t.$refText);return Array.isArray(t._items)?t._items:[]}throwCyclicReferenceError(t,n,r){throw new Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(t)}/${n} (symbol '${r}')`)}getLinkedNode(t){try{let n=this.getCandidate(t);if(Gi(n))return{error:n};let r=this.loadAstNode(n);return r?{node:r,descr:n}:{descr:n,error:this.createLinkingError(t,n)}}catch(n){console.error(`An error occurred while resolving reference to '${t.reference.$refText}':`,n);let r=n.message??String(n);return{error:{info:t,message:`An error occurred while resolving reference to '${t.reference.$refText}': ${r}`}}}}loadAstNode(t){if(t.node)return t.node;let n=this.langiumDocuments().getDocument(t.documentUri);if(n)return this.astNodeLocator.getAstNode(n.parseResult.value,t.path)}createLinkingError(t,n){let r=Ws(t.container).$document;r&&r.state<ue.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${r.uri}).`);let i=this.reflection.getReferenceType(t);return{info:t,message:`Could not resolve reference to ${i} named '${t.reference.$refText}'.`,targetDescription:n}}};function vM(e){return typeof e.name=="string"}var zu=class{getName(t){if(vM(t))return t.name}getNameNode(t){return na(t.$cstNode,"name")}};var ju=class{constructor(t){this.nameProvider=t.references.NameProvider,this.index=t.shared.workspace.IndexManager,this.nodeLocator=t.workspace.AstNodeLocator,this.documents=t.shared.workspace.LangiumDocuments,this.hasMultiReference=yt(t.Grammar).some(n=>an(n)&&n.isMulti)}findDeclarations(t){if(t){let n=mh(t),r=t.astNode;if(n&&r){let i=r[n.feature];if(it(i)||Ct(i))return Up(i);if(Array.isArray(i)){for(let o of i)if((it(o)||Ct(o))&&o.$refNode&&o.$refNode.offset<=t.offset&&o.$refNode.end>=t.end)return Up(o)}}if(r){let i=this.nameProvider.getNameNode(r);if(i&&(i===t||WE(t,i)))return this.getSelfNodes(r)}}return[]}getSelfNodes(t){if(this.hasMultiReference){let n=this.index.findAllReferences(t,this.nodeLocator.getAstNodePath(t)),r=this.getNodeFromReferenceDescription(n.head());if(r){for(let i of Gr(r))if(Ct(i.reference)&&i.reference.items.some(o=>o.ref===t))return i.reference.items.map(o=>o.ref)}return[t]}else return[t]}getNodeFromReferenceDescription(t){if(!t)return;let n=this.documents.getDocument(t.sourceUri);if(n)return this.nodeLocator.getAstNode(n.parseResult.value,t.sourcePath)}findDeclarationNodes(t){let n=this.findDeclarations(t),r=[];for(let i of n){let o=this.nameProvider.getNameNode(i)??i.$cstNode;o&&r.push(o)}return r}findReferences(t,n){let r=[];n.includeDeclaration&&r.push(...this.getSelfReferences(t));let i=this.index.findAllReferences(t,this.nodeLocator.getAstNodePath(t));return n.documentUri&&(i=i.filter(o=>et.equals(o.sourceUri,n.documentUri))),r.push(...i),ye(r)}getSelfReferences(t){let n=this.getSelfNodes(t),r=[];for(let i of n){let o=this.nameProvider.getNameNode(i);if(o){let s=at(i),a=this.nodeLocator.getAstNodePath(i);r.push({sourceUri:s.uri,sourcePath:a,targetUri:s.uri,targetPath:a,segment:eo(o),local:!0})}}return r}};var Kt=class{constructor(t){if(this.map=new Map,t)for(let[n,r]of t)this.add(n,r)}get size(){return Jl.sum(ye(this.map.values()).map(t=>t.length))}clear(){this.map.clear()}delete(t,n){if(n===void 0)return this.map.delete(t);{let r=this.map.get(t);if(r){let i=r.indexOf(n);if(i>=0)return r.length===1?this.map.delete(t):r.splice(i,1),!0}return!1}}get(t){return this.map.get(t)??[]}getStream(t){let n=this.map.get(t);return n?ye(n):Ql}has(t,n){if(n===void 0)return this.map.has(t);{let r=this.map.get(t);return r?r.indexOf(n)>=0:!1}}add(t,n){return this.map.has(t)?this.map.get(t).push(n):this.map.set(t,[n]),this}addAll(t,n){return this.map.has(t)?this.map.get(t).push(...n):this.map.set(t,Array.from(n)),this}forEach(t){this.map.forEach((n,r)=>n.forEach(i=>t(i,r,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return ye(this.map.entries()).flatMap(([t,n])=>n.map(r=>[t,r]))}keys(){return ye(this.map.keys())}values(){return ye(this.map.values()).flat()}entriesGroupedByKey(){return ye(this.map.entries())}},Pa=class{get size(){return this.map.size}constructor(t){if(this.map=new Map,this.inverse=new Map,t)for(let[n,r]of t)this.set(n,r)}clear(){this.map.clear(),this.inverse.clear()}set(t,n){return this.map.set(t,n),this.inverse.set(n,t),this}get(t){return this.map.get(t)}getKey(t){return this.inverse.get(t)}delete(t){let n=this.map.get(t);return n!==void 0?(this.map.delete(t),this.inverse.delete(n),!0):!1}};var Yu=class{constructor(t){this.nameProvider=t.references.NameProvider,this.descriptions=t.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(t,n=ce.CancellationToken.None){return this.collectExportedSymbolsForNode(t.parseResult.value,t,void 0,n)}async collectExportedSymbolsForNode(t,n,r=tc,i=ce.CancellationToken.None){let o=[];this.addExportedSymbol(t,o,n);for(let s of r(t))await Ge(i),this.addExportedSymbol(s,o,n);return o}addExportedSymbol(t,n,r){let i=this.nameProvider.getName(t);i&&n.push(this.descriptions.createDescription(t,i,r))}async collectLocalSymbols(t,n=ce.CancellationToken.None){let r=t.parseResult.value,i=new Kt;for(let o of rn(r))await Ge(n),this.addLocalSymbol(o,t,i);return i}addLocalSymbol(t,n,r){let i=t.$container;if(i){let o=this.nameProvider.getName(t);o&&r.add(i,this.descriptions.createDescription(t,o,n))}}};var Ca=class{constructor(t,n,r){this.elements=t,this.outerScope=n,this.caseInsensitive=r?.caseInsensitive??!1,this.concatOuterScope=r?.concatOuterScope??!0}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(t){let n=this.caseInsensitive?t.toLowerCase():t,r=this.caseInsensitive?this.elements.find(i=>i.name.toLowerCase()===n):this.elements.find(i=>i.name===t);if(r)return r;if(this.outerScope)return this.outerScope.getElement(t)}getElements(t){let n=this.caseInsensitive?t.toLowerCase():t,r=this.caseInsensitive?this.elements.filter(i=>i.name.toLowerCase()===n):this.elements.filter(i=>i.name===t);return(this.concatOuterScope||r.isEmpty())&&this.outerScope?r.concat(this.outerScope.getElements(t)):r}};var Vu=class{constructor(t,n,r){this.elements=new Kt,this.caseInsensitive=r?.caseInsensitive??!1,this.concatOuterScope=r?.concatOuterScope??!0;for(let i of t){let o=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.add(o,i)}this.outerScope=n}getElement(t){let n=this.caseInsensitive?t.toLowerCase():t,r=this.elements.get(n)[0];if(r)return r;if(this.outerScope)return this.outerScope.getElement(t)}getElements(t){let n=this.caseInsensitive?t.toLowerCase():t,r=this.elements.get(n);return(this.concatOuterScope||r.length===0)&&this.outerScope?ye(r).concat(this.outerScope.getElements(t)):ye(r)}getAllElements(){let t=ye(this.elements.values());return this.outerScope&&(t=t.concat(this.outerScope.getAllElements())),t}};var Ku=class{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(t){this.toDispose.push(t)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(t=>t.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}},Ym=class extends Ku{constructor(){super(...arguments),this.cache=new Map}has(t){return this.throwIfDisposed(),this.cache.has(t)}set(t,n){this.throwIfDisposed(),this.cache.set(t,n)}get(t,n){if(this.throwIfDisposed(),this.cache.has(t))return this.cache.get(t);if(n){let r=n();return this.cache.set(t,r),r}else return}delete(t){return this.throwIfDisposed(),this.cache.delete(t)}clear(){this.throwIfDisposed(),this.cache.clear()}},qu=class extends Ku{constructor(t){super(),this.cache=new Map,this.converter=t??(n=>n)}has(t,n){return this.throwIfDisposed(),this.cacheForContext(t).has(n)}set(t,n,r){this.throwIfDisposed(),this.cacheForContext(t).set(n,r)}get(t,n,r){this.throwIfDisposed();let i=this.cacheForContext(t);if(i.has(n))return i.get(n);if(r){let o=r();return i.set(n,o),o}else return}delete(t,n){return this.throwIfDisposed(),this.cacheForContext(t).delete(n)}clear(t){if(this.throwIfDisposed(),t){let n=this.converter(t);this.cache.delete(n)}else this.cache.clear()}cacheForContext(t){let n=this.converter(t),r=this.cache.get(n);return r||(r=new Map,this.cache.set(n,r)),r}};var Zu=class extends Ym{constructor(t,n){super(),n?(this.toDispose.push(t.workspace.DocumentBuilder.onBuildPhase(n,()=>{this.clear()})),this.toDispose.push(t.workspace.DocumentBuilder.onUpdate((r,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(t.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}};var Ju=class{constructor(t){this.reflection=t.shared.AstReflection,this.nameProvider=t.references.NameProvider,this.descriptions=t.workspace.AstNodeDescriptionProvider,this.indexManager=t.shared.workspace.IndexManager,this.globalScopeCache=new Zu(t.shared)}getScope(t){let n=[],r=this.reflection.getReferenceType(t),i=at(t.container).localSymbols;if(i){let s=t.container;do i.has(s)&&n.push(i.getStream(s).filter(a=>this.reflection.isSubtype(a.type,r))),s=s.$container;while(s)}let o=this.getGlobalScope(r,t);for(let s=n.length-1;s>=0;s--)o=this.createScope(n[s],o);return o}createScope(t,n,r){return new Ca(ye(t),n,r)}createScopeForNodes(t,n,r){let i=ye(t).map(o=>{let s=this.nameProvider.getName(o);if(s)return this.descriptions.createDescription(o,s)}).nonNullable();return new Ca(i,n,r)}getGlobalScope(t,n){return this.globalScopeCache.get(t,()=>new Vu(this.indexManager.allElements(t)))}};function z_(e){return typeof e.$comment=="string"}function H_(e){return typeof e=="object"&&!!e&&("$ref"in e||"$refs"in e||"$error"in e)}var Qu=class{constructor(t){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=t.shared.workspace.LangiumDocuments,this.astNodeLocator=t.workspace.AstNodeLocator,this.nameProvider=t.references.NameProvider,this.commentProvider=t.documentation.CommentProvider}serialize(t,n){let r=n??{},i=n?.replacer,o=(a,l)=>this.replacer(a,l,r),s=i?(a,l)=>i(a,l,o):o;try{return this.currentDocument=at(t),JSON.stringify(t,s,n?.space)}finally{this.currentDocument=void 0}}deserialize(t,n){let r=n??{},i=JSON.parse(t);return this.linkNode(i,i,r),i}replacer(t,n,{refText:r,sourceText:i,textRegions:o,comments:s,uriConverter:a}){if(!this.ignoreProperties.has(t))if(it(n)){let l=n.ref,c=r?n.$refText:void 0;if(l){let u=at(l),f="";this.currentDocument&&this.currentDocument!==u&&(a?f=a(u.uri,l):f=u.uri.toString());let d=this.astNodeLocator.getAstNodePath(l);return{$ref:`${f}#${d}`,$refText:c}}else return{$error:n.error?.message??"Could not resolve reference",$refText:c}}else if(Ct(n)){let l=r?n.$refText:void 0,c=[];for(let u of n.items){let f=u.ref,d=at(u.ref),p="";this.currentDocument&&this.currentDocument!==d&&(a?p=a(d.uri,f):p=d.uri.toString());let m=this.astNodeLocator.getAstNodePath(f);c.push(`${p}#${m}`)}return{$refs:c,$refText:l}}else if(Ue(n)){let l;if(o&&(l=this.addAstNodeRegionWithAssignmentsTo({...n}),(!t||n.$document)&&l?.$textRegion&&(l.$textRegion.documentURI=this.currentDocument?.uri.toString())),i&&!t&&(l??(l={...n}),l.$sourceText=n.$cstNode?.text),s){l??(l={...n});let c=this.commentProvider.getComment(n);c&&(l.$comment=c.replace(/\r/g,""))}return l??n}else return n}addAstNodeRegionWithAssignmentsTo(t){let n=r=>({offset:r.offset,end:r.end,length:r.length,range:r.range});if(t.$cstNode){let r=t.$textRegion=n(t.$cstNode),i=r.assignments={};return Object.keys(t).filter(o=>!o.startsWith("$")).forEach(o=>{let s=fh(t.$cstNode,o).map(n);s.length!==0&&(i[o]=s)}),t}}linkNode(t,n,r,i,o,s){for(let[l,c]of Object.entries(t))if(Array.isArray(c))for(let u=0;u<c.length;u++){let f=c[u];H_(f)?c[u]=this.reviveReference(t,l,n,f,r):Ue(f)&&this.linkNode(f,n,r,t,l,u)}else H_(c)?t[l]=this.reviveReference(t,l,n,c,r):Ue(c)&&this.linkNode(c,n,r,t,l);let a=t;a.$container=i,a.$containerProperty=o,a.$containerIndex=s}reviveReference(t,n,r,i,o){let s=i.$refText,a=i.$error,l;if(i.$ref){let c=this.getRefNode(r,i.$ref,o.uriConverter);if(Ue(c))return s||(s=this.nameProvider.getName(c)),{$refText:s??"",ref:c};a=c}else if(i.$refs){let c=[];for(let u of i.$refs){let f=this.getRefNode(r,u,o.uriConverter);Ue(f)&&c.push({ref:f})}if(c.length===0)l={$refText:s??"",items:c},a??(a="Could not resolve multi-reference");else return{$refText:s??"",items:c}}if(a)return l??(l={$refText:s??"",ref:void 0}),l.error={info:{container:t,property:n,reference:l},message:a},l}getRefNode(t,n,r){try{let i=n.indexOf("#");if(i===0){let l=this.astNodeLocator.getAstNode(t,n.substring(1));return l||"Could not resolve path: "+n}if(i<0){let l=r?r(n):Oe.parse(n),c=this.langiumDocuments.getDocument(l);return c?c.parseResult.value:"Could not find document for URI: "+n}let o=r?r(n.substring(0,i)):Oe.parse(n.substring(0,i)),s=this.langiumDocuments.getDocument(o);if(!s)return"Could not find document for URI: "+n;if(i===n.length-1)return s.parseResult.value;let a=this.astNodeLocator.getAstNode(s.parseResult.value,n.substring(i+1));return a||"Could not resolve URI: "+n}catch(i){return String(i)}}};var ef=class{get map(){return this.fileExtensionMap}constructor(t){this.languageIdMap=new Map,this.fileExtensionMap=new Map,this.fileNameMap=new Map,this.textDocuments=t?.workspace.TextDocuments}register(t){let n=t.LanguageMetaData;for(let r of n.fileExtensions)this.fileExtensionMap.has(r)&&console.warn(`The file extension ${r} is used by multiple languages. It is now assigned to '${n.languageId}'.`),this.fileExtensionMap.set(r,t);if(n.fileNames)for(let r of n.fileNames)this.fileNameMap.has(r)&&console.warn(`The file name ${r} is used by multiple languages. It is now assigned to '${n.languageId}'.`),this.fileNameMap.set(r,t);this.languageIdMap.set(n.languageId,t)}getServices(t){if(this.languageIdMap.size===0)throw new Error("The service registry is empty. Use `register` to register the services of a language.");let n=this.textDocuments?.get(t)?.languageId;if(n!==void 0){let s=this.languageIdMap.get(n);if(s)return s}let r=et.extname(t),i=et.basename(t),o=this.fileNameMap.get(i)??this.fileExtensionMap.get(r);if(!o)throw n?new Error(`The service registry contains no services for the extension '${r}' for language '${n}'.`):new Error(`The service registry contains no services for the extension '${r}'.`);return o}hasServices(t){try{return this.getServices(t),!0}catch{return!1}}get all(){return Array.from(this.languageIdMap.values())}};function Fo(e){return{code:e}}var Vm;(function(e){e.defaults=["fast","slow","built-in"],e.all=e.defaults})(Vm||(Vm={}));var tf=class{constructor(t){this.entries=new Kt,this.knownCategories=new Set(Vm.defaults),this.entriesBefore=[],this.entriesAfter=[],this.reflection=t.shared.AstReflection}register(t,n=this,r="fast"){if(r==="built-in")throw new Error("The 'built-in' category is reserved for lexer, parser, and linker errors.");this.knownCategories.add(r);for(let[i,o]of Object.entries(t)){let s=o;if(Array.isArray(s))for(let a of s){let l={check:this.wrapValidationException(a,n),category:r};this.addEntry(i,l)}else if(typeof s=="function"){let a={check:this.wrapValidationException(s,n),category:r};this.addEntry(i,a)}else rr(s)}}wrapValidationException(t,n){return async(r,i,o)=>{await this.handleException(()=>t.call(n,r,i,o),"An error occurred during validation",i,r)}}async handleException(t,n,r,i){try{await t()}catch(o){if(Ar(o))throw o;console.error(`${n}:`,o),o instanceof Error&&o.stack&&console.error(o.stack);let s=o instanceof Error?o.message:String(o);r("error",`${n}: ${s}`,{node:i})}}addEntry(t,n){if(t==="AstNode"){this.entries.add("AstNode",n);return}for(let r of this.reflection.getAllSubTypes(t))this.entries.add(r,n)}getChecks(t,n){let r=ye(this.entries.get(t)).concat(this.entries.get("AstNode"));return n&&(r=r.filter(i=>n.includes(i.category))),r.map(i=>i.check)}registerBeforeDocument(t,n=this){this.entriesBefore.push(this.wrapPreparationException(t,"An error occurred during set-up of the validation",n))}registerAfterDocument(t,n=this){this.entriesAfter.push(this.wrapPreparationException(t,"An error occurred during tear-down of the validation",n))}wrapPreparationException(t,n,r){return async(i,o,s,a)=>{await this.handleException(()=>t.call(r,i,o,s,a),n,o,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(t){return this.knownCategories}};var _M=Object.freeze({validateNode:!0,validateChildren:!0}),nf=class{constructor(t){this.validationRegistry=t.validation.ValidationRegistry,this.metadata=t.LanguageMetaData,this.profiler=t.shared.profilers.LangiumProfiler,this.languageId=t.LanguageMetaData.languageId}async validateDocument(t,n={},r=ce.CancellationToken.None){let i=t.parseResult,o=[];if(await Ge(r),(!n.categories||n.categories.includes("built-in"))&&(this.processLexingErrors(i,o,n),n.stopAfterLexingErrors&&o.some(s=>s.data?.code===qt.LexingError)||(this.processParsingErrors(i,o,n),n.stopAfterParsingErrors&&o.some(s=>s.data?.code===qt.ParsingError))||(this.processLinkingErrors(t,o,n),n.stopAfterLinkingErrors&&o.some(s=>s.data?.code===qt.LinkingError))))return o;try{o.push(...await this.validateAst(i.value,n,r))}catch(s){if(Ar(s))throw s;console.error("An error occurred during validation:",s)}return await Ge(r),o}processLexingErrors(t,n,r){let i=[...t.lexerErrors,...t.lexerReport?.diagnostics??[]];for(let o of i){let s=o.severity??"error",a={severity:Km(s),range:{start:{line:o.line-1,character:o.column-1},end:{line:o.line-1,character:o.column+o.length-1}},message:o.message,data:AM(s),source:this.getSource()};n.push(a)}}processParsingErrors(t,n,r){for(let i of t.parserErrors){let o;if(qs(i.token))o=XE(i.token);else if("previousToken"in i){let s=i.previousToken;if(qs(s)){let a={line:s.endLine-1,character:s.endColumn};o={start:a,end:a}}else{let a={line:0,character:0};o={start:a,end:a}}}if(o){let s={severity:Km("error"),range:o,message:i.message,data:Fo(qt.ParsingError),source:this.getSource()};n.push(s)}}}processLinkingErrors(t,n,r){for(let i of t.references){let o=i.error;if(o){let s={node:o.info.container,range:i.$refNode?.range,property:o.info.property,index:o.info.index,data:{code:qt.LinkingError,containerType:o.info.container.$type,property:o.info.property,refText:o.info.reference.$refText}};n.push(this.toDiagnostic("error",o.message,s))}}}async validateAst(t,n,r=ce.CancellationToken.None){let i=[],o=(s,a,l)=>{i.push(this.toDiagnostic(s,a,l))};return await this.validateAstBefore(t,n,o,r),await this.validateAstNodes(t,n,o,r),await this.validateAstAfter(t,n,o,r),i}async validateAstBefore(t,n,r,i=ce.CancellationToken.None){let o=this.validationRegistry.checksBefore;for(let s of o)await Ge(i),await s(t,r,n.categories??[],i)}async validateAstNodes(t,n,r,i=ce.CancellationToken.None){if(this.profiler?.isActive("validating")){let o=this.profiler.createTask("validating",this.languageId);o.start();try{let s=yt(t).iterator();for(let a of s){o.startSubTask(a.$type);let l=this.validateSingleNodeOptions(a,n);if(l.validateNode)try{let c=this.validationRegistry.getChecks(a.$type,n.categories);for(let u of c)await u(a,r,i)}finally{o.stopSubTask(a.$type)}l.validateChildren||s.prune()}}finally{o.stop()}}else{let o=yt(t).iterator();for(let s of o){await Ge(i);let a=this.validateSingleNodeOptions(s,n);if(a.validateNode){let l=this.validationRegistry.getChecks(s.$type,n.categories);for(let c of l)await c(s,r,i)}a.validateChildren||o.prune()}}}validateSingleNodeOptions(t,n){return _M}async validateAstAfter(t,n,r,i=ce.CancellationToken.None){let o=this.validationRegistry.checksAfter;for(let s of o)await Ge(i),await s(t,r,n.categories??[],i)}toDiagnostic(t,n,r){return{message:n,range:qm(r),severity:Km(t),code:r.code,codeDescription:r.codeDescription,tags:r.tags,relatedInformation:r.relatedInformation,data:r.data,source:this.getSource()}}getSource(){return this.metadata.languageId}};function qm(e){if(e.range)return e.range;let t;return typeof e.property=="string"?t=na(e.node.$cstNode,e.property,e.index):typeof e.keyword=="string"&&(t=ph(e.node.$cstNode,e.keyword,e.index)),t??(t=e.node.$cstNode),t?t.range:{start:{line:0,character:0},end:{line:0,character:0}}}function Km(e){switch(e){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+e)}}function AM(e){switch(e){case"error":return Fo(qt.LexingError);case"warning":return Fo(qt.LexingWarning);case"info":return Fo(qt.LexingInfo);case"hint":return Fo(qt.LexingHint);default:throw new Error("Invalid diagnostic severity: "+e)}}var qt;(function(e){e.LexingError="lexing-error",e.LexingWarning="lexing-warning",e.LexingInfo="lexing-info",e.LexingHint="lexing-hint",e.ParsingError="parsing-error",e.LinkingError="linking-error"})(qt||(qt={}));var rf=class{constructor(t){this.astNodeLocator=t.workspace.AstNodeLocator,this.nameProvider=t.references.NameProvider}createDescription(t,n,r){let i=r??at(t);n??(n=this.nameProvider.getName(t));let o=this.astNodeLocator.getAstNodePath(t);if(!n)throw new Error(`Node at path ${o} has no name.`);let s,a=()=>s??(s=eo(this.nameProvider.getNameNode(t)??t.$cstNode));return{node:t,name:n,get nameSegment(){return a()},selectionSegment:eo(t.$cstNode),type:t.$type,documentUri:i.uri,path:o}}},of=class{constructor(t){this.nodeLocator=t.workspace.AstNodeLocator}async createDescriptions(t,n=ce.CancellationToken.None){let r=[],i=t.parseResult.value;for(let o of yt(i))await Ge(n),Gr(o).forEach(s=>{s.reference.error||r.push(...this.createInfoDescriptions(s))});return r}createInfoDescriptions(t){let n=t.reference;if(n.error||!n.$refNode)return[];let r=[];it(n)&&n.$nodeDescription?r=[n.$nodeDescription]:Ct(n)&&(r=n.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));let i=at(t.container).uri,o=this.nodeLocator.getAstNodePath(t.container),s=[],a=eo(n.$refNode);for(let l of r)s.push({sourceUri:i,sourcePath:o,targetUri:l.documentUri,targetPath:l.path,segment:a,local:et.equals(l.documentUri,i)});return s}};var sf=class{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(t){if(t.$container){let n=this.getAstNodePath(t.$container),r=this.getPathSegment(t);return n+this.segmentSeparator+r}return""}getPathSegment({$containerProperty:t,$containerIndex:n}){if(!t)throw new Error("Missing '$containerProperty' in AST node.");return n!==void 0?t+this.indexSeparator+n:t}getAstNode(t,n){return n.split(this.segmentSeparator).reduce((i,o)=>{if(!i||o.length===0)return i;let s=o.indexOf(this.indexSeparator);if(s>0){let a=o.substring(0,s),l=parseInt(o.substring(s+1));return i[a]?.[l]}return i[o]},t)}};var af=class{constructor(t){this._ready=new _r,this.onConfigurationSectionUpdateEmitter=new Mu.Emitter,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=t.ServiceRegistry}get ready(){return this._ready.promise}initialize(t){this.workspaceConfig=t.capabilities.workspace?.configuration??!1}async initialized(t){if(this.workspaceConfig){if(t.register){let n=this.serviceRegistry.all;t.register({section:n.map(r=>this.toSectionName(r.LanguageMetaData.languageId))})}if(t.fetchConfiguration){let n=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),r=await t.fetchConfiguration(n);n.forEach((i,o)=>{this.updateSectionConfiguration(i.section,r[o])})}}this._ready.resolve()}updateConfiguration(t){typeof t.settings!="object"||t.settings===null||Object.entries(t.settings).forEach(([n,r])=>{this.updateSectionConfiguration(n,r),this.onConfigurationSectionUpdateEmitter.fire({section:n,configuration:r})})}updateSectionConfiguration(t,n){this.settings[t]=n}async getConfiguration(t,n){await this.ready;let r=this.toSectionName(t);if(this.settings[r])return this.settings[r][n]}toSectionName(t){return`${t}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}};var Bo;(function(e){function t(n){return{dispose:async()=>await n()}}e.create=t})(Bo||(Bo={}));var lf=class{constructor(t){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new Kt,this.documentPhaseListeners=new Kt,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=ue.Changed,this.langiumDocuments=t.workspace.LangiumDocuments,this.langiumDocumentFactory=t.workspace.LangiumDocumentFactory,this.textDocuments=t.workspace.TextDocuments,this.indexManager=t.workspace.IndexManager,this.fileSystemProvider=t.workspace.FileSystemProvider,this.workspaceManager=()=>t.workspace.WorkspaceManager,this.serviceRegistry=t.ServiceRegistry}async build(t,n={},r=ce.CancellationToken.None){for(let i of t){let o=i.uri.toString();if(i.state===ue.Validated){if(typeof n.validation=="boolean"&&n.validation)this.resetToState(i,ue.IndexedReferences);else if(typeof n.validation=="object"){let s=this.findMissingValidationCategories(i,n);s.length>0&&(this.buildState.set(o,{completed:!1,options:{validation:{categories:s}},result:this.buildState.get(o)?.result}),i.state=ue.IndexedReferences)}}else this.buildState.delete(o)}this.currentState=ue.Changed,await this.emitUpdate(t.map(i=>i.uri),[]),await this.buildDocuments(t,n,r)}async update(t,n,r=ce.CancellationToken.None){this.currentState=ue.Changed;let i=[];for(let l of n){let c=this.langiumDocuments.deleteDocuments(l);for(let u of c)i.push(u.uri),this.cleanUpDeleted(u)}let o=(await Promise.all(t.map(l=>this.findChangedUris(l)))).flat();for(let l of o){let c=this.langiumDocuments.getDocument(l);c===void 0&&(c=this.langiumDocumentFactory.fromModel({$type:"INVALID"},l),c.state=ue.Changed,this.langiumDocuments.addDocument(c)),this.resetToState(c,ue.Changed)}let s=ye(o).concat(i).map(l=>l.toString()).toSet();this.langiumDocuments.all.filter(l=>!s.has(l.uri.toString())&&this.shouldRelink(l,s)).forEach(l=>this.resetToState(l,ue.ComputedScopes)),await this.emitUpdate(o,i),await Ge(r);let a=this.sortDocuments(this.langiumDocuments.all.filter(l=>l.state<ue.Validated||!this.buildState.get(l.uri.toString())?.completed||this.resultsAreIncomplete(l,this.updateBuildOptions)).toArray());await this.buildDocuments(a,this.updateBuildOptions,r)}resultsAreIncomplete(t,n){return this.findMissingValidationCategories(t,n).length>=1}findMissingValidationCategories(t,n){let r=this.buildState.get(t.uri.toString()),i=this.serviceRegistry.getServices(t.uri).validation.ValidationRegistry.getAllValidationCategories(t),o=r?.result?.validationChecks?new Set(r?.result?.validationChecks):r?.completed?i:new Set,s=n===void 0||n.validation===!0?i:typeof n.validation=="object"?n.validation.categories??i:[];return ye(s).filter(a=>!o.has(a)).toArray()}async findChangedUris(t){if(this.langiumDocuments.getDocument(t)??this.textDocuments?.get(t))return[t];try{let r=await this.fileSystemProvider.stat(t);if(r.isDirectory)return await this.workspaceManager().searchFolder(t);if(this.workspaceManager().shouldIncludeEntry(r))return[t]}catch{}return[]}async emitUpdate(t,n){await Promise.all(this.updateListeners.map(r=>r(t,n)))}sortDocuments(t){let n=0,r=t.length-1;for(;n<r;){for(;n<t.length&&this.hasTextDocument(t[n]);)n++;for(;r>=0&&!this.hasTextDocument(t[r]);)r--;n<r&&([t[n],t[r]]=[t[r],t[n]])}return t}hasTextDocument(t){return!!this.textDocuments?.get(t.uri)}shouldRelink(t,n){return t.references.some(r=>r.error!==void 0)?!0:this.indexManager.isAffected(t,n)}onUpdate(t){return this.updateListeners.push(t),Bo.create(()=>{let n=this.updateListeners.indexOf(t);n>=0&&this.updateListeners.splice(n,1)})}resetToState(t,n){switch(n){case ue.Changed:case ue.Parsed:this.indexManager.removeContent(t.uri);case ue.IndexedContent:t.localSymbols=void 0;case ue.ComputedScopes:this.serviceRegistry.getServices(t.uri).references.Linker.unlink(t);case ue.Linked:this.indexManager.removeReferences(t.uri);case ue.IndexedReferences:t.diagnostics=void 0,this.buildState.delete(t.uri.toString());case ue.Validated:}t.state>n&&(t.state=n)}cleanUpDeleted(t){this.buildState.delete(t.uri.toString()),this.indexManager.remove(t.uri),t.state=ue.Changed}async buildDocuments(t,n,r){this.prepareBuild(t,n),await this.runCancelable(t,ue.Parsed,r,s=>this.langiumDocumentFactory.update(s,r)),await this.runCancelable(t,ue.IndexedContent,r,s=>this.indexManager.updateContent(s,r)),await this.runCancelable(t,ue.ComputedScopes,r,async s=>{let a=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.localSymbols=await a.collectLocalSymbols(s,r)});let i=t.filter(s=>this.shouldLink(s));await this.runCancelable(i,ue.Linked,r,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,r)),await this.runCancelable(i,ue.IndexedReferences,r,s=>this.indexManager.updateReferences(s,r));let o=t.filter(s=>this.shouldValidate(s)?!0:(this.markAsCompleted(s),!1));await this.runCancelable(o,ue.Validated,r,async s=>{await this.validate(s,r),this.markAsCompleted(s)})}markAsCompleted(t){let n=this.buildState.get(t.uri.toString());n&&(n.completed=!0)}prepareBuild(t,n){for(let r of t){let i=r.uri.toString(),o=this.buildState.get(i);(!o||o.completed)&&this.buildState.set(i,{completed:!1,options:n,result:o?.result})}}async runCancelable(t,n,r,i){for(let s of t)s.state<n&&(await Ge(r),await i(s),s.state=n,await this.notifyDocumentPhase(s,n,r));let o=t.filter(s=>s.state===n);await this.notifyBuildPhase(o,n,r),this.currentState=n}onBuildPhase(t,n){return this.buildPhaseListeners.add(t,n),Bo.create(()=>{this.buildPhaseListeners.delete(t,n)})}onDocumentPhase(t,n){return this.documentPhaseListeners.add(t,n),Bo.create(()=>{this.documentPhaseListeners.delete(t,n)})}waitUntil(t,n,r){let i;return n&&"path"in n?i=n:r=n,r??(r=ce.CancellationToken.None),i?this.awaitDocumentState(t,i,r):this.awaitBuilderState(t,r)}awaitDocumentState(t,n,r){let i=this.langiumDocuments.getDocument(n);if(i){if(i.state>=t)return Promise.resolve(n);if(r.isCancellationRequested)return Promise.reject(hi);if(this.currentState>=t&&t>i.state)return Promise.reject(new Fu.ResponseError(Gm.RequestFailed,`Document state of ${n.toString()} is ${ue[i.state]}, requiring ${ue[t]}, but workspace state is already ${ue[this.currentState]}. Returning undefined.`))}else return Promise.reject(new Fu.ResponseError(Gm.ServerCancelled,`No document found for URI: ${n.toString()}`));return new Promise((o,s)=>{let a=this.onDocumentPhase(t,c=>{et.equals(c.uri,n)&&(a.dispose(),l.dispose(),o(c.uri))}),l=r.onCancellationRequested(()=>{a.dispose(),l.dispose(),s(hi)})})}awaitBuilderState(t,n){return this.currentState>=t?Promise.resolve():n.isCancellationRequested?Promise.reject(hi):new Promise((r,i)=>{let o=this.onBuildPhase(t,()=>{o.dispose(),s.dispose(),r()}),s=n.onCancellationRequested(()=>{o.dispose(),s.dispose(),i(hi)})})}async notifyDocumentPhase(t,n,r){let o=this.documentPhaseListeners.get(n).slice();for(let s of o)try{await Ge(r),await s(t,r)}catch(a){if(!Ar(a))throw a}}async notifyBuildPhase(t,n,r){if(t.length===0)return;let o=this.buildPhaseListeners.get(n).slice();for(let s of o)await Ge(r),await s(t,r)}shouldLink(t){return this.getBuildOptions(t).eagerLinking??!0}shouldValidate(t){return!!this.getBuildOptions(t).validation}async validate(t,n){let r=this.serviceRegistry.getServices(t.uri).validation.DocumentValidator,i=this.getBuildOptions(t),o=typeof i.validation=="object"?{...i.validation}:{};o.categories=this.findMissingValidationCategories(t,i);let s=await r.validateDocument(t,o,n);t.diagnostics?t.diagnostics.push(...s):t.diagnostics=s;let a=this.buildState.get(t.uri.toString());a&&(a.result??(a.result={}),a.result.validationChecks?a.result.validationChecks=ye(a.result.validationChecks).concat(o.categories).distinct().toArray():a.result.validationChecks=[...o.categories])}getBuildOptions(t){return this.buildState.get(t.uri.toString())?.options??{}}};var cf=class{constructor(t){this.symbolIndex=new Map,this.symbolByTypeIndex=new qu,this.referenceIndex=new Map,this.documents=t.workspace.LangiumDocuments,this.serviceRegistry=t.ServiceRegistry,this.astReflection=t.AstReflection}findAllReferences(t,n){let r=at(t).uri,i=[];return this.referenceIndex.forEach(o=>{o.forEach(s=>{et.equals(s.targetUri,r)&&s.targetPath===n&&i.push(s)})}),ye(i)}allElements(t,n){let r=ye(this.symbolIndex.keys());return n&&(r=r.filter(i=>!n||n.has(i))),r.map(i=>this.getFileDescriptions(i,t)).flat()}getFileDescriptions(t,n){return n?this.symbolByTypeIndex.get(t,n,()=>(this.symbolIndex.get(t)??[]).filter(o=>this.astReflection.isSubtype(o.type,n))):this.symbolIndex.get(t)??[]}remove(t){this.removeContent(t),this.removeReferences(t)}removeContent(t){let n=t.toString();this.symbolIndex.delete(n),this.symbolByTypeIndex.clear(n)}removeReferences(t){let n=t.toString();this.referenceIndex.delete(n)}async updateContent(t,n=ce.CancellationToken.None){let i=await this.serviceRegistry.getServices(t.uri).references.ScopeComputation.collectExportedSymbols(t,n),o=t.uri.toString();this.symbolIndex.set(o,i),this.symbolByTypeIndex.clear(o)}async updateReferences(t,n=ce.CancellationToken.None){let i=await this.serviceRegistry.getServices(t.uri).workspace.ReferenceDescriptionProvider.createDescriptions(t,n);this.referenceIndex.set(t.uri.toString(),i)}isAffected(t,n){let r=this.referenceIndex.get(t.uri.toString());return r?r.some(i=>!i.local&&n.has(i.targetUri.toString())):!1}};var uf=class{constructor(t){this.initialBuildOptions={},this._ready=new _r,this.serviceRegistry=t.ServiceRegistry,this.langiumDocuments=t.workspace.LangiumDocuments,this.documentBuilder=t.workspace.DocumentBuilder,this.fileSystemProvider=t.workspace.FileSystemProvider,this.mutex=t.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(t){this.folders=t.workspaceFolders??void 0}initialized(t){return this.mutex.write(n=>this.initializeWorkspace(this.folders??[],n))}async initializeWorkspace(t,n=ce.CancellationToken.None){let r=await this.performStartup(t);await Ge(n),await this.documentBuilder.build(r,this.initialBuildOptions,n)}async performStartup(t){let n=[],r=s=>{n.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)};await this.loadAdditionalDocuments(t,r);let i=[];await Promise.all(t.map(s=>this.getRootFolder(s)).map(async s=>this.traverseFolder(s,i)));let o=ye(i).distinct(s=>s.toString()).filter(s=>!this.langiumDocuments.hasDocument(s));return await this.loadWorkspaceDocuments(o,r),this._ready.resolve(),n}async loadWorkspaceDocuments(t,n){await Promise.all(t.map(async r=>{let i=await this.langiumDocuments.getOrCreateDocument(r);n(i)}))}loadAdditionalDocuments(t,n){return Promise.resolve()}getRootFolder(t){return Oe.parse(t.uri)}async traverseFolder(t,n){try{let r=await this.fileSystemProvider.readDirectory(t);await Promise.all(r.map(async i=>{this.shouldIncludeEntry(i)&&(i.isDirectory?await this.traverseFolder(i.uri,n):i.isFile&&n.push(i.uri))}))}catch(r){console.error("Failure to read directory content of "+t.toString(!0),r)}}async searchFolder(t){let n=[];return await this.traverseFolder(t,n),n}shouldIncludeEntry(t){let n=et.basename(t.uri);return n.startsWith(".")?!1:t.isDirectory?n!=="node_modules"&&n!=="out":t.isFile?this.serviceRegistry.hasServices(t.uri):!1}};var ff=class{buildUnexpectedCharactersMessage(t,n,r,i,o){return co.buildUnexpectedCharactersMessage(t,n,r,i,o)}buildUnableToPopLexerModeMessage(t){return co.buildUnableToPopLexerModeMessage(t)}},Zm={mode:"full"},Wo=class{constructor(t){this.errorMessageProvider=t.parser.LexerErrorMessageProvider,this.tokenBuilder=t.parser.TokenBuilder;let n=this.tokenBuilder.buildTokens(t.Grammar,{caseInsensitive:t.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(n);let r=j_(n)?Object.values(n):n,i=t.LanguageMetaData.mode==="production";this.chevrotainLexer=new Me(r,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(t,n=Zm){let r=this.chevrotainLexer.tokenize(t);return{tokens:r.tokens,errors:r.errors,hidden:r.groups.hidden??[],report:this.tokenBuilder.flushLexingReport?.(t)}}toTokenTypeDictionary(t){if(j_(t))return t;let n=Y_(t)?Object.values(t.modes).flat():t,r={};return n.forEach(i=>r[i.name]=i),r}};function Jm(e){return Array.isArray(e)&&(e.length===0||"name"in e[0])}function Y_(e){return e&&"modes"in e&&"defaultMode"in e}function j_(e){return!Jm(e)&&!Y_(e)}var V_;(function(e){function t(n){return typeof n=="string"}e.is=t})(V_||(V_={}));var Qm;(function(e){function t(n){return typeof n=="string"}e.is=t})(Qm||(Qm={}));var K_;(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function t(n){return typeof n=="number"&&e.MIN_VALUE<=n&&n<=e.MAX_VALUE}e.is=t})(K_||(K_={}));var df;(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function t(n){return typeof n=="number"&&e.MIN_VALUE<=n&&n<=e.MAX_VALUE}e.is=t})(df||(df={}));var ve;(function(e){function t(r,i){return r===Number.MAX_VALUE&&(r=df.MAX_VALUE),i===Number.MAX_VALUE&&(i=df.MAX_VALUE),{line:r,character:i}}e.create=t;function n(r){let i=r;return b.objectLiteral(i)&&b.uinteger(i.line)&&b.uinteger(i.character)}e.is=n})(ve||(ve={}));var pe;(function(e){function t(r,i,o,s){if(b.uinteger(r)&&b.uinteger(i)&&b.uinteger(o)&&b.uinteger(s))return{start:ve.create(r,i),end:ve.create(o,s)};if(ve.is(r)&&ve.is(i))return{start:r,end:i};throw new Error(`Range#create called with invalid arguments[${r}, ${i}, ${o}, ${s}]`)}e.create=t;function n(r){let i=r;return b.objectLiteral(i)&&ve.is(i.start)&&ve.is(i.end)}e.is=n})(pe||(pe={}));var pf;(function(e){function t(r,i){return{uri:r,range:i}}e.create=t;function n(r){let i=r;return b.objectLiteral(i)&&pe.is(i.range)&&(b.string(i.uri)||b.undefined(i.uri))}e.is=n})(pf||(pf={}));var q_;(function(e){function t(r,i,o,s){return{targetUri:r,targetRange:i,targetSelectionRange:o,originSelectionRange:s}}e.create=t;function n(r){let i=r;return b.objectLiteral(i)&&pe.is(i.targetRange)&&b.string(i.targetUri)&&pe.is(i.targetSelectionRange)&&(pe.is(i.originSelectionRange)||b.undefined(i.originSelectionRange))}e.is=n})(q_||(q_={}));var eg;(function(e){function t(r,i,o,s){return{red:r,green:i,blue:o,alpha:s}}e.create=t;function n(r){let i=r;return b.objectLiteral(i)&&b.numberRange(i.red,0,1)&&b.numberRange(i.green,0,1)&&b.numberRange(i.blue,0,1)&&b.numberRange(i.alpha,0,1)}e.is=n})(eg||(eg={}));var Z_;(function(e){function t(r,i){return{range:r,color:i}}e.create=t;function n(r){let i=r;return b.objectLiteral(i)&&pe.is(i.range)&&eg.is(i.color)}e.is=n})(Z_||(Z_={}));var J_;(function(e){function t(r,i,o){return{label:r,textEdit:i,additionalTextEdits:o}}e.create=t;function n(r){let i=r;return b.objectLiteral(i)&&b.string(i.label)&&(b.undefined(i.textEdit)||Uo.is(i))&&(b.undefined(i.additionalTextEdits)||b.typedArray(i.additionalTextEdits,Uo.is))}e.is=n})(J_||(J_={}));var Q_;(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(Q_||(Q_={}));var e0;(function(e){function t(r,i,o,s,a,l){let c={startLine:r,endLine:i};return b.defined(o)&&(c.startCharacter=o),b.defined(s)&&(c.endCharacter=s),b.defined(a)&&(c.kind=a),b.defined(l)&&(c.collapsedText=l),c}e.create=t;function n(r){let i=r;return b.objectLiteral(i)&&b.uinteger(i.startLine)&&b.uinteger(i.startLine)&&(b.undefined(i.startCharacter)||b.uinteger(i.startCharacter))&&(b.undefined(i.endCharacter)||b.uinteger(i.endCharacter))&&(b.undefined(i.kind)||b.string(i.kind))}e.is=n})(e0||(e0={}));var tg;(function(e){function t(r,i){return{location:r,message:i}}e.create=t;function n(r){let i=r;return b.defined(i)&&pf.is(i.location)&&b.string(i.message)}e.is=n})(tg||(tg={}));var t0;(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(t0||(t0={}));var n0;(function(e){e.Unnecessary=1,e.Deprecated=2})(n0||(n0={}));var r0;(function(e){function t(n){let r=n;return b.objectLiteral(r)&&b.string(r.href)}e.is=t})(r0||(r0={}));var hf;(function(e){function t(o,s,a,l,c,u){let f={range:o,message:s};return b.defined(a)&&(f.severity=a),b.defined(l)&&(f.code=l),b.defined(c)&&(f.source=c),b.defined(u)&&(f.relatedInformation=u),f}e.create=t;function n(o){var s;let a=o;return b.defined(a)&&pe.is(a.range)&&(b.string(a.message)||gi.is(a.message))&&(b.number(a.severity)||b.undefined(a.severity))&&(b.integer(a.code)||b.string(a.code)||b.undefined(a.code))&&(b.undefined(a.codeDescription)||b.string((s=a.codeDescription)===null||s===void 0?void 0:s.href))&&(b.string(a.source)||b.undefined(a.source))&&(b.undefined(a.relatedInformation)||b.typedArray(a.relatedInformation,tg.is))}e.is=n;function r(o){return b.string(o.message)}e.is3_17=r;function i(o){if(b.string(o.message))return o.message;if(gi.is(o.message))return o.message.value;throw new Error(`Unknown message type ${typeof o.message}`)}e.getMessageString=i})(hf||(hf={}));var Xo;(function(e){function t(r,i,...o){let s={title:r,command:i};return b.defined(o)&&o.length>0&&(s.arguments=o),s}e.create=t;function n(r){let i=r;return b.defined(i)&&b.string(i.title)&&(i.tooltip===void 0||b.string(i.tooltip))&&b.string(i.command)}e.is=n})(Xo||(Xo={}));var Uo;(function(e){function t(o,s){return{range:o,newText:s}}e.replace=t;function n(o,s){return{range:{start:o,end:o},newText:s}}e.insert=n;function r(o){return{range:o,newText:""}}e.del=r;function i(o){let s=o;return b.objectLiteral(s)&&b.string(s.newText)&&pe.is(s.range)}e.is=i})(Uo||(Uo={}));var mf;(function(e){function t(r,i,o){let s={label:r};return i!==void 0&&(s.needsConfirmation=i),o!==void 0&&(s.description=o),s}e.create=t;function n(r){let i=r;return b.objectLiteral(i)&&b.string(i.label)&&(b.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(b.string(i.description)||i.description===void 0)}e.is=n})(mf||(mf={}));var mi;(function(e){function t(n){let r=n;return b.string(r)}e.is=t})(mi||(mi={}));var i0;(function(e){function t(o,s,a){return{range:o,newText:s,annotationId:a}}e.replace=t;function n(o,s,a){return{range:{start:o,end:o},newText:s,annotationId:a}}e.insert=n;function r(o,s){return{range:o,newText:"",annotationId:s}}e.del=r;function i(o){let s=o;return Uo.is(s)&&(mf.is(s.annotationId)||mi.is(s.annotationId))}e.is=i})(i0||(i0={}));var ng;(function(e){function t(r,i){return{textDocument:r,edits:i}}e.create=t;function n(r){let i=r;return b.defined(i)&&ag.is(i.textDocument)&&Array.isArray(i.edits)}e.is=n})(ng||(ng={}));var rg;(function(e){function t(r,i,o){let s={kind:"create",uri:r};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(s.options=i),o!==void 0&&(s.annotationId=o),s}e.create=t;function n(r){let i=r;return i&&i.kind==="create"&&b.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||b.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||b.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||mi.is(i.annotationId))}e.is=n})(rg||(rg={}));var ig;(function(e){function t(r,i,o,s){let a={kind:"rename",oldUri:r,newUri:i};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(a.options=o),s!==void 0&&(a.annotationId=s),a}e.create=t;function n(r){let i=r;return i&&i.kind==="rename"&&b.string(i.oldUri)&&b.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||b.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||b.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||mi.is(i.annotationId))}e.is=n})(ig||(ig={}));var og;(function(e){function t(r,i,o){let s={kind:"delete",uri:r};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(s.options=i),o!==void 0&&(s.annotationId=o),s}e.create=t;function n(r){let i=r;return i&&i.kind==="delete"&&b.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||b.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||b.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||mi.is(i.annotationId))}e.is=n})(og||(og={}));var sg;(function(e){function t(n){let r=n;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(i=>b.string(i.kind)?rg.is(i)||ig.is(i)||og.is(i):ng.is(i)))}e.is=t})(sg||(sg={}));var o0;(function(e){function t(n){let r=n;return b.objectLiteral(r)&&pe.is(r.range)&&dg.isSnippet(r.snippet)&&(r.annotationId===void 0||mf.is(r.annotationId)||mi.is(r.annotationId))}e.is=t})(o0||(o0={}));var s0;(function(e){function t(r){return{uri:r}}e.create=t;function n(r){let i=r;return b.defined(i)&&b.string(i.uri)}e.is=n})(s0||(s0={}));var a0;(function(e){function t(r,i){return{uri:r,version:i}}e.create=t;function n(r){let i=r;return b.defined(i)&&b.string(i.uri)&&b.integer(i.version)}e.is=n})(a0||(a0={}));var ag;(function(e){function t(r,i){return{uri:r,version:i}}e.create=t;function n(r){let i=r;return b.defined(i)&&b.string(i.uri)&&(i.version===null||b.integer(i.version))}e.is=n})(ag||(ag={}));var l0;(function(e){e.ABAP="abap",e.WindowsBat="bat",e.BibTeX="bibtex",e.Clojure="clojure",e.Coffeescript="coffeescript",e.C="c",e.CPP="cpp",e.CSharp="csharp",e.CSS="css",e.D="d",e.Delphi="pascal",e.Diff="diff",e.Dart="dart",e.Dockerfile="dockerfile",e.Elixir="elixir",e.Erlang="erlang",e.FSharp="fsharp",e.GitCommit="git-commit",e.GitRebase="git-rebase",e.Go="go",e.Groovy="groovy",e.Handlebars="handlebars",e.Haskell="haskell",e.HTML="html",e.Ini="ini",e.Java="java",e.JavaScript="javascript",e.JavaScriptReact="javascriptreact",e.JSON="json",e.LaTeX="latex",e.Less="less",e.Lua="lua",e.Makefile="makefile",e.Markdown="markdown",e.ObjectiveC="objective-c",e.ObjectiveCPP="objective-cpp",e.Pascal="pascal",e.Perl="perl",e.Perl6="perl6",e.PHP="php",e.Plaintext="plaintext",e.Powershell="powershell",e.Pug="jade",e.Python="python",e.R="r",e.Razor="razor",e.Ruby="ruby",e.Rust="rust",e.SCSS="scss",e.SASS="sass",e.Scala="scala",e.ShaderLab="shaderlab",e.ShellScript="shellscript",e.SQL="sql",e.Swift="swift",e.TypeScript="typescript",e.TypeScriptReact="typescriptreact",e.TeX="tex",e.VisualBasic="vb",e.XML="xml",e.XSL="xsl",e.YAML="yaml"})(l0||(l0={}));var c0;(function(e){function t(r,i,o,s){return{uri:r,languageId:i,version:o,text:s}}e.create=t;function n(r){let i=r;return b.defined(i)&&b.string(i.uri)&&b.string(i.languageId)&&b.integer(i.version)&&b.string(i.text)}e.is=n})(c0||(c0={}));var lg;(function(e){e.PlainText="plaintext",e.Markdown="markdown";function t(n){let r=n;return r===e.PlainText||r===e.Markdown}e.is=t})(lg||(lg={}));var gi;(function(e){function t(n){let r=n;return b.objectLiteral(n)&&lg.is(r.kind)&&b.string(r.value)}e.is=t})(gi||(gi={}));var u0;(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})(u0||(u0={}));var f0;(function(e){e.PlainText=1,e.Snippet=2})(f0||(f0={}));var d0;(function(e){e.Deprecated=1})(d0||(d0={}));var p0;(function(e){function t(r,i,o){return{newText:r,insert:i,replace:o}}e.create=t;function n(r){let i=r;return i&&b.string(i.newText)&&pe.is(i.insert)&&pe.is(i.replace)}e.is=n})(p0||(p0={}));var h0;(function(e){e.asIs=1,e.adjustIndentation=2})(h0||(h0={}));var m0;(function(e){e.Replace=1,e.Merge=2})(m0||(m0={}));var g0;(function(e){function t(n){let r=n;return r&&(b.string(r.detail)||r.detail===void 0)&&(b.string(r.description)||r.description===void 0)}e.is=t})(g0||(g0={}));var y0;(function(e){function t(n){return{label:n}}e.create=t})(y0||(y0={}));var x0;(function(e){function t(n,r){return{items:n||[],isIncomplete:!!r}}e.create=t})(x0||(x0={}));var gf;(function(e){function t(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}e.fromPlainText=t;function n(r){let i=r;return b.string(i)||b.objectLiteral(i)&&b.string(i.language)&&b.string(i.value)}e.is=n})(gf||(gf={}));var E0;(function(e){function t(n){let r=n;return!!r&&b.objectLiteral(r)&&(gi.is(r.contents)||gf.is(r.contents)||b.typedArray(r.contents,gf.is))&&(n.range===void 0||pe.is(n.range))}e.is=t})(E0||(E0={}));var w0;(function(e){function t(n,r){return r?{label:n,documentation:r}:{label:n}}e.create=t})(w0||(w0={}));var T0;(function(e){function t(n,r,...i){let o={label:n};return b.defined(r)&&(o.documentation=r),b.defined(i)?o.parameters=i:o.parameters=[],o}e.create=t})(T0||(T0={}));var v0;(function(e){e.Text=1,e.Read=2,e.Write=3})(v0||(v0={}));var _0;(function(e){function t(n,r){let i={range:n};return b.number(r)&&(i.kind=r),i}e.create=t})(_0||(_0={}));var A0;(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})(A0||(A0={}));var k0;(function(e){e.Deprecated=1})(k0||(k0={}));var I0;(function(e){function t(n,r,i,o,s){let a={name:n,kind:r,location:{uri:o,range:i}};return s&&(a.containerName=s),a}e.create=t})(I0||(I0={}));var R0;(function(e){function t(n,r,i,o){return o!==void 0?{name:n,kind:r,location:{uri:i,range:o}}:{name:n,kind:r,location:{uri:i}}}e.create=t})(R0||(R0={}));var S0;(function(e){function t(r,i,o,s,a,l){let c={name:r,detail:i,kind:o,range:s,selectionRange:a};return l!==void 0&&(c.children=l),c}e.create=t;function n(r){let i=r;return i&&b.string(i.name)&&b.number(i.kind)&&pe.is(i.range)&&pe.is(i.selectionRange)&&(i.detail===void 0||b.string(i.detail))&&(i.deprecated===void 0||b.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}e.is=n})(S0||(S0={}));var b0;(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorMove="refactor.move",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll",e.Notebook="notebook"})(b0||(b0={}));var yf;(function(e){e.Invoked=1,e.Automatic=2})(yf||(yf={}));var N0;(function(e){function t(r,i,o){let s={diagnostics:r};return i!=null&&(s.only=i),o!=null&&(s.triggerKind=o),s}e.create=t;function n(r){let i=r;return b.defined(i)&&b.typedArray(i.diagnostics,hf.is)&&(i.only===void 0||b.typedArray(i.only,b.string))&&(i.triggerKind===void 0||i.triggerKind===yf.Invoked||i.triggerKind===yf.Automatic)}e.is=n})(N0||(N0={}));var cg;(function(e){e.LLMGenerated=1;function t(n){return b.defined(n)&&n===e.LLMGenerated}e.is=t})(cg||(cg={}));var L0;(function(e){function t(r,i,o){let s={title:r},a=!0;return typeof i=="string"?(a=!1,s.kind=i):Xo.is(i)?s.command=i:s.edit=i,a&&o!==void 0&&(s.kind=o),s}e.create=t;function n(r){let i=r;return i&&b.string(i.title)&&(i.diagnostics===void 0||b.typedArray(i.diagnostics,hf.is))&&(i.kind===void 0||b.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Xo.is(i.command))&&(i.isPreferred===void 0||b.boolean(i.isPreferred))&&(i.edit===void 0||sg.is(i.edit))&&(i.tags===void 0||b.typedArray(i.tags,cg.is))}e.is=n})(L0||(L0={}));var P0;(function(e){function t(r,i){let o={range:r};return b.defined(i)&&(o.data=i),o}e.create=t;function n(r){let i=r;return b.defined(i)&&pe.is(i.range)&&(b.undefined(i.command)||Xo.is(i.command))}e.is=n})(P0||(P0={}));var C0;(function(e){function t(r,i){return{tabSize:r,insertSpaces:i}}e.create=t;function n(r){let i=r;return b.defined(i)&&b.uinteger(i.tabSize)&&b.boolean(i.insertSpaces)}e.is=n})(C0||(C0={}));var O0;(function(e){function t(r,i,o){return{range:r,target:i,data:o}}e.create=t;function n(r){let i=r;return b.defined(i)&&pe.is(i.range)&&(b.undefined(i.target)||b.string(i.target))}e.is=n})(O0||(O0={}));var $0;(function(e){function t(r,i){return{range:r,parent:i}}e.create=t;function n(r){let i=r;return b.objectLiteral(i)&&pe.is(i.range)&&(i.parent===void 0||e.is(i.parent))}e.is=n})($0||($0={}));var D0;(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",e.label="label"})(D0||(D0={}));var M0;(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"})(M0||(M0={}));var F0;(function(e){function t(n){let r=n;return b.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}e.is=t})(F0||(F0={}));var B0;(function(e){function t(r,i){return{range:r,text:i}}e.create=t;function n(r){let i=r;return i!=null&&pe.is(i.range)&&b.string(i.text)}e.is=n})(B0||(B0={}));var W0;(function(e){function t(r,i,o){return{range:r,variableName:i,caseSensitiveLookup:o}}e.create=t;function n(r){let i=r;return i!=null&&pe.is(i.range)&&b.boolean(i.caseSensitiveLookup)&&(b.string(i.variableName)||i.variableName===void 0)}e.is=n})(W0||(W0={}));var X0;(function(e){function t(r,i){return{range:r,expression:i}}e.create=t;function n(r){let i=r;return i!=null&&pe.is(i.range)&&(b.string(i.expression)||i.expression===void 0)}e.is=n})(X0||(X0={}));var U0;(function(e){function t(r,i){return{frameId:r,stoppedLocation:i}}e.create=t;function n(r){let i=r;return b.defined(i)&&pe.is(r.stoppedLocation)}e.is=n})(U0||(U0={}));var ug;(function(e){e.Type=1,e.Parameter=2;function t(n){return n===1||n===2}e.is=t})(ug||(ug={}));var fg;(function(e){function t(r){return{value:r}}e.create=t;function n(r){let i=r;return b.objectLiteral(i)&&(i.tooltip===void 0||b.string(i.tooltip)||gi.is(i.tooltip))&&(i.location===void 0||pf.is(i.location))&&(i.command===void 0||Xo.is(i.command))}e.is=n})(fg||(fg={}));var G0;(function(e){function t(r,i,o){let s={position:r,label:i};return o!==void 0&&(s.kind=o),s}e.create=t;function n(r){let i=r;return b.objectLiteral(i)&&ve.is(i.position)&&(b.string(i.label)||b.typedArray(i.label,fg.is))&&(i.kind===void 0||ug.is(i.kind))&&i.textEdits===void 0||b.typedArray(i.textEdits,Uo.is)&&(i.tooltip===void 0||b.string(i.tooltip)||gi.is(i.tooltip))&&(i.paddingLeft===void 0||b.boolean(i.paddingLeft))&&(i.paddingRight===void 0||b.boolean(i.paddingRight))}e.is=n})(G0||(G0={}));var dg;(function(e){function t(r){return{kind:"snippet",value:r}}e.createSnippet=t;function n(r){let i=r;return b.objectLiteral(i)&&i.kind==="snippet"&&b.string(i.value)}e.isSnippet=n})(dg||(dg={}));var H0;(function(e){function t(n,r,i,o){return{insertText:n,filterText:r,range:i,command:o}}e.create=t})(H0||(H0={}));var z0;(function(e){function t(n){return{items:n}}e.create=t})(z0||(z0={}));var j0;(function(e){e.Invoked=1,e.Automatic=2})(j0||(j0={}));var Y0;(function(e){function t(n,r){return{range:n,text:r}}e.create=t})(Y0||(Y0={}));var V0;(function(e){function t(n,r){return{triggerKind:n,selectedCompletionInfo:r}}e.create=t})(V0||(V0={}));var K0;(function(e){function t(n){let r=n;return b.objectLiteral(r)&&Qm.is(r.uri)&&b.string(r.name)}e.is=t})(K0||(K0={}));var q0;(function(e){function t(o,s,a,l){return new pg(o,s,a,l)}e.create=t;function n(o){let s=o;return!!(b.defined(s)&&b.string(s.uri)&&(b.undefined(s.languageId)||b.string(s.languageId))&&b.uinteger(s.lineCount)&&b.func(s.getText)&&b.func(s.positionAt)&&b.func(s.offsetAt))}e.is=n;function r(o,s){let a=o.getText(),l=i(s,(u,f)=>{let d=u.range.start.line-f.range.start.line;return d===0?u.range.start.character-f.range.start.character:d}),c=a.length;for(let u=l.length-1;u>=0;u--){let f=l[u],d=o.offsetAt(f.range.start),p=o.offsetAt(f.range.end);if(p<=c)a=a.substring(0,d)+f.newText+a.substring(p,a.length);else throw new Error("Overlapping edit");c=d}return a}e.applyEdits=r;function i(o,s){if(o.length<=1)return o;let a=o.length/2|0,l=o.slice(0,a),c=o.slice(a);i(l,s),i(c,s);let u=0,f=0,d=0;for(;u<l.length&&f<c.length;)s(l[u],c[f])<=0?o[d++]=l[u++]:o[d++]=c[f++];for(;u<l.length;)o[d++]=l[u++];for(;f<c.length;)o[d++]=c[f++];return o}})(q0||(q0={}));var pg=class{constructor(t,n,r,i){this._uri=t,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(t){if(t){let n=this.offsetAt(t.start),r=this.offsetAt(t.end);return this._content.substring(n,r)}return this._content}update(t,n){this._content=t.text,this._version=n,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let t=[],n=this._content,r=!0;for(let i=0;i<n.length;i++){r&&(t.push(i),r=!1);let o=n.charAt(i);r=o==="\r"||o===`
|
|
117
|
+
For Further details.`,r}function bD(e){if(e instanceof Ee)return"SUBRULE";if(e instanceof we)return"OPTION";if(e instanceof Ie)return"OR";if(e instanceof Ne)return"AT_LEAST_ONE";if(e instanceof Le)return"AT_LEAST_ONE_SEP";if(e instanceof ke)return"MANY_SEP";if(e instanceof me)return"MANY";if(e instanceof le)return"CONSUME";throw Error("non exhaustive match")}function ND(e,t,n){let r=rv(t.configs.elements,o=>o.state.transitions),i=pv(r.filter(o=>o instanceof li).map(o=>o.tokenType),o=>o.tokenTypeIdx);return{actualToken:n,possibleTokenTypes:i,tokenPath:e}}function LD(e,t){return e.edges[t.tokenTypeIdx]}function PD(e,t,n){let r=new No,i=[];for(let s of e.elements){if(n.is(s.alt)===!1)continue;if(s.state.type===wr){i.push(s);continue}let a=s.state.transitions.length;for(let l=0;l<a;l++){let c=s.state.transitions[l],u=CD(c,t);u!==void 0&&r.add({state:u,alt:s.alt,stack:s.stack})}}let o;if(i.length===0&&r.size===1&&(o=r),o===void 0){o=new No;for(let s of r.elements)ku(s,o)}if(i.length>0&&!MD(o))for(let s of i)o.add(s);return o}function CD(e,t){if(e instanceof li&&uo(t,e.tokenType))return e.target}function OD(e,t){let n;for(let r of e.elements)if(t.is(r.alt)===!0){if(n===void 0)n=r.alt;else if(n!==r.alt)return}return n}function Av(e){return{configs:e,edges:{},isAcceptState:!1,prediction:-1}}function vv(e,t,n,r){return r=kv(e,r),t.edges[n.tokenTypeIdx]=r,r}function kv(e,t){if(t===Ia)return t;let n=t.configs.key,r=e.states[n];return r!==void 0?r:(t.configs.finalize(),e.states[n]=t,t)}function $D(e){let t=new No,n=e.transitions.length;for(let r=0;r<n;r++){let o={state:e.transitions[r].target,alt:r,stack:[]};ku(o,t)}return t}function ku(e,t){let n=e.state;if(n.type===wr){if(e.stack.length>0){let i=[...e.stack],s={state:i.pop(),alt:e.alt,stack:i};ku(s,t)}else t.add(e);return}n.epsilonOnlyTransitions||t.add(e);let r=n.transitions.length;for(let i=0;i<r;i++){let o=n.transitions[i],s=DD(e,o);s!==void 0&&ku(s,t)}}function DD(e,t){if(t instanceof ka)return{state:t.target,alt:e.alt,stack:e.stack};if(t instanceof ci){let n=[...e.stack,t.followState];return{state:t.target,alt:e.alt,stack:n}}}function MD(e){for(let t of e.elements)if(t.state.type===wr)return!0;return!1}function FD(e){for(let t of e.elements)if(t.state.type!==wr)return!1;return!0}function BD(e){if(FD(e))return!0;let t=WD(e.elements);return XD(t)&&!UD(t)}function WD(e){let t=new Map;for(let n of e){let r=Qh(n,!1),i=t.get(r);i===void 0&&(i={},t.set(r,i)),i[n.alt]=!0}return t}function XD(e){for(let t of Array.from(e.values()))if(Object.keys(t).length>1)return!0;return!1}function UD(e){for(let t of Array.from(e.values()))if(Object.keys(t).length===1)return!0;return!1}function GD(e,t){let n;for(let r of e.configs.elements)if(!(t.is(r.alt)===!1||r.state.type===wr)){if(n===void 0)n=r.alt;else if(n!==r.alt)return}return n}var Po=class{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]??this.rootNode}buildRootNode(t){return this.rootNode=new ba(t),this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(t){let n=new Co;return n.grammarSource=t,this.appendChild(this.current,n),this.nodeStack.push(n),n}buildLeafNode(t,n){let r=this.createLeafNode(t,!n);return n&&(r.grammarSource=n),this.appendChild(this.current,r),r}createLeafNode(t,n){return new Sa(t.startOffset,t.image.length,t.startLine-1,t.startColumn-1,t.endLine-1,t.endColumn,t.tokenType,n)}appendChild(t,n){n.container=t,t.content.push(n)}appendChildren(t,n){for(let r of n)r.container=t;t.content.length===0?t.content=n.slice():t.content.push(...n)}insertChildren(t,n,r){for(let i of r)i.container=t;t.content.splice(n,0,...r)}removeNode(t){let n=t.container;if(n){let r=n.content.indexOf(t);r>=0&&n.content.splice(r,1)}}addHiddenNodes(t){let n=[];for(let o of t)n.push(this.createLeafNode(o,!0));let r=this.current,i=!1;if(r.content.length>0){this.appendChildren(r,n);return}for(;r.container;){let o=r.container.content.indexOf(r);if(o>0){this.insertChildren(r.container,o,n),i=!0;break}r=r.container}i||this.insertChildren(this.rootNode,0,n)}construct(t){let n=this.current;t.$cstNode=n;let r=this.nodeStack.pop();r&&(r.content.length===0?this.removeNode(r):r.content=r.content.slice())}},Iu=class{constructor(){this.container=void 0,this.grammarSource=void 0}get root(){let t=this;for(;t.container;)t=t.container;return t}get text(){return this.root.fullText.substring(this.offset,this.end)}},Sa=class extends Iu{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get astNode(){let t=this.container;if(!t)throw new Error("This node has no associated AST element");return t.astNode}get range(){return{start:{line:this._startLine,character:this._startColumn},end:{line:this._endLine,character:this._endColumn}}}constructor(t,n,r,i,o,s,a,l=!1){super(),this._hidden=l,this._offset=Lo(t),this._length=Lo(n),this._startLine=Lo(r),this._startColumn=Lo(i),this._endLine=Lo(o),this._endColumn=Lo(s),this._tokenType=a}};function Lo(e){return e|0}var Co=class extends Iu{constructor(){super(...arguments),this.content=[],this._astNode=void 0,this._rangeCache=void 0}get astNode(){let t=this;for(;t;){if(t._astNode)return t._astNode;t=t.container}throw new Error("This node has no associated AST element")}set astNode(t){this._astNode=t}get hidden(){return!1}get offset(){return this.firstNonHiddenNode?.offset??0}get length(){return this.end-this.offset}get end(){return this.lastNonHiddenNode?.end??0}get range(){let t=this._rangeCache;if(t===void 0){let n=this.firstNonHiddenNode,r=this.lastNonHiddenNode;if(n&&r){let{range:i}=n,{range:o}=r;this._rangeCache=t={start:i.start,end:o.end.line<i.start.line?i.start:o.end}}else return{start:{line:0,character:0},end:{line:0,character:0}}}return t}get firstNonHiddenNode(){for(let t of this.content)if(!t.hidden)return t;return this.content[0]}get lastNonHiddenNode(){for(let t=this.content.length-1;t>=0;t--){let n=this.content[t];if(!n.hidden)return n}return this.content[this.content.length-1]}},ba=class extends Co{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(t){super(),this._text="",this._text=t??""}};var rm=Symbol("Datatype");function nm(e){return e.$type===rm}var Iv="\u200B",Rv=e=>e.endsWith(Iv)?e:e+Iv,Ru=class{constructor(t,n){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=t.parser.Lexer;let r=this.lexer.definition,i=t.LanguageMetaData.mode==="production";t.shared.profilers.LangiumProfiler?.isActive("parsing")?this.wrapper=new om(r,{...t.parser.ParserConfig,skipValidations:i,errorMessageProvider:t.parser.ParserErrorMessageProvider},n,t.shared.profilers.LangiumProfiler.createTask("parsing",t.LanguageMetaData.languageId)):this.wrapper=new Nu(r,{...t.parser.ParserConfig,skipValidations:i,errorMessageProvider:t.parser.ParserErrorMessageProvider},n)}alternatives(t,n){this.wrapper.wrapOr(t,n)}optional(t,n){this.wrapper.wrapOption(t,n)}many(t,n){this.wrapper.wrapMany(t,n)}atLeastOne(t,n){this.wrapper.wrapAtLeastOne(t,n)}getRule(t){return this.allRules.get(t)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}},Su=class extends Ru{get current(){return this.stack[this.stack.length-1]}constructor(t){super(t,!1),this.nodeBuilder=new Po,this.stack=[],this.assignmentMap=new Map,this.operatorPrecedence=new Map,this.linker=t.references.Linker,this.converter=t.parser.ValueConverter,this.astReflection=t.shared.AstReflection}rule(t,n){let r=this.computeRuleType(t),i;qr(t)&&(i=t.name,this.registerPrecedenceMap(t));let o=this.wrapper.DEFINE_RULE(Rv(t.name),this.startImplementation(r,i,n).bind(this));return this.allRules.set(t.name,o),lt(t)&&t.entry&&(this.mainRule=o),o}registerPrecedenceMap(t){let n=t.name,r=new Map;for(let i=0;i<t.operators.precedences.length;i++){let o=t.operators.precedences[i];for(let s of o.operators)r.set(s.value,{precedence:i,rightAssoc:o.associativity==="right"})}this.operatorPrecedence.set(n,r)}computeRuleType(t){return qr(t)?or(t):t.fragment?void 0:ra(t)?rm:or(t)}parse(t,n={}){this.nodeBuilder.buildRootNode(t);let r=this.lexerResult=this.lexer.tokenize(t);this.wrapper.input=r.tokens;let i=n.rule?this.allRules.get(n.rule):this.mainRule;if(!i)throw new Error(n.rule?`No rule found with name '${n.rule}'`:"No main rule available.");let o=this.doParse(i);return this.nodeBuilder.addHiddenNodes(r.hidden),this.unorderedGroups.clear(),this.lexerResult=void 0,Ql(o,{deep:!0}),{value:o,lexerErrors:r.errors,lexerReport:r.report,parserErrors:this.wrapper.errors}}doParse(t){let n=this.wrapper.rule(t);if(this.stack.length>0&&(n=this.construct()),n===void 0)throw new Error("No result from parser");if(this.stack.length>0)throw new Error("Parser stack is not empty after parsing");return this.linkCstNode(n),n}linkCstNode(t){Ue(t)&&t.$cstNode&&(t.$cstNode.astNode=t)}startImplementation(t,n,r){return i=>{let o=!this.isRecording()&&t!==void 0;if(o){let s={$type:t};this.stack.push(s),t===rm?s.value="":n!==void 0&&(s.$infixName=n)}return r(i),o?this.construct():void 0}}extractHiddenTokens(t){let n=this.lexerResult.hidden;if(!n.length)return[];let r=t.startOffset;for(let i=0;i<n.length;i++)if(n[i].startOffset>r)return n.splice(0,i);return n.splice(0,n.length)}consume(t,n,r){let i=this.wrapper.wrapConsume(t,n);if(!this.isRecording()&&this.isValidToken(i)){let o=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(o);let s=this.nodeBuilder.buildLeafNode(i,r),{assignment:a,crossRef:l}=this.getAssignment(r),c=this.current;if(a){let u=Ht(r)?i.image:this.converter.convert(i.image,s);this.assign(a.operator,a.feature,u,s,l)}else if(nm(c)){let u=i.image;Ht(r)||(u=this.converter.convert(u,s).toString()),c.value+=u}}}isValidToken(t){return!t.isInsertedInRecovery&&qs(t)}subrule(t,n,r,i,o){let s;!this.isRecording()&&!r&&(s=this.nodeBuilder.buildCompositeNode(i));let a;try{a=this.wrapper.wrapSubrule(t,n,o)}finally{this.isRecording()||(a===void 0&&!r&&(a=this.construct()),a!==void 0&&s&&s.length>0&&this.performSubruleAssignment(a,i,s))}}performSubruleAssignment(t,n,r){let{assignment:i,crossRef:o}=this.getAssignment(n);if(i)this.assign(i.operator,i.feature,t,r,o);else if(!i){let s=this.current;if(nm(s))s.value+=t.toString();else if(typeof t=="object"&&t){let l=this.assignWithoutOverride(t,s);this.stack.pop(),this.stack.push(l)}}}action(t,n){if(!this.isRecording()){let r=this.current;if(n.feature&&n.operator){r=this.construct(),this.nodeBuilder.removeNode(r.$cstNode);let i=this.nodeBuilder.buildCompositeNode(n);this.nodeBuilder.appendChild(i,r.$cstNode);let o={$type:t};this.stack.push(o),this.assign(n.operator,n.feature,r,r.$cstNode)}else r.$type=t}}construct(){if(this.isRecording())return;let t=this.stack.pop();return this.nodeBuilder.construct(t),"$infixName"in t?this.constructInfix(t,this.operatorPrecedence.get(t.$infixName)):nm(t)?this.converter.convert(t.value,t.$cstNode):(fE(this.astReflection,t),t)}constructInfix(t,n){let r=t.parts;if(!Array.isArray(r)||r.length===0)return;let i=t.operators;if(!Array.isArray(i)||r.length<2)return r[0];let o=0,s=-1;for(let g=0;g<i.length;g++){let w=i[g],x=n.get(w)??{precedence:1/0,rightAssoc:!1};x.precedence>s?(s=x.precedence,o=g):x.precedence===s&&(x.rightAssoc||(o=g))}let a=i.slice(0,o),l=i.slice(o+1),c=r.slice(0,o+1),u=r.slice(o+1),f={$infixName:t.$infixName,$type:t.$type,$cstNode:t.$cstNode,parts:c,operators:a},d={$infixName:t.$infixName,$type:t.$type,$cstNode:t.$cstNode,parts:u,operators:l},p=this.constructInfix(f,n),m=this.constructInfix(d,n);return{$type:t.$type,$cstNode:t.$cstNode,left:p,operator:i[o],right:m}}getAssignment(t){if(!this.assignmentMap.has(t)){let n=Hi(t,ln);this.assignmentMap.set(t,{assignment:n,crossRef:n&&cn(n.terminal)?n.terminal.isMulti?"multi":"single":void 0})}return this.assignmentMap.get(t)}assign(t,n,r,i,o){let s=this.current,a;switch(o==="single"&&typeof r=="string"?a=this.linker.buildReference(s,n,i,r):o==="multi"&&typeof r=="string"?a=this.linker.buildMultiReference(s,n,i,r):a=r,this.linkCstNode(a),t){case"=":{s[n]=a;break}case"?=":{s[n]=!0;break}case"+=":Array.isArray(s[n])||(s[n]=[]),s[n].push(a)}}assignWithoutOverride(t,n){for(let[r,i]of Object.entries(n)){let o=t[r];o===void 0?t[r]=i:Array.isArray(o)&&Array.isArray(i)&&(i.push(...o),t[r]=i)}return t.$cstNode=void 0,t}get definitionErrors(){return this.wrapper.definitionErrors}},im=class{buildMismatchTokenMessage(t){return Sn.buildMismatchTokenMessage(t)}buildNotAllInputParsedMessage(t){return Sn.buildNotAllInputParsedMessage(t)}buildNoViableAltMessage(t){return Sn.buildNoViableAltMessage(t)}buildEarlyExitMessage(t){return Sn.buildEarlyExitMessage(t)}},Na=class extends im{buildMismatchTokenMessage({expected:t,actual:n}){return`Expecting ${t.LABEL?"`"+t.LABEL+"`":t.name.endsWith(":KW")?`keyword '${t.name.substring(0,t.name.length-3)}'`:`token of type '${t.name}'`} but found \`${n.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:t}){return`Expecting end of file but found \`${t.image}\`.`}},bu=class extends Ru{constructor(t){super(t,!0),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(t){this.resetState();let n=this.lexer.tokenize(t,{mode:"partial"});return this.tokens=n.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(t,n){let r=this.wrapper.DEFINE_RULE(Rv(t.name),this.startImplementation(n).bind(this));return this.allRules.set(t.name,r),t.entry&&(this.mainRule=r),r}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(t){return n=>{let r=this.keepStackSize();try{t(n)}finally{this.resetStackSize(r)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){let t=this.elementStack.length;return this.stackSize=t,t}resetStackSize(t){this.removeUnexpectedElements(),this.stackSize=t}consume(t,n,r){this.wrapper.wrapConsume(t,n),this.isRecording()||(this.lastElementStack=[...this.elementStack,r],this.nextTokenIndex=this.currIdx+1)}subrule(t,n,r,i,o){this.before(i),this.wrapper.wrapSubrule(t,n,o),this.after(i)}before(t){this.isRecording()||this.elementStack.push(t)}after(t){if(!this.isRecording()){let n=this.elementStack.lastIndexOf(t);n>=0&&this.elementStack.splice(n)}}get currIdx(){return this.wrapper.currIdx}},HD={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Na},Nu=class extends wa{constructor(t,n,r){let i=n&&"maxLookahead"in n;super(t,{...HD,lookaheadStrategy:i?new bn({maxLookahead:n.maxLookahead}):new Ra({logging:n.skipValidations?()=>{}:void 0,incomplete:r}),...n})}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(t,n,r){return this.RULE(t,n,r)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(t,n){return this.consume(t,n,void 0)}wrapSubrule(t,n,r){return this.subrule(t,n,{ARGS:[r]})}wrapOr(t,n){this.or(t,n)}wrapOption(t,n){this.option(t,n)}wrapMany(t,n){this.many(t,n)}wrapAtLeastOne(t,n){this.atLeastOne(t,n)}rule(t){return t.call(this,{})}},om=class extends Nu{constructor(t,n,r,i){super(t,n,r),this.task=i}rule(t){this.task.start(),this.task.startSubTask(this.ruleName(t));try{return super.rule(t)}finally{this.task.stopSubTask(this.ruleName(t)),this.task.stop()}}ruleName(t){return t.ruleName}subrule(t,n,r){this.task.startSubTask(this.ruleName(n));try{return super.subrule(t,n,r)}finally{this.task.stopSubTask(this.ruleName(n))}}};function Pu(e,t,n){return zD({parser:t,tokens:n,ruleNames:new Map},e),t}function zD(e,t){let n=ta(t,!1),r=ye(t.rules).filter(lt).filter(o=>n.has(o));for(let o of r){let s={...e,consume:1,optional:1,subrule:1,many:1,or:1};e.parser.rule(o,di(s,o.definition))}let i=ye(t.rules).filter(qr).filter(o=>n.has(o));for(let o of i)e.parser.rule(o,jD(e,o))}function jD(e,t){let n=t.call.rule.ref;if(!n)throw new Error("Could not resolve reference to infix operator rule: "+t.call.rule.$refText);if(xt(n))throw new Error("Cannot use terminal rule in infix expression");let r=t.operators.precedences.flatMap(p=>p.operators),i={$type:"Group",elements:[]},o={$container:i,$type:"Assignment",feature:"parts",operator:"+=",terminal:t.call},s={$container:i,$type:"Group",elements:[],cardinality:"*"};i.elements.push(o,s);let l={$container:s,$type:"Assignment",feature:"operators",operator:"+=",terminal:{$type:"Alternatives",elements:r}},c={...o,$container:s};s.elements.push(l,c);let f=r.map(p=>e.tokens[p.value]).map((p,m)=>({ALT:()=>e.parser.consume(m,p,l)})),d;return p=>{d??(d=am(e,n)),e.parser.subrule(0,d,!1,o,p),e.parser.many(0,{DEF:()=>{e.parser.alternatives(0,f),e.parser.subrule(1,d,!1,c,p)}})}}function di(e,t,n=!1){let r;if(Ht(t))r=QD(e,t);else if(rr(t))r=YD(e,t);else if(ln(t))r=di(e,t.terminal);else if(cn(t))r=Sv(e,t);else if(un(t))r=VD(e,t);else if(Zp(t))r=qD(e,t);else if(th(t))r=ZD(e,t);else if(Kr(t))r=JD(e,t);else if(AE(t)){let i=e.consume++;r=()=>e.parser.consume(i,ft,t)}else throw new Zs(t.$cstNode,`Unexpected element type: ${t.$type}`);return bv(e,n?void 0:Lu(t),r,t.cardinality)}function YD(e,t){let n=or(t);return()=>e.parser.action(n,t)}function VD(e,t){let n=t.rule.ref;if(nr(n)){let r=e.subrule++,i=lt(n)&&n.fragment,o=t.arguments.length>0?KD(n,t.arguments):()=>({}),s;return a=>{s??(s=am(e,n)),e.parser.subrule(r,s,i,t,o(a))}}else if(xt(n)){let r=e.consume++,i=sm(e,n.name);return()=>e.parser.consume(r,i,t)}else if(n)ir(n);else throw new Zs(t.$cstNode,`Undefined rule: ${t.rule.$refText}`)}function KD(e,t){if(t.some(r=>r.calledByName)){let r=t.map(i=>({parameterName:i.parameter?.ref?.name,predicate:hn(i.value)}));return i=>{let o={};for(let{parameterName:s,predicate:a}of r)s&&(o[s]=a(i));return o}}else{let r=t.map(i=>hn(i.value));return i=>{let o={};for(let s=0;s<r.length;s++)if(s<e.parameters.length){let a=e.parameters[s].name,l=r[s];o[a]=l(i)}return o}}}function hn(e){if(vE(e)){let t=hn(e.left),n=hn(e.right);return r=>t(r)||n(r)}else if(_E(e)){let t=hn(e.left),n=hn(e.right);return r=>t(r)&&n(r)}else if(RE(e)){let t=hn(e.value);return n=>!t(n)}else if(SE(e)){let t=e.parameter.ref.name;return n=>n!==void 0&&n[t]===!0}else if(wE(e)){let t=!!e.true;return()=>t}ir(e)}function qD(e,t){if(t.elements.length===1)return di(e,t.elements[0]);{let n=[];for(let i of t.elements){let o={ALT:di(e,i,!0)},s=Lu(i);s&&(o.GATE=hn(s)),n.push(o)}let r=e.or++;return i=>e.parser.alternatives(r,n.map(o=>{let s={ALT:()=>o.ALT(i)},a=o.GATE;return a&&(s.GATE=()=>a(i)),s}))}}function ZD(e,t){if(t.elements.length===1)return di(e,t.elements[0]);let n=[];for(let a of t.elements){let l={ALT:di(e,a,!0)},c=Lu(a);c&&(l.GATE=hn(c)),n.push(l)}let r=e.or++,i=(a,l)=>{let c=l.getRuleStack().join("-");return`uGroup_${a}_${c}`},o=a=>e.parser.alternatives(r,n.map((l,c)=>{let u={ALT:()=>!0},f=e.parser;u.ALT=()=>{if(l.ALT(a),!f.isRecording()){let p=i(r,f);f.unorderedGroups.get(p)||f.unorderedGroups.set(p,[]);let m=f.unorderedGroups.get(p);typeof m?.[c]>"u"&&(m[c]=!0)}};let d=l.GATE;return d?u.GATE=()=>d(a):u.GATE=()=>!f.unorderedGroups.get(i(r,f))?.[c],u})),s=bv(e,Lu(t),o,"*");return a=>{s(a),e.parser.isRecording()||e.parser.unorderedGroups.delete(i(r,e.parser))}}function JD(e,t){let n=t.elements.map(r=>di(e,r));return r=>n.forEach(i=>i(r))}function Lu(e){if(Kr(e))return e.guardCondition}function Sv(e,t,n=t.terminal){if(n)if(un(n)&<(n.rule.ref)){let r=n.rule.ref,i=e.subrule++,o;return s=>{o??(o=am(e,r)),e.parser.subrule(i,o,!1,t,s)}}else if(un(n)&&xt(n.rule.ref)){let r=e.consume++,i=sm(e,n.rule.ref.name);return()=>e.parser.consume(r,i,t)}else if(Ht(n)){let r=e.consume++,i=sm(e,n.value);return()=>e.parser.consume(r,i,t)}else throw new Error("Could not build cross reference parser");else{if(!t.type.ref)throw new Error("Could not resolve reference to type: "+t.type.$refText);let i=gc(t.type.ref)?.terminal;if(!i)throw new Error("Could not find name assignment for type: "+or(t.type.ref));return Sv(e,t,i)}}function QD(e,t){let n=e.consume++,r=e.tokens[t.value];if(!r)throw new Error("Could not find token for keyword: "+t.value);return()=>e.parser.consume(n,r,t)}function bv(e,t,n,r){let i=t&&hn(t);if(!r)if(i){let o=e.or++;return s=>e.parser.alternatives(o,[{ALT:()=>n(s),GATE:()=>i(s)},{ALT:Jc(),GATE:()=>!i(s)}])}else return n;if(r==="*"){let o=e.many++;return s=>e.parser.many(o,{DEF:()=>n(s),GATE:i?()=>i(s):void 0})}else if(r==="+"){let o=e.many++;if(i){let s=e.or++;return a=>e.parser.alternatives(s,[{ALT:()=>e.parser.atLeastOne(o,{DEF:()=>n(a)}),GATE:()=>i(a)},{ALT:Jc(),GATE:()=>!i(a)}])}else return s=>e.parser.atLeastOne(o,{DEF:()=>n(s)})}else if(r==="?"){let o=e.optional++;return s=>e.parser.optional(o,{DEF:()=>n(s),GATE:i?()=>i(s):void 0})}else ir(r)}function am(e,t){let n=eM(e,t),r=e.parser.getRule(n);if(!r)throw new Error(`Rule "${n}" not found."`);return r}function eM(e,t){if(nr(t))return t.name;if(e.ruleNames.has(t))return e.ruleNames.get(t);{let n=t,r=n.$container,i=t.$type;for(;!lt(r);)(Kr(r)||Zp(r)||th(r))&&(i=r.elements.indexOf(n).toString()+":"+i),n=r,r=r.$container;return i=r.name+":"+i,e.ruleNames.set(t,i),i}}function sm(e,t){let n=e.tokens[t];if(!n)throw new Error(`Token "${t}" not found."`);return n}function Nv(e){let t=e.Grammar,n=e.parser.Lexer,r=new bu(e);return Pu(t,r,n.definition),r.finalize(),r}function Lv(e){let t=tM(e);return t.finalize(),t}function tM(e){let t=e.Grammar,n=e.parser.Lexer,r=new Su(e);return Pu(t,r,n.definition)}var Oo=class{constructor(){this.diagnostics=[]}buildTokens(t,n){let r=ye(ta(t,!1)),i=this.buildTerminalTokens(r),o=this.buildKeywordTokens(r,i,n);return o.push(...i),o}flushLexingReport(t){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){let t=[...this.diagnostics];return this.diagnostics=[],t}buildTerminalTokens(t){return t.filter(xt).filter(n=>!n.fragment).map(n=>this.buildTerminalToken(n)).toArray()}buildTerminalToken(t){let n=no(t),r=this.requiresCustomPattern(n)?this.regexPatternFunction(n):n,i={name:t.name,PATTERN:r};return typeof r=="function"&&(i.LINE_BREAKS=!0),t.hidden&&(i.GROUP=mc(n)?Me.SKIPPED:"hidden"),i}requiresCustomPattern(t){return!!(t.flags.includes("u")||t.flags.includes("s"))}regexPatternFunction(t){let n=new RegExp(t,t.flags+"y");return(r,i)=>(n.lastIndex=i,n.exec(r))}buildKeywordTokens(t,n,r){return t.filter(nr).flatMap(i=>sn(i).filter(Ht)).distinct(i=>i.value).toArray().sort((i,o)=>o.value.length-i.value.length).map(i=>this.buildKeywordToken(i,n,!!r?.caseInsensitive))}buildKeywordToken(t,n,r){let i=this.buildKeywordPattern(t,r),o={name:t.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(t,n)};return typeof i=="function"&&(o.LINE_BREAKS=!0),o}buildKeywordPattern(t,n){return n?new RegExp(Qr(t.value),"i"):t.value}findLongerAlt(t,n){return n.reduce((r,i)=>{let o=i?.PATTERN;return o?.source&&zE("^"+o.source+"$",t.value)&&r.push(i),r},[])}};var $o=class{convert(t,n){let r=n.grammarSource;if(cn(r)&&(r=lh(r)),un(r)){let i=r.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,t,n)}return t}runConverter(t,n,r){switch(t.name.toUpperCase()){case"INT":return Cn.convertInt(n);case"STRING":return Cn.convertString(n);case"ID":return Cn.convertID(n)}switch(mh(t)?.toLowerCase()){case"number":return Cn.convertNumber(n);case"boolean":return Cn.convertBoolean(n);case"bigint":return Cn.convertBigint(n);case"date":return Cn.convertDate(n);default:return n}}},Cn;(function(e){function t(c){let u="";for(let f=1;f<c.length-1;f++){let d=c.charAt(f);if(d==="\\"){let p=c.charAt(++f);u+=n(p)}else u+=d}return u}e.convertString=t;function n(c){switch(c){case"b":return"\b";case"f":return"\f";case"n":return`
|
|
118
|
+
`;case"r":return"\r";case"t":return" ";case"v":return"\v";case"0":return"\0";default:return c}}function r(c){return c.charAt(0)==="^"?c.substring(1):c}e.convertID=r;function i(c){return parseInt(c)}e.convertInt=i;function o(c){return BigInt(c)}e.convertBigint=o;function s(c){return new Date(c)}e.convertDate=s;function a(c){return Number(c)}e.convertNumber=a;function l(c){return c.toLowerCase()==="true"}e.convertBoolean=l})(Cn||(Cn={}));var ce=Bp($v()),Du=Bp(mm()),Mu=Bp(Mv()),Um={lspReservedErrorRangeStart:-32899,RequestFailed:-32803,ServerCancelled:-32802,ContentModified:-32801,RequestCancelled:-32800,lspReservedErrorRangeEnd:-32800};function EM(){return new Promise(e=>{typeof setImmediate>"u"?setTimeout(e,0):setImmediate(e)})}var Fu=0,wM=10;function Fv(){return Fu=performance.now(),new ce.CancellationTokenSource}var hi=Symbol("OperationCancelled");function kr(e){return e===hi}async function Ge(e){if(e===ce.CancellationToken.None)return;let t=performance.now();if(t-Fu>=wM&&(Fu=t,await EM(),Fu=performance.now()),e.isCancellationRequested)throw hi}var Ar=class{constructor(){this.promise=new Promise((t,n)=>{this.resolve=r=>(t(r),this),this.reject=r=>(n(r),this)})}};var Bu=class e{constructor(t,n,r,i){this._uri=t,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(t){if(t){let n=this.offsetAt(t.start),r=this.offsetAt(t.end);return this._content.substring(n,r)}return this._content}update(t,n){for(let r of t)if(e.isIncremental(r)){let i=Xv(r.range),o=this.offsetAt(i.start),s=this.offsetAt(i.end);this._content=this._content.substring(0,o)+r.text+this._content.substring(s,this._content.length);let a=Math.max(i.start.line,0),l=Math.max(i.end.line,0),c=this._lineOffsets,u=Bv(r.text,!1,o);if(l-a===u.length)for(let d=0,p=u.length;d<p;d++)c[d+a+1]=u[d];else u.length<1e4?c.splice(a+1,l-a,...u):this._lineOffsets=c=c.slice(0,a+1).concat(u,c.slice(l+1));let f=r.text.length-(s-o);if(f!==0)for(let d=a+1+u.length,p=c.length;d<p;d++)c[d]=c[d]+f}else if(e.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=Bv(this._content,!0)),this._lineOffsets}positionAt(t){t=Math.max(Math.min(t,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return{line:0,character:t};for(;r<i;){let s=Math.floor((r+i)/2);n[s]>t?i=s:r=s+1}let o=r-1;return t=this.ensureBeforeEOL(t,n[o]),{line:o,character:t-n[o]}}offsetAt(t){let n=this.getLineOffsets();if(t.line>=n.length)return this._content.length;if(t.line<0)return 0;let r=n[t.line];if(t.character<=0)return r;let i=t.line+1<n.length?n[t.line+1]:this._content.length,o=Math.min(r+t.character,i);return this.ensureBeforeEOL(o,r)}getLineRange(t){let n=this.getLineOffsets();if(t>=n.length){let s=n.length-1;return{start:{line:s,character:0},end:{line:s,character:this._content.length-n[s]}}}else if(t<0)return{start:{line:0,character:0},end:{line:0,character:0}};let r=n[t],i=t+1<n.length?n[t+1]:this._content.length,o=this.ensureBeforeEOL(i,r);return{start:{line:t,character:0},end:{line:t,character:o-r}}}getEOLCharacters(t){let n=this.getLineOffsets();if(t>=n.length)return"";if(t<0)return"";let r=t+1<n.length?n[t+1]:this._content.length,i=this.ensureBeforeEOL(r,n[t]);return this._content.substring(i,r)}ensureBeforeEOL(t,n){for(;t>n&&Wv(this._content.charCodeAt(t-1));)t--;return t}get lineCount(){return this.getLineOffsets().length}static isIncremental(t){let n=t;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")}static isFull(t){let n=t;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}},La;(function(e){function t(i,o,s,a){return new Bu(i,o,s,a)}e.create=t;function n(i,o,s){if(i instanceof Bu)return i.update(o,s),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}e.update=n;function r(i,o){let s=i.getText(),a=Gm(o.map(TM),(u,f)=>{let d=u.range.start.line-f.range.start.line;return d===0?u.range.start.character-f.range.start.character:d}),l=0,c=[];for(let u of a){let f=i.offsetAt(u.range.start);if(f<l)throw new Error("Overlapping edit");f>l&&c.push(s.substring(l,f)),u.newText.length&&c.push(u.newText),l=i.offsetAt(u.range.end)}return c.push(s.substr(l)),c.join("")}e.applyEdits=r})(La||(La={}));function Gm(e,t){if(e.length<=1)return e;let n=e.length/2|0,r=e.slice(0,n),i=e.slice(n);Gm(r,t),Gm(i,t);let o=0,s=0,a=0;for(;o<r.length&&s<i.length;)t(r[o],i[s])<=0?e[a++]=r[o++]:e[a++]=i[s++];for(;o<r.length;)e[a++]=r[o++];for(;s<i.length;)e[a++]=i[s++];return e}function Bv(e,t,n=0){let r=t?[n]:[];for(let i=0;i<e.length;i++){let o=e.charCodeAt(i);Wv(o)&&(o===13&&i+1<e.length&&e.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function Wv(e){return e===13||e===10}function Xv(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 TM(e){let t=Xv(e.range);return t!==e.range?{newText:e.newText,range:t}:e}var Uv;(()=>{"use strict";var e={975:P=>{function S(I){if(typeof I!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(I))}function b(I,A){for(var v,D="",L=0,B=-1,z=0,G=0;G<=I.length;++G){if(G<I.length)v=I.charCodeAt(G);else{if(v===47)break;v=47}if(v===47){if(!(B===G-1||z===1))if(B!==G-1&&z===2){if(D.length<2||L!==2||D.charCodeAt(D.length-1)!==46||D.charCodeAt(D.length-2)!==46){if(D.length>2){var ee=D.lastIndexOf("/");if(ee!==D.length-1){ee===-1?(D="",L=0):L=(D=D.slice(0,ee)).length-1-D.lastIndexOf("/"),B=G,z=0;continue}}else if(D.length===2||D.length===1){D="",L=0,B=G,z=0;continue}}A&&(D.length>0?D+="/..":D="..",L=2)}else D.length>0?D+="/"+I.slice(B+1,G):D=I.slice(B+1,G),L=G-B-1;B=G,z=0}else v===46&&z!==-1?++z:z=-1}return D}var $={resolve:function(){for(var I,A="",v=!1,D=arguments.length-1;D>=-1&&!v;D--){var L;D>=0?L=arguments[D]:(I===void 0&&(I=process.cwd()),L=I),S(L),L.length!==0&&(A=L+"/"+A,v=L.charCodeAt(0)===47)}return A=b(A,!v),v?A.length>0?"/"+A:"/":A.length>0?A:"."},normalize:function(I){if(S(I),I.length===0)return".";var A=I.charCodeAt(0)===47,v=I.charCodeAt(I.length-1)===47;return(I=b(I,!A)).length!==0||A||(I="."),I.length>0&&v&&(I+="/"),A?"/"+I:I},isAbsolute:function(I){return S(I),I.length>0&&I.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var I,A=0;A<arguments.length;++A){var v=arguments[A];S(v),v.length>0&&(I===void 0?I=v:I+="/"+v)}return I===void 0?".":$.normalize(I)},relative:function(I,A){if(S(I),S(A),I===A||(I=$.resolve(I))===(A=$.resolve(A)))return"";for(var v=1;v<I.length&&I.charCodeAt(v)===47;++v);for(var D=I.length,L=D-v,B=1;B<A.length&&A.charCodeAt(B)===47;++B);for(var z=A.length-B,G=L<z?L:z,ee=-1,Y=0;Y<=G;++Y){if(Y===G){if(z>G){if(A.charCodeAt(B+Y)===47)return A.slice(B+Y+1);if(Y===0)return A.slice(B+Y)}else L>G&&(I.charCodeAt(v+Y)===47?ee=Y:Y===0&&(ee=0));break}var ne=I.charCodeAt(v+Y);if(ne!==A.charCodeAt(B+Y))break;ne===47&&(ee=Y)}var k="";for(Y=v+ee+1;Y<=D;++Y)Y!==D&&I.charCodeAt(Y)!==47||(k.length===0?k+="..":k+="/..");return k.length>0?k+A.slice(B+ee):(B+=ee,A.charCodeAt(B)===47&&++B,A.slice(B))},_makeLong:function(I){return I},dirname:function(I){if(S(I),I.length===0)return".";for(var A=I.charCodeAt(0),v=A===47,D=-1,L=!0,B=I.length-1;B>=1;--B)if((A=I.charCodeAt(B))===47){if(!L){D=B;break}}else L=!1;return D===-1?v?"/":".":v&&D===1?"//":I.slice(0,D)},basename:function(I,A){if(A!==void 0&&typeof A!="string")throw new TypeError('"ext" argument must be a string');S(I);var v,D=0,L=-1,B=!0;if(A!==void 0&&A.length>0&&A.length<=I.length){if(A.length===I.length&&A===I)return"";var z=A.length-1,G=-1;for(v=I.length-1;v>=0;--v){var ee=I.charCodeAt(v);if(ee===47){if(!B){D=v+1;break}}else G===-1&&(B=!1,G=v+1),z>=0&&(ee===A.charCodeAt(z)?--z==-1&&(L=v):(z=-1,L=G))}return D===L?L=G:L===-1&&(L=I.length),I.slice(D,L)}for(v=I.length-1;v>=0;--v)if(I.charCodeAt(v)===47){if(!B){D=v+1;break}}else L===-1&&(B=!1,L=v+1);return L===-1?"":I.slice(D,L)},extname:function(I){S(I);for(var A=-1,v=0,D=-1,L=!0,B=0,z=I.length-1;z>=0;--z){var G=I.charCodeAt(z);if(G!==47)D===-1&&(L=!1,D=z+1),G===46?A===-1?A=z:B!==1&&(B=1):A!==-1&&(B=-1);else if(!L){v=z+1;break}}return A===-1||D===-1||B===0||B===1&&A===D-1&&A===v+1?"":I.slice(A,D)},format:function(I){if(I===null||typeof I!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof I);return(function(A,v){var D=v.dir||v.root,L=v.base||(v.name||"")+(v.ext||"");return D?D===v.root?D+L:D+"/"+L:L})(0,I)},parse:function(I){S(I);var A={root:"",dir:"",base:"",ext:"",name:""};if(I.length===0)return A;var v,D=I.charCodeAt(0),L=D===47;L?(A.root="/",v=1):v=0;for(var B=-1,z=0,G=-1,ee=!0,Y=I.length-1,ne=0;Y>=v;--Y)if((D=I.charCodeAt(Y))!==47)G===-1&&(ee=!1,G=Y+1),D===46?B===-1?B=Y:ne!==1&&(ne=1):B!==-1&&(ne=-1);else if(!ee){z=Y+1;break}return B===-1||G===-1||ne===0||ne===1&&B===G-1&&B===z+1?G!==-1&&(A.base=A.name=z===0&&L?I.slice(1,G):I.slice(z,G)):(z===0&&L?(A.name=I.slice(1,B),A.base=I.slice(1,G)):(A.name=I.slice(z,B),A.base=I.slice(z,G)),A.ext=I.slice(B,G)),z>0?A.dir=I.slice(0,z-1):L&&(A.dir="/"),A},sep:"/",delimiter:":",win32:null,posix:null};$.posix=$,P.exports=$}},t={};function n(P){var S=t[P];if(S!==void 0)return S.exports;var b=t[P]={exports:{}};return e[P](b,b.exports,n),b.exports}n.d=(P,S)=>{for(var b in S)n.o(S,b)&&!n.o(P,b)&&Object.defineProperty(P,b,{enumerable:!0,get:S[b]})},n.o=(P,S)=>Object.prototype.hasOwnProperty.call(P,S),n.r=P=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(P,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(P,"__esModule",{value:!0})};var r={};let i;n.r(r),n.d(r,{URI:()=>d,Utils:()=>j}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);let o=/^\w[\w\d+.-]*$/,s=/^\//,a=/^\/\//;function l(P,S){if(!P.scheme&&S)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${P.authority}", path: "${P.path}", query: "${P.query}", fragment: "${P.fragment}"}`);if(P.scheme&&!o.test(P.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(P.path){if(P.authority){if(!s.test(P.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(a.test(P.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}let c="",u="/",f=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class d{constructor(S,b,$,I,A,v=!1){M(this,"scheme");M(this,"authority");M(this,"path");M(this,"query");M(this,"fragment");typeof S=="object"?(this.scheme=S.scheme||c,this.authority=S.authority||c,this.path=S.path||c,this.query=S.query||c,this.fragment=S.fragment||c):(this.scheme=(function(D,L){return D||L?D:"file"})(S,v),this.authority=b||c,this.path=(function(D,L){switch(D){case"https":case"http":case"file":L?L[0]!==u&&(L=u+L):L=u}return L})(this.scheme,$||c),this.query=I||c,this.fragment=A||c,l(this,v))}static isUri(S){return S instanceof d||!!S&&typeof S.authority=="string"&&typeof S.fragment=="string"&&typeof S.path=="string"&&typeof S.query=="string"&&typeof S.scheme=="string"&&typeof S.fsPath=="string"&&typeof S.with=="function"&&typeof S.toString=="function"}get fsPath(){return y(this,!1)}with(S){if(!S)return this;let{scheme:b,authority:$,path:I,query:A,fragment:v}=S;return b===void 0?b=this.scheme:b===null&&(b=c),$===void 0?$=this.authority:$===null&&($=c),I===void 0?I=this.path:I===null&&(I=c),A===void 0?A=this.query:A===null&&(A=c),v===void 0?v=this.fragment:v===null&&(v=c),b===this.scheme&&$===this.authority&&I===this.path&&A===this.query&&v===this.fragment?this:new m(b,$,I,A,v)}static parse(S,b=!1){let $=f.exec(S);return $?new m($[2]||c,R($[4]||c),R($[5]||c),R($[7]||c),R($[9]||c),b):new m(c,c,c,c,c)}static file(S){let b=c;if(i&&(S=S.replace(/\\/g,u)),S[0]===u&&S[1]===u){let $=S.indexOf(u,2);$===-1?(b=S.substring(2),S=u):(b=S.substring(2,$),S=S.substring($)||u)}return new m("file",b,S,c,c)}static from(S){let b=new m(S.scheme,S.authority,S.path,S.query,S.fragment);return l(b,!0),b}toString(S=!1){return T(this,S)}toJSON(){return this}static revive(S){if(S){if(S instanceof d)return S;{let b=new m(S);return b._formatted=S.external,b._fsPath=S._sep===p?S.fsPath:null,b}}return S}}let p=i?1:void 0;class m extends d{constructor(){super(...arguments);M(this,"_formatted",null);M(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=y(this,!1)),this._fsPath}toString(b=!1){return b?T(this,!0):(this._formatted||(this._formatted=T(this,!1)),this._formatted)}toJSON(){let b={$mid:1};return this._fsPath&&(b.fsPath=this._fsPath,b._sep=p),this._formatted&&(b.external=this._formatted),this.path&&(b.path=this.path),this.scheme&&(b.scheme=this.scheme),this.authority&&(b.authority=this.authority),this.query&&(b.query=this.query),this.fragment&&(b.fragment=this.fragment),b}}let g={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function w(P,S,b){let $,I=-1;for(let A=0;A<P.length;A++){let v=P.charCodeAt(A);if(v>=97&&v<=122||v>=65&&v<=90||v>=48&&v<=57||v===45||v===46||v===95||v===126||S&&v===47||b&&v===91||b&&v===93||b&&v===58)I!==-1&&($+=encodeURIComponent(P.substring(I,A)),I=-1),$!==void 0&&($+=P.charAt(A));else{$===void 0&&($=P.substr(0,A));let D=g[v];D!==void 0?(I!==-1&&($+=encodeURIComponent(P.substring(I,A)),I=-1),$+=D):I===-1&&(I=A)}}return I!==-1&&($+=encodeURIComponent(P.substring(I))),$!==void 0?$:P}function x(P){let S;for(let b=0;b<P.length;b++){let $=P.charCodeAt(b);$===35||$===63?(S===void 0&&(S=P.substr(0,b)),S+=g[$]):S!==void 0&&(S+=P[b])}return S!==void 0?S:P}function y(P,S){let b;return b=P.authority&&P.path.length>1&&P.scheme==="file"?`//${P.authority}${P.path}`:P.path.charCodeAt(0)===47&&(P.path.charCodeAt(1)>=65&&P.path.charCodeAt(1)<=90||P.path.charCodeAt(1)>=97&&P.path.charCodeAt(1)<=122)&&P.path.charCodeAt(2)===58?S?P.path.substr(1):P.path[1].toLowerCase()+P.path.substr(2):P.path,i&&(b=b.replace(/\//g,"\\")),b}function T(P,S){let b=S?x:w,$="",{scheme:I,authority:A,path:v,query:D,fragment:L}=P;if(I&&($+=I,$+=":"),(A||I==="file")&&($+=u,$+=u),A){let B=A.indexOf("@");if(B!==-1){let z=A.substr(0,B);A=A.substr(B+1),B=z.lastIndexOf(":"),B===-1?$+=b(z,!1,!1):($+=b(z.substr(0,B),!1,!1),$+=":",$+=b(z.substr(B+1),!1,!0)),$+="@"}A=A.toLowerCase(),B=A.lastIndexOf(":"),B===-1?$+=b(A,!1,!0):($+=b(A.substr(0,B),!1,!0),$+=A.substr(B))}if(v){if(v.length>=3&&v.charCodeAt(0)===47&&v.charCodeAt(2)===58){let B=v.charCodeAt(1);B>=65&&B<=90&&(v=`/${String.fromCharCode(B+32)}:${v.substr(3)}`)}else if(v.length>=2&&v.charCodeAt(1)===58){let B=v.charCodeAt(0);B>=65&&B<=90&&(v=`${String.fromCharCode(B+32)}:${v.substr(2)}`)}$+=b(v,!0,!1)}return D&&($+="?",$+=b(D,!1,!1)),L&&($+="#",$+=S?L:w(L,!1,!1)),$}function E(P){try{return decodeURIComponent(P)}catch{return P.length>3?P.substr(0,3)+E(P.substr(3)):P}}let _=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function R(P){return P.match(_)?P.replace(_,(S=>E(S))):P}var F=n(975);let C=F.posix||F,W="/";var j;(function(P){P.joinPath=function(S,...b){return S.with({path:C.join(S.path,...b)})},P.resolvePath=function(S,...b){let $=S.path,I=!1;$[0]!==W&&($=W+$,I=!0);let A=C.resolve($,...b);return I&&A[0]===W&&!S.authority&&(A=A.substring(1)),S.with({path:A})},P.dirname=function(S){if(S.path.length===0||S.path===W)return S;let b=C.dirname(S.path);return b.length===1&&b.charCodeAt(0)===46&&(b=""),S.with({path:b})},P.basename=function(S){return C.basename(S.path)},P.extname=function(S){return C.extname(S.path)}})(j||(j={})),Uv=r})();var{URI:Oe,Utils:Do}=Uv;var et;(function(e){e.basename=Do.basename,e.dirname=Do.dirname,e.extname=Do.extname,e.joinPath=Do.joinPath,e.resolvePath=Do.resolvePath;let t=typeof process=="object"&&process?.platform==="win32";function n(s,a){return s?.toString()===a?.toString()}e.equals=n;function r(s,a){let l=typeof s=="string"?Oe.parse(s).path:s.path,c=typeof a=="string"?Oe.parse(a).path:a.path,u=l.split("/").filter(g=>g.length>0),f=c.split("/").filter(g=>g.length>0);if(t){let g=/^[A-Z]:$/;if(u[0]&&g.test(u[0])&&(u[0]=u[0].toLowerCase()),f[0]&&g.test(f[0])&&(f[0]=f[0].toLowerCase()),u[0]!==f[0])return c.substring(1)}let d=0;for(;d<u.length&&u[d]===f[d];d++);let p="../".repeat(u.length-d),m=f.slice(d).join("/");return p+m}e.relative=r;function i(s){return Oe.parse(s.toString()).toString()}e.normalize=i;function o(s,a){let l=typeof s=="string"?Oe.parse(s):s,c=typeof a=="string"?Oe.parse(a):a;if(l.scheme!==c.scheme)return!1;let u=l.path,f=c.path;return f.charAt(f.length-1)==="/"&&(f=f.slice(0,-1)),u.charAt(u.length-1)==="/"&&(u=u.slice(0,-1)),f===u?!0:f.length<u.length||f.charAt(u.length)!=="/"?!1:f.startsWith(u)}e.contains=o})(et||(et={}));var Wu=class{constructor(){this.root={name:"",children:new Map}}normalizeUri(t){return et.normalize(t)}clear(){this.root.children.clear()}insert(t,n){let r=this.getNode(this.normalizeUri(t),!0);r.element=n}delete(t){let n=this.getNode(this.normalizeUri(t),!1);n?.parent&&n.parent.children.delete(n.name)}has(t){return this.getNode(this.normalizeUri(t),!1)?.element!==void 0}hasNode(t){return this.getNode(this.normalizeUri(t),!1)!==void 0}find(t){return this.getNode(this.normalizeUri(t),!1)?.element}findNode(t){let n=this.normalizeUri(t),r=this.getNode(n,!1);if(r)return{name:r.name,uri:et.joinPath(Oe.parse(n),r.name).toString(),element:r.element}}findChildren(t){let n=this.normalizeUri(t),r=this.getNode(n,!1);return r?Array.from(r.children.values()).map(i=>({name:i.name,uri:et.joinPath(Oe.parse(n),i.name).toString(),element:i.element})):[]}all(){return this.collectValues(this.root)}findAll(t){let n=this.getNode(this.normalizeUri(t),!1);return n?this.collectValues(n):[]}getNode(t,n){let r=t.split("/");t.charAt(t.length-1)==="/"&&r.pop();let i=this.root;for(let o of r){let s=i.children.get(o);if(!s)if(n)s={name:o,children:new Map,parent:i},i.children.set(o,s);else return;i=s}return i}collectValues(t){let n=[];t.element&&n.push(t.element);for(let r of t.children.values())n.push(...this.collectValues(r));return n}};var ue;(function(e){e[e.Changed=0]="Changed",e[e.Parsed=1]="Parsed",e[e.IndexedContent=2]="IndexedContent",e[e.ComputedScopes=3]="ComputedScopes",e[e.Linked=4]="Linked",e[e.IndexedReferences=5]="IndexedReferences",e[e.Validated=6]="Validated"})(ue||(ue={}));var Xu=class{constructor(t){this.serviceRegistry=t.ServiceRegistry,this.textDocuments=t.workspace.TextDocuments,this.fileSystemProvider=t.workspace.FileSystemProvider}async fromUri(t,n=ce.CancellationToken.None){let r=await this.getInitialText(t,n);return this.createAsync(t,r,n)}async getInitialText(t,n){return this.fileSystemProvider.readFile(t)}fromTextDocument(t,n,r){return n=n??Oe.parse(t.uri),ce.CancellationToken.is(r)?this.createAsync(n,t,r):this.create(n,t,r)}fromString(t,n,r){return ce.CancellationToken.is(r)?this.createAsync(n,t,r):this.create(n,t,r)}fromModel(t,n){return this.create(n,{$model:t})}create(t,n,r){if(typeof n=="string"){let i=this.parse(t,n,r);return this.createLangiumDocument(i,t,void 0,n)}else if("$model"in n){let i={value:n.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,t)}else{let i=this.parse(t,n.getText(),r);return this.createLangiumDocument(i,t,n)}}async createAsync(t,n,r){if(typeof n=="string"){let i=await this.parseAsync(t,n,r);return this.createLangiumDocument(i,t,void 0,n)}else{let i=await this.parseAsync(t,n.getText(),r);return this.createLangiumDocument(i,t,n)}}createLangiumDocument(t,n,r,i){let o;if(r)o={parseResult:t,uri:n,state:ue.Parsed,references:[],textDocument:r};else{let s=this.createTextDocumentGetter(n,i);o={parseResult:t,uri:n,state:ue.Parsed,references:[],get textDocument(){return s()}}}return t.value.$document=o,o}async update(t,n){let r=t.parseResult.value.$cstNode?.root.fullText,i=this.textDocuments?.get(t.uri.toString()),o=await this.getUpdatedText(t,i,n);if(i)Object.defineProperty(t,"textDocument",{value:i});else{let s=this.createTextDocumentGetter(t.uri,o);Object.defineProperty(t,"textDocument",{get:s})}return r!==o&&(t.parseResult=await this.parseAsync(t.uri,o,n),t.parseResult.value.$document=t),t.state=ue.Parsed,t}async getUpdatedText(t,n,r){return n?n.getText():await this.fileSystemProvider.readFile(t.uri)}parse(t,n,r){return this.serviceRegistry.getServices(t).parser.LangiumParser.parse(n,r)}parseAsync(t,n,r){return this.serviceRegistry.getServices(t).parser.AsyncParser.parse(n,r)}createTextDocumentGetter(t,n){let r=this.serviceRegistry,i;return()=>i??(i=La.create(t.toString(),r.getServices(t).LanguageMetaData.languageId,0,n??""))}},Uu=class{constructor(t){this.documentTrie=new Wu,this.services=t,this.langiumDocumentFactory=t.workspace.LangiumDocumentFactory,this.documentBuilder=()=>t.workspace.DocumentBuilder}get all(){return ye(this.documentTrie.all())}addDocument(t){let n=t.uri.toString();if(this.documentTrie.has(n))throw new Error(`A document with the URI '${n}' is already present.`);this.documentTrie.insert(n,t)}getDocument(t){let n=t.toString();return this.documentTrie.find(n)}getDocuments(t){let n=t.toString();return this.documentTrie.findAll(n)}async getOrCreateDocument(t,n){let r=this.getDocument(t);return r||(r=await this.langiumDocumentFactory.fromUri(t,n),this.addDocument(r),r)}createDocument(t,n,r){if(r)return this.langiumDocumentFactory.fromString(n,t,r).then(i=>(this.addDocument(i),i));{let i=this.langiumDocumentFactory.fromString(n,t);return this.addDocument(i),i}}hasDocument(t){return this.documentTrie.has(t.toString())}invalidateDocument(t){let n=t.toString(),r=this.documentTrie.find(n);return r&&this.documentBuilder().resetToState(r,ue.Changed),r}deleteDocument(t){let n=t.toString(),r=this.documentTrie.find(n);return r&&(r.state=ue.Changed,this.documentTrie.delete(n)),r}deleteDocuments(t){let n=t.toString(),r=this.documentTrie.findAll(n);for(let i of r)i.state=ue.Changed;return this.documentTrie.delete(n),r}};var Mo=Symbol("RefResolving"),Hm=class{constructor(t,n,r,i,o){this.resolver=t,this.node=n,this.property=r,this._ref=void 0,this.$refNode=i,this.$refText=o}get ref(){return this.resolver.resolveReference(this,this.node,this.property)}get $nodeDescription(){return this._nodeDescription}get error(){return Gi(this._ref)?this._ref:void 0}},zm=class{constructor(t,n,r,i,o){this.resolver=t,this.node=n,this.property=r,this._items=void 0,this.$refNode=i,this.$refText=o}get items(){return this.resolver.resolveMultiReference(this,this.node,this.property)}get error(){return this._linkingError}},Gu=class{constructor(t){this.reflection=t.shared.AstReflection,this.langiumDocuments=()=>t.shared.workspace.LangiumDocuments,this.scopeProvider=t.references.ScopeProvider,this.astNodeLocator=t.workspace.AstNodeLocator,this.profiler=t.shared.profilers.LangiumProfiler,this.languageId=t.LanguageMetaData.languageId,this.referenceResolver={resolveReference:this.resolveReference.bind(this),resolveMultiReference:this.resolveMultiReference.bind(this)}}async link(t,n=ce.CancellationToken.None){if(this.profiler?.isActive("linking")){let r=this.profiler.createTask("linking",this.languageId);r.start();try{for(let i of yt(t.parseResult.value))await Ge(n),Gr(i).forEach(o=>{let s=`${i.$type}:${o.property}`;r.startSubTask(s);try{this.doLink(o,t)}finally{r.stopSubTask(s)}})}finally{r.stop()}}else for(let r of yt(t.parseResult.value))await Ge(n),Gr(r).forEach(i=>this.doLink(i,t))}doLink(t,n){let r=t.reference;if("_ref"in r&&r._ref===void 0){r._ref=Mo;try{let i=this.getCandidate(t);if(Gi(i))r._ref=i;else{r._nodeDescription=i;let o=this.loadAstNode(i);r._ref=o??this.createLinkingError(t,i)}}catch(i){console.error(`An error occurred while resolving reference to '${r.$refText}':`,i);let o=i.message??String(i);r._ref={info:t,message:`An error occurred while resolving reference to '${r.$refText}': ${o}`}}n.references.push(r)}else if("_items"in r&&r._items===void 0){r._items=Mo;try{let i=this.getCandidates(t),o=[];if(Gi(i))r._linkingError=i;else for(let s of i){let a=this.loadAstNode(s);a&&o.push({ref:a,$nodeDescription:s})}r._items=o}catch(i){r._linkingError={info:t,message:`An error occurred while resolving reference to '${r.$refText}': ${i}`},r._items=[]}n.references.push(r)}}unlink(t){for(let n of t.references)"_ref"in n?(n._ref=void 0,delete n._nodeDescription):"_items"in n&&(n._items=void 0,delete n._linkingError);t.references=[]}getCandidate(t){return this.scopeProvider.getScope(t).getElement(t.reference.$refText)??this.createLinkingError(t)}getCandidates(t){let r=this.scopeProvider.getScope(t).getElements(t.reference.$refText).distinct(i=>`${i.documentUri}#${i.path}`).toArray();return r.length>0?r:this.createLinkingError(t)}buildReference(t,n,r,i){return new Hm(this.referenceResolver,t,n,r,i)}buildMultiReference(t,n,r,i){return new zm(this.referenceResolver,t,n,r,i)}resolveReference(t,n,r){if(Ue(t._ref))return t._ref;if(uE(t._nodeDescription)){let i=this.loadAstNode(t._nodeDescription);t._ref=i??this.createLinkingError({reference:t,container:n,property:r},t._nodeDescription)}else if(t._ref===void 0){t._ref=Mo;let i=Ws(n).$document,o=this.getLinkedNode({reference:t,container:n,property:r});if(o.error&&i&&i.state<ue.ComputedScopes)return t._ref=void 0;t._ref=o.node??o.error,t._nodeDescription=o.descr,i?.references.push(t)}else t._ref===Mo&&this.throwCyclicReferenceError(n,r,t.$refText);return Ue(t._ref)?t._ref:void 0}resolveMultiReference(t,n,r){if(Array.isArray(t._items))return t._items;if(t._items===void 0){t._items=Mo;let i=Ws(n).$document,o=this.getCandidates({reference:t,container:n,property:r}),s=[];if(Gi(o))t._linkingError=o;else{for(let a of o){let l=this.loadAstNode(a);l&&s.push({ref:l,$nodeDescription:a})}s.length===0&&(t._linkingError=this.createLinkingError({reference:t,container:n,property:r}))}t._items=s,i?.references.push(t)}else t._items===Mo&&this.throwCyclicReferenceError(n,r,t.$refText);return Array.isArray(t._items)?t._items:[]}throwCyclicReferenceError(t,n,r){throw new Error(`Cyclic reference resolution detected: ${this.astNodeLocator.getAstNodePath(t)}/${n} (symbol '${r}')`)}getLinkedNode(t){try{let n=this.getCandidate(t);if(Gi(n))return{error:n};let r=this.loadAstNode(n);return r?{node:r,descr:n}:{descr:n,error:this.createLinkingError(t,n)}}catch(n){console.error(`An error occurred while resolving reference to '${t.reference.$refText}':`,n);let r=n.message??String(n);return{error:{info:t,message:`An error occurred while resolving reference to '${t.reference.$refText}': ${r}`}}}}loadAstNode(t){if(t.node)return t.node;let n=this.langiumDocuments().getDocument(t.documentUri);if(n)return this.astNodeLocator.getAstNode(n.parseResult.value,t.path)}createLinkingError(t,n){let r=Ws(t.container).$document;r&&r.state<ue.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${r.uri}).`);let i=this.reflection.getReferenceType(t);return{info:t,message:`Could not resolve reference to ${i} named '${t.reference.$refText}'.`,targetDescription:n}}};function _M(e){return typeof e.name=="string"}var Hu=class{getName(t){if(_M(t))return t.name}getNameNode(t){return na(t.$cstNode,"name")}};var zu=class{constructor(t){this.nameProvider=t.references.NameProvider,this.index=t.shared.workspace.IndexManager,this.nodeLocator=t.workspace.AstNodeLocator,this.documents=t.shared.workspace.LangiumDocuments,this.hasMultiReference=yt(t.Grammar).some(n=>cn(n)&&n.isMulti)}findDeclarations(t){if(t){let n=hh(t),r=t.astNode;if(n&&r){let i=r[n.feature];if(it(i)||Ct(i))return Xp(i);if(Array.isArray(i)){for(let o of i)if((it(o)||Ct(o))&&o.$refNode&&o.$refNode.offset<=t.offset&&o.$refNode.end>=t.end)return Xp(o)}}if(r){let i=this.nameProvider.getNameNode(r);if(i&&(i===t||BE(t,i)))return this.getSelfNodes(r)}}return[]}getSelfNodes(t){if(this.hasMultiReference){let n=this.index.findAllReferences(t,this.nodeLocator.getAstNodePath(t)),r=this.getNodeFromReferenceDescription(n.head());if(r){for(let i of Gr(r))if(Ct(i.reference)&&i.reference.items.some(o=>o.ref===t))return i.reference.items.map(o=>o.ref)}return[t]}else return[t]}getNodeFromReferenceDescription(t){if(!t)return;let n=this.documents.getDocument(t.sourceUri);if(n)return this.nodeLocator.getAstNode(n.parseResult.value,t.sourcePath)}findDeclarationNodes(t){let n=this.findDeclarations(t),r=[];for(let i of n){let o=this.nameProvider.getNameNode(i)??i.$cstNode;o&&r.push(o)}return r}findReferences(t,n){let r=[];n.includeDeclaration&&r.push(...this.getSelfReferences(t));let i=this.index.findAllReferences(t,this.nodeLocator.getAstNodePath(t));return n.documentUri&&(i=i.filter(o=>et.equals(o.sourceUri,n.documentUri))),r.push(...i),ye(r)}getSelfReferences(t){let n=this.getSelfNodes(t),r=[];for(let i of n){let o=this.nameProvider.getNameNode(i);if(o){let s=at(i),a=this.nodeLocator.getAstNodePath(i);r.push({sourceUri:s.uri,sourcePath:a,targetUri:s.uri,targetPath:a,segment:eo(o),local:!0})}}return r}};var Kt=class{constructor(t){if(this.map=new Map,t)for(let[n,r]of t)this.add(n,r)}get size(){return Zl.sum(ye(this.map.values()).map(t=>t.length))}clear(){this.map.clear()}delete(t,n){if(n===void 0)return this.map.delete(t);{let r=this.map.get(t);if(r){let i=r.indexOf(n);if(i>=0)return r.length===1?this.map.delete(t):r.splice(i,1),!0}return!1}}get(t){return this.map.get(t)??[]}getStream(t){let n=this.map.get(t);return n?ye(n):Jl}has(t,n){if(n===void 0)return this.map.has(t);{let r=this.map.get(t);return r?r.indexOf(n)>=0:!1}}add(t,n){return this.map.has(t)?this.map.get(t).push(n):this.map.set(t,[n]),this}addAll(t,n){return this.map.has(t)?this.map.get(t).push(...n):this.map.set(t,Array.from(n)),this}forEach(t){this.map.forEach((n,r)=>n.forEach(i=>t(i,r,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return ye(this.map.entries()).flatMap(([t,n])=>n.map(r=>[t,r]))}keys(){return ye(this.map.keys())}values(){return ye(this.map.values()).flat()}entriesGroupedByKey(){return ye(this.map.entries())}},Pa=class{get size(){return this.map.size}constructor(t){if(this.map=new Map,this.inverse=new Map,t)for(let[n,r]of t)this.set(n,r)}clear(){this.map.clear(),this.inverse.clear()}set(t,n){return this.map.set(t,n),this.inverse.set(n,t),this}get(t){return this.map.get(t)}getKey(t){return this.inverse.get(t)}delete(t){let n=this.map.get(t);return n!==void 0?(this.map.delete(t),this.inverse.delete(n),!0):!1}};var ju=class{constructor(t){this.nameProvider=t.references.NameProvider,this.descriptions=t.workspace.AstNodeDescriptionProvider}async collectExportedSymbols(t,n=ce.CancellationToken.None){return this.collectExportedSymbolsForNode(t.parseResult.value,t,void 0,n)}async collectExportedSymbolsForNode(t,n,r=ec,i=ce.CancellationToken.None){let o=[];this.addExportedSymbol(t,o,n);for(let s of r(t))await Ge(i),this.addExportedSymbol(s,o,n);return o}addExportedSymbol(t,n,r){let i=this.nameProvider.getName(t);i&&n.push(this.descriptions.createDescription(t,i,r))}async collectLocalSymbols(t,n=ce.CancellationToken.None){let r=t.parseResult.value,i=new Kt;for(let o of sn(r))await Ge(n),this.addLocalSymbol(o,t,i);return i}addLocalSymbol(t,n,r){let i=t.$container;if(i){let o=this.nameProvider.getName(t);o&&r.add(i,this.descriptions.createDescription(t,o,n))}}};var Ca=class{constructor(t,n,r){this.elements=t,this.outerScope=n,this.caseInsensitive=r?.caseInsensitive??!1,this.concatOuterScope=r?.concatOuterScope??!0}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(t){let n=this.caseInsensitive?t.toLowerCase():t,r=this.caseInsensitive?this.elements.find(i=>i.name.toLowerCase()===n):this.elements.find(i=>i.name===t);if(r)return r;if(this.outerScope)return this.outerScope.getElement(t)}getElements(t){let n=this.caseInsensitive?t.toLowerCase():t,r=this.caseInsensitive?this.elements.filter(i=>i.name.toLowerCase()===n):this.elements.filter(i=>i.name===t);return(this.concatOuterScope||r.isEmpty())&&this.outerScope?r.concat(this.outerScope.getElements(t)):r}};var Yu=class{constructor(t,n,r){this.elements=new Kt,this.caseInsensitive=r?.caseInsensitive??!1,this.concatOuterScope=r?.concatOuterScope??!0;for(let i of t){let o=this.caseInsensitive?i.name.toLowerCase():i.name;this.elements.add(o,i)}this.outerScope=n}getElement(t){let n=this.caseInsensitive?t.toLowerCase():t,r=this.elements.get(n)[0];if(r)return r;if(this.outerScope)return this.outerScope.getElement(t)}getElements(t){let n=this.caseInsensitive?t.toLowerCase():t,r=this.elements.get(n);return(this.concatOuterScope||r.length===0)&&this.outerScope?ye(r).concat(this.outerScope.getElements(t)):ye(r)}getAllElements(){let t=ye(this.elements.values());return this.outerScope&&(t=t.concat(this.outerScope.getAllElements())),t}};var Vu=class{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(t){this.toDispose.push(t)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(t=>t.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}},jm=class extends Vu{constructor(){super(...arguments),this.cache=new Map}has(t){return this.throwIfDisposed(),this.cache.has(t)}set(t,n){this.throwIfDisposed(),this.cache.set(t,n)}get(t,n){if(this.throwIfDisposed(),this.cache.has(t))return this.cache.get(t);if(n){let r=n();return this.cache.set(t,r),r}else return}delete(t){return this.throwIfDisposed(),this.cache.delete(t)}clear(){this.throwIfDisposed(),this.cache.clear()}},Ku=class extends Vu{constructor(t){super(),this.cache=new Map,this.converter=t??(n=>n)}has(t,n){return this.throwIfDisposed(),this.cacheForContext(t).has(n)}set(t,n,r){this.throwIfDisposed(),this.cacheForContext(t).set(n,r)}get(t,n,r){this.throwIfDisposed();let i=this.cacheForContext(t);if(i.has(n))return i.get(n);if(r){let o=r();return i.set(n,o),o}else return}delete(t,n){return this.throwIfDisposed(),this.cacheForContext(t).delete(n)}clear(t){if(this.throwIfDisposed(),t){let n=this.converter(t);this.cache.delete(n)}else this.cache.clear()}cacheForContext(t){let n=this.converter(t),r=this.cache.get(n);return r||(r=new Map,this.cache.set(n,r)),r}};var qu=class extends jm{constructor(t,n){super(),n?(this.toDispose.push(t.workspace.DocumentBuilder.onBuildPhase(n,()=>{this.clear()})),this.toDispose.push(t.workspace.DocumentBuilder.onUpdate((r,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(t.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}};var Zu=class{constructor(t){this.reflection=t.shared.AstReflection,this.nameProvider=t.references.NameProvider,this.descriptions=t.workspace.AstNodeDescriptionProvider,this.indexManager=t.shared.workspace.IndexManager,this.globalScopeCache=new qu(t.shared)}getScope(t){let n=[],r=this.reflection.getReferenceType(t),i=at(t.container).localSymbols;if(i){let s=t.container;do i.has(s)&&n.push(i.getStream(s).filter(a=>this.reflection.isSubtype(a.type,r))),s=s.$container;while(s)}let o=this.getGlobalScope(r,t);for(let s=n.length-1;s>=0;s--)o=this.createScope(n[s],o);return o}createScope(t,n,r){return new Ca(ye(t),n,r)}createScopeForNodes(t,n,r){let i=ye(t).map(o=>{let s=this.nameProvider.getName(o);if(s)return this.descriptions.createDescription(o,s)}).nonNullable();return new Ca(i,n,r)}getGlobalScope(t,n){return this.globalScopeCache.get(t,()=>new Yu(this.indexManager.allElements(t)))}};function Hv(e){return typeof e.$comment=="string"}function Gv(e){return typeof e=="object"&&!!e&&("$ref"in e||"$refs"in e||"$error"in e)}var Ju=class{constructor(t){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=t.shared.workspace.LangiumDocuments,this.astNodeLocator=t.workspace.AstNodeLocator,this.nameProvider=t.references.NameProvider,this.commentProvider=t.documentation.CommentProvider}serialize(t,n){let r=n??{},i=n?.replacer,o=(a,l)=>this.replacer(a,l,r),s=i?(a,l)=>i(a,l,o):o;try{return this.currentDocument=at(t),JSON.stringify(t,s,n?.space)}finally{this.currentDocument=void 0}}deserialize(t,n){let r=n??{},i=JSON.parse(t);return this.linkNode(i,i,r),i}replacer(t,n,{refText:r,sourceText:i,textRegions:o,comments:s,uriConverter:a}){if(!this.ignoreProperties.has(t))if(it(n)){let l=n.ref,c=r?n.$refText:void 0;if(l){let u=at(l),f="";this.currentDocument&&this.currentDocument!==u&&(a?f=a(u.uri,l):f=u.uri.toString());let d=this.astNodeLocator.getAstNodePath(l);return{$ref:`${f}#${d}`,$refText:c}}else return{$error:n.error?.message??"Could not resolve reference",$refText:c}}else if(Ct(n)){let l=r?n.$refText:void 0,c=[];for(let u of n.items){let f=u.ref,d=at(u.ref),p="";this.currentDocument&&this.currentDocument!==d&&(a?p=a(d.uri,f):p=d.uri.toString());let m=this.astNodeLocator.getAstNodePath(f);c.push(`${p}#${m}`)}return{$refs:c,$refText:l}}else if(Ue(n)){let l;if(o&&(l=this.addAstNodeRegionWithAssignmentsTo({...n}),(!t||n.$document)&&l?.$textRegion&&(l.$textRegion.documentURI=this.currentDocument?.uri.toString())),i&&!t&&(l??(l={...n}),l.$sourceText=n.$cstNode?.text),s){l??(l={...n});let c=this.commentProvider.getComment(n);c&&(l.$comment=c.replace(/\r/g,""))}return l??n}else return n}addAstNodeRegionWithAssignmentsTo(t){let n=r=>({offset:r.offset,end:r.end,length:r.length,range:r.range});if(t.$cstNode){let r=t.$textRegion=n(t.$cstNode),i=r.assignments={};return Object.keys(t).filter(o=>!o.startsWith("$")).forEach(o=>{let s=uh(t.$cstNode,o).map(n);s.length!==0&&(i[o]=s)}),t}}linkNode(t,n,r,i,o,s){for(let[l,c]of Object.entries(t))if(Array.isArray(c))for(let u=0;u<c.length;u++){let f=c[u];Gv(f)?c[u]=this.reviveReference(t,l,n,f,r):Ue(f)&&this.linkNode(f,n,r,t,l,u)}else Gv(c)?t[l]=this.reviveReference(t,l,n,c,r):Ue(c)&&this.linkNode(c,n,r,t,l);let a=t;a.$container=i,a.$containerProperty=o,a.$containerIndex=s}reviveReference(t,n,r,i,o){let s=i.$refText,a=i.$error,l;if(i.$ref){let c=this.getRefNode(r,i.$ref,o.uriConverter);if(Ue(c))return s||(s=this.nameProvider.getName(c)),{$refText:s??"",ref:c};a=c}else if(i.$refs){let c=[];for(let u of i.$refs){let f=this.getRefNode(r,u,o.uriConverter);Ue(f)&&c.push({ref:f})}if(c.length===0)l={$refText:s??"",items:c},a??(a="Could not resolve multi-reference");else return{$refText:s??"",items:c}}if(a)return l??(l={$refText:s??"",ref:void 0}),l.error={info:{container:t,property:n,reference:l},message:a},l}getRefNode(t,n,r){try{let i=n.indexOf("#");if(i===0){let l=this.astNodeLocator.getAstNode(t,n.substring(1));return l||"Could not resolve path: "+n}if(i<0){let l=r?r(n):Oe.parse(n),c=this.langiumDocuments.getDocument(l);return c?c.parseResult.value:"Could not find document for URI: "+n}let o=r?r(n.substring(0,i)):Oe.parse(n.substring(0,i)),s=this.langiumDocuments.getDocument(o);if(!s)return"Could not find document for URI: "+n;if(i===n.length-1)return s.parseResult.value;let a=this.astNodeLocator.getAstNode(s.parseResult.value,n.substring(i+1));return a||"Could not resolve URI: "+n}catch(i){return String(i)}}};var Qu=class{get map(){return this.fileExtensionMap}constructor(t){this.languageIdMap=new Map,this.fileExtensionMap=new Map,this.fileNameMap=new Map,this.textDocuments=t?.workspace.TextDocuments}register(t){let n=t.LanguageMetaData;for(let r of n.fileExtensions)this.fileExtensionMap.has(r)&&console.warn(`The file extension ${r} is used by multiple languages. It is now assigned to '${n.languageId}'.`),this.fileExtensionMap.set(r,t);if(n.fileNames)for(let r of n.fileNames)this.fileNameMap.has(r)&&console.warn(`The file name ${r} is used by multiple languages. It is now assigned to '${n.languageId}'.`),this.fileNameMap.set(r,t);this.languageIdMap.set(n.languageId,t)}getServices(t){if(this.languageIdMap.size===0)throw new Error("The service registry is empty. Use `register` to register the services of a language.");let n=this.textDocuments?.get(t)?.languageId;if(n!==void 0){let s=this.languageIdMap.get(n);if(s)return s}let r=et.extname(t),i=et.basename(t),o=this.fileNameMap.get(i)??this.fileExtensionMap.get(r);if(!o)throw n?new Error(`The service registry contains no services for the extension '${r}' for language '${n}'.`):new Error(`The service registry contains no services for the extension '${r}'.`);return o}hasServices(t){try{return this.getServices(t),!0}catch{return!1}}get all(){return Array.from(this.languageIdMap.values())}};function Fo(e){return{code:e}}var Ym;(function(e){e.defaults=["fast","slow","built-in"],e.all=e.defaults})(Ym||(Ym={}));var ef=class{constructor(t){this.entries=new Kt,this.knownCategories=new Set(Ym.defaults),this.entriesBefore=[],this.entriesAfter=[],this.reflection=t.shared.AstReflection}register(t,n=this,r="fast"){if(r==="built-in")throw new Error("The 'built-in' category is reserved for lexer, parser, and linker errors.");this.knownCategories.add(r);for(let[i,o]of Object.entries(t)){let s=o;if(Array.isArray(s))for(let a of s){let l={check:this.wrapValidationException(a,n),category:r};this.addEntry(i,l)}else if(typeof s=="function"){let a={check:this.wrapValidationException(s,n),category:r};this.addEntry(i,a)}else ir(s)}}wrapValidationException(t,n){return async(r,i,o)=>{await this.handleException(()=>t.call(n,r,i,o),"An error occurred during validation",i,r)}}async handleException(t,n,r,i){try{await t()}catch(o){if(kr(o))throw o;console.error(`${n}:`,o),o instanceof Error&&o.stack&&console.error(o.stack);let s=o instanceof Error?o.message:String(o);r("error",`${n}: ${s}`,{node:i})}}addEntry(t,n){if(t==="AstNode"){this.entries.add("AstNode",n);return}for(let r of this.reflection.getAllSubTypes(t))this.entries.add(r,n)}getChecks(t,n){let r=ye(this.entries.get(t)).concat(this.entries.get("AstNode"));return n&&(r=r.filter(i=>n.includes(i.category))),r.map(i=>i.check)}registerBeforeDocument(t,n=this){this.entriesBefore.push(this.wrapPreparationException(t,"An error occurred during set-up of the validation",n))}registerAfterDocument(t,n=this){this.entriesAfter.push(this.wrapPreparationException(t,"An error occurred during tear-down of the validation",n))}wrapPreparationException(t,n,r){return async(i,o,s,a)=>{await this.handleException(()=>t.call(r,i,o,s,a),n,o,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}getAllValidationCategories(t){return this.knownCategories}};var vM=Object.freeze({validateNode:!0,validateChildren:!0}),tf=class{constructor(t){this.validationRegistry=t.validation.ValidationRegistry,this.metadata=t.LanguageMetaData,this.profiler=t.shared.profilers.LangiumProfiler,this.languageId=t.LanguageMetaData.languageId}async validateDocument(t,n={},r=ce.CancellationToken.None){let i=t.parseResult,o=[];if(await Ge(r),(!n.categories||n.categories.includes("built-in"))&&(this.processLexingErrors(i,o,n),n.stopAfterLexingErrors&&o.some(s=>s.data?.code===qt.LexingError)||(this.processParsingErrors(i,o,n),n.stopAfterParsingErrors&&o.some(s=>s.data?.code===qt.ParsingError))||(this.processLinkingErrors(t,o,n),n.stopAfterLinkingErrors&&o.some(s=>s.data?.code===qt.LinkingError))))return o;try{o.push(...await this.validateAst(i.value,n,r))}catch(s){if(kr(s))throw s;console.error("An error occurred during validation:",s)}return await Ge(r),o}processLexingErrors(t,n,r){let i=[...t.lexerErrors,...t.lexerReport?.diagnostics??[]];for(let o of i){let s=o.severity??"error",a={severity:Vm(s),range:{start:{line:o.line-1,character:o.column-1},end:{line:o.line-1,character:o.column+o.length-1}},message:o.message,data:AM(s),source:this.getSource()};n.push(a)}}processParsingErrors(t,n,r){for(let i of t.parserErrors){let o;if(qs(i.token))o=WE(i.token);else if("previousToken"in i){let s=i.previousToken;if(qs(s)){let a={line:s.endLine-1,character:s.endColumn};o={start:a,end:a}}else{let a={line:0,character:0};o={start:a,end:a}}}if(o){let s={severity:Vm("error"),range:o,message:i.message,data:Fo(qt.ParsingError),source:this.getSource()};n.push(s)}}}processLinkingErrors(t,n,r){for(let i of t.references){let o=i.error;if(o){let s={node:o.info.container,range:i.$refNode?.range,property:o.info.property,index:o.info.index,data:{code:qt.LinkingError,containerType:o.info.container.$type,property:o.info.property,refText:o.info.reference.$refText}};n.push(this.toDiagnostic("error",o.message,s))}}}async validateAst(t,n,r=ce.CancellationToken.None){let i=[],o=(s,a,l)=>{i.push(this.toDiagnostic(s,a,l))};return await this.validateAstBefore(t,n,o,r),await this.validateAstNodes(t,n,o,r),await this.validateAstAfter(t,n,o,r),i}async validateAstBefore(t,n,r,i=ce.CancellationToken.None){let o=this.validationRegistry.checksBefore;for(let s of o)await Ge(i),await s(t,r,n.categories??[],i)}async validateAstNodes(t,n,r,i=ce.CancellationToken.None){if(this.profiler?.isActive("validating")){let o=this.profiler.createTask("validating",this.languageId);o.start();try{let s=yt(t).iterator();for(let a of s){o.startSubTask(a.$type);let l=this.validateSingleNodeOptions(a,n);if(l.validateNode)try{let c=this.validationRegistry.getChecks(a.$type,n.categories);for(let u of c)await u(a,r,i)}finally{o.stopSubTask(a.$type)}l.validateChildren||s.prune()}}finally{o.stop()}}else{let o=yt(t).iterator();for(let s of o){await Ge(i);let a=this.validateSingleNodeOptions(s,n);if(a.validateNode){let l=this.validationRegistry.getChecks(s.$type,n.categories);for(let c of l)await c(s,r,i)}a.validateChildren||o.prune()}}}validateSingleNodeOptions(t,n){return vM}async validateAstAfter(t,n,r,i=ce.CancellationToken.None){let o=this.validationRegistry.checksAfter;for(let s of o)await Ge(i),await s(t,r,n.categories??[],i)}toDiagnostic(t,n,r){return{message:n,range:Km(r),severity:Vm(t),code:r.code,codeDescription:r.codeDescription,tags:r.tags,relatedInformation:r.relatedInformation,data:r.data,source:this.getSource()}}getSource(){return this.metadata.languageId}};function Km(e){if(e.range)return e.range;let t;return typeof e.property=="string"?t=na(e.node.$cstNode,e.property,e.index):typeof e.keyword=="string"&&(t=dh(e.node.$cstNode,e.keyword,e.index)),t??(t=e.node.$cstNode),t?t.range:{start:{line:0,character:0},end:{line:0,character:0}}}function Vm(e){switch(e){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+e)}}function AM(e){switch(e){case"error":return Fo(qt.LexingError);case"warning":return Fo(qt.LexingWarning);case"info":return Fo(qt.LexingInfo);case"hint":return Fo(qt.LexingHint);default:throw new Error("Invalid diagnostic severity: "+e)}}var qt;(function(e){e.LexingError="lexing-error",e.LexingWarning="lexing-warning",e.LexingInfo="lexing-info",e.LexingHint="lexing-hint",e.ParsingError="parsing-error",e.LinkingError="linking-error"})(qt||(qt={}));var nf=class{constructor(t){this.astNodeLocator=t.workspace.AstNodeLocator,this.nameProvider=t.references.NameProvider}createDescription(t,n,r){let i=r??at(t);n??(n=this.nameProvider.getName(t));let o=this.astNodeLocator.getAstNodePath(t);if(!n)throw new Error(`Node at path ${o} has no name.`);let s,a=()=>s??(s=eo(this.nameProvider.getNameNode(t)??t.$cstNode));return{node:t,name:n,get nameSegment(){return a()},selectionSegment:eo(t.$cstNode),type:t.$type,documentUri:i.uri,path:o}}},rf=class{constructor(t){this.nodeLocator=t.workspace.AstNodeLocator}async createDescriptions(t,n=ce.CancellationToken.None){let r=[],i=t.parseResult.value;for(let o of yt(i))await Ge(n),Gr(o).forEach(s=>{s.reference.error||r.push(...this.createInfoDescriptions(s))});return r}createInfoDescriptions(t){let n=t.reference;if(n.error||!n.$refNode)return[];let r=[];it(n)&&n.$nodeDescription?r=[n.$nodeDescription]:Ct(n)&&(r=n.items.map(l=>l.$nodeDescription).filter(l=>l!==void 0));let i=at(t.container).uri,o=this.nodeLocator.getAstNodePath(t.container),s=[],a=eo(n.$refNode);for(let l of r)s.push({sourceUri:i,sourcePath:o,targetUri:l.documentUri,targetPath:l.path,segment:a,local:et.equals(l.documentUri,i)});return s}};var of=class{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(t){if(t.$container){let n=this.getAstNodePath(t.$container),r=this.getPathSegment(t);return n+this.segmentSeparator+r}return""}getPathSegment({$containerProperty:t,$containerIndex:n}){if(!t)throw new Error("Missing '$containerProperty' in AST node.");return n!==void 0?t+this.indexSeparator+n:t}getAstNode(t,n){return n.split(this.segmentSeparator).reduce((i,o)=>{if(!i||o.length===0)return i;let s=o.indexOf(this.indexSeparator);if(s>0){let a=o.substring(0,s),l=parseInt(o.substring(s+1));return i[a]?.[l]}return i[o]},t)}};var sf=class{constructor(t){this._ready=new Ar,this.onConfigurationSectionUpdateEmitter=new Du.Emitter,this.settings={},this.workspaceConfig=!1,this.serviceRegistry=t.ServiceRegistry}get ready(){return this._ready.promise}initialize(t){this.workspaceConfig=t.capabilities.workspace?.configuration??!1}async initialized(t){if(this.workspaceConfig){if(t.register){let n=this.serviceRegistry.all;t.register({section:n.map(r=>this.toSectionName(r.LanguageMetaData.languageId))})}if(t.fetchConfiguration){let n=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),r=await t.fetchConfiguration(n);n.forEach((i,o)=>{this.updateSectionConfiguration(i.section,r[o])})}}this._ready.resolve()}updateConfiguration(t){typeof t.settings!="object"||t.settings===null||Object.entries(t.settings).forEach(([n,r])=>{this.updateSectionConfiguration(n,r),this.onConfigurationSectionUpdateEmitter.fire({section:n,configuration:r})})}updateSectionConfiguration(t,n){this.settings[t]=n}async getConfiguration(t,n){await this.ready;let r=this.toSectionName(t);if(this.settings[r])return this.settings[r][n]}toSectionName(t){return`${t}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}};var Bo;(function(e){function t(n){return{dispose:async()=>await n()}}e.create=t})(Bo||(Bo={}));var af=class{constructor(t){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new Kt,this.documentPhaseListeners=new Kt,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=ue.Changed,this.langiumDocuments=t.workspace.LangiumDocuments,this.langiumDocumentFactory=t.workspace.LangiumDocumentFactory,this.textDocuments=t.workspace.TextDocuments,this.indexManager=t.workspace.IndexManager,this.fileSystemProvider=t.workspace.FileSystemProvider,this.workspaceManager=()=>t.workspace.WorkspaceManager,this.serviceRegistry=t.ServiceRegistry}async build(t,n={},r=ce.CancellationToken.None){for(let i of t){let o=i.uri.toString();if(i.state===ue.Validated){if(typeof n.validation=="boolean"&&n.validation)this.resetToState(i,ue.IndexedReferences);else if(typeof n.validation=="object"){let s=this.findMissingValidationCategories(i,n);s.length>0&&(this.buildState.set(o,{completed:!1,options:{validation:{categories:s}},result:this.buildState.get(o)?.result}),i.state=ue.IndexedReferences)}}else this.buildState.delete(o)}this.currentState=ue.Changed,await this.emitUpdate(t.map(i=>i.uri),[]),await this.buildDocuments(t,n,r)}async update(t,n,r=ce.CancellationToken.None){this.currentState=ue.Changed;let i=[];for(let l of n){let c=this.langiumDocuments.deleteDocuments(l);for(let u of c)i.push(u.uri),this.cleanUpDeleted(u)}let o=(await Promise.all(t.map(l=>this.findChangedUris(l)))).flat();for(let l of o){let c=this.langiumDocuments.getDocument(l);c===void 0&&(c=this.langiumDocumentFactory.fromModel({$type:"INVALID"},l),c.state=ue.Changed,this.langiumDocuments.addDocument(c)),this.resetToState(c,ue.Changed)}let s=ye(o).concat(i).map(l=>l.toString()).toSet();this.langiumDocuments.all.filter(l=>!s.has(l.uri.toString())&&this.shouldRelink(l,s)).forEach(l=>this.resetToState(l,ue.ComputedScopes)),await this.emitUpdate(o,i),await Ge(r);let a=this.sortDocuments(this.langiumDocuments.all.filter(l=>l.state<ue.Validated||!this.buildState.get(l.uri.toString())?.completed||this.resultsAreIncomplete(l,this.updateBuildOptions)).toArray());await this.buildDocuments(a,this.updateBuildOptions,r)}resultsAreIncomplete(t,n){return this.findMissingValidationCategories(t,n).length>=1}findMissingValidationCategories(t,n){let r=this.buildState.get(t.uri.toString()),i=this.serviceRegistry.getServices(t.uri).validation.ValidationRegistry.getAllValidationCategories(t),o=r?.result?.validationChecks?new Set(r?.result?.validationChecks):r?.completed?i:new Set,s=n===void 0||n.validation===!0?i:typeof n.validation=="object"?n.validation.categories??i:[];return ye(s).filter(a=>!o.has(a)).toArray()}async findChangedUris(t){if(this.langiumDocuments.getDocument(t)??this.textDocuments?.get(t))return[t];try{let r=await this.fileSystemProvider.stat(t);if(r.isDirectory)return await this.workspaceManager().searchFolder(t);if(this.workspaceManager().shouldIncludeEntry(r))return[t]}catch{}return[]}async emitUpdate(t,n){await Promise.all(this.updateListeners.map(r=>r(t,n)))}sortDocuments(t){let n=0,r=t.length-1;for(;n<r;){for(;n<t.length&&this.hasTextDocument(t[n]);)n++;for(;r>=0&&!this.hasTextDocument(t[r]);)r--;n<r&&([t[n],t[r]]=[t[r],t[n]])}return t}hasTextDocument(t){return!!this.textDocuments?.get(t.uri)}shouldRelink(t,n){return t.references.some(r=>r.error!==void 0)?!0:this.indexManager.isAffected(t,n)}onUpdate(t){return this.updateListeners.push(t),Bo.create(()=>{let n=this.updateListeners.indexOf(t);n>=0&&this.updateListeners.splice(n,1)})}resetToState(t,n){switch(n){case ue.Changed:case ue.Parsed:this.indexManager.removeContent(t.uri);case ue.IndexedContent:t.localSymbols=void 0;case ue.ComputedScopes:this.serviceRegistry.getServices(t.uri).references.Linker.unlink(t);case ue.Linked:this.indexManager.removeReferences(t.uri);case ue.IndexedReferences:t.diagnostics=void 0,this.buildState.delete(t.uri.toString());case ue.Validated:}t.state>n&&(t.state=n)}cleanUpDeleted(t){this.buildState.delete(t.uri.toString()),this.indexManager.remove(t.uri),t.state=ue.Changed}async buildDocuments(t,n,r){this.prepareBuild(t,n),await this.runCancelable(t,ue.Parsed,r,s=>this.langiumDocumentFactory.update(s,r)),await this.runCancelable(t,ue.IndexedContent,r,s=>this.indexManager.updateContent(s,r)),await this.runCancelable(t,ue.ComputedScopes,r,async s=>{let a=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.localSymbols=await a.collectLocalSymbols(s,r)});let i=t.filter(s=>this.shouldLink(s));await this.runCancelable(i,ue.Linked,r,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,r)),await this.runCancelable(i,ue.IndexedReferences,r,s=>this.indexManager.updateReferences(s,r));let o=t.filter(s=>this.shouldValidate(s)?!0:(this.markAsCompleted(s),!1));await this.runCancelable(o,ue.Validated,r,async s=>{await this.validate(s,r),this.markAsCompleted(s)})}markAsCompleted(t){let n=this.buildState.get(t.uri.toString());n&&(n.completed=!0)}prepareBuild(t,n){for(let r of t){let i=r.uri.toString(),o=this.buildState.get(i);(!o||o.completed)&&this.buildState.set(i,{completed:!1,options:n,result:o?.result})}}async runCancelable(t,n,r,i){for(let s of t)s.state<n&&(await Ge(r),await i(s),s.state=n,await this.notifyDocumentPhase(s,n,r));let o=t.filter(s=>s.state===n);await this.notifyBuildPhase(o,n,r),this.currentState=n}onBuildPhase(t,n){return this.buildPhaseListeners.add(t,n),Bo.create(()=>{this.buildPhaseListeners.delete(t,n)})}onDocumentPhase(t,n){return this.documentPhaseListeners.add(t,n),Bo.create(()=>{this.documentPhaseListeners.delete(t,n)})}waitUntil(t,n,r){let i;return n&&"path"in n?i=n:r=n,r??(r=ce.CancellationToken.None),i?this.awaitDocumentState(t,i,r):this.awaitBuilderState(t,r)}awaitDocumentState(t,n,r){let i=this.langiumDocuments.getDocument(n);if(i){if(i.state>=t)return Promise.resolve(n);if(r.isCancellationRequested)return Promise.reject(hi);if(this.currentState>=t&&t>i.state)return Promise.reject(new Mu.ResponseError(Um.RequestFailed,`Document state of ${n.toString()} is ${ue[i.state]}, requiring ${ue[t]}, but workspace state is already ${ue[this.currentState]}. Returning undefined.`))}else return Promise.reject(new Mu.ResponseError(Um.ServerCancelled,`No document found for URI: ${n.toString()}`));return new Promise((o,s)=>{let a=this.onDocumentPhase(t,c=>{et.equals(c.uri,n)&&(a.dispose(),l.dispose(),o(c.uri))}),l=r.onCancellationRequested(()=>{a.dispose(),l.dispose(),s(hi)})})}awaitBuilderState(t,n){return this.currentState>=t?Promise.resolve():n.isCancellationRequested?Promise.reject(hi):new Promise((r,i)=>{let o=this.onBuildPhase(t,()=>{o.dispose(),s.dispose(),r()}),s=n.onCancellationRequested(()=>{o.dispose(),s.dispose(),i(hi)})})}async notifyDocumentPhase(t,n,r){let o=this.documentPhaseListeners.get(n).slice();for(let s of o)try{await Ge(r),await s(t,r)}catch(a){if(!kr(a))throw a}}async notifyBuildPhase(t,n,r){if(t.length===0)return;let o=this.buildPhaseListeners.get(n).slice();for(let s of o)await Ge(r),await s(t,r)}shouldLink(t){return this.getBuildOptions(t).eagerLinking??!0}shouldValidate(t){return!!this.getBuildOptions(t).validation}async validate(t,n){let r=this.serviceRegistry.getServices(t.uri).validation.DocumentValidator,i=this.getBuildOptions(t),o=typeof i.validation=="object"?{...i.validation}:{};o.categories=this.findMissingValidationCategories(t,i);let s=await r.validateDocument(t,o,n);t.diagnostics?t.diagnostics.push(...s):t.diagnostics=s;let a=this.buildState.get(t.uri.toString());a&&(a.result??(a.result={}),a.result.validationChecks?a.result.validationChecks=ye(a.result.validationChecks).concat(o.categories).distinct().toArray():a.result.validationChecks=[...o.categories])}getBuildOptions(t){return this.buildState.get(t.uri.toString())?.options??{}}};var lf=class{constructor(t){this.symbolIndex=new Map,this.symbolByTypeIndex=new Ku,this.referenceIndex=new Map,this.documents=t.workspace.LangiumDocuments,this.serviceRegistry=t.ServiceRegistry,this.astReflection=t.AstReflection}findAllReferences(t,n){let r=at(t).uri,i=[];return this.referenceIndex.forEach(o=>{o.forEach(s=>{et.equals(s.targetUri,r)&&s.targetPath===n&&i.push(s)})}),ye(i)}allElements(t,n){let r=ye(this.symbolIndex.keys());return n&&(r=r.filter(i=>!n||n.has(i))),r.map(i=>this.getFileDescriptions(i,t)).flat()}getFileDescriptions(t,n){return n?this.symbolByTypeIndex.get(t,n,()=>(this.symbolIndex.get(t)??[]).filter(o=>this.astReflection.isSubtype(o.type,n))):this.symbolIndex.get(t)??[]}remove(t){this.removeContent(t),this.removeReferences(t)}removeContent(t){let n=t.toString();this.symbolIndex.delete(n),this.symbolByTypeIndex.clear(n)}removeReferences(t){let n=t.toString();this.referenceIndex.delete(n)}async updateContent(t,n=ce.CancellationToken.None){let i=await this.serviceRegistry.getServices(t.uri).references.ScopeComputation.collectExportedSymbols(t,n),o=t.uri.toString();this.symbolIndex.set(o,i),this.symbolByTypeIndex.clear(o)}async updateReferences(t,n=ce.CancellationToken.None){let i=await this.serviceRegistry.getServices(t.uri).workspace.ReferenceDescriptionProvider.createDescriptions(t,n);this.referenceIndex.set(t.uri.toString(),i)}isAffected(t,n){let r=this.referenceIndex.get(t.uri.toString());return r?r.some(i=>!i.local&&n.has(i.targetUri.toString())):!1}};var cf=class{constructor(t){this.initialBuildOptions={},this._ready=new Ar,this.serviceRegistry=t.ServiceRegistry,this.langiumDocuments=t.workspace.LangiumDocuments,this.documentBuilder=t.workspace.DocumentBuilder,this.fileSystemProvider=t.workspace.FileSystemProvider,this.mutex=t.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(t){this.folders=t.workspaceFolders??void 0}initialized(t){return this.mutex.write(n=>this.initializeWorkspace(this.folders??[],n))}async initializeWorkspace(t,n=ce.CancellationToken.None){let r=await this.performStartup(t);await Ge(n),await this.documentBuilder.build(r,this.initialBuildOptions,n)}async performStartup(t){let n=[],r=s=>{n.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)};await this.loadAdditionalDocuments(t,r);let i=[];await Promise.all(t.map(s=>this.getRootFolder(s)).map(async s=>this.traverseFolder(s,i)));let o=ye(i).distinct(s=>s.toString()).filter(s=>!this.langiumDocuments.hasDocument(s));return await this.loadWorkspaceDocuments(o,r),this._ready.resolve(),n}async loadWorkspaceDocuments(t,n){await Promise.all(t.map(async r=>{let i=await this.langiumDocuments.getOrCreateDocument(r);n(i)}))}loadAdditionalDocuments(t,n){return Promise.resolve()}getRootFolder(t){return Oe.parse(t.uri)}async traverseFolder(t,n){try{let r=await this.fileSystemProvider.readDirectory(t);await Promise.all(r.map(async i=>{this.shouldIncludeEntry(i)&&(i.isDirectory?await this.traverseFolder(i.uri,n):i.isFile&&n.push(i.uri))}))}catch(r){console.error("Failure to read directory content of "+t.toString(!0),r)}}async searchFolder(t){let n=[];return await this.traverseFolder(t,n),n}shouldIncludeEntry(t){let n=et.basename(t.uri);return n.startsWith(".")?!1:t.isDirectory?n!=="node_modules"&&n!=="out":t.isFile?this.serviceRegistry.hasServices(t.uri):!1}};var uf=class{buildUnexpectedCharactersMessage(t,n,r,i,o){return co.buildUnexpectedCharactersMessage(t,n,r,i,o)}buildUnableToPopLexerModeMessage(t){return co.buildUnableToPopLexerModeMessage(t)}},qm={mode:"full"},Wo=class{constructor(t){this.errorMessageProvider=t.parser.LexerErrorMessageProvider,this.tokenBuilder=t.parser.TokenBuilder;let n=this.tokenBuilder.buildTokens(t.Grammar,{caseInsensitive:t.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(n);let r=zv(n)?Object.values(n):n,i=t.LanguageMetaData.mode==="production";this.chevrotainLexer=new Me(r,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(t,n=qm){let r=this.chevrotainLexer.tokenize(t);return{tokens:r.tokens,errors:r.errors,hidden:r.groups.hidden??[],report:this.tokenBuilder.flushLexingReport?.(t)}}toTokenTypeDictionary(t){if(zv(t))return t;let n=jv(t)?Object.values(t.modes).flat():t,r={};return n.forEach(i=>r[i.name]=i),r}};function Zm(e){return Array.isArray(e)&&(e.length===0||"name"in e[0])}function jv(e){return e&&"modes"in e&&"defaultMode"in e}function zv(e){return!Zm(e)&&!jv(e)}var Yv;(function(e){function t(n){return typeof n=="string"}e.is=t})(Yv||(Yv={}));var Jm;(function(e){function t(n){return typeof n=="string"}e.is=t})(Jm||(Jm={}));var Vv;(function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647;function t(n){return typeof n=="number"&&e.MIN_VALUE<=n&&n<=e.MAX_VALUE}e.is=t})(Vv||(Vv={}));var ff;(function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647;function t(n){return typeof n=="number"&&e.MIN_VALUE<=n&&n<=e.MAX_VALUE}e.is=t})(ff||(ff={}));var _e;(function(e){function t(r,i){return r===Number.MAX_VALUE&&(r=ff.MAX_VALUE),i===Number.MAX_VALUE&&(i=ff.MAX_VALUE),{line:r,character:i}}e.create=t;function n(r){let i=r;return N.objectLiteral(i)&&N.uinteger(i.line)&&N.uinteger(i.character)}e.is=n})(_e||(_e={}));var pe;(function(e){function t(r,i,o,s){if(N.uinteger(r)&&N.uinteger(i)&&N.uinteger(o)&&N.uinteger(s))return{start:_e.create(r,i),end:_e.create(o,s)};if(_e.is(r)&&_e.is(i))return{start:r,end:i};throw new Error(`Range#create called with invalid arguments[${r}, ${i}, ${o}, ${s}]`)}e.create=t;function n(r){let i=r;return N.objectLiteral(i)&&_e.is(i.start)&&_e.is(i.end)}e.is=n})(pe||(pe={}));var df;(function(e){function t(r,i){return{uri:r,range:i}}e.create=t;function n(r){let i=r;return N.objectLiteral(i)&&pe.is(i.range)&&(N.string(i.uri)||N.undefined(i.uri))}e.is=n})(df||(df={}));var Kv;(function(e){function t(r,i,o,s){return{targetUri:r,targetRange:i,targetSelectionRange:o,originSelectionRange:s}}e.create=t;function n(r){let i=r;return N.objectLiteral(i)&&pe.is(i.targetRange)&&N.string(i.targetUri)&&pe.is(i.targetSelectionRange)&&(pe.is(i.originSelectionRange)||N.undefined(i.originSelectionRange))}e.is=n})(Kv||(Kv={}));var Qm;(function(e){function t(r,i,o,s){return{red:r,green:i,blue:o,alpha:s}}e.create=t;function n(r){let i=r;return N.objectLiteral(i)&&N.numberRange(i.red,0,1)&&N.numberRange(i.green,0,1)&&N.numberRange(i.blue,0,1)&&N.numberRange(i.alpha,0,1)}e.is=n})(Qm||(Qm={}));var qv;(function(e){function t(r,i){return{range:r,color:i}}e.create=t;function n(r){let i=r;return N.objectLiteral(i)&&pe.is(i.range)&&Qm.is(i.color)}e.is=n})(qv||(qv={}));var Zv;(function(e){function t(r,i,o){return{label:r,textEdit:i,additionalTextEdits:o}}e.create=t;function n(r){let i=r;return N.objectLiteral(i)&&N.string(i.label)&&(N.undefined(i.textEdit)||Uo.is(i))&&(N.undefined(i.additionalTextEdits)||N.typedArray(i.additionalTextEdits,Uo.is))}e.is=n})(Zv||(Zv={}));var Jv;(function(e){e.Comment="comment",e.Imports="imports",e.Region="region"})(Jv||(Jv={}));var Qv;(function(e){function t(r,i,o,s,a,l){let c={startLine:r,endLine:i};return N.defined(o)&&(c.startCharacter=o),N.defined(s)&&(c.endCharacter=s),N.defined(a)&&(c.kind=a),N.defined(l)&&(c.collapsedText=l),c}e.create=t;function n(r){let i=r;return N.objectLiteral(i)&&N.uinteger(i.startLine)&&N.uinteger(i.startLine)&&(N.undefined(i.startCharacter)||N.uinteger(i.startCharacter))&&(N.undefined(i.endCharacter)||N.uinteger(i.endCharacter))&&(N.undefined(i.kind)||N.string(i.kind))}e.is=n})(Qv||(Qv={}));var eg;(function(e){function t(r,i){return{location:r,message:i}}e.create=t;function n(r){let i=r;return N.defined(i)&&df.is(i.location)&&N.string(i.message)}e.is=n})(eg||(eg={}));var e0;(function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4})(e0||(e0={}));var t0;(function(e){e.Unnecessary=1,e.Deprecated=2})(t0||(t0={}));var n0;(function(e){function t(n){let r=n;return N.objectLiteral(r)&&N.string(r.href)}e.is=t})(n0||(n0={}));var pf;(function(e){function t(o,s,a,l,c,u){let f={range:o,message:s};return N.defined(a)&&(f.severity=a),N.defined(l)&&(f.code=l),N.defined(c)&&(f.source=c),N.defined(u)&&(f.relatedInformation=u),f}e.create=t;function n(o){var s;let a=o;return N.defined(a)&&pe.is(a.range)&&(N.string(a.message)||gi.is(a.message))&&(N.number(a.severity)||N.undefined(a.severity))&&(N.integer(a.code)||N.string(a.code)||N.undefined(a.code))&&(N.undefined(a.codeDescription)||N.string((s=a.codeDescription)===null||s===void 0?void 0:s.href))&&(N.string(a.source)||N.undefined(a.source))&&(N.undefined(a.relatedInformation)||N.typedArray(a.relatedInformation,eg.is))}e.is=n;function r(o){return N.string(o.message)}e.is3_17=r;function i(o){if(N.string(o.message))return o.message;if(gi.is(o.message))return o.message.value;throw new Error(`Unknown message type ${typeof o.message}`)}e.getMessageString=i})(pf||(pf={}));var Xo;(function(e){function t(r,i,...o){let s={title:r,command:i};return N.defined(o)&&o.length>0&&(s.arguments=o),s}e.create=t;function n(r){let i=r;return N.defined(i)&&N.string(i.title)&&(i.tooltip===void 0||N.string(i.tooltip))&&N.string(i.command)}e.is=n})(Xo||(Xo={}));var Uo;(function(e){function t(o,s){return{range:o,newText:s}}e.replace=t;function n(o,s){return{range:{start:o,end:o},newText:s}}e.insert=n;function r(o){return{range:o,newText:""}}e.del=r;function i(o){let s=o;return N.objectLiteral(s)&&N.string(s.newText)&&pe.is(s.range)}e.is=i})(Uo||(Uo={}));var hf;(function(e){function t(r,i,o){let s={label:r};return i!==void 0&&(s.needsConfirmation=i),o!==void 0&&(s.description=o),s}e.create=t;function n(r){let i=r;return N.objectLiteral(i)&&N.string(i.label)&&(N.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(N.string(i.description)||i.description===void 0)}e.is=n})(hf||(hf={}));var mi;(function(e){function t(n){let r=n;return N.string(r)}e.is=t})(mi||(mi={}));var r0;(function(e){function t(o,s,a){return{range:o,newText:s,annotationId:a}}e.replace=t;function n(o,s,a){return{range:{start:o,end:o},newText:s,annotationId:a}}e.insert=n;function r(o,s){return{range:o,newText:"",annotationId:s}}e.del=r;function i(o){let s=o;return Uo.is(s)&&(hf.is(s.annotationId)||mi.is(s.annotationId))}e.is=i})(r0||(r0={}));var tg;(function(e){function t(r,i){return{textDocument:r,edits:i}}e.create=t;function n(r){let i=r;return N.defined(i)&&sg.is(i.textDocument)&&Array.isArray(i.edits)}e.is=n})(tg||(tg={}));var ng;(function(e){function t(r,i,o){let s={kind:"create",uri:r};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(s.options=i),o!==void 0&&(s.annotationId=o),s}e.create=t;function n(r){let i=r;return i&&i.kind==="create"&&N.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||N.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||N.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||mi.is(i.annotationId))}e.is=n})(ng||(ng={}));var rg;(function(e){function t(r,i,o,s){let a={kind:"rename",oldUri:r,newUri:i};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(a.options=o),s!==void 0&&(a.annotationId=s),a}e.create=t;function n(r){let i=r;return i&&i.kind==="rename"&&N.string(i.oldUri)&&N.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||N.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||N.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||mi.is(i.annotationId))}e.is=n})(rg||(rg={}));var ig;(function(e){function t(r,i,o){let s={kind:"delete",uri:r};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(s.options=i),o!==void 0&&(s.annotationId=o),s}e.create=t;function n(r){let i=r;return i&&i.kind==="delete"&&N.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||N.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||N.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||mi.is(i.annotationId))}e.is=n})(ig||(ig={}));var og;(function(e){function t(n){let r=n;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(i=>N.string(i.kind)?ng.is(i)||rg.is(i)||ig.is(i):tg.is(i)))}e.is=t})(og||(og={}));var i0;(function(e){function t(n){let r=n;return N.objectLiteral(r)&&pe.is(r.range)&&fg.isSnippet(r.snippet)&&(r.annotationId===void 0||hf.is(r.annotationId)||mi.is(r.annotationId))}e.is=t})(i0||(i0={}));var o0;(function(e){function t(r){return{uri:r}}e.create=t;function n(r){let i=r;return N.defined(i)&&N.string(i.uri)}e.is=n})(o0||(o0={}));var s0;(function(e){function t(r,i){return{uri:r,version:i}}e.create=t;function n(r){let i=r;return N.defined(i)&&N.string(i.uri)&&N.integer(i.version)}e.is=n})(s0||(s0={}));var sg;(function(e){function t(r,i){return{uri:r,version:i}}e.create=t;function n(r){let i=r;return N.defined(i)&&N.string(i.uri)&&(i.version===null||N.integer(i.version))}e.is=n})(sg||(sg={}));var a0;(function(e){e.ABAP="abap",e.WindowsBat="bat",e.BibTeX="bibtex",e.Clojure="clojure",e.Coffeescript="coffeescript",e.C="c",e.CPP="cpp",e.CSharp="csharp",e.CSS="css",e.D="d",e.Delphi="pascal",e.Diff="diff",e.Dart="dart",e.Dockerfile="dockerfile",e.Elixir="elixir",e.Erlang="erlang",e.FSharp="fsharp",e.GitCommit="git-commit",e.GitRebase="git-rebase",e.Go="go",e.Groovy="groovy",e.Handlebars="handlebars",e.Haskell="haskell",e.HTML="html",e.Ini="ini",e.Java="java",e.JavaScript="javascript",e.JavaScriptReact="javascriptreact",e.JSON="json",e.LaTeX="latex",e.Less="less",e.Lua="lua",e.Makefile="makefile",e.Markdown="markdown",e.ObjectiveC="objective-c",e.ObjectiveCPP="objective-cpp",e.Pascal="pascal",e.Perl="perl",e.Perl6="perl6",e.PHP="php",e.Plaintext="plaintext",e.Powershell="powershell",e.Pug="jade",e.Python="python",e.R="r",e.Razor="razor",e.Ruby="ruby",e.Rust="rust",e.SCSS="scss",e.SASS="sass",e.Scala="scala",e.ShaderLab="shaderlab",e.ShellScript="shellscript",e.SQL="sql",e.Swift="swift",e.TypeScript="typescript",e.TypeScriptReact="typescriptreact",e.TeX="tex",e.VisualBasic="vb",e.XML="xml",e.XSL="xsl",e.YAML="yaml"})(a0||(a0={}));var l0;(function(e){function t(r,i,o,s){return{uri:r,languageId:i,version:o,text:s}}e.create=t;function n(r){let i=r;return N.defined(i)&&N.string(i.uri)&&N.string(i.languageId)&&N.integer(i.version)&&N.string(i.text)}e.is=n})(l0||(l0={}));var ag;(function(e){e.PlainText="plaintext",e.Markdown="markdown";function t(n){let r=n;return r===e.PlainText||r===e.Markdown}e.is=t})(ag||(ag={}));var gi;(function(e){function t(n){let r=n;return N.objectLiteral(n)&&ag.is(r.kind)&&N.string(r.value)}e.is=t})(gi||(gi={}));var c0;(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})(c0||(c0={}));var u0;(function(e){e.PlainText=1,e.Snippet=2})(u0||(u0={}));var f0;(function(e){e.Deprecated=1})(f0||(f0={}));var d0;(function(e){function t(r,i,o){return{newText:r,insert:i,replace:o}}e.create=t;function n(r){let i=r;return i&&N.string(i.newText)&&pe.is(i.insert)&&pe.is(i.replace)}e.is=n})(d0||(d0={}));var p0;(function(e){e.asIs=1,e.adjustIndentation=2})(p0||(p0={}));var h0;(function(e){e.Replace=1,e.Merge=2})(h0||(h0={}));var m0;(function(e){function t(n){let r=n;return r&&(N.string(r.detail)||r.detail===void 0)&&(N.string(r.description)||r.description===void 0)}e.is=t})(m0||(m0={}));var g0;(function(e){function t(n){return{label:n}}e.create=t})(g0||(g0={}));var y0;(function(e){function t(n,r){return{items:n||[],isIncomplete:!!r}}e.create=t})(y0||(y0={}));var mf;(function(e){function t(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}e.fromPlainText=t;function n(r){let i=r;return N.string(i)||N.objectLiteral(i)&&N.string(i.language)&&N.string(i.value)}e.is=n})(mf||(mf={}));var x0;(function(e){function t(n){let r=n;return!!r&&N.objectLiteral(r)&&(gi.is(r.contents)||mf.is(r.contents)||N.typedArray(r.contents,mf.is))&&(n.range===void 0||pe.is(n.range))}e.is=t})(x0||(x0={}));var E0;(function(e){function t(n,r){return r?{label:n,documentation:r}:{label:n}}e.create=t})(E0||(E0={}));var w0;(function(e){function t(n,r,...i){let o={label:n};return N.defined(r)&&(o.documentation=r),N.defined(i)?o.parameters=i:o.parameters=[],o}e.create=t})(w0||(w0={}));var T0;(function(e){e.Text=1,e.Read=2,e.Write=3})(T0||(T0={}));var _0;(function(e){function t(n,r){let i={range:n};return N.number(r)&&(i.kind=r),i}e.create=t})(_0||(_0={}));var v0;(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})(v0||(v0={}));var A0;(function(e){e.Deprecated=1})(A0||(A0={}));var k0;(function(e){function t(n,r,i,o,s){let a={name:n,kind:r,location:{uri:o,range:i}};return s&&(a.containerName=s),a}e.create=t})(k0||(k0={}));var I0;(function(e){function t(n,r,i,o){return o!==void 0?{name:n,kind:r,location:{uri:i,range:o}}:{name:n,kind:r,location:{uri:i}}}e.create=t})(I0||(I0={}));var R0;(function(e){function t(r,i,o,s,a,l){let c={name:r,detail:i,kind:o,range:s,selectionRange:a};return l!==void 0&&(c.children=l),c}e.create=t;function n(r){let i=r;return i&&N.string(i.name)&&N.number(i.kind)&&pe.is(i.range)&&pe.is(i.selectionRange)&&(i.detail===void 0||N.string(i.detail))&&(i.deprecated===void 0||N.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}e.is=n})(R0||(R0={}));var S0;(function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorMove="refactor.move",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll",e.Notebook="notebook"})(S0||(S0={}));var gf;(function(e){e.Invoked=1,e.Automatic=2})(gf||(gf={}));var b0;(function(e){function t(r,i,o){let s={diagnostics:r};return i!=null&&(s.only=i),o!=null&&(s.triggerKind=o),s}e.create=t;function n(r){let i=r;return N.defined(i)&&N.typedArray(i.diagnostics,pf.is)&&(i.only===void 0||N.typedArray(i.only,N.string))&&(i.triggerKind===void 0||i.triggerKind===gf.Invoked||i.triggerKind===gf.Automatic)}e.is=n})(b0||(b0={}));var lg;(function(e){e.LLMGenerated=1;function t(n){return N.defined(n)&&n===e.LLMGenerated}e.is=t})(lg||(lg={}));var N0;(function(e){function t(r,i,o){let s={title:r},a=!0;return typeof i=="string"?(a=!1,s.kind=i):Xo.is(i)?s.command=i:s.edit=i,a&&o!==void 0&&(s.kind=o),s}e.create=t;function n(r){let i=r;return i&&N.string(i.title)&&(i.diagnostics===void 0||N.typedArray(i.diagnostics,pf.is))&&(i.kind===void 0||N.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Xo.is(i.command))&&(i.isPreferred===void 0||N.boolean(i.isPreferred))&&(i.edit===void 0||og.is(i.edit))&&(i.tags===void 0||N.typedArray(i.tags,lg.is))}e.is=n})(N0||(N0={}));var L0;(function(e){function t(r,i){let o={range:r};return N.defined(i)&&(o.data=i),o}e.create=t;function n(r){let i=r;return N.defined(i)&&pe.is(i.range)&&(N.undefined(i.command)||Xo.is(i.command))}e.is=n})(L0||(L0={}));var P0;(function(e){function t(r,i){return{tabSize:r,insertSpaces:i}}e.create=t;function n(r){let i=r;return N.defined(i)&&N.uinteger(i.tabSize)&&N.boolean(i.insertSpaces)}e.is=n})(P0||(P0={}));var C0;(function(e){function t(r,i,o){return{range:r,target:i,data:o}}e.create=t;function n(r){let i=r;return N.defined(i)&&pe.is(i.range)&&(N.undefined(i.target)||N.string(i.target))}e.is=n})(C0||(C0={}));var O0;(function(e){function t(r,i){return{range:r,parent:i}}e.create=t;function n(r){let i=r;return N.objectLiteral(i)&&pe.is(i.range)&&(i.parent===void 0||e.is(i.parent))}e.is=n})(O0||(O0={}));var $0;(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",e.label="label"})($0||($0={}));var D0;(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"})(D0||(D0={}));var M0;(function(e){function t(n){let r=n;return N.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}e.is=t})(M0||(M0={}));var F0;(function(e){function t(r,i){return{range:r,text:i}}e.create=t;function n(r){let i=r;return i!=null&&pe.is(i.range)&&N.string(i.text)}e.is=n})(F0||(F0={}));var B0;(function(e){function t(r,i,o){return{range:r,variableName:i,caseSensitiveLookup:o}}e.create=t;function n(r){let i=r;return i!=null&&pe.is(i.range)&&N.boolean(i.caseSensitiveLookup)&&(N.string(i.variableName)||i.variableName===void 0)}e.is=n})(B0||(B0={}));var W0;(function(e){function t(r,i){return{range:r,expression:i}}e.create=t;function n(r){let i=r;return i!=null&&pe.is(i.range)&&(N.string(i.expression)||i.expression===void 0)}e.is=n})(W0||(W0={}));var X0;(function(e){function t(r,i){return{frameId:r,stoppedLocation:i}}e.create=t;function n(r){let i=r;return N.defined(i)&&pe.is(r.stoppedLocation)}e.is=n})(X0||(X0={}));var cg;(function(e){e.Type=1,e.Parameter=2;function t(n){return n===1||n===2}e.is=t})(cg||(cg={}));var ug;(function(e){function t(r){return{value:r}}e.create=t;function n(r){let i=r;return N.objectLiteral(i)&&(i.tooltip===void 0||N.string(i.tooltip)||gi.is(i.tooltip))&&(i.location===void 0||df.is(i.location))&&(i.command===void 0||Xo.is(i.command))}e.is=n})(ug||(ug={}));var U0;(function(e){function t(r,i,o){let s={position:r,label:i};return o!==void 0&&(s.kind=o),s}e.create=t;function n(r){let i=r;return N.objectLiteral(i)&&_e.is(i.position)&&(N.string(i.label)||N.typedArray(i.label,ug.is))&&(i.kind===void 0||cg.is(i.kind))&&i.textEdits===void 0||N.typedArray(i.textEdits,Uo.is)&&(i.tooltip===void 0||N.string(i.tooltip)||gi.is(i.tooltip))&&(i.paddingLeft===void 0||N.boolean(i.paddingLeft))&&(i.paddingRight===void 0||N.boolean(i.paddingRight))}e.is=n})(U0||(U0={}));var fg;(function(e){function t(r){return{kind:"snippet",value:r}}e.createSnippet=t;function n(r){let i=r;return N.objectLiteral(i)&&i.kind==="snippet"&&N.string(i.value)}e.isSnippet=n})(fg||(fg={}));var G0;(function(e){function t(n,r,i,o){return{insertText:n,filterText:r,range:i,command:o}}e.create=t})(G0||(G0={}));var H0;(function(e){function t(n){return{items:n}}e.create=t})(H0||(H0={}));var z0;(function(e){e.Invoked=1,e.Automatic=2})(z0||(z0={}));var j0;(function(e){function t(n,r){return{range:n,text:r}}e.create=t})(j0||(j0={}));var Y0;(function(e){function t(n,r){return{triggerKind:n,selectedCompletionInfo:r}}e.create=t})(Y0||(Y0={}));var V0;(function(e){function t(n){let r=n;return N.objectLiteral(r)&&Jm.is(r.uri)&&N.string(r.name)}e.is=t})(V0||(V0={}));var K0;(function(e){function t(o,s,a,l){return new dg(o,s,a,l)}e.create=t;function n(o){let s=o;return!!(N.defined(s)&&N.string(s.uri)&&(N.undefined(s.languageId)||N.string(s.languageId))&&N.uinteger(s.lineCount)&&N.func(s.getText)&&N.func(s.positionAt)&&N.func(s.offsetAt))}e.is=n;function r(o,s){let a=o.getText(),l=i(s,(u,f)=>{let d=u.range.start.line-f.range.start.line;return d===0?u.range.start.character-f.range.start.character:d}),c=a.length;for(let u=l.length-1;u>=0;u--){let f=l[u],d=o.offsetAt(f.range.start),p=o.offsetAt(f.range.end);if(p<=c)a=a.substring(0,d)+f.newText+a.substring(p,a.length);else throw new Error("Overlapping edit");c=d}return a}e.applyEdits=r;function i(o,s){if(o.length<=1)return o;let a=o.length/2|0,l=o.slice(0,a),c=o.slice(a);i(l,s),i(c,s);let u=0,f=0,d=0;for(;u<l.length&&f<c.length;)s(l[u],c[f])<=0?o[d++]=l[u++]:o[d++]=c[f++];for(;u<l.length;)o[d++]=l[u++];for(;f<c.length;)o[d++]=c[f++];return o}})(K0||(K0={}));var dg=class{constructor(t,n,r,i){this._uri=t,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(t){if(t){let n=this.offsetAt(t.start),r=this.offsetAt(t.end);return this._content.substring(n,r)}return this._content}update(t,n){this._content=t.text,this._version=n,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let t=[],n=this._content,r=!0;for(let i=0;i<n.length;i++){r&&(t.push(i),r=!1);let o=n.charAt(i);r=o==="\r"||o===`
|
|
119
119
|
`,o==="\r"&&i+1<n.length&&n.charAt(i+1)===`
|
|
120
|
-
`&&i++}r&&n.length>0&&t.push(n.length),this._lineOffsets=t}return this._lineOffsets}positionAt(t){t=Math.max(Math.min(t,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return
|
|
120
|
+
`&&i++}r&&n.length>0&&t.push(n.length),this._lineOffsets=t}return this._lineOffsets}positionAt(t){t=Math.max(Math.min(t,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return _e.create(0,t);for(;r<i;){let s=Math.floor((r+i)/2);n[s]>t?i=s:r=s+1}let o=r-1;return _e.create(o,t-n[o])}offsetAt(t){let n=this.getLineOffsets();if(t.line>=n.length)return this._content.length;if(t.line<0)return 0;let r=n[t.line],i=t.line+1<n.length?n[t.line+1]:this._content.length;return Math.max(Math.min(r+t.character,i),r)}get lineCount(){return this.getLineOffsets().length}},N;(function(e){let t=Object.prototype.toString;function n(p){return typeof p<"u"}e.defined=n;function r(p){return typeof p>"u"}e.undefined=r;function i(p){return p===!0||p===!1}e.boolean=i;function o(p){return t.call(p)==="[object String]"}e.string=o;function s(p){return t.call(p)==="[object Number]"}e.number=s;function a(p,m,g){return t.call(p)==="[object Number]"&&m<=p&&p<=g}e.numberRange=a;function l(p){return t.call(p)==="[object Number]"&&-2147483648<=p&&p<=2147483647}e.integer=l;function c(p){return t.call(p)==="[object Number]"&&0<=p&&p<=2147483647}e.uinteger=c;function u(p){return t.call(p)==="[object Function]"}e.func=u;function f(p){return p!==null&&typeof p=="object"}e.objectLiteral=f;function d(p,m){return Array.isArray(p)&&p.every(m)}e.typedArray=d})(N||(N={}));function J0(e,t,n){let r,i;typeof e=="string"?(i=t,r=n):(i=e.range.start,r=t),i||(i=_e.create(0,0));let o=eA(e),s=mg(r),a=IM({lines:o,position:i,options:s});return LM({index:0,tokens:a,position:i})}function Q0(e,t){let n=mg(t),r=eA(e);if(r.length===0)return!1;let i=r[0],o=r[r.length-1],s=n.start,a=n.end;return!!s?.exec(i)&&!!a?.exec(o)}function eA(e){let t="";return typeof e=="string"?t=e:t=e.text,t.split(GE)}var q0=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,kM=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function IM(e){let t=[],n=e.position.line,r=e.position.character;for(let i=0;i<e.lines.length;i++){let o=i===0,s=i===e.lines.length-1,a=e.lines[i],l=0;if(o&&e.options.start){let u=e.options.start?.exec(a);u&&(l=u.index+u[0].length)}else{let u=e.options.line?.exec(a);u&&(l=u.index+u[0].length)}if(s){let u=e.options.end?.exec(a);u&&(a=a.substring(0,u.index))}if(a=a.substring(0,NM(a)),hg(a,l)>=a.length){if(t.length>0){let u=_e.create(n,r);t.push({type:"break",content:"",range:pe.create(u,u)})}}else{q0.lastIndex=l;let u=q0.exec(a);if(u){let f=u[0],d=u[1],p=_e.create(n,r+l),m=_e.create(n,r+l+f.length);t.push({type:"tag",content:d,range:pe.create(p,m)}),l+=f.length,l=hg(a,l)}if(l<a.length){let f=a.substring(l),d=Array.from(f.matchAll(kM));t.push(...RM(d,f,n,r+l))}}n++,r=0}return t.length>0&&t[t.length-1].type==="break"?t.slice(0,-1):t}function RM(e,t,n,r){let i=[];if(e.length===0){let o=_e.create(n,r),s=_e.create(n,r+t.length);i.push({type:"text",content:t,range:pe.create(o,s)})}else{let o=0;for(let a of e){let l=a.index,c=t.substring(o,l);c.length>0&&i.push({type:"text",content:t.substring(o,l),range:pe.create(_e.create(n,o+r),_e.create(n,l+r))});let u=c.length+1,f=a[1];if(i.push({type:"inline-tag",content:f,range:pe.create(_e.create(n,o+u+r),_e.create(n,o+u+f.length+r))}),u+=f.length,a.length===4){u+=a[2].length;let d=a[3];i.push({type:"text",content:d,range:pe.create(_e.create(n,o+u+r),_e.create(n,o+u+d.length+r))})}else i.push({type:"text",content:"",range:pe.create(_e.create(n,o+u+r),_e.create(n,o+u+r))});o=l+a[0].length}let s=t.substring(o);s.length>0&&i.push({type:"text",content:s,range:pe.create(_e.create(n,o+r),_e.create(n,o+r+s.length))})}return i}var SM=/\S/,bM=/\s*$/;function hg(e,t){let n=e.substring(t).match(SM);return n?t+n.index:e.length}function NM(e){let t=e.match(bM);if(t&&typeof t.index=="number")return t.index}function LM(e){let t=_e.create(e.position.line,e.position.character);if(e.tokens.length===0)return new yf([],pe.create(t,t));let n=[];for(;e.index<e.tokens.length;){let o=PM(e,n[n.length-1]);o&&n.push(o)}let r=n[0]?.range.start??t,i=n[n.length-1]?.range.end??t;return new yf(n,pe.create(r,i))}function PM(e,t){let n=e.tokens[e.index];if(n.type==="tag")return nA(e,!1);if(n.type==="text"||n.type==="inline-tag")return tA(e);CM(n,t),e.index++}function CM(e,t){if(t){let n=new xf("",e.range);"inlines"in t?t.inlines.push(n):t.content.inlines.push(n)}}function tA(e){let t=e.tokens[e.index],n=t,r=t,i=[];for(;t&&t.type!=="break"&&t.type!=="tag";)i.push(OM(e)),r=t,t=e.tokens[e.index];return new $a(i,pe.create(n.range.start,r.range.end))}function OM(e){return e.tokens[e.index].type==="inline-tag"?nA(e,!0):rA(e)}function nA(e,t){let n=e.tokens[e.index++],r=n.content.substring(1);if(e.tokens[e.index]?.type==="text")if(t){let o=rA(e);return new Oa(r,new $a([o],o.range),t,pe.create(n.range.start,o.range.end))}else{let o=tA(e);return new Oa(r,o,t,pe.create(n.range.start,o.range.end))}else{let o=n.range;return new Oa(r,new $a([],o),t,o)}}function rA(e){let t=e.tokens[e.index++];return new xf(t.content,t.range)}function mg(e){if(!e)return mg({start:"/**",end:"*/",line:"*"});let{start:t,end:n,line:r}=e;return{start:pg(t,!0),end:pg(n,!1),line:pg(r,!0)}}function pg(e,t){if(typeof e=="string"||typeof e=="object"){let n=typeof e=="string"?Qr(e):e.source;return t?new RegExp(`^\\s*${n}`):new RegExp(`\\s*${n}\\s*$`)}else return e}var yf=class{constructor(t,n){this.elements=t,this.range=n}getTag(t){return this.getAllTags().find(n=>n.name===t)}getTags(t){return this.getAllTags().filter(n=>n.name===t)}getAllTags(){return this.elements.filter(t=>"name"in t)}toString(){let t="";for(let n of this.elements)if(t.length===0)t=n.toString();else{let r=n.toString();t+=Z0(t)+r}return t.trim()}toMarkdown(t){let n="";for(let r of this.elements)if(n.length===0)n=r.toMarkdown(t);else{let i=r.toMarkdown(t);n+=Z0(n)+i}return n.trim()}},Oa=class{constructor(t,n,r,i){this.name=t,this.content=n,this.inline=r,this.range=i}toString(){let t=`@${this.name}`,n=this.content.toString();return this.content.inlines.length===1?t=`${t} ${n}`:this.content.inlines.length>1&&(t=`${t}
|
|
121
121
|
${n}`),this.inline?`{${t}}`:t}toMarkdown(t){return t?.renderTag?.(this)??this.toMarkdownDefault(t)}toMarkdownDefault(t){let n=this.content.toMarkdown(t);if(this.inline){let o=$M(this.name,n,t??{});if(typeof o=="string")return o}let r="";t?.tag==="italic"||t?.tag===void 0?r="*":t?.tag==="bold"?r="**":t?.tag==="bold-italic"&&(r="***");let i=`${r}@${this.name}${r}`;return this.content.inlines.length===1?i=`${i} \u2014 ${n}`:this.content.inlines.length>1&&(i=`${i}
|
|
122
|
-
${n}`),this.inline?`{${i}}`:i}};function $M(e,t,n){if(e==="linkplain"||e==="linkcode"||e==="link"){let r=t.indexOf(" "),i=t;if(r>0){let s=
|
|
122
|
+
${n}`),this.inline?`{${i}}`:i}};function $M(e,t,n){if(e==="linkplain"||e==="linkcode"||e==="link"){let r=t.indexOf(" "),i=t;if(r>0){let s=hg(t,r);i=t.substring(s),t=t.substring(0,r)}return(e==="linkcode"||e==="link"&&n.link==="code")&&(i=`\`${i}\``),n.renderLink?.(t,i)??DM(t,i)}}function DM(e,t){try{return Oe.parse(e,!0),`[${t}](${e})`}catch{return e}}var $a=class{constructor(t,n){this.inlines=t,this.range=n}toString(){let t="";for(let n=0;n<this.inlines.length;n++){let r=this.inlines[n],i=this.inlines[n+1];t+=r.toString(),i&&i.range.start.line>r.range.start.line&&(t+=`
|
|
123
123
|
`)}return t}toMarkdown(t){let n="";for(let r=0;r<this.inlines.length;r++){let i=this.inlines[r],o=this.inlines[r+1];n+=i.toMarkdown(t),o&&o.range.start.line>i.range.start.line&&(n+=`
|
|
124
|
-
`)}return n}},
|
|
124
|
+
`)}return n}},xf=class{constructor(t,n){this.text=t,this.range=n}toString(){return this.text}toMarkdown(){return this.text}};function Z0(e){return e.endsWith(`
|
|
125
125
|
`)?`
|
|
126
126
|
`:`
|
|
127
127
|
|
|
128
|
-
`}var wf=class{constructor(t){this.indexManager=t.shared.workspace.IndexManager,this.commentProvider=t.documentation.CommentProvider}getDocumentation(t){let n=this.commentProvider.getComment(t);if(n&&eA(n))return Q0(n).toMarkdown({renderLink:(i,o)=>this.documentationLinkRenderer(t,i,o),renderTag:i=>this.documentationTagRenderer(t,i)})}documentationLinkRenderer(t,n,r){let i=this.findNameInLocalSymbols(t,n)??this.findNameInGlobalScope(t,n);if(i&&i.nameSegment){let o=i.nameSegment.range.start.line+1,s=i.nameSegment.range.start.character+1,a=i.documentUri.with({fragment:`L${o},${s}`});return`[${r}](${a.toString()})`}else return}documentationTagRenderer(t,n){}findNameInLocalSymbols(t,n){let i=at(t).localSymbols;if(!i)return;let o=t;do{let a=i.getStream(o).find(l=>l.name===n);if(a)return a;o=o.$container}while(o)}findNameInGlobalScope(t,n){return this.indexManager.allElements().find(i=>i.name===n)}};var Tf=class{constructor(t){this.grammarConfig=()=>t.parser.GrammarConfig}getComment(t){return z_(t)?t.$comment:GE(t.$cstNode,this.grammarConfig().multilineCommentRules)?.text}};var vf=class{constructor(t){this.syncParser=t.parser.LangiumParser}parse(t,n){return Promise.resolve(this.syncParser.parse(t))}};var _f;(function(e){e[e.Normal=0]="Normal",e[e.Immediate=1]="Immediate"})(_f||(_f={}));var Af=class{constructor(){this.previousTokenSource=new ce.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.immediateReads=[],this.done=!0}write(t){this.cancelWrite();let n=B_();return this.previousTokenSource=n,this.enqueue(this.writeQueue,t,n.token)}read(t,n=_f.Normal){if(n===_f.Immediate){let r=Promise.resolve().then(()=>t());this.immediateReads.push(r);let i=()=>{this.immediateReads.splice(this.immediateReads.indexOf(r),1)};return r.then(i,i),r}return this.enqueue(this.readQueue,t)}enqueue(t,n,r=ce.CancellationToken.None){let i=new _r,o={action:n,deferred:i,cancellationToken:r};return t.push(o),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;let t=[];if(this.writeQueue.length>0)for(t.push(this.writeQueue.shift()),this.done=!1;this.immediateReads.length>0;)await Promise.allSettled(this.immediateReads.slice());else if(this.readQueue.length>0)t.push(...this.readQueue.splice(0,this.readQueue.length)),this.done=!1;else return;await Promise.all(t.map(async({action:n,deferred:r,cancellationToken:i})=>{try{let o=await Promise.resolve().then(()=>n(i));r.resolve(o)}catch(o){Ar(o)?r.resolve(void 0):r.reject(o)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}};var kf=class{constructor(t){this.grammarElementIdMap=new Pa,this.tokenTypeIdMap=new Pa,this.cstNodeBuilder=new Po,this.grammar=t.Grammar,this.lexer=t.parser.Lexer,this.linker=t.references.Linker}dehydrate(t){return{lexerErrors:t.lexerErrors,lexerReport:t.lexerReport?this.dehydrateLexerReport(t.lexerReport):void 0,parserErrors:t.parserErrors.map(n=>({...n,message:n.message})),value:this.dehydrateAstNode(t.value,this.createDehyrationContext(t.value))}}dehydrateLexerReport(t){return t}createDehyrationContext(t){let n=new Map,r=new Map;for(let i of yt(t))n.set(i,{});if(t.$cstNode)for(let i of Ks(t.$cstNode))r.set(i,{});return{astNodes:n,cstNodes:r}}dehydrateAstNode(t,n){let r=n.astNodes.get(t);r.$type=t.$type,r.$containerIndex=t.$containerIndex,r.$containerProperty=t.$containerProperty,t.$cstNode!==void 0&&(r.$cstNode=this.dehydrateCstNode(t.$cstNode,n));for(let[i,o]of Object.entries(t))if(!i.startsWith("$"))if(Array.isArray(o)){let s=[];r[i]=s;for(let a of o)Ue(a)?s.push(this.dehydrateAstNode(a,n)):it(a)?s.push(this.dehydrateReference(a,n)):s.push(a)}else Ue(o)?r[i]=this.dehydrateAstNode(o,n):it(o)?r[i]=this.dehydrateReference(o,n):o!==void 0&&(r[i]=o);return r}dehydrateReference(t,n){let r={};return r.$refText=t.$refText,t.$refNode&&(r.$refNode=n.cstNodes.get(t.$refNode)),r}dehydrateCstNode(t,n){let r=n.cstNodes.get(t);if(ql(t)?r.fullText=t.fullText:r.grammarSource=this.getGrammarElementId(t.grammarSource),r.hidden=t.hidden,Jn(t))r.content=t.content.map(i=>this.dehydrateCstNode(i,n));else if(Kl(t)){r.tokenType=t.tokenType.name,r.offset=t.offset,r.length=t.length;let{start:i,end:o}=t.range;r.startLine=i.line,r.startColumn=i.character,r.endLine=o.line,r.endColumn=o.character}return r}hydrate(t){let n=t.value,r=this.createHydrationContext(n);return"$cstNode"in n&&this.hydrateCstNode(n.$cstNode,r),{lexerErrors:t.lexerErrors,lexerReport:t.lexerReport,parserErrors:t.parserErrors,value:this.hydrateAstNode(n,r)}}createHydrationContext(t){let n=new Map,r=new Map;for(let i of yt(t))n.set(i,{});if(t.$cstNode)for(let i of Ks(t.$cstNode)){let o;"fullText"in i?o=new ba(i.fullText):"content"in i?o=new Co:"tokenType"in i&&(o=this.hydrateCstLeafNode(i)),o&&r.set(i,o)}return{astNodes:n,cstNodes:r,linkedCstNodes:new Set}}hydrateAstNode(t,n){let r=n.astNodes.get(t);if(r.$type=t.$type,r.$containerIndex=t.$containerIndex,r.$containerProperty=t.$containerProperty,t.$cstNode){let i=n.cstNodes.get(t.$cstNode);r.$cstNode=i,i&&!n.linkedCstNodes.has(i)&&(n.linkedCstNodes.add(i),i.astNode=r)}for(let[i,o]of Object.entries(t))if(!i.startsWith("$"))if(Array.isArray(o)){let s=[];r[i]=s;for(let a of o)Ue(a)?s.push(this.setParent(this.hydrateAstNode(a,n),r)):it(a)?s.push(this.hydrateReference(a,r,i,n)):s.push(a)}else Ue(o)?r[i]=this.setParent(this.hydrateAstNode(o,n),r):it(o)?r[i]=this.hydrateReference(o,r,i,n):o!==void 0&&(r[i]=o);return r}setParent(t,n){return t.$container=n,t}hydrateReference(t,n,r,i){return this.linker.buildReference(n,r,i.cstNodes.get(t.$refNode),t.$refText)}hydrateCstNode(t,n,r=0){let i=n.cstNodes.get(t);if(typeof t.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(t.grammarSource)),Jn(i)){let o=[];for(let s of t.content)o.push(this.hydrateCstNode(s,n,r++));this.cstNodeBuilder.appendChildren(i,o)}return i}hydrateCstLeafNode(t){let n=this.getTokenType(t.tokenType);return new Sa(t.offset,t.length,t.startLine,t.startColumn,t.endLine,t.endColumn,n,t.hidden)}getTokenType(t){return this.lexer.definition[t]}getGrammarElementId(t){if(t)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(t)}getGrammarElement(t){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(t)}createGrammarElementIdMap(){let t=0;for(let n of yt(this.grammar))dc(n)&&this.grammarElementIdMap.set(n,t++)}};function If(e){return{documentation:{CommentProvider:t=>new Tf(t),DocumentationProvider:t=>new wf(t)},parser:{AsyncParser:t=>new vf(t),GrammarConfig:t=>ew(t),LangiumParser:t=>P_(t),CompletionParser:t=>L_(t),ValueConverter:()=>new $o,TokenBuilder:()=>new Oo,Lexer:t=>new Wo(t),ParserErrorMessageProvider:()=>new Na,LexerErrorMessageProvider:()=>new ff},workspace:{AstNodeLocator:()=>new sf,AstNodeDescriptionProvider:t=>new rf(t),ReferenceDescriptionProvider:t=>new of(t)},references:{Linker:t=>new Hu(t),NameProvider:()=>new zu,ScopeProvider:t=>new Ju(t),ScopeComputation:t=>new Yu(t),References:t=>new ju(t)},serializer:{Hydrator:t=>new kf(t),JsonSerializer:t=>new Qu(t)},validation:{DocumentValidator:t=>new nf(t),ValidationRegistry:t=>new tf(t)},shared:()=>e.shared}}function Rf(e){return{ServiceRegistry:t=>new ef(t),workspace:{LangiumDocuments:t=>new Gu(t),LangiumDocumentFactory:t=>new Uu(t),DocumentBuilder:t=>new lf(t),IndexManager:t=>new cf(t),WorkspaceManager:t=>new uf(t),FileSystemProvider:t=>e.fileSystemProvider(t),WorkspaceLock:()=>new Af,ConfigurationProvider:t=>new af(t)},profilers:{}}}var oA;(function(e){e.merge=(t,n)=>Da(Da({},t),n)})(oA||(oA={}));function Go(e,t,n,r,i,o,s,a,l){let c=[e,t,n,r,i,o,s,a,l].reduce(Da,{});return lA(c)}var MM=Symbol("isProxy");function lA(e,t){let n=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error("Cannot set property on injected service container")},get:(r,i)=>i===MM?!0:aA(r,i,e,t||n),getOwnPropertyDescriptor:(r,i)=>(aA(r,i,e,t||n),Object.getOwnPropertyDescriptor(r,i)),has:(r,i)=>i in e,ownKeys:()=>[...Object.getOwnPropertyNames(e)]});return n}var sA=Symbol();function aA(e,t,n,r){if(t in e){if(e[t]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable. Cause: "+e[t]);if(e[t]===sA)throw new Error('Cycle detected. Please make "'+String(t)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return e[t]}else if(t in n){let i=n[t];e[t]=sA;try{e[t]=typeof i=="function"?i(r):lA(i,r)}catch(o){throw e[t]=o instanceof Error?o:void 0,o}return e[t]}else return}function Da(e,t){if(t){for(let[n,r]of Object.entries(t))if(!(n==="__proto__"||n==="constructor"||n==="prototype")&&r!=null)if(typeof r=="object"){let i=e[n];typeof i=="object"&&i!==null?e[n]=Da(i,r):e[n]=Da({},r)}else e[n]=r}return e}var cA={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},Ho;(function(e){e.REGULAR="indentation-sensitive",e.IGNORE_INDENTATION="ignore-indentation"})(Ho||(Ho={}));var Ma=class extends Oo{constructor(t=cA){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...cA,...t},this.indentTokenType=or({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=or({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(t,n){let r=super.buildTokens(t,n);if(!Jm(r))throw new Error("Invalid tokens built by default builder");let{indentTokenName:i,dedentTokenName:o,whitespaceTokenName:s,ignoreIndentationDelimiters:a}=this.options,l,c,u,f=[];for(let d of r){for(let[p,m]of a)d.name===p?d.PUSH_MODE=Ho.IGNORE_INDENTATION:d.name===m&&(d.POP_MODE=!0);d.name===o?l=d:d.name===i?c=d:d.name===s?u=d:f.push(d)}if(!l||!c||!u)throw new Error("Some indentation/whitespace tokens not found!");return a.length>0?{modes:{[Ho.REGULAR]:[l,c,...f,u],[Ho.IGNORE_INDENTATION]:[...f,u]},defaultMode:Ho.REGULAR}:[l,c,u,...f]}flushLexingReport(t){return{...super.flushLexingReport(t),remainingDedents:this.flushRemainingDedents(t)}}isStartOfLine(t,n){return n===0||`\r
|
|
129
|
-
`.includes(t[n-1])}matchWhitespace(t,n,r,i){this.whitespaceRegExp.lastIndex=n;let o=this.whitespaceRegExp.exec(t);return{currIndentLevel:o?.[0].length??0,prevIndentLevel:this.indentationStack.at(-1),match:o}}createIndentationTokenInstance(t,n,r,i){let o=this.getLineNumber(n,i);return An(t,r,i,i+r.length,o,o,1,r.length)}getLineNumber(t,n){return t.substring(0,n).split(/\r\n|\r|\n/).length}indentMatcher(t,n,r,i){if(!this.isStartOfLine(t,n))return null;let{currIndentLevel:o,prevIndentLevel:s,match:a}=this.matchWhitespace(t,n,r,i);return o<=s?null:(this.indentationStack.push(o),a)}dedentMatcher(t,n,r,i){if(!this.isStartOfLine(t,n))return null;let{currIndentLevel:o,prevIndentLevel:s,match:a}=this.matchWhitespace(t,n,r,i);if(o>=s)return null;let l=this.indentationStack.lastIndexOf(o);if(l===-1)return this.diagnostics.push({severity:"error",message:`Invalid dedent level ${o} at offset: ${n}. Current indentation stack: ${this.indentationStack}`,offset:n,length:a?.[0]?.length??0,line:this.getLineNumber(t,n),column:1}),null;let c=this.indentationStack.length-l-1,u=t.substring(0,n).match(/[\r\n]+$/)?.[0].length??1;for(let f=0;f<c;f++){let d=this.createIndentationTokenInstance(this.dedentTokenType,t,"",n-(u-1));r.push(d),this.indentationStack.pop()}return null}buildTerminalToken(t){let n=super.buildTerminalToken(t),{indentTokenName:r,dedentTokenName:i,whitespaceTokenName:o}=this.options;return n.name===r?this.indentTokenType:n.name===i?this.dedentTokenType:n.name===o?or({name:o,pattern:this.whitespaceRegExp,group:Me.SKIPPED}):n}flushRemainingDedents(t){let n=[];for(;this.indentationStack.length>1;)n.push(this.createIndentationTokenInstance(this.dedentTokenType,t,"",t.length)),this.indentationStack.pop();return this.indentationStack=[0],n}},Sf=class extends Wo{constructor(t){if(super(t),t.parser.TokenBuilder instanceof Ma)this.indentationTokenBuilder=t.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(t,n=Zm){let r=super.tokenize(t),i=r.report;n?.mode==="full"&&r.tokens.push(...i.remainingDedents),i.remainingDedents=[];let{indentTokenType:o,dedentTokenType:s}=this.indentationTokenBuilder,a=o.tokenTypeIdx,l=s.tokenTypeIdx,c=[],u=r.tokens.length-1;for(let f=0;f<u;f++){let d=r.tokens[f],p=r.tokens[f+1];if(d.tokenTypeIdx===a&&p.tokenTypeIdx===l){f++;continue}c.push(d)}return u>=0&&c.push(r.tokens[u]),r.tokens=c,r}};var yg=class{stat(t){throw new Error("No file system is available.")}statSync(t){throw new Error("No file system is available.")}async exists(){return!1}existsSync(){return!1}readBinary(){throw new Error("No file system is available.")}readBinarySync(){throw new Error("No file system is available.")}readFile(){throw new Error("No file system is available.")}readFileSync(){throw new Error("No file system is available.")}async readDirectory(){return[]}readDirectorySync(){return[]}},bf={fileSystemProvider:()=>new yg};var FM={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},BM={AstReflection:()=>new Vs};function WM(){let e=Go(Rf(bf),BM),t=Go(If({shared:e}),FM);return e.ServiceRegistry.register(t),t}function uA(e){let t=WM(),n=t.serializer.JsonSerializer.deserialize(e);return t.shared.workspace.LangiumDocumentFactory.fromModel(n,Oe.parse(`memory:/${n.name??"grammar"}.langium`)),n}var zo={$type:"AnchorDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function os(e){return We.isInstance(e,zo.$type)}var xg={$type:"BlockProperty",key:"key",value:"value"};var _g={$type:"CalendarBlock",properties:"properties"};function Ha(e){return We.isInstance(e,_g.$type)}var Pn={$type:"ConfigEntry"};function dA(e){return We.isInstance(e,Pn.$type)}var Of={$type:"DefaultDeclaration",entityType:"entityType",properties:"properties"};function nt(e){return We.isInstance(e,Of.$type)}var Ag={$type:"DescriptionDirective",text:"text"};function za(e){return We.isInstance(e,Ag.$type)}var Nf={$type:"EntityProperty",key:"key",value:"value",values:"values"};var jo={$type:"FootnoteDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function Ig(e){return We.isInstance(e,jo.$type)}var Yo={$type:"GroupBlock",content:"content",name:"name",properties:"properties",title:"title"};function $e(e){return We.isInstance(e,Yo.$type)}var Fa={$type:"GroupContent"};var Eg={$type:"IncludeDeclaration",options:"options",path:"path"};var wg={$type:"IncludeOption",key:"key",value:"value"};var Vo={$type:"ItemDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function Ke(e){return We.isInstance(e,Vo.$type)}var Ko={$type:"LabelDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function ja(e){return We.isInstance(e,Ko.$type)}var qo={$type:"MilestoneDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function pn(e){return We.isInstance(e,qo.$type)}var Wa={$type:"NonWorkingDeclaration",name:"name",properties:"properties",title:"title"};function Ir(e){return We.isInstance(e,Wa.$type)}var Tg={$type:"NowlineDirective",properties:"properties",version:"version"};var kr={$type:"NowlineFile",configEntries:"configEntries",directive:"directive",hasConfig:"hasConfig",includes:"includes",roadmapDecl:"roadmapDecl",roadmapEntries:"roadmapEntries"};function ss(e){return We.isInstance(e,kr.$type)}var Zo={$type:"ParallelBlock",content:"content",name:"name",properties:"properties",title:"title"};function tt(e){return We.isInstance(e,Zo.$type)}var Lf={$type:"ParallelContent"};var Jo={$type:"PersonDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function Ya(e){return We.isInstance(e,Jo.$type)}var fA={$type:"PersonMemberRef",ref:"ref"};var Pf={$type:"RoadmapDeclaration",name:"name",properties:"properties",title:"title"};var Zt={$type:"RoadmapEntry"};var kg={$type:"ScaleBlock",properties:"properties"};function pA(e){return We.isInstance(e,kg.$type)}var Qo={$type:"SizeDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function yi(e){return We.isInstance(e,Qo.$type)}var es={$type:"StatusDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function Va(e){return We.isInstance(e,es.$type)}var Xa={$type:"StyleDeclaration",name:"name",properties:"properties",title:"title"};function Dt(e){return We.isInstance(e,Xa.$type)}var vg={$type:"StyleProperty",key:"key",value:"value"};var Ba={$type:"SwimlaneContent"};var ts={$type:"SwimlaneDeclaration",content:"content",name:"name",properties:"properties",title:"title"};function qe(e){return We.isInstance(e,ts.$type)}var ns={$type:"SymbolDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function xi(e){return We.isInstance(e,ns.$type)}var Cf={$type:"TeamContent"};var rs={$type:"TeamDeclaration",content:"content",name:"name",properties:"properties",title:"title"};function Cn(e){return We.isInstance(e,rs.$type)}var is={$type:"WaveDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function Tt(e){return We.isInstance(e,is.$type)}var Ua={$type:"WorkingDeclaration",name:"name",properties:"properties",title:"title"};function Ka(e){return We.isInstance(e,Ua.$type)}var Ga=class extends Ui{constructor(){super(...arguments);M(this,"types",{AnchorDeclaration:{name:zo.$type,properties:{description:{name:zo.description,optional:!0},name:{name:zo.name,optional:!0},properties:{name:zo.properties,defaultValue:[],optional:!0},title:{name:zo.title,optional:!0}},superTypes:[Zt.$type]},BlockProperty:{name:xg.$type,properties:{key:{name:xg.key},value:{name:xg.value}},superTypes:[]},CalendarBlock:{name:_g.$type,properties:{properties:{name:_g.properties,defaultValue:[],optional:!0}},superTypes:[Pn.$type]},ConfigEntry:{name:Pn.$type,properties:{},superTypes:[]},DefaultDeclaration:{name:Of.$type,properties:{entityType:{name:Of.entityType},properties:{name:Of.properties,defaultValue:[],optional:!0}},superTypes:[Pn.$type]},DescriptionDirective:{name:Ag.$type,properties:{text:{name:Ag.text}},superTypes:[Fa.$type,Lf.$type,Ba.$type,Cf.$type]},EntityProperty:{name:Nf.$type,properties:{key:{name:Nf.key},value:{name:Nf.value,optional:!0},values:{name:Nf.values,defaultValue:[],optional:!0}},superTypes:[]},FootnoteDeclaration:{name:jo.$type,properties:{description:{name:jo.description,optional:!0},name:{name:jo.name,optional:!0},properties:{name:jo.properties,defaultValue:[],optional:!0},title:{name:jo.title,optional:!0}},superTypes:[Zt.$type]},GroupBlock:{name:Yo.$type,properties:{content:{name:Yo.content,defaultValue:[]},name:{name:Yo.name,optional:!0},properties:{name:Yo.properties,defaultValue:[],optional:!0},title:{name:Yo.title,optional:!0}},superTypes:[Fa.$type,Lf.$type,Ba.$type]},GroupContent:{name:Fa.$type,properties:{},superTypes:[]},IncludeDeclaration:{name:Eg.$type,properties:{options:{name:Eg.options,defaultValue:[],optional:!0},path:{name:Eg.path}},superTypes:[]},IncludeOption:{name:wg.$type,properties:{key:{name:wg.key},value:{name:wg.value}},superTypes:[]},ItemDeclaration:{name:Vo.$type,properties:{description:{name:Vo.description,optional:!0},name:{name:Vo.name,optional:!0},properties:{name:Vo.properties,defaultValue:[],optional:!0},title:{name:Vo.title,optional:!0}},superTypes:[Fa.$type,Lf.$type,Ba.$type]},LabelDeclaration:{name:Ko.$type,properties:{description:{name:Ko.description,optional:!0},name:{name:Ko.name,optional:!0},properties:{name:Ko.properties,defaultValue:[],optional:!0},title:{name:Ko.title,optional:!0}},superTypes:[Zt.$type]},MilestoneDeclaration:{name:qo.$type,properties:{description:{name:qo.description,optional:!0},name:{name:qo.name,optional:!0},properties:{name:qo.properties,defaultValue:[],optional:!0},title:{name:qo.title,optional:!0}},superTypes:[Zt.$type]},NonWorkingDeclaration:{name:Wa.$type,properties:{name:{name:Wa.name,optional:!0},properties:{name:Wa.properties,defaultValue:[],optional:!0},title:{name:Wa.title,optional:!0}},superTypes:[Pn.$type]},NowlineDirective:{name:Tg.$type,properties:{properties:{name:Tg.properties,defaultValue:[],optional:!0},version:{name:Tg.version}},superTypes:[]},NowlineFile:{name:kr.$type,properties:{configEntries:{name:kr.configEntries,defaultValue:[],optional:!0},directive:{name:kr.directive,optional:!0},hasConfig:{name:kr.hasConfig,defaultValue:!1,optional:!0},includes:{name:kr.includes,defaultValue:[],optional:!0},roadmapDecl:{name:kr.roadmapDecl,optional:!0},roadmapEntries:{name:kr.roadmapEntries,defaultValue:[],optional:!0}},superTypes:[]},ParallelBlock:{name:Zo.$type,properties:{content:{name:Zo.content,defaultValue:[]},name:{name:Zo.name,optional:!0},properties:{name:Zo.properties,defaultValue:[],optional:!0},title:{name:Zo.title,optional:!0}},superTypes:[Fa.$type,Ba.$type]},ParallelContent:{name:Lf.$type,properties:{},superTypes:[]},PersonDeclaration:{name:Jo.$type,properties:{description:{name:Jo.description,optional:!0},name:{name:Jo.name,optional:!0},properties:{name:Jo.properties,defaultValue:[],optional:!0},title:{name:Jo.title,optional:!0}},superTypes:[Zt.$type]},PersonMemberRef:{name:fA.$type,properties:{ref:{name:fA.ref}},superTypes:[Cf.$type]},RoadmapDeclaration:{name:Pf.$type,properties:{name:{name:Pf.name,optional:!0},properties:{name:Pf.properties,defaultValue:[],optional:!0},title:{name:Pf.title,optional:!0}},superTypes:[]},RoadmapEntry:{name:Zt.$type,properties:{},superTypes:[]},ScaleBlock:{name:kg.$type,properties:{properties:{name:kg.properties,defaultValue:[],optional:!0}},superTypes:[Pn.$type]},SizeDeclaration:{name:Qo.$type,properties:{description:{name:Qo.description,optional:!0},name:{name:Qo.name,optional:!0},properties:{name:Qo.properties,defaultValue:[],optional:!0},title:{name:Qo.title,optional:!0}},superTypes:[Zt.$type]},StatusDeclaration:{name:es.$type,properties:{description:{name:es.description,optional:!0},name:{name:es.name,optional:!0},properties:{name:es.properties,defaultValue:[],optional:!0},title:{name:es.title,optional:!0}},superTypes:[Zt.$type]},StyleDeclaration:{name:Xa.$type,properties:{name:{name:Xa.name,optional:!0},properties:{name:Xa.properties,defaultValue:[],optional:!0},title:{name:Xa.title,optional:!0}},superTypes:[Pn.$type]},StyleProperty:{name:vg.$type,properties:{key:{name:vg.key},value:{name:vg.value}},superTypes:[]},SwimlaneContent:{name:Ba.$type,properties:{},superTypes:[]},SwimlaneDeclaration:{name:ts.$type,properties:{content:{name:ts.content,defaultValue:[],optional:!0},name:{name:ts.name,optional:!0},properties:{name:ts.properties,defaultValue:[],optional:!0},title:{name:ts.title,optional:!0}},superTypes:[Zt.$type]},SymbolDeclaration:{name:ns.$type,properties:{description:{name:ns.description,optional:!0},name:{name:ns.name,optional:!0},properties:{name:ns.properties,defaultValue:[],optional:!0},title:{name:ns.title,optional:!0}},superTypes:[Pn.$type]},TeamContent:{name:Cf.$type,properties:{},superTypes:[]},TeamDeclaration:{name:rs.$type,properties:{content:{name:rs.content,defaultValue:[],optional:!0},name:{name:rs.name,optional:!0},properties:{name:rs.properties,defaultValue:[],optional:!0},title:{name:rs.title,optional:!0}},superTypes:[Zt.$type,Cf.$type]},WaveDeclaration:{name:is.$type,properties:{description:{name:is.description,optional:!0},name:{name:is.name,optional:!0},properties:{name:is.properties,defaultValue:[],optional:!0},title:{name:is.title,optional:!0}},superTypes:[Zt.$type]},WorkingDeclaration:{name:Ua.$type,properties:{name:{name:Ua.name,optional:!0},properties:{name:Ua.properties,defaultValue:[],optional:!0},title:{name:Ua.title,optional:!0}},superTypes:[Pn.$type]}})}},We=new Ga;function vt(e){let t=[];for(let n of e.content)za(n)||t.push(n);return t}function*mA(e){for(let t of e)yield*Rg(t)}function*Rg(e){for(let t of vt(e))yield t,($e(t)||tt(t))&&(yield*Rg(t))}function*gA(e){for(let t of e.content)Cn(t)&&(yield t,yield*gA(t))}function*Sg(e){qe(e)||$e(e)||tt(e)?yield*Rg(e):Cn(e)&&(yield*gA(e))}function*On(e,t={}){t.config&&(yield*e.configEntries),t.roadmap&&e.roadmapDecl&&(yield e.roadmapDecl);for(let n of e.roadmapEntries)yield n,yield*Sg(n)}function $f(e,t){hA(e,t);for(let n of Sg(e))hA(n,t)}function hA(e,t){let n=e.properties;if(Array.isArray(n))for(let r of n)t(r,e)}function Df(e,t){t(e.name,e);for(let n of Sg(e))t(n.name,n)}function yA(e){return e.name}function xA(e){let t=new Set;for(let n of On(e,{roadmap:!0})){let r=yA(n);r&&t.add(r)}return t}function EA(e){let t=new Map;for(let n of On(e,{roadmap:!0})){let r=yA(n);r&&!t.has(r)&&t.set(r,n)}return t}function Q(e){return e.key.endsWith(":")?e.key.slice(0,-1):e.key}function _t(e,t){return e.find(n=>Q(n)===t)}function re(e,t){return _t(e,t)?.value}function Be(e,t){let n=_t(e,t);return n?n.value!==void 0?[n.value]:[...n.values]:[]}var ot=/^\d{4}-\d{2}-\d{2}$/;function _e(e){if(!e||!ot.test(e))return null;let[t,n,r]=e.split("-").map(s=>Number.parseInt(s,10)),i=new Date(0);return i.setUTCFullYear(t,n-1,r),i.getUTCFullYear()===t&&i.getUTCMonth()===n-1&&i.getUTCDate()===r?i:null}function He(e){return _e(e)!==null}var TA={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};function Ng(e){return Object.hasOwn(TA,e)}var Lg=new Set(["date","start","end","every"]);function qa(e){let t=new Map;for(let l of e.properties){let c=Q(l);Lg.has(c)&&!t.has(c)&&t.set(c,l)}let n=XM(t),r={own:t,shape:n,wellFormed:!1},i=t.get("date");if(i){let l=bg(i);l.every(He)&&(r.dates=l)}let o=wA(t.get("start"));o!==void 0&&(r.start=o);let s=wA(t.get("end"));s!==void 0&&(r.end=s);let a=t.get("every");if(a){let l=bg(a);l.every(Ng)&&(r.weekdays=l.map(c=>TA[c]))}return r.wellFormed=n!=="malformed"&&(!i||r.dates!==void 0&&r.dates.length>0)&&(!t.has("start")||r.start!==void 0)&&(!t.has("end")||r.end!==void 0)&&!(r.start!==void 0&&r.end!==void 0&&r.end<r.start)&&(!a||r.weekdays!==void 0&&r.weekdays.length>0),r}function Mf(e){return e.some(t=>t.$type==="NonWorkingDeclaration"&&t.name==="weekend")}function XM(e){let t=e.has("start"),n=e.has("end");return e.has("date")?e.has("every")||t||n?"malformed":"dated":e.has("every")?t&&n?"bounded-recurrence":t||n?"half-bounded-recurrence":"open-recurrence":t&&n?"range":"malformed"}function bg(e){return e.value!==void 0?[e.value]:[...e.values]}function wA(e){if(!e)return;let t=bg(e);return t.length===1&&He(t[0])?t[0]:void 0}function Ff(e,t,n){let r=[],i=n.defaults.get(e);if(i){let l=Pg("default-style",i.properties,n);l&&r.push(l),r.push({level:"default",props:i.properties})}let o=_t(t,"labels"),s=o?o.value?[o.value]:o.values:[];for(let l of[...s].reverse()){let c=n.labels.get(l);if(!c){r.push({level:"label",id:l,label:void 0});continue}let u=Pg("label-style",c.properties,n);u&&r.push(u)}let a=Pg("entity-style",t,n);return a&&r.push(a),r.push({level:"inline",props:t}),r}function Pg(e,t,n){let r=_t(t,"style")?.value;if(r)return{level:e,id:r,decl:n.styles.get(r)}}var Bf=["planned","in-progress","active","done","completed","at-risk","blocked"],Ei=["none","multiplier","person","people","points","time"],Za=[...Ei,"shield","warning","lock","calendar"],vA=["hide","show"],_A={border:["solid","dashed","dotted"],shadow:["none","subtle","soft","hard"],font:["sans","serif","mono"],weight:["thin","light","normal","bold"],italic:["true","false"],"text-size":["none","xs","sm","md","lg","xl"],padding:["none","xs","sm","md","lg","xl"],spacing:["none","xs","sm","md","lg","xl"],"header-height":["none","xs","sm","md","lg","xl"],"corner-radius":["none","xs","sm","md","lg","xl","full"],bracket:["none","solid","dashed"],"header-position":["beside","above"],"timeline-position":["top","bottom","both"],"minor-grid":["true","false"]},AA=["red","blue","yellow","green","orange","purple","violet","gray","grey","navy","white","none"],kA=["business","full","custom"],IA=["merge","ignore","isolate"],RA=["bg","fg","text","border","icon","shadow","font","weight","italic","text-size","padding","spacing","header-height","corner-radius","bracket","header-position","capacity-icon","timeline-position","minor-grid","non-working"],SA=["header-height","header-position","timeline-position","minor-grid","non-working"],Ja="none",bA=["days-per-week","days-per-month","days-per-quarter","days-per-year"],NA=["name","label-every","label"],LA=["item","label","swimlane","roadmap","milestone","footnote","anchor","parallel","group"],PA=["labels","link","style","description"],CA={RoadmapDeclaration:["author","start","length","scale","calendar","logo","logo-size"],AnchorDeclaration:["date"],SwimlaneDeclaration:["owner","capacity","utilization-warn-at","utilization-over-at","status","after","before"],ItemDeclaration:["size","duration","status","owner","after","before","remaining","capacity"],ParallelBlock:["owner","after","before","status"],GroupBlock:["owner","after","before","status"],MilestoneDeclaration:["date","after"],FootnoteDeclaration:["on"],PersonDeclaration:[],TeamDeclaration:[],LabelDeclaration:[],SizeDeclaration:["effort"],StatusDeclaration:[],WaveDeclaration:["after"]},OA=["locale"];function se(e,t){return e.length*t*.58}function $A(e,t,n){if(se(e,n)<=t)return e;let r=Array.from(e.trimStart());for(let i=r.length-1;i>=1;i--){let s=`${r.slice(0,i).join("").trimEnd()}\u2026`;if(se(s,n)<=t)return s}return`${r[0]??""}\u2026`}function wi(e,t,n,r=t){if(!e)return[];let i=e.split(/\s+/).filter(a=>a.length>0);if(i.length===0)return[];let o=[],s="";for(let a of i){let l=s?`${s} ${a}`:a,c=o.length===0?r:t;s&&se(l,n)>c?(o.push(s),s=a):s=l}return s&&o.push(s),o}var UM=new Set(Ei),GM=/^\d+$/,HM=/^\d+\.\d+$/,zM=/^\d+(?:\.\d+)?%$/;function Rr(e){if(!e)return null;if(GM.test(e)){let t=parseInt(e,10);return t>0?t:null}if(HM.test(e)){let t=parseFloat(e);return Number.isFinite(t)&&t>0?t:null}if(zM.test(e)){let t=parseFloat(e.slice(0,-1))/100;return Number.isFinite(t)&&t>0?t:null}return null}function Qa(e){if(Number.isInteger(e))return String(e);let t=e.toFixed(6);return t=t.replace(/0+$/,""),t=t.replace(/\.$/,""),t}function jM(e){for(let t of e.properties)if(Q(t)==="unicode"&&t.value)return t.value}function el(e,t){if(e==="none")return null;if(UM.has(e))return{kind:"builtin",name:e};let n=t.get(e);return n?{kind:"literal",text:jM(n)??e}:{kind:"literal",text:e}}function tl(e,t,n){return t?t.kind==="builtin"&&t.name==="multiplier"?(e.length+1)*n*.58:e.length*n*.58+(.1+1)*n:e.length*n*.58}var Wf=.6,YM=.5,VM=.1;function nl(e,t,n,r){if(t?.kind!=="builtin"||t.name==="multiplier")return;let i=n*VM;if(r){let o=s=>s.length*n*YM;return[o(r),n*Wf,o(e),i]}return[se(e,n),i]}function Ti(e){return e.toISOString().slice(0,10)}var as={mode:"business",daysPerWeek:5,daysPerMonth:22,daysPerQuarter:65,daysPerYear:260},KM={mode:"full",daysPerWeek:7,daysPerMonth:30,daysPerQuarter:91,daysPerYear:365};function DA(e,t){let r=_t(e.roadmapDecl?.properties??[],"calendar")?.value??"business";if(r==="business")return{...as};if(r==="full")return{...KM};if(t){let i=(o,s)=>{let a=_t(t.properties,o),l=a?parseInt(a.value,10):NaN;return Number.isFinite(l)&&l>0?l:s};return{mode:"custom",daysPerWeek:i("days-per-week",as.daysPerWeek),daysPerMonth:i("days-per-month",as.daysPerMonth),daysPerQuarter:i("days-per-quarter",as.daysPerQuarter),daysPerYear:i("days-per-year",as.daysPerYear)}}return{...as}}var Xf=/^(\d+(?:\.\d+)?)([dwmqy])$/;function ls(e,t){let n=Xf.exec(e);if(!n)return 0;let r=parseFloat(n[1]);switch(n[2]){case"d":return r;case"w":return r*t.daysPerWeek;case"m":return r*t.daysPerMonth;case"q":return r*t.daysPerQuarter;case"y":return r*t.daysPerYear;default:return 0}}function MA(e,t,n){return e?Xf.test(e)?ls(e,n):t.get(e)?.effortDays??0:0}function FA(e,t,n){let r=re(e,"duration");if(r&&Xf.test(r))return ls(r,n);let i=re(e,"size"),o=i?t.get(i):void 0;if(!o)return 0;let s=Rr(re(e,"capacity"))??1;return o.effortDays/s}function BA(e,t,n){let r=re(e,"size"),i=r?t.get(r):void 0;if(i)return i.effortDays;let o=re(e,"duration");if(o&&Xf.test(o)){let s=Rr(re(e,"capacity"))??1;return ls(o,n)*s}return 0}function cs(e,t){let n=new Map;for(let[r,i]of e){let s=_t(i.properties,"effort")?.value;if(!s)continue;let a=ls(s,t);a<=0||n.set(r,{name:r,title:i.title||void 0,effortDays:a,effortLiteral:s})}return n}function At(e,t){return Math.round((t.getTime()-e.getTime())/864e5)}function Xe(e,t){let n=new Date(e.getTime());return n.setUTCDate(n.getUTCDate()+t),n}function $g(e){return e!=="business"?[]:[{working:!1,every:new Set([0,6]),id:"weekend",title:"Weekend"}]}function Dg(e,t=$g(e.mode)){return JM(n=>HA(n,e),t)}function Uf(e,t,n,r){if(!e.hasNonWorkingDays)return Xe(t,r);let i=Math.floor(r);return i<=Math.floor(n)?e.dateAtWorkingIndex(t,n):Xe(e.dateAtWorkingIndex(t,i-1),1)}function GA(e,t){return HA(e,t)}function HA(e,t){switch(e){case"days":return 1;case"weeks":return t.daysPerWeek;case"months":return t.daysPerMonth;case"quarters":return t.daysPerQuarter;case"years":return t.daysPerYear}}function zA(e){switch(e){case"days":return 1;case"weeks":return 7;case"months":return 30;case"quarters":return 91;case"years":return 365}}var jA=864e5,ze=7,qM=4,ZM=1e8,YA=14;function JM(e,t){let n=[];for(let g of t){let w=eF(g);w&&n.push(w)}let r=n.map(g=>g.copy),i=rF(n),o=sF(i,oF(n)),s=qA(o,KA(n)),a=lF(n,o),l=(g,w)=>cF(a,g,w),c=s[0],u=s[s.length-1];for(let g of[c,u])if(g.kind!=="mask"||g.workingPerWeek===0)throw new RangeError("working calendar: an unbounded stretch has no working weekday");let f=s.some(g=>g.kind==="non-working"||g.kind==="mask"&&g.workingPerWeek<ze),d=iF(i);if(!f)return QM(e,r,d,l);let p=new Og(s,ZA(n,!1)),m=(g,w)=>p.dateAt(g,w);return{rules:r,hasNonWorkingDays:!0,weekStart:uF(i),workingWeekdays:d,daysPerUnit:e,addUnits:(g,w,x)=>m(g,w*e(x)),isWorkingDay:g=>p.isWorkingDay(g),workingIndexOf:(g,w)=>p.indexOf(g,w),dateAtWorkingIndex:m,nonWorkingRuns:(g,w)=>p.runs(g,w),workingExceptionRuns:l}}function QM(e,t,n,r){return{rules:t,hasNonWorkingDays:!1,weekStart:void 0,workingWeekdays:n,daysPerUnit:e,addUnits:(i,o,s)=>Xe(i,o*e(s)),isWorkingDay:()=>!0,workingIndexOf:(i,o)=>At(i,o),dateAtWorkingIndex:(i,o)=>Xe(i,o),nonWorkingRuns:()=>[],workingExceptionRuns:r}}function eF(e){let t=e.every===void 0?void 0:nF(e.every),n=e.start!==void 0||e.end!==void 0;if(t===0||e.dates!==void 0&&(t!==void 0||n)||t===void 0&&e.dates===void 0&&(e.start===void 0||e.end===void 0))return;let i=e.start===void 0?-1/0:Nt(e.start),o=e.end===void 0?1/0:Nt(e.end);if(Number.isNaN(i)||Number.isNaN(o)||o<i)return;let s=e.dates?.map(Nt);if(s?.some(Number.isNaN))return;let a=s?s.map(l=>({start:l,end:l+1})):[{start:i,end:o+1}];return{copy:tF(e),working:e.working,mask:t,spans:a}}function tF(e){let t={working:e.working};return e.every!==void 0&&(t.every=new Set(e.every)),e.dates!==void 0&&(t.dates=e.dates.map(n=>new Date(n.getTime()))),e.start!==void 0&&(t.start=new Date(e.start.getTime())),e.end!==void 0&&(t.end=new Date(e.end.getTime())),e.id!==void 0&&(t.id=e.id),e.title!==void 0&&(t.title=e.title),t}function nF(e){let t=0;for(let n of e){if(!Number.isInteger(n)||n<0||n>=ze)throw new RangeError(`working calendar: weekday ${n} is outside 0..6`);t|=1<<n}return t}function rF(e){let t=0,n=0;for(let r of e)r.mask===void 0||!VA(r.spans[0])||(r.working?n|=r.mask:t|=r.mask);return t&~n}function iF(e){let t=new Set;for(let n=0;n<ze;n++)(e&1<<n)===0&&t.add(n);return t}function VA(e){return e.start===-1/0&&e.end===1/0}function oF(e){let t=[];for(let n of e)n.mask===void 0||VA(n.spans[0])||t.push({...n.spans[0],working:n.working,mask:n.mask});return t}function sF(e,t){let n=new Array(ze).fill(0),r=new Array(ze).fill(0),i=(u,f)=>{let d=u.working?r:n;for(let p=0;p<ze;p++)u.mask&1<<p&&(d[p]+=f)},o=()=>{let u=e;for(let f=0;f<ze;f++)n[f]>0&&(u|=1<<f),r[f]>0&&(u&=~(1<<f));return u},s=[];for(let u of t)u.start===-1/0?i(u,1):s.push({at:u.start,span:u,delta:1}),u.end!==1/0&&s.push({at:u.end,span:u,delta:-1});s.sort((u,f)=>u.at-f.at);let a=[],l=-1/0,c=0;for(;;){let u=c<s.length?s[c].at:1/0;if(l<u&&aF(a,{start:l,end:u,mask:o()}),u===1/0)return a;for(;c<s.length&&s[c].at===u;)i(s[c].span,s[c].delta),c++;l=u}}function aF(e,t){let n=e[e.length-1];n&&n.mask===t.mask?n.end=t.end:e.push(t)}function KA(e){let t=[];for(let s of e)if(s.mask===void 0)for(let a of s.spans)t.push({at:a.start,working:s.working,delta:1}),t.push({at:a.end,working:s.working,delta:-1});t.sort((s,a)=>s.at-a.at);let n=[],r=0,i=0,o=0;for(;o<t.length;){let s=t[o].at;for(;o<t.length&&t[o].at===s;)t[o].working?r+=t[o].delta:i+=t[o].delta,o++;if(o===t.length||r===0&&i===0)continue;let a=r>0?"working":"non-working",l=t[o].at,c=n[n.length-1];c&&c.kind===a&&c.end===s?c.end=l:n.push({start:s,end:l,kind:a})}return n}function qA(e,t){let n=[],r=0;for(let i of e){for(;r<t.length&&t[r].end<=i.start;)r++;let o=i.start;for(let s=r;s<t.length&&t[s].start<i.end;s++){let a=Math.max(t[s].start,i.start),l=Math.min(t[s].end,i.end);o<a&&n.push(WA(o,a,i.mask)),n.push({start:a,end:l,kind:t[s].kind}),o=l}o<i.end&&n.push(WA(o,i.end,i.mask))}return n}function WA(e,t,n){let r=[];for(let o=0;o<ze;o++)r.push((n&1<<o)!==0);let i=r.filter(o=>!o).length;return{start:e,end:t,kind:"mask",off:r,workingPerWeek:i}}function ZA(e,t){let n=[];for(let[r,i]of e.entries()){let o=i.copy.title;if(i.mask!==void 0||i.working!==t||o===void 0||i.spans.length===0)continue;let s=i.spans.reduce((a,l)=>Math.min(a,l.start),1/0);n.push({title:o,spans:i.spans,first:s,order:r})}return n.sort((r,i)=>r.first-i.first||r.order-i.order),n.map(({title:r,spans:i})=>({title:r,spans:i}))}function lF(e,t){let n=ZA(e,!0);if(n.length===0)return[];let r=e.filter(l=>!l.working),i=qA(t,KA(r)),o=new Map;n.forEach((l,c)=>{for(let u of l.spans)for(let f=u.start;f<u.end;f++){if(!ek(i,f))continue;let d=o.get(f)??new Set;d.add(c),o.set(f,d)}});let s=[...o.keys()].sort((l,c)=>l-c),a=[];for(let l=0;l<s.length;){let c=l,u=new Set;for(;c<s.length&&s[c]-s[l]===c-l;){for(let f of o.get(s[c])??[])u.add(f);c++}a.push({from:rl(s[l]),through:rl(s[c-1]),titles:[...u].sort((f,d)=>f-d).map(f=>n[f].title)}),l=c}return a}function cF(e,t,n){let r=Nt(t),i=Nt(n);return Number.isNaN(r)||Number.isNaN(i)?[]:e.filter(o=>Nt(o.from)<i&&Nt(o.through)>=r).map(o=>({from:new Date(o.from.getTime()),through:new Date(o.through.getTime()),titles:[...o.titles]}))}function uF(e){let t=i=>(e&1<<i)!==0,n,r=0;for(let i=0;i<ze;i++){if(t(i)||!t((i+6)%ze))continue;let o=0;for(;o<ze&&t((i+6-o)%ze);)o++;o>r&&(n=i,r=o)}return n}function Nt(e){return Math.round(e.getTime()/jA)}function rl(e){return new Date(e*jA)}function il(e){return((e+qM)%ze+ze)%ze}function JA(){return new Error("working calendar: remainder scan exceeded its cap (internal error)")}function QA(e,t){let n=0,r=e.length-1;for(;n<r;){let i=n+r>>1;t>=e[i].end?n=i+1:r=i}return n}function ek(e,t){let n=e[QA(e,t)];return n.kind==="mask"?n.off[il(t)]:n.kind==="non-working"}function Cg(e,t,n){if(e.kind!=="mask")return e.kind==="working"?n-t:0;let r=Math.floor((n-t)/ze),i=r*e.workingPerWeek;for(let o=t+r*ze;o<n;o++)e.off[il(o)]||i++;return i}function XA(e,t,n){if(e.kind!=="mask")return t+n;let r=t+Math.floor(n/e.workingPerWeek)*ze,i=n%e.workingPerWeek;for(let o=0;o<YA;o++,r++)if(!e.off[il(r)]){if(i===0)return r;i--}throw JA()}function UA(e,t,n){if(e.kind!=="mask")return t-n;let r=Math.floor((n-1)/e.workingPerWeek),i=t-r*ze,o=n-r*e.workingPerWeek;for(let s=0;s<YA;s++)if(i--,!e.off[il(i)]&&(o--,o===0))return i;throw JA()}var Og=class{constructor(t,n){M(this,"pieces");M(this,"titled");this.pieces=t,this.titled=n}isWorkingDay(t){let n=Nt(t);return Number.isNaN(n)||!this.isNonWorking(n)}indexOf(t,n){let r=Nt(t),i=Nt(n);if(Number.isNaN(r)||Number.isNaN(i))return Number.NaN;let o=this.nthFrom(i,0);return o>=r?this.count(r,o):-this.count(o,r)}dateAt(t,n){let r=Nt(t),i=Math.floor(n);return Number.isNaN(r)||!Number.isFinite(i)||Math.abs(i)>ZM?new Date(Number.NaN):rl(i>=0?this.nthFrom(r,i):this.nthBefore(r,-i))}runs(t,n){let r=Nt(t),i=Nt(n);if(Number.isNaN(r)||Number.isNaN(i)||r>=i)return[];let o=[],s=this.isNonWorking(r)?this.nthBefore(r,1)+1:this.nextNonWorking(r,i);for(;s<i;){let a=this.nthFrom(s,0)-1;o.push({from:rl(s),through:rl(a),titles:this.titlesIn(s,a)}),s=this.nextNonWorking(a+1,i)}return o}pieceAt(t){return QA(this.pieces,t)}isNonWorking(t){return ek(this.pieces,t)}count(t,n){let r=0;for(let i=this.pieceAt(t);i<this.pieces.length&&this.pieces[i].start<n;i++){let o=this.pieces[i];r+=Cg(o,Math.max(t,o.start),Math.min(n,o.end))}return r}nthFrom(t,n){let r=t,i=n;for(let o=this.pieceAt(t);o<this.pieces.length;o++){let s=this.pieces[o];if(s.end===1/0)return XA(s,r,i);let a=Cg(s,r,s.end);if(i<a)return XA(s,r,i);i-=a,r=s.end}throw new Error("working calendar: forward walk left the last piece (internal error)")}nthBefore(t,n){let r=t,i=n;for(let o=this.pieceAt(t-1);o>=0;o--){let s=this.pieces[o];if(s.start===-1/0)return UA(s,r,i);let a=Cg(s,s.start,r);if(i<=a)return UA(s,r,i);i-=a,r=s.start}throw new Error("working calendar: backward walk left the first piece (internal error)")}nextNonWorking(t,n){for(let r=this.pieceAt(t);r<this.pieces.length&&this.pieces[r].start<n;r++){let i=this.pieces[r],o=Math.max(t,i.start);if(i.kind==="non-working")return o;if(!(i.kind!=="mask"||i.workingPerWeek===ze)){for(let s=0;s<ze&&o+s<i.end;s++)if(i.off[il(o+s)])return o+s}}return n}titlesIn(t,n){let r=[];for(let i of this.titled)i.spans.some(o=>o.start<=n&&o.end>t)&&r.push(i.title);return r}};function Gf(e,t){let n=DA(e,t.config.calendar),r=fF(n,t.config.calendarDeclarations);try{return{config:n,working:Dg(n,r)}}catch(i){if(!(i instanceof RangeError))throw i;return{config:n,working:Dg(n)}}}function fF(e,t){let n=Mf(t)?[]:$g(e.mode);for(let r of t){let i=dF(r);i&&n.push(i)}return n.sort(pF)}function dF(e){let t=qa(e);if(!t.wellFormed)return;let n={working:e.$type==="WorkingDeclaration"};return e.name&&(n.id=e.name),e.title!==void 0&&(n.title=e.title),t.dates&&(n.dates=t.dates.map(Mg)),t.start&&(n.start=Mg(t.start)),t.end&&(n.end=Mg(t.end)),t.weekdays&&(n.every=new Set(t.weekdays)),n}function Mg(e){return _e(e)}function pF(e,t){return us(tk(e),tk(t))||us(e.title,t.title)||us(e.id,t.id)||Number(e.working)-Number(t.working)||us(nk(e),nk(t))||us(e.start?.getTime(),t.start?.getTime())||us(e.end?.getTime(),t.end?.getTime())||hF(e.dates??[],t.dates??[])}function tk(e){return e.dates?Math.min(...e.dates.map(t=>t.getTime())):e.start?.getTime()}function nk(e){if(!e.every)return;let t=0;for(let n of e.every)t|=1<<n;return t}function us(e,t){return e===t?0:e===void 0?-1:t===void 0?1:e<t?-1:1}function hF(e,t){let n=e.map(i=>i.getTime()).sort((i,o)=>i-o),r=t.map(i=>i.getTime()).sort((i,o)=>i-o);for(let i=0;i<Math.min(n.length,r.length);i++)if(n[i]!==r[i])return n[i]-r[i];return n.length-r.length}function rk(e){let{naturalPixelsPerDay:t,dayCount:n,chromeWidth:r,maxWidth:i}=e;if(i===void 0||r+n*t<=i)return t;let o=(i-r)/n,s=Math.min(t,1);return Math.max(s,o)}var $n=12,Mn=6,Hf=20,vi=38,Nr=13,ol=11,sl=16,Fg=2;function zf(e){return vi+(Math.max(1,e)-1)*sl}function jf(e,t){return t?zf(e):Hf+(Math.max(1,e)-1)*sl}function Bg(e,t){return Math.max(0,jf(e,t)-vi)}var _i=12,Wg=12,Sr=5,fs=22,Xg=14,al=10,Mt=8,Lr=14,Ai=6,ik=4;function ds(e,t){let n=$n;if(e){let r=Ai+Lr+ik-$n;n=$n+Math.max(0,r)}if(t&&!Hg(t.barWidth)){let r=zg(0,e)+Dn;n=Math.max(n,r+hn)}return n}var hn=4,Pr=2*_i,Ug=Ai+Lr+hn+_i+Sr,ps=fs+1;function Yf(e){let t=e.barRightX+Mn,n=!1,r=null;e.iconSpills&&(r=t,t=r+Lr,n=!0);let i=null;e.captionWidth!==null&&(n&&(t+=hn),i=t,t+=e.captionWidth,n=!0);let o=null;e.footnoteCount>0&&(n&&(t+=hn),o=t,t+=e.footnoteCount*Mt,n=!0);let s=null;return e.dotSpills&&(n&&(t+=hn),s=t+Sr,t=s+Sr),{iconSpillX:r,captionX:i,footnoteSpillStartX:o,dotSpillCx:s,rightX:t}}var Dn=12,ok=6,Gg=6,sk=5,br=hn,ak=ok+Dn+br+Dn+Gg;function Hg(e){return e<ak}function zg(e,t){return t?e+Ai+Lr+br:e+ok}function jg(e,t){let n;return t>0?n=e-fs-(t-1)*Mt-br:n=e-_i-Sr-br,n-Dn}function ll(e){let{barWidth:t,footnoteLabels:n,hasBeforeGlyph:r}=e,i=Number.POSITIVE_INFINITY;t>=Pr&&(i=Math.min(i,-(_i+Sr)));let o=n.length;if(o>0&&t>=ps)for(let a=0;a<o;a+=1){let c=-fs-(o-1-a)*Mt-se(n[a],al);i=Math.min(i,c)}return r&&t>=ak&&(i=Math.min(i,jg(0,o))),Math.max($n,-i+hn)}var Cr=13,Fn=3,Bn=4,mF=4,Vf=Cr+mF,gF=.25;function lk(e,t){if(e.length===0)return{rows:[[]],expanded:!1};let n=[[]],r=0,i=t,o=!1;for(let s of e){let a=n[n.length-1],l=(a.length===0?0:Bn)+s.width,c=r+l;if(c<=i){a.push(s),r=c;continue}if(a.length===0){a.push(s),r=s.width;continue}let u=c-i,f=s.width*gF;if(!o&&u<=f){a.push(s),r=c,i=c,o=!0;continue}n.push([s]),r=s.width,i=t}return{rows:n,expanded:o}}var ck={none:0,xs:2,sm:4,md:8,lg:16,xl:24},uk={none:0,xs:4,sm:8,md:12,lg:20,xl:32},ki={none:0,xs:10,sm:12,md:14,lg:18,xl:24},Ii={none:0,xs:2,sm:4,md:8,lg:12,xl:20,full:9999},Yg={xs:18,sm:24,md:36,lg:48,xl:72},Vg=1,Jt=4,cl={none:0,xs:16,sm:20,md:24,lg:32,xl:40},fk=cl.md;function ul(e){return Math.round(e/2+3)}var yF=ul(fk),Ri=10,fl=22,dl=15,pl="6 4",Kg=36,Ft=16,qg=Ft/2,hl=10,Zg=Ft-4,hs=6,Kf=2.25,dk=1,st=12,pk=32,hk=120,Jg=240,Qg=72,qf=28,Bt=16,ey=22,ms=18,Zf="Powered by",ty="https://nowline.io",ml=.22,Or=40,Jf=32,mk=.58,xF=Zf.length*Jf*mk,EF=10,gl=xF+EF,ny=gl+74,ry=5,Qf=gl+81,wF=3*Or*mk,TF=Qf+wF,vF=12+Or,iy=TF*ml,gk=vF*ml,ed=4;var oy={sans:'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',serif:'Georgia, "Times New Roman", serif',mono:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"},yk={days:7,weeks:4,months:3,quarters:4,years:5},sy=.1,ay=20,td=2,ly="2 2",cy=.13,uy=6,fy=2,dy=.12,yl=.25,mn=10,py=7,xl=14,nd=8,$r=6,Dr=2,Si=3,bi=.5,hy=9,rd=18,id=10,my=6,od=16,sd=11;var xk=18,El=13,ad=ki.xs,gy=10,Ek=6,wk=6,yy=.12,xy=.06,Ey=2;function ld(e){return e.drawn?{header:e.hasTitle||e.hasPins||e.hasBracket?xk:0,pad:Ek}:{header:0,pad:0}}function gs(e,t){return t?e+Dn+br:e}function wy(e){return e.length*ad*.58}function ys(e){if(e.kind==="item")return Number.NEGATIVE_INFINITY;let t=Number.NEGATIVE_INFINITY,n=e.inlineDatePins??[];for(let r of n)t=Math.max(t,r.glyphTopLeft.x+r.glyphSize);if(e.title&&e.headerHeight>0){let r=n.some(i=>i.side==="after");t=Math.max(t,gs(e.box.x,r)+wy(e.title))}return t}function _F(e,t){return e.endX-Math.min(t/2,(e.endX-e.startX)/2)}function AF(e,t){return e.startX+Math.min(t/2,(e.endX-e.startX)/2)}function xs(e){return e<3?{headWidth:3,head:"dot"}:{headWidth:Math.min(7,e),head:"arrow"}}var Ty=(e,t,n)=>e>=t-.01&&e<=n+.01;function kF(e,t){return t.rowY===void 0||!Ty(t.rowY,e.top,e.bottom)?!1:e.rowY===void 0||Ty(e.rowY,t.top,t.bottom)}function IF(e,t,n,r,i){let o=[];for(let l of e){if(l.x>=n+1||l.x+l.width<=t-1)continue;let c=l.y-1,u=l.y+l.height+1;u<=r||c>=i||o.push([Math.max(r,c),Math.min(i,u)])}o.sort((l,c)=>l[0]-c[0]);let s=[],a=r;for(let[l,c]of o)l-a>=2&&s.push([a,l]),a=Math.max(a,c);return i-a>=2&&s.push([a,i]),s}function Tk(e,t,n,r){let i=Math.min(n,r),o=Math.max(n,r),s=0;for(let a of e)Math.abs(a.x-t)>1||a.bottom<=i||a.top>=o||s++;return s}function vk(e,t,n,r){let i=Math.min(n,r),o=Math.max(n,r),s=0;for(let a of e)a.height<=0||t<=a.x||t>=a.x+a.width||a.y+a.height<=i||a.y>=o||s++;return s}function RF(e,t,n,r){let i=Math.min(e.x,t.x),o=Math.max(e.x,t.x),s=Math.min(e.y,t.y),a=Math.max(e.y,t.y),l=null;for(let f of IF(r.blocks,i,o,s,a)){let d=(f[0]+f[1])/2,p=[Tk(r.edges,e.x,e.y,d)+Tk(r.edges,t.x,d,t.y),vk(r.blocks,e.x,e.y,d)+vk(r.blocks,t.x,d,t.y),Math.abs(d-e.y)];(!l||SF(p,l.key))&&(l={gap:f,centre:d,key:p})}if(l)return{gap:l.gap,centre:l.centre};let c=Math.min(4,(a-s)/2),u=e.y+n*c;return{gap:[s,a],centre:u}}function SF(e,t){for(let n=0;n<e.length;n++)if(e[n]!==t[n])return e[n]<t[n];return!1}function bF(e,t){let n=[0];for(let r=1;r*2.5<=t+.01;r++)n.push(-e*r*2.5,e*r*2.5);return n}function NF(e){let t=[],n=new Map,r=[...e].sort((i,o)=>i.centre-o.centre||i.xLo-o.xLo||i.index-o.index);for(let i of r){let[o,s]=i.gap,a=t.find(c=>c.bundle===i.bundle&&c.y>=o-.01&&c.y<=s+.01),l=i.centre;if(a)l=a.y;else{let c=bF(i.dir,(s-o)/2),u=Number.POSITIVE_INFINITY;for(let f of c){let d=i.centre+f,p=t.filter(m=>m.bundle!==i.bundle&&Math.abs(m.y-d)<2.5-.01&&m.xLo<i.xHi+1&&m.xHi>i.xLo-1).length;if(p<u&&(u=p,l=d),p===0)break}}t.push({y:l,xLo:i.xLo,xHi:i.xHi,bundle:i.bundle}),n.set(i.index,l)}return n}function _k(e,t,n){let r=new Array(e.length).fill(null),i=[];e.forEach((s,a)=>{let{source:l,target:c}=s,u=c.startX-l.endX>.01;if(kF(l,c)&&c.startX>=l.endX-.01){if(!u)return;let y=l.exitY!==void 0&&Ty(l.exitY,c.top,c.bottom)?l.exitY:c.rowY??0;r[a]={fromId:s.fromId,toId:s.toId,waypoints:[{x:l.endX,y},{x:c.paintedX,y}],slack:!0,...xs(c.bottom-c.top)};return}let f=_F(l,n),d=AF(c,n),p,m,g;if(c.top>=l.bottom-.01)g=1,p={x:f,y:l.bottom},m={x:d,y:c.top};else if(c.bottom<=l.top+.01)g=-1,p={x:f,y:l.top},m={x:d,y:c.bottom};else{let y=Math.max(l.bottom,c.bottom)+4;r[a]={fromId:s.fromId,toId:s.toId,waypoints:[{x:f,y:l.bottom},{x:f,y},{x:d,y},{x:d,y:c.bottom}],slack:u,...xs(c.paintedWidth)};return}if(Math.abs(f-d)<.01){r[a]={fromId:s.fromId,toId:s.toId,waypoints:[p,m],slack:u,...xs(c.paintedWidth)};return}let{gap:w,centre:x}=RF(p,m,g,t);i.push({index:a,req:s,from:p,to:m,dir:g,gap:w,centre:x,xLo:Math.min(f,d),xHi:Math.max(f,d),bundle:`${Math.round(d*100)}:${g}`})});let o=NF(i);for(let s of i){let a=o.get(s.index)??s.centre,l=s.req.target.startX-s.req.source.endX>.01;r[s.index]={fromId:s.req.fromId,toId:s.req.toId,waypoints:[s.from,{x:s.from.x,y:a},{x:s.to.x,y:a},s.to],slack:l,...xs(s.req.target.paintedWidth)}}return r}function wl(e,t,n,r=0,i=0){let o=e+10,s=o+12,a=t.length*6.5,l=s+a,c=0,u=0;n&&(c=`owner: ${n}`.length*5,u=l+6,l=u+c);let f=0;r>0&&(f=l+6,l=f+r);let d=0;i>0&&(d=l+6+i,l=d);let p=l-o+12,m=Math.max(56,p);return{titleTextWidth:a,ownerTextWidth:c,capacityBadgeWidth:r,footnoteIndicatorWidth:i,titleX:s,ownerX:u,badgeX:f,footnoteRightX:d,tabX:o,tabW:m,rightX:o+m}}function cd(e){let t=re(e.roadmapDecl?.properties??[],"logo");return t||void 0}function PF(e){let t=re(e.roadmapDecl?.properties??[],"logo-size");return t!==void 0&&t in Yg?t:"md"}function Ak(e,t){let n=e.width/e.height,r=Yg[t],i=r*n;return i>160&&(i=160,r=i/n),{width:i,height:r}}function kk(e,t){let n=cd(e);if(!(!n||!t)&&t.width>0&&t.height>0&&!(!Number.isFinite(t.width)||!Number.isFinite(t.height)))return{...Ak(t,PF(e)),assetRef:n,intrinsic:t}}function Tl(e,t,n){let r=e+24,i=r+10,o=t.length*6,s=Math.max(60,o+10+10),a=r+s+6,l=a+18,c=0,u=0,f=0,d=0,p=l;return n&&(u=l+6,c=n.length*5.5,f=u-3,d=c+6,p=f+d),{labelTextWidth:o,sourceTextWidth:c,tabX:r,tabWidth:s,tabLabelX:i,badgeX:a,badgeSize:18,sourceHaloX:f,sourceHaloWidth:d,sourceTextX:u,chromeRightX:p}}var Ik="lexing-error",Rk="parsing-error";function Sk(e){if(!e||typeof e!="object")return!1;let t=e.code;return t===Ik||t===Rk}function Ni(e){let t=[];for(let n of e.parseResult.lexerErrors)t.push({origin:"lexer",error:n});for(let n of e.parseResult.parserErrors)t.push({origin:"parser",error:n});for(let n of e.diagnostics??[]){let r=n;Sk(r.data)||t.push({origin:"validation",diagnostic:r})}return t}var CF=/did you mean ['"]?([^'"?]+)['"]?\??/i;function ud(e){let t=e.match(CF);return t?t[1].trim():void 0}function fd(e){let t=e.toLowerCase();return t.includes("duplicate identifier")?"duplicate-identifier":t.includes("unknown reference")||t.includes("did you mean")?"unknown-reference":t.includes("circular")?"circular-dependency":t.includes("requires")&&t.includes("date:")?"missing-date":t.includes("duration")?"duration":t.includes("include")?"include":t.includes("indent")?"indentation":"validation"}function bk(e){if(!e||typeof e!="object")return;let t=e;if(typeof t.code=="string"&&Array.isArray(t.args))return t.code}function vy(e){let t=bk(e.data);return t||(typeof e.code=="string"&&e.code!==""?e.code:typeof e.code=="number"?String(e.code):fd(e.message))}var Nk,Lk=()=>Nk??(Nk=uA(`{
|
|
128
|
+
`}var Ef=class{constructor(t){this.indexManager=t.shared.workspace.IndexManager,this.commentProvider=t.documentation.CommentProvider}getDocumentation(t){let n=this.commentProvider.getComment(t);if(n&&Q0(n))return J0(n).toMarkdown({renderLink:(i,o)=>this.documentationLinkRenderer(t,i,o),renderTag:i=>this.documentationTagRenderer(t,i)})}documentationLinkRenderer(t,n,r){let i=this.findNameInLocalSymbols(t,n)??this.findNameInGlobalScope(t,n);if(i&&i.nameSegment){let o=i.nameSegment.range.start.line+1,s=i.nameSegment.range.start.character+1,a=i.documentUri.with({fragment:`L${o},${s}`});return`[${r}](${a.toString()})`}else return}documentationTagRenderer(t,n){}findNameInLocalSymbols(t,n){let i=at(t).localSymbols;if(!i)return;let o=t;do{let a=i.getStream(o).find(l=>l.name===n);if(a)return a;o=o.$container}while(o)}findNameInGlobalScope(t,n){return this.indexManager.allElements().find(i=>i.name===n)}};var wf=class{constructor(t){this.grammarConfig=()=>t.parser.GrammarConfig}getComment(t){return Hv(t)?t.$comment:UE(t.$cstNode,this.grammarConfig().multilineCommentRules)?.text}};var Tf=class{constructor(t){this.syncParser=t.parser.LangiumParser}parse(t,n){return Promise.resolve(this.syncParser.parse(t))}};var _f;(function(e){e[e.Normal=0]="Normal",e[e.Immediate=1]="Immediate"})(_f||(_f={}));var vf=class{constructor(){this.previousTokenSource=new ce.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.immediateReads=[],this.done=!0}write(t){this.cancelWrite();let n=Fv();return this.previousTokenSource=n,this.enqueue(this.writeQueue,t,n.token)}read(t,n=_f.Normal){if(n===_f.Immediate){let r=Promise.resolve().then(()=>t());this.immediateReads.push(r);let i=()=>{this.immediateReads.splice(this.immediateReads.indexOf(r),1)};return r.then(i,i),r}return this.enqueue(this.readQueue,t)}enqueue(t,n,r=ce.CancellationToken.None){let i=new Ar,o={action:n,deferred:i,cancellationToken:r};return t.push(o),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;let t=[];if(this.writeQueue.length>0)for(t.push(this.writeQueue.shift()),this.done=!1;this.immediateReads.length>0;)await Promise.allSettled(this.immediateReads.slice());else if(this.readQueue.length>0)t.push(...this.readQueue.splice(0,this.readQueue.length)),this.done=!1;else return;await Promise.all(t.map(async({action:n,deferred:r,cancellationToken:i})=>{try{let o=await Promise.resolve().then(()=>n(i));r.resolve(o)}catch(o){kr(o)?r.resolve(void 0):r.reject(o)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}};var Af=class{constructor(t){this.grammarElementIdMap=new Pa,this.tokenTypeIdMap=new Pa,this.cstNodeBuilder=new Po,this.grammar=t.Grammar,this.lexer=t.parser.Lexer,this.linker=t.references.Linker}dehydrate(t){return{lexerErrors:t.lexerErrors,lexerReport:t.lexerReport?this.dehydrateLexerReport(t.lexerReport):void 0,parserErrors:t.parserErrors.map(n=>({...n,message:n.message})),value:this.dehydrateAstNode(t.value,this.createDehyrationContext(t.value))}}dehydrateLexerReport(t){return t}createDehyrationContext(t){let n=new Map,r=new Map;for(let i of yt(t))n.set(i,{});if(t.$cstNode)for(let i of Ks(t.$cstNode))r.set(i,{});return{astNodes:n,cstNodes:r}}dehydrateAstNode(t,n){let r=n.astNodes.get(t);r.$type=t.$type,r.$containerIndex=t.$containerIndex,r.$containerProperty=t.$containerProperty,t.$cstNode!==void 0&&(r.$cstNode=this.dehydrateCstNode(t.$cstNode,n));for(let[i,o]of Object.entries(t))if(!i.startsWith("$"))if(Array.isArray(o)){let s=[];r[i]=s;for(let a of o)Ue(a)?s.push(this.dehydrateAstNode(a,n)):it(a)?s.push(this.dehydrateReference(a,n)):s.push(a)}else Ue(o)?r[i]=this.dehydrateAstNode(o,n):it(o)?r[i]=this.dehydrateReference(o,n):o!==void 0&&(r[i]=o);return r}dehydrateReference(t,n){let r={};return r.$refText=t.$refText,t.$refNode&&(r.$refNode=n.cstNodes.get(t.$refNode)),r}dehydrateCstNode(t,n){let r=n.cstNodes.get(t);if(Kl(t)?r.fullText=t.fullText:r.grammarSource=this.getGrammarElementId(t.grammarSource),r.hidden=t.hidden,Qn(t))r.content=t.content.map(i=>this.dehydrateCstNode(i,n));else if(Vl(t)){r.tokenType=t.tokenType.name,r.offset=t.offset,r.length=t.length;let{start:i,end:o}=t.range;r.startLine=i.line,r.startColumn=i.character,r.endLine=o.line,r.endColumn=o.character}return r}hydrate(t){let n=t.value,r=this.createHydrationContext(n);return"$cstNode"in n&&this.hydrateCstNode(n.$cstNode,r),{lexerErrors:t.lexerErrors,lexerReport:t.lexerReport,parserErrors:t.parserErrors,value:this.hydrateAstNode(n,r)}}createHydrationContext(t){let n=new Map,r=new Map;for(let i of yt(t))n.set(i,{});if(t.$cstNode)for(let i of Ks(t.$cstNode)){let o;"fullText"in i?o=new ba(i.fullText):"content"in i?o=new Co:"tokenType"in i&&(o=this.hydrateCstLeafNode(i)),o&&r.set(i,o)}return{astNodes:n,cstNodes:r,linkedCstNodes:new Set}}hydrateAstNode(t,n){let r=n.astNodes.get(t);if(r.$type=t.$type,r.$containerIndex=t.$containerIndex,r.$containerProperty=t.$containerProperty,t.$cstNode){let i=n.cstNodes.get(t.$cstNode);r.$cstNode=i,i&&!n.linkedCstNodes.has(i)&&(n.linkedCstNodes.add(i),i.astNode=r)}for(let[i,o]of Object.entries(t))if(!i.startsWith("$"))if(Array.isArray(o)){let s=[];r[i]=s;for(let a of o)Ue(a)?s.push(this.setParent(this.hydrateAstNode(a,n),r)):it(a)?s.push(this.hydrateReference(a,r,i,n)):s.push(a)}else Ue(o)?r[i]=this.setParent(this.hydrateAstNode(o,n),r):it(o)?r[i]=this.hydrateReference(o,r,i,n):o!==void 0&&(r[i]=o);return r}setParent(t,n){return t.$container=n,t}hydrateReference(t,n,r,i){return this.linker.buildReference(n,r,i.cstNodes.get(t.$refNode),t.$refText)}hydrateCstNode(t,n,r=0){let i=n.cstNodes.get(t);if(typeof t.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(t.grammarSource)),Qn(i)){let o=[];for(let s of t.content)o.push(this.hydrateCstNode(s,n,r++));this.cstNodeBuilder.appendChildren(i,o)}return i}hydrateCstLeafNode(t){let n=this.getTokenType(t.tokenType);return new Sa(t.offset,t.length,t.startLine,t.startColumn,t.endLine,t.endColumn,n,t.hidden)}getTokenType(t){return this.lexer.definition[t]}getGrammarElementId(t){if(t)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(t)}getGrammarElement(t){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(t)}createGrammarElementIdMap(){let t=0;for(let n of yt(this.grammar))fc(n)&&this.grammarElementIdMap.set(n,t++)}};function kf(e){return{documentation:{CommentProvider:t=>new wf(t),DocumentationProvider:t=>new Ef(t)},parser:{AsyncParser:t=>new Tf(t),GrammarConfig:t=>QE(t),LangiumParser:t=>Lv(t),CompletionParser:t=>Nv(t),ValueConverter:()=>new $o,TokenBuilder:()=>new Oo,Lexer:t=>new Wo(t),ParserErrorMessageProvider:()=>new Na,LexerErrorMessageProvider:()=>new uf},workspace:{AstNodeLocator:()=>new of,AstNodeDescriptionProvider:t=>new nf(t),ReferenceDescriptionProvider:t=>new rf(t)},references:{Linker:t=>new Gu(t),NameProvider:()=>new Hu,ScopeProvider:t=>new Zu(t),ScopeComputation:t=>new ju(t),References:t=>new zu(t)},serializer:{Hydrator:t=>new Af(t),JsonSerializer:t=>new Ju(t)},validation:{DocumentValidator:t=>new tf(t),ValidationRegistry:t=>new ef(t)},shared:()=>e.shared}}function If(e){return{ServiceRegistry:t=>new Qu(t),workspace:{LangiumDocuments:t=>new Uu(t),LangiumDocumentFactory:t=>new Xu(t),DocumentBuilder:t=>new af(t),IndexManager:t=>new lf(t),WorkspaceManager:t=>new cf(t),FileSystemProvider:t=>e.fileSystemProvider(t),WorkspaceLock:()=>new vf,ConfigurationProvider:t=>new sf(t)},profilers:{}}}var iA;(function(e){e.merge=(t,n)=>Da(Da({},t),n)})(iA||(iA={}));function Go(e,t,n,r,i,o,s,a,l){let c=[e,t,n,r,i,o,s,a,l].reduce(Da,{});return aA(c)}var MM=Symbol("isProxy");function aA(e,t){let n=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error("Cannot set property on injected service container")},get:(r,i)=>i===MM?!0:sA(r,i,e,t||n),getOwnPropertyDescriptor:(r,i)=>(sA(r,i,e,t||n),Object.getOwnPropertyDescriptor(r,i)),has:(r,i)=>i in e,ownKeys:()=>[...Object.getOwnPropertyNames(e)]});return n}var oA=Symbol();function sA(e,t,n,r){if(t in e){if(e[t]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable. Cause: "+e[t]);if(e[t]===oA)throw new Error('Cycle detected. Please make "'+String(t)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return e[t]}else if(t in n){let i=n[t];e[t]=oA;try{e[t]=typeof i=="function"?i(r):aA(i,r)}catch(o){throw e[t]=o instanceof Error?o:void 0,o}return e[t]}else return}function Da(e,t){if(t){for(let[n,r]of Object.entries(t))if(!(n==="__proto__"||n==="constructor"||n==="prototype")&&r!=null)if(typeof r=="object"){let i=e[n];typeof i=="object"&&i!==null?e[n]=Da(i,r):e[n]=Da({},r)}else e[n]=r}return e}var lA={indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[]},Ho;(function(e){e.REGULAR="indentation-sensitive",e.IGNORE_INDENTATION="ignore-indentation"})(Ho||(Ho={}));var Ma=class extends Oo{constructor(t=lA){super(),this.indentationStack=[0],this.whitespaceRegExp=/[ \t]+/y,this.options={...lA,...t},this.indentTokenType=sr({name:this.options.indentTokenName,pattern:this.indentMatcher.bind(this),line_breaks:!1}),this.dedentTokenType=sr({name:this.options.dedentTokenName,pattern:this.dedentMatcher.bind(this),line_breaks:!1})}buildTokens(t,n){let r=super.buildTokens(t,n);if(!Zm(r))throw new Error("Invalid tokens built by default builder");let{indentTokenName:i,dedentTokenName:o,whitespaceTokenName:s,ignoreIndentationDelimiters:a}=this.options,l,c,u,f=[];for(let d of r){for(let[p,m]of a)d.name===p?d.PUSH_MODE=Ho.IGNORE_INDENTATION:d.name===m&&(d.POP_MODE=!0);d.name===o?l=d:d.name===i?c=d:d.name===s?u=d:f.push(d)}if(!l||!c||!u)throw new Error("Some indentation/whitespace tokens not found!");return a.length>0?{modes:{[Ho.REGULAR]:[l,c,...f,u],[Ho.IGNORE_INDENTATION]:[...f,u]},defaultMode:Ho.REGULAR}:[l,c,u,...f]}flushLexingReport(t){return{...super.flushLexingReport(t),remainingDedents:this.flushRemainingDedents(t)}}isStartOfLine(t,n){return n===0||`\r
|
|
129
|
+
`.includes(t[n-1])}matchWhitespace(t,n,r,i){this.whitespaceRegExp.lastIndex=n;let o=this.whitespaceRegExp.exec(t);return{currIndentLevel:o?.[0].length??0,prevIndentLevel:this.indentationStack.at(-1),match:o}}createIndentationTokenInstance(t,n,r,i){let o=this.getLineNumber(n,i);return Rn(t,r,i,i+r.length,o,o,1,r.length)}getLineNumber(t,n){return t.substring(0,n).split(/\r\n|\r|\n/).length}indentMatcher(t,n,r,i){if(!this.isStartOfLine(t,n))return null;let{currIndentLevel:o,prevIndentLevel:s,match:a}=this.matchWhitespace(t,n,r,i);return o<=s?null:(this.indentationStack.push(o),a)}dedentMatcher(t,n,r,i){if(!this.isStartOfLine(t,n))return null;let{currIndentLevel:o,prevIndentLevel:s,match:a}=this.matchWhitespace(t,n,r,i);if(o>=s)return null;let l=this.indentationStack.lastIndexOf(o);if(l===-1)return this.diagnostics.push({severity:"error",message:`Invalid dedent level ${o} at offset: ${n}. Current indentation stack: ${this.indentationStack}`,offset:n,length:a?.[0]?.length??0,line:this.getLineNumber(t,n),column:1}),null;let c=this.indentationStack.length-l-1,u=t.substring(0,n).match(/[\r\n]+$/)?.[0].length??1;for(let f=0;f<c;f++){let d=this.createIndentationTokenInstance(this.dedentTokenType,t,"",n-(u-1));r.push(d),this.indentationStack.pop()}return null}buildTerminalToken(t){let n=super.buildTerminalToken(t),{indentTokenName:r,dedentTokenName:i,whitespaceTokenName:o}=this.options;return n.name===r?this.indentTokenType:n.name===i?this.dedentTokenType:n.name===o?sr({name:o,pattern:this.whitespaceRegExp,group:Me.SKIPPED}):n}flushRemainingDedents(t){let n=[];for(;this.indentationStack.length>1;)n.push(this.createIndentationTokenInstance(this.dedentTokenType,t,"",t.length)),this.indentationStack.pop();return this.indentationStack=[0],n}},Rf=class extends Wo{constructor(t){if(super(t),t.parser.TokenBuilder instanceof Ma)this.indentationTokenBuilder=t.parser.TokenBuilder;else throw new Error("IndentationAwareLexer requires an accompanying IndentationAwareTokenBuilder")}tokenize(t,n=qm){let r=super.tokenize(t),i=r.report;n?.mode==="full"&&r.tokens.push(...i.remainingDedents),i.remainingDedents=[];let{indentTokenType:o,dedentTokenType:s}=this.indentationTokenBuilder,a=o.tokenTypeIdx,l=s.tokenTypeIdx,c=[],u=r.tokens.length-1;for(let f=0;f<u;f++){let d=r.tokens[f],p=r.tokens[f+1];if(d.tokenTypeIdx===a&&p.tokenTypeIdx===l){f++;continue}c.push(d)}return u>=0&&c.push(r.tokens[u]),r.tokens=c,r}};var gg=class{stat(t){throw new Error("No file system is available.")}statSync(t){throw new Error("No file system is available.")}async exists(){return!1}existsSync(){return!1}readBinary(){throw new Error("No file system is available.")}readBinarySync(){throw new Error("No file system is available.")}readFile(){throw new Error("No file system is available.")}readFileSync(){throw new Error("No file system is available.")}async readDirectory(){return[]}readDirectorySync(){return[]}},Sf={fileSystemProvider:()=>new gg};var FM={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},BM={AstReflection:()=>new Vs};function WM(){let e=Go(If(Sf),BM),t=Go(kf({shared:e}),FM);return e.ServiceRegistry.register(t),t}function cA(e){let t=WM(),n=t.serializer.JsonSerializer.deserialize(e);return t.shared.workspace.LangiumDocumentFactory.fromModel(n,Oe.parse(`memory:/${n.name??"grammar"}.langium`)),n}var zo={$type:"AnchorDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function os(e){return We.isInstance(e,zo.$type)}var yg={$type:"BlockProperty",key:"key",value:"value"};var _g={$type:"CalendarBlock",properties:"properties"};function Ha(e){return We.isInstance(e,_g.$type)}var $n={$type:"ConfigEntry"};function fA(e){return We.isInstance(e,$n.$type)}var Cf={$type:"DefaultDeclaration",entityType:"entityType",properties:"properties"};function nt(e){return We.isInstance(e,Cf.$type)}var vg={$type:"DescriptionDirective",text:"text"};function za(e){return We.isInstance(e,vg.$type)}var bf={$type:"EntityProperty",key:"key",value:"value",values:"values"};var jo={$type:"FootnoteDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function kg(e){return We.isInstance(e,jo.$type)}var Yo={$type:"GroupBlock",content:"content",name:"name",properties:"properties",title:"title"};function $e(e){return We.isInstance(e,Yo.$type)}var Fa={$type:"GroupContent"};var xg={$type:"IncludeDeclaration",options:"options",path:"path"};var Eg={$type:"IncludeOption",key:"key",value:"value"};var Vo={$type:"ItemDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function Ke(e){return We.isInstance(e,Vo.$type)}var Ko={$type:"LabelDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function ja(e){return We.isInstance(e,Ko.$type)}var qo={$type:"MilestoneDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function mn(e){return We.isInstance(e,qo.$type)}var Wa={$type:"NonWorkingDeclaration",name:"name",properties:"properties",title:"title"};function Rr(e){return We.isInstance(e,Wa.$type)}var wg={$type:"NowlineDirective",properties:"properties",version:"version"};var Ir={$type:"NowlineFile",configEntries:"configEntries",directive:"directive",hasConfig:"hasConfig",includes:"includes",roadmapDecl:"roadmapDecl",roadmapEntries:"roadmapEntries"};function ss(e){return We.isInstance(e,Ir.$type)}var Zo={$type:"ParallelBlock",content:"content",name:"name",properties:"properties",title:"title"};function tt(e){return We.isInstance(e,Zo.$type)}var Nf={$type:"ParallelContent"};var Jo={$type:"PersonDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function Ya(e){return We.isInstance(e,Jo.$type)}var uA={$type:"PersonMemberRef",ref:"ref"};var Lf={$type:"RoadmapDeclaration",name:"name",properties:"properties",title:"title"};var Zt={$type:"RoadmapEntry"};var Ag={$type:"ScaleBlock",properties:"properties"};function dA(e){return We.isInstance(e,Ag.$type)}var Qo={$type:"SizeDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function yi(e){return We.isInstance(e,Qo.$type)}var es={$type:"StatusDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function Va(e){return We.isInstance(e,es.$type)}var Xa={$type:"StyleDeclaration",name:"name",properties:"properties",title:"title"};function Dt(e){return We.isInstance(e,Xa.$type)}var Tg={$type:"StyleProperty",key:"key",value:"value"};var Ba={$type:"SwimlaneContent"};var ts={$type:"SwimlaneDeclaration",content:"content",name:"name",properties:"properties",title:"title"};function qe(e){return We.isInstance(e,ts.$type)}var ns={$type:"SymbolDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function xi(e){return We.isInstance(e,ns.$type)}var Pf={$type:"TeamContent"};var rs={$type:"TeamDeclaration",content:"content",name:"name",properties:"properties",title:"title"};function Jt(e){return We.isInstance(e,rs.$type)}var is={$type:"WaveDeclaration",description:"description",name:"name",properties:"properties",title:"title"};function Tt(e){return We.isInstance(e,is.$type)}var Ua={$type:"WorkingDeclaration",name:"name",properties:"properties",title:"title"};function Ka(e){return We.isInstance(e,Ua.$type)}var Ga=class extends Ui{constructor(){super(...arguments);M(this,"types",{AnchorDeclaration:{name:zo.$type,properties:{description:{name:zo.description,optional:!0},name:{name:zo.name,optional:!0},properties:{name:zo.properties,defaultValue:[],optional:!0},title:{name:zo.title,optional:!0}},superTypes:[Zt.$type]},BlockProperty:{name:yg.$type,properties:{key:{name:yg.key},value:{name:yg.value}},superTypes:[]},CalendarBlock:{name:_g.$type,properties:{properties:{name:_g.properties,defaultValue:[],optional:!0}},superTypes:[$n.$type]},ConfigEntry:{name:$n.$type,properties:{},superTypes:[]},DefaultDeclaration:{name:Cf.$type,properties:{entityType:{name:Cf.entityType},properties:{name:Cf.properties,defaultValue:[],optional:!0}},superTypes:[$n.$type]},DescriptionDirective:{name:vg.$type,properties:{text:{name:vg.text}},superTypes:[Fa.$type,Nf.$type,Ba.$type,Pf.$type]},EntityProperty:{name:bf.$type,properties:{key:{name:bf.key},value:{name:bf.value,optional:!0},values:{name:bf.values,defaultValue:[],optional:!0}},superTypes:[]},FootnoteDeclaration:{name:jo.$type,properties:{description:{name:jo.description,optional:!0},name:{name:jo.name,optional:!0},properties:{name:jo.properties,defaultValue:[],optional:!0},title:{name:jo.title,optional:!0}},superTypes:[Zt.$type]},GroupBlock:{name:Yo.$type,properties:{content:{name:Yo.content,defaultValue:[]},name:{name:Yo.name,optional:!0},properties:{name:Yo.properties,defaultValue:[],optional:!0},title:{name:Yo.title,optional:!0}},superTypes:[Fa.$type,Nf.$type,Ba.$type]},GroupContent:{name:Fa.$type,properties:{},superTypes:[]},IncludeDeclaration:{name:xg.$type,properties:{options:{name:xg.options,defaultValue:[],optional:!0},path:{name:xg.path}},superTypes:[]},IncludeOption:{name:Eg.$type,properties:{key:{name:Eg.key},value:{name:Eg.value}},superTypes:[]},ItemDeclaration:{name:Vo.$type,properties:{description:{name:Vo.description,optional:!0},name:{name:Vo.name,optional:!0},properties:{name:Vo.properties,defaultValue:[],optional:!0},title:{name:Vo.title,optional:!0}},superTypes:[Fa.$type,Nf.$type,Ba.$type]},LabelDeclaration:{name:Ko.$type,properties:{description:{name:Ko.description,optional:!0},name:{name:Ko.name,optional:!0},properties:{name:Ko.properties,defaultValue:[],optional:!0},title:{name:Ko.title,optional:!0}},superTypes:[Zt.$type]},MilestoneDeclaration:{name:qo.$type,properties:{description:{name:qo.description,optional:!0},name:{name:qo.name,optional:!0},properties:{name:qo.properties,defaultValue:[],optional:!0},title:{name:qo.title,optional:!0}},superTypes:[Zt.$type]},NonWorkingDeclaration:{name:Wa.$type,properties:{name:{name:Wa.name,optional:!0},properties:{name:Wa.properties,defaultValue:[],optional:!0},title:{name:Wa.title,optional:!0}},superTypes:[$n.$type]},NowlineDirective:{name:wg.$type,properties:{properties:{name:wg.properties,defaultValue:[],optional:!0},version:{name:wg.version}},superTypes:[]},NowlineFile:{name:Ir.$type,properties:{configEntries:{name:Ir.configEntries,defaultValue:[],optional:!0},directive:{name:Ir.directive,optional:!0},hasConfig:{name:Ir.hasConfig,defaultValue:!1,optional:!0},includes:{name:Ir.includes,defaultValue:[],optional:!0},roadmapDecl:{name:Ir.roadmapDecl,optional:!0},roadmapEntries:{name:Ir.roadmapEntries,defaultValue:[],optional:!0}},superTypes:[]},ParallelBlock:{name:Zo.$type,properties:{content:{name:Zo.content,defaultValue:[]},name:{name:Zo.name,optional:!0},properties:{name:Zo.properties,defaultValue:[],optional:!0},title:{name:Zo.title,optional:!0}},superTypes:[Fa.$type,Ba.$type]},ParallelContent:{name:Nf.$type,properties:{},superTypes:[]},PersonDeclaration:{name:Jo.$type,properties:{description:{name:Jo.description,optional:!0},name:{name:Jo.name,optional:!0},properties:{name:Jo.properties,defaultValue:[],optional:!0},title:{name:Jo.title,optional:!0}},superTypes:[Zt.$type]},PersonMemberRef:{name:uA.$type,properties:{ref:{name:uA.ref}},superTypes:[Pf.$type]},RoadmapDeclaration:{name:Lf.$type,properties:{name:{name:Lf.name,optional:!0},properties:{name:Lf.properties,defaultValue:[],optional:!0},title:{name:Lf.title,optional:!0}},superTypes:[]},RoadmapEntry:{name:Zt.$type,properties:{},superTypes:[]},ScaleBlock:{name:Ag.$type,properties:{properties:{name:Ag.properties,defaultValue:[],optional:!0}},superTypes:[$n.$type]},SizeDeclaration:{name:Qo.$type,properties:{description:{name:Qo.description,optional:!0},name:{name:Qo.name,optional:!0},properties:{name:Qo.properties,defaultValue:[],optional:!0},title:{name:Qo.title,optional:!0}},superTypes:[Zt.$type]},StatusDeclaration:{name:es.$type,properties:{description:{name:es.description,optional:!0},name:{name:es.name,optional:!0},properties:{name:es.properties,defaultValue:[],optional:!0},title:{name:es.title,optional:!0}},superTypes:[Zt.$type]},StyleDeclaration:{name:Xa.$type,properties:{name:{name:Xa.name,optional:!0},properties:{name:Xa.properties,defaultValue:[],optional:!0},title:{name:Xa.title,optional:!0}},superTypes:[$n.$type]},StyleProperty:{name:Tg.$type,properties:{key:{name:Tg.key},value:{name:Tg.value}},superTypes:[]},SwimlaneContent:{name:Ba.$type,properties:{},superTypes:[]},SwimlaneDeclaration:{name:ts.$type,properties:{content:{name:ts.content,defaultValue:[],optional:!0},name:{name:ts.name,optional:!0},properties:{name:ts.properties,defaultValue:[],optional:!0},title:{name:ts.title,optional:!0}},superTypes:[Zt.$type]},SymbolDeclaration:{name:ns.$type,properties:{description:{name:ns.description,optional:!0},name:{name:ns.name,optional:!0},properties:{name:ns.properties,defaultValue:[],optional:!0},title:{name:ns.title,optional:!0}},superTypes:[$n.$type]},TeamContent:{name:Pf.$type,properties:{},superTypes:[]},TeamDeclaration:{name:rs.$type,properties:{content:{name:rs.content,defaultValue:[],optional:!0},name:{name:rs.name,optional:!0},properties:{name:rs.properties,defaultValue:[],optional:!0},title:{name:rs.title,optional:!0}},superTypes:[Zt.$type,Pf.$type]},WaveDeclaration:{name:is.$type,properties:{description:{name:is.description,optional:!0},name:{name:is.name,optional:!0},properties:{name:is.properties,defaultValue:[],optional:!0},title:{name:is.title,optional:!0}},superTypes:[Zt.$type]},WorkingDeclaration:{name:Ua.$type,properties:{name:{name:Ua.name,optional:!0},properties:{name:Ua.properties,defaultValue:[],optional:!0},title:{name:Ua.title,optional:!0}},superTypes:[$n.$type]}})}},We=new Ga;function _t(e){let t=[];for(let n of e.content)za(n)||t.push(n);return t}function*hA(e){for(let t of e)yield*Ig(t)}function*Ig(e){for(let t of _t(e))yield t,($e(t)||tt(t))&&(yield*Ig(t))}function*mA(e){for(let t of e.content)Jt(t)&&(yield t,yield*mA(t))}function*Rg(e){qe(e)||$e(e)||tt(e)?yield*Ig(e):Jt(e)&&(yield*mA(e))}function*Dn(e,t={}){t.config&&(yield*e.configEntries),t.roadmap&&e.roadmapDecl&&(yield e.roadmapDecl);for(let n of e.roadmapEntries)yield n,yield*Rg(n)}function Of(e,t){pA(e,t);for(let n of Rg(e))pA(n,t)}function pA(e,t){let n=e.properties;if(Array.isArray(n))for(let r of n)t(r,e)}function $f(e,t){t(e.name,e);for(let n of Rg(e))t(n.name,n)}function gA(e){return e.name}function yA(e){let t=new Set;for(let n of Dn(e,{roadmap:!0})){let r=gA(n);r&&t.add(r)}return t}function xA(e){let t=new Map;for(let n of Dn(e,{roadmap:!0})){let r=gA(n);r&&!t.has(r)&&t.set(r,n)}return t}function Q(e){return e.key.endsWith(":")?e.key.slice(0,-1):e.key}function vt(e,t){return e.find(n=>Q(n)===t)}function re(e,t){return vt(e,t)?.value}function Be(e,t){let n=vt(e,t);return n?n.value!==void 0?[n.value]:[...n.values]:[]}var ot=/^\d{4}-\d{2}-\d{2}$/;function ve(e){if(!e||!ot.test(e))return null;let[t,n,r]=e.split("-").map(s=>Number.parseInt(s,10)),i=new Date(0);return i.setUTCFullYear(t,n-1,r),i.getUTCFullYear()===t&&i.getUTCMonth()===n-1&&i.getUTCDate()===r?i:null}function He(e){return ve(e)!==null}var wA={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};function bg(e){return Object.hasOwn(wA,e)}var Ng=new Set(["date","start","end","every"]);function qa(e){let t=new Map;for(let l of e.properties){let c=Q(l);Ng.has(c)&&!t.has(c)&&t.set(c,l)}let n=XM(t),r={own:t,shape:n,wellFormed:!1},i=t.get("date");if(i){let l=Sg(i);l.every(He)&&(r.dates=l)}let o=EA(t.get("start"));o!==void 0&&(r.start=o);let s=EA(t.get("end"));s!==void 0&&(r.end=s);let a=t.get("every");if(a){let l=Sg(a);l.every(bg)&&(r.weekdays=l.map(c=>wA[c]))}return r.wellFormed=n!=="malformed"&&(!i||r.dates!==void 0&&r.dates.length>0)&&(!t.has("start")||r.start!==void 0)&&(!t.has("end")||r.end!==void 0)&&!(r.start!==void 0&&r.end!==void 0&&r.end<r.start)&&(!a||r.weekdays!==void 0&&r.weekdays.length>0),r}function Df(e){return e.some(t=>t.$type==="NonWorkingDeclaration"&&t.name==="weekend")}function XM(e){let t=e.has("start"),n=e.has("end");return e.has("date")?e.has("every")||t||n?"malformed":"dated":e.has("every")?t&&n?"bounded-recurrence":t||n?"half-bounded-recurrence":"open-recurrence":t&&n?"range":"malformed"}function Sg(e){return e.value!==void 0?[e.value]:[...e.values]}function EA(e){if(!e)return;let t=Sg(e);return t.length===1&&He(t[0])?t[0]:void 0}function Mf(e,t,n){let r=[],i=n.defaults.get(e);if(i){let l=Lg("default-style",i.properties,n);l&&r.push(l),r.push({level:"default",props:i.properties})}let o=vt(t,"labels"),s=o?o.value?[o.value]:o.values:[];for(let l of[...s].reverse()){let c=n.labels.get(l);if(!c){r.push({level:"label",id:l,label:void 0});continue}let u=Lg("label-style",c.properties,n);u&&r.push(u)}let a=Lg("entity-style",t,n);return a&&r.push(a),r.push({level:"inline",props:t}),r}function Lg(e,t,n){let r=vt(t,"style")?.value;if(r)return{level:e,id:r,decl:n.styles.get(r)}}var Ff=["planned","in-progress","active","done","completed","at-risk","blocked"],Ei=["none","multiplier","person","people","points","time"],Za=[...Ei,"shield","warning","lock","calendar"],TA=["hide","show"],_A={border:["solid","dashed","dotted"],shadow:["none","subtle","soft","hard"],font:["sans","serif","mono"],weight:["thin","light","normal","bold"],italic:["true","false"],"text-size":["none","xs","sm","md","lg","xl"],padding:["none","xs","sm","md","lg","xl"],spacing:["none","xs","sm","md","lg","xl"],"header-height":["none","xs","sm","md","lg","xl"],"corner-radius":["none","xs","sm","md","lg","xl","full"],bracket:["none","solid","dashed"],"header-position":["beside","above"],"timeline-position":["top","bottom","both"],"minor-grid":["true","false"]},vA=["red","blue","yellow","green","orange","purple","violet","gray","grey","navy","white","none"],AA=["business","full","custom"],kA=["merge","ignore","isolate"],IA=["bg","fg","text","border","icon","shadow","font","weight","italic","text-size","padding","spacing","header-height","corner-radius","bracket","header-position","capacity-icon","timeline-position","minor-grid","non-working"],RA=["header-height","header-position","timeline-position","minor-grid","non-working"],Ja="none",SA=["days-per-week","days-per-month","days-per-quarter","days-per-year"],bA=["name","label-every","label"],NA=["item","label","swimlane","roadmap","milestone","footnote","anchor","parallel","group"],LA=["labels","link","style","description"],PA={RoadmapDeclaration:["author","start","length","scale","calendar","logo","logo-size"],AnchorDeclaration:["date"],SwimlaneDeclaration:["owner","capacity","utilization-warn-at","utilization-over-at","status","after","before"],ItemDeclaration:["size","duration","status","owner","after","before","remaining","capacity"],ParallelBlock:["owner","after","before","status"],GroupBlock:["owner","after","before","status"],MilestoneDeclaration:["date","after"],FootnoteDeclaration:["on"],PersonDeclaration:[],TeamDeclaration:[],LabelDeclaration:[],SizeDeclaration:["effort"],StatusDeclaration:[],WaveDeclaration:["after"]},CA=["locale"];function se(e,t){return e.length*t*.58}function OA(e,t,n){if(se(e,n)<=t)return e;let r=Array.from(e.trimStart());for(let i=r.length-1;i>=1;i--){let s=`${r.slice(0,i).join("").trimEnd()}\u2026`;if(se(s,n)<=t)return s}return`${r[0]??""}\u2026`}function wi(e,t,n,r=t){if(!e)return[];let i=e.split(/\s+/).filter(a=>a.length>0);if(i.length===0)return[];let o=[],s="";for(let a of i){let l=s?`${s} ${a}`:a,c=o.length===0?r:t;s&&se(l,n)>c?(o.push(s),s=a):s=l}return s&&o.push(s),o}var UM=new Set(Ei),GM=/^\d+$/,HM=/^\d+\.\d+$/,zM=/^\d+(?:\.\d+)?%$/;function Sr(e){if(!e)return null;if(GM.test(e)){let t=parseInt(e,10);return t>0?t:null}if(HM.test(e)){let t=parseFloat(e);return Number.isFinite(t)&&t>0?t:null}if(zM.test(e)){let t=parseFloat(e.slice(0,-1))/100;return Number.isFinite(t)&&t>0?t:null}return null}function Qa(e){if(Number.isInteger(e))return String(e);let t=e.toFixed(6);return t=t.replace(/0+$/,""),t=t.replace(/\.$/,""),t}function jM(e){for(let t of e.properties)if(Q(t)==="unicode"&&t.value)return t.value}function el(e,t){if(e==="none")return null;if(UM.has(e))return{kind:"builtin",name:e};let n=t.get(e);return n?{kind:"literal",text:jM(n)??e}:{kind:"literal",text:e}}function tl(e,t,n){return t?t.kind==="builtin"&&t.name==="multiplier"?(e.length+1)*n*.58:e.length*n*.58+(.1+1)*n:e.length*n*.58}var Bf=.6,YM=.5,VM=.1;function nl(e,t,n,r){if(t?.kind!=="builtin"||t.name==="multiplier")return;let i=n*VM;if(r){let o=s=>s.length*n*YM;return[o(r),n*Bf,o(e),i]}return[se(e,n),i]}function Ti(e){return e.toISOString().slice(0,10)}var as={mode:"business",daysPerWeek:5,daysPerMonth:22,daysPerQuarter:65,daysPerYear:260},KM={mode:"full",daysPerWeek:7,daysPerMonth:30,daysPerQuarter:91,daysPerYear:365};function $A(e,t){let r=vt(e.roadmapDecl?.properties??[],"calendar")?.value??"business";if(r==="business")return{...as};if(r==="full")return{...KM};if(t){let i=(o,s)=>{let a=vt(t.properties,o),l=a?parseInt(a.value,10):NaN;return Number.isFinite(l)&&l>0?l:s};return{mode:"custom",daysPerWeek:i("days-per-week",as.daysPerWeek),daysPerMonth:i("days-per-month",as.daysPerMonth),daysPerQuarter:i("days-per-quarter",as.daysPerQuarter),daysPerYear:i("days-per-year",as.daysPerYear)}}return{...as}}var Wf=/^(\d+(?:\.\d+)?)([dwmqy])$/;function ls(e,t){let n=Wf.exec(e);if(!n)return 0;let r=parseFloat(n[1]);switch(n[2]){case"d":return r;case"w":return r*t.daysPerWeek;case"m":return r*t.daysPerMonth;case"q":return r*t.daysPerQuarter;case"y":return r*t.daysPerYear;default:return 0}}function DA(e,t,n){return e?Wf.test(e)?ls(e,n):t.get(e)?.effortDays??0:0}function MA(e,t,n){let r=re(e,"duration");if(r&&Wf.test(r))return ls(r,n);let i=re(e,"size"),o=i?t.get(i):void 0;if(!o)return 0;let s=Sr(re(e,"capacity"))??1;return o.effortDays/s}function FA(e,t,n){let r=re(e,"size"),i=r?t.get(r):void 0;if(i)return i.effortDays;let o=re(e,"duration");if(o&&Wf.test(o)){let s=Sr(re(e,"capacity"))??1;return ls(o,n)*s}return 0}function cs(e,t){let n=new Map;for(let[r,i]of e){let s=vt(i.properties,"effort")?.value;if(!s)continue;let a=ls(s,t);a<=0||n.set(r,{name:r,title:i.title||void 0,effortDays:a,effortLiteral:s})}return n}function At(e,t){return Math.round((t.getTime()-e.getTime())/864e5)}function Xe(e,t){let n=new Date(e.getTime());return n.setUTCDate(n.getUTCDate()+t),n}function Og(e){return e!=="business"?[]:[{working:!1,every:new Set([0,6]),id:"weekend",title:"Weekend"}]}function $g(e,t=Og(e.mode)){return JM(n=>GA(n,e),t)}function Xf(e,t,n,r){if(!e.hasNonWorkingDays)return Xe(t,r);let i=Math.floor(r);return i<=Math.floor(n)?e.dateAtWorkingIndex(t,n):Xe(e.dateAtWorkingIndex(t,i-1),1)}function UA(e,t){return GA(e,t)}function GA(e,t){switch(e){case"days":return 1;case"weeks":return t.daysPerWeek;case"months":return t.daysPerMonth;case"quarters":return t.daysPerQuarter;case"years":return t.daysPerYear}}function HA(e){switch(e){case"days":return 1;case"weeks":return 7;case"months":return 30;case"quarters":return 91;case"years":return 365}}var zA=864e5,ze=7,qM=4,ZM=1e8,jA=14;function JM(e,t){let n=[];for(let g of t){let w=eF(g);w&&n.push(w)}let r=n.map(g=>g.copy),i=rF(n),o=sF(i,oF(n)),s=KA(o,VA(n)),a=lF(n,o),l=(g,w)=>cF(a,g,w),c=s[0],u=s[s.length-1];for(let g of[c,u])if(g.kind!=="mask"||g.workingPerWeek===0)throw new RangeError("working calendar: an unbounded stretch has no working weekday");let f=s.some(g=>g.kind==="non-working"||g.kind==="mask"&&g.workingPerWeek<ze),d=iF(i);if(!f)return QM(e,r,d,l);let p=new Cg(s,qA(n,!1)),m=(g,w)=>p.dateAt(g,w);return{rules:r,hasNonWorkingDays:!0,weekStart:uF(i),workingWeekdays:d,daysPerUnit:e,addUnits:(g,w,x)=>m(g,w*e(x)),isWorkingDay:g=>p.isWorkingDay(g),workingIndexOf:(g,w)=>p.indexOf(g,w),dateAtWorkingIndex:m,nonWorkingRuns:(g,w)=>p.runs(g,w),workingExceptionRuns:l}}function QM(e,t,n,r){return{rules:t,hasNonWorkingDays:!1,weekStart:void 0,workingWeekdays:n,daysPerUnit:e,addUnits:(i,o,s)=>Xe(i,o*e(s)),isWorkingDay:()=>!0,workingIndexOf:(i,o)=>At(i,o),dateAtWorkingIndex:(i,o)=>Xe(i,o),nonWorkingRuns:()=>[],workingExceptionRuns:r}}function eF(e){let t=e.every===void 0?void 0:nF(e.every),n=e.start!==void 0||e.end!==void 0;if(t===0||e.dates!==void 0&&(t!==void 0||n)||t===void 0&&e.dates===void 0&&(e.start===void 0||e.end===void 0))return;let i=e.start===void 0?-1/0:Nt(e.start),o=e.end===void 0?1/0:Nt(e.end);if(Number.isNaN(i)||Number.isNaN(o)||o<i)return;let s=e.dates?.map(Nt);if(s?.some(Number.isNaN))return;let a=s?s.map(l=>({start:l,end:l+1})):[{start:i,end:o+1}];return{copy:tF(e),working:e.working,mask:t,spans:a}}function tF(e){let t={working:e.working};return e.every!==void 0&&(t.every=new Set(e.every)),e.dates!==void 0&&(t.dates=e.dates.map(n=>new Date(n.getTime()))),e.start!==void 0&&(t.start=new Date(e.start.getTime())),e.end!==void 0&&(t.end=new Date(e.end.getTime())),e.id!==void 0&&(t.id=e.id),e.title!==void 0&&(t.title=e.title),t}function nF(e){let t=0;for(let n of e){if(!Number.isInteger(n)||n<0||n>=ze)throw new RangeError(`working calendar: weekday ${n} is outside 0..6`);t|=1<<n}return t}function rF(e){let t=0,n=0;for(let r of e)r.mask===void 0||!YA(r.spans[0])||(r.working?n|=r.mask:t|=r.mask);return t&~n}function iF(e){let t=new Set;for(let n=0;n<ze;n++)(e&1<<n)===0&&t.add(n);return t}function YA(e){return e.start===-1/0&&e.end===1/0}function oF(e){let t=[];for(let n of e)n.mask===void 0||YA(n.spans[0])||t.push({...n.spans[0],working:n.working,mask:n.mask});return t}function sF(e,t){let n=new Array(ze).fill(0),r=new Array(ze).fill(0),i=(u,f)=>{let d=u.working?r:n;for(let p=0;p<ze;p++)u.mask&1<<p&&(d[p]+=f)},o=()=>{let u=e;for(let f=0;f<ze;f++)n[f]>0&&(u|=1<<f),r[f]>0&&(u&=~(1<<f));return u},s=[];for(let u of t)u.start===-1/0?i(u,1):s.push({at:u.start,span:u,delta:1}),u.end!==1/0&&s.push({at:u.end,span:u,delta:-1});s.sort((u,f)=>u.at-f.at);let a=[],l=-1/0,c=0;for(;;){let u=c<s.length?s[c].at:1/0;if(l<u&&aF(a,{start:l,end:u,mask:o()}),u===1/0)return a;for(;c<s.length&&s[c].at===u;)i(s[c].span,s[c].delta),c++;l=u}}function aF(e,t){let n=e[e.length-1];n&&n.mask===t.mask?n.end=t.end:e.push(t)}function VA(e){let t=[];for(let s of e)if(s.mask===void 0)for(let a of s.spans)t.push({at:a.start,working:s.working,delta:1}),t.push({at:a.end,working:s.working,delta:-1});t.sort((s,a)=>s.at-a.at);let n=[],r=0,i=0,o=0;for(;o<t.length;){let s=t[o].at;for(;o<t.length&&t[o].at===s;)t[o].working?r+=t[o].delta:i+=t[o].delta,o++;if(o===t.length||r===0&&i===0)continue;let a=r>0?"working":"non-working",l=t[o].at,c=n[n.length-1];c&&c.kind===a&&c.end===s?c.end=l:n.push({start:s,end:l,kind:a})}return n}function KA(e,t){let n=[],r=0;for(let i of e){for(;r<t.length&&t[r].end<=i.start;)r++;let o=i.start;for(let s=r;s<t.length&&t[s].start<i.end;s++){let a=Math.max(t[s].start,i.start),l=Math.min(t[s].end,i.end);o<a&&n.push(BA(o,a,i.mask)),n.push({start:a,end:l,kind:t[s].kind}),o=l}o<i.end&&n.push(BA(o,i.end,i.mask))}return n}function BA(e,t,n){let r=[];for(let o=0;o<ze;o++)r.push((n&1<<o)!==0);let i=r.filter(o=>!o).length;return{start:e,end:t,kind:"mask",off:r,workingPerWeek:i}}function qA(e,t){let n=[];for(let[r,i]of e.entries()){let o=i.copy.title;if(i.mask!==void 0||i.working!==t||o===void 0||i.spans.length===0)continue;let s=i.spans.reduce((a,l)=>Math.min(a,l.start),1/0);n.push({title:o,spans:i.spans,first:s,order:r})}return n.sort((r,i)=>r.first-i.first||r.order-i.order),n.map(({title:r,spans:i})=>({title:r,spans:i}))}function lF(e,t){let n=qA(e,!0);if(n.length===0)return[];let r=e.filter(l=>!l.working),i=KA(t,VA(r)),o=new Map;n.forEach((l,c)=>{for(let u of l.spans)for(let f=u.start;f<u.end;f++){if(!QA(i,f))continue;let d=o.get(f)??new Set;d.add(c),o.set(f,d)}});let s=[...o.keys()].sort((l,c)=>l-c),a=[];for(let l=0;l<s.length;){let c=l,u=new Set;for(;c<s.length&&s[c]-s[l]===c-l;){for(let f of o.get(s[c])??[])u.add(f);c++}a.push({from:rl(s[l]),through:rl(s[c-1]),titles:[...u].sort((f,d)=>f-d).map(f=>n[f].title)}),l=c}return a}function cF(e,t,n){let r=Nt(t),i=Nt(n);return Number.isNaN(r)||Number.isNaN(i)?[]:e.filter(o=>Nt(o.from)<i&&Nt(o.through)>=r).map(o=>({from:new Date(o.from.getTime()),through:new Date(o.through.getTime()),titles:[...o.titles]}))}function uF(e){let t=i=>(e&1<<i)!==0,n,r=0;for(let i=0;i<ze;i++){if(t(i)||!t((i+6)%ze))continue;let o=0;for(;o<ze&&t((i+6-o)%ze);)o++;o>r&&(n=i,r=o)}return n}function Nt(e){return Math.round(e.getTime()/zA)}function rl(e){return new Date(e*zA)}function il(e){return((e+qM)%ze+ze)%ze}function ZA(){return new Error("working calendar: remainder scan exceeded its cap (internal error)")}function JA(e,t){let n=0,r=e.length-1;for(;n<r;){let i=n+r>>1;t>=e[i].end?n=i+1:r=i}return n}function QA(e,t){let n=e[JA(e,t)];return n.kind==="mask"?n.off[il(t)]:n.kind==="non-working"}function Pg(e,t,n){if(e.kind!=="mask")return e.kind==="working"?n-t:0;let r=Math.floor((n-t)/ze),i=r*e.workingPerWeek;for(let o=t+r*ze;o<n;o++)e.off[il(o)]||i++;return i}function WA(e,t,n){if(e.kind!=="mask")return t+n;let r=t+Math.floor(n/e.workingPerWeek)*ze,i=n%e.workingPerWeek;for(let o=0;o<jA;o++,r++)if(!e.off[il(r)]){if(i===0)return r;i--}throw ZA()}function XA(e,t,n){if(e.kind!=="mask")return t-n;let r=Math.floor((n-1)/e.workingPerWeek),i=t-r*ze,o=n-r*e.workingPerWeek;for(let s=0;s<jA;s++)if(i--,!e.off[il(i)]&&(o--,o===0))return i;throw ZA()}var Cg=class{constructor(t,n){M(this,"pieces");M(this,"titled");this.pieces=t,this.titled=n}isWorkingDay(t){let n=Nt(t);return Number.isNaN(n)||!this.isNonWorking(n)}indexOf(t,n){let r=Nt(t),i=Nt(n);if(Number.isNaN(r)||Number.isNaN(i))return Number.NaN;let o=this.nthFrom(i,0);return o>=r?this.count(r,o):-this.count(o,r)}dateAt(t,n){let r=Nt(t),i=Math.floor(n);return Number.isNaN(r)||!Number.isFinite(i)||Math.abs(i)>ZM?new Date(Number.NaN):rl(i>=0?this.nthFrom(r,i):this.nthBefore(r,-i))}runs(t,n){let r=Nt(t),i=Nt(n);if(Number.isNaN(r)||Number.isNaN(i)||r>=i)return[];let o=[],s=this.isNonWorking(r)?this.nthBefore(r,1)+1:this.nextNonWorking(r,i);for(;s<i;){let a=this.nthFrom(s,0)-1;o.push({from:rl(s),through:rl(a),titles:this.titlesIn(s,a)}),s=this.nextNonWorking(a+1,i)}return o}pieceAt(t){return JA(this.pieces,t)}isNonWorking(t){return QA(this.pieces,t)}count(t,n){let r=0;for(let i=this.pieceAt(t);i<this.pieces.length&&this.pieces[i].start<n;i++){let o=this.pieces[i];r+=Pg(o,Math.max(t,o.start),Math.min(n,o.end))}return r}nthFrom(t,n){let r=t,i=n;for(let o=this.pieceAt(t);o<this.pieces.length;o++){let s=this.pieces[o];if(s.end===1/0)return WA(s,r,i);let a=Pg(s,r,s.end);if(i<a)return WA(s,r,i);i-=a,r=s.end}throw new Error("working calendar: forward walk left the last piece (internal error)")}nthBefore(t,n){let r=t,i=n;for(let o=this.pieceAt(t-1);o>=0;o--){let s=this.pieces[o];if(s.start===-1/0)return XA(s,r,i);let a=Pg(s,s.start,r);if(i<=a)return XA(s,r,i);i-=a,r=s.start}throw new Error("working calendar: backward walk left the first piece (internal error)")}nextNonWorking(t,n){for(let r=this.pieceAt(t);r<this.pieces.length&&this.pieces[r].start<n;r++){let i=this.pieces[r],o=Math.max(t,i.start);if(i.kind==="non-working")return o;if(!(i.kind!=="mask"||i.workingPerWeek===ze)){for(let s=0;s<ze&&o+s<i.end;s++)if(i.off[il(o+s)])return o+s}}return n}titlesIn(t,n){let r=[];for(let i of this.titled)i.spans.some(o=>o.start<=n&&o.end>t)&&r.push(i.title);return r}};function Uf(e,t){let n=$A(e,t.config.calendar),r=fF(n,t.config.calendarDeclarations);try{return{config:n,working:$g(n,r)}}catch(i){if(!(i instanceof RangeError))throw i;return{config:n,working:$g(n)}}}function fF(e,t){let n=Df(t)?[]:Og(e.mode);for(let r of t){let i=dF(r);i&&n.push(i)}return n.sort(pF)}function dF(e){let t=qa(e);if(!t.wellFormed)return;let n={working:e.$type==="WorkingDeclaration"};return e.name&&(n.id=e.name),e.title!==void 0&&(n.title=e.title),t.dates&&(n.dates=t.dates.map(Dg)),t.start&&(n.start=Dg(t.start)),t.end&&(n.end=Dg(t.end)),t.weekdays&&(n.every=new Set(t.weekdays)),n}function Dg(e){return ve(e)}function pF(e,t){return us(ek(e),ek(t))||us(e.title,t.title)||us(e.id,t.id)||Number(e.working)-Number(t.working)||us(tk(e),tk(t))||us(e.start?.getTime(),t.start?.getTime())||us(e.end?.getTime(),t.end?.getTime())||hF(e.dates??[],t.dates??[])}function ek(e){return e.dates?Math.min(...e.dates.map(t=>t.getTime())):e.start?.getTime()}function tk(e){if(!e.every)return;let t=0;for(let n of e.every)t|=1<<n;return t}function us(e,t){return e===t?0:e===void 0?-1:t===void 0?1:e<t?-1:1}function hF(e,t){let n=e.map(i=>i.getTime()).sort((i,o)=>i-o),r=t.map(i=>i.getTime()).sort((i,o)=>i-o);for(let i=0;i<Math.min(n.length,r.length);i++)if(n[i]!==r[i])return n[i]-r[i];return n.length-r.length}function nk(e){let{naturalPixelsPerDay:t,dayCount:n,chromeWidth:r,maxWidth:i}=e;if(i===void 0||r+n*t<=i)return t;let o=(i-r)/n,s=Math.min(t,1);return Math.max(s,o)}var Mn=12,Bn=6,Gf=20,_i=38,Lr=13,ol=11,sl=16,Mg=2;function Hf(e){return _i+(Math.max(1,e)-1)*sl}function zf(e,t){return t?Hf(e):Gf+(Math.max(1,e)-1)*sl}function Fg(e,t){return Math.max(0,zf(e,t)-_i)}var vi=12,Bg=12,br=5,fs=22,Wg=14,al=10,Mt=8,Pr=14,Ai=6,rk=4;function ds(e,t){let n=Mn;if(e){let r=Ai+Pr+rk-Mn;n=Mn+Math.max(0,r)}if(t&&!Gg(t.barWidth)){let r=Hg(0,e)+Fn;n=Math.max(n,r+gn)}return n}var gn=4,Cr=2*vi,Xg=Ai+Pr+gn+vi+br,ps=fs+1;function jf(e){let t=e.barRightX+Bn,n=!1,r=null;e.iconSpills&&(r=t,t=r+Pr,n=!0);let i=null;e.captionWidth!==null&&(n&&(t+=gn),i=t,t+=e.captionWidth,n=!0);let o=null;e.footnoteCount>0&&(n&&(t+=gn),o=t,t+=e.footnoteCount*Mt,n=!0);let s=null;return e.dotSpills&&(n&&(t+=gn),s=t+br,t=s+br),{iconSpillX:r,captionX:i,footnoteSpillStartX:o,dotSpillCx:s,rightX:t}}var Fn=12,ik=6,Ug=6,ok=5,Nr=gn,sk=ik+Fn+Nr+Fn+Ug;function Gg(e){return e<sk}function Hg(e,t){return t?e+Ai+Pr+Nr:e+ik}function zg(e,t){let n;return t>0?n=e-fs-(t-1)*Mt-Nr:n=e-vi-br-Nr,n-Fn}function ll(e){let{barWidth:t,footnoteLabels:n,hasBeforeGlyph:r}=e,i=Number.POSITIVE_INFINITY;t>=Cr&&(i=Math.min(i,-(vi+br)));let o=n.length;if(o>0&&t>=ps)for(let a=0;a<o;a+=1){let c=-fs-(o-1-a)*Mt-se(n[a],al);i=Math.min(i,c)}return r&&t>=sk&&(i=Math.min(i,zg(0,o))),Math.max(Mn,-i+gn)}var Or=13,Wn=3,Xn=4,mF=4,Yf=Or+mF,gF=.25;function ak(e,t){if(e.length===0)return{rows:[[]],expanded:!1};let n=[[]],r=0,i=t,o=!1;for(let s of e){let a=n[n.length-1],l=(a.length===0?0:Xn)+s.width,c=r+l;if(c<=i){a.push(s),r=c;continue}if(a.length===0){a.push(s),r=s.width;continue}let u=c-i,f=s.width*gF;if(!o&&u<=f){a.push(s),r=c,i=c,o=!0;continue}n.push([s]),r=s.width,i=t}return{rows:n,expanded:o}}var lk={none:0,xs:2,sm:4,md:8,lg:16,xl:24},ck={none:0,xs:4,sm:8,md:12,lg:20,xl:32},ki={none:0,xs:10,sm:12,md:14,lg:18,xl:24},Ii={none:0,xs:2,sm:4,md:8,lg:12,xl:20,full:9999},jg={xs:18,sm:24,md:36,lg:48,xl:72},Yg=1,Qt=4,cl={none:0,xs:16,sm:20,md:24,lg:32,xl:40},uk=cl.md;function ul(e){return Math.round(e/2+3)}var yF=ul(uk),Ri=10,fl=22,dl=15,pl="6 4",Vg=36,Ft=16,Kg=Ft/2,hl=10,qg=Ft-4,hs=6,Vf=2.25,fk=1,st=12,dk=32,pk=120,Zg=240,Jg=72,Kf=28,Bt=16,Qg=22,ms=18,qf="Powered by",ey="https://nowline.io",ml=.22,$r=40,Zf=32,hk=.58,xF=qf.length*Zf*hk,EF=10,gl=xF+EF,ty=gl+74,ny=5,Jf=gl+81,wF=3*$r*hk,TF=Jf+wF,_F=12+$r,ry=TF*ml,mk=_F*ml,Qf=4;var iy={sans:'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',serif:'Georgia, "Times New Roman", serif',mono:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"},gk={days:7,weeks:4,months:3,quarters:4,years:5},oy=.1,sy=20,ed=2,ay="2 2",ly=.13,cy=6,uy=2,fy=.12,yl=.25,yn=10,dy=7,xl=14,td=8,Dr=6,Mr=2,Si=3,bi=.5,py=9,nd=18,rd=10,hy=6,id=16,od=11;var yk=18,El=13,sd=ki.xs,my=10,xk=6,Ek=6,gy=.12,yy=.06,xy=2;function ad(e){return e.drawn?{header:e.hasTitle||e.hasPins||e.hasBracket?yk:0,pad:xk}:{header:0,pad:0}}function gs(e,t){return t?e+Fn+Nr:e}function Ey(e){return e.length*sd*.58}function ys(e){if(e.kind==="item")return Number.NEGATIVE_INFINITY;let t=Number.NEGATIVE_INFINITY,n=e.inlineDatePins??[];for(let r of n)t=Math.max(t,r.glyphTopLeft.x+r.glyphSize);if(e.title&&e.headerHeight>0){let r=n.some(i=>i.side==="after");t=Math.max(t,gs(e.box.x,r)+Ey(e.title))}return t}function vF(e,t){return e.endX-Math.min(t/2,(e.endX-e.startX)/2)}function AF(e,t){return e.startX+Math.min(t/2,(e.endX-e.startX)/2)}function xs(e){return e<3?{headWidth:3,head:"dot"}:{headWidth:Math.min(7,e),head:"arrow"}}var wy=(e,t,n)=>e>=t-.01&&e<=n+.01;function kF(e,t){return t.rowY===void 0||!wy(t.rowY,e.top,e.bottom)?!1:e.rowY===void 0||wy(e.rowY,t.top,t.bottom)}function IF(e,t,n,r,i){let o=[];for(let l of e){if(l.x>=n+1||l.x+l.width<=t-1)continue;let c=l.y-1,u=l.y+l.height+1;u<=r||c>=i||o.push([Math.max(r,c),Math.min(i,u)])}o.sort((l,c)=>l[0]-c[0]);let s=[],a=r;for(let[l,c]of o)l-a>=2&&s.push([a,l]),a=Math.max(a,c);return i-a>=2&&s.push([a,i]),s}function wk(e,t,n,r){let i=Math.min(n,r),o=Math.max(n,r),s=0;for(let a of e)Math.abs(a.x-t)>1||a.bottom<=i||a.top>=o||s++;return s}function Tk(e,t,n,r){let i=Math.min(n,r),o=Math.max(n,r),s=0;for(let a of e)a.height<=0||t<=a.x||t>=a.x+a.width||a.y+a.height<=i||a.y>=o||s++;return s}function RF(e,t,n,r){let i=Math.min(e.x,t.x),o=Math.max(e.x,t.x),s=Math.min(e.y,t.y),a=Math.max(e.y,t.y),l=null;for(let f of IF(r.blocks,i,o,s,a)){let d=(f[0]+f[1])/2,p=[wk(r.edges,e.x,e.y,d)+wk(r.edges,t.x,d,t.y),Tk(r.blocks,e.x,e.y,d)+Tk(r.blocks,t.x,d,t.y),Math.abs(d-e.y)];(!l||SF(p,l.key))&&(l={gap:f,centre:d,key:p})}if(l)return{gap:l.gap,centre:l.centre};let c=Math.min(4,(a-s)/2),u=e.y+n*c;return{gap:[s,a],centre:u}}function SF(e,t){for(let n=0;n<e.length;n++)if(e[n]!==t[n])return e[n]<t[n];return!1}function bF(e,t){let n=[0];for(let r=1;r*2.5<=t+.01;r++)n.push(-e*r*2.5,e*r*2.5);return n}function NF(e){let t=[],n=new Map,r=[...e].sort((i,o)=>i.centre-o.centre||i.xLo-o.xLo||i.index-o.index);for(let i of r){let[o,s]=i.gap,a=t.find(c=>c.bundle===i.bundle&&c.y>=o-.01&&c.y<=s+.01),l=i.centre;if(a)l=a.y;else{let c=bF(i.dir,(s-o)/2),u=Number.POSITIVE_INFINITY;for(let f of c){let d=i.centre+f,p=t.filter(m=>m.bundle!==i.bundle&&Math.abs(m.y-d)<2.5-.01&&m.xLo<i.xHi+1&&m.xHi>i.xLo-1).length;if(p<u&&(u=p,l=d),p===0)break}}t.push({y:l,xLo:i.xLo,xHi:i.xHi,bundle:i.bundle}),n.set(i.index,l)}return n}function _k(e,t,n){let r=new Array(e.length).fill(null),i=[];e.forEach((s,a)=>{let{source:l,target:c}=s,u=c.startX-l.endX>.01;if(kF(l,c)&&c.startX>=l.endX-.01){if(!u)return;let y=l.exitY!==void 0&&wy(l.exitY,c.top,c.bottom)?l.exitY:c.rowY??0;r[a]={fromId:s.fromId,toId:s.toId,waypoints:[{x:l.endX,y},{x:c.paintedX,y}],slack:!0,...xs(c.bottom-c.top)};return}let f=vF(l,n),d=AF(c,n),p,m,g;if(c.top>=l.bottom-.01)g=1,p={x:f,y:l.bottom},m={x:d,y:c.top};else if(c.bottom<=l.top+.01)g=-1,p={x:f,y:l.top},m={x:d,y:c.bottom};else{let y=Math.max(l.bottom,c.bottom)+4;r[a]={fromId:s.fromId,toId:s.toId,waypoints:[{x:f,y:l.bottom},{x:f,y},{x:d,y},{x:d,y:c.bottom}],slack:u,...xs(c.paintedWidth)};return}if(Math.abs(f-d)<.01){r[a]={fromId:s.fromId,toId:s.toId,waypoints:[p,m],slack:u,...xs(c.paintedWidth)};return}let{gap:w,centre:x}=RF(p,m,g,t);i.push({index:a,req:s,from:p,to:m,dir:g,gap:w,centre:x,xLo:Math.min(f,d),xHi:Math.max(f,d),bundle:`${Math.round(d*100)}:${g}`})});let o=NF(i);for(let s of i){let a=o.get(s.index)??s.centre,l=s.req.target.startX-s.req.source.endX>.01;r[s.index]={fromId:s.req.fromId,toId:s.req.toId,waypoints:[s.from,{x:s.from.x,y:a},{x:s.to.x,y:a},s.to],slack:l,...xs(s.req.target.paintedWidth)}}return r}function vk(e,t,n,r=0,i=0){let o=e+10,s=o+12,a=t.length*6.5,l=s+a,c=0,u=0,f=0;n&&(c=13+n.length*5,u=l+6,f=u+10+3,l=u+c);let d=0;r>0&&(d=l+6,l=d+r);let p=0;i>0&&(p=l+6+i,l=p);let m=l-o+12,g=Math.max(56,m);return{titleTextWidth:a,ownerTextWidth:c,capacityBadgeWidth:r,footnoteIndicatorWidth:i,titleX:s,ownerX:u,ownerTextX:f,badgeX:d,footnoteRightX:p,tabX:o,tabW:g,rightX:o+g}}function ld(e){let t=re(e.roadmapDecl?.properties??[],"logo");return t||void 0}function PF(e){let t=re(e.roadmapDecl?.properties??[],"logo-size");return t!==void 0&&t in jg?t:"md"}function Ak(e,t){let n=e.width/e.height,r=jg[t],i=r*n;return i>160&&(i=160,r=i/n),{width:i,height:r}}function kk(e,t){let n=ld(e);if(!(!n||!t)&&t.width>0&&t.height>0&&!(!Number.isFinite(t.width)||!Number.isFinite(t.height)))return{...Ak(t,PF(e)),assetRef:n,intrinsic:t}}function wl(e,t,n){let r=e+24,i=r+10,o=t.length*6,s=Math.max(60,o+10+10),a=r+s+6,l=a+18,c=0,u=0,f=0,d=0,p=l;return n&&(u=l+6,c=n.length*5.5,f=u-3,d=c+6,p=f+d),{labelTextWidth:o,sourceTextWidth:c,tabX:r,tabWidth:s,tabLabelX:i,badgeX:a,badgeSize:18,sourceHaloX:f,sourceHaloWidth:d,sourceTextX:u,chromeRightX:p}}var Ik="lexing-error",Rk="parsing-error";function Sk(e){if(!e||typeof e!="object")return!1;let t=e.code;return t===Ik||t===Rk}function Ni(e){let t=[];for(let n of e.parseResult.lexerErrors)t.push({origin:"lexer",error:n});for(let n of e.parseResult.parserErrors)t.push({origin:"parser",error:n});for(let n of e.diagnostics??[]){let r=n;Sk(r.data)||t.push({origin:"validation",diagnostic:r})}return t}var CF=/did you mean ['"]?([^'"?]+)['"]?\??/i;function cd(e){let t=e.match(CF);return t?t[1].trim():void 0}function ud(e){let t=e.toLowerCase();return t.includes("duplicate identifier")?"duplicate-identifier":t.includes("unknown reference")||t.includes("did you mean")?"unknown-reference":t.includes("circular")?"circular-dependency":t.includes("requires")&&t.includes("date:")?"missing-date":t.includes("duration")?"duration":t.includes("include")?"include":t.includes("indent")?"indentation":"validation"}function bk(e){if(!e||typeof e!="object")return;let t=e;if(typeof t.code=="string"&&Array.isArray(t.args))return t.code}function Ty(e){let t=bk(e.data);return t||(typeof e.code=="string"&&e.code!==""?e.code:typeof e.code=="number"?String(e.code):ud(e.message))}var Nk,Lk=()=>Nk??(Nk=cA(`{
|
|
130
130
|
"$type": "Grammar",
|
|
131
131
|
"isDeclared": true,
|
|
132
132
|
"name": "Nowline",
|
|
@@ -2913,9 +2913,9 @@ ${n}`),this.inline?`{${i}}`:i}};function $M(e,t,n){if(e==="linkplain"||e==="link
|
|
|
2913
2913
|
"imports": [],
|
|
2914
2914
|
"interfaces": [],
|
|
2915
2915
|
"types": []
|
|
2916
|
-
}`));var OF={languageId:"nowline",fileExtensions:[".nowline"],caseInsensitive:!1,mode:"development"},Pk={AstReflection:()=>new Ga},Ck={Grammar:()=>Lk(),LanguageMetaData:()=>OF,parser:{}};var Ok={item:"an item",group:"a group",parallel:"a parallel block",swimlane:"a swimlane",anchor:"an anchor",milestone:"a milestone","floating-milestone":"a milestone without a date",wave:"a wave",label:"a label",size:"a size",status:"a status",person:"a person",team:"a team",footnote:"a footnote",roadmap:"the roadmap",style:"a style",symbol:"a symbol"},$F={item:"item",group:"group",parallel:"parallel block",swimlane:"swimlane",anchor:"anchor",milestone:"milestone","floating-milestone":"milestone",wave:"wave",label:"label",size:"size",status:"status",person:"person",team:"team",footnote:"footnote",roadmap:"roadmap",style:"style",symbol:"symbol"},_y=e=>e.charAt(0).toUpperCase()+e.slice(1);function Es(e){return e.kind==="parallel-block"?`the parallel block on line ${e.line}`:e.kind==="group-block"?`the group on line ${e.line}`:`${e.kind} "${e.name}"`}function $k(e){return e.name||e.line===void 0?`"${e.name}"`:Es({kind:e.kind==="parallel"?"parallel-block":"group-block",line:e.line})}function Ay(e,t=!0){if(e.name)return`${e.kind} "${e.name}"`;let n=e.kind==="parallel"?"parallel block":e.kind,r=t?"the ":"";return e.line===void 0?`${r}${n}`:`${r}${n} on line ${e.line}`}function Dk(e){return e.name?`${_y(e.kind)} "${e.name}"`:_y(Ay(e))}function Mk(e){return e===null?"has no start floor":`opens no earlier than ${e}`}function Fk(e){return e?e.title===void 0?` Did you mean wave:${e.id}?`:` Did you mean wave:${e.id} ("${e.title}")?`:""}function Bk(e){let t=e.slice(0,5).map(r=>`"${r}"`),n=e.length-t.length;return n>0?`${t.join(", ")} and ${n} more`:t.join(", ")}function dd(e){return`[${e.join(", ")}]`}var Wk={"NL.E0001":()=>"Config section must appear before roadmap.","NL.E0002":()=>"Include declarations must appear before the config section.","NL.E0003":()=>"Include declarations must appear before the roadmap section.","NL.E0004":()=>"At least one swimlane is required.","NL.E0005":e=>`Line ${e.line}: mixed tabs and spaces in indentation. Use either tabs or spaces consistently.`,"NL.E0100":e=>`Invalid version format "${e.version}". Expected format: v1, v2, etc.`,"NL.E0101":e=>`This file requires Nowline ${e.version}, but the parser only supports up to ${e.supported}.`,"NL.E0102":e=>`Unknown directive property "${e.key}". Allowed: ${e.allowed}.`,"NL.E0103":e=>`Duplicate directive property "${e.key}".`,"NL.E0104":e=>`Invalid locale "${e.value}". Use a BCP-47 tag like "en-US", "fr", or "fr-CA".`,"NL.E0200":e=>`Invalid include mode "${e.value}". Must be merge, ignore, or isolate.`,"NL.E0201":e=>`Duplicate "${e.key}" option on include.`,"NL.E0202":e=>{switch(e.reason){case"mismatch":return`Included "${e.path}" declares waves ${dd(e.child)}, but this file's waves are ${dd(e.parent)}. Every included roadmap must declare the same waves in the same order: copy this file's wave lines into "${e.path}".`;case"child-none":return`Included "${e.path}" declares no waves, but this file's waves are ${dd(e.parent)}. Copy this file's wave lines into "${e.path}" so its work joins the waves.`;case"parent-none":return`Included "${e.path}" declares waves ${dd(e.child)}, but this file declares none. Declare the same waves here so the barriers apply to the whole roadmap.`;case"floor":return`Wave "${e.id}" in "${e.path}" ${Mk(e.childFloor)}, but this file's wave "${e.id}" ${Mk(e.parentFloor)}. A wave must have the same start floor in every included roadmap.`}},"NL.E0300":e=>`Duplicate identifier "${e.name}". First declared at ${e.location}.`,"NL.E0301":e=>`${e.type} must have an identifier, a title, or both.`,"NL.E0302":e=>`${e.key}: reference "${e.value}" does not resolve to any declared entity in this file.`,"NL.E0400":e=>`Invalid duration "${e.value}". Use a raw duration literal like 0.5d, 2w, 1m, 2q. Use "size:NAME" to reference a declared size.`,"NL.E0401":e=>`Invalid size "${e.value}". Use the id of a declared size (e.g. xs, m, lg).`,"NL.E0402":e=>`Invalid effort "${e.value}". Use a raw duration literal like 0.5d, 2w, 1m, 2q.`,"NL.E0403":e=>`Invalid remaining value "${e.value}". Use a percentage like 30% or a duration literal like 1w, 0.5d.`,"NL.E0404":e=>`Remaining must be between 0% and 100%, got ${e.value}.`,"NL.E0405":e=>`Invalid ${e.key} "${e.value}". Use ISO 8601 format: YYYY-MM-DD.`,"NL.E0406":e=>`Invalid scale "${e.value}". Use a raw duration literal like 1w, 2w, 1q (no name lookup).`,"NL.E0407":e=>`Invalid calendar "${e.value}". Must be business, full, or custom.`,"NL.E0408":e=>`Property "${e.key}" requires at least one reference.`,"NL.E0410":e=>`"${e.key}:" accepts at most one inline date per direction; collapse the multiple dates to a single binding date or use a declared anchor.`,"NL.E0411":e=>`Inline date in "${e.key}:" is not allowed on ${e.type}. Allowed only on item, parallel, and group, and on a wave's after:; for a milestone use "date:" instead.`,"NL.E0412":e=>`Inline date "${e.date}" in "${e.key}:" requires the roadmap to declare "start:". Add start:YYYY-MM-DD to the roadmap.`,"NL.E0413":e=>`Inline date "${e.date}" in "${e.key}:" is before roadmap start ${e.start}.`,"NL.E0500":e=>`Anchor "${e.name}" requires a "date:" property.`,"NL.E0501":e=>`Anchor "${e.name}" has a date but the roadmap is missing "start:". Add start:YYYY-MM-DD to the roadmap.`,"NL.E0502":e=>`Anchor "${e.name}" date ${e.date} is before roadmap start ${e.start}.`,"NL.E0503":e=>`Milestone "${e.name}" requires at least one of "date:" or "after:".`,"NL.E0504":e=>`Milestone "${e.name}" date ${e.date} is before roadmap start ${e.start}.`,"NL.E0505":()=>'Footnote requires an "on:" property referencing one or more entities.',"NL.E0600":e=>`Item "${e.name}" requires a "size:" or "duration:" property.`,"NL.E0800":e=>`Invalid non-working value "${e.value}". Use hide or show.`,"NL.E0801":e=>`Invalid color "${e.value}" for "${e.key}". Use a named color, hex value, or "none".`,"NL.E0802":e=>`Invalid value "${e.value}" for "${e.key}". Allowed: ${e.allowed}.`,"NL.E0803":e=>`Unknown style property "${e.key}".`,"NL.E0804":e=>`Raw style property "${e.key}" is not allowed on ${e.entity}. Declare a named style in config and reference it via "style:id".`,"NL.E0805":e=>`Symbol id "${e.name}" collides with a built-in icon name. Reserved built-ins: ${e.builtins}.`,"NL.E0806":e=>`Symbol "${e.name}" requires a "unicode:" property (e.g. unicode:"\u{1F4B0}" or unicode:"\\u{1F464}").`,"NL.E0807":e=>`Symbol "${e.name}" unicode: must be a non-empty value.`,"NL.E0808":e=>`Symbol "${e.name}" ascii: must be 1-3 ASCII characters (got ${e.length} character${e.length===1?"":"s"}).`,"NL.E0809":e=>`Unknown symbol property "${e.key}". Allowed: unicode, ascii, link, description.`,"NL.E0810":e=>`Duplicate symbol id "${e.name}". First declared at ${e.location}.`,"NL.E0811":e=>`${e.key}: "${e.value}" is neither a built-in (${e.builtins}) nor a declared symbol. Add "symbol ${e.value} unicode:..." earlier in config or use a quoted Unicode literal.`,"NL.E0812":e=>`${e.key}: symbol "${e.value}" is referenced before its declaration. Move "symbol ${e.value}" above this entry.`,"NL.E0900":e=>`A ${e.kind} declaration takes date:, or start: and end:, or every: with optional start: and end:.`,"NL.E0901":e=>`Unknown ${e.kind} property "${e.key}". Allowed: date, start, end, every.`,"NL.E0902":e=>`${e.key}: on a ${e.kind} declaration takes one date, not a list.`,"NL.E0903":e=>`end: ${e.end} is before start: ${e.start}.`,"NL.E0904":e=>`Invalid weekday "${e.value}". Use sun, mon, tue, wed, thu, fri or sat.`,"NL.E0905":e=>`Weekday "${e.value}" is listed more than once.`,"NL.E0906":()=>"This leaves no working day in the week with no end date. Keep at least one weekday working.","NL.E0907":e=>`Duplicate ${e.kind} id "${e.name}".`,"NL.W0700":e=>`Unknown property "${e.key}" on ${e.entity}. The renderer ignores it.${e.suggested?` Did you mean "${e.suggested}"?`:""}`,"NL.W0701":e=>`Wave "${e.id}" in "${e.path}" differs from this file's definition (${e.fields.map(t=>`${t.field} ${t.there===""?"none":`"${t.there}"`} there, ${t.here===""?"none":`"${t.here}"`} here`).join("; ")}); this file's definition is used.`,"NL.W0702":e=>`"wave:" on ${e.target.kind==="default"?`"default ${e.target.entityType}"`:!e.target.name&&e.target.line!==void 0?`the ${e.target.kind==="parallel"?"parallel block":e.target.kind} on line ${e.target.line}`:`${e.target.kind} "${e.target.name}"`} is ignored: this roadmap declares no waves. Declare waves with "wave <id>" to use it, or remove the property.`,"NL.W0703":e=>`"${e.key}" on "default ${e.entityType}" is ignored: it is a roadmap-only style key. Set it on "default roadmap" instead.`,"NL.W0704":e=>`"timeline-position:${e.position}" draws no dates: "header-height:none" removes every timeline date strip. Set header-height to xs, sm, md, lg or xl to show them.`,"NL.W0705":e=>`days-per-week is ${e.daysPerWeek}, but the week leaves ${e.working} working days.`,"NL.E1100":e=>`Wave ${e.title===void 0?`on line ${e.line}`:`"${e.title}"`} needs an explicit identifier so work can reference it with wave:<id>, e.g. wave build "Build".`,"NL.E1101":e=>{switch(e.reason){case"list":return`"wave:" takes exactly one wave id; an item belongs to at most one wave. Got "${e.value}".`;case"unknown":return`Wave "${e.value}" is not declared. Declared waves: ${e.declared.length>0?e.declared.join(", "):"none"}. Add "wave ${e.value}" above the first swimlane that uses it.${Fk(e.suggestion)}`;case"forward":return`Wave "${e.value}" is used before its declaration on line ${e.line}. Declare waves above the swimlanes that use them.`;case"not-a-wave":return`"wave:" must name a wave, but "${e.value}" is ${Ok[e.kind]}.${Fk(e.suggestion)}`}},"NL.E1102":e=>`${_y(Ay(e.entity))} has wave:${e.wave}, but its enclosing ${Ay(e.container,!1)} has wave:${e.containerWave}. A container's wave applies to everything inside it; remove one of the two wave: properties.`,"NL.E1103":e=>{switch(e.reason){case"sequence":{let t=e.items.length>1,n=`${t?"Items":"Item"} ${e.items.map(i=>`"${i}"`).join(", ")} (wave "${e.itemWave}")`,r=typeof e.ref=="string"?`"${e.ref}"`:Es(e.ref);return`${n} ${t?"come":"comes"} after ${r} (wave "${e.refWave}") in ${Es(e.flow)}. Work in a lane or group runs in order, so it must also be ordered by wave: move ${r} below "${e.last}", or change their waves.`}case"join":return`Item "${e.name}" (wave "${e.wave}") comes after ${Es(e.block)} in ${Es(e.flow)}, and that block cannot end before its track "${e.track}" (wave "${e.trackWave}") does. Move "${e.name}" above the block or into a track of its own, or change one of their waves.`;case"after-item":return e.container?`${Dk(e.container)} has after:${e.refId}, but "${e.ref}" is in later wave "${e.refWave}". Wave "${e.refWave}" cannot start until wave "${e.wave}" ends, so "${e.name}" (wave "${e.wave}") inside it could never start: move "${e.name}" to wave "${e.refWave}" or later, or remove the after:.`:`Item "${e.name}" (wave "${e.wave}") has after:${e.refId}, but "${e.ref}" is in later wave "${e.refWave}". Wave "${e.refWave}" cannot start until wave "${e.wave}" ends, so "${e.name}" could never start: move it to wave "${e.refWave}" or later, or remove the after:.`;case"after-wave":return e.container?`${Dk(e.container)} (wave "${e.wave}") has after:${e.refId}, but work cannot wait for the end of its own wave or a later one. Use an earlier wave, or move the ${e.container.kind} to a later wave.`:`Item "${e.name}" (wave "${e.wave}") has after:${e.refId}, but work cannot wait for the end of its own wave or a later one. Use an earlier wave, or move "${e.name}" to a later wave.`;case"chain":return`Item "${e.name}" (wave "${e.wave}") could never start: through ${e.chain.join(" \u2192 ")}, it waits for work that cannot start until wave "${e.wave}" has ended. Move "${e.name}" to a later wave, or break the chain.`}},"NL.E1104":e=>{switch(e.reason){case"swimlane":return`"wave:" is not allowed on swimlane "${e.name}": a swimlane spans every wave. Put wave: on its items, or wrap them in "group wave:${e.value}".`;case"milestone":return`"wave:" is not allowed on milestone "${e.name}". To place a milestone at the end of a wave, use after:${e.value}.`;case"other":return`"wave:" is not allowed on ${$F[e.type]} "${e.name}"; only item, group, and parallel can belong to a wave.`}},"NL.E1105":e=>e.reason==="before"?`"before:" is not allowed on wave "${e.name}". A wave's end comes from its items; to give a wave a deadline, add a dated milestone: milestone ${e.name}-due date:<YYYY-MM-DD> after:${e.name}.`:`"${e.key}:" is not allowed on wave "${e.name}". A wave's span comes from its items; only after: (an anchor, a dated milestone, or one ISO date) can hold back a wave's start.`,"NL.E1106":e=>`Wave "${e.name}" has after:${e.ref}, but "${e.ref}" is ${Ok[e.kind]}. A wave's after: accepts only anchors, dated milestones, or one ISO date; to make a wave wait for work, put that work in an earlier wave.`,"NL.W1000":e=>`Now-line date ${e.date} is outside the roadmap window (${e.start} \u2013 ${e.end}); it will not be drawn.`,"NL.W1002":e=>`Wave barriers did not settle after ${e.passes} layout passes, so the drawn schedule may not respect the wave order. The roadmap probably has an ordering conflict that validation did not catch.`,"NL.W1100":e=>{let t=$k(e);return e.reason==="item"?`before:${e.ref} on ${t} can never be met: ${t} is in wave "${e.wave}", which cannot start until "${e.ref}" (wave "${e.refWave}") has finished. The overrun will be painted.`:`before:${e.ref} on ${t} can never be met: ${t} is in wave "${e.wave}", which cannot finish before wave "${e.ref}" starts. The overrun will be painted.`},"NL.W1101":e=>{let t=$k(e);switch(e.reason){case"forward-lane":return`${e.key}:${e.ref} on ${t} refers to "${e.ref}", which is in a later swimlane ("${e.lane}"). Layout places swimlanes in order and ignores references to work it has not placed yet, so it ignores this ${e.key}:. Move swimlane "${e.lane}" above swimlane "${e.ownLane}", or remove the ${e.key}:.`;case"forward-flow":return`${e.key}:${e.ref} on ${t} refers to "${e.ref}", which comes later in ${Es(e.flow)}. Layout ignores references to work it has not placed yet, so it ignores this ${e.key}:. Move "${e.ref}" above ${t}, or remove the ${e.key}:.`;case"ancestor":return`${e.key}:${e.ref} on ${t} refers to "${e.ref}", which contains it. Layout ignores references to an enclosing group or parallel, so it ignores this ${e.key}:. Remove the ${e.key}:.`;case"floating-milestone":return`${e.key}:${e.ref} on ${t} refers to milestone "${e.ref}", which has no date. Floating milestones are placed after all work, so layout ignores this ${e.key}:. Reference the milestone's predecessors or a wave instead.`}},"NL.I1000":e=>`Title on item "${e.name}" is wider than its bar at this scale; it rendered to the right of the bar.`,"NL.I1001":e=>`Label chips on item "${e.name}" did not fit inside the bar; they rendered in a spill column to the right.`,"NL.I1002":e=>`Item "${e.name}" is too narrow to show its marker at this scale; decorations spilled beside the bar.`,"NL.I1003":e=>e.anchor?`Item "${e.name}" extends past its "before:" anchor "${e.anchor}".`:`Item "${e.name}" extends past its "before:" anchor.`,"NL.I1004":e=>`Swimlane "${e.lane}" packed into ${e.rows} rows to avoid overlap.`,"NL.I1005":e=>`Swimlane "${e.lane}" is over capacity in one or more periods (red utilization band).`,"NL.I1006":e=>{switch(e.reason){case"one":return`Wave "${e.name}" has no items, so it spans no time; it is drawn as a marker in the wave strip and listed in the wave legend.`;case"many":return`Waves ${Bk(e.names)} have no items, so they span no time; they are drawn as markers in the wave strip and listed in the wave legend.`;case"all":return`None of the declared waves (${Bk(e.names)}) has items yet. The wave strip shows a placeholder until work is assigned with wave:<id>.`}},"NL.I1007":e=>`Milestone "${e.name}" (${e.date}) is overrun: wave "${e.wave}" ends ${e.end}.`,"NL.I1008":e=>`Item "${e.name}" is pinned to ${e.pin} (${e.key}:), a non-working day; it starts on ${e.start}.`};var V=e=>`\xAB\xA0${e}\xA0\xBB`,Xk={item:"un \xE9l\xE9ment",group:"un groupe",parallel:"un bloc parall\xE8le",swimlane:"une swimlane",anchor:"une ancre",milestone:"un jalon","floating-milestone":"un jalon sans date",wave:"une vague",label:"une \xE9tiquette",size:"une taille",status:"un statut",person:"une personne",team:"une \xE9quipe",footnote:"une note de bas de page",roadmap:"la roadmap",style:"un style",symbol:"un symbole"},DF={item:"l'\xE9l\xE9ment",group:"le groupe",parallel:"le bloc parall\xE8le",swimlane:"la swimlane",anchor:"l'ancre",milestone:"le jalon","floating-milestone":"le jalon",wave:"la vague",label:"l'\xE9tiquette",size:"la taille",status:"le statut",person:"la personne",team:"l'\xE9quipe",footnote:"la note de bas de page",roadmap:"la roadmap",style:"le style",symbol:"le symbole"},ky=e=>e.charAt(0).toUpperCase()+e.slice(1);function ws(e){return e.kind==="parallel-block"?`le bloc parall\xE8le \xE0 la ligne ${e.line}`:e.kind==="group-block"?`le groupe \xE0 la ligne ${e.line}`:`${e.kind==="group"?"le groupe":e.kind==="parallel"?"le bloc parall\xE8le":"la swimlane"} ${V(e.name)}`}function Iy(e,t=!1){if(e.name||e.line===void 0)return t?`de ${V(e.name)}`:V(e.name);let n=ws({kind:e.kind==="parallel"?"parallel-block":"group-block",line:e.line});return t?`du ${n.slice(3)}`:n}function Ry(e){let t=e.kind==="item"?"\xE9l\xE9ment":e.kind==="group"?"groupe":"bloc parall\xE8le",n=e.kind==="item"?"l'":"le ";return e.name?`${n}${t} ${V(e.name)}`:e.line===void 0?`${n}${t}`:`${n}${t} \xE0 la ligne ${e.line}`}function Uk(e){let t=e.kind==="parallel"?"le bloc parall\xE8le":"le groupe";return e.name?`${t} ${V(e.name)}`:e.line===void 0?t:`${t} \xE0 la ligne ${e.line}`}function Gk(e){return e?e.title===void 0?` Vouliez-vous dire wave:${e.id}\xA0?`:` Vouliez-vous dire wave:${e.id} (${V(e.title)})\xA0?`:""}function Hk(e){let t=e.slice(0,5).map(V),n=e.length-t.length;return n>0?`${t.join(", ")} et ${n} autre${n>1?"s":""}`:t.join(", ")}function pd(e){return`[${e.join(", ")}]`}function zk(e){return e===null?"n'a pas de borne de d\xE9part":`ne s'ouvre pas avant ${e}`}function jk(e){return e===""?"aucun":V(e)}var MF={title:"titre",style:"style",labels:"\xE9tiquettes",link:"lien",description:"description"},Yk={"NL.E0001":()=>"La section config doit pr\xE9c\xE9der la section roadmap.","NL.E0002":()=>"Les d\xE9clarations include doivent pr\xE9c\xE9der la section config.","NL.E0003":()=>"Les d\xE9clarations include doivent pr\xE9c\xE9der la section roadmap.","NL.E0004":()=>"Au moins une swimlane est requise.","NL.E0005":e=>`Ligne ${e.line}\xA0: tabulations et espaces m\xE9lang\xE9s dans l'indentation. Utilisez l'un ou l'autre, mais pas les deux.`,"NL.E0100":e=>`Format de version invalide \xAB\xA0${e.version}\xA0\xBB. Format attendu\xA0: v1, v2, etc.`,"NL.E0101":e=>`Ce fichier requiert Nowline ${e.version}, mais l'analyseur ne prend en charge que jusqu'\xE0 ${e.supported}.`,"NL.E0102":e=>`Propri\xE9t\xE9 de directive inconnue \xAB\xA0${e.key}\xA0\xBB. Valeurs admises\xA0: ${e.allowed}.`,"NL.E0103":e=>`Propri\xE9t\xE9 de directive \xAB\xA0${e.key}\xA0\xBB en double.`,"NL.E0104":e=>`Locale invalide \xAB\xA0${e.value}\xA0\xBB. Utilisez une \xE9tiquette BCP-47 telle que \xAB\xA0en-US\xA0\xBB, \xAB\xA0fr\xA0\xBB ou \xAB\xA0fr-CA\xA0\xBB.`,"NL.E0200":e=>`Mode d'include invalide \xAB\xA0${e.value}\xA0\xBB. Doit \xEAtre merge, ignore ou isolate.`,"NL.E0201":e=>`Option \xAB\xA0${e.key}\xA0\xBB en double sur include.`,"NL.E0202":e=>{switch(e.reason){case"mismatch":return`L'include ${V(e.path)} d\xE9clare les vagues ${pd(e.child)}, mais celles de ce fichier sont ${pd(e.parent)}. Chaque roadmap incluse doit d\xE9clarer les m\xEAmes vagues dans le m\xEAme ordre\xA0: copiez les lignes wave de ce fichier dans ${V(e.path)}.`;case"child-none":return`L'include ${V(e.path)} ne d\xE9clare aucune vague, mais celles de ce fichier sont ${pd(e.parent)}. Copiez les lignes wave de ce fichier dans ${V(e.path)} pour que son travail rejoigne les vagues.`;case"parent-none":return`L'include ${V(e.path)} d\xE9clare les vagues ${pd(e.child)}, mais ce fichier n'en d\xE9clare aucune. D\xE9clarez les m\xEAmes vagues ici pour que les barri\xE8res s'appliquent \xE0 toute la roadmap.`;case"floor":return`La vague ${V(e.id)} dans ${V(e.path)} ${zk(e.childFloor)}, mais la vague ${V(e.id)} de ce fichier ${zk(e.parentFloor)}. Une vague doit avoir la m\xEAme borne de d\xE9part dans chaque roadmap incluse.`}},"NL.E0300":e=>`Identifiant en double \xAB\xA0${e.name}\xA0\xBB. Premi\xE8re d\xE9claration \xE0 ${e.location}.`,"NL.E0301":e=>`${e.type} doit comporter un identifiant, un titre, ou les deux.`,"NL.E0302":e=>`La r\xE9f\xE9rence \xAB\xA0${e.value}\xA0\xBB de \xAB\xA0${e.key}:\xA0\xBB ne d\xE9signe aucune entit\xE9 d\xE9clar\xE9e dans ce fichier.`,"NL.E0400":e=>`Dur\xE9e invalide \xAB\xA0${e.value}\xA0\xBB. Utilisez un litt\xE9ral de dur\xE9e brut comme 0.5d, 2w, 1m, 2q. Utilisez \xAB\xA0size:NOM\xA0\xBB pour r\xE9f\xE9rencer une taille d\xE9clar\xE9e.`,"NL.E0401":e=>`Taille invalide \xAB\xA0${e.value}\xA0\xBB. Utilisez l'identifiant d'une taille d\xE9clar\xE9e (p.\xA0ex. xs, m, lg).`,"NL.E0402":e=>`Effort invalide \xAB\xA0${e.value}\xA0\xBB. Utilisez un litt\xE9ral de dur\xE9e brut comme 0.5d, 2w, 1m, 2q.`,"NL.E0403":e=>`Valeur restante invalide \xAB\xA0${e.value}\xA0\xBB. Utilisez un pourcentage tel que 30% ou un litt\xE9ral de dur\xE9e comme 1w, 0.5d.`,"NL.E0404":e=>`La valeur restante doit \xEAtre comprise entre 0 % et 100 %, re\xE7u ${e.value}.`,"NL.E0405":e=>`${e.key} invalide \xAB\xA0${e.value}\xA0\xBB. Utilisez le format ISO 8601\xA0: AAAA-MM-JJ.`,"NL.E0406":e=>`\xC9chelle invalide \xAB\xA0${e.value}\xA0\xBB. Utilisez un litt\xE9ral de dur\xE9e brut comme 1w, 2w, 1q (pas de recherche par nom).`,"NL.E0407":e=>`Calendrier invalide \xAB\xA0${e.value}\xA0\xBB. Doit \xEAtre business, full ou custom.`,"NL.E0408":e=>`La propri\xE9t\xE9 \xAB\xA0${e.key}\xA0\xBB exige au moins une r\xE9f\xE9rence.`,"NL.E0410":e=>`\xAB\xA0${e.key}:\xA0\xBB n'accepte qu'une seule date inline par direction\xA0; regroupez les dates en une seule date contraignante ou utilisez une ancre d\xE9clar\xE9e.`,"NL.E0411":e=>`Une date inline dans \xAB\xA0${e.key}:\xA0\xBB n'est pas autoris\xE9e sur ${e.type}. Autoris\xE9e seulement sur item, parallel et group, et sur le \xAB\xA0after:\xA0\xBB d'une vague\xA0; pour un milestone utilisez \xAB\xA0date:\xA0\xBB \xE0 la place.`,"NL.E0412":e=>`La date inline \xAB\xA0${e.date}\xA0\xBB dans \xAB\xA0${e.key}:\xA0\xBB exige que la roadmap d\xE9clare \xAB\xA0start:\xA0\xBB. Ajoutez start:AAAA-MM-JJ \xE0 la roadmap.`,"NL.E0413":e=>`La date inline \xAB\xA0${e.date}\xA0\xBB dans \xAB\xA0${e.key}:\xA0\xBB pr\xE9c\xE8de le d\xE9but de la roadmap (${e.start}).`,"NL.E0500":e=>`L'ancre \xAB\xA0${e.name}\xA0\xBB exige une propri\xE9t\xE9 \xAB\xA0date:\xA0\xBB.`,"NL.E0501":e=>`L'ancre \xAB\xA0${e.name}\xA0\xBB a une date, mais \xAB\xA0start:\xA0\xBB manque sur la roadmap. Ajoutez start:AAAA-MM-JJ \xE0 la roadmap.`,"NL.E0502":e=>`La date ${e.date} de l'ancre \xAB\xA0${e.name}\xA0\xBB pr\xE9c\xE8de le d\xE9but de la roadmap (${e.start}).`,"NL.E0503":e=>`Le jalon \xAB\xA0${e.name}\xA0\xBB exige au moins l'une des propri\xE9t\xE9s \xAB\xA0date:\xA0\xBB ou \xAB\xA0after:\xA0\xBB.`,"NL.E0504":e=>`La date ${e.date} du jalon \xAB\xA0${e.name}\xA0\xBB pr\xE9c\xE8de le d\xE9but de la roadmap (${e.start}).`,"NL.E0505":()=>"Une note de bas de page exige une propri\xE9t\xE9 \xAB\xA0on:\xA0\xBB r\xE9f\xE9ren\xE7ant au moins une entit\xE9.","NL.E0600":e=>`L'\xE9l\xE9ment \xAB\xA0${e.name}\xA0\xBB exige une propri\xE9t\xE9 \xAB\xA0size:\xA0\xBB ou \xAB\xA0duration:\xA0\xBB.`,"NL.E0800":e=>`Valeur non-working invalide \xAB\xA0${e.value}\xA0\xBB. Utilisez hide ou show.`,"NL.E0801":e=>`Couleur invalide \xAB\xA0${e.value}\xA0\xBB pour \xAB\xA0${e.key}\xA0\xBB. Utilisez une couleur nomm\xE9e, une valeur hexad\xE9cimale ou \xAB\xA0none\xA0\xBB.`,"NL.E0802":e=>`Valeur invalide \xAB\xA0${e.value}\xA0\xBB pour \xAB\xA0${e.key}\xA0\xBB. Valeurs admises\xA0: ${e.allowed}.`,"NL.E0803":e=>`Propri\xE9t\xE9 de style inconnue \xAB\xA0${e.key}\xA0\xBB.`,"NL.E0804":e=>`La propri\xE9t\xE9 de style brute \xAB\xA0${e.key}\xA0\xBB n'est pas permise sur ${e.entity}. D\xE9clarez un style nomm\xE9 dans la config et r\xE9f\xE9rencez-le avec \xAB\xA0style:id\xA0\xBB.`,"NL.E0805":e=>`L'identifiant de symbole \xAB\xA0${e.name}\xA0\xBB entre en conflit avec le nom d'une ic\xF4ne int\xE9gr\xE9e. Noms r\xE9serv\xE9s\xA0: ${e.builtins}.`,"NL.E0806":e=>`Le symbole \xAB\xA0${e.name}\xA0\xBB exige une propri\xE9t\xE9 \xAB\xA0unicode:\xA0\xBB (p.\xA0ex. unicode:"\u{1F4B0}" ou unicode:"\\u{1F464}").`,"NL.E0807":e=>`La propri\xE9t\xE9 \xAB\xA0unicode:\xA0\xBB du symbole \xAB\xA0${e.name}\xA0\xBB doit avoir une valeur non vide.`,"NL.E0808":e=>`La propri\xE9t\xE9 \xAB\xA0ascii:\xA0\xBB du symbole \xAB\xA0${e.name}\xA0\xBB doit compter de 1 \xE0 3 caract\xE8res ASCII (re\xE7u\xA0: ${e.length} caract\xE8re${e.length>1?"s":""}).`,"NL.E0809":e=>`Propri\xE9t\xE9 de symbole inconnue \xAB\xA0${e.key}\xA0\xBB. Valeurs admises\xA0: unicode, ascii, link, description.`,"NL.E0810":e=>`Identifiant de symbole en double \xAB\xA0${e.name}\xA0\xBB. Premi\xE8re d\xE9claration \xE0 ${e.location}.`,"NL.E0811":e=>`${e.key}: \xAB\xA0${e.value}\xA0\xBB n'est ni une ic\xF4ne int\xE9gr\xE9e (${e.builtins}) ni un symbole d\xE9clar\xE9. Ajoutez \xAB\xA0symbol ${e.value} unicode:...\xA0\xBB plus haut dans la config ou utilisez un litt\xE9ral Unicode entre guillemets.`,"NL.E0812":e=>`${e.key}: le symbole \xAB\xA0${e.value}\xA0\xBB est r\xE9f\xE9renc\xE9 avant sa d\xE9claration. D\xE9placez \xAB\xA0symbol ${e.value}\xA0\xBB au-dessus de cette entr\xE9e.`,"NL.E0900":e=>`Une d\xE9claration ${e.kind} prend date:, ou start: et end:, ou every: avec start: et end: facultatifs.`,"NL.E0901":e=>`Propri\xE9t\xE9 ${e.kind} inconnue \xAB\xA0${e.key}\xA0\xBB. Autoris\xE9es\xA0: date, start, end, every.`,"NL.E0902":e=>`${e.key}: sur une d\xE9claration ${e.kind} prend une seule date, pas une liste.`,"NL.E0903":e=>`end: ${e.end} pr\xE9c\xE8de start: ${e.start}.`,"NL.E0904":e=>`Jour de semaine invalide \xAB\xA0${e.value}\xA0\xBB. Utilisez sun, mon, tue, wed, thu, fri ou sat.`,"NL.E0905":e=>`Le jour \xAB\xA0${e.value}\xA0\xBB appara\xEEt plusieurs fois.`,"NL.E0906":()=>"Il ne reste aucun jour ouvr\xE9 dans la semaine sans date de fin. Gardez au moins un jour ouvr\xE9.","NL.E0907":e=>`Identifiant ${e.kind} \xAB\xA0${e.name}\xA0\xBB en double.`,"NL.W0700":e=>`Propri\xE9t\xE9 inconnue \xAB\xA0${e.key}\xA0\xBB sur ${e.entity}. Le moteur de rendu l'ignore.${e.suggested?` Vouliez-vous dire \xAB\xA0${e.suggested}\xA0\xBB\xA0?`:""}`,"NL.W0701":e=>`La vague ${V(e.id)} dans ${V(e.path)} diff\xE8re de la d\xE9finition de ce fichier (${e.fields.map(t=>`${MF[t.field]} ${jk(t.there)} l\xE0-bas, ${jk(t.here)} ici`).join("\xA0; ")})\xA0; la d\xE9finition de ce fichier est utilis\xE9e.`,"NL.W0702":e=>`\xAB\xA0wave:\xA0\xBB sur ${e.target.kind==="default"?V(`default ${e.target.entityType}`):!e.target.name&&e.target.line!==void 0?e.target.kind==="item"||e.target.kind==="group"||e.target.kind==="parallel"?Ry({kind:e.target.kind,name:"",line:e.target.line}):`${e.target.kind} \xE0 la ligne ${e.target.line}`:`${e.target.kind} ${V(e.target.name)}`} est ignor\xE9\xA0: cette roadmap ne d\xE9clare aucune vague. D\xE9clarez des vagues avec \xAB\xA0wave <id>\xA0\xBB pour l'utiliser, ou retirez la propri\xE9t\xE9.`,"NL.W0703":e=>`${V(e.key)} sur ${V(`default ${e.entityType}`)} est ignor\xE9\xA0: c'est une cl\xE9 de style propre \xE0 la roadmap. D\xE9finissez-la plut\xF4t sur \xAB\xA0default roadmap\xA0\xBB.`,"NL.W0704":e=>`${V(`timeline-position:${e.position}`)} n'affiche aucune date\xA0: ${V("header-height:none")} retire tous les bandeaux de dates de la frise. Donnez \xE0 header-height la valeur xs, sm, md, lg ou xl pour les afficher.`,"NL.W0705":e=>`days-per-week vaut ${e.daysPerWeek}, mais la semaine laisse ${e.working} jours ouvr\xE9s.`,"NL.E1100":e=>`La vague ${e.title===void 0?`\xE0 la ligne ${e.line}`:V(e.title)} exige un identifiant explicite pour que le travail puisse la r\xE9f\xE9rencer avec wave:<id>, p.\xA0ex. wave build "Build".`,"NL.E1101":e=>{switch(e.reason){case"list":return`\xAB\xA0wave:\xA0\xBB accepte exactement un identifiant de vague\xA0; un \xE9l\xE9ment appartient \xE0 une seule vague au plus. Re\xE7u ${V(e.value)}.`;case"unknown":return`La vague ${V(e.value)} n'est pas d\xE9clar\xE9e. Vagues d\xE9clar\xE9es\xA0: ${e.declared.length>0?e.declared.join(", "):"aucune"}. Ajoutez \xAB\xA0wave ${e.value}\xA0\xBB au-dessus de la premi\xE8re swimlane qui l'utilise.${Gk(e.suggestion)}`;case"forward":return`La vague ${V(e.value)} est utilis\xE9e avant sa d\xE9claration \xE0 la ligne ${e.line}. D\xE9clarez les vagues au-dessus des swimlanes qui les utilisent.`;case"not-a-wave":return`\xAB\xA0wave:\xA0\xBB doit nommer une vague, mais ${V(e.value)} est ${Xk[e.kind]}.${Gk(e.suggestion)}`}},"NL.E1102":e=>`${ky(Ry(e.entity))} a wave:${e.wave}, mais ${Ry(e.container)} qui le contient a wave:${e.containerWave}. La vague d'un conteneur s'applique \xE0 tout ce qu'il contient\xA0; retirez l'une des deux propri\xE9t\xE9s wave:.`,"NL.E1103":e=>{switch(e.reason){case"sequence":{let t=e.items.length>1,n=`${t?"Les \xE9l\xE9ments":"L'\xE9l\xE9ment"} ${e.items.map(V).join(", ")} (vague ${V(e.itemWave)})`,r=typeof e.ref=="string"?V(e.ref):ws(e.ref);return`${n} ${t?"viennent":"vient"} apr\xE8s ${r} (vague ${V(e.refWave)}) dans ${ws(e.flow)}. Le travail d'une swimlane ou d'un groupe s'ex\xE9cute dans l'ordre, il doit donc aussi \xEAtre ordonn\xE9 par vague\xA0: d\xE9placez ${r} sous ${V(e.last)}, ou changez leurs vagues.`}case"join":return`L'\xE9l\xE9ment ${V(e.name)} (vague ${V(e.wave)}) vient apr\xE8s ${ws(e.block)} dans ${ws(e.flow)}, et ce bloc ne peut pas se terminer avant sa piste ${V(e.track)} (vague ${V(e.trackWave)}). D\xE9placez ${V(e.name)} au-dessus du bloc ou dans une piste distincte, ou changez l'une de leurs vagues.`;case"after-item":return e.container?`${ky(Uk(e.container))} a after:${e.refId}, mais ${V(e.ref)} est dans la vague ult\xE9rieure ${V(e.refWave)}. La vague ${V(e.refWave)} ne peut pas d\xE9marrer avant la fin de la vague ${V(e.wave)}, donc ${V(e.name)} (vague ${V(e.wave)}) \xE0 l'int\xE9rieur ne pourrait jamais d\xE9marrer\xA0: d\xE9placez ${V(e.name)} dans la vague ${V(e.refWave)} ou une vague ult\xE9rieure, ou retirez le after:.`:`L'\xE9l\xE9ment ${V(e.name)} (vague ${V(e.wave)}) a after:${e.refId}, mais ${V(e.ref)} est dans la vague ult\xE9rieure ${V(e.refWave)}. La vague ${V(e.refWave)} ne peut pas d\xE9marrer avant la fin de la vague ${V(e.wave)}, donc ${V(e.name)} ne pourrait jamais d\xE9marrer\xA0: d\xE9placez-le dans la vague ${V(e.refWave)} ou une vague ult\xE9rieure, ou retirez le after:.`;case"after-wave":{let t=e.container?.kind==="parallel"?"bloc parall\xE8le":"groupe";return e.container?`${ky(Uk(e.container))} (vague ${V(e.wave)}) a after:${e.refId}, mais le travail ne peut pas attendre la fin de sa propre vague ni d'une vague ult\xE9rieure. Utilisez une vague ant\xE9rieure, ou d\xE9placez le ${t} dans une vague ult\xE9rieure.`:`L'\xE9l\xE9ment ${V(e.name)} (vague ${V(e.wave)}) a after:${e.refId}, mais le travail ne peut pas attendre la fin de sa propre vague ni d'une vague ult\xE9rieure. Utilisez une vague ant\xE9rieure, ou d\xE9placez ${V(e.name)} dans une vague ult\xE9rieure.`}case"chain":return`L'\xE9l\xE9ment ${V(e.name)} (vague ${V(e.wave)}) ne pourrait jamais d\xE9marrer\xA0: via ${e.chain.join(" \u2192 ")}, il attend du travail qui ne peut pas d\xE9marrer avant la fin de la vague ${V(e.wave)}. D\xE9placez ${V(e.name)} dans une vague ult\xE9rieure, ou rompez la cha\xEEne.`}},"NL.E1104":e=>{switch(e.reason){case"swimlane":return`\xAB\xA0wave:\xA0\xBB n'est pas autoris\xE9 sur la swimlane ${V(e.name)}\xA0: une swimlane couvre toutes les vagues. Placez wave: sur ses \xE9l\xE9ments, ou regroupez-les dans \xAB\xA0group wave:${e.value}\xA0\xBB.`;case"milestone":return`\xAB\xA0wave:\xA0\xBB n'est pas autoris\xE9 sur le jalon ${V(e.name)}. Pour placer un jalon \xE0 la fin d'une vague, utilisez after:${e.value}.`;case"other":return`\xAB\xA0wave:\xA0\xBB n'est pas autoris\xE9 sur ${DF[e.type]} ${V(e.name)}\xA0; seuls item, group et parallel peuvent appartenir \xE0 une vague.`}},"NL.E1105":e=>e.reason==="before"?`\xAB\xA0before:\xA0\xBB n'est pas autoris\xE9 sur la vague ${V(e.name)}. La fin d'une vague d\xE9coule de ses \xE9l\xE9ments\xA0; pour donner une \xE9ch\xE9ance \xE0 une vague, ajoutez un jalon dat\xE9\xA0: milestone ${e.name}-due date:<AAAA-MM-JJ> after:${e.name}.`:`\xAB\xA0${e.key}:\xA0\xBB n'est pas autoris\xE9 sur la vague ${V(e.name)}. L'\xE9tendue d'une vague d\xE9coule de ses \xE9l\xE9ments\xA0; seul after: (une ancre, un jalon dat\xE9 ou une date ISO) peut retarder le d\xE9but d'une vague.`,"NL.E1106":e=>`La vague ${V(e.name)} a after:${e.ref}, mais ${V(e.ref)} est ${Xk[e.kind]}. Le after: d'une vague accepte seulement des ancres, des jalons dat\xE9s ou une date ISO\xA0; pour qu'une vague attende du travail, placez ce travail dans une vague ant\xE9rieure.`,"NL.W1002":e=>`Les barri\xE8res de vagues ne se sont pas stabilis\xE9es apr\xE8s ${e.passes} passes de mise en page\xA0; le calendrier dessin\xE9 pourrait donc ne pas respecter l'ordre des vagues. La roadmap comporte probablement un conflit d'ordre que la validation n'a pas d\xE9tect\xE9.`,"NL.W1100":e=>{let t=Iy(e);return e.reason==="item"?`before:${e.ref} sur ${t} ne peut jamais \xEAtre respect\xE9\xA0: ${t} est dans la vague ${V(e.wave)}, qui ne peut pas d\xE9marrer avant la fin de ${V(e.ref)} (vague ${V(e.refWave)}). Le d\xE9passement sera peint.`:`before:${e.ref} sur ${t} ne peut jamais \xEAtre respect\xE9\xA0: ${t} est dans la vague ${V(e.wave)}, qui ne peut pas se terminer avant le d\xE9but de la vague ${V(e.ref)}. Le d\xE9passement sera peint.`},"NL.W1101":e=>{let t=Iy(e);switch(e.reason){case"forward-lane":return`${e.key}:${e.ref} sur ${t} r\xE9f\xE9rence ${V(e.ref)}, qui se trouve dans une swimlane ult\xE9rieure (${V(e.lane)}). La mise en page place les swimlanes dans l'ordre et ignore les r\xE9f\xE9rences \xE0 du travail qu'elle n'a pas encore plac\xE9, elle ignore donc ce ${e.key}:. D\xE9placez la swimlane ${V(e.lane)} au-dessus de la swimlane ${V(e.ownLane)}, ou retirez le ${e.key}:.`;case"forward-flow":return`${e.key}:${e.ref} sur ${t} r\xE9f\xE9rence ${V(e.ref)}, qui vient plus tard dans ${ws(e.flow)}. La mise en page ignore les r\xE9f\xE9rences \xE0 du travail qu'elle n'a pas encore plac\xE9, elle ignore donc ce ${e.key}:. D\xE9placez ${V(e.ref)} au-dessus ${Iy(e,!0)}, ou retirez le ${e.key}:.`;case"ancestor":return`${e.key}:${e.ref} sur ${t} r\xE9f\xE9rence ${V(e.ref)}, qui le contient. La mise en page ignore les r\xE9f\xE9rences \xE0 un groupe ou un bloc parall\xE8le englobant, elle ignore donc ce ${e.key}:. Retirez le ${e.key}:.`;case"floating-milestone":return`${e.key}:${e.ref} sur ${t} r\xE9f\xE9rence le jalon ${V(e.ref)}, qui n'a pas de date. Les jalons sans date sont plac\xE9s apr\xE8s tout le travail, la mise en page ignore donc ce ${e.key}:. R\xE9f\xE9rencez plut\xF4t les pr\xE9d\xE9cesseurs du jalon ou une vague.`}},"NL.I1006":e=>{switch(e.reason){case"one":return`La vague ${V(e.name)} n'a aucun \xE9l\xE9ment, elle ne couvre donc aucune dur\xE9e\xA0; elle est dessin\xE9e comme un rep\xE8re dans la bande des vagues et list\xE9e dans la l\xE9gende des vagues.`;case"many":return`Les vagues ${Hk(e.names)} n'ont aucun \xE9l\xE9ment, elles ne couvrent donc aucune dur\xE9e\xA0; elles sont dessin\xE9es comme des rep\xE8res dans la bande des vagues et list\xE9es dans la l\xE9gende des vagues.`;case"all":return`Aucune des vagues d\xE9clar\xE9es (${Hk(e.names)}) n'a encore d'\xE9l\xE9ment. La bande des vagues affiche un espace r\xE9serv\xE9 jusqu'\xE0 ce que du travail soit affect\xE9 avec wave:<id>.`}},"NL.I1007":e=>`Le jalon ${V(e.name)} (${e.date}) est d\xE9pass\xE9\xA0: la vague ${V(e.wave)} se termine le ${e.end}.`,"NL.I1008":e=>`L'\xE9l\xE9ment ${V(e.name)} est \xE9pingl\xE9 \xE0 ${e.pin} (${e.key}:), un jour non ouvr\xE9\xA0; il d\xE9marre le ${e.start}.`};var Vk={};var Kk={};var FF=new Map([["en-US",Wk],["fr",Yk],["fr-CA",Vk],["fr-FR",Kk]]);function Qt(e,t,...n){for(let r of BF(e)){let o=FF.get(r)?.[t];if(o)return o(...n)}return t}var qk="en-US";function BF(e){let t=[],n=WF(e);for(;n.length>0;){t.includes(n)||t.push(n);let r=n.lastIndexOf("-");if(r<=0)break;n=n.slice(0,r)}return t.includes(qk)||t.push(qk),t}function WF(e){return e.split("-").map((n,r)=>r===0?n.toLowerCase():/^[a-zA-Z]{2}$/.test(n)?n.toUpperCase():n).join("-")}var XF=/[\\/]/;function Qk(e){for(let t=e.length-1;t>=0;t--){let n=e.charCodeAt(t);if(n===47||n===92)return t}return-1}function Zk(...e){for(let t of e)if(t){if(t.includes("\\")&&!t.includes("/"))return"\\";if(t.includes("/"))return"/"}return"/"}function UF(e){return e?e[0]==="/"||e[0]==="\\"?!0:e.length>=3&&/^[A-Za-z]:[\\/]/.test(e):!1}function eI(e){let t=Qk(e);return t<0?".":t===0?e[0]:t===2&&/^[A-Za-z]:[\\/]/.test(e)?e.slice(0,3):e.slice(0,t)}function Ts(e){let t=Qk(e);return t<0?e:e.slice(t+1)}function Sy(e,t){if(UF(t))return Jk(t,Zk(t));let n=Zk(e,t);return Jk(`${e}${n}${t}`,n)}function Jk(e,t){let n="",r=e,i=/^([A-Za-z]:)([\\/])?/.exec(r);i?(n=i[1]+(i[2]?t:""),r=r.slice(i[0].length)):(r[0]==="/"||r[0]==="\\")&&(n=t,r=r.replace(/^[\\/]+/,""));let o=[];for(let s of r.split(XF))if(!(s===""||s===".")){if(s===".."){o.length>0&&o[o.length-1]!==".."?o.pop():n||o.push("..");continue}o.push(s)}return n+o.join(t)}function kt(e){return/[\r\n]/.test(e)?e.replace(/\s*[\r\n]+\s*/g," ").trim():e}function tI(e,t,n){if(e===t)return 0;let r=e.length,i=t.length;if(Math.abs(r-i)>n)return n+1;if(r===0)return i;if(i===0)return r;let o=new Array(i+1),s=new Array(i+1);for(let a=0;a<=i;a++)o[a]=a;for(let a=1;a<=r;a++){s[0]=a;let l=a;for(let u=1;u<=i;u++){let f=e.charCodeAt(a-1)===t.charCodeAt(u-1)?0:1;s[u]=Math.min(o[u]+1,s[u-1]+1,o[u-1]+f),s[u]<l&&(l=s[u])}if(l>n)return n+1;let c=o;o=s,s=c}return o[i]}function nI(e,t,n=2){let r,i=n+1;for(let o of t){let s=tI(e,o,n);if(s<i&&(r=o,i=s,s===0))break}return r}function rI(e,t,n=2){let r,i=n+1,o=!1;for(let s of t){let a=tI(e,s,n);a<i?(r=s,i=a,o=!1):a===i&&a<=n&&s!==r&&(o=!0)}return o?void 0:r}function Re(e){return e.name??(e.title===void 0?"<unnamed>":kt(e.title))}function Mr(e){return e.$type==="NonWorkingDeclaration"?"non-working":e.$type.replace(/Declaration$|Block$/,"").toLowerCase()}function vl(e){let t=Mr(e),n=e.name??(e.title===void 0?void 0:kt(e.title));return n?`${t} "${n}"`:t}function gn(e){let t=e.$cstNode;return t?t.range.start.line+1:0}function hd(e,t){return`"${e}" cannot be set on "default ${t}". Identity-defining, sizing, sequencing, reference, and prose properties must be explicit on each entity.`}function en(e){let t=new Set,n=[];for(let r of e.roadmapEntries)!Tt(r)||!r.name||t.has(r.name)||(t.add(r.name),n.push(r));return n}function GF(e){let t=new Map;return en(e).forEach((n,r)=>{t.set(n.name,r+1)}),t}function oI(e){return(e.properties??[]).filter(n=>Q(n)==="wave")}function sI(e){return oI(e)[0]}function by(e){return e.value!==void 0?e.value:e.values.length===1?e.values[0]:`[${e.values.join(", ")}]`}function HF(e){let t=e;for(;t?.$container&&!ss(t.$container);)t=t.$container;let n=t?.$container;if(!(!t||!n||!ss(n)))return{file:n,index:n.roadmapEntries.indexOf(t),waveDecls:aI(n)}}function aI(e){let t=new Map;return e.roadmapEntries.forEach((n,r)=>{Tt(n)&&n.name&&!t.has(n.name)&&t.set(n.name,r)}),t}function Ny(e,t,n,r=HF(t)){let i=by(e);if(e.value===void 0&&e.values.length!==1)return{status:"list",value:i};let o=n.get(i);if(o===void 0)return{status:"missing",value:i};if(r){let s=r.waveDecls.get(i);if(s!==void 0&&(r.index<0||s>r.index))return{status:"forward",value:i,line:gn(r.file.roadmapEntries[s])}}return{status:"valid",id:i,index:o}}function zF(e){return $e(e)||tt(e)}function jF(e,t,n,r){let i=sI(e);if(!i)return t;let o=Ny(i,e,n,r);if(o.status==="valid")return t??o.index}function md(e,t){let n=new Map,r=new Map,i=new Map,o=(s,a,l)=>{let c=jF(s,a,t,l);c!==void 0&&n.set(s,c);let u=c;if($e(s)||tt(s)){let f=[];for(let d of vt(s))f.push(o(d,c,l));c===void 0&&($e(s)?u=f[0]:f.length>0&&!f.includes(void 0)&&(u=Math.min(...f)))}return u!==void 0&&r.set(s,u),u};for(let s of e){let a,l=s.$container;if(ss(l)){let c=i.get(l);c||(c=aI(l),i.set(l,c)),a={file:l,index:l.roadmapEntries.indexOf(s),waveDecls:c}}for(let c of vt(s))o(c,void 0,a)}return{waveOf:n,leadOf:r}}function lI(e){return(e.properties??[]).find(n=>Q(n)==="date")?.value}function vs(e){let t=EA(e);return n=>t.get(n)}function Al(e,t){let n=null;for(let r of e.properties){if(Q(r)!=="after")continue;let i=r.value!==void 0?[r.value]:r.values;for(let o of i){if(!o)continue;let s;if(ot.test(o))s=o;else{let a=t(o);(os(a)||pn(a))&&(s=lI(a))}s===void 0||!He(s)||(n===null||s>n.date)&&(n={date:s,ref:o})}}return n}var cI=new Set(["before","date","start","length","duration","size","capacity","remaining","wave"]);function Li(e){return Tt(e.$container)&&cI.has(Q(e))}var YF={ItemDeclaration:"item",GroupBlock:"group",ParallelBlock:"parallel",SwimlaneDeclaration:"swimlane",AnchorDeclaration:"anchor",MilestoneDeclaration:"milestone",WaveDeclaration:"wave",LabelDeclaration:"label",SizeDeclaration:"size",StatusDeclaration:"status",PersonDeclaration:"person",TeamDeclaration:"team",FootnoteDeclaration:"footnote",RoadmapDeclaration:"roadmap",StyleDeclaration:"style",SymbolDeclaration:"symbol"};function _l(e){return YF[e.$type]??Mr(e)}function VF(e,t){let n=[],r=Re(e),i=!e.name&&e.title===void 0;if(e.name||n.push({severity:"error",code:"NL.E1100",args:{...e.title===void 0?{}:{title:kt(e.title)},line:gn(e)},node:e}),i)return n;for(let o of e.properties){let s=Q(o);if(cI.has(s)){n.push({severity:"error",code:"NL.E1105",args:s==="before"?{reason:"before",name:r}:{reason:"other",key:s,name:r},node:o,property:"key"});continue}if(s!=="after")continue;let a=o.value!==void 0?[o.value]:o.values;for(let l of a){if(!l||ot.test(l))continue;let c=t(l);if(!(!c||os(c))){if(pn(c)){if(lI(c)!==void 0)continue;n.push({severity:"error",code:"NL.E1106",args:{name:r,ref:l,kind:"floating-milestone"},node:o});continue}n.push({severity:"error",code:"NL.E1106",args:{name:r,ref:l,kind:_l(c)},node:o})}}}return n}function gd(e){let t=vs(e);return e.roadmapEntries.filter(Tt).flatMap(n=>VF(n,t))}function KF(e){return[...On(e,{config:!0,roadmap:!0})].filter(t=>dA(t)?nt(t):!Tt(t))}function qF(e,t){let n=e.toLowerCase(),r=t.filter(o=>o.title!==void 0&&kt(o.title).toLowerCase()===n),i;if(r.length===1)i=r[0];else{let o=rI(e,t.map(s=>s.name));i=o===void 0?void 0:t.find(s=>s.name===o)}if(i)return i.title===void 0?{id:i.name}:{id:i.name,title:kt(i.title)}}function ZF(e,t,n){let r=n(t);if(r)return _l(r);for(let i of e.configEntries)if((Dt(i)||xi(i))&&i.name===t)return _l(i)}function JF(e,t){let n=e.$container;for(;zF(n);){let r=sI(n);if(r)return Ny(r,n,t).status==="valid"?{container:n,prop:r}:void 0;n=n?.$container}}function iI(e,t){let n=t.name??(t.title===void 0?"":kt(t.title));return n?{kind:e,name:n}:{kind:e,name:n,line:gn(t)}}function QF(e){if(nt(e))return{kind:"default",entityType:e.entityType};let t=e,n=t.name??(t.title===void 0?"":kt(t.title)),r=_l(e);return n?{kind:r,name:n}:{kind:r,name:n,line:gn(e)}}function e2(e,t,n,r,i,o){let s=Ny(n,t,i);switch(s.status){case"list":return{severity:"error",code:"NL.E1101",args:{reason:"list",value:s.value},node:n};case"forward":return{severity:"error",code:"NL.E1101",args:{reason:"forward",value:s.value,line:s.line},node:n};case"missing":{let u=ZF(e,s.value,o),f=qF(s.value,r);return{severity:"error",code:"NL.E1101",args:u===void 0?{reason:"unknown",value:s.value,declared:r.map(d=>d.name),...f?{suggestion:f}:{}}:{reason:"not-a-wave",value:s.value,kind:u,...f?{suggestion:f}:{}},node:n}}case"valid":break}let a=JF(t,i);if(!a)return;let l=by(a.prop);if(l===s.id)return;let c=Ke(t)?"item":$e(t)?"group":"parallel";return{severity:"error",code:"NL.E1102",args:{entity:iI(c,t),wave:s.id,container:iI($e(a.container)?"group":"parallel",a.container),containerWave:l},node:n}}function yd(e){let t=en(e),n=t.length>0,r=GF(e),i=vs(e),o=[];for(let s of KF(e)){let a=oI(s);if(a.length===0)continue;if(!n){for(let m of a)o.push({severity:"warning",code:"NL.W0702",args:{target:QF(s)},node:m,property:"key"});continue}if(nt(s)){for(let m of a)o.push({severity:"error",message:hd("wave",s.entityType),node:m});continue}let l=s,c=Re(l);if(!l.name&&l.title===void 0&&!Ke(s)&&!$e(s)&&!tt(s))continue;if(qe(s)||pn(s)){for(let m of a)o.push({severity:"error",code:"NL.E1104",args:{reason:qe(s)?"swimlane":"milestone",name:c,value:by(m)},node:m});continue}if(!Ke(s)&&!$e(s)&&!tt(s)){for(let m of a)o.push({severity:"error",code:"NL.E1104",args:{reason:"other",type:_l(s),name:c},node:m});continue}let[f,...d]=a,p=e2(e,s,f,t,r,i);if(p&&o.push(p),d.length>0){let m=a.flatMap(g=>g.value!==void 0?[g.value]:g.values);for(let g of d)o.push({severity:"error",code:"NL.E1101",args:{reason:"list",value:`[${m.join(", ")}]`},node:g})}}return o}var t2=["after-wave","after-item","sequence","join"];function Pi(e){return e.name??(e.title===void 0?void 0:kt(e.title))}function xd(e){let t=Pi(e);if(qe(e))return{kind:"swimlane",name:Re(e)};let n=$e(e);return t?{kind:n?"group":"parallel",name:t}:{kind:n?"group-block":"parallel-block",line:gn(e)}}function uI(e){let t=Pi(e);return t!==void 0||e.$type==="ItemDeclaration"?t:{kind:$e(e)?"group-block":"parallel-block",line:gn(e)}}function fI(e){return e.$type==="ItemDeclaration"||Pi(e)!==void 0?{name:Re(e)}:{name:"",kind:$e(e)?"group":"parallel",line:gn(e)}}function n2(e){let t=$e(e)?"group":"parallel",n=Pi(e);return n?{kind:t,name:n}:{kind:t,name:"",line:gn(e)}}function Ly(e){return(e.value!==void 0?[e.value]:e.values).filter(t=>!!t)}function r2(e){return pn(e)&&!e.properties.some(t=>Q(t)==="date")}function _s(e,t,n={}){if(t.length===0)return[];let r=new Map;t.forEach((k,O)=>{k.name&&r.set(k.name,O+1)});let i=k=>t[k-1]?.name??"",{lanes:o,lookup:s}=e,{waveOf:a,leadOf:l}=md(o,r),c=[],u=new Map,f=0,d=(k,O,X,U)=>{let K=c.length,q={node:k,lane:O,parent:X,children:[],prev:U,start:f++,reg:-1,ew:a.get(k),lw:l.get(k),after:[],afterWaves:[]};if(c.push(q),$e(k)||tt(k)){let J=-1;for(let ie of vt(k))J=d(ie,O,K,$e(k)?J:-1),q.children.push(J);q.reg=f++}else q.reg=q.start;if(k.name){let J=u.get(k.name)??[];J.push(K),u.set(k.name,J)}return K};o.forEach((k,O)=>{let X=-1;for(let U of vt(k))X=d(U,O,-1,X)});let p=(k,O)=>{let X=u.get(k);if(X){for(let U=X.length-1;U>=0;U--)if(c[X[U]].reg<c[O].start)return X[U]}},m=[],g=n.suppressCycleRefs??!0?o2(c,o,s):()=>!1;for(let k=0;k<c.length;k++){let O=c[k],X=fI(O.node);for(let U of O.node.properties){let K=Q(U);if(!(K!=="after"&&K!=="before"))for(let q of Ly(U)){if(ot.test(q))continue;let J=p(q,k),ie=J===void 0?r.get(q):void 0;if(K==="after"&&(J!==void 0?O.after.push({from:J,prop:U,ref:q}):ie!==void 0&&O.afterWaves.push({prop:U,ref:q,j:ie})),J!==void 0||ie!==void 0)continue;let ge=u.get(q)?.[0];if(ge===void 0&&!r2(s(q))||g(O.node.name,K,q))continue;let fe=!1;for(let de=O.parent;de>=0&&!fe;de=c[de].parent)fe=c[de].node.name===q;m.push({severity:"warning",code:"NL.W1101",args:ge===void 0?{reason:"floating-milestone",key:K,ref:q,...X}:fe?{reason:"ancestor",key:K,ref:q,...X}:c[ge].lane!==O.lane?{reason:"forward-lane",key:K,ref:q,...X,lane:Re(o[c[ge].lane]),ownLane:Re(o[O.lane])}:{reason:"forward-flow",key:K,ref:q,...X,flow:xd(i2(c,o,k,ge))},node:U})}}}let w=new Array(c.length),x=new Array(c.length);for(let k=c.length-1;k>=0;k--){let O=c[k];if(O.node.$type==="ItemDeclaration"){w[k]=O.ew,x[k]=O.ew;continue}for(let X of O.children){let U=w[X],K=x[X];U!==void 0&&(w[k]=Math.max(w[k]??U,U)),K!==void 0&&(x[k]=Math.min(x[k]??K,K))}}for(let k=0;k<c.length;k++){let O=w[k];if(O===void 0)continue;let X=fI(c[k].node);for(let U of c[k].node.properties)if(Q(U)==="before")for(let K of Ly(U)){if(ot.test(K))continue;let q=p(K,k);if(q!==void 0){let ie=x[q];if(ie===void 0||O<=ie)continue;m.push({severity:"warning",code:"NL.W1100",args:{reason:"item",ref:K,...X,wave:i(O),refWave:i(ie)},node:U});continue}let J=r.get(K);J===void 0||O<J||m.push({severity:"warning",code:"NL.W1100",args:{reason:"wave",ref:K,...X,wave:i(O)},node:U})}}let y=k=>c[k].node.$type!=="ItemDeclaration",T=k=>{let{parent:O}=c[k];return O<0?!1:tt(c[O].node)||c[O].children[0]===k},E=new Array(c.length).fill(0),v=new Array(c.length).fill(0),S=k=>{let O=c[k],X=[];O.lw!==void 0&&X.push({term:{kind:O.ew!==void 0?"wave":"lead"},value:O.lw-1});for(let U of O.afterWaves)X.push({term:{kind:"after-wave",prop:U.prop,ref:U.ref},value:U.j});T(k)&&X.push({term:{kind:"parent",from:O.parent},value:E[O.parent]}),O.prev>=0&&X.push({term:{kind:"seq",from:O.prev},value:v[O.prev]});for(let U of O.after)X.push({term:{kind:"after",from:U.from,prop:U.prop,ref:U.ref},value:v[U.from]});return X},F=k=>{let O=E[k];for(let X of c[k].children)O=Math.max(O,v[X]);return O},C=c.map((k,O)=>[2*O+1]),W=c.map(()=>[]);for(let k=0;k<c.length;k++){let O=c[k];T(k)&&C[O.parent].push(2*k),O.prev>=0&&W[O.prev].push(2*k);for(let X of O.after)W[X.from].push(2*k);O.parent>=0&&W[k].push(2*O.parent+1)}let j=[],P=new Array(2*c.length).fill(!0);for(let k=0;k<c.length;k++)j.push(2*k,2*k+1);for(let k=0;k<j.length;k++){let O=j[k];P[O]=!1;let X=O>>1,U=(O&1)===1,K=U?F(X):Math.max(0,...S(X).map(q=>q.value));if(!(K<=(U?v[X]:E[X]))){U?v[X]=K:E[X]=K;for(let q of U?W[X]:C[X])P[q]||(P[q]=!0,j.push(q))}}let R=(k,O)=>S(k).filter(X=>X.value===O).map(X=>X.term),N=(k,O)=>{if(!y(k))return[{kind:"start"}];let X=c[k].children.filter(U=>v[U]===O).map(U=>({kind:"child",from:U}));return X.length>0?$e(c[k].node)?X.reverse():X:E[k]===O?[{kind:"start"}]:[]},$=(k,O)=>{let X=[{i:k,via:k}];for(;X.length>0;){let{i:U,via:K}=X.pop(),q=N(U,O);for(let J=q.length-1;J>=0;J--){let ie=q[J];if(ie.kind==="start"){let ge=c[U].ew;if(ge!==void 0&&ge-1===O)return{origin:U,via:K}}else ie.kind==="child"&&X.push({i:ie.from,via:U===k?ie.from:K})}}},I=(k,O)=>{let X=c[k].ew;return X!==void 0&&X-1===O},A=(k,O)=>{let X=k;for(;c[X].prev>=0||T(X);){let U=c[X].prev;if(U<0){X=c[X].parent;continue}let K=c[U].ew;if(K!==void 0&&K>O)return U;X=U}},_=new Map,D=[],L=new Map,B=(k,O,X)=>`${k}:${c[k].node.properties.indexOf(O)}:${X}`,z=(k,O)=>{let X=[],U=k;for(;;){let K=R(U,O);for(let J of K)if(J.kind==="after-wave")X.push({variant:"after-wave",owner:U,prop:J.prop,ref:J.ref});else if(J.kind==="after")I(J.from,O)&&X.push({variant:"after-item",owner:U,prop:J.prop,ref:J.ref});else if(J.kind==="seq"){let ie=J.from,ge=c[ie].node;if(tt(ge)&&c[ie].ew===void 0){let fe=$(ie,O),de=fe&&(Pi(c[fe.via].node)??Pi(c[fe.origin].node));de&&X.push({variant:"join",owner:U,block:ie,track:de})}else if(I(ie,O)){let fe=uI(ge);fe&&X.push({variant:"sequence",owner:U,pred:ie,ref:fe})}}let q=K.find(J=>J.kind==="parent");if(!q)break;U=q.from}for(let K of t2){let q=X.find(J=>J.variant===K);if(q)return q}},G=(k,O)=>{let X=[{key:2*k,from:-1}],U=new Set([2*k]),K,q=(J,ie)=>{U.has(J)||(U.add(J),X.push({key:J,from:ie}))};for(let J=0;J<X.length;J++){let ie=X[J].key>>1;if(ie!==k&&_.has(ie)){K??(K=ie);continue}if((X[J].key&1)===1){for(let de of N(ie,O))de.kind==="start"?q(2*ie,J):de.kind==="child"&&q(2*de.from+1,J);continue}let ge=R(ie,O),fe=ge.find(de=>de.kind==="wave"||de.kind==="lead")??ge.find(de=>de.kind==="after-wave");if(fe){let de=[];for(let ht=J;ht>=0;ht=X[ht].from){let mt=X[ht].key>>1;de[de.length-1]!==mt&&de.push(mt)}let rt=Re(c[ie].node);return{path:de,origin:fe.kind==="after-wave"?`${rt} (after:${fe.ref})`:`${rt} (wave "${i(O+1)}")`}}for(let de of ge)de.kind==="parent"?q(2*de.from,J):(de.kind==="seq"||de.kind==="after")&&q(2*de.from+1,J)}return{hit:K}},ee=(k,O,X,U)=>{let K=Re(c[O].node),q=i(X),J=i(U+1),ie=c[k.owner].node,ge=k.owner===O?void 0:n2(ie);switch(k.variant){case"after-wave":{let fe=c[k.owner].ew===void 0?void 0:ge;return{node:k.prop,run:[O],build:()=>({reason:"after-wave",name:K,wave:q,refId:k.ref,...fe?{container:fe}:{}})}}case"after-item":return{node:k.prop,run:[O],build:()=>({reason:"after-item",name:K,wave:q,refId:k.ref,ref:k.ref,refWave:J,...ge?{container:ge}:{}})};case"join":{let fe=c[k.block];return{node:c[O].node,run:[O],build:()=>({reason:"join",name:K,wave:q,block:xd(fe.node),flow:xd(dI(c,o,k.block)),track:k.track,trackWave:J})}}case"sequence":{let fe=k.pred,de=c[fe].parent,rt=ht=>{if(de<0)return c[ht].lane===c[fe].lane;for(let mt=c[ht].parent;mt>=0;mt=c[mt].parent)if(mt===de)return!0;return!1};return{node:c[O].node,run:[O],build:ht=>{let mt=ht.filter(rt);return{reason:"sequence",items:mt.map(Yl=>Re(c[Yl].node)),itemWave:q,ref:k.ref,refWave:i(c[fe].ew??U+1),flow:xd(dI(c,o,fe)),last:Re(c[mt[mt.length-1]].node)}},seq:{pred:fe,ref:k.ref,inFlow:rt}}}}},Y=(k,O)=>(D.push(O),k!==void 0&&L.set(k,O),O),ne=(k,O,X,U)=>{let K=k.variant==="sequence"?`sequence:${k.pred}:${X}`:k.variant==="join"?`join:${k.block}:${X}`:`${k.variant}:${B(k.owner,k.prop,k.ref)}`,q=L.get(K);return q?(q.run.push(O),q):Y(K,ee(k,O,X,U))};for(let k=0;k<c.length;k++){let O=c[k],X=O.ew;if(O.node.$type!=="ItemDeclaration"||X===void 0||E[k]<X)continue;let U=E[k],K=z(k,U),q;if(K)q=ne(K,k,X,U);else{let J=G(k,U);if("path"in J){let ie=J.path.slice(1).filter(rt=>!y(rt)||Pi(c[rt].node)!==void 0).map(rt=>Re(c[rt].node)),ge=[J.origin,...ie.filter((rt,ht)=>ie[ht-1]!==rt)],fe=Re(O.node),de=i(X);q=Y(void 0,{node:O.node,run:[k],build:()=>({reason:"chain",name:fe,wave:de,chain:ge})})}else{let ie=J.hit===void 0?void 0:_.get(J.hit),ge=ie?.seq;if(ge?.inFlow(k)){let fe=A(k,X),de=fe===void 0?void 0:uI(c[fe].node),rt=fe!==void 0&&de!==void 0?{variant:"sequence",owner:k,pred:fe,ref:de}:{variant:"sequence",owner:k,pred:ge.pred,ref:ge.ref};q=ne(rt,k,X,U)}else q=ie,q?.run.push(k)}}q&&_.set(k,q)}for(let k of D)m.push({severity:"error",code:"NL.E1103",args:k.build(k.run),node:k.node});return m}function dI(e,t,n){let r=e[n].parent;return r<0?t[e[n].lane]:e[r].node}function i2(e,t,n,r){let i=new Set;for(let o=e[r].parent;o>=0;o=e[o].parent)i.add(o);for(let o=e[n].parent;o>=0;o=e[o].parent)if(i.has(o))return e[o].node;return t[e[n].lane]}function o2(e,t,n){let r=new Map,i=(c,u)=>{let f=r.get(c)??new Set;f.add(u),r.set(c,f)},o=[],s=(c,u)=>{if(c)for(let f of u){let d=Q(f);if(!(d!=="after"&&d!=="before"))for(let p of Ly(f))ot.test(p)||(d==="after"?i(c,p):i(p,c),o.push(p))}};for(let c of t)s(c.name,c.properties);for(let c of e)s(c.node.name,c.node.properties);let a=new Set;for(;o.length>0;){let c=o.pop();if(a.has(c))continue;a.add(c);let u=n(c);pn(u)&&s(u.name,u.properties)}let l=(c,u)=>{let f=new Set([c]),d=[c];for(;d.length>0;){let p=d.pop();if(p===u)return!0;for(let m of r.get(p)??[])f.has(m)||(f.add(m),d.push(m))}return!1};return(c,u,f)=>c?u==="after"?l(f,c):l(c,f):!1}function As(e){return t=>e.anchors.get(t)??e.milestones.get(t)??e.waves?.get(t)}function Il(e){let t=e.$document?.parseResult;return!!t&&(t.lexerErrors.length>0||t.parserErrors.length>0)}function hI(e,t,n){return n||Il(e)?!1:!!e.roadmapDecl||t.swimlanes.size>0||en(e).length>0}function kl(e,t){if(!e.$cstNode)return{};let{start:n,end:r}=qm({node:e,...t===void 0?{}:{property:t}});return{line:n.line,range:{start:{line:n.line,character:n.character},end:{line:r.line,character:r.character}}}}function Ci(e,t,n,r,...i){return{severity:e,message:Qt("en-US",r,...i),sourcePath:t,...n,code:r,args:i,rule:"wave"}}function Ed(e){return e.map(t=>t.name)}function pI(e){let t=n=>{let r=e.properties.find(i=>Q(i)===n);return r?r.value??r.values.join(", "):""};return{title:e.title===void 0?"":kt(e.title),style:t("style"),labels:t("labels"),link:t("link"),description:e.description?kt(e.description.text):""}}var s2=["title","style","labels","link","description"];function mI(e,t,n){let r={diagnostics:[],failed:!1};if(n.mode==="ignore"||!n.participates||n.childFile.roadmapEntries.some(p=>Tt(p)&&!p.name))return r;let i=n.parentAbs,o=kl(n.inc),s=n.childRelPath,a=en(e),l=en(n.childFile),c=p=>({diagnostics:[p],failed:!0});if(a.length===0&&l.length===0)return r;if(l.length===0)return c(Ci("error",i,o,"NL.E0202",{reason:"child-none",path:s,parent:Ed(a)}));if(a.length===0)return c(Ci("error",i,o,"NL.E0202",{reason:"parent-none",path:s,child:Ed(l)}));if(a.length!==l.length||a.some((p,m)=>p.name!==l[m].name))return c(Ci("error",i,o,"NL.E0202",{reason:"mismatch",path:s,child:Ed(l),parent:Ed(a)}));let u=As(t),f=As(n.childContent);for(let p=0;p<a.length;p++){let m=Al(a[p],u)?.date??null,g=Al(l[p],f)?.date??null;if(m!==g)return c(Ci("error",i,o,"NL.E0202",{reason:"floor",id:a[p].name,path:s,childFloor:g,parentFloor:m}))}let d=[];for(let p=0;p<a.length;p++){let m=pI(a[p]),g=pI(l[p]),w=s2.filter(x=>m[x]!==g[x]).map(x=>({field:x,there:g[x],here:m[x]}));w.length!==0&&d.push(Ci("warning",i,o,"NL.W0701",{id:a[p].name,path:s,fields:w}))}return{diagnostics:d,failed:!1}}function a2(e){let t=e;for(;t&&!ss(t);)t=t.$container;return t}function gI(e){let{rootFile:t,rootAbs:n,rootContent:r,files:i,edges:o,failed:s}=e,a=[],l=new Set,c=v=>{let S=JSON.stringify([v.sourcePath,v.line,v.code,v.args,v.message]);l.has(S)||(l.add(S),a.push(v))},u=v=>{let S=a2(v);return S?i.get(S):void 0},f=(v,S)=>{let F=kl(v.node,v.property);return"message"in v?{severity:v.severity,message:v.message,sourcePath:S,...F,rule:"wave"}:Ci(v.severity,S,F,v.code,v.args)},d=[],p=new Set([n]),m=v=>{for(let S of o.get(v)??[])S.mode==="ignore"||!S.participates||p.has(S.childAbs)||(p.add(S.childAbs),s.has(S.childAbs)||d.push({file:S.childFile,abs:S.childAbs}),m(S.childAbs))};m(n);let g=en(t),w=new Map(g.map(v=>[v.name,v]));for(let{file:v,abs:S}of d){for(let C of gd(v))c(f(C,S));for(let C of yd(v))c(f(C,S));if(w.size===0)continue;let F=(C,W)=>{let j=C===void 0?void 0:w.get(C);if(!j||Tt(W))return;let P=j.$cstNode?j.$cstNode.range.start.line+1:0;c(Ci("error",S,kl(W),"NL.E0300",{name:C,location:`${Ts(n)}:${P}`}))};v.roadmapDecl&&F(v.roadmapDecl.name,v.roadmapDecl);for(let C of v.roadmapEntries)Df(C,F);for(let C of v.configEntries)Dt(C)&&F(C.name,C)}if(g.length===0)return a;let x=v=>"message"in v?v.message:`${v.code}\0${JSON.stringify(v.args)}`,y=new Map,T={lanes:t.roadmapEntries.filter(qe),lookup:vs(t)};for(let v of _s(T,g,{suppressCycleRefs:!1})){let S=y.get(v.node)??new Set;S.add(x(v)),y.set(v.node,S)}let E=v=>{for(let S of v){if(y.get(S.node)?.has(x(S)))continue;let F=u(S.node);F===void 0||s.has(F)||c(f(S,F))}};E(_s({lanes:[...r.swimlanes.values()],lookup:As(r)},g,{suppressCycleRefs:!1}));for(let v of r.isolatedRegions){let S=v.content.roadmap?u(v.content.roadmap):void 0;if(S!==void 0&&s.has(S))continue;let F=[...v.content.waves?.values()??[]];F.length!==0&&E(_s({lanes:[...v.content.swimlanes.values()],lookup:As(v.content)},F,{suppressCycleRefs:!1}))}return a}function wd(e){let t=xA(e),n=[];for(let r of e.roadmapEntries)$f(r,i=>{let o=Q(i);if(o!=="after"&&o!=="before"&&o!=="on"||Li(i))return;let s=i.value?[i.value]:i.values;for(let a of s)a&&((o==="after"||o==="before")&&ot.test(a)||t.has(a)||n.push({prop:i,key:o,value:a}))});return n}function yI(e,t){let n=[],r=new Set([e]),i=o=>{for(let s of t.get(o)??[])if(!(s.mode==="ignore"||r.has(s.childAbs))){if(r.add(s.childAbs),!Il(s.childFile))for(let{prop:a,key:l,value:c}of wd(s.childFile)){let u=[{key:l,value:c}];n.push({severity:"error",message:Qt("en-US","NL.E0302",...u),sourcePath:s.childAbs,...kl(a),code:"NL.E0302",args:u})}i(s.childAbs)}};return i(e),n}function wI(e){let t=e?.properties.find(n=>n.key==="start");if(!(!t?.value||!He(t.value)))return t.value}function c2(e,t,n){return t&&n?`Included "${e}" declares start:${n}, which doesn't match this file's start:${t}. Both files must declare the same start date, or neither should.`:t?`Included "${e}" has no start:, but this file declares start:${t}. Both files must declare the same start date, or neither should.`:`Included "${e}" declares start:${n}, but this file has no start:. Both files must declare the same start date, or neither should.`}function Fr(e){return e.code!==void 0||e.rule==="wave"||e.syntax!==void 0}function TI(){return{styles:new Map,defaults:new Map,symbols:new Map,calendarDeclarations:[]}}function vI(){return{persons:new Map,teams:new Map,anchors:new Map,labels:new Map,sizes:new Map,statuses:new Map,swimlanes:new Map,milestones:new Map,footnotes:new Map,isolatedRegions:[]}}async function Cy(e,t,n){let r=n.readFile??(async l=>{let{nodeReadFile:c}=await Promise.resolve().then(()=>(EI(),xI));return c(l)}),i=Sy("",t),o={services:n.services,rootAbs:i,diagnostics:[],resolving:[],processed:new Map,readFile:r,files:new Map,edges:new Map,stubs:new Set,failedWaves:new Set},{config:s,content:a}=await kI(e,i,o);return o.diagnostics.push(...gI({rootFile:e,rootAbs:i,rootContent:a,files:o.files,edges:o.edges,failed:o.failedWaves})),o.diagnostics.push(...yI(i,o.edges)),{config:s,content:a,diagnostics:o.diagnostics,processedFiles:new Set(o.processed.keys())}}async function kI(e,t,n){if(n.processed.has(t))return n.processed.get(t);if(n.resolving.includes(t)){n.diagnostics.push({severity:"error",message:`Circular include detected: ${[...n.resolving,t].join(" \u2192 ")}`,sourcePath:t});let c={config:TI(),content:vI()};return n.stubs.add(c.content),n.processed.set(t,c),c}t!==n.rootAbs&&n.diagnostics.push(...u2(e,t)),n.resolving.push(t),n.files.set(e,t);let r=TI(),i=vI();g2(r,e),w2(i,e);let o=en(e);o.length>0&&(i.waves=new Map(o.map(c=>[c.name,c])));let s=[];n.edges.set(t,s);let a=new Set;for(let c of e.includes){let u=c.path,f=Sy(eI(t),u);if(a.has(f)){n.diagnostics.push({severity:"error",message:`Duplicate include "${u}" in ${Ts(t)}.`,sourcePath:t,line:c.$cstNode?.range.start.line});continue}a.add(f);let d=_I(c,"config")??"merge",p=_I(c,"roadmap")??"merge",m;try{let y=await n.readFile(f);m=await f2(n.services,y,f)}catch(y){n.diagnostics.push({severity:"error",message:`Could not read include "${u}": ${y.message}`,sourcePath:t,line:c.$cstNode?.range.start.line});continue}let{config:g,content:w}=await kI(m,f,n);s.push({parentAbs:t,inc:c,childRelPath:u,childAbs:f,mode:p,childFile:m,childContent:w,participates:hI(m,w,n.stubs.has(w))}),d2(r,g,d,f,n.diagnostics),p2(i,w,g,p,f,u,n.diagnostics);let x=!Il(m);if(x&&p==="isolate"&&!w.roadmap&&n.diagnostics.push({severity:"error",message:`Cannot isolate "${u}": it has no roadmap declaration.`,sourcePath:t,line:c.$cstNode?.range.start.line}),x&&p!=="ignore"&&m.roadmapDecl){let y=wI(e.roadmapDecl),T=wI(m.roadmapDecl);y!==T&&n.diagnostics.push({severity:"error",message:c2(u,y,T),sourcePath:t,line:c.$cstNode?.range.start.line})}}i.waves&&E2(i,i.waves);for(let c of s){let{diagnostics:u,failed:f}=mI(e,i,c);n.diagnostics.push(...u),f&&n.failedWaves.add(c.childAbs)}n.resolving.pop();let l={config:r,content:i};return n.processed.set(t,l),l}function u2(e,t){let n=e.$document;if(!n)return[];let r=[];for(let i of Ni(n)){if(i.origin==="validation")continue;let o=i.origin==="lexer"?i.error.line:i.error.token?.startLine;r.push({severity:"error",message:i.error.message,sourcePath:t,...o!==void 0&&Number.isFinite(o)?{line:o-1}:{},syntax:i})}return r}function _I(e,t){let n=e.options.find(r=>r.key===t);if(n&&(n.value==="merge"||n.value==="ignore"||n.value==="isolate"))return n.value}async function f2(e,t,n){let r=Oe.file(n),o=e.shared.workspace.LangiumDocumentFactory.fromString(t,r);return await e.shared.workspace.DocumentBuilder.build([o],{validation:!1}),o.parseResult.value}function d2(e,t,n,r,i){if(n==="ignore"||n==="isolate")return;let o=(s,a)=>i.push({severity:"warning",message:`${a} "${s}" from ${Ts(r)} is shadowed by the parent's definition.`,sourcePath:r});Py(e.styles,t.styles,s=>o(s,"Style")),Py(e.defaults,t.defaults,s=>o(s,"Default")),Py(e.symbols,t.symbols,s=>o(s,"Symbol")),h2(e.calendarDeclarations,t.calendarDeclarations,s=>o(s.name,m2(s))),t.scale&&!e.scale&&(e.scale=t.scale),t.calendar&&!e.calendar&&(e.calendar=t.calendar)}function p2(e,t,n,r,i,o,s){if(r==="ignore")return;if(r==="isolate"){t.roadmap&&e.isolatedRegions.push({sourcePath:o,config:n,content:t});return}let a=(l,c)=>s.push({severity:"warning",message:`${c} "${l}" from ${Ts(i)} is shadowed by the parent's definition.`,sourcePath:i});Wn(e.persons,t.persons,l=>a(l,"Person")),Wn(e.teams,t.teams,l=>a(l,"Team")),Wn(e.anchors,t.anchors,l=>a(l,"Anchor")),Wn(e.labels,t.labels,l=>a(l,"Label")),Wn(e.sizes,t.sizes,l=>a(l,"Size")),Wn(e.statuses,t.statuses,l=>a(l,"Status")),Wn(e.swimlanes,t.swimlanes,l=>a(l,"Swimlane")),Wn(e.milestones,t.milestones,l=>a(l,"Milestone")),Wn(e.footnotes,t.footnotes,l=>a(l,"Footnote")),t.roadmap&&!e.roadmap&&(e.roadmap=t.roadmap)}function Py(e,t,n){for(let[r,i]of t){if(e.has(r)){e.get(r)!==i&&n(r);continue}e.set(r,i)}}function h2(e,t,n){let r=new Set(e),i=new Set(e.filter(o=>o.name).map(AI));for(let o of t)if(!r.has(o)){if(o.name&&i.has(AI(o))){n(o);continue}e.push(o),r.add(o)}}function AI(e){return`${e.$type}:${e.name}`}function m2(e){return Ir(e)?"Non-working":"Working"}function Wn(e,t,n){let r=new Set(e.values());for(let[i,o]of t)if(!r.has(o)){if(!o.name&&o.title){e.set(Oy(e,II(o.title)),o);continue}if(e.has(i)){n(i);continue}e.set(i,o)}}function g2(e,t){for(let n of t.configEntries)y2(e,n)}function y2(e,t){pA(t)?e.scale||(e.scale=t):Ha(t)?e.calendar||(e.calendar=t):Dt(t)?t.name&&!e.styles.has(t.name)&&e.styles.set(t.name,t):xi(t)?t.name&&!e.symbols.has(t.name)&&e.symbols.set(t.name,t):nt(t)?e.defaults.has(t.entityType)||e.defaults.set(t.entityType,t):(Ir(t)||Ka(t))&&e.calendarDeclarations.push(t)}function x2(e){let t={swimlanes:new Set,persons:new Set,teams:new Set,anchors:new Set,labels:new Set,sizes:new Set,statuses:new Set,milestones:new Set,footnotes:new Set};for(let n of e){let r=n.name;if(r){if(qe(n))t.swimlanes.add(r);else if(Ya(n))t.persons.add(r);else if(Cn(n))t.teams.add(r);else if(os(n))t.anchors.add(r);else if(ja(n))t.labels.add(r);else if(yi(n))t.sizes.add(r);else if(Va(n))t.statuses.add(r);else if(pn(n))t.milestones.add(r);else if(Ig(n))t.footnotes.add(r);else if(Tt(n))for(let i of Object.values(t))i.add(r)}}return t}function E2(e,t){let n=[e.persons,e.teams,e.anchors,e.labels,e.sizes,e.statuses,e.swimlanes,e.milestones,e.footnotes],r=(i,o)=>t.has(i)&&!o.name&&!!o.title;for(let i of n){let o=[...i];if(!o.some(([a,l])=>r(a,l)))continue;let s=new Set([...i.keys(),...t.keys()]);i.clear();for(let[a,l]of o){let c=r(a,l)?Oy(i,a,s):a;s.add(c),i.set(c,l)}}}function w2(e,t){t.roadmapDecl&&!e.roadmap&&(e.roadmap=t.roadmapDecl);let n=x2(t.roadmapEntries);for(let r of t.roadmapEntries)T2(e,r,n)}function II(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"entity"}function Oy(e,t,n){let r=o=>e.has(o)||(n?.has(o)??!1);if(!r(t))return t;let i=2;for(;r(`${t}-${i}`);)i++;return`${t}-${i}`}function Xn(e,t,n){t.name?e.has(t.name)||e.set(t.name,t):t.title&&e.set(Oy(e,II(t.title),n),t)}function T2(e,t,n){qe(t)?Xn(e.swimlanes,t,n.swimlanes):Ya(t)?Xn(e.persons,t,n.persons):Cn(t)?Xn(e.teams,t,n.teams):os(t)?Xn(e.anchors,t,n.anchors):ja(t)?Xn(e.labels,t,n.labels):yi(t)?Xn(e.sizes,t,n.sizes):Va(t)?Xn(e.statuses,t,n.statuses):pn(t)?Xn(e.milestones,t,n.milestones):Ig(t)&&Xn(e.footnotes,t,n.footnotes)}function Rl(e){let t=e?.roadmapDecl?.properties.find(r=>Q(r)==="start");if(!t)return{kind:"missing"};let n=t.value;return!n||!He(n)?{kind:"invalid"}:{kind:"valid",iso:n,date:new Date(n)}}function Z(e,t,n,r,...i){e(t,Qt("en-US",r,...i),{...n,data:{code:r,args:i}})}function Td(e,t){let n={node:t.node,...t.property===void 0?{}:{property:t.property}};if("message"in t){e(t.severity,t.message,n);return}Z(e,t.severity,n,t.code,t.args)}function Oi(e){let t=e.$cstNode;return t?`line ${t.range.start.line+1}`:"unknown location"}function vd(e){return/^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(e)}var $y="v1",_d=new Set(Bf),RI=new Set(Ei),Dy=new Set(Za),Sl=new Set(RA),SI=new Set(vA),bI=new Set(SA),bl=Object.fromEntries(Object.entries(_A).map(([e,t])=>[e,new Set(t)])),NI=new Set(AA),LI=new Set(kA),Ad=new Set(bA),My=new Set(NA),Fy=new Set(LA),PI={item:new Set(["size","duration","after","before","remaining","link","description","owner"]),milestone:new Set(["date","after","link","description"]),anchor:new Set(["date","link","description"]),footnote:new Set(["on","link","description"]),label:new Set(["link","description"]),swimlane:new Set(["capacity"]),roadmap:new Set,parallel:new Set,group:new Set},By=new Set(PA),CI=Object.fromEntries(Object.entries(CA).map(([e,t])=>[e,new Set(t)])),v2=[{keys:new Set(["progress","percent","percentage","pct","complete","completion"]),requires:"remaining",suggest:"status: + remaining:"},{keys:new Set(["date","start"]),requires:"after",entities:new Set(["ItemDeclaration","ParallelBlock","GroupBlock"]),suggest:"after:<date>"}];function OI(e,t,n){let r=e.toLowerCase();for(let i of v2)if(!(!i.keys.has(r)||!t.has(i.requires))&&!(i.entities&&(n===void 0||!i.entities.has(n))))return i.suggest}var $i=/^\d+(?:\.\d+)?[dwmqy]$/,$I=/^\d+%$/,DI=/^#[0-9a-fA-F]{3,8}$/,MI=/^v\d+$/,Wy=/^\d+$/,FI=/^[dwmqy]$/,Xy=/^\d+(\.\d+)?$/,Nl=/^\d+(\.\d+)?%$/,kd=/^\d+\.\d+$/,BI=/^\d+$/,WI=/^[\x20-\x7E]{1,3}$/,XI=/^[a-zA-Z]{2,3}(-[a-zA-Z]{2}|-\d{3})?$/,UI=new Set(IA),Uy=new Set(OA);function HI(e,t){let n=e.configEntries.filter(Ha),i=e.roadmapDecl?.properties.find(o=>Q(o)==="calendar")?.value;if(n.length>0&&i!=="custom")for(let o of n)t("error",'A "calendar" config block is only valid when the roadmap declares calendar:custom.',{node:o});if(i==="custom"&&n.length===0&&t("error",'calendar:custom requires a "calendar" config block with days-per-week, days-per-month, days-per-quarter, and days-per-year.',{node:e.roadmapDecl,property:"properties"}),i==="custom"&&n.length>0)for(let o of n){let s=new Set(o.properties.map(a=>Q(a)));for(let a of Ad)s.has(a)||t("error",`calendar:custom requires "${a}" in the calendar config block.`,{node:o})}}function zI(e,t){let n=new Set;for(let r of e.properties){let i=Q(r);if(!Ad.has(i)){t("error",`Unknown calendar property "${i}". Allowed: ${[...Ad].join(", ")}.`,{node:r,property:"key"});continue}n.has(i)&&t("error",`Duplicate calendar property "${i}".`,{node:r,property:"key"}),n.add(i),(!Wy.test(r.value)||parseInt(r.value,10)<=0)&&t("error",`"${i}" must be a positive integer, got "${r.value}".`,{node:r,property:"value"})}}function jI(e,t){let n=new Set;for(let r of e.properties){let i=Q(r);if(!My.has(i)){t("error",`Unknown scale property "${i}". Allowed: ${[...My].join(", ")}.`,{node:r,property:"key"});continue}n.has(i)&&t("error",`Duplicate scale property "${i}".`,{node:r,property:"key"}),n.add(i),i==="label-every"&&(!Wy.test(r.value)||parseInt(r.value,10)<=0)&&t("error",`"label-every" must be a positive integer, got "${r.value}".`,{node:r,property:"value"})}}function YI(e,t){let n=Mr(e),r=qa(e),{own:i}=r;for(let c of e.properties)Lg.has(Q(c))||Z(t,"error",{node:c,property:"key"},"NL.E0901",{kind:n,key:Q(c)});r.shape==="malformed"&&Z(t,"error",{node:e},"NL.E0900",{kind:n});let o=i.get("date");o&&o.values.length>0&&o.values.forEach((c,u)=>{He(c)||Z(t,"error",{node:o,property:"values",index:u},"NL.E0405",{key:"date",value:c})});for(let c of["start","end"]){let u=i.get(c);u&&u.values.length>1?Z(t,"error",{node:u},"NL.E0902",{kind:n,key:c}):u&&u.values.length===1&&!He(u.values[0])&&Z(t,"error",{node:u,property:"values",index:0},"NL.E0405",{key:c,value:u.values[0]})}let{start:s,end:a}=r;s&&a&&a<s&&Z(t,"error",{node:i.get("end"),property:"value"},"NL.E0903",{start:s,end:a});let l=i.get("every");if(l){let c=new Set;(l.value!==void 0?[l.value]:l.values).forEach((f,d)=>{let p=l.values.length>0?{node:l,property:"values",index:d}:{node:l,property:"value"};Ng(f)?c.has(f)&&Z(t,"error",p,"NL.E0905",{value:f}):Z(t,"error",p,"NL.E0904",{value:f}),c.add(f)})}}function VI(e,t){let n=e.roadmapDecl;if(!n)return;let r=e.configEntries.filter(qI),i=r.map(y=>({decl:y,facts:qa(y)})).filter(({facts:y})=>y.wellFormed),o=y=>y.weekdays??[],s=i.filter(({facts:y})=>y.shape==="open-recurrence"),a=n.properties.find(y=>Q(y)==="calendar"),l=e.configEntries.find(Ha),c=a?.value==="custom"&&l!==void 0,u=a?.value==="full",f=c?l.properties.find(y=>Q(y)==="days-per-week"):void 0,d=parseInt(f?.value??"",10),p=c?Number.isFinite(d)&&d>0?d:GI:u?7:GI,m=Mf(r),g=new Set(!c&&!u&&!m?[0,6]:[]);for(let{decl:y,facts:T}of s)if(Ir(y))for(let E of o(T))g.add(E);for(let{decl:y,facts:T}of s)if(Ka(y))for(let E of o(T))g.delete(E);if(g.size===7)for(let{decl:y}of s)Ir(y)&&Z(t,"error",{node:y},"NL.E0906");for(let{decl:y,facts:T}of i){if(!Ir(y)||T.shape!=="half-bounded-recurrence")continue;new Set([...g,...o(T)]).size===7&&Z(t,"error",{node:y},"NL.E0906")}let w=7-g.size;if(w===0||w===p)return;let x=c?f?{node:f,property:"value"}:{node:l}:a?{node:a}:s.length>0?{node:s[0].decl}:{node:n};Z(t,"warning",x,"NL.W0705",{daysPerWeek:p,working:w})}function KI(e,t){let n=new Map;for(let r of e.configEntries){if(!qI(r)||!r.name)continue;let i=`${r.$type}:${r.name}`;n.has(i)?Z(t,"error",{node:r,property:"name"},"NL.E0907",{kind:Mr(r),name:r.name}):n.set(i,r)}}var GI=5;function qI(e){return Ir(e)||Ka(e)}function JI(e,t){e.properties.find(r=>Q(r)==="date")||Z(t,"error",{node:e},"NL.E0500",{name:Re(e)})}function QI(e,t){let n=e.properties.find(s=>Q(s)==="date");if(!n?.value)return;let r=n.value;if(!He(r))return;let i=new Date(r),o=Rl(e.$container);switch(o.kind){case"invalid":return;case"missing":Z(t,"error",{node:n,property:"value"},"NL.E0501",{name:Re(e)});return;case"valid":i<o.date&&Z(t,"error",{node:n,property:"value"},"NL.E0502",{name:Re(e),date:r,start:o.iso});return}}function eR(e,t){let n=e.properties.some(i=>Q(i)==="date"),r=e.properties.some(i=>Q(i)==="after");!n&&!r&&Z(t,"error",{node:e},"NL.E0503",{name:Re(e)})}function tR(e,t){let n=e.properties.find(s=>Q(s)==="date");if(!n?.value)return;let r=n.value;if(!He(r))return;let i=new Date(r),o=Rl(e.$container);switch(o.kind){case"invalid":return;case"missing":t("error",`Milestone "${Re(e)}" has a date but the roadmap is missing "start:". Add start:YYYY-MM-DD to the roadmap.`,{node:n,property:"value"});return;case"valid":i<o.date&&Z(t,"error",{node:n,property:"value"},"NL.E0504",{name:Re(e),date:r,start:o.iso});return}}function nR(e,t){e.properties.some(r=>Q(r)==="on")||Z(t,"error",{node:e},"NL.E0505")}function rR(e,t){for(let n of e.properties)Q(n)==="footnote"&&t("error",`Property "footnote:" is not valid on ${vl(e)}. Footnotes attach via "on:" on the footnote declaration \u2014 declare \`footnote <id> on:<target-id>\` instead.`,{node:n})}function iR(e,t){let n=e.properties.some(i=>Q(i)==="duration"),r=e.properties.some(i=>Q(i)==="size");!n&&!r&&Z(t,"error",{node:e},"NL.E0600",{name:Re(e)})}function oR(e,t){for(let n of e.properties){let r=Q(n);(r==="size"||r==="duration"||r==="remaining"||r==="capacity")&&t("error",`"${r}" is not valid on ${e.$type==="ParallelBlock"?"parallel":"group"} (computed from children).`,{node:n})}}function sR(e,t){let n=e.content.filter(r=>!za(r));n.length===0?t("error","Parallel block must contain at least 2 children.",{node:e}):n.length===1&&t("warning","Parallel block has only 1 child. Use at least 2 for parallel execution.",{node:e})}function aR(e,t){e.content.filter(r=>!za(r)).length===0&&t("error","Group must contain at least 1 child.",{node:e})}function lR(e,t){e.properties.find(r=>Q(r)==="effort")||t("error",`Size "${Re(e)}" requires an "effort:" property.`,{node:e}),e.name&&($i.test(e.name)||FI.test(e.name))&&t("error",`Size id "${e.name}" collides with the raw duration pattern. Choose a different name (e.g. "xs", "small", "quarter").`,{node:e,property:"name"})}function cR(e,t){e.name&&_d.has(e.name)&&t("error",`Status id "${e.name}" collides with the built-in status value. Built-ins: ${Bf.join(", ")}.`,{node:e,property:"name"})}function uR(e,t){let n=new Map;for(let r of e.roadmapEntries)if(yi(r)&&r.name){let i=n.get(r.name);i?t("error",`Duplicate size id "${r.name}". First declared at ${Oi(i)}.`,{node:r,property:"name"}):n.set(r.name,r)}}function fR(e,t){if(nt(e)&&e.entityType!=="swimlane")return;let n=e.properties.find(s=>Q(s)==="utilization-warn-at"),r=e.properties.find(s=>Q(s)==="utilization-over-at");if(!n||!r)return;let i=ZI(n.value),o=ZI(r.value);i===null||o===null||i>o&&t("error",`utilization-warn-at (${n.value}) must be \u2264 utilization-over-at (${r.value}). Warn fires below over; if both fire at the same point, the warn band collapses to zero.`,{node:n,property:"value"})}function dR(e,t){let n=new Map,r=o=>!!o.title||o.properties.length>0||o.description!==void 0,i=o=>{if(!o.name)return;let s=r(o);n.has(o.name)||n.set(o.name,[]),n.get(o.name).push({node:o,isDeclaration:s}),!s&&o.$container.$type==="NowlineFile"&&t("warning",`Bare "person ${o.name}" at roadmap top level has no declaration. Either add properties (title, link, etc.) or remove the line.`,{node:o})};for(let o of On(e))Ya(o)&&i(o);for(let[o,s]of n){let a=s.filter(l=>l.isDeclaration);if(a.length>1)for(let l=1;l<a.length;l++)t("error",`Person "${o}" is declared more than once. First declaration at ${Oi(a[0].node)}.`,{node:a[l].node})}}function ZI(e){if(!e||e===Ja)return null;if(Nl.test(e)){let t=parseFloat(e);return Number.isFinite(t)&&t>0?t/100:null}if(kd.test(e)){let t=parseFloat(e);return Number.isFinite(t)&&t>0?t:null}return null}function pR(e,t){if(Li(e))return;let n=Q(e),r=e.value,i=e.values,o=r?[r]:i;switch(n){case"status":break;case"duration":r&&!$i.test(r)&&Z(t,"error",{node:e,property:"value"},"NL.E0400",{value:r});break;case"size":r&&!vd(r)&&Z(t,"error",{node:e,property:"value"},"NL.E0401",{value:r});break;case"effort":r&&!$i.test(r)&&Z(t,"error",{node:e,property:"value"},"NL.E0402",{value:r});break;case"remaining":{if(r)if($I.test(r)){let s=parseFloat(r);(s<0||s>100)&&Z(t,"error",{node:e,property:"value"},"NL.E0404",{value:r})}else $i.test(r)||Z(t,"error",{node:e,property:"value"},"NL.E0403",{value:r});break}case"date":case"start":case"end":r&&!He(r)&&Z(t,"error",{node:e,property:"value"},"NL.E0405",{key:n,value:r});break;case"scale":r&&!$i.test(r)&&Z(t,"error",{node:e,property:"value"},"NL.E0406",{value:r});break;case"calendar":r&&!LI.has(r)&&Z(t,"error",{node:e,property:"value"},"NL.E0407",{value:r});break;case"on":case"after":case"before":o.length===0&&Z(t,"error",{node:e},"NL.E0408",{key:n});break;case"capacity":{if(!r)break;let s=e.$container,a=k2(s);if(a==="invalid")break;a==="lane"?(!Xy.test(r)||parseFloat(r)<=0)&&t("error",`Invalid swimlane capacity "${r}". Use a positive integer (e.g. capacity:5) or decimal (e.g. capacity:1.5). Percent literals are not allowed on swimlanes.`,{node:e,property:"value"}):Nl.test(r)?parseFloat(r)<=0&&t("error",`Item capacity "${r}" must be positive.`,{node:e,property:"value"}):Xy.test(r)?parseFloat(r)<=0&&t("error",`Item capacity "${r}" must be positive.`,{node:e,property:"value"}):t("error",`Invalid item capacity "${r}". Use a positive integer (capacity:2), decimal (capacity:0.5), or percent literal (capacity:50%).`,{node:e,property:"value"});break}case"overcapacity":{t("error",'"overcapacity:" was removed. Use "utilization-over-at:none" (and/or "utilization-warn-at:none") to suppress the lane utilization underline.',{node:e});break}case"utilization-warn-at":case"utilization-over-at":{if(!r)break;if(!I2(e.$container)){t("error",`"${n}:" is only valid on "swimlane" or "default swimlane".`,{node:e});break}if(r===Ja)break;if(Nl.test(r)){parseFloat(r)<=0&&t("error",`${n} value "${r}" must be positive.`,{node:e,property:"value"});break}if(kd.test(r)){parseFloat(r)<=0&&t("error",`${n} value "${r}" must be positive.`,{node:e,property:"value"});break}if(BI.test(r)){t("error",`Ambiguous ${n} value "${r}". Use the percent form ("${r}%") or the decimal-fraction form ("0.${r}") to make the intent explicit.`,{node:e,property:"value"});break}t("error",`Invalid ${n} value "${r}". Use a positive percent (e.g. 80%), a positive decimal fraction (e.g. 0.8), or "none" to opt out.`,{node:e,property:"value"});break}case"capacity-icon":break;case"icon":break;case"non-working":nt(e.$container)&&xR(r,e,t);break;default:if(Sl.has(n)){if(n==="bg"||n==="fg"||n==="text")r&&!yR(r)&&Z(t,"error",{node:e,property:"value"},"NL.E0801",{value:r,key:n});else if(n in bl){let s=bl[n];r&&!s.has(r)&&Z(t,"error",{node:e,property:"value"},"NL.E0802",{value:r,key:n,allowed:[...s].join(", ")})}}break}}function hR(e,t){for(let n of e.properties){let r=Q(n);Sl.has(r)&&Z(t,"error",{node:n},"NL.E0804",{key:r,entity:vl(e)})}}function mR(e,t){let n=CI[e.$type];if(!n)return;let r=e.$type==="ParallelBlock"||e.$type==="GroupBlock"?new Set(["size","duration","remaining","capacity"]):null;for(let i of e.properties){let o=Q(i);if(n.has(o)||By.has(o)||Sl.has(o)||o==="footnote"||r?.has(o)||o==="wave"||Li(i))continue;let s=[...n,...By],a=OI(o,n,e.$type)??nI(o,s)??"";Z(t,"warning",{node:i,property:"key"},"NL.W0700",{key:o,entity:vl(e),suggested:a})}}function gR(e,t){let n=Q(e),r=e.value;if(n==="bg"||n==="fg"||n==="text")yR(r)||Z(t,"error",{node:e,property:"value"},"NL.E0801",{value:r,key:n});else if(n==="non-working")xR(r,e,t);else if(n in bl){let i=bl[n];i.has(r)||Z(t,"error",{node:e,property:"value"},"NL.E0802",{value:r,key:n,allowed:[...i].join(", ")})}else Sl.has(n)||Z(t,"error",{node:e,property:"key"},"NL.E0803",{key:n})}function yR(e){return NI.has(e)||DI.test(e)}function xR(e,t,n){e===void 0||SI.has(e)||Z(n,"error",{node:t,property:"value"},"NL.E0800",{value:e})}function k2(e){return e?qe(e)?"lane":Ke(e)?"item":nt(e)?e.entityType==="swimlane"?"lane":"item":"invalid":"invalid"}function I2(e){return e?!!(qe(e)||nt(e)&&e.entityType==="swimlane"):!1}function ER(e,t){let n=new Map,r=new Map;for(let i=0;i<e.roadmapEntries.length;i++){let o=e.roadmapEntries[i];yi(o)&&o.name?n.has(o.name)||n.set(o.name,i):Va(o)&&o.name&&(r.has(o.name)||r.set(o.name,i))}for(let i=0;i<e.roadmapEntries.length;i++){let o=e.roadmapEntries[i];$f(o,s=>{if(Li(s))return;let a=Q(s);if(a==="size"&&s.value){let l=s.value,c=n.get(l);c===void 0?t("error",`Size "${l}" is not declared. Add "size ${l} effort:<literal>" earlier in the roadmap section.`,{node:s,property:"value"}):c>=i&&t("error",`Size "${l}" is referenced before its declaration. Move "size ${l}" above this entity.`,{node:s,property:"value"})}else if(a==="status"&&s.value){let l=s.value;if(_d.has(l))return;let c=r.get(l);c===void 0?t("error",`Status "${l}" is not a built-in and has no declaration. Add "status ${l}" earlier in the roadmap section.`,{node:s,property:"value"}):c>=i&&t("error",`Status "${l}" is referenced before its declaration. Move "status ${l}" above this entity.`,{node:s,property:"value"})}})}}function wR(e,t){for(let{prop:n,key:r,value:i}of wd(e))Z(t,"error",{node:n},"NL.E0302",{key:r,value:i})}function TR(e,t){let n=Rl(e),r=i=>{let o=i.properties??[],s=Tt(i),a=Ke(i)||tt(i)||$e(i)||s;for(let l of o){let c=Q(l);if(c!=="after"&&c!=="before"||s&&c==="before")continue;let f=(l.value?[l.value]:l.values).filter(d=>!!d&&ot.test(d));if(f.length!==0){if(!a){Z(t,"error",{node:l},"NL.E0411",{key:c,type:Mr(i)});continue}f.length>1&&Z(t,"error",{node:l},"NL.E0410",{key:c});for(let d of f){if(!He(d)){Z(t,"error",l.value!==void 0?{node:l,property:"value"}:{node:l,property:"values",index:l.values.indexOf(d)},"NL.E0405",{key:c,value:d});continue}switch(n.kind){case"invalid":continue;case"missing":Z(t,"error",{node:l},"NL.E0412",{key:c,date:d});continue;case"valid":{let p=_e(d);p&&p<n.date&&Z(t,"error",{node:l},"NL.E0413",{key:c,date:d,start:n.iso})}}}}}};for(let i of On(e))_R(i)||r(i)}function vR(e,t){let n=new Map,r=(d,p)=>{n.has(d)||n.set(d,new Set),n.get(d).add(p)},i=(d,p,m)=>{if(d)for(let g of p){let w=Q(g);if(w==="after"){let x=g.value?[g.value]:g.values;for(let y of x)y&&(ot.test(y)||r(d,y))}else if(w==="before"){let x=g.value?[g.value]:g.values;for(let y of x)y&&(ot.test(y)||r(y,d))}}},o=d=>{if(Tt(d))return;let p=d.name,m=d.properties??[];i(p,m,e)};for(let d of On(e))_R(d)||o(d);let s=0,a=1,l=2,c=new Map;for(let d of n.keys())c.set(d,s);let u=new Set,f=(d,p)=>{c.set(d,a),p.push(d);for(let m of n.get(d)??[]){let g=c.get(m)??s;if(g===a){let w=p.indexOf(m),x=p.slice(w).concat(m),y=[...x].sort().join("\u2192");u.has(y)||(u.add(y),t("error",`Circular dependency detected: ${x.join(" \u2192 ")}.`,{node:e.roadmapDecl??e}))}else g===s&&f(m,p)}p.pop(),c.set(d,l)};for(let d of n.keys())(c.get(d)??s)===s&&f(d,[])}function _R(e){return Cn(e)&&Cn(e.$container)}function AR(e,t){let n=e.hasConfig?Ec.findNodeForKeyword(e.$cstNode,"config")?.offset:void 0,r=e.roadmapDecl?.$cstNode?.offset;n!==void 0&&r!==void 0&&n>r&&Z(t,"error",{node:e,property:"hasConfig"},"NL.E0001");for(let i of e.includes){let o=i.$cstNode?.offset??0;n!==void 0&&o>n&&Z(t,"error",{node:i},"NL.E0002"),r!==void 0&&o>r&&Z(t,"error",{node:i},"NL.E0003")}}function kR(e,t){if(!MI.test(e.version)){Z(t,"error",{node:e,property:"version"},"NL.E0100",{version:e.version});return}let n=parseInt(e.version.slice(1),10),r=parseInt($y.slice(1),10);n>r&&Z(t,"error",{node:e,property:"version"},"NL.E0101",{version:e.version,supported:$y})}function IR(e,t){let n=new Set;for(let r of e.properties){let i=Q(r);if(!Uy.has(i)){Z(t,"error",{node:r,property:"key"},"NL.E0102",{key:i,allowed:[...Uy].join(", ")});continue}if(n.has(i)&&Z(t,"error",{node:r,property:"key"},"NL.E0103",{key:i}),n.add(i),i==="locale"){let o=r.value;XI.test(o)||Z(t,"error",{node:r,property:"value"},"NL.E0104",{value:o})}}}function RR(e,t){!e.name&&!e.title&&Z(t,"error",{node:e},"NL.E0301",{type:e.$type})}function SR(e,t){let n=new Map,r=(i,o)=>{if(!i)return;let s=n.get(i);s?Z(t,"error",{node:o},"NL.E0300",{name:i,location:Oi(s)}):n.set(i,o)};e.roadmapDecl?.name&&r(e.roadmapDecl.name,e.roadmapDecl);for(let i of e.roadmapEntries)Df(i,r);for(let i of e.configEntries)Dt(i)&&i.name&&r(i.name,i)}function bR(e,t){let n=e.$document?.textDocument.getText()??e.$cstNode?.text;if(!n)return;let r=n.split(/\r?\n/);for(let i=0;i<r.length;i++){let o=r[i];if(o.length===0)continue;let s=o.match(/^([\t ]+)/);if(!s)continue;let a=s[1];if(a.includes(" ")&&a.includes(" ")){Z(t,"error",{node:e},"NL.E0005",{line:i+1});return}}}function NR(e,t){let n=e.roadmapEntries.some(qe);e.roadmapDecl&&!n&&Z(t,"error",{node:e.roadmapDecl},"NL.E0004")}function LR(e,t){UI.has(e.value)||Z(t,"error",{node:e,property:"value"},"NL.E0200",{value:e.value})}function PR(e,t){let n=new Set;for(let r of e.options){let i=Q(r);n.has(i)&&Z(t,"error",{node:r},"NL.E0201",{key:i}),n.add(i)}}function CR(e,t){if(!Fy.has(e.entityType)){t("error",`"${e.entityType}" is not a supported entity type for default. Allowed: ${[...Fy].join(", ")}.`,{node:e,property:"entityType"});return}let n=e.$container,r=-1;for(let o=0;o<n.configEntries.length;o++){let s=n.configEntries[o];if(nt(s)&&s.entityType===e.entityType){if(r<0)r=o;else if(s===e){t("error",`Duplicate "default ${e.entityType}" declaration. Only one is allowed per entity type per file.`,{node:e});break}}}let i=PI[e.entityType];if(i)for(let o of e.properties){let s=Q(o);i.has(s)&&t("error",hd(s,e.entityType),{node:o})}if(e.entityType!=="roadmap")for(let o of e.properties){let s=Q(o);bI.has(s)&&Z(t,"warning",{node:o,property:"key"},"NL.W0703",{key:s,entityType:e.entityType})}}function OR(e,t){let n=e.roadmapDecl;if(!n)return;let r=new Map,i=new Map;for(let c of e.configEntries)Dt(c)&&c.name&&!r.has(c.name)?r.set(c.name,c):nt(c)&&c.entityType==="roadmap"&&(i.has("roadmap")||i.set("roadmap",c));let o=new Map;for(let c of e.roadmapEntries)ja(c)&&c.name&&!o.has(c.name)&&o.set(c.name,c);let s,a,l=c=>{for(let u of c){let f=Q(u);f==="header-height"?s=u:f==="timeline-position"&&(a=u)}};for(let c of Ff("roadmap",n.properties,{styles:r,defaults:i,labels:o}))switch(c.level){case"inline":break;case"default":l(c.props);break;case"label":return;default:if(!c.decl)return;l(c.decl.properties)}s?.value==="none"&&(a?.value!=="bottom"&&a?.value!=="both"||Z(t,"warning",{node:a,property:"value"},"NL.W0704",{position:a.value}))}function $R(e,t){e.name&&Dy.has(e.name)&&Z(t,"error",{node:e,property:"name"},"NL.E0805",{name:e.name,builtins:[...Za].sort().join(", ")});let n=e.properties.find(i=>Q(i)==="unicode");n?(!n.value||n.value.length===0)&&Z(t,"error",{node:n,property:"value"},"NL.E0807",{name:Re(e)}):Z(t,"error",{node:e},"NL.E0806",{name:Re(e)});let r=e.properties.find(i=>Q(i)==="ascii");if(r){let i=r.value??"";WI.test(i)||Z(t,"error",{node:r,property:"value"},"NL.E0808",{name:Re(e),length:i.length})}for(let i of e.properties){let o=Q(i);o!=="unicode"&&o!=="ascii"&&o!=="link"&&o!=="description"&&Z(t,"error",{node:i,property:"key"},"NL.E0809",{key:o})}}function DR(e,t){let n=new Map;for(let r of e.configEntries)if(xi(r)&&r.name){let i=n.get(r.name);i?Z(t,"error",{node:r,property:"name"},"NL.E0810",{name:r.name,location:Oi(i)}):n.set(r.name,r)}}function MR(e,t){let n=new Map;for(let i=0;i<e.configEntries.length;i++){let o=e.configEntries[i];xi(o)&&o.name&&(n.has(o.name)||n.set(o.name,i))}let r=(i,o,s,a)=>{if(o!=="icon"&&o!=="capacity-icon"||!s||!vd(s)||o==="capacity-icon"&&RI.has(s)||o==="icon"&&Dy.has(s))return;let l=n.get(s);if(l===void 0){let c=o==="capacity-icon"?[...Ei].sort().join(", "):[...Za].sort().join(", ");Z(t,"error",{node:a,property:"value"},"NL.E0811",{key:o,value:s,builtins:c})}else l>=i&&Z(t,"error",{node:a,property:"value"},"NL.E0812",{key:o,value:s})};for(let i=0;i<e.configEntries.length;i++){let o=e.configEntries[i];if(Dt(o))for(let s of o.properties)r(i,Q(s),s.value,s);else if(nt(o))for(let s of o.properties)r(i,Q(s),s.value,s)}}function FR(e){let t=e.validation.ValidationRegistry,n=e.validation.NowlineValidator,r={NowlineFile:[n.checkFileStructure,n.checkUniqueIdentifiers,n.checkSwimlaneRequired,n.checkIndentationConsistency,n.checkRoadmapOnlyKeywordsPosition,n.checkForwardReferences,n.checkReferenceResolution,n.checkInlineDatePins,n.checkCircularDependencies,n.checkWaves,n.checkDuplicateSizeIds,n.checkCalendarBlockConsistency,n.checkHiddenTimelineStrip,n.checkPersonDeclarations,n.checkDuplicateSymbolIds,n.checkSymbolReferences,n.checkCalendarWeek,n.checkDuplicateCalendarDeclarationIds],NowlineDirective:[n.checkDirectiveVersion,n.checkDirectiveProperties],IncludeOption:[n.checkIncludeMode],IncludeDeclaration:[n.checkIncludeDuplicateOptions],EntityProperty:[n.checkPropertyValues],RoadmapDeclaration:[n.checkEntityIdOrTitle,n.checkRoadmapProperties,n.checkNoRawStyleProperties,n.checkUnknownEntityProperties],AnchorDeclaration:[n.checkEntityIdOrTitle,n.checkAnchorRequiredDate,n.checkAnchorAgainstStart,n.checkNoRawStyleProperties,n.checkNoFootnoteProperty,n.checkUnknownEntityProperties],SwimlaneDeclaration:[n.checkEntityIdOrTitle,n.checkNoRawStyleProperties,n.checkUtilizationOrdering,n.checkNoFootnoteProperty,n.checkUnknownEntityProperties],ItemDeclaration:[n.checkEntityIdOrTitle,n.checkItemRequiredDuration,n.checkNoRawStyleProperties,n.checkNoFootnoteProperty,n.checkUnknownEntityProperties],ParallelBlock:[n.checkParallelMinChildren,n.checkNoComputedProperties,n.checkNoRawStyleProperties,n.checkNoFootnoteProperty,n.checkUnknownEntityProperties],GroupBlock:[n.checkGroupMinChildren,n.checkNoComputedProperties,n.checkNoRawStyleProperties,n.checkNoFootnoteProperty,n.checkUnknownEntityProperties],MilestoneDeclaration:[n.checkEntityIdOrTitle,n.checkMilestoneRequirement,n.checkMilestoneAgainstStart,n.checkNoRawStyleProperties,n.checkNoFootnoteProperty,n.checkUnknownEntityProperties],FootnoteDeclaration:[n.checkEntityIdOrTitle,n.checkFootnoteOn,n.checkNoRawStyleProperties,n.checkUnknownEntityProperties],PersonDeclaration:[n.checkEntityIdOrTitle,n.checkNoRawStyleProperties,n.checkNoFootnoteProperty,n.checkUnknownEntityProperties],TeamDeclaration:[n.checkEntityIdOrTitle,n.checkNoRawStyleProperties,n.checkNoFootnoteProperty,n.checkUnknownEntityProperties],StyleDeclaration:[n.checkEntityIdOrTitle],StyleProperty:[n.checkStylePropertyEnum],SymbolDeclaration:[n.checkEntityIdOrTitle,n.checkSymbolDeclaration],NonWorkingDeclaration:[n.checkCalendarDeclaration],WorkingDeclaration:[n.checkCalendarDeclaration],LabelDeclaration:[n.checkEntityIdOrTitle,n.checkNoRawStyleProperties,n.checkUnknownEntityProperties],SizeDeclaration:[n.checkEntityIdOrTitle,n.checkSizeDeclaration,n.checkNoRawStyleProperties,n.checkUnknownEntityProperties],StatusDeclaration:[n.checkEntityIdOrTitle,n.checkStatusDeclaration,n.checkNoRawStyleProperties,n.checkUnknownEntityProperties],WaveDeclaration:[n.checkNoRawStyleProperties,n.checkNoFootnoteProperty,n.checkUnknownEntityProperties],DefaultDeclaration:[n.checkDefaultDeclaration,n.checkUtilizationOrdering],CalendarBlock:[n.checkCalendarBlock],ScaleBlock:[n.checkScaleBlock]};t.register(r,n)}var Id=class{checkFileStructure(t,n){AR(t,n)}checkRoadmapOnlyKeywordsPosition(t,n){}checkDirectiveVersion(t,n){kR(t,n)}checkDirectiveProperties(t,n){IR(t,n)}checkEntityIdOrTitle(t,n){RR(t,n)}checkUniqueIdentifiers(t,n){SR(t,n)}checkIndentationConsistency(t,n){bR(t,n)}checkSwimlaneRequired(t,n){NR(t,n)}checkIncludeMode(t,n){LR(t,n)}checkIncludeDuplicateOptions(t,n){PR(t,n)}checkPropertyValues(t,n){pR(t,n)}checkAnchorRequiredDate(t,n){JI(t,n)}checkAnchorAgainstStart(t,n){QI(t,n)}checkMilestoneRequirement(t,n){eR(t,n)}checkMilestoneAgainstStart(t,n){tR(t,n)}checkFootnoteOn(t,n){nR(t,n)}checkNoFootnoteProperty(t,n){rR(t,n)}checkItemRequiredDuration(t,n){iR(t,n)}checkNoComputedProperties(t,n){oR(t,n)}checkParallelMinChildren(t,n){sR(t,n)}checkGroupMinChildren(t,n){aR(t,n)}checkNoRawStyleProperties(t,n){hR(t,n)}checkUnknownEntityProperties(t,n){mR(t,n)}checkRoadmapProperties(t,n){}checkStylePropertyEnum(t,n){gR(t,n)}checkSizeDeclaration(t,n){lR(t,n)}checkStatusDeclaration(t,n){cR(t,n)}checkWaves(t,n){for(let o of gd(t))Td(n,o);for(let o of yd(t))Td(n,o);let r=en(t);if(r.length===0)return;let i={lanes:t.roadmapEntries.filter(qe),lookup:vs(t)};for(let o of _s(i,r))Td(n,o)}checkDuplicateSizeIds(t,n){uR(t,n)}checkUtilizationOrdering(t,n){fR(t,n)}checkDefaultDeclaration(t,n){CR(t,n)}checkHiddenTimelineStrip(t,n){OR(t,n)}checkCalendarBlockConsistency(t,n){HI(t,n)}checkCalendarBlock(t,n){zI(t,n)}checkScaleBlock(t,n){jI(t,n)}checkForwardReferences(t,n){ER(t,n)}checkReferenceResolution(t,n){wR(t,n)}checkInlineDatePins(t,n){TR(t,n)}checkCircularDependencies(t,n){vR(t,n)}checkPersonDeclarations(t,n){dR(t,n)}checkSymbolDeclaration(t,n){$R(t,n)}checkDuplicateSymbolIds(t,n){DR(t,n)}checkCalendarDeclaration(t,n){YI(t,n)}checkCalendarWeek(t,n){VI(t,n)}checkDuplicateCalendarDeclarationIds(t,n){KI(t,n)}checkSymbolReferences(t,n){MR(t,n)}};var Gy=class extends $o{runConverter(t,n,r){return t.name==="PROPERTY_KEY_WITH_COLON"||t.name==="INCLUDE_OPTION_KEY"?n.endsWith(":")?n.slice(0,-1):n:super.runConverter(t,n,r)}},Hy=class extends Ma{isStartOfLine(t,n){if(!super.isStartOfLine(t,n))return!1;let r=n-1;for(;r>=0&&(t[r]===" "||t[r]===" ");)r--;for(;r>=0&&(t[r]==="\r"||t[r]===`
|
|
2917
|
-
`);)r--;for(;r>=0&&(t[r]===" "||t[r]===" ");)r--;return r<0||t[r]!=="\\"}},BR={parser:{TokenBuilder:()=>new Hy({indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[["[","]"]]}),Lexer:e=>new Sf(e),ParserConfig:()=>({maxLookahead:4}),ValueConverter:()=>new Gy},validation:{NowlineValidator:()=>new Id}};function zy(e={}){let t=e.shared??Go(Rf(bf),Pk),n=Go(If({shared:t}),Ck,BR);return t.ServiceRegistry.register(n),FR(n),{shared:t,Nowline:n}}function jy(e,t){return t.code===void 0?t.message:Qt(e,t.code,...t.args??[])}function Di(e){let{content:t}=e,n=[...t.waves?.values()??[]];if(n.length===0)return;let r=new Map;n.forEach((u,f)=>{r.set(u.name,f+1)});let i=As(t),o=n.map(u=>Al(u,i)),s=new WeakMap,a=new WeakMap,l=u=>{let f=md(u,r);for(let[d,p]of f.waveOf)s.set(d,p);for(let[d,p]of f.leadOf)a.set(d,p)};l([...t.swimlanes.values()]);for(let u of t.isolatedRegions)l([...u.content.swimlanes.values()]);let c=u=>Ke(u)?s.get(u):void 0;return{waves:n,index:r,floors:o,waveOf:s,leadOf:a,memberWave:c,isMember:(u,f)=>{let d=c(u);return d!==void 0&&(f===void 0||d===f)}}}var Ll="en-US",P2={"en-US":{nowLabel:"now",quarterPrefix:"Q",waveHeldBy:"held by",waveNoItems:"no items",waveBackgroundItem:"Background (no wave)",waveLegendBackground:"Background work (not in a wave)",waveLegendBoundary:"Wave boundary",waveLegendPrefix:"Waves:",wavesDeclaredPlaceholder:"Waves declared: {names} \u2014 no items assigned yet"},fr:{nowLabel:"maint.",quarterPrefix:"T",waveHeldBy:"retenue par",waveNoItems:"aucun \xE9l\xE9ment",waveBackgroundItem:"Travail de fond (hors vague)",waveLegendBackground:"Travail de fond (dans aucune vague)",waveLegendBoundary:"Limite de vague",waveLegendPrefix:"Vagues\xA0:",wavesDeclaredPlaceholder:"Vagues d\xE9clar\xE9es\xA0: {names} \u2014 aucun \xE9l\xE9ment affect\xE9 pour l\u2019instant"}};function WR(e,t){return t??e??Ll}function Un(e){let t={};for(let n of C2(e)){let r=P2[n];if(r)for(let i of Object.keys(r))t[i]===void 0&&r[i]!==void 0&&(t[i]=r[i])}return t}function XR(e,t){return e.wavesDeclaredPlaceholder.replace("{names}",()=>t.join(", "))}function C2(e){let t=[],n=O2(e);for(;n.length>0;){t.includes(n)||t.push(n);let r=n.lastIndexOf("-");if(r<=0)break;n=n.slice(0,r)}return t.includes(Ll)||t.push(Ll),t}function O2(e){return e.split("-").map((n,r)=>r===0?n.toLowerCase():/^[a-zA-Z]{2}$/.test(n)?n.toUpperCase():n).join("-")}function Rd(e){return e==="hide"||e==="show"}var UR={red:"#f87171",blue:"#60a5fa",yellow:"#facc15",green:"#34d399",orange:"#fb923c",purple:"#a78bfa",gray:"#94a3b8",navy:"#818cf8",white:"#e2e8f0"},Gn={bg:"none",fg:"#e2e8f0",text:"#e2e8f0",border:"solid",icon:"none",shadow:"none",font:"sans",weight:"normal",italic:!1,textSize:"md",padding:"sm",spacing:"sm",headerHeight:"sm",cornerRadius:"sm",bracket:"none",capacityIcon:"multiplier"},Yy={name:"dark",surface:{page:"#0b1220",chart:"#111827",headerBox:"#1e293b"},entities:{roadmap:{...Gn,headerHeight:"md",padding:"md"},swimlane:{...Gn,fg:"#e2e8f0",text:"#e2e8f0",padding:"sm",spacing:"none",textSize:"sm"},item:{...Gn,bg:"#0f172a",fg:"#94a3b8",text:"#e2e8f0",shadow:"subtle",cornerRadius:"sm"},parallel:{...Gn,bg:"#8c84ff",bracket:"dashed",padding:"xs"},group:{...Gn,bg:"#f0a832",bracket:"solid",padding:"xs",fg:"#94a3b8"},anchor:{...Gn,bg:"#0b1220",fg:"#cbd5e1",text:"#cbd5e1",cornerRadius:"sm"},milestone:{...Gn,bg:"#e2e8f0",fg:"#e2e8f0",text:"#0b1220",border:"solid"},footnote:{...Gn,bg:"none",fg:"#94a3b8",text:"#e2e8f0",textSize:"sm"},label:{...Gn,bg:"#1e293b",fg:"#94a3b8",text:"#e2e8f0",textSize:"xs",padding:"xs",cornerRadius:"full"}},swimlane:{bandEven:"#111827",bandOdd:"#0f172a",separator:"#1f2937",frameTabText:"#e2e8f0",frameTabMuted:"#94a3b8",border:"#334155",tabFill:"#1e293b",tabStroke:"#475569",tabText:"#e2e8f0",ownerText:"#94a3b8",footnoteIndicator:"#f87171",rowTintEven:"#0f172a",rowTintOdd:"#1e293b",utilizationOk:"#34d399",utilizationWarn:"#fbbf24",utilizationOver:"#f87171"},timeline:{gridLine:"#475569",minorGridLine:"#334155",nonWorkingSeam:"#6b7a90",nonWorkingFill:"#94a3b8",tickMark:"#334155",labelText:"#cbd5e1",panelFill:"#0f172a",border:"#334155"},header:{cardBorder:"#475569",author:"#94a3b8"},item:{overflowX:"#f87171",linkIconFg:"#94a3b8",overflowTailFill:"#7f1d1d",overflowTailStroke:"#f87171",overflowCaption:"#fecaca"},parallel:{bracketStroke:"#cbd5e1"},anchorDiamond:{fill:"#0f172a",stroke:"#cbd5e1",label:"#cbd5e1",cutLine:"#94a3b8"},milestoneDiamond:{fill:"#e2e8f0",label:"#e2e8f0",cutLineNormal:"#a5b4fc",cutLineOverrun:"#ef4444",slack:"#cbd5e1"},footnotePanel:{fill:"#0f172a",border:"#334155",header:"#e2e8f0",title:"#e2e8f0",description:"#94a3b8",number:"#f87171"},nowline:{stroke:"#f87171",labelText:"#0b1220",labelBg:"#f87171"},milestone:{dashedInk:"#a5b4fc",overrun:"#ef4444"},anchor:{predecessorLine:"#94a3b8"},dependency:{edgeStroke:"#cbd5e1",overflowStroke:"#ef5350"},footnote:{indicatorText:"#f87171",descriptionMuted:"#94a3b8"},includeRegion:{border:"#475569",label:"#cbd5e1",badge:"#94a3b8",fill:"#0b1220",tabFill:"#111827",tabStroke:"#475569",tabText:"#e2e8f0",badgeFill:"#1e293b",badgeStroke:"#475569",badgeText:"#94a3b8"},wave:{stripFill:"#042f2e",stripFillAlt:"#134e4a",labelText:"#99f6e4",labelMuted:"#5eead4",boundary:"#2dd4bf",hatch:"#0f172a",hatchOnDark:"#ffffff"},arrowhead:{neutral:"#94a3b8",light:"#64748b",dark:"#e2e8f0"},status:{done:"#34d399",inProgress:"#60a5fa",atRisk:"#facc15",blocked:"#ef4444",planned:"#94a3b8",neutral:"#94a3b8"},statusTint:{done:"#052e16",inProgress:"#172554",atRisk:"#422006",blocked:"#7f1d1d",planned:"#1e293b",neutral:"#1e293b"},statusDot:{onLight:{done:"#065f46",inProgress:"#1e3a8a",atRisk:"#92400e",blocked:"#991b1b",planned:"#334155",neutral:"#334155"},onDark:{done:"#d1fae5",inProgress:"#dbeafe",atRisk:"#fef3c7",blocked:"#fee2e2",planned:"#e2e8f0",neutral:"#e2e8f0"}},attribution:{mark:"#cbd5e1",link:"#f87171"},diagnostic:{overlayBg:"#7f1d1d",errorText:"#fecaca"}};var GR={red:"#4a4a4a",blue:"#6b6b6b",green:"#8a8a8a",yellow:"#c8c8c8",orange:"#5c5c5c",purple:"#3a3a3a",gray:"#9e9e9e",navy:"#2a2a2a",white:"#ffffff"},Hn={bg:"none",fg:"#1a1a1a",text:"#1a1a1a",border:"solid",icon:"none",shadow:"none",font:"sans",weight:"normal",italic:!1,textSize:"md",padding:"sm",spacing:"sm",headerHeight:"sm",cornerRadius:"sm",bracket:"none",capacityIcon:"multiplier"},Vy={name:"grayscale",surface:{page:"#f5f5f5",chart:"#ffffff",headerBox:"#ffffff"},entities:{roadmap:{...Hn,headerHeight:"md",padding:"md"},swimlane:{...Hn,fg:"#3a3a3a",text:"#3a3a3a",padding:"sm",spacing:"none",textSize:"sm"},item:{...Hn,bg:"#ffffff",fg:"#9e9e9e",text:"#1a1a1a",shadow:"subtle",cornerRadius:"sm"},parallel:{...Hn,bg:"#9e9e9e",bracket:"dashed",padding:"xs"},group:{...Hn,bg:"#595959",bracket:"solid",padding:"xs",fg:"#595959"},anchor:{...Hn,bg:"#1a1a1a",fg:"#1a1a1a",text:"#1a1a1a",cornerRadius:"sm"},milestone:{...Hn,bg:"#2a2a2a",fg:"#2a2a2a",text:"#ffffff",border:"solid"},footnote:{...Hn,bg:"none",fg:"#595959",text:"#595959",textSize:"sm"},label:{...Hn,bg:"#e8e8e8",fg:"#595959",text:"#595959",textSize:"xs",padding:"xs",cornerRadius:"full"}},swimlane:{bandEven:"#ffffff",bandOdd:"#f5f5f5",separator:"#d4d4d4",frameTabText:"#3a3a3a",frameTabMuted:"#737373",border:"#d4d4d4",tabFill:"#e8e8e8",tabStroke:"#bdbdbd",tabText:"#3a3a3a",ownerText:"#737373",footnoteIndicator:"#4a4a4a",rowTintEven:"#ffffff",rowTintOdd:"#f5f5f5",utilizationOk:"#8a8a8a",utilizationWarn:"#595959",utilizationOver:"#1a1a1a"},timeline:{gridLine:"#bdbdbd",minorGridLine:"#d4d4d4",nonWorkingSeam:"#9a9a9a",nonWorkingFill:"#737373",tickMark:"#bdbdbd",labelText:"#737373",panelFill:"#ffffff",border:"#d4d4d4"},header:{cardBorder:"#d4d4d4",author:"#737373"},item:{overflowX:"#1a1a1a",linkIconFg:"#1a1a1a",overflowTailFill:"#e8e8e8",overflowTailStroke:"#4a4a4a",overflowCaption:"#3a3a3a"},parallel:{bracketStroke:"#3a3a3a"},anchorDiamond:{fill:"#ffffff",stroke:"#3a3a3a",label:"#3a3a3a",cutLine:"#737373"},milestoneDiamond:{fill:"#1a1a1a",label:"#1a1a1a",cutLineNormal:"#2a2a2a",cutLineOverrun:"#4a4a4a",slack:"#1a1a1a"},footnotePanel:{fill:"#ffffff",border:"#d4d4d4",header:"#1a1a1a",title:"#1a1a1a",description:"#737373",number:"#4a4a4a"},nowline:{stroke:"#1a1a1a",labelText:"#ffffff",labelBg:"#1a1a1a"},milestone:{dashedInk:"#9e9e9e",overrun:"#4a4a4a"},anchor:{predecessorLine:"#9e9e9e"},dependency:{edgeStroke:"#595959",overflowStroke:"#1a1a1a"},footnote:{indicatorText:"#4a4a4a",descriptionMuted:"#737373"},includeRegion:{border:"#9e9e9e",label:"#3a3a3a",badge:"#737373",fill:"#f5f5f5",tabFill:"#ffffff",tabStroke:"#bdbdbd",tabText:"#1a1a1a",badgeFill:"#e8e8e8",badgeStroke:"#bdbdbd",badgeText:"#595959"},wave:{stripFill:"#fafafa",stripFillAlt:"#e0e0e0",labelText:"#212121",labelMuted:"#616161",boundary:"#616161",hatch:"#000000",hatchOnDark:"#ffffff"},arrowhead:{neutral:"#595959",light:"#9e9e9e",dark:"#1a1a1a"},status:{done:"#8a8a8a",inProgress:"#595959",atRisk:"#737373",blocked:"#3a3a3a",planned:"#bdbdbd",neutral:"#bdbdbd"},statusTint:{done:"#ebebeb",inProgress:"#e4e4e4",atRisk:"#eeeeee",blocked:"#dcdcdc",planned:"#f5f5f5",neutral:"#f5f5f5"},statusDot:{onLight:{done:"#3a3a3a",inProgress:"#2a2a2a",atRisk:"#4a4a4a",blocked:"#1a1a1a",planned:"#595959",neutral:"#595959"},onDark:{done:"#d4d4d4",inProgress:"#e8e8e8",atRisk:"#c8c8c8",blocked:"#f0f0f0",planned:"#d4d4d4",neutral:"#d4d4d4"}},attribution:{mark:"#9e9e9e",link:"#1a1a1a"},diagnostic:{overlayBg:"#e8e8e8",errorText:"#1a1a1a"}};var HR={red:"#e53935",blue:"#1e88e5",yellow:"#fdd835",green:"#43a047",orange:"#fb8c00",purple:"#8e24aa",gray:"#9e9e9e",navy:"#0d47a1",white:"#ffffff"},zn={bg:"none",fg:"#0f172a",text:"#0f172a",border:"solid",icon:"none",shadow:"none",font:"sans",weight:"normal",italic:!1,textSize:"md",padding:"sm",spacing:"sm",headerHeight:"sm",cornerRadius:"sm",bracket:"none",capacityIcon:"multiplier"},Ky={name:"light",surface:{page:"#f8fafc",chart:"#ffffff",headerBox:"#ffffff"},entities:{roadmap:{...zn,headerHeight:"md",padding:"md"},swimlane:{...zn,fg:"#334155",text:"#334155",padding:"sm",spacing:"none",textSize:"sm"},item:{...zn,bg:"#ffffff",fg:"#94a3b8",text:"#0f172a",shadow:"subtle",cornerRadius:"sm"},parallel:{...zn,bg:"#635cf1",bracket:"dashed",padding:"xs"},group:{...zn,bg:"#ea9818",bracket:"solid",padding:"xs",fg:"#475569"},anchor:{...zn,bg:"#0f172a",fg:"#0f172a",text:"#0f172a",cornerRadius:"sm"},milestone:{...zn,bg:"#312e81",fg:"#312e81",text:"#ffffff",border:"solid"},footnote:{...zn,bg:"none",fg:"#475569",text:"#475569",textSize:"sm"},label:{...zn,bg:"#f1f5f9",fg:"#475569",text:"#475569",textSize:"xs",padding:"xs",cornerRadius:"full"}},swimlane:{bandEven:"#ffffff",bandOdd:"#f8fafc",separator:"#e2e8f0",frameTabText:"#334155",frameTabMuted:"#64748b",border:"#e2e8f0",tabFill:"#f1f5f9",tabStroke:"#cbd5e1",tabText:"#334155",ownerText:"#64748b",footnoteIndicator:"#dc2626",rowTintEven:"#ffffff",rowTintOdd:"#f8fafc",utilizationOk:"#10b981",utilizationWarn:"#f59e0b",utilizationOver:"#ef4444"},timeline:{gridLine:"#cbd5e1",minorGridLine:"#e2e8f0",nonWorkingSeam:"#a0aec0",nonWorkingFill:"#64748b",tickMark:"#cbd5e1",labelText:"#64748b",panelFill:"#ffffff",border:"#e2e8f0"},header:{cardBorder:"#e2e8f0",author:"#64748b"},item:{overflowX:"#dc2626",linkIconFg:"#0f172a",overflowTailFill:"#fee2e2",overflowTailStroke:"#ef4444",overflowCaption:"#b91c1c"},parallel:{bracketStroke:"#334155"},anchorDiamond:{fill:"#ffffff",stroke:"#334155",label:"#334155",cutLine:"#64748b"},milestoneDiamond:{fill:"#0f172a",label:"#0f172a",cutLineNormal:"#1e1b4b",cutLineOverrun:"#b91c1c",slack:"#0f172a"},footnotePanel:{fill:"#ffffff",border:"#e2e8f0",header:"#0f172a",title:"#0f172a",description:"#64748b",number:"#dc2626"},nowline:{stroke:"#e53e3e",labelText:"#ffffff",labelBg:"#e53e3e"},milestone:{dashedInk:"#94a3b8",overrun:"#ef4444"},anchor:{predecessorLine:"#94a3b8"},dependency:{edgeStroke:"#475569",overflowStroke:"#d32f2f"},footnote:{indicatorText:"#e53e3e",descriptionMuted:"#64748b"},includeRegion:{border:"#94a3b8",label:"#334155",badge:"#64748b",fill:"#f8fafc",tabFill:"#ffffff",tabStroke:"#cbd5e1",tabText:"#0f172a",badgeFill:"#e2e8f0",badgeStroke:"#cbd5e1",badgeText:"#475569"},wave:{stripFill:"#f0fdfa",stripFillAlt:"#ccfbf1",labelText:"#134e4a",labelMuted:"#0f766e",boundary:"#0d9488",hatch:"#0f172a",hatchOnDark:"#ffffff"},arrowhead:{neutral:"#475569",light:"#94a3b8",dark:"#0f172a"},status:{done:"#10b981",inProgress:"#3b82f6",atRisk:"#f59e0b",blocked:"#ef4444",planned:"#94a3b8",neutral:"#94a3b8"},statusTint:{done:"#ecfdf5",inProgress:"#eff6ff",atRisk:"#fffbeb",blocked:"#fee2e2",planned:"#f8fafc",neutral:"#f8fafc"},statusDot:{onLight:{done:"#065f46",inProgress:"#1e3a8a",atRisk:"#92400e",blocked:"#991b1b",planned:"#334155",neutral:"#334155"},onDark:{done:"#d1fae5",inProgress:"#dbeafe",atRisk:"#fef3c7",blocked:"#fee2e2",planned:"#e2e8f0",neutral:"#e2e8f0"}},attribution:{mark:"#94a3b8",link:"#e53e3e"},diagnostic:{overlayBg:"#fee2e2",errorText:"#991b1b"}};var zR=["light","dark","grayscale"],qy={light:Ky,dark:Yy,grayscale:Vy};var $2={greyscale:"grayscale"};function Zy(e){let t=e.toLowerCase(),n=$2[t]??t;return zR.find(r=>r===n)}var D2={grey:"gray",violet:"purple"};function jn(e,t){if(e==="none")return"none";if(e.startsWith("#"))return e;let n=t.name==="dark"?UR:t.name==="grayscale"?GR:HR,r=D2[e]??e,i=n[r];return typeof i=="string"?i:e}function M2(e,t){return{bg:jn(e.bg,t),fg:jn(e.fg,t),text:jn(e.text,t),border:e.border,icon:e.icon,shadow:e.shadow,font:e.font,weight:e.weight,italic:e.italic,textSize:e.textSize,padding:e.padding,spacing:e.spacing,headerHeight:e.headerHeight,cornerRadius:e.cornerRadius,bracket:e.bracket,headerPosition:"beside",capacityIcon:e.capacityIcon,timelinePosition:"top",minorGrid:!1,nonWorking:"hide"}}function jR(e,t,n,r){switch(t){case"bg":e.bg=jn(n,r);break;case"fg":e.fg=jn(n,r);break;case"text":e.text=jn(n,r);break;case"border":(n==="solid"||n==="dashed"||n==="dotted")&&(e.border=n);break;case"icon":e.icon=n;break;case"shadow":(n==="none"||n==="subtle"||n==="soft"||n==="hard")&&(e.shadow=n);break;case"font":(n==="sans"||n==="serif"||n==="mono")&&(e.font=n);break;case"weight":(n==="thin"||n==="light"||n==="normal"||n==="bold")&&(e.weight=n);break;case"italic":e.italic=n==="true";break;case"text-size":e.textSize=Pl(n,"xl");break;case"padding":e.padding=Pl(n,"xl");break;case"spacing":e.spacing=Pl(n,"xl");break;case"header-height":e.headerHeight=Pl(n,"xl");break;case"corner-radius":e.cornerRadius=Pl(n,"full");break;case"bracket":(n==="none"||n==="solid"||n==="dashed")&&(e.bracket=n);break;case"header-position":(n==="beside"||n==="above")&&(e.headerPosition=n);break;case"capacity-icon":e.capacityIcon=n;break;case"timeline-position":(n==="top"||n==="bottom"||n==="both")&&(e.timelinePosition=n);break;case"minor-grid":e.minorGrid=n==="true";break;case"non-working":Rd(n)&&(e.nonWorking=n);break;default:break}}function Pl(e,t){let n=["none","xs","sm","md","lg","xl","full"],r=n.indexOf(t),i=n.indexOf(e);return i<0?"md":i>r?n[r]:n[i]}function F2(e,t,n){if(t)for(let r of t.properties)jR(e,Q(r),r.value,n)}function B2(e,t,n){for(let r of t){let i=Q(r);r.value!==void 0&&jR(e,i,r.value,n)}}function Se(e,t,n){let r=n.theme.entities[e],i=M2(r,n.theme);for(let o of Ff(e,t,n))switch(o.level){case"default":case"inline":B2(i,o.props,n.theme);break;case"label":break;default:F2(i,o.decl,n.theme)}return i}function YR(e,t){return Se("label",e.properties,t)}function KR(e,t){let r=_t(e.roadmapDecl?.properties??[],"scale")?.value,i="weeks",o,s;if(r)if(r==="days"||r==="weeks"||r==="months"||r==="quarters"||r==="years")i=r;else{let c=/^(\d+)([dwmqy])$/.exec(r);if(c){let u=Math.max(1,parseInt(c[1],10));switch(c[2]){case"d":i="days";break;case"w":i="weeks";break;case"m":i="months";break;case"q":i="quarters";break;case"y":i="years";break}o=Jy(i)*u,s=1}}let a=s??yk[i]??4,l=c=>s===void 0&&!c?{labelEveryDefault:!0}:{};if(t){let c=_t(t.properties,"label-every"),u=c&&parseInt(c.value,10)||0,f=u!==0?Math.max(1,u):a;return{unit:i,labelEvery:f,pixelsPerUnit:o??Jy(i),...l(u!==0)}}return{unit:i,labelEvery:a,pixelsPerUnit:o??Jy(i),...l(!1)}}function Jy(e){switch(e){case"days":return pk;case"weeks":return 40;case"months":return 80;case"quarters":return 160;case"years":return 320}}var W2=.5,Qy=.5,Cl=7;function Br(e){return e==="months"||e==="quarters"||e==="years"}function Sd(e,t){let n=e.getUTCFullYear(),r=e.getUTCMonth();switch(t){case"months":return new Date(Date.UTC(n,r+1,1));case"quarters":return new Date(Date.UTC(n,r-r%3+3,1));case"years":return new Date(Date.UTC(n+1,0,1))}}function X2(e,t){if(e.getUTCDate()!==1)return!1;let n=e.getUTCMonth();switch(t){case"months":return!0;case"quarters":return n%3===0;case"years":return n===0}}function Mi(e,t,n,r,i){let o=Math.ceil(t-1e-6);if(i?.hasNonWorkingDays){if(!Br(n)&&o<=0)return 0;let a=o<=0?e:Xe(i.dateAtWorkingIndex(e,o-1),1),l=Br(n)?VR(a,n):n==="weeks"?qR(a,e,i.weekStart):a;return i.workingIndexOf(e,l)}if(!Br(n))return Math.ceil(t/r)*r;let s=Xe(e,o);return At(e,VR(s,n))}function VR(e,t){return X2(e,t)?e:Sd(e,t)}function qR(e,t,n){let r=n===void 0?-At(t,e):n-e.getUTCDay();return Xe(e,(r%Cl+Cl)%Cl)}function U2(e,t,n){return qR(Xe(e,1),t,n)}function bd(e,t,n,r=Ll){if(e.calendar?.hasNonWorkingDays)return G2(e,t,e.calendar,r);if(Br(t.unit))return K2(e,t,t.unit,r);let i=n.daysPerUnit(t.unit),o=i*e.pixelsPerDay,s=Math.max(1,Math.round(e.widthPx/e.pixelsPerDay)),a=Math.floor(s/i)+1,l=[];for(let c=0;c<a;c++){let u=c*i,f=e.originX+u*e.pixelsPerDay,d=c%t.labelEvery===0,p=c===a-1;l.push({x:f,labelX:p?void 0:f+o/2,major:d,label:d&&!p?nx(t.unit,Xe(e.domain[0],u),c,r):void 0})}return l}function G2(e,t,n,r){let{unit:i}=t,[o,s]=e.domain,a=x=>Br(i)?Sd(x,i):i==="weeks"?U2(x,o,n.weekStart):Xe(x,1),l=[o];for(let x=a(o);x<s;x=a(x))l.push(x);let c=e.forward(s),u=[];l.forEach((x,y)=>{let T=e.forward(x);(y+1<l.length?e.forward(l[y+1]):c)>T&&!j2(e,i,l,y)&&u.push({date:x,x:T})});let f=i==="days"&&t.labelEveryDefault===!0&&n.weekStart!==void 0,d=(x,y)=>f?z2(x,n,e.showsNonWorking):y%t.labelEvery===0,m=(e.showsNonWorking?zA(i):n.daysPerUnit(i))*e.pixelsPerDay,g=u.map(({date:x,x:y},T)=>{let E=(T+1<u.length?u[T+1].x:c)-y,v=d(x,T),S=v?nx(i,x,T,r):void 0,F=S===void 0?0:se(S,Ri),C=Br(i)?T===0||T===u.length-1:E<m-W2,W=S!==void 0&&!(F>E&&C);return{x:y,columnPx:E,major:v,label:S,labelPx:F,isNarrowed:C,isShown:W}});Br(i)||H2(g);let w=g.map(x=>({x:x.x,labelX:x.x+x.columnPx/2,major:x.major,label:x.isShown?x.label:void 0}));return s>o&&w.push({x:c,labelX:void 0,major:d(s,u.length),label:void 0}),w}function H2(e){let t=n=>{let r=e[n];return r===void 0||r.isShown?0:r.columnPx/2};e.forEach((n,r)=>{if(n.label===void 0||n.isShown||!n.isNarrowed||!(e[r-1]?.isNarrowed===!0||e[r+1]?.isNarrowed===!0))return;let o=n.labelPx/2,s=n.columnPx/2;n.isShown=o<=s+t(r-1)&&o<=s+t(r+1)})}function z2(e,t,n){let r=t.weekStart;if(n)return e.getUTCDay()===r;let i=(e.getUTCDay()-r+Cl)%Cl;for(let o=1;o<=i;o++)if(t.isWorkingDay(Xe(e,-o)))return!1;return!0}function j2(e,t,n,r){let i=e.calendar;if(!e.showsNonWorking||!i||!Br(t)||r===0||r!==n.length-1)return!1;let[o,s]=e.domain;return i.workingIndexOf(o,n[r])>=i.workingIndexOf(o,s)}function ex(e,t,n,r){let i=e.calendar;if(!i?.hasNonWorkingDays)return;let o=i.nonWorkingRuns(e.domain[0],e.domain[1]);if(o.length===0)return;let[s,a]=e.range;if(e.showsNonWorking)return o.map(c=>V2(e,c,n));let l=c=>t.some(u=>Math.abs(u.x-c)<Qy&&(u.major||r));return o.map(c=>{let u=e.forward(c.from),f={x:u,width:e.forward(Xe(c.through,1))-u,from:c.from,through:c.through};c.titles.length>0&&(f.titles=c.titles,f.label=JR(c,i.workingWeekdays),f.cut=!0);let d=u-s>Qy&&a-u>Qy;return n==="days"&&d&&!l(u)&&(f.seam=!0),f})}function tx(e){let t=e.calendar?.workingExceptionRuns(e.domain[0],e.domain[1])??[];if(t.length===0)return;let[n]=e.range;return t.map(r=>({x:Math.max(n,e.forward(r.from)),from:r.from,through:r.through,titles:r.titles,label:Y2(r)}))}function Y2(e){let t=At(e.from,e.through)+1;return`${e.titles.join(", ")}${ZR}+${t}d`}var ZR=" \xB7 ";function JR(e,t){let n=0;for(let i=e.from;i<=e.through;i=Xe(i,1))t.has(i.getUTCDay())&&n++;let r=e.titles.join(", ");return n>0?`${r}${ZR}${n}d`:r}function V2(e,t,n){let[r,i]=e.range,o=Math.max(r,e.forward(t.from)),s=Math.min(i,e.forward(Xe(t.through,1))),a={x:o,width:s-o,from:t.from,through:t.through};return t.titles.length>0&&(a.titles=t.titles,e.calendar&&(a.label=JR(t,e.calendar.workingWeekdays))),(n==="days"||n==="weeks"||t.titles.length>0)&&(a.band=!0),a}function K2(e,t,n,r){let[i,o]=e.domain,s=[i];for(let c=Sd(i,n);c<o;c=Sd(c,n))s.push(c);o>i&&s.push(o);let a=s.map(c=>e.forward(c)),l=s.length-1;return s.map((c,u)=>{let f=a[u],d=u%t.labelEvery===0;if(u===l)return{x:f,labelX:void 0,major:d,label:void 0};let p=a[u+1]-f,m=d?nx(n,c,u,r):void 0,g=u===0||u===l-1;return m!==void 0&&g&&se(m,Ri)>p&&(m=void 0),{x:f,labelX:f+p/2,major:d,label:m}})}function nx(e,t,n,r){switch(e){case"days":return`${t.getUTCMonth()+1}/${t.getUTCDate()}`;case"weeks":{let i=t.toLocaleString(r,{month:"short",timeZone:"UTC"}),o=t.getUTCDate().toString().padStart(2,"0");return`${i} ${o}`}case"months":return t.toLocaleString(r,{month:"short",timeZone:"UTC"});case"quarters":{let i=Math.floor(t.getUTCMonth()/3)+1;return`${Un(r).quarterPrefix}${i} ${t.getUTCFullYear()}`}case"years":return`${t.getUTCFullYear()}`}}function QR(e,t,n){let r=n.theme??"light",i=qy[r],o=WR(n.locale,Z2(e)),s={theme:i,styles:t.config.styles,defaults:t.config.defaults,labels:t.content.labels},a=Se("roadmap",e.roadmapDecl?.properties??[],s);return{themeName:r,theme:i,locale:o,styleCtx:s,roadmapStyle:a}}function eS(e,t,n,r,i){let{config:o,working:s}=Gf(e,t),a=KR(e,t.config.scale),{startDate:l,endDate:c}=q2(e,i,n.today,a),u=Rd(n.nonWorking)?n.nonWorking:r.roadmapStyle.nonWorking,f=u==="show"&&s.hasNonWorkingDays,d=Math.max(1,s.workingIndexOf(l,c)),p=f?Math.max(1,At(l,c)):d;return{cal:o,calendar:s,preset:a,schedule:i,startDate:l,naturalEndDate:c,spanDays:d,timelineDays:p,nonWorking:u}}function q2(e,t,n,r){let i=e.roadmapDecl?.properties??[],{config:o,working:s}=t.calendar,{startDate:a}=t,l=re(i,"length"),c=0;if(l){let m=ls(l,o);m>0&&(c=m)}let u=t.extent.contentEndDay;if(n&&!(c>0)){let m=s.workingIndexOf(a,n);m>0&&(u=Math.max(u,m))}let f=GA(r.unit,o),d=Mi(a,u>0?u:4*o.daysPerWeek,r.unit,f,s),p=Math.max(c,d);return{startDate:a,endDate:s.dateAtWorkingIndex(a,Math.max(1,p))}}function Z2(e){return _t(e.directive?.properties??[],"locale")?.value}var J2=1e-6,ks=class{constructor(t,n){M(this,"scale");M(this,"startDate");M(this,"spanDays");M(this,"unit");M(this,"calendar");this.scale=n,this.startDate=t.startDate,this.spanDays=t.spanDays,this.unit=t.preset.unit,this.calendar=t.calendar}isPast(t,n){return this.scale.indexAtX(t)>n+J2}boundaryAtOrAfterX(t){return this.boundaryAtOrAfter(this.scale.indexAtX(t))}boundaryAtOrAfter(t){return Mi(this.startDate,t,this.unit,this.calendar.daysPerUnit(this.unit),this.calendar)}captionColumn(t){let n=this.boundaryAtOrAfter(t);return{start:n,end:this.nextBoundary(n)}}nextBoundary(t){return Mi(this.startDate,t+.5,this.unit,this.calendar.daysPerUnit(this.unit),this.calendar)}xAt(t){return this.scale.forward(this.calendar.dateAtWorkingIndex(this.startDate,t))}captionCapX(t){let n=this.isPast(t,this.spanDays)?Math.max(this.spanDays,this.boundaryAtOrAfterX(t)):this.spanDays;return this.xAt(this.captionColumn(n).end)}};function tS(e,t){e.box.y+=t;for(let n of e.inlineDatePins??[])n.glyphTopLeft.y+=t;if(e.kind==="item"){for(let n of e.labelChips)n.box.y+=t;e.overflowBox&&(e.overflowBox.y+=t);return}for(let n of e.children)tS(n,t)}function Is(e,t){e.box.y+=t;for(let n of e.children)tS(n,t);for(let n of e.nested)Is(n,t)}function nS(e,t){e.box.y+=t;for(let n of e.nestedSwimlanes)Is(n,t);for(let n of[...e.anchors??[],...e.milestones??[]])n.center.y+=t,n.labelBox.y+=t,n.cutTopY+=t,n.cutBottomY+=t;for(let n of e.milestones??[])for(let r of n.slackArrows??[])r.y+=t;for(let n of e.edges??[])for(let r of n.waypoints)r.y+=t}function rS(e,t,n){e.cutTopY+=n,e.cutBottomY+=n,e.slackArrows?.forEach((r,i)=>{let o=t.slackArrows?.[i];o&&"y"in o&&(r.y+=n)})}var rx=class{constructor(t,n){M(this,"id");M(this,"anchor");this.id=t,this.anchor=n}place(t,n){let r=re(this.anchor.properties,"date"),i=_e(r);if(!i)return null;let o=t.scale.forwardWithinDomain(i);if(o===null)return null;let s=Se("anchor",this.anchor.properties,t.styleCtx),a=t.markerRowPlacements.get(this.id),l=a?.centerY??t.timeline.markerRow.y,c={x:o,y:l},u=a?.labelBox??{x:o+6+6,y:l-4,width:0,height:12},f=a?.labelSide??"right";t.entityLeftEdges.set(this.id,o),t.entityRightEdges.set(this.id,o),t.entityMidpoints.set(this.id,c);let d={id:this.id,title:this.anchor.title??this.id,center:c,radius:6,style:s,predecessorPoints:[],cutTopY:t.chartTopY,cutBottomY:t.swimlaneBottomY,bumpedUp:(a?.rowIndex??0)>0,labelBox:u,labelSide:f};return!t.scale.showsNonWorking&&!t.calendar.isWorkingDay(i)&&(d.hiddenDate=Ti(i)),d}};function Pd(e,t,n){let r=[];for(let[i,o]of e){let s=new rx(i,o).place(t,n);s&&r.push(s)}return r}function Ol(e){if(e.kind==="item"){let n=e.textSpills||e.dotSpills||e.iconSpills||e.footnoteSpills;return Math.max(e.box.x+e.box.width,n?e.decorationsRightX:Number.NEGATIVE_INFINITY,e.chipsOutside?e.chipsRightX:Number.NEGATIVE_INFINITY)}let t=Math.max(e.box.x+e.box.width,ys(e));for(let n of e.children)t=Math.max(t,Ol(n));return t}function Rs(e){let t=0;for(let n of e)t=Math.max(t,iS(n.children)),n.nested.length>0&&(t=Math.max(t,Rs(n.nested)));return t}function iS(e){let t=0;for(let n of e)n.kind==="item"?t=Math.max(t,n.box.x+n.box.width):t=Math.max(t,iS(n.children));return t}function Cd(e){let t=0;for(let n of e)t=Math.max(t,oS(n.children)),n.nested.length>0&&(t=Math.max(t,Cd(n.nested)));return t}function oS(e){let t=0;for(let n of e)n.kind==="item"?n.textSpills&&(t=Math.max(t,n.decorationsRightX)):t=Math.max(t,oS(n.children));return t}function eB(e){return e.box.y+e.box.height-Jt/2}function ix(e,t){let{box:n}=e;return{startX:e.dateSpan.startX,endX:e.dateSpan.endX,paintedX:n.x,paintedWidth:n.width,top:n.y,bottom:n.y+n.height,rowY:n.y+t/2,exitY:ox(e,t)}}function sS(e){let{box:t}=e;return{startX:t.x,endX:t.x+t.width,paintedX:t.x,paintedWidth:t.width,top:t.y,bottom:t.y+t.height}}function ox(e,t){return e.textSpills?eB(e):e.box.y+t/2}function aS(e){let{box:t,afterDate:n,beforeDate:r,hasLinkIcon:i,footnoteCount:o}=e;if(!n&&!r)return[];let s=[],a=Dn,l=t.y+sk,c=Hg(t.width);if(n){let u=zg(t.x,i),f=c?{x:t.x-Mn-a,y:l}:{x:u,y:l};s.push({side:"after",isoDate:n,glyphTopLeft:f,glyphSize:a,spilled:c})}if(r){let u=t.x+t.width,f=jg(u,o),d=c?{x:u+Mn,y:l}:{x:f,y:l};s.push({side:"before",isoDate:r,glyphTopLeft:d,glyphSize:a,spilled:c})}return s}function Od(e){let{box:t,afterDate:n,beforeDate:r,title:i}=e;if(!n&&!r)return[];let o=[],s=Dn,a=t.y+(El-s)/2,l=i?gs(t.x,!!n)+wy(i):t.x;if(n&&(l=Math.max(l,t.x+s),o.push({side:"after",isoDate:n,glyphTopLeft:{x:t.x,y:a},glyphSize:s,spilled:!1})),r){let c=t.x+t.width-Gg-s,u=l>t.x?l+br:t.x;o.push({side:"before",isoDate:r,glyphTopLeft:{x:Math.max(c,u),y:a},glyphSize:s,spilled:!1})}return o}function Wt(e){for(let t of e)if(_e(t))return t}function Wr(e){return{after:Be(e,"after").map(n=>{let r=_e(n);return r?{raw:n,date:r}:{raw:n,ref:n}})}}function $d(e){return e.floors.map(t=>t?_e(t.date):null)}function Dd(e,t,n,r,i=0,o){let s=n.map(c=>c??-1/0),a=[];for(let c=0;c<e;c++){let u=lS(c===0?t:a[c-1],s[c],i);a.push(c===0?u:Math.max(u,o?.S[c]??-1/0))}let l=a.map((c,u)=>Math.max(c,o?.E[u]??-1/0));for(let c=1;c<=e+1;c++){let u=r(a,l).memberEnd,f=[],d=[];for(let p=0;p<e;p++)f.push(p===0?a[0]:lS(d[p-1],s[p],i)),d.push(Math.max(f[p],u[p]??-1/0));if(cS(a,f)&&cS(l,d))return{S:a,E:l,passes:c,capped:!1};a=f,l=d}return r(a,l),{S:a,E:l,passes:e+1,capped:!0}}function lS(e,t,n){return t-e>n?t:e}function cS(e,t){for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function uS(e,t,n){return $d(e).map(r=>r?n.workingIndexOf(t,r):null)}var Fi=class{constructor(t,n){M(this,"plan");M(this,"S");M(this,"memberEnd");M(this,"binding");M(this,"memberCount");this.plan=t,this.S=n;let r=t.waves.length;this.memberEnd=new Array(r).fill(-1/0),this.binding=new Array(r).fill(void 0),this.memberCount=new Array(r).fill(0)}floor(t){let n=this.plan.waveOf.get(t),r=t.$type==="ItemDeclaration"?void 0:this.plan.leadOf.get(t),i;return n!==void 0&&(i=this.S[n-1]),r!==void 0&&(i=Math.max(i??-1/0,this.S[r-1])),i}apply(t,n){let r=this.floor(t);return r===void 0?n:Math.max(n,r)}accumulate(t,n){let r=this.plan.memberWave(t);r!==void 0&&(this.memberCount[r-1]++,n>this.memberEnd[r-1]&&(this.memberEnd[r-1]=n,this.binding[r-1]=t))}};function Md(e,t,n,r,i,o=0){return e.waves.map((s,a)=>{let l={id:s.name,index:a+1,start:t.S[a],end:t.E[a],memberCount:n.memberCount[a]},c=n.binding[a];if(c!==void 0&&n.memberEnd[a]===t.E[a]&&t.E[a]>t.S[a]){let p=c.name??c.title;p!==void 0&&(l.heldBy=p)}let u=i[a],f=e.floors[a]?.ref,d=a===0?r:t.E[a-1];return u!=null&&f!==void 0&&u-d>o&&(l.floorRef=f),l})}var It=.5;function fS(e,t,n,r){let i=e.waves.map(()=>n);return{plan:e,ids:e.waves.map(o=>o.name),origin:n,floors:$d(e).map(o=>o?t.forward(o):null),S:i,E:i,pass:new Fi(e,i),frozen:!1,backgroundTooltip:r}}function dS(e,t,n){e.S=t,e.E=n,e.pass=new Fi(e.plan,t)}function pS(e,t){e.S=t.S,e.E=t.E,e.frozen=!0,e.solve=t}function Fd(e,t,n){e.ids.forEach((r,i)=>{t.set(r,e.S[i]),n.set(r,e.E[i])})}function Xr(e,t,n){return n.waves?n.waves.pass.apply(e,t):t}function hS(e,t,n){n.waves&&!n.waves.frozen&&n.waves.pass.accumulate(e,t)}function mS(e,t){if(t.waves)return t.waves.plan.memberWave(e)!==void 0?"member":"background"}function gS(e,t){for(let n of[...e.S,...e.E])if(!(Math.abs(n-e.origin)<It)&&Math.abs(t-n)<It)return!0;return!1}function sx(e,t){let n=Math.round((e-t.timeline.originX)/t.timeline.pixelsPerDay);if(!t.scale.showsNonWorking)return n;let r=t.timeline.startDate;return t.calendar.workingIndexOf(r,Xe(r,n))}function Bd(e,t){return t.calendar.dateAtWorkingIndex(t.timeline.startDate,sx(e,t))}function yS(e,t,n){return Uf(n.calendar,n.timeline.startDate,sx(e,n),sx(t,n))}function $l(e,t,n){return Xr(e,Dl(e.properties,t,n),n)}var tB=!0;function xS(){return tB}function Dl(e,t,n){let{after:r}=Wr(e);if(r.length>0){let i=t;for(let o of r){if("date"in o){let a=n.scale.forwardWithinDomain(o.date);a!==null&&(i=Math.max(i,a));continue}let s=n.entityRightEdges.get(o.ref);s!==void 0&&(i=Math.max(i,s))}return i}return t}function ES(e,t,n){if(!n.calendar.hasNonWorkingDays)return;let r=nB(e);if(!r||n.calendar.isWorkingDay(r.date))return;let i=n.scale.forwardWithinDomain(r.date);if(!(i===null||Math.abs(t-i)>=It))return{key:r.key,pin:r.raw,start:Ti(Bd(t,n))}}function nB(e){let{after:t}=Wr(e);for(let n of t)if("date"in n)return{key:"after",raw:n.raw,date:n.date}}function ax(e){if(!e||e==="none"||e==="transparent")return 1;let t=e.startsWith("#")?e.slice(1):e;if(t.length===3&&(t=t.split("").map(s=>s+s).join("")),t.length!==6)return 1;let n=parseInt(t.slice(0,2),16)/255,r=parseInt(t.slice(2,4),16)/255,i=parseInt(t.slice(4,6),16)/255,o=s=>s<=.03928?s/12.92:((s+.055)/1.055)**2.4;return .2126*o(n)+.7152*o(r)+.0722*o(i)}function rB(e,t){return ax(e)>=.24?t.statusDot.onLight:t.statusDot.onDark}function wS(e,t,n){let r=rB(t,n),i={done:r.done,"in-progress":r.inProgress,"at-risk":r.atRisk,blocked:r.blocked,planned:r.planned,neutral:r.neutral};return i[e]??i.neutral}var iB=.24;function oB(e){return e==="none"?"transparent":e}function Wd(e){return ax(oB(e))>=iB?"dark":"light"}function Ss(e,t,n){return e.scale.showsNonWorking?e.scale.advanceX(t,n)-t:n*e.timeline.pixelsPerDay}function Ml(e,t){return{x:e,startX:e,y:t,height:0}}function TS(e,t){let n=e.schedule.byNode.get(t);if(!n)throw new Error(`layout: item "${t.name??t.title??"(unnamed)"}" is not in the day schedule`);return n.days}function Xd(e,t,n,r){return{cal:t.cal,schedule:t.schedule,styleCtx:{theme:t.theme,styles:e.config.styles,defaults:e.config.defaults,labels:e.content.labels},sizes:cs(e.content.sizes,t.cal),labels:e.content.labels,teams:e.content.teams,persons:e.content.persons,symbols:e.config.symbols,footnoteIndex:r.footnotes?.index??new Map,footnoteHosts:r.footnotes?.hosts??new Map,timeline:t.timeline,scale:t.scale,calendar:t.calendar,...t.axisColumns?{axisColumns:t.axisColumns}:{},bandScale:t.bandScale,entityLeftEdges:new Map,entityRightEdges:new Map,entityMidpoints:new Map,markerIds:new Set([...e.content.anchors.keys(),...e.content.milestones.keys()]),placedItems:new Map,itemFlowKey:new Map,currentFlowKey:"",slackCorridors:[],markerRowPlacements:r.markerRowPlacements??new Map,chartTopY:n.chartTopY,chartBottomY:n.chartBottomY,swimlaneBottomY:n.swimlaneBottomY,nextParallelId:0,nextGroupId:0,...t.waves?{waves:t.waves}:{}}}var sB=12,aB=4,Ud=13,lB=11;function cB(e,t){return(e?se(e,lB):0)+t}function Hd(e){return Math.max(0,Math.min(dk,(e-Vg)/2))}function lx(e){return Math.max(Vg,e-2*Hd(e))}function vS(e){if(!/[\r\n]/.test(e))return;let t=e.replace(/\r\n?/g,`
|
|
2916
|
+
}`));var OF={languageId:"nowline",fileExtensions:[".nowline"],caseInsensitive:!1,mode:"development"},Pk={AstReflection:()=>new Ga},Ck={Grammar:()=>Lk(),LanguageMetaData:()=>OF,parser:{}};var Ok={item:"an item",group:"a group",parallel:"a parallel block",swimlane:"a swimlane",anchor:"an anchor",milestone:"a milestone","floating-milestone":"a milestone without a date",wave:"a wave",label:"a label",size:"a size",status:"a status",person:"a person",team:"a team",footnote:"a footnote",roadmap:"the roadmap",style:"a style",symbol:"a symbol"},$F={item:"item",group:"group",parallel:"parallel block",swimlane:"swimlane",anchor:"anchor",milestone:"milestone","floating-milestone":"milestone",wave:"wave",label:"label",size:"size",status:"status",person:"person",team:"team",footnote:"footnote",roadmap:"roadmap",style:"style",symbol:"symbol"},_y=e=>e.charAt(0).toUpperCase()+e.slice(1);function Es(e){return e.kind==="parallel-block"?`the parallel block on line ${e.line}`:e.kind==="group-block"?`the group on line ${e.line}`:`${e.kind} "${e.name}"`}function $k(e){return e.name||e.line===void 0?`"${e.name}"`:Es({kind:e.kind==="parallel"?"parallel-block":"group-block",line:e.line})}function vy(e,t=!0){if(e.name)return`${e.kind} "${e.name}"`;let n=e.kind==="parallel"?"parallel block":e.kind,r=t?"the ":"";return e.line===void 0?`${r}${n}`:`${r}${n} on line ${e.line}`}function Dk(e){return e.name?`${_y(e.kind)} "${e.name}"`:_y(vy(e))}function Mk(e){return e===null?"has no start floor":`opens no earlier than ${e}`}function Fk(e){return e?e.title===void 0?` Did you mean wave:${e.id}?`:` Did you mean wave:${e.id} ("${e.title}")?`:""}function Bk(e){let t=e.slice(0,5).map(r=>`"${r}"`),n=e.length-t.length;return n>0?`${t.join(", ")} and ${n} more`:t.join(", ")}function fd(e){return`[${e.join(", ")}]`}var Wk={"NL.E0001":()=>"Config section must appear before roadmap.","NL.E0002":()=>"Include declarations must appear before the config section.","NL.E0003":()=>"Include declarations must appear before the roadmap section.","NL.E0004":()=>"At least one swimlane is required.","NL.E0005":e=>`Line ${e.line}: mixed tabs and spaces in indentation. Use either tabs or spaces consistently.`,"NL.E0100":e=>`Invalid version format "${e.version}". Expected format: v1, v2, etc.`,"NL.E0101":e=>`This file requires Nowline ${e.version}, but the parser only supports up to ${e.supported}.`,"NL.E0102":e=>`Unknown directive property "${e.key}". Allowed: ${e.allowed}.`,"NL.E0103":e=>`Duplicate directive property "${e.key}".`,"NL.E0104":e=>`Invalid locale "${e.value}". Use a BCP-47 tag like "en-US", "fr", or "fr-CA".`,"NL.E0200":e=>`Invalid include mode "${e.value}". Must be merge, ignore, or isolate.`,"NL.E0201":e=>`Duplicate "${e.key}" option on include.`,"NL.E0202":e=>{switch(e.reason){case"mismatch":return`Included "${e.path}" declares waves ${fd(e.child)}, but this file's waves are ${fd(e.parent)}. Every included roadmap must declare the same waves in the same order: copy this file's wave lines into "${e.path}".`;case"child-none":return`Included "${e.path}" declares no waves, but this file's waves are ${fd(e.parent)}. Copy this file's wave lines into "${e.path}" so its work joins the waves.`;case"parent-none":return`Included "${e.path}" declares waves ${fd(e.child)}, but this file declares none. Declare the same waves here so the barriers apply to the whole roadmap.`;case"floor":return`Wave "${e.id}" in "${e.path}" ${Mk(e.childFloor)}, but this file's wave "${e.id}" ${Mk(e.parentFloor)}. A wave must have the same start floor in every included roadmap.`}},"NL.E0300":e=>`Duplicate identifier "${e.name}". First declared at ${e.location}.`,"NL.E0301":e=>`${e.type} must have an identifier, a title, or both.`,"NL.E0302":e=>`${e.key}: reference "${e.value}" does not resolve to any declared entity in this file.`,"NL.E0400":e=>`Invalid duration "${e.value}". Use a raw duration literal like 0.5d, 2w, 1m, 2q. Use "size:NAME" to reference a declared size.`,"NL.E0401":e=>`Invalid size "${e.value}". Use the id of a declared size (e.g. xs, m, lg).`,"NL.E0402":e=>`Invalid effort "${e.value}". Use a raw duration literal like 0.5d, 2w, 1m, 2q.`,"NL.E0403":e=>`Invalid remaining value "${e.value}". Use a percentage like 30% or a duration literal like 1w, 0.5d.`,"NL.E0404":e=>`Remaining must be between 0% and 100%, got ${e.value}.`,"NL.E0405":e=>`Invalid ${e.key} "${e.value}". Use ISO 8601 format: YYYY-MM-DD.`,"NL.E0406":e=>`Invalid scale "${e.value}". Use a raw duration literal like 1w, 2w, 1q (no name lookup).`,"NL.E0407":e=>`Invalid calendar "${e.value}". Must be business, full, or custom.`,"NL.E0408":e=>`Property "${e.key}" requires at least one reference.`,"NL.E0410":e=>`"${e.key}:" accepts at most one inline date per direction; collapse the multiple dates to a single binding date or use a declared anchor.`,"NL.E0411":e=>`Inline date in "${e.key}:" is not allowed on ${e.type}. Allowed only on item, parallel, and group, and on a wave's after:; for a milestone use "date:" instead.`,"NL.E0412":e=>`Inline date "${e.date}" in "${e.key}:" requires the roadmap to declare "start:". Add start:YYYY-MM-DD to the roadmap.`,"NL.E0413":e=>`Inline date "${e.date}" in "${e.key}:" is before roadmap start ${e.start}.`,"NL.E0500":e=>`Anchor "${e.name}" requires a "date:" property.`,"NL.E0501":e=>`Anchor "${e.name}" has a date but the roadmap is missing "start:". Add start:YYYY-MM-DD to the roadmap.`,"NL.E0502":e=>`Anchor "${e.name}" date ${e.date} is before roadmap start ${e.start}.`,"NL.E0503":e=>`Milestone "${e.name}" requires at least one of "date:" or "after:".`,"NL.E0504":e=>`Milestone "${e.name}" date ${e.date} is before roadmap start ${e.start}.`,"NL.E0505":()=>'Footnote requires an "on:" property referencing one or more entities.',"NL.E0600":e=>`Item "${e.name}" requires a "size:" or "duration:" property.`,"NL.E0800":e=>`Invalid non-working value "${e.value}". Use hide or show.`,"NL.E0801":e=>`Invalid color "${e.value}" for "${e.key}". Use a named color, hex value, or "none".`,"NL.E0802":e=>`Invalid value "${e.value}" for "${e.key}". Allowed: ${e.allowed}.`,"NL.E0803":e=>`Unknown style property "${e.key}".`,"NL.E0804":e=>`Raw style property "${e.key}" is not allowed on ${e.entity}. Declare a named style in config and reference it via "style:id".`,"NL.E0805":e=>`Symbol id "${e.name}" collides with a built-in icon name. Reserved built-ins: ${e.builtins}.`,"NL.E0806":e=>`Symbol "${e.name}" requires a "unicode:" property (e.g. unicode:"\u{1F4B0}" or unicode:"\\u{1F464}").`,"NL.E0807":e=>`Symbol "${e.name}" unicode: must be a non-empty value.`,"NL.E0808":e=>`Symbol "${e.name}" ascii: must be 1-3 ASCII characters (got ${e.length} character${e.length===1?"":"s"}).`,"NL.E0809":e=>`Unknown symbol property "${e.key}". Allowed: unicode, ascii, link, description.`,"NL.E0810":e=>`Duplicate symbol id "${e.name}". First declared at ${e.location}.`,"NL.E0811":e=>`${e.key}: "${e.value}" is neither a built-in (${e.builtins}) nor a declared symbol. Add "symbol ${e.value} unicode:..." earlier in config or use a quoted Unicode literal.`,"NL.E0812":e=>`${e.key}: symbol "${e.value}" is referenced before its declaration. Move "symbol ${e.value}" above this entry.`,"NL.E0900":e=>`A ${e.kind} declaration takes date:, or start: and end:, or every: with optional start: and end:.`,"NL.E0901":e=>`Unknown ${e.kind} property "${e.key}". Allowed: date, start, end, every.`,"NL.E0902":e=>`${e.key}: on a ${e.kind} declaration takes one date, not a list.`,"NL.E0903":e=>`end: ${e.end} is before start: ${e.start}.`,"NL.E0904":e=>`Invalid weekday "${e.value}". Use sun, mon, tue, wed, thu, fri or sat.`,"NL.E0905":e=>`Weekday "${e.value}" is listed more than once.`,"NL.E0906":()=>"This leaves no working day in the week with no end date. Keep at least one weekday working.","NL.E0907":e=>`Duplicate ${e.kind} id "${e.name}".`,"NL.W0700":e=>`Unknown property "${e.key}" on ${e.entity}. The renderer ignores it.${e.suggested?` Did you mean "${e.suggested}"?`:""}`,"NL.W0701":e=>`Wave "${e.id}" in "${e.path}" differs from this file's definition (${e.fields.map(t=>`${t.field} ${t.there===""?"none":`"${t.there}"`} there, ${t.here===""?"none":`"${t.here}"`} here`).join("; ")}); this file's definition is used.`,"NL.W0702":e=>`"wave:" on ${e.target.kind==="default"?`"default ${e.target.entityType}"`:!e.target.name&&e.target.line!==void 0?`the ${e.target.kind==="parallel"?"parallel block":e.target.kind} on line ${e.target.line}`:`${e.target.kind} "${e.target.name}"`} is ignored: this roadmap declares no waves. Declare waves with "wave <id>" to use it, or remove the property.`,"NL.W0703":e=>`"${e.key}" on "default ${e.entityType}" is ignored: it is a roadmap-only style key. Set it on "default roadmap" instead.`,"NL.W0704":e=>`"timeline-position:${e.position}" draws no dates: "header-height:none" removes every timeline date strip. Set header-height to xs, sm, md, lg or xl to show them.`,"NL.W0705":e=>`days-per-week is ${e.daysPerWeek}, but the week leaves ${e.working} working days.`,"NL.E1100":e=>`Wave ${e.title===void 0?`on line ${e.line}`:`"${e.title}"`} needs an explicit identifier so work can reference it with wave:<id>, e.g. wave build "Build".`,"NL.E1101":e=>{switch(e.reason){case"list":return`"wave:" takes exactly one wave id; an item belongs to at most one wave. Got "${e.value}".`;case"unknown":return`Wave "${e.value}" is not declared. Declared waves: ${e.declared.length>0?e.declared.join(", "):"none"}. Add "wave ${e.value}" above the first swimlane that uses it.${Fk(e.suggestion)}`;case"forward":return`Wave "${e.value}" is used before its declaration on line ${e.line}. Declare waves above the swimlanes that use them.`;case"not-a-wave":return`"wave:" must name a wave, but "${e.value}" is ${Ok[e.kind]}.${Fk(e.suggestion)}`}},"NL.E1102":e=>`${_y(vy(e.entity))} has wave:${e.wave}, but its enclosing ${vy(e.container,!1)} has wave:${e.containerWave}. A container's wave applies to everything inside it; remove one of the two wave: properties.`,"NL.E1103":e=>{switch(e.reason){case"sequence":{let t=e.items.length>1,n=`${t?"Items":"Item"} ${e.items.map(i=>`"${i}"`).join(", ")} (wave "${e.itemWave}")`,r=typeof e.ref=="string"?`"${e.ref}"`:Es(e.ref);return`${n} ${t?"come":"comes"} after ${r} (wave "${e.refWave}") in ${Es(e.flow)}. Work in a lane or group runs in order, so it must also be ordered by wave: move ${r} below "${e.last}", or change their waves.`}case"join":return`Item "${e.name}" (wave "${e.wave}") comes after ${Es(e.block)} in ${Es(e.flow)}, and that block cannot end before its track "${e.track}" (wave "${e.trackWave}") does. Move "${e.name}" above the block or into a track of its own, or change one of their waves.`;case"after-item":return e.container?`${Dk(e.container)} has after:${e.refId}, but "${e.ref}" is in later wave "${e.refWave}". Wave "${e.refWave}" cannot start until wave "${e.wave}" ends, so "${e.name}" (wave "${e.wave}") inside it could never start: move "${e.name}" to wave "${e.refWave}" or later, or remove the after:.`:`Item "${e.name}" (wave "${e.wave}") has after:${e.refId}, but "${e.ref}" is in later wave "${e.refWave}". Wave "${e.refWave}" cannot start until wave "${e.wave}" ends, so "${e.name}" could never start: move it to wave "${e.refWave}" or later, or remove the after:.`;case"after-wave":return e.container?`${Dk(e.container)} (wave "${e.wave}") has after:${e.refId}, but work cannot wait for the end of its own wave or a later one. Use an earlier wave, or move the ${e.container.kind} to a later wave.`:`Item "${e.name}" (wave "${e.wave}") has after:${e.refId}, but work cannot wait for the end of its own wave or a later one. Use an earlier wave, or move "${e.name}" to a later wave.`;case"chain":return`Item "${e.name}" (wave "${e.wave}") could never start: through ${e.chain.join(" \u2192 ")}, it waits for work that cannot start until wave "${e.wave}" has ended. Move "${e.name}" to a later wave, or break the chain.`}},"NL.E1104":e=>{switch(e.reason){case"swimlane":return`"wave:" is not allowed on swimlane "${e.name}": a swimlane spans every wave. Put wave: on its items, or wrap them in "group wave:${e.value}".`;case"milestone":return`"wave:" is not allowed on milestone "${e.name}". To place a milestone at the end of a wave, use after:${e.value}.`;case"other":return`"wave:" is not allowed on ${$F[e.type]} "${e.name}"; only item, group, and parallel can belong to a wave.`}},"NL.E1105":e=>e.reason==="before"?`"before:" is not allowed on wave "${e.name}". A wave's end comes from its items; to give a wave a deadline, add a dated milestone: milestone ${e.name}-due date:<YYYY-MM-DD> after:${e.name}.`:`"${e.key}:" is not allowed on wave "${e.name}". A wave's span comes from its items; only after: (an anchor, a dated milestone, or one ISO date) can hold back a wave's start.`,"NL.E1106":e=>`Wave "${e.name}" has after:${e.ref}, but "${e.ref}" is ${Ok[e.kind]}. A wave's after: accepts only anchors, dated milestones, or one ISO date; to make a wave wait for work, put that work in an earlier wave.`,"NL.W1000":e=>`Now-line date ${e.date} is outside the roadmap window (${e.start} \u2013 ${e.end}); it will not be drawn.`,"NL.W1002":e=>`Wave barriers did not settle after ${e.passes} layout passes, so the drawn schedule may not respect the wave order. The roadmap probably has an ordering conflict that validation did not catch.`,"NL.W1100":e=>{let t=$k(e);return e.reason==="item"?`before:${e.ref} on ${t} can never be met: ${t} is in wave "${e.wave}", which cannot start until "${e.ref}" (wave "${e.refWave}") has finished. The overrun will be painted.`:`before:${e.ref} on ${t} can never be met: ${t} is in wave "${e.wave}", which cannot finish before wave "${e.ref}" starts. The overrun will be painted.`},"NL.W1101":e=>{let t=$k(e);switch(e.reason){case"forward-lane":return`${e.key}:${e.ref} on ${t} refers to "${e.ref}", which is in a later swimlane ("${e.lane}"). Layout places swimlanes in order and ignores references to work it has not placed yet, so it ignores this ${e.key}:. Move swimlane "${e.lane}" above swimlane "${e.ownLane}", or remove the ${e.key}:.`;case"forward-flow":return`${e.key}:${e.ref} on ${t} refers to "${e.ref}", which comes later in ${Es(e.flow)}. Layout ignores references to work it has not placed yet, so it ignores this ${e.key}:. Move "${e.ref}" above ${t}, or remove the ${e.key}:.`;case"ancestor":return`${e.key}:${e.ref} on ${t} refers to "${e.ref}", which contains it. Layout ignores references to an enclosing group or parallel, so it ignores this ${e.key}:. Remove the ${e.key}:.`;case"floating-milestone":return`${e.key}:${e.ref} on ${t} refers to milestone "${e.ref}", which has no date. Floating milestones are placed after all work, so layout ignores this ${e.key}:. Reference the milestone's predecessors or a wave instead.`}},"NL.I1000":e=>`Title on item "${e.name}" is wider than its bar at this scale; it rendered to the right of the bar.`,"NL.I1001":e=>`Label chips on item "${e.name}" did not fit inside the bar; they rendered in a spill column to the right.`,"NL.I1002":e=>`Item "${e.name}" is too narrow to show its marker at this scale; decorations spilled beside the bar.`,"NL.I1003":e=>e.anchor?`Item "${e.name}" extends past its "before:" anchor "${e.anchor}".`:`Item "${e.name}" extends past its "before:" anchor.`,"NL.I1004":e=>`Swimlane "${e.lane}" packed into ${e.rows} rows to avoid overlap.`,"NL.I1005":e=>`Swimlane "${e.lane}" is over capacity in one or more periods (red utilization band).`,"NL.I1006":e=>{switch(e.reason){case"one":return`Wave "${e.name}" has no items, so it spans no time; it is drawn as a marker in the wave strip and listed in the wave legend.`;case"many":return`Waves ${Bk(e.names)} have no items, so they span no time; they are drawn as markers in the wave strip and listed in the wave legend.`;case"all":return`None of the declared waves (${Bk(e.names)}) has items yet. The wave strip shows a placeholder until work is assigned with wave:<id>.`}},"NL.I1007":e=>`Milestone "${e.name}" (${e.date}) is overrun: wave "${e.wave}" ends ${e.end}.`,"NL.I1008":e=>`Item "${e.name}" is pinned to ${e.pin} (${e.key}:), a non-working day; it starts on ${e.start}.`};var V=e=>`\xAB\xA0${e}\xA0\xBB`,Xk={item:"un \xE9l\xE9ment",group:"un groupe",parallel:"un bloc parall\xE8le",swimlane:"une swimlane",anchor:"une ancre",milestone:"un jalon","floating-milestone":"un jalon sans date",wave:"une vague",label:"une \xE9tiquette",size:"une taille",status:"un statut",person:"une personne",team:"une \xE9quipe",footnote:"une note de bas de page",roadmap:"la roadmap",style:"un style",symbol:"un symbole"},DF={item:"l'\xE9l\xE9ment",group:"le groupe",parallel:"le bloc parall\xE8le",swimlane:"la swimlane",anchor:"l'ancre",milestone:"le jalon","floating-milestone":"le jalon",wave:"la vague",label:"l'\xE9tiquette",size:"la taille",status:"le statut",person:"la personne",team:"l'\xE9quipe",footnote:"la note de bas de page",roadmap:"la roadmap",style:"le style",symbol:"le symbole"},Ay=e=>e.charAt(0).toUpperCase()+e.slice(1);function ws(e){return e.kind==="parallel-block"?`le bloc parall\xE8le \xE0 la ligne ${e.line}`:e.kind==="group-block"?`le groupe \xE0 la ligne ${e.line}`:`${e.kind==="group"?"le groupe":e.kind==="parallel"?"le bloc parall\xE8le":"la swimlane"} ${V(e.name)}`}function ky(e,t=!1){if(e.name||e.line===void 0)return t?`de ${V(e.name)}`:V(e.name);let n=ws({kind:e.kind==="parallel"?"parallel-block":"group-block",line:e.line});return t?`du ${n.slice(3)}`:n}function Iy(e){let t=e.kind==="item"?"\xE9l\xE9ment":e.kind==="group"?"groupe":"bloc parall\xE8le",n=e.kind==="item"?"l'":"le ";return e.name?`${n}${t} ${V(e.name)}`:e.line===void 0?`${n}${t}`:`${n}${t} \xE0 la ligne ${e.line}`}function Uk(e){let t=e.kind==="parallel"?"le bloc parall\xE8le":"le groupe";return e.name?`${t} ${V(e.name)}`:e.line===void 0?t:`${t} \xE0 la ligne ${e.line}`}function Gk(e){return e?e.title===void 0?` Vouliez-vous dire wave:${e.id}\xA0?`:` Vouliez-vous dire wave:${e.id} (${V(e.title)})\xA0?`:""}function Hk(e){let t=e.slice(0,5).map(V),n=e.length-t.length;return n>0?`${t.join(", ")} et ${n} autre${n>1?"s":""}`:t.join(", ")}function dd(e){return`[${e.join(", ")}]`}function zk(e){return e===null?"n'a pas de borne de d\xE9part":`ne s'ouvre pas avant ${e}`}function jk(e){return e===""?"aucun":V(e)}var MF={title:"titre",style:"style",labels:"\xE9tiquettes",link:"lien",description:"description"},Yk={"NL.E0001":()=>"La section config doit pr\xE9c\xE9der la section roadmap.","NL.E0002":()=>"Les d\xE9clarations include doivent pr\xE9c\xE9der la section config.","NL.E0003":()=>"Les d\xE9clarations include doivent pr\xE9c\xE9der la section roadmap.","NL.E0004":()=>"Au moins une swimlane est requise.","NL.E0005":e=>`Ligne ${e.line}\xA0: tabulations et espaces m\xE9lang\xE9s dans l'indentation. Utilisez l'un ou l'autre, mais pas les deux.`,"NL.E0100":e=>`Format de version invalide \xAB\xA0${e.version}\xA0\xBB. Format attendu\xA0: v1, v2, etc.`,"NL.E0101":e=>`Ce fichier requiert Nowline ${e.version}, mais l'analyseur ne prend en charge que jusqu'\xE0 ${e.supported}.`,"NL.E0102":e=>`Propri\xE9t\xE9 de directive inconnue \xAB\xA0${e.key}\xA0\xBB. Valeurs admises\xA0: ${e.allowed}.`,"NL.E0103":e=>`Propri\xE9t\xE9 de directive \xAB\xA0${e.key}\xA0\xBB en double.`,"NL.E0104":e=>`Locale invalide \xAB\xA0${e.value}\xA0\xBB. Utilisez une \xE9tiquette BCP-47 telle que \xAB\xA0en-US\xA0\xBB, \xAB\xA0fr\xA0\xBB ou \xAB\xA0fr-CA\xA0\xBB.`,"NL.E0200":e=>`Mode d'include invalide \xAB\xA0${e.value}\xA0\xBB. Doit \xEAtre merge, ignore ou isolate.`,"NL.E0201":e=>`Option \xAB\xA0${e.key}\xA0\xBB en double sur include.`,"NL.E0202":e=>{switch(e.reason){case"mismatch":return`L'include ${V(e.path)} d\xE9clare les vagues ${dd(e.child)}, mais celles de ce fichier sont ${dd(e.parent)}. Chaque roadmap incluse doit d\xE9clarer les m\xEAmes vagues dans le m\xEAme ordre\xA0: copiez les lignes wave de ce fichier dans ${V(e.path)}.`;case"child-none":return`L'include ${V(e.path)} ne d\xE9clare aucune vague, mais celles de ce fichier sont ${dd(e.parent)}. Copiez les lignes wave de ce fichier dans ${V(e.path)} pour que son travail rejoigne les vagues.`;case"parent-none":return`L'include ${V(e.path)} d\xE9clare les vagues ${dd(e.child)}, mais ce fichier n'en d\xE9clare aucune. D\xE9clarez les m\xEAmes vagues ici pour que les barri\xE8res s'appliquent \xE0 toute la roadmap.`;case"floor":return`La vague ${V(e.id)} dans ${V(e.path)} ${zk(e.childFloor)}, mais la vague ${V(e.id)} de ce fichier ${zk(e.parentFloor)}. Une vague doit avoir la m\xEAme borne de d\xE9part dans chaque roadmap incluse.`}},"NL.E0300":e=>`Identifiant en double \xAB\xA0${e.name}\xA0\xBB. Premi\xE8re d\xE9claration \xE0 ${e.location}.`,"NL.E0301":e=>`${e.type} doit comporter un identifiant, un titre, ou les deux.`,"NL.E0302":e=>`La r\xE9f\xE9rence \xAB\xA0${e.value}\xA0\xBB de \xAB\xA0${e.key}:\xA0\xBB ne d\xE9signe aucune entit\xE9 d\xE9clar\xE9e dans ce fichier.`,"NL.E0400":e=>`Dur\xE9e invalide \xAB\xA0${e.value}\xA0\xBB. Utilisez un litt\xE9ral de dur\xE9e brut comme 0.5d, 2w, 1m, 2q. Utilisez \xAB\xA0size:NOM\xA0\xBB pour r\xE9f\xE9rencer une taille d\xE9clar\xE9e.`,"NL.E0401":e=>`Taille invalide \xAB\xA0${e.value}\xA0\xBB. Utilisez l'identifiant d'une taille d\xE9clar\xE9e (p.\xA0ex. xs, m, lg).`,"NL.E0402":e=>`Effort invalide \xAB\xA0${e.value}\xA0\xBB. Utilisez un litt\xE9ral de dur\xE9e brut comme 0.5d, 2w, 1m, 2q.`,"NL.E0403":e=>`Valeur restante invalide \xAB\xA0${e.value}\xA0\xBB. Utilisez un pourcentage tel que 30% ou un litt\xE9ral de dur\xE9e comme 1w, 0.5d.`,"NL.E0404":e=>`La valeur restante doit \xEAtre comprise entre 0 % et 100 %, re\xE7u ${e.value}.`,"NL.E0405":e=>`${e.key} invalide \xAB\xA0${e.value}\xA0\xBB. Utilisez le format ISO 8601\xA0: AAAA-MM-JJ.`,"NL.E0406":e=>`\xC9chelle invalide \xAB\xA0${e.value}\xA0\xBB. Utilisez un litt\xE9ral de dur\xE9e brut comme 1w, 2w, 1q (pas de recherche par nom).`,"NL.E0407":e=>`Calendrier invalide \xAB\xA0${e.value}\xA0\xBB. Doit \xEAtre business, full ou custom.`,"NL.E0408":e=>`La propri\xE9t\xE9 \xAB\xA0${e.key}\xA0\xBB exige au moins une r\xE9f\xE9rence.`,"NL.E0410":e=>`\xAB\xA0${e.key}:\xA0\xBB n'accepte qu'une seule date inline par direction\xA0; regroupez les dates en une seule date contraignante ou utilisez une ancre d\xE9clar\xE9e.`,"NL.E0411":e=>`Une date inline dans \xAB\xA0${e.key}:\xA0\xBB n'est pas autoris\xE9e sur ${e.type}. Autoris\xE9e seulement sur item, parallel et group, et sur le \xAB\xA0after:\xA0\xBB d'une vague\xA0; pour un milestone utilisez \xAB\xA0date:\xA0\xBB \xE0 la place.`,"NL.E0412":e=>`La date inline \xAB\xA0${e.date}\xA0\xBB dans \xAB\xA0${e.key}:\xA0\xBB exige que la roadmap d\xE9clare \xAB\xA0start:\xA0\xBB. Ajoutez start:AAAA-MM-JJ \xE0 la roadmap.`,"NL.E0413":e=>`La date inline \xAB\xA0${e.date}\xA0\xBB dans \xAB\xA0${e.key}:\xA0\xBB pr\xE9c\xE8de le d\xE9but de la roadmap (${e.start}).`,"NL.E0500":e=>`L'ancre \xAB\xA0${e.name}\xA0\xBB exige une propri\xE9t\xE9 \xAB\xA0date:\xA0\xBB.`,"NL.E0501":e=>`L'ancre \xAB\xA0${e.name}\xA0\xBB a une date, mais \xAB\xA0start:\xA0\xBB manque sur la roadmap. Ajoutez start:AAAA-MM-JJ \xE0 la roadmap.`,"NL.E0502":e=>`La date ${e.date} de l'ancre \xAB\xA0${e.name}\xA0\xBB pr\xE9c\xE8de le d\xE9but de la roadmap (${e.start}).`,"NL.E0503":e=>`Le jalon \xAB\xA0${e.name}\xA0\xBB exige au moins l'une des propri\xE9t\xE9s \xAB\xA0date:\xA0\xBB ou \xAB\xA0after:\xA0\xBB.`,"NL.E0504":e=>`La date ${e.date} du jalon \xAB\xA0${e.name}\xA0\xBB pr\xE9c\xE8de le d\xE9but de la roadmap (${e.start}).`,"NL.E0505":()=>"Une note de bas de page exige une propri\xE9t\xE9 \xAB\xA0on:\xA0\xBB r\xE9f\xE9ren\xE7ant au moins une entit\xE9.","NL.E0600":e=>`L'\xE9l\xE9ment \xAB\xA0${e.name}\xA0\xBB exige une propri\xE9t\xE9 \xAB\xA0size:\xA0\xBB ou \xAB\xA0duration:\xA0\xBB.`,"NL.E0800":e=>`Valeur non-working invalide \xAB\xA0${e.value}\xA0\xBB. Utilisez hide ou show.`,"NL.E0801":e=>`Couleur invalide \xAB\xA0${e.value}\xA0\xBB pour \xAB\xA0${e.key}\xA0\xBB. Utilisez une couleur nomm\xE9e, une valeur hexad\xE9cimale ou \xAB\xA0none\xA0\xBB.`,"NL.E0802":e=>`Valeur invalide \xAB\xA0${e.value}\xA0\xBB pour \xAB\xA0${e.key}\xA0\xBB. Valeurs admises\xA0: ${e.allowed}.`,"NL.E0803":e=>`Propri\xE9t\xE9 de style inconnue \xAB\xA0${e.key}\xA0\xBB.`,"NL.E0804":e=>`La propri\xE9t\xE9 de style brute \xAB\xA0${e.key}\xA0\xBB n'est pas permise sur ${e.entity}. D\xE9clarez un style nomm\xE9 dans la config et r\xE9f\xE9rencez-le avec \xAB\xA0style:id\xA0\xBB.`,"NL.E0805":e=>`L'identifiant de symbole \xAB\xA0${e.name}\xA0\xBB entre en conflit avec le nom d'une ic\xF4ne int\xE9gr\xE9e. Noms r\xE9serv\xE9s\xA0: ${e.builtins}.`,"NL.E0806":e=>`Le symbole \xAB\xA0${e.name}\xA0\xBB exige une propri\xE9t\xE9 \xAB\xA0unicode:\xA0\xBB (p.\xA0ex. unicode:"\u{1F4B0}" ou unicode:"\\u{1F464}").`,"NL.E0807":e=>`La propri\xE9t\xE9 \xAB\xA0unicode:\xA0\xBB du symbole \xAB\xA0${e.name}\xA0\xBB doit avoir une valeur non vide.`,"NL.E0808":e=>`La propri\xE9t\xE9 \xAB\xA0ascii:\xA0\xBB du symbole \xAB\xA0${e.name}\xA0\xBB doit compter de 1 \xE0 3 caract\xE8res ASCII (re\xE7u\xA0: ${e.length} caract\xE8re${e.length>1?"s":""}).`,"NL.E0809":e=>`Propri\xE9t\xE9 de symbole inconnue \xAB\xA0${e.key}\xA0\xBB. Valeurs admises\xA0: unicode, ascii, link, description.`,"NL.E0810":e=>`Identifiant de symbole en double \xAB\xA0${e.name}\xA0\xBB. Premi\xE8re d\xE9claration \xE0 ${e.location}.`,"NL.E0811":e=>`${e.key}: \xAB\xA0${e.value}\xA0\xBB n'est ni une ic\xF4ne int\xE9gr\xE9e (${e.builtins}) ni un symbole d\xE9clar\xE9. Ajoutez \xAB\xA0symbol ${e.value} unicode:...\xA0\xBB plus haut dans la config ou utilisez un litt\xE9ral Unicode entre guillemets.`,"NL.E0812":e=>`${e.key}: le symbole \xAB\xA0${e.value}\xA0\xBB est r\xE9f\xE9renc\xE9 avant sa d\xE9claration. D\xE9placez \xAB\xA0symbol ${e.value}\xA0\xBB au-dessus de cette entr\xE9e.`,"NL.E0900":e=>`Une d\xE9claration ${e.kind} prend date:, ou start: et end:, ou every: avec start: et end: facultatifs.`,"NL.E0901":e=>`Propri\xE9t\xE9 ${e.kind} inconnue \xAB\xA0${e.key}\xA0\xBB. Autoris\xE9es\xA0: date, start, end, every.`,"NL.E0902":e=>`${e.key}: sur une d\xE9claration ${e.kind} prend une seule date, pas une liste.`,"NL.E0903":e=>`end: ${e.end} pr\xE9c\xE8de start: ${e.start}.`,"NL.E0904":e=>`Jour de semaine invalide \xAB\xA0${e.value}\xA0\xBB. Utilisez sun, mon, tue, wed, thu, fri ou sat.`,"NL.E0905":e=>`Le jour \xAB\xA0${e.value}\xA0\xBB appara\xEEt plusieurs fois.`,"NL.E0906":()=>"Il ne reste aucun jour ouvr\xE9 dans la semaine sans date de fin. Gardez au moins un jour ouvr\xE9.","NL.E0907":e=>`Identifiant ${e.kind} \xAB\xA0${e.name}\xA0\xBB en double.`,"NL.W0700":e=>`Propri\xE9t\xE9 inconnue \xAB\xA0${e.key}\xA0\xBB sur ${e.entity}. Le moteur de rendu l'ignore.${e.suggested?` Vouliez-vous dire \xAB\xA0${e.suggested}\xA0\xBB\xA0?`:""}`,"NL.W0701":e=>`La vague ${V(e.id)} dans ${V(e.path)} diff\xE8re de la d\xE9finition de ce fichier (${e.fields.map(t=>`${MF[t.field]} ${jk(t.there)} l\xE0-bas, ${jk(t.here)} ici`).join("\xA0; ")})\xA0; la d\xE9finition de ce fichier est utilis\xE9e.`,"NL.W0702":e=>`\xAB\xA0wave:\xA0\xBB sur ${e.target.kind==="default"?V(`default ${e.target.entityType}`):!e.target.name&&e.target.line!==void 0?e.target.kind==="item"||e.target.kind==="group"||e.target.kind==="parallel"?Iy({kind:e.target.kind,name:"",line:e.target.line}):`${e.target.kind} \xE0 la ligne ${e.target.line}`:`${e.target.kind} ${V(e.target.name)}`} est ignor\xE9\xA0: cette roadmap ne d\xE9clare aucune vague. D\xE9clarez des vagues avec \xAB\xA0wave <id>\xA0\xBB pour l'utiliser, ou retirez la propri\xE9t\xE9.`,"NL.W0703":e=>`${V(e.key)} sur ${V(`default ${e.entityType}`)} est ignor\xE9\xA0: c'est une cl\xE9 de style propre \xE0 la roadmap. D\xE9finissez-la plut\xF4t sur \xAB\xA0default roadmap\xA0\xBB.`,"NL.W0704":e=>`${V(`timeline-position:${e.position}`)} n'affiche aucune date\xA0: ${V("header-height:none")} retire tous les bandeaux de dates de la frise. Donnez \xE0 header-height la valeur xs, sm, md, lg ou xl pour les afficher.`,"NL.W0705":e=>`days-per-week vaut ${e.daysPerWeek}, mais la semaine laisse ${e.working} jours ouvr\xE9s.`,"NL.E1100":e=>`La vague ${e.title===void 0?`\xE0 la ligne ${e.line}`:V(e.title)} exige un identifiant explicite pour que le travail puisse la r\xE9f\xE9rencer avec wave:<id>, p.\xA0ex. wave build "Build".`,"NL.E1101":e=>{switch(e.reason){case"list":return`\xAB\xA0wave:\xA0\xBB accepte exactement un identifiant de vague\xA0; un \xE9l\xE9ment appartient \xE0 une seule vague au plus. Re\xE7u ${V(e.value)}.`;case"unknown":return`La vague ${V(e.value)} n'est pas d\xE9clar\xE9e. Vagues d\xE9clar\xE9es\xA0: ${e.declared.length>0?e.declared.join(", "):"aucune"}. Ajoutez \xAB\xA0wave ${e.value}\xA0\xBB au-dessus de la premi\xE8re swimlane qui l'utilise.${Gk(e.suggestion)}`;case"forward":return`La vague ${V(e.value)} est utilis\xE9e avant sa d\xE9claration \xE0 la ligne ${e.line}. D\xE9clarez les vagues au-dessus des swimlanes qui les utilisent.`;case"not-a-wave":return`\xAB\xA0wave:\xA0\xBB doit nommer une vague, mais ${V(e.value)} est ${Xk[e.kind]}.${Gk(e.suggestion)}`}},"NL.E1102":e=>`${Ay(Iy(e.entity))} a wave:${e.wave}, mais ${Iy(e.container)} qui le contient a wave:${e.containerWave}. La vague d'un conteneur s'applique \xE0 tout ce qu'il contient\xA0; retirez l'une des deux propri\xE9t\xE9s wave:.`,"NL.E1103":e=>{switch(e.reason){case"sequence":{let t=e.items.length>1,n=`${t?"Les \xE9l\xE9ments":"L'\xE9l\xE9ment"} ${e.items.map(V).join(", ")} (vague ${V(e.itemWave)})`,r=typeof e.ref=="string"?V(e.ref):ws(e.ref);return`${n} ${t?"viennent":"vient"} apr\xE8s ${r} (vague ${V(e.refWave)}) dans ${ws(e.flow)}. Le travail d'une swimlane ou d'un groupe s'ex\xE9cute dans l'ordre, il doit donc aussi \xEAtre ordonn\xE9 par vague\xA0: d\xE9placez ${r} sous ${V(e.last)}, ou changez leurs vagues.`}case"join":return`L'\xE9l\xE9ment ${V(e.name)} (vague ${V(e.wave)}) vient apr\xE8s ${ws(e.block)} dans ${ws(e.flow)}, et ce bloc ne peut pas se terminer avant sa piste ${V(e.track)} (vague ${V(e.trackWave)}). D\xE9placez ${V(e.name)} au-dessus du bloc ou dans une piste distincte, ou changez l'une de leurs vagues.`;case"after-item":return e.container?`${Ay(Uk(e.container))} a after:${e.refId}, mais ${V(e.ref)} est dans la vague ult\xE9rieure ${V(e.refWave)}. La vague ${V(e.refWave)} ne peut pas d\xE9marrer avant la fin de la vague ${V(e.wave)}, donc ${V(e.name)} (vague ${V(e.wave)}) \xE0 l'int\xE9rieur ne pourrait jamais d\xE9marrer\xA0: d\xE9placez ${V(e.name)} dans la vague ${V(e.refWave)} ou une vague ult\xE9rieure, ou retirez le after:.`:`L'\xE9l\xE9ment ${V(e.name)} (vague ${V(e.wave)}) a after:${e.refId}, mais ${V(e.ref)} est dans la vague ult\xE9rieure ${V(e.refWave)}. La vague ${V(e.refWave)} ne peut pas d\xE9marrer avant la fin de la vague ${V(e.wave)}, donc ${V(e.name)} ne pourrait jamais d\xE9marrer\xA0: d\xE9placez-le dans la vague ${V(e.refWave)} ou une vague ult\xE9rieure, ou retirez le after:.`;case"after-wave":{let t=e.container?.kind==="parallel"?"bloc parall\xE8le":"groupe";return e.container?`${Ay(Uk(e.container))} (vague ${V(e.wave)}) a after:${e.refId}, mais le travail ne peut pas attendre la fin de sa propre vague ni d'une vague ult\xE9rieure. Utilisez une vague ant\xE9rieure, ou d\xE9placez le ${t} dans une vague ult\xE9rieure.`:`L'\xE9l\xE9ment ${V(e.name)} (vague ${V(e.wave)}) a after:${e.refId}, mais le travail ne peut pas attendre la fin de sa propre vague ni d'une vague ult\xE9rieure. Utilisez une vague ant\xE9rieure, ou d\xE9placez ${V(e.name)} dans une vague ult\xE9rieure.`}case"chain":return`L'\xE9l\xE9ment ${V(e.name)} (vague ${V(e.wave)}) ne pourrait jamais d\xE9marrer\xA0: via ${e.chain.join(" \u2192 ")}, il attend du travail qui ne peut pas d\xE9marrer avant la fin de la vague ${V(e.wave)}. D\xE9placez ${V(e.name)} dans une vague ult\xE9rieure, ou rompez la cha\xEEne.`}},"NL.E1104":e=>{switch(e.reason){case"swimlane":return`\xAB\xA0wave:\xA0\xBB n'est pas autoris\xE9 sur la swimlane ${V(e.name)}\xA0: une swimlane couvre toutes les vagues. Placez wave: sur ses \xE9l\xE9ments, ou regroupez-les dans \xAB\xA0group wave:${e.value}\xA0\xBB.`;case"milestone":return`\xAB\xA0wave:\xA0\xBB n'est pas autoris\xE9 sur le jalon ${V(e.name)}. Pour placer un jalon \xE0 la fin d'une vague, utilisez after:${e.value}.`;case"other":return`\xAB\xA0wave:\xA0\xBB n'est pas autoris\xE9 sur ${DF[e.type]} ${V(e.name)}\xA0; seuls item, group et parallel peuvent appartenir \xE0 une vague.`}},"NL.E1105":e=>e.reason==="before"?`\xAB\xA0before:\xA0\xBB n'est pas autoris\xE9 sur la vague ${V(e.name)}. La fin d'une vague d\xE9coule de ses \xE9l\xE9ments\xA0; pour donner une \xE9ch\xE9ance \xE0 une vague, ajoutez un jalon dat\xE9\xA0: milestone ${e.name}-due date:<AAAA-MM-JJ> after:${e.name}.`:`\xAB\xA0${e.key}:\xA0\xBB n'est pas autoris\xE9 sur la vague ${V(e.name)}. L'\xE9tendue d'une vague d\xE9coule de ses \xE9l\xE9ments\xA0; seul after: (une ancre, un jalon dat\xE9 ou une date ISO) peut retarder le d\xE9but d'une vague.`,"NL.E1106":e=>`La vague ${V(e.name)} a after:${e.ref}, mais ${V(e.ref)} est ${Xk[e.kind]}. Le after: d'une vague accepte seulement des ancres, des jalons dat\xE9s ou une date ISO\xA0; pour qu'une vague attende du travail, placez ce travail dans une vague ant\xE9rieure.`,"NL.W1002":e=>`Les barri\xE8res de vagues ne se sont pas stabilis\xE9es apr\xE8s ${e.passes} passes de mise en page\xA0; le calendrier dessin\xE9 pourrait donc ne pas respecter l'ordre des vagues. La roadmap comporte probablement un conflit d'ordre que la validation n'a pas d\xE9tect\xE9.`,"NL.W1100":e=>{let t=ky(e);return e.reason==="item"?`before:${e.ref} sur ${t} ne peut jamais \xEAtre respect\xE9\xA0: ${t} est dans la vague ${V(e.wave)}, qui ne peut pas d\xE9marrer avant la fin de ${V(e.ref)} (vague ${V(e.refWave)}). Le d\xE9passement sera peint.`:`before:${e.ref} sur ${t} ne peut jamais \xEAtre respect\xE9\xA0: ${t} est dans la vague ${V(e.wave)}, qui ne peut pas se terminer avant le d\xE9but de la vague ${V(e.ref)}. Le d\xE9passement sera peint.`},"NL.W1101":e=>{let t=ky(e);switch(e.reason){case"forward-lane":return`${e.key}:${e.ref} sur ${t} r\xE9f\xE9rence ${V(e.ref)}, qui se trouve dans une swimlane ult\xE9rieure (${V(e.lane)}). La mise en page place les swimlanes dans l'ordre et ignore les r\xE9f\xE9rences \xE0 du travail qu'elle n'a pas encore plac\xE9, elle ignore donc ce ${e.key}:. D\xE9placez la swimlane ${V(e.lane)} au-dessus de la swimlane ${V(e.ownLane)}, ou retirez le ${e.key}:.`;case"forward-flow":return`${e.key}:${e.ref} sur ${t} r\xE9f\xE9rence ${V(e.ref)}, qui vient plus tard dans ${ws(e.flow)}. La mise en page ignore les r\xE9f\xE9rences \xE0 du travail qu'elle n'a pas encore plac\xE9, elle ignore donc ce ${e.key}:. D\xE9placez ${V(e.ref)} au-dessus ${ky(e,!0)}, ou retirez le ${e.key}:.`;case"ancestor":return`${e.key}:${e.ref} sur ${t} r\xE9f\xE9rence ${V(e.ref)}, qui le contient. La mise en page ignore les r\xE9f\xE9rences \xE0 un groupe ou un bloc parall\xE8le englobant, elle ignore donc ce ${e.key}:. Retirez le ${e.key}:.`;case"floating-milestone":return`${e.key}:${e.ref} sur ${t} r\xE9f\xE9rence le jalon ${V(e.ref)}, qui n'a pas de date. Les jalons sans date sont plac\xE9s apr\xE8s tout le travail, la mise en page ignore donc ce ${e.key}:. R\xE9f\xE9rencez plut\xF4t les pr\xE9d\xE9cesseurs du jalon ou une vague.`}},"NL.I1006":e=>{switch(e.reason){case"one":return`La vague ${V(e.name)} n'a aucun \xE9l\xE9ment, elle ne couvre donc aucune dur\xE9e\xA0; elle est dessin\xE9e comme un rep\xE8re dans la bande des vagues et list\xE9e dans la l\xE9gende des vagues.`;case"many":return`Les vagues ${Hk(e.names)} n'ont aucun \xE9l\xE9ment, elles ne couvrent donc aucune dur\xE9e\xA0; elles sont dessin\xE9es comme des rep\xE8res dans la bande des vagues et list\xE9es dans la l\xE9gende des vagues.`;case"all":return`Aucune des vagues d\xE9clar\xE9es (${Hk(e.names)}) n'a encore d'\xE9l\xE9ment. La bande des vagues affiche un espace r\xE9serv\xE9 jusqu'\xE0 ce que du travail soit affect\xE9 avec wave:<id>.`}},"NL.I1007":e=>`Le jalon ${V(e.name)} (${e.date}) est d\xE9pass\xE9\xA0: la vague ${V(e.wave)} se termine le ${e.end}.`,"NL.I1008":e=>`L'\xE9l\xE9ment ${V(e.name)} est \xE9pingl\xE9 \xE0 ${e.pin} (${e.key}:), un jour non ouvr\xE9\xA0; il d\xE9marre le ${e.start}.`};var Vk={};var Kk={};var FF=new Map([["en-US",Wk],["fr",Yk],["fr-CA",Vk],["fr-FR",Kk]]);function en(e,t,...n){for(let r of BF(e)){let o=FF.get(r)?.[t];if(o)return o(...n)}return t}var qk="en-US";function BF(e){let t=[],n=WF(e);for(;n.length>0;){t.includes(n)||t.push(n);let r=n.lastIndexOf("-");if(r<=0)break;n=n.slice(0,r)}return t.includes(qk)||t.push(qk),t}function WF(e){return e.split("-").map((n,r)=>r===0?n.toLowerCase():/^[a-zA-Z]{2}$/.test(n)?n.toUpperCase():n).join("-")}var XF=/[\\/]/;function Qk(e){for(let t=e.length-1;t>=0;t--){let n=e.charCodeAt(t);if(n===47||n===92)return t}return-1}function Zk(...e){for(let t of e)if(t){if(t.includes("\\")&&!t.includes("/"))return"\\";if(t.includes("/"))return"/"}return"/"}function UF(e){return e?e[0]==="/"||e[0]==="\\"?!0:e.length>=3&&/^[A-Za-z]:[\\/]/.test(e):!1}function eI(e){let t=Qk(e);return t<0?".":t===0?e[0]:t===2&&/^[A-Za-z]:[\\/]/.test(e)?e.slice(0,3):e.slice(0,t)}function Ts(e){let t=Qk(e);return t<0?e:e.slice(t+1)}function Ry(e,t){if(UF(t))return Jk(t,Zk(t));let n=Zk(e,t);return Jk(`${e}${n}${t}`,n)}function Jk(e,t){let n="",r=e,i=/^([A-Za-z]:)([\\/])?/.exec(r);i?(n=i[1]+(i[2]?t:""),r=r.slice(i[0].length)):(r[0]==="/"||r[0]==="\\")&&(n=t,r=r.replace(/^[\\/]+/,""));let o=[];for(let s of r.split(XF))if(!(s===""||s===".")){if(s===".."){o.length>0&&o[o.length-1]!==".."?o.pop():n||o.push("..");continue}o.push(s)}return n+o.join(t)}function kt(e){return/[\r\n]/.test(e)?e.replace(/\s*[\r\n]+\s*/g," ").trim():e}function tI(e,t,n){if(e===t)return 0;let r=e.length,i=t.length;if(Math.abs(r-i)>n)return n+1;if(r===0)return i;if(i===0)return r;let o=new Array(i+1),s=new Array(i+1);for(let a=0;a<=i;a++)o[a]=a;for(let a=1;a<=r;a++){s[0]=a;let l=a;for(let u=1;u<=i;u++){let f=e.charCodeAt(a-1)===t.charCodeAt(u-1)?0:1;s[u]=Math.min(o[u]+1,s[u-1]+1,o[u-1]+f),s[u]<l&&(l=s[u])}if(l>n)return n+1;let c=o;o=s,s=c}return o[i]}function nI(e,t,n=2){let r,i=n+1;for(let o of t){let s=tI(e,o,n);if(s<i&&(r=o,i=s,s===0))break}return r}function rI(e,t,n=2){let r,i=n+1,o=!1;for(let s of t){let a=tI(e,s,n);a<i?(r=s,i=a,o=!1):a===i&&a<=n&&s!==r&&(o=!0)}return o?void 0:r}function Re(e){return e.name??(e.title===void 0?"<unnamed>":kt(e.title))}function Fr(e){return e.$type==="NonWorkingDeclaration"?"non-working":e.$type.replace(/Declaration$|Block$/,"").toLowerCase()}function Tl(e){let t=Fr(e),n=e.name??(e.title===void 0?void 0:kt(e.title));return n?`${t} "${n}"`:t}function xn(e){let t=e.$cstNode;return t?t.range.start.line+1:0}function pd(e,t){return`"${e}" cannot be set on "default ${t}". Identity-defining, sizing, sequencing, reference, and prose properties must be explicit on each entity.`}function tn(e){let t=new Set,n=[];for(let r of e.roadmapEntries)!Tt(r)||!r.name||t.has(r.name)||(t.add(r.name),n.push(r));return n}function GF(e){let t=new Map;return tn(e).forEach((n,r)=>{t.set(n.name,r+1)}),t}function oI(e){return(e.properties??[]).filter(n=>Q(n)==="wave")}function sI(e){return oI(e)[0]}function Sy(e){return e.value!==void 0?e.value:e.values.length===1?e.values[0]:`[${e.values.join(", ")}]`}function HF(e){let t=e;for(;t?.$container&&!ss(t.$container);)t=t.$container;let n=t?.$container;if(!(!t||!n||!ss(n)))return{file:n,index:n.roadmapEntries.indexOf(t),waveDecls:aI(n)}}function aI(e){let t=new Map;return e.roadmapEntries.forEach((n,r)=>{Tt(n)&&n.name&&!t.has(n.name)&&t.set(n.name,r)}),t}function by(e,t,n,r=HF(t)){let i=Sy(e);if(e.value===void 0&&e.values.length!==1)return{status:"list",value:i};let o=n.get(i);if(o===void 0)return{status:"missing",value:i};if(r){let s=r.waveDecls.get(i);if(s!==void 0&&(r.index<0||s>r.index))return{status:"forward",value:i,line:xn(r.file.roadmapEntries[s])}}return{status:"valid",id:i,index:o}}function zF(e){return $e(e)||tt(e)}function jF(e,t,n,r){let i=sI(e);if(!i)return t;let o=by(i,e,n,r);if(o.status==="valid")return t??o.index}function hd(e,t){let n=new Map,r=new Map,i=new Map,o=(s,a,l)=>{let c=jF(s,a,t,l);c!==void 0&&n.set(s,c);let u=c;if($e(s)||tt(s)){let f=[];for(let d of _t(s))f.push(o(d,c,l));c===void 0&&($e(s)?u=f[0]:f.length>0&&!f.includes(void 0)&&(u=Math.min(...f)))}return u!==void 0&&r.set(s,u),u};for(let s of e){let a,l=s.$container;if(ss(l)){let c=i.get(l);c||(c=aI(l),i.set(l,c)),a={file:l,index:l.roadmapEntries.indexOf(s),waveDecls:c}}for(let c of _t(s))o(c,void 0,a)}return{waveOf:n,leadOf:r}}function lI(e){return(e.properties??[]).find(n=>Q(n)==="date")?.value}function _s(e){let t=xA(e);return n=>t.get(n)}function vl(e,t){let n=null;for(let r of e.properties){if(Q(r)!=="after")continue;let i=r.value!==void 0?[r.value]:r.values;for(let o of i){if(!o)continue;let s;if(ot.test(o))s=o;else{let a=t(o);(os(a)||mn(a))&&(s=lI(a))}s===void 0||!He(s)||(n===null||s>n.date)&&(n={date:s,ref:o})}}return n}var cI=new Set(["before","date","start","length","duration","size","capacity","remaining","wave"]);function Li(e){return Tt(e.$container)&&cI.has(Q(e))}var YF={ItemDeclaration:"item",GroupBlock:"group",ParallelBlock:"parallel",SwimlaneDeclaration:"swimlane",AnchorDeclaration:"anchor",MilestoneDeclaration:"milestone",WaveDeclaration:"wave",LabelDeclaration:"label",SizeDeclaration:"size",StatusDeclaration:"status",PersonDeclaration:"person",TeamDeclaration:"team",FootnoteDeclaration:"footnote",RoadmapDeclaration:"roadmap",StyleDeclaration:"style",SymbolDeclaration:"symbol"};function _l(e){return YF[e.$type]??Fr(e)}function VF(e,t){let n=[],r=Re(e),i=!e.name&&e.title===void 0;if(e.name||n.push({severity:"error",code:"NL.E1100",args:{...e.title===void 0?{}:{title:kt(e.title)},line:xn(e)},node:e}),i)return n;for(let o of e.properties){let s=Q(o);if(cI.has(s)){n.push({severity:"error",code:"NL.E1105",args:s==="before"?{reason:"before",name:r}:{reason:"other",key:s,name:r},node:o,property:"key"});continue}if(s!=="after")continue;let a=o.value!==void 0?[o.value]:o.values;for(let l of a){if(!l||ot.test(l))continue;let c=t(l);if(!(!c||os(c))){if(mn(c)){if(lI(c)!==void 0)continue;n.push({severity:"error",code:"NL.E1106",args:{name:r,ref:l,kind:"floating-milestone"},node:o});continue}n.push({severity:"error",code:"NL.E1106",args:{name:r,ref:l,kind:_l(c)},node:o})}}}return n}function md(e){let t=_s(e);return e.roadmapEntries.filter(Tt).flatMap(n=>VF(n,t))}function KF(e){return[...Dn(e,{config:!0,roadmap:!0})].filter(t=>fA(t)?nt(t):!Tt(t))}function qF(e,t){let n=e.toLowerCase(),r=t.filter(o=>o.title!==void 0&&kt(o.title).toLowerCase()===n),i;if(r.length===1)i=r[0];else{let o=rI(e,t.map(s=>s.name));i=o===void 0?void 0:t.find(s=>s.name===o)}if(i)return i.title===void 0?{id:i.name}:{id:i.name,title:kt(i.title)}}function ZF(e,t,n){let r=n(t);if(r)return _l(r);for(let i of e.configEntries)if((Dt(i)||xi(i))&&i.name===t)return _l(i)}function JF(e,t){let n=e.$container;for(;zF(n);){let r=sI(n);if(r)return by(r,n,t).status==="valid"?{container:n,prop:r}:void 0;n=n?.$container}}function iI(e,t){let n=t.name??(t.title===void 0?"":kt(t.title));return n?{kind:e,name:n}:{kind:e,name:n,line:xn(t)}}function QF(e){if(nt(e))return{kind:"default",entityType:e.entityType};let t=e,n=t.name??(t.title===void 0?"":kt(t.title)),r=_l(e);return n?{kind:r,name:n}:{kind:r,name:n,line:xn(e)}}function e2(e,t,n,r,i,o){let s=by(n,t,i);switch(s.status){case"list":return{severity:"error",code:"NL.E1101",args:{reason:"list",value:s.value},node:n};case"forward":return{severity:"error",code:"NL.E1101",args:{reason:"forward",value:s.value,line:s.line},node:n};case"missing":{let u=ZF(e,s.value,o),f=qF(s.value,r);return{severity:"error",code:"NL.E1101",args:u===void 0?{reason:"unknown",value:s.value,declared:r.map(d=>d.name),...f?{suggestion:f}:{}}:{reason:"not-a-wave",value:s.value,kind:u,...f?{suggestion:f}:{}},node:n}}case"valid":break}let a=JF(t,i);if(!a)return;let l=Sy(a.prop);if(l===s.id)return;let c=Ke(t)?"item":$e(t)?"group":"parallel";return{severity:"error",code:"NL.E1102",args:{entity:iI(c,t),wave:s.id,container:iI($e(a.container)?"group":"parallel",a.container),containerWave:l},node:n}}function gd(e){let t=tn(e),n=t.length>0,r=GF(e),i=_s(e),o=[];for(let s of KF(e)){let a=oI(s);if(a.length===0)continue;if(!n){for(let m of a)o.push({severity:"warning",code:"NL.W0702",args:{target:QF(s)},node:m,property:"key"});continue}if(nt(s)){for(let m of a)o.push({severity:"error",message:pd("wave",s.entityType),node:m});continue}let l=s,c=Re(l);if(!l.name&&l.title===void 0&&!Ke(s)&&!$e(s)&&!tt(s))continue;if(qe(s)||mn(s)){for(let m of a)o.push({severity:"error",code:"NL.E1104",args:{reason:qe(s)?"swimlane":"milestone",name:c,value:Sy(m)},node:m});continue}if(!Ke(s)&&!$e(s)&&!tt(s)){for(let m of a)o.push({severity:"error",code:"NL.E1104",args:{reason:"other",type:_l(s),name:c},node:m});continue}let[f,...d]=a,p=e2(e,s,f,t,r,i);if(p&&o.push(p),d.length>0){let m=a.flatMap(g=>g.value!==void 0?[g.value]:g.values);for(let g of d)o.push({severity:"error",code:"NL.E1101",args:{reason:"list",value:`[${m.join(", ")}]`},node:g})}}return o}var t2=["after-wave","after-item","sequence","join"];function Pi(e){return e.name??(e.title===void 0?void 0:kt(e.title))}function yd(e){let t=Pi(e);if(qe(e))return{kind:"swimlane",name:Re(e)};let n=$e(e);return t?{kind:n?"group":"parallel",name:t}:{kind:n?"group-block":"parallel-block",line:xn(e)}}function uI(e){let t=Pi(e);return t!==void 0||e.$type==="ItemDeclaration"?t:{kind:$e(e)?"group-block":"parallel-block",line:xn(e)}}function fI(e){return e.$type==="ItemDeclaration"||Pi(e)!==void 0?{name:Re(e)}:{name:"",kind:$e(e)?"group":"parallel",line:xn(e)}}function n2(e){let t=$e(e)?"group":"parallel",n=Pi(e);return n?{kind:t,name:n}:{kind:t,name:"",line:xn(e)}}function Ny(e){return(e.value!==void 0?[e.value]:e.values).filter(t=>!!t)}function r2(e){return mn(e)&&!e.properties.some(t=>Q(t)==="date")}function vs(e,t,n={}){if(t.length===0)return[];let r=new Map;t.forEach((k,O)=>{k.name&&r.set(k.name,O+1)});let i=k=>t[k-1]?.name??"",{lanes:o,lookup:s}=e,{waveOf:a,leadOf:l}=hd(o,r),c=[],u=new Map,f=0,d=(k,O,X,U)=>{let K=c.length,q={node:k,lane:O,parent:X,children:[],prev:U,start:f++,reg:-1,ew:a.get(k),lw:l.get(k),after:[],afterWaves:[]};if(c.push(q),$e(k)||tt(k)){let J=-1;for(let ie of _t(k))J=d(ie,O,K,$e(k)?J:-1),q.children.push(J);q.reg=f++}else q.reg=q.start;if(k.name){let J=u.get(k.name)??[];J.push(K),u.set(k.name,J)}return K};o.forEach((k,O)=>{let X=-1;for(let U of _t(k))X=d(U,O,-1,X)});let p=(k,O)=>{let X=u.get(k);if(X){for(let U=X.length-1;U>=0;U--)if(c[X[U]].reg<c[O].start)return X[U]}},m=[],g=n.suppressCycleRefs??!0?o2(c,o,s):()=>!1;for(let k=0;k<c.length;k++){let O=c[k],X=fI(O.node);for(let U of O.node.properties){let K=Q(U);if(!(K!=="after"&&K!=="before"))for(let q of Ny(U)){if(ot.test(q))continue;let J=p(q,k),ie=J===void 0?r.get(q):void 0;if(K==="after"&&(J!==void 0?O.after.push({from:J,prop:U,ref:q}):ie!==void 0&&O.afterWaves.push({prop:U,ref:q,j:ie})),J!==void 0||ie!==void 0)continue;let ge=u.get(q)?.[0];if(ge===void 0&&!r2(s(q))||g(O.node.name,K,q))continue;let fe=!1;for(let de=O.parent;de>=0&&!fe;de=c[de].parent)fe=c[de].node.name===q;m.push({severity:"warning",code:"NL.W1101",args:ge===void 0?{reason:"floating-milestone",key:K,ref:q,...X}:fe?{reason:"ancestor",key:K,ref:q,...X}:c[ge].lane!==O.lane?{reason:"forward-lane",key:K,ref:q,...X,lane:Re(o[c[ge].lane]),ownLane:Re(o[O.lane])}:{reason:"forward-flow",key:K,ref:q,...X,flow:yd(i2(c,o,k,ge))},node:U})}}}let w=new Array(c.length),x=new Array(c.length);for(let k=c.length-1;k>=0;k--){let O=c[k];if(O.node.$type==="ItemDeclaration"){w[k]=O.ew,x[k]=O.ew;continue}for(let X of O.children){let U=w[X],K=x[X];U!==void 0&&(w[k]=Math.max(w[k]??U,U)),K!==void 0&&(x[k]=Math.min(x[k]??K,K))}}for(let k=0;k<c.length;k++){let O=w[k];if(O===void 0)continue;let X=fI(c[k].node);for(let U of c[k].node.properties)if(Q(U)==="before")for(let K of Ny(U)){if(ot.test(K))continue;let q=p(K,k);if(q!==void 0){let ie=x[q];if(ie===void 0||O<=ie)continue;m.push({severity:"warning",code:"NL.W1100",args:{reason:"item",ref:K,...X,wave:i(O),refWave:i(ie)},node:U});continue}let J=r.get(K);J===void 0||O<J||m.push({severity:"warning",code:"NL.W1100",args:{reason:"wave",ref:K,...X,wave:i(O)},node:U})}}let y=k=>c[k].node.$type!=="ItemDeclaration",T=k=>{let{parent:O}=c[k];return O<0?!1:tt(c[O].node)||c[O].children[0]===k},E=new Array(c.length).fill(0),_=new Array(c.length).fill(0),R=k=>{let O=c[k],X=[];O.lw!==void 0&&X.push({term:{kind:O.ew!==void 0?"wave":"lead"},value:O.lw-1});for(let U of O.afterWaves)X.push({term:{kind:"after-wave",prop:U.prop,ref:U.ref},value:U.j});T(k)&&X.push({term:{kind:"parent",from:O.parent},value:E[O.parent]}),O.prev>=0&&X.push({term:{kind:"seq",from:O.prev},value:_[O.prev]});for(let U of O.after)X.push({term:{kind:"after",from:U.from,prop:U.prop,ref:U.ref},value:_[U.from]});return X},F=k=>{let O=E[k];for(let X of c[k].children)O=Math.max(O,_[X]);return O},C=c.map((k,O)=>[2*O+1]),W=c.map(()=>[]);for(let k=0;k<c.length;k++){let O=c[k];T(k)&&C[O.parent].push(2*k),O.prev>=0&&W[O.prev].push(2*k);for(let X of O.after)W[X.from].push(2*k);O.parent>=0&&W[k].push(2*O.parent+1)}let j=[],P=new Array(2*c.length).fill(!0);for(let k=0;k<c.length;k++)j.push(2*k,2*k+1);for(let k=0;k<j.length;k++){let O=j[k];P[O]=!1;let X=O>>1,U=(O&1)===1,K=U?F(X):Math.max(0,...R(X).map(q=>q.value));if(!(K<=(U?_[X]:E[X]))){U?_[X]=K:E[X]=K;for(let q of U?W[X]:C[X])P[q]||(P[q]=!0,j.push(q))}}let S=(k,O)=>R(k).filter(X=>X.value===O).map(X=>X.term),b=(k,O)=>{if(!y(k))return[{kind:"start"}];let X=c[k].children.filter(U=>_[U]===O).map(U=>({kind:"child",from:U}));return X.length>0?$e(c[k].node)?X.reverse():X:E[k]===O?[{kind:"start"}]:[]},$=(k,O)=>{let X=[{i:k,via:k}];for(;X.length>0;){let{i:U,via:K}=X.pop(),q=b(U,O);for(let J=q.length-1;J>=0;J--){let ie=q[J];if(ie.kind==="start"){let ge=c[U].ew;if(ge!==void 0&&ge-1===O)return{origin:U,via:K}}else ie.kind==="child"&&X.push({i:ie.from,via:U===k?ie.from:K})}}},I=(k,O)=>{let X=c[k].ew;return X!==void 0&&X-1===O},A=(k,O)=>{let X=k;for(;c[X].prev>=0||T(X);){let U=c[X].prev;if(U<0){X=c[X].parent;continue}let K=c[U].ew;if(K!==void 0&&K>O)return U;X=U}},v=new Map,D=[],L=new Map,B=(k,O,X)=>`${k}:${c[k].node.properties.indexOf(O)}:${X}`,z=(k,O)=>{let X=[],U=k;for(;;){let K=S(U,O);for(let J of K)if(J.kind==="after-wave")X.push({variant:"after-wave",owner:U,prop:J.prop,ref:J.ref});else if(J.kind==="after")I(J.from,O)&&X.push({variant:"after-item",owner:U,prop:J.prop,ref:J.ref});else if(J.kind==="seq"){let ie=J.from,ge=c[ie].node;if(tt(ge)&&c[ie].ew===void 0){let fe=$(ie,O),de=fe&&(Pi(c[fe.via].node)??Pi(c[fe.origin].node));de&&X.push({variant:"join",owner:U,block:ie,track:de})}else if(I(ie,O)){let fe=uI(ge);fe&&X.push({variant:"sequence",owner:U,pred:ie,ref:fe})}}let q=K.find(J=>J.kind==="parent");if(!q)break;U=q.from}for(let K of t2){let q=X.find(J=>J.variant===K);if(q)return q}},G=(k,O)=>{let X=[{key:2*k,from:-1}],U=new Set([2*k]),K,q=(J,ie)=>{U.has(J)||(U.add(J),X.push({key:J,from:ie}))};for(let J=0;J<X.length;J++){let ie=X[J].key>>1;if(ie!==k&&v.has(ie)){K??(K=ie);continue}if((X[J].key&1)===1){for(let de of b(ie,O))de.kind==="start"?q(2*ie,J):de.kind==="child"&&q(2*de.from+1,J);continue}let ge=S(ie,O),fe=ge.find(de=>de.kind==="wave"||de.kind==="lead")??ge.find(de=>de.kind==="after-wave");if(fe){let de=[];for(let ht=J;ht>=0;ht=X[ht].from){let mt=X[ht].key>>1;de[de.length-1]!==mt&&de.push(mt)}let rt=Re(c[ie].node);return{path:de,origin:fe.kind==="after-wave"?`${rt} (after:${fe.ref})`:`${rt} (wave "${i(O+1)}")`}}for(let de of ge)de.kind==="parent"?q(2*de.from,J):(de.kind==="seq"||de.kind==="after")&&q(2*de.from+1,J)}return{hit:K}},ee=(k,O,X,U)=>{let K=Re(c[O].node),q=i(X),J=i(U+1),ie=c[k.owner].node,ge=k.owner===O?void 0:n2(ie);switch(k.variant){case"after-wave":{let fe=c[k.owner].ew===void 0?void 0:ge;return{node:k.prop,run:[O],build:()=>({reason:"after-wave",name:K,wave:q,refId:k.ref,...fe?{container:fe}:{}})}}case"after-item":return{node:k.prop,run:[O],build:()=>({reason:"after-item",name:K,wave:q,refId:k.ref,ref:k.ref,refWave:J,...ge?{container:ge}:{}})};case"join":{let fe=c[k.block];return{node:c[O].node,run:[O],build:()=>({reason:"join",name:K,wave:q,block:yd(fe.node),flow:yd(dI(c,o,k.block)),track:k.track,trackWave:J})}}case"sequence":{let fe=k.pred,de=c[fe].parent,rt=ht=>{if(de<0)return c[ht].lane===c[fe].lane;for(let mt=c[ht].parent;mt>=0;mt=c[mt].parent)if(mt===de)return!0;return!1};return{node:c[O].node,run:[O],build:ht=>{let mt=ht.filter(rt);return{reason:"sequence",items:mt.map(jl=>Re(c[jl].node)),itemWave:q,ref:k.ref,refWave:i(c[fe].ew??U+1),flow:yd(dI(c,o,fe)),last:Re(c[mt[mt.length-1]].node)}},seq:{pred:fe,ref:k.ref,inFlow:rt}}}}},Y=(k,O)=>(D.push(O),k!==void 0&&L.set(k,O),O),ne=(k,O,X,U)=>{let K=k.variant==="sequence"?`sequence:${k.pred}:${X}`:k.variant==="join"?`join:${k.block}:${X}`:`${k.variant}:${B(k.owner,k.prop,k.ref)}`,q=L.get(K);return q?(q.run.push(O),q):Y(K,ee(k,O,X,U))};for(let k=0;k<c.length;k++){let O=c[k],X=O.ew;if(O.node.$type!=="ItemDeclaration"||X===void 0||E[k]<X)continue;let U=E[k],K=z(k,U),q;if(K)q=ne(K,k,X,U);else{let J=G(k,U);if("path"in J){let ie=J.path.slice(1).filter(rt=>!y(rt)||Pi(c[rt].node)!==void 0).map(rt=>Re(c[rt].node)),ge=[J.origin,...ie.filter((rt,ht)=>ie[ht-1]!==rt)],fe=Re(O.node),de=i(X);q=Y(void 0,{node:O.node,run:[k],build:()=>({reason:"chain",name:fe,wave:de,chain:ge})})}else{let ie=J.hit===void 0?void 0:v.get(J.hit),ge=ie?.seq;if(ge?.inFlow(k)){let fe=A(k,X),de=fe===void 0?void 0:uI(c[fe].node),rt=fe!==void 0&&de!==void 0?{variant:"sequence",owner:k,pred:fe,ref:de}:{variant:"sequence",owner:k,pred:ge.pred,ref:ge.ref};q=ne(rt,k,X,U)}else q=ie,q?.run.push(k)}}q&&v.set(k,q)}for(let k of D)m.push({severity:"error",code:"NL.E1103",args:k.build(k.run),node:k.node});return m}function dI(e,t,n){let r=e[n].parent;return r<0?t[e[n].lane]:e[r].node}function i2(e,t,n,r){let i=new Set;for(let o=e[r].parent;o>=0;o=e[o].parent)i.add(o);for(let o=e[n].parent;o>=0;o=e[o].parent)if(i.has(o))return e[o].node;return t[e[n].lane]}function o2(e,t,n){let r=new Map,i=(c,u)=>{let f=r.get(c)??new Set;f.add(u),r.set(c,f)},o=[],s=(c,u)=>{if(c)for(let f of u){let d=Q(f);if(!(d!=="after"&&d!=="before"))for(let p of Ny(f))ot.test(p)||(d==="after"?i(c,p):i(p,c),o.push(p))}};for(let c of t)s(c.name,c.properties);for(let c of e)s(c.node.name,c.node.properties);let a=new Set;for(;o.length>0;){let c=o.pop();if(a.has(c))continue;a.add(c);let u=n(c);mn(u)&&s(u.name,u.properties)}let l=(c,u)=>{let f=new Set([c]),d=[c];for(;d.length>0;){let p=d.pop();if(p===u)return!0;for(let m of r.get(p)??[])f.has(m)||(f.add(m),d.push(m))}return!1};return(c,u,f)=>c?u==="after"?l(f,c):l(c,f):!1}function As(e){return t=>e.anchors.get(t)??e.milestones.get(t)??e.waves?.get(t)}function kl(e){let t=e.$document?.parseResult;return!!t&&(t.lexerErrors.length>0||t.parserErrors.length>0)}function hI(e,t,n){return n||kl(e)?!1:!!e.roadmapDecl||t.swimlanes.size>0||tn(e).length>0}function Al(e,t){if(!e.$cstNode)return{};let{start:n,end:r}=Km({node:e,...t===void 0?{}:{property:t}});return{line:n.line,range:{start:{line:n.line,character:n.character},end:{line:r.line,character:r.character}}}}function Ci(e,t,n,r,...i){return{severity:e,message:en("en-US",r,...i),sourcePath:t,...n,code:r,args:i,rule:"wave"}}function xd(e){return e.map(t=>t.name)}function pI(e){let t=n=>{let r=e.properties.find(i=>Q(i)===n);return r?r.value??r.values.join(", "):""};return{title:e.title===void 0?"":kt(e.title),style:t("style"),labels:t("labels"),link:t("link"),description:e.description?kt(e.description.text):""}}var s2=["title","style","labels","link","description"];function mI(e,t,n){let r={diagnostics:[],failed:!1};if(n.mode==="ignore"||!n.participates||n.childFile.roadmapEntries.some(p=>Tt(p)&&!p.name))return r;let i=n.parentAbs,o=Al(n.inc),s=n.childRelPath,a=tn(e),l=tn(n.childFile),c=p=>({diagnostics:[p],failed:!0});if(a.length===0&&l.length===0)return r;if(l.length===0)return c(Ci("error",i,o,"NL.E0202",{reason:"child-none",path:s,parent:xd(a)}));if(a.length===0)return c(Ci("error",i,o,"NL.E0202",{reason:"parent-none",path:s,child:xd(l)}));if(a.length!==l.length||a.some((p,m)=>p.name!==l[m].name))return c(Ci("error",i,o,"NL.E0202",{reason:"mismatch",path:s,child:xd(l),parent:xd(a)}));let u=As(t),f=As(n.childContent);for(let p=0;p<a.length;p++){let m=vl(a[p],u)?.date??null,g=vl(l[p],f)?.date??null;if(m!==g)return c(Ci("error",i,o,"NL.E0202",{reason:"floor",id:a[p].name,path:s,childFloor:g,parentFloor:m}))}let d=[];for(let p=0;p<a.length;p++){let m=pI(a[p]),g=pI(l[p]),w=s2.filter(x=>m[x]!==g[x]).map(x=>({field:x,there:g[x],here:m[x]}));w.length!==0&&d.push(Ci("warning",i,o,"NL.W0701",{id:a[p].name,path:s,fields:w}))}return{diagnostics:d,failed:!1}}function a2(e){let t=e;for(;t&&!ss(t);)t=t.$container;return t}function gI(e){let{rootFile:t,rootAbs:n,rootContent:r,files:i,edges:o,failed:s}=e,a=[],l=new Set,c=_=>{let R=JSON.stringify([_.sourcePath,_.line,_.code,_.args,_.message]);l.has(R)||(l.add(R),a.push(_))},u=_=>{let R=a2(_);return R?i.get(R):void 0},f=(_,R)=>{let F=Al(_.node,_.property);return"message"in _?{severity:_.severity,message:_.message,sourcePath:R,...F,rule:"wave"}:Ci(_.severity,R,F,_.code,_.args)},d=[],p=new Set([n]),m=_=>{for(let R of o.get(_)??[])R.mode==="ignore"||!R.participates||p.has(R.childAbs)||(p.add(R.childAbs),s.has(R.childAbs)||d.push({file:R.childFile,abs:R.childAbs}),m(R.childAbs))};m(n);let g=tn(t),w=new Map(g.map(_=>[_.name,_]));for(let{file:_,abs:R}of d){for(let C of md(_))c(f(C,R));for(let C of gd(_))c(f(C,R));if(w.size===0)continue;let F=(C,W)=>{let j=C===void 0?void 0:w.get(C);if(!j||Tt(W))return;let P=j.$cstNode?j.$cstNode.range.start.line+1:0;c(Ci("error",R,Al(W),"NL.E0300",{name:C,location:`${Ts(n)}:${P}`}))};_.roadmapDecl&&F(_.roadmapDecl.name,_.roadmapDecl);for(let C of _.roadmapEntries)$f(C,F);for(let C of _.configEntries)Dt(C)&&F(C.name,C)}if(g.length===0)return a;let x=_=>"message"in _?_.message:`${_.code}\0${JSON.stringify(_.args)}`,y=new Map,T={lanes:t.roadmapEntries.filter(qe),lookup:_s(t)};for(let _ of vs(T,g,{suppressCycleRefs:!1})){let R=y.get(_.node)??new Set;R.add(x(_)),y.set(_.node,R)}let E=_=>{for(let R of _){if(y.get(R.node)?.has(x(R)))continue;let F=u(R.node);F===void 0||s.has(F)||c(f(R,F))}};E(vs({lanes:[...r.swimlanes.values()],lookup:As(r)},g,{suppressCycleRefs:!1}));for(let _ of r.isolatedRegions){let R=_.content.roadmap?u(_.content.roadmap):void 0;if(R!==void 0&&s.has(R))continue;let F=[..._.content.waves?.values()??[]];F.length!==0&&E(vs({lanes:[..._.content.swimlanes.values()],lookup:As(_.content)},F,{suppressCycleRefs:!1}))}return a}function Ed(e){let t=yA(e),n=[];for(let r of e.roadmapEntries)Of(r,i=>{let o=Q(i);if(o!=="after"&&o!=="before"&&o!=="on"||Li(i))return;let s=i.value?[i.value]:i.values;for(let a of s)a&&((o==="after"||o==="before")&&ot.test(a)||t.has(a)||n.push({prop:i,key:o,value:a}))});return n}function yI(e,t){let n=[],r=new Set([e]),i=o=>{for(let s of t.get(o)??[])if(!(s.mode==="ignore"||r.has(s.childAbs))){if(r.add(s.childAbs),!kl(s.childFile))for(let{prop:a,key:l,value:c}of Ed(s.childFile)){let u=[{key:l,value:c}];n.push({severity:"error",message:en("en-US","NL.E0302",...u),sourcePath:s.childAbs,...Al(a),code:"NL.E0302",args:u})}i(s.childAbs)}};return i(e),n}function wI(e){let t=e?.properties.find(n=>n.key==="start");if(!(!t?.value||!He(t.value)))return t.value}function c2(e,t,n){return t&&n?`Included "${e}" declares start:${n}, which doesn't match this file's start:${t}. Both files must declare the same start date, or neither should.`:t?`Included "${e}" has no start:, but this file declares start:${t}. Both files must declare the same start date, or neither should.`:`Included "${e}" declares start:${n}, but this file has no start:. Both files must declare the same start date, or neither should.`}function Br(e){return e.code!==void 0||e.rule==="wave"||e.syntax!==void 0}function TI(){return{styles:new Map,defaults:new Map,symbols:new Map,calendarDeclarations:[]}}function _I(){return{persons:new Map,teams:new Map,anchors:new Map,labels:new Map,sizes:new Map,statuses:new Map,swimlanes:new Map,milestones:new Map,footnotes:new Map,isolatedRegions:[]}}async function Py(e,t,n){let r=n.readFile??(async l=>{let{nodeReadFile:c}=await Promise.resolve().then(()=>(EI(),xI));return c(l)}),i=Ry("",t),o={services:n.services,rootAbs:i,diagnostics:[],resolving:[],processed:new Map,readFile:r,files:new Map,edges:new Map,stubs:new Set,failedWaves:new Set},{config:s,content:a}=await kI(e,i,o);return o.diagnostics.push(...gI({rootFile:e,rootAbs:i,rootContent:a,files:o.files,edges:o.edges,failed:o.failedWaves})),o.diagnostics.push(...yI(i,o.edges)),{config:s,content:a,diagnostics:o.diagnostics,processedFiles:new Set(o.processed.keys())}}async function kI(e,t,n){if(n.processed.has(t))return n.processed.get(t);if(n.resolving.includes(t)){n.diagnostics.push({severity:"error",message:`Circular include detected: ${[...n.resolving,t].join(" \u2192 ")}`,sourcePath:t});let c={config:TI(),content:_I()};return n.stubs.add(c.content),n.processed.set(t,c),c}t!==n.rootAbs&&n.diagnostics.push(...u2(e,t)),n.resolving.push(t),n.files.set(e,t);let r=TI(),i=_I();g2(r,e),w2(i,e);let o=tn(e);o.length>0&&(i.waves=new Map(o.map(c=>[c.name,c])));let s=[];n.edges.set(t,s);let a=new Set;for(let c of e.includes){let u=c.path,f=Ry(eI(t),u);if(a.has(f)){n.diagnostics.push({severity:"error",message:`Duplicate include "${u}" in ${Ts(t)}.`,sourcePath:t,line:c.$cstNode?.range.start.line});continue}a.add(f);let d=vI(c,"config")??"merge",p=vI(c,"roadmap")??"merge",m;try{let y=await n.readFile(f);m=await f2(n.services,y,f)}catch(y){n.diagnostics.push({severity:"error",message:`Could not read include "${u}": ${y.message}`,sourcePath:t,line:c.$cstNode?.range.start.line});continue}let{config:g,content:w}=await kI(m,f,n);s.push({parentAbs:t,inc:c,childRelPath:u,childAbs:f,mode:p,childFile:m,childContent:w,participates:hI(m,w,n.stubs.has(w))}),d2(r,g,d,f,n.diagnostics),p2(i,w,g,p,f,u,n.diagnostics);let x=!kl(m);if(x&&p==="isolate"&&!w.roadmap&&n.diagnostics.push({severity:"error",message:`Cannot isolate "${u}": it has no roadmap declaration.`,sourcePath:t,line:c.$cstNode?.range.start.line}),x&&p!=="ignore"&&m.roadmapDecl){let y=wI(e.roadmapDecl),T=wI(m.roadmapDecl);y!==T&&n.diagnostics.push({severity:"error",message:c2(u,y,T),sourcePath:t,line:c.$cstNode?.range.start.line})}}i.waves&&E2(i,i.waves);for(let c of s){let{diagnostics:u,failed:f}=mI(e,i,c);n.diagnostics.push(...u),f&&n.failedWaves.add(c.childAbs)}n.resolving.pop();let l={config:r,content:i};return n.processed.set(t,l),l}function u2(e,t){let n=e.$document;if(!n)return[];let r=[];for(let i of Ni(n)){if(i.origin==="validation")continue;let o=i.origin==="lexer"?i.error.line:i.error.token?.startLine;r.push({severity:"error",message:i.error.message,sourcePath:t,...o!==void 0&&Number.isFinite(o)?{line:o-1}:{},syntax:i})}return r}function vI(e,t){let n=e.options.find(r=>r.key===t);if(n&&(n.value==="merge"||n.value==="ignore"||n.value==="isolate"))return n.value}async function f2(e,t,n){let r=Oe.file(n),o=e.shared.workspace.LangiumDocumentFactory.fromString(t,r);return await e.shared.workspace.DocumentBuilder.build([o],{validation:!1}),o.parseResult.value}function d2(e,t,n,r,i){if(n==="ignore"||n==="isolate")return;let o=(s,a)=>i.push({severity:"warning",message:`${a} "${s}" from ${Ts(r)} is shadowed by the parent's definition.`,sourcePath:r});Ly(e.styles,t.styles,s=>o(s,"Style")),Ly(e.defaults,t.defaults,s=>o(s,"Default")),Ly(e.symbols,t.symbols,s=>o(s,"Symbol")),h2(e.calendarDeclarations,t.calendarDeclarations,s=>o(s.name,m2(s))),t.scale&&!e.scale&&(e.scale=t.scale),t.calendar&&!e.calendar&&(e.calendar=t.calendar)}function p2(e,t,n,r,i,o,s){if(r==="ignore")return;if(r==="isolate"){t.roadmap&&e.isolatedRegions.push({sourcePath:o,config:n,content:t});return}let a=(l,c)=>s.push({severity:"warning",message:`${c} "${l}" from ${Ts(i)} is shadowed by the parent's definition.`,sourcePath:i});Un(e.persons,t.persons,l=>a(l,"Person")),Un(e.teams,t.teams,l=>a(l,"Team")),Un(e.anchors,t.anchors,l=>a(l,"Anchor")),Un(e.labels,t.labels,l=>a(l,"Label")),Un(e.sizes,t.sizes,l=>a(l,"Size")),Un(e.statuses,t.statuses,l=>a(l,"Status")),Un(e.swimlanes,t.swimlanes,l=>a(l,"Swimlane")),Un(e.milestones,t.milestones,l=>a(l,"Milestone")),Un(e.footnotes,t.footnotes,l=>a(l,"Footnote")),t.roadmap&&!e.roadmap&&(e.roadmap=t.roadmap)}function Ly(e,t,n){for(let[r,i]of t){if(e.has(r)){e.get(r)!==i&&n(r);continue}e.set(r,i)}}function h2(e,t,n){let r=new Set(e),i=new Set(e.filter(o=>o.name).map(AI));for(let o of t)if(!r.has(o)){if(o.name&&i.has(AI(o))){n(o);continue}e.push(o),r.add(o)}}function AI(e){return`${e.$type}:${e.name}`}function m2(e){return Rr(e)?"Non-working":"Working"}function Un(e,t,n){let r=new Set(e.values());for(let[i,o]of t)if(!r.has(o)){if(!o.name&&o.title){e.set(Cy(e,II(o.title)),o);continue}if(e.has(i)){n(i);continue}e.set(i,o)}}function g2(e,t){for(let n of t.configEntries)y2(e,n)}function y2(e,t){dA(t)?e.scale||(e.scale=t):Ha(t)?e.calendar||(e.calendar=t):Dt(t)?t.name&&!e.styles.has(t.name)&&e.styles.set(t.name,t):xi(t)?t.name&&!e.symbols.has(t.name)&&e.symbols.set(t.name,t):nt(t)?e.defaults.has(t.entityType)||e.defaults.set(t.entityType,t):(Rr(t)||Ka(t))&&e.calendarDeclarations.push(t)}function x2(e){let t={swimlanes:new Set,persons:new Set,teams:new Set,anchors:new Set,labels:new Set,sizes:new Set,statuses:new Set,milestones:new Set,footnotes:new Set};for(let n of e){let r=n.name;if(r){if(qe(n))t.swimlanes.add(r);else if(Ya(n))t.persons.add(r);else if(Jt(n))t.teams.add(r);else if(os(n))t.anchors.add(r);else if(ja(n))t.labels.add(r);else if(yi(n))t.sizes.add(r);else if(Va(n))t.statuses.add(r);else if(mn(n))t.milestones.add(r);else if(kg(n))t.footnotes.add(r);else if(Tt(n))for(let i of Object.values(t))i.add(r)}}return t}function E2(e,t){let n=[e.persons,e.teams,e.anchors,e.labels,e.sizes,e.statuses,e.swimlanes,e.milestones,e.footnotes],r=(i,o)=>t.has(i)&&!o.name&&!!o.title;for(let i of n){let o=[...i];if(!o.some(([a,l])=>r(a,l)))continue;let s=new Set([...i.keys(),...t.keys()]);i.clear();for(let[a,l]of o){let c=r(a,l)?Cy(i,a,s):a;s.add(c),i.set(c,l)}}}function w2(e,t){t.roadmapDecl&&!e.roadmap&&(e.roadmap=t.roadmapDecl);let n=x2(t.roadmapEntries);for(let r of t.roadmapEntries)T2(e,r,n)}function II(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"entity"}function Cy(e,t,n){let r=o=>e.has(o)||(n?.has(o)??!1);if(!r(t))return t;let i=2;for(;r(`${t}-${i}`);)i++;return`${t}-${i}`}function Gn(e,t,n){t.name?e.has(t.name)||e.set(t.name,t):t.title&&e.set(Cy(e,II(t.title),n),t)}function T2(e,t,n){qe(t)?Gn(e.swimlanes,t,n.swimlanes):Ya(t)?Gn(e.persons,t,n.persons):Jt(t)?Gn(e.teams,t,n.teams):os(t)?Gn(e.anchors,t,n.anchors):ja(t)?Gn(e.labels,t,n.labels):yi(t)?Gn(e.sizes,t,n.sizes):Va(t)?Gn(e.statuses,t,n.statuses):mn(t)?Gn(e.milestones,t,n.milestones):kg(t)&&Gn(e.footnotes,t,n.footnotes)}function Il(e){let t=e?.roadmapDecl?.properties.find(r=>Q(r)==="start");if(!t)return{kind:"missing"};let n=t.value;return!n||!He(n)?{kind:"invalid"}:{kind:"valid",iso:n,date:new Date(n)}}function Z(e,t,n,r,...i){e(t,en("en-US",r,...i),{...n,data:{code:r,args:i}})}function wd(e,t){let n={node:t.node,...t.property===void 0?{}:{property:t.property}};if("message"in t){e(t.severity,t.message,n);return}Z(e,t.severity,n,t.code,t.args)}function Oi(e){let t=e.$cstNode;return t?`line ${t.range.start.line+1}`:"unknown location"}function Td(e){return/^[a-zA-Z_][a-zA-Z0-9_-]*$/.test(e)}var Oy="v1",_d=new Set(Ff),RI=new Set(Ei),$y=new Set(Za),Rl=new Set(IA),SI=new Set(TA),bI=new Set(RA),Sl=Object.fromEntries(Object.entries(_A).map(([e,t])=>[e,new Set(t)])),NI=new Set(vA),LI=new Set(AA),vd=new Set(SA),Dy=new Set(bA),My=new Set(NA),PI={item:new Set(["size","duration","after","before","remaining","link","description","owner"]),milestone:new Set(["date","after","link","description"]),anchor:new Set(["date","link","description"]),footnote:new Set(["on","link","description"]),label:new Set(["link","description"]),swimlane:new Set(["capacity"]),roadmap:new Set,parallel:new Set,group:new Set},Fy=new Set(LA),CI=Object.fromEntries(Object.entries(PA).map(([e,t])=>[e,new Set(t)])),_2=[{keys:new Set(["progress","percent","percentage","pct","complete","completion"]),requires:"remaining",suggest:"status: + remaining:"},{keys:new Set(["date","start"]),requires:"after",entities:new Set(["ItemDeclaration","ParallelBlock","GroupBlock"]),suggest:"after:<date>"}];function OI(e,t,n){let r=e.toLowerCase();for(let i of _2)if(!(!i.keys.has(r)||!t.has(i.requires))&&!(i.entities&&(n===void 0||!i.entities.has(n))))return i.suggest}var $i=/^\d+(?:\.\d+)?[dwmqy]$/,$I=/^\d+%$/,DI=/^#[0-9a-fA-F]{3,8}$/,MI=/^v\d+$/,By=/^\d+$/,FI=/^[dwmqy]$/,Wy=/^\d+(\.\d+)?$/,bl=/^\d+(\.\d+)?%$/,Ad=/^\d+\.\d+$/,BI=/^\d+$/,WI=/^[\x20-\x7E]{1,3}$/,XI=/^[a-zA-Z]{2,3}(-[a-zA-Z]{2}|-\d{3})?$/,UI=new Set(kA),Xy=new Set(CA);function HI(e,t){let n=e.configEntries.filter(Ha),i=e.roadmapDecl?.properties.find(o=>Q(o)==="calendar")?.value;if(n.length>0&&i!=="custom")for(let o of n)t("error",'A "calendar" config block is only valid when the roadmap declares calendar:custom.',{node:o});if(i==="custom"&&n.length===0&&t("error",'calendar:custom requires a "calendar" config block with days-per-week, days-per-month, days-per-quarter, and days-per-year.',{node:e.roadmapDecl,property:"properties"}),i==="custom"&&n.length>0)for(let o of n){let s=new Set(o.properties.map(a=>Q(a)));for(let a of vd)s.has(a)||t("error",`calendar:custom requires "${a}" in the calendar config block.`,{node:o})}}function zI(e,t){let n=new Set;for(let r of e.properties){let i=Q(r);if(!vd.has(i)){t("error",`Unknown calendar property "${i}". Allowed: ${[...vd].join(", ")}.`,{node:r,property:"key"});continue}n.has(i)&&t("error",`Duplicate calendar property "${i}".`,{node:r,property:"key"}),n.add(i),(!By.test(r.value)||parseInt(r.value,10)<=0)&&t("error",`"${i}" must be a positive integer, got "${r.value}".`,{node:r,property:"value"})}}function jI(e,t){let n=new Set;for(let r of e.properties){let i=Q(r);if(!Dy.has(i)){t("error",`Unknown scale property "${i}". Allowed: ${[...Dy].join(", ")}.`,{node:r,property:"key"});continue}n.has(i)&&t("error",`Duplicate scale property "${i}".`,{node:r,property:"key"}),n.add(i),i==="label-every"&&(!By.test(r.value)||parseInt(r.value,10)<=0)&&t("error",`"label-every" must be a positive integer, got "${r.value}".`,{node:r,property:"value"})}}function YI(e,t){let n=Fr(e),r=qa(e),{own:i}=r;for(let c of e.properties)Ng.has(Q(c))||Z(t,"error",{node:c,property:"key"},"NL.E0901",{kind:n,key:Q(c)});r.shape==="malformed"&&Z(t,"error",{node:e},"NL.E0900",{kind:n});let o=i.get("date");o&&o.values.length>0&&o.values.forEach((c,u)=>{He(c)||Z(t,"error",{node:o,property:"values",index:u},"NL.E0405",{key:"date",value:c})});for(let c of["start","end"]){let u=i.get(c);u&&u.values.length>1?Z(t,"error",{node:u},"NL.E0902",{kind:n,key:c}):u&&u.values.length===1&&!He(u.values[0])&&Z(t,"error",{node:u,property:"values",index:0},"NL.E0405",{key:c,value:u.values[0]})}let{start:s,end:a}=r;s&&a&&a<s&&Z(t,"error",{node:i.get("end"),property:"value"},"NL.E0903",{start:s,end:a});let l=i.get("every");if(l){let c=new Set;(l.value!==void 0?[l.value]:l.values).forEach((f,d)=>{let p=l.values.length>0?{node:l,property:"values",index:d}:{node:l,property:"value"};bg(f)?c.has(f)&&Z(t,"error",p,"NL.E0905",{value:f}):Z(t,"error",p,"NL.E0904",{value:f}),c.add(f)})}}function VI(e,t){let n=e.roadmapDecl;if(!n)return;let r=e.configEntries.filter(qI),i=r.map(y=>({decl:y,facts:qa(y)})).filter(({facts:y})=>y.wellFormed),o=y=>y.weekdays??[],s=i.filter(({facts:y})=>y.shape==="open-recurrence"),a=n.properties.find(y=>Q(y)==="calendar"),l=e.configEntries.find(Ha),c=a?.value==="custom"&&l!==void 0,u=a?.value==="full",f=c?l.properties.find(y=>Q(y)==="days-per-week"):void 0,d=parseInt(f?.value??"",10),p=c?Number.isFinite(d)&&d>0?d:GI:u?7:GI,m=Df(r),g=new Set(!c&&!u&&!m?[0,6]:[]);for(let{decl:y,facts:T}of s)if(Rr(y))for(let E of o(T))g.add(E);for(let{decl:y,facts:T}of s)if(Ka(y))for(let E of o(T))g.delete(E);if(g.size===7)for(let{decl:y}of s)Rr(y)&&Z(t,"error",{node:y},"NL.E0906");for(let{decl:y,facts:T}of i){if(!Rr(y)||T.shape!=="half-bounded-recurrence")continue;new Set([...g,...o(T)]).size===7&&Z(t,"error",{node:y},"NL.E0906")}let w=7-g.size;if(w===0||w===p)return;let x=c?f?{node:f,property:"value"}:{node:l}:a?{node:a}:s.length>0?{node:s[0].decl}:{node:n};Z(t,"warning",x,"NL.W0705",{daysPerWeek:p,working:w})}function KI(e,t){let n=new Map;for(let r of e.configEntries){if(!qI(r)||!r.name)continue;let i=`${r.$type}:${r.name}`;n.has(i)?Z(t,"error",{node:r,property:"name"},"NL.E0907",{kind:Fr(r),name:r.name}):n.set(i,r)}}var GI=5;function qI(e){return Rr(e)||Ka(e)}function JI(e,t){e.properties.find(r=>Q(r)==="date")||Z(t,"error",{node:e},"NL.E0500",{name:Re(e)})}function QI(e,t){let n=e.properties.find(s=>Q(s)==="date");if(!n?.value)return;let r=n.value;if(!He(r))return;let i=new Date(r),o=Il(e.$container);switch(o.kind){case"invalid":return;case"missing":Z(t,"error",{node:n,property:"value"},"NL.E0501",{name:Re(e)});return;case"valid":i<o.date&&Z(t,"error",{node:n,property:"value"},"NL.E0502",{name:Re(e),date:r,start:o.iso});return}}function eR(e,t){let n=e.properties.some(i=>Q(i)==="date"),r=e.properties.some(i=>Q(i)==="after");!n&&!r&&Z(t,"error",{node:e},"NL.E0503",{name:Re(e)})}function tR(e,t){let n=e.properties.find(s=>Q(s)==="date");if(!n?.value)return;let r=n.value;if(!He(r))return;let i=new Date(r),o=Il(e.$container);switch(o.kind){case"invalid":return;case"missing":t("error",`Milestone "${Re(e)}" has a date but the roadmap is missing "start:". Add start:YYYY-MM-DD to the roadmap.`,{node:n,property:"value"});return;case"valid":i<o.date&&Z(t,"error",{node:n,property:"value"},"NL.E0504",{name:Re(e),date:r,start:o.iso});return}}function nR(e,t){e.properties.some(r=>Q(r)==="on")||Z(t,"error",{node:e},"NL.E0505")}function rR(e,t){for(let n of e.properties)Q(n)==="footnote"&&t("error",`Property "footnote:" is not valid on ${Tl(e)}. Footnotes attach via "on:" on the footnote declaration \u2014 declare \`footnote <id> on:<target-id>\` instead.`,{node:n})}function iR(e,t){let n=e.properties.some(i=>Q(i)==="duration"),r=e.properties.some(i=>Q(i)==="size");!n&&!r&&Z(t,"error",{node:e},"NL.E0600",{name:Re(e)})}function oR(e,t){for(let n of e.properties){let r=Q(n);(r==="size"||r==="duration"||r==="remaining"||r==="capacity")&&t("error",`"${r}" is not valid on ${e.$type==="ParallelBlock"?"parallel":"group"} (computed from children).`,{node:n})}}function sR(e,t){let n=e.content.filter(r=>!za(r));n.length===0?t("error","Parallel block must contain at least 2 children.",{node:e}):n.length===1&&t("warning","Parallel block has only 1 child. Use at least 2 for parallel execution.",{node:e})}function aR(e,t){e.content.filter(r=>!za(r)).length===0&&t("error","Group must contain at least 1 child.",{node:e})}function lR(e,t){e.properties.find(r=>Q(r)==="effort")||t("error",`Size "${Re(e)}" requires an "effort:" property.`,{node:e}),e.name&&($i.test(e.name)||FI.test(e.name))&&t("error",`Size id "${e.name}" collides with the raw duration pattern. Choose a different name (e.g. "xs", "small", "quarter").`,{node:e,property:"name"})}function cR(e,t){e.name&&_d.has(e.name)&&t("error",`Status id "${e.name}" collides with the built-in status value. Built-ins: ${Ff.join(", ")}.`,{node:e,property:"name"})}function uR(e,t){let n=new Map;for(let r of e.roadmapEntries)if(yi(r)&&r.name){let i=n.get(r.name);i?t("error",`Duplicate size id "${r.name}". First declared at ${Oi(i)}.`,{node:r,property:"name"}):n.set(r.name,r)}}function fR(e,t){if(nt(e)&&e.entityType!=="swimlane")return;let n=e.properties.find(s=>Q(s)==="utilization-warn-at"),r=e.properties.find(s=>Q(s)==="utilization-over-at");if(!n||!r)return;let i=ZI(n.value),o=ZI(r.value);i===null||o===null||i>o&&t("error",`utilization-warn-at (${n.value}) must be \u2264 utilization-over-at (${r.value}). Warn fires below over; if both fire at the same point, the warn band collapses to zero.`,{node:n,property:"value"})}function dR(e,t){let n=new Map,r=o=>!!o.title||o.properties.length>0||o.description!==void 0,i=o=>{if(!o.name)return;let s=r(o);n.has(o.name)||n.set(o.name,[]),n.get(o.name).push({node:o,isDeclaration:s}),!s&&o.$container.$type==="NowlineFile"&&t("warning",`Bare "person ${o.name}" at roadmap top level has no declaration. Either add properties (title, link, etc.) or remove the line.`,{node:o})};for(let o of Dn(e))Ya(o)&&i(o);for(let[o,s]of n){let a=s.filter(l=>l.isDeclaration);if(a.length>1)for(let l=1;l<a.length;l++)t("error",`Person "${o}" is declared more than once. First declaration at ${Oi(a[0].node)}.`,{node:a[l].node})}}function ZI(e){if(!e||e===Ja)return null;if(bl.test(e)){let t=parseFloat(e);return Number.isFinite(t)&&t>0?t/100:null}if(Ad.test(e)){let t=parseFloat(e);return Number.isFinite(t)&&t>0?t:null}return null}function pR(e,t){if(Li(e))return;let n=Q(e),r=e.value,i=e.values,o=r?[r]:i;switch(n){case"status":break;case"duration":r&&!$i.test(r)&&Z(t,"error",{node:e,property:"value"},"NL.E0400",{value:r});break;case"size":r&&!Td(r)&&Z(t,"error",{node:e,property:"value"},"NL.E0401",{value:r});break;case"effort":r&&!$i.test(r)&&Z(t,"error",{node:e,property:"value"},"NL.E0402",{value:r});break;case"remaining":{if(r)if($I.test(r)){let s=parseFloat(r);(s<0||s>100)&&Z(t,"error",{node:e,property:"value"},"NL.E0404",{value:r})}else $i.test(r)||Z(t,"error",{node:e,property:"value"},"NL.E0403",{value:r});break}case"date":case"start":case"end":r&&!He(r)&&Z(t,"error",{node:e,property:"value"},"NL.E0405",{key:n,value:r});break;case"scale":r&&!$i.test(r)&&Z(t,"error",{node:e,property:"value"},"NL.E0406",{value:r});break;case"calendar":r&&!LI.has(r)&&Z(t,"error",{node:e,property:"value"},"NL.E0407",{value:r});break;case"on":case"after":case"before":o.length===0&&Z(t,"error",{node:e},"NL.E0408",{key:n});break;case"capacity":{if(!r)break;let s=e.$container,a=k2(s);if(a==="invalid")break;a==="lane"?(!Wy.test(r)||parseFloat(r)<=0)&&t("error",`Invalid swimlane capacity "${r}". Use a positive integer (e.g. capacity:5) or decimal (e.g. capacity:1.5). Percent literals are not allowed on swimlanes.`,{node:e,property:"value"}):bl.test(r)?parseFloat(r)<=0&&t("error",`Item capacity "${r}" must be positive.`,{node:e,property:"value"}):Wy.test(r)?parseFloat(r)<=0&&t("error",`Item capacity "${r}" must be positive.`,{node:e,property:"value"}):t("error",`Invalid item capacity "${r}". Use a positive integer (capacity:2), decimal (capacity:0.5), or percent literal (capacity:50%).`,{node:e,property:"value"});break}case"overcapacity":{t("error",'"overcapacity:" was removed. Use "utilization-over-at:none" (and/or "utilization-warn-at:none") to suppress the lane utilization underline.',{node:e});break}case"utilization-warn-at":case"utilization-over-at":{if(!r)break;if(!I2(e.$container)){t("error",`"${n}:" is only valid on "swimlane" or "default swimlane".`,{node:e});break}if(r===Ja)break;if(bl.test(r)){parseFloat(r)<=0&&t("error",`${n} value "${r}" must be positive.`,{node:e,property:"value"});break}if(Ad.test(r)){parseFloat(r)<=0&&t("error",`${n} value "${r}" must be positive.`,{node:e,property:"value"});break}if(BI.test(r)){t("error",`Ambiguous ${n} value "${r}". Use the percent form ("${r}%") or the decimal-fraction form ("0.${r}") to make the intent explicit.`,{node:e,property:"value"});break}t("error",`Invalid ${n} value "${r}". Use a positive percent (e.g. 80%), a positive decimal fraction (e.g. 0.8), or "none" to opt out.`,{node:e,property:"value"});break}case"capacity-icon":break;case"icon":break;case"non-working":nt(e.$container)&&xR(r,e,t);break;default:if(Rl.has(n)){if(n==="bg"||n==="fg"||n==="text")r&&!yR(r)&&Z(t,"error",{node:e,property:"value"},"NL.E0801",{value:r,key:n});else if(n in Sl){let s=Sl[n];r&&!s.has(r)&&Z(t,"error",{node:e,property:"value"},"NL.E0802",{value:r,key:n,allowed:[...s].join(", ")})}}break}}function hR(e,t){for(let n of e.properties){let r=Q(n);Rl.has(r)&&Z(t,"error",{node:n},"NL.E0804",{key:r,entity:Tl(e)})}}function mR(e,t){let n=CI[e.$type];if(!n)return;let r=e.$type==="ParallelBlock"||e.$type==="GroupBlock"?new Set(["size","duration","remaining","capacity"]):null;for(let i of e.properties){let o=Q(i);if(n.has(o)||Fy.has(o)||Rl.has(o)||o==="footnote"||r?.has(o)||o==="wave"||Li(i))continue;let s=[...n,...Fy],a=OI(o,n,e.$type)??nI(o,s)??"";Z(t,"warning",{node:i,property:"key"},"NL.W0700",{key:o,entity:Tl(e),suggested:a})}}function gR(e,t){let n=Q(e),r=e.value;if(n==="bg"||n==="fg"||n==="text")yR(r)||Z(t,"error",{node:e,property:"value"},"NL.E0801",{value:r,key:n});else if(n==="non-working")xR(r,e,t);else if(n in Sl){let i=Sl[n];i.has(r)||Z(t,"error",{node:e,property:"value"},"NL.E0802",{value:r,key:n,allowed:[...i].join(", ")})}else Rl.has(n)||Z(t,"error",{node:e,property:"key"},"NL.E0803",{key:n})}function yR(e){return NI.has(e)||DI.test(e)}function xR(e,t,n){e===void 0||SI.has(e)||Z(n,"error",{node:t,property:"value"},"NL.E0800",{value:e})}function k2(e){return e?qe(e)?"lane":Ke(e)?"item":nt(e)?e.entityType==="swimlane"?"lane":"item":"invalid":"invalid"}function I2(e){return e?!!(qe(e)||nt(e)&&e.entityType==="swimlane"):!1}function ER(e,t){let n=new Map,r=new Map;for(let i=0;i<e.roadmapEntries.length;i++){let o=e.roadmapEntries[i];yi(o)&&o.name?n.has(o.name)||n.set(o.name,i):Va(o)&&o.name&&(r.has(o.name)||r.set(o.name,i))}for(let i=0;i<e.roadmapEntries.length;i++){let o=e.roadmapEntries[i];Of(o,s=>{if(Li(s))return;let a=Q(s);if(a==="size"&&s.value){let l=s.value,c=n.get(l);c===void 0?t("error",`Size "${l}" is not declared. Add "size ${l} effort:<literal>" earlier in the roadmap section.`,{node:s,property:"value"}):c>=i&&t("error",`Size "${l}" is referenced before its declaration. Move "size ${l}" above this entity.`,{node:s,property:"value"})}else if(a==="status"&&s.value){let l=s.value;if(_d.has(l))return;let c=r.get(l);c===void 0?t("error",`Status "${l}" is not a built-in and has no declaration. Add "status ${l}" earlier in the roadmap section.`,{node:s,property:"value"}):c>=i&&t("error",`Status "${l}" is referenced before its declaration. Move "status ${l}" above this entity.`,{node:s,property:"value"})}})}}function wR(e,t){for(let{prop:n,key:r,value:i}of Ed(e))Z(t,"error",{node:n},"NL.E0302",{key:r,value:i})}function TR(e,t){let n=Il(e),r=i=>{let o=i.properties??[],s=Tt(i),a=Ke(i)||tt(i)||$e(i)||s;for(let l of o){let c=Q(l);if(c!=="after"&&c!=="before"||s&&c==="before")continue;let f=(l.value?[l.value]:l.values).filter(d=>!!d&&ot.test(d));if(f.length!==0){if(!a){Z(t,"error",{node:l},"NL.E0411",{key:c,type:Fr(i)});continue}f.length>1&&Z(t,"error",{node:l},"NL.E0410",{key:c});for(let d of f){if(!He(d)){Z(t,"error",l.value!==void 0?{node:l,property:"value"}:{node:l,property:"values",index:l.values.indexOf(d)},"NL.E0405",{key:c,value:d});continue}switch(n.kind){case"invalid":continue;case"missing":Z(t,"error",{node:l},"NL.E0412",{key:c,date:d});continue;case"valid":{let p=ve(d);p&&p<n.date&&Z(t,"error",{node:l},"NL.E0413",{key:c,date:d,start:n.iso})}}}}}};for(let i of Dn(e))vR(i)||r(i)}function _R(e,t){let n=new Map,r=(d,p)=>{n.has(d)||n.set(d,new Set),n.get(d).add(p)},i=(d,p,m)=>{if(d)for(let g of p){let w=Q(g);if(w==="after"){let x=g.value?[g.value]:g.values;for(let y of x)y&&(ot.test(y)||r(d,y))}else if(w==="before"){let x=g.value?[g.value]:g.values;for(let y of x)y&&(ot.test(y)||r(y,d))}}},o=d=>{if(Tt(d))return;let p=d.name,m=d.properties??[];i(p,m,e)};for(let d of Dn(e))vR(d)||o(d);let s=0,a=1,l=2,c=new Map;for(let d of n.keys())c.set(d,s);let u=new Set,f=(d,p)=>{c.set(d,a),p.push(d);for(let m of n.get(d)??[]){let g=c.get(m)??s;if(g===a){let w=p.indexOf(m),x=p.slice(w).concat(m),y=[...x].sort().join("\u2192");u.has(y)||(u.add(y),t("error",`Circular dependency detected: ${x.join(" \u2192 ")}.`,{node:e.roadmapDecl??e}))}else g===s&&f(m,p)}p.pop(),c.set(d,l)};for(let d of n.keys())(c.get(d)??s)===s&&f(d,[])}function vR(e){return Jt(e)&&Jt(e.$container)}function AR(e,t){let n=e.hasConfig?xc.findNodeForKeyword(e.$cstNode,"config")?.offset:void 0,r=e.roadmapDecl?.$cstNode?.offset;n!==void 0&&r!==void 0&&n>r&&Z(t,"error",{node:e,property:"hasConfig"},"NL.E0001");for(let i of e.includes){let o=i.$cstNode?.offset??0;n!==void 0&&o>n&&Z(t,"error",{node:i},"NL.E0002"),r!==void 0&&o>r&&Z(t,"error",{node:i},"NL.E0003")}}function kR(e,t){if(!MI.test(e.version)){Z(t,"error",{node:e,property:"version"},"NL.E0100",{version:e.version});return}let n=parseInt(e.version.slice(1),10),r=parseInt(Oy.slice(1),10);n>r&&Z(t,"error",{node:e,property:"version"},"NL.E0101",{version:e.version,supported:Oy})}function IR(e,t){let n=new Set;for(let r of e.properties){let i=Q(r);if(!Xy.has(i)){Z(t,"error",{node:r,property:"key"},"NL.E0102",{key:i,allowed:[...Xy].join(", ")});continue}if(n.has(i)&&Z(t,"error",{node:r,property:"key"},"NL.E0103",{key:i}),n.add(i),i==="locale"){let o=r.value;XI.test(o)||Z(t,"error",{node:r,property:"value"},"NL.E0104",{value:o})}}}function RR(e,t){!e.name&&!e.title&&Z(t,"error",{node:e},"NL.E0301",{type:e.$type})}function SR(e,t){let n=new Map,r=(i,o)=>{if(!i)return;let s=n.get(i);s?Z(t,"error",{node:o},"NL.E0300",{name:i,location:Oi(s)}):n.set(i,o)};e.roadmapDecl?.name&&r(e.roadmapDecl.name,e.roadmapDecl);for(let i of e.roadmapEntries)$f(i,r);for(let i of e.configEntries)Dt(i)&&i.name&&r(i.name,i)}function bR(e,t){let n=e.$document?.textDocument.getText()??e.$cstNode?.text;if(!n)return;let r=n.split(/\r?\n/);for(let i=0;i<r.length;i++){let o=r[i];if(o.length===0)continue;let s=o.match(/^([\t ]+)/);if(!s)continue;let a=s[1];if(a.includes(" ")&&a.includes(" ")){Z(t,"error",{node:e},"NL.E0005",{line:i+1});return}}}function NR(e,t){let n=e.roadmapEntries.some(qe);e.roadmapDecl&&!n&&Z(t,"error",{node:e.roadmapDecl},"NL.E0004")}function LR(e,t){UI.has(e.value)||Z(t,"error",{node:e,property:"value"},"NL.E0200",{value:e.value})}function PR(e,t){let n=new Set;for(let r of e.options){let i=Q(r);n.has(i)&&Z(t,"error",{node:r},"NL.E0201",{key:i}),n.add(i)}}function CR(e,t){if(!My.has(e.entityType)){t("error",`"${e.entityType}" is not a supported entity type for default. Allowed: ${[...My].join(", ")}.`,{node:e,property:"entityType"});return}let n=e.$container,r=-1;for(let o=0;o<n.configEntries.length;o++){let s=n.configEntries[o];if(nt(s)&&s.entityType===e.entityType){if(r<0)r=o;else if(s===e){t("error",`Duplicate "default ${e.entityType}" declaration. Only one is allowed per entity type per file.`,{node:e});break}}}let i=PI[e.entityType];if(i)for(let o of e.properties){let s=Q(o);i.has(s)&&t("error",pd(s,e.entityType),{node:o})}if(e.entityType!=="roadmap")for(let o of e.properties){let s=Q(o);bI.has(s)&&Z(t,"warning",{node:o,property:"key"},"NL.W0703",{key:s,entityType:e.entityType})}}function OR(e,t){let n=e.roadmapDecl;if(!n)return;let r=new Map,i=new Map;for(let c of e.configEntries)Dt(c)&&c.name&&!r.has(c.name)?r.set(c.name,c):nt(c)&&c.entityType==="roadmap"&&(i.has("roadmap")||i.set("roadmap",c));let o=new Map;for(let c of e.roadmapEntries)ja(c)&&c.name&&!o.has(c.name)&&o.set(c.name,c);let s,a,l=c=>{for(let u of c){let f=Q(u);f==="header-height"?s=u:f==="timeline-position"&&(a=u)}};for(let c of Mf("roadmap",n.properties,{styles:r,defaults:i,labels:o}))switch(c.level){case"inline":break;case"default":l(c.props);break;case"label":return;default:if(!c.decl)return;l(c.decl.properties)}s?.value==="none"&&(a?.value!=="bottom"&&a?.value!=="both"||Z(t,"warning",{node:a,property:"value"},"NL.W0704",{position:a.value}))}function $R(e,t){e.name&&$y.has(e.name)&&Z(t,"error",{node:e,property:"name"},"NL.E0805",{name:e.name,builtins:[...Za].sort().join(", ")});let n=e.properties.find(i=>Q(i)==="unicode");n?(!n.value||n.value.length===0)&&Z(t,"error",{node:n,property:"value"},"NL.E0807",{name:Re(e)}):Z(t,"error",{node:e},"NL.E0806",{name:Re(e)});let r=e.properties.find(i=>Q(i)==="ascii");if(r){let i=r.value??"";WI.test(i)||Z(t,"error",{node:r,property:"value"},"NL.E0808",{name:Re(e),length:i.length})}for(let i of e.properties){let o=Q(i);o!=="unicode"&&o!=="ascii"&&o!=="link"&&o!=="description"&&Z(t,"error",{node:i,property:"key"},"NL.E0809",{key:o})}}function DR(e,t){let n=new Map;for(let r of e.configEntries)if(xi(r)&&r.name){let i=n.get(r.name);i?Z(t,"error",{node:r,property:"name"},"NL.E0810",{name:r.name,location:Oi(i)}):n.set(r.name,r)}}function MR(e,t){let n=new Map;for(let i=0;i<e.configEntries.length;i++){let o=e.configEntries[i];xi(o)&&o.name&&(n.has(o.name)||n.set(o.name,i))}let r=(i,o,s,a)=>{if(o!=="icon"&&o!=="capacity-icon"||!s||!Td(s)||o==="capacity-icon"&&RI.has(s)||o==="icon"&&$y.has(s))return;let l=n.get(s);if(l===void 0){let c=o==="capacity-icon"?[...Ei].sort().join(", "):[...Za].sort().join(", ");Z(t,"error",{node:a,property:"value"},"NL.E0811",{key:o,value:s,builtins:c})}else l>=i&&Z(t,"error",{node:a,property:"value"},"NL.E0812",{key:o,value:s})};for(let i=0;i<e.configEntries.length;i++){let o=e.configEntries[i];if(Dt(o))for(let s of o.properties)r(i,Q(s),s.value,s);else if(nt(o))for(let s of o.properties)r(i,Q(s),s.value,s)}}function FR(e){let t=e.validation.ValidationRegistry,n=e.validation.NowlineValidator,r={NowlineFile:[n.checkFileStructure,n.checkUniqueIdentifiers,n.checkSwimlaneRequired,n.checkIndentationConsistency,n.checkRoadmapOnlyKeywordsPosition,n.checkForwardReferences,n.checkReferenceResolution,n.checkInlineDatePins,n.checkCircularDependencies,n.checkWaves,n.checkDuplicateSizeIds,n.checkCalendarBlockConsistency,n.checkHiddenTimelineStrip,n.checkPersonDeclarations,n.checkDuplicateSymbolIds,n.checkSymbolReferences,n.checkCalendarWeek,n.checkDuplicateCalendarDeclarationIds],NowlineDirective:[n.checkDirectiveVersion,n.checkDirectiveProperties],IncludeOption:[n.checkIncludeMode],IncludeDeclaration:[n.checkIncludeDuplicateOptions],EntityProperty:[n.checkPropertyValues],RoadmapDeclaration:[n.checkEntityIdOrTitle,n.checkRoadmapProperties,n.checkNoRawStyleProperties,n.checkUnknownEntityProperties],AnchorDeclaration:[n.checkEntityIdOrTitle,n.checkAnchorRequiredDate,n.checkAnchorAgainstStart,n.checkNoRawStyleProperties,n.checkNoFootnoteProperty,n.checkUnknownEntityProperties],SwimlaneDeclaration:[n.checkEntityIdOrTitle,n.checkNoRawStyleProperties,n.checkUtilizationOrdering,n.checkNoFootnoteProperty,n.checkUnknownEntityProperties],ItemDeclaration:[n.checkEntityIdOrTitle,n.checkItemRequiredDuration,n.checkNoRawStyleProperties,n.checkNoFootnoteProperty,n.checkUnknownEntityProperties],ParallelBlock:[n.checkParallelMinChildren,n.checkNoComputedProperties,n.checkNoRawStyleProperties,n.checkNoFootnoteProperty,n.checkUnknownEntityProperties],GroupBlock:[n.checkGroupMinChildren,n.checkNoComputedProperties,n.checkNoRawStyleProperties,n.checkNoFootnoteProperty,n.checkUnknownEntityProperties],MilestoneDeclaration:[n.checkEntityIdOrTitle,n.checkMilestoneRequirement,n.checkMilestoneAgainstStart,n.checkNoRawStyleProperties,n.checkNoFootnoteProperty,n.checkUnknownEntityProperties],FootnoteDeclaration:[n.checkEntityIdOrTitle,n.checkFootnoteOn,n.checkNoRawStyleProperties,n.checkUnknownEntityProperties],PersonDeclaration:[n.checkEntityIdOrTitle,n.checkNoRawStyleProperties,n.checkNoFootnoteProperty,n.checkUnknownEntityProperties],TeamDeclaration:[n.checkEntityIdOrTitle,n.checkNoRawStyleProperties,n.checkNoFootnoteProperty,n.checkUnknownEntityProperties],StyleDeclaration:[n.checkEntityIdOrTitle],StyleProperty:[n.checkStylePropertyEnum],SymbolDeclaration:[n.checkEntityIdOrTitle,n.checkSymbolDeclaration],NonWorkingDeclaration:[n.checkCalendarDeclaration],WorkingDeclaration:[n.checkCalendarDeclaration],LabelDeclaration:[n.checkEntityIdOrTitle,n.checkNoRawStyleProperties,n.checkUnknownEntityProperties],SizeDeclaration:[n.checkEntityIdOrTitle,n.checkSizeDeclaration,n.checkNoRawStyleProperties,n.checkUnknownEntityProperties],StatusDeclaration:[n.checkEntityIdOrTitle,n.checkStatusDeclaration,n.checkNoRawStyleProperties,n.checkUnknownEntityProperties],WaveDeclaration:[n.checkNoRawStyleProperties,n.checkNoFootnoteProperty,n.checkUnknownEntityProperties],DefaultDeclaration:[n.checkDefaultDeclaration,n.checkUtilizationOrdering],CalendarBlock:[n.checkCalendarBlock],ScaleBlock:[n.checkScaleBlock]};t.register(r,n)}var kd=class{checkFileStructure(t,n){AR(t,n)}checkRoadmapOnlyKeywordsPosition(t,n){}checkDirectiveVersion(t,n){kR(t,n)}checkDirectiveProperties(t,n){IR(t,n)}checkEntityIdOrTitle(t,n){RR(t,n)}checkUniqueIdentifiers(t,n){SR(t,n)}checkIndentationConsistency(t,n){bR(t,n)}checkSwimlaneRequired(t,n){NR(t,n)}checkIncludeMode(t,n){LR(t,n)}checkIncludeDuplicateOptions(t,n){PR(t,n)}checkPropertyValues(t,n){pR(t,n)}checkAnchorRequiredDate(t,n){JI(t,n)}checkAnchorAgainstStart(t,n){QI(t,n)}checkMilestoneRequirement(t,n){eR(t,n)}checkMilestoneAgainstStart(t,n){tR(t,n)}checkFootnoteOn(t,n){nR(t,n)}checkNoFootnoteProperty(t,n){rR(t,n)}checkItemRequiredDuration(t,n){iR(t,n)}checkNoComputedProperties(t,n){oR(t,n)}checkParallelMinChildren(t,n){sR(t,n)}checkGroupMinChildren(t,n){aR(t,n)}checkNoRawStyleProperties(t,n){hR(t,n)}checkUnknownEntityProperties(t,n){mR(t,n)}checkRoadmapProperties(t,n){}checkStylePropertyEnum(t,n){gR(t,n)}checkSizeDeclaration(t,n){lR(t,n)}checkStatusDeclaration(t,n){cR(t,n)}checkWaves(t,n){for(let o of md(t))wd(n,o);for(let o of gd(t))wd(n,o);let r=tn(t);if(r.length===0)return;let i={lanes:t.roadmapEntries.filter(qe),lookup:_s(t)};for(let o of vs(i,r))wd(n,o)}checkDuplicateSizeIds(t,n){uR(t,n)}checkUtilizationOrdering(t,n){fR(t,n)}checkDefaultDeclaration(t,n){CR(t,n)}checkHiddenTimelineStrip(t,n){OR(t,n)}checkCalendarBlockConsistency(t,n){HI(t,n)}checkCalendarBlock(t,n){zI(t,n)}checkScaleBlock(t,n){jI(t,n)}checkForwardReferences(t,n){ER(t,n)}checkReferenceResolution(t,n){wR(t,n)}checkInlineDatePins(t,n){TR(t,n)}checkCircularDependencies(t,n){_R(t,n)}checkPersonDeclarations(t,n){dR(t,n)}checkSymbolDeclaration(t,n){$R(t,n)}checkDuplicateSymbolIds(t,n){DR(t,n)}checkCalendarDeclaration(t,n){YI(t,n)}checkCalendarWeek(t,n){VI(t,n)}checkDuplicateCalendarDeclarationIds(t,n){KI(t,n)}checkSymbolReferences(t,n){MR(t,n)}};var Uy=class extends $o{runConverter(t,n,r){return t.name==="PROPERTY_KEY_WITH_COLON"||t.name==="INCLUDE_OPTION_KEY"?n.endsWith(":")?n.slice(0,-1):n:super.runConverter(t,n,r)}},Gy=class extends Ma{isStartOfLine(t,n){if(!super.isStartOfLine(t,n))return!1;let r=n-1;for(;r>=0&&(t[r]===" "||t[r]===" ");)r--;for(;r>=0&&(t[r]==="\r"||t[r]===`
|
|
2917
|
+
`);)r--;for(;r>=0&&(t[r]===" "||t[r]===" ");)r--;return r<0||t[r]!=="\\"}},BR={parser:{TokenBuilder:()=>new Gy({indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[["[","]"]]}),Lexer:e=>new Rf(e),ParserConfig:()=>({maxLookahead:4}),ValueConverter:()=>new Uy},validation:{NowlineValidator:()=>new kd}};function Hy(e={}){let t=e.shared??Go(If(Sf),Pk),n=Go(kf({shared:t}),Ck,BR);return t.ServiceRegistry.register(n),FR(n),{shared:t,Nowline:n}}function zy(e,t){return t.code===void 0?t.message:en(e,t.code,...t.args??[])}function Di(e){let{content:t}=e,n=[...t.waves?.values()??[]];if(n.length===0)return;let r=new Map;n.forEach((u,f)=>{r.set(u.name,f+1)});let i=As(t),o=n.map(u=>vl(u,i)),s=new WeakMap,a=new WeakMap,l=u=>{let f=hd(u,r);for(let[d,p]of f.waveOf)s.set(d,p);for(let[d,p]of f.leadOf)a.set(d,p)};l([...t.swimlanes.values()]);for(let u of t.isolatedRegions)l([...u.content.swimlanes.values()]);let c=u=>Ke(u)?s.get(u):void 0;return{waves:n,index:r,floors:o,waveOf:s,leadOf:a,memberWave:c,isMember:(u,f)=>{let d=c(u);return d!==void 0&&(f===void 0||d===f)}}}var Nl="en-US",P2={"en-US":{nowLabel:"now",quarterPrefix:"Q",waveHeldBy:"held by",waveNoItems:"no items",waveBackgroundItem:"Background (no wave)",waveLegendBackground:"Background work (not in a wave)",waveLegendBoundary:"Wave boundary",waveLegendPrefix:"Waves:",wavesDeclaredPlaceholder:"Waves declared: {names} \u2014 no items assigned yet"},fr:{nowLabel:"maint.",quarterPrefix:"T",waveHeldBy:"retenue par",waveNoItems:"aucun \xE9l\xE9ment",waveBackgroundItem:"Travail de fond (hors vague)",waveLegendBackground:"Travail de fond (dans aucune vague)",waveLegendBoundary:"Limite de vague",waveLegendPrefix:"Vagues\xA0:",wavesDeclaredPlaceholder:"Vagues d\xE9clar\xE9es\xA0: {names} \u2014 aucun \xE9l\xE9ment affect\xE9 pour l\u2019instant"}};function WR(e,t){return t??e??Nl}function Hn(e){let t={};for(let n of C2(e)){let r=P2[n];if(r)for(let i of Object.keys(r))t[i]===void 0&&r[i]!==void 0&&(t[i]=r[i])}return t}function XR(e,t){return e.wavesDeclaredPlaceholder.replace("{names}",()=>t.join(", "))}function C2(e){let t=[],n=O2(e);for(;n.length>0;){t.includes(n)||t.push(n);let r=n.lastIndexOf("-");if(r<=0)break;n=n.slice(0,r)}return t.includes(Nl)||t.push(Nl),t}function O2(e){return e.split("-").map((n,r)=>r===0?n.toLowerCase():/^[a-zA-Z]{2}$/.test(n)?n.toUpperCase():n).join("-")}function Id(e){return e==="hide"||e==="show"}var UR={red:"#f87171",blue:"#60a5fa",yellow:"#facc15",green:"#34d399",orange:"#fb923c",purple:"#a78bfa",gray:"#94a3b8",navy:"#818cf8",white:"#e2e8f0"},zn={bg:"none",fg:"#e2e8f0",text:"#e2e8f0",border:"solid",icon:"none",shadow:"none",font:"sans",weight:"normal",italic:!1,textSize:"md",padding:"sm",spacing:"sm",headerHeight:"sm",cornerRadius:"sm",bracket:"none",capacityIcon:"multiplier"},jy={name:"dark",surface:{page:"#0b1220",chart:"#111827",headerBox:"#1e293b"},entities:{roadmap:{...zn,headerHeight:"md",padding:"md"},swimlane:{...zn,fg:"#e2e8f0",text:"#e2e8f0",padding:"sm",spacing:"none",textSize:"sm"},item:{...zn,bg:"#0f172a",fg:"#94a3b8",text:"#e2e8f0",shadow:"subtle",cornerRadius:"sm"},parallel:{...zn,bg:"#8c84ff",bracket:"dashed",padding:"xs"},group:{...zn,bg:"#f0a832",bracket:"solid",padding:"xs",fg:"#94a3b8"},anchor:{...zn,bg:"#0b1220",fg:"#cbd5e1",text:"#cbd5e1",cornerRadius:"sm"},milestone:{...zn,bg:"#e2e8f0",fg:"#e2e8f0",text:"#0b1220",border:"solid"},footnote:{...zn,bg:"none",fg:"#94a3b8",text:"#e2e8f0",textSize:"sm"},label:{...zn,bg:"#1e293b",fg:"#94a3b8",text:"#e2e8f0",textSize:"xs",padding:"xs",cornerRadius:"full"}},swimlane:{bandEven:"#111827",bandOdd:"#0f172a",separator:"#1f2937",frameTabText:"#e2e8f0",frameTabMuted:"#94a3b8",border:"#334155",tabFill:"#1e293b",tabStroke:"#475569",tabText:"#e2e8f0",ownerText:"#94a3b8",footnoteIndicator:"#f87171",rowTintEven:"#0f172a",rowTintOdd:"#1e293b",utilizationOk:"#34d399",utilizationWarn:"#fbbf24",utilizationOver:"#f87171"},timeline:{gridLine:"#475569",minorGridLine:"#334155",nonWorkingSeam:"#6b7a90",nonWorkingFill:"#94a3b8",tickMark:"#334155",labelText:"#cbd5e1",panelFill:"#0f172a",border:"#334155"},header:{cardBorder:"#475569",author:"#94a3b8"},item:{overflowX:"#f87171",linkIconFg:"#94a3b8",overflowTailFill:"#7f1d1d",overflowTailStroke:"#f87171",overflowCaption:"#fecaca"},parallel:{bracketStroke:"#cbd5e1"},anchorDiamond:{fill:"#0f172a",stroke:"#cbd5e1",label:"#cbd5e1",cutLine:"#94a3b8"},milestoneDiamond:{fill:"#e2e8f0",label:"#e2e8f0",cutLineNormal:"#a5b4fc",cutLineOverrun:"#ef4444",slack:"#cbd5e1"},footnotePanel:{fill:"#0f172a",border:"#334155",header:"#e2e8f0",title:"#e2e8f0",description:"#94a3b8",number:"#f87171"},nowline:{stroke:"#f87171",labelText:"#0b1220",labelBg:"#f87171"},milestone:{dashedInk:"#a5b4fc",overrun:"#ef4444"},anchor:{predecessorLine:"#94a3b8"},dependency:{edgeStroke:"#cbd5e1",overflowStroke:"#ef5350"},footnote:{indicatorText:"#f87171",descriptionMuted:"#94a3b8"},includeRegion:{border:"#475569",label:"#cbd5e1",badge:"#94a3b8",fill:"#0b1220",tabFill:"#111827",tabStroke:"#475569",tabText:"#e2e8f0",badgeFill:"#1e293b",badgeStroke:"#475569",badgeText:"#94a3b8"},wave:{stripFill:"#042f2e",stripFillAlt:"#134e4a",labelText:"#99f6e4",labelMuted:"#5eead4",boundary:"#2dd4bf",hatch:"#0f172a",hatchOnDark:"#ffffff"},arrowhead:{neutral:"#94a3b8",light:"#64748b",dark:"#e2e8f0"},status:{done:"#34d399",inProgress:"#60a5fa",atRisk:"#facc15",blocked:"#ef4444",planned:"#94a3b8",neutral:"#94a3b8"},statusTint:{done:"#052e16",inProgress:"#172554",atRisk:"#422006",blocked:"#7f1d1d",planned:"#1e293b",neutral:"#1e293b"},statusDot:{onLight:{done:"#065f46",inProgress:"#1e3a8a",atRisk:"#92400e",blocked:"#991b1b",planned:"#334155",neutral:"#334155"},onDark:{done:"#d1fae5",inProgress:"#dbeafe",atRisk:"#fef3c7",blocked:"#fee2e2",planned:"#e2e8f0",neutral:"#e2e8f0"}},attribution:{mark:"#cbd5e1",link:"#f87171"},diagnostic:{overlayBg:"#7f1d1d",errorText:"#fecaca"}};var GR={red:"#4a4a4a",blue:"#6b6b6b",green:"#8a8a8a",yellow:"#c8c8c8",orange:"#5c5c5c",purple:"#3a3a3a",gray:"#9e9e9e",navy:"#2a2a2a",white:"#ffffff"},jn={bg:"none",fg:"#1a1a1a",text:"#1a1a1a",border:"solid",icon:"none",shadow:"none",font:"sans",weight:"normal",italic:!1,textSize:"md",padding:"sm",spacing:"sm",headerHeight:"sm",cornerRadius:"sm",bracket:"none",capacityIcon:"multiplier"},Yy={name:"grayscale",surface:{page:"#f5f5f5",chart:"#ffffff",headerBox:"#ffffff"},entities:{roadmap:{...jn,headerHeight:"md",padding:"md"},swimlane:{...jn,fg:"#3a3a3a",text:"#3a3a3a",padding:"sm",spacing:"none",textSize:"sm"},item:{...jn,bg:"#ffffff",fg:"#9e9e9e",text:"#1a1a1a",shadow:"subtle",cornerRadius:"sm"},parallel:{...jn,bg:"#9e9e9e",bracket:"dashed",padding:"xs"},group:{...jn,bg:"#595959",bracket:"solid",padding:"xs",fg:"#595959"},anchor:{...jn,bg:"#1a1a1a",fg:"#1a1a1a",text:"#1a1a1a",cornerRadius:"sm"},milestone:{...jn,bg:"#2a2a2a",fg:"#2a2a2a",text:"#ffffff",border:"solid"},footnote:{...jn,bg:"none",fg:"#595959",text:"#595959",textSize:"sm"},label:{...jn,bg:"#e8e8e8",fg:"#595959",text:"#595959",textSize:"xs",padding:"xs",cornerRadius:"full"}},swimlane:{bandEven:"#ffffff",bandOdd:"#f5f5f5",separator:"#d4d4d4",frameTabText:"#3a3a3a",frameTabMuted:"#737373",border:"#d4d4d4",tabFill:"#e8e8e8",tabStroke:"#bdbdbd",tabText:"#3a3a3a",ownerText:"#737373",footnoteIndicator:"#4a4a4a",rowTintEven:"#ffffff",rowTintOdd:"#f5f5f5",utilizationOk:"#8a8a8a",utilizationWarn:"#595959",utilizationOver:"#1a1a1a"},timeline:{gridLine:"#bdbdbd",minorGridLine:"#d4d4d4",nonWorkingSeam:"#9a9a9a",nonWorkingFill:"#737373",tickMark:"#bdbdbd",labelText:"#737373",panelFill:"#ffffff",border:"#d4d4d4"},header:{cardBorder:"#d4d4d4",author:"#737373"},item:{overflowX:"#1a1a1a",linkIconFg:"#1a1a1a",overflowTailFill:"#e8e8e8",overflowTailStroke:"#4a4a4a",overflowCaption:"#3a3a3a"},parallel:{bracketStroke:"#3a3a3a"},anchorDiamond:{fill:"#ffffff",stroke:"#3a3a3a",label:"#3a3a3a",cutLine:"#737373"},milestoneDiamond:{fill:"#1a1a1a",label:"#1a1a1a",cutLineNormal:"#2a2a2a",cutLineOverrun:"#4a4a4a",slack:"#1a1a1a"},footnotePanel:{fill:"#ffffff",border:"#d4d4d4",header:"#1a1a1a",title:"#1a1a1a",description:"#737373",number:"#4a4a4a"},nowline:{stroke:"#1a1a1a",labelText:"#ffffff",labelBg:"#1a1a1a"},milestone:{dashedInk:"#9e9e9e",overrun:"#4a4a4a"},anchor:{predecessorLine:"#9e9e9e"},dependency:{edgeStroke:"#595959",overflowStroke:"#1a1a1a"},footnote:{indicatorText:"#4a4a4a",descriptionMuted:"#737373"},includeRegion:{border:"#9e9e9e",label:"#3a3a3a",badge:"#737373",fill:"#f5f5f5",tabFill:"#ffffff",tabStroke:"#bdbdbd",tabText:"#1a1a1a",badgeFill:"#e8e8e8",badgeStroke:"#bdbdbd",badgeText:"#595959"},wave:{stripFill:"#fafafa",stripFillAlt:"#e0e0e0",labelText:"#212121",labelMuted:"#616161",boundary:"#616161",hatch:"#000000",hatchOnDark:"#ffffff"},arrowhead:{neutral:"#595959",light:"#9e9e9e",dark:"#1a1a1a"},status:{done:"#8a8a8a",inProgress:"#595959",atRisk:"#737373",blocked:"#3a3a3a",planned:"#bdbdbd",neutral:"#bdbdbd"},statusTint:{done:"#ebebeb",inProgress:"#e4e4e4",atRisk:"#eeeeee",blocked:"#dcdcdc",planned:"#f5f5f5",neutral:"#f5f5f5"},statusDot:{onLight:{done:"#3a3a3a",inProgress:"#2a2a2a",atRisk:"#4a4a4a",blocked:"#1a1a1a",planned:"#595959",neutral:"#595959"},onDark:{done:"#d4d4d4",inProgress:"#e8e8e8",atRisk:"#c8c8c8",blocked:"#f0f0f0",planned:"#d4d4d4",neutral:"#d4d4d4"}},attribution:{mark:"#9e9e9e",link:"#1a1a1a"},diagnostic:{overlayBg:"#e8e8e8",errorText:"#1a1a1a"}};var HR={red:"#e53935",blue:"#1e88e5",yellow:"#fdd835",green:"#43a047",orange:"#fb8c00",purple:"#8e24aa",gray:"#9e9e9e",navy:"#0d47a1",white:"#ffffff"},Yn={bg:"none",fg:"#0f172a",text:"#0f172a",border:"solid",icon:"none",shadow:"none",font:"sans",weight:"normal",italic:!1,textSize:"md",padding:"sm",spacing:"sm",headerHeight:"sm",cornerRadius:"sm",bracket:"none",capacityIcon:"multiplier"},Vy={name:"light",surface:{page:"#f8fafc",chart:"#ffffff",headerBox:"#ffffff"},entities:{roadmap:{...Yn,headerHeight:"md",padding:"md"},swimlane:{...Yn,fg:"#334155",text:"#334155",padding:"sm",spacing:"none",textSize:"sm"},item:{...Yn,bg:"#ffffff",fg:"#94a3b8",text:"#0f172a",shadow:"subtle",cornerRadius:"sm"},parallel:{...Yn,bg:"#635cf1",bracket:"dashed",padding:"xs"},group:{...Yn,bg:"#ea9818",bracket:"solid",padding:"xs",fg:"#475569"},anchor:{...Yn,bg:"#0f172a",fg:"#0f172a",text:"#0f172a",cornerRadius:"sm"},milestone:{...Yn,bg:"#312e81",fg:"#312e81",text:"#ffffff",border:"solid"},footnote:{...Yn,bg:"none",fg:"#475569",text:"#475569",textSize:"sm"},label:{...Yn,bg:"#f1f5f9",fg:"#475569",text:"#475569",textSize:"xs",padding:"xs",cornerRadius:"full"}},swimlane:{bandEven:"#ffffff",bandOdd:"#f8fafc",separator:"#e2e8f0",frameTabText:"#334155",frameTabMuted:"#64748b",border:"#e2e8f0",tabFill:"#f1f5f9",tabStroke:"#cbd5e1",tabText:"#334155",ownerText:"#64748b",footnoteIndicator:"#dc2626",rowTintEven:"#ffffff",rowTintOdd:"#f8fafc",utilizationOk:"#10b981",utilizationWarn:"#f59e0b",utilizationOver:"#ef4444"},timeline:{gridLine:"#cbd5e1",minorGridLine:"#e2e8f0",nonWorkingSeam:"#a0aec0",nonWorkingFill:"#64748b",tickMark:"#cbd5e1",labelText:"#64748b",panelFill:"#ffffff",border:"#e2e8f0"},header:{cardBorder:"#e2e8f0",author:"#64748b"},item:{overflowX:"#dc2626",linkIconFg:"#0f172a",overflowTailFill:"#fee2e2",overflowTailStroke:"#ef4444",overflowCaption:"#b91c1c"},parallel:{bracketStroke:"#334155"},anchorDiamond:{fill:"#ffffff",stroke:"#334155",label:"#334155",cutLine:"#64748b"},milestoneDiamond:{fill:"#0f172a",label:"#0f172a",cutLineNormal:"#1e1b4b",cutLineOverrun:"#b91c1c",slack:"#0f172a"},footnotePanel:{fill:"#ffffff",border:"#e2e8f0",header:"#0f172a",title:"#0f172a",description:"#64748b",number:"#dc2626"},nowline:{stroke:"#e53e3e",labelText:"#ffffff",labelBg:"#e53e3e"},milestone:{dashedInk:"#94a3b8",overrun:"#ef4444"},anchor:{predecessorLine:"#94a3b8"},dependency:{edgeStroke:"#475569",overflowStroke:"#d32f2f"},footnote:{indicatorText:"#e53e3e",descriptionMuted:"#64748b"},includeRegion:{border:"#94a3b8",label:"#334155",badge:"#64748b",fill:"#f8fafc",tabFill:"#ffffff",tabStroke:"#cbd5e1",tabText:"#0f172a",badgeFill:"#e2e8f0",badgeStroke:"#cbd5e1",badgeText:"#475569"},wave:{stripFill:"#f0fdfa",stripFillAlt:"#ccfbf1",labelText:"#134e4a",labelMuted:"#0f766e",boundary:"#0d9488",hatch:"#0f172a",hatchOnDark:"#ffffff"},arrowhead:{neutral:"#475569",light:"#94a3b8",dark:"#0f172a"},status:{done:"#10b981",inProgress:"#3b82f6",atRisk:"#f59e0b",blocked:"#ef4444",planned:"#94a3b8",neutral:"#94a3b8"},statusTint:{done:"#ecfdf5",inProgress:"#eff6ff",atRisk:"#fffbeb",blocked:"#fee2e2",planned:"#f8fafc",neutral:"#f8fafc"},statusDot:{onLight:{done:"#065f46",inProgress:"#1e3a8a",atRisk:"#92400e",blocked:"#991b1b",planned:"#334155",neutral:"#334155"},onDark:{done:"#d1fae5",inProgress:"#dbeafe",atRisk:"#fef3c7",blocked:"#fee2e2",planned:"#e2e8f0",neutral:"#e2e8f0"}},attribution:{mark:"#94a3b8",link:"#e53e3e"},diagnostic:{overlayBg:"#fee2e2",errorText:"#991b1b"}};var zR=["light","dark","grayscale"],Ky={light:Vy,dark:jy,grayscale:Yy};var $2={greyscale:"grayscale"};function qy(e){let t=e.toLowerCase(),n=$2[t]??t;return zR.find(r=>r===n)}var D2={grey:"gray",violet:"purple"};function Vn(e,t){if(e==="none")return"none";if(e.startsWith("#"))return e;let n=t.name==="dark"?UR:t.name==="grayscale"?GR:HR,r=D2[e]??e,i=n[r];return typeof i=="string"?i:e}function M2(e,t){return{bg:Vn(e.bg,t),fg:Vn(e.fg,t),text:Vn(e.text,t),border:e.border,icon:e.icon,shadow:e.shadow,font:e.font,weight:e.weight,italic:e.italic,textSize:e.textSize,padding:e.padding,spacing:e.spacing,headerHeight:e.headerHeight,cornerRadius:e.cornerRadius,bracket:e.bracket,headerPosition:"beside",capacityIcon:e.capacityIcon,timelinePosition:"top",minorGrid:!1,nonWorking:"hide"}}function jR(e,t,n,r){switch(t){case"bg":e.bg=Vn(n,r);break;case"fg":e.fg=Vn(n,r);break;case"text":e.text=Vn(n,r);break;case"border":(n==="solid"||n==="dashed"||n==="dotted")&&(e.border=n);break;case"icon":e.icon=n;break;case"shadow":(n==="none"||n==="subtle"||n==="soft"||n==="hard")&&(e.shadow=n);break;case"font":(n==="sans"||n==="serif"||n==="mono")&&(e.font=n);break;case"weight":(n==="thin"||n==="light"||n==="normal"||n==="bold")&&(e.weight=n);break;case"italic":e.italic=n==="true";break;case"text-size":e.textSize=Ll(n,"xl");break;case"padding":e.padding=Ll(n,"xl");break;case"spacing":e.spacing=Ll(n,"xl");break;case"header-height":e.headerHeight=Ll(n,"xl");break;case"corner-radius":e.cornerRadius=Ll(n,"full");break;case"bracket":(n==="none"||n==="solid"||n==="dashed")&&(e.bracket=n);break;case"header-position":(n==="beside"||n==="above")&&(e.headerPosition=n);break;case"capacity-icon":e.capacityIcon=n;break;case"timeline-position":(n==="top"||n==="bottom"||n==="both")&&(e.timelinePosition=n);break;case"minor-grid":e.minorGrid=n==="true";break;case"non-working":Id(n)&&(e.nonWorking=n);break;default:break}}function Ll(e,t){let n=["none","xs","sm","md","lg","xl","full"],r=n.indexOf(t),i=n.indexOf(e);return i<0?"md":i>r?n[r]:n[i]}function F2(e,t,n){if(t)for(let r of t.properties)jR(e,Q(r),r.value,n)}function B2(e,t,n){for(let r of t){let i=Q(r);r.value!==void 0&&jR(e,i,r.value,n)}}function Se(e,t,n){let r=n.theme.entities[e],i=M2(r,n.theme);for(let o of Mf(e,t,n))switch(o.level){case"default":case"inline":B2(i,o.props,n.theme);break;case"label":break;default:F2(i,o.decl,n.theme)}return i}function YR(e,t){return Se("label",e.properties,t)}function KR(e,t){let r=vt(e.roadmapDecl?.properties??[],"scale")?.value,i="weeks",o,s;if(r)if(r==="days"||r==="weeks"||r==="months"||r==="quarters"||r==="years")i=r;else{let c=/^(\d+)([dwmqy])$/.exec(r);if(c){let u=Math.max(1,parseInt(c[1],10));switch(c[2]){case"d":i="days";break;case"w":i="weeks";break;case"m":i="months";break;case"q":i="quarters";break;case"y":i="years";break}o=Zy(i)*u,s=1}}let a=s??gk[i]??4,l=c=>s===void 0&&!c?{labelEveryDefault:!0}:{};if(t){let c=vt(t.properties,"label-every"),u=c&&parseInt(c.value,10)||0,f=u!==0?Math.max(1,u):a;return{unit:i,labelEvery:f,pixelsPerUnit:o??Zy(i),...l(u!==0)}}return{unit:i,labelEvery:a,pixelsPerUnit:o??Zy(i),...l(!1)}}function Zy(e){switch(e){case"days":return dk;case"weeks":return 40;case"months":return 80;case"quarters":return 160;case"years":return 320}}var W2=.5,Jy=.5,Pl=7;function Wr(e){return e==="months"||e==="quarters"||e==="years"}function Rd(e,t){let n=e.getUTCFullYear(),r=e.getUTCMonth();switch(t){case"months":return new Date(Date.UTC(n,r+1,1));case"quarters":return new Date(Date.UTC(n,r-r%3+3,1));case"years":return new Date(Date.UTC(n+1,0,1))}}function X2(e,t){if(e.getUTCDate()!==1)return!1;let n=e.getUTCMonth();switch(t){case"months":return!0;case"quarters":return n%3===0;case"years":return n===0}}function Mi(e,t,n,r,i){let o=Math.ceil(t-1e-6);if(i?.hasNonWorkingDays){if(!Wr(n)&&o<=0)return 0;let a=o<=0?e:Xe(i.dateAtWorkingIndex(e,o-1),1),l=Wr(n)?VR(a,n):n==="weeks"?qR(a,e,i.weekStart):a;return i.workingIndexOf(e,l)}if(!Wr(n))return Math.ceil(t/r)*r;let s=Xe(e,o);return At(e,VR(s,n))}function VR(e,t){return X2(e,t)?e:Rd(e,t)}function qR(e,t,n){let r=n===void 0?-At(t,e):n-e.getUTCDay();return Xe(e,(r%Pl+Pl)%Pl)}function U2(e,t,n){return qR(Xe(e,1),t,n)}function Sd(e,t,n,r=Nl){if(e.calendar?.hasNonWorkingDays)return G2(e,t,e.calendar,r);if(Wr(t.unit))return K2(e,t,t.unit,r);let i=n.daysPerUnit(t.unit),o=i*e.pixelsPerDay,s=Math.max(1,Math.round(e.widthPx/e.pixelsPerDay)),a=Math.floor(s/i)+1,l=[];for(let c=0;c<a;c++){let u=c*i,f=e.originX+u*e.pixelsPerDay,d=c%t.labelEvery===0,p=c===a-1;l.push({x:f,labelX:p?void 0:f+o/2,major:d,label:d&&!p?tx(t.unit,Xe(e.domain[0],u),c,r):void 0})}return l}function G2(e,t,n,r){let{unit:i}=t,[o,s]=e.domain,a=x=>Wr(i)?Rd(x,i):i==="weeks"?U2(x,o,n.weekStart):Xe(x,1),l=[o];for(let x=a(o);x<s;x=a(x))l.push(x);let c=e.forward(s),u=[];l.forEach((x,y)=>{let T=e.forward(x);(y+1<l.length?e.forward(l[y+1]):c)>T&&!j2(e,i,l,y)&&u.push({date:x,x:T})});let f=i==="days"&&t.labelEveryDefault===!0&&n.weekStart!==void 0,d=(x,y)=>f?z2(x,n,e.showsNonWorking):y%t.labelEvery===0,m=(e.showsNonWorking?HA(i):n.daysPerUnit(i))*e.pixelsPerDay,g=u.map(({date:x,x:y},T)=>{let E=(T+1<u.length?u[T+1].x:c)-y,_=d(x,T),R=_?tx(i,x,T,r):void 0,F=R===void 0?0:se(R,Ri),C=Wr(i)?T===0||T===u.length-1:E<m-W2,W=R!==void 0&&!(F>E&&C);return{x:y,columnPx:E,major:_,label:R,labelPx:F,isNarrowed:C,isShown:W}});Wr(i)||H2(g);let w=g.map(x=>({x:x.x,labelX:x.x+x.columnPx/2,major:x.major,label:x.isShown?x.label:void 0}));return s>o&&w.push({x:c,labelX:void 0,major:d(s,u.length),label:void 0}),w}function H2(e){let t=n=>{let r=e[n];return r===void 0||r.isShown?0:r.columnPx/2};e.forEach((n,r)=>{if(n.label===void 0||n.isShown||!n.isNarrowed||!(e[r-1]?.isNarrowed===!0||e[r+1]?.isNarrowed===!0))return;let o=n.labelPx/2,s=n.columnPx/2;n.isShown=o<=s+t(r-1)&&o<=s+t(r+1)})}function z2(e,t,n){let r=t.weekStart;if(n)return e.getUTCDay()===r;let i=(e.getUTCDay()-r+Pl)%Pl;for(let o=1;o<=i;o++)if(t.isWorkingDay(Xe(e,-o)))return!1;return!0}function j2(e,t,n,r){let i=e.calendar;if(!e.showsNonWorking||!i||!Wr(t)||r===0||r!==n.length-1)return!1;let[o,s]=e.domain;return i.workingIndexOf(o,n[r])>=i.workingIndexOf(o,s)}function Qy(e,t,n,r){let i=e.calendar;if(!i?.hasNonWorkingDays)return;let o=i.nonWorkingRuns(e.domain[0],e.domain[1]);if(o.length===0)return;let[s,a]=e.range;if(e.showsNonWorking)return o.map(c=>V2(e,c,n));let l=c=>t.some(u=>Math.abs(u.x-c)<Jy&&(u.major||r));return o.map(c=>{let u=e.forward(c.from),f={x:u,width:e.forward(Xe(c.through,1))-u,from:c.from,through:c.through};c.titles.length>0&&(f.titles=c.titles,f.label=JR(c,i.workingWeekdays),f.cut=!0);let d=u-s>Jy&&a-u>Jy;return n==="days"&&d&&!l(u)&&(f.seam=!0),f})}function ex(e){let t=e.calendar?.workingExceptionRuns(e.domain[0],e.domain[1])??[];if(t.length===0)return;let[n]=e.range;return t.map(r=>({x:Math.max(n,e.forward(r.from)),from:r.from,through:r.through,titles:r.titles,label:Y2(r)}))}function Y2(e){let t=At(e.from,e.through)+1;return`${e.titles.join(", ")}${ZR}+${t}d`}var ZR=" \xB7 ";function JR(e,t){let n=0;for(let i=e.from;i<=e.through;i=Xe(i,1))t.has(i.getUTCDay())&&n++;let r=e.titles.join(", ");return n>0?`${r}${ZR}${n}d`:r}function V2(e,t,n){let[r,i]=e.range,o=Math.max(r,e.forward(t.from)),s=Math.min(i,e.forward(Xe(t.through,1))),a={x:o,width:s-o,from:t.from,through:t.through};return t.titles.length>0&&(a.titles=t.titles,e.calendar&&(a.label=JR(t,e.calendar.workingWeekdays))),(n==="days"||n==="weeks"||t.titles.length>0)&&(a.band=!0),a}function K2(e,t,n,r){let[i,o]=e.domain,s=[i];for(let c=Rd(i,n);c<o;c=Rd(c,n))s.push(c);o>i&&s.push(o);let a=s.map(c=>e.forward(c)),l=s.length-1;return s.map((c,u)=>{let f=a[u],d=u%t.labelEvery===0;if(u===l)return{x:f,labelX:void 0,major:d,label:void 0};let p=a[u+1]-f,m=d?tx(n,c,u,r):void 0,g=u===0||u===l-1;return m!==void 0&&g&&se(m,Ri)>p&&(m=void 0),{x:f,labelX:f+p/2,major:d,label:m}})}function tx(e,t,n,r){switch(e){case"days":return`${t.getUTCMonth()+1}/${t.getUTCDate()}`;case"weeks":{let i=t.toLocaleString(r,{month:"short",timeZone:"UTC"}),o=t.getUTCDate().toString().padStart(2,"0");return`${i} ${o}`}case"months":return t.toLocaleString(r,{month:"short",timeZone:"UTC"});case"quarters":{let i=Math.floor(t.getUTCMonth()/3)+1;return`${Hn(r).quarterPrefix}${i} ${t.getUTCFullYear()}`}case"years":return`${t.getUTCFullYear()}`}}function QR(e,t,n){let r=n.theme??"light",i=Ky[r],o=WR(n.locale,Z2(e)),s={theme:i,styles:t.config.styles,defaults:t.config.defaults,labels:t.content.labels},a=Se("roadmap",e.roadmapDecl?.properties??[],s);return{themeName:r,theme:i,locale:o,styleCtx:s,roadmapStyle:a}}function eS(e,t,n,r,i){let{config:o,working:s}=Uf(e,t),a=KR(e,t.config.scale),{startDate:l,endDate:c}=q2(e,i,n.today,a),u=Id(n.nonWorking)?n.nonWorking:r.roadmapStyle.nonWorking,f=u==="show"&&s.hasNonWorkingDays,d=Math.max(1,s.workingIndexOf(l,c)),p=f?Math.max(1,At(l,c)):d;return{cal:o,calendar:s,preset:a,schedule:i,startDate:l,naturalEndDate:c,spanDays:d,timelineDays:p,nonWorking:u}}function q2(e,t,n,r){let i=e.roadmapDecl?.properties??[],{config:o,working:s}=t.calendar,{startDate:a}=t,l=re(i,"length"),c=0;if(l){let m=ls(l,o);m>0&&(c=m)}let u=t.extent.contentEndDay;if(n&&!(c>0)){let m=s.workingIndexOf(a,n);m>0&&(u=Math.max(u,m))}let f=UA(r.unit,o),d=Mi(a,u>0?u:4*o.daysPerWeek,r.unit,f,s),p=Math.max(c,d);return{startDate:a,endDate:s.dateAtWorkingIndex(a,Math.max(1,p))}}function Z2(e){return vt(e.directive?.properties??[],"locale")?.value}var J2=1e-6,ks=class{constructor(t,n){M(this,"scale");M(this,"startDate");M(this,"spanDays");M(this,"unit");M(this,"calendar");this.scale=n,this.startDate=t.startDate,this.spanDays=t.spanDays,this.unit=t.preset.unit,this.calendar=t.calendar}isPast(t,n){return this.scale.indexAtX(t)>n+J2}boundaryAtOrAfterX(t){return this.boundaryAtOrAfter(this.scale.indexAtX(t))}boundaryAtOrAfter(t){return Mi(this.startDate,t,this.unit,this.calendar.daysPerUnit(this.unit),this.calendar)}captionColumn(t){let n=this.boundaryAtOrAfter(t);return{start:n,end:this.nextBoundary(n)}}nextBoundary(t){return Mi(this.startDate,t+.5,this.unit,this.calendar.daysPerUnit(this.unit),this.calendar)}xAt(t){return this.scale.forward(this.calendar.dateAtWorkingIndex(this.startDate,t))}captionCapX(t){let n=this.isPast(t,this.spanDays)?Math.max(this.spanDays,this.boundaryAtOrAfterX(t)):this.spanDays;return this.xAt(this.captionColumn(n).end)}};function tS(e,t){e.box.y+=t;for(let n of e.inlineDatePins??[])n.glyphTopLeft.y+=t;if(e.kind==="item"){for(let n of e.labelChips)n.box.y+=t;e.overflowBox&&(e.overflowBox.y+=t);return}for(let n of e.children)tS(n,t)}function Is(e,t){e.box.y+=t;for(let n of e.children)tS(n,t);for(let n of e.nested)Is(n,t)}function nS(e,t){e.box.y+=t;for(let n of e.nestedSwimlanes)Is(n,t);for(let n of[...e.anchors??[],...e.milestones??[]])n.center.y+=t,n.labelBox.y+=t,n.cutTopY+=t,n.cutBottomY+=t;for(let n of e.milestones??[])for(let r of n.slackArrows??[])r.y+=t;for(let n of e.edges??[])for(let r of n.waypoints)r.y+=t}function rS(e,t,n){e.cutTopY+=n,e.cutBottomY+=n,e.slackArrows?.forEach((r,i)=>{let o=t.slackArrows?.[i];o&&"y"in o&&(r.y+=n)})}var nx=class{constructor(t,n){M(this,"id");M(this,"anchor");this.id=t,this.anchor=n}place(t,n){let r=re(this.anchor.properties,"date"),i=ve(r);if(!i)return null;let o=t.scale.forwardWithinDomain(i);if(o===null)return null;let s=Se("anchor",this.anchor.properties,t.styleCtx),a=t.markerRowPlacements.get(this.id),l=a?.centerY??t.timeline.markerRow.y,c={x:o,y:l},u=a?.labelBox??{x:o+6+6,y:l-4,width:0,height:12},f=a?.labelSide??"right";t.entityLeftEdges.set(this.id,o),t.entityRightEdges.set(this.id,o),t.entityMidpoints.set(this.id,c);let d={id:this.id,title:this.anchor.title??this.id,center:c,radius:6,style:s,predecessorPoints:[],cutTopY:t.chartTopY,cutBottomY:t.swimlaneBottomY,bumpedUp:(a?.rowIndex??0)>0,labelBox:u,labelSide:f};return!t.scale.showsNonWorking&&!t.calendar.isWorkingDay(i)&&(d.hiddenDate=Ti(i)),d}};function Ld(e,t,n){let r=[];for(let[i,o]of e){let s=new nx(i,o).place(t,n);s&&r.push(s)}return r}function Cl(e){if(e.kind==="item"){let n=e.textSpills||e.dotSpills||e.iconSpills||e.footnoteSpills;return Math.max(e.box.x+e.box.width,n?e.decorationsRightX:Number.NEGATIVE_INFINITY,e.chipsOutside?e.chipsRightX:Number.NEGATIVE_INFINITY)}let t=Math.max(e.box.x+e.box.width,ys(e));for(let n of e.children)t=Math.max(t,Cl(n));return t}function Rs(e){let t=0;for(let n of e)t=Math.max(t,iS(n.children)),n.nested.length>0&&(t=Math.max(t,Rs(n.nested)));return t}function iS(e){let t=0;for(let n of e)n.kind==="item"?t=Math.max(t,n.box.x+n.box.width):t=Math.max(t,iS(n.children));return t}function Pd(e){let t=0;for(let n of e)t=Math.max(t,oS(n.children)),n.nested.length>0&&(t=Math.max(t,Pd(n.nested)));return t}function oS(e){let t=0;for(let n of e)n.kind==="item"?n.textSpills&&(t=Math.max(t,n.decorationsRightX)):t=Math.max(t,oS(n.children));return t}function eB(e){return e.box.y+e.box.height-Qt/2}function rx(e,t){let{box:n}=e;return{startX:e.dateSpan.startX,endX:e.dateSpan.endX,paintedX:n.x,paintedWidth:n.width,top:n.y,bottom:n.y+n.height,rowY:n.y+t/2,exitY:ix(e,t)}}function sS(e){let{box:t}=e;return{startX:t.x,endX:t.x+t.width,paintedX:t.x,paintedWidth:t.width,top:t.y,bottom:t.y+t.height}}function ix(e,t){return e.textSpills?eB(e):e.box.y+t/2}function aS(e){let{box:t,afterDate:n,beforeDate:r,hasLinkIcon:i,footnoteCount:o}=e;if(!n&&!r)return[];let s=[],a=Fn,l=t.y+ok,c=Gg(t.width);if(n){let u=Hg(t.x,i),f=c?{x:t.x-Bn-a,y:l}:{x:u,y:l};s.push({side:"after",isoDate:n,glyphTopLeft:f,glyphSize:a,spilled:c})}if(r){let u=t.x+t.width,f=zg(u,o),d=c?{x:u+Bn,y:l}:{x:f,y:l};s.push({side:"before",isoDate:r,glyphTopLeft:d,glyphSize:a,spilled:c})}return s}function Cd(e){let{box:t,afterDate:n,beforeDate:r,title:i}=e;if(!n&&!r)return[];let o=[],s=Fn,a=t.y+(El-s)/2,l=i?gs(t.x,!!n)+Ey(i):t.x;if(n&&(l=Math.max(l,t.x+s),o.push({side:"after",isoDate:n,glyphTopLeft:{x:t.x,y:a},glyphSize:s,spilled:!1})),r){let c=t.x+t.width-Ug-s,u=l>t.x?l+Nr:t.x;o.push({side:"before",isoDate:r,glyphTopLeft:{x:Math.max(c,u),y:a},glyphSize:s,spilled:!1})}return o}function Wt(e){for(let t of e)if(ve(t))return t}function Xr(e){return{after:Be(e,"after").map(n=>{let r=ve(n);return r?{raw:n,date:r}:{raw:n,ref:n}})}}function Od(e){return e.floors.map(t=>t?ve(t.date):null)}function $d(e,t,n,r,i=0,o){let s=n.map(c=>c??-1/0),a=[];for(let c=0;c<e;c++){let u=lS(c===0?t:a[c-1],s[c],i);a.push(c===0?u:Math.max(u,o?.S[c]??-1/0))}let l=a.map((c,u)=>Math.max(c,o?.E[u]??-1/0));for(let c=1;c<=e+1;c++){let u=r(a,l).memberEnd,f=[],d=[];for(let p=0;p<e;p++)f.push(p===0?a[0]:lS(d[p-1],s[p],i)),d.push(Math.max(f[p],u[p]??-1/0));if(cS(a,f)&&cS(l,d))return{S:a,E:l,passes:c,capped:!1};a=f,l=d}return r(a,l),{S:a,E:l,passes:e+1,capped:!0}}function lS(e,t,n){return t-e>n?t:e}function cS(e,t){for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function uS(e,t,n){return Od(e).map(r=>r?n.workingIndexOf(t,r):null)}var Fi=class{constructor(t,n){M(this,"plan");M(this,"S");M(this,"memberEnd");M(this,"binding");M(this,"memberCount");this.plan=t,this.S=n;let r=t.waves.length;this.memberEnd=new Array(r).fill(-1/0),this.binding=new Array(r).fill(void 0),this.memberCount=new Array(r).fill(0)}floor(t){let n=this.plan.waveOf.get(t),r=t.$type==="ItemDeclaration"?void 0:this.plan.leadOf.get(t),i;return n!==void 0&&(i=this.S[n-1]),r!==void 0&&(i=Math.max(i??-1/0,this.S[r-1])),i}apply(t,n){let r=this.floor(t);return r===void 0?n:Math.max(n,r)}accumulate(t,n){let r=this.plan.memberWave(t);r!==void 0&&(this.memberCount[r-1]++,n>this.memberEnd[r-1]&&(this.memberEnd[r-1]=n,this.binding[r-1]=t))}};function Dd(e,t,n,r,i,o=0){return e.waves.map((s,a)=>{let l={id:s.name,index:a+1,start:t.S[a],end:t.E[a],memberCount:n.memberCount[a]},c=n.binding[a];if(c!==void 0&&n.memberEnd[a]===t.E[a]&&t.E[a]>t.S[a]){let p=c.name??c.title;p!==void 0&&(l.heldBy=p)}let u=i[a],f=e.floors[a]?.ref,d=a===0?r:t.E[a-1];return u!=null&&f!==void 0&&u-d>o&&(l.floorRef=f),l})}var It=.5;function fS(e,t,n,r){let i=e.waves.map(()=>n);return{plan:e,ids:e.waves.map(o=>o.name),origin:n,floors:Od(e).map(o=>o?t.forward(o):null),S:i,E:i,pass:new Fi(e,i),frozen:!1,backgroundTooltip:r}}function dS(e,t,n){e.S=t,e.E=n,e.pass=new Fi(e.plan,t)}function pS(e,t){e.S=t.S,e.E=t.E,e.frozen=!0,e.solve=t}function Md(e,t,n){e.ids.forEach((r,i)=>{t.set(r,e.S[i]),n.set(r,e.E[i])})}function Ur(e,t,n){return n.waves?n.waves.pass.apply(e,t):t}function hS(e,t,n){n.waves&&!n.waves.frozen&&n.waves.pass.accumulate(e,t)}function mS(e,t){if(t.waves)return t.waves.plan.memberWave(e)!==void 0?"member":"background"}function gS(e,t){for(let n of[...e.S,...e.E])if(!(Math.abs(n-e.origin)<It)&&Math.abs(t-n)<It)return!0;return!1}function ox(e,t){let n=Math.round((e-t.timeline.originX)/t.timeline.pixelsPerDay);if(!t.scale.showsNonWorking)return n;let r=t.timeline.startDate;return t.calendar.workingIndexOf(r,Xe(r,n))}function Fd(e,t){return t.calendar.dateAtWorkingIndex(t.timeline.startDate,ox(e,t))}function yS(e,t,n){return Xf(n.calendar,n.timeline.startDate,ox(e,n),ox(t,n))}function Ol(e,t,n){return Ur(e,$l(e.properties,t,n),n)}var tB=!0;function xS(){return tB}function $l(e,t,n){let{after:r}=Xr(e);if(r.length>0){let i=t;for(let o of r){if("date"in o){let a=n.scale.forwardWithinDomain(o.date);a!==null&&(i=Math.max(i,a));continue}let s=n.entityRightEdges.get(o.ref);s!==void 0&&(i=Math.max(i,s))}return i}return t}function ES(e,t,n){if(!n.calendar.hasNonWorkingDays)return;let r=nB(e);if(!r||n.calendar.isWorkingDay(r.date))return;let i=n.scale.forwardWithinDomain(r.date);if(!(i===null||Math.abs(t-i)>=It))return{key:r.key,pin:r.raw,start:Ti(Fd(t,n))}}function nB(e){let{after:t}=Xr(e);for(let n of t)if("date"in n)return{key:"after",raw:n.raw,date:n.date}}function sx(e){if(!e||e==="none"||e==="transparent")return 1;let t=e.startsWith("#")?e.slice(1):e;if(t.length===3&&(t=t.split("").map(s=>s+s).join("")),t.length!==6)return 1;let n=parseInt(t.slice(0,2),16)/255,r=parseInt(t.slice(2,4),16)/255,i=parseInt(t.slice(4,6),16)/255,o=s=>s<=.03928?s/12.92:((s+.055)/1.055)**2.4;return .2126*o(n)+.7152*o(r)+.0722*o(i)}function rB(e,t){return sx(e)>=.24?t.statusDot.onLight:t.statusDot.onDark}function wS(e,t,n){let r=rB(t,n),i={done:r.done,"in-progress":r.inProgress,"at-risk":r.atRisk,blocked:r.blocked,planned:r.planned,neutral:r.neutral};return i[e]??i.neutral}var iB=.24;function oB(e){return e==="none"?"transparent":e}function Bd(e){return sx(oB(e))>=iB?"dark":"light"}function Ss(e,t,n){return e.scale.showsNonWorking?e.scale.advanceX(t,n)-t:n*e.timeline.pixelsPerDay}function Dl(e,t){return{x:e,startX:e,y:t,height:0}}function TS(e,t){let n=e.schedule.byNode.get(t);if(!n)throw new Error(`layout: item "${t.name??t.title??"(unnamed)"}" is not in the day schedule`);return n.days}function sB(e){let t=new Map(e),n=r=>{for(let i of r.content)Jt(i)&&(i.name&&!t.has(i.name)&&t.set(i.name,i),n(i))};for(let r of e.values())n(r);return t}function Wd(e,t,n,r){return{cal:t.cal,schedule:t.schedule,styleCtx:{theme:t.theme,styles:e.config.styles,defaults:e.config.defaults,labels:e.content.labels},sizes:cs(e.content.sizes,t.cal),labels:e.content.labels,teams:sB(e.content.teams),persons:e.content.persons,symbols:e.config.symbols,footnoteIndex:r.footnotes?.index??new Map,footnoteHosts:r.footnotes?.hosts??new Map,timeline:t.timeline,scale:t.scale,calendar:t.calendar,...t.axisColumns?{axisColumns:t.axisColumns}:{},bandScale:t.bandScale,entityLeftEdges:new Map,entityRightEdges:new Map,entityMidpoints:new Map,markerIds:new Set([...e.content.anchors.keys(),...e.content.milestones.keys()]),placedItems:new Map,itemFlowKey:new Map,currentFlowKey:"",slackCorridors:[],markerRowPlacements:r.markerRowPlacements??new Map,chartTopY:n.chartTopY,chartBottomY:n.chartBottomY,swimlaneBottomY:n.swimlaneBottomY,nextParallelId:0,nextGroupId:0,...t.waves?{waves:t.waves}:{}}}var aB=12,lB=4,Xd=13,cB=11;function uB(e,t){return(e?se(e,cB):0)+t}function Gd(e){return Math.max(0,Math.min(fk,(e-Yg)/2))}function ax(e){return Math.max(Yg,e-2*Gd(e))}function _S(e){if(!/[\r\n]/.test(e))return;let t=e.replace(/\r\n?/g,`
|
|
2918
2918
|
`).split(`
|
|
2919
|
-
`).map(i=>i.trim()),n=0,r=t.length;for(;n<r&&t[n]==="";)n+=1;for(;r>n&&t[r-1]==="";)r-=1;return t.slice(n,r)}function uB(e,t,n,r=t){let i=e,o=vS(e);if(o){if(o.length>=2)return{textSpills:!(n<=t&&o.every((c,u)=>se(c,Ud)<=(u===0?r:t))),titleLines:o};i=o[0]??""}let s=i.length>0&&se(i,Ud)>r,a=n>t;if(!s&&!a)return{textSpills:!1,titleLines:[i]};if(s&&!a){let l=wi(i,t,Ud,r);if(l.length>=2&&l.length<=Fg&&l.every((c,u)=>se(c,Ud)<=(u===0?r:t)))return{textSpills:!1,titleLines:l}}return{textSpills:!0,titleLines:[i]}}function _S(e,t,n){let r=vS(e);return r&&r.length>=2?r:!t.textSpills&&!n&&t.titleLines.length>=2?t.titleLines:[r?r[0]??"":e]}function AS(e){let{visualWidth:t}=e,n=ds(!!e.hasLinkIcon,e.hasAfterGlyph?{barWidth:t}:void 0),r=Math.max(0,t-n-sB),i=cB(e.metaText,e.metaTrailingWidth??0),o=Math.max(0,t-n-(e.titleFirstLineRightReservePx??ll({barWidth:t,footnoteLabels:[],hasBeforeGlyph:!1})));return{leftInset:n,fit:uB(e.title,r,i,o)}}var fB;function kS(e,t,n){fB?.(e,t,n)}var Gd=class{constructor(t){M(this,"geometry");this.geometry=t}get id(){return this.geometry.id}measure(t){return{width:this.geometry.naturalWidth,height:t.bands.bandwidth()+this.geometry.barExtra}}place(t,n){let{naturalWidth:r,visualWidth:i,caption:o,barExtra:s}=this.geometry,a=n.bands.bandwidth(),l=t.x+Hd(r),c={x:l,y:t.y,width:i,height:s>0?a+s:a},{textSpills:u,titleLines:f}=o.fit,d=u?l+i+aB:l+o.leftInset;return{id:this.geometry.id,box:c,textX:d,textSpills:u,titleLines:f}}};function dB(e){switch(e){case"done":case"completed":return"done";case"in-progress":case"active":return"in-progress";case"at-risk":case"blocked":case"planned":return e;case void 0:return"planned";default:return"neutral"}}function pB(e){if(!e)return 0;let t=/^(\d{1,3})%$/.exec(e);return t?Math.max(0,Math.min(100,parseInt(t[1],10)))/100:0}function hB(e,t){if(e)return/^\d+(?:\.\d+)?[dwmqy]$/.test(e)||/^\d+%$/.test(e)?e:t.sizes.get(e)?.effortLiteral??e}function mB(e,t){if(e)return t.teams.get(e)?.title??t.persons.get(e)?.title??e}function gB(e){if(!e)return{icon:"none"};let t=e.toLowerCase();return t.includes("linear.app")?{icon:"linear",href:e}:t.includes("github.com")?{icon:"github",href:e}:t.includes("atlassian.net")||t.includes("jira.")?{icon:"jira",href:e}:{icon:"generic",href:e}}function zd(e,t,n,r,i){let o=YR(e,t),s=e.name??e.title??"",a=o.padding==="none"?"xs":o.padding,l=uk[a],c=Math.max(20,Math.round(s.length*5.5+l*2));return i!==void 0&&(c=Math.min(c,i)),{text:s,style:o,box:{x:n,y:r,width:c,height:Cr}}}function yB(e,t){let n=BA(e,t.sizes,t.cal),r=MA(re(e,"remaining"),t.sizes,t.cal),i=re(e,"status"),o=dB(i),s=pB(i);s===0&&o==="done"&&(s=1);let a=/^(\d{1,3})%$/.exec(re(e,"remaining")??"");return s===0&&o==="in-progress"&&a&&(s=1-Math.max(0,Math.min(100,parseInt(a[1],10)))/100),s===0&&o==="in-progress"&&r>0&&n>0&&(s=Math.max(0,Math.min(1,1-r/n))),{status:o,progress:s}}function xB(e,t,n,r,i,o){let s=re(e,"duration"),a=!!s&&/^\d+(?:\.\d+)?[dwmqy]$/.test(s),l=n?n.title??n.name:"",c=a?s:l||void 0,u=re(e,"remaining"),f=hB(u,t),d=mB(re(e,"owner"),t),p=()=>[c,d].filter(Boolean).join(" "),m;if(r==="in-progress"&&f){let T=p();m=T?`${T} \u2014 ${f} remaining`:`${f} remaining`}else if(r==="in-progress"&&i>0&&i<1){let T=Math.round((1-i)*100),E=p();m=E?`${E} \u2014 ${T}% remaining`:`${T}% remaining`}else(d||c)&&(m=p()||void 0);let g=re(e,"capacity"),w=Rr(g),x=null,y=0;if(w!==null){let T=Qa(w),E=el(o,t.symbols),v=11,S=nl(T,E,v,m);x={value:w,text:T,icon:E,...S!==void 0?{iconDxTerms:S}:{}},y=(m?se(" ",v):0)+tl(T,E,v)}return{metaText:m,ownerDisplay:d,capacity:x,capacityTrailingWidth:y}}function EB(e,t){let n=new Set;if(e){for(let[r,i]of t.footnoteHosts.entries())if(i.includes(e)){let o=t.footnoteIndex.get(r);o!==void 0&&n.add(o)}}return[...n].sort((r,i)=>r-i)}function wB(e,t,n){return ll({barWidth:e,footnoteLabels:t.map(String),hasBeforeGlyph:Wt(n)!==void 0})}var TB={done:"done","in-progress":"inProgress","at-risk":"atRisk",blocked:"blocked",planned:"planned",neutral:"neutral"};function vB(e,t,n){let r=TB[t],i={...e};return i.bg===n.entities.item.bg&&(i.bg=n.statusTint[r]),i.fg===n.entities.item.fg&&(i.fg=n.status[r]),i}function _B(e,t,n,r,i){if(n===0)return 0;let o=r-Jt-Cr-Fn,s;e&&t?s=Math.max(vi,i)+Fn:e?s=o:s=Math.max(o,i+Fn);let l=s+(n-1)*Vf+Cr+Fn+Jt;return Math.max(0,l-r)}function AB(e,t,n){let r=n.axisColumns;if(!t.textSpills||!r)return{lines:e,truncated:!1};let i=Math.max(0,...e.map(g=>se(g,Nr))),{metaText:o,capacityTrailingWidth:s}=t.meta,a=(o?se(o,ol):0)+s,l=Math.max(i,a),c=Yf({barRightX:t.barRightX,iconSpills:t.iconSpills,captionWidth:l,footnoteCount:t.visualWidth<ps?t.footnoteCount:0,dotSpills:t.visualWidth<Pr}),u=r.captionCapX(t.barRightX);if(c.rightX<=u+kB||c.captionX===null)return{lines:e,truncated:!1};let f=c.rightX-(c.captionX+l),d=u-c.captionX-f,p=!1;return{lines:e.map(g=>{let w=$A(g,d,Nr);return w!==g&&(p=!0),w}),truncated:p}}var kB=1e-6;function jd(e,t,n){let r=e.properties,i=Se("item",r,n.styleCtx),o=re(r,"size"),s=o?n.sizes.get(o)??null:null,a=TS(n,e),l=Be(r,"after"),c=Be(r,"before"),u=Ss(n,t,a),f=lx(u),d=gB(re(r,"link")),p=d.icon!=="none",m=lx(u),g=Be(r,"labels"),w=[];for(let z of g){let G=n.labels.get(z);if(!G)continue;let ee=zd(G,n.styleCtx,0,0);w.push({id:G,width:ee.box.width})}let x=0;for(let z=0;z<w.length;z+=1)z>0&&(x+=Bn),x+=w[z].width;let y=Math.max(0,m-2*$n),T=w.length>0&&x>y,{status:E,progress:v}=yB(r,n),S=vB(i,E,n.styleCtx.theme),F=xB(r,n,s,E,v,S.capacityIcon),C=e.title??e.name??"",W=EB(e.name,n),j=AS({title:C,visualWidth:f,metaText:F.metaText,metaTrailingWidth:F.capacityTrailingWidth,hasLinkIcon:p,hasAfterGlyph:Wt(l)!==void 0,titleFirstLineRightReservePx:wB(m,W,c)}),P=p&&f<Ug,R=j.fit.textSpills||P,N=AB(_S(C,j.fit,P),{textSpills:R,iconSpills:P,barRightX:t+Hd(u)+f,visualWidth:f,footnoteCount:W.length,meta:F},n),$=N.lines,I=T?lk(w,f):null,A=I?I.rows.length:w.length>0?1:0,_=F.metaText!==void 0||F.capacity!==null,D=jf($.length,_),L=Bg($.length,_),B=_B(T,R,A,n.bandScale.bandwidth(),D);return{node:e,id:e.name??"",startX:t,durationDays:a,naturalWidth:u,visualWidth:f,naturalVisualWidth:m,style:S,size:s,status:E,progress:v,meta:F,link:d,chips:{samples:w,outside:T,pack:I,rowCount:A},footnoteIndicators:W,caption:{...j,title:C,iconSpills:P,lines:$,truncated:N.truncated,lastBaseline:D},barExtra:Math.max(L,B)}}function Yd(e,t,n,r){let i=e.properties,o=Be(i,"after"),s=Be(i,"before"),a=Dl(i,t.x,n);n.waves&&(a=Xr(e,a,n));let l=ES(i,a,n),c=n.scale.startX(a),u=r??jd(e,c,n);if(u.startX!==c)throw new Error(`layout: item "${e.name??e.title??"(unnamed)"}" was measured at x ${u.startX} but placed at x ${c}`);let{naturalWidth:f,style:d,status:p,progress:m,footnoteIndicators:g,caption:w}=u,{metaText:x,ownerDisplay:y,capacity:T,capacityTrailingWidth:E}=u.meta,v=u.link,S=v.icon!=="none",F=u.chips.samples,C=u.chips.outside,W=c,j=c+f,P=c+Ss(n,c,u.durationDays),R=!1,N,$;if(s.length>0){let Ze,Zn;for(let Pt of s){let Ds=_e(Pt),Ms=Ds?n.scale.forwardWithinDomain(Ds)??void 0:n.entityLeftEdges.get(Pt);Ms!==void 0&&(Ze===void 0||Ms<Ze)&&(Ze=Ms,Zn=Pt)}Ze!==void 0&&P>Ze&&(R=!0,N={x:Ze,y:t.y,width:j-Ze,height:n.bandScale.bandwidth()},$=Zn)}let I=w.title,A=new Gd(u),_={time:n.scale,bands:n.bandScale,style:d},D=A.place({x:W,y:t.y},_),L=D.box,B=n.bandScale.bandwidth(),z=L.width<Pr,G=w.iconSpills,ee=L.width<ps,Y=D.textSpills||G,ne=w.lines,k=u.chips.pack,O=w.lastBaseline,X=u.barExtra,U=[],K=L.y+B-Jt-Cr-Fn,q=L.y+(C&&Y?Math.max(vi,O):O)+Fn,ie=C&&Y||!C&&F.length>0?Math.max(K,q):K,ge=C?L.x+L.width+Mn:L.x+$n,fe=ge;if(k)for(let Ze=0;Ze<k.rows.length;Ze+=1){let Zn=ie+Ze*Vf,Pt=ge;for(let Ms of k.rows[Ze]){let cE=zd(Ms.id,n.styleCtx,Pt,Zn);U.push(cE),Pt+=cE.box.width+Bn}let Ds=Pt-Bn;Ds>fe&&(fe=Ds)}else{let Ze=ge;for(let Zn of F){let Pt=zd(Zn.id,n.styleCtx,Ze,ie);U.push(Pt),Ze+=Pt.box.width+Bn}fe=F.length>0?Ze-Bn:ge}let de=y??re(i,"owner"),rt=e.description?.text,ht=g.length>0&&ee,mt=null;if(Y){let Ze=Math.max(...ne.map(Pt=>se(Pt,Nr))),Zn=(x?se(x,11):0)+E;mt=Math.max(Ze,Zn)}let Yl=Yf({barRightX:L.x+L.width,iconSpills:G,captionWidth:mt,footnoteCount:ht?g.length:0,dotSpills:z}),{iconSpillX:UN,footnoteSpillStartX:GN,dotSpillCx:HN}=Yl,zN=Math.max(L.x+L.width,Yl.rightX),$s=e.name;$s&&(n.entityLeftEdges.set($s,W),n.entityRightEdges.set($s,P)),hS(e,P,n);let aE=$s??cx(e);n.itemFlowKey.set(aE,n.currentFlowKey),t.startX=W,t.x=P,t.height=Math.max(t.height,n.bandScale.step()+X);let lE=aS({box:L,afterDate:Wt(o),beforeDate:Wt(s),hasLinkIcon:S,footnoteCount:g.length}),qn={kind:"item",id:$s,title:I,...ne.length>=2||ne[0]!==I?{titleLines:ne}:{},box:L,dateSpan:{startX:W,endX:j},status:p,statusDotColor:wS(p,d.bg,n.styleCtx.theme),progressFraction:m,footnoteIndicators:g,labelChips:U,chipsOutside:C,chipsRightX:fe,linkIcon:v.icon,linkHref:v.href,hasOverflow:R,overflowBox:N,overflowAnchorId:$,owner:de,description:rt,metaText:x,textSpills:Y,dotSpills:z,iconSpills:G,footnoteSpills:ht,dotSpillCx:HN,iconSpillX:UN,footnoteSpillStartX:GN,decorationsRightX:zN,capacity:T,size:u.size,style:d,inlineDatePins:lE.length>0?lE:void 0},Vl=mS(e,n);return Vl!==void 0&&(qn.waveRole=Vl),Vl==="background"&&(qn.waveHatch=Wd(d.bg)),l!==void 0&&(qn.nonWorkingPin=l),w.truncated&&(qn.titleTruncated=!0),Vl==="background"&&n.waves&&(qn.waveTooltip=n.waves.backgroundTooltip),n.placedItems.set(aE,qn),kS(A,_,qn),qn}function cx(e){let t=e.$cstNode?.range.start;return`#item@${t?t.line+1:0}:${t?t.character+1:0}`}function ux(e){let t=new Map;for(let n of mA(e))Ke(n)&&t.set(n.name??cx(n),n);return t}var IB=.01;function RB(e,t){let n={blocks:[],edges:[]},r=new Map,i=(a,l,c)=>{n.blocks.push({x:a,y:c,width:l,height:0})},o=(a,l)=>{let{box:c}=a;if(a.kind==="item"){n.blocks.push({...c,width:Ol(a)-c.x}),n.edges.push({x:c.x,top:c.y,bottom:c.y+c.height},{x:c.x+c.width,top:c.y,bottom:c.y+c.height});return}l&&a.id&&r.set(a.id,a),a.kind==="group"&&a.waveOnly||(a.headerHeight>0&&n.blocks.push({x:c.x,y:c.y,width:Math.max(c.width,ys(a)-c.x),height:a.headerHeight}),i(c.x,c.width,c.y+c.height),n.edges.push({x:c.x,top:c.y,bottom:c.y+c.height},{x:c.x+c.width,top:c.y,bottom:c.y+c.height}));for(let u of a.children)o(u,l)},s=(a,l)=>{i(a.box.x,a.box.width,a.box.y),i(a.box.x,a.box.width,a.box.y+a.box.height);for(let c of a.children)o(c,l);for(let c of a.nested)s(c,l)};for(let a of e)s(a,!0);for(let a of t){i(a.box.x,a.box.width,a.box.y),i(a.box.x,a.box.width,a.box.y+a.box.height);for(let l of a.nestedSwimlanes)s(l,!1)}return{obstacles:n,containers:r}}function fx(e,t,n,r){let{obstacles:i,containers:o}=RB(t,n),s=r.bandScale.bandwidth(),a=Se("item",[],r.styleCtx),l=[];for(let[p,m]of e){let g=r.placedItems.get(p);if(!g)continue;let w=ix(g,s);for(let x of Be(m.properties,"after")){let y=r.placedItems.get(x),T=y?void 0:o.get(x),E;if(y?E=ix(y,s):T&&(E=sS(T)),E){l.push({fromId:x,toId:p,source:E,target:w});continue}let v=r.entityMidpoints.get(x);if(!v||w.startX-v.x<=IB)continue;let S=w.rowY??w.top;l.push({fromId:x,toId:p,waypoints:[{x:v.x,y:S},{x:w.paintedX,y:S}],slack:!0,...xs(w.bottom-w.top),style:a})}}let c=l.filter(p=>p!==null&&"source"in p),u=_k(c,i,r.scale.pixelsPerDay),f=new Map(c.map((p,m)=>[p,u[m]])),d=[];for(let p of l){if(!p)continue;if(!("source"in p)){d.push(p);continue}let m=f.get(p);m&&d.push({...m,style:a})}return d}function Kd(e,t=0){let n=new Map,r=new Map;return[...e.entries()].forEach(([i,o],s)=>{n.set(i,t+s+1),r.set(i,Be(o.properties,"on"))}),{index:n,hosts:r}}var Vd=11,SB=120,bB=6,IS="\u2014 ";function SS(e,t,n,r,i=[]){let o=Bt,s=n+Bt,a=r-2*Bt,l=o+2*Bt,c=o+a-Bt,u=s+qf+Bt,f=[],d=0,p=(g,w,x)=>{for(let[y,T]of g){let E=T.title??y,v=T.description?.text,S=NB(E,v,l,c),F=u+d*ms,C=j=>({x:j.x,y:F+j.row*ms,text:j.text}),W={number:w.footnoteIndex.get(y)??f.length+1,y:F,title:E,titleLines:S.title.map(C),description:v,style:Se("footnote",T.properties,w.styleCtx)};S.description.length>0&&(W.descriptionLines=S.description.map(C)),x!==void 0&&(W.region=x),f.push(W),d+=S.rows}};p(e,t);for(let g of i){if(g.footnotes.size===0)continue;let w=u+d*ms;d+=1;let x=f.length;p(g.footnotes,g.ctx,g.title),f[x].regionHeadingY=w}return{box:{x:o,y:s,width:a,height:f.length===0?0:qf+d*ms+Bt},entries:f}}function NB(e,t,n,r){let i=r-n,o=RS(e,i,i),s=o.map((g,w)=>({x:n,row:w,text:g}));if(!t)return{title:s,description:[],rows:o.length};let a=se(IS,Vd),l=t.trim().split(/\s+/)[0]??"",c=n+Math.max(SB,e.length*bB),u=o.length===1&&a+se(l,Vd)<=r-c,f=u?c:n,d=u?o.length-1:o.length,p=RS(t,i,r-f-a),m=p.map((g,w)=>({x:w===0?f:n,row:d+w,text:w===0?`${IS}${g}`:g}));return{title:s,description:m,rows:d+p.length}}function RS(e,t,n){if(se(e,Vd)<=n)return[e];let r=wi(e,t,Vd,n);return r.length>0?r:[e]}function Fl(e,t,n){let r=[],i=(o,s,a)=>{let l=_e(re(s.properties,"date"));if(!l)return;let c=n.forwardWithinDomain(l);c!==null&&r.push({id:o,centerX:c,radius:6,title:s.title??o,fontSize:10,bold:a,date:l,isMilestone:a})};for(let[o,s]of e)i(o,s,!1);for(let[o,s]of t)i(o,s,!0);return r}function Zd(e,t){return[...CB(e),...OB(t)]}function bs(e,t){let n=new Map;for(let[r,i]of e){let o=t+13+i.rowIndex*26;n.set(r,{rowIndex:i.rowIndex,centerY:o,labelBox:{...i.labelBox,y:o-4},labelSide:i.labelSide})}return n}function dx(e){return`nonworking:${e.from.toISOString().slice(0,10)}`}function px(e){return`working:${e.from.toISOString().slice(0,10)}`}function bS(e,t,n){return{id:e,centerX:t,radius:0,title:n,fontSize:10,bold:!1}}function CB(e){let t=[];for(let n of e??[])n.label!==void 0&&t.push(bS(dx(n),n.x,n.label));return t}function OB(e){return(e??[]).map(t=>bS(px(t),t.x,t.label))}function Bi(e,t,n,r){let i=n;for(let o of e){let s=NS(o,r),a=o.centerX+o.radius+6+s,l=o.centerX-o.radius-6-s;a>n&&l<t&&(i=Math.max(i,a+st))}return i}function NS(e,t){return t(e.title,e.fontSize)*(e.bold?1.05:1)}function Jd(e){let t=[];for(let n of e)for(let r of n.slackArrows??[])"marker"in r&&r.marker!==n.id&&t.push({from:r.marker,to:n.id});return t}function Ns(e,t,n,r,i=[]){let o=[...e].sort((u,f)=>u.centerX-f.centerX),s=new Map,a=[],l=new Map(e.map(u=>[u.id,u])),c=i.filter(u=>l.has(u.from)&&l.has(u.to));for(let u of o){let f=NS(u,r),d=u.centerX+u.radius+6,p=u.centerX-u.radius-6-f,m=d+f<=n,g=p>=t,w=u.centerX-u.radius,x=u.centerX+u.radius,y=A=>A==="right"?d:p,T=A=>A==="right"?m:g,E=c.filter(A=>A.from===u.id).map(A=>{let _=l.get(A.to);return{left:Math.min(u.centerX,_.centerX)+u.radius,right:Math.max(u.centerX,_.centerX)-_.radius}}).filter(A=>A.right>A.left),v=-1,S=Number.POSITIVE_INFINITY;for(let A of c){if(A.to===u.id){let _=s.get(A.from);_&&(S=Math.min(S,_.rowIndex))}if(A.from===u.id){let _=s.get(A.to);_&&(v=Math.max(v,_.rowIndex))}}let F=A=>{let _=y(A);return E.some(D=>D.left<_+f&&D.right>_)},C=A=>T(A)&&!F(A),W=C("right")?"right":C("left")?"left":m?"right":"left",j=(A,_)=>{let D=Math.min(w,A),L=Math.max(x,A+f),B=[{left:D,right:L},...E];return a[_].some(z=>B.some(G=>z.left<G.right&&z.right>G.left))},P=-1,R="right",N=d;e:for(let A=a.length-1;A>=0;A--)if(!(A<v||A>S))for(let _ of["right","left"]){if(!C(_))continue;let D=y(_);if(!j(D,A)){P=A,R=_,N=D;break e}}if(P===-1&&v>=0&&v<S){let A=v+1;for(let[_,D]of s)D.rowIndex>=A&&s.set(_,{...D,rowIndex:D.rowIndex+1});a.splice(A,0,[]),P=A,R=W,N=y(R)}else if(P===-1){for(let[A,_]of s)s.set(A,{..._,rowIndex:_.rowIndex+1});a=[[],...a],P=0,R=W,N=y(R)}let $=Math.min(w,N),I=Math.max(x,N+f);a[P].push({left:$,right:I},...E),s.set(u.id,{rowIndex:P,labelBox:{x:N,y:0,width:f,height:12},labelSide:R})}return{placements:s,rowCount:a.length}}function hx(e,t){let n=[];for(let r of e){let i=t.placedItems.get(r),o=t.entityRightEdges.get(r);if(o===void 0)continue;let s=i?ox(i,t.bandScale.bandwidth()):void 0;if(!i&&t.waves?.plan.index.has(r)){n.push({ref:r,endX:o,y:s,flowKey:`wave:${r}`,wave:r});continue}let a=t.itemFlowKey.get(r)??`marker:${r}`;if(!i&&t.markerIds.has(r)){n.push({ref:r,endX:o,y:s,marker:!0,flowKey:a});continue}n.push({ref:r,endX:o,y:s,flowKey:a})}return n}function mx(e){let t=new Map;for(let n of e){let r=t.get(n.flowKey);(!r||n.endX>r.endX)&&t.set(n.flowKey,n)}return Array.from(t.values())}function LS(e,t){return Math.abs(t-e.endX)<=12}function PS(e,t){return e.endX>=t||e.wave!==void 0?null:e.y!==void 0?{x:e.endX,y:e.y}:e.marker&&!LS(e,t)?{x:e.endX,marker:e.ref}:null}function CS(e){let t=null;for(let n of e)n.wave===void 0&&(!t||n.endX>t.endX)&&(t=n);return t}function $B(e,t,n){return e.y!==void 0?{x:e.endX,y:e.y}:e.marker?LS(e,t)?null:{x:e.endX,marker:e.ref}:{x:e.endX,marker:n}}function DB(e,t){let n;for(let r of e)r.wave===void 0||r.endX-t<It||(!n||r.endX>n.endX)&&(n=r);return n?.wave}var gx=class{constructor(t,n){M(this,"id");M(this,"milestone");this.id=t,this.milestone=n}place(t){let n=this.milestone,r=Se("milestone",n.properties,t.styleCtx),i=re(n.properties,"date"),o=Be(n.properties,"after"),s=_e(i),a=t.timeline.markerRow.y,l=6,c=n.title??this.id,u=null,f=a,d=!1,p,m=!1,g;if(s){let y=t.scale.forwardWithinDomain(s);if(y===null)return null;u=y,d=!0;let T=t.markerRowPlacements.get(this.id);T&&(f=T.centerY);let E=hx(o,t),v=mx(E),S=CS(v);if(S&&S.endX>y){m=!0;let F=$B(S,y,this.id);F&&(p=[F])}g=DB(v,y),g!==void 0&&(m=!0)}else if(o.length>0){let y=hx(o,t),T=mx(y);T.sort((S,F)=>F.endX-S.endX);let E=T[0]?.endX??t.timeline.originX;u=E,d=!1;let v=[];for(let S=1;S<T.length;S++){let F=PS(T[S],E);F&&v.push(F)}v.length>0&&(p=v)}if(u===null)return null;let w={x:u,y:f};t.entityLeftEdges.set(this.id,w.x),t.entityRightEdges.set(this.id,w.x),t.entityMidpoints.set(this.id,w);let x={id:this.id,title:c,x:u,radius:l,fixed:d,slackArrows:p,isOverrun:m,style:r,cutTopY:t.chartTopY,cutBottomY:t.swimlaneBottomY};return t.waves&&!m&&gS(t.waves,u)&&(x.onWaveBoundary=!0),g!==void 0&&s&&(x.overrunByWave=g,x.overrunDate=Ti(s)),s&&!t.scale.showsNonWorking&&!t.calendar.isWorkingDay(s)&&(x.hiddenDate=Ti(s)),x}};function Qd(e,t){let n=[];for(let[r,i]of e){let o=new gx(r,i).place(t);o&&n.push(o)}return n}function ep(e,t){let n=r=>{let i=t.get(r);if(!i)throw new Error(`layout: marker "${r}" has no marker-row placement`);return i};return e.map(r=>{let i=n(r.id),o={id:r.id,title:r.title,center:{x:r.x,y:i.centerY},radius:r.radius,fixed:r.fixed,slackArrows:r.slackArrows?.map(s=>"y"in s?{x:s.x,y:s.y}:{x:s.x,y:n(s.marker).centerY}),isOverrun:r.isOverrun,style:r.style,cutTopY:r.cutTopY,cutBottomY:r.cutBottomY,labelBox:i.labelBox,labelSide:i.labelSide};return r.onWaveBoundary&&(o.onWaveBoundary=!0),r.overrunByWave!==void 0&&(o.overrunByWave=r.overrunByWave),r.overrunDate!==void 0&&(o.overrunDate=r.overrunDate),r.hiddenDate!==void 0&&(o.hiddenDate=r.hiddenDate),o})}function OS(e,t){let n=[];for(let[r,i]of e){let o=re(i.properties,"date"),s=Be(i.properties,"after"),a=_e(o),l=hx(s,t),c=mx(l);if(a){let f=t.scale.forwardWithinDomain(a);if(f===null)continue;let d=CS(c);d&&d.endX>f&&d.y!==void 0&&n.push({xStart:Math.min(d.endX,f),xEnd:Math.max(d.endX,f),y:d.y,slackPredId:d.ref,milestoneId:r});continue}if(c.length===0)continue;c.sort((f,d)=>d.endX-f.endX);let u=c[0].endX;for(let f=1;f<c.length;f++){let d=c[f],p=PS(d,u);p&&"y"in p&&n.push({xStart:d.endX,xEnd:u,y:p.y,slackPredId:d.ref,milestoneId:r})}}return n}var Bl=16,MB=8,FB=6;function DS(e,t,n,r,i,o){yx(e.content.anchors,t);let s=Qd(e.content.milestones,t),a=BB(e.content.anchors,s,t);if(a.length===0)return{anchors:[],milestones:[],laneShift:0};let l=Bl,c=Ns(a,l,Bi(a,l,o-Bl,se),se,Jd(s)),u=n+MB,f=u+c.rowCount*26+FB-r,d=i+f,p=bs(c.placements,u);t.markerRowPlacements=p,t.chartTopY=r+f,t.swimlaneBottomY=d;let m=Pd(e.content.anchors,t,new Set),g=ep(s.map(w=>({...w,cutTopY:t.chartTopY,cutBottomY:d,slackArrows:w.slackArrows?.map(x=>"y"in x?{x:x.x,y:x.y+f}:x)})),p);return{anchors:m,milestones:g,laneShift:f}}function MS(e,t){let n=[...(e.anchors??[]).map(i=>$S(i,!1)),...(e.milestones??[]).map(i=>$S(i,!0))];return n.length===0?t:Bi(n,e.box.x+Bl,t-Bl,se)+Bl}function FS(e){let t=0;for(let n of[...e.anchors??[],...e.milestones??[]])t=Math.max(t,n.labelBox.x+n.labelBox.width);return t}function BB(e,t,n){let r=Fl(e,new Map,n.scale),i=o=>({id:o.id,centerX:o.x,radius:o.radius,title:o.title,fontSize:10,bold:!0});return r.push(...t.filter(o=>o.fixed).map(i)),r.push(...t.filter(o=>!o.fixed).map(i)),r}function $S(e,t){return{id:e.id??"",centerX:e.center.x,radius:e.radius,title:e.title,fontSize:10,bold:t}}function yx(e,t){for(let n of Fl(e,new Map,t.scale))t.entityLeftEdges.set(n.id,n.centerX),t.entityRightEdges.set(n.id,n.centerX)}var WB=.8,XB=1;function UB(e){let t=[];return WS(e,t),t}function WS(e,t){for(let n of e)if(n.kind==="item"){let r=GB(n);r>0&&n.box.width>0&&t.push({startX:n.box.x,endX:n.box.x+n.box.width,load:r})}else(n.kind==="parallel"||n.kind==="group")&&WS(n.children,t)}function GB(e){return e.capacity?e.capacity.value:e.size?1:0}function XS(e){if(e.capacityValue<=0||e.warnFraction===null&&e.overFraction===null)return null;let t=UB(e.children);if(t.length===0)return null;let n=new Set;for(let s of t)n.add(s.startX),n.add(s.endX);let r=Array.from(n).sort((s,a)=>s-a);if(r.length<2)return null;let i=[];for(let s=0;s<r.length-1;s++){let a=r[s],l=r[s+1],c=(a+l)/2,u=0;for(let f of t)f.startX<=c&&c<f.endX&&(u+=f.load);i.push({startX:a,endX:l,load:u,classification:HB(u,e.capacityValue,e.warnFraction,e.overFraction)})}let o=[];for(let s of i){let a=o[o.length-1];a&&a.classification===s.classification&&a.endX===s.startX?a.endX=s.endX:o.push({...s})}return{segments:o,capacityValue:e.capacityValue,warnFraction:e.warnFraction,overFraction:e.overFraction}}function HB(e,t,n,r){let i=e/t;return r!==null&&i>=r?"red":n!==null&&i>=n?"yellow":"green"}function US(e,t){let n=t.get("swimlane"),r=BS(re(e.properties,"utilization-warn-at"),n?re(n.properties,"utilization-warn-at"):void 0,WB),i=BS(re(e.properties,"utilization-over-at"),n?re(n.properties,"utilization-over-at"):void 0,XB);return{warn:r,over:i}}function BS(e,t,n){let i=YB(e??t);return i.kind==="unset"?n:i.kind==="none"?null:i.value}var zB=/^\d+(?:\.\d+)?%$/,jB=/^\d+\.\d+$/;function YB(e){if(e===void 0)return{kind:"unset"};if(e==="none")return{kind:"none"};if(zB.test(e)){let t=parseFloat(e)/100;return Number.isFinite(t)&&t>0?{kind:"number",value:t}:{kind:"unset"}}if(jB.test(e)){let t=parseFloat(e);return Number.isFinite(t)&&t>0?{kind:"number",value:t}:{kind:"unset"}}return{kind:"unset"}}var tp=class{constructor(t){M(this,"rows");M(this,"opts");M(this,"paintedRightX");this.opts=t,this.paintedRightX=t.laneLeftX,this.rows=[{y:t.originY,height:t.minRowHeight,rightEdge:t.laneLeftX,spillX:t.laneLeftX}]}placeItem(t){let n=this.rows[this.rows.length-1],i=t.desiredStart>=n.rightEdge&&t.desiredStart>=n.spillX&&!this.rowIntersectsCorridor(n,t)&&!this.rowCrossesOwnCorridor(n,t)?n:this.appendRow(Math.max(this.opts.minRowHeight,t.predictedHeight));return{rowIndex:this.rows.length-1,y:i.y}}placeBlock(){let t=this.rows[this.rows.length-1];if(t.rightEdge>this.opts.laneLeftX){let n=this.appendRow(this.opts.minRowHeight);return{rowIndex:this.rows.length-1,y:n.y}}return{rowIndex:this.rows.length-1,y:t.y}}commitItem(t){let n=this.rows[t.rowIndex];n.height=Math.max(n.height,t.placed.box.height,t.rowHeight??0),n.rightEdge=t.logicalEnd,n.spillX=t.spillReservation??this.opts.laneLeftX}commitBlock(t){let n=this.rows[t.rowIndex];n.height=Math.max(n.height,t.blockHeight),n.rightEdge=t.blockEnd,n.spillX=t.spillReservation??this.opts.laneLeftX,t.paintedRight!==void 0&&t.paintedRight>this.paintedRightX&&(this.paintedRightX=t.paintedRight)}usedHeight(){let t=this.rows[this.rows.length-1];return t.y+t.height-this.opts.originY}usedRightX(){let t=this.paintedRightX;for(let n of this.rows)n.rightEdge>t&&(t=n.rightEdge),n.spillX>t&&(t=n.spillX);return t}rowIntersectsCorridor(t,n){return this.opts.slackCorridors.some(r=>r.y>=t.y&&r.y<t.y+t.height&&n.desiredStart<r.xEnd&&n.desiredEnd>r.xStart&&r.slackPredId!==n.childId&&!n.pendingIds?.has(r.slackPredId))}rowCrossesOwnCorridor(t,n){return this.opts.slackCorridors.some(r=>r.slackPredId===n.childId&&r.xStart<n.desiredStart&&t.rightEdge>Math.max(r.xStart,this.opts.laneLeftX))}appendRow(t){let n=this.rows[this.rows.length-1],r={y:n.y+n.height,height:t,rightEdge:this.opts.laneLeftX,spillX:this.opts.laneLeftX};return this.rows.push(r),r}};function xx(e){return Ke(e)?e.name?[e.name]:[]:vt(e).flatMap(xx)}function np(e,t,n,r){let i=n.bandScale.step(),o=t.leftX,s=new tp({laneLeftX:o,originY:t.firstRowY,minRowHeight:i,slackCorridors:n.slackCorridors}),a=o,l=Number.POSITIVE_INFINITY,c=new Set(vt(e).flatMap(xx)),u=[];for(let f of vt(e)){for(let C of xx(f))c.delete(C);if(!Ke(f)){let C=$l(f,a,n),{rowIndex:W,y:j}=s.placeBlock(),P=Ml(C,j),R=r.sequenceOne(f,P,n);u.push(R);let N=R.box.x+R.box.width,$=Math.max(i,P.height),I=HS(R);s.commitBlock({rowIndex:W,placed:R,blockHeight:$,blockEnd:N,spillReservation:I>N?I:null,paintedRight:Ol(R)}),l=Math.min(l,P.startX),a=Math.max(a,P.x);continue}let d=f,p=$l(d,a,n),m=n.scale.startX(p),g=jd(d,m,n),w=m+g.naturalWidth,x=i+g.barExtra,{rowIndex:y,y:T}=s.placeItem({childId:d.name??"",desiredStart:m,desiredEnd:w,predictedHeight:x,pendingIds:c}),E=Ml(p,T),v=Yd(d,E,n,g);u.push(v),l=Math.min(l,E.startX);let S=Math.max(m+g.naturalWidth,v.box.x+v.box.width),F=m+Ss(n,m,g.durationDays);a=Math.max(a,F),s.commitItem({rowIndex:y,placed:v,logicalEnd:S,spillReservation:GS(v),rowHeight:x})}return l===Number.POSITIVE_INFINITY&&(l=n.scale.startX(o)),{children:u,timeCursorX:a,timeStartX:l,packer:s}}function GS(e){return e.textSpills||e.chipsOutside||e.dotSpills||e.iconSpills||e.footnoteSpills?Math.max(e.decorationsRightX,e.chipsOutside?e.chipsRightX:0)+6:null}function HS(e){let t=e.box.x+e.box.width;if(e.kind==="item")return Math.max(t,GS(e)??t);let n=ys(e);return Math.max(t,n>t?n+wk:t,...e.children.map(HS))}var Ex=10;function VB(e,t,n){let r=re(e.properties,"capacity"),i=Rr(r);if(i===null)return{capacity:null,badgeWidthPx:0};let o=Qa(i),s=el(t.capacityIcon,n),a=tl(o,s,Ex),l=nl(o,s,Ex);return{capacity:{value:i,text:o,icon:s,...l!==void 0?{iconDxTerms:l}:{}},badgeWidthPx:a}}var KB=10,qB=38,ZB=8;function JB(e,t,n){let r=e.title??e.name??"";if(!r)return 0;let i=re(e.properties,"owner");return wl(0,r,i??void 0,t,n).rightX}function QB(e,t){if(!e.name)return[];let n=[];for(let[r,i]of t.footnoteHosts.entries())if(i.includes(e.name)){let o=t.footnoteIndex.get(r);o!==void 0&&n.push(o)}return n.sort((r,i)=>r-i),n}function eW(e,t,n){for(let r of e.content)if(r.$type!=="DescriptionDirective")return n.scale.startX($l(r,t,n))}var Ls=class{constructor(t,n){M(this,"input");M(this,"helpers");this.input=t,this.helpers=n}get id(){return this.input.lane.name??""}place(t,n){let{lane:r,bandIndex:i}=this.input,{helpers:o}=this,s=Se("swimlane",r.properties,n.styleCtx),a=t.x,l=n.bandScale.step(),c=n.currentFlowKey;n.currentFlowKey=`lane:${r.name??i}`;let{capacity:u,badgeWidthPx:f}=VB(r,s,n.symbols),d=QB(r,n),p=d.length>0?se(d.join(","),Ex):0,m=JB(r,f,p),g=eW(r,a,n),w=!r.title||g===void 0||g>=m+ZB,x=t.y+(w?KB:qB),y=np(r,{leftX:a,firstRowY:x},n,o),{children:T}=y,E=x-t.y,v=Math.max(l+32,E+y.packer.usedHeight()+16),S=Math.max(y.packer.usedRightX(),m),F={x:0,y:t.y,width:0,height:v},C=re(r.properties,"owner"),W;if(C){let P=n.teams.get(C),R=n.persons.get(C);W=P?.title??R?.title??C}let j=u?(()=>{let{warn:P,over:R}=US(r,n.styleCtx.defaults);return XS({children:T,capacityValue:u.value,warnFraction:P,overFraction:R})})():null;return n.currentFlowKey=c,{positioned:{id:r.name,title:r.title??r.name??"",box:F,bandIndex:i,children:T,nested:[],style:s,owner:W,footnoteIndicators:d,capacity:u,capacityBadgeWidth:f,footnoteIndicatorWidth:p,utilization:j},usedHeight:v,usedRightX:S}}};var tW=18,nW=14,rW=14,iW=16,oW=32;function wx(e,t,n,r,i){let o=n+tW,s=[],a=[],l=!0,c=t.footnoteIndex.size;for(let u of e){l||(o+=iW),l=!1;let f=u.content.roadmap?.title??u.sourcePath,d=o+nW,p=Xd(u,{theme:t.styleCtx.theme,cal:t.cal,schedule:t.schedule,timeline:t.timeline,scale:t.scale,calendar:t.calendar,axisColumns:t.axisColumns,bandScale:t.bandScale,waves:t.waves},{chartTopY:d,chartBottomY:d,swimlaneBottomY:d},{footnotes:Kd(u.content.footnotes,c)});c+=u.content.footnotes.size,t.waves?Fd(t.waves,p.entityLeftEdges,p.entityRightEdges):yx(u.content.anchors,p);let m=[],g=d,w=0;for(let S of u.content.swimlanes.values()){p.nextParallelId=0,p.nextGroupId=0;let{positioned:F,usedHeight:C}=new Ls({lane:S,bandIndex:w},r).place({x:p.timeline.originX,y:g},p);m.push(F),g+=C,w++}let x=DS(u,p,o,d,g,i);if(x.laneShift!==0){for(let S of m)Is(S,x.laneShift);g+=x.laneShift}let y=g,T=Math.max(t.bandScale.bandwidth(),y-o+rW),E={x:0,y:o,width:0,height:T},v={sourcePath:u.sourcePath,label:f,box:E,nestedSwimlanes:m,style:Se("swimlane",[],t.styleCtx)};x.anchors.length>0&&(v.anchors=x.anchors),x.milestones.length>0&&(v.milestones=x.milestones),s.push(v),a.push(p),o+=T}return{regions:s,contexts:a,endY:o}}function zS(e,t){let n=rp(e,t);e.box.width=n;for(let r of e.nestedSwimlanes)r.box.width=n}function rp(e,t){let n=e.box.x,{chromeRightX:r}=Tl(n,e.label,e.sourcePath),i=Rs(e.nestedSwimlanes),o=Math.max(r,i,FS(e))+oW;return Math.min(t-n,o-n)}function jS(e,t,n,r){if(!e)return null;let i=t.scale.forwardWithinDomain(e);if(i===null)return null;let o=t.timeline.box.y,s=t.timeline.tickPanelY,a=Un(n).nowLabel,l=se(a,hl),c=Math.max(Kg,Math.ceil(l+2*hs)),u=t.timeline.originX-st,f=c/2,d;i-f<u?d="flag-right":i+f>r?d="flag-left":d="center";let p=t.timeline.bottomTickPanelY,m=t.timeline.bottomTickPanelHeight??0,g=p!==void 0&&m>0?p+m:t.swimlaneBottomY;return{x:i,topY:s,bottomY:g,pillTopY:o,pillMode:d,label:a,pillWidth:c,style:Se("item",[],t.styleCtx)}}function ip(e){let t=e.trim().replace(/^#/,"");if(t.length===3&&(t=t.split("").map(n=>n+n).join("")),!/^[0-9a-fA-F]{6}$/.test(t))throw new Error(`Unsupported hex colour: ${e}`);return[Number.parseInt(t.slice(0,2),16),Number.parseInt(t.slice(2,4),16),Number.parseInt(t.slice(4,6),16)]}function YS(e){let[t,n,r]=ip(e).map(i=>{let o=i/255;return o<=.03928?o/12.92:((o+.055)/1.055)**2.4});return .2126*t+.7152*n+.0722*r}function op(e,t){let n=YS(e),r=YS(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}var sW=4.5;function qS(e,t,n,r,i){if(!e.frozen||!e.solve)throw new Error("buildWaves: the wave barrier has not settled");let o=t.timeline.waveStrip;if(!o)throw new Error("buildWaves: the timeline has no wave strip");let s=Md(e.plan,e.solve,e.pass,e.origin,e.floors,It),a=s.every(E=>E.memberCount===0),l=t.timeline.box.x,c=l+t.timeline.box.width,u=o.y+o.height/2,f=o.y+Si,d=o.height-2*Si,p=[],m=0,g=s.map((E,v)=>{let S=e.plan.waves[v],F=S.title??E.id,C=E.memberCount===0,W=Bd(E.start,t),j=yS(E.start,E.end,t),P=C?void 0:m++,R=lW(E.id,t),N=cW(S.properties,P,t),$=Math.max(E.start,l),I=Math.min(E.end,c),A=Math.max(0,I-$),_,D=!1;if(!C){if(R.length>0){let U=R.length*Mt;_=VS(F,E.id,v+1,A,U),D=_!==void 0}_??(_=VS(F,E.id,v+1,A,0))}let L=($+I)/2,B;if(C&&(L=E.start,!a)){let U=p.filter(K=>Math.abs(K-E.start)<It).length;p.push(E.start),L=E.start+U*hy,B={x:L,y:u}}let z=C?Tx(W):`${Tx(W)} \u2013 ${Tx(j)}`,G=[F,z];C?G.push(n.waveNoItems):E.heldBy!==void 0&&G.push(`${n.waveHeldBy} ${E.heldBy}`);let ee,Y=s[v-1];if(!a&&Y!==void 0&&E.floorRef!==void 0&&E.start-Y.end>It){let U=Math.max(Y.end,l),K=Math.min(E.start,c),q=se(E.floorRef,mn);if(q+2*$r<=K-U){let J=(U+K)/2,ie=q+2*Dr;ee={text:E.floorRef,x:J,halo:{x:J-ie/2,y:f,width:ie,height:d}}}}let ne={x:E.start,y:o.y,width:E.end-E.start,height:o.height},k=C?void 0:aW(ne,t.timeline.box),O,X;if(k){let U=k.x+k.width,K=D?R.length*Mt:0;if(K){let q=U-$r+Dr,J=U-$r-K-Dr;X={rightX:U-$r,halo:{x:J,y:f,width:q-J,height:d}}}if(_){let q=ZS(_.label),J=K?Math.min(L,U-$r-K-q/2):L,ie=q+2*Dr;O={x:J,halo:{x:J-ie/2,y:f,width:ie,height:d}}}}return{id:E.id,title:F,index:v,...P!==void 0?{visibleOrdinal:P}:{},startX:E.start,endX:E.end,startDate:W,endDate:j,memberCount:E.memberCount,empty:C,...E.heldBy!==void 0?{heldBy:E.heldBy}:{},...E.floorRef!==void 0?{floorRef:E.floorRef}:{},columnBox:{x:E.start,y:t.chartTopY,width:E.end-E.start,height:t.swimlaneBottomY-t.chartTopY},strip:{box:{x:E.start,y:o.y,width:E.end-E.start,height:o.height},..._?{label:_.label}:{},labelKind:_?.kind??"none",labelX:L,...k?{cell:k}:{},...O?{labelDraw:O}:{},...X?{superscripts:X}:{},tooltip:G.join(" \xB7 "),footnotesShown:D,...B?{marker:B}:{},...ee?{gapLabel:ee}:{}},style:N,footnoteIndicators:R}}),w=a?[]:dW(g,e.origin,o.y,t),x=vx(r),y=i.map(E=>vx(E.nestedSwimlanes)),T={waves:g,boundaries:w,crossings:KS(x,w),regionCrossings:y.map(E=>KS(E,w)),hasBackground:x.length+y.flat().length>0};return a&&(T.placeholder=XR(n,g.map(E=>E.title))),T}function aW(e,t){let n=bi,r={x:e.x,y:e.y+n,width:e.width,height:e.height-2*n},i={x:t.x+n,y:e.y,width:t.width-2*n,height:e.height},o=Math.max(r.x,i.x),s=Math.max(r.y,i.y),a=Math.min(r.x+r.width,i.x+i.width),l=Math.min(r.y+r.height,i.y+i.height);if(!(a<=o||l<=s))return{x:o,y:s,width:a-o,height:l-s}}function ZS(e){return se(e,mn)*1.05}function VS(e,t,n,r,i){let o=a=>ZS(a)+i+2*$r<=r;if(o(e))return{kind:"title",label:e};if(t!==e&&o(t))return{kind:"id",label:t};for(let a=e.length-1;a>=3;a--){let l=e.slice(0,a).trimEnd();if(l.length<3)break;let c=`${l}\u2026`;if(o(c))return{kind:"ellipsis",label:c}}let s=`#${n}`;if(o(s))return{kind:"ordinal",label:s}}function lW(e,t){let n=[];for(let[r,i]of t.footnoteHosts.entries()){if(!i.includes(e))continue;let o=t.footnoteIndex.get(r);o!==void 0&&n.push(o)}return n.sort((r,i)=>r-i)}function cW(e,t,n){let r=n.styleCtx.theme,i=new Map,o=re(e,"style"),s=o?n.styleCtx.styles.get(o):void 0;for(let d of s?.properties??[])i.set(Q(d),d.value);let a=d=>{let p=i.get(d);if(p===void 0)return;let m=jn(p,r);return m==="none"?void 0:m},l=a("bg"),c=t!==void 0&&t%2===1?r.wave.stripFillAlt:r.wave.stripFill,u=l?uW(c,l,yl)??c:c,f=i.get("border");return{...l?{tint:l}:{},stripFill:c,text:a("text")??fW(r.wave,u),boundary:a("fg")??r.wave.boundary,boundaryDash:f==="dashed"?"4 2":f==="dotted"?"1 2":null}}var sp=/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;function uW(e,t,n){if(!sp.test(e)||!sp.test(t))return;let r=ip(e),i=ip(t);return`#${r.map((o,s)=>Math.round(o*(1-n)+i[s]*n).toString(16).padStart(2,"0")).join("")}`}function fW(e,t){let n=e.labelText;return!sp.test(n)||!sp.test(t)||op(n,t)>=sW?n:op(e.hatch,t)>=op(e.hatchOnDark,t)?e.hatch:e.hatchOnDark}function dW(e,t,n,r){let i=[];for(let a of e)a.empty||(i.push({x:a.startX,wave:a,opening:!0}),i.push({x:a.endX,wave:a,opening:!1}));i.sort((a,l)=>a.x-l.x);let o=[],s=0;for(;s<i.length;){let a=s;for(;a<i.length&&i[a].x-i[s].x<It;)a++;let l=i.slice(s,a);s=a;let c=l[0].x;if(Math.abs(c-t)<It)continue;let u=(l.find(f=>f.opening)??l[0]).wave;o.push({x:c,topY:n,bottomY:r.swimlaneBottomY,stroke:u.style.boundary,dash:u.style.boundaryDash})}return o}function vx(e){let t=[],n=r=>{for(let i of r)i.kind==="item"?i.waveRole==="background"&&t.push(i):n(i.children)};for(let r of e)n(r.children),t.push(...vx(r.nested));return t}function KS(e,t){let n=[];for(let r of e){let i=r.box.x,o=r.box.x+r.box.width;for(let s of t)i<s.x&&s.x<o&&n.push({x:s.x,topY:r.box.y,bottomY:r.box.y+r.box.height,stroke:s.stroke})}return n}var pW="\u2070\xB9\xB2\xB3\u2074\u2075\u2076\u2077\u2078\u2079";function hW(e){return String(e).replace(/[0-9]/g,t=>pW[Number(t)])}function JS(e,t,n,r,i){let{waves:o}=e,s=o.some(v=>!v.empty&&v.strip.labelKind!=="title"),a=o.some(v=>v.empty),l=o.some(v=>v.footnoteIndicators.length>0&&!v.strip.footnotesShown);if(!e.hasBackground&&!s&&!a&&!l)return;let c=mn,u=v=>se(v,c),f=t.timeline.originX,d=Math.max(f,i-st),p=0,m=f,g=!1,w=0,x=v=>r+v*xl+sd,y=v=>{g&&m+od+v>d&&(p++,m=f,g=!1);let S=g?m+od:m;return m=S+v,g=!0,w=Math.max(w,m-f),S},T=[],E=(v,S)=>{let F=rd+my,C=y(F+u(S)),W=x(p);T.push({kind:v,text:S,swatch:{x:C,y:W-sd+(xl-id)/2,width:rd,height:id},...v==="background"?{hatch:Wd(t.styleCtx.theme.entities.item.bg)}:{},runs:[{text:S,x:C+F,y:W}]})};if(e.hasBackground&&E("background",n.waveLegendBackground),e.boundaries.length>0&&E("boundary",n.waveLegendBoundary),s||a||l){let v=o.map(W=>{let j=`#${W.index+1} ${W.title}`;return W.footnoteIndicators.length>0&&!W.strip.footnotesShown&&(j+=` ${W.footnoteIndicators.map(hW).join(",")}`),W.empty&&(j+=` (${n.waveNoItems})`),j}),S=" \xB7 ",F=`${n.waveLegendPrefix} ${v[0]}`,C=[{text:F,x:y(u(F)),y:x(p)}];for(let W of v.slice(1)){let j=C[C.length-1];m+u(S+W)<=d?(j.text+=S+W,m+=u(S+W),w=Math.max(w,m-f)):(p++,m=f,g=!1,C.push({text:W,x:y(u(W)),y:x(p)}))}T.push({kind:"waves",text:`${n.waveLegendPrefix} ${v.join(S)}`,runs:C})}return{box:{x:f,y:r,width:w,height:(p+1)*xl},entries:T}}function Tx(e){return e.toISOString().slice(0,10)}var QS=1e-6,Ps=class{constructor(t){M(this,"domain");M(this,"range");M(this,"pixelsPerDay");M(this,"calendar");M(this,"nonWorking");this.domain=t.domain,this.range=t.range,this.calendar=t.calendar,this.nonWorking=t.nonWorking??"hide";let n=Math.max(1,this.showsNonWorking?At(t.domain[0],t.domain[1]):this.indexOf(t.domain[1]));this.pixelsPerDay=(t.range[1]-t.range[0])/n}get showsNonWorking(){return this.nonWorking==="show"&&this.calendar?.hasNonWorkingDays===!0}indexOf(t){return this.calendar?this.calendar.workingIndexOf(this.domain[0],t):At(this.domain[0],t)}dayAt(t){let n=(t-this.range[0])/this.pixelsPerDay;return{days:n,day:Math.floor(n+QS)}}forward(t){return this.showsNonWorking?this.range[0]+At(this.domain[0],t)*this.pixelsPerDay:this.range[0]+this.indexOf(t)*this.pixelsPerDay}forwardWithinDomain(t){return t<this.domain[0]||t>this.domain[1]?null:this.forward(t)}invert(t){let n=Math.round((t-this.range[0])/this.pixelsPerDay);return this.showsNonWorking?Xe(this.domain[0],n):this.calendar?this.calendar.dateAtWorkingIndex(this.domain[0],n):Xe(this.domain[0],n)}indexAtX(t){let{days:n,day:r}=this.dayAt(t);if(!this.showsNonWorking||!this.calendar)return n;let i=Xe(this.domain[0],r),o=this.calendar.workingIndexOf(this.domain[0],i);return this.calendar.isWorkingDay(i)?o+Math.max(0,n-r):o}startX(t){if(!this.showsNonWorking||!this.calendar)return t;let n=Xe(this.domain[0],this.dayAt(t).day);if(this.calendar.isWorkingDay(n))return t;let r=this.calendar.workingIndexOf(this.domain[0],n);return this.forward(this.calendar.dateAtWorkingIndex(this.domain[0],r))}advanceX(t,n){if(!this.showsNonWorking||!this.calendar)return t+n*this.pixelsPerDay;let r=this.startX(t);if(n<=0)return r;let i=this.indexAtX(r)+n,o=Math.ceil(i-QS)-1,s=i-o,a=this.calendar.dateAtWorkingIndex(this.domain[0],o);return this.forward(a)+s*this.pixelsPerDay}get originX(){return this.range[0]}get widthPx(){return this.range[1]-this.range[0]}};var ap=6,gW=4,eb=8,cp=class{constructor(t){M(this,"input");this.input=t}measure(){let{title:t,author:n,style:r,logo:i}=this.input,o=r.headerPosition==="beside",s=yW(t,n,i),a=i?Math.max(Qg,i.height+20):Qg;return{position:r.headerPosition,titleLines:s.titleLines,authorLines:s.authorLines,cardWidth:s.cardWidth,cardHeight:s.cardHeight,textCardHeight:s.textCardHeight,logoSlot:s.logoSlot,...i?{logo:i}:{},chartLeftX:o?s.boxWidth:0,aboveHeight:a,chartTopY:o?eb:a+eb,minRowsBottomY:o?s.cardHeight+gW:0}}place(t,n){let{title:r,author:i,style:o}=this.input,s=t.position==="beside",a=s?{x:0,y:0,width:t.chartLeftX,height:n.chartBottomY}:{x:0,y:0,width:n.canvasRightX,height:t.aboveHeight},l=s?{x:ap,y:n.rowsBottomY-t.cardHeight,width:t.cardWidth,height:t.cardHeight}:{x:0,y:0,width:n.canvasRightX,height:t.aboveHeight},c,u;return t.logo&&(c={box:{x:a.x+l.x+16,y:a.y+l.y+(l.height-t.logo.height)/2,width:t.logo.width,height:t.logo.height},assetRef:t.logo.assetRef,intrinsic:t.logo.intrinsic},u={x:t.logoSlot,y:Math.max(0,(l.height-t.textCardHeight)/2)}),{box:a,position:o.headerPosition,title:r,author:i,titleLines:t.titleLines,authorLines:t.authorLines,cardBox:l,logo:c,...u?{textInset:u}:{},style:o}}};function yW(e,t,n){let r=Jg-32,i=wi(e,r,16),o=wi(t??"",r,11),s=0;for(let w of i)s=Math.max(s,se(w,16));for(let w of o)s=Math.max(s,se(w,11));let a=i.length>0||o.length>0,l=n?n.width+(a?12:0):0,c=s+32,u=Math.max(hk-ap,Math.min(Jg-ap,c)+l),f=i.length>0?(i.length-1)*20:0,d=o.length>0?18+(o.length-1)*14:0,p=26+f+d+14,m=n?Math.max(p,n.height+20):p,g=u+ap;return{titleLines:i,authorLines:o,cardWidth:u,cardHeight:m,textCardHeight:p,logoSlot:l,boxWidth:g}}var xW=8;function rb(e,t,n,r,i){let{locale:o,styleCtx:s}=r,{calendar:a,preset:l,startDate:c,timelineDays:u,nonWorking:f}=i,d=i.naturalEndDate,p=i.schedule.plan,m=r.roadmapStyle,g=cl[m.headerHeight]??cl.md,w=g>0&&m.timelinePosition!=="bottom",x=g>0&&(m.timelinePosition==="bottom"||m.timelinePosition==="both"),y=e.roadmapDecl?.title??e.roadmapDecl?.name??"",T=re(e.roadmapDecl?.properties??[],"author"),E=new cp({title:y,author:T,style:m,logo:kk(e,n.logo)}),v=E.measure(),{chartLeftX:S}=v,F=rk({naturalPixelsPerDay:l.pixelsPerUnit/a.daysPerUnit(l.unit),dayCount:u,chromeWidth:S+2*st,maxWidth:n.width}),C=u*F,W=S+st,j=C,R=n.today!==void 0&&n.today>=c&&n.today<=d?Ft:0,N=w?g:0,$=p?ay:0,I=new Ps({domain:[c,d],range:[W,W+C],calendar:a,nonWorking:f}),A=Zd(ex(I,[],l.unit,!1),tx(I)),_=t.content.anchors.size+t.content.milestones.size>0||A.length>0,D=W+j+st,L=Fl(t.content.anchors,t.content.milestones,I),B=[...L,...A],z=Ns(B,S,Bi(B,S,D,se),se),G=_?Math.max(1,z.rowCount):0,ee=G*26,Y=R+N+$+ee,ne=Y+xW,k=Rx(v,Y),O=k+R,X=O+N,U=X+$,K=bd(I,l,a,o),q={box:{x:W,y:k,width:C,height:0},ticks:K,pixelsPerDay:F,originX:W,startDate:c,endDate:d,labelStyle:Se("roadmap",[],s),pillRowHeight:R,tickPanelY:O,tickPanelHeight:N,markerRow:{y:U+13,height:ee,collisionY:U-8},minorGrid:m.minorGrid,...p?{waveStrip:{y:X,height:$}}:{}};return Sx(q,I,l.unit),{header:v,headerNode:E,axis:{originX:W,ppd:F,naturalWidth:C,scale:I},naturalChartRightX:D,bands:{timelineY:k,pillRowHeight:R,tickPanelY:O,tickPanelHeight:N,waveStripY:X,markerRowY:U,estimatedMarkerRows:G,rowsHeight:Y,chartTopY:k+ne,bottomTickPanelHeight:x?g:0},timeline:q,markers:{datePinned:L,placements:bs(z.placements,U),hasEntities:_}}}function Rx(e,t){return Math.max(e.chartTopY,e.minRowsBottomY-t)}function Sx(e,t,n){let r=ex(t,e.ticks,n,e.minorGrid);r&&(e.nonWorkingDisplay=t.showsNonWorking?"show":"hide",e.nonWorking=r);let i=tx(t);i&&(e.workingExceptions=i)}var ib=8,bx=class{constructor(t){M(this,"rightX");M(this,"frozen",!1);this.rightX=t}grow(t){if(this.frozen)throw new Error("layout: the canvas grew after it was frozen");return t<=this.rightX?!1:(this.rightX=t,!0)}freeze(){this.frozen=!0}get provisional(){return this.rightX}get final(){if(!this.frozen)throw new Error("layout: the canvas was read before it was final");return this.rightX}},EW;var up=class{constructor(t,n,r,i,o,s,a){M(this,"file");M(this,"resolved");M(this,"options");M(this,"scope");M(this,"window");M(this,"measured");M(this,"chart");M(this,"canvas");M(this,"chartY");M(this,"draft",{});M(this,"scaleIsFinal",!1);M(this,"band");M(this,"rowsTop");M(this,"rowsBottom");M(this,"why");this.file=t,this.resolved=n,this.options=r,this.scope=i,this.window=o,this.measured=s,this.chart=a,this.canvas=new bx(s.naturalChartRightX);let l=a.ctx;this.chartY={get top(){return l.chartTopY},set top(c){l.chartTopY=c},get swimlaneBottom(){return l.swimlaneBottomY},set swimlaneBottom(c){l.swimlaneBottomY=c},get bottom(){return l.chartBottomY},set bottom(c){l.chartBottomY=c}}}get ctx(){return this.chart.ctx}get scale(){return this.chart.ctx.scale}finalScale(){if(!this.scaleIsFinal)throw new Error("layout: the final scale was read before the timeline extension");return this.chart.ctx.scale}extendScale(t){if(this.scaleIsFinal)throw new Error("layout: the scale was extended after it was final");this.chart.ctx.scale=t}settleScale(){this.scaleIsFinal=!0}markerBand(){if(!this.band)throw new Error("layout: the marker band was read before the final pack");return this.band}setMarkerBand(t){if(this.band)throw new Error("layout: the marker band was packed twice");this.band=t,this.chart.ctx.markerRowPlacements=t.placements}headerRowsTop(){return this.rowsTop||(this.rowsTop=wW(this.measured,this.options.today,this.finalScale())),this.rowsTop}headerRowsBottom(){if(this.rowsBottom===void 0)throw new Error("layout: the header rows bottom was read before the rows grew");return this.rowsBottom}setHeaderRowsBottom(t){if(this.rowsBottom!==void 0)throw new Error("layout: the header rows grew twice");this.rowsBottom=t}explain(t){this.why=t}report(t,n){EW?.(t,n,this.why),this.why=void 0}};function wW(e,t,n){let{bands:r,header:i}=e;if(!(r.pillRowHeight===0&&t!==void 0&&n.forwardWithinDomain(t)!==null))return{timelineY:r.timelineY,pillRowHeight:r.pillRowHeight,tickPanelY:r.tickPanelY,markerRowY:r.markerRowY,shift:0};let s=Rx(i,Ft+r.rowsHeight),a=s+Ft,l=a-r.tickPanelY;return{timelineY:s,pillRowHeight:Ft,tickPanelY:a,markerRowY:r.markerRowY+l,shift:l}}function TW(e){return e.canvas.grow(e.chart.maxRightX+st)}function vW(e){let{swimlanes:t,includes:n,milestones:r}=e.chart,{calendar:i,preset:o,startDate:s,spanDays:a,nonWorking:l}=e.window,{originX:c,ppd:u}=e.measured.axis,f=e.measured.timeline,d=Rs(t);for(let S of n)d=Math.max(d,Rs(S.nestedSwimlanes));let p=0;for(let S of e.measured.markers.datePinned)p=Math.max(p,S.centerX+S.radius);let m=0;for(let S of r)S.fixed?p=Math.max(p,S.x+S.radius):m=Math.max(m,S.x+S.radius);for(let S of n){for(let F of S.anchors??[])p=Math.max(p,F.center.x+F.radius);for(let F of S.milestones??[])F.fixed?p=Math.max(p,F.center.x+F.radius):m=Math.max(m,F.center.x+F.radius)}let g=Math.max(d,p,m),w=i.daysPerUnit(o.unit),x=e.scale.showsNonWorking?e.scale.indexAtX(g):(g-c)/u,y=x>0?Mi(s,x,o.unit,w,i):0,T=Cd(t);for(let S of n)T=Math.max(T,Cd(S.nestedSwimlanes));let E=new ks(e.window,e.scale);if(T>0){let S=Math.max(a,y);E.isPast(T,S)&&(y=Math.max(y,Math.min(E.boundaryAtOrAfterX(T),E.captionColumn(S).end)))}let v=!1;if(y>a){let S={bar:d,caption:T,datedMarker:p,afterMilestone:m};e.explain(Object.keys(S).filter(j=>S[j]>0&&E.isPast(S[j],a)));let F=i.dateAtWorkingIndex(s,y),C=e.scale.showsNonWorking?At(s,F)*u:y*u,W=new Ps({domain:[s,F],range:[c,c+C],calendar:i,nonWorking:l});e.extendScale(W),f.endDate=F,f.box.width=C,f.ticks=bd(W,o,i,e.scope.locale),Sx(f,W,o.unit),e.canvas.grow(c+C+st),v=!0}return e.settleScale(),v}function _W(e){let t=e.measured.timeline,n=e.measured.markers.datePinned.map(s=>({id:s.id,centerX:s.centerX,radius:s.radius,title:s.title,fontSize:s.fontSize,bold:s.bold}));for(let s of e.chart.milestones)s.fixed||n.push({id:s.id,centerX:s.x,radius:s.radius,title:s.title,fontSize:10,bold:!0});let r=Zd(t.nonWorking,t.workingExceptions);n.push(...r),e.draft.markerEntries={all:n,calendarCount:r.length};let i=Bi(n,e.measured.header.chartLeftX,e.canvas.provisional,se);for(let s of e.chart.includes)i=Math.max(i,MS(s,e.canvas.provisional));let o=e.canvas.grow(i);return e.canvas.freeze(),o}function AW(e){let t=e.canvas.final,n=e.measured.naturalChartRightX,r=e.chart.swimlanes.length>0&&t!==n;for(let i of e.chart.swimlanes)i.box.width=t;for(let i of e.chart.includes)rp(i,t)!==rp(i,n)&&(r=!0),zS(i,t);return r}function kW(e){let t=Xt(e.draft.markerEntries,"the marker entries"),n=Ns(t.all,e.measured.header.chartLeftX,e.canvas.final,se,Jd(e.chart.milestones)),r=bs(n.placements,e.headerRowsTop().markerRowY),i=e.measured.markers.hasEntities||t.calendarCount>0?Math.max(1,n.rowCount):0;e.setMarkerBand({rowCount:i,placements:r});let o=!1;for(let[s,a]of e.measured.markers.placements){let l=r.get(s);(!l||!BW(a,l))&&(o=!0)}return o}function IW(e){let t=e.markerBand(),n=e.ctx,r=e.measured.timeline,i=ep(e.chart.milestones,t.placements),o=i.some(s=>n.entityMidpoints.get(s.id??"")?.y!==s.center.y);for(let s of r.nonWorking??[]){if(s.label===void 0)continue;let a=t.placements.get(dx(s));a&&(s.labelBox=a.labelBox,s.labelSide=a.labelSide)}for(let s of r.workingExceptions??[]){let a=t.placements.get(px(s));a&&(s.labelBox=a.labelBox,s.labelSide=a.labelSide)}for(let s of e.measured.markers.datePinned){let a=t.placements.get(s.id);a&&n.entityMidpoints.set(s.id,{x:s.centerX,y:a.centerY})}for(let s of i)s.fixed||n.entityMidpoints.set(s.id??"",{x:s.center.x,y:s.center.y});return e.draft.milestones=i,o}function RW(e){let t=e.markerBand(),n=e.headerRowsTop(),r=e.measured.bands,i=r.estimatedMarkerRows,s=e.ctx.timeline,a=!1;n.pillRowHeight!==r.pillRowHeight&&(s.box.y=n.timelineY,s.pillRowHeight=n.pillRowHeight,s.tickPanelY=n.tickPanelY,s.waveStrip&&(s.waveStrip.y+=n.shift),s.markerRow.y+=n.shift,s.markerRow.collisionY+=n.shift,a=!0);let l=n.shift;t.rowCount>i&&(l+=(t.rowCount-i)*26,s.markerRow.height=t.rowCount*26,a=!0),e.setHeaderRowsBottom(n.markerRowY+s.markerRow.height);let c=r.chartTopY+l;e.chartY.top=c,e.chartY.bottom+=c,e.chartY.swimlaneBottom+=c,s.box.height=e.chartY.bottom-s.box.y;for(let d of e.chart.swimlanes)Is(d,c);for(let d of e.chart.includes)nS(d,c);let u=e.chart.milestones,f=Xt(e.draft.milestones,"the milestones");for(let d=0;d<f.length;d++)rS(f[d],u[d],c);return a}function SW(e){let t=e.measured.bands.bottomTickPanelHeight;return t<=0?!1:(e.ctx.timeline.bottomTickPanelY=e.chartY.bottom+ib,e.ctx.timeline.bottomTickPanelHeight=t,e.chartY.bottom+=ib+t,!0)}function bW(e){e.finalScale();let t=e.ctx;if(!t.waves)return!1;let n=qS(t.waves,t,Un(e.scope.locale),e.chart.swimlanes,e.chart.includes);return n.regionCrossings.forEach((r,i)=>{r.length>0&&(e.chart.includes[i].waveCrossings=r)}),n.placeholder!==void 0&&t.timeline.waveStrip&&(t.timeline.waveStrip.placeholder=n.placeholder),e.draft.waves=n,!0}function NW(e){e.finalScale(),e.markerBand();let t=new Set(Xt(e.draft.milestones,"the milestones").map(r=>r.center.x)),n=Pd(e.resolved.content.anchors,e.ctx,t);return e.draft.anchors=n,n.length>0}function LW(e){let t=ux(e.chart.laneEntries),n=fx(t,e.chart.swimlanes,e.chart.includes,e.ctx);e.draft.edges=n;let r=0;return e.resolved.content.isolatedRegions.forEach((i,o)=>{let s=e.chart.includes[o],a=e.chart.regionContexts[o];if(!s||!a)return;let l=fx(ux([...i.content.swimlanes.values()]),s.nestedSwimlanes,[],a);l.length>0&&(s.edges=l),r+=l.length}),n.length+r>0}function PW(e){e.finalScale();let t=jS(e.options.today,e.ctx,e.scope.locale,e.canvas.final);return e.draft.nowline=t,t!==null}function CW(e){let t=e.draft.waves;if(!t)return!1;let n=JS(t,e.ctx,Un(e.scope.locale),e.chartY.bottom+nd,e.canvas.final);return n?(e.chartY.bottom+=nd+n.box.height,e.draft.waveLegend=n,!0):!1}function OW(e){let t=e.resolved.content.isolatedRegions.flatMap((r,i)=>{let o=e.chart.regionContexts[i],s=e.chart.includes[i];return o&&s?[{title:s.label,footnotes:r.content.footnotes,ctx:o}]:[]}),n=SS(e.resolved.content.footnotes,e.ctx,e.chartY.bottom,e.canvas.final,t);return e.draft.footnotes=n,n.entries.length>0}function $W(e){let{header:t,headerNode:n}=e.measured;return e.draft.header=n.place(t,{rowsBottomY:e.headerRowsBottom(),chartBottomY:e.chartY.bottom,canvasRightX:e.canvas.final}),t.position==="beside"}function DW(e){let t=Xt(e.draft.footnotes,"the footnote panel"),n=e.canvas.final,r=t.entries.length>0?t.box.y+t.box.height:e.chartY.bottom,i={x:n-st-iy,y:r+st,width:iy,height:gk};return e.draft.attributionBox=i,e.draft.height=i.y+i.height+st,!0}var MW=[{name:"growCanvasForSpill",reads:["placement"],writes:["canvas"],run:TW},{name:"extendTimeline",reads:["placement","window","scale"],writes:["scale","timeline","calendarRuns","canvas"],run:vW},{name:"growCanvasForMarkerLabels",reads:["placement","calendarRuns","canvas"],writes:["markerEntries","canvas"],run:_W},{name:"fitWidths",reads:["placement","canvas"],writes:["laneWidths"],run:AW},{name:"packMarkers",reads:["placement","canvas","markerEntries","headerBands","scale"],writes:["markerBand"],run:kW},{name:"placeMarkers",reads:["placement","markerBand","calendarRuns"],writes:["milestones","calendarLabels","markerMidpoints"],run:IW},{name:"growHeaderRows",reads:["placement","markerBand","headerBands","scale","milestones","chartTop","laneBottom"],writes:["chartTop","rowsBottom","laneBottom","chartBottom","laneY","milestones","timeline"],run:RW},{name:"bottomTickPanel",reads:["headerBands","chartBottom"],writes:["chartBottom","timeline"],run:SW},{name:"waves",reads:["scale","chartTop","laneBottom","timeline","laneY"],writes:["waves","timeline"],run:bW},{name:"anchors",reads:["scale","markerBand","chartTop","laneBottom","milestones"],writes:["anchors","markerMidpoints"],run:NW},{name:"dependencyEdges",reads:["laneY","markerMidpoints"],writes:["edges"],run:LW},{name:"nowline",reads:["scale","canvas","laneBottom","timeline"],writes:["nowline"],run:PW},{name:"waveLegend",reads:["waves","canvas","chartBottom"],writes:["legend","chartBottom"],run:CW},{name:"footnotePanel",reads:["chartBottom","canvas"],writes:["footnotes"],run:OW},{name:"header",reads:["chartBottom","canvas","rowsBottom"],writes:["header"],run:$W},{name:"attribution",reads:["footnotes","chartBottom","canvas"],writes:["attribution"],run:DW}];function ob(e,t=MW){for(let n of t)e.report(n.name,n.run(e));return FW(e)}function FW(e){let{draft:t}=e,{themeName:n,theme:r}=e.scope,{swimlanes:i,includes:o,waveSolve:s}=e.chart,a=e.canvas.final,l=e.measured.header.chartLeftX,c=t.waves,u=t.waveLegend;return{width:a,height:Xt(t.height,"the canvas height"),theme:n,palette:r,backgroundColor:r.surface.page,header:{...Xt(t.header,"the header"),attributionBox:Xt(t.attributionBox,"the attribution box")},timeline:e.measured.timeline,nowline:Xt(t.nowline,"the now-line"),swimlanes:i,anchors:Xt(t.anchors,"the anchors"),milestones:Xt(t.milestones,"the milestones"),edges:Xt(t.edges,"the edges"),footnotes:Xt(t.footnotes,"the footnote panel"),includes:o,chartBox:{x:l,y:e.chartY.top,width:a-l,height:e.chartY.bottom-e.chartY.top},...s?{waveSolve:s}:{},...c?{waves:c.waves}:{},...c&&c.boundaries.length>0?{waveBoundaries:c.boundaries}:{},...c&&c.crossings.length>0?{waveCrossings:c.crossings}:{},...u?{waveLegend:u}:{}}}function Xt(e,t){if(e===void 0)throw new Error(`layout: ${t} was read before its step ran`);return e}function BW(e,t){return e.rowIndex===t.rowIndex&&e.centerY===t.centerY&&e.labelSide===t.labelSide&&e.labelBox.x===t.labelBox.x&&e.labelBox.y===t.labelBox.y&&e.labelBox.width===t.labelBox.width&&e.labelBox.height===t.labelBox.height}var Cs=class extends Map{constructor(t,n=UW){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(let[r,i]of t)this.set(r,i)}get(t){return super.get(sb(this,t))}has(t){return super.has(sb(this,t))}set(t,n){return super.set(WW(this,t),n)}delete(t){return super.delete(XW(this,t))}};function sb({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function WW({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function XW({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function UW(e){return e!==null&&typeof e=="object"?e.valueOf():e}function fp(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r<i;)o[r]=e+r*n;return o}function dp(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}var ab=Symbol("implicit");function pp(){var e=new Cs,t=[],n=[],r=ab;function i(o){let s=e.get(o);if(s===void 0){if(r!==ab)return r;e.set(o,s=t.push(o)-1)}return n[s%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new Cs;for(let s of o)e.has(s)||e.set(s,t.push(s)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return pp(t,n).unknown(r)},dp.apply(i,arguments),i}function Wl(){var e=pp().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,o,s,a=!1,l=0,c=0,u=.5;delete e.unknown;function f(){var d=t().length,p=i<r,m=p?i:r,g=p?r:i;o=(g-m)/Math.max(1,d-l+c*2),a&&(o=Math.floor(o)),m+=(g-m-o*(d-l))*u,s=o*(1-l),a&&(m=Math.round(m),s=Math.round(s));var w=fp(d).map(function(x){return m+o*x});return n(p?w.reverse():w)}return e.domain=function(d){return arguments.length?(t(d),f()):t()},e.range=function(d){return arguments.length?([r,i]=d,r=+r,i=+i,f()):[r,i]},e.rangeRound=function(d){return[r,i]=d,r=+r,i=+i,a=!0,f()},e.bandwidth=function(){return s},e.step=function(){return o},e.round=function(d){return arguments.length?(a=!!d,f()):a},e.padding=function(d){return arguments.length?(l=Math.min(1,c=+d),f()):l},e.paddingInner=function(d){return arguments.length?(l=Math.min(1,d),f()):l},e.paddingOuter=function(d){return arguments.length?(c=+d,f()):c},e.align=function(d){return arguments.length?(u=Math.max(0,Math.min(1,d)),f()):u},e.copy=function(){return Wl(t(),[r,i]).round(a).paddingInner(l).paddingOuter(c).align(u)},dp.apply(f(),arguments)}var Nx=class e{constructor(t,n,r){M(this,"bandwidthPx");M(this,"stepPx");M(this,"d3");this.bandwidthPx=t,this.stepPx=n,this.d3=r}static fixedRow(t){return new e(t.bandwidth,t.step)}static forRows(t){let n=Array.from({length:t.count},(i,o)=>String(o)),r=Wl().domain(n).range(t.range).paddingInner(t.paddingInner??0).paddingOuter(t.paddingOuter??0);return new e(r.bandwidth(),r.step(),r)}bandwidth(){return this.bandwidthPx}step(){return this.stepPx}forward(t){if(!this.d3)throw new Error("BandScale.forward is only available on closed-domain bands (BandScale.forRows)");let n=this.d3(t);if(n===void 0)throw new Error(`BandScale: unknown band id "${t}"`);return n}},GW={bandwidth:56,step:64};function lb(){return Nx.fixedRow(GW)}var cb=8;function ub(e,t,n,r,i){let{theme:o,styleCtx:s}=t,{cal:a,calendar:l,schedule:c}=n,u=c.plan,{originX:f,scale:d}=r.axis,{timeline:p}=r,m=Xd(e,{theme:o,cal:a,schedule:c,timeline:p,scale:d,calendar:l,axisColumns:new ks(n,d),bandScale:lb(),waves:u?fS(u,d,f,Un(t.locale).waveBackgroundItem):void 0},{chartTopY:0,chartBottomY:0,swimlaneBottomY:0},{footnotes:Kd(e.content.footnotes),markerRowPlacements:new Map(r.markers.placements)});for(let _ of r.markers.datePinned){let D=m.markerRowPlacements.get(_.id);D&&(m.entityLeftEdges.set(_.id,_.centerX),m.entityRightEdges.set(_.id,_.centerX),m.entityMidpoints.set(_.id,{x:_.centerX,y:D.centerY}))}let g=new Map(m.entityLeftEdges),w=new Map(m.entityRightEdges),x=new Map(m.entityMidpoints),y=()=>{m.entityLeftEdges=new Map(g),m.entityRightEdges=new Map(w),m.entityMidpoints=new Map(x),m.placedItems=new Map,m.itemFlowKey=new Map,m.currentFlowKey="",m.waves&&Fd(m.waves,m.entityLeftEdges,m.entityRightEdges)},T=[...e.content.swimlanes.values()],E=Se("swimlane",[],s),v=ck[E.spacing]??0,S=()=>{m.nextParallelId=0,m.nextGroupId=0;let _=[],D=m.chartTopY,L=0,B=m.timeline.originX;for(let z of T){L>0&&(D+=v);let{positioned:G,usedHeight:ee,usedRightX:Y}=new Ls({lane:z,bandIndex:L},i).place({x:m.timeline.originX,y:D},m);_.push(G),D+=ee,Y>B&&(B=Y),L++}return{swimlanes:_,nextY:D,maxRightX:B}},F=e.content.isolatedRegions,C,W,j=m.waves;if(j){let _,D=xS()?HW(j.ids,c,d):void 0,L=Dd(j.ids.length,j.origin,j.floors,(B,z)=>(dS(j,B,z),y(),_=S(),F.length>0&&wx(F,m,_.nextY+cb,i,r.naturalChartRightX),j.pass),It,D);pS(j,L),W={passes:L.passes,capped:L.capped},C=_}else C=S();let P=C.swimlanes,R=C.nextY,N=OS(e.content.milestones,m);N.length>0&&(y(),m.slackCorridors=N,C=S(),P=C.swimlanes,R=C.nextY);let $=[],I=[];if(F.length>0){let _=wx(F,m,R+cb,i,r.naturalChartRightX);$=_.regions,I=_.contexts,R=_.endY}m.chartBottomY=R,m.swimlaneBottomY=R;let A=Qd(e.content.milestones,m);return{ctx:m,swimlanes:P,includes:$,regionContexts:I,milestones:A,laneEntries:T,maxRightX:C.maxRightX,bottomY:R,...W?{waveSolve:W}:{}}}function HW(e,t,n){let r=e.map(i=>t.waves?.get(i));return{S:r.map(i=>i?n.forward(i.start):null),E:r.map(i=>i?n.forward(i.end):null)}}var hp=class{constructor(t,n){M(this,"node");M(this,"helpers");this.node=t,this.helpers=n}get id(){return this.node.name??""}place(t,n){let{node:r}=this,{helpers:i}=this,o=Se("group",r.properties,n.styleCtx),s=Xr(r,Dl(r.properties,t.x,n),n),a=n.waves!==void 0&&r.title===void 0&&re(r.properties,"wave")!==void 0&&re(r.properties,"style")===void 0&&Be(r.properties,"labels").length===0,l=a?void 0:r.title??r.name,c=n.currentFlowKey;n.nextGroupId+=1,n.currentFlowKey=`${c}/group:${r.name??`group-${n.nextGroupId}`}`;let u=Wt(Be(r.properties,"after")),f=Wt(Be(r.properties,"before")),d=ld({drawn:!a,hasTitle:!!l,hasPins:!!(u||f),hasBracket:o.bracket!=="none"}),p=np(r,{leftX:s,firstRowY:t.y+d.header+d.pad},n,i),{children:m,timeCursorX:g,timeStartX:w}=p,x=n.bandScale.step(),y=x-n.bandScale.bandwidth(),T=Math.max(x,p.packer.usedHeight())-y,E={x:w,y:t.y,width:g-w,height:d.header+d.pad+T+d.pad};t.startX=E.x,t.x=g,t.height=Math.max(t.height,E.height+y);let v=r.name;v&&(n.entityLeftEdges.set(v,E.x),n.entityRightEdges.set(v,g)),n.currentFlowKey=c;let S=a?[]:Od({box:E,afterDate:u,beforeDate:f,title:l});return{kind:"group",id:v,title:l,box:E,headerHeight:d.header,children:m,style:o,inlineDatePins:S.length>0?S:void 0,...a?{waveOnly:!0}:{}}}};var mp=class{constructor(t,n){M(this,"node");M(this,"helpers");this.node=t,this.helpers=n}get id(){return this.node.name??""}place(t,n){let{node:r}=this,{helpers:i}=this,o=Se("parallel",r.properties,n.styleCtx),s=Xr(r,t.x,n),a=Wt(Be(r.properties,"after")),l=Wt(Be(r.properties,"before")),c=r.title??r.name,u=ld({drawn:!0,hasTitle:!!c,hasPins:!!(a||l),hasBracket:o.bracket!=="none"}),f=t.y+u.header+u.pad,d=[],p=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY,g=0,w=n.currentFlowKey;n.nextParallelId+=1;let x=r.name??`parallel-${n.nextParallelId}`,y=0;for(let W of r.content){if(W.$type==="DescriptionDirective")continue;n.currentFlowKey=`${w}/par:${x}#${y}`;let j=Ml(s,f+g),P=i.sequenceOne(W,j,n);d.push(P),g+=Math.max(n.bandScale.step(),j.height),p=Math.min(p,j.startX),m=Math.max(m,j.x),y++}n.currentFlowKey=w,d.length===0&&(p=n.scale.showsNonWorking?n.scale.startX(s):s,m=p);let T=n.bandScale.step(),E=T-n.bandScale.bandwidth(),v=Math.max(T,g)-E,S={x:p,y:t.y,width:m-p,height:u.header+u.pad+v+u.pad};t.startX=S.x,t.x=m,t.height=Math.max(t.height,S.height+E);let F=r.name;F&&(n.entityLeftEdges.set(F,S.x),n.entityRightEdges.set(F,m));let C=Od({box:S,afterDate:a,beforeDate:l,title:c});return{kind:"parallel",id:F,title:c,box:S,headerHeight:u.header,children:d,style:o,inlineDatePins:C.length>0?C:void 0}}};function zW(e,t,n){return new mp(e,{sequenceOne:gp}).place(t,n)}function jW(e,t,n){return new hp(e,{sequenceOne:gp}).place(t,n)}function gp(e,t,n){if(Ke(e))return Yd(e,t,n);if(tt(e))return zW(e,t,n);if($e(e))return jW(e,t,n);throw new Error(`Unknown swimlane child type: ${e.$type??"unknown"}`)}var yp=class{place(t,n,r,i){let o={sequenceOne:gp},s=QR(t,n,r),a=eS(t,n,r,s,i),l=rb(t,n,r,s,a),c=ub(n,s,a,l,o);return ob(new up(t,n,r,s,a,l,c))}};function Xl(e,t,n={}){let r=Gf(e,t),{config:i,working:o}=r,s=cs(t.content.sizes,i),a=re(e.roadmapDecl?.properties??[],"start"),l=_e(a)??YW(n.today??new Date),c=N=>o.workingIndexOf(l,N),u=N=>o.dateAtWorkingIndex(l,N),f=(N,$)=>Uf(o,l,N,$),d=0,p=N=>{d=Math.max(d,N)},m=new Map,g=new Map,w=new Map,x=new Map,y=new WeakMap,T=new Map,E=new WeakMap,v=new Map;for(let[N,$]of t.content.anchors){let I=_e(re($.properties,"date"));if(I){let A=c(I);g.set(N,A),v.set(N,I),p(A)}}let S=()=>({itemEnd:m,anchorEnd:g,milestoneEnd:w,sizes:s,itemResults:x,inByNode:!0}),F=(N,$,I)=>{let A=L=>{if("date"in L)return c(L.date);let B=L.ref;return N.itemEnd.has(B)?N.itemEnd.get(B):N.anchorEnd.has(B)?N.anchorEnd.get(B):N.milestoneEnd.has(B)?N.milestoneEnd.get(B):0},_=(L,B)=>{let z=B;for(let G of vt(L))z=D(G,z),I(z);return z},D=(L,B)=>{if(Ke(L)){let z=FA(L.properties,N.sizes,i),{after:G}=Wr(L.properties),ee=G.length>0?Math.max(B,...G.map(A)):B;$&&(ee=$.apply(L,ee));let Y=ee+z,ne={start:u(ee),end:f(ee,Y),days:z};return N.inByNode&&y.set(L,ne),L.name&&(N.itemEnd.set(L.name,Y),N.itemResults?.set(L.name,ne)),$?.accumulate(L,Y),Y}if(tt(L)){let{after:z}=Wr(L.properties),G=z.length>0?Math.max(B,...z.map(A)):B;$&&(G=$.apply(L,G));let ee=G;for(let Y of vt(L))ee=Math.max(ee,D(Y,G));return L.name&&N.itemEnd.set(L.name,ee),ee}if($e(L)){let{after:z}=Wr(L.properties),G=z.length>0?Math.max(B,...z.map(A)):B;$&&(G=$.apply(L,G));let ee=_(L,G);return L.name&&N.itemEnd.set(L.name,ee),ee}return B};return{walkLane:_,resolveAfterDay:A}},C=(N,$)=>{let I=_e(re(N.properties,"date"));if(I)return c(I);let{after:A}=Wr(N.properties);return A.length>0?Math.max(0,...A.map($)):void 0},W=(N,$)=>{let I=new Map,A=new Map,_=new Map;for(let[B,z]of N.anchors){let G=_e(re(z.properties,"date"));if(G){let ee=c(G);A.set(B,ee),p(ee)}}let{walkLane:D,resolveAfterDay:L}=F({itemEnd:I,anchorEnd:A,milestoneEnd:_,sizes:cs(N.sizes,i),inByNode:$},void 0,p);for(let B of N.swimlanes.values())D(B,0);for(let[B,z]of N.milestones){let G=C(z,L);G!==void 0&&(_.set(B,G),p(G))}for(let B of N.isolatedRegions)W(B.content,!1)},j=n.plan!==void 0?n.plan??void 0:Di(t),P;if(j){let N=j.waves.map(L=>L.name),$=uS(j,l,o),I,A=0,_=L=>{A=Math.max(A,L)},D=Dd(N.length,0,$,(L,B)=>{let z=N.map((Y,ne)=>[Y,B[ne]]);m=new Map(z),x=new Map,y=new WeakMap,A=0;let G=new Fi(j,L),{walkLane:ee}=F(S(),G,_);for(let Y of t.content.swimlanes.values())ee(Y,0);for(let Y of t.content.isolatedRegions){let ne=F({itemEnd:new Map(z),anchorEnd:new Map,milestoneEnd:new Map,sizes:cs(Y.content.sizes,i),inByNode:!0},G,_);for(let k of Y.content.swimlanes.values())ne.walkLane(k,0)}return I=G,G});p(Math.max(A,...D.S,...D.E.slice(-1))),P=new Map;for(let L of Md(j,D,I,0,$))P.set(L.id,{index:L.index,start:u(L.start),end:f(L.start,L.end),memberCount:L.memberCount,...L.heldBy!==void 0?{heldBy:L.heldBy}:{},...L.floorRef!==void 0?{floorRef:L.floorRef}:{}})}else{let{walkLane:N}=F(S(),void 0,p);for(let $ of t.content.swimlanes.values())N($,0)}let{resolveAfterDay:R}=F(S(),void 0,p);for(let[N,$]of t.content.milestones){let I=C($,R);if(I===void 0)continue;let A=_e(re($.properties,"date"))??u(I);w.set(N,I),T.set(N,A),E.set($,A),p(I)}if(!j)for(let N of t.content.isolatedRegions)W(N.content,!0);return{startDate:l,calendar:r,items:x,byNode:y,milestones:T,milestoneByNode:E,anchors:v,...P?{waves:P}:{},...j?{plan:j}:{},resolved:t,extent:{contentEndDay:d}}}function YW(e){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))}function Lx(e,t,n={}){let r=n.schedule?.resolved===t?n.schedule:Xl(e,t,{today:n.today,plan:Di(t)??null});return new yp().place(e,t,n,r)}function xp(e){return e.toISOString().slice(0,10)}function fb(e){return e.id!==void 0?e.id:/[\r\n]/.test(e.title)?e.title.replace(/\s*[\r\n]+\s*/g," ").trim():e.title}function Px(e,t){for(let n of e)n.kind==="item"?t(n):Px(n.children,t)}function VW(e,t,n){let r=fb(e);e.textSpills&&n.push(tn(t,"NL.I1000","info",{name:r},r)),e.chipsOutside&&n.push(tn(t,"NL.I1001","info",{name:r},r)),(e.box.width<Pr||e.dotSpills||e.iconSpills||e.footnoteSpills)&&n.push(tn(t,"NL.I1002","info",{name:r},r)),e.hasOverflow&&n.push(tn(t,"NL.I1003","info",{name:r,anchor:e.overflowAnchorId},r)),db(e,t,n)}function db(e,t,n){let r=e.nonWorkingPin;if(!r)return;let i=fb(e);n.push(tn(t,"NL.I1008","info",{name:i,pin:r.pin,key:r.key,start:r.start},i))}function tn(e,t,n,r,i){return{message:Qt(e,t,r),severity:n,code:t,entityId:i,lspSeverity:n==="warning"?2:3,data:{code:t,args:r}}}function pb(e,t,n){let r=e.id??e.title,i=[];Px(e.children,a=>i.push(a));for(let a of i)VW(a,t,n);let o=new Set(i.map(a=>a.box.y));o.size>1&&n.push(tn(t,"NL.I1004","info",{lane:r,rows:o.size},r)),(e.utilization?.segments.some(a=>a.classification==="red")??!1)&&n.push(tn(t,"NL.I1005","info",{lane:r},r));for(let a of e.nested)pb(a,t,n)}function hb(e,t,n){Px(e.children,r=>{db(r,t,n)});for(let r of e.nested)hb(r,t,n)}function KW(e,t,n){e.waveSolve?.capped&&n.push(tn(t,"NL.W1002","warning",{passes:e.waveSolve.passes}));let r=e.waves??[],i=r.filter(o=>o.empty).map(o=>o.id);if(i.length>0){let o=i.length===r.length?{reason:"all",names:i}:i.length===1?{reason:"one",name:i[0]}:{reason:"many",names:i};n.push(tn(t,"NL.I1006","info",o,o.reason==="one"?o.name:void 0))}for(let o of e.milestones){if(o.overrunByWave===void 0||o.overrunDate===void 0)continue;let s=r.find(l=>l.id===o.overrunByWave);if(!s)continue;let a=o.id??o.title;n.push(tn(t,"NL.I1007","info",{name:a,date:o.overrunDate,wave:s.id,end:xp(s.endDate)},a))}}function Cx(e,t={}){let n=t.locale??"en-US",r=[];for(let i of e.swimlanes)pb(i,n,r);for(let i of e.includes)for(let o of i.nestedSwimlanes)hb(o,n,r);if(KW(e,n,r),t.today){let i=t.today,o=e.timeline.startDate,s=e.timeline.endDate;(i<o||i>s)&&r.push(tn(n,"NL.W1000","warning",{date:xp(i),start:xp(o),end:xp(s)}))}return r}var Wi=class extends Error{constructor(t){super(t),this.name="TimezoneError"}};function Ox(e){if(!e||e.toLowerCase()==="local")return{kind:"local"};if(e.toUpperCase()==="UTC")return{kind:"utc"};if(e==="Z")return{kind:"offset",ms:0};let t=/^([+-])(\d{2})(?::?(\d{2}))?$/.exec(e);if(t){let n=t[1]==="+"?1:-1,r=parseInt(t[2],10),i=t[3]!==void 0?parseInt(t[3],10):0;if(r>23||i>59)throw new Wi(`nowline: invalid timezone offset "${e}". Hours must be 0\u201323 and minutes 0\u201359.`);return{kind:"offset",ms:n*(r*60+i)*6e4}}try{return{kind:"iana",name:Intl.DateTimeFormat(void 0,{timeZone:e}).resolvedOptions().timeZone}}catch{throw new Wi(`nowline: unrecognised timezone "${e}". Use "local", "UTC", an ISO 8601 offset (e.g. "+05:30", "-07:00", "Z"), or an IANA timezone name (e.g. "America/Los_Angeles", "Asia/Kolkata").`)}}function Ep(e,t){switch(t.kind){case"local":return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()));case"utc":return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()));case"offset":{let n=new Date(e.getTime()+t.ms);return new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()))}case"iana":{let n=new Intl.DateTimeFormat("en-CA",{timeZone:t.name,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(e),r=0,i=0,o=0;for(let s of n)s.type==="year"?r=parseInt(s.value,10):s.type==="month"?i=parseInt(s.value,10)-1:s.type==="day"&&(o=parseInt(s.value,10));return new Date(Date.UTC(r,i,o))}}}var mb=/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?)(Z|([+-])(\d{2})(?::?(\d{2}))?)$/,gb=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?$/;function yb(e){return(ot.test(e)||mb.test(e)||gb.test(e))&&!He(e.slice(0,10))}function $x(e={}){let t=e.zone??{kind:"local"},n=e.clock??(()=>new Date),r=e.now;if(!(r==="-"||r===null)){if(r instanceof Date)return r;if(r!==void 0){if(yb(r))return;let i=_e(r);if(i)return i;let o=mb.exec(r);if(o){let s=new Date(r);if(!Number.isNaN(s.getTime())){if(o[2]==="Z")return Ep(s,{kind:"utc"});let l=o[3]==="+"?1:-1,c=parseInt(o[4],10),u=o[5]!==void 0?parseInt(o[5],10):0,f=l*(c*60+u)*6e4;return Ep(s,{kind:"offset",ms:f})}}return gb.test(r)?_e(r.slice(0,10))??void 0:void 0}return Ep(n(),t)}}function qW(e){return e===2?"warning":e===3?"info":"error"}function xb(e,t){return{severity:qW(e.severity),code:vy(e),message:e.message,suggestion:ud(e.message),file:t,line:(e.range?.start.line??0)+1,column:(e.range?.start.character??0)+1}}function Dx(e,t){return{severity:"error",code:"parse-error",message:e.message,file:t,line:e.token?.startLine??1,column:e.token?.startColumn??1}}function Mx(e,t){return{severity:"error",code:"lex-error",message:e.message,file:t,line:e.line??1,column:e.column??1}}function Eb(e,t){if(e.syntax?.origin==="lexer")return Mx(e.syntax.error,e.sourcePath);if(e.syntax?.origin==="parser")return Dx(e.syntax.error,e.sourcePath);let n=(e.range?.start.line??e.line??0)+1,r=(e.range?.start.character??0)+1;if(!Fr(e))return{severity:e.severity,code:"include",message:e.message,file:e.sourcePath,line:n,column:1};let i=t?jy(t,e):e.message,o=ud(i);return{severity:e.severity,code:e.code??fd(e.message),message:i,...o===void 0?{}:{suggestion:o},file:e.sourcePath,line:n,column:r}}function wb(e,t,n="warning"){return{severity:n,code:"render.warning",message:e,file:t,line:1,column:1}}function Tb(e,t){return{severity:e.severity,code:e.code,message:e.message,file:t,line:1,column:1}}var vb="__nowline_browser_noop_include__";async function _b(e){throw new Error(`${vb}: include "${e}" was skipped \u2014 running in single-file mode.`)}function Fx(e){return e.includes(vb)}function Rb(e,t){let n=t==="image/png"?JW(e):t==="image/jpeg"?QW(e):eX(e);return n&&n.width>0&&n.height>0?n:void 0}var ZW=[137,80,78,71,13,10,26,10];function Bx(e,t){return e[t]<<8|e[t+1]}function Ab(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function kb(e,t){return e[t]|e[t+1]<<8}function Ib(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16}function wp(e,t,n){return String.fromCharCode(...e.subarray(t,t+n))}function JW(e){if(!(e.length<24||ZW.some((t,n)=>e[n]!==t))&&wp(e,12,4)==="IHDR")return{width:Ab(e,16),height:Ab(e,20)}}function QW(e){if(e.length<4||e[0]!==255||e[1]!==216)return;let t=2;for(;t+3<e.length;){if(e[t]!==255)return;let n=e[t+1];if(n===255){t+=1;continue}if(n===1||n>=208&&n<=217){t+=2;continue}let r=Bx(e,t+2);if(n>=192&&n<=207&&n!==196&&n!==200&&n!==204)return t+8>=e.length?void 0:{width:Bx(e,t+7),height:Bx(e,t+5)};if(r<2)return;t+=2+r}}function eX(e){if(e.length<16||wp(e,0,4)!=="RIFF"||wp(e,8,4)!=="WEBP")return;let t=wp(e,12,4),n=t==="VP8L"?25:30;if(!(e.length<n)){if(t==="VP8 ")return e[23]!==157||e[24]!==1||e[25]!==42?void 0:{width:kb(e,26)&16383,height:kb(e,28)&16383};if(t==="VP8L"){if(e[20]!==47)return;let r=e[21],i=e[22],o=e[23],s=e[24];return{width:1+(r|(i&63)<<8),height:1+(i>>6|o<<2|(s&15)<<10)}}if(t==="VP8X")return{width:1+Ib(e,24),height:1+Ib(e,27)}}}var tX=new Set(["svg","g","defs","symbol","use","path","rect","circle","ellipse","line","polyline","polygon","text","tspan","title","desc","linearGradient","radialGradient","stop","clipPath","mask","pattern","filter","feGaussianBlur","feColorMatrix","feOffset","feMerge","feMergeNode","feFlood","feComposite","feBlend","feDropShadow","image"]),nX=new Set(["d","x","y","x1","y1","x2","y2","cx","cy","r","rx","ry","width","height","viewBox","preserveAspectRatio","fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-opacity","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-dasharray","stroke-dashoffset","opacity","transform","points","id","clip-path","mask","filter","font-family","font-size","font-weight","font-style","text-anchor","dx","dy","rotate","letter-spacing","word-spacing","xmlns","href","xlink:href","offset","stop-color","stop-opacity","gradientUnits","gradientTransform","spreadMethod","maskUnits","maskContentUnits","stdDeviation","values","in","in2","mode","type","result","flood-color","flood-opacity","patternUnits","patternContentUnits","role","aria-label","display","visibility","clip-rule","color","font-variant","font-stretch","text-decoration","dominant-baseline","alignment-baseline","baseline-shift","writing-mode","paint-order","vector-effect","shape-rendering","text-rendering","image-rendering","color-interpolation","color-interpolation-filters"]),rX=new Set(["fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-opacity","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-dasharray","stroke-dashoffset","opacity","clip-path","clip-rule","mask","filter","font-family","font-size","font-weight","font-style","font-variant","font-stretch","text-anchor","text-decoration","letter-spacing","word-spacing","dominant-baseline","alignment-baseline","baseline-shift","writing-mode","stop-color","stop-opacity","flood-color","flood-opacity","display","visibility","color","paint-order","vector-effect","shape-rendering","text-rendering","image-rendering","color-interpolation","color-interpolation-filters"]),iX=new Set(["line-height","text-align","font-variant-ligatures","font-variant-caps","font-variant-numeric","font-variant-east-asian","font-variant-position","font-variant-alternates","font-feature-settings","font-variation-settings","font-kerning","white-space","text-orientation","overflow","isolation","solid-color","solid-opacity","enable-background","color-rendering"]),oX=new Set(["none","normal","auto","initial","inherit","unset"]);function sX(e){return e==="xlink:href"?!1:e.includes(":")||e.startsWith("data-")||e==="version"||e==="baseProfile"||e==="enable-background"}function aX(e){return e==="metadata"||e.includes(":")&&!e.startsWith("svg:")}var lX=new Set(["x","y","width","height"]);function bb(e){let t=[],n=0,r=e.length;for(;n<r;){if(e[n]!=="<"){let u=n;for(;n<r&&e[n]!=="<";)n++;let f=e.slice(u,n);f.trim().length>0?t.push({kind:"text",text:f}):f.length>0&&t.push({kind:"text",text:f});continue}if(e.startsWith("<!--",n)){let u=e.indexOf("-->",n+4);if(u<0)break;t.push({kind:"comment",text:e.slice(n+4,u)}),n=u+3;continue}if(e.startsWith("<![CDATA[",n)){let u=e.indexOf("]]>",n+9);if(u<0)break;t.push({kind:"cdata",text:e.slice(n+9,u)}),n=u+3;continue}if(e.startsWith("<?",n)){let u=e.indexOf("?>",n+2);if(u<0)break;t.push({kind:"decl",text:e.slice(n+2,u)}),n=u+2;continue}if(e.startsWith("<!",n)){let u=e.indexOf(">",n+2);if(u<0)break;t.push({kind:"decl",text:e.slice(n+2,u)}),n=u+1;continue}if(e[n+1]==="/"){let u=e.indexOf(">",n+2);if(u<0)break;let f=e.slice(n+2,u).trim();t.push({kind:"close",name:f}),n=u+1;continue}let i=cX(e,n);if(i<0)break;let o=e.slice(n+1,i).trim(),s=o.endsWith("/"),a=s?o.slice(0,-1).trim():o,{name:l,attrs:c}=uX(a);t.push({kind:s?"self":"open",name:l,attrs:c}),n=i+1}return t}function cX(e,t){let n=t+1,r=null;for(;n<e.length;){let i=e[n];if(r)i===r&&(r=null);else if(i==='"'||i==="'")r=i;else if(i===">")return n;n++}return-1}function uX(e){let t=0;for(;t<e.length&&/\s/.test(e[t]);)t++;let n=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;let r=e.slice(n,t),i={};for(;t<e.length;){for(;t<e.length&&/\s/.test(e[t]);)t++;if(t>=e.length)break;let o=t;for(;t<e.length&&e[t]!=="="&&!/\s/.test(e[t]);)t++;let s=e.slice(o,t);if(t>=e.length||e[t]!=="="){s&&(i[s]="");continue}if(t++,t>=e.length)break;let a=e[t];if(a!=='"'&&a!=="'"){let c=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;i[s]=e.slice(c,t);continue}t++;let l=t;for(;t<e.length&&e[t]!==a;)t++;i[s]=e.slice(l,t),t<e.length&&t++}return{name:r,attrs:i}}function Ul(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function fX(e,t){if(e.startsWith("#")){let n=t.get(e.slice(1));return n?`#${n}`:null}if(/^url\(#[^)]+\)$/.test(e)){let n=e.slice(5,-1),r=t.get(n);return r?`url(#${r})`:null}return null}function Nb(e,t={}){let n=t.idPrefix??"nl-logo",r=t.onWarn??(()=>{}),i=bb(e),o="",s=0;for(let d of i)d.kind==="open"&&d.name==="style"?s++:d.kind==="close"&&d.name==="style"?s=Math.max(0,s-1):s>0&&(d.kind==="text"||d.kind==="cdata")&&(o+=d.text??"");let a=dX(o,d=>r(`sanitizer: dropping ${d}`)),l=new Map,c=0;for(let d of i)if((d.kind==="open"||d.kind==="self")&&d.attrs&&"id"in d.attrs){let p=d.attrs.id;p&&!l.has(p)&&l.set(p,`${n}-${c++}`)}let u=[],f=[];for(let d of i)if(d.kind!=="comment"&&d.kind!=="decl"){if(d.kind==="cdata"){f[f.length-1]&&u.push(Ul(d.text??""));continue}if(d.kind==="text"){if(f.length===0||f[f.length-1]){let p=(d.text??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");u.push(p)}continue}if(d.kind==="open"||d.kind==="self"){let p=d.name??"";if(p==="script"||p==="foreignObject"||p==="animate"||p==="animateTransform"||p==="animateMotion"||p==="set"){r(`sanitizer: dropping <${p}>`),d.kind==="open"&&f.push(!1);continue}if(p==="style"||aX(p)){d.kind==="open"&&f.push(!1);continue}if(!tX.has(p)){r(`sanitizer: dropping unknown element <${p}>`),d.kind==="open"&&f.push(!1);continue}let m=[`<${p}`],g=p==="svg"&&f.length===0,w=pX(d.attrs??{},a,r),x=Object.keys(w).sort();for(let y of x){let T=w[y];if(g&&t.stripRootSize&&lX.has(y))continue;if(/^on/i.test(y)){r(`sanitizer: dropping event handler ${y}`);continue}if(sX(y)||y==="class")continue;if(!nX.has(y)){r(`sanitizer: dropping attribute ${y}`);continue}if(y==="href"||y==="xlink:href"){let v=fX(T,l);if(v===null){r(`sanitizer: dropping external href ${T}`);continue}m.push(` ${y}="${Ul(v)}"`);continue}if(y==="id"){let v=l.get(T);v&&m.push(` id="${Ul(v)}"`);continue}let E=/url\(#([^)]+)\)/gi;if(/data:|javascript:|vbscript:|url\(|expression\s*\(|[\\{}]/i.test(T.replace(E,""))){r(`sanitizer: dropping suspicious value at ${y}`);continue}if(/url\(#/i.test(T)){let v=T.replace(E,(S,F)=>{let C=l.get(F);return C?`url(#${C})`:"none"});m.push(` ${y}="${Ul(v)}"`);continue}m.push(` ${y}="${Ul(T)}"`)}m.push(d.kind==="self"?"/>":">"),u.push(m.join("")),d.kind==="open"&&f.push(!0);continue}d.kind==="close"&&f.pop()&&u.push(`</${d.name}>`)}return u.join("")}function Sb(e){if(e===void 0)return;let t=/^\s*([0-9]*\.?[0-9]+(?:e[+-]?[0-9]+)?)\s*(px)?\s*$/i.exec(e);if(!t)return;let n=Number(t[1]);return n>0&&Number.isFinite(n)?n:void 0}function Tp(e){let t=bb(e).find(s=>(s.kind==="open"||s.kind==="self")&&s.name==="svg");if(!t)return;let n=t.attrs??{},r=Sb(n.width),i=Sb(n.height);if(r!==void 0&&i!==void 0)return{width:r,height:i};let o=(n.viewBox??"").trim().split(/[\s,]+/).map(Number);if(o.length===4&&o.every(Number.isFinite)&&o[2]>0&&o[3]>0)return{width:o[2],height:o[3]}}function Lb(e){let t=[];for(let n of e.split(";")){let r=n.indexOf(":");if(r<0)continue;let i=n.slice(0,r).trim().toLowerCase(),o=n.slice(r+1).replace(/!\s*important\s*$/i,"").trim();i&&o&&t.push({property:i,value:o})}return t}function dX(e,t){let n=[],r=e.replace(/\/\*[\s\S]*?\*\//g,""),i=/([^{}]+)\{([^{}]*)\}/g;for(let o of r.matchAll(i)){let s=o[1].trim(),a=s.split(",").map(l=>l.trim());if(s.startsWith("@")||!a.every(l=>/^\.[A-Za-z_][\w-]*$/.test(l))){t(`<style> rule ${s}`);continue}n.push({classes:a.map(l=>l.slice(1)),declarations:Lb(o[2])})}return/@[a-z-]+[^{;]*;/i.test(r)&&t("<style> at-rule"),n}function pX(e,t,n){let r=new Set((e.class??"").split(/\s+/).filter(Boolean)),i=[];for(let s of t)s.classes.some(a=>r.has(a))&&i.push(...s.declarations);if(e.style!==void 0&&i.push(...Lb(e.style)),i.length===0&&e.style===void 0)return e;let o={...e};delete o.style;for(let{property:s,value:a}of i)rX.has(s)?o[s]=a:!s.startsWith("-")&&!iX.has(s)&&!oX.has(a.toLowerCase())&&n(`sanitizer: dropping style property ${s}`);return o}var hX={".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp"};function mX(e){let t=e.slice(e.lastIndexOf("/")+1),n=t.lastIndexOf(".");return n>0?t.slice(n).toLowerCase():""}async function Pb(e,t,n){if(!e||!t)return;let r=mX(e),i=hX[r];if(!i){n(`unsupported logo format: ${r||"(none)"} (${e})`);return}let o;try{o=await t(e)}catch(l){let c=l instanceof Error?l.message:String(l);n(`logo file not found: ${e} (${c})`);return}let s=o.bytes,a=i==="image/svg+xml"?Tp(new TextDecoder().decode(s)):Rb(s,i);if(!a){let l=i==="image/svg+xml"?"no viewBox and no pixel width/height on the root <svg>":`not a readable ${r.slice(1).toUpperCase()} header`;n(`logo could not be parsed: ${e} (${l})`);return}return{ref:e,dimensions:a,asset:o}}var gX=1,yX=0;function xX(){return Oe.parse(`memory:///stage-${++yX}.nowline`)}async function EX(e){if(e.document)return e.document;let{workspace:t}=e.services.shared,n=t.LangiumDocumentFactory.fromString(e.source,xX());return await t.DocumentBuilder.build([n],{validation:!0}),n}function wX(e){return e.origin!=="validation"||e.diagnostic.severity===gX}async function Wx(e){let t=await EX(e),n=Ni(t);if(n.some(wX))return{kind:"invalid",document:t,diagnostics:n};let r=t.parseResult.value,i=await Cy(r,e.sourcePath,{services:e.services.Nowline,readFile:e.readSource}),o=e.isToleratedIncludeError??(()=>!1),s=i.diagnostics.filter(E=>E.severity==="error"&&!o(E)),a=i.diagnostics.filter(Fr),l=s.find(E=>!Fr(E));if(l)return{kind:"include-error",document:t,legacy:l,routed:[],resolved:i};if(s.length>0)return{kind:"include-error",document:t,routed:a,resolved:i};let c=[],u=await Pb(cd(r),e.assetResolver,E=>c.push(E)),{theme:f,today:d,width:p,locale:m,nonWorking:g}=e.layout,w={theme:f,today:d,width:p,locale:m,nonWorking:g},x=Di(i)??null,y=Xl(r,i,{today:d,plan:x}),T=Lx(r,i,{...w,schedule:y,logo:u?.dimensions});return{kind:"staged",document:t,ast:r,resolved:i,routed:a,logo:u,warnings:c,plan:x,schedule:y,model:T,layout:w}}var Cb=/&/g,Ob=/</g,$b=/>/g,TX=/"/g,vX=/'/g;function Ye(e){return e.replace(Cb,"&").replace(Ob,"<").replace($b,">")}function Yn(e){return e.replace(Cb,"&").replace(Ob,"<").replace($b,">").replace(TX,""").replace(vX,"'")}function Os(e){let t=Object.keys(e).sort(),n=[];for(let r of t){let i=e[r];i==null||i===!1||(i===!0?n.push(r):n.push(`${r}="${Yn(String(i))}"`))}return n.length?` ${n.join(" ")}`:""}function H(e,t,n){return n===void 0||n===""?`<${e}${Os(t)}/>`:`<${e}${Os(t)}>${n}</${e}>`}function ae(e,t){return`<text${Os(e)}>${Ye(t)}</text>`}function h(e){return Number.isFinite(e)?Number.isInteger(e)?e.toString():(Math.round(e*100)/100).toString():"0"}var kX="3 3";function vp(e,t){let n=e.waypoints;if(n.length<2)return"";let r=t.dependency.edgeStroke,i=n[n.length-1],o=n[n.length-2],s=Math.hypot(i.x-o.x,i.y-o.y);if(s===0)return"";let a=(i.x-o.x)/s,l=(i.y-o.y)/s,c=e.headWidth/2,u=e.head==="dot"?c:e.headWidth*5/7,f=s>u?[...n.slice(0,-1),{x:i.x-a*u,y:i.y-l*u}]:n.slice(0,-1),d=[IX(f,e.slack,r)],p=t.arrowhead.neutral;if(e.head==="dot")d.push(H("circle",{cx:h(i.x-a*c),cy:h(i.y-l*c),r:h(c),fill:p}));else{let m=i.x-a*u,g=i.y-l*u;d.push(H("path",{d:`M${h(m-l*c)} ${h(g+a*c)} L${h(i.x)} ${h(i.y)} L${h(m+l*c)} ${h(g-a*c)} z`,fill:p}))}return H("g",{"data-layer":"dependency"},d.join(""))}function IX(e,t,n){if(e.length<2)return"";let r={fill:"none",stroke:n,"stroke-width":1.1,"stroke-linejoin":"round"};if(!t)return H("path",{d:SX(e,ed),...r});let{solid:i,dotted:o}=RX(e,ed);return(i?H("path",{d:i,...r}):"")+(o?H("path",{d:o,...r,"stroke-dasharray":kX,"stroke-linecap":"round"}):"")}function RX(e,t){let n=e.length,r=[],i=[],o=[];for(let a=1;a<n-1;a++){let l=e[a-1],c=e[a],u=e[a+1],f=Math.hypot(c.x-l.x,c.y-l.y),d=Math.hypot(u.x-c.x,u.y-c.y),p=Math.min(t,f/2,d/2),m={x:Math.sign(c.x-l.x),y:Math.sign(c.y-l.y)},g={x:Math.sign(u.x-c.x),y:Math.sign(u.y-c.y)};r[a]={x:c.x-m.x*p,y:c.y-m.y*p},i[a]={x:c.x+g.x*p,y:c.y+g.y*p},p>0&&o.push(`M${h(r[a].x)} ${h(r[a].y)} Q${h(c.x)} ${h(c.y)} ${h(i[a].x)} ${h(i[a].y)}`)}let s=[];for(let a=0;a<n-1;a++){let l=a===0?e[0]:i[a],c=a===n-2?e[n-1]:r[a+1],u=`M${h(l.x)} ${h(l.y)} L${h(c.x)} ${h(c.y)}`;Math.abs(e[a+1].y-e[a].y)<1e-9?s.push(u):o.push(u)}return{solid:o.join(" "),dotted:s.join(" ")}}function SX(e,t){if(e.length<2)return"";let n=[`M${h(e[0].x)} ${h(e[0].y)}`];for(let r=1;r<e.length;r++){let i=e[r-1],o=e[r];if(r===e.length-1){n.push(`L${h(o.x)} ${h(o.y)}`);continue}let s=e[r+1],a=Math.sign(o.x-i.x),l=Math.sign(o.y-i.y),c=Math.sign(s.x-o.x),u=Math.sign(s.y-o.y),f=Math.hypot(o.x-i.x,o.y-i.y),d=Math.hypot(s.x-o.x,s.y-o.y),p=Math.min(t,f/2,d/2);if(p<=0||a!==0&&c!==0||l!==0&&u!==0){n.push(`L${h(o.x)} ${h(o.y)}`);continue}let m={x:o.x-a*p,y:o.y-l*p},g={x:o.x+c*p,y:o.y+u*p};n.push(`L${h(m.x)} ${h(m.y)}`),n.push(`Q${h(o.x)} ${h(o.y)} ${h(g.x)} ${h(g.y)}`)}return n.join(" ")}function Db(e,t,n,r){if(e.entries.length===0)return"";let i=n.footnotePanel.fill,o=n.footnotePanel.border,s=n.footnotePanel.header,a=n.footnotePanel.title,l=n.footnotePanel.description,c=n.footnotePanel.number,u=[];u.push(H("rect",{x:h(e.box.x),y:h(e.box.y),width:h(e.box.width),height:h(e.box.height),rx:6,ry:6,fill:i,stroke:o,"stroke-width":1,filter:`url(#${t}-shadow-subtle)`})),u.push(ae({x:h(e.box.x+Bt),y:h(e.box.y+ey),"font-family":r.sans,"font-size":12,"font-weight":700,fill:s},"Footnotes"));let f=e.box.x+Bt;for(let d of e.entries){d.region!==void 0&&d.regionHeadingY!==void 0&&u.push(ae({x:h(f),y:h(d.regionHeadingY),"font-family":r.sans,"font-size":10,"font-weight":700,fill:s},d.region)),u.push(ae({x:h(f),y:h(d.y),"font-family":r.sans,"font-size":10,"font-weight":700,fill:c},String(d.number)));for(let p of d.titleLines)u.push(ae({x:h(p.x),y:h(p.y),"font-family":r.sans,"font-size":11,"font-weight":600,fill:a},p.text));for(let p of d.descriptionLines??[])u.push(ae({x:h(p.x),y:h(p.y),"font-family":r.sans,"font-size":11,fill:l},p.text))}return H("g",{"data-layer":"footnotes"},u.join(""))}function Mb(e,t,n,r){let i=e.box.x+e.cardBox.x,o=e.box.y+e.cardBox.y,s=e.cardBox.width,a=e.cardBox.height,l=e.style.bg==="none"?n.surface.headerBox:e.style.bg,c=n.header.cardBorder,u=H("rect",{x:h(i),y:h(o),width:h(s),height:h(a),rx:6,ry:6,fill:l,stroke:c,"stroke-width":1,filter:`url(#${t}-shadow-subtle)`}),f=i+16+(e.textInset?.x??0),d=o+(e.textInset?.y??0),p=[];e.titleLines.forEach((T,E)=>{p.push(ae({x:h(f),y:h(d+26+E*20),"font-family":r[e.style.font],"font-size":16,"font-weight":600,fill:e.style.text},T))});let m=p.join(""),g=d+26+Math.max(0,e.titleLines.length-1)*20,w=n.header.author,x=[];e.authorLines.forEach((T,E)=>{x.push(ae({x:h(f),y:h(g+18+E*14),"font-family":r[e.style.font],"font-size":11,fill:w},T))});let y=x.join("");return H("g",{"data-layer":"header","data-id":`${t}-header`},u+m+y)}function Fb(e,t){let n=e.palette.attribution.mark,r=e.palette.attribution.link;if(e.swimlanes.length===0)return"";let i=e.header.attributionBox.x,o=e.header.attributionBox.y,s=Or,a=ae({x:"0",y:s,"font-family":t.sans,"font-size":Jf,"font-weight":400,fill:n},Zf)+ae({x:gl,y:s,"font-family":t.sans,"font-size":Or,"font-weight":700,fill:n},"now")+H("rect",{x:ny,y:12,width:ry,height:Or,fill:r})+ae({x:Qf,y:s,"font-family":t.sans,"font-size":Or,"font-weight":400,fill:n},"ine"),l=H("g",{transform:`translate(${h(i)} ${h(o)}) scale(${h(ml)})`},a);return H("a",{href:ty,target:"_blank",rel:"noopener","aria-label":"Powered by nowline"},H("g",{"data-layer":"attribution"},l))}async function Bb(e,t,n,r){let i=e.assetRef??"",{x:o,y:s,width:a,height:l}=e.box,c;try{if(r.logo&&r.logo.ref===i)c=r.logo.asset;else if(t)c=await t(i);else return""}catch(d){let p=`logo file not found: ${i} (${d instanceof Error?d.message:String(d)})`;if(r.strict)throw d;return r.warn?.(p),""}let u=(c.mime??"").toLowerCase();if(u==="image/svg+xml"){let d=new TextDecoder().decode(c.bytes),p=e.intrinsic??Tp(d)??{width:a,height:l},m=new Set,g=Nb(d,{idPrefix:`${n}-logo`,onWarn:w=>m.add(w.replace(/^sanitizer: dropping /,"")),stripRootSize:!0});return m.size>0&&r.warn?.(`logo ${i}: removed unsupported SVG content: ${[...m].join(", ")}`),H("svg",{"data-layer":"logo",x:h(o),y:h(s),width:h(a),height:h(l),viewBox:`0 0 ${h(p.width)} ${h(p.height)}`,preserveAspectRatio:"xMidYMid meet",overflow:"hidden"},g)}if(u==="image/png"||u==="image/jpeg"||u==="image/jpg"||u==="image/webp"){let d=bX(c.bytes);return H("image",{"data-layer":"logo",href:`data:${u};base64,${d}`,x:h(o),y:h(s),width:h(a),height:h(l),preserveAspectRatio:"xMidYMid meet"})}let f=`unsupported logo format: ${u} (${i})`;if(r.strict)throw new Error(f);return r.warn?.(f),""}function bX(e){if(typeof btoa<"u"){let n="";for(let r=0;r<e.length;r++)n+=String.fromCharCode(e[r]);return btoa(n)}let t=globalThis;if(t.Buffer)return t.Buffer.from(e).toString("base64");throw new Error("renderer: no base64 encoder available")}var _p=class{constructor(t="nl"){M(this,"prefix");M(this,"counter",0);this.prefix=t}next(t){let n=`${this.prefix}-${this.counter++}`;return t?`${n}-${t}`:n}};function Ap(e,t,n){let r=e.radius,i=e.center.x,o=e.center.y,s=t.anchorDiamond.fill,a=t.anchorDiamond.stroke,l=H("path",{d:`M${h(i)} ${h(o-r)} L${h(i+r)} ${h(o)} L${h(i)} ${h(o+r)} L${h(i-r)} ${h(o)} Z`,fill:s,stroke:a,"stroke-width":1.25}),c=t.anchorDiamond.label,u=e.labelSide==="left"?e.labelBox.x+e.labelBox.width:e.labelBox.x,f={x:h(u),y:h(o+4),"font-family":n.sans,"font-size":10,fill:c};e.labelSide==="left"&&(f["text-anchor"]="end");let d=e.title?ae(f,e.title):"";return H("g",{"data-layer":"anchor","data-id":e.id??null},Wb(e.hiddenDate)+l+d)}function kp(e,t){let n=t.anchorDiamond.cutLine;return H("line",{x1:h(e.center.x),y1:h(e.center.y+e.radius+1),x2:h(e.center.x),y2:h(e.cutBottomY),stroke:n,"stroke-width":1,"stroke-dasharray":"1 3"})}function Ip(e,t,n){let r=e.center.x,i=e.center.y,o=e.radius,s=e.isOverrun?t.milestoneDiamond.cutLineOverrun:t.milestoneDiamond.fill,a=H("path",{d:`M${h(r)} ${h(i-o)} L${h(r+o)} ${h(i)} L${h(r)} ${h(i+o)} L${h(r-o)} ${h(i)} Z`,fill:s,stroke:s,"stroke-width":1}),l=e.isOverrun?t.milestoneDiamond.cutLineOverrun:t.milestoneDiamond.label,c=e.labelSide==="left"?e.labelBox.x+e.labelBox.width:e.labelBox.x,u={x:h(c),y:h(i+4),"font-family":n.sans,"font-size":10,"font-weight":600,fill:l};e.labelSide==="left"&&(u["text-anchor"]="end");let f=e.title?ae(u,e.title):"";return H("g",{"data-layer":"milestone","data-id":e.id??null},Wb(e.hiddenDate)+a+f)}function Wb(e){return e===void 0?"":`<title>${Ye(e)}</title>`}function Rp(e,t,n){let r=e.isOverrun?n.milestoneDiamond.cutLineOverrun:n.milestoneDiamond.cutLineNormal,i=[];if(e.onWaveBoundary||i.push(H("line",{x1:h(e.center.x),y1:h(e.center.y+e.radius+1),x2:h(e.center.x),y2:h(e.cutBottomY),stroke:r,"stroke-width":2,"stroke-dasharray":pl,"stroke-linecap":"round"})),e.slackArrows&&e.slackArrows.length>0){let o=e.isOverrun?n.milestoneDiamond.cutLineOverrun:n.milestoneDiamond.slack,s=e.isOverrun?"arrow-overrun":"arrow-dark";for(let a of e.slackArrows)i.push(H("path",{d:`M${h(a.x)} ${h(a.y)} H${h(e.center.x-6)}`,fill:"none",stroke:o,"stroke-width":1.1,"stroke-dasharray":"3 3","stroke-linecap":"round","marker-end":`url(#${t}-${s})`}))}return i.join("")}var Ur={person:{viewBox:"0 0 24 24",body:'<circle cx="12" cy="8" r="4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M4 21a8 8 0 0 1 16 0" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>',ascii:"p"},people:{viewBox:"0 0 24 24",body:'<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><circle cx="9" cy="7" r="4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M22 21v-2a4 4 0 0 0-3-3.87" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M16 3.13a4 4 0 0 1 0 7.75" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>',ascii:"P"},points:{viewBox:"0 0 24 24",body:'<polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" fill="currentColor" stroke="currentColor" stroke-width="1" stroke-linejoin="round"/>',ascii:"*"},time:{viewBox:"0 0 24 24",body:'<line x1="10" x2="14" y1="2" y2="2" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><line x1="12" x2="15" y1="14" y2="11" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><circle cx="12" cy="14" r="8" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>',ascii:"t"}},NX={calendar:{viewBox:"0 0 24 24",body:'<rect x="3" y="4" width="18" height="18" rx="2" ry="2" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><line x1="16" x2="16" y1="2" y2="6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><line x1="8" x2="8" y1="2" y2="6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><line x1="3" x2="21" y1="10" y2="10" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>',ascii:"d"}},Xb={...Ur,...NX};var oae={none:"",multiplier:"x",person:Ur.person.ascii,people:Ur.people.ascii,points:Ur.points.ascii,time:Ur.time.ascii};var LX={thin:100,light:300,normal:400,bold:700};function PX(e){return ki[e]??14}function Sp(e,t,n){return{"font-family":t[e.font],"font-size":n??PX(e.textSize),"font-weight":LX[e.weight]??400,"font-style":e.italic?"italic":"normal",fill:e.text}}function CX(e){if(e.border==="dashed")return"4 3";if(e.border==="dotted")return"1 3"}function Ub(e,t,n,r,i,o={}){let s=Math.min(Ii[i.cornerRadius]??4,r/2,n/2);return H("rect",{x:h(e),y:h(t),width:h(n),height:h(r),rx:h(s),ry:h(s),fill:i.bg==="none"?"transparent":i.bg,stroke:i.fg,"stroke-width":1,"stroke-dasharray":CX(i)??null,...o})}function bp(e,t){let n=Math.max(e.x,t.x),r=Math.max(e.y,t.y),i=Math.min(e.x+e.width,t.x+t.width),o=Math.min(e.y+e.height,t.y+t.height);if(!(i<=n||o<=r))return{x:n,y:r,width:i-n,height:o-r}}var OX={none:{dx:0,dy:0,stdDeviation:0,opacity:0},subtle:{dx:0,dy:1,stdDeviation:1.5,opacity:.2},soft:{dx:0,dy:3,stdDeviation:5,opacity:.3},hard:{dx:2,dy:2,stdDeviation:0,opacity:.45}};function $X(e,t){let n=`${e}-shadow-${t}`,r=OX[t],i=`<feGaussianBlur in="SourceAlpha" stdDeviation="${r.stdDeviation}"/><feOffset dx="${r.dx}" dy="${r.dy}" result="offsetblur"/><feComponentTransfer><feFuncA type="linear" slope="${r.opacity}"/></feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>`;return H("filter",{id:n,x:"-50%",y:"-50%",width:"200%",height:"200%"},i)}function Gb(e,t){return t==="none"?null:`url(#${e}-shadow-${t})`}function Hb(e){return["subtle","soft","hard"].map(t=>$X(e,t)).join("")}var DX=4,MX=8,FX=10;function zb(e,t){return`url(#${e}-wave-hatch-${t})`}function jb(e,t,n){let r=uy;return H("pattern",{id:`${e}-wave-hatch-${t}`,width:r,height:r,patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)"},H("line",{x1:h(r/2),y1:0,x2:h(r/2),y2:r,stroke:t==="dark"?n.wave.hatch:n.wave.hatchOnDark,"stroke-width":fy,opacity:cy}))}function Yb(e){let t=n=>n.isOverrun&&(n.slackArrows?.length??0)>0;return e.milestones.some(t)||e.includes.some(n=>(n.milestones??[]).some(t))}function Vb(e){if(!e.waves)return[];let t=new Set,n=i=>{for(let o of i)o.kind==="item"?o.waveRole==="background"&&o.waveHatch&&t.add(o.waveHatch):n(o.children)},r=i=>{for(let o of i)n(o.children),r(o.nested)};r(e.swimlanes);for(let i of e.includes)r(i.nestedSwimlanes);for(let i of e.waveLegend?.entries??[])i.kind==="background"&&i.hatch&&t.add(i.hatch);return["dark","light"].filter(i=>t.has(i))}function Kb(e,t,n,r){let o=Math.min(Ii[t.cornerRadius]??4,e.height/2);return H("rect",{x:h(e.x+.5),y:h(e.y+.5),width:h(Math.max(0,e.width-2*.5)),height:h(Math.max(0,e.height-2*.5)),rx:h(o),ry:h(o),fill:zb(r,n)})}var Xx=4;function BX(e,t){let n=Math.min(Xx-bi,e.width/2,e.height/2),r=1e-6;return{left:e.x<=t.box.x+bi+r?n:0,right:e.x+e.width>=t.box.x+t.box.width-bi-r?n:0}}function WX(e,t){let{x:n,y:r,width:i,height:o}=e,s=(a,l,c)=>a>0?` A${h(a)} ${h(a)} 0 0 1 ${h(l)} ${h(c)}`:"";return`M${h(n+t.left)} ${h(r)} H${h(n+i-t.right)}`+s(t.right,n+i,r+t.right)+` V${h(r+o-t.right)}`+s(t.right,n+i-t.right,r+o)+` H${h(n+t.left)}`+s(t.left,n,r+o-t.left)+` V${h(r+t.left)}`+s(t.left,n+t.left,r)+" Z"}function Ux(e,t,n){let r=o=>n&&(n.left>0||n.right>0)?H("path",{d:WX(t,n),...o}):H("rect",{x:h(t.x),y:h(t.y),width:h(t.width),height:h(t.height),...o}),i=r({fill:e.style.stripFill});return e.style.tint?i+r({fill:e.style.tint,"fill-opacity":yl}):i}function qb(e,t){let n=e.timeline,r=n.waveStrip;if(!e.waves||!r)return"";let i=[H("rect",{x:h(n.box.x),y:h(r.y),width:h(n.box.width),height:h(r.height),rx:Xx,ry:Xx,fill:t.timeline.panelFill,stroke:t.timeline.border,"stroke-width":1})];for(let o of e.waves){let s=o.strip.cell;s&&i.push(H("g",{"data-id":o.id},`<title>${Ye(o.strip.tooltip)}</title>${Ux(o,s,BX(s,n))}`))}return H("g",{"data-layer":"wave-strip"},i.join(""))}function Np(e,t){let n=[];for(let r of e){if(!r.style.tint||r.empty)continue;let i=t?bp(r.columnBox,t):r.columnBox;!i||i.width<=0||i.height<=0||n.push(H("rect",{x:h(i.x),y:h(i.y),width:h(i.width),height:h(i.height),fill:r.style.tint,"fill-opacity":dy}))}return n.length===0?"":H("g",{"data-layer":"wave-bg"},n.join(""))}function Lp(e,t){let n=[];for(let r of e??[]){let i=r.topY,o=r.bottomY;t&&(r.x<=t.x||r.x>=t.x+t.width||(i=Math.max(i,t.y),o=Math.min(o,t.y+t.height),o<=i))||n.push(H("line",{x1:h(r.x),y1:h(i),x2:h(r.x),y2:h(o),stroke:r.stroke,"stroke-width":td,"stroke-dasharray":r.dash}))}return n.length===0?"":H("g",{"data-layer":"wave-boundary"},n.join(""))}function Zb(e,t,n){let r=e.timeline,i=r.waveStrip;if(!e.waves||!i)return"";let o=i.y+i.height/2+DX,s=[],a=(l,c,u)=>H("rect",{x:h(u.x),y:h(u.y),width:h(u.width),height:h(u.height),fill:t.timeline.panelFill})+ae({x:h(l),y:h(o),"font-family":n.sans,"font-size":mn,"font-style":"italic",fill:t.wave.labelMuted,"text-anchor":"middle"},c);if(i.placeholder!==void 0){let l=r.box.x+r.box.width/2,c=se(i.placeholder,mn)+2*Dr,u={x:l-c/2,y:i.y+Si,width:c,height:i.height-2*Si};s.push(a(l,i.placeholder,u))}for(let l of e.waves){if(l.strip.gapLabel){let{text:f,x:d,halo:p}=l.strip.gapLabel;s.push(a(d,f,p))}if(l.strip.marker){let{x:f,y:d}=l.strip.marker,p=py/2;s.push(H("path",{d:`M${h(f)} ${h(d-p)} L${h(f+p)} ${h(d)} L${h(f)} ${h(d+p)} L${h(f-p)} ${h(d)} Z`,fill:t.timeline.panelFill,stroke:t.wave.boundary,"stroke-width":1.5},`<title>${Ye(l.strip.tooltip)}</title>`))}if(!l.strip.cell)continue;let{labelDraw:c,superscripts:u}=l.strip;if(u&&s.push(Ux(l,u.halo)),l.strip.label!==void 0&&c&&(s.push(Ux(l,c.halo)),s.push(ae({x:h(c.x),y:h(o),"font-family":n.sans,"font-size":mn,"font-weight":600,fill:l.style.text,"text-anchor":"middle"},l.strip.label))),u){let f=u.rightX;for(let d=l.footnoteIndicators.length-1;d>=0;d--)s.push(ae({x:h(f),y:h(i.y+FX),"font-family":n.sans,"font-size":MX,"font-weight":700,fill:l.style.text,"text-anchor":"end"},String(l.footnoteIndicators[d]))),f-=Mt}}return s.length===0?"":H("g",{"data-layer":"wave-labels"},s.join(""))}function Pp(e){if(!e||e.length===0)return"";let t=e.map(n=>H("line",{x1:h(n.x),y1:h(n.topY),x2:h(n.x),y2:h(n.bottomY),stroke:n.stroke,"stroke-width":1,"stroke-dasharray":ly}));return H("g",{"data-layer":"wave-cross"},t.join(""))}function XX(e){let t=e.entities.item.bg;return t==="none"?"transparent":t}function Jb(e,t,n,r){if(!e)return"";let i=[];for(let o of e.entries){let s=o.swatch;if(s&&o.kind==="background"&&o.hatch){let a=XX(n),l={x:h(s.x),y:h(s.y),width:h(s.width),height:h(s.height)};i.push(H("rect",{...l,rx:2,ry:2,fill:a,stroke:n.entities.item.fg,"stroke-width":1})),i.push(H("rect",{x:h(s.x+.5),y:h(s.y+.5),width:h(s.width-1),height:h(s.height-1),rx:2,ry:2,fill:zb(t,o.hatch)}))}else if(s&&o.kind==="boundary"){let a=s.x+s.width/2;i.push(H("line",{x1:h(a),y1:h(s.y),x2:h(a),y2:h(s.y+s.height),stroke:n.wave.boundary,"stroke-width":td}))}for(let a of o.runs)i.push(ae({x:h(a.x),y:h(a.y),"font-family":r.sans,"font-size":mn,fill:n.wave.labelText},a.text))}return H("g",{"data-layer":"wave-legend"},i.join(""))}function Qb(e,t){let n=e;for(let r of t.iconDxTerms??[])n+=r;return n}function Gx(e,t,n,r,i,o){let s=t,{text:a,icon:l}=e,c={"font-family":i,"font-size":r,fill:o};if(!l)return ae({x:h(s),y:h(n),...c},a);if(l.kind==="builtin"&&l.name==="multiplier")return ae({x:h(s),y:h(n),...c},`${a}\xD7`);if(l.kind==="builtin"){let f=Ur[l.name],d=ae({x:h(s),y:h(n),...c},a),p=r,m=Qb(t,e),g=n-r*.85,w=`<svg x="${h(m)}" y="${h(g)}" width="${h(p)}" height="${h(p)}" viewBox="${f.viewBox}" style="color:${Yn(o)}" aria-hidden="true">${f.body}</svg>`;return d+w}let u=h(r*.1);return`<text x="${h(s)}" y="${h(n)}" font-family="${Yn(i)}" font-size="${r}" fill="${Yn(o)}">${Ye(a)}<tspan dx="${u}">${Ye(l.text)}</tspan></text>`}function UX(e){let{metaText:t,capacity:n,x:r,baselineY:i,fontSize:o,fontFamily:s,color:a}=e;if(!t&&!n)return"";let l={"font-family":s,"font-size":o,fill:a};if(!n)return ae({x:h(r),y:h(i),...l},t);if(!t)return Gx(n,r,i,o,s,a);let c=h(o*Wf),u=`<text x="${h(r)}" y="${h(i)}" font-family="${Yn(s)}" font-size="${o}" fill="${Yn(a)}">`,{text:f,icon:d}=n;if(!d)return u+Ye(t)+`<tspan dx="${c}">${Ye(f)}</tspan></text>`;if(d.kind==="builtin"&&d.name==="multiplier")return u+Ye(t)+`<tspan dx="${c}">${Ye(f)}\xD7</tspan></text>`;if(d.kind==="literal"){let T=h(o*.1);return u+Ye(t)+`<tspan dx="${c}">${Ye(f)}</tspan><tspan dx="${T}">${Ye(d.text)}</tspan></text>`}let p=Ur[d.name],m=o,g=Qb(r,n),w=i-o*.85,x=u+Ye(t)+`<tspan dx="${c}">${Ye(f)}</tspan></text>`,y=`<svg x="${h(g)}" y="${h(w)}" width="${h(m)}" height="${h(m)}" viewBox="${p.viewBox}" style="color:${Yn(a)}" aria-hidden="true">${p.body}</svg>`;return x+y}function GX(e,t){let n=Xb.calendar,r=`<svg x="${h(e.glyphTopLeft.x)}" y="${h(e.glyphTopLeft.y)}" width="${h(e.glyphSize)}" height="${h(e.glyphSize)}" viewBox="${n.viewBox}" style="color:${Yn(t)}" aria-hidden="true">${n.body}</svg>`,i=`<title>${Ye(e.isoDate)}</title>`;return H("g",{"data-layer":"inline-date-pin","data-side":e.side,"data-date":e.isoDate,"data-spilled":e.spilled?"true":null},i+r)}function Hx(e,t){return!e||e.length===0?"":e.map(n=>GX(n,t)).join("")}function eN(e){return e?.some(t=>t.side==="after")??!1}function HX(e){let t=[];return e.titleTruncated&&t.push(e.title),e.waveTooltip!==void 0&&t.push(e.waveTooltip),t.length>0?`<title>${Ye(t.join(`
|
|
2920
|
-
`))}</title>`:""}function zX(e,t){let n=[],r=Gb(t,e.style.shadow);return n.push(Ub(e.box.x,e.box.y,e.box.width,e.box.height,e.style,{filter:r??null})),e.waveRole==="background"&&e.waveHatch&&n.push(Kb(e.box,e.style,e.waveHatch,t)),n.join("")}function jX(e){if(e.progressFraction>0){let t=Math.max(0,Math.min(e.box.width,e.box.width*e.progressFraction));return H("rect",{x:h(e.box.x),y:h(e.box.y+e.box.height-Jt),width:h(t),height:Jt,fill:e.style.fg,opacity:.55})}return""}function YX(e){let t=e.dotSpills&&e.dotSpillCx!==null?e.dotSpillCx:e.box.x+e.box.width-_i;return H("circle",{cx:h(t),cy:h(e.box.y+Wg),r:Sr,fill:e.statusDotColor})}function VX(e,t){let n;if(e.textSpills)n=e.box.x+e.box.width+Mn,e.iconSpills&&(n+=Lr+hn);else{let r=!!e.linkIcon&&e.linkIcon!=="none",o=e.inlineDatePins?.find(s=>s.side==="after"&&!s.spilled)?ds(r,{barWidth:e.box.width}):ds(!t.noLinks&&r&&!e.iconSpills);n=e.box.x+o}return n}function KX(e,t,n,r){let i=[],o=e.style.text,s=n.entities.item.text,a=e.textSpills?s:o,l=e.textSpills?s:e.style.fg,c=e.titleLines??(e.title?[e.title]:[]);return c.forEach((u,f)=>{u!==""&&i.push(ae({x:h(t),y:h(e.box.y+Hf+f*sl),"font-family":r[e.style.font],"font-size":Nr,"font-weight":600,fill:a},u))}),(e.metaText||e.capacity)&&i.push(UX({metaText:e.metaText,capacity:e.capacity,x:t,baselineY:e.box.y+zf(c.length),fontSize:ol,fontFamily:r[e.style.font],color:l})),i.join("")}function qX(e,t,n){let r=[],i=t.entities.item.text;if(e.footnoteIndicators.length>0){let o=e.box.y+Xg;if(e.footnoteSpills&&e.footnoteSpillStartX!==null){let s=e.footnoteSpillStartX;for(let a=0;a<e.footnoteIndicators.length;a++){let l=e.footnoteIndicators[a];r.push(ae({x:h(s),y:h(o),"font-family":n.sans,"font-size":al,"font-weight":700,fill:i},String(l))),s+=Mt}}else{let s=e.box.x+e.box.width-fs;for(let a=e.footnoteIndicators.length-1;a>=0;a--){let l=e.footnoteIndicators[a];r.push(ae({x:h(s),y:h(o),"font-family":n.sans,"font-size":al,"font-weight":700,fill:e.style.text,"text-anchor":"end"},String(l))),s-=Mt}}}return r.join("")}function ZX(e,t,n){let r=[];if(!t.noLinks&&e.linkIcon&&e.linkIcon!=="none"){let i={linear:"#5e6ad2",github:"#0f172a",jira:"#0052cc",generic:n.item.linkIconFg},o=i[e.linkIcon]??i.generic,s=Lr,a=e.iconSpills&&e.iconSpillX!==null?e.iconSpillX:e.box.x+Ai,l=e.box.y+Ai,c=H("rect",{x:h(a),y:h(l),width:s,height:s,rx:2,ry:2,fill:o}),u=a,f=l,d=H("path",{d:`M${h(u+4)} ${h(f+10)} L${h(u+10)} ${h(f+4)} M${h(u+6)} ${h(f+4)} H${h(u+10)} V${h(f+8)}`,stroke:"#ffffff",fill:"none","stroke-width":1.1,"stroke-linecap":"round","stroke-linejoin":"round"}),p=c+d,m=e.linkHref?H("a",{href:e.linkHref,target:"_blank",rel:"noopener"},p):p;r.push(m)}return r.join("")}function JX(e,t,n){let r=[];if(e.hasOverflow&&e.overflowBox){let i=t.item.overflowTailFill,o=t.item.overflowTailStroke,s=t.item.overflowCaption;r.push(H("rect",{x:h(e.overflowBox.x),y:h(e.overflowBox.y),width:h(e.overflowBox.width),height:h(e.overflowBox.height),fill:i,stroke:o,"stroke-width":1})),e.overflowAnchorId&&e.overflowBox.width>60&&r.push(ae({x:h(e.overflowBox.x+e.overflowBox.width/2),y:h(e.overflowBox.y+e.overflowBox.height/2+3),"font-family":n.sans,"font-size":9,"font-weight":700,fill:s,"text-anchor":"middle"},`past ${e.overflowAnchorId}`))}return r.join("")}function QX(e,t){let n=[];for(let r of e.labelChips){let i=Math.min(Ii[r.style.cornerRadius]??8,r.box.height/2);n.push(H("rect",{x:h(r.box.x),y:h(r.box.y),width:h(r.box.width),height:h(r.box.height),rx:h(i),ry:h(i),fill:r.style.bg==="none"?"transparent":r.style.bg,stroke:r.style.fg,"stroke-width":.5})),n.push(ae({x:h(r.box.x+r.box.width/2),y:h(r.box.y+r.box.height/2+3),...Sp(r.style,t,ki.xs),"text-anchor":"middle"},r.text))}return n.join("")}function tN(e,t,n,r,i){let o=[];return o.push(HX(e)),o.push(zX(e,n)),o.push(jX(e)),o.push(YX(e)),o.push(Hx(e.inlineDatePins,e.style.fg)),o.push(KX(e,VX(e,t),r,i)),o.push(qX(e,r,i)),o.push(ZX(e,t,r)),o.push(JX(e,r,i)),o.push(QX(e,i)),H("g",{"data-layer":"item","data-id":e.id??null},o.join(""))}function eU(e,t,n,r,i,o){let s=[];if(!(e.kind==="group"&&e.waveOnly)){let l=e.box.y+e.headerHeight,c=e.box.height-e.headerHeight;if(e.style.bg!=="none"){let f=t<=Ey;s.push(H("rect",{x:h(e.box.x),y:h(l),width:h(e.box.width),height:h(c),fill:f?e.style.bg:"none","fill-opacity":f?t===1?yy:xy:null,stroke:f?null:e.style.bg,"stroke-opacity":f?null:.6,"stroke-width":f?null:1}))}let u=e.kind==="group"?e.style.fg:i.parallel.bracketStroke;if(e.headerHeight>0&&e.style.bracket!=="none"){let f=e.box.y+El,d=e.box.x,p=e.box.x+e.box.width;s.push(H("path",{d:`M${h(d)} ${h(l)} V${h(f)} H${h(p)} V${h(l)}`,fill:"none",stroke:u,"stroke-width":1.2,"stroke-dasharray":e.style.bracket==="dashed"?"3 2":null}))}e.title&&e.headerHeight>0&&s.push(ae({x:h(gs(e.box.x,eN(e.inlineDatePins))),y:h(e.box.y+gy),...Sp(e.style,o,ad),"font-weight":600,fill:u},e.title)),s.push(Hx(e.inlineDatePins,e.style.fg))}for(let l of e.children)s.push(rN(l,n,r,i,o,t));return H("g",{"data-layer":e.kind,"data-id":e.id??null},s.join(""))}function rN(e,t,n,r,i,o=0){return e.kind==="item"?tN(e,t,n,r,i):eU(e,o+1,t,n,r,i)}var nN=2;function tU(e,t){switch(e){case"green":return t.swimlane.utilizationOk;case"yellow":return t.swimlane.utilizationWarn;case"red":return t.swimlane.utilizationOver}}function nU(e,t){if(!e.utilization||e.utilization.segments.length===0)return"";let n=e.box.y+e.box.height-nN,r=e.utilization.segments.map(i=>{let o=i.endX-i.startX;return o<=0?"":H("rect",{x:h(i.startX),y:h(n),width:h(o),height:nN,fill:tU(i.classification,t),"data-utilization":i.classification,"data-load":h(i.load)})});return H("g",{"data-layer":"lane-utilization","data-id":e.id??null},r.join(""))}function iN(e,t){let n=e.bandIndex%2===0?t.swimlane.rowTintEven:t.swimlane.rowTintOdd,r=t.swimlane.border;return H("g",{"data-layer":"swimlane-bg","data-id":e.id??null},H("rect",{x:h(e.box.x),y:h(e.box.y),width:h(e.box.width),height:h(e.box.height),fill:n,stroke:r,"stroke-width":1}))}function Cp(e,t,n,r,i){let o=r.swimlane.tabFill,s=r.swimlane.tabStroke,a=r.swimlane.tabText,l=r.swimlane.ownerText,c=r.swimlane.footnoteIndicator,u=[];if(e.title){let d=e.footnoteIndicators.length>0?e.footnoteIndicators.join(","):"",p=wl(e.box.x,e.title,e.owner,e.capacityBadgeWidth,e.footnoteIndicatorWidth),m=fl,g=e.box.y+10,w=g+dl;u.push(H("rect",{x:h(p.tabX),y:h(g),width:h(p.tabW),height:h(m),rx:4,ry:4,fill:o,stroke:s,"stroke-width":1})),u.push(ae({x:h(p.titleX),y:h(w),"font-family":i[e.style.font],"font-size":12,"font-weight":600,fill:a},e.title)),e.owner&&u.push(ae({x:h(p.ownerX),y:h(w),"font-family":i[e.style.font],"font-size":10,fill:l},`owner: ${e.owner}`)),e.capacity&&u.push(Gx(e.capacity,p.badgeX,w,10,i[e.style.font],l)),d&&u.push(ae({x:h(p.footnoteRightX),y:h(g+14),"font-family":i.sans,"font-size":10,"font-weight":700,fill:c,"text-anchor":"end"},d))}for(let f of e.children)u.push(rN(f,t,n,r,i));return u.push(nU(e,r)),H("g",{"data-layer":"swimlane","data-id":e.id??null},u.join(""))}function sN(e,t,n){let r=n.timeline.gridLine,i=n.timeline.minorGridLine,o=e.bottomTickPanelHeight??0,s=e.bottomTickPanelY!==void 0&&o>0,a=e.tickPanelY,l=s?e.bottomTickPanelY+o:e.box.y+e.box.height,c=t,u=e.box.y+e.box.height,f=[];for(let d of e.ticks)if(d.major)f.push(H("line",{x1:h(d.x),y1:h(a),x2:h(d.x),y2:h(l),stroke:r,"stroke-width":1}));else if(e.minorGrid){if(d.labelX===void 0)continue;f.push(H("line",{x1:h(d.x),y1:h(c),x2:h(d.x),y2:h(u),stroke:i,"stroke-width":1}))}for(let d of e.nonWorking??[])d.seam&&f.push(H("line",{x1:h(d.x),y1:h(c),x2:h(d.x),y2:h(u),stroke:n.timeline.nonWorkingSeam,"stroke-width":1,"stroke-dasharray":"1 3"}));return H("g",{"data-layer":"grid"},f.join(""))}function Op(e,t,n,r){let i=e.box.y+e.box.height,o=[];for(let s of e.nonWorking??[]){if(!s.band)continue;let a={x:s.x,y:t,width:s.width,height:i-t},l=r?bp(a,r):a;!l||l.width<=0||l.height<=0||o.push(H("rect",{x:h(l.x),y:h(l.y),width:h(l.width),height:h(l.height),fill:n.timeline.nonWorkingFill,"fill-opacity":sy}))}return o.length===0?"":H("g",{"data-layer":"non-working"},o.join(""))}function aN(e,t,n){let r=e.box.y+e.box.height,i=[];for(let o of e.nonWorking??[])o.label===void 0||!o.labelBox||(o.cut&&i.push(H("line",{x1:h(o.x),y1:h(o.labelBox.y+4),x2:h(o.x),y2:h(r),stroke:t.timeline.nonWorkingSeam,"stroke-width":1,"stroke-dasharray":"1 3"})),i.push(oN(o.label,o.labelBox,o.labelSide,t,n)));for(let o of e.workingExceptions??[])o.labelBox&&i.push(oN(o.label,o.labelBox,o.labelSide,t,n));return i.length===0?"":H("g",{"data-layer":"non-working-label"},i.join(""))}function oN(e,t,n,r,i){let o=n==="left",s=t.y+4,a={x:h(o?t.x+t.width:t.x),y:h(s+4),"font-family":i.sans,"font-size":10,fill:r.timeline.labelText};return o&&(a["text-anchor"]="end"),ae(a,e)}function lN(e,t,n){let r=t.timeline.panelFill,i=t.timeline.border,o=t.timeline.labelText,s=[],a=e.tickPanelY,l=e.tickPanelHeight,c=l>0,u=e.markerRow.height>0,f=e.waveStrip?e.waveStrip.y+e.waveStrip.height:a+l,d=e.markerRow.height,p=e.bottomTickPanelY,m=e.bottomTickPanelHeight??0,g=p!==void 0&&m>0;c&&s.push(H("rect",{x:h(e.box.x),y:h(a),width:h(e.box.width),height:h(l),rx:4,ry:4,fill:r,stroke:i,"stroke-width":1})),u&&s.push(H("rect",{x:h(e.box.x),y:h(f),width:h(e.box.width),height:h(d),rx:4,ry:4,fill:r,stroke:i,"stroke-width":1})),g&&s.push(H("rect",{x:h(e.box.x),y:h(p),width:h(e.box.width),height:h(m),rx:4,ry:4,fill:r,stroke:i,"stroke-width":1}));for(let w of e.ticks)w.major&&(!w.label||w.labelX===void 0||(c&&s.push(ae({x:h(w.labelX),y:h(a+ul(l)),"font-family":n.sans,"font-size":Ri,fill:o,"text-anchor":"middle"},w.label)),g&&s.push(ae({x:h(w.labelX),y:h(p+ul(m)),"font-family":n.sans,"font-size":Ri,fill:o,"text-anchor":"middle"},w.label))));return H("g",{"data-layer":"timeline"},s.join(""))}function cN(e,t,n,r,i,o){let s=r.includeRegion.border,a=r.includeRegion.fill,l=r.includeRegion.tabFill,c=r.includeRegion.tabStroke,u=r.includeRegion.tabText,f=r.includeRegion.badgeFill,d=r.includeRegion.badgeStroke,p=r.includeRegion.badgeText,m=e.box.x+8,g=e.box.y,w=e.box.width-16,x=e.box.height,y=H("rect",{x:h(m),y:h(g),width:h(w),height:h(x),rx:8,ry:8,fill:a,stroke:s,"stroke-width":1,"stroke-dasharray":pl}),T=fl,E=Tl(e.box.x,e.label,e.sourcePath),v=g-T/2,S=H("rect",{x:h(E.tabX),y:h(v),width:h(E.tabWidth),height:T,rx:4,ry:4,fill:l,stroke:c,"stroke-width":1}),F=ae({x:h(E.tabLabelX),y:h(v+dl),"font-family":i.sans,"font-size":11,"font-weight":600,fill:u},e.label),C=E.badgeX,W=E.badgeSize,j=g-W/2,P=H("rect",{x:h(C),y:h(j),width:W,height:W,rx:4,ry:4,fill:f,stroke:d,"stroke-width":1}),R=H("path",{d:`M${h(C+7)} ${h(j+4)} H${h(C+14)} V${h(j+11)} M${h(C+4)} ${h(j+7)} H${h(C+11)} V${h(j+14)} H${h(C+4)} Z`,stroke:p,"stroke-width":1.4,fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}),N=9,$=g+4,I=H("rect",{x:h(E.sourceHaloX),y:h($-N),width:h(E.sourceHaloWidth),height:N+6,fill:a}),A=ae({x:h(E.sourceTextX),y:h($),"font-family":i.mono,"font-size":N,fill:p},e.sourcePath),_={x:m,y:g,width:w,height:x},D=o?Op(o.timeline,o.chartBox.y,r,_):"",L=o?.waves?Np(o.waves,_)+Lp(o.waveBoundaries,_):"",B=o?.waves?Pp(e.waveCrossings):"",z=e.nestedSwimlanes.map(k=>Cp(k,t,n,r,i)).join(""),G=(e.edges??[]).map(k=>vp(k,r)).join(""),ee=e.anchors??[],Y=e.milestones??[],ne=ee.map(k=>kp(k,r)).join("")+Y.map(k=>Rp(k,n,r)).join("")+ee.map(k=>Ap(k,r,i)).join("")+Y.map(k=>Ip(k,r,i)).join("");return H("g",{"data-layer":"include"},y+D+L+G+z+B+ne+S+F+P+R+I+A)}function uN(e,t,n){if(!e)return"";let r=t.nowline.stroke,i=t.nowline.labelText,o=H("line",{x1:h(e.x),y1:h(e.topY),x2:h(e.x),y2:h(e.bottomY),stroke:r,"stroke-width":Kf}),s=rU(e,r),a=iU(e,i,n);return H("g",{"data-layer":"nowline"},o+s+a)}function fN(e){let t=Kf/2;return e.pillMode==="flag-right"?e.x-t:e.pillMode==="flag-left"?e.x+t:e.x}function rU(e,t){let n=e.pillTopY,r=e.pillTopY+Ft,i=qg,o=e.pillWidth;if(e.pillMode==="center")return H("rect",{x:h(e.x-o/2),y:h(n),width:h(o),height:h(Ft),rx:i,ry:i,fill:t});let s=fN(e);if(e.pillMode==="flag-right"){let c=s+o,u=[`M ${h(s)} ${h(n)}`,`L ${h(c-i)} ${h(n)}`,`A ${i} ${i} 0 0 1 ${h(c)} ${h(n+i)}`,`L ${h(c)} ${h(r-i)}`,`A ${i} ${i} 0 0 1 ${h(c-i)} ${h(r)}`,`L ${h(s)} ${h(r)}`,"Z"].join(" ");return H("path",{d:u,fill:t})}let a=s-o,l=[`M ${h(s)} ${h(n)}`,`L ${h(a+i)} ${h(n)}`,`A ${i} ${i} 0 0 0 ${h(a)} ${h(n+i)}`,`L ${h(a)} ${h(r-i)}`,`A ${i} ${i} 0 0 0 ${h(a+i)} ${h(r)}`,`L ${h(s)} ${h(r)}`,"Z"].join(" ");return H("path",{d:l,fill:t})}function iU(e,t,n){let r=e.pillTopY+Zg,i=fN(e),o,s;return e.pillMode==="center"?(o=e.x,s="middle"):e.pillMode==="flag-right"?(o=i+hs,s="start"):(o=i-hs,s="end"),ae({x:h(o),y:h(r),"font-family":n.sans,"font-size":hl,"font-weight":700,fill:t,"text-anchor":s},e.label)}async function zx(e,t={}){let r=new _p(t.idPrefix??"nl").next("root"),i=e.palette,o=t.fontFamilies??oy,s=[],a=(u,f)=>`<marker id="${u}" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" fill="${f}"/></marker>`,l=`<defs>${Hb(r)}`+a(`${r}-arrow-dark`,i.arrowhead.dark)+(Yb(e)?a(`${r}-arrow-overrun`,i.milestoneDiamond.cutLineOverrun):"")+Vb(e).map(u=>jb(r,u,i)).join("")+"</defs>";s.push(l),s.push(H("rect",{x:0,y:0,width:h(e.width),height:h(e.height),fill:e.backgroundColor})),s.push(lN(e.timeline,i,o)),s.push(qb(e,i));for(let u of e.swimlanes)s.push(iN(u,i));s.push(Op(e.timeline,e.chartBox.y,i)),e.waves&&s.push(Np(e.waves)),s.push(sN(e.timeline,e.chartBox.y,i)),s.push(Lp(e.waveBoundaries)),s.push(Zb(e,i,o));for(let u of e.edges)s.push(vp(u,i));for(let u of e.swimlanes)s.push(Cp(u,t,r,i,o));for(let u of e.includes)s.push(cN(u,t,r,i,o,e));s.push(Pp(e.waveCrossings));for(let u of e.anchors)s.push(kp(u,i));for(let u of e.milestones)s.push(Rp(u,r,i));s.push(aN(e.timeline,i,o));for(let u of e.anchors)s.push(Ap(u,i,o));for(let u of e.milestones)s.push(Ip(u,i,o));if(s.push(uN(e.nowline,i,o)),s.push(Db(e.footnotes,r,i,o)),s.push(Jb(e.waveLegend,r,i,o)),s.push(Mb(e.header,r,i,o)),s.push(Fb(e,o)),e.header.logo&&(t.logo||t.assetResolver)){let u=await Bb(e.header.logo,t.assetResolver,r,t);u&&s.push(u)}return`<svg${Os({xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${h(e.width)} ${h(e.height)}`,width:h(e.width),height:h(e.height),"data-theme":e.theme,"data-generator":"nowline"})}>${s.join("")}</svg>`}var jx="/browser-source.nowline",oU={error:3,warning:2,info:1},sU={error:3,warning:2,info:1};function dN(e,t){return oU[e]>=sU[t]}var $p,pN=0;function hN(){return $p||($p=zy()),$p}function aU(){return Oe.parse(`memory:///nowline-browser-${++pN}.nowline`)}async function Yx(e,t={}){let n=t.filePath??jx,r=hN(),o=r.shared.workspace.LangiumDocumentFactory.fromString(e,aU());return await r.shared.workspace.DocumentBuilder.build([o],{validation:!0}),{ast:o.parseResult.value,diagnostics:mN(o,n)}}function mN(e,t){return gN(Ni(e),t)}function gN(e,t){return e.map(n=>n.origin==="lexer"?Mx(n.error,t):n.origin==="parser"?Dx(n.error,t):xb(n.diagnostic,t))}async function Vx(e,t={}){let n=t.filePath??jx,r=hN(),i,o;if(t.timezone)try{i=Ox(t.timezone)}catch(T){if(!(T instanceof Wi))throw T;o=T}let s=o?void 0:$x({now:t.today,zone:i}),a=await Wx({source:e,sourcePath:n,services:r,readSource:t.readFile??_b,assetResolver:t.assetResolver,isToleratedIncludeError:T=>Fx(T.message),layout:{theme:t.theme,today:s,locale:t.locale,width:t.width,nonWorking:t.nonWorking}});if(a.kind==="invalid")return{kind:"diagnostics",diagnostics:gN(a.diagnostics,n)};let l=a.kind==="include-error"&&a.legacy!==void 0,c=mN(a.document,n);for(let T of a.resolved.diagnostics){if(T.severity==="error"&&Fx(T.message)){t.onSkippedInclude?.({sourcePath:T.sourcePath,message:T.message});continue}l&&Fr(T)||c.push(Eb(T))}if(a.kind==="include-error"||c.some(T=>T.severity==="error"))return{kind:"diagnostics",diagnostics:c};if(o)return{kind:"diagnostics",diagnostics:[{severity:"error",code:"invalid-timezone",message:o.message,file:n,line:1,column:1}]};let u=[...a.warnings],{logo:f,model:d}=a,p=t.diagnosticLevel??"error",m=Cx(d,{today:s??void 0,locale:t.locale??"en-US"}).map(T=>Tb(T,n)),g=t.showLinks!==!1,w=t.strict===!0,x=await zx(d,{idPrefix:t.idPrefix,assetResolver:t.assetResolver,logo:f,noLinks:!g,strict:w,warn:T=>u.push(T),fontFamilies:t.fontFamilies}),y=[...m,...u.map(T=>wb(T,n,w?"error":"warning"))].filter(T=>dN(T.severity,p));return w&&y.length>0?{kind:"diagnostics",diagnostics:[...c,...y]}:{kind:"svg",svg:x,warnings:y}}function Kx(){$p=void 0,pN=0}var yN="/embed.nowline",qx=!1;async function xN(e){let{ast:t,diagnostics:n}=await Yx(e,{filePath:yN});return{ast:t,errors:n.filter(r=>r.severity==="error").map(r=>r.message)}}async function Dp(e,t={}){let n={filePath:yN,theme:t.theme,today:t.today,timezone:t.timezone,locale:t.locale,width:t.width,nonWorking:t.nonWorking,idPrefix:t.idPrefix,onSkippedInclude:()=>{qx||(qx=!0,console.warn("nowline: `include` directives are skipped in the browser embed (single-file mode). Render multi-file roadmaps with the CLI or the GitHub Action."))}},r=await Vx(e,n);if(r.kind==="svg")return r.svg;let i=r.diagnostics.filter(o=>o.severity==="error").map(o=>o.message);throw new Gl(`Failed to render Nowline source: ${i.join("; ")}`,i)}var Gl=class extends Error{constructor(n,r){super(n);M(this,"details",r);this.name="EmbedRenderError"}};function EN(){qx=!1,Kx()}var nn=Uint8Array,Lt=Uint16Array,tE=Int32Array,nE=new nn([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),rE=new nn([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),wN=new nn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),AN=function(e,t){for(var n=new Lt(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new tE(n[30]),r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return{b:n,r:i}},kN=AN(nE,2),lU=kN.b,Jx=kN.r;lU[28]=258,Jx[258]=28;var IN=AN(rE,0),xle=IN.b,TN=IN.r,Qx=new Lt(32768);for(xe=0;xe<32768;++xe)Vn=(xe&43690)>>1|(xe&21845)<<1,Vn=(Vn&52428)>>2|(Vn&13107)<<2,Vn=(Vn&61680)>>4|(Vn&3855)<<4,Qx[xe]=((Vn&65280)>>8|(Vn&255)<<8)>>1;var Vn,xe,jl=(function(e,t,n){for(var r=e.length,i=0,o=new Lt(t);i<r;++i)e[i]&&++o[e[i]-1];var s=new Lt(t);for(i=1;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;var a;if(n){a=new Lt(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var c=i<<4|e[i],u=t-e[i],f=s[e[i]-1]++<<u,d=f|(1<<u)-1;f<=d;++f)a[Qx[f]>>l]=c}else for(a=new Lt(r),i=0;i<r;++i)e[i]&&(a[i]=Qx[s[e[i]-1]++]>>15-e[i]);return a}),Xi=new nn(288);for(xe=0;xe<144;++xe)Xi[xe]=8;var xe;for(xe=144;xe<256;++xe)Xi[xe]=9;var xe;for(xe=256;xe<280;++xe)Xi[xe]=7;var xe;for(xe=280;xe<288;++xe)Xi[xe]=8;var xe,Mp=new nn(32);for(xe=0;xe<32;++xe)Mp[xe]=5;var xe,cU=jl(Xi,9,0);var uU=jl(Mp,5,0);var RN=function(e){return(e+7)/8|0},fU=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new nn(e.subarray(t,n))};var Kn=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},Hl=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},Zx=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return{t:bN,l:0};if(i==1){var s=new nn(n[0].s+1);return s[n[0].s]=1,{t:s,l:1}}n.sort(function(v,S){return v.f-S.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],c=0,u=1,f=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=i-1;)a=n[n[c].f<n[f].f?c++:f++],l=n[c!=u&&n[c].f<n[f].f?c++:f++],n[u++]={s:-1,f:a.f+l.f,l:a,r:l};for(var d=o[0].s,r=1;r<i;++r)o[r].s>d&&(d=o[r].s);var p=new Lt(d+1),m=eE(n[u-1],p,0);if(m>t){var r=0,g=0,w=m-t,x=1<<w;for(o.sort(function(S,F){return p[F.s]-p[S.s]||S.f-F.f});r<i;++r){var y=o[r].s;if(p[y]>t)g+=x-(1<<m-p[y]),p[y]=t;else break}for(g>>=w;g>0;){var T=o[r].s;p[T]<t?g-=1<<t-p[T]++-1:++r}for(;r>=0&&g;--r){var E=o[r].s;p[E]==t&&(--p[E],++g)}m=t}return{t:new nn(p),l:m}},eE=function(e,t,n){return e.s==-1?Math.max(eE(e.l,t,n+1),eE(e.r,t,n+1)):t[e.s]=n},vN=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Lt(++t),r=0,i=e[0],o=1,s=function(l){n[r++]=l},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return{c:n.subarray(0,r),n:t}},zl=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},SN=function(e,t,n){var r=n.length,i=RN(t+2);e[i]=r&255,e[i+1]=r>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var o=0;o<r;++o)e[i+o+4]=n[o];return(i+4+r)*8},_N=function(e,t,n,r,i,o,s,a,l,c,u){Kn(t,u++,n),++i[256];for(var f=Zx(i,15),d=f.t,p=f.l,m=Zx(o,15),g=m.t,w=m.l,x=vN(d),y=x.c,T=x.n,E=vN(g),v=E.c,S=E.n,F=new Lt(19),C=0;C<y.length;++C)++F[y[C]&31];for(var C=0;C<v.length;++C)++F[v[C]&31];for(var W=Zx(F,7),j=W.t,P=W.l,R=19;R>4&&!j[wN[R-1]];--R);var N=c+5<<3,$=zl(i,Xi)+zl(o,Mp)+s,I=zl(i,d)+zl(o,g)+s+14+3*R+zl(F,j)+2*F[16]+3*F[17]+7*F[18];if(l>=0&&N<=$&&N<=I)return SN(t,u,e.subarray(l,l+c));var A,_,D,L;if(Kn(t,u,1+(I<$)),u+=2,I<$){A=jl(d,p,0),_=d,D=jl(g,w,0),L=g;var B=jl(j,P,0);Kn(t,u,T-257),Kn(t,u+5,S-1),Kn(t,u+10,R-4),u+=14;for(var C=0;C<R;++C)Kn(t,u+3*C,j[wN[C]]);u+=3*R;for(var z=[y,v],G=0;G<2;++G)for(var ee=z[G],C=0;C<ee.length;++C){var Y=ee[C]&31;Kn(t,u,B[Y]),u+=j[Y],Y>15&&(Kn(t,u,ee[C]>>5&127),u+=ee[C]>>12)}}else A=cU,_=Xi,D=uU,L=Mp;for(var C=0;C<a;++C){var ne=r[C];if(ne>255){var Y=ne>>18&31;Hl(t,u,A[Y+257]),u+=_[Y+257],Y>7&&(Kn(t,u,ne>>23&31),u+=nE[Y]);var k=ne&31;Hl(t,u,D[k]),u+=L[k],k>3&&(Hl(t,u,ne>>5&8191),u+=rE[k])}else Hl(t,u,A[ne]),u+=_[ne]}return Hl(t,u,A[256]),u+_[256]},dU=new tE([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),bN=new nn(0),pU=function(e,t,n,r,i,o){var s=o.z||e.length,a=new nn(r+s+5*(1+Math.ceil(s/7e3))+i),l=a.subarray(r,a.length-i),c=o.l,u=(o.r||0)&7;if(t){u&&(l[0]=o.r>>3);for(var f=dU[t-1],d=f>>13,p=f&8191,m=(1<<n)-1,g=o.p||new Lt(32768),w=o.h||new Lt(m+1),x=Math.ceil(n/3),y=2*x,T=function(ge){return(e[ge]^e[ge+1]<<x^e[ge+2]<<y)&m},E=new tE(25e3),v=new Lt(288),S=new Lt(32),F=0,C=0,W=o.i||0,j=0,P=o.w||0,R=0;W+2<s;++W){var N=T(W),$=W&32767,I=w[N];if(g[$]=I,w[N]=$,P<=W){var A=s-W;if((F>7e3||j>24576)&&(A>423||!c)){u=_N(e,l,0,E,v,S,C,j,R,W-R,u),j=F=C=0,R=W;for(var _=0;_<286;++_)v[_]=0;for(var _=0;_<30;++_)S[_]=0}var D=2,L=0,B=p,z=$-I&32767;if(A>2&&N==T(W-z))for(var G=Math.min(d,A)-1,ee=Math.min(32767,W),Y=Math.min(258,A);z<=ee&&--B&&$!=I;){if(e[W+D]==e[W+D-z]){for(var ne=0;ne<Y&&e[W+ne]==e[W+ne-z];++ne);if(ne>D){if(D=ne,L=z,ne>G)break;for(var k=Math.min(z,ne-2),O=0,_=0;_<k;++_){var X=W-z+_&32767,U=g[X],K=X-U&32767;K>O&&(O=K,I=X)}}}$=I,I=g[$],z+=$-I&32767}if(L){E[j++]=268435456|Jx[D]<<18|TN[L];var q=Jx[D]&31,J=TN[L]&31;C+=nE[q]+rE[J],++v[257+q],++S[J],P=W+D,++F}else E[j++]=e[W],++v[e[W]]}}for(W=Math.max(W,P);W<s;++W)E[j++]=e[W],++v[e[W]];u=_N(e,l,c,E,v,S,C,j,R,W-R,u),c||(o.r=u&7|l[u/8|0]<<3,u-=7,o.h=w,o.p=g,o.i=W,o.w=P)}else{for(var W=o.w||0;W<s+c;W+=65535){var ie=W+65535;ie>=s&&(l[u/8|0]=c,ie=s),u=SN(l,u+1,e.subarray(W,ie))}o.i=s}return fU(a,0,r+RN(u)+i)};var NN=function(){var e=1,t=0;return{p:function(n){for(var r=e,i=t,o=n.length|0,s=0;s!=o;){for(var a=Math.min(s+2655,o);s<a;++s)i+=r+=n[s];r=(r&65535)+15*(r>>16),i=(i&65535)+15*(i>>16)}e=r,t=i},d:function(){return e%=65521,t%=65521,(e&255)<<24|(e&65280)<<8|(t&255)<<8|t>>8}}},hU=function(e,t,n,r,i){if(!i&&(i={l:1},t.dictionary)){var o=t.dictionary.subarray(-32768),s=new nn(o.length+e.length);s.set(o),s.set(e,o.length),e=s,i.w=o.length}return pU(e,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,n,r,i)};var LN=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};var mU=function(e,t){var n=t.level,r=n==0?0:n<6?1:n==9?3:2;if(e[0]=120,e[1]=r<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var i=NN();i.p(t.dictionary),LN(e,2,i.d())}};function PN(e,t){t||(t={});var n=NN();n.p(e);var r=hU(e,t,t.dictionary?6:2,4);return mU(r,t),LN(r,r.length-4,n.d()),r}var gU=typeof TextDecoder<"u"&&new TextDecoder,yU=0;try{gU.decode(bN,{stream:!0}),yU=1}catch{}var $N="https://free.nowline.io/open";function CN(e){let t=new TextEncoder().encode(e),n=PN(t),r=32768,i="";for(let o=0;o<n.length;o+=r)i+=String.fromCharCode(...n.subarray(o,o+r));return btoa(i).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function iE({source:e,sourceUrl:t,share:n}){if(n===!1||n==="none")return null;if(typeof n=="object")return t!==void 0&&ON(t)?n.remoteUrl.replace("{url}",encodeURIComponent(t)):n.textUrl.replace("{text}",CN(e));let r=n===!0?$N:n,i=new URL(r);return t!==void 0&&ON(t)?i.hash=`url=${encodeURIComponent(t)}`:i.hash=`text=${CN(e)}`,i.toString()}function ON(e){try{return new URL(e).protocol==="https:"}catch{return!1}}var DN=0;async function MN(e){let t=e.document??globalThis.document;if(!t)return{rendered:0,failed:0};let n=t.querySelectorAll(e.selector),r=0,i=0,o=++DN,s=e.share??!0,a=[],l=0;for(let c of Array.from(n)){let u=xU(c);if(!u)continue;let f=EU(c),d=`nl-r${o}-${l++}`,p={theme:e.theme,locale:e.locale,width:e.width,nonWorking:e.nonWorking,today:e.today,timezone:e.timezone,idPrefix:d},m=u.parentElement,g=u.nextSibling,x=c.getAttribute("data-nowline-source-url")??void 0??e.sourceUrl;a.push(Dp(f,p).then(y=>{if(wU(u,y),r++,m!==null){let T=iE({source:f,sourceUrl:x,share:s});if(T!==null){let E=t.createElement("a");E.className="nowline-share",E.href=T,E.target="_blank",E.rel="noopener noreferrer",E.textContent="Share on Nowline",m.insertBefore(E,g)}}},y=>{i++,console.error("nowline: render failed",y)}))}return await Promise.all(a),{rendered:r,failed:i}}function xU(e){let t=e.parentElement;return t&&t.tagName.toUpperCase()==="PRE"?t:e}function EU(e){return e.textContent??""}function wU(e,t){e.outerHTML=t}function FN(){DN=0}function Fp(){if(typeof globalThis>"u")return"light";let e=globalThis.matchMedia;if(typeof e!="function")return"light";try{return e("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{return"light"}}function BN(e,t){return e&&e!=="auto"?Zy(e)??t:t}var TU="0.0.0-dev.20261020002921.g70f418b",vU="70f418b",_U="pre code.language-nowline, code.language-nowline",WN={theme:"auto",startOnLoad:!0,selector:_U,systemTheme:Fp(),share:!0},Ae={...WN},oE=!1;function AU(e={}){Ae={theme:e.theme??Ae.theme,startOnLoad:e.startOnLoad??Ae.startOnLoad,selector:e.selector??Ae.selector,locale:e.locale??Ae.locale,width:e.width??Ae.width,nonWorking:e.nonWorking??Ae.nonWorking,today:e.today!==void 0?e.today:Ae.today,timezone:e.timezone??Ae.timezone,share:e.share??Ae.share,sourceUrl:e.sourceUrl??Ae.sourceUrl,systemTheme:Fp()}}function XN(){return{theme:BN(Ae.theme,Ae.systemTheme),locale:Ae.locale,width:Ae.width,nonWorking:Ae.nonWorking,today:Ae.today,timezone:Ae.timezone}}async function kU(e,t={}){let n={...XN(),...t};return Dp(e,n)}async function IU(e){return xN(e)}async function sE(e){let t={selector:e?.selector??Ae.selector,theme:e?.theme??XN().theme,locale:e?.locale??Ae.locale,width:e?.width??Ae.width,nonWorking:e?.nonWorking??Ae.nonWorking,today:e?.today!==void 0?e.today:Ae.today,timezone:e?.timezone??Ae.timezone,share:e?.share??Ae.share,sourceUrl:e?.sourceUrl??Ae.sourceUrl,document:e?.document};return MN(t)}var RU=sE;if(typeof document<"u"&&!oE){oE=!0;let e=()=>{Ae.startOnLoad&&sE()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):queueMicrotask(e)}function SU(){Ae={...WN,systemTheme:Fp()},oE=!1,EN(),FN()}return QN(bU);})();
|
|
2919
|
+
`).map(i=>i.trim()),n=0,r=t.length;for(;n<r&&t[n]==="";)n+=1;for(;r>n&&t[r-1]==="";)r-=1;return t.slice(n,r)}function fB(e,t,n,r=t){let i=e,o=_S(e);if(o){if(o.length>=2)return{textSpills:!(n<=t&&o.every((c,u)=>se(c,Xd)<=(u===0?r:t))),titleLines:o};i=o[0]??""}let s=i.length>0&&se(i,Xd)>r,a=n>t;if(!s&&!a)return{textSpills:!1,titleLines:[i]};if(s&&!a){let l=wi(i,t,Xd,r);if(l.length>=2&&l.length<=Mg&&l.every((c,u)=>se(c,Xd)<=(u===0?r:t)))return{textSpills:!1,titleLines:l}}return{textSpills:!0,titleLines:[i]}}function vS(e,t,n){let r=_S(e);return r&&r.length>=2?r:!t.textSpills&&!n&&t.titleLines.length>=2?t.titleLines:[r?r[0]??"":e]}function AS(e){let{visualWidth:t}=e,n=ds(!!e.hasLinkIcon,e.hasAfterGlyph?{barWidth:t}:void 0),r=Math.max(0,t-n-aB),i=uB(e.metaText,e.metaTrailingWidth??0),o=Math.max(0,t-n-(e.titleFirstLineRightReservePx??ll({barWidth:t,footnoteLabels:[],hasBeforeGlyph:!1})));return{leftInset:n,fit:fB(e.title,r,i,o)}}var dB;function kS(e,t,n){dB?.(e,t,n)}var Ud=class{constructor(t){M(this,"geometry");this.geometry=t}get id(){return this.geometry.id}measure(t){return{width:this.geometry.naturalWidth,height:t.bands.bandwidth()+this.geometry.barExtra}}place(t,n){let{naturalWidth:r,visualWidth:i,caption:o,barExtra:s}=this.geometry,a=n.bands.bandwidth(),l=t.x+Gd(r),c={x:l,y:t.y,width:i,height:s>0?a+s:a},{textSpills:u,titleLines:f}=o.fit,d=u?l+i+lB:l+o.leftInset;return{id:this.geometry.id,box:c,textX:d,textSpills:u,titleLines:f}}};function pB(e){switch(e){case"done":case"completed":return"done";case"in-progress":case"active":return"in-progress";case"at-risk":case"blocked":case"planned":return e;case void 0:return"planned";default:return"neutral"}}function hB(e){if(!e)return 0;let t=/^(\d{1,3})%$/.exec(e);return t?Math.max(0,Math.min(100,parseInt(t[1],10)))/100:0}function mB(e,t){if(e)return/^\d+(?:\.\d+)?[dwmqy]$/.test(e)||/^\d+%$/.test(e)?e:t.sizes.get(e)?.effortLiteral??e}function gB(e,t){if(e)return t.teams.get(e)?.title??t.persons.get(e)?.title??e}function yB(e){if(!e)return{icon:"none"};let t=e.toLowerCase();return t.includes("linear.app")?{icon:"linear",href:e}:t.includes("github.com")?{icon:"github",href:e}:t.includes("atlassian.net")||t.includes("jira.")?{icon:"jira",href:e}:{icon:"generic",href:e}}function Hd(e,t,n,r,i){let o=YR(e,t),s=e.name??e.title??"",a=o.padding==="none"?"xs":o.padding,l=ck[a],c=Math.max(20,Math.round(s.length*5.5+l*2));return i!==void 0&&(c=Math.min(c,i)),{text:s,style:o,box:{x:n,y:r,width:c,height:Or}}}function xB(e,t){let n=FA(e,t.sizes,t.cal),r=DA(re(e,"remaining"),t.sizes,t.cal),i=re(e,"status"),o=pB(i),s=hB(i);s===0&&o==="done"&&(s=1);let a=/^(\d{1,3})%$/.exec(re(e,"remaining")??"");return s===0&&o==="in-progress"&&a&&(s=1-Math.max(0,Math.min(100,parseInt(a[1],10)))/100),s===0&&o==="in-progress"&&r>0&&n>0&&(s=Math.max(0,Math.min(1,1-r/n))),{status:o,progress:s}}function EB(e,t,n,r,i,o){let s=re(e,"duration"),a=!!s&&/^\d+(?:\.\d+)?[dwmqy]$/.test(s),l=n?n.title??n.name:"",c=a?s:l||void 0,u=re(e,"remaining"),f=mB(u,t),d=gB(re(e,"owner"),t),p=()=>[c,d].filter(Boolean).join(" "),m;if(r==="in-progress"&&f){let T=p();m=T?`${T} \u2014 ${f} remaining`:`${f} remaining`}else if(r==="in-progress"&&i>0&&i<1){let T=Math.round((1-i)*100),E=p();m=E?`${E} \u2014 ${T}% remaining`:`${T}% remaining`}else(d||c)&&(m=p()||void 0);let g=re(e,"capacity"),w=Sr(g),x=null,y=0;if(w!==null){let T=Qa(w),E=el(o,t.symbols),_=11,R=nl(T,E,_,m);x={value:w,text:T,icon:E,...R!==void 0?{iconDxTerms:R}:{}},y=(m?se(" ",_):0)+tl(T,E,_)}return{metaText:m,ownerDisplay:d,capacity:x,capacityTrailingWidth:y}}function wB(e,t){let n=new Set;if(e){for(let[r,i]of t.footnoteHosts.entries())if(i.includes(e)){let o=t.footnoteIndex.get(r);o!==void 0&&n.add(o)}}return[...n].sort((r,i)=>r-i)}function TB(e,t,n){return ll({barWidth:e,footnoteLabels:t.map(String),hasBeforeGlyph:Wt(n)!==void 0})}var _B={done:"done","in-progress":"inProgress","at-risk":"atRisk",blocked:"blocked",planned:"planned",neutral:"neutral"};function vB(e,t,n){let r=_B[t],i={...e};return i.bg===n.entities.item.bg&&(i.bg=n.statusTint[r]),i.fg===n.entities.item.fg&&(i.fg=n.status[r]),i}function AB(e,t,n,r,i){if(n===0)return 0;let o=r-Qt-Or-Wn,s;e&&t?s=Math.max(_i,i)+Wn:e?s=o:s=Math.max(o,i+Wn);let l=s+(n-1)*Yf+Or+Wn+Qt;return Math.max(0,l-r)}function kB(e,t,n){let r=n.axisColumns;if(!t.textSpills||!r)return{lines:e,truncated:!1};let i=Math.max(0,...e.map(g=>se(g,Lr))),{metaText:o,capacityTrailingWidth:s}=t.meta,a=(o?se(o,ol):0)+s,l=Math.max(i,a),c=jf({barRightX:t.barRightX,iconSpills:t.iconSpills,captionWidth:l,footnoteCount:t.visualWidth<ps?t.footnoteCount:0,dotSpills:t.visualWidth<Cr}),u=r.captionCapX(t.barRightX);if(c.rightX<=u+IB||c.captionX===null)return{lines:e,truncated:!1};let f=c.rightX-(c.captionX+l),d=u-c.captionX-f,p=!1;return{lines:e.map(g=>{let w=OA(g,d,Lr);return w!==g&&(p=!0),w}),truncated:p}}var IB=1e-6;function zd(e,t,n){let r=e.properties,i=Se("item",r,n.styleCtx),o=re(r,"size"),s=o?n.sizes.get(o)??null:null,a=TS(n,e),l=Be(r,"after"),c=Be(r,"before"),u=Ss(n,t,a),f=ax(u),d=yB(re(r,"link")),p=d.icon!=="none",m=ax(u),g=Be(r,"labels"),w=[];for(let z of g){let G=n.labels.get(z);if(!G)continue;let ee=Hd(G,n.styleCtx,0,0);w.push({id:G,width:ee.box.width})}let x=0;for(let z=0;z<w.length;z+=1)z>0&&(x+=Xn),x+=w[z].width;let y=Math.max(0,m-2*Mn),T=w.length>0&&x>y,{status:E,progress:_}=xB(r,n),R=vB(i,E,n.styleCtx.theme),F=EB(r,n,s,E,_,R.capacityIcon),C=e.title??e.name??"",W=wB(e.name,n),j=AS({title:C,visualWidth:f,metaText:F.metaText,metaTrailingWidth:F.capacityTrailingWidth,hasLinkIcon:p,hasAfterGlyph:Wt(l)!==void 0,titleFirstLineRightReservePx:TB(m,W,c)}),P=p&&f<Xg,S=j.fit.textSpills||P,b=kB(vS(C,j.fit,P),{textSpills:S,iconSpills:P,barRightX:t+Gd(u)+f,visualWidth:f,footnoteCount:W.length,meta:F},n),$=b.lines,I=T?ak(w,f):null,A=I?I.rows.length:w.length>0?1:0,v=F.metaText!==void 0||F.capacity!==null,D=zf($.length,v),L=Fg($.length,v),B=AB(T,S,A,n.bandScale.bandwidth(),D);return{node:e,id:e.name??"",startX:t,durationDays:a,naturalWidth:u,visualWidth:f,naturalVisualWidth:m,style:R,size:s,status:E,progress:_,meta:F,link:d,chips:{samples:w,outside:T,pack:I,rowCount:A},footnoteIndicators:W,caption:{...j,title:C,iconSpills:P,lines:$,truncated:b.truncated,lastBaseline:D},barExtra:Math.max(L,B)}}function jd(e,t,n,r){let i=e.properties,o=Be(i,"after"),s=Be(i,"before"),a=$l(i,t.x,n);n.waves&&(a=Ur(e,a,n));let l=ES(i,a,n),c=n.scale.startX(a),u=r??zd(e,c,n);if(u.startX!==c)throw new Error(`layout: item "${e.name??e.title??"(unnamed)"}" was measured at x ${u.startX} but placed at x ${c}`);let{naturalWidth:f,style:d,status:p,progress:m,footnoteIndicators:g,caption:w}=u,{metaText:x,ownerDisplay:y,capacity:T,capacityTrailingWidth:E}=u.meta,_=u.link,R=_.icon!=="none",F=u.chips.samples,C=u.chips.outside,W=c,j=c+f,P=c+Ss(n,c,u.durationDays),S=!1,b,$;if(s.length>0){let Ze,Jn;for(let Pt of s){let Ds=ve(Pt),Ms=Ds?n.scale.forwardWithinDomain(Ds)??void 0:n.entityLeftEdges.get(Pt);Ms!==void 0&&(Ze===void 0||Ms<Ze)&&(Ze=Ms,Jn=Pt)}Ze!==void 0&&P>Ze&&(S=!0,b={x:Ze,y:t.y,width:j-Ze,height:n.bandScale.bandwidth()},$=Jn)}let I=w.title,A=new Ud(u),v={time:n.scale,bands:n.bandScale,style:d},D=A.place({x:W,y:t.y},v),L=D.box,B=n.bandScale.bandwidth(),z=L.width<Cr,G=w.iconSpills,ee=L.width<ps,Y=D.textSpills||G,ne=w.lines,k=u.chips.pack,O=w.lastBaseline,X=u.barExtra,U=[],K=L.y+B-Qt-Or-Wn,q=L.y+(C&&Y?Math.max(_i,O):O)+Wn,ie=C&&Y||!C&&F.length>0?Math.max(K,q):K,ge=C?L.x+L.width+Bn:L.x+Mn,fe=ge;if(k)for(let Ze=0;Ze<k.rows.length;Ze+=1){let Jn=ie+Ze*Yf,Pt=ge;for(let Ms of k.rows[Ze]){let lE=Hd(Ms.id,n.styleCtx,Pt,Jn);U.push(lE),Pt+=lE.box.width+Xn}let Ds=Pt-Xn;Ds>fe&&(fe=Ds)}else{let Ze=ge;for(let Jn of F){let Pt=Hd(Jn.id,n.styleCtx,Ze,ie);U.push(Pt),Ze+=Pt.box.width+Xn}fe=F.length>0?Ze-Xn:ge}let de=y??re(i,"owner"),rt=e.description?.text,ht=g.length>0&&ee,mt=null;if(Y){let Ze=Math.max(...ne.map(Pt=>se(Pt,Lr))),Jn=(x?se(x,11):0)+E;mt=Math.max(Ze,Jn)}let jl=jf({barRightX:L.x+L.width,iconSpills:G,captionWidth:mt,footnoteCount:ht?g.length:0,dotSpills:z}),{iconSpillX:UN,footnoteSpillStartX:GN,dotSpillCx:HN}=jl,zN=Math.max(L.x+L.width,jl.rightX),$s=e.name;$s&&(n.entityLeftEdges.set($s,W),n.entityRightEdges.set($s,P)),hS(e,P,n);let sE=$s??lx(e);n.itemFlowKey.set(sE,n.currentFlowKey),t.startX=W,t.x=P,t.height=Math.max(t.height,n.bandScale.step()+X);let aE=aS({box:L,afterDate:Wt(o),beforeDate:Wt(s),hasLinkIcon:R,footnoteCount:g.length}),Zn={kind:"item",id:$s,title:I,...ne.length>=2||ne[0]!==I?{titleLines:ne}:{},box:L,dateSpan:{startX:W,endX:j},status:p,statusDotColor:wS(p,d.bg,n.styleCtx.theme),progressFraction:m,footnoteIndicators:g,labelChips:U,chipsOutside:C,chipsRightX:fe,linkIcon:_.icon,linkHref:_.href,hasOverflow:S,overflowBox:b,overflowAnchorId:$,owner:de,description:rt,metaText:x,textSpills:Y,dotSpills:z,iconSpills:G,footnoteSpills:ht,dotSpillCx:HN,iconSpillX:UN,footnoteSpillStartX:GN,decorationsRightX:zN,capacity:T,size:u.size,style:d,inlineDatePins:aE.length>0?aE:void 0},Yl=mS(e,n);return Yl!==void 0&&(Zn.waveRole=Yl),Yl==="background"&&(Zn.waveHatch=Bd(d.bg)),l!==void 0&&(Zn.nonWorkingPin=l),w.truncated&&(Zn.titleTruncated=!0),Yl==="background"&&n.waves&&(Zn.waveTooltip=n.waves.backgroundTooltip),n.placedItems.set(sE,Zn),kS(A,v,Zn),Zn}function lx(e){let t=e.$cstNode?.range.start;return`#item@${t?t.line+1:0}:${t?t.character+1:0}`}function cx(e){let t=new Map;for(let n of hA(e))Ke(n)&&t.set(n.name??lx(n),n);return t}var RB=.01;function SB(e,t){let n={blocks:[],edges:[]},r=new Map,i=(a,l,c)=>{n.blocks.push({x:a,y:c,width:l,height:0})},o=(a,l)=>{let{box:c}=a;if(a.kind==="item"){n.blocks.push({...c,width:Cl(a)-c.x}),n.edges.push({x:c.x,top:c.y,bottom:c.y+c.height},{x:c.x+c.width,top:c.y,bottom:c.y+c.height});return}l&&a.id&&r.set(a.id,a),a.kind==="group"&&a.waveOnly||(a.headerHeight>0&&n.blocks.push({x:c.x,y:c.y,width:Math.max(c.width,ys(a)-c.x),height:a.headerHeight}),i(c.x,c.width,c.y+c.height),n.edges.push({x:c.x,top:c.y,bottom:c.y+c.height},{x:c.x+c.width,top:c.y,bottom:c.y+c.height}));for(let u of a.children)o(u,l)},s=(a,l)=>{i(a.box.x,a.box.width,a.box.y),i(a.box.x,a.box.width,a.box.y+a.box.height);for(let c of a.children)o(c,l);for(let c of a.nested)s(c,l)};for(let a of e)s(a,!0);for(let a of t){i(a.box.x,a.box.width,a.box.y),i(a.box.x,a.box.width,a.box.y+a.box.height);for(let l of a.nestedSwimlanes)s(l,!1)}return{obstacles:n,containers:r}}function ux(e,t,n,r){let{obstacles:i,containers:o}=SB(t,n),s=r.bandScale.bandwidth(),a=Se("item",[],r.styleCtx),l=[];for(let[p,m]of e){let g=r.placedItems.get(p);if(!g)continue;let w=rx(g,s);for(let x of Be(m.properties,"after")){let y=r.placedItems.get(x),T=y?void 0:o.get(x),E;if(y?E=rx(y,s):T&&(E=sS(T)),E){l.push({fromId:x,toId:p,source:E,target:w});continue}let _=r.entityMidpoints.get(x);if(!_||w.startX-_.x<=RB)continue;let R=w.rowY??w.top;l.push({fromId:x,toId:p,waypoints:[{x:_.x,y:R},{x:w.paintedX,y:R}],slack:!0,...xs(w.bottom-w.top),style:a})}}let c=l.filter(p=>p!==null&&"source"in p),u=_k(c,i,r.scale.pixelsPerDay),f=new Map(c.map((p,m)=>[p,u[m]])),d=[];for(let p of l){if(!p)continue;if(!("source"in p)){d.push(p);continue}let m=f.get(p);m&&d.push({...m,style:a})}return d}function Vd(e,t=0){let n=new Map,r=new Map;return[...e.entries()].forEach(([i,o],s)=>{n.set(i,t+s+1),r.set(i,Be(o.properties,"on"))}),{index:n,hosts:r}}var Yd=11,bB=120,NB=6,IS="\u2014 ";function SS(e,t,n,r,i=[]){let o=Bt,s=n+Bt,a=r-2*Bt,l=o+2*Bt,c=o+a-Bt,u=s+Kf+Bt,f=[],d=0,p=(g,w,x)=>{for(let[y,T]of g){let E=T.title??y,_=T.description?.text,R=LB(E,_,l,c),F=u+d*ms,C=j=>({x:j.x,y:F+j.row*ms,text:j.text}),W={number:w.footnoteIndex.get(y)??f.length+1,y:F,title:E,titleLines:R.title.map(C),description:_,style:Se("footnote",T.properties,w.styleCtx)};R.description.length>0&&(W.descriptionLines=R.description.map(C)),x!==void 0&&(W.region=x),f.push(W),d+=R.rows}};p(e,t);for(let g of i){if(g.footnotes.size===0)continue;let w=u+d*ms;d+=1;let x=f.length;p(g.footnotes,g.ctx,g.title),f[x].regionHeadingY=w}return{box:{x:o,y:s,width:a,height:f.length===0?0:Kf+d*ms+Bt},entries:f}}function LB(e,t,n,r){let i=r-n,o=RS(e,i,i),s=o.map((g,w)=>({x:n,row:w,text:g}));if(!t)return{title:s,description:[],rows:o.length};let a=se(IS,Yd),l=t.trim().split(/\s+/)[0]??"",c=n+Math.max(bB,e.length*NB),u=o.length===1&&a+se(l,Yd)<=r-c,f=u?c:n,d=u?o.length-1:o.length,p=RS(t,i,r-f-a),m=p.map((g,w)=>({x:w===0?f:n,row:d+w,text:w===0?`${IS}${g}`:g}));return{title:s,description:m,rows:d+p.length}}function RS(e,t,n){if(se(e,Yd)<=n)return[e];let r=wi(e,t,Yd,n);return r.length>0?r:[e]}function Ml(e,t,n){let r=[],i=(o,s,a)=>{let l=ve(re(s.properties,"date"));if(!l)return;let c=n.forwardWithinDomain(l);c!==null&&r.push({id:o,centerX:c,radius:6,title:s.title??o,fontSize:10,bold:a,date:l,isMilestone:a})};for(let[o,s]of e)i(o,s,!1);for(let[o,s]of t)i(o,s,!0);return r}function qd(e,t){return[...OB(e),...$B(t)]}function bs(e,t){let n=new Map;for(let[r,i]of e){let o=t+13+i.rowIndex*26;n.set(r,{rowIndex:i.rowIndex,centerY:o,labelBox:{...i.labelBox,y:o-4},labelSide:i.labelSide})}return n}function fx(e){return`nonworking:${e.from.toISOString().slice(0,10)}`}function dx(e){return`working:${e.from.toISOString().slice(0,10)}`}function bS(e,t,n){return{id:e,centerX:t,radius:0,title:n,fontSize:10,bold:!1}}function OB(e){let t=[];for(let n of e??[])n.label!==void 0&&t.push(bS(fx(n),n.x,n.label));return t}function $B(e){return(e??[]).map(t=>bS(dx(t),t.x,t.label))}function Bi(e,t,n,r){let i=n;for(let o of e){let s=NS(o,r),a=o.centerX+o.radius+6+s,l=o.centerX-o.radius-6-s;a>n&&l<t&&(i=Math.max(i,a+st))}return i}function NS(e,t){return t(e.title,e.fontSize)*(e.bold?1.05:1)}function Zd(e){let t=[];for(let n of e)for(let r of n.slackArrows??[])"marker"in r&&r.marker!==n.id&&t.push({from:r.marker,to:n.id});return t}function Ns(e,t,n,r,i=[]){let o=[...e].sort((u,f)=>u.centerX-f.centerX),s=new Map,a=[],l=new Map(e.map(u=>[u.id,u])),c=i.filter(u=>l.has(u.from)&&l.has(u.to));for(let u of o){let f=NS(u,r),d=u.centerX+u.radius+6,p=u.centerX-u.radius-6-f,m=d+f<=n,g=p>=t,w=u.centerX-u.radius,x=u.centerX+u.radius,y=A=>A==="right"?d:p,T=A=>A==="right"?m:g,E=c.filter(A=>A.from===u.id).map(A=>{let v=l.get(A.to);return{left:Math.min(u.centerX,v.centerX)+u.radius,right:Math.max(u.centerX,v.centerX)-v.radius}}).filter(A=>A.right>A.left),_=-1,R=Number.POSITIVE_INFINITY;for(let A of c){if(A.to===u.id){let v=s.get(A.from);v&&(R=Math.min(R,v.rowIndex))}if(A.from===u.id){let v=s.get(A.to);v&&(_=Math.max(_,v.rowIndex))}}let F=A=>{let v=y(A);return E.some(D=>D.left<v+f&&D.right>v)},C=A=>T(A)&&!F(A),W=C("right")?"right":C("left")?"left":m?"right":"left",j=(A,v)=>{let D=Math.min(w,A),L=Math.max(x,A+f),B=[{left:D,right:L},...E];return a[v].some(z=>B.some(G=>z.left<G.right&&z.right>G.left))},P=-1,S="right",b=d;e:for(let A=a.length-1;A>=0;A--)if(!(A<_||A>R))for(let v of["right","left"]){if(!C(v))continue;let D=y(v);if(!j(D,A)){P=A,S=v,b=D;break e}}if(P===-1&&_>=0&&_<R){let A=_+1;for(let[v,D]of s)D.rowIndex>=A&&s.set(v,{...D,rowIndex:D.rowIndex+1});a.splice(A,0,[]),P=A,S=W,b=y(S)}else if(P===-1){for(let[A,v]of s)s.set(A,{...v,rowIndex:v.rowIndex+1});a=[[],...a],P=0,S=W,b=y(S)}let $=Math.min(w,b),I=Math.max(x,b+f);a[P].push({left:$,right:I},...E),s.set(u.id,{rowIndex:P,labelBox:{x:b,y:0,width:f,height:12},labelSide:S})}return{placements:s,rowCount:a.length}}function px(e,t){let n=[];for(let r of e){let i=t.placedItems.get(r),o=t.entityRightEdges.get(r);if(o===void 0)continue;let s=i?ix(i,t.bandScale.bandwidth()):void 0;if(!i&&t.waves?.plan.index.has(r)){n.push({ref:r,endX:o,y:s,flowKey:`wave:${r}`,wave:r});continue}let a=t.itemFlowKey.get(r)??`marker:${r}`;if(!i&&t.markerIds.has(r)){n.push({ref:r,endX:o,y:s,marker:!0,flowKey:a});continue}n.push({ref:r,endX:o,y:s,flowKey:a})}return n}function hx(e){let t=new Map;for(let n of e){let r=t.get(n.flowKey);(!r||n.endX>r.endX)&&t.set(n.flowKey,n)}return Array.from(t.values())}function LS(e,t){return Math.abs(t-e.endX)<=12}function PS(e,t){return e.endX>=t||e.wave!==void 0?null:e.y!==void 0?{x:e.endX,y:e.y}:e.marker&&!LS(e,t)?{x:e.endX,marker:e.ref}:null}function CS(e){let t=null;for(let n of e)n.wave===void 0&&(!t||n.endX>t.endX)&&(t=n);return t}function DB(e,t,n){return e.y!==void 0?{x:e.endX,y:e.y}:e.marker?LS(e,t)?null:{x:e.endX,marker:e.ref}:{x:e.endX,marker:n}}function MB(e,t){let n;for(let r of e)r.wave===void 0||r.endX-t<It||(!n||r.endX>n.endX)&&(n=r);return n?.wave}var mx=class{constructor(t,n){M(this,"id");M(this,"milestone");this.id=t,this.milestone=n}place(t){let n=this.milestone,r=Se("milestone",n.properties,t.styleCtx),i=re(n.properties,"date"),o=Be(n.properties,"after"),s=ve(i),a=t.timeline.markerRow.y,l=6,c=n.title??this.id,u=null,f=a,d=!1,p,m=!1,g;if(s){let y=t.scale.forwardWithinDomain(s);if(y===null)return null;u=y,d=!0;let T=t.markerRowPlacements.get(this.id);T&&(f=T.centerY);let E=px(o,t),_=hx(E),R=CS(_);if(R&&R.endX>y){m=!0;let F=DB(R,y,this.id);F&&(p=[F])}g=MB(_,y),g!==void 0&&(m=!0)}else if(o.length>0){let y=px(o,t),T=hx(y);T.sort((R,F)=>F.endX-R.endX);let E=T[0]?.endX??t.timeline.originX;u=E,d=!1;let _=[];for(let R=1;R<T.length;R++){let F=PS(T[R],E);F&&_.push(F)}_.length>0&&(p=_)}if(u===null)return null;let w={x:u,y:f};t.entityLeftEdges.set(this.id,w.x),t.entityRightEdges.set(this.id,w.x),t.entityMidpoints.set(this.id,w);let x={id:this.id,title:c,x:u,radius:l,fixed:d,slackArrows:p,isOverrun:m,style:r,cutTopY:t.chartTopY,cutBottomY:t.swimlaneBottomY};return t.waves&&!m&&gS(t.waves,u)&&(x.onWaveBoundary=!0),g!==void 0&&s&&(x.overrunByWave=g,x.overrunDate=Ti(s)),s&&!t.scale.showsNonWorking&&!t.calendar.isWorkingDay(s)&&(x.hiddenDate=Ti(s)),x}};function Jd(e,t){let n=[];for(let[r,i]of e){let o=new mx(r,i).place(t);o&&n.push(o)}return n}function Qd(e,t){let n=r=>{let i=t.get(r);if(!i)throw new Error(`layout: marker "${r}" has no marker-row placement`);return i};return e.map(r=>{let i=n(r.id),o={id:r.id,title:r.title,center:{x:r.x,y:i.centerY},radius:r.radius,fixed:r.fixed,slackArrows:r.slackArrows?.map(s=>"y"in s?{x:s.x,y:s.y}:{x:s.x,y:n(s.marker).centerY}),isOverrun:r.isOverrun,style:r.style,cutTopY:r.cutTopY,cutBottomY:r.cutBottomY,labelBox:i.labelBox,labelSide:i.labelSide};return r.onWaveBoundary&&(o.onWaveBoundary=!0),r.overrunByWave!==void 0&&(o.overrunByWave=r.overrunByWave),r.overrunDate!==void 0&&(o.overrunDate=r.overrunDate),r.hiddenDate!==void 0&&(o.hiddenDate=r.hiddenDate),o})}function OS(e,t){let n=[];for(let[r,i]of e){let o=re(i.properties,"date"),s=Be(i.properties,"after"),a=ve(o),l=px(s,t),c=hx(l);if(a){let f=t.scale.forwardWithinDomain(a);if(f===null)continue;let d=CS(c);d&&d.endX>f&&d.y!==void 0&&n.push({xStart:Math.min(d.endX,f),xEnd:Math.max(d.endX,f),y:d.y,slackPredId:d.ref,milestoneId:r});continue}if(c.length===0)continue;c.sort((f,d)=>d.endX-f.endX);let u=c[0].endX;for(let f=1;f<c.length;f++){let d=c[f],p=PS(d,u);p&&"y"in p&&n.push({xStart:d.endX,xEnd:u,y:p.y,slackPredId:d.ref,milestoneId:r})}}return n}var Fl=16,FB=8,BB=6;function DS(e,t,n,r,i,o){gx(e.content.anchors,t);let s=Jd(e.content.milestones,t),a=WB(e.content.anchors,s,t);if(a.length===0)return{anchors:[],milestones:[],laneShift:0};let l=Fl,c=Ns(a,l,Bi(a,l,o-Fl,se),se,Zd(s)),u=n+FB,f=u+c.rowCount*26+BB-r,d=i+f,p=bs(c.placements,u);t.markerRowPlacements=p,t.chartTopY=r+f,t.swimlaneBottomY=d;let m=Ld(e.content.anchors,t,new Set),g=Qd(s.map(w=>({...w,cutTopY:t.chartTopY,cutBottomY:d,slackArrows:w.slackArrows?.map(x=>"y"in x?{x:x.x,y:x.y+f}:x)})),p);return{anchors:m,milestones:g,laneShift:f}}function MS(e,t){let n=[...(e.anchors??[]).map(i=>$S(i,!1)),...(e.milestones??[]).map(i=>$S(i,!0))];return n.length===0?t:Bi(n,e.box.x+Fl,t-Fl,se)+Fl}function FS(e){let t=0;for(let n of[...e.anchors??[],...e.milestones??[]])t=Math.max(t,n.labelBox.x+n.labelBox.width);return t}function WB(e,t,n){let r=Ml(e,new Map,n.scale),i=o=>({id:o.id,centerX:o.x,radius:o.radius,title:o.title,fontSize:10,bold:!0});return r.push(...t.filter(o=>o.fixed).map(i)),r.push(...t.filter(o=>!o.fixed).map(i)),r}function $S(e,t){return{id:e.id??"",centerX:e.center.x,radius:e.radius,title:e.title,fontSize:10,bold:t}}function gx(e,t){for(let n of Ml(e,new Map,t.scale))t.entityLeftEdges.set(n.id,n.centerX),t.entityRightEdges.set(n.id,n.centerX)}var XB=.8,UB=1;function GB(e){let t=[];return WS(e,t),t}function WS(e,t){for(let n of e)if(n.kind==="item"){let r=HB(n);r>0&&n.box.width>0&&t.push({startX:n.box.x,endX:n.box.x+n.box.width,load:r})}else(n.kind==="parallel"||n.kind==="group")&&WS(n.children,t)}function HB(e){return e.capacity?e.capacity.value:e.size?1:0}function XS(e){if(e.capacityValue<=0||e.warnFraction===null&&e.overFraction===null)return null;let t=GB(e.children);if(t.length===0)return null;let n=new Set;for(let s of t)n.add(s.startX),n.add(s.endX);let r=Array.from(n).sort((s,a)=>s-a);if(r.length<2)return null;let i=[];for(let s=0;s<r.length-1;s++){let a=r[s],l=r[s+1],c=(a+l)/2,u=0;for(let f of t)f.startX<=c&&c<f.endX&&(u+=f.load);i.push({startX:a,endX:l,load:u,classification:zB(u,e.capacityValue,e.warnFraction,e.overFraction)})}let o=[];for(let s of i){let a=o[o.length-1];a&&a.classification===s.classification&&a.endX===s.startX?a.endX=s.endX:o.push({...s})}return{segments:o,capacityValue:e.capacityValue,warnFraction:e.warnFraction,overFraction:e.overFraction}}function zB(e,t,n,r){let i=e/t;return r!==null&&i>=r?"red":n!==null&&i>=n?"yellow":"green"}function US(e,t){let n=t.get("swimlane"),r=BS(re(e.properties,"utilization-warn-at"),n?re(n.properties,"utilization-warn-at"):void 0,XB),i=BS(re(e.properties,"utilization-over-at"),n?re(n.properties,"utilization-over-at"):void 0,UB);return{warn:r,over:i}}function BS(e,t,n){let i=VB(e??t);return i.kind==="unset"?n:i.kind==="none"?null:i.value}var jB=/^\d+(?:\.\d+)?%$/,YB=/^\d+\.\d+$/;function VB(e){if(e===void 0)return{kind:"unset"};if(e==="none")return{kind:"none"};if(jB.test(e)){let t=parseFloat(e)/100;return Number.isFinite(t)&&t>0?{kind:"number",value:t}:{kind:"unset"}}if(YB.test(e)){let t=parseFloat(e);return Number.isFinite(t)&&t>0?{kind:"number",value:t}:{kind:"unset"}}return{kind:"unset"}}var ep=class{constructor(t){M(this,"rows");M(this,"opts");M(this,"paintedRightX");this.opts=t,this.paintedRightX=t.laneLeftX,this.rows=[{y:t.originY,height:t.minRowHeight,rightEdge:t.laneLeftX,spillX:t.laneLeftX}]}placeItem(t){let n=this.rows[this.rows.length-1],i=t.desiredStart>=n.rightEdge&&t.desiredStart>=n.spillX&&!this.rowIntersectsCorridor(n,t)&&!this.rowCrossesOwnCorridor(n,t)?n:this.appendRow(Math.max(this.opts.minRowHeight,t.predictedHeight));return{rowIndex:this.rows.length-1,y:i.y}}placeBlock(){let t=this.rows[this.rows.length-1];if(t.rightEdge>this.opts.laneLeftX){let n=this.appendRow(this.opts.minRowHeight);return{rowIndex:this.rows.length-1,y:n.y}}return{rowIndex:this.rows.length-1,y:t.y}}commitItem(t){let n=this.rows[t.rowIndex];n.height=Math.max(n.height,t.placed.box.height,t.rowHeight??0),n.rightEdge=t.logicalEnd,n.spillX=t.spillReservation??this.opts.laneLeftX}commitBlock(t){let n=this.rows[t.rowIndex];n.height=Math.max(n.height,t.blockHeight),n.rightEdge=t.blockEnd,n.spillX=t.spillReservation??this.opts.laneLeftX,t.paintedRight!==void 0&&t.paintedRight>this.paintedRightX&&(this.paintedRightX=t.paintedRight)}usedHeight(){let t=this.rows[this.rows.length-1];return t.y+t.height-this.opts.originY}usedRightX(){let t=this.paintedRightX;for(let n of this.rows)n.rightEdge>t&&(t=n.rightEdge),n.spillX>t&&(t=n.spillX);return t}rowIntersectsCorridor(t,n){return this.opts.slackCorridors.some(r=>r.y>=t.y&&r.y<t.y+t.height&&n.desiredStart<r.xEnd&&n.desiredEnd>r.xStart&&r.slackPredId!==n.childId&&!n.pendingIds?.has(r.slackPredId))}rowCrossesOwnCorridor(t,n){return this.opts.slackCorridors.some(r=>r.slackPredId===n.childId&&r.xStart<n.desiredStart&&t.rightEdge>Math.max(r.xStart,this.opts.laneLeftX))}appendRow(t){let n=this.rows[this.rows.length-1],r={y:n.y+n.height,height:t,rightEdge:this.opts.laneLeftX,spillX:this.opts.laneLeftX};return this.rows.push(r),r}};function yx(e){return Ke(e)?e.name?[e.name]:[]:_t(e).flatMap(yx)}function tp(e,t,n,r){let i=n.bandScale.step(),o=t.leftX,s=new ep({laneLeftX:o,originY:t.firstRowY,minRowHeight:i,slackCorridors:n.slackCorridors}),a=o,l=Number.POSITIVE_INFINITY,c=new Set(_t(e).flatMap(yx)),u=[];for(let f of _t(e)){for(let C of yx(f))c.delete(C);if(!Ke(f)){let C=Ol(f,a,n),{rowIndex:W,y:j}=s.placeBlock(),P=Dl(C,j),S=r.sequenceOne(f,P,n);u.push(S);let b=S.box.x+S.box.width,$=Math.max(i,P.height),I=HS(S);s.commitBlock({rowIndex:W,placed:S,blockHeight:$,blockEnd:b,spillReservation:I>b?I:null,paintedRight:Cl(S)}),l=Math.min(l,P.startX),a=Math.max(a,P.x);continue}let d=f,p=Ol(d,a,n),m=n.scale.startX(p),g=zd(d,m,n),w=m+g.naturalWidth,x=i+g.barExtra,{rowIndex:y,y:T}=s.placeItem({childId:d.name??"",desiredStart:m,desiredEnd:w,predictedHeight:x,pendingIds:c}),E=Dl(p,T),_=jd(d,E,n,g);u.push(_),l=Math.min(l,E.startX);let R=Math.max(m+g.naturalWidth,_.box.x+_.box.width),F=m+Ss(n,m,g.durationDays);a=Math.max(a,F),s.commitItem({rowIndex:y,placed:_,logicalEnd:R,spillReservation:GS(_),rowHeight:x})}return l===Number.POSITIVE_INFINITY&&(l=n.scale.startX(o)),{children:u,timeCursorX:a,timeStartX:l,packer:s}}function GS(e){return e.textSpills||e.chipsOutside||e.dotSpills||e.iconSpills||e.footnoteSpills?Math.max(e.decorationsRightX,e.chipsOutside?e.chipsRightX:0)+6:null}function HS(e){let t=e.box.x+e.box.width;if(e.kind==="item")return Math.max(t,GS(e)??t);let n=ys(e);return Math.max(t,n>t?n+Ek:t,...e.children.map(HS))}var xx=10;function KB(e,t,n){let r=re(e.properties,"capacity"),i=Sr(r);if(i===null)return{capacity:null,badgeWidthPx:0};let o=Qa(i),s=el(t.capacityIcon,n),a=tl(o,s,xx),l=nl(o,s,xx);return{capacity:{value:i,text:o,icon:s,...l!==void 0?{iconDxTerms:l}:{}},badgeWidthPx:a}}var qB=10,ZB=38,JB=8;function QB(e,t){let n=re(e.properties,"owner");if(!n)return;let r=t.teams.get(n);if(r)return{text:r.title??n,kind:"team"};let i=t.persons.get(n);return i?{text:i.title??n,kind:"person"}:{text:n,kind:"team"}}function eW(e,t){if(!e.name)return[];let n=[];for(let[r,i]of t.footnoteHosts.entries())if(i.includes(e.name)){let o=t.footnoteIndex.get(r);o!==void 0&&n.push(o)}return n.sort((r,i)=>r-i),n}function tW(e,t,n){for(let r of e.content)if(r.$type!=="DescriptionDirective")return n.scale.startX(Ol(r,t,n))}var Ls=class{constructor(t,n){M(this,"input");M(this,"helpers");this.input=t,this.helpers=n}get id(){return this.input.lane.name??""}place(t,n){let{lane:r,bandIndex:i}=this.input,{helpers:o}=this,s=Se("swimlane",r.properties,n.styleCtx),a=t.x,l=n.bandScale.step(),c=n.currentFlowKey;n.currentFlowKey=`lane:${r.name??i}`;let{capacity:u,badgeWidthPx:f}=KB(r,s,n.symbols),d=eW(r,n),p=d.length>0?se(d.join(","),xx):0,m=0,g=QB(r,n),w=r.title??r.name??"",x=w?vk(m,w,g?.text,f,p):null,y=x?.rightX??0,T=tW(r,a,n),E=!r.title||T===void 0||T>=y+JB,_=t.y+(E?qB:ZB),R=tp(r,{leftX:a,firstRowY:_},n,o),{children:F}=R,C=_-t.y,W=Math.max(l+32,C+R.packer.usedHeight()+16),j=Math.max(R.packer.usedRightX(),y),P={x:m,y:t.y,width:0,height:W},S=u?(()=>{let{warn:b,over:$}=US(r,n.styleCtx.defaults);return XS({children:F,capacityValue:u.value,warnFraction:b,overFraction:$})})():null;return n.currentFlowKey=c,{positioned:{id:r.name,title:w,box:P,bandIndex:i,children:F,nested:[],style:s,owner:g?.text,ownerKind:g?.kind,footnoteIndicators:d,capacity:u,tab:x,utilization:S},usedHeight:W,usedRightX:j}}};var nW=18,rW=14,iW=14,oW=16,sW=32;function Ex(e,t,n,r,i){let o=n+nW,s=[],a=[],l=!0,c=t.footnoteIndex.size;for(let u of e){l||(o+=oW),l=!1;let f=u.content.roadmap?.title??u.sourcePath,d=o+rW,p=Wd(u,{theme:t.styleCtx.theme,cal:t.cal,schedule:t.schedule,timeline:t.timeline,scale:t.scale,calendar:t.calendar,axisColumns:t.axisColumns,bandScale:t.bandScale,waves:t.waves},{chartTopY:d,chartBottomY:d,swimlaneBottomY:d},{footnotes:Vd(u.content.footnotes,c)});c+=u.content.footnotes.size,t.waves?Md(t.waves,p.entityLeftEdges,p.entityRightEdges):gx(u.content.anchors,p);let m=[],g=d,w=0;for(let R of u.content.swimlanes.values()){p.nextParallelId=0,p.nextGroupId=0;let{positioned:F,usedHeight:C}=new Ls({lane:R,bandIndex:w},r).place({x:p.timeline.originX,y:g},p);m.push(F),g+=C,w++}let x=DS(u,p,o,d,g,i);if(x.laneShift!==0){for(let R of m)Is(R,x.laneShift);g+=x.laneShift}let y=g,T=Math.max(t.bandScale.bandwidth(),y-o+iW),E={x:0,y:o,width:0,height:T},_={sourcePath:u.sourcePath,label:f,box:E,nestedSwimlanes:m,style:Se("swimlane",[],t.styleCtx)};x.anchors.length>0&&(_.anchors=x.anchors),x.milestones.length>0&&(_.milestones=x.milestones),s.push(_),a.push(p),o+=T}return{regions:s,contexts:a,endY:o}}function zS(e,t){let n=np(e,t);e.box.width=n;for(let r of e.nestedSwimlanes)r.box.width=n}function np(e,t){let n=e.box.x,{chromeRightX:r}=wl(n,e.label,e.sourcePath),i=Rs(e.nestedSwimlanes),o=Math.max(r,i,FS(e))+sW;return Math.min(t-n,o-n)}function jS(e,t,n,r){if(!e)return null;let i=t.scale.forwardWithinDomain(e);if(i===null)return null;let o=t.timeline.box.y,s=t.timeline.tickPanelY,a=Hn(n).nowLabel,l=se(a,hl),c=Math.max(Vg,Math.ceil(l+2*hs)),u=t.timeline.originX-st,f=c/2,d;i-f<u?d="flag-right":i+f>r?d="flag-left":d="center";let p=t.timeline.bottomTickPanelY,m=t.timeline.bottomTickPanelHeight??0,g=p!==void 0&&m>0?p+m:t.swimlaneBottomY;return{x:i,topY:s,bottomY:g,pillTopY:o,pillMode:d,label:a,pillWidth:c,style:Se("item",[],t.styleCtx)}}function rp(e){let t=e.trim().replace(/^#/,"");if(t.length===3&&(t=t.split("").map(n=>n+n).join("")),!/^[0-9a-fA-F]{6}$/.test(t))throw new Error(`Unsupported hex colour: ${e}`);return[Number.parseInt(t.slice(0,2),16),Number.parseInt(t.slice(2,4),16),Number.parseInt(t.slice(4,6),16)]}function YS(e){let[t,n,r]=rp(e).map(i=>{let o=i/255;return o<=.03928?o/12.92:((o+.055)/1.055)**2.4});return .2126*t+.7152*n+.0722*r}function ip(e,t){let n=YS(e),r=YS(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}var aW=4.5;function qS(e,t,n,r,i){if(!e.frozen||!e.solve)throw new Error("buildWaves: the wave barrier has not settled");let o=t.timeline.waveStrip;if(!o)throw new Error("buildWaves: the timeline has no wave strip");let s=Dd(e.plan,e.solve,e.pass,e.origin,e.floors,It),a=s.every(E=>E.memberCount===0),l=t.timeline.box.x,c=l+t.timeline.box.width,u=o.y+o.height/2,f=o.y+Si,d=o.height-2*Si,p=[],m=0,g=s.map((E,_)=>{let R=e.plan.waves[_],F=R.title??E.id,C=E.memberCount===0,W=Fd(E.start,t),j=yS(E.start,E.end,t),P=C?void 0:m++,S=cW(E.id,t),b=uW(R.properties,P,t),$=Math.max(E.start,l),I=Math.min(E.end,c),A=Math.max(0,I-$),v,D=!1;if(!C){if(S.length>0){let U=S.length*Mt;v=VS(F,E.id,_+1,A,U),D=v!==void 0}v??(v=VS(F,E.id,_+1,A,0))}let L=($+I)/2,B;if(C&&(L=E.start,!a)){let U=p.filter(K=>Math.abs(K-E.start)<It).length;p.push(E.start),L=E.start+U*py,B={x:L,y:u}}let z=C?wx(W):`${wx(W)} \u2013 ${wx(j)}`,G=[F,z];C?G.push(n.waveNoItems):E.heldBy!==void 0&&G.push(`${n.waveHeldBy} ${E.heldBy}`);let ee,Y=s[_-1];if(!a&&Y!==void 0&&E.floorRef!==void 0&&E.start-Y.end>It){let U=Math.max(Y.end,l),K=Math.min(E.start,c),q=se(E.floorRef,yn);if(q+2*Dr<=K-U){let J=(U+K)/2,ie=q+2*Mr;ee={text:E.floorRef,x:J,halo:{x:J-ie/2,y:f,width:ie,height:d}}}}let ne={x:E.start,y:o.y,width:E.end-E.start,height:o.height},k=C?void 0:lW(ne,t.timeline.box),O,X;if(k){let U=k.x+k.width,K=D?S.length*Mt:0;if(K){let q=U-Dr+Mr,J=U-Dr-K-Mr;X={rightX:U-Dr,halo:{x:J,y:f,width:q-J,height:d}}}if(v){let q=ZS(v.label),J=K?Math.min(L,U-Dr-K-q/2):L,ie=q+2*Mr;O={x:J,halo:{x:J-ie/2,y:f,width:ie,height:d}}}}return{id:E.id,title:F,index:_,...P!==void 0?{visibleOrdinal:P}:{},startX:E.start,endX:E.end,startDate:W,endDate:j,memberCount:E.memberCount,empty:C,...E.heldBy!==void 0?{heldBy:E.heldBy}:{},...E.floorRef!==void 0?{floorRef:E.floorRef}:{},columnBox:{x:E.start,y:t.chartTopY,width:E.end-E.start,height:t.swimlaneBottomY-t.chartTopY},strip:{box:{x:E.start,y:o.y,width:E.end-E.start,height:o.height},...v?{label:v.label}:{},labelKind:v?.kind??"none",labelX:L,...k?{cell:k}:{},...O?{labelDraw:O}:{},...X?{superscripts:X}:{},tooltip:G.join(" \xB7 "),footnotesShown:D,...B?{marker:B}:{},...ee?{gapLabel:ee}:{}},style:b,footnoteIndicators:S}}),w=a?[]:pW(g,e.origin,o.y,t),x=Tx(r),y=i.map(E=>Tx(E.nestedSwimlanes)),T={waves:g,boundaries:w,crossings:KS(x,w),regionCrossings:y.map(E=>KS(E,w)),hasBackground:x.length+y.flat().length>0};return a&&(T.placeholder=XR(n,g.map(E=>E.title))),T}function lW(e,t){let n=bi,r={x:e.x,y:e.y+n,width:e.width,height:e.height-2*n},i={x:t.x+n,y:e.y,width:t.width-2*n,height:e.height},o=Math.max(r.x,i.x),s=Math.max(r.y,i.y),a=Math.min(r.x+r.width,i.x+i.width),l=Math.min(r.y+r.height,i.y+i.height);if(!(a<=o||l<=s))return{x:o,y:s,width:a-o,height:l-s}}function ZS(e){return se(e,yn)*1.05}function VS(e,t,n,r,i){let o=a=>ZS(a)+i+2*Dr<=r;if(o(e))return{kind:"title",label:e};if(t!==e&&o(t))return{kind:"id",label:t};for(let a=e.length-1;a>=3;a--){let l=e.slice(0,a).trimEnd();if(l.length<3)break;let c=`${l}\u2026`;if(o(c))return{kind:"ellipsis",label:c}}let s=`#${n}`;if(o(s))return{kind:"ordinal",label:s}}function cW(e,t){let n=[];for(let[r,i]of t.footnoteHosts.entries()){if(!i.includes(e))continue;let o=t.footnoteIndex.get(r);o!==void 0&&n.push(o)}return n.sort((r,i)=>r-i)}function uW(e,t,n){let r=n.styleCtx.theme,i=new Map,o=re(e,"style"),s=o?n.styleCtx.styles.get(o):void 0;for(let d of s?.properties??[])i.set(Q(d),d.value);let a=d=>{let p=i.get(d);if(p===void 0)return;let m=Vn(p,r);return m==="none"?void 0:m},l=a("bg"),c=t!==void 0&&t%2===1?r.wave.stripFillAlt:r.wave.stripFill,u=l?fW(c,l,yl)??c:c,f=i.get("border");return{...l?{tint:l}:{},stripFill:c,text:a("text")??dW(r.wave,u),boundary:a("fg")??r.wave.boundary,boundaryDash:f==="dashed"?"4 2":f==="dotted"?"1 2":null}}var op=/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;function fW(e,t,n){if(!op.test(e)||!op.test(t))return;let r=rp(e),i=rp(t);return`#${r.map((o,s)=>Math.round(o*(1-n)+i[s]*n).toString(16).padStart(2,"0")).join("")}`}function dW(e,t){let n=e.labelText;return!op.test(n)||!op.test(t)||ip(n,t)>=aW?n:ip(e.hatch,t)>=ip(e.hatchOnDark,t)?e.hatch:e.hatchOnDark}function pW(e,t,n,r){let i=[];for(let a of e)a.empty||(i.push({x:a.startX,wave:a,opening:!0}),i.push({x:a.endX,wave:a,opening:!1}));i.sort((a,l)=>a.x-l.x);let o=[],s=0;for(;s<i.length;){let a=s;for(;a<i.length&&i[a].x-i[s].x<It;)a++;let l=i.slice(s,a);s=a;let c=l[0].x;if(Math.abs(c-t)<It)continue;let u=(l.find(f=>f.opening)??l[0]).wave;o.push({x:c,topY:n,bottomY:r.swimlaneBottomY,stroke:u.style.boundary,dash:u.style.boundaryDash})}return o}function Tx(e){let t=[],n=r=>{for(let i of r)i.kind==="item"?i.waveRole==="background"&&t.push(i):n(i.children)};for(let r of e)n(r.children),t.push(...Tx(r.nested));return t}function KS(e,t){let n=[];for(let r of e){let i=r.box.x,o=r.box.x+r.box.width;for(let s of t)i<s.x&&s.x<o&&n.push({x:s.x,topY:r.box.y,bottomY:r.box.y+r.box.height,stroke:s.stroke})}return n}var hW="\u2070\xB9\xB2\xB3\u2074\u2075\u2076\u2077\u2078\u2079";function mW(e){return String(e).replace(/[0-9]/g,t=>hW[Number(t)])}function JS(e,t,n,r,i){let{waves:o}=e,s=o.some(_=>!_.empty&&_.strip.labelKind!=="title"),a=o.some(_=>_.empty),l=o.some(_=>_.footnoteIndicators.length>0&&!_.strip.footnotesShown);if(!e.hasBackground&&!s&&!a&&!l)return;let c=yn,u=_=>se(_,c),f=t.timeline.originX,d=Math.max(f,i-st),p=0,m=f,g=!1,w=0,x=_=>r+_*xl+od,y=_=>{g&&m+id+_>d&&(p++,m=f,g=!1);let R=g?m+id:m;return m=R+_,g=!0,w=Math.max(w,m-f),R},T=[],E=(_,R)=>{let F=nd+hy,C=y(F+u(R)),W=x(p);T.push({kind:_,text:R,swatch:{x:C,y:W-od+(xl-rd)/2,width:nd,height:rd},..._==="background"?{hatch:Bd(t.styleCtx.theme.entities.item.bg)}:{},runs:[{text:R,x:C+F,y:W}]})};if(e.hasBackground&&E("background",n.waveLegendBackground),e.boundaries.length>0&&E("boundary",n.waveLegendBoundary),s||a||l){let _=o.map(W=>{let j=`#${W.index+1} ${W.title}`;return W.footnoteIndicators.length>0&&!W.strip.footnotesShown&&(j+=` ${W.footnoteIndicators.map(mW).join(",")}`),W.empty&&(j+=` (${n.waveNoItems})`),j}),R=" \xB7 ",F=`${n.waveLegendPrefix} ${_[0]}`,C=[{text:F,x:y(u(F)),y:x(p)}];for(let W of _.slice(1)){let j=C[C.length-1];m+u(R+W)<=d?(j.text+=R+W,m+=u(R+W),w=Math.max(w,m-f)):(p++,m=f,g=!1,C.push({text:W,x:y(u(W)),y:x(p)}))}T.push({kind:"waves",text:`${n.waveLegendPrefix} ${_.join(R)}`,runs:C})}return{box:{x:f,y:r,width:w,height:(p+1)*xl},entries:T}}function wx(e){return e.toISOString().slice(0,10)}var QS=1e-6,Ps=class{constructor(t){M(this,"domain");M(this,"range");M(this,"pixelsPerDay");M(this,"calendar");M(this,"nonWorking");this.domain=t.domain,this.range=t.range,this.calendar=t.calendar,this.nonWorking=t.nonWorking??"hide";let n=Math.max(1,this.showsNonWorking?At(t.domain[0],t.domain[1]):this.indexOf(t.domain[1]));this.pixelsPerDay=(t.range[1]-t.range[0])/n}get showsNonWorking(){return this.nonWorking==="show"&&this.calendar?.hasNonWorkingDays===!0}indexOf(t){return this.calendar?this.calendar.workingIndexOf(this.domain[0],t):At(this.domain[0],t)}dayAt(t){let n=(t-this.range[0])/this.pixelsPerDay;return{days:n,day:Math.floor(n+QS)}}forward(t){return this.showsNonWorking?this.range[0]+At(this.domain[0],t)*this.pixelsPerDay:this.range[0]+this.indexOf(t)*this.pixelsPerDay}forwardWithinDomain(t){return t<this.domain[0]||t>this.domain[1]?null:this.forward(t)}invert(t){let n=Math.round((t-this.range[0])/this.pixelsPerDay);return this.showsNonWorking?Xe(this.domain[0],n):this.calendar?this.calendar.dateAtWorkingIndex(this.domain[0],n):Xe(this.domain[0],n)}indexAtX(t){let{days:n,day:r}=this.dayAt(t);if(!this.showsNonWorking||!this.calendar)return n;let i=Xe(this.domain[0],r),o=this.calendar.workingIndexOf(this.domain[0],i);return this.calendar.isWorkingDay(i)?o+Math.max(0,n-r):o}startX(t){if(!this.showsNonWorking||!this.calendar)return t;let n=Xe(this.domain[0],this.dayAt(t).day);if(this.calendar.isWorkingDay(n))return t;let r=this.calendar.workingIndexOf(this.domain[0],n);return this.forward(this.calendar.dateAtWorkingIndex(this.domain[0],r))}advanceX(t,n){if(!this.showsNonWorking||!this.calendar)return t+n*this.pixelsPerDay;let r=this.startX(t);if(n<=0)return r;let i=this.indexAtX(r)+n,o=Math.ceil(i-QS)-1,s=i-o,a=this.calendar.dateAtWorkingIndex(this.domain[0],o);return this.forward(a)+s*this.pixelsPerDay}get originX(){return this.range[0]}get widthPx(){return this.range[1]-this.range[0]}};var sp=6,yW=4,eb=8,lp=class{constructor(t){M(this,"input");this.input=t}measure(){let{title:t,author:n,style:r,logo:i}=this.input,o=r.headerPosition==="beside",s=xW(t,n,i),a=i?Math.max(Jg,i.height+20):Jg;return{position:r.headerPosition,titleLines:s.titleLines,authorLines:s.authorLines,cardWidth:s.cardWidth,cardHeight:s.cardHeight,textCardHeight:s.textCardHeight,logoSlot:s.logoSlot,...i?{logo:i}:{},chartLeftX:o?s.boxWidth:0,aboveHeight:a,chartTopY:o?eb:a+eb,minRowsBottomY:o?s.cardHeight+yW:0}}place(t,n){let{title:r,author:i,style:o}=this.input,s=t.position==="beside",a=s?{x:0,y:0,width:t.chartLeftX,height:n.chartBottomY}:{x:0,y:0,width:n.canvasRightX,height:t.aboveHeight},l=s?{x:sp,y:n.rowsBottomY-t.cardHeight,width:t.cardWidth,height:t.cardHeight}:{x:0,y:0,width:n.canvasRightX,height:t.aboveHeight},c,u;return t.logo&&(c={box:{x:a.x+l.x+16,y:a.y+l.y+(l.height-t.logo.height)/2,width:t.logo.width,height:t.logo.height},assetRef:t.logo.assetRef,intrinsic:t.logo.intrinsic},u={x:t.logoSlot,y:Math.max(0,(l.height-t.textCardHeight)/2)}),{box:a,position:o.headerPosition,title:r,author:i,titleLines:t.titleLines,authorLines:t.authorLines,cardBox:l,logo:c,...u?{textInset:u}:{},style:o}}};function xW(e,t,n){let r=Zg-32,i=wi(e,r,16),o=wi(t??"",r,11),s=0;for(let w of i)s=Math.max(s,se(w,16));for(let w of o)s=Math.max(s,se(w,11));let a=i.length>0||o.length>0,l=n?n.width+(a?12:0):0,c=s+32,u=Math.max(pk-sp,Math.min(Zg-sp,c)+l),f=i.length>0?(i.length-1)*20:0,d=o.length>0?18+(o.length-1)*14:0,p=26+f+d+14,m=n?Math.max(p,n.height+20):p,g=u+sp;return{titleLines:i,authorLines:o,cardWidth:u,cardHeight:m,textCardHeight:p,logoSlot:l,boxWidth:g}}var EW=8;function rb(e,t,n,r,i){let{locale:o,styleCtx:s}=r,{calendar:a,preset:l,startDate:c,timelineDays:u,nonWorking:f}=i,d=i.naturalEndDate,p=i.schedule.plan,m=r.roadmapStyle,g=cl[m.headerHeight]??cl.md,w=g>0&&m.timelinePosition!=="bottom",x=g>0&&(m.timelinePosition==="bottom"||m.timelinePosition==="both"),y=e.roadmapDecl?.title??e.roadmapDecl?.name??"",T=re(e.roadmapDecl?.properties??[],"author"),E=new lp({title:y,author:T,style:m,logo:kk(e,n.logo)}),_=E.measure(),{chartLeftX:R}=_,F=nk({naturalPixelsPerDay:l.pixelsPerUnit/a.daysPerUnit(l.unit),dayCount:u,chromeWidth:R+2*st,maxWidth:n.width}),C=u*F,W=R+st,j=C,S=n.today!==void 0&&n.today>=c&&n.today<=d?Ft:0,b=w?g:0,$=p?sy:0,I=new Ps({domain:[c,d],range:[W,W+C],calendar:a,nonWorking:f}),A=qd(Qy(I,[],l.unit,!1),ex(I)),v=t.content.anchors.size+t.content.milestones.size>0||A.length>0,D=W+j+st,L=Ml(t.content.anchors,t.content.milestones,I),B=[...L,...A],z=Ns(B,R,Bi(B,R,D,se),se),G=v?Math.max(1,z.rowCount):0,ee=G*26,Y=S+b+$+ee,ne=Y+EW,k=Ix(_,Y),O=k+S,X=O+b,U=X+$,K=Sd(I,l,a,o),q={box:{x:W,y:k,width:C,height:0},ticks:K,pixelsPerDay:F,originX:W,startDate:c,endDate:d,labelStyle:Se("roadmap",[],s),pillRowHeight:S,tickPanelY:O,tickPanelHeight:b,markerRow:{y:U+13,height:ee,collisionY:U-8},minorGrid:m.minorGrid,...p?{waveStrip:{y:X,height:$}}:{}};return Rx(q,I,l.unit),{header:_,headerNode:E,axis:{originX:W,ppd:F,naturalWidth:C,scale:I},naturalChartRightX:D,bands:{timelineY:k,pillRowHeight:S,tickPanelY:O,tickPanelHeight:b,waveStripY:X,markerRowY:U,estimatedMarkerRows:G,rowsHeight:Y,chartTopY:k+ne,bottomTickPanelHeight:x?g:0},timeline:q,markers:{datePinned:L,placements:bs(z.placements,U),hasEntities:v}}}function Ix(e,t){return Math.max(e.chartTopY,e.minRowsBottomY-t)}function Rx(e,t,n){let r=Qy(t,e.ticks,n,e.minorGrid);r&&(e.nonWorkingDisplay=t.showsNonWorking?"show":"hide",e.nonWorking=r);let i=ex(t);i&&(e.workingExceptions=i)}var ib=8,Sx=class{constructor(t){M(this,"rightX");M(this,"frozen",!1);this.rightX=t}grow(t){if(this.frozen)throw new Error("layout: the canvas grew after it was frozen");return t<=this.rightX?!1:(this.rightX=t,!0)}freeze(){this.frozen=!0}get provisional(){return this.rightX}get final(){if(!this.frozen)throw new Error("layout: the canvas was read before it was final");return this.rightX}},wW;var cp=class{constructor(t,n,r,i,o,s,a){M(this,"file");M(this,"resolved");M(this,"options");M(this,"scope");M(this,"window");M(this,"measured");M(this,"chart");M(this,"canvas");M(this,"chartY");M(this,"draft",{});M(this,"scaleIsFinal",!1);M(this,"band");M(this,"rowsTop");M(this,"rowsBottom");M(this,"why");this.file=t,this.resolved=n,this.options=r,this.scope=i,this.window=o,this.measured=s,this.chart=a,this.canvas=new Sx(s.naturalChartRightX);let l=a.ctx;this.chartY={get top(){return l.chartTopY},set top(c){l.chartTopY=c},get swimlaneBottom(){return l.swimlaneBottomY},set swimlaneBottom(c){l.swimlaneBottomY=c},get bottom(){return l.chartBottomY},set bottom(c){l.chartBottomY=c}}}get ctx(){return this.chart.ctx}get scale(){return this.chart.ctx.scale}finalScale(){if(!this.scaleIsFinal)throw new Error("layout: the final scale was read before the timeline extension");return this.chart.ctx.scale}extendScale(t){if(this.scaleIsFinal)throw new Error("layout: the scale was extended after it was final");this.chart.ctx.scale=t}settleScale(){this.scaleIsFinal=!0}markerBand(){if(!this.band)throw new Error("layout: the marker band was read before the final pack");return this.band}setMarkerBand(t){if(this.band)throw new Error("layout: the marker band was packed twice");this.band=t,this.chart.ctx.markerRowPlacements=t.placements}headerRowsTop(){return this.rowsTop||(this.rowsTop=TW(this.measured,this.options.today,this.finalScale())),this.rowsTop}headerRowsBottom(){if(this.rowsBottom===void 0)throw new Error("layout: the header rows bottom was read before the rows grew");return this.rowsBottom}setHeaderRowsBottom(t){if(this.rowsBottom!==void 0)throw new Error("layout: the header rows grew twice");this.rowsBottom=t}explain(t){this.why=t}report(t,n){wW?.(t,n,this.why),this.why=void 0}};function TW(e,t,n){let{bands:r,header:i}=e;if(!(r.pillRowHeight===0&&t!==void 0&&n.forwardWithinDomain(t)!==null))return{timelineY:r.timelineY,pillRowHeight:r.pillRowHeight,tickPanelY:r.tickPanelY,markerRowY:r.markerRowY,shift:0};let s=Ix(i,Ft+r.rowsHeight),a=s+Ft,l=a-r.tickPanelY;return{timelineY:s,pillRowHeight:Ft,tickPanelY:a,markerRowY:r.markerRowY+l,shift:l}}function _W(e){return e.canvas.grow(e.chart.maxRightX+st)}function vW(e){let{swimlanes:t,includes:n,milestones:r}=e.chart,{calendar:i,preset:o,startDate:s,spanDays:a,nonWorking:l}=e.window,{originX:c,ppd:u}=e.measured.axis,f=e.measured.timeline,d=Rs(t);for(let R of n)d=Math.max(d,Rs(R.nestedSwimlanes));let p=0;for(let R of e.measured.markers.datePinned)p=Math.max(p,R.centerX+R.radius);let m=0;for(let R of r)R.fixed?p=Math.max(p,R.x+R.radius):m=Math.max(m,R.x+R.radius);for(let R of n){for(let F of R.anchors??[])p=Math.max(p,F.center.x+F.radius);for(let F of R.milestones??[])F.fixed?p=Math.max(p,F.center.x+F.radius):m=Math.max(m,F.center.x+F.radius)}let g=Math.max(d,p,m),w=i.daysPerUnit(o.unit),x=e.scale.showsNonWorking?e.scale.indexAtX(g):(g-c)/u,y=x>0?Mi(s,x,o.unit,w,i):0,T=Pd(t);for(let R of n)T=Math.max(T,Pd(R.nestedSwimlanes));let E=new ks(e.window,e.scale);if(T>0){let R=Math.max(a,y);E.isPast(T,R)&&(y=Math.max(y,Math.min(E.boundaryAtOrAfterX(T),E.captionColumn(R).end)))}let _=!1;if(y>a){let R={bar:d,caption:T,datedMarker:p,afterMilestone:m};e.explain(Object.keys(R).filter(j=>R[j]>0&&E.isPast(R[j],a)));let F=i.dateAtWorkingIndex(s,y),C=e.scale.showsNonWorking?At(s,F)*u:y*u,W=new Ps({domain:[s,F],range:[c,c+C],calendar:i,nonWorking:l});e.extendScale(W),f.endDate=F,f.box.width=C,f.ticks=Sd(W,o,i,e.scope.locale),Rx(f,W,o.unit),e.canvas.grow(c+C+st),_=!0}return e.settleScale(),_}function AW(e){let t=e.measured.timeline,n=e.measured.markers.datePinned.map(s=>({id:s.id,centerX:s.centerX,radius:s.radius,title:s.title,fontSize:s.fontSize,bold:s.bold}));for(let s of e.chart.milestones)s.fixed||n.push({id:s.id,centerX:s.x,radius:s.radius,title:s.title,fontSize:10,bold:!0});let r=qd(t.nonWorking,t.workingExceptions);n.push(...r),e.draft.markerEntries={all:n,calendarCount:r.length};let i=Bi(n,e.measured.header.chartLeftX,e.canvas.provisional,se);for(let s of e.chart.includes)i=Math.max(i,MS(s,e.canvas.provisional));let o=e.canvas.grow(i);return e.canvas.freeze(),o}function kW(e){let t=e.canvas.final,n=e.measured.naturalChartRightX,r=e.chart.swimlanes.length>0&&t!==n;for(let i of e.chart.swimlanes)i.box.width=t;for(let i of e.chart.includes)np(i,t)!==np(i,n)&&(r=!0),zS(i,t);return r}function IW(e){let t=Xt(e.draft.markerEntries,"the marker entries"),n=Ns(t.all,e.measured.header.chartLeftX,e.canvas.final,se,Zd(e.chart.milestones)),r=bs(n.placements,e.headerRowsTop().markerRowY),i=e.measured.markers.hasEntities||t.calendarCount>0?Math.max(1,n.rowCount):0;e.setMarkerBand({rowCount:i,placements:r});let o=!1;for(let[s,a]of e.measured.markers.placements){let l=r.get(s);(!l||!WW(a,l))&&(o=!0)}return o}function RW(e){let t=e.markerBand(),n=e.ctx,r=e.measured.timeline,i=Qd(e.chart.milestones,t.placements),o=i.some(s=>n.entityMidpoints.get(s.id??"")?.y!==s.center.y);for(let s of r.nonWorking??[]){if(s.label===void 0)continue;let a=t.placements.get(fx(s));a&&(s.labelBox=a.labelBox,s.labelSide=a.labelSide)}for(let s of r.workingExceptions??[]){let a=t.placements.get(dx(s));a&&(s.labelBox=a.labelBox,s.labelSide=a.labelSide)}for(let s of e.measured.markers.datePinned){let a=t.placements.get(s.id);a&&n.entityMidpoints.set(s.id,{x:s.centerX,y:a.centerY})}for(let s of i)s.fixed||n.entityMidpoints.set(s.id??"",{x:s.center.x,y:s.center.y});return e.draft.milestones=i,o}function SW(e){let t=e.markerBand(),n=e.headerRowsTop(),r=e.measured.bands,i=r.estimatedMarkerRows,s=e.ctx.timeline,a=!1;n.pillRowHeight!==r.pillRowHeight&&(s.box.y=n.timelineY,s.pillRowHeight=n.pillRowHeight,s.tickPanelY=n.tickPanelY,s.waveStrip&&(s.waveStrip.y+=n.shift),s.markerRow.y+=n.shift,s.markerRow.collisionY+=n.shift,a=!0);let l=n.shift;t.rowCount>i&&(l+=(t.rowCount-i)*26,s.markerRow.height=t.rowCount*26,a=!0),e.setHeaderRowsBottom(n.markerRowY+s.markerRow.height);let c=r.chartTopY+l;e.chartY.top=c,e.chartY.bottom+=c,e.chartY.swimlaneBottom+=c,s.box.height=e.chartY.bottom-s.box.y;for(let d of e.chart.swimlanes)Is(d,c);for(let d of e.chart.includes)nS(d,c);let u=e.chart.milestones,f=Xt(e.draft.milestones,"the milestones");for(let d=0;d<f.length;d++)rS(f[d],u[d],c);return a}function bW(e){let t=e.measured.bands.bottomTickPanelHeight;return t<=0?!1:(e.ctx.timeline.bottomTickPanelY=e.chartY.bottom+ib,e.ctx.timeline.bottomTickPanelHeight=t,e.chartY.bottom+=ib+t,!0)}function NW(e){e.finalScale();let t=e.ctx;if(!t.waves)return!1;let n=qS(t.waves,t,Hn(e.scope.locale),e.chart.swimlanes,e.chart.includes);return n.regionCrossings.forEach((r,i)=>{r.length>0&&(e.chart.includes[i].waveCrossings=r)}),n.placeholder!==void 0&&t.timeline.waveStrip&&(t.timeline.waveStrip.placeholder=n.placeholder),e.draft.waves=n,!0}function LW(e){e.finalScale(),e.markerBand();let t=new Set(Xt(e.draft.milestones,"the milestones").map(r=>r.center.x)),n=Ld(e.resolved.content.anchors,e.ctx,t);return e.draft.anchors=n,n.length>0}function PW(e){let t=cx(e.chart.laneEntries),n=ux(t,e.chart.swimlanes,e.chart.includes,e.ctx);e.draft.edges=n;let r=0;return e.resolved.content.isolatedRegions.forEach((i,o)=>{let s=e.chart.includes[o],a=e.chart.regionContexts[o];if(!s||!a)return;let l=ux(cx([...i.content.swimlanes.values()]),s.nestedSwimlanes,[],a);l.length>0&&(s.edges=l),r+=l.length}),n.length+r>0}function CW(e){e.finalScale();let t=jS(e.options.today,e.ctx,e.scope.locale,e.canvas.final);return e.draft.nowline=t,t!==null}function OW(e){let t=e.draft.waves;if(!t)return!1;let n=JS(t,e.ctx,Hn(e.scope.locale),e.chartY.bottom+td,e.canvas.final);return n?(e.chartY.bottom+=td+n.box.height,e.draft.waveLegend=n,!0):!1}function $W(e){let t=e.resolved.content.isolatedRegions.flatMap((r,i)=>{let o=e.chart.regionContexts[i],s=e.chart.includes[i];return o&&s?[{title:s.label,footnotes:r.content.footnotes,ctx:o}]:[]}),n=SS(e.resolved.content.footnotes,e.ctx,e.chartY.bottom,e.canvas.final,t);return e.draft.footnotes=n,n.entries.length>0}function DW(e){let{header:t,headerNode:n}=e.measured;return e.draft.header=n.place(t,{rowsBottomY:e.headerRowsBottom(),chartBottomY:e.chartY.bottom,canvasRightX:e.canvas.final}),t.position==="beside"}function MW(e){let t=Xt(e.draft.footnotes,"the footnote panel"),n=e.canvas.final,r=t.entries.length>0?t.box.y+t.box.height:e.chartY.bottom,i={x:n-st-ry,y:r+st,width:ry,height:mk};return e.draft.attributionBox=i,e.draft.height=i.y+i.height+st,!0}var FW=[{name:"growCanvasForSpill",reads:["placement"],writes:["canvas"],run:_W},{name:"extendTimeline",reads:["placement","window","scale"],writes:["scale","timeline","calendarRuns","canvas"],run:vW},{name:"growCanvasForMarkerLabels",reads:["placement","calendarRuns","canvas"],writes:["markerEntries","canvas"],run:AW},{name:"fitWidths",reads:["placement","canvas"],writes:["laneWidths"],run:kW},{name:"packMarkers",reads:["placement","canvas","markerEntries","headerBands","scale"],writes:["markerBand"],run:IW},{name:"placeMarkers",reads:["placement","markerBand","calendarRuns"],writes:["milestones","calendarLabels","markerMidpoints"],run:RW},{name:"growHeaderRows",reads:["placement","markerBand","headerBands","scale","milestones","chartTop","laneBottom"],writes:["chartTop","rowsBottom","laneBottom","chartBottom","laneY","milestones","timeline"],run:SW},{name:"bottomTickPanel",reads:["headerBands","chartBottom"],writes:["chartBottom","timeline"],run:bW},{name:"waves",reads:["scale","chartTop","laneBottom","timeline","laneY"],writes:["waves","timeline"],run:NW},{name:"anchors",reads:["scale","markerBand","chartTop","laneBottom","milestones"],writes:["anchors","markerMidpoints"],run:LW},{name:"dependencyEdges",reads:["laneY","markerMidpoints"],writes:["edges"],run:PW},{name:"nowline",reads:["scale","canvas","laneBottom","timeline"],writes:["nowline"],run:CW},{name:"waveLegend",reads:["waves","canvas","chartBottom"],writes:["legend","chartBottom"],run:OW},{name:"footnotePanel",reads:["chartBottom","canvas"],writes:["footnotes"],run:$W},{name:"header",reads:["chartBottom","canvas","rowsBottom"],writes:["header"],run:DW},{name:"attribution",reads:["footnotes","chartBottom","canvas"],writes:["attribution"],run:MW}];function ob(e,t=FW){for(let n of t)e.report(n.name,n.run(e));return BW(e)}function BW(e){let{draft:t}=e,{themeName:n,theme:r}=e.scope,{swimlanes:i,includes:o,waveSolve:s}=e.chart,a=e.canvas.final,l=e.measured.header.chartLeftX,c=t.waves,u=t.waveLegend;return{width:a,height:Xt(t.height,"the canvas height"),theme:n,palette:r,backgroundColor:r.surface.page,header:{...Xt(t.header,"the header"),attributionBox:Xt(t.attributionBox,"the attribution box")},timeline:e.measured.timeline,nowline:Xt(t.nowline,"the now-line"),swimlanes:i,anchors:Xt(t.anchors,"the anchors"),milestones:Xt(t.milestones,"the milestones"),edges:Xt(t.edges,"the edges"),footnotes:Xt(t.footnotes,"the footnote panel"),includes:o,chartBox:{x:l,y:e.chartY.top,width:a-l,height:e.chartY.bottom-e.chartY.top},...s?{waveSolve:s}:{},...c?{waves:c.waves}:{},...c&&c.boundaries.length>0?{waveBoundaries:c.boundaries}:{},...c&&c.crossings.length>0?{waveCrossings:c.crossings}:{},...u?{waveLegend:u}:{}}}function Xt(e,t){if(e===void 0)throw new Error(`layout: ${t} was read before its step ran`);return e}function WW(e,t){return e.rowIndex===t.rowIndex&&e.centerY===t.centerY&&e.labelSide===t.labelSide&&e.labelBox.x===t.labelBox.x&&e.labelBox.y===t.labelBox.y&&e.labelBox.width===t.labelBox.width&&e.labelBox.height===t.labelBox.height}var Cs=class extends Map{constructor(t,n=GW){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(let[r,i]of t)this.set(r,i)}get(t){return super.get(sb(this,t))}has(t){return super.has(sb(this,t))}set(t,n){return super.set(XW(this,t),n)}delete(t){return super.delete(UW(this,t))}};function sb({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function XW({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function UW({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function GW(e){return e!==null&&typeof e=="object"?e.valueOf():e}function up(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r<i;)o[r]=e+r*n;return o}function fp(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}var ab=Symbol("implicit");function dp(){var e=new Cs,t=[],n=[],r=ab;function i(o){let s=e.get(o);if(s===void 0){if(r!==ab)return r;e.set(o,s=t.push(o)-1)}return n[s%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new Cs;for(let s of o)e.has(s)||e.set(s,t.push(s)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return dp(t,n).unknown(r)},fp.apply(i,arguments),i}function Bl(){var e=dp().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,o,s,a=!1,l=0,c=0,u=.5;delete e.unknown;function f(){var d=t().length,p=i<r,m=p?i:r,g=p?r:i;o=(g-m)/Math.max(1,d-l+c*2),a&&(o=Math.floor(o)),m+=(g-m-o*(d-l))*u,s=o*(1-l),a&&(m=Math.round(m),s=Math.round(s));var w=up(d).map(function(x){return m+o*x});return n(p?w.reverse():w)}return e.domain=function(d){return arguments.length?(t(d),f()):t()},e.range=function(d){return arguments.length?([r,i]=d,r=+r,i=+i,f()):[r,i]},e.rangeRound=function(d){return[r,i]=d,r=+r,i=+i,a=!0,f()},e.bandwidth=function(){return s},e.step=function(){return o},e.round=function(d){return arguments.length?(a=!!d,f()):a},e.padding=function(d){return arguments.length?(l=Math.min(1,c=+d),f()):l},e.paddingInner=function(d){return arguments.length?(l=Math.min(1,d),f()):l},e.paddingOuter=function(d){return arguments.length?(c=+d,f()):c},e.align=function(d){return arguments.length?(u=Math.max(0,Math.min(1,d)),f()):u},e.copy=function(){return Bl(t(),[r,i]).round(a).paddingInner(l).paddingOuter(c).align(u)},fp.apply(f(),arguments)}var bx=class e{constructor(t,n,r){M(this,"bandwidthPx");M(this,"stepPx");M(this,"d3");this.bandwidthPx=t,this.stepPx=n,this.d3=r}static fixedRow(t){return new e(t.bandwidth,t.step)}static forRows(t){let n=Array.from({length:t.count},(i,o)=>String(o)),r=Bl().domain(n).range(t.range).paddingInner(t.paddingInner??0).paddingOuter(t.paddingOuter??0);return new e(r.bandwidth(),r.step(),r)}bandwidth(){return this.bandwidthPx}step(){return this.stepPx}forward(t){if(!this.d3)throw new Error("BandScale.forward is only available on closed-domain bands (BandScale.forRows)");let n=this.d3(t);if(n===void 0)throw new Error(`BandScale: unknown band id "${t}"`);return n}},HW={bandwidth:56,step:64};function lb(){return bx.fixedRow(HW)}var cb=8;function ub(e,t,n,r,i){let{theme:o,styleCtx:s}=t,{cal:a,calendar:l,schedule:c}=n,u=c.plan,{originX:f,scale:d}=r.axis,{timeline:p}=r,m=Wd(e,{theme:o,cal:a,schedule:c,timeline:p,scale:d,calendar:l,axisColumns:new ks(n,d),bandScale:lb(),waves:u?fS(u,d,f,Hn(t.locale).waveBackgroundItem):void 0},{chartTopY:0,chartBottomY:0,swimlaneBottomY:0},{footnotes:Vd(e.content.footnotes),markerRowPlacements:new Map(r.markers.placements)});for(let v of r.markers.datePinned){let D=m.markerRowPlacements.get(v.id);D&&(m.entityLeftEdges.set(v.id,v.centerX),m.entityRightEdges.set(v.id,v.centerX),m.entityMidpoints.set(v.id,{x:v.centerX,y:D.centerY}))}let g=new Map(m.entityLeftEdges),w=new Map(m.entityRightEdges),x=new Map(m.entityMidpoints),y=()=>{m.entityLeftEdges=new Map(g),m.entityRightEdges=new Map(w),m.entityMidpoints=new Map(x),m.placedItems=new Map,m.itemFlowKey=new Map,m.currentFlowKey="",m.waves&&Md(m.waves,m.entityLeftEdges,m.entityRightEdges)},T=[...e.content.swimlanes.values()],E=Se("swimlane",[],s),_=lk[E.spacing]??0,R=()=>{m.nextParallelId=0,m.nextGroupId=0;let v=[],D=m.chartTopY,L=0,B=m.timeline.originX;for(let z of T){L>0&&(D+=_);let{positioned:G,usedHeight:ee,usedRightX:Y}=new Ls({lane:z,bandIndex:L},i).place({x:m.timeline.originX,y:D},m);v.push(G),D+=ee,Y>B&&(B=Y),L++}return{swimlanes:v,nextY:D,maxRightX:B}},F=e.content.isolatedRegions,C,W,j=m.waves;if(j){let v,D=xS()?zW(j.ids,c,d):void 0,L=$d(j.ids.length,j.origin,j.floors,(B,z)=>(dS(j,B,z),y(),v=R(),F.length>0&&Ex(F,m,v.nextY+cb,i,r.naturalChartRightX),j.pass),It,D);pS(j,L),W={passes:L.passes,capped:L.capped},C=v}else C=R();let P=C.swimlanes,S=C.nextY,b=OS(e.content.milestones,m);b.length>0&&(y(),m.slackCorridors=b,C=R(),P=C.swimlanes,S=C.nextY);let $=[],I=[];if(F.length>0){let v=Ex(F,m,S+cb,i,r.naturalChartRightX);$=v.regions,I=v.contexts,S=v.endY}m.chartBottomY=S,m.swimlaneBottomY=S;let A=Jd(e.content.milestones,m);return{ctx:m,swimlanes:P,includes:$,regionContexts:I,milestones:A,laneEntries:T,maxRightX:C.maxRightX,bottomY:S,...W?{waveSolve:W}:{}}}function zW(e,t,n){let r=e.map(i=>t.waves?.get(i));return{S:r.map(i=>i?n.forward(i.start):null),E:r.map(i=>i?n.forward(i.end):null)}}var pp=class{constructor(t,n){M(this,"node");M(this,"helpers");this.node=t,this.helpers=n}get id(){return this.node.name??""}place(t,n){let{node:r}=this,{helpers:i}=this,o=Se("group",r.properties,n.styleCtx),s=Ur(r,$l(r.properties,t.x,n),n),a=n.waves!==void 0&&r.title===void 0&&re(r.properties,"wave")!==void 0&&re(r.properties,"style")===void 0&&Be(r.properties,"labels").length===0,l=a?void 0:r.title??r.name,c=n.currentFlowKey;n.nextGroupId+=1,n.currentFlowKey=`${c}/group:${r.name??`group-${n.nextGroupId}`}`;let u=Wt(Be(r.properties,"after")),f=Wt(Be(r.properties,"before")),d=ad({drawn:!a,hasTitle:!!l,hasPins:!!(u||f),hasBracket:o.bracket!=="none"}),p=tp(r,{leftX:s,firstRowY:t.y+d.header+d.pad},n,i),{children:m,timeCursorX:g,timeStartX:w}=p,x=n.bandScale.step(),y=x-n.bandScale.bandwidth(),T=Math.max(x,p.packer.usedHeight())-y,E={x:w,y:t.y,width:g-w,height:d.header+d.pad+T+d.pad};t.startX=E.x,t.x=g,t.height=Math.max(t.height,E.height+y);let _=r.name;_&&(n.entityLeftEdges.set(_,E.x),n.entityRightEdges.set(_,g)),n.currentFlowKey=c;let R=a?[]:Cd({box:E,afterDate:u,beforeDate:f,title:l});return{kind:"group",id:_,title:l,box:E,headerHeight:d.header,children:m,style:o,inlineDatePins:R.length>0?R:void 0,...a?{waveOnly:!0}:{}}}};var hp=class{constructor(t,n){M(this,"node");M(this,"helpers");this.node=t,this.helpers=n}get id(){return this.node.name??""}place(t,n){let{node:r}=this,{helpers:i}=this,o=Se("parallel",r.properties,n.styleCtx),s=Ur(r,t.x,n),a=Wt(Be(r.properties,"after")),l=Wt(Be(r.properties,"before")),c=r.title??r.name,u=ad({drawn:!0,hasTitle:!!c,hasPins:!!(a||l),hasBracket:o.bracket!=="none"}),f=t.y+u.header+u.pad,d=[],p=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY,g=0,w=n.currentFlowKey;n.nextParallelId+=1;let x=r.name??`parallel-${n.nextParallelId}`,y=0;for(let W of r.content){if(W.$type==="DescriptionDirective")continue;n.currentFlowKey=`${w}/par:${x}#${y}`;let j=Dl(s,f+g),P=i.sequenceOne(W,j,n);d.push(P),g+=Math.max(n.bandScale.step(),j.height),p=Math.min(p,j.startX),m=Math.max(m,j.x),y++}n.currentFlowKey=w,d.length===0&&(p=n.scale.showsNonWorking?n.scale.startX(s):s,m=p);let T=n.bandScale.step(),E=T-n.bandScale.bandwidth(),_=Math.max(T,g)-E,R={x:p,y:t.y,width:m-p,height:u.header+u.pad+_+u.pad};t.startX=R.x,t.x=m,t.height=Math.max(t.height,R.height+E);let F=r.name;F&&(n.entityLeftEdges.set(F,R.x),n.entityRightEdges.set(F,m));let C=Cd({box:R,afterDate:a,beforeDate:l,title:c});return{kind:"parallel",id:F,title:c,box:R,headerHeight:u.header,children:d,style:o,inlineDatePins:C.length>0?C:void 0}}};function jW(e,t,n){return new hp(e,{sequenceOne:mp}).place(t,n)}function YW(e,t,n){return new pp(e,{sequenceOne:mp}).place(t,n)}function mp(e,t,n){if(Ke(e))return jd(e,t,n);if(tt(e))return jW(e,t,n);if($e(e))return YW(e,t,n);throw new Error(`Unknown swimlane child type: ${e.$type??"unknown"}`)}var gp=class{place(t,n,r,i){let o={sequenceOne:mp},s=QR(t,n,r),a=eS(t,n,r,s,i),l=rb(t,n,r,s,a),c=ub(n,s,a,l,o);return ob(new cp(t,n,r,s,a,l,c))}};function Wl(e,t,n={}){let r=Uf(e,t),{config:i,working:o}=r,s=cs(t.content.sizes,i),a=re(e.roadmapDecl?.properties??[],"start"),l=ve(a)??VW(n.today??new Date),c=b=>o.workingIndexOf(l,b),u=b=>o.dateAtWorkingIndex(l,b),f=(b,$)=>Xf(o,l,b,$),d=0,p=b=>{d=Math.max(d,b)},m=new Map,g=new Map,w=new Map,x=new Map,y=new WeakMap,T=new Map,E=new WeakMap,_=new Map;for(let[b,$]of t.content.anchors){let I=ve(re($.properties,"date"));if(I){let A=c(I);g.set(b,A),_.set(b,I),p(A)}}let R=()=>({itemEnd:m,anchorEnd:g,milestoneEnd:w,sizes:s,itemResults:x,inByNode:!0}),F=(b,$,I)=>{let A=L=>{if("date"in L)return c(L.date);let B=L.ref;return b.itemEnd.has(B)?b.itemEnd.get(B):b.anchorEnd.has(B)?b.anchorEnd.get(B):b.milestoneEnd.has(B)?b.milestoneEnd.get(B):0},v=(L,B)=>{let z=B;for(let G of _t(L))z=D(G,z),I(z);return z},D=(L,B)=>{if(Ke(L)){let z=MA(L.properties,b.sizes,i),{after:G}=Xr(L.properties),ee=G.length>0?Math.max(B,...G.map(A)):B;$&&(ee=$.apply(L,ee));let Y=ee+z,ne={start:u(ee),end:f(ee,Y),days:z};return b.inByNode&&y.set(L,ne),L.name&&(b.itemEnd.set(L.name,Y),b.itemResults?.set(L.name,ne)),$?.accumulate(L,Y),Y}if(tt(L)){let{after:z}=Xr(L.properties),G=z.length>0?Math.max(B,...z.map(A)):B;$&&(G=$.apply(L,G));let ee=G;for(let Y of _t(L))ee=Math.max(ee,D(Y,G));return L.name&&b.itemEnd.set(L.name,ee),ee}if($e(L)){let{after:z}=Xr(L.properties),G=z.length>0?Math.max(B,...z.map(A)):B;$&&(G=$.apply(L,G));let ee=v(L,G);return L.name&&b.itemEnd.set(L.name,ee),ee}return B};return{walkLane:v,resolveAfterDay:A}},C=(b,$)=>{let I=ve(re(b.properties,"date"));if(I)return c(I);let{after:A}=Xr(b.properties);return A.length>0?Math.max(0,...A.map($)):void 0},W=(b,$)=>{let I=new Map,A=new Map,v=new Map;for(let[B,z]of b.anchors){let G=ve(re(z.properties,"date"));if(G){let ee=c(G);A.set(B,ee),p(ee)}}let{walkLane:D,resolveAfterDay:L}=F({itemEnd:I,anchorEnd:A,milestoneEnd:v,sizes:cs(b.sizes,i),inByNode:$},void 0,p);for(let B of b.swimlanes.values())D(B,0);for(let[B,z]of b.milestones){let G=C(z,L);G!==void 0&&(v.set(B,G),p(G))}for(let B of b.isolatedRegions)W(B.content,!1)},j=n.plan!==void 0?n.plan??void 0:Di(t),P;if(j){let b=j.waves.map(L=>L.name),$=uS(j,l,o),I,A=0,v=L=>{A=Math.max(A,L)},D=$d(b.length,0,$,(L,B)=>{let z=b.map((Y,ne)=>[Y,B[ne]]);m=new Map(z),x=new Map,y=new WeakMap,A=0;let G=new Fi(j,L),{walkLane:ee}=F(R(),G,v);for(let Y of t.content.swimlanes.values())ee(Y,0);for(let Y of t.content.isolatedRegions){let ne=F({itemEnd:new Map(z),anchorEnd:new Map,milestoneEnd:new Map,sizes:cs(Y.content.sizes,i),inByNode:!0},G,v);for(let k of Y.content.swimlanes.values())ne.walkLane(k,0)}return I=G,G});p(Math.max(A,...D.S,...D.E.slice(-1))),P=new Map;for(let L of Dd(j,D,I,0,$))P.set(L.id,{index:L.index,start:u(L.start),end:f(L.start,L.end),memberCount:L.memberCount,...L.heldBy!==void 0?{heldBy:L.heldBy}:{},...L.floorRef!==void 0?{floorRef:L.floorRef}:{}})}else{let{walkLane:b}=F(R(),void 0,p);for(let $ of t.content.swimlanes.values())b($,0)}let{resolveAfterDay:S}=F(R(),void 0,p);for(let[b,$]of t.content.milestones){let I=C($,S);if(I===void 0)continue;let A=ve(re($.properties,"date"))??u(I);w.set(b,I),T.set(b,A),E.set($,A),p(I)}if(!j)for(let b of t.content.isolatedRegions)W(b.content,!0);return{startDate:l,calendar:r,items:x,byNode:y,milestones:T,milestoneByNode:E,anchors:_,...P?{waves:P}:{},...j?{plan:j}:{},resolved:t,extent:{contentEndDay:d}}}function VW(e){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))}function Nx(e,t,n={}){let r=n.schedule?.resolved===t?n.schedule:Wl(e,t,{today:n.today,plan:Di(t)??null});return new gp().place(e,t,n,r)}function yp(e){return e.toISOString().slice(0,10)}function fb(e){return e.id!==void 0?e.id:/[\r\n]/.test(e.title)?e.title.replace(/\s*[\r\n]+\s*/g," ").trim():e.title}function Lx(e,t){for(let n of e)n.kind==="item"?t(n):Lx(n.children,t)}function KW(e,t,n){let r=fb(e);e.textSpills&&n.push(nn(t,"NL.I1000","info",{name:r},r)),e.chipsOutside&&n.push(nn(t,"NL.I1001","info",{name:r},r)),(e.box.width<Cr||e.dotSpills||e.iconSpills||e.footnoteSpills)&&n.push(nn(t,"NL.I1002","info",{name:r},r)),e.hasOverflow&&n.push(nn(t,"NL.I1003","info",{name:r,anchor:e.overflowAnchorId},r)),db(e,t,n)}function db(e,t,n){let r=e.nonWorkingPin;if(!r)return;let i=fb(e);n.push(nn(t,"NL.I1008","info",{name:i,pin:r.pin,key:r.key,start:r.start},i))}function nn(e,t,n,r,i){return{message:en(e,t,r),severity:n,code:t,entityId:i,lspSeverity:n==="warning"?2:3,data:{code:t,args:r}}}function pb(e,t,n){let r=e.id??e.title,i=[];Lx(e.children,a=>i.push(a));for(let a of i)KW(a,t,n);let o=new Set(i.map(a=>a.box.y));o.size>1&&n.push(nn(t,"NL.I1004","info",{lane:r,rows:o.size},r)),(e.utilization?.segments.some(a=>a.classification==="red")??!1)&&n.push(nn(t,"NL.I1005","info",{lane:r},r));for(let a of e.nested)pb(a,t,n)}function hb(e,t,n){Lx(e.children,r=>{db(r,t,n)});for(let r of e.nested)hb(r,t,n)}function qW(e,t,n){e.waveSolve?.capped&&n.push(nn(t,"NL.W1002","warning",{passes:e.waveSolve.passes}));let r=e.waves??[],i=r.filter(o=>o.empty).map(o=>o.id);if(i.length>0){let o=i.length===r.length?{reason:"all",names:i}:i.length===1?{reason:"one",name:i[0]}:{reason:"many",names:i};n.push(nn(t,"NL.I1006","info",o,o.reason==="one"?o.name:void 0))}for(let o of e.milestones){if(o.overrunByWave===void 0||o.overrunDate===void 0)continue;let s=r.find(l=>l.id===o.overrunByWave);if(!s)continue;let a=o.id??o.title;n.push(nn(t,"NL.I1007","info",{name:a,date:o.overrunDate,wave:s.id,end:yp(s.endDate)},a))}}function Px(e,t={}){let n=t.locale??"en-US",r=[];for(let i of e.swimlanes)pb(i,n,r);for(let i of e.includes)for(let o of i.nestedSwimlanes)hb(o,n,r);if(qW(e,n,r),t.today){let i=t.today,o=e.timeline.startDate,s=e.timeline.endDate;(i<o||i>s)&&r.push(nn(n,"NL.W1000","warning",{date:yp(i),start:yp(o),end:yp(s)}))}return r}var Wi=class extends Error{constructor(t){super(t),this.name="TimezoneError"}};function Cx(e){if(!e||e.toLowerCase()==="local")return{kind:"local"};if(e.toUpperCase()==="UTC")return{kind:"utc"};if(e==="Z")return{kind:"offset",ms:0};let t=/^([+-])(\d{2})(?::?(\d{2}))?$/.exec(e);if(t){let n=t[1]==="+"?1:-1,r=parseInt(t[2],10),i=t[3]!==void 0?parseInt(t[3],10):0;if(r>23||i>59)throw new Wi(`nowline: invalid timezone offset "${e}". Hours must be 0\u201323 and minutes 0\u201359.`);return{kind:"offset",ms:n*(r*60+i)*6e4}}try{return{kind:"iana",name:Intl.DateTimeFormat(void 0,{timeZone:e}).resolvedOptions().timeZone}}catch{throw new Wi(`nowline: unrecognised timezone "${e}". Use "local", "UTC", an ISO 8601 offset (e.g. "+05:30", "-07:00", "Z"), or an IANA timezone name (e.g. "America/Los_Angeles", "Asia/Kolkata").`)}}function xp(e,t){switch(t.kind){case"local":return new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()));case"utc":return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()));case"offset":{let n=new Date(e.getTime()+t.ms);return new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()))}case"iana":{let n=new Intl.DateTimeFormat("en-CA",{timeZone:t.name,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(e),r=0,i=0,o=0;for(let s of n)s.type==="year"?r=parseInt(s.value,10):s.type==="month"?i=parseInt(s.value,10)-1:s.type==="day"&&(o=parseInt(s.value,10));return new Date(Date.UTC(r,i,o))}}}var mb=/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?)(Z|([+-])(\d{2})(?::?(\d{2}))?)$/,gb=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?$/;function yb(e){return(ot.test(e)||mb.test(e)||gb.test(e))&&!He(e.slice(0,10))}function Ox(e={}){let t=e.zone??{kind:"local"},n=e.clock??(()=>new Date),r=e.now;if(!(r==="-"||r===null)){if(r instanceof Date)return r;if(r!==void 0){if(yb(r))return;let i=ve(r);if(i)return i;let o=mb.exec(r);if(o){let s=new Date(r);if(!Number.isNaN(s.getTime())){if(o[2]==="Z")return xp(s,{kind:"utc"});let l=o[3]==="+"?1:-1,c=parseInt(o[4],10),u=o[5]!==void 0?parseInt(o[5],10):0,f=l*(c*60+u)*6e4;return xp(s,{kind:"offset",ms:f})}}return gb.test(r)?ve(r.slice(0,10))??void 0:void 0}return xp(n(),t)}}function ZW(e){return e===2?"warning":e===3?"info":"error"}function xb(e,t){return{severity:ZW(e.severity),code:Ty(e),message:e.message,suggestion:cd(e.message),file:t,line:(e.range?.start.line??0)+1,column:(e.range?.start.character??0)+1}}function $x(e,t){return{severity:"error",code:"parse-error",message:e.message,file:t,line:e.token?.startLine??1,column:e.token?.startColumn??1}}function Dx(e,t){return{severity:"error",code:"lex-error",message:e.message,file:t,line:e.line??1,column:e.column??1}}function Eb(e,t){if(e.syntax?.origin==="lexer")return Dx(e.syntax.error,e.sourcePath);if(e.syntax?.origin==="parser")return $x(e.syntax.error,e.sourcePath);let n=(e.range?.start.line??e.line??0)+1,r=(e.range?.start.character??0)+1;if(!Br(e))return{severity:e.severity,code:"include",message:e.message,file:e.sourcePath,line:n,column:1};let i=t?zy(t,e):e.message,o=cd(i);return{severity:e.severity,code:e.code??ud(e.message),message:i,...o===void 0?{}:{suggestion:o},file:e.sourcePath,line:n,column:r}}function wb(e,t,n="warning"){return{severity:n,code:"render.warning",message:e,file:t,line:1,column:1}}function Tb(e,t){return{severity:e.severity,code:e.code,message:e.message,file:t,line:1,column:1}}var _b="__nowline_browser_noop_include__";async function vb(e){throw new Error(`${_b}: include "${e}" was skipped \u2014 running in single-file mode.`)}function Mx(e){return e.includes(_b)}function Rb(e,t){let n=t==="image/png"?QW(e):t==="image/jpeg"?eX(e):tX(e);return n&&n.width>0&&n.height>0?n:void 0}var JW=[137,80,78,71,13,10,26,10];function Fx(e,t){return e[t]<<8|e[t+1]}function Ab(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function kb(e,t){return e[t]|e[t+1]<<8}function Ib(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16}function Ep(e,t,n){return String.fromCharCode(...e.subarray(t,t+n))}function QW(e){if(!(e.length<24||JW.some((t,n)=>e[n]!==t))&&Ep(e,12,4)==="IHDR")return{width:Ab(e,16),height:Ab(e,20)}}function eX(e){if(e.length<4||e[0]!==255||e[1]!==216)return;let t=2;for(;t+3<e.length;){if(e[t]!==255)return;let n=e[t+1];if(n===255){t+=1;continue}if(n===1||n>=208&&n<=217){t+=2;continue}let r=Fx(e,t+2);if(n>=192&&n<=207&&n!==196&&n!==200&&n!==204)return t+8>=e.length?void 0:{width:Fx(e,t+7),height:Fx(e,t+5)};if(r<2)return;t+=2+r}}function tX(e){if(e.length<16||Ep(e,0,4)!=="RIFF"||Ep(e,8,4)!=="WEBP")return;let t=Ep(e,12,4),n=t==="VP8L"?25:30;if(!(e.length<n)){if(t==="VP8 ")return e[23]!==157||e[24]!==1||e[25]!==42?void 0:{width:kb(e,26)&16383,height:kb(e,28)&16383};if(t==="VP8L"){if(e[20]!==47)return;let r=e[21],i=e[22],o=e[23],s=e[24];return{width:1+(r|(i&63)<<8),height:1+(i>>6|o<<2|(s&15)<<10)}}if(t==="VP8X")return{width:1+Ib(e,24),height:1+Ib(e,27)}}}var nX=new Set(["svg","g","defs","symbol","use","path","rect","circle","ellipse","line","polyline","polygon","text","tspan","title","desc","linearGradient","radialGradient","stop","clipPath","mask","pattern","filter","feGaussianBlur","feColorMatrix","feOffset","feMerge","feMergeNode","feFlood","feComposite","feBlend","feDropShadow","image"]),rX=new Set(["d","x","y","x1","y1","x2","y2","cx","cy","r","rx","ry","width","height","viewBox","preserveAspectRatio","fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-opacity","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-dasharray","stroke-dashoffset","opacity","transform","points","id","clip-path","mask","filter","font-family","font-size","font-weight","font-style","text-anchor","dx","dy","rotate","letter-spacing","word-spacing","xmlns","href","xlink:href","offset","stop-color","stop-opacity","gradientUnits","gradientTransform","spreadMethod","maskUnits","maskContentUnits","stdDeviation","values","in","in2","mode","type","result","flood-color","flood-opacity","patternUnits","patternContentUnits","role","aria-label","display","visibility","clip-rule","color","font-variant","font-stretch","text-decoration","dominant-baseline","alignment-baseline","baseline-shift","writing-mode","paint-order","vector-effect","shape-rendering","text-rendering","image-rendering","color-interpolation","color-interpolation-filters"]),iX=new Set(["fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-opacity","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-dasharray","stroke-dashoffset","opacity","clip-path","clip-rule","mask","filter","font-family","font-size","font-weight","font-style","font-variant","font-stretch","text-anchor","text-decoration","letter-spacing","word-spacing","dominant-baseline","alignment-baseline","baseline-shift","writing-mode","stop-color","stop-opacity","flood-color","flood-opacity","display","visibility","color","paint-order","vector-effect","shape-rendering","text-rendering","image-rendering","color-interpolation","color-interpolation-filters"]),oX=new Set(["line-height","text-align","font-variant-ligatures","font-variant-caps","font-variant-numeric","font-variant-east-asian","font-variant-position","font-variant-alternates","font-feature-settings","font-variation-settings","font-kerning","white-space","text-orientation","overflow","isolation","solid-color","solid-opacity","enable-background","color-rendering"]),sX=new Set(["none","normal","auto","initial","inherit","unset"]);function aX(e){return e==="xlink:href"?!1:e.includes(":")||e.startsWith("data-")||e==="version"||e==="baseProfile"||e==="enable-background"}function lX(e){return e==="metadata"||e.includes(":")&&!e.startsWith("svg:")}var cX=new Set(["x","y","width","height"]);function bb(e){let t=[],n=0,r=e.length;for(;n<r;){if(e[n]!=="<"){let u=n;for(;n<r&&e[n]!=="<";)n++;let f=e.slice(u,n);f.trim().length>0?t.push({kind:"text",text:f}):f.length>0&&t.push({kind:"text",text:f});continue}if(e.startsWith("<!--",n)){let u=e.indexOf("-->",n+4);if(u<0)break;t.push({kind:"comment",text:e.slice(n+4,u)}),n=u+3;continue}if(e.startsWith("<![CDATA[",n)){let u=e.indexOf("]]>",n+9);if(u<0)break;t.push({kind:"cdata",text:e.slice(n+9,u)}),n=u+3;continue}if(e.startsWith("<?",n)){let u=e.indexOf("?>",n+2);if(u<0)break;t.push({kind:"decl",text:e.slice(n+2,u)}),n=u+2;continue}if(e.startsWith("<!",n)){let u=e.indexOf(">",n+2);if(u<0)break;t.push({kind:"decl",text:e.slice(n+2,u)}),n=u+1;continue}if(e[n+1]==="/"){let u=e.indexOf(">",n+2);if(u<0)break;let f=e.slice(n+2,u).trim();t.push({kind:"close",name:f}),n=u+1;continue}let i=uX(e,n);if(i<0)break;let o=e.slice(n+1,i).trim(),s=o.endsWith("/"),a=s?o.slice(0,-1).trim():o,{name:l,attrs:c}=fX(a);t.push({kind:s?"self":"open",name:l,attrs:c}),n=i+1}return t}function uX(e,t){let n=t+1,r=null;for(;n<e.length;){let i=e[n];if(r)i===r&&(r=null);else if(i==='"'||i==="'")r=i;else if(i===">")return n;n++}return-1}function fX(e){let t=0;for(;t<e.length&&/\s/.test(e[t]);)t++;let n=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;let r=e.slice(n,t),i={};for(;t<e.length;){for(;t<e.length&&/\s/.test(e[t]);)t++;if(t>=e.length)break;let o=t;for(;t<e.length&&e[t]!=="="&&!/\s/.test(e[t]);)t++;let s=e.slice(o,t);if(t>=e.length||e[t]!=="="){s&&(i[s]="");continue}if(t++,t>=e.length)break;let a=e[t];if(a!=='"'&&a!=="'"){let c=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;i[s]=e.slice(c,t);continue}t++;let l=t;for(;t<e.length&&e[t]!==a;)t++;i[s]=e.slice(l,t),t<e.length&&t++}return{name:r,attrs:i}}function Xl(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function dX(e,t){if(e.startsWith("#")){let n=t.get(e.slice(1));return n?`#${n}`:null}if(/^url\(#[^)]+\)$/.test(e)){let n=e.slice(5,-1),r=t.get(n);return r?`url(#${r})`:null}return null}function Nb(e,t={}){let n=t.idPrefix??"nl-logo",r=t.onWarn??(()=>{}),i=bb(e),o="",s=0;for(let d of i)d.kind==="open"&&d.name==="style"?s++:d.kind==="close"&&d.name==="style"?s=Math.max(0,s-1):s>0&&(d.kind==="text"||d.kind==="cdata")&&(o+=d.text??"");let a=pX(o,d=>r(`sanitizer: dropping ${d}`)),l=new Map,c=0;for(let d of i)if((d.kind==="open"||d.kind==="self")&&d.attrs&&"id"in d.attrs){let p=d.attrs.id;p&&!l.has(p)&&l.set(p,`${n}-${c++}`)}let u=[],f=[];for(let d of i)if(d.kind!=="comment"&&d.kind!=="decl"){if(d.kind==="cdata"){f[f.length-1]&&u.push(Xl(d.text??""));continue}if(d.kind==="text"){if(f.length===0||f[f.length-1]){let p=(d.text??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");u.push(p)}continue}if(d.kind==="open"||d.kind==="self"){let p=d.name??"";if(p==="script"||p==="foreignObject"||p==="animate"||p==="animateTransform"||p==="animateMotion"||p==="set"){r(`sanitizer: dropping <${p}>`),d.kind==="open"&&f.push(!1);continue}if(p==="style"||lX(p)){d.kind==="open"&&f.push(!1);continue}if(!nX.has(p)){r(`sanitizer: dropping unknown element <${p}>`),d.kind==="open"&&f.push(!1);continue}let m=[`<${p}`],g=p==="svg"&&f.length===0,w=hX(d.attrs??{},a,r),x=Object.keys(w).sort();for(let y of x){let T=w[y];if(g&&t.stripRootSize&&cX.has(y))continue;if(/^on/i.test(y)){r(`sanitizer: dropping event handler ${y}`);continue}if(aX(y)||y==="class")continue;if(!rX.has(y)){r(`sanitizer: dropping attribute ${y}`);continue}if(y==="href"||y==="xlink:href"){let _=dX(T,l);if(_===null){r(`sanitizer: dropping external href ${T}`);continue}m.push(` ${y}="${Xl(_)}"`);continue}if(y==="id"){let _=l.get(T);_&&m.push(` id="${Xl(_)}"`);continue}let E=/url\(#([^)]+)\)/gi;if(/data:|javascript:|vbscript:|url\(|expression\s*\(|[\\{}]/i.test(T.replace(E,""))){r(`sanitizer: dropping suspicious value at ${y}`);continue}if(/url\(#/i.test(T)){let _=T.replace(E,(R,F)=>{let C=l.get(F);return C?`url(#${C})`:"none"});m.push(` ${y}="${Xl(_)}"`);continue}m.push(` ${y}="${Xl(T)}"`)}m.push(d.kind==="self"?"/>":">"),u.push(m.join("")),d.kind==="open"&&f.push(!0);continue}d.kind==="close"&&f.pop()&&u.push(`</${d.name}>`)}return u.join("")}function Sb(e){if(e===void 0)return;let t=/^\s*([0-9]*\.?[0-9]+(?:e[+-]?[0-9]+)?)\s*(px)?\s*$/i.exec(e);if(!t)return;let n=Number(t[1]);return n>0&&Number.isFinite(n)?n:void 0}function wp(e){let t=bb(e).find(s=>(s.kind==="open"||s.kind==="self")&&s.name==="svg");if(!t)return;let n=t.attrs??{},r=Sb(n.width),i=Sb(n.height);if(r!==void 0&&i!==void 0)return{width:r,height:i};let o=(n.viewBox??"").trim().split(/[\s,]+/).map(Number);if(o.length===4&&o.every(Number.isFinite)&&o[2]>0&&o[3]>0)return{width:o[2],height:o[3]}}function Lb(e){let t=[];for(let n of e.split(";")){let r=n.indexOf(":");if(r<0)continue;let i=n.slice(0,r).trim().toLowerCase(),o=n.slice(r+1).replace(/!\s*important\s*$/i,"").trim();i&&o&&t.push({property:i,value:o})}return t}function pX(e,t){let n=[],r=e.replace(/\/\*[\s\S]*?\*\//g,""),i=/([^{}]+)\{([^{}]*)\}/g;for(let o of r.matchAll(i)){let s=o[1].trim(),a=s.split(",").map(l=>l.trim());if(s.startsWith("@")||!a.every(l=>/^\.[A-Za-z_][\w-]*$/.test(l))){t(`<style> rule ${s}`);continue}n.push({classes:a.map(l=>l.slice(1)),declarations:Lb(o[2])})}return/@[a-z-]+[^{;]*;/i.test(r)&&t("<style> at-rule"),n}function hX(e,t,n){let r=new Set((e.class??"").split(/\s+/).filter(Boolean)),i=[];for(let s of t)s.classes.some(a=>r.has(a))&&i.push(...s.declarations);if(e.style!==void 0&&i.push(...Lb(e.style)),i.length===0&&e.style===void 0)return e;let o={...e};delete o.style;for(let{property:s,value:a}of i)iX.has(s)?o[s]=a:!s.startsWith("-")&&!oX.has(s)&&!sX.has(a.toLowerCase())&&n(`sanitizer: dropping style property ${s}`);return o}var mX={".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp"};function gX(e){let t=e.slice(e.lastIndexOf("/")+1),n=t.lastIndexOf(".");return n>0?t.slice(n).toLowerCase():""}async function Pb(e,t,n){if(!e||!t)return;let r=gX(e),i=mX[r];if(!i){n(`unsupported logo format: ${r||"(none)"} (${e})`);return}let o;try{o=await t(e)}catch(l){let c=l instanceof Error?l.message:String(l);n(`logo file not found: ${e} (${c})`);return}let s=o.bytes,a=i==="image/svg+xml"?wp(new TextDecoder().decode(s)):Rb(s,i);if(!a){let l=i==="image/svg+xml"?"no viewBox and no pixel width/height on the root <svg>":`not a readable ${r.slice(1).toUpperCase()} header`;n(`logo could not be parsed: ${e} (${l})`);return}return{ref:e,dimensions:a,asset:o}}var yX=1,xX=0;function EX(){return Oe.parse(`memory:///stage-${++xX}.nowline`)}async function wX(e){if(e.document)return e.document;let{workspace:t}=e.services.shared,n=t.LangiumDocumentFactory.fromString(e.source,EX());return await t.DocumentBuilder.build([n],{validation:!0}),n}function TX(e){return e.origin!=="validation"||e.diagnostic.severity===yX}async function Bx(e){let t=await wX(e),n=Ni(t);if(n.some(TX))return{kind:"invalid",document:t,diagnostics:n};let r=t.parseResult.value,i=await Py(r,e.sourcePath,{services:e.services.Nowline,readFile:e.readSource}),o=e.isToleratedIncludeError??(()=>!1),s=i.diagnostics.filter(E=>E.severity==="error"&&!o(E)),a=i.diagnostics.filter(Br),l=s.find(E=>!Br(E));if(l)return{kind:"include-error",document:t,legacy:l,routed:[],resolved:i};if(s.length>0)return{kind:"include-error",document:t,routed:a,resolved:i};let c=[],u=await Pb(ld(r),e.assetResolver,E=>c.push(E)),{theme:f,today:d,width:p,locale:m,nonWorking:g}=e.layout,w={theme:f,today:d,width:p,locale:m,nonWorking:g},x=Di(i)??null,y=Wl(r,i,{today:d,plan:x}),T=Nx(r,i,{...w,schedule:y,logo:u?.dimensions});return{kind:"staged",document:t,ast:r,resolved:i,routed:a,logo:u,warnings:c,plan:x,schedule:y,model:T,layout:w}}var Cb=/&/g,Ob=/</g,$b=/>/g,_X=/"/g,vX=/'/g;function Ye(e){return e.replace(Cb,"&").replace(Ob,"<").replace($b,">")}function rn(e){return e.replace(Cb,"&").replace(Ob,"<").replace($b,">").replace(_X,""").replace(vX,"'")}function Os(e){let t=Object.keys(e).sort(),n=[];for(let r of t){let i=e[r];i==null||i===!1||(i===!0?n.push(r):n.push(`${r}="${rn(String(i))}"`))}return n.length?` ${n.join(" ")}`:""}function H(e,t,n){return n===void 0||n===""?`<${e}${Os(t)}/>`:`<${e}${Os(t)}>${n}</${e}>`}function ae(e,t){return`<text${Os(e)}>${Ye(t)}</text>`}function h(e){return Number.isFinite(e)?Number.isInteger(e)?e.toString():(Math.round(e*100)/100).toString():"0"}var IX="3 3";function Tp(e,t){let n=e.waypoints;if(n.length<2)return"";let r=t.dependency.edgeStroke,i=n[n.length-1],o=n[n.length-2],s=Math.hypot(i.x-o.x,i.y-o.y);if(s===0)return"";let a=(i.x-o.x)/s,l=(i.y-o.y)/s,c=e.headWidth/2,u=e.head==="dot"?c:e.headWidth*5/7,f=s>u?[...n.slice(0,-1),{x:i.x-a*u,y:i.y-l*u}]:n.slice(0,-1),d=[RX(f,e.slack,r)],p=t.arrowhead.neutral;if(e.head==="dot")d.push(H("circle",{cx:h(i.x-a*c),cy:h(i.y-l*c),r:h(c),fill:p}));else{let m=i.x-a*u,g=i.y-l*u;d.push(H("path",{d:`M${h(m-l*c)} ${h(g+a*c)} L${h(i.x)} ${h(i.y)} L${h(m+l*c)} ${h(g-a*c)} z`,fill:p}))}return H("g",{"data-layer":"dependency"},d.join(""))}function RX(e,t,n){if(e.length<2)return"";let r={fill:"none",stroke:n,"stroke-width":1.1,"stroke-linejoin":"round"};if(!t)return H("path",{d:bX(e,Qf),...r});let{solid:i,dotted:o}=SX(e,Qf);return(i?H("path",{d:i,...r}):"")+(o?H("path",{d:o,...r,"stroke-dasharray":IX,"stroke-linecap":"round"}):"")}function SX(e,t){let n=e.length,r=[],i=[],o=[];for(let a=1;a<n-1;a++){let l=e[a-1],c=e[a],u=e[a+1],f=Math.hypot(c.x-l.x,c.y-l.y),d=Math.hypot(u.x-c.x,u.y-c.y),p=Math.min(t,f/2,d/2),m={x:Math.sign(c.x-l.x),y:Math.sign(c.y-l.y)},g={x:Math.sign(u.x-c.x),y:Math.sign(u.y-c.y)};r[a]={x:c.x-m.x*p,y:c.y-m.y*p},i[a]={x:c.x+g.x*p,y:c.y+g.y*p},p>0&&o.push(`M${h(r[a].x)} ${h(r[a].y)} Q${h(c.x)} ${h(c.y)} ${h(i[a].x)} ${h(i[a].y)}`)}let s=[];for(let a=0;a<n-1;a++){let l=a===0?e[0]:i[a],c=a===n-2?e[n-1]:r[a+1],u=`M${h(l.x)} ${h(l.y)} L${h(c.x)} ${h(c.y)}`;Math.abs(e[a+1].y-e[a].y)<1e-9?s.push(u):o.push(u)}return{solid:o.join(" "),dotted:s.join(" ")}}function bX(e,t){if(e.length<2)return"";let n=[`M${h(e[0].x)} ${h(e[0].y)}`];for(let r=1;r<e.length;r++){let i=e[r-1],o=e[r];if(r===e.length-1){n.push(`L${h(o.x)} ${h(o.y)}`);continue}let s=e[r+1],a=Math.sign(o.x-i.x),l=Math.sign(o.y-i.y),c=Math.sign(s.x-o.x),u=Math.sign(s.y-o.y),f=Math.hypot(o.x-i.x,o.y-i.y),d=Math.hypot(s.x-o.x,s.y-o.y),p=Math.min(t,f/2,d/2);if(p<=0||a!==0&&c!==0||l!==0&&u!==0){n.push(`L${h(o.x)} ${h(o.y)}`);continue}let m={x:o.x-a*p,y:o.y-l*p},g={x:o.x+c*p,y:o.y+u*p};n.push(`L${h(m.x)} ${h(m.y)}`),n.push(`Q${h(o.x)} ${h(o.y)} ${h(g.x)} ${h(g.y)}`)}return n.join(" ")}function Db(e,t,n,r){if(e.entries.length===0)return"";let i=n.footnotePanel.fill,o=n.footnotePanel.border,s=n.footnotePanel.header,a=n.footnotePanel.title,l=n.footnotePanel.description,c=n.footnotePanel.number,u=[];u.push(H("rect",{x:h(e.box.x),y:h(e.box.y),width:h(e.box.width),height:h(e.box.height),rx:6,ry:6,fill:i,stroke:o,"stroke-width":1,filter:`url(#${t}-shadow-subtle)`})),u.push(ae({x:h(e.box.x+Bt),y:h(e.box.y+Qg),"font-family":r.sans,"font-size":12,"font-weight":700,fill:s},"Footnotes"));let f=e.box.x+Bt;for(let d of e.entries){d.region!==void 0&&d.regionHeadingY!==void 0&&u.push(ae({x:h(f),y:h(d.regionHeadingY),"font-family":r.sans,"font-size":10,"font-weight":700,fill:s},d.region)),u.push(ae({x:h(f),y:h(d.y),"font-family":r.sans,"font-size":10,"font-weight":700,fill:c},String(d.number)));for(let p of d.titleLines)u.push(ae({x:h(p.x),y:h(p.y),"font-family":r.sans,"font-size":11,"font-weight":600,fill:a},p.text));for(let p of d.descriptionLines??[])u.push(ae({x:h(p.x),y:h(p.y),"font-family":r.sans,"font-size":11,fill:l},p.text))}return H("g",{"data-layer":"footnotes"},u.join(""))}function Mb(e,t,n,r){let i=e.box.x+e.cardBox.x,o=e.box.y+e.cardBox.y,s=e.cardBox.width,a=e.cardBox.height,l=e.style.bg==="none"?n.surface.headerBox:e.style.bg,c=n.header.cardBorder,u=H("rect",{x:h(i),y:h(o),width:h(s),height:h(a),rx:6,ry:6,fill:l,stroke:c,"stroke-width":1,filter:`url(#${t}-shadow-subtle)`}),f=i+16+(e.textInset?.x??0),d=o+(e.textInset?.y??0),p=[];e.titleLines.forEach((T,E)=>{p.push(ae({x:h(f),y:h(d+26+E*20),"font-family":r[e.style.font],"font-size":16,"font-weight":600,fill:e.style.text},T))});let m=p.join(""),g=d+26+Math.max(0,e.titleLines.length-1)*20,w=n.header.author,x=[];e.authorLines.forEach((T,E)=>{x.push(ae({x:h(f),y:h(g+18+E*14),"font-family":r[e.style.font],"font-size":11,fill:w},T))});let y=x.join("");return H("g",{"data-layer":"header","data-id":`${t}-header`},u+m+y)}function Fb(e,t){let n=e.palette.attribution.mark,r=e.palette.attribution.link;if(e.swimlanes.length===0)return"";let i=e.header.attributionBox.x,o=e.header.attributionBox.y,s=$r,a=ae({x:"0",y:s,"font-family":t.sans,"font-size":Zf,"font-weight":400,fill:n},qf)+ae({x:gl,y:s,"font-family":t.sans,"font-size":$r,"font-weight":700,fill:n},"now")+H("rect",{x:ty,y:12,width:ny,height:$r,fill:r})+ae({x:Jf,y:s,"font-family":t.sans,"font-size":$r,"font-weight":400,fill:n},"ine"),l=H("g",{transform:`translate(${h(i)} ${h(o)}) scale(${h(ml)})`},a);return H("a",{href:ey,target:"_blank",rel:"noopener","aria-label":"Powered by nowline"},H("g",{"data-layer":"attribution"},l))}async function Bb(e,t,n,r){let i=e.assetRef??"",{x:o,y:s,width:a,height:l}=e.box,c;try{if(r.logo&&r.logo.ref===i)c=r.logo.asset;else if(t)c=await t(i);else return""}catch(d){let p=`logo file not found: ${i} (${d instanceof Error?d.message:String(d)})`;if(r.strict)throw d;return r.warn?.(p),""}let u=(c.mime??"").toLowerCase();if(u==="image/svg+xml"){let d=new TextDecoder().decode(c.bytes),p=e.intrinsic??wp(d)??{width:a,height:l},m=new Set,g=Nb(d,{idPrefix:`${n}-logo`,onWarn:w=>m.add(w.replace(/^sanitizer: dropping /,"")),stripRootSize:!0});return m.size>0&&r.warn?.(`logo ${i}: removed unsupported SVG content: ${[...m].join(", ")}`),H("svg",{"data-layer":"logo",x:h(o),y:h(s),width:h(a),height:h(l),viewBox:`0 0 ${h(p.width)} ${h(p.height)}`,preserveAspectRatio:"xMidYMid meet",overflow:"hidden"},g)}if(u==="image/png"||u==="image/jpeg"||u==="image/jpg"||u==="image/webp"){let d=NX(c.bytes);return H("image",{"data-layer":"logo",href:`data:${u};base64,${d}`,x:h(o),y:h(s),width:h(a),height:h(l),preserveAspectRatio:"xMidYMid meet"})}let f=`unsupported logo format: ${u} (${i})`;if(r.strict)throw new Error(f);return r.warn?.(f),""}function NX(e){if(typeof btoa<"u"){let n="";for(let r=0;r<e.length;r++)n+=String.fromCharCode(e[r]);return btoa(n)}let t=globalThis;if(t.Buffer)return t.Buffer.from(e).toString("base64");throw new Error("renderer: no base64 encoder available")}var _p=class{constructor(t="nl"){M(this,"prefix");M(this,"counter",0);this.prefix=t}next(t){let n=`${this.prefix}-${this.counter++}`;return t?`${n}-${t}`:n}};function vp(e,t,n){let r=e.radius,i=e.center.x,o=e.center.y,s=t.anchorDiamond.fill,a=t.anchorDiamond.stroke,l=H("path",{d:`M${h(i)} ${h(o-r)} L${h(i+r)} ${h(o)} L${h(i)} ${h(o+r)} L${h(i-r)} ${h(o)} Z`,fill:s,stroke:a,"stroke-width":1.25}),c=t.anchorDiamond.label,u=e.labelSide==="left"?e.labelBox.x+e.labelBox.width:e.labelBox.x,f={x:h(u),y:h(o+4),"font-family":n.sans,"font-size":10,fill:c};e.labelSide==="left"&&(f["text-anchor"]="end");let d=e.title?ae(f,e.title):"";return H("g",{"data-layer":"anchor","data-id":e.id??null},Wb(e.hiddenDate)+l+d)}function Ap(e,t){let n=t.anchorDiamond.cutLine;return H("line",{x1:h(e.center.x),y1:h(e.center.y+e.radius+1),x2:h(e.center.x),y2:h(e.cutBottomY),stroke:n,"stroke-width":1,"stroke-dasharray":"1 3"})}function kp(e,t,n){let r=e.center.x,i=e.center.y,o=e.radius,s=e.isOverrun?t.milestoneDiamond.cutLineOverrun:t.milestoneDiamond.fill,a=H("path",{d:`M${h(r)} ${h(i-o)} L${h(r+o)} ${h(i)} L${h(r)} ${h(i+o)} L${h(r-o)} ${h(i)} Z`,fill:s,stroke:s,"stroke-width":1}),l=e.isOverrun?t.milestoneDiamond.cutLineOverrun:t.milestoneDiamond.label,c=e.labelSide==="left"?e.labelBox.x+e.labelBox.width:e.labelBox.x,u={x:h(c),y:h(i+4),"font-family":n.sans,"font-size":10,"font-weight":600,fill:l};e.labelSide==="left"&&(u["text-anchor"]="end");let f=e.title?ae(u,e.title):"";return H("g",{"data-layer":"milestone","data-id":e.id??null},Wb(e.hiddenDate)+a+f)}function Wb(e){return e===void 0?"":`<title>${Ye(e)}</title>`}function Ip(e,t,n){let r=e.isOverrun?n.milestoneDiamond.cutLineOverrun:n.milestoneDiamond.cutLineNormal,i=[];if(e.onWaveBoundary||i.push(H("line",{x1:h(e.center.x),y1:h(e.center.y+e.radius+1),x2:h(e.center.x),y2:h(e.cutBottomY),stroke:r,"stroke-width":2,"stroke-dasharray":pl,"stroke-linecap":"round"})),e.slackArrows&&e.slackArrows.length>0){let o=e.isOverrun?n.milestoneDiamond.cutLineOverrun:n.milestoneDiamond.slack,s=e.isOverrun?"arrow-overrun":"arrow-dark";for(let a of e.slackArrows)i.push(H("path",{d:`M${h(a.x)} ${h(a.y)} H${h(e.center.x-6)}`,fill:"none",stroke:o,"stroke-width":1.1,"stroke-dasharray":"3 3","stroke-linecap":"round","marker-end":`url(#${t}-${s})`}))}return i.join("")}var En={person:{viewBox:"0 0 24 24",body:'<circle cx="12" cy="8" r="4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M4 21a8 8 0 0 1 16 0" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>',ascii:"p"},people:{viewBox:"0 0 24 24",body:'<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><circle cx="9" cy="7" r="4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M22 21v-2a4 4 0 0 0-3-3.87" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M16 3.13a4 4 0 0 1 0 7.75" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>',ascii:"P"},points:{viewBox:"0 0 24 24",body:'<polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" fill="currentColor" stroke="currentColor" stroke-width="1" stroke-linejoin="round"/>',ascii:"*"},time:{viewBox:"0 0 24 24",body:'<line x1="10" x2="14" y1="2" y2="2" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><line x1="12" x2="15" y1="14" y2="11" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><circle cx="12" cy="14" r="8" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>',ascii:"t"}},LX={calendar:{viewBox:"0 0 24 24",body:'<rect x="3" y="4" width="18" height="18" rx="2" ry="2" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><line x1="16" x2="16" y1="2" y2="6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><line x1="8" x2="8" y1="2" y2="6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><line x1="3" x2="21" y1="10" y2="10" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>',ascii:"d"}},Xb={...En,...LX};var eae={none:"",multiplier:"x",person:En.person.ascii,people:En.people.ascii,points:En.points.ascii,time:En.time.ascii};var PX={thin:100,light:300,normal:400,bold:700};function CX(e){return ki[e]??14}function Rp(e,t,n){return{"font-family":t[e.font],"font-size":n??CX(e.textSize),"font-weight":PX[e.weight]??400,"font-style":e.italic?"italic":"normal",fill:e.text}}function OX(e){if(e.border==="dashed")return"4 3";if(e.border==="dotted")return"1 3"}function Ub(e,t,n,r,i,o={}){let s=Math.min(Ii[i.cornerRadius]??4,r/2,n/2);return H("rect",{x:h(e),y:h(t),width:h(n),height:h(r),rx:h(s),ry:h(s),fill:i.bg==="none"?"transparent":i.bg,stroke:i.fg,"stroke-width":1,"stroke-dasharray":OX(i)??null,...o})}function Sp(e,t){let n=Math.max(e.x,t.x),r=Math.max(e.y,t.y),i=Math.min(e.x+e.width,t.x+t.width),o=Math.min(e.y+e.height,t.y+t.height);if(!(i<=n||o<=r))return{x:n,y:r,width:i-n,height:o-r}}var $X={none:{dx:0,dy:0,stdDeviation:0,opacity:0},subtle:{dx:0,dy:1,stdDeviation:1.5,opacity:.2},soft:{dx:0,dy:3,stdDeviation:5,opacity:.3},hard:{dx:2,dy:2,stdDeviation:0,opacity:.45}};function DX(e,t){let n=`${e}-shadow-${t}`,r=$X[t],i=`<feGaussianBlur in="SourceAlpha" stdDeviation="${r.stdDeviation}"/><feOffset dx="${r.dx}" dy="${r.dy}" result="offsetblur"/><feComponentTransfer><feFuncA type="linear" slope="${r.opacity}"/></feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>`;return H("filter",{id:n,x:"-50%",y:"-50%",width:"200%",height:"200%"},i)}function Gb(e,t){return t==="none"?null:`url(#${e}-shadow-${t})`}function Hb(e){return["subtle","soft","hard"].map(t=>DX(e,t)).join("")}var MX=4,FX=8,BX=10;function zb(e,t){return`url(#${e}-wave-hatch-${t})`}function jb(e,t,n){let r=cy;return H("pattern",{id:`${e}-wave-hatch-${t}`,width:r,height:r,patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)"},H("line",{x1:h(r/2),y1:0,x2:h(r/2),y2:r,stroke:t==="dark"?n.wave.hatch:n.wave.hatchOnDark,"stroke-width":uy,opacity:ly}))}function Yb(e){let t=n=>n.isOverrun&&(n.slackArrows?.length??0)>0;return e.milestones.some(t)||e.includes.some(n=>(n.milestones??[]).some(t))}function Vb(e){if(!e.waves)return[];let t=new Set,n=i=>{for(let o of i)o.kind==="item"?o.waveRole==="background"&&o.waveHatch&&t.add(o.waveHatch):n(o.children)},r=i=>{for(let o of i)n(o.children),r(o.nested)};r(e.swimlanes);for(let i of e.includes)r(i.nestedSwimlanes);for(let i of e.waveLegend?.entries??[])i.kind==="background"&&i.hatch&&t.add(i.hatch);return["dark","light"].filter(i=>t.has(i))}function Kb(e,t,n,r){let o=Math.min(Ii[t.cornerRadius]??4,e.height/2);return H("rect",{x:h(e.x+.5),y:h(e.y+.5),width:h(Math.max(0,e.width-2*.5)),height:h(Math.max(0,e.height-2*.5)),rx:h(o),ry:h(o),fill:zb(r,n)})}var Wx=4;function WX(e,t){let n=Math.min(Wx-bi,e.width/2,e.height/2),r=1e-6;return{left:e.x<=t.box.x+bi+r?n:0,right:e.x+e.width>=t.box.x+t.box.width-bi-r?n:0}}function XX(e,t){let{x:n,y:r,width:i,height:o}=e,s=(a,l,c)=>a>0?` A${h(a)} ${h(a)} 0 0 1 ${h(l)} ${h(c)}`:"";return`M${h(n+t.left)} ${h(r)} H${h(n+i-t.right)}`+s(t.right,n+i,r+t.right)+` V${h(r+o-t.right)}`+s(t.right,n+i-t.right,r+o)+` H${h(n+t.left)}`+s(t.left,n,r+o-t.left)+` V${h(r+t.left)}`+s(t.left,n+t.left,r)+" Z"}function Xx(e,t,n){let r=o=>n&&(n.left>0||n.right>0)?H("path",{d:XX(t,n),...o}):H("rect",{x:h(t.x),y:h(t.y),width:h(t.width),height:h(t.height),...o}),i=r({fill:e.style.stripFill});return e.style.tint?i+r({fill:e.style.tint,"fill-opacity":yl}):i}function qb(e,t){let n=e.timeline,r=n.waveStrip;if(!e.waves||!r)return"";let i=[H("rect",{x:h(n.box.x),y:h(r.y),width:h(n.box.width),height:h(r.height),rx:Wx,ry:Wx,fill:t.timeline.panelFill,stroke:t.timeline.border,"stroke-width":1})];for(let o of e.waves){let s=o.strip.cell;s&&i.push(H("g",{"data-id":o.id},`<title>${Ye(o.strip.tooltip)}</title>${Xx(o,s,WX(s,n))}`))}return H("g",{"data-layer":"wave-strip"},i.join(""))}function bp(e,t){let n=[];for(let r of e){if(!r.style.tint||r.empty)continue;let i=t?Sp(r.columnBox,t):r.columnBox;!i||i.width<=0||i.height<=0||n.push(H("rect",{x:h(i.x),y:h(i.y),width:h(i.width),height:h(i.height),fill:r.style.tint,"fill-opacity":fy}))}return n.length===0?"":H("g",{"data-layer":"wave-bg"},n.join(""))}function Np(e,t){let n=[];for(let r of e??[]){let i=r.topY,o=r.bottomY;t&&(r.x<=t.x||r.x>=t.x+t.width||(i=Math.max(i,t.y),o=Math.min(o,t.y+t.height),o<=i))||n.push(H("line",{x1:h(r.x),y1:h(i),x2:h(r.x),y2:h(o),stroke:r.stroke,"stroke-width":ed,"stroke-dasharray":r.dash}))}return n.length===0?"":H("g",{"data-layer":"wave-boundary"},n.join(""))}function Zb(e,t,n){let r=e.timeline,i=r.waveStrip;if(!e.waves||!i)return"";let o=i.y+i.height/2+MX,s=[],a=(l,c,u)=>H("rect",{x:h(u.x),y:h(u.y),width:h(u.width),height:h(u.height),fill:t.timeline.panelFill})+ae({x:h(l),y:h(o),"font-family":n.sans,"font-size":yn,"font-style":"italic",fill:t.wave.labelMuted,"text-anchor":"middle"},c);if(i.placeholder!==void 0){let l=r.box.x+r.box.width/2,c=se(i.placeholder,yn)+2*Mr,u={x:l-c/2,y:i.y+Si,width:c,height:i.height-2*Si};s.push(a(l,i.placeholder,u))}for(let l of e.waves){if(l.strip.gapLabel){let{text:f,x:d,halo:p}=l.strip.gapLabel;s.push(a(d,f,p))}if(l.strip.marker){let{x:f,y:d}=l.strip.marker,p=dy/2;s.push(H("path",{d:`M${h(f)} ${h(d-p)} L${h(f+p)} ${h(d)} L${h(f)} ${h(d+p)} L${h(f-p)} ${h(d)} Z`,fill:t.timeline.panelFill,stroke:t.wave.boundary,"stroke-width":1.5},`<title>${Ye(l.strip.tooltip)}</title>`))}if(!l.strip.cell)continue;let{labelDraw:c,superscripts:u}=l.strip;if(u&&s.push(Xx(l,u.halo)),l.strip.label!==void 0&&c&&(s.push(Xx(l,c.halo)),s.push(ae({x:h(c.x),y:h(o),"font-family":n.sans,"font-size":yn,"font-weight":600,fill:l.style.text,"text-anchor":"middle"},l.strip.label))),u){let f=u.rightX;for(let d=l.footnoteIndicators.length-1;d>=0;d--)s.push(ae({x:h(f),y:h(i.y+BX),"font-family":n.sans,"font-size":FX,"font-weight":700,fill:l.style.text,"text-anchor":"end"},String(l.footnoteIndicators[d]))),f-=Mt}}return s.length===0?"":H("g",{"data-layer":"wave-labels"},s.join(""))}function Lp(e){if(!e||e.length===0)return"";let t=e.map(n=>H("line",{x1:h(n.x),y1:h(n.topY),x2:h(n.x),y2:h(n.bottomY),stroke:n.stroke,"stroke-width":1,"stroke-dasharray":ay}));return H("g",{"data-layer":"wave-cross"},t.join(""))}function UX(e){let t=e.entities.item.bg;return t==="none"?"transparent":t}function Jb(e,t,n,r){if(!e)return"";let i=[];for(let o of e.entries){let s=o.swatch;if(s&&o.kind==="background"&&o.hatch){let a=UX(n),l={x:h(s.x),y:h(s.y),width:h(s.width),height:h(s.height)};i.push(H("rect",{...l,rx:2,ry:2,fill:a,stroke:n.entities.item.fg,"stroke-width":1})),i.push(H("rect",{x:h(s.x+.5),y:h(s.y+.5),width:h(s.width-1),height:h(s.height-1),rx:2,ry:2,fill:zb(t,o.hatch)}))}else if(s&&o.kind==="boundary"){let a=s.x+s.width/2;i.push(H("line",{x1:h(a),y1:h(s.y),x2:h(a),y2:h(s.y+s.height),stroke:n.wave.boundary,"stroke-width":ed}))}for(let a of o.runs)i.push(ae({x:h(a.x),y:h(a.y),"font-family":r.sans,"font-size":yn,fill:n.wave.labelText},a.text))}return H("g",{"data-layer":"wave-legend"},i.join(""))}function Qb(e,t){let n=e;for(let r of t.iconDxTerms??[])n+=r;return n}function Ux(e,t,n,r,i,o){let s=t,{text:a,icon:l}=e,c={"font-family":i,"font-size":r,fill:o};if(!l)return ae({x:h(s),y:h(n),...c},a);if(l.kind==="builtin"&&l.name==="multiplier")return ae({x:h(s),y:h(n),...c},`${a}\xD7`);if(l.kind==="builtin"){let f=En[l.name],d=ae({x:h(s),y:h(n),...c},a),p=r,m=Qb(t,e),g=n-r*.85,w=`<svg x="${h(m)}" y="${h(g)}" width="${h(p)}" height="${h(p)}" viewBox="${f.viewBox}" style="color:${rn(o)}" aria-hidden="true">${f.body}</svg>`;return d+w}let u=h(r*.1);return`<text x="${h(s)}" y="${h(n)}" font-family="${rn(i)}" font-size="${r}" fill="${rn(o)}">${Ye(a)}<tspan dx="${u}">${Ye(l.text)}</tspan></text>`}function GX(e){let{metaText:t,capacity:n,x:r,baselineY:i,fontSize:o,fontFamily:s,color:a}=e;if(!t&&!n)return"";let l={"font-family":s,"font-size":o,fill:a};if(!n)return ae({x:h(r),y:h(i),...l},t);if(!t)return Ux(n,r,i,o,s,a);let c=h(o*Bf),u=`<text x="${h(r)}" y="${h(i)}" font-family="${rn(s)}" font-size="${o}" fill="${rn(a)}">`,{text:f,icon:d}=n;if(!d)return u+Ye(t)+`<tspan dx="${c}">${Ye(f)}</tspan></text>`;if(d.kind==="builtin"&&d.name==="multiplier")return u+Ye(t)+`<tspan dx="${c}">${Ye(f)}\xD7</tspan></text>`;if(d.kind==="literal"){let T=h(o*.1);return u+Ye(t)+`<tspan dx="${c}">${Ye(f)}</tspan><tspan dx="${T}">${Ye(d.text)}</tspan></text>`}let p=En[d.name],m=o,g=Qb(r,n),w=i-o*.85,x=u+Ye(t)+`<tspan dx="${c}">${Ye(f)}</tspan></text>`,y=`<svg x="${h(g)}" y="${h(w)}" width="${h(m)}" height="${h(m)}" viewBox="${p.viewBox}" style="color:${rn(a)}" aria-hidden="true">${p.body}</svg>`;return x+y}function HX(e,t){let n=Xb.calendar,r=`<svg x="${h(e.glyphTopLeft.x)}" y="${h(e.glyphTopLeft.y)}" width="${h(e.glyphSize)}" height="${h(e.glyphSize)}" viewBox="${n.viewBox}" style="color:${rn(t)}" aria-hidden="true">${n.body}</svg>`,i=`<title>${Ye(e.isoDate)}</title>`;return H("g",{"data-layer":"inline-date-pin","data-side":e.side,"data-date":e.isoDate,"data-spilled":e.spilled?"true":null},i+r)}function Gx(e,t){return!e||e.length===0?"":e.map(n=>HX(n,t)).join("")}function eN(e){return e?.some(t=>t.side==="after")??!1}function zX(e){let t=[];return e.titleTruncated&&t.push(e.title),e.waveTooltip!==void 0&&t.push(e.waveTooltip),t.length>0?`<title>${Ye(t.join(`
|
|
2920
|
+
`))}</title>`:""}function jX(e,t){let n=[],r=Gb(t,e.style.shadow);return n.push(Ub(e.box.x,e.box.y,e.box.width,e.box.height,e.style,{filter:r??null})),e.waveRole==="background"&&e.waveHatch&&n.push(Kb(e.box,e.style,e.waveHatch,t)),n.join("")}function YX(e){if(e.progressFraction>0){let t=Math.max(0,Math.min(e.box.width,e.box.width*e.progressFraction));return H("rect",{x:h(e.box.x),y:h(e.box.y+e.box.height-Qt),width:h(t),height:Qt,fill:e.style.fg,opacity:.55})}return""}function VX(e){let t=e.dotSpills&&e.dotSpillCx!==null?e.dotSpillCx:e.box.x+e.box.width-vi;return H("circle",{cx:h(t),cy:h(e.box.y+Bg),r:br,fill:e.statusDotColor})}function KX(e,t){let n;if(e.textSpills)n=e.box.x+e.box.width+Bn,e.iconSpills&&(n+=Pr+gn);else{let r=!!e.linkIcon&&e.linkIcon!=="none",o=e.inlineDatePins?.find(s=>s.side==="after"&&!s.spilled)?ds(r,{barWidth:e.box.width}):ds(!t.noLinks&&r&&!e.iconSpills);n=e.box.x+o}return n}function qX(e,t,n,r){let i=[],o=e.style.text,s=n.entities.item.text,a=e.textSpills?s:o,l=e.textSpills?s:e.style.fg,c=e.titleLines??(e.title?[e.title]:[]);return c.forEach((u,f)=>{u!==""&&i.push(ae({x:h(t),y:h(e.box.y+Gf+f*sl),"font-family":r[e.style.font],"font-size":Lr,"font-weight":600,fill:a},u))}),(e.metaText||e.capacity)&&i.push(GX({metaText:e.metaText,capacity:e.capacity,x:t,baselineY:e.box.y+Hf(c.length),fontSize:ol,fontFamily:r[e.style.font],color:l})),i.join("")}function ZX(e,t,n){let r=[],i=t.entities.item.text;if(e.footnoteIndicators.length>0){let o=e.box.y+Wg;if(e.footnoteSpills&&e.footnoteSpillStartX!==null){let s=e.footnoteSpillStartX;for(let a=0;a<e.footnoteIndicators.length;a++){let l=e.footnoteIndicators[a];r.push(ae({x:h(s),y:h(o),"font-family":n.sans,"font-size":al,"font-weight":700,fill:i},String(l))),s+=Mt}}else{let s=e.box.x+e.box.width-fs;for(let a=e.footnoteIndicators.length-1;a>=0;a--){let l=e.footnoteIndicators[a];r.push(ae({x:h(s),y:h(o),"font-family":n.sans,"font-size":al,"font-weight":700,fill:e.style.text,"text-anchor":"end"},String(l))),s-=Mt}}}return r.join("")}function JX(e,t,n){let r=[];if(!t.noLinks&&e.linkIcon&&e.linkIcon!=="none"){let i={linear:"#5e6ad2",github:"#0f172a",jira:"#0052cc",generic:n.item.linkIconFg},o=i[e.linkIcon]??i.generic,s=Pr,a=e.iconSpills&&e.iconSpillX!==null?e.iconSpillX:e.box.x+Ai,l=e.box.y+Ai,c=H("rect",{x:h(a),y:h(l),width:s,height:s,rx:2,ry:2,fill:o}),u=a,f=l,d=H("path",{d:`M${h(u+4)} ${h(f+10)} L${h(u+10)} ${h(f+4)} M${h(u+6)} ${h(f+4)} H${h(u+10)} V${h(f+8)}`,stroke:"#ffffff",fill:"none","stroke-width":1.1,"stroke-linecap":"round","stroke-linejoin":"round"}),p=c+d,m=e.linkHref?H("a",{href:e.linkHref,target:"_blank",rel:"noopener"},p):p;r.push(m)}return r.join("")}function QX(e,t,n){let r=[];if(e.hasOverflow&&e.overflowBox){let i=t.item.overflowTailFill,o=t.item.overflowTailStroke,s=t.item.overflowCaption;r.push(H("rect",{x:h(e.overflowBox.x),y:h(e.overflowBox.y),width:h(e.overflowBox.width),height:h(e.overflowBox.height),fill:i,stroke:o,"stroke-width":1})),e.overflowAnchorId&&e.overflowBox.width>60&&r.push(ae({x:h(e.overflowBox.x+e.overflowBox.width/2),y:h(e.overflowBox.y+e.overflowBox.height/2+3),"font-family":n.sans,"font-size":9,"font-weight":700,fill:s,"text-anchor":"middle"},`past ${e.overflowAnchorId}`))}return r.join("")}function eU(e,t){let n=[];for(let r of e.labelChips){let i=Math.min(Ii[r.style.cornerRadius]??8,r.box.height/2);n.push(H("rect",{x:h(r.box.x),y:h(r.box.y),width:h(r.box.width),height:h(r.box.height),rx:h(i),ry:h(i),fill:r.style.bg==="none"?"transparent":r.style.bg,stroke:r.style.fg,"stroke-width":.5})),n.push(ae({x:h(r.box.x+r.box.width/2),y:h(r.box.y+r.box.height/2+3),...Rp(r.style,t,ki.xs),"text-anchor":"middle"},r.text))}return n.join("")}function tN(e,t,n,r,i){let o=[];return o.push(zX(e)),o.push(jX(e,n)),o.push(YX(e)),o.push(VX(e)),o.push(Gx(e.inlineDatePins,e.style.fg)),o.push(qX(e,KX(e,t),r,i)),o.push(ZX(e,r,i)),o.push(JX(e,t,r)),o.push(QX(e,r,i)),o.push(eU(e,i)),H("g",{"data-layer":"item","data-id":e.id??null},o.join(""))}function nU(e,t,n,r,i,o){let s=[];if(!(e.kind==="group"&&e.waveOnly)){let l=e.box.y+e.headerHeight,c=e.box.height-e.headerHeight;if(e.style.bg!=="none"){let f=t<=xy;s.push(H("rect",{x:h(e.box.x),y:h(l),width:h(e.box.width),height:h(c),fill:f?e.style.bg:"none","fill-opacity":f?t===1?gy:yy:null,stroke:f?null:e.style.bg,"stroke-opacity":f?null:.6,"stroke-width":f?null:1}))}let u=e.kind==="group"?e.style.fg:i.parallel.bracketStroke;if(e.headerHeight>0&&e.style.bracket!=="none"){let f=e.box.y+El,d=e.box.x,p=e.box.x+e.box.width;s.push(H("path",{d:`M${h(d)} ${h(l)} V${h(f)} H${h(p)} V${h(l)}`,fill:"none",stroke:u,"stroke-width":1.2,"stroke-dasharray":e.style.bracket==="dashed"?"3 2":null}))}e.title&&e.headerHeight>0&&s.push(ae({x:h(gs(e.box.x,eN(e.inlineDatePins))),y:h(e.box.y+my),...Rp(e.style,o,sd),"font-weight":600,fill:u},e.title)),s.push(Gx(e.inlineDatePins,e.style.fg))}for(let l of e.children)s.push(rN(l,n,r,i,o,t));return H("g",{"data-layer":e.kind,"data-id":e.id??null},s.join(""))}function rN(e,t,n,r,i,o=0){return e.kind==="item"?tN(e,t,n,r,i):nU(e,o+1,t,n,r,i)}var nN=2;function rU(e,t){switch(e){case"green":return t.swimlane.utilizationOk;case"yellow":return t.swimlane.utilizationWarn;case"red":return t.swimlane.utilizationOver}}function iU(e,t){if(!e.utilization||e.utilization.segments.length===0)return"";let n=e.box.y+e.box.height-nN,r=e.utilization.segments.map(i=>{let o=i.endX-i.startX;return o<=0?"":H("rect",{x:h(i.startX),y:h(n),width:h(o),height:nN,fill:rU(i.classification,t),"data-utilization":i.classification,"data-load":h(i.load)})});return H("g",{"data-layer":"lane-utilization","data-id":e.id??null},r.join(""))}function iN(e,t){let n=e.bandIndex%2===0?t.swimlane.rowTintEven:t.swimlane.rowTintOdd,r=t.swimlane.border;return H("g",{"data-layer":"swimlane-bg","data-id":e.id??null},H("rect",{x:h(e.box.x),y:h(e.box.y),width:h(e.box.width),height:h(e.box.height),fill:n,stroke:r,"stroke-width":1}))}function Pp(e,t,n,r,i){let o=r.swimlane.tabFill,s=r.swimlane.tabStroke,a=r.swimlane.tabText,l=r.swimlane.ownerText,c=r.swimlane.footnoteIndicator,u=[],f=e.tab;if(f){let p=e.footnoteIndicators.length>0?e.footnoteIndicators.join(","):"",m=fl,g=e.box.y+10,w=g+dl;if(u.push(H("rect",{x:h(f.tabX),y:h(g),width:h(f.tabW),height:h(m),rx:4,ry:4,fill:o,stroke:s,"stroke-width":1})),u.push(ae({x:h(f.titleX),y:h(w),"font-family":i[e.style.font],"font-size":12,"font-weight":600,fill:a},e.title)),e.owner){let x=En[e.ownerKind==="person"?"person":"people"],y=10;u.push(`<svg x="${h(f.ownerX)}" y="${h(w-y*.85)}" width="${h(y)}" height="${h(y)}" viewBox="${x.viewBox}" style="color:${rn(l)}" aria-hidden="true">${x.body}</svg>`),u.push(ae({x:h(f.ownerTextX),y:h(w),"font-family":i[e.style.font],"font-size":10,fill:l},e.owner))}e.capacity&&u.push(Ux(e.capacity,f.badgeX,w,10,i[e.style.font],l)),p&&u.push(ae({x:h(f.footnoteRightX),y:h(g+14),"font-family":i.sans,"font-size":10,"font-weight":700,fill:c,"text-anchor":"end"},p))}for(let d of e.children)u.push(rN(d,t,n,r,i));return u.push(iU(e,r)),H("g",{"data-layer":"swimlane","data-id":e.id??null},u.join(""))}function sN(e,t,n){let r=n.timeline.gridLine,i=n.timeline.minorGridLine,o=e.bottomTickPanelHeight??0,s=e.bottomTickPanelY!==void 0&&o>0,a=e.tickPanelY,l=s?e.bottomTickPanelY+o:e.box.y+e.box.height,c=t,u=e.box.y+e.box.height,f=[];for(let d of e.ticks)if(d.major)f.push(H("line",{x1:h(d.x),y1:h(a),x2:h(d.x),y2:h(l),stroke:r,"stroke-width":1}));else if(e.minorGrid){if(d.labelX===void 0)continue;f.push(H("line",{x1:h(d.x),y1:h(c),x2:h(d.x),y2:h(u),stroke:i,"stroke-width":1}))}for(let d of e.nonWorking??[])d.seam&&f.push(H("line",{x1:h(d.x),y1:h(c),x2:h(d.x),y2:h(u),stroke:n.timeline.nonWorkingSeam,"stroke-width":1,"stroke-dasharray":"1 3"}));return H("g",{"data-layer":"grid"},f.join(""))}function Cp(e,t,n,r){let i=e.box.y+e.box.height,o=[];for(let s of e.nonWorking??[]){if(!s.band)continue;let a={x:s.x,y:t,width:s.width,height:i-t},l=r?Sp(a,r):a;!l||l.width<=0||l.height<=0||o.push(H("rect",{x:h(l.x),y:h(l.y),width:h(l.width),height:h(l.height),fill:n.timeline.nonWorkingFill,"fill-opacity":oy}))}return o.length===0?"":H("g",{"data-layer":"non-working"},o.join(""))}function aN(e,t,n){let r=e.box.y+e.box.height,i=[];for(let o of e.nonWorking??[])o.label===void 0||!o.labelBox||(o.cut&&i.push(H("line",{x1:h(o.x),y1:h(o.labelBox.y+4),x2:h(o.x),y2:h(r),stroke:t.timeline.nonWorkingSeam,"stroke-width":1,"stroke-dasharray":"1 3"})),i.push(oN(o.label,o.labelBox,o.labelSide,t,n)));for(let o of e.workingExceptions??[])o.labelBox&&i.push(oN(o.label,o.labelBox,o.labelSide,t,n));return i.length===0?"":H("g",{"data-layer":"non-working-label"},i.join(""))}function oN(e,t,n,r,i){let o=n==="left",s=t.y+4,a={x:h(o?t.x+t.width:t.x),y:h(s+4),"font-family":i.sans,"font-size":10,fill:r.timeline.labelText};return o&&(a["text-anchor"]="end"),ae(a,e)}function lN(e,t,n){let r=t.timeline.panelFill,i=t.timeline.border,o=t.timeline.labelText,s=[],a=e.tickPanelY,l=e.tickPanelHeight,c=l>0,u=e.markerRow.height>0,f=e.waveStrip?e.waveStrip.y+e.waveStrip.height:a+l,d=e.markerRow.height,p=e.bottomTickPanelY,m=e.bottomTickPanelHeight??0,g=p!==void 0&&m>0;c&&s.push(H("rect",{x:h(e.box.x),y:h(a),width:h(e.box.width),height:h(l),rx:4,ry:4,fill:r,stroke:i,"stroke-width":1})),u&&s.push(H("rect",{x:h(e.box.x),y:h(f),width:h(e.box.width),height:h(d),rx:4,ry:4,fill:r,stroke:i,"stroke-width":1})),g&&s.push(H("rect",{x:h(e.box.x),y:h(p),width:h(e.box.width),height:h(m),rx:4,ry:4,fill:r,stroke:i,"stroke-width":1}));for(let w of e.ticks)w.major&&(!w.label||w.labelX===void 0||(c&&s.push(ae({x:h(w.labelX),y:h(a+ul(l)),"font-family":n.sans,"font-size":Ri,fill:o,"text-anchor":"middle"},w.label)),g&&s.push(ae({x:h(w.labelX),y:h(p+ul(m)),"font-family":n.sans,"font-size":Ri,fill:o,"text-anchor":"middle"},w.label))));return H("g",{"data-layer":"timeline"},s.join(""))}function cN(e,t,n,r,i,o){let s=r.includeRegion.border,a=r.includeRegion.fill,l=r.includeRegion.tabFill,c=r.includeRegion.tabStroke,u=r.includeRegion.tabText,f=r.includeRegion.badgeFill,d=r.includeRegion.badgeStroke,p=r.includeRegion.badgeText,m=e.box.x+8,g=e.box.y,w=e.box.width-16,x=e.box.height,y=H("rect",{x:h(m),y:h(g),width:h(w),height:h(x),rx:8,ry:8,fill:a,stroke:s,"stroke-width":1,"stroke-dasharray":pl}),T=fl,E=wl(e.box.x,e.label,e.sourcePath),_=g-T/2,R=H("rect",{x:h(E.tabX),y:h(_),width:h(E.tabWidth),height:T,rx:4,ry:4,fill:l,stroke:c,"stroke-width":1}),F=ae({x:h(E.tabLabelX),y:h(_+dl),"font-family":i.sans,"font-size":11,"font-weight":600,fill:u},e.label),C=E.badgeX,W=E.badgeSize,j=g-W/2,P=H("rect",{x:h(C),y:h(j),width:W,height:W,rx:4,ry:4,fill:f,stroke:d,"stroke-width":1}),S=H("path",{d:`M${h(C+7)} ${h(j+4)} H${h(C+14)} V${h(j+11)} M${h(C+4)} ${h(j+7)} H${h(C+11)} V${h(j+14)} H${h(C+4)} Z`,stroke:p,"stroke-width":1.4,fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}),b=9,$=g+4,I=H("rect",{x:h(E.sourceHaloX),y:h($-b),width:h(E.sourceHaloWidth),height:b+6,fill:a}),A=ae({x:h(E.sourceTextX),y:h($),"font-family":i.mono,"font-size":b,fill:p},e.sourcePath),v={x:m,y:g,width:w,height:x},D=o?Cp(o.timeline,o.chartBox.y,r,v):"",L=o?.waves?bp(o.waves,v)+Np(o.waveBoundaries,v):"",B=o?.waves?Lp(e.waveCrossings):"",z=e.nestedSwimlanes.map(k=>Pp(k,t,n,r,i)).join(""),G=(e.edges??[]).map(k=>Tp(k,r)).join(""),ee=e.anchors??[],Y=e.milestones??[],ne=ee.map(k=>Ap(k,r)).join("")+Y.map(k=>Ip(k,n,r)).join("")+ee.map(k=>vp(k,r,i)).join("")+Y.map(k=>kp(k,r,i)).join("");return H("g",{"data-layer":"include"},y+D+L+G+z+B+ne+R+F+P+S+I+A)}function uN(e,t,n){if(!e)return"";let r=t.nowline.stroke,i=t.nowline.labelText,o=H("line",{x1:h(e.x),y1:h(e.topY),x2:h(e.x),y2:h(e.bottomY),stroke:r,"stroke-width":Vf}),s=oU(e,r),a=sU(e,i,n);return H("g",{"data-layer":"nowline"},o+s+a)}function fN(e){let t=Vf/2;return e.pillMode==="flag-right"?e.x-t:e.pillMode==="flag-left"?e.x+t:e.x}function oU(e,t){let n=e.pillTopY,r=e.pillTopY+Ft,i=Kg,o=e.pillWidth;if(e.pillMode==="center")return H("rect",{x:h(e.x-o/2),y:h(n),width:h(o),height:h(Ft),rx:i,ry:i,fill:t});let s=fN(e);if(e.pillMode==="flag-right"){let c=s+o,u=[`M ${h(s)} ${h(n)}`,`L ${h(c-i)} ${h(n)}`,`A ${i} ${i} 0 0 1 ${h(c)} ${h(n+i)}`,`L ${h(c)} ${h(r-i)}`,`A ${i} ${i} 0 0 1 ${h(c-i)} ${h(r)}`,`L ${h(s)} ${h(r)}`,"Z"].join(" ");return H("path",{d:u,fill:t})}let a=s-o,l=[`M ${h(s)} ${h(n)}`,`L ${h(a+i)} ${h(n)}`,`A ${i} ${i} 0 0 0 ${h(a)} ${h(n+i)}`,`L ${h(a)} ${h(r-i)}`,`A ${i} ${i} 0 0 0 ${h(a+i)} ${h(r)}`,`L ${h(s)} ${h(r)}`,"Z"].join(" ");return H("path",{d:l,fill:t})}function sU(e,t,n){let r=e.pillTopY+qg,i=fN(e),o,s;return e.pillMode==="center"?(o=e.x,s="middle"):e.pillMode==="flag-right"?(o=i+hs,s="start"):(o=i-hs,s="end"),ae({x:h(o),y:h(r),"font-family":n.sans,"font-size":hl,"font-weight":700,fill:t,"text-anchor":s},e.label)}async function Hx(e,t={}){let r=new _p(t.idPrefix??"nl").next("root"),i=e.palette,o=t.fontFamilies??iy,s=[],a=(u,f)=>`<marker id="${u}" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" fill="${f}"/></marker>`,l=`<defs>${Hb(r)}`+a(`${r}-arrow-dark`,i.arrowhead.dark)+(Yb(e)?a(`${r}-arrow-overrun`,i.milestoneDiamond.cutLineOverrun):"")+Vb(e).map(u=>jb(r,u,i)).join("")+"</defs>";s.push(l),s.push(H("rect",{x:0,y:0,width:h(e.width),height:h(e.height),fill:e.backgroundColor})),s.push(lN(e.timeline,i,o)),s.push(qb(e,i));for(let u of e.swimlanes)s.push(iN(u,i));s.push(Cp(e.timeline,e.chartBox.y,i)),e.waves&&s.push(bp(e.waves)),s.push(sN(e.timeline,e.chartBox.y,i)),s.push(Np(e.waveBoundaries)),s.push(Zb(e,i,o));for(let u of e.edges)s.push(Tp(u,i));for(let u of e.swimlanes)s.push(Pp(u,t,r,i,o));for(let u of e.includes)s.push(cN(u,t,r,i,o,e));s.push(Lp(e.waveCrossings));for(let u of e.anchors)s.push(Ap(u,i));for(let u of e.milestones)s.push(Ip(u,r,i));s.push(aN(e.timeline,i,o));for(let u of e.anchors)s.push(vp(u,i,o));for(let u of e.milestones)s.push(kp(u,i,o));if(s.push(uN(e.nowline,i,o)),s.push(Db(e.footnotes,r,i,o)),s.push(Jb(e.waveLegend,r,i,o)),s.push(Mb(e.header,r,i,o)),s.push(Fb(e,o)),e.header.logo&&(t.logo||t.assetResolver)){let u=await Bb(e.header.logo,t.assetResolver,r,t);u&&s.push(u)}return`<svg${Os({xmlns:"http://www.w3.org/2000/svg",viewBox:`0 0 ${h(e.width)} ${h(e.height)}`,width:h(e.width),height:h(e.height),"data-theme":e.theme,"data-generator":"nowline"})}>${s.join("")}</svg>`}var zx="/browser-source.nowline",aU={error:3,warning:2,info:1},lU={error:3,warning:2,info:1};function dN(e,t){return aU[e]>=lU[t]}var Op,pN=0;function hN(){return Op||(Op=Hy()),Op}function cU(){return Oe.parse(`memory:///nowline-browser-${++pN}.nowline`)}async function jx(e,t={}){let n=t.filePath??zx,r=hN(),o=r.shared.workspace.LangiumDocumentFactory.fromString(e,cU());return await r.shared.workspace.DocumentBuilder.build([o],{validation:!0}),{ast:o.parseResult.value,diagnostics:mN(o,n)}}function mN(e,t){return gN(Ni(e),t)}function gN(e,t){return e.map(n=>n.origin==="lexer"?Dx(n.error,t):n.origin==="parser"?$x(n.error,t):xb(n.diagnostic,t))}async function Yx(e,t={}){let n=t.filePath??zx,r=hN(),i,o;if(t.timezone)try{i=Cx(t.timezone)}catch(T){if(!(T instanceof Wi))throw T;o=T}let s=o?void 0:Ox({now:t.today,zone:i}),a=await Bx({source:e,sourcePath:n,services:r,readSource:t.readFile??vb,assetResolver:t.assetResolver,isToleratedIncludeError:T=>Mx(T.message),layout:{theme:t.theme,today:s,locale:t.locale,width:t.width,nonWorking:t.nonWorking}});if(a.kind==="invalid")return{kind:"diagnostics",diagnostics:gN(a.diagnostics,n)};let l=a.kind==="include-error"&&a.legacy!==void 0,c=mN(a.document,n);for(let T of a.resolved.diagnostics){if(T.severity==="error"&&Mx(T.message)){t.onSkippedInclude?.({sourcePath:T.sourcePath,message:T.message});continue}l&&Br(T)||c.push(Eb(T))}if(a.kind==="include-error"||c.some(T=>T.severity==="error"))return{kind:"diagnostics",diagnostics:c};if(o)return{kind:"diagnostics",diagnostics:[{severity:"error",code:"invalid-timezone",message:o.message,file:n,line:1,column:1}]};let u=[...a.warnings],{logo:f,model:d}=a,p=t.diagnosticLevel??"error",m=Px(d,{today:s??void 0,locale:t.locale??"en-US"}).map(T=>Tb(T,n)),g=t.showLinks!==!1,w=t.strict===!0,x=await Hx(d,{idPrefix:t.idPrefix,assetResolver:t.assetResolver,logo:f,noLinks:!g,strict:w,warn:T=>u.push(T),fontFamilies:t.fontFamilies}),y=[...m,...u.map(T=>wb(T,n,w?"error":"warning"))].filter(T=>dN(T.severity,p));return w&&y.length>0?{kind:"diagnostics",diagnostics:[...c,...y]}:{kind:"svg",svg:x,warnings:y}}function Vx(){Op=void 0,pN=0}var yN="/embed.nowline",Kx=!1;async function xN(e){let{ast:t,diagnostics:n}=await jx(e,{filePath:yN});return{ast:t,errors:n.filter(r=>r.severity==="error").map(r=>r.message)}}async function $p(e,t={}){let n={filePath:yN,theme:t.theme,today:t.today,timezone:t.timezone,locale:t.locale,width:t.width,nonWorking:t.nonWorking,idPrefix:t.idPrefix,onSkippedInclude:()=>{Kx||(Kx=!0,console.warn("nowline: `include` directives are skipped in the browser embed (single-file mode). Render multi-file roadmaps with the CLI or the GitHub Action."))}},r=await Yx(e,n);if(r.kind==="svg")return r.svg;let i=r.diagnostics.filter(o=>o.severity==="error").map(o=>o.message);throw new Ul(`Failed to render Nowline source: ${i.join("; ")}`,i)}var Ul=class extends Error{constructor(n,r){super(n);M(this,"details",r);this.name="EmbedRenderError"}};function EN(){Kx=!1,Vx()}var on=Uint8Array,Lt=Uint16Array,eE=Int32Array,tE=new on([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),nE=new on([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),wN=new on([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),AN=function(e,t){for(var n=new Lt(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new eE(n[30]),r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return{b:n,r:i}},kN=AN(tE,2),uU=kN.b,Zx=kN.r;uU[28]=258,Zx[258]=28;var IN=AN(nE,0),hle=IN.b,TN=IN.r,Jx=new Lt(32768);for(xe=0;xe<32768;++xe)Kn=(xe&43690)>>1|(xe&21845)<<1,Kn=(Kn&52428)>>2|(Kn&13107)<<2,Kn=(Kn&61680)>>4|(Kn&3855)<<4,Jx[xe]=((Kn&65280)>>8|(Kn&255)<<8)>>1;var Kn,xe,zl=(function(e,t,n){for(var r=e.length,i=0,o=new Lt(t);i<r;++i)e[i]&&++o[e[i]-1];var s=new Lt(t);for(i=1;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;var a;if(n){a=new Lt(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var c=i<<4|e[i],u=t-e[i],f=s[e[i]-1]++<<u,d=f|(1<<u)-1;f<=d;++f)a[Jx[f]>>l]=c}else for(a=new Lt(r),i=0;i<r;++i)e[i]&&(a[i]=Jx[s[e[i]-1]++]>>15-e[i]);return a}),Xi=new on(288);for(xe=0;xe<144;++xe)Xi[xe]=8;var xe;for(xe=144;xe<256;++xe)Xi[xe]=9;var xe;for(xe=256;xe<280;++xe)Xi[xe]=7;var xe;for(xe=280;xe<288;++xe)Xi[xe]=8;var xe,Dp=new on(32);for(xe=0;xe<32;++xe)Dp[xe]=5;var xe,fU=zl(Xi,9,0);var dU=zl(Dp,5,0);var RN=function(e){return(e+7)/8|0},pU=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new on(e.subarray(t,n))};var qn=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},Gl=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},qx=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return{t:bN,l:0};if(i==1){var s=new on(n[0].s+1);return s[n[0].s]=1,{t:s,l:1}}n.sort(function(_,R){return _.f-R.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],c=0,u=1,f=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=i-1;)a=n[n[c].f<n[f].f?c++:f++],l=n[c!=u&&n[c].f<n[f].f?c++:f++],n[u++]={s:-1,f:a.f+l.f,l:a,r:l};for(var d=o[0].s,r=1;r<i;++r)o[r].s>d&&(d=o[r].s);var p=new Lt(d+1),m=Qx(n[u-1],p,0);if(m>t){var r=0,g=0,w=m-t,x=1<<w;for(o.sort(function(R,F){return p[F.s]-p[R.s]||R.f-F.f});r<i;++r){var y=o[r].s;if(p[y]>t)g+=x-(1<<m-p[y]),p[y]=t;else break}for(g>>=w;g>0;){var T=o[r].s;p[T]<t?g-=1<<t-p[T]++-1:++r}for(;r>=0&&g;--r){var E=o[r].s;p[E]==t&&(--p[E],++g)}m=t}return{t:new on(p),l:m}},Qx=function(e,t,n){return e.s==-1?Math.max(Qx(e.l,t,n+1),Qx(e.r,t,n+1)):t[e.s]=n},_N=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Lt(++t),r=0,i=e[0],o=1,s=function(l){n[r++]=l},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return{c:n.subarray(0,r),n:t}},Hl=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},SN=function(e,t,n){var r=n.length,i=RN(t+2);e[i]=r&255,e[i+1]=r>>8,e[i+2]=e[i]^255,e[i+3]=e[i+1]^255;for(var o=0;o<r;++o)e[i+o+4]=n[o];return(i+4+r)*8},vN=function(e,t,n,r,i,o,s,a,l,c,u){qn(t,u++,n),++i[256];for(var f=qx(i,15),d=f.t,p=f.l,m=qx(o,15),g=m.t,w=m.l,x=_N(d),y=x.c,T=x.n,E=_N(g),_=E.c,R=E.n,F=new Lt(19),C=0;C<y.length;++C)++F[y[C]&31];for(var C=0;C<_.length;++C)++F[_[C]&31];for(var W=qx(F,7),j=W.t,P=W.l,S=19;S>4&&!j[wN[S-1]];--S);var b=c+5<<3,$=Hl(i,Xi)+Hl(o,Dp)+s,I=Hl(i,d)+Hl(o,g)+s+14+3*S+Hl(F,j)+2*F[16]+3*F[17]+7*F[18];if(l>=0&&b<=$&&b<=I)return SN(t,u,e.subarray(l,l+c));var A,v,D,L;if(qn(t,u,1+(I<$)),u+=2,I<$){A=zl(d,p,0),v=d,D=zl(g,w,0),L=g;var B=zl(j,P,0);qn(t,u,T-257),qn(t,u+5,R-1),qn(t,u+10,S-4),u+=14;for(var C=0;C<S;++C)qn(t,u+3*C,j[wN[C]]);u+=3*S;for(var z=[y,_],G=0;G<2;++G)for(var ee=z[G],C=0;C<ee.length;++C){var Y=ee[C]&31;qn(t,u,B[Y]),u+=j[Y],Y>15&&(qn(t,u,ee[C]>>5&127),u+=ee[C]>>12)}}else A=fU,v=Xi,D=dU,L=Dp;for(var C=0;C<a;++C){var ne=r[C];if(ne>255){var Y=ne>>18&31;Gl(t,u,A[Y+257]),u+=v[Y+257],Y>7&&(qn(t,u,ne>>23&31),u+=tE[Y]);var k=ne&31;Gl(t,u,D[k]),u+=L[k],k>3&&(Gl(t,u,ne>>5&8191),u+=nE[k])}else Gl(t,u,A[ne]),u+=v[ne]}return Gl(t,u,A[256]),u+v[256]},hU=new eE([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),bN=new on(0),mU=function(e,t,n,r,i,o){var s=o.z||e.length,a=new on(r+s+5*(1+Math.ceil(s/7e3))+i),l=a.subarray(r,a.length-i),c=o.l,u=(o.r||0)&7;if(t){u&&(l[0]=o.r>>3);for(var f=hU[t-1],d=f>>13,p=f&8191,m=(1<<n)-1,g=o.p||new Lt(32768),w=o.h||new Lt(m+1),x=Math.ceil(n/3),y=2*x,T=function(ge){return(e[ge]^e[ge+1]<<x^e[ge+2]<<y)&m},E=new eE(25e3),_=new Lt(288),R=new Lt(32),F=0,C=0,W=o.i||0,j=0,P=o.w||0,S=0;W+2<s;++W){var b=T(W),$=W&32767,I=w[b];if(g[$]=I,w[b]=$,P<=W){var A=s-W;if((F>7e3||j>24576)&&(A>423||!c)){u=vN(e,l,0,E,_,R,C,j,S,W-S,u),j=F=C=0,S=W;for(var v=0;v<286;++v)_[v]=0;for(var v=0;v<30;++v)R[v]=0}var D=2,L=0,B=p,z=$-I&32767;if(A>2&&b==T(W-z))for(var G=Math.min(d,A)-1,ee=Math.min(32767,W),Y=Math.min(258,A);z<=ee&&--B&&$!=I;){if(e[W+D]==e[W+D-z]){for(var ne=0;ne<Y&&e[W+ne]==e[W+ne-z];++ne);if(ne>D){if(D=ne,L=z,ne>G)break;for(var k=Math.min(z,ne-2),O=0,v=0;v<k;++v){var X=W-z+v&32767,U=g[X],K=X-U&32767;K>O&&(O=K,I=X)}}}$=I,I=g[$],z+=$-I&32767}if(L){E[j++]=268435456|Zx[D]<<18|TN[L];var q=Zx[D]&31,J=TN[L]&31;C+=tE[q]+nE[J],++_[257+q],++R[J],P=W+D,++F}else E[j++]=e[W],++_[e[W]]}}for(W=Math.max(W,P);W<s;++W)E[j++]=e[W],++_[e[W]];u=vN(e,l,c,E,_,R,C,j,S,W-S,u),c||(o.r=u&7|l[u/8|0]<<3,u-=7,o.h=w,o.p=g,o.i=W,o.w=P)}else{for(var W=o.w||0;W<s+c;W+=65535){var ie=W+65535;ie>=s&&(l[u/8|0]=c,ie=s),u=SN(l,u+1,e.subarray(W,ie))}o.i=s}return pU(a,0,r+RN(u)+i)};var NN=function(){var e=1,t=0;return{p:function(n){for(var r=e,i=t,o=n.length|0,s=0;s!=o;){for(var a=Math.min(s+2655,o);s<a;++s)i+=r+=n[s];r=(r&65535)+15*(r>>16),i=(i&65535)+15*(i>>16)}e=r,t=i},d:function(){return e%=65521,t%=65521,(e&255)<<24|(e&65280)<<8|(t&255)<<8|t>>8}}},gU=function(e,t,n,r,i){if(!i&&(i={l:1},t.dictionary)){var o=t.dictionary.subarray(-32768),s=new on(o.length+e.length);s.set(o),s.set(e,o.length),e=s,i.w=o.length}return mU(e,t.level==null?6:t.level,t.mem==null?i.l?Math.ceil(Math.max(8,Math.min(13,Math.log(e.length)))*1.5):20:12+t.mem,n,r,i)};var LN=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};var yU=function(e,t){var n=t.level,r=n==0?0:n<6?1:n==9?3:2;if(e[0]=120,e[1]=r<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var i=NN();i.p(t.dictionary),LN(e,2,i.d())}};function PN(e,t){t||(t={});var n=NN();n.p(e);var r=gU(e,t,t.dictionary?6:2,4);return yU(r,t),LN(r,r.length-4,n.d()),r}var xU=typeof TextDecoder<"u"&&new TextDecoder,EU=0;try{xU.decode(bN,{stream:!0}),EU=1}catch{}var $N="https://free.nowline.io/open";function CN(e){let t=new TextEncoder().encode(e),n=PN(t),r=32768,i="";for(let o=0;o<n.length;o+=r)i+=String.fromCharCode(...n.subarray(o,o+r));return btoa(i).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function rE({source:e,sourceUrl:t,share:n}){if(n===!1||n==="none")return null;if(typeof n=="object")return t!==void 0&&ON(t)?n.remoteUrl.replace("{url}",encodeURIComponent(t)):n.textUrl.replace("{text}",CN(e));let r=n===!0?$N:n,i=new URL(r);return t!==void 0&&ON(t)?i.hash=`url=${encodeURIComponent(t)}`:i.hash=`text=${CN(e)}`,i.toString()}function ON(e){try{return new URL(e).protocol==="https:"}catch{return!1}}var DN=0;async function MN(e){let t=e.document??globalThis.document;if(!t)return{rendered:0,failed:0};let n=t.querySelectorAll(e.selector),r=0,i=0,o=++DN,s=e.share??!0,a=[],l=0;for(let c of Array.from(n)){let u=wU(c);if(!u)continue;let f=TU(c),d=`nl-r${o}-${l++}`,p={theme:e.theme,locale:e.locale,width:e.width,nonWorking:e.nonWorking,today:e.today,timezone:e.timezone,idPrefix:d},m=u.parentElement,g=u.nextSibling,x=c.getAttribute("data-nowline-source-url")??void 0??e.sourceUrl;a.push($p(f,p).then(y=>{if(_U(u,y),r++,m!==null){let T=rE({source:f,sourceUrl:x,share:s});if(T!==null){let E=t.createElement("a");E.className="nowline-share",E.href=T,E.target="_blank",E.rel="noopener noreferrer",E.textContent="Share on Nowline",m.insertBefore(E,g)}}},y=>{i++,console.error("nowline: render failed",y)}))}return await Promise.all(a),{rendered:r,failed:i}}function wU(e){let t=e.parentElement;return t&&t.tagName.toUpperCase()==="PRE"?t:e}function TU(e){return e.textContent??""}function _U(e,t){e.outerHTML=t}function FN(){DN=0}function Mp(){if(typeof globalThis>"u")return"light";let e=globalThis.matchMedia;if(typeof e!="function")return"light";try{return e("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{return"light"}}function BN(e,t){return e&&e!=="auto"?qy(e)??t:t}var vU="0.0.0-dev.20261020011950.gce8a91f",AU="ce8a91f",kU="pre code.language-nowline, code.language-nowline",WN={theme:"auto",startOnLoad:!0,selector:kU,systemTheme:Mp(),share:!0},Ae={...WN},iE=!1;function IU(e={}){Ae={theme:e.theme??Ae.theme,startOnLoad:e.startOnLoad??Ae.startOnLoad,selector:e.selector??Ae.selector,locale:e.locale??Ae.locale,width:e.width??Ae.width,nonWorking:e.nonWorking??Ae.nonWorking,today:e.today!==void 0?e.today:Ae.today,timezone:e.timezone??Ae.timezone,share:e.share??Ae.share,sourceUrl:e.sourceUrl??Ae.sourceUrl,systemTheme:Mp()}}function XN(){return{theme:BN(Ae.theme,Ae.systemTheme),locale:Ae.locale,width:Ae.width,nonWorking:Ae.nonWorking,today:Ae.today,timezone:Ae.timezone}}async function RU(e,t={}){let n={...XN(),...t};return $p(e,n)}async function SU(e){return xN(e)}async function oE(e){let t={selector:e?.selector??Ae.selector,theme:e?.theme??XN().theme,locale:e?.locale??Ae.locale,width:e?.width??Ae.width,nonWorking:e?.nonWorking??Ae.nonWorking,today:e?.today!==void 0?e.today:Ae.today,timezone:e?.timezone??Ae.timezone,share:e?.share??Ae.share,sourceUrl:e?.sourceUrl??Ae.sourceUrl,document:e?.document};return MN(t)}var bU=oE;if(typeof document<"u"&&!iE){iE=!0;let e=()=>{Ae.startOnLoad&&oE()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):queueMicrotask(e)}function NU(){Ae={...WN,systemTheme:Mp()},iE=!1,EN(),FN()}return QN(LU);})();
|
|
2921
2921
|
//# sourceMappingURL=nowline.min.js.map
|