@nowline/embed 0.0.0-dev.20261017174947.ge897dee → 0.0.0-dev.20261017184716.ge0dbbdf
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/nowline.esm.js +3 -3
- package/dist/nowline.min.js +2 -2
- package/package.json +6 -6
package/dist/nowline.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @nowline/embed 0.0.0-dev.
|
|
1
|
+
/*! @nowline/embed 0.0.0-dev.20261017184716.ge0dbbdf sha=e0dbbdf built=2026-10-17T18:42:18Z */
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -40621,8 +40621,8 @@ function effectiveTheme(theme, systemTheme) {
|
|
|
40621
40621
|
}
|
|
40622
40622
|
|
|
40623
40623
|
// src/index.ts
|
|
40624
|
-
var version = true ? "0.0.0-dev.
|
|
40625
|
-
var sha = true ? "
|
|
40624
|
+
var version = true ? "0.0.0-dev.20261017184716.ge0dbbdf" : "0.0.0";
|
|
40625
|
+
var sha = true ? "e0dbbdf" : "unknown";
|
|
40626
40626
|
var DEFAULT_SELECTOR = "pre code.language-nowline, code.language-nowline";
|
|
40627
40627
|
var initialConfig = {
|
|
40628
40628
|
theme: "auto",
|
package/dist/nowline.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @nowline/embed 0.0.0-dev.
|
|
1
|
+
/*! @nowline/embed 0.0.0-dev.20261017184716.ge0dbbdf sha=e0dbbdf built=2026-10-17T18:42:18Z */
|
|
2
2
|
"use strict";var nowline=(()=>{var yN=Object.create;var Os=Object.defineProperty;var xN=Object.getOwnPropertyDescriptor;var EN=Object.getOwnPropertyNames;var wN=Object.getPrototypeOf,TN=Object.prototype.hasOwnProperty;var vN=(e,t,n)=>t in e?Os(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var _N=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(r){throw n=[r],r}};var Ds=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},_p=(e,t)=>{for(var n in t)Os(e,n,{get:t[n],enumerable:!0})},Yx=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of EN(t))!TN.call(e,i)&&i!==n&&Os(e,i,{get:()=>t[i],enumerable:!(r=xN(t,i))||r.enumerable});return e};var Ap=(e,t,n)=>(n=e!=null?yN(wN(e)):{},Yx(t||!e||!e.__esModule?Os(n,"default",{value:e,enumerable:!0}):n,e)),AN=e=>Yx(Os({},"__esModule",{value:!0}),e);var F=(e,t,n)=>vN(e,typeof t!="symbol"?t+"":t,n);var qh=Ds(Kh=>{"use strict";Object.defineProperty(Kh,"__esModule",{value:!0});var Yh;function Vh(){if(Yh===void 0)throw new Error("No runtime abstraction layer installed");return Yh}(function(e){function t(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");Yh=n}e.install=t})(Vh||(Vh={}));Kh.default=Vh});var Zh=Ds(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.boolean=RD;Ln.string=g_;Ln.number=bD;Ln.error=SD;Ln.func=ND;Ln.array=y_;Ln.stringArray=LD;function RD(e){return e===!0||e===!1}function g_(e){return typeof e=="string"||e instanceof String}function bD(e){return typeof e=="number"||e instanceof Number}function SD(e){return e instanceof Error}function ND(e){return typeof e=="function"}function y_(e){return Array.isArray(e)}function LD(e){return y_(e)&&e.every(t=>g_(t))}});var em=Ds(Tr=>{"use strict";var PD=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 $D=PD(qh()),x_;(function(e){let t={dispose(){}};e.None=function(){return t}})(x_||(Tr.Event=x_={}));var Jh=class{constructor(){F(this,"_callbacks");F(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,$D.default)().console.error(a)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},ku=class ku{constructor(t){F(this,"_options");F(this,"_event");F(this,"_callbacks");this._options=t}get event(){return this._event||(this._event=(t,n,r)=>{this._callbacks||(this._callbacks=new Jh),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=ku._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)}};F(ku,"_noop",function(){});var Qh=ku;Tr.Emitter=Qh});var E_=Ds(wt=>{"use strict";var CD=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]})),OD=wt&&wt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),DD=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"&&CD(n,t,r[i]);return OD(n,t),n}})(),MD=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 FD=MD(qh()),BD=DD(Zh()),tm=em(),Iu;(function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:tm.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:tm.Event.None});function t(n){let r=n;return r&&(r===e.None||r===e.Cancelled||BD.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}e.is=t})(Iu||(wt.CancellationToken=Iu={}));var WD=Object.freeze(function(e,t){let n=(0,FD.default)().timer.setTimeout(e.bind(t),0);return{dispose(){n.dispose()}}}),Ru=class{constructor(){F(this,"_isCancelled",!1);F(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?WD:(this._emitter||(this._emitter=new tm.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},nm=class{constructor(){F(this,"_token")}get token(){return this._token||(this._token=new Ru),this._token}cancel(){this._token?this._token.cancel():this._token=Iu.Cancelled}dispose(){this._token?this._token instanceof Ru&&this._token.dispose():this._token=Iu.None}};wt.CancellationTokenSource=nm});var T_=Ds(te=>{"use strict";var UD=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]})),XD=te&&te.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),GD=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"&&UD(n,t,r[i]);return XD(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 di=GD(Zh()),rm;(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})(rm||(te.ErrorCodes=rm={}));var im=class e extends Error{constructor(n,r,i){super(r);F(this,"code");F(this,"data");this.code=di.number(n)?n:rm.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=im;var Yt=class Yt{constructor(t){F(this,"kind");this.kind=t}static is(t){return t===Yt.auto||t===Yt.byName||t===Yt.byPosition}toString(){return this.kind}};F(Yt,"auto",new Yt("auto")),F(Yt,"byPosition",new Yt("byPosition")),F(Yt,"byName",new Yt("byName"));var vr=Yt;te.ParameterStructures=vr;var $e=class{constructor(t,n){F(this,"method");F(this,"numberOfParams");this.method=t,this.numberOfParams=n}get parameterStructures(){return vr.auto}};te.AbstractMessageSignature=$e;var om=class extends $e{constructor(n){super(n,0);F(this,"_")}};te.RequestType0=om;var sm=class extends $e{constructor(n,r=vr.auto){super(n,1);F(this,"_parameterStructures");F(this,"_");this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};te.RequestType=sm;var am=class extends $e{constructor(n,r=vr.auto){super(n,1);F(this,"_parameterStructures");F(this,"_");this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};te.RequestType1=am;var lm=class extends $e{constructor(n){super(n,2);F(this,"_")}};te.RequestType2=lm;var cm=class extends $e{constructor(n){super(n,3);F(this,"_")}};te.RequestType3=cm;var um=class extends $e{constructor(n){super(n,4);F(this,"_")}};te.RequestType4=um;var fm=class extends $e{constructor(n){super(n,5);F(this,"_")}};te.RequestType5=fm;var dm=class extends $e{constructor(n){super(n,6);F(this,"_")}};te.RequestType6=dm;var pm=class extends $e{constructor(n){super(n,7);F(this,"_")}};te.RequestType7=pm;var hm=class extends $e{constructor(n){super(n,8);F(this,"_")}};te.RequestType8=hm;var mm=class extends $e{constructor(n){super(n,9);F(this,"_")}};te.RequestType9=mm;var gm=class extends $e{constructor(n,r=vr.auto){super(n,1);F(this,"_parameterStructures");F(this,"_");this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};te.NotificationType=gm;var ym=class extends $e{constructor(n){super(n,0);F(this,"_")}};te.NotificationType0=ym;var xm=class extends $e{constructor(n,r=vr.auto){super(n,1);F(this,"_parameterStructures");F(this,"_");this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};te.NotificationType1=xm;var Em=class extends $e{constructor(n){super(n,2);F(this,"_")}};te.NotificationType2=Em;var wm=class extends $e{constructor(n){super(n,3);F(this,"_")}};te.NotificationType3=wm;var Tm=class extends $e{constructor(n){super(n,4);F(this,"_")}};te.NotificationType4=Tm;var vm=class extends $e{constructor(n){super(n,5);F(this,"_")}};te.NotificationType5=vm;var _m=class extends $e{constructor(n){super(n,6);F(this,"_")}};te.NotificationType6=_m;var Am=class extends $e{constructor(n){super(n,7);F(this,"_")}};te.NotificationType7=Am;var km=class extends $e{constructor(n){super(n,8);F(this,"_")}};te.NotificationType8=km;var Im=class extends $e{constructor(n){super(n,9);F(this,"_")}};te.NotificationType9=Im;var w_;(function(e){function t(i){let o=i;return o&&di.string(o.method)&&(di.string(o.id)||di.number(o.id))}e.isRequest=t;function n(i){let o=i;return o&&di.string(o.method)&&i.id===void 0}e.isNotification=n;function r(i){let o=i;return o&&(o.result!==void 0||!!o.error)&&(di.string(o.id)||di.number(o.id)||o.id===null)}e.isResponse=r})(w_||(te.Message=w_={}))});var Yk={};_p(Yk,{nodeReadFile:()=>LF});async function LF(){throw new Error("nowline: filesystem readers are unavailable in the browser embed")}var Vk=_N(()=>{});var rX={};_p(rX,{EmbedRenderError:()=>Ol,__resetForTests:()=>nX,init:()=>Gx,initialize:()=>JU,parse:()=>eX,render:()=>QU,run:()=>tX,sha:()=>qU,version:()=>KU});function Xe(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 $t(e){return typeof e=="object"&&e!==null&&typeof e.$refText=="string"&&"items"in e}function Vx(e){return typeof e=="object"&&e!==null&&typeof e.name=="string"&&typeof e.type=="string"&&typeof e.path=="string"}function Bi(e){return typeof e=="object"&&e!==null&&typeof e.info=="object"&&typeof e.message=="string"}var Fi=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 Xe(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 Wl(e){return typeof e=="object"&&e!==null&&typeof e.tokenType=="object"}function Ul(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+=IN(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(Xl(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(Xl(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 IN(e){return typeof e=="string"?e:typeof e>"u"?"undefined":typeof e.toString=="function"?e.toString():Object.prototype.toString.call(e)}function Xl(e){return!!e&&typeof e[Symbol.iterator]=="function"}var zl=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(Xl(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++];Xl(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}):zl}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}},Gl;(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})(Gl||(Gl={}));function Hl(e,t={}){for(let[n,r]of Object.entries(e))n.startsWith("$")||(Array.isArray(r)?r.forEach((i,o)=>{Xe(i)&&(i.$container=e,i.$containerProperty=n,i.$containerIndex=o,t.deep&&Hl(i,t))}):Xe(r)&&(r.$container=e,r.$containerProperty=n,t.deep&&Hl(r,t)))}function Wi(e,t){let n=e;for(;n;){if(t(n))return n;n=n.$container}}function at(e){let n=Ms(e).$document;if(!n)throw new Error("AST node has no document.");return n}function Ms(e){for(;e.$container;)e=e.$container;return e}function Ip(e){return it(e)?e.ref?[e.ref]:[]:$t(e)?e.items.map(t=>t.ref):[]}function jl(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(Xe(o)){if(r.keyIndex++,kp(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(Xe(a)&&kp(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=>jl(n,t))}function yt(e,t){if(e){if(t?.range&&!kp(e,t.range))return new Qn(e,()=>[])}else throw new Error("Root node must be an AstNode.");return new Qn(e,n=>jl(n,t),{includeRoot:!0})}function kp(e,t){if(!t)return!0;let n=e.$cstNode?.range;return n?Zx(n,t):!1}function Xr(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)||$t(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)||$t(o))return{done:!1,value:{reference:o,container:e,property:n,index:i}}}t.arrayIndex=0}}t.keyIndex++}return gt})}function Kx(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]=qx(i.defaultValue))}function qx(e){return Array.isArray(e)?[...e.map(qx)]:e}var Rt={$type:"AbstractElement",cardinality:"cardinality"};function rc(e){return he.isInstance(e,Rt.$type)}var ql={$type:"AbstractParserRule"};function tr(e){return he.isInstance(e,ql.$type)}var Yl={$type:"AbstractRule"};var Xt={$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 Zl={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function Dp(e){return he.isInstance(e,Zl.$type)}var Jx={$type:"ArrayLiteral",elements:"elements"};var bp={$type:"ArrayType",elementType:"elementType"};function rE(e){return he.isInstance(e,bp.$type)}var Hr={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function sn(e){return he.isInstance(e,Hr.$type)}var Sp={$type:"BooleanLiteral",true:"true"};function iE(e){return he.isInstance(e,Sp.$type)}var jr={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function oE(e){return he.isInstance(e,jr.$type)}var Ui={$type:"Condition"};var Jl={$type:"Conjunction",left:"left",right:"right"};function sE(e){return he.isInstance(e,Jl.$type)}var Yr={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function an(e){return he.isInstance(e,Yr.$type)}var Ql={$type:"Disjunction",left:"left",right:"right"};function aE(e){return he.isInstance(e,Ql.$type)}var Np={$type:"EndOfFile",cardinality:"cardinality"};function lE(e){return he.isInstance(e,Np.$type)}var Gr={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};var Qx={$type:"GrammarImport",path:"path"};var Xi={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function Vr(e){return he.isInstance(e,Xi.$type)}var Lp={$type:"InferredType",name:"name"};function ic(e){return he.isInstance(e,Lp.$type)}var yn={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function Kr(e){return he.isInstance(e,yn.$type)}var Rp={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};var eE={$type:"InfixRuleOperators",precedences:"precedences"};var Us={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function cE(e){return he.isInstance(e,Us.$type)}var Xs={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function Gt(e){return he.isInstance(e,Xs.$type)}var Vl={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};var Gi={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function uE(e){return he.isInstance(e,Gi.$type)}var Pp={$type:"Negation",value:"value"};function fE(e){return he.isInstance(e,Pp.$type)}var tE={$type:"NumberLiteral",value:"value"};var Kl={$type:"Parameter",name:"name"};var $p={$type:"ParameterReference",parameter:"parameter"};function dE(e){return he.isInstance(e,$p.$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 ec={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function pE(e){return he.isInstance(e,ec.$type)}var zi={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function hE(e){return he.isInstance(e,zi.$type)}var Cp={$type:"ReturnType",name:"name"};function mE(e){return he.isInstance(e,Cp.$type)}var Hi={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function ln(e){return he.isInstance(e,Hi.$type)}var Gs={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function Mp(e){return he.isInstance(e,Gs.$type)}var nE={$type:"StringLiteral",value:"value"};var ji={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function gE(e){return he.isInstance(e,ji.$type)}var Ct={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};var Yi={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function yE(e){return he.isInstance(e,Yi.$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 Vi={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function Fp(e){return he.isInstance(e,Vi.$type)}var tc={$type:"Type",name:"name",type:"type"};function Bp(e){return he.isInstance(e,tc.$type)}var Fs={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};var Bs={$type:"TypeDefinition"};var Op={$type:"UnionType",types:"types"};function xE(e){return he.isInstance(e,Op.$type)}var nc={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function Wp(e){return he.isInstance(e,nc.$type)}var Ki={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function EE(e){return he.isInstance(e,Ki.$type)}var Ws={$type:"ValueLiteral"};var zs={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function wE(e){return he.isInstance(e,zs.$type)}var Hs=class extends Fi{constructor(){super(...arguments),this.types={AbstractElement:{name:Rt.$type,properties:{cardinality:{name:Rt.cardinality,optional:!0}},superTypes:[]},AbstractParserRule:{name:ql.$type,properties:{},superTypes:[Yl.$type,Xt.$type]},AbstractRule:{name:Yl.$type,properties:{},superTypes:[]},AbstractType:{name:Xt.$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:Xt.$type,optional:!0}},superTypes:[Rt.$type]},Alternatives:{name:Zl.$type,properties:{cardinality:{name:Zl.cardinality,optional:!0},elements:{name:Zl.elements,defaultValue:[]}},superTypes:[Rt.$type]},ArrayLiteral:{name:Jx.$type,properties:{elements:{name:Jx.elements,defaultValue:[]}},superTypes:[Ws.$type]},ArrayType:{name:bp.$type,properties:{elementType:{name:bp.elementType}},superTypes:[Bs.$type]},Assignment:{name:Hr.$type,properties:{cardinality:{name:Hr.cardinality,optional:!0},feature:{name:Hr.feature},operator:{name:Hr.operator},predicate:{name:Hr.predicate,optional:!0},terminal:{name:Hr.terminal}},superTypes:[Rt.$type]},BooleanLiteral:{name:Sp.$type,properties:{true:{name:Sp.true,defaultValue:!1}},superTypes:[Ui.$type,Ws.$type]},CharacterRange:{name:jr.$type,properties:{cardinality:{name:jr.cardinality,optional:!0},left:{name:jr.left},lookahead:{name:jr.lookahead,optional:!0},parenthesized:{name:jr.parenthesized,defaultValue:!1,optional:!0},right:{name:jr.right,optional:!0}},superTypes:[Ct.$type]},Condition:{name:Ui.$type,properties:{},superTypes:[]},Conjunction:{name:Jl.$type,properties:{left:{name:Jl.left},right:{name:Jl.right}},superTypes:[Ui.$type]},CrossReference:{name:Yr.$type,properties:{cardinality:{name:Yr.cardinality,optional:!0},deprecatedSyntax:{name:Yr.deprecatedSyntax,defaultValue:!1},isMulti:{name:Yr.isMulti,defaultValue:!1},terminal:{name:Yr.terminal,optional:!0},type:{name:Yr.type,referenceType:Xt.$type}},superTypes:[Rt.$type]},Disjunction:{name:Ql.$type,properties:{left:{name:Ql.left},right:{name:Ql.right}},superTypes:[Ui.$type]},EndOfFile:{name:Np.$type,properties:{cardinality:{name:Np.cardinality,optional:!0}},superTypes:[Rt.$type]},Grammar:{name:Gr.$type,properties:{imports:{name:Gr.imports,defaultValue:[]},interfaces:{name:Gr.interfaces,defaultValue:[]},isDeclared:{name:Gr.isDeclared,defaultValue:!1},name:{name:Gr.name,optional:!0},rules:{name:Gr.rules,defaultValue:[]},types:{name:Gr.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:Qx.$type,properties:{path:{name:Qx.path}},superTypes:[]},Group:{name:Xi.$type,properties:{cardinality:{name:Xi.cardinality,optional:!0},elements:{name:Xi.elements,defaultValue:[]},guardCondition:{name:Xi.guardCondition,optional:!0},predicate:{name:Xi.predicate,optional:!0}},superTypes:[Rt.$type]},InferredType:{name:Lp.$type,properties:{name:{name:Lp.name}},superTypes:[Xt.$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:Xt.$type,optional:!0}},superTypes:[ql.$type]},InfixRuleOperatorList:{name:Rp.$type,properties:{associativity:{name:Rp.associativity,optional:!0},operators:{name:Rp.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:eE.$type,properties:{precedences:{name:eE.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:Us.$type,properties:{attributes:{name:Us.attributes,defaultValue:[]},name:{name:Us.name},superTypes:{name:Us.superTypes,defaultValue:[],referenceType:Xt.$type}},superTypes:[Xt.$type]},Keyword:{name:Xs.$type,properties:{cardinality:{name:Xs.cardinality,optional:!0},predicate:{name:Xs.predicate,optional:!0},value:{name:Xs.value}},superTypes:[Rt.$type]},NamedArgument:{name:Vl.$type,properties:{calledByName:{name:Vl.calledByName,defaultValue:!1},parameter:{name:Vl.parameter,referenceType:Kl.$type,optional:!0},value:{name:Vl.value}},superTypes:[]},NegatedToken:{name:Gi.$type,properties:{cardinality:{name:Gi.cardinality,optional:!0},lookahead:{name:Gi.lookahead,optional:!0},parenthesized:{name:Gi.parenthesized,defaultValue:!1,optional:!0},terminal:{name:Gi.terminal}},superTypes:[Ct.$type]},Negation:{name:Pp.$type,properties:{value:{name:Pp.value}},superTypes:[Ui.$type]},NumberLiteral:{name:tE.$type,properties:{value:{name:tE.value}},superTypes:[Ws.$type]},Parameter:{name:Kl.$type,properties:{name:{name:Kl.name}},superTypes:[]},ParameterReference:{name:$p.$type,properties:{parameter:{name:$p.parameter,referenceType:Kl.$type}},superTypes:[Ui.$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:Xt.$type,optional:!0}},superTypes:[ql.$type]},ReferenceType:{name:ec.$type,properties:{isMulti:{name:ec.isMulti,defaultValue:!1},referenceType:{name:ec.referenceType}},superTypes:[Bs.$type]},RegexToken:{name:zi.$type,properties:{cardinality:{name:zi.cardinality,optional:!0},lookahead:{name:zi.lookahead,optional:!0},parenthesized:{name:zi.parenthesized,defaultValue:!1,optional:!0},regex:{name:zi.regex}},superTypes:[Ct.$type]},ReturnType:{name:Cp.$type,properties:{name:{name:Cp.name}},superTypes:[]},RuleCall:{name:Hi.$type,properties:{arguments:{name:Hi.arguments,defaultValue:[]},cardinality:{name:Hi.cardinality,optional:!0},predicate:{name:Hi.predicate,optional:!0},rule:{name:Hi.rule,referenceType:Yl.$type}},superTypes:[Rt.$type]},SimpleType:{name:Gs.$type,properties:{primitiveType:{name:Gs.primitiveType,optional:!0},stringType:{name:Gs.stringType,optional:!0},typeRef:{name:Gs.typeRef,referenceType:Xt.$type,optional:!0}},superTypes:[Bs.$type]},StringLiteral:{name:nE.$type,properties:{value:{name:nE.value}},superTypes:[Ws.$type]},TerminalAlternatives:{name:ji.$type,properties:{cardinality:{name:ji.cardinality,optional:!0},elements:{name:ji.elements,defaultValue:[]},lookahead:{name:ji.lookahead,optional:!0},parenthesized:{name:ji.parenthesized,defaultValue:!1,optional:!0}},superTypes:[Ct.$type]},TerminalElement:{name:Ct.$type,properties:{cardinality:{name:Ct.cardinality,optional:!0},lookahead:{name:Ct.lookahead,optional:!0},parenthesized:{name:Ct.parenthesized,defaultValue:!1,optional:!0}},superTypes:[Rt.$type]},TerminalGroup:{name:Yi.$type,properties:{cardinality:{name:Yi.cardinality,optional:!0},elements:{name:Yi.elements,defaultValue:[]},lookahead:{name:Yi.lookahead,optional:!0},parenthesized:{name:Yi.parenthesized,defaultValue:!1,optional:!0}},superTypes:[Ct.$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:[Yl.$type]},TerminalRuleCall:{name:Vi.$type,properties:{cardinality:{name:Vi.cardinality,optional:!0},lookahead:{name:Vi.lookahead,optional:!0},parenthesized:{name:Vi.parenthesized,defaultValue:!1,optional:!0},rule:{name:Vi.rule,referenceType:er.$type}},superTypes:[Ct.$type]},Type:{name:tc.$type,properties:{name:{name:tc.name},type:{name:tc.type}},superTypes:[Xt.$type]},TypeAttribute:{name:Fs.$type,properties:{defaultValue:{name:Fs.defaultValue,optional:!0},isOptional:{name:Fs.isOptional,defaultValue:!1},name:{name:Fs.name},type:{name:Fs.type}},superTypes:[]},TypeDefinition:{name:Bs.$type,properties:{},superTypes:[]},UnionType:{name:Op.$type,properties:{types:{name:Op.types,defaultValue:[]}},superTypes:[Bs.$type]},UnorderedGroup:{name:nc.$type,properties:{cardinality:{name:nc.cardinality,optional:!0},elements:{name:nc.elements,defaultValue:[]}},superTypes:[Rt.$type]},UntilToken:{name:Ki.$type,properties:{cardinality:{name:Ki.cardinality,optional:!0},lookahead:{name:Ki.lookahead,optional:!0},parenthesized:{name:Ki.parenthesized,defaultValue:!1,optional:!0},terminal:{name:Ki.terminal}},superTypes:[Ct.$type]},ValueLiteral:{name:Ws.$type,properties:{},superTypes:[]},Wildcard:{name:zs.$type,properties:{cardinality:{name:zs.cardinality,optional:!0},lookahead:{name:zs.lookahead,optional:!0},parenthesized:{name:zs.parenthesized,defaultValue:!1,optional:!0}},superTypes:[Ct.$type]}}}},he=new Hs;function js(e){return new Qn(e,t=>Jn(t)?t.content:[],{includeRoot:!0})}function _E(e,t){for(;e.container;)if(e=e.container,e===t)return!0;return!1}function AE(e){return{start:{line:e.startLine-1,character:e.startColumn-1},end:{line:e.endLine-1,character:e.endColumn}}}function Ys(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 qi(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 RN(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 Zx(e,t){return RN(e,t)>xn.After}var kE=/^[\w\p{L}]$/u;function IE(e,t){if(e){let n=bN(e,!0);if(n&&vE(n,t))return n;if(Ul(e)){let r=e.content.findIndex(i=>!i.hidden);for(let i=r-1;i>=0;i--){let o=e.content[i];if(vE(o,t))return o}}}}function vE(e,t){return Wl(e)&&t.includes(e.tokenType.name)}function bN(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 uc={};_p(uc,{findAssignment:()=>Qp,findNameAssignment:()=>lc,findNodeForKeyword:()=>Zp,findNodeForProperty:()=>Qs,findNodesForKeyword:()=>ON,findNodesForKeywordInternal:()=>Jp,findNodesForProperty:()=>Kp,getActionAtElement:()=>CE,getActionType:()=>DE,getAllReachableRules:()=>Js,getAllRulesUsedForCrossReferences:()=>CN,getCrossReferenceTerminal:()=>Yp,getEntryRule:()=>NE,getExplicitRuleType:()=>cc,getHiddenRules:()=>LE,getRuleType:()=>eh,getRuleTypeName:()=>WN,getTypeName:()=>ir,isArrayCardinality:()=>MN,isArrayOperator:()=>FN,isCommentTerminal:()=>Vp,isDataType:()=>BN,isDataTypeRule:()=>ea,isOptionalCardinality:()=>DN,terminalRegex:()=>Ji});var Vs=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 ie(e){return e.charCodeAt(0)}function oc(e,t){Array.isArray(e)?e.forEach(function(n){t.push(n)}):t.push(e)}function Zi(e,t){if(e[t]===!0)throw"duplicate flag "+t;let n=e[t];e[t]=!0}function qr(e){if(e===void 0)throw Error("Internal Error - Should never get here!");return!0}function Ks(){throw Error("Internal Error - Should never get here!")}function Up(e){return e.type==="Character"}var qs=[];for(let e=ie("0");e<=ie("9");e++)qs.push(e);var Zs=[ie("_")].concat(qs);for(let e=ie("a");e<=ie("z");e++)Zs.push(e);for(let e=ie("A");e<=ie("Z");e++)Zs.push(e);var Xp=[ie(" "),ie("\f"),ie(`
|
|
3
3
|
`),ie("\r"),ie(" "),ie("\v"),ie(" "),ie("\xA0"),ie("\u1680"),ie("\u2000"),ie("\u2001"),ie("\u2002"),ie("\u2003"),ie("\u2004"),ie("\u2005"),ie("\u2006"),ie("\u2007"),ie("\u2008"),ie("\u2009"),ie("\u200A"),ie("\u2028"),ie("\u2029"),ie("\u202F"),ie("\u205F"),ie("\u3000"),ie("\uFEFF")];var SN=/[0-9a-fA-F]/,sc=/[0-9]/,NN=/[1-9]/,Zr=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":Zi(r,"global");break;case"i":Zi(r,"ignoreCase");break;case"m":Zi(r,"multiLine");break;case"u":Zi(r,"unicode");break;case"y":Zi(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}}qr(n);let r=this.disjunction();return this.consumeChar(")"),{type:n,value:r,loc:this.loc(t)}}return Ks()}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;qr(n);break}if(!(t===!0&&n===void 0)&&qr(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()),qr(t)?(t.loc=this.loc(n),this.isQuantifier()&&(t.quantifier=this.quantifier()),t):Ks()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[ie(`
|
|
4
4
|
`),ie("\r"),ie("\u2028"),ie("\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=Xp;break;case"S":t=Xp,n=!0;break;case"w":t=Zs;break;case"W":t=Zs,n=!0;break}return qr(t)?{type:"Set",value:t,complement:n}:Ks()}controlEscapeAtom(){let t;switch(this.popChar()){case"f":t=ie("\f");break;case"n":t=ie(`
|
|
@@ -2917,5 +2917,5 @@ ${n}`),this.inline?`{${i}}`:i}};function sM(e,t,n){if(e==="linkplain"||e==="link
|
|
|
2917
2917
|
`);)r--;for(;r>=0&&(t[r]===" "||t[r]===" ");)r--;return r<0||t[r]!=="\\"}},hR={parser:{TokenBuilder:()=>new by({indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[["[","]"]]}),Lexer:e=>new Ef(e),ParserConfig:()=>({maxLookahead:4}),ValueConverter:()=>new Ry},validation:{NowlineValidator:()=>new wd}};function Sy(e={}){let t=e.shared??Bo(xf(wf),ak),n=Bo(yf({shared:t}),lk,hR);return t.ServiceRegistry.register(n),pR(n),{shared:t,Nowline:n}}function Ny(e,t){return t.code===void 0?t.message:Qt(e,t.code,...t.args??[])}function Pi(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=Ts(t),o=n.map(u=>gl(u,i)),s=new WeakMap,a=new WeakMap,c=u=>{let f=ld(u,r);for(let[d,p]of f.waveOf)s.set(d,p);for(let[d,p]of f.leadOf)a.set(d,p)};c([...t.swimlanes.values()]);for(let u of t.isolatedRegions)c([...u.content.swimlanes.values()]);let l=u=>Ve(u)?s.get(u):void 0;return{waves:n,index:r,floors:o,waveOf:s,leadOf:a,memberWave:l,isMember:(u,f)=>{let d=l(u);return d!==void 0&&(f===void 0||d===f)}}}var _l="en-US",t2={"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 mR(e,t){return t??e??_l}function Gn(e){let t={};for(let n of n2(e)){let r=t2[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 gR(e,t){return e.wavesDeclaredPlaceholder.replace("{names}",()=>t.join(", "))}function n2(e){let t=[],n=r2(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(_l)||t.push(_l),t}function r2(e){return e.split("-").map((n,r)=>r===0?n.toLowerCase():/^[a-zA-Z]{2}$/.test(n)?n.toUpperCase():n).join("-")}function Td(e){return e==="hide"||e==="show"}var yR={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"},Ly={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 xR={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"},Py={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 ER={red:"#e53935",blue:"#1e88e5",yellow:"#fdd835",green:"#43a047",orange:"#fb8c00",purple:"#8e24aa",gray:"#9e9e9e",navy:"#0d47a1",white:"#ffffff"},jn={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"},$y={name:"light",surface:{page:"#f8fafc",chart:"#ffffff",headerBox:"#ffffff"},entities:{roadmap:{...jn,headerHeight:"md",padding:"md"},swimlane:{...jn,fg:"#334155",text:"#334155",padding:"sm",spacing:"none",textSize:"sm"},item:{...jn,bg:"#ffffff",fg:"#94a3b8",text:"#0f172a",shadow:"subtle",cornerRadius:"sm"},parallel:{...jn,bg:"#635cf1",bracket:"dashed",padding:"xs"},group:{...jn,bg:"#ea9818",bracket:"solid",padding:"xs",fg:"#475569"},anchor:{...jn,bg:"#0f172a",fg:"#0f172a",text:"#0f172a",cornerRadius:"sm"},milestone:{...jn,bg:"#312e81",fg:"#312e81",text:"#ffffff",border:"solid"},footnote:{...jn,bg:"none",fg:"#475569",text:"#475569",textSize:"sm"},label:{...jn,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 wR=["light","dark","grayscale"],Cy={light:$y,dark:Ly,grayscale:Py};var i2={greyscale:"grayscale"};function Oy(e){let t=e.toLowerCase(),n=i2[t]??t;return wR.find(r=>r===n)}var o2={grey:"gray",violet:"purple"};function Yn(e,t){if(e==="none")return"none";if(e.startsWith("#"))return e;let n=t.name==="dark"?yR:t.name==="grayscale"?xR:ER,r=o2[e]??e,i=n[r];return typeof i=="string"?i:e}function s2(e,t){return{bg:Yn(e.bg,t),fg:Yn(e.fg,t),text:Yn(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 TR(e,t,n,r){switch(t){case"bg":e.bg=Yn(n,r);break;case"fg":e.fg=Yn(n,r);break;case"text":e.text=Yn(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=Al(n,"xl");break;case"padding":e.padding=Al(n,"xl");break;case"spacing":e.spacing=Al(n,"xl");break;case"header-height":e.headerHeight=Al(n,"xl");break;case"corner-radius":e.cornerRadius=Al(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":Td(n)&&(e.nonWorking=n);break;default:break}}function Al(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 a2(e,t,n){if(t)for(let r of t.properties)TR(e,q(r),r.value,n)}function l2(e,t,n){for(let r of t){let i=q(r);r.value!==void 0&&TR(e,i,r.value,n)}}function be(e,t,n){let r=n.theme.entities[e],i=s2(r,n.theme);for(let o of Sf(e,t,n))switch(o.level){case"default":case"inline":l2(i,o.props,n.theme);break;case"label":break;default:a2(i,o.decl,n.theme)}return i}function vR(e,t){return be("label",e.properties,t)}function AR(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 l=/^(\d+)([dwmqy])$/.exec(r);if(l){let u=Math.max(1,parseInt(l[1],10));switch(l[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=Dy(i)*u,s=1}}let a=s??jA[i]??4,c=l=>s===void 0&&!l?{labelEveryDefault:!0}:{};if(t){let l=_t(t.properties,"label-every"),u=l&&parseInt(l.value,10)||0,f=u!==0?Math.max(1,u):a;return{unit:i,labelEvery:f,pixelsPerUnit:o??Dy(i),...c(u!==0)}}return{unit:i,labelEvery:a,pixelsPerUnit:o??Dy(i),...c(!1)}}function Dy(e){switch(e){case"days":return XA;case"weeks":return 40;case"months":return 80;case"quarters":return 160;case"years":return 320}}var c2=.5,My=.5,kl=7;function Mr(e){return e==="months"||e==="quarters"||e==="years"}function vd(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 u2(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 $i(e,t,n,r,i){let o=Math.ceil(t-1e-6);if(i?.hasNonWorkingDays){if(!Mr(n)&&o<=0)return 0;let a=o<=0?e:Ue(i.dateAtWorkingIndex(e,o-1),1),c=Mr(n)?_R(a,n):n==="weeks"?kR(a,e,i.weekStart):a;return i.workingIndexOf(e,c)}if(!Mr(n))return Math.ceil(t/r)*r;let s=Ue(e,o);return At(e,_R(s,n))}function _R(e,t){return u2(e,t)?e:vd(e,t)}function kR(e,t,n){let r=n===void 0?-At(t,e):n-e.getUTCDay();return Ue(e,(r%kl+kl)%kl)}function f2(e,t,n){return kR(Ue(e,1),t,n)}function _d(e,t,n,r=_l){if(e.calendar?.hasNonWorkingDays)return d2(e,t,e.calendar,r);if(Mr(t.unit))return x2(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,c=[];for(let l=0;l<a;l++){let u=l*i,f=e.originX+u*e.pixelsPerDay,d=l%t.labelEvery===0,p=l===a-1;c.push({x:f,labelX:p?void 0:f+o/2,major:d,label:d&&!p?Wy(t.unit,Ue(e.domain[0],u),l,r):void 0})}return c}function d2(e,t,n,r){let{unit:i}=t,[o,s]=e.domain,a=E=>Mr(i)?vd(E,i):i==="weeks"?f2(E,o,n.weekStart):Ue(E,1),c=[o];for(let E=a(o);E<s;E=a(E))c.push(E);let l=e.forward(s),u=[];c.forEach((E,y)=>{let x=e.forward(E);(y+1<c.length?e.forward(c[y+1]):l)>x&&!m2(e,i,c,y)&&u.push({date:E,x})});let f=i==="days"&&t.labelEveryDefault===!0&&n.weekStart!==void 0,d=(E,y)=>f?h2(E,n,e.showsNonWorking):y%t.labelEvery===0,m=(e.showsNonWorking?EA(i):n.daysPerUnit(i))*e.pixelsPerDay,g=u.map(({date:E,x:y},x)=>{let T=(x+1<u.length?u[x+1].x:l)-y,v=d(E,x),S=v?Wy(i,E,x,r):void 0,W=S===void 0?0:se(S,ki),$=Mr(i)?x===0||x===u.length-1:T<m-c2,D=S!==void 0&&!(W>T&&$);return{x:y,columnPx:T,major:v,label:S,labelPx:W,isNarrowed:$,isShown:D}});Mr(i)||p2(g);let w=g.map(E=>({x:E.x,labelX:E.x+E.columnPx/2,major:E.major,label:E.isShown?E.label:void 0}));return s>o&&w.push({x:l,labelX:void 0,major:d(s,u.length),label:void 0}),w}function p2(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 h2(e,t,n){let r=t.weekStart;if(n)return e.getUTCDay()===r;let i=(e.getUTCDay()-r+kl)%kl;for(let o=1;o<=i;o++)if(t.isWorkingDay(Ue(e,-o)))return!1;return!0}function m2(e,t,n,r){let i=e.calendar;if(!e.showsNonWorking||!i||!Mr(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 Fy(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(l=>y2(e,l,n));let c=l=>t.some(u=>Math.abs(u.x-l)<My&&(u.major||r));return o.map(l=>{let u=e.forward(l.from),f={x:u,width:e.forward(Ue(l.through,1))-u,from:l.from,through:l.through};l.titles.length>0&&(f.titles=l.titles,f.label=RR(l,i.workingWeekdays),f.cut=!0);let d=u-s>My&&a-u>My;return n==="days"&&d&&!c(u)&&(f.seam=!0),f})}function By(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:g2(r)}))}function g2(e){let t=At(e.from,e.through)+1;return`${e.titles.join(", ")}${IR}+${t}d`}var IR=" \xB7 ";function RR(e,t){let n=0;for(let i=e.from;i<=e.through;i=Ue(i,1))t.has(i.getUTCDay())&&n++;let r=e.titles.join(", ");return n>0?`${r}${IR}${n}d`:r}function y2(e,t,n){let[r,i]=e.range,o=Math.max(r,e.forward(t.from)),s=Math.min(i,e.forward(Ue(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=RR(t,e.calendar.workingWeekdays))),(n==="days"||n==="weeks"||t.titles.length>0)&&(a.band=!0),a}function x2(e,t,n,r){let[i,o]=e.domain,s=[i];for(let l=vd(i,n);l<o;l=vd(l,n))s.push(l);o>i&&s.push(o);let a=s.map(l=>e.forward(l)),c=s.length-1;return s.map((l,u)=>{let f=a[u],d=u%t.labelEvery===0;if(u===c)return{x:f,labelX:void 0,major:d,label:void 0};let p=a[u+1]-f,m=d?Wy(n,l,u,r):void 0,g=u===0||u===c-1;return m!==void 0&&g&&se(m,ki)>p&&(m=void 0),{x:f,labelX:f+p/2,major:d,label:m}})}function Wy(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`${Gn(r).quarterPrefix}${i} ${t.getUTCFullYear()}`}case"years":return`${t.getUTCFullYear()}`}}function bR(e,t,n){let r=n.theme??"light",i=Cy[r],o=mR(n.locale,w2(e)),s={theme:i,styles:t.config.styles,defaults:t.config.defaults,labels:t.content.labels},a=be("roadmap",e.roadmapDecl?.properties??[],s);return{themeName:r,theme:i,locale:o,styleCtx:s,roadmapStyle:a}}function SR(e,t,n,r,i){let{config:o,working:s}=$f(e,t),a=AR(e,t.config.scale),{startDate:c,endDate:l}=E2(e,i,n.today,a),u=Td(n.nonWorking)?n.nonWorking:r.roadmapStyle.nonWorking,f=u==="show"&&s.hasNonWorkingDays,d=Math.max(1,s.workingIndexOf(c,l)),p=f?Math.max(1,At(c,l)):d;return{cal:o,calendar:s,preset:a,schedule:i,startDate:c,naturalEndDate:l,spanDays:d,timelineDays:p,nonWorking:u}}function E2(e,t,n,r){let i=e.roadmapDecl?.properties??[],{config:o,working:s}=t.calendar,{startDate:a}=t,c=re(i,"length"),l=0;if(c){let m=is(c,o);m>0&&(l=m)}let u=t.extent.contentEndDay;if(n&&!(l>0)){let m=s.workingIndexOf(a,n);m>0&&(u=Math.max(u,m))}let f=yA(r.unit,o),d=$i(a,u>0?u:4*o.daysPerWeek,r.unit,f,s),p=Math.max(l,d);return{startDate:a,endDate:s.dateAtWorkingIndex(a,Math.max(1,p))}}function w2(e){return _t(e.directive?.properties??[],"locale")?.value}var T2=1e-6,vs=class{constructor(t,n){F(this,"scale");F(this,"startDate");F(this,"spanDays");F(this,"unit");F(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+T2}boundaryAtOrAfterX(t){return this.boundaryAtOrAfter(this.scale.indexAtX(t))}boundaryAtOrAfter(t){return $i(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 $i(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)}};var Xy=class{constructor(t,n){F(this,"id");F(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=be("anchor",this.anchor.properties,t.styleCtx),a=t.markerRowPlacements.get(this.id),c=a?.centerY??t.timeline.markerRow.y,l={x:o,y:c},u=a?.labelBox??{x:o+6+6,y:c-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,l);let d={id:this.id,title:this.anchor.title??this.id,center:l,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=wi(i)),d}};function kd(e,t,n){let r=[];for(let[i,o]of e){let s=new Xy(i,o).place(t,n);s&&r.push(s)}return r}function Il(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,hs(e));for(let n of e.children)t=Math.max(t,Il(n));return t}function _s(e){let t=0;for(let n of e)t=Math.max(t,NR(n.children)),n.nested.length>0&&(t=Math.max(t,_s(n.nested)));return t}function NR(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,NR(n.children));return t}function Id(e){let t=0;for(let n of e)t=Math.max(t,LR(n.children)),n.nested.length>0&&(t=Math.max(t,Id(n.nested)));return t}function LR(e){let t=0;for(let n of e)n.kind==="item"?n.textSpills&&(t=Math.max(t,n.decorationsRightX)):t=Math.max(t,LR(n.children));return t}function _2(e){return e.box.y+e.box.height-Jt/2}function Gy(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:zy(e,t)}}function PR(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 zy(e,t){return e.textSpills?_2(e):e.box.y+t/2}function $R(e){let{box:t,afterDate:n,beforeDate:r,hasLinkIcon:i,footnoteCount:o}=e;if(!n&&!r)return[];let s=[],a=Dn,c=t.y+OA,l=bg(t.width);if(n){let u=Sg(t.x,i),f=l?{x:t.x-Mn-a,y:c}:{x:u,y:c};s.push({side:"after",isoDate:n,glyphTopLeft:f,glyphSize:a,spilled:l})}if(r){let u=t.x+t.width,f=Ng(u,o),d=l?{x:u+Mn,y:c}:{x:f,y:c};s.push({side:"before",isoDate:r,glyphTopLeft:d,glyphSize:a,spilled:l})}return s}function Rd(e){let{box:t,afterDate:n,beforeDate:r,title:i}=e;if(!n&&!r)return[];let o=[],s=Dn,a=t.y+(fl-s)/2,c=i?ps(t.x,!!n)+iy(i):t.x;if(n&&(c=Math.max(c,t.x+s),o.push({side:"after",isoDate:n,glyphTopLeft:{x:t.x,y:a},glyphSize:s,spilled:!1})),r){let l=t.x+t.width-Rg-s,u=c>t.x?c+Sr:t.x;o.push({side:"before",isoDate:r,glyphTopLeft:{x:Math.max(l,u),y:a},glyphSize:s,spilled:!1})}return o}function Bt(e){for(let t of e)if(_e(t))return t}function Fr(e){return{after:Be(e,"after").map(n=>{let r=_e(n);return r?{raw:n,date:r}:{raw:n,ref:n}})}}function bd(e){return e.floors.map(t=>t?_e(t.date):null)}function Sd(e,t,n,r,i=0,o){let s=n.map(l=>l??-1/0),a=[];for(let l=0;l<e;l++){let u=CR(l===0?t:a[l-1],s[l],i);a.push(l===0?u:Math.max(u,o?.S[l]??-1/0))}let c=a.map((l,u)=>Math.max(l,o?.E[u]??-1/0));for(let l=1;l<=e+1;l++){let u=r(a,c).memberEnd,f=[],d=[];for(let p=0;p<e;p++)f.push(p===0?a[0]:CR(d[p-1],s[p],i)),d.push(Math.max(f[p],u[p]??-1/0));if(OR(a,f)&&OR(c,d))return{S:a,E:c,passes:l,capped:!1};a=f,c=d}return r(a,c),{S:a,E:c,passes:e+1,capped:!0}}function CR(e,t,n){return t-e>n?t:e}function OR(e,t){for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function DR(e,t,n){return bd(e).map(r=>r?n.workingIndexOf(t,r):null)}var Ci=class{constructor(t,n){F(this,"plan");F(this,"S");F(this,"memberEnd");F(this,"binding");F(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 Nd(e,t,n,r,i,o=0){return e.waves.map((s,a)=>{let c={id:s.name,index:a+1,start:t.S[a],end:t.E[a],memberCount:n.memberCount[a]},l=n.binding[a];if(l!==void 0&&n.memberEnd[a]===t.E[a]&&t.E[a]>t.S[a]){let p=l.name??l.title;p!==void 0&&(c.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&&(c.floorRef=f),c})}var It=.5;function MR(e,t,n,r){let i=e.waves.map(()=>n);return{plan:e,ids:e.waves.map(o=>o.name),origin:n,floors:bd(e).map(o=>o?t.forward(o):null),S:i,E:i,pass:new Ci(e,i),frozen:!1,backgroundTooltip:r}}function FR(e,t,n){e.S=t,e.E=n,e.pass=new Ci(e.plan,t)}function BR(e,t){e.S=t.S,e.E=t.E,e.frozen=!0,e.solve=t}function Ld(e,t,n){e.ids.forEach((r,i)=>{t.set(r,e.S[i]),n.set(r,e.E[i])})}function Br(e,t,n){return n.waves?n.waves.pass.apply(e,t):t}function WR(e,t,n){n.waves&&!n.waves.frozen&&n.waves.pass.accumulate(e,t)}function UR(e,t){if(t.waves)return t.waves.plan.memberWave(e)!==void 0?"member":"background"}function XR(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 Hy(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,Ue(r,n))}function Pd(e,t){return t.calendar.dateAtWorkingIndex(t.timeline.startDate,Hy(e,t))}function GR(e,t,n){return Pf(n.calendar,n.timeline.startDate,Hy(e,n),Hy(t,n))}function Rl(e,t,n){return Br(e,bl(e.properties,t,n),n)}var A2=!0;function zR(){return A2}function bl(e,t,n){let{after:r}=Fr(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 HR(e,t,n){if(!n.calendar.hasNonWorkingDays)return;let r=k2(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:wi(Pd(t,n))}}function k2(e){let{after:t}=Fr(e);for(let n of t)if("date"in n)return{key:"after",raw:n.raw,date:n.date}}function As(e,t,n){return e.scale.showsNonWorking?e.scale.advanceX(t,n)-t:n*e.timeline.pixelsPerDay}function Sl(e,t){return{x:e,startX:e,y:t,height:0}}function jR(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 $d(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:os(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,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 I2=12,R2=4,Cd=13,b2=11;function S2(e,t){return(e?se(e,b2):0)+t}function Dd(e){return Math.max(0,Math.min(UA,(e-Pg)/2))}function jy(e){return Math.max(Pg,e-2*Dd(e))}function YR(e){if(!/[\r\n]/.test(e))return;let t=e.replace(/\r\n?/g,`
|
|
2918
2918
|
`).split(`
|
|
2919
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 N2(e,t,n,r=t){let i=e,o=YR(e);if(o){if(o.length>=2)return{textSpills:!(n<=t&&o.every((l,u)=>se(l,Cd)<=(u===0?r:t))),titleLines:o};i=o[0]??""}let s=i.length>0&&se(i,Cd)>r,a=n>t;if(!s&&!a)return{textSpills:!1,titleLines:[i]};if(s&&!a){let c=Ti(i,t,Cd,r);if(c.length>=2&&c.length<=vg&&c.every((l,u)=>se(l,Cd)<=(u===0?r:t)))return{textSpills:!1,titleLines:c}}return{textSpills:!0,titleLines:[i]}}function VR(e,t,n){let r=YR(e);return r&&r.length>=2?r:!t.textSpills&&!n&&t.titleLines.length>=2?t.titleLines:[r?r[0]??"":e]}function KR(e){let{visualWidth:t}=e,n=ls(!!e.hasLinkIcon,e.hasAfterGlyph?{barWidth:t}:void 0),r=Math.max(0,t-n-I2),i=S2(e.metaText,e.metaTrailingWidth??0),o=Math.max(0,t-n-(e.titleFirstLineRightReservePx??nl({barWidth:t,footnoteLabels:[],hasBeforeGlyph:!1})));return{leftInset:n,fit:N2(e.title,r,i,o)}}var L2;function qR(e,t,n){L2?.(e,t,n)}var Od=class{constructor(t){F(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(),c=t.x+Dd(r),l={x:c,y:t.y,width:i,height:s>0?a+s:a},{textSpills:u,titleLines:f}=o.fit,d=u?c+i+R2:c+o.leftInset;return{id:this.geometry.id,box:l,textX:d,textSpills:u,titleLines:f}}};function P2(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 $2(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 C2(e,t){if(e)return/^\d+(?:\.\d+)?[dwmqy]$/.test(e)||/^\d+%$/.test(e)?e:t.sizes.get(e)?.effortLiteral??e}function O2(e,t){if(e)return t.teams.get(e)?.title??t.persons.get(e)?.title??e}function D2(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 Md(e,t,n,r,i){let o=vR(e,t),s=e.name??e.title??"",a=o.padding==="none"?"xs":o.padding,c=BA[a],l=Math.max(20,Math.round(s.length*5.5+c*2));return i!==void 0&&(l=Math.min(l,i)),{text:s,style:o,box:{x:n,y:r,width:l,height:$r}}}function M2(e,t){let n=pA(e,t.sizes,t.cal),r=fA(re(e,"remaining"),t.sizes,t.cal),i=re(e,"status"),o=P2(i),s=$2(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 F2(e,t,n,r,i,o){let s=re(e,"duration"),a=!!s&&/^\d+(?:\.\d+)?[dwmqy]$/.test(s),c=n?n.title??n.name:"",l=a?s:c||void 0,u=re(e,"remaining"),f=C2(u,t),d=O2(re(e,"owner"),t),p=()=>[l,d].filter(Boolean).join(" "),m;if(r==="in-progress"&&f){let x=p();m=x?`${x} \u2014 ${f} remaining`:`${f} remaining`}else if(r==="in-progress"&&i>0&&i<1){let x=Math.round((1-i)*100),T=p();m=T?`${T} \u2014 ${x}% remaining`:`${x}% remaining`}else(d||l)&&(m=p()||void 0);let g=re(e,"capacity"),w=Rr(g),E=null,y=0;if(w!==null){let x=Ka(w),T=qa(o,t.symbols);E={value:w,text:x,icon:T};let v=11;y=(m?se(" ",v):0)+Ei(x,T,v)}return{metaText:m,ownerDisplay:d,capacity:E,capacityTrailingWidth:y}}function B2(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 W2(e,t,n){return nl({barWidth:e,footnoteLabels:t.map(String),hasBeforeGlyph:Bt(n)!==void 0})}var U2={done:"done","in-progress":"inProgress","at-risk":"atRisk",blocked:"blocked",planned:"planned",neutral:"neutral"};function X2(e,t,n){let r=U2[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 G2(e,t,n,r,i){if(n===0)return 0;let o=r-Jt-$r-Fn,s;e&&t?s=Math.max(vi,i)+Fn:e?s=o:s=Math.max(o,i+Fn);let c=s+(n-1)*Ff+$r+Fn+Jt;return Math.max(0,c-r)}function z2(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,Qa):0)+s,c=Math.max(i,a),l=Mf({barRightX:t.barRightX,iconSpills:t.iconSpills,captionWidth:c,footnoteCount:t.visualWidth<cs?t.footnoteCount:0,dotSpills:t.visualWidth<Pr}),u=r.captionCapX(t.barRightX);if(l.rightX<=u+H2||l.captionX===null)return{lines:e,truncated:!1};let f=l.rightX-(l.captionX+c),d=u-l.captionX-f,p=!1;return{lines:e.map(g=>{let w=PA(g,d,Nr);return w!==g&&(p=!0),w}),truncated:p}}var H2=1e-6;function Fd(e,t,n){let r=e.properties,i=be("item",r,n.styleCtx),o=re(r,"size"),s=o?n.sizes.get(o)??null:null,a=jR(n,e),c=Be(r,"after"),l=Be(r,"before"),u=As(n,t,a),f=jy(u),d=D2(re(r,"link")),p=d.icon!=="none",m=jy(u),g=Be(r,"labels"),w=[];for(let G of g){let X=n.labels.get(G);if(!X)continue;let Q=Md(X,n.styleCtx,0,0);w.push({id:X,width:Q.box.width})}let E=0;for(let G=0;G<w.length;G+=1)G>0&&(E+=Bn),E+=w[G].width;let y=Math.max(0,m-2*On),x=w.length>0&&E>y,{status:T,progress:v}=M2(r,n),S=X2(i,T,n.styleCtx.theme),W=F2(r,n,s,T,v,S.capacityIcon),$=e.title??e.name??"",D=B2(e.name,n),H=KR({title:$,visualWidth:f,metaText:W.metaText,metaTrailingWidth:W.capacityTrailingWidth,hasLinkIcon:p,hasAfterGlyph:Bt(c)!==void 0,titleFirstLineRightReservePx:W2(m,D,l)}),P=p&&f<Ig,I=H.fit.textSpills||P,R=z2(VR($,H.fit,P),{textSpills:I,iconSpills:P,barRightX:t+Dd(u)+f,visualWidth:f,footnoteCount:D.length,meta:W},n),O=R.lines,_=x?MA(w,f):null,b=_?_.rows.length:w.length>0?1:0,L=W.metaText!==void 0||W.capacity!==null,M=Df(O.length,L),N=_g(O.length,L),B=G2(x,I,b,n.bandScale.bandwidth(),M);return{node:e,id:e.name??"",startX:t,durationDays:a,naturalWidth:u,visualWidth:f,naturalVisualWidth:m,style:S,size:s,status:T,progress:v,meta:W,link:d,chips:{samples:w,outside:x,pack:_,rowCount:b},footnoteIndicators:D,caption:{...H,title:$,iconSpills:P,lines:O,truncated:R.truncated,lastBaseline:M},barExtra:Math.max(N,B)}}function Bd(e,t,n,r){let i=e.properties,o=Be(i,"after"),s=Be(i,"before"),a=bl(i,t.x,n);n.waves&&(a=Br(e,a,n));let c=HR(i,a,n),l=n.scale.startX(a),u=r??Fd(e,l,n);if(u.startX!==l)throw new Error(`layout: item "${e.name??e.title??"(unnamed)"}" was measured at x ${u.startX} but placed at x ${l}`);let{naturalWidth:f,style:d,status:p,progress:m,footnoteIndicators:g,caption:w}=u,{metaText:E,ownerDisplay:y,capacity:x,capacityTrailingWidth:T}=u.meta,v=u.link,S=v.icon!=="none",W=u.chips.samples,$=u.chips.outside,D=l,H=l+f,P=l+As(n,l,u.durationDays),I=!1,R,O;if(s.length>0){let qe,Zn;for(let Pt of s){let $s=_e(Pt),Cs=$s?n.scale.forwardWithinDomain($s)??void 0:n.entityLeftEdges.get(Pt);Cs!==void 0&&(qe===void 0||Cs<qe)&&(qe=Cs,Zn=Pt)}qe!==void 0&&P>qe&&(I=!0,R={x:qe,y:t.y,width:H-qe,height:n.bandScale.bandwidth()},O=Zn)}let _=w.title,b=new Od(u),L={time:n.scale,bands:n.bandScale,style:d},M=b.place({x:D,y:t.y},L),N=M.box,B=n.bandScale.bandwidth(),G=N.width<Pr,X=w.iconSpills,Q=N.width<cs,j=M.textSpills||X,ne=w.lines,A=u.chips.pack,C=w.lastBaseline,U=u.barExtra,z=[],J=N.y+B-Jt-$r-Fn,Z=N.y+($&&j?Math.max(vi,C):C)+Fn,oe=$&&j||!$&&W.length>0?Math.max(J,Z):J,ge=$?N.x+N.width+Mn:N.x+On,ue=ge;if(A)for(let qe=0;qe<A.rows.length;qe+=1){let Zn=oe+qe*Ff,Pt=ge;for(let Cs of A.rows[qe]){let jx=Md(Cs.id,n.styleCtx,Pt,Zn);z.push(jx),Pt+=jx.box.width+Bn}let $s=Pt-Bn;$s>ue&&(ue=$s)}else{let qe=ge;for(let Zn of W){let Pt=Md(Zn.id,n.styleCtx,qe,oe);z.push(Pt),qe+=Pt.box.width+Bn}ue=W.length>0?qe-Bn:ge}let fe=y??re(i,"owner"),rt=e.description?.text,ht=g.length>0&&Q,mt=null;if(j){let qe=Math.max(...ne.map(Pt=>se(Pt,Nr))),Zn=(E?se(E,11):0)+T;mt=Math.max(qe,Zn)}let Bl=Mf({barRightX:N.x+N.width,iconSpills:X,captionWidth:mt,footnoteCount:ht?g.length:0,dotSpills:G}),{iconSpillX:pN,footnoteSpillStartX:hN,dotSpillCx:mN}=Bl,gN=Math.max(N.x+N.width,Bl.rightX),Ps=e.name;Ps&&(n.entityLeftEdges.set(Ps,D),n.entityRightEdges.set(Ps,P)),WR(e,P,n);let zx=Ps??Yy(e);n.itemFlowKey.set(zx,n.currentFlowKey),t.startX=D,t.x=P,t.height=Math.max(t.height,n.bandScale.step()+U);let Hx=$R({box:N,afterDate:Bt(o),beforeDate:Bt(s),hasLinkIcon:S,footnoteCount:g.length}),Ur={kind:"item",id:Ps,title:_,...ne.length>=2||ne[0]!==_?{titleLines:ne}:{},box:N,dateSpan:{startX:D,endX:H},status:p,progressFraction:m,footnoteIndicators:g,labelChips:z,chipsOutside:$,chipsRightX:ue,linkIcon:v.icon,linkHref:v.href,hasOverflow:I,overflowBox:R,overflowAnchorId:O,owner:fe,description:rt,metaText:E,textSpills:j,dotSpills:G,iconSpills:X,footnoteSpills:ht,dotSpillCx:mN,iconSpillX:pN,footnoteSpillStartX:hN,decorationsRightX:gN,capacity:x,size:u.size,style:d,inlineDatePins:Hx.length>0?Hx:void 0},vp=UR(e,n);return vp!==void 0&&(Ur.waveRole=vp),c!==void 0&&(Ur.nonWorkingPin=c),w.truncated&&(Ur.titleTruncated=!0),vp==="background"&&n.waves&&(Ur.waveTooltip=n.waves.backgroundTooltip),n.placedItems.set(zx,Ur),qR(b,L,Ur),Ur}function Yy(e){let t=e.$cstNode?.range.start;return`#item@${t?t.line+1:0}:${t?t.character+1:0}`}function Vy(e){let t=new Map;for(let n of J0(e))Ve(n)&&t.set(n.name??Yy(n),n);return t}var j2=.01;function Y2(e,t){let n={blocks:[],edges:[]},r=new Map,i=(a,c,l)=>{n.blocks.push({x:a,y:l,width:c,height:0})},o=(a,c)=>{let{box:l}=a;if(a.kind==="item"){n.blocks.push({...l,width:Il(a)-l.x}),n.edges.push({x:l.x,top:l.y,bottom:l.y+l.height},{x:l.x+l.width,top:l.y,bottom:l.y+l.height});return}c&&a.id&&r.set(a.id,a),a.kind==="group"&&a.waveOnly||(a.headerHeight>0&&n.blocks.push({x:l.x,y:l.y,width:Math.max(l.width,hs(a)-l.x),height:a.headerHeight}),i(l.x,l.width,l.y+l.height),n.edges.push({x:l.x,top:l.y,bottom:l.y+l.height},{x:l.x+l.width,top:l.y,bottom:l.y+l.height}));for(let u of a.children)o(u,c)},s=(a,c)=>{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.children)o(l,c);for(let l of a.nested)s(l,c)};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 c of a.nestedSwimlanes)s(c,!1)}return{obstacles:n,containers:r}}function Ky(e,t,n,r){let{obstacles:i,containers:o}=Y2(t,n),s=r.bandScale.bandwidth(),a=be("item",[],r.styleCtx),c=[];for(let[p,m]of e){let g=r.placedItems.get(p);if(!g)continue;let w=Gy(g,s);for(let E of Be(m.properties,"after")){let y=r.placedItems.get(E),x=y?void 0:o.get(E),T;if(y?T=Gy(y,s):x&&(T=PR(x)),T){c.push({fromId:E,toId:p,source:T,target:w});continue}let v=r.entityMidpoints.get(E);if(!v||w.startX-v.x<=j2)continue;let S=w.rowY??w.top;c.push({fromId:E,toId:p,waypoints:[{x:v.x,y:S},{x:w.paintedX,y:S}],slack:!0,...ms(w.bottom-w.top),style:a})}}let l=c.filter(p=>p!==null&&"source"in p),u=JA(l,i,r.scale.pixelsPerDay),f=new Map(l.map((p,m)=>[p,u[m]])),d=[];for(let p of c){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 Ud(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 Wd=11,V2=120,K2=6,ZR="\u2014 ";function QR(e,t,n,r,i=[]){let o=Ft,s=n+Ft,a=r-2*Ft,c=o+2*Ft,l=o+a-Ft,u=s+Gf+Ft,f=[],d=0,p=(g,w,E)=>{for(let[y,x]of g){let T=x.title??y,v=x.description?.text,S=q2(T,v,c,l),W=u+d*ds,$=H=>({x:H.x,y:W+H.row*ds,text:H.text}),D={number:w.footnoteIndex.get(y)??f.length+1,y:W,title:T,titleLines:S.title.map($),description:v,style:be("footnote",x.properties,w.styleCtx)};S.description.length>0&&(D.descriptionLines=S.description.map($)),E!==void 0&&(D.region=E),f.push(D),d+=S.rows}};p(e,t);for(let g of i){if(g.footnotes.size===0)continue;let w=u+d*ds;d+=1;let E=f.length;p(g.footnotes,g.ctx,g.title),f[E].regionHeadingY=w}return{box:{x:o,y:s,width:a,height:f.length===0?0:Gf+d*ds+Ft},entries:f}}function q2(e,t,n,r){let i=r-n,o=JR(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(ZR,Wd),c=t.trim().split(/\s+/)[0]??"",l=n+Math.max(V2,e.length*K2),u=o.length===1&&a+se(c,Wd)<=r-l,f=u?l:n,d=u?o.length-1:o.length,p=JR(t,i,r-f-a),m=p.map((g,w)=>({x:w===0?f:n,row:d+w,text:w===0?`${ZR}${g}`:g}));return{title:s,description:m,rows:d+p.length}}function JR(e,t,n){if(se(e,Wd)<=n)return[e];let r=Ti(e,t,Wd,n);return r.length>0?r:[e]}function eb(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)eb(n,t)}function ks(e,t){e.box.y+=t;for(let n of e.children)eb(n,t);for(let n of e.nested)ks(n,t)}function tb(e,t){e.box.y+=t;for(let n of e.nestedSwimlanes)ks(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 Nl(e,t,n){let r=[],i=(o,s,a)=>{let c=_e(re(s.properties,"date"));if(!c)return;let l=n.forwardWithinDomain(c);l!==null&&r.push({id:o,centerX:l,radius:6,title:s.title??o,fontSize:10,bold:a,date:c,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 Gd(e,t){return[...J2(e),...Q2(t)]}function Is(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 Zy(e){return`nonworking:${e.from.toISOString().slice(0,10)}`}function Jy(e){return`working:${e.from.toISOString().slice(0,10)}`}function nb(e,t,n){return{id:e,centerX:t,radius:0,title:n,fontSize:10,bold:!1}}function J2(e){let t=[];for(let n of e??[])n.label!==void 0&&t.push(nb(Zy(n),n.x,n.label));return t}function Q2(e){return(e??[]).map(t=>nb(Jy(t),t.x,t.label))}function Oi(e,t,n,r){let i=n;for(let o of e){let s=rb(o,r),a=o.centerX+o.radius+6+s,c=o.centerX-o.radius-6-s;a>n&&c<t&&(i=Math.max(i,a+st))}return i}function rb(e,t){return t(e.title,e.fontSize)*(e.bold?1.05:1)}function Rs(e,t,n,r){let i=[...e].sort((a,c)=>a.centerX-c.centerX),o=new Map,s=[];for(let a of i){let c=rb(a,r),l=a.centerX+a.radius+6,u=a.centerX-a.radius-6-c,f=l+c<=n,d=u>=t,p=a.centerX-a.radius,m=a.centerX+a.radius,g=W=>W==="right"?l:u,w=W=>W==="right"?f:d,E=(W,$)=>{let D=Math.min(p,W),H=Math.max(m,W+c);return s[$].some(P=>P.left<H&&P.right>D)},y=-1,x="right",T=l;e:for(let W=s.length-1;W>=0;W--)for(let $ of["right","left"]){if(!w($))continue;let D=g($);if(!E(D,W)){y=W,x=$,T=D;break e}}if(y===-1){for(let[W,$]of o)o.set(W,{...$,rowIndex:$.rowIndex+1});s=[[],...s],y=0,x=f?"right":"left",T=g(x)}let v=Math.min(p,T),S=Math.max(m,T+c);s[y].push({left:v,right:S}),o.set(a.id,{rowIndex:y,labelBox:{x:T,y:0,width:c,height:12},labelSide:x})}return{placements:o,rowCount:s.length}}function Qy(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?zy(i,t.bandScale.bandwidth()):t.entityMidpoints.get(r)?.y??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}`;n.push({ref:r,endX:o,y:s,flowKey:a})}return n}function ex(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 ib(e,t){return e.endX<t&&e.y>0&&e.wave===void 0}function ob(e){let t=null;for(let n of e)n.wave===void 0&&(!t||n.endX>t.endX)&&(t=n);return t}function eB(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 tx=class{constructor(t,n){F(this,"id");F(this,"milestone");this.id=t,this.milestone=n}place(t){let n=this.milestone,r=be("milestone",n.properties,t.styleCtx),i=re(n.properties,"date"),o=Be(n.properties,"after"),s=_e(i),a=t.timeline.markerRow.y,c=6,l=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 x=t.markerRowPlacements.get(this.id);x&&(f=x.centerY);let T=Qy(o,t),v=ex(T),S=ob(v);S&&S.endX>y&&(m=!0,p=[{x:S.endX,y:S.y>0?S.y:f}]),g=eB(v,y),g!==void 0&&(m=!0)}else if(o.length>0){let y=Qy(o,t),x=ex(y);x.sort((S,W)=>W.endX-S.endX);let T=x[0]?.endX??t.timeline.originX;u=T,d=!1;let v=[];for(let S=1;S<x.length;S++){let W=x[S];ib(W,T)&&v.push({x:W.endX,y:W.y})}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 E={id:this.id,title:l,x:u,radius:c,fixed:d,slackArrows:p,isOverrun:m,style:r,cutTopY:t.chartTopY,cutBottomY:t.swimlaneBottomY};return t.waves&&!m&&XR(t.waves,u)&&(E.onWaveBoundary=!0),g!==void 0&&s&&(E.overrunByWave=g,E.overrunDate=wi(s)),s&&!t.scale.showsNonWorking&&!t.calendar.isWorkingDay(s)&&(E.hiddenDate=wi(s)),E}};function zd(e,t){let n=[];for(let[r,i]of e){let o=new tx(r,i).place(t);o&&n.push(o)}return n}function Hd(e,t){return e.map(n=>{let r=t.get(n.id);if(!r)throw new Error(`layout: milestone "${n.id}" has no marker-row placement`);let i={id:n.id,title:n.title,center:{x:n.x,y:r.centerY},radius:n.radius,fixed:n.fixed,slackArrows:n.slackArrows,isOverrun:n.isOverrun,style:n.style,cutTopY:n.cutTopY,cutBottomY:n.cutBottomY,labelBox:r.labelBox,labelSide:r.labelSide};return n.onWaveBoundary&&(i.onWaveBoundary=!0),n.overrunByWave!==void 0&&(i.overrunByWave=n.overrunByWave),n.overrunDate!==void 0&&(i.overrunDate=n.overrunDate),n.hiddenDate!==void 0&&(i.hiddenDate=n.hiddenDate),i})}function sb(e,t){let n=[];for(let[r,i]of e){let o=re(i.properties,"date"),s=Be(i.properties,"after"),a=_e(o),c=Qy(s,t),l=ex(c);if(a){let f=t.scale.forwardWithinDomain(a);if(f===null)continue;let d=ob(l);d&&d.endX>f&&d.y>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(l.length===0)continue;l.sort((f,d)=>d.endX-f.endX);let u=l[0].endX;for(let f=1;f<l.length;f++){let d=l[f];ib(d,u)&&n.push({xStart:d.endX,xEnd:u,y:d.y,slackPredId:d.ref,milestoneId:r})}}return n}var Ll=16,tB=8,nB=6;function lb(e,t,n,r,i,o){nx(e.content.anchors,t);let s=zd(e.content.milestones,t),a=rB(e.content.anchors,s,t);if(a.length===0)return{anchors:[],milestones:[],laneShift:0};let c=Ll,l=Rs(a,c,Oi(a,c,o-Ll,se),se),u=n+tB,f=u+l.rowCount*26+nB-r,d=i+f,p=Is(l.placements,u);t.markerRowPlacements=p,t.chartTopY=r+f,t.swimlaneBottomY=d;let m=kd(e.content.anchors,t,new Set),g=Hd(s.map(w=>({...w,cutTopY:t.chartTopY,cutBottomY:d,slackArrows:w.slackArrows?.map(E=>({x:E.x,y:E.y+f}))})),p);return{anchors:m,milestones:g,laneShift:f}}function cb(e,t){let n=[...(e.anchors??[]).map(i=>ab(i,!1)),...(e.milestones??[]).map(i=>ab(i,!0))];return n.length===0?t:Oi(n,e.box.x+Ll,t-Ll,se)+Ll}function ub(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 rB(e,t,n){let r=Nl(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 ab(e,t){return{id:e.id??"",centerX:e.center.x,radius:e.radius,title:e.title,fontSize:10,bold:t}}function nx(e,t){for(let n of Nl(e,new Map,t.scale))t.entityLeftEdges.set(n.id,n.centerX),t.entityRightEdges.set(n.id,n.centerX)}var iB=.8,oB=1;function sB(e){let t=[];return db(e,t),t}function db(e,t){for(let n of e)if(n.kind==="item"){let r=aB(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")&&db(n.children,t)}function aB(e){return e.capacity?e.capacity.value:e.size?1:0}function pb(e){if(e.capacityValue<=0||e.warnFraction===null&&e.overFraction===null)return null;let t=sB(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],c=r[s+1],l=(a+c)/2,u=0;for(let f of t)f.startX<=l&&l<f.endX&&(u+=f.load);i.push({startX:a,endX:c,load:u,classification:lB(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 lB(e,t,n,r){let i=e/t;return r!==null&&i>=r?"red":n!==null&&i>=n?"yellow":"green"}function hb(e,t){let n=t.get("swimlane"),r=fb(re(e.properties,"utilization-warn-at"),n?re(n.properties,"utilization-warn-at"):void 0,iB),i=fb(re(e.properties,"utilization-over-at"),n?re(n.properties,"utilization-over-at"):void 0,oB);return{warn:r,over:i}}function fb(e,t,n){let i=fB(e??t);return i.kind==="unset"?n:i.kind==="none"?null:i.value}var cB=/^\d+(?:\.\d+)?%$/,uB=/^\d+\.\d+$/;function fB(e){if(e===void 0)return{kind:"unset"};if(e==="none")return{kind:"none"};if(cB.test(e)){let t=parseFloat(e)/100;return Number.isFinite(t)&&t>0?{kind:"number",value:t}:{kind:"unset"}}if(uB.test(e)){let t=parseFloat(e);return Number.isFinite(t)&&t>0?{kind:"number",value:t}:{kind:"unset"}}return{kind:"unset"}}var jd=class{constructor(t){F(this,"rows");F(this,"opts");F(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 rx(e){return Ve(e)?e.name?[e.name]:[]:vt(e).flatMap(rx)}function Yd(e,t,n,r){let i=n.bandScale.step(),o=t.leftX,s=new jd({laneLeftX:o,originY:t.firstRowY,minRowHeight:i,slackCorridors:n.slackCorridors}),a=o,c=Number.POSITIVE_INFINITY,l=new Set(vt(e).flatMap(rx)),u=[];for(let f of vt(e)){for(let $ of rx(f))l.delete($);if(!Ve(f)){let $=Rl(f,a,n),{rowIndex:D,y:H}=s.placeBlock(),P=Sl($,H),I=r.sequenceOne(f,P,n);u.push(I);let R=I.box.x+I.box.width,O=Math.max(i,P.height),_=gb(I);s.commitBlock({rowIndex:D,placed:I,blockHeight:O,blockEnd:R,spillReservation:_>R?_:null,paintedRight:Il(I)}),c=Math.min(c,P.startX),a=Math.max(a,P.x);continue}let d=f,p=Rl(d,a,n),m=n.scale.startX(p),g=Fd(d,m,n),w=m+g.naturalWidth,E=i+g.barExtra,{rowIndex:y,y:x}=s.placeItem({childId:d.name??"",desiredStart:m,desiredEnd:w,predictedHeight:E,pendingIds:l}),T=Sl(p,x),v=Bd(d,T,n,g);u.push(v),c=Math.min(c,T.startX);let S=Math.max(m+g.naturalWidth,v.box.x+v.box.width),W=m+As(n,m,g.durationDays);a=Math.max(a,W),s.commitItem({rowIndex:y,placed:v,logicalEnd:S,spillReservation:mb(v),rowHeight:E})}return c===Number.POSITIVE_INFINITY&&(c=n.scale.startX(o)),{children:u,timeCursorX:a,timeStartX:c,packer:s}}function mb(e){return e.textSpills||e.chipsOutside||e.dotSpills||e.iconSpills||e.footnoteSpills?Math.max(e.decorationsRightX,e.chipsOutside?e.chipsRightX:0)+6:null}function gb(e){let t=e.box.x+e.box.width;if(e.kind==="item")return Math.max(t,mb(e)??t);let n=hs(e);return Math.max(t,n>t?n+KA:t,...e.children.map(gb))}var yb=10;function dB(e,t,n){let r=re(e.properties,"capacity"),i=Rr(r);if(i===null)return{capacity:null,badgeWidthPx:0};let o=Ka(i),s=qa(t.capacityIcon,n),a=Ei(o,s,yb);return{capacity:{value:i,text:o,icon:s},badgeWidthPx:a}}var pB=10,hB=38,mB=8;function gB(e,t,n){let r=e.title??e.name??"";if(!r)return 0;let i=re(e.properties,"owner");return dl(0,r,i??void 0,t,n).rightX}function yB(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 xB(e,t,n){for(let r of e.content)if(r.$type!=="DescriptionDirective")return n.scale.startX(Rl(r,t,n))}var bs=class{constructor(t,n){F(this,"input");F(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=be("swimlane",r.properties,n.styleCtx),a=t.x,c=n.bandScale.step(),l=n.currentFlowKey;n.currentFlowKey=`lane:${r.name??i}`;let{capacity:u,badgeWidthPx:f}=dB(r,s,n.symbols),d=yB(r,n),p=d.length>0?se(d.join(","),yb):0,m=gB(r,f,p),g=xB(r,a,n),w=!r.title||g===void 0||g>=m+mB,E=t.y+(w?pB:hB),y=Yd(r,{leftX:a,firstRowY:E},n,o),{children:x}=y,T=E-t.y,v=Math.max(c+32,T+y.packer.usedHeight()+16),S=Math.max(y.packer.usedRightX(),m),W={x:0,y:t.y,width:0,height:v},$=re(r.properties,"owner"),D;if($){let P=n.teams.get($),I=n.persons.get($);D=P?.title??I?.title??$}let H=u?(()=>{let{warn:P,over:I}=hb(r,n.styleCtx.defaults);return pb({children:x,capacityValue:u.value,warnFraction:P,overFraction:I})})():null;return n.currentFlowKey=l,{positioned:{id:r.name,title:r.title??r.name??"",box:W,bandIndex:i,children:x,nested:[],style:s,owner:D,footnoteIndicators:d,capacity:u,utilization:H},usedHeight:v,usedRightX:S}}};var EB=18,wB=14,TB=14,vB=16,_B=32;function ix(e,t,n,r,i){let o=n+EB,s=[],a=[],c=!0,l=t.footnoteIndex.size;for(let u of e){c||(o+=vB),c=!1;let f=u.content.roadmap?.title??u.sourcePath,d=o+wB,p=$d(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:Ud(u.content.footnotes,l)});l+=u.content.footnotes.size,t.waves?Ld(t.waves,p.entityLeftEdges,p.entityRightEdges):nx(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:W,usedHeight:$}=new bs({lane:S,bandIndex:w},r).place({x:p.timeline.originX,y:g},p);m.push(W),g+=$,w++}let E=lb(u,p,o,d,g,i);if(E.laneShift!==0){for(let S of m)ks(S,E.laneShift);g+=E.laneShift}let y=g,x=Math.max(t.bandScale.bandwidth(),y-o+TB),T={x:0,y:o,width:0,height:x},v={sourcePath:u.sourcePath,label:f,box:T,nestedSwimlanes:m,style:be("swimlane",[],t.styleCtx)};E.anchors.length>0&&(v.anchors=E.anchors),E.milestones.length>0&&(v.milestones=E.milestones),s.push(v),a.push(p),o+=x}return{regions:s,contexts:a,endY:o}}function xb(e,t){let n=Vd(e,t);e.box.width=n;for(let r of e.nestedSwimlanes)r.box.width=n}function Vd(e,t){let n=e.box.x,{chromeRightX:r}=pl(n,e.label,e.sourcePath),i=_s(e.nestedSwimlanes),o=Math.max(r,i,ub(e))+_B;return Math.min(t-n,o-n)}function Eb(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=Gn(n).nowLabel,c=se(a,sl),l=Math.max($g,Math.ceil(c+2*fs)),u=t.timeline.originX-st,f=l/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:l,style:be("item",[],t.styleCtx)}}function Kd(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 wb(e){let[t,n,r]=Kd(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 qd(e,t){let n=wb(e),r=wb(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}var AB=4.5;function _b(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=Nd(e.plan,e.solve,e.pass,e.origin,e.floors,It),a=s.every(y=>y.memberCount===0),c=t.timeline.box.x,l=c+t.timeline.box.width,u=o.y+o.height/2,f=[],d=0,p=s.map((y,x)=>{let T=e.plan.waves[x],v=T.title??y.id,S=y.memberCount===0,W=Pd(y.start,t),$=GR(y.start,y.end,t),D=S?void 0:d++,H=kB(y.id,t),P=IB(T.properties,D,t),I=Math.max(y.start,c),R=Math.min(y.end,l),O=Math.max(0,R-I),_,b=!1;if(!S){if(H.length>0){let Q=H.length*Zt;_=Tb(v,y.id,x+1,O,Q),b=_!==void 0}_??(_=Tb(v,y.id,x+1,O,0))}let L=(I+R)/2,M;if(S&&(L=y.start,!a)){let Q=f.filter(j=>Math.abs(j-y.start)<It).length;f.push(y.start),L=y.start+Q*Jg,M={x:L,y:u}}let N=S?ox(W):`${ox(W)} \u2013 ${ox($)}`,B=[v,N];S?B.push(n.waveNoItems):y.heldBy!==void 0&&B.push(`${n.waveHeldBy} ${y.heldBy}`);let G,X=s[x-1];if(!a&&X!==void 0&&y.floorRef!==void 0&&y.start-X.end>It){let Q=Math.max(X.end,c),j=Math.min(y.start,l);se(y.floorRef,mn)+2*Wn<=j-Q&&(G={text:y.floorRef,x:(Q+j)/2})}return{id:y.id,title:v,index:x,...D!==void 0?{visibleOrdinal:D}:{},startX:y.start,endX:y.end,startDate:W,endDate:$,memberCount:y.memberCount,empty:S,...y.heldBy!==void 0?{heldBy:y.heldBy}:{},...y.floorRef!==void 0?{floorRef:y.floorRef}:{},columnBox:{x:y.start,y:t.chartTopY,width:y.end-y.start,height:t.swimlaneBottomY-t.chartTopY},strip:{box:{x:y.start,y:o.y,width:y.end-y.start,height:o.height},..._?{label:_.label}:{},labelKind:_?.kind??"none",labelX:L,tooltip:B.join(" \xB7 "),footnotesShown:b,...M?{marker:M}:{},...G?{gapLabel:G}:{}},style:P,footnoteIndicators:H}}),m=a?[]:SB(p,e.origin,o.y,t),g=sx(r),w=i.map(y=>sx(y.nestedSwimlanes)),E={waves:p,boundaries:m,crossings:vb(g,m),regionCrossings:w.map(y=>vb(y,m)),hasBackground:g.length+w.flat().length>0};return a&&(E.placeholder=gR(n,p.map(y=>y.title))),E}function Tb(e,t,n,r,i){let o=a=>se(a,mn)*1.05+i+2*Wn<=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 c=e.slice(0,a).trimEnd();if(c.length<3)break;let l=`${c}\u2026`;if(o(l))return{kind:"ellipsis",label:l}}let s=`#${n}`;if(o(s))return{kind:"ordinal",label:s}}function kB(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 IB(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=Yn(p,r);return m==="none"?void 0:m},c=a("bg"),l=t!==void 0&&t%2===1?r.wave.stripFillAlt:r.wave.stripFill,u=c?RB(l,c,cl)??l:l,f=i.get("border");return{...c?{tint:c}:{},stripFill:l,text:a("text")??bB(r.wave,u),boundary:a("fg")??r.wave.boundary,boundaryDash:f==="dashed"?"4 2":f==="dotted"?"1 2":null}}var Zd=/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;function RB(e,t,n){if(!Zd.test(e)||!Zd.test(t))return;let r=Kd(e),i=Kd(t);return`#${r.map((o,s)=>Math.round(o*(1-n)+i[s]*n).toString(16).padStart(2,"0")).join("")}`}function bB(e,t){let n=e.labelText;return!Zd.test(n)||!Zd.test(t)||qd(n,t)>=AB?n:qd(e.hatch,t)>=qd(e.hatchOnDark,t)?e.hatch:e.hatchOnDark}function SB(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,c)=>a.x-c.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 c=i.slice(s,a);s=a;let l=c[0].x;if(Math.abs(l-t)<It)continue;let u=(c.find(f=>f.opening)??c[0]).wave;o.push({x:l,topY:n,bottomY:r.swimlaneBottomY,stroke:u.style.boundary,dash:u.style.boundaryDash})}return o}function sx(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(...sx(r.nested));return t}function vb(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 NB="\u2070\xB9\xB2\xB3\u2074\u2075\u2076\u2077\u2078\u2079";function LB(e){return String(e).replace(/[0-9]/g,t=>NB[Number(t)])}function Ab(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),c=o.some(v=>v.footnoteIndicators.length>0&&!v.strip.footnotesShown);if(!e.hasBackground&&!s&&!a&&!c)return;let l=mn,u=v=>se(v,l),f=t.timeline.originX,d=Math.max(f,i-st),p=0,m=f,g=!1,w=0,E=v=>r+v*ul+Qf,y=v=>{g&&m+Jf+v>d&&(p++,m=f,g=!1);let S=g?m+Jf:m;return m=S+v,g=!0,w=Math.max(w,m-f),S},x=[],T=(v,S)=>{let W=qf+Qg,$=y(W+u(S)),D=E(p);x.push({kind:v,text:S,swatch:{x:$,y:D-Qf+(ul-Zf)/2,width:qf,height:Zf},runs:[{text:S,x:$+W,y:D}]})};if(e.hasBackground&&T("background",n.waveLegendBackground),e.boundaries.length>0&&T("boundary",n.waveLegendBoundary),s||a||c){let v=o.map(D=>{let H=`#${D.index+1} ${D.title}`;return D.footnoteIndicators.length>0&&!D.strip.footnotesShown&&(H+=` ${D.footnoteIndicators.map(LB).join(",")}`),D.empty&&(H+=` (${n.waveNoItems})`),H}),S=" \xB7 ",W=`${n.waveLegendPrefix} ${v[0]}`,$=[{text:W,x:y(u(W)),y:E(p)}];for(let D of v.slice(1)){let H=$[$.length-1];m+u(S+D)<=d?(H.text+=S+D,m+=u(S+D),w=Math.max(w,m-f)):(p++,m=f,g=!1,$.push({text:D,x:y(u(D)),y:E(p)}))}x.push({kind:"waves",text:`${n.waveLegendPrefix} ${v.join(S)}`,runs:$})}return{box:{x:f,y:r,width:w,height:(p+1)*ul},entries:x}}function ox(e){return e.toISOString().slice(0,10)}var kb=1e-6,Ss=class{constructor(t){F(this,"domain");F(this,"range");F(this,"pixelsPerDay");F(this,"calendar");F(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+kb)}}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?Ue(this.domain[0],n):this.calendar?this.calendar.dateAtWorkingIndex(this.domain[0],n):Ue(this.domain[0],n)}indexAtX(t){let{days:n,day:r}=this.dayAt(t);if(!this.showsNonWorking||!this.calendar)return n;let i=Ue(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=Ue(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-kb)-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 Jd=6,$B=4,Ib=8,ep=class{constructor(t){F(this,"input");this.input=t}measure(){let{title:t,author:n,style:r,logo:i}=this.input,o=r.headerPosition==="beside",s=CB(t,n,i),a=i?Math.max(Mg,i.height+20):Mg;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?Ib:a+Ib,minRowsBottomY:o?s.cardHeight+$B: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},c=s?{x:Jd,y:n.rowsBottomY-t.cardHeight,width:t.cardWidth,height:t.cardHeight}:{x:0,y:0,width:n.canvasRightX,height:t.aboveHeight},l,u;return t.logo&&(l={box:{x:a.x+c.x+16,y:a.y+c.y+(c.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,(c.height-t.textCardHeight)/2)}),{box:a,position:o.headerPosition,title:r,author:i,titleLines:t.titleLines,authorLines:t.authorLines,cardBox:c,logo:l,...u?{textInset:u}:{},style:o}}};function CB(e,t,n){let r=Dg-32,i=Ti(e,r,16),o=Ti(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,c=n?n.width+(a?12:0):0,l=s+32,u=Math.max(GA-Jd,Math.min(Dg-Jd,l)+c),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+Jd;return{titleLines:i,authorLines:o,cardWidth:u,cardHeight:m,textCardHeight:p,logoSlot:c,boxWidth:g}}var OB=8;function Sb(e,t,n,r,i){let{locale:o,styleCtx:s}=r,{calendar:a,preset:c,startDate:l,timelineDays:u,nonWorking:f}=i,d=i.naturalEndDate,p=i.schedule.plan,m=r.roadmapStyle,g=il[m.headerHeight]??il.md,w=g>0&&m.timelinePosition!=="bottom",E=g>0&&(m.timelinePosition==="bottom"||m.timelinePosition==="both"),y=e.roadmapDecl?.title??e.roadmapDecl?.name??"",x=re(e.roadmapDecl?.properties??[],"author"),T=new ep({title:y,author:x,style:m,logo:ek(e,n.logo)}),v=T.measure(),{chartLeftX:S}=v,W=LA({naturalPixelsPerDay:c.pixelsPerUnit/a.daysPerUnit(c.unit),dayCount:u,chromeWidth:S+2*st,maxWidth:n.width}),$=u*W,D=S+st,H=$,I=n.today!==void 0&&n.today>=l&&n.today<=d?Mt:0,R=w?g:0,O=p?Hg:0,_=new Ss({domain:[l,d],range:[D,D+$],calendar:a,nonWorking:f}),b=Gd(Fy(_,[],c.unit,!1),By(_)),L=t.content.anchors.size+t.content.milestones.size>0||b.length>0,M=D+H+st,N=Nl(t.content.anchors,t.content.milestones,_),B=[...N,...b],G=Rs(B,S,Oi(B,S,M,se),se),X=L?Math.max(1,G.rowCount):0,Q=X*26,j=I+R+O+Q,ne=j+OB,A=fx(v,j),C=A+I,U=C+R,z=U+O,J=_d(_,c,a,o),Z={box:{x:D,y:A,width:$,height:0},ticks:J,pixelsPerDay:W,originX:D,startDate:l,endDate:d,labelStyle:be("roadmap",[],s),pillRowHeight:I,tickPanelY:C,tickPanelHeight:R,markerRow:{y:z+13,height:Q,collisionY:z-8},minorGrid:m.minorGrid,...p?{waveStrip:{y:U,height:O}}:{}};return dx(Z,_,c.unit),{header:v,headerNode:T,axis:{originX:D,ppd:W,naturalWidth:$,scale:_},naturalChartRightX:M,bands:{timelineY:A,pillRowHeight:I,tickPanelY:C,tickPanelHeight:R,waveStripY:U,markerRowY:z,estimatedMarkerRows:X,rowsHeight:j,chartTopY:A+ne,bottomTickPanelHeight:E?g:0},timeline:Z,markers:{datePinned:N,placements:Is(G.placements,z),hasEntities:L}}}function fx(e,t){return Math.max(e.chartTopY,e.minRowsBottomY-t)}function dx(e,t,n){let r=Fy(t,e.ticks,n,e.minorGrid);r&&(e.nonWorkingDisplay=t.showsNonWorking?"show":"hide",e.nonWorking=r);let i=By(t);i&&(e.workingExceptions=i)}var Nb=8,px=class{constructor(t){F(this,"rightX");F(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}},DB;var tp=class{constructor(t,n,r,i,o,s,a){F(this,"file");F(this,"resolved");F(this,"options");F(this,"scope");F(this,"window");F(this,"measured");F(this,"chart");F(this,"canvas");F(this,"chartY");F(this,"draft",{});F(this,"scaleIsFinal",!1);F(this,"band");F(this,"rowsTop");F(this,"rowsBottom");this.file=t,this.resolved=n,this.options=r,this.scope=i,this.window=o,this.measured=s,this.chart=a,this.canvas=new px(s.naturalChartRightX);let c=a.ctx;this.chartY={get top(){return c.chartTopY},set top(l){c.chartTopY=l},get swimlaneBottom(){return c.swimlaneBottomY},set swimlaneBottom(l){c.swimlaneBottomY=l},get bottom(){return c.chartBottomY},set bottom(l){c.chartBottomY=l}}}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=MB(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}report(t,n){DB?.(t,n)}};function MB(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=fx(i,Mt+r.rowsHeight),a=s+Mt,c=a-r.tickPanelY;return{timelineY:s,pillRowHeight:Mt,tickPanelY:a,markerRowY:r.markerRowY+c,shift:c}}function FB(e){return e.canvas.grow(e.chart.maxRightX+st)}function BB(e){let{swimlanes:t,includes:n,milestones:r}=e.chart,{calendar:i,preset:o,startDate:s,spanDays:a,nonWorking:c}=e.window,{originX:l,ppd:u}=e.measured.axis,f=e.measured.timeline,d=_s(t);for(let y of n)d=Math.max(d,_s(y.nestedSwimlanes));for(let y of e.measured.markers.datePinned)d=Math.max(d,y.centerX+y.radius);for(let y of r)d=Math.max(d,y.x+y.radius);let p=i.daysPerUnit(o.unit),m=e.scale.showsNonWorking?e.scale.indexAtX(d):(d-l)/u,g=m>0?$i(s,m,o.unit,p,i):0,w=Id(t);for(let y of n)w=Math.max(w,Id(y.nestedSwimlanes));if(w>0){let y=new vs(e.window,e.scale),x=Math.max(a,g);y.isPast(w,x)&&(g=Math.max(g,Math.min(y.boundaryAtOrAfterX(w),y.captionColumn(x).end)))}let E=!1;if(g>a){let y=i.dateAtWorkingIndex(s,g),x=e.scale.showsNonWorking?At(s,y)*u:g*u,T=new Ss({domain:[s,y],range:[l,l+x],calendar:i,nonWorking:c});e.extendScale(T),f.endDate=y,f.box.width=x,f.ticks=_d(T,o,i,e.scope.locale),dx(f,T,o.unit),e.canvas.grow(l+x+st),E=!0}return e.settleScale(),E}function WB(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=Gd(t.nonWorking,t.workingExceptions);n.push(...r),e.draft.markerEntries={all:n,calendarCount:r.length};let i=Oi(n,e.measured.header.chartLeftX,e.canvas.provisional,se);for(let s of e.chart.includes)i=Math.max(i,cb(s,e.canvas.provisional));let o=e.canvas.grow(i);return e.canvas.freeze(),o}function UB(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)Vd(i,t)!==Vd(i,n)&&(r=!0),xb(i,t);return r}function XB(e){let t=Wt(e.draft.markerEntries,"the marker entries"),n=Rs(t.all,e.measured.header.chartLeftX,e.canvas.final,se),r=Is(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 c=r.get(s);(!c||!nW(a,c))&&(o=!0)}return o}function GB(e){let t=e.markerBand(),n=e.ctx,r=e.measured.timeline,i=Hd(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(Zy(s));a&&(s.labelBox=a.labelBox,s.labelSide=a.labelSide)}for(let s of r.workingExceptions??[]){let a=t.placements.get(Jy(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 zB(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.height+=s.box.y-n.timelineY,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 c=n.shift;if(t.rowCount>i&&(c+=(t.rowCount-i)*26,s.markerRow.height=t.rowCount*26,a=!0),e.setHeaderRowsBottom(n.markerRowY+s.markerRow.height),c===0)return a;s.box.height+=c,e.chartY.top+=c,e.chartY.bottom+=c,e.chartY.swimlaneBottom+=c;for(let l of e.chart.swimlanes)ks(l,c);for(let l of e.chart.includes)tb(l,c);for(let l of Wt(e.draft.milestones,"the milestones"))if(l.cutTopY=e.chartY.top,l.cutBottomY=e.chartY.swimlaneBottom,l.slackArrows)for(let u of l.slackArrows)u.y+=c;return!0}function HB(e){let t=e.measured.bands.bottomTickPanelHeight;return t<=0?!1:(e.ctx.timeline.bottomTickPanelY=e.chartY.bottom+Nb,e.ctx.timeline.bottomTickPanelHeight=t,e.chartY.bottom+=Nb+t,!0)}function jB(e){e.finalScale();let t=e.ctx;if(!t.waves)return!1;let n=_b(t.waves,t,Gn(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 YB(e){e.finalScale(),e.markerBand();let t=new Set(Wt(e.draft.milestones,"the milestones").map(r=>r.center.x)),n=kd(e.resolved.content.anchors,e.ctx,t);return e.draft.anchors=n,n.length>0}function VB(e){let t=Vy(e.chart.laneEntries),n=Ky(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 c=Ky(Vy([...i.content.swimlanes.values()]),s.nestedSwimlanes,[],a);c.length>0&&(s.edges=c),r+=c.length}),n.length+r>0}function KB(e){e.finalScale();let t=Eb(e.options.today,e.ctx,e.scope.locale,e.canvas.final);return e.draft.nowline=t,t!==null}function qB(e){let t=e.draft.waves;if(!t)return!1;let n=Ab(t,e.ctx,Gn(e.scope.locale),e.chartY.bottom+Kf,e.canvas.final);return n?(e.chartY.bottom+=Kf+n.box.height,e.draft.waveLegend=n,!0):!1}function ZB(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=QR(e.resolved.content.footnotes,e.ctx,e.chartY.bottom,e.canvas.final,t);return e.draft.footnotes=n,n.entries.length>0}function JB(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 QB(e){let t=Wt(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-Xg,y:r+st,width:Xg,height:HA};return e.draft.attributionBox=i,e.draft.height=i.y+i.height+st,!0}var eW=[{name:"growCanvasForSpill",reads:["placement"],writes:["canvas"],run:FB},{name:"extendTimeline",reads:["placement","window","scale"],writes:["scale","timeline","calendarRuns","canvas"],run:BB},{name:"growCanvasForMarkerLabels",reads:["placement","calendarRuns","canvas"],writes:["markerEntries","canvas"],run:WB},{name:"fitWidths",reads:["placement","canvas"],writes:["laneWidths"],run:UB},{name:"packMarkers",reads:["canvas","markerEntries","headerBands","scale"],writes:["markerBand"],run:XB},{name:"placeMarkers",reads:["placement","markerBand","calendarRuns"],writes:["milestones","calendarLabels","markerMidpoints"],run:GB},{name:"growHeaderRows",reads:["markerBand","headerBands","scale","milestones","chartTop","laneBottom"],writes:["chartTop","rowsBottom","laneBottom","chartBottom","laneY","milestones","timeline"],run:zB},{name:"bottomTickPanel",reads:["headerBands","chartBottom"],writes:["chartBottom","timeline"],run:HB},{name:"waves",reads:["scale","chartTop","laneBottom","timeline","laneY"],writes:["waves","timeline"],run:jB},{name:"anchors",reads:["scale","markerBand","chartTop","laneBottom","milestones"],writes:["anchors","markerMidpoints"],run:YB},{name:"dependencyEdges",reads:["laneY","markerMidpoints"],writes:["edges"],run:VB},{name:"nowline",reads:["scale","canvas","laneBottom","timeline"],writes:["nowline"],run:KB},{name:"waveLegend",reads:["waves","canvas","chartBottom"],writes:["legend","chartBottom"],run:qB},{name:"footnotePanel",reads:["chartBottom","canvas"],writes:["footnotes"],run:ZB},{name:"header",reads:["chartBottom","canvas","rowsBottom"],writes:["header"],run:JB},{name:"attribution",reads:["footnotes","chartBottom","canvas"],writes:["attribution"],run:QB}];function Lb(e,t=eW){for(let n of t)e.report(n.name,n.run(e));return tW(e)}function tW(e){let{draft:t}=e,{themeName:n,theme:r}=e.scope,{swimlanes:i,includes:o,waveSolve:s}=e.chart,a=e.canvas.final,c=e.measured.header.chartLeftX,l=t.waves,u=t.waveLegend;return{width:a,height:Wt(t.height,"the canvas height"),theme:n,palette:r,backgroundColor:r.surface.page,header:{...Wt(t.header,"the header"),attributionBox:Wt(t.attributionBox,"the attribution box")},timeline:e.measured.timeline,nowline:Wt(t.nowline,"the now-line"),swimlanes:i,anchors:Wt(t.anchors,"the anchors"),milestones:Wt(t.milestones,"the milestones"),edges:Wt(t.edges,"the edges"),footnotes:Wt(t.footnotes,"the footnote panel"),includes:o,chartBox:{x:c,y:e.chartY.top,width:a-c,height:e.chartY.bottom-e.chartY.top},...s?{waveSolve:s}:{},...l?{waves:l.waves}:{},...l&&l.boundaries.length>0?{waveBoundaries:l.boundaries}:{},...l&&l.crossings.length>0?{waveCrossings:l.crossings}:{},...u?{waveLegend:u}:{}}}function Wt(e,t){if(e===void 0)throw new Error(`layout: ${t} was read before its step ran`);return e}function nW(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 Ns=class extends Map{constructor(t,n=oW){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(Pb(this,t))}has(t){return super.has(Pb(this,t))}set(t,n){return super.set(rW(this,t),n)}delete(t){return super.delete(iW(this,t))}};function Pb({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function rW({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function iW({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function oW(e){return e!==null&&typeof e=="object"?e.valueOf():e}function np(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 rp(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}var $b=Symbol("implicit");function ip(){var e=new Ns,t=[],n=[],r=$b;function i(o){let s=e.get(o);if(s===void 0){if(r!==$b)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 Ns;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 ip(t,n).unknown(r)},rp.apply(i,arguments),i}function Pl(){var e=ip().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,o,s,a=!1,c=0,l=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-c+l*2),a&&(o=Math.floor(o)),m+=(g-m-o*(d-c))*u,s=o*(1-c),a&&(m=Math.round(m),s=Math.round(s));var w=np(d).map(function(E){return m+o*E});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?(c=Math.min(1,l=+d),f()):c},e.paddingInner=function(d){return arguments.length?(c=Math.min(1,d),f()):c},e.paddingOuter=function(d){return arguments.length?(l=+d,f()):l},e.align=function(d){return arguments.length?(u=Math.max(0,Math.min(1,d)),f()):u},e.copy=function(){return Pl(t(),[r,i]).round(a).paddingInner(c).paddingOuter(l).align(u)},rp.apply(f(),arguments)}var hx=class e{constructor(t,n,r){F(this,"bandwidthPx");F(this,"stepPx");F(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=Pl().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}},sW={bandwidth:56,step:64};function Cb(){return hx.fixedRow(sW)}var Ob=8;function Db(e,t,n,r,i){let{theme:o,styleCtx:s}=t,{cal:a,calendar:c,schedule:l}=n,u=l.plan,{originX:f,scale:d}=r.axis,{timeline:p,bands:m}=r,g=$d(e,{theme:o,cal:a,schedule:l,timeline:p,scale:d,calendar:c,axisColumns:new vs(n,d),bandScale:Cb(),waves:u?MR(u,d,f,Gn(t.locale).waveBackgroundItem):void 0},{chartTopY:m.chartTopY,chartBottomY:0,swimlaneBottomY:0},{footnotes:Ud(e.content.footnotes),markerRowPlacements:new Map(r.markers.placements)});for(let M of r.markers.datePinned){let N=g.markerRowPlacements.get(M.id);N&&(g.entityLeftEdges.set(M.id,M.centerX),g.entityRightEdges.set(M.id,M.centerX),g.entityMidpoints.set(M.id,{x:M.centerX,y:N.centerY}))}let w=new Map(g.entityLeftEdges),E=new Map(g.entityRightEdges),y=new Map(g.entityMidpoints),x=()=>{g.entityLeftEdges=new Map(w),g.entityRightEdges=new Map(E),g.entityMidpoints=new Map(y),g.placedItems=new Map,g.itemFlowKey=new Map,g.currentFlowKey="",g.waves&&Ld(g.waves,g.entityLeftEdges,g.entityRightEdges)},T=[...e.content.swimlanes.values()],v=be("swimlane",[],s),S=FA[v.spacing]??0,W=()=>{g.nextParallelId=0,g.nextGroupId=0;let M=[],N=g.chartTopY,B=0,G=g.timeline.originX;for(let X of T){B>0&&(N+=S);let{positioned:Q,usedHeight:j,usedRightX:ne}=new bs({lane:X,bandIndex:B},i).place({x:g.timeline.originX,y:N},g);M.push(Q),N+=j,ne>G&&(G=ne),B++}return{swimlanes:M,nextY:N,maxRightX:G}},$=e.content.isolatedRegions,D,H,P=g.waves;if(P){let M,N=zR()?aW(P.ids,l,d):void 0,B=Sd(P.ids.length,P.origin,P.floors,(G,X)=>(FR(P,G,X),x(),M=W(),$.length>0&&ix($,g,M.nextY+Ob,i,r.naturalChartRightX),P.pass),It,N);BR(P,B),H={passes:B.passes,capped:B.capped},D=M}else D=W();let I=D.swimlanes,R=D.nextY,O=sb(e.content.milestones,g);O.length>0&&(x(),g.slackCorridors=O,D=W(),I=D.swimlanes,R=D.nextY);let _=[],b=[];if($.length>0){let M=ix($,g,R+Ob,i,r.naturalChartRightX);_=M.regions,b=M.contexts,R=M.endY}g.chartBottomY=R,g.swimlaneBottomY=R,p.box.height=g.chartBottomY-p.box.y;let L=zd(e.content.milestones,g);return{ctx:g,swimlanes:I,includes:_,regionContexts:b,milestones:L,laneEntries:T,maxRightX:D.maxRightX,bottomY:R,...H?{waveSolve:H}:{}}}function aW(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 op=class{constructor(t,n){F(this,"node");F(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=be("group",r.properties,n.styleCtx),s=Br(r,bl(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,c=a?void 0:r.title??r.name,l=n.currentFlowKey;n.nextGroupId+=1,n.currentFlowKey=`${l}/group:${r.name??`group-${n.nextGroupId}`}`;let u=Bt(Be(r.properties,"after")),f=Bt(Be(r.properties,"before")),d=td({drawn:!a,hasTitle:!!c,hasPins:!!(u||f),hasBracket:o.bracket!=="none"}),p=Yd(r,{leftX:s,firstRowY:t.y+d.header+d.pad},n,i),{children:m,timeCursorX:g,timeStartX:w}=p,E=n.bandScale.step(),y=E-n.bandScale.bandwidth(),x=Math.max(E,p.packer.usedHeight())-y,T={x:w,y:t.y,width:g-w,height:d.header+d.pad+x+d.pad};t.startX=T.x,t.x=g,t.height=Math.max(t.height,T.height+y);let v=r.name;v&&(n.entityLeftEdges.set(v,T.x),n.entityRightEdges.set(v,g)),n.currentFlowKey=l;let S=a?[]:Rd({box:T,afterDate:u,beforeDate:f,title:c});return{kind:"group",id:v,title:c,box:T,headerHeight:d.header,children:m,style:o,inlineDatePins:S.length>0?S:void 0,...a?{waveOnly:!0}:{}}}};var sp=class{constructor(t,n){F(this,"node");F(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=be("parallel",r.properties,n.styleCtx),s=Br(r,t.x,n),a=Bt(Be(r.properties,"after")),c=Bt(Be(r.properties,"before")),l=r.title??r.name,u=td({drawn:!0,hasTitle:!!l,hasPins:!!(a||c),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 E=r.name??`parallel-${n.nextParallelId}`,y=0;for(let D of r.content){if(D.$type==="DescriptionDirective")continue;n.currentFlowKey=`${w}/par:${E}#${y}`;let H=Sl(s,f+g),P=i.sequenceOne(D,H,n);d.push(P),g+=Math.max(n.bandScale.step(),H.height),p=Math.min(p,H.startX),m=Math.max(m,H.x),y++}n.currentFlowKey=w,d.length===0&&(p=n.scale.showsNonWorking?n.scale.startX(s):s,m=p);let x=n.bandScale.step(),T=x-n.bandScale.bandwidth(),v=Math.max(x,g)-T,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+T);let W=r.name;W&&(n.entityLeftEdges.set(W,S.x),n.entityRightEdges.set(W,m));let $=Rd({box:S,afterDate:a,beforeDate:c,title:l});return{kind:"parallel",id:W,title:l,box:S,headerHeight:u.header,children:d,style:o,inlineDatePins:$.length>0?$:void 0}}};function lW(e,t,n){return new sp(e,{sequenceOne:ap}).place(t,n)}function cW(e,t,n){return new op(e,{sequenceOne:ap}).place(t,n)}function ap(e,t,n){if(Ve(e))return Bd(e,t,n);if(et(e))return lW(e,t,n);if(Oe(e))return cW(e,t,n);throw new Error(`Unknown swimlane child type: ${e.$type??"unknown"}`)}var lp=class{place(t,n,r,i){let o={sequenceOne:ap},s=bR(t,n,r),a=SR(t,n,r,s,i),c=Sb(t,n,r,s,a),l=Db(n,s,a,c,o);return Lb(new tp(t,n,r,s,a,c,l))}};function $l(e,t,n={}){let r=$f(e,t),{config:i,working:o}=r,s=os(t.content.sizes,i),a=re(e.roadmapDecl?.properties??[],"start"),c=_e(a)??uW(n.today??new Date),l=R=>o.workingIndexOf(c,R),u=R=>o.dateAtWorkingIndex(c,R),f=(R,O)=>Pf(o,c,R,O),d=0,p=R=>{d=Math.max(d,R)},m=new Map,g=new Map,w=new Map,E=new Map,y=new WeakMap,x=new Map,T=new WeakMap,v=new Map;for(let[R,O]of t.content.anchors){let _=_e(re(O.properties,"date"));if(_){let b=l(_);g.set(R,b),v.set(R,_),p(b)}}let S=()=>({itemEnd:m,anchorEnd:g,milestoneEnd:w,sizes:s,itemResults:E,inByNode:!0}),W=(R,O,_)=>{let b=N=>{if("date"in N)return l(N.date);let B=N.ref;return R.itemEnd.has(B)?R.itemEnd.get(B):R.anchorEnd.has(B)?R.anchorEnd.get(B):R.milestoneEnd.has(B)?R.milestoneEnd.get(B):0},L=(N,B)=>{let G=B;for(let X of vt(N))G=M(X,G),_(G);return G},M=(N,B)=>{if(Ve(N)){let G=dA(N.properties,R.sizes,i),{after:X}=Fr(N.properties),Q=X.length>0?Math.max(B,...X.map(b)):B;O&&(Q=O.apply(N,Q));let j=Q+G,ne={start:u(Q),end:f(Q,j),days:G};return R.inByNode&&y.set(N,ne),N.name&&(R.itemEnd.set(N.name,j),R.itemResults?.set(N.name,ne)),O?.accumulate(N,j),j}if(et(N)){let{after:G}=Fr(N.properties),X=G.length>0?Math.max(B,...G.map(b)):B;O&&(X=O.apply(N,X));let Q=X;for(let j of vt(N))Q=Math.max(Q,M(j,X));return N.name&&R.itemEnd.set(N.name,Q),Q}if(Oe(N)){let{after:G}=Fr(N.properties),X=G.length>0?Math.max(B,...G.map(b)):B;O&&(X=O.apply(N,X));let Q=L(N,X);return N.name&&R.itemEnd.set(N.name,Q),Q}return B};return{walkLane:L,resolveAfterDay:b}},$=(R,O)=>{let _=_e(re(R.properties,"date"));if(_)return l(_);let{after:b}=Fr(R.properties);return b.length>0?Math.max(0,...b.map(O)):void 0},D=(R,O)=>{let _=new Map,b=new Map,L=new Map;for(let[B,G]of R.anchors){let X=_e(re(G.properties,"date"));if(X){let Q=l(X);b.set(B,Q),p(Q)}}let{walkLane:M,resolveAfterDay:N}=W({itemEnd:_,anchorEnd:b,milestoneEnd:L,sizes:os(R.sizes,i),inByNode:O},void 0,p);for(let B of R.swimlanes.values())M(B,0);for(let[B,G]of R.milestones){let X=$(G,N);X!==void 0&&(L.set(B,X),p(X))}for(let B of R.isolatedRegions)D(B.content,!1)},H=n.plan!==void 0?n.plan??void 0:Pi(t),P;if(H){let R=H.waves.map(N=>N.name),O=DR(H,c,o),_,b=0,L=N=>{b=Math.max(b,N)},M=Sd(R.length,0,O,(N,B)=>{let G=R.map((j,ne)=>[j,B[ne]]);m=new Map(G),E=new Map,y=new WeakMap,b=0;let X=new Ci(H,N),{walkLane:Q}=W(S(),X,L);for(let j of t.content.swimlanes.values())Q(j,0);for(let j of t.content.isolatedRegions){let ne=W({itemEnd:new Map(G),anchorEnd:new Map,milestoneEnd:new Map,sizes:os(j.content.sizes,i),inByNode:!0},X,L);for(let A of j.content.swimlanes.values())ne.walkLane(A,0)}return _=X,X});p(Math.max(b,...M.S,...M.E.slice(-1))),P=new Map;for(let N of Nd(H,M,_,0,O))P.set(N.id,{index:N.index,start:u(N.start),end:f(N.start,N.end),memberCount:N.memberCount,...N.heldBy!==void 0?{heldBy:N.heldBy}:{},...N.floorRef!==void 0?{floorRef:N.floorRef}:{}})}else{let{walkLane:R}=W(S(),void 0,p);for(let O of t.content.swimlanes.values())R(O,0)}let{resolveAfterDay:I}=W(S(),void 0,p);for(let[R,O]of t.content.milestones){let _=$(O,I);if(_===void 0)continue;let b=_e(re(O.properties,"date"))??u(_);w.set(R,_),x.set(R,b),T.set(O,b),p(_)}if(!H)for(let R of t.content.isolatedRegions)D(R.content,!0);return{startDate:c,calendar:r,items:E,byNode:y,milestones:x,milestoneByNode:T,anchors:v,...P?{waves:P}:{},...H?{plan:H}:{},resolved:t,extent:{contentEndDay:d}}}function uW(e){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))}function mx(e,t,n={}){let r=n.schedule?.resolved===t?n.schedule:$l(e,t,{today:n.today,plan:Pi(t)??null});return new lp().place(e,t,n,r)}function cp(e){return e.toISOString().slice(0,10)}function Mb(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 gx(e,t){for(let n of e)n.kind==="item"?t(n):gx(n.children,t)}function fW(e,t,n){let r=Mb(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)),Fb(e,t,n)}function Fb(e,t,n){let r=e.nonWorkingPin;if(!r)return;let i=Mb(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 Bb(e,t,n){let r=e.id??e.title,i=[];gx(e.children,a=>i.push(a));for(let a of i)fW(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)Bb(a,t,n)}function Wb(e,t,n){gx(e.children,r=>{Fb(r,t,n)});for(let r of e.nested)Wb(r,t,n)}function dW(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(c=>c.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:cp(s.endDate)},a))}}function yx(e,t={}){let n=t.locale??"en-US",r=[];for(let i of e.swimlanes)Bb(i,n,r);for(let i of e.includes)for(let o of i.nestedSwimlanes)Wb(o,n,r);if(dW(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:cp(i),start:cp(o),end:cp(s)}))}return r}var Di=class extends Error{constructor(t){super(t),this.name="TimezoneError"}};function xx(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 Di(`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 Di(`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 up(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 Ub=/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?)(Z|([+-])(\d{2})(?::?(\d{2}))?)$/,Xb=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?$/;function Gb(e){return(ot.test(e)||Ub.test(e)||Xb.test(e))&&!ze(e.slice(0,10))}function Ex(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(Gb(r))return;let i=_e(r);if(i)return i;let o=Ub.exec(r);if(o){let s=new Date(r);if(!Number.isNaN(s.getTime())){if(o[2]==="Z")return up(s,{kind:"utc"});let c=o[3]==="+"?1:-1,l=parseInt(o[4],10),u=o[5]!==void 0?parseInt(o[5],10):0,f=c*(l*60+u)*6e4;return up(s,{kind:"offset",ms:f})}}return Xb.test(r)?_e(r.slice(0,10))??void 0:void 0}return up(n(),t)}}function pW(e){return e===2?"warning":e===3?"info":"error"}function zb(e,t){return{severity:pW(e.severity),code:sy(e),message:e.message,suggestion:rd(e.message),file:t,line:(e.range?.start.line??0)+1,column:(e.range?.start.character??0)+1}}function wx(e,t){return{severity:"error",code:"parse-error",message:e.message,file:t,line:e.token?.startLine??1,column:e.token?.startColumn??1}}function Tx(e,t){return{severity:"error",code:"lex-error",message:e.message,file:t,line:e.line??1,column:e.column??1}}function Hb(e,t){if(e.syntax?.origin==="lexer")return Tx(e.syntax.error,e.sourcePath);if(e.syntax?.origin==="parser")return wx(e.syntax.error,e.sourcePath);let n=(e.range?.start.line??e.line??0)+1,r=(e.range?.start.character??0)+1;if(!Dr(e))return{severity:e.severity,code:"include",message:e.message,file:e.sourcePath,line:n,column:1};let i=t?Ny(t,e):e.message,o=rd(i);return{severity:e.severity,code:e.code??id(e.message),message:i,...o===void 0?{}:{suggestion:o},file:e.sourcePath,line:n,column:r}}function jb(e,t,n="warning"){return{severity:n,code:"render.warning",message:e,file:t,line:1,column:1}}function Yb(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 Kb(e){throw new Error(`${Vb}: include "${e}" was skipped \u2014 running in single-file mode.`)}function vx(e){return e.includes(Vb)}function Qb(e,t){let n=t==="image/png"?mW(e):t==="image/jpeg"?gW(e):yW(e);return n&&n.width>0&&n.height>0?n:void 0}var hW=[137,80,78,71,13,10,26,10];function _x(e,t){return e[t]<<8|e[t+1]}function qb(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function Zb(e,t){return e[t]|e[t+1]<<8}function Jb(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16}function fp(e,t,n){return String.fromCharCode(...e.subarray(t,t+n))}function mW(e){if(!(e.length<24||hW.some((t,n)=>e[n]!==t))&&fp(e,12,4)==="IHDR")return{width:qb(e,16),height:qb(e,20)}}function gW(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=_x(e,t+2);if(n>=192&&n<=207&&n!==196&&n!==200&&n!==204)return t+8>=e.length?void 0:{width:_x(e,t+7),height:_x(e,t+5)};if(r<2)return;t+=2+r}}function yW(e){if(e.length<16||fp(e,0,4)!=="RIFF"||fp(e,8,4)!=="WEBP")return;let t=fp(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:Zb(e,26)&16383,height:Zb(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+Jb(e,24),height:1+Jb(e,27)}}}var xW=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"]),EW=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"]),wW=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"]),TW=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"]),vW=new Set(["none","normal","auto","initial","inherit","unset"]);function _W(e){return e==="xlink:href"?!1:e.includes(":")||e.startsWith("data-")||e==="version"||e==="baseProfile"||e==="enable-background"}function AW(e){return e==="metadata"||e.includes(":")&&!e.startsWith("svg:")}var kW=new Set(["x","y","width","height"]);function tS(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=IW(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:c,attrs:l}=RW(a);t.push({kind:s?"self":"open",name:c,attrs:l}),n=i+1}return t}function IW(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 RW(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 l=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;i[s]=e.slice(l,t);continue}t++;let c=t;for(;t<e.length&&e[t]!==a;)t++;i[s]=e.slice(c,t),t<e.length&&t++}return{name:r,attrs:i}}function Cl(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function bW(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 nS(e,t={}){let n=t.idPrefix??"nl-logo",r=t.onWarn??(()=>{}),i=tS(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=SW(o,d=>r(`sanitizer: dropping ${d}`)),c=new Map,l=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&&!c.has(p)&&c.set(p,`${n}-${l++}`)}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(Cl(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"||AW(p)){d.kind==="open"&&f.push(!1);continue}if(!xW.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=NW(d.attrs??{},a,r),E=Object.keys(w).sort();for(let y of E){let x=w[y];if(g&&t.stripRootSize&&kW.has(y))continue;if(/^on/i.test(y)){r(`sanitizer: dropping event handler ${y}`);continue}if(_W(y)||y==="class")continue;if(!EW.has(y)){r(`sanitizer: dropping attribute ${y}`);continue}if(y==="href"||y==="xlink:href"){let v=bW(x,c);if(v===null){r(`sanitizer: dropping external href ${x}`);continue}m.push(` ${y}="${Cl(v)}"`);continue}if(y==="id"){let v=c.get(x);v&&m.push(` id="${Cl(v)}"`);continue}let T=/url\(#([^)]+)\)/gi;if(/data:|javascript:|vbscript:|url\(|expression\s*\(|[\\{}]/i.test(x.replace(T,""))){r(`sanitizer: dropping suspicious value at ${y}`);continue}if(/url\(#/i.test(x)){let v=x.replace(T,(S,W)=>{let $=c.get(W);return $?`url(#${$})`:"none"});m.push(` ${y}="${Cl(v)}"`);continue}m.push(` ${y}="${Cl(x)}"`)}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 eS(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 dp(e){let t=tS(e).find(s=>(s.kind==="open"||s.kind==="self")&&s.name==="svg");if(!t)return;let n=t.attrs??{},r=eS(n.width),i=eS(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 rS(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 SW(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(c=>c.trim());if(s.startsWith("@")||!a.every(c=>/^\.[A-Za-z_][\w-]*$/.test(c))){t(`<style> rule ${s}`);continue}n.push({classes:a.map(c=>c.slice(1)),declarations:rS(o[2])})}return/@[a-z-]+[^{;]*;/i.test(r)&&t("<style> at-rule"),n}function NW(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(...rS(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)wW.has(s)?o[s]=a:!s.startsWith("-")&&!TW.has(s)&&!vW.has(a.toLowerCase())&&n(`sanitizer: dropping style property ${s}`);return o}var LW={".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp"};function PW(e){let t=e.slice(e.lastIndexOf("/")+1),n=t.lastIndexOf(".");return n>0?t.slice(n).toLowerCase():""}async function iS(e,t,n){if(!e||!t)return;let r=PW(e),i=LW[r];if(!i){n(`unsupported logo format: ${r||"(none)"} (${e})`);return}let o;try{o=await t(e)}catch(c){let l=c instanceof Error?c.message:String(c);n(`logo file not found: ${e} (${l})`);return}let s=o.bytes,a=i==="image/svg+xml"?dp(new TextDecoder().decode(s)):Qb(s,i);if(!a){let c=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} (${c})`);return}return{ref:e,dimensions:a,asset:o}}var $W=1,CW=0;function OW(){return Ce.parse(`memory:///stage-${++CW}.nowline`)}async function DW(e){if(e.document)return e.document;let{workspace:t}=e.services.shared,n=t.LangiumDocumentFactory.fromString(e.source,OW());return await t.DocumentBuilder.build([n],{validation:!0}),n}function MW(e){return e.origin!=="validation"||e.diagnostic.severity===$W}async function Ax(e){let t=await DW(e),n=Ii(t);if(n.some(MW))return{kind:"invalid",document:t,diagnostics:n};let r=t.parseResult.value,i=await yy(r,e.sourcePath,{services:e.services.Nowline,readFile:e.readSource}),o=e.isToleratedIncludeError??(()=>!1),s=i.diagnostics.filter(T=>T.severity==="error"&&!o(T)),a=i.diagnostics.filter(Dr),c=s.find(T=>!Dr(T));if(c)return{kind:"include-error",document:t,legacy:c,routed:[],resolved:i};if(s.length>0)return{kind:"include-error",document:t,routed:a,resolved:i};let l=[],u=await iS(nd(r),e.assetResolver,T=>l.push(T)),{theme:f,today:d,width:p,locale:m,nonWorking:g}=e.layout,w={theme:f,today:d,width:p,locale:m,nonWorking:g},E=Pi(i)??null,y=$l(r,i,{today:d,plan:E}),x=mx(r,i,{...w,schedule:y,logo:u?.dimensions});return{kind:"staged",document:t,ast:r,resolved:i,routed:a,logo:u,warnings:l,plan:E,schedule:y,model:x,layout:w}}var Wr={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"}},FW={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"}},oS={...Wr,...FW};var lse={none:"",multiplier:"x",person:Wr.person.ascii,people:Wr.people.ascii,points:Wr.points.ascii,time:Wr.time.ascii};var pp=class{constructor(t="nl"){F(this,"prefix");F(this,"counter",0);this.prefix=t}next(t){let n=`${this.prefix}-${this.counter++}`;return t?`${n}-${t}`:n}};var sS=/&/g,aS=/</g,lS=/>/g,BW=/"/g,WW=/'/g;function tt(e){return e.replace(sS,"&").replace(aS,"<").replace(lS,">")}function Vn(e){return e.replace(sS,"&").replace(aS,"<").replace(lS,">").replace(BW,""").replace(WW,"'")}function Ls(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}="${Vn(String(i))}"`))}return n.length?` ${n.join(" ")}`:""}function Y(e,t,n){return n===void 0||n===""?`<${e}${Ls(t)}/>`:`<${e}${Ls(t)}>${n}</${e}>`}function pe(e,t){return`<text${Ls(e)}>${tt(t)}</text>`}function h(e){return Number.isFinite(e)?Number.isInteger(e)?e.toString():(Math.round(e*100)/100).toString():"0"}var UW={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 XW(e,t){let n=`${e}-shadow-${t}`,r=UW[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 Y("filter",{id:n,x:"-50%",y:"-50%",width:"200%",height:"200%"},i)}function cS(e,t){return t==="none"?null:`url(#${e}-shadow-${t})`}function uS(e){return["subtle","soft","hard"].map(t=>XW(e,t)).join("")}var HW={thin:100,light:300,normal:400,bold:700};function jW(e){return us[e]??14}function gS(e,t,n){return{"font-family":t[e.font],"font-size":n??jW(e.textSize),"font-weight":HW[e.weight]??400,"font-style":e.italic?"italic":"normal",fill:e.text}}function YW(e){if(e.border==="dashed")return"4 3";if(e.border==="dotted")return"1 3"}function yS(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 VW(e,t){return yS(e)>=.24?t.statusDot.onLight:t.statusDot.onDark}function gp(e,t){return e.length*t*.58}function xS(e,t,n,r,i,o,s){let a=i*.58,c=t?gp(t,i):0,l=t?a:0,u=n+c+l,{text:f,icon:d}=e,p=gp(f,i),m={"font-family":o,"font-size":i,fill:s};if(!d)return pe({x:h(u),y:h(r),...m},f);if(d.kind==="builtin"&&d.name==="multiplier")return pe({x:h(u),y:h(r),...m},`${f}\xD7`);if(d.kind==="builtin"){let w=Wr[d.name],E=pe({x:h(u),y:h(r),...m},f),y=i*.1,x=i,T=u+p+y,v=r-i*.85,S=`<svg x="${h(T)}" y="${h(v)}" width="${h(x)}" height="${h(x)}" viewBox="${w.viewBox}" style="color:${Vn(s)}" aria-hidden="true">${w.body}</svg>`;return E+S}let g=h(i*.1);return`<text x="${h(u)}" y="${h(r)}" font-family="${Vn(o)}" font-size="${i}" fill="${Vn(s)}">${tt(f)}<tspan dx="${g}">${tt(d.text)}</tspan></text>`}var fS=.6,KW=.5;function qW(e){let{metaText:t,capacity:n,x:r,baselineY:i,fontSize:o,fontFamily:s,color:a}=e;if(!t&&!n)return"";let c={"font-family":s,"font-size":o,fill:a};if(!n)return pe({x:h(r),y:h(i),...c},t);if(!t)return xS(n,void 0,r,i,o,s,a);let l=h(o*fS),u=`<text x="${h(r)}" y="${h(i)}" font-family="${Vn(s)}" font-size="${o}" fill="${Vn(a)}">`,{text:f,icon:d}=n;if(!d)return u+tt(t)+`<tspan dx="${l}">${tt(f)}</tspan></text>`;if(d.kind==="builtin"&&d.name==="multiplier")return u+tt(t)+`<tspan dx="${l}">${tt(f)}\xD7</tspan></text>`;if(d.kind==="literal"){let S=h(o*.1);return u+tt(t)+`<tspan dx="${l}">${tt(f)}</tspan><tspan dx="${S}">${tt(d.text)}</tspan></text>`}let p=Wr[d.name],m=S=>S.length*o*KW,g=r+m(t)+o*fS,w=o*.1,E=o,y=g+m(f)+w,x=i-o*.85,T=u+tt(t)+`<tspan dx="${l}">${tt(f)}</tspan></text>`,v=`<svg x="${h(y)}" y="${h(x)}" width="${h(E)}" height="${h(E)}" viewBox="${p.viewBox}" style="color:${Vn(a)}" aria-hidden="true">${p.body}</svg>`;return T+v}function ZW(e,t){let n=oS.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:${Vn(t)}" aria-hidden="true">${n.body}</svg>`,i=`<title>${tt(e.isoDate)}</title>`;return Y("g",{"data-layer":"inline-date-pin","data-side":e.side,"data-date":e.isoDate,"data-spilled":e.spilled?"true":null},i+r)}function ES(e,t){return!e||e.length===0?"":e.map(n=>ZW(n,t)).join("")}function JW(e){return e?.some(t=>t.side==="after")??!1}function QW(e,t,n,r,i,o={}){let s=Math.min(rl[i.cornerRadius]??4,r/2,n/2);return Y("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":YW(i)??null,...o})}function eU(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,c=e.style.bg==="none"?n.surface.headerBox:e.style.bg,l=n.header.cardBorder,u=Y("rect",{x:h(i),y:h(o),width:h(s),height:h(a),rx:6,ry:6,fill:c,stroke:l,"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((x,T)=>{p.push(pe({x:h(f),y:h(d+26+T*20),"font-family":r[e.style.font],"font-size":16,"font-weight":600,fill:e.style.text},x))});let m=p.join(""),g=d+26+Math.max(0,e.titleLines.length-1)*20,w=n.header.author,E=[];e.authorLines.forEach((x,T)=>{E.push(pe({x:h(f),y:h(g+18+T*14),"font-family":r[e.style.font],"font-size":11,fill:w},x))});let y=E.join("");return Y("g",{"data-layer":"header","data-id":`${t}-header`},u+m+y)}function tU(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,c=s?e.bottomTickPanelY+o:e.box.y+e.box.height,l=t,u=e.box.y+e.box.height,f=[];for(let d of e.ticks)if(d.major)f.push(Y("line",{x1:h(d.x),y1:h(a),x2:h(d.x),y2:h(c),stroke:r,"stroke-width":1}));else if(e.minorGrid){if(d.labelX===void 0)continue;f.push(Y("line",{x1:h(d.x),y1:h(l),x2:h(d.x),y2:h(u),stroke:i,"stroke-width":1}))}for(let d of e.nonWorking??[])d.seam&&f.push(Y("line",{x1:h(d.x),y1:h(l),x2:h(d.x),y2:h(u),stroke:n.timeline.nonWorkingSeam,"stroke-width":1,"stroke-dasharray":"1 3"}));return Y("g",{"data-layer":"grid"},f.join(""))}function wS(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},c=r?Rx(a,r):a;!c||c.width<=0||c.height<=0||o.push(Y("rect",{x:h(c.x),y:h(c.y),width:h(c.width),height:h(c.height),fill:n.timeline.nonWorkingFill,"fill-opacity":zg}))}return o.length===0?"":Y("g",{"data-layer":"non-working"},o.join(""))}function nU(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(Y("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(dS(o.label,o.labelBox,o.labelSide,t,n)));for(let o of e.workingExceptions??[])o.labelBox&&i.push(dS(o.label,o.labelBox,o.labelSide,t,n));return i.length===0?"":Y("g",{"data-layer":"non-working-label"},i.join(""))}function dS(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"),pe(a,e)}function rU(e,t,n){let r=t.timeline.panelFill,i=t.timeline.border,o=t.timeline.labelText,s=[],a=e.tickPanelY,c=e.tickPanelHeight,l=c>0,u=e.markerRow.height>0,f=e.waveStrip?e.waveStrip.y+e.waveStrip.height:a+c,d=e.markerRow.height,p=e.bottomTickPanelY,m=e.bottomTickPanelHeight??0,g=p!==void 0&&m>0;l&&s.push(Y("rect",{x:h(e.box.x),y:h(a),width:h(e.box.width),height:h(c),rx:4,ry:4,fill:r,stroke:i,"stroke-width":1})),u&&s.push(Y("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(Y("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||(l&&s.push(pe({x:h(w.labelX),y:h(a+ol(c)),"font-family":n.sans,"font-size":ki,fill:o,"text-anchor":"middle"},w.label)),g&&s.push(pe({x:h(w.labelX),y:h(p+ol(m)),"font-family":n.sans,"font-size":ki,fill:o,"text-anchor":"middle"},w.label))));return Y("g",{"data-layer":"timeline"},s.join(""))}function iU(e,t,n){if(!e)return"";let r=t.nowline.stroke,i=t.nowline.labelText,o=Y("line",{x1:h(e.x),y1:h(e.topY),x2:h(e.x),y2:h(e.bottomY),stroke:r,"stroke-width":Xf}),s=oU(e,r),a=sU(e,i,n);return Y("g",{"data-layer":"nowline"},o+s+a)}function TS(e){let t=Xf/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+Mt,i=Cg,o=e.pillWidth;if(e.pillMode==="center")return Y("rect",{x:h(e.x-o/2),y:h(n),width:h(o),height:h(Mt),rx:i,ry:i,fill:t});let s=TS(e);if(e.pillMode==="flag-right"){let l=s+o,u=[`M ${h(s)} ${h(n)}`,`L ${h(l-i)} ${h(n)}`,`A ${i} ${i} 0 0 1 ${h(l)} ${h(n+i)}`,`L ${h(l)} ${h(r-i)}`,`A ${i} ${i} 0 0 1 ${h(l-i)} ${h(r)}`,`L ${h(s)} ${h(r)}`,"Z"].join(" ");return Y("path",{d:u,fill:t})}let a=s-o,c=[`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 Y("path",{d:c,fill:t})}function sU(e,t,n){let r=e.pillTopY+Og,i=TS(e),o,s;return e.pillMode==="center"?(o=e.x,s="middle"):e.pillMode==="flag-right"?(o=i+fs,s="start"):(o=i-fs,s="end"),pe({x:h(o),y:h(r),"font-family":n.sans,"font-size":sl,"font-weight":700,fill:t,"text-anchor":s},e.label)}function aU(e,t,n,r,i){let o=[],s=[];e.titleTruncated&&s.push(e.title),e.waveTooltip!==void 0&&s.push(e.waveTooltip),s.length>0&&o.push(`<title>${tt(s.join(`
|
|
2920
|
-
`))}</title>`);let a=cS(n,e.style.shadow);o.push(QW(e.box.x,e.box.y,e.box.width,e.box.height,e.style,{filter:a??null})),e.waveRole==="background"&&o.push(RU(e.box,e.style,n));let c=VW(e.style.bg,r),l={done:c.done,"in-progress":c.inProgress,"at-risk":c.atRisk,blocked:c.blocked,planned:c.planned,neutral:c.neutral},u=l[e.status]??l.neutral;if(e.progressFraction>0){let y=Math.max(0,Math.min(e.box.width,e.box.width*e.progressFraction));o.push(Y("rect",{x:h(e.box.x),y:h(e.box.y+e.box.height-Jt),width:h(y),height:Jt,fill:e.style.fg,opacity:.55}))}let f=e.dotSpills&&e.dotSpillCx!==null?e.dotSpillCx:e.box.x+e.box.width-_i;o.push(Y("circle",{cx:h(f),cy:h(e.box.y+Ag),r:br,fill:u})),o.push(ES(e.inlineDatePins,e.style.fg));let d;if(e.textSpills)d=e.box.x+e.box.width+Mn,e.iconSpills&&(d+=Lr+hn);else{let y=!!e.linkIcon&&e.linkIcon!=="none",T=e.inlineDatePins?.find(v=>v.side==="after"&&!v.spilled)?ls(y,{barWidth:e.box.width}):ls(!t.noLinks&&y&&!e.iconSpills);d=e.box.x+T}let p=e.style.text,m=r.entities.item.text,g=e.textSpills?m:p,w=e.textSpills?m:e.style.fg,E=e.titleLines??(e.title?[e.title]:[]);if(E.forEach((y,x)=>{y!==""&&o.push(pe({x:h(d),y:h(e.box.y+Cf+x*el),"font-family":i[e.style.font],"font-size":Nr,"font-weight":600,fill:g},y))}),(e.metaText||e.capacity)&&o.push(qW({metaText:e.metaText,capacity:e.capacity,x:d,baselineY:e.box.y+Of(E.length),fontSize:Qa,fontFamily:i[e.style.font],color:w})),e.footnoteIndicators.length>0){let y=e.box.y+kg;if(e.footnoteSpills&&e.footnoteSpillStartX!==null){let x=e.footnoteSpillStartX;for(let T=0;T<e.footnoteIndicators.length;T++){let v=e.footnoteIndicators[T];o.push(pe({x:h(x),y:h(y),"font-family":i.sans,"font-size":tl,"font-weight":700,fill:m},String(v))),x+=Zt}}else{let x=e.box.x+e.box.width-as;for(let T=e.footnoteIndicators.length-1;T>=0;T--){let v=e.footnoteIndicators[T];o.push(pe({x:h(x),y:h(y),"font-family":i.sans,"font-size":tl,"font-weight":700,fill:e.style.text,"text-anchor":"end"},String(v))),x-=Zt}}}if(!t.noLinks&&e.linkIcon&&e.linkIcon!=="none"){let y={linear:"#5e6ad2",github:"#0f172a",jira:"#0052cc",generic:r.item.linkIconFg},x=y[e.linkIcon]??y.generic,T=Lr,v=e.iconSpills&&e.iconSpillX!==null?e.iconSpillX:e.box.x+Ai,S=e.box.y+Ai,W=Y("rect",{x:h(v),y:h(S),width:T,height:T,rx:2,ry:2,fill:x}),$=v,D=S,H=Y("path",{d:`M${h($+4)} ${h(D+10)} L${h($+10)} ${h(D+4)} M${h($+6)} ${h(D+4)} H${h($+10)} V${h(D+8)}`,stroke:"#ffffff",fill:"none","stroke-width":1.1,"stroke-linecap":"round","stroke-linejoin":"round"}),P=W+H,I=e.linkHref?Y("a",{href:e.linkHref,target:"_blank",rel:"noopener"},P):P;o.push(I)}if(e.hasOverflow&&e.overflowBox){let y=r.item.overflowTailFill,x=r.item.overflowTailStroke,T=r.item.overflowCaption;o.push(Y("rect",{x:h(e.overflowBox.x),y:h(e.overflowBox.y),width:h(e.overflowBox.width),height:h(e.overflowBox.height),fill:y,stroke:x,"stroke-width":1})),e.overflowAnchorId&&e.overflowBox.width>60&&o.push(pe({x:h(e.overflowBox.x+e.overflowBox.width/2),y:h(e.overflowBox.y+e.overflowBox.height/2+3),"font-family":i.sans,"font-size":9,"font-weight":700,fill:T,"text-anchor":"middle"},`past ${e.overflowAnchorId}`))}for(let y of e.labelChips){let x=Math.min(rl[y.style.cornerRadius]??8,y.box.height/2);o.push(Y("rect",{x:h(y.box.x),y:h(y.box.y),width:h(y.box.width),height:h(y.box.height),rx:h(x),ry:h(x),fill:y.style.bg==="none"?"transparent":y.style.bg,stroke:y.style.fg,"stroke-width":.5})),o.push(pe({x:h(y.box.x+y.box.width/2),y:h(y.box.y+y.box.height/2+3),...gS(y.style,i,us.xs),"text-anchor":"middle"},y.text))}return Y("g",{"data-layer":"item","data-id":e.id??null},o.join(""))}function lU(e,t,n,r,i,o){let s=[];if(!(e.kind==="group"&&e.waveOnly)){let c=e.box.y+e.headerHeight,l=e.box.height-e.headerHeight;if(e.style.bg!=="none"){let f=t<=ry;s.push(Y("rect",{x:h(e.box.x),y:h(c),width:h(e.box.width),height:h(l),fill:f?e.style.bg:"none","fill-opacity":f?t===1?ty:ny: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+fl,d=e.box.x,p=e.box.x+e.box.width;s.push(Y("path",{d:`M${h(d)} ${h(c)} V${h(f)} H${h(p)} V${h(c)}`,fill:"none",stroke:u,"stroke-width":1.2,"stroke-dasharray":e.style.bracket==="dashed"?"3 2":null}))}e.title&&e.headerHeight>0&&s.push(pe({x:h(ps(e.box.x,JW(e.inlineDatePins))),y:h(e.box.y+ey),...gS(e.style,o,ed),"font-weight":600,fill:u},e.title)),s.push(ES(e.inlineDatePins,e.style.fg))}for(let c of e.children)s.push(vS(c,n,r,i,o,t));return Y("g",{"data-layer":e.kind,"data-id":e.id??null},s.join(""))}function vS(e,t,n,r,i,o=0){return e.kind==="item"?aU(e,t,n,r,i):lU(e,o+1,t,n,r,i)}var pS=2;function cU(e,t){switch(e){case"green":return t.swimlane.utilizationOk;case"yellow":return t.swimlane.utilizationWarn;case"red":return t.swimlane.utilizationOver}}function uU(e,t){if(!e.utilization||e.utilization.segments.length===0)return"";let n=e.box.y+e.box.height-pS,r=e.utilization.segments.map(i=>{let o=i.endX-i.startX;return o<=0?"":Y("rect",{x:h(i.startX),y:h(n),width:h(o),height:pS,fill:cU(i.classification,t),"data-utilization":i.classification,"data-load":h(i.load)})});return Y("g",{"data-layer":"lane-utilization","data-id":e.id??null},r.join(""))}function fU(e,t){let n=e.bandIndex%2===0?t.swimlane.rowTintEven:t.swimlane.rowTintOdd,r=t.swimlane.border;return Y("g",{"data-layer":"swimlane-bg","data-id":e.id??null},Y("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 _S(e,t,n,r,i){let o=r.swimlane.tabFill,s=r.swimlane.tabStroke,a=r.swimlane.tabText,c=r.swimlane.ownerText,l=r.swimlane.footnoteIndicator,u=[];if(e.title){let d=e.capacity?Ei(e.capacity.text,e.capacity.icon,10):0,p=e.footnoteIndicators.length>0?e.footnoteIndicators.join(","):"",m=p?gp(p,10):0,g=dl(e.box.x,e.title,e.owner,d,m),w=Bf,E=e.box.y+10,y=E+Wf;u.push(Y("rect",{x:h(g.tabX),y:h(E),width:h(g.tabW),height:h(w),rx:4,ry:4,fill:o,stroke:s,"stroke-width":1})),u.push(pe({x:h(g.titleX),y:h(y),"font-family":i[e.style.font],"font-size":12,"font-weight":600,fill:a},e.title)),e.owner&&u.push(pe({x:h(g.ownerX),y:h(y),"font-family":i[e.style.font],"font-size":10,fill:c},`owner: ${e.owner}`)),e.capacity&&u.push(xS(e.capacity,void 0,g.badgeX,y,10,i[e.style.font],c)),p&&u.push(pe({x:h(g.footnoteRightX),y:h(E+14),"font-family":i.sans,"font-size":10,"font-weight":700,fill:l,"text-anchor":"end"},p))}for(let f of e.children)u.push(vS(f,t,n,r,i));return u.push(uU(e,r)),Y("g",{"data-layer":"swimlane","data-id":e.id??null},u.join(""))}function AS(e,t,n){let r=e.radius,i=e.center.x,o=e.center.y,s=t.anchorDiamond.fill,a=t.anchorDiamond.stroke,c=Y("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}),l=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:l};e.labelSide==="left"&&(f["text-anchor"]="end");let d=e.title?pe(f,e.title):"";return Y("g",{"data-layer":"anchor","data-id":e.id??null},RS(e.hiddenDate)+c+d)}function kS(e,t){let n=t.anchorDiamond.cutLine;return Y("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 IS(e,t,n){let r=e.center.x,i=e.center.y,o=e.radius,s=t.milestoneDiamond.fill,a=Y("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}),c=t.milestoneDiamond.label,l=e.labelSide==="left"?e.labelBox.x+e.labelBox.width:e.labelBox.x,u={x:h(l),y:h(i+4),"font-family":n.sans,"font-size":10,"font-weight":600,fill:c};e.labelSide==="left"&&(u["text-anchor"]="end");let f=e.title?pe(u,e.title):"";return Y("g",{"data-layer":"milestone","data-id":e.id??null},RS(e.hiddenDate)+a+f)}function RS(e){return e===void 0?"":`<title>${tt(e)}</title>`}function bS(e,t,n){let r=e.isOverrun?n.milestoneDiamond.cutLineOverrun:n.milestoneDiamond.cutLineNormal,i=[];if(e.onWaveBoundary||i.push(Y("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":Uf,"stroke-linecap":"round"})),e.slackArrows&&e.slackArrows.length>0){let o=n.milestoneDiamond.slack;for(let s of e.slackArrows)i.push(Y("path",{d:`M${h(s.x)} ${h(s.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}-arrow-dark)`}))}return i.join("")}var dU="3 3";function SS(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,c=(i.y-o.y)/s,l=e.headWidth/2,u=e.head==="dot"?l:e.headWidth*5/7,f=s>u?[...n.slice(0,-1),{x:i.x-a*u,y:i.y-c*u}]:n.slice(0,-1),d=[pU(f,e.slack,r)],p=t.arrowhead.neutral;if(e.head==="dot")d.push(Y("circle",{cx:h(i.x-a*l),cy:h(i.y-c*l),r:h(l),fill:p}));else{let m=i.x-a*u,g=i.y-c*u;d.push(Y("path",{d:`M${h(m-c*l)} ${h(g+a*l)} L${h(i.x)} ${h(i.y)} L${h(m+c*l)} ${h(g-a*l)} z`,fill:p}))}return Y("g",{"data-layer":"dependency"},d.join(""))}function pU(e,t,n){if(e.length<2)return"";let r={fill:"none",stroke:n,"stroke-width":1.1,"stroke-linejoin":"round"};if(!t)return Y("path",{d:mU(e,Yf),...r});let{solid:i,dotted:o}=hU(e,Yf);return(i?Y("path",{d:i,...r}):"")+(o?Y("path",{d:o,...r,"stroke-dasharray":dU,"stroke-linecap":"round"}):"")}function hU(e,t){let n=e.length,r=[],i=[],o=[];for(let a=1;a<n-1;a++){let c=e[a-1],l=e[a],u=e[a+1],f=Math.hypot(l.x-c.x,l.y-c.y),d=Math.hypot(u.x-l.x,u.y-l.y),p=Math.min(t,f/2,d/2),m={x:Math.sign(l.x-c.x),y:Math.sign(l.y-c.y)},g={x:Math.sign(u.x-l.x),y:Math.sign(u.y-l.y)};r[a]={x:l.x-m.x*p,y:l.y-m.y*p},i[a]={x:l.x+g.x*p,y:l.y+g.y*p},p>0&&o.push(`M${h(r[a].x)} ${h(r[a].y)} Q${h(l.x)} ${h(l.y)} ${h(i[a].x)} ${h(i[a].y)}`)}let s=[];for(let a=0;a<n-1;a++){let c=a===0?e[0]:i[a],l=a===n-2?e[n-1]:r[a+1],u=`M${h(c.x)} ${h(c.y)} L${h(l.x)} ${h(l.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 mU(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),c=Math.sign(o.y-i.y),l=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&&l!==0||c!==0&&u!==0){n.push(`L${h(o.x)} ${h(o.y)}`);continue}let m={x:o.x-a*p,y:o.y-c*p},g={x:o.x+l*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 gU(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,c=n.footnotePanel.description,l=n.footnotePanel.number,u=[];u.push(Y("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(pe({x:h(e.box.x+Ft),y:h(e.box.y+Fg),"font-family":r.sans,"font-size":12,"font-weight":700,fill:s},"Footnotes"));let f=e.box.x+Ft;for(let d of e.entries){d.region!==void 0&&d.regionHeadingY!==void 0&&u.push(pe({x:h(f),y:h(d.regionHeadingY),"font-family":r.sans,"font-size":10,"font-weight":700,fill:s},d.region)),u.push(pe({x:h(f),y:h(d.y),"font-family":r.sans,"font-size":10,"font-weight":700,fill:l},String(d.number)));for(let p of d.titleLines)u.push(pe({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(pe({x:h(p.x),y:h(p.y),"font-family":r.sans,"font-size":11,fill:c},p.text))}return Y("g",{"data-layer":"footnotes"},u.join(""))}function yU(e,t,n,r,i,o){let s=r.includeRegion.border,a=r.includeRegion.fill,c=r.includeRegion.tabFill,l=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,E=e.box.height,y=Y("rect",{x:h(m),y:h(g),width:h(w),height:h(E),rx:8,ry:8,fill:a,stroke:s,"stroke-width":1,"stroke-dasharray":Uf}),x=Bf,T=pl(e.box.x,e.label,e.sourcePath),v=g-x/2,S=Y("rect",{x:h(T.tabX),y:h(v),width:h(T.tabWidth),height:x,rx:4,ry:4,fill:c,stroke:l,"stroke-width":1}),W=pe({x:h(T.tabLabelX),y:h(v+Wf),"font-family":i.sans,"font-size":11,"font-weight":600,fill:u},e.label),$=T.badgeX,D=T.badgeSize,H=g-D/2,P=Y("rect",{x:h($),y:h(H),width:D,height:D,rx:4,ry:4,fill:f,stroke:d,"stroke-width":1}),I=Y("path",{d:`M${h($+7)} ${h(H+4)} H${h($+14)} V${h(H+11)} M${h($+4)} ${h(H+7)} H${h($+11)} V${h(H+14)} H${h($+4)} Z`,stroke:p,"stroke-width":1.4,fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}),R=9,O=g+4,_=Y("rect",{x:h(T.sourceHaloX),y:h(O-R),width:h(T.sourceHaloWidth),height:R+6,fill:a}),b=pe({x:h(T.sourceTextX),y:h(O),"font-family":i.mono,"font-size":R,fill:p},e.sourcePath),L={x:m,y:g,width:w,height:E},M=o?wS(o.timeline,o.chartBox.y,r,L):"",N=o?.waves?$S(o.waves,L)+CS(o.waveBoundaries,L):"",B=o?.waves?OS(e.waveCrossings):"",G=e.nestedSwimlanes.map(A=>_S(A,t,n,r,i)).join(""),X=(e.edges??[]).map(A=>SS(A,r)).join(""),Q=e.anchors??[],j=e.milestones??[],ne=Q.map(A=>kS(A,r)).join("")+j.map(A=>bS(A,n,r)).join("")+Q.map(A=>AS(A,r,i)).join("")+j.map(A=>IS(A,r,i)).join("");return Y("g",{"data-layer":"include"},y+M+N+X+G+B+ne+S+W+P+I+_+b)}function xU(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=Cr,a=pe({x:"0",y:s,"font-family":t.sans,"font-size":Hf,"font-weight":400,fill:n},zf)+pe({x:ll,y:s,"font-family":t.sans,"font-size":Cr,"font-weight":700,fill:n},"now")+Y("rect",{x:Wg,y:12,width:Ug,height:Cr,fill:r})+pe({x:jf,y:s,"font-family":t.sans,"font-size":Cr,"font-weight":400,fill:n},"ine"),c=Y("g",{transform:`translate(${h(i)} ${h(o)}) scale(${h(al)})`},a);return Y("a",{href:Bg,target:"_blank",rel:"noopener","aria-label":"Powered by nowline"},Y("g",{"data-layer":"attribution"},c))}async function EU(e,t,n,r){let i=e.assetRef??"",{x:o,y:s,width:a,height:c}=e.box,l;try{if(r.logo&&r.logo.ref===i)l=r.logo.asset;else if(t)l=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=(l.mime??"").toLowerCase();if(u==="image/svg+xml"){let d=new TextDecoder().decode(l.bytes),p=e.intrinsic??dp(d)??{width:a,height:c},m=new Set,g=nS(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(", ")}`),Y("svg",{"data-layer":"logo",x:h(o),y:h(s),width:h(a),height:h(c),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=wU(l.bytes);return Y("image",{"data-layer":"logo",href:`data:${u};base64,${d}`,x:h(o),y:h(s),width:h(a),height:h(c),preserveAspectRatio:"xMidYMid meet"})}let f=`unsupported logo format: ${u} (${i})`;if(r.strict)throw new Error(f);return r.warn?.(f),""}function wU(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 TU=.24,hp=2,hS=3,vU=4,_U=8,AU=10;function NS(e){return e.bg==="none"?"transparent":e.bg}function yp(e){return yS(e)>=TU?"dark":"light"}function LS(e,t){return`url(#${e}-wave-hatch-${t})`}function kU(e,t,n){let r=Vg;return Y("pattern",{id:`${e}-wave-hatch-${t}`,width:r,height:r,patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)"},Y("line",{x1:h(r/2),y1:0,x2:h(r/2),y2:r,stroke:t==="dark"?n.wave.hatch:n.wave.hatchOnDark,"stroke-width":Kg,opacity:Yg}))}function IU(e){if(!e.waves)return[];let t=new Set,n=i=>{for(let o of i)o.kind==="item"?o.waveRole==="background"&&t.add(yp(NS(o.style))):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);return e.waveLegend?.entries.some(i=>i.kind==="background")&&t.add(yp(DS(e.palette))),["dark","light"].filter(i=>t.has(i))}function RU(e,t,n){let i=Math.min(rl[t.cornerRadius]??4,e.height/2);return Y("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(i),ry:h(i),fill:LS(n,yp(NS(t)))})}function Rx(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 kx=4,mp=.5;function PS(e,t){if(e.empty)return;let n=mp;return Rx({x:e.strip.box.x,y:e.strip.box.y+n,width:e.strip.box.width,height:e.strip.box.height-2*n},{x:t.box.x+n,y:e.strip.box.y,width:t.box.width-2*n,height:e.strip.box.height})}function bU(e,t){let n=Math.min(kx-mp,e.width/2,e.height/2),r=1e-6;return{left:e.x<=t.box.x+mp+r?n:0,right:e.x+e.width>=t.box.x+t.box.width-mp-r?n:0}}function SU(e,t){let{x:n,y:r,width:i,height:o}=e,s=(a,c,l)=>a>0?` A${h(a)} ${h(a)} 0 0 1 ${h(c)} ${h(l)}`:"";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 Ix(e,t,n){let r=o=>n&&(n.left>0||n.right>0)?Y("path",{d:SU(t,n),...o}):Y("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":cl}):i}function NU(e,t){let n=e.timeline,r=n.waveStrip;if(!e.waves||!r)return"";let i=[Y("rect",{x:h(n.box.x),y:h(r.y),width:h(n.box.width),height:h(r.height),rx:kx,ry:kx,fill:t.timeline.panelFill,stroke:t.timeline.border,"stroke-width":1})];for(let o of e.waves){let s=PS(o,n);s&&i.push(Y("g",{"data-id":o.id},`<title>${tt(o.strip.tooltip)}</title>${Ix(o,s,bU(s,n))}`))}return Y("g",{"data-layer":"wave-strip"},i.join(""))}function $S(e,t){let n=[];for(let r of e){if(!r.style.tint||r.empty)continue;let i=t?Rx(r.columnBox,t):r.columnBox;!i||i.width<=0||i.height<=0||n.push(Y("rect",{x:h(i.x),y:h(i.y),width:h(i.width),height:h(i.height),fill:r.style.tint,"fill-opacity":qg}))}return n.length===0?"":Y("g",{"data-layer":"wave-bg"},n.join(""))}function CS(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(Y("line",{x1:h(r.x),y1:h(i),x2:h(r.x),y2:h(o),stroke:r.stroke,"stroke-width":Vf,"stroke-dasharray":r.dash}))}return n.length===0?"":Y("g",{"data-layer":"wave-boundary"},n.join(""))}function mS(e,t){let n=gp(e,mn);return t?n*1.05:n}function LU(e,t,n){let r=e.timeline,i=r.waveStrip;if(!e.waves||!i)return"";let o=i.y+i.height/2+vU,s=i.y+hS,a=i.height-2*hS,c=[],l=(u,f)=>{let d=mS(f,!1)+2*hp;return Y("rect",{x:h(u-d/2),y:h(s),width:h(d),height:h(a),fill:t.timeline.panelFill})+pe({x:h(u),y:h(o),"font-family":n.sans,"font-size":mn,"font-style":"italic",fill:t.wave.labelMuted,"text-anchor":"middle"},f)};i.placeholder!==void 0&&c.push(l(r.box.x+r.box.width/2,i.placeholder));for(let u of e.waves){if(u.strip.gapLabel){let{text:m,x:g}=u.strip.gapLabel;c.push(l(g,m))}if(u.strip.marker){let{x:m,y:g}=u.strip.marker,w=Zg/2;c.push(Y("path",{d:`M${h(m)} ${h(g-w)} L${h(m+w)} ${h(g)} L${h(m)} ${h(g+w)} L${h(m-w)} ${h(g)} Z`,fill:t.timeline.panelFill,stroke:t.wave.boundary,"stroke-width":1.5},`<title>${tt(u.strip.tooltip)}</title>`))}let f=PS(u,r);if(!f)continue;let d=f.x+f.width,p=u.strip.footnotesShown?u.footnoteIndicators.length*Zt:0;if(p){let m=d-Wn+hp,g=d-Wn-p-hp;c.push(Ix(u,{x:g,y:s,width:m-g,height:a}))}if(u.strip.label!==void 0){let m=mS(u.strip.label,!0),g=p?Math.min(u.strip.labelX,d-Wn-p-m/2):u.strip.labelX,w=m+2*hp;c.push(Ix(u,{x:g-w/2,y:s,width:w,height:a})),c.push(pe({x:h(g),y:h(o),"font-family":n.sans,"font-size":mn,"font-weight":600,fill:u.style.text,"text-anchor":"middle"},u.strip.label))}if(u.strip.footnotesShown){let m=d-Wn;for(let g=u.footnoteIndicators.length-1;g>=0;g--)c.push(pe({x:h(m),y:h(i.y+AU),"font-family":n.sans,"font-size":_U,"font-weight":700,fill:u.style.text,"text-anchor":"end"},String(u.footnoteIndicators[g]))),m-=Zt}}return c.length===0?"":Y("g",{"data-layer":"wave-labels"},c.join(""))}function OS(e){if(!e||e.length===0)return"";let t=e.map(n=>Y("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":jg}));return Y("g",{"data-layer":"wave-cross"},t.join(""))}function DS(e){let t=e.entities.item.bg;return t==="none"?"transparent":t}function PU(e,t,n,r){if(!e)return"";let i=[];for(let o of e.entries){let s=o.swatch;if(s&&o.kind==="background"){let a=DS(n),c={x:h(s.x),y:h(s.y),width:h(s.width),height:h(s.height)};i.push(Y("rect",{...c,rx:2,ry:2,fill:a,stroke:n.entities.item.fg,"stroke-width":1})),i.push(Y("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:LS(t,yp(a))}))}else if(s&&o.kind==="boundary"){let a=s.x+s.width/2;i.push(Y("line",{x1:h(a),y1:h(s.y),x2:h(a),y2:h(s.y+s.height),stroke:n.wave.boundary,"stroke-width":Vf}))}for(let a of o.runs)i.push(pe({x:h(a.x),y:h(a.y),"font-family":r.sans,"font-size":mn,fill:n.wave.labelText},a.text))}return Y("g",{"data-layer":"wave-legend"},i.join(""))}async function bx(e,t={}){let r=new pp(t.idPrefix??"nl").next("root"),i=e.palette,o=t.fontFamilies??Gg,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>`,c=`<defs>${uS(r)}`+a(`${r}-arrow-dark`,i.arrowhead.dark)+IU(e).map(u=>kU(r,u,i)).join("")+"</defs>";s.push(c),s.push(Y("rect",{x:0,y:0,width:h(e.width),height:h(e.height),fill:e.backgroundColor})),s.push(rU(e.timeline,i,o)),s.push(NU(e,i));for(let u of e.swimlanes)s.push(fU(u,i));s.push(wS(e.timeline,e.chartBox.y,i)),e.waves&&s.push($S(e.waves)),s.push(tU(e.timeline,e.chartBox.y,i)),s.push(CS(e.waveBoundaries)),s.push(LU(e,i,o));for(let u of e.edges)s.push(SS(u,i));for(let u of e.swimlanes)s.push(_S(u,t,r,i,o));for(let u of e.includes)s.push(yU(u,t,r,i,o,e));s.push(OS(e.waveCrossings));for(let u of e.anchors)s.push(kS(u,i));for(let u of e.milestones)s.push(bS(u,r,i));s.push(nU(e.timeline,i,o));for(let u of e.anchors)s.push(AS(u,i,o));for(let u of e.milestones)s.push(IS(u,i,o));if(s.push(iU(e.nowline,i,o)),s.push(gU(e.footnotes,r,i,o)),s.push(PU(e.waveLegend,r,i,o)),s.push(eU(e.header,r,i,o)),s.push(xU(e,o)),e.header.logo&&(t.logo||t.assetResolver)){let u=await EU(e.header.logo,t.assetResolver,r,t);u&&s.push(u)}return`<svg${Ls({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 Sx="/browser-source.nowline",$U={error:3,warning:2,info:1},CU={error:3,warning:2,info:1};function MS(e,t){return $U[e]>=CU[t]}var xp,FS=0;function BS(){return xp||(xp=Sy()),xp}function OU(){return Ce.parse(`memory:///nowline-browser-${++FS}.nowline`)}async function Nx(e,t={}){let n=t.filePath??Sx,r=BS(),o=r.shared.workspace.LangiumDocumentFactory.fromString(e,OU());return await r.shared.workspace.DocumentBuilder.build([o],{validation:!0}),{ast:o.parseResult.value,diagnostics:WS(o,n)}}function WS(e,t){return US(Ii(e),t)}function US(e,t){return e.map(n=>n.origin==="lexer"?Tx(n.error,t):n.origin==="parser"?wx(n.error,t):zb(n.diagnostic,t))}async function Lx(e,t={}){let n=t.filePath??Sx,r=BS(),i,o;if(t.timezone)try{i=xx(t.timezone)}catch(x){if(!(x instanceof Di))throw x;o=x}let s=o?void 0:Ex({now:t.today,zone:i}),a=await Ax({source:e,sourcePath:n,services:r,readSource:t.readFile??Kb,assetResolver:t.assetResolver,isToleratedIncludeError:x=>vx(x.message),layout:{theme:t.theme,today:s,locale:t.locale,width:t.width,nonWorking:t.nonWorking}});if(a.kind==="invalid")return{kind:"diagnostics",diagnostics:US(a.diagnostics,n)};let c=a.kind==="include-error"&&a.legacy!==void 0,l=WS(a.document,n);for(let x of a.resolved.diagnostics){if(x.severity==="error"&&vx(x.message)){t.onSkippedInclude?.({sourcePath:x.sourcePath,message:x.message});continue}c&&Dr(x)||l.push(Hb(x))}if(a.kind==="include-error"||l.some(x=>x.severity==="error"))return{kind:"diagnostics",diagnostics:l};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=yx(d,{today:s??void 0,locale:t.locale??"en-US"}).map(x=>Yb(x,n)),g=t.showLinks!==!1,w=t.strict===!0,E=await bx(d,{idPrefix:t.idPrefix,assetResolver:t.assetResolver,logo:f,noLinks:!g,strict:w,warn:x=>u.push(x),fontFamilies:t.fontFamilies}),y=[...m,...u.map(x=>jb(x,n,w?"error":"warning"))].filter(x=>MS(x.severity,p));return w&&y.length>0?{kind:"diagnostics",diagnostics:[...l,...y]}:{kind:"svg",svg:E,warnings:y}}function Px(){xp=void 0,FS=0}var XS="/embed.nowline",$x=!1;async function GS(e){let{ast:t,diagnostics:n}=await Nx(e,{filePath:XS});return{ast:t,errors:n.filter(r=>r.severity==="error").map(r=>r.message)}}async function Ep(e,t={}){let n={filePath:XS,theme:t.theme,today:t.today,timezone:t.timezone,locale:t.locale,width:t.width,nonWorking:t.nonWorking,idPrefix:t.idPrefix,onSkippedInclude:()=>{$x||($x=!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 Lx(e,n);if(r.kind==="svg")return r.svg;let i=r.diagnostics.filter(o=>o.severity==="error").map(o=>o.message);throw new Ol(`Failed to render Nowline source: ${i.join("; ")}`,i)}var Ol=class extends Error{constructor(n,r){super(n);F(this,"details",r);this.name="EmbedRenderError"}};function zS(){$x=!1,Px()}var nn=Uint8Array,Lt=Uint16Array,Fx=Int32Array,Bx=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]),Wx=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]),HS=new nn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),KS=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 Fx(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}},qS=KS(Bx,2),DU=qS.b,Ox=qS.r;DU[28]=258,Ox[258]=28;var ZS=KS(Wx,0),Mse=ZS.b,jS=ZS.r,Dx=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,Dx[xe]=((Kn&65280)>>8|(Kn&255)<<8)>>1;var Kn,xe,Fl=(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 c=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],f=s[e[i]-1]++<<u,d=f|(1<<u)-1;f<=d;++f)a[Dx[f]>>c]=l}else for(a=new Lt(r),i=0;i<r;++i)e[i]&&(a[i]=Dx[s[e[i]-1]++]>>15-e[i]);return a}),Mi=new nn(288);for(xe=0;xe<144;++xe)Mi[xe]=8;var xe;for(xe=144;xe<256;++xe)Mi[xe]=9;var xe;for(xe=256;xe<280;++xe)Mi[xe]=7;var xe;for(xe=280;xe<288;++xe)Mi[xe]=8;var xe,wp=new nn(32);for(xe=0;xe<32;++xe)wp[xe]=5;var xe,MU=Fl(Mi,9,0);var FU=Fl(wp,5,0);var JS=function(e){return(e+7)/8|0},BU=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 qn=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},Dl=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},Cx=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:eN,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],c=n[1],l=0,u=1,f=2;for(n[0]={s:-1,f:a.f+c.f,l:a,r:c};u!=i-1;)a=n[n[l].f<n[f].f?l++:f++],c=n[l!=u&&n[l].f<n[f].f?l++:f++],n[u++]={s:-1,f:a.f+c.f,l:a,r:c};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=Mx(n[u-1],p,0);if(m>t){var r=0,g=0,w=m-t,E=1<<w;for(o.sort(function(S,W){return p[W.s]-p[S.s]||S.f-W.f});r<i;++r){var y=o[r].s;if(p[y]>t)g+=E-(1<<m-p[y]),p[y]=t;else break}for(g>>=w;g>0;){var x=o[r].s;p[x]<t?g-=1<<t-p[x]++-1:++r}for(;r>=0&&g;--r){var T=o[r].s;p[T]==t&&(--p[T],++g)}m=t}return{t:new nn(p),l:m}},Mx=function(e,t,n){return e.s==-1?Math.max(Mx(e.l,t,n+1),Mx(e.r,t,n+1)):t[e.s]=n},YS=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(c){n[r++]=c},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}},Ml=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},QS=function(e,t,n){var r=n.length,i=JS(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},VS=function(e,t,n,r,i,o,s,a,c,l,u){qn(t,u++,n),++i[256];for(var f=Cx(i,15),d=f.t,p=f.l,m=Cx(o,15),g=m.t,w=m.l,E=YS(d),y=E.c,x=E.n,T=YS(g),v=T.c,S=T.n,W=new Lt(19),$=0;$<y.length;++$)++W[y[$]&31];for(var $=0;$<v.length;++$)++W[v[$]&31];for(var D=Cx(W,7),H=D.t,P=D.l,I=19;I>4&&!H[HS[I-1]];--I);var R=l+5<<3,O=Ml(i,Mi)+Ml(o,wp)+s,_=Ml(i,d)+Ml(o,g)+s+14+3*I+Ml(W,H)+2*W[16]+3*W[17]+7*W[18];if(c>=0&&R<=O&&R<=_)return QS(t,u,e.subarray(c,c+l));var b,L,M,N;if(qn(t,u,1+(_<O)),u+=2,_<O){b=Fl(d,p,0),L=d,M=Fl(g,w,0),N=g;var B=Fl(H,P,0);qn(t,u,x-257),qn(t,u+5,S-1),qn(t,u+10,I-4),u+=14;for(var $=0;$<I;++$)qn(t,u+3*$,H[HS[$]]);u+=3*I;for(var G=[y,v],X=0;X<2;++X)for(var Q=G[X],$=0;$<Q.length;++$){var j=Q[$]&31;qn(t,u,B[j]),u+=H[j],j>15&&(qn(t,u,Q[$]>>5&127),u+=Q[$]>>12)}}else b=MU,L=Mi,M=FU,N=wp;for(var $=0;$<a;++$){var ne=r[$];if(ne>255){var j=ne>>18&31;Dl(t,u,b[j+257]),u+=L[j+257],j>7&&(qn(t,u,ne>>23&31),u+=Bx[j]);var A=ne&31;Dl(t,u,M[A]),u+=N[A],A>3&&(Dl(t,u,ne>>5&8191),u+=Wx[A])}else Dl(t,u,b[ne]),u+=L[ne]}return Dl(t,u,b[256]),u+L[256]},WU=new Fx([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),eN=new nn(0),UU=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),c=a.subarray(r,a.length-i),l=o.l,u=(o.r||0)&7;if(t){u&&(c[0]=o.r>>3);for(var f=WU[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),E=Math.ceil(n/3),y=2*E,x=function(ge){return(e[ge]^e[ge+1]<<E^e[ge+2]<<y)&m},T=new Fx(25e3),v=new Lt(288),S=new Lt(32),W=0,$=0,D=o.i||0,H=0,P=o.w||0,I=0;D+2<s;++D){var R=x(D),O=D&32767,_=w[R];if(g[O]=_,w[R]=O,P<=D){var b=s-D;if((W>7e3||H>24576)&&(b>423||!l)){u=VS(e,c,0,T,v,S,$,H,I,D-I,u),H=W=$=0,I=D;for(var L=0;L<286;++L)v[L]=0;for(var L=0;L<30;++L)S[L]=0}var M=2,N=0,B=p,G=O-_&32767;if(b>2&&R==x(D-G))for(var X=Math.min(d,b)-1,Q=Math.min(32767,D),j=Math.min(258,b);G<=Q&&--B&&O!=_;){if(e[D+M]==e[D+M-G]){for(var ne=0;ne<j&&e[D+ne]==e[D+ne-G];++ne);if(ne>M){if(M=ne,N=G,ne>X)break;for(var A=Math.min(G,ne-2),C=0,L=0;L<A;++L){var U=D-G+L&32767,z=g[U],J=U-z&32767;J>C&&(C=J,_=U)}}}O=_,_=g[O],G+=O-_&32767}if(N){T[H++]=268435456|Ox[M]<<18|jS[N];var Z=Ox[M]&31,ee=jS[N]&31;$+=Bx[Z]+Wx[ee],++v[257+Z],++S[ee],P=D+M,++W}else T[H++]=e[D],++v[e[D]]}}for(D=Math.max(D,P);D<s;++D)T[H++]=e[D],++v[e[D]];u=VS(e,c,l,T,v,S,$,H,I,D-I,u),l||(o.r=u&7|c[u/8|0]<<3,u-=7,o.h=w,o.p=g,o.i=D,o.w=P)}else{for(var D=o.w||0;D<s+l;D+=65535){var oe=D+65535;oe>=s&&(c[u/8|0]=l,oe=s),u=QS(c,u+1,e.subarray(D,oe))}o.i=s}return BU(a,0,r+JS(u)+i)};var tN=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}}},XU=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 UU(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 nN=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};var GU=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=tN();i.p(t.dictionary),nN(e,2,i.d())}};function rN(e,t){t||(t={});var n=tN();n.p(e);var r=XU(e,t,t.dictionary?6:2,4);return GU(r,t),nN(r,r.length-4,n.d()),r}var zU=typeof TextDecoder<"u"&&new TextDecoder,HU=0;try{zU.decode(eN,{stream:!0}),HU=1}catch{}var sN="https://free.nowline.io/open";function iN(e){let t=new TextEncoder().encode(e),n=rN(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 Ux({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}",iN(e));let r=n===!0?sN:n,i=new URL(r);return t!==void 0&&oN(t)?i.hash=`url=${encodeURIComponent(t)}`:i.hash=`text=${iN(e)}`,i.toString()}function oN(e){try{return new URL(e).protocol==="https:"}catch{return!1}}var aN=0;async function lN(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=++aN,s=e.share??!0,a=[],c=0;for(let l of Array.from(n)){let u=jU(l);if(!u)continue;let f=YU(l),d=`nl-r${o}-${c++}`,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,E=l.getAttribute("data-nowline-source-url")??void 0??e.sourceUrl;a.push(Ep(f,p).then(y=>{if(VU(u,y),r++,m!==null){let x=Ux({source:f,sourceUrl:E,share:s});if(x!==null){let T=t.createElement("a");T.className="nowline-share",T.href=x,T.target="_blank",T.rel="noopener noreferrer",T.textContent="Share on Nowline",m.insertBefore(T,g)}}},y=>{i++,console.error("nowline: render failed",y)}))}return await Promise.all(a),{rendered:r,failed:i}}function jU(e){let t=e.parentElement;return t&&t.tagName.toUpperCase()==="PRE"?t:e}function YU(e){return e.textContent??""}function VU(e,t){e.outerHTML=t}function cN(){aN=0}function Tp(){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 uN(e,t){return e&&e!=="auto"?Oy(e)??t:t}var KU="0.0.0-dev.20261017174947.ge897dee",qU="e897dee",ZU="pre code.language-nowline, code.language-nowline",fN={theme:"auto",startOnLoad:!0,selector:ZU,systemTheme:Tp(),share:!0},Ae={...fN},Xx=!1;function JU(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:Tp()}}function dN(){return{theme:uN(Ae.theme,Ae.systemTheme),locale:Ae.locale,width:Ae.width,nonWorking:Ae.nonWorking,today:Ae.today,timezone:Ae.timezone}}async function QU(e,t={}){let n={...dN(),...t};return Ep(e,n)}async function eX(e){return GS(e)}async function Gx(e){let t={selector:e?.selector??Ae.selector,theme:e?.theme??dN().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 lN(t)}var tX=Gx;if(typeof document<"u"&&!Xx){Xx=!0;let e=()=>{Ae.startOnLoad&&Gx()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):queueMicrotask(e)}function nX(){Ae={...fN,systemTheme:Tp()},Xx=!1,zS(),cN()}return AN(rX);})();
|
|
2920
|
+
`))}</title>`);let a=cS(n,e.style.shadow);o.push(QW(e.box.x,e.box.y,e.box.width,e.box.height,e.style,{filter:a??null})),e.waveRole==="background"&&o.push(RU(e.box,e.style,n));let c=VW(e.style.bg,r),l={done:c.done,"in-progress":c.inProgress,"at-risk":c.atRisk,blocked:c.blocked,planned:c.planned,neutral:c.neutral},u=l[e.status]??l.neutral;if(e.progressFraction>0){let y=Math.max(0,Math.min(e.box.width,e.box.width*e.progressFraction));o.push(Y("rect",{x:h(e.box.x),y:h(e.box.y+e.box.height-Jt),width:h(y),height:Jt,fill:e.style.fg,opacity:.55}))}let f=e.dotSpills&&e.dotSpillCx!==null?e.dotSpillCx:e.box.x+e.box.width-_i;o.push(Y("circle",{cx:h(f),cy:h(e.box.y+Ag),r:br,fill:u})),o.push(ES(e.inlineDatePins,e.style.fg));let d;if(e.textSpills)d=e.box.x+e.box.width+Mn,e.iconSpills&&(d+=Lr+hn);else{let y=!!e.linkIcon&&e.linkIcon!=="none",T=e.inlineDatePins?.find(v=>v.side==="after"&&!v.spilled)?ls(y,{barWidth:e.box.width}):ls(!t.noLinks&&y&&!e.iconSpills);d=e.box.x+T}let p=e.style.text,m=r.entities.item.text,g=e.textSpills?m:p,w=e.textSpills?m:e.style.fg,E=e.titleLines??(e.title?[e.title]:[]);if(E.forEach((y,x)=>{y!==""&&o.push(pe({x:h(d),y:h(e.box.y+Cf+x*el),"font-family":i[e.style.font],"font-size":Nr,"font-weight":600,fill:g},y))}),(e.metaText||e.capacity)&&o.push(qW({metaText:e.metaText,capacity:e.capacity,x:d,baselineY:e.box.y+Of(E.length),fontSize:Qa,fontFamily:i[e.style.font],color:w})),e.footnoteIndicators.length>0){let y=e.box.y+kg;if(e.footnoteSpills&&e.footnoteSpillStartX!==null){let x=e.footnoteSpillStartX;for(let T=0;T<e.footnoteIndicators.length;T++){let v=e.footnoteIndicators[T];o.push(pe({x:h(x),y:h(y),"font-family":i.sans,"font-size":tl,"font-weight":700,fill:m},String(v))),x+=Zt}}else{let x=e.box.x+e.box.width-as;for(let T=e.footnoteIndicators.length-1;T>=0;T--){let v=e.footnoteIndicators[T];o.push(pe({x:h(x),y:h(y),"font-family":i.sans,"font-size":tl,"font-weight":700,fill:e.style.text,"text-anchor":"end"},String(v))),x-=Zt}}}if(!t.noLinks&&e.linkIcon&&e.linkIcon!=="none"){let y={linear:"#5e6ad2",github:"#0f172a",jira:"#0052cc",generic:r.item.linkIconFg},x=y[e.linkIcon]??y.generic,T=Lr,v=e.iconSpills&&e.iconSpillX!==null?e.iconSpillX:e.box.x+Ai,S=e.box.y+Ai,W=Y("rect",{x:h(v),y:h(S),width:T,height:T,rx:2,ry:2,fill:x}),$=v,D=S,H=Y("path",{d:`M${h($+4)} ${h(D+10)} L${h($+10)} ${h(D+4)} M${h($+6)} ${h(D+4)} H${h($+10)} V${h(D+8)}`,stroke:"#ffffff",fill:"none","stroke-width":1.1,"stroke-linecap":"round","stroke-linejoin":"round"}),P=W+H,I=e.linkHref?Y("a",{href:e.linkHref,target:"_blank",rel:"noopener"},P):P;o.push(I)}if(e.hasOverflow&&e.overflowBox){let y=r.item.overflowTailFill,x=r.item.overflowTailStroke,T=r.item.overflowCaption;o.push(Y("rect",{x:h(e.overflowBox.x),y:h(e.overflowBox.y),width:h(e.overflowBox.width),height:h(e.overflowBox.height),fill:y,stroke:x,"stroke-width":1})),e.overflowAnchorId&&e.overflowBox.width>60&&o.push(pe({x:h(e.overflowBox.x+e.overflowBox.width/2),y:h(e.overflowBox.y+e.overflowBox.height/2+3),"font-family":i.sans,"font-size":9,"font-weight":700,fill:T,"text-anchor":"middle"},`past ${e.overflowAnchorId}`))}for(let y of e.labelChips){let x=Math.min(rl[y.style.cornerRadius]??8,y.box.height/2);o.push(Y("rect",{x:h(y.box.x),y:h(y.box.y),width:h(y.box.width),height:h(y.box.height),rx:h(x),ry:h(x),fill:y.style.bg==="none"?"transparent":y.style.bg,stroke:y.style.fg,"stroke-width":.5})),o.push(pe({x:h(y.box.x+y.box.width/2),y:h(y.box.y+y.box.height/2+3),...gS(y.style,i,us.xs),"text-anchor":"middle"},y.text))}return Y("g",{"data-layer":"item","data-id":e.id??null},o.join(""))}function lU(e,t,n,r,i,o){let s=[];if(!(e.kind==="group"&&e.waveOnly)){let c=e.box.y+e.headerHeight,l=e.box.height-e.headerHeight;if(e.style.bg!=="none"){let f=t<=ry;s.push(Y("rect",{x:h(e.box.x),y:h(c),width:h(e.box.width),height:h(l),fill:f?e.style.bg:"none","fill-opacity":f?t===1?ty:ny: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+fl,d=e.box.x,p=e.box.x+e.box.width;s.push(Y("path",{d:`M${h(d)} ${h(c)} V${h(f)} H${h(p)} V${h(c)}`,fill:"none",stroke:u,"stroke-width":1.2,"stroke-dasharray":e.style.bracket==="dashed"?"3 2":null}))}e.title&&e.headerHeight>0&&s.push(pe({x:h(ps(e.box.x,JW(e.inlineDatePins))),y:h(e.box.y+ey),...gS(e.style,o,ed),"font-weight":600,fill:u},e.title)),s.push(ES(e.inlineDatePins,e.style.fg))}for(let c of e.children)s.push(vS(c,n,r,i,o,t));return Y("g",{"data-layer":e.kind,"data-id":e.id??null},s.join(""))}function vS(e,t,n,r,i,o=0){return e.kind==="item"?aU(e,t,n,r,i):lU(e,o+1,t,n,r,i)}var pS=2;function cU(e,t){switch(e){case"green":return t.swimlane.utilizationOk;case"yellow":return t.swimlane.utilizationWarn;case"red":return t.swimlane.utilizationOver}}function uU(e,t){if(!e.utilization||e.utilization.segments.length===0)return"";let n=e.box.y+e.box.height-pS,r=e.utilization.segments.map(i=>{let o=i.endX-i.startX;return o<=0?"":Y("rect",{x:h(i.startX),y:h(n),width:h(o),height:pS,fill:cU(i.classification,t),"data-utilization":i.classification,"data-load":h(i.load)})});return Y("g",{"data-layer":"lane-utilization","data-id":e.id??null},r.join(""))}function fU(e,t){let n=e.bandIndex%2===0?t.swimlane.rowTintEven:t.swimlane.rowTintOdd,r=t.swimlane.border;return Y("g",{"data-layer":"swimlane-bg","data-id":e.id??null},Y("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 _S(e,t,n,r,i){let o=r.swimlane.tabFill,s=r.swimlane.tabStroke,a=r.swimlane.tabText,c=r.swimlane.ownerText,l=r.swimlane.footnoteIndicator,u=[];if(e.title){let d=e.capacity?Ei(e.capacity.text,e.capacity.icon,10):0,p=e.footnoteIndicators.length>0?e.footnoteIndicators.join(","):"",m=p?gp(p,10):0,g=dl(e.box.x,e.title,e.owner,d,m),w=Bf,E=e.box.y+10,y=E+Wf;u.push(Y("rect",{x:h(g.tabX),y:h(E),width:h(g.tabW),height:h(w),rx:4,ry:4,fill:o,stroke:s,"stroke-width":1})),u.push(pe({x:h(g.titleX),y:h(y),"font-family":i[e.style.font],"font-size":12,"font-weight":600,fill:a},e.title)),e.owner&&u.push(pe({x:h(g.ownerX),y:h(y),"font-family":i[e.style.font],"font-size":10,fill:c},`owner: ${e.owner}`)),e.capacity&&u.push(xS(e.capacity,void 0,g.badgeX,y,10,i[e.style.font],c)),p&&u.push(pe({x:h(g.footnoteRightX),y:h(E+14),"font-family":i.sans,"font-size":10,"font-weight":700,fill:l,"text-anchor":"end"},p))}for(let f of e.children)u.push(vS(f,t,n,r,i));return u.push(uU(e,r)),Y("g",{"data-layer":"swimlane","data-id":e.id??null},u.join(""))}function AS(e,t,n){let r=e.radius,i=e.center.x,o=e.center.y,s=t.anchorDiamond.fill,a=t.anchorDiamond.stroke,c=Y("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}),l=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:l};e.labelSide==="left"&&(f["text-anchor"]="end");let d=e.title?pe(f,e.title):"";return Y("g",{"data-layer":"anchor","data-id":e.id??null},RS(e.hiddenDate)+c+d)}function kS(e,t){let n=t.anchorDiamond.cutLine;return Y("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 IS(e,t,n){let r=e.center.x,i=e.center.y,o=e.radius,s=t.milestoneDiamond.fill,a=Y("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}),c=t.milestoneDiamond.label,l=e.labelSide==="left"?e.labelBox.x+e.labelBox.width:e.labelBox.x,u={x:h(l),y:h(i+4),"font-family":n.sans,"font-size":10,"font-weight":600,fill:c};e.labelSide==="left"&&(u["text-anchor"]="end");let f=e.title?pe(u,e.title):"";return Y("g",{"data-layer":"milestone","data-id":e.id??null},RS(e.hiddenDate)+a+f)}function RS(e){return e===void 0?"":`<title>${tt(e)}</title>`}function bS(e,t,n){let r=e.isOverrun?n.milestoneDiamond.cutLineOverrun:n.milestoneDiamond.cutLineNormal,i=[];if(e.onWaveBoundary||i.push(Y("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":Uf,"stroke-linecap":"round"})),e.slackArrows&&e.slackArrows.length>0){let o=n.milestoneDiamond.slack;for(let s of e.slackArrows)i.push(Y("path",{d:`M${h(s.x)} ${h(s.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}-arrow-dark)`}))}return i.join("")}var dU="3 3";function SS(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,c=(i.y-o.y)/s,l=e.headWidth/2,u=e.head==="dot"?l:e.headWidth*5/7,f=s>u?[...n.slice(0,-1),{x:i.x-a*u,y:i.y-c*u}]:n.slice(0,-1),d=[pU(f,e.slack,r)],p=t.arrowhead.neutral;if(e.head==="dot")d.push(Y("circle",{cx:h(i.x-a*l),cy:h(i.y-c*l),r:h(l),fill:p}));else{let m=i.x-a*u,g=i.y-c*u;d.push(Y("path",{d:`M${h(m-c*l)} ${h(g+a*l)} L${h(i.x)} ${h(i.y)} L${h(m+c*l)} ${h(g-a*l)} z`,fill:p}))}return Y("g",{"data-layer":"dependency"},d.join(""))}function pU(e,t,n){if(e.length<2)return"";let r={fill:"none",stroke:n,"stroke-width":1.1,"stroke-linejoin":"round"};if(!t)return Y("path",{d:mU(e,Yf),...r});let{solid:i,dotted:o}=hU(e,Yf);return(i?Y("path",{d:i,...r}):"")+(o?Y("path",{d:o,...r,"stroke-dasharray":dU,"stroke-linecap":"round"}):"")}function hU(e,t){let n=e.length,r=[],i=[],o=[];for(let a=1;a<n-1;a++){let c=e[a-1],l=e[a],u=e[a+1],f=Math.hypot(l.x-c.x,l.y-c.y),d=Math.hypot(u.x-l.x,u.y-l.y),p=Math.min(t,f/2,d/2),m={x:Math.sign(l.x-c.x),y:Math.sign(l.y-c.y)},g={x:Math.sign(u.x-l.x),y:Math.sign(u.y-l.y)};r[a]={x:l.x-m.x*p,y:l.y-m.y*p},i[a]={x:l.x+g.x*p,y:l.y+g.y*p},p>0&&o.push(`M${h(r[a].x)} ${h(r[a].y)} Q${h(l.x)} ${h(l.y)} ${h(i[a].x)} ${h(i[a].y)}`)}let s=[];for(let a=0;a<n-1;a++){let c=a===0?e[0]:i[a],l=a===n-2?e[n-1]:r[a+1],u=`M${h(c.x)} ${h(c.y)} L${h(l.x)} ${h(l.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 mU(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),c=Math.sign(o.y-i.y),l=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&&l!==0||c!==0&&u!==0){n.push(`L${h(o.x)} ${h(o.y)}`);continue}let m={x:o.x-a*p,y:o.y-c*p},g={x:o.x+l*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 gU(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,c=n.footnotePanel.description,l=n.footnotePanel.number,u=[];u.push(Y("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(pe({x:h(e.box.x+Ft),y:h(e.box.y+Fg),"font-family":r.sans,"font-size":12,"font-weight":700,fill:s},"Footnotes"));let f=e.box.x+Ft;for(let d of e.entries){d.region!==void 0&&d.regionHeadingY!==void 0&&u.push(pe({x:h(f),y:h(d.regionHeadingY),"font-family":r.sans,"font-size":10,"font-weight":700,fill:s},d.region)),u.push(pe({x:h(f),y:h(d.y),"font-family":r.sans,"font-size":10,"font-weight":700,fill:l},String(d.number)));for(let p of d.titleLines)u.push(pe({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(pe({x:h(p.x),y:h(p.y),"font-family":r.sans,"font-size":11,fill:c},p.text))}return Y("g",{"data-layer":"footnotes"},u.join(""))}function yU(e,t,n,r,i,o){let s=r.includeRegion.border,a=r.includeRegion.fill,c=r.includeRegion.tabFill,l=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,E=e.box.height,y=Y("rect",{x:h(m),y:h(g),width:h(w),height:h(E),rx:8,ry:8,fill:a,stroke:s,"stroke-width":1,"stroke-dasharray":Uf}),x=Bf,T=pl(e.box.x,e.label,e.sourcePath),v=g-x/2,S=Y("rect",{x:h(T.tabX),y:h(v),width:h(T.tabWidth),height:x,rx:4,ry:4,fill:c,stroke:l,"stroke-width":1}),W=pe({x:h(T.tabLabelX),y:h(v+Wf),"font-family":i.sans,"font-size":11,"font-weight":600,fill:u},e.label),$=T.badgeX,D=T.badgeSize,H=g-D/2,P=Y("rect",{x:h($),y:h(H),width:D,height:D,rx:4,ry:4,fill:f,stroke:d,"stroke-width":1}),I=Y("path",{d:`M${h($+7)} ${h(H+4)} H${h($+14)} V${h(H+11)} M${h($+4)} ${h(H+7)} H${h($+11)} V${h(H+14)} H${h($+4)} Z`,stroke:p,"stroke-width":1.4,fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}),R=9,O=g+4,_=Y("rect",{x:h(T.sourceHaloX),y:h(O-R),width:h(T.sourceHaloWidth),height:R+6,fill:a}),b=pe({x:h(T.sourceTextX),y:h(O),"font-family":i.mono,"font-size":R,fill:p},e.sourcePath),L={x:m,y:g,width:w,height:E},M=o?wS(o.timeline,o.chartBox.y,r,L):"",N=o?.waves?$S(o.waves,L)+CS(o.waveBoundaries,L):"",B=o?.waves?OS(e.waveCrossings):"",G=e.nestedSwimlanes.map(A=>_S(A,t,n,r,i)).join(""),X=(e.edges??[]).map(A=>SS(A,r)).join(""),Q=e.anchors??[],j=e.milestones??[],ne=Q.map(A=>kS(A,r)).join("")+j.map(A=>bS(A,n,r)).join("")+Q.map(A=>AS(A,r,i)).join("")+j.map(A=>IS(A,r,i)).join("");return Y("g",{"data-layer":"include"},y+M+N+X+G+B+ne+S+W+P+I+_+b)}function xU(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=Cr,a=pe({x:"0",y:s,"font-family":t.sans,"font-size":Hf,"font-weight":400,fill:n},zf)+pe({x:ll,y:s,"font-family":t.sans,"font-size":Cr,"font-weight":700,fill:n},"now")+Y("rect",{x:Wg,y:12,width:Ug,height:Cr,fill:r})+pe({x:jf,y:s,"font-family":t.sans,"font-size":Cr,"font-weight":400,fill:n},"ine"),c=Y("g",{transform:`translate(${h(i)} ${h(o)}) scale(${h(al)})`},a);return Y("a",{href:Bg,target:"_blank",rel:"noopener","aria-label":"Powered by nowline"},Y("g",{"data-layer":"attribution"},c))}async function EU(e,t,n,r){let i=e.assetRef??"",{x:o,y:s,width:a,height:c}=e.box,l;try{if(r.logo&&r.logo.ref===i)l=r.logo.asset;else if(t)l=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=(l.mime??"").toLowerCase();if(u==="image/svg+xml"){let d=new TextDecoder().decode(l.bytes),p=e.intrinsic??dp(d)??{width:a,height:c},m=new Set,g=nS(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(", ")}`),Y("svg",{"data-layer":"logo",x:h(o),y:h(s),width:h(a),height:h(c),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=wU(l.bytes);return Y("image",{"data-layer":"logo",href:`data:${u};base64,${d}`,x:h(o),y:h(s),width:h(a),height:h(c),preserveAspectRatio:"xMidYMid meet"})}let f=`unsupported logo format: ${u} (${i})`;if(r.strict)throw new Error(f);return r.warn?.(f),""}function wU(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 TU=.24,hp=2,hS=3,vU=4,_U=8,AU=10;function NS(e){return e.bg==="none"?"transparent":e.bg}function yp(e){return yS(e)>=TU?"dark":"light"}function LS(e,t){return`url(#${e}-wave-hatch-${t})`}function kU(e,t,n){let r=Vg;return Y("pattern",{id:`${e}-wave-hatch-${t}`,width:r,height:r,patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)"},Y("line",{x1:h(r/2),y1:0,x2:h(r/2),y2:r,stroke:t==="dark"?n.wave.hatch:n.wave.hatchOnDark,"stroke-width":Kg,opacity:Yg}))}function IU(e){if(!e.waves)return[];let t=new Set,n=i=>{for(let o of i)o.kind==="item"?o.waveRole==="background"&&t.add(yp(NS(o.style))):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);return e.waveLegend?.entries.some(i=>i.kind==="background")&&t.add(yp(DS(e.palette))),["dark","light"].filter(i=>t.has(i))}function RU(e,t,n){let i=Math.min(rl[t.cornerRadius]??4,e.height/2);return Y("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(i),ry:h(i),fill:LS(n,yp(NS(t)))})}function Rx(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 kx=4,mp=.5;function PS(e,t){if(e.empty)return;let n=mp;return Rx({x:e.strip.box.x,y:e.strip.box.y+n,width:e.strip.box.width,height:e.strip.box.height-2*n},{x:t.box.x+n,y:e.strip.box.y,width:t.box.width-2*n,height:e.strip.box.height})}function bU(e,t){let n=Math.min(kx-mp,e.width/2,e.height/2),r=1e-6;return{left:e.x<=t.box.x+mp+r?n:0,right:e.x+e.width>=t.box.x+t.box.width-mp-r?n:0}}function SU(e,t){let{x:n,y:r,width:i,height:o}=e,s=(a,c,l)=>a>0?` A${h(a)} ${h(a)} 0 0 1 ${h(c)} ${h(l)}`:"";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 Ix(e,t,n){let r=o=>n&&(n.left>0||n.right>0)?Y("path",{d:SU(t,n),...o}):Y("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":cl}):i}function NU(e,t){let n=e.timeline,r=n.waveStrip;if(!e.waves||!r)return"";let i=[Y("rect",{x:h(n.box.x),y:h(r.y),width:h(n.box.width),height:h(r.height),rx:kx,ry:kx,fill:t.timeline.panelFill,stroke:t.timeline.border,"stroke-width":1})];for(let o of e.waves){let s=PS(o,n);s&&i.push(Y("g",{"data-id":o.id},`<title>${tt(o.strip.tooltip)}</title>${Ix(o,s,bU(s,n))}`))}return Y("g",{"data-layer":"wave-strip"},i.join(""))}function $S(e,t){let n=[];for(let r of e){if(!r.style.tint||r.empty)continue;let i=t?Rx(r.columnBox,t):r.columnBox;!i||i.width<=0||i.height<=0||n.push(Y("rect",{x:h(i.x),y:h(i.y),width:h(i.width),height:h(i.height),fill:r.style.tint,"fill-opacity":qg}))}return n.length===0?"":Y("g",{"data-layer":"wave-bg"},n.join(""))}function CS(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(Y("line",{x1:h(r.x),y1:h(i),x2:h(r.x),y2:h(o),stroke:r.stroke,"stroke-width":Vf,"stroke-dasharray":r.dash}))}return n.length===0?"":Y("g",{"data-layer":"wave-boundary"},n.join(""))}function mS(e,t){let n=gp(e,mn);return t?n*1.05:n}function LU(e,t,n){let r=e.timeline,i=r.waveStrip;if(!e.waves||!i)return"";let o=i.y+i.height/2+vU,s=i.y+hS,a=i.height-2*hS,c=[],l=(u,f)=>{let d=mS(f,!1)+2*hp;return Y("rect",{x:h(u-d/2),y:h(s),width:h(d),height:h(a),fill:t.timeline.panelFill})+pe({x:h(u),y:h(o),"font-family":n.sans,"font-size":mn,"font-style":"italic",fill:t.wave.labelMuted,"text-anchor":"middle"},f)};i.placeholder!==void 0&&c.push(l(r.box.x+r.box.width/2,i.placeholder));for(let u of e.waves){if(u.strip.gapLabel){let{text:m,x:g}=u.strip.gapLabel;c.push(l(g,m))}if(u.strip.marker){let{x:m,y:g}=u.strip.marker,w=Zg/2;c.push(Y("path",{d:`M${h(m)} ${h(g-w)} L${h(m+w)} ${h(g)} L${h(m)} ${h(g+w)} L${h(m-w)} ${h(g)} Z`,fill:t.timeline.panelFill,stroke:t.wave.boundary,"stroke-width":1.5},`<title>${tt(u.strip.tooltip)}</title>`))}let f=PS(u,r);if(!f)continue;let d=f.x+f.width,p=u.strip.footnotesShown?u.footnoteIndicators.length*Zt:0;if(p){let m=d-Wn+hp,g=d-Wn-p-hp;c.push(Ix(u,{x:g,y:s,width:m-g,height:a}))}if(u.strip.label!==void 0){let m=mS(u.strip.label,!0),g=p?Math.min(u.strip.labelX,d-Wn-p-m/2):u.strip.labelX,w=m+2*hp;c.push(Ix(u,{x:g-w/2,y:s,width:w,height:a})),c.push(pe({x:h(g),y:h(o),"font-family":n.sans,"font-size":mn,"font-weight":600,fill:u.style.text,"text-anchor":"middle"},u.strip.label))}if(u.strip.footnotesShown){let m=d-Wn;for(let g=u.footnoteIndicators.length-1;g>=0;g--)c.push(pe({x:h(m),y:h(i.y+AU),"font-family":n.sans,"font-size":_U,"font-weight":700,fill:u.style.text,"text-anchor":"end"},String(u.footnoteIndicators[g]))),m-=Zt}}return c.length===0?"":Y("g",{"data-layer":"wave-labels"},c.join(""))}function OS(e){if(!e||e.length===0)return"";let t=e.map(n=>Y("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":jg}));return Y("g",{"data-layer":"wave-cross"},t.join(""))}function DS(e){let t=e.entities.item.bg;return t==="none"?"transparent":t}function PU(e,t,n,r){if(!e)return"";let i=[];for(let o of e.entries){let s=o.swatch;if(s&&o.kind==="background"){let a=DS(n),c={x:h(s.x),y:h(s.y),width:h(s.width),height:h(s.height)};i.push(Y("rect",{...c,rx:2,ry:2,fill:a,stroke:n.entities.item.fg,"stroke-width":1})),i.push(Y("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:LS(t,yp(a))}))}else if(s&&o.kind==="boundary"){let a=s.x+s.width/2;i.push(Y("line",{x1:h(a),y1:h(s.y),x2:h(a),y2:h(s.y+s.height),stroke:n.wave.boundary,"stroke-width":Vf}))}for(let a of o.runs)i.push(pe({x:h(a.x),y:h(a.y),"font-family":r.sans,"font-size":mn,fill:n.wave.labelText},a.text))}return Y("g",{"data-layer":"wave-legend"},i.join(""))}async function bx(e,t={}){let r=new pp(t.idPrefix??"nl").next("root"),i=e.palette,o=t.fontFamilies??Gg,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>`,c=`<defs>${uS(r)}`+a(`${r}-arrow-dark`,i.arrowhead.dark)+IU(e).map(u=>kU(r,u,i)).join("")+"</defs>";s.push(c),s.push(Y("rect",{x:0,y:0,width:h(e.width),height:h(e.height),fill:e.backgroundColor})),s.push(rU(e.timeline,i,o)),s.push(NU(e,i));for(let u of e.swimlanes)s.push(fU(u,i));s.push(wS(e.timeline,e.chartBox.y,i)),e.waves&&s.push($S(e.waves)),s.push(tU(e.timeline,e.chartBox.y,i)),s.push(CS(e.waveBoundaries)),s.push(LU(e,i,o));for(let u of e.edges)s.push(SS(u,i));for(let u of e.swimlanes)s.push(_S(u,t,r,i,o));for(let u of e.includes)s.push(yU(u,t,r,i,o,e));s.push(OS(e.waveCrossings));for(let u of e.anchors)s.push(kS(u,i));for(let u of e.milestones)s.push(bS(u,r,i));s.push(nU(e.timeline,i,o));for(let u of e.anchors)s.push(AS(u,i,o));for(let u of e.milestones)s.push(IS(u,i,o));if(s.push(iU(e.nowline,i,o)),s.push(gU(e.footnotes,r,i,o)),s.push(PU(e.waveLegend,r,i,o)),s.push(eU(e.header,r,i,o)),s.push(xU(e,o)),e.header.logo&&(t.logo||t.assetResolver)){let u=await EU(e.header.logo,t.assetResolver,r,t);u&&s.push(u)}return`<svg${Ls({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 Sx="/browser-source.nowline",$U={error:3,warning:2,info:1},CU={error:3,warning:2,info:1};function MS(e,t){return $U[e]>=CU[t]}var xp,FS=0;function BS(){return xp||(xp=Sy()),xp}function OU(){return Ce.parse(`memory:///nowline-browser-${++FS}.nowline`)}async function Nx(e,t={}){let n=t.filePath??Sx,r=BS(),o=r.shared.workspace.LangiumDocumentFactory.fromString(e,OU());return await r.shared.workspace.DocumentBuilder.build([o],{validation:!0}),{ast:o.parseResult.value,diagnostics:WS(o,n)}}function WS(e,t){return US(Ii(e),t)}function US(e,t){return e.map(n=>n.origin==="lexer"?Tx(n.error,t):n.origin==="parser"?wx(n.error,t):zb(n.diagnostic,t))}async function Lx(e,t={}){let n=t.filePath??Sx,r=BS(),i,o;if(t.timezone)try{i=xx(t.timezone)}catch(x){if(!(x instanceof Di))throw x;o=x}let s=o?void 0:Ex({now:t.today,zone:i}),a=await Ax({source:e,sourcePath:n,services:r,readSource:t.readFile??Kb,assetResolver:t.assetResolver,isToleratedIncludeError:x=>vx(x.message),layout:{theme:t.theme,today:s,locale:t.locale,width:t.width,nonWorking:t.nonWorking}});if(a.kind==="invalid")return{kind:"diagnostics",diagnostics:US(a.diagnostics,n)};let c=a.kind==="include-error"&&a.legacy!==void 0,l=WS(a.document,n);for(let x of a.resolved.diagnostics){if(x.severity==="error"&&vx(x.message)){t.onSkippedInclude?.({sourcePath:x.sourcePath,message:x.message});continue}c&&Dr(x)||l.push(Hb(x))}if(a.kind==="include-error"||l.some(x=>x.severity==="error"))return{kind:"diagnostics",diagnostics:l};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=yx(d,{today:s??void 0,locale:t.locale??"en-US"}).map(x=>Yb(x,n)),g=t.showLinks!==!1,w=t.strict===!0,E=await bx(d,{idPrefix:t.idPrefix,assetResolver:t.assetResolver,logo:f,noLinks:!g,strict:w,warn:x=>u.push(x),fontFamilies:t.fontFamilies}),y=[...m,...u.map(x=>jb(x,n,w?"error":"warning"))].filter(x=>MS(x.severity,p));return w&&y.length>0?{kind:"diagnostics",diagnostics:[...l,...y]}:{kind:"svg",svg:E,warnings:y}}function Px(){xp=void 0,FS=0}var XS="/embed.nowline",$x=!1;async function GS(e){let{ast:t,diagnostics:n}=await Nx(e,{filePath:XS});return{ast:t,errors:n.filter(r=>r.severity==="error").map(r=>r.message)}}async function Ep(e,t={}){let n={filePath:XS,theme:t.theme,today:t.today,timezone:t.timezone,locale:t.locale,width:t.width,nonWorking:t.nonWorking,idPrefix:t.idPrefix,onSkippedInclude:()=>{$x||($x=!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 Lx(e,n);if(r.kind==="svg")return r.svg;let i=r.diagnostics.filter(o=>o.severity==="error").map(o=>o.message);throw new Ol(`Failed to render Nowline source: ${i.join("; ")}`,i)}var Ol=class extends Error{constructor(n,r){super(n);F(this,"details",r);this.name="EmbedRenderError"}};function zS(){$x=!1,Px()}var nn=Uint8Array,Lt=Uint16Array,Fx=Int32Array,Bx=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]),Wx=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]),HS=new nn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),KS=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 Fx(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}},qS=KS(Bx,2),DU=qS.b,Ox=qS.r;DU[28]=258,Ox[258]=28;var ZS=KS(Wx,0),Mse=ZS.b,jS=ZS.r,Dx=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,Dx[xe]=((Kn&65280)>>8|(Kn&255)<<8)>>1;var Kn,xe,Fl=(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 c=15-t;for(i=0;i<r;++i)if(e[i])for(var l=i<<4|e[i],u=t-e[i],f=s[e[i]-1]++<<u,d=f|(1<<u)-1;f<=d;++f)a[Dx[f]>>c]=l}else for(a=new Lt(r),i=0;i<r;++i)e[i]&&(a[i]=Dx[s[e[i]-1]++]>>15-e[i]);return a}),Mi=new nn(288);for(xe=0;xe<144;++xe)Mi[xe]=8;var xe;for(xe=144;xe<256;++xe)Mi[xe]=9;var xe;for(xe=256;xe<280;++xe)Mi[xe]=7;var xe;for(xe=280;xe<288;++xe)Mi[xe]=8;var xe,wp=new nn(32);for(xe=0;xe<32;++xe)wp[xe]=5;var xe,MU=Fl(Mi,9,0);var FU=Fl(wp,5,0);var JS=function(e){return(e+7)/8|0},BU=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 qn=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},Dl=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},Cx=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:eN,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],c=n[1],l=0,u=1,f=2;for(n[0]={s:-1,f:a.f+c.f,l:a,r:c};u!=i-1;)a=n[n[l].f<n[f].f?l++:f++],c=n[l!=u&&n[l].f<n[f].f?l++:f++],n[u++]={s:-1,f:a.f+c.f,l:a,r:c};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=Mx(n[u-1],p,0);if(m>t){var r=0,g=0,w=m-t,E=1<<w;for(o.sort(function(S,W){return p[W.s]-p[S.s]||S.f-W.f});r<i;++r){var y=o[r].s;if(p[y]>t)g+=E-(1<<m-p[y]),p[y]=t;else break}for(g>>=w;g>0;){var x=o[r].s;p[x]<t?g-=1<<t-p[x]++-1:++r}for(;r>=0&&g;--r){var T=o[r].s;p[T]==t&&(--p[T],++g)}m=t}return{t:new nn(p),l:m}},Mx=function(e,t,n){return e.s==-1?Math.max(Mx(e.l,t,n+1),Mx(e.r,t,n+1)):t[e.s]=n},YS=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(c){n[r++]=c},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}},Ml=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},QS=function(e,t,n){var r=n.length,i=JS(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},VS=function(e,t,n,r,i,o,s,a,c,l,u){qn(t,u++,n),++i[256];for(var f=Cx(i,15),d=f.t,p=f.l,m=Cx(o,15),g=m.t,w=m.l,E=YS(d),y=E.c,x=E.n,T=YS(g),v=T.c,S=T.n,W=new Lt(19),$=0;$<y.length;++$)++W[y[$]&31];for(var $=0;$<v.length;++$)++W[v[$]&31];for(var D=Cx(W,7),H=D.t,P=D.l,I=19;I>4&&!H[HS[I-1]];--I);var R=l+5<<3,O=Ml(i,Mi)+Ml(o,wp)+s,_=Ml(i,d)+Ml(o,g)+s+14+3*I+Ml(W,H)+2*W[16]+3*W[17]+7*W[18];if(c>=0&&R<=O&&R<=_)return QS(t,u,e.subarray(c,c+l));var b,L,M,N;if(qn(t,u,1+(_<O)),u+=2,_<O){b=Fl(d,p,0),L=d,M=Fl(g,w,0),N=g;var B=Fl(H,P,0);qn(t,u,x-257),qn(t,u+5,S-1),qn(t,u+10,I-4),u+=14;for(var $=0;$<I;++$)qn(t,u+3*$,H[HS[$]]);u+=3*I;for(var G=[y,v],X=0;X<2;++X)for(var Q=G[X],$=0;$<Q.length;++$){var j=Q[$]&31;qn(t,u,B[j]),u+=H[j],j>15&&(qn(t,u,Q[$]>>5&127),u+=Q[$]>>12)}}else b=MU,L=Mi,M=FU,N=wp;for(var $=0;$<a;++$){var ne=r[$];if(ne>255){var j=ne>>18&31;Dl(t,u,b[j+257]),u+=L[j+257],j>7&&(qn(t,u,ne>>23&31),u+=Bx[j]);var A=ne&31;Dl(t,u,M[A]),u+=N[A],A>3&&(Dl(t,u,ne>>5&8191),u+=Wx[A])}else Dl(t,u,b[ne]),u+=L[ne]}return Dl(t,u,b[256]),u+L[256]},WU=new Fx([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),eN=new nn(0),UU=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),c=a.subarray(r,a.length-i),l=o.l,u=(o.r||0)&7;if(t){u&&(c[0]=o.r>>3);for(var f=WU[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),E=Math.ceil(n/3),y=2*E,x=function(ge){return(e[ge]^e[ge+1]<<E^e[ge+2]<<y)&m},T=new Fx(25e3),v=new Lt(288),S=new Lt(32),W=0,$=0,D=o.i||0,H=0,P=o.w||0,I=0;D+2<s;++D){var R=x(D),O=D&32767,_=w[R];if(g[O]=_,w[R]=O,P<=D){var b=s-D;if((W>7e3||H>24576)&&(b>423||!l)){u=VS(e,c,0,T,v,S,$,H,I,D-I,u),H=W=$=0,I=D;for(var L=0;L<286;++L)v[L]=0;for(var L=0;L<30;++L)S[L]=0}var M=2,N=0,B=p,G=O-_&32767;if(b>2&&R==x(D-G))for(var X=Math.min(d,b)-1,Q=Math.min(32767,D),j=Math.min(258,b);G<=Q&&--B&&O!=_;){if(e[D+M]==e[D+M-G]){for(var ne=0;ne<j&&e[D+ne]==e[D+ne-G];++ne);if(ne>M){if(M=ne,N=G,ne>X)break;for(var A=Math.min(G,ne-2),C=0,L=0;L<A;++L){var U=D-G+L&32767,z=g[U],J=U-z&32767;J>C&&(C=J,_=U)}}}O=_,_=g[O],G+=O-_&32767}if(N){T[H++]=268435456|Ox[M]<<18|jS[N];var Z=Ox[M]&31,ee=jS[N]&31;$+=Bx[Z]+Wx[ee],++v[257+Z],++S[ee],P=D+M,++W}else T[H++]=e[D],++v[e[D]]}}for(D=Math.max(D,P);D<s;++D)T[H++]=e[D],++v[e[D]];u=VS(e,c,l,T,v,S,$,H,I,D-I,u),l||(o.r=u&7|c[u/8|0]<<3,u-=7,o.h=w,o.p=g,o.i=D,o.w=P)}else{for(var D=o.w||0;D<s+l;D+=65535){var oe=D+65535;oe>=s&&(c[u/8|0]=l,oe=s),u=QS(c,u+1,e.subarray(D,oe))}o.i=s}return BU(a,0,r+JS(u)+i)};var tN=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}}},XU=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 UU(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 nN=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};var GU=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=tN();i.p(t.dictionary),nN(e,2,i.d())}};function rN(e,t){t||(t={});var n=tN();n.p(e);var r=XU(e,t,t.dictionary?6:2,4);return GU(r,t),nN(r,r.length-4,n.d()),r}var zU=typeof TextDecoder<"u"&&new TextDecoder,HU=0;try{zU.decode(eN,{stream:!0}),HU=1}catch{}var sN="https://free.nowline.io/open";function iN(e){let t=new TextEncoder().encode(e),n=rN(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 Ux({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}",iN(e));let r=n===!0?sN:n,i=new URL(r);return t!==void 0&&oN(t)?i.hash=`url=${encodeURIComponent(t)}`:i.hash=`text=${iN(e)}`,i.toString()}function oN(e){try{return new URL(e).protocol==="https:"}catch{return!1}}var aN=0;async function lN(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=++aN,s=e.share??!0,a=[],c=0;for(let l of Array.from(n)){let u=jU(l);if(!u)continue;let f=YU(l),d=`nl-r${o}-${c++}`,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,E=l.getAttribute("data-nowline-source-url")??void 0??e.sourceUrl;a.push(Ep(f,p).then(y=>{if(VU(u,y),r++,m!==null){let x=Ux({source:f,sourceUrl:E,share:s});if(x!==null){let T=t.createElement("a");T.className="nowline-share",T.href=x,T.target="_blank",T.rel="noopener noreferrer",T.textContent="Share on Nowline",m.insertBefore(T,g)}}},y=>{i++,console.error("nowline: render failed",y)}))}return await Promise.all(a),{rendered:r,failed:i}}function jU(e){let t=e.parentElement;return t&&t.tagName.toUpperCase()==="PRE"?t:e}function YU(e){return e.textContent??""}function VU(e,t){e.outerHTML=t}function cN(){aN=0}function Tp(){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 uN(e,t){return e&&e!=="auto"?Oy(e)??t:t}var KU="0.0.0-dev.20261017184716.ge0dbbdf",qU="e0dbbdf",ZU="pre code.language-nowline, code.language-nowline",fN={theme:"auto",startOnLoad:!0,selector:ZU,systemTheme:Tp(),share:!0},Ae={...fN},Xx=!1;function JU(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:Tp()}}function dN(){return{theme:uN(Ae.theme,Ae.systemTheme),locale:Ae.locale,width:Ae.width,nonWorking:Ae.nonWorking,today:Ae.today,timezone:Ae.timezone}}async function QU(e,t={}){let n={...dN(),...t};return Ep(e,n)}async function eX(e){return GS(e)}async function Gx(e){let t={selector:e?.selector??Ae.selector,theme:e?.theme??dN().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 lN(t)}var tX=Gx;if(typeof document<"u"&&!Xx){Xx=!0;let e=()=>{Ae.startOnLoad&&Gx()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):queueMicrotask(e)}function nX(){Ae={...fN,systemTheme:Tp()},Xx=!1,zS(),cN()}return AN(rX);})();
|
|
2921
2921
|
//# sourceMappingURL=nowline.min.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nowline/embed",
|
|
3
|
-
"version": "0.0.0-dev.
|
|
3
|
+
"version": "0.0.0-dev.20261017184716.ge0dbbdf",
|
|
4
4
|
"description": "Browser embed bundle for Nowline. Drop a <script> tag and ```nowline``` blocks render in place.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"engines": {
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
"cdn"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@nowline/browser": "0.0.0-dev.
|
|
43
|
-
"@nowline/core": "0.0.0-dev.
|
|
44
|
-
"@nowline/layout": "0.0.0-dev.
|
|
45
|
-
"@nowline/renderer": "0.0.0-dev.
|
|
46
|
-
"@nowline/share-link": "0.0.0-dev.
|
|
42
|
+
"@nowline/browser": "0.0.0-dev.20261017184716.ge0dbbdf",
|
|
43
|
+
"@nowline/core": "0.0.0-dev.20261017184716.ge0dbbdf",
|
|
44
|
+
"@nowline/layout": "0.0.0-dev.20261017184716.ge0dbbdf",
|
|
45
|
+
"@nowline/renderer": "0.0.0-dev.20261017184716.ge0dbbdf",
|
|
46
|
+
"@nowline/share-link": "0.0.0-dev.20261017184716.ge0dbbdf",
|
|
47
47
|
"langium": "~4.4.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|