@nowline/embed 0.0.0-dev.20261023234242.g7cd76e6 → 0.0.0-dev.20261024005602.gaf04042

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.
@@ -1,4 +1,4 @@
1
- /*! @nowline/embed 0.0.0-dev.20261023234242.g7cd76e6 sha=7cd76e6 built=2026-10-23T23:37:39Z */
1
+ /*! @nowline/embed 0.0.0-dev.20261024005602.gaf04042 sha=af04042 built=2026-10-24T00:45:37Z */
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -40879,8 +40879,8 @@ function effectiveTheme(theme, systemTheme) {
40879
40879
  }
40880
40880
 
40881
40881
  // src/index.ts
40882
- var version = true ? "0.0.0-dev.20261023234242.g7cd76e6" : "0.0.0";
40883
- var sha = true ? "7cd76e6" : "unknown";
40882
+ var version = true ? "0.0.0-dev.20261024005602.gaf04042" : "0.0.0";
40883
+ var sha = true ? "af04042" : "unknown";
40884
40884
  var DEFAULT_SELECTOR = "pre code.language-nowline, code.language-nowline";
40885
40885
  var initialConfig = {
40886
40886
  theme: "auto",
@@ -1,4 +1,4 @@
1
- /*! @nowline/embed 0.0.0-dev.20261023234242.g7cd76e6 sha=7cd76e6 built=2026-10-23T23:37:39Z */
1
+ /*! @nowline/embed 0.0.0-dev.20261024005602.gaf04042 sha=af04042 built=2026-10-24T00:45:37Z */
2
2
  "use strict";var nowline=(()=>{var JN=Object.create;var Bs=Object.defineProperty;var QN=Object.getOwnPropertyDescriptor;var eL=Object.getOwnPropertyNames;var tL=Object.getPrototypeOf,nL=Object.prototype.hasOwnProperty;var rL=(e,t,n)=>t in e?Bs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var iL=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(r){throw n=[r],r}};var Ws=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},Wp=(e,t)=>{for(var n in t)Bs(e,n,{get:t[n],enumerable:!0})},dE=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of eL(t))!nL.call(e,i)&&i!==n&&Bs(e,i,{get:()=>t[i],enumerable:!(r=QN(t,i))||r.enumerable});return e};var Xp=(e,t,n)=>(n=e!=null?JN(tL(e)):{},dE(t||!e||!e.__esModule?Bs(n,"default",{value:e,enumerable:!0}):n,e)),oL=e=>dE(Bs({},"__esModule",{value:!0}),e);var M=(e,t,n)=>rL(e,typeof t!="symbol"?t+"":t,n);var pm=Ws(dm=>{"use strict";Object.defineProperty(dm,"__esModule",{value:!0});var um;function fm(){if(um===void 0)throw new Error("No runtime abstraction layer installed");return um}(function(e){function t(n){if(n===void 0)throw new Error("No runtime abstraction layer provided");um=n}e.install=t})(fm||(fm={}));dm.default=fm});var hm=Ws($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.boolean=lM;$n.string=$v;$n.number=cM;$n.error=uM;$n.func=fM;$n.array=Dv;$n.stringArray=dM;function lM(e){return e===!0||e===!1}function $v(e){return typeof e=="string"||e instanceof String}function cM(e){return typeof e=="number"||e instanceof Number}function uM(e){return e instanceof Error}function fM(e){return typeof e=="function"}function Dv(e){return Array.isArray(e)}function dM(e){return Dv(e)&&e.every(t=>$v(t))}});var ym=Ws(Ar=>{"use strict";var pM=Ar&&Ar.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ar,"__esModule",{value:!0});Ar.Emitter=Ar.Event=void 0;var hM=pM(pm()),Mv;(function(e){let t={dispose(){}};e.None=function(){return t}})(Mv||(Ar.Event=Mv={}));var mm=class{constructor(){M(this,"_callbacks");M(this,"_contexts")}add(t,n=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(t),this._contexts.push(n),Array.isArray(r)&&r.push({dispose:()=>this.remove(t,n)})}remove(t,n=null){if(!this._callbacks)return;let r=!1;for(let i=0,o=this._callbacks.length;i<o;i++)if(this._callbacks[i]===t)if(this._contexts[i]===n){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else r=!0;if(r)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...t){if(!this._callbacks)return[];let n=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let o=0,s=r.length;o<s;o++)try{n.push(r[o].apply(i[o],t))}catch(a){(0,hM.default)().console.error(a)}return n}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Bu=class Bu{constructor(t){M(this,"_options");M(this,"_event");M(this,"_callbacks");this._options=t}get event(){return this._event||(this._event=(t,n,r)=>{this._callbacks||(this._callbacks=new mm),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=Bu._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(t){this._callbacks&&this._callbacks.invoke.call(this._callbacks,t)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};M(Bu,"_noop",function(){});var gm=Bu;Ar.Emitter=gm});var Fv=Ws(wt=>{"use strict";var mM=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]})),gM=wt&&wt.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),yM=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"&&mM(n,t,r[i]);return gM(n,t),n}})(),xM=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 EM=xM(pm()),wM=yM(hm()),xm=ym(),Wu;(function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:xm.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:xm.Event.None});function t(n){let r=n;return r&&(r===e.None||r===e.Cancelled||wM.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}e.is=t})(Wu||(wt.CancellationToken=Wu={}));var TM=Object.freeze(function(e,t){let n=(0,EM.default)().timer.setTimeout(e.bind(t),0);return{dispose(){n.dispose()}}}),Xu=class{constructor(){M(this,"_isCancelled",!1);M(this,"_emitter")}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?TM:(this._emitter||(this._emitter=new xm.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},Em=class{constructor(){M(this,"_token")}get token(){return this._token||(this._token=new Xu),this._token}cancel(){this._token?this._token.cancel():this._token=Wu.Cancelled}dispose(){this._token?this._token instanceof Xu&&this._token.dispose():this._token=Wu.None}};wt.CancellationTokenSource=Em});var Wv=Ws(te=>{"use strict";var _M=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]})),vM=te&&te.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),AM=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"&&_M(n,t,r[i]);return vM(n,t),n}})();Object.defineProperty(te,"__esModule",{value:!0});te.Message=te.NotificationType9=te.NotificationType8=te.NotificationType7=te.NotificationType6=te.NotificationType5=te.NotificationType4=te.NotificationType3=te.NotificationType2=te.NotificationType1=te.NotificationType0=te.NotificationType=te.RequestType9=te.RequestType8=te.RequestType7=te.RequestType6=te.RequestType5=te.RequestType4=te.RequestType3=te.RequestType2=te.RequestType1=te.RequestType=te.RequestType0=te.AbstractMessageSignature=te.ParameterStructures=te.ResponseError=te.ErrorCodes=void 0;var pi=AM(hm()),wm;(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})(wm||(te.ErrorCodes=wm={}));var Tm=class e extends Error{constructor(n,r,i){super(r);M(this,"code");M(this,"data");this.code=pi.number(n)?n:wm.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=Tm;var qt=class qt{constructor(t){M(this,"kind");this.kind=t}static is(t){return t===qt.auto||t===qt.byName||t===qt.byPosition}toString(){return this.kind}};M(qt,"auto",new qt("auto")),M(qt,"byPosition",new qt("byPosition")),M(qt,"byName",new qt("byName"));var kr=qt;te.ParameterStructures=kr;var Pe=class{constructor(t,n){M(this,"method");M(this,"numberOfParams");this.method=t,this.numberOfParams=n}get parameterStructures(){return kr.auto}};te.AbstractMessageSignature=Pe;var _m=class extends Pe{constructor(n){super(n,0);M(this,"_")}};te.RequestType0=_m;var vm=class extends Pe{constructor(n,r=kr.auto){super(n,1);M(this,"_parameterStructures");M(this,"_");this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};te.RequestType=vm;var Am=class extends Pe{constructor(n,r=kr.auto){super(n,1);M(this,"_parameterStructures");M(this,"_");this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};te.RequestType1=Am;var km=class extends Pe{constructor(n){super(n,2);M(this,"_")}};te.RequestType2=km;var Im=class extends Pe{constructor(n){super(n,3);M(this,"_")}};te.RequestType3=Im;var Rm=class extends Pe{constructor(n){super(n,4);M(this,"_")}};te.RequestType4=Rm;var Sm=class extends Pe{constructor(n){super(n,5);M(this,"_")}};te.RequestType5=Sm;var bm=class extends Pe{constructor(n){super(n,6);M(this,"_")}};te.RequestType6=bm;var Nm=class extends Pe{constructor(n){super(n,7);M(this,"_")}};te.RequestType7=Nm;var Lm=class extends Pe{constructor(n){super(n,8);M(this,"_")}};te.RequestType8=Lm;var Om=class extends Pe{constructor(n){super(n,9);M(this,"_")}};te.RequestType9=Om;var Pm=class extends Pe{constructor(n,r=kr.auto){super(n,1);M(this,"_parameterStructures");M(this,"_");this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};te.NotificationType=Pm;var Cm=class extends Pe{constructor(n){super(n,0);M(this,"_")}};te.NotificationType0=Cm;var $m=class extends Pe{constructor(n,r=kr.auto){super(n,1);M(this,"_parameterStructures");M(this,"_");this._parameterStructures=r}get parameterStructures(){return this._parameterStructures}};te.NotificationType1=$m;var Dm=class extends Pe{constructor(n){super(n,2);M(this,"_")}};te.NotificationType2=Dm;var Mm=class extends Pe{constructor(n){super(n,3);M(this,"_")}};te.NotificationType3=Mm;var Fm=class extends Pe{constructor(n){super(n,4);M(this,"_")}};te.NotificationType4=Fm;var Bm=class extends Pe{constructor(n){super(n,5);M(this,"_")}};te.NotificationType5=Bm;var Wm=class extends Pe{constructor(n){super(n,6);M(this,"_")}};te.NotificationType6=Wm;var Xm=class extends Pe{constructor(n){super(n,7);M(this,"_")}};te.NotificationType7=Xm;var Um=class extends Pe{constructor(n){super(n,8);M(this,"_")}};te.NotificationType8=Um;var Gm=class extends Pe{constructor(n){super(n,9);M(this,"_")}};te.NotificationType9=Gm;var Bv;(function(e){function t(i){let o=i;return o&&pi.string(o.method)&&(pi.string(o.id)||pi.number(o.id))}e.isRequest=t;function n(i){let o=i;return o&&pi.string(o.method)&&i.id===void 0}e.isNotification=n;function r(i){let o=i;return o&&(o.result!==void 0||!!o.error)&&(pi.string(o.id)||pi.number(o.id)||o.id===null)}e.isResponse=r})(Bv||(te.Message=Bv={}))});var kI={};Wp(kI,{nodeReadFile:()=>x2});async function x2(){throw new Error("nowline: filesystem readers are unavailable in the browser embed")}var II=iL(()=>{});var WU={};Wp(WU,{EmbedRenderError:()=>Vl,__resetForTests:()=>BU,init:()=>lE,initialize:()=>$U,parse:()=>MU,render:()=>DU,run:()=>FU,sha:()=>PU,version:()=>OU});function Ue(e){return typeof e=="object"&&e!==null&&typeof e.$type=="string"}function it(e){return typeof e=="object"&&e!==null&&typeof e.$refText=="string"&&"ref"in e}function Dt(e){return typeof e=="object"&&e!==null&&typeof e.$refText=="string"&&"items"in e}function pE(e){return typeof e=="object"&&e!==null&&typeof e.name=="string"&&typeof e.type=="string"&&typeof e.path=="string"}function Ui(e){return typeof e=="object"&&e!==null&&typeof e.info=="object"&&typeof e.message=="string"}var Xi=class{constructor(){this.subtypes={},this.allSubtypes={}}getAllTypes(){return Object.keys(this.types)}getReferenceType(t){let n=this.types[t.container.$type];if(!n)throw new Error(`Type ${t.container.$type||"undefined"} not found.`);let r=n.properties[t.property]?.referenceType;if(!r)throw new Error(`Property ${t.property||"undefined"} of type ${t.container.$type} is not a reference.`);return r}getTypeMetaData(t){let n=this.types[t];return n||{name:t,properties:{},superTypes:[]}}isInstance(t,n){return Ue(t)&&this.isSubtype(t.$type,n)}isSubtype(t,n){if(t===n)return!0;let r=this.subtypes[t];r||(r=this.subtypes[t]={});let i=r[n];if(i!==void 0)return i;{let o=this.types[t],s=o?o.superTypes.some(a=>this.isSubtype(a,n)):!1;return r[n]=s,s}}getAllSubTypes(t){let n=this.allSubtypes[t];if(n)return n;{let r=this.getAllTypes(),i=[];for(let o of r)this.isSubtype(o,t)&&i.push(o);return this.allSubtypes[t]=i,i}}isComplete(t){let n=this.getTypeMetaData(t.$type);for(let r of Object.keys(n.properties)){let i=n.properties[r];if(i.optional)continue;let o=t[i.name];if(o==null)return!1}return!0}};function tr(e){return typeof e=="object"&&e!==null&&Array.isArray(e.content)}function ec(e){return typeof e=="object"&&e!==null&&typeof e.tokenType=="object"}function tc(e){return tr(e)&&typeof e.fullText=="string"}var Ht=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+=aL(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(nc(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(nc(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 aL(e){return typeof e=="string"?e:typeof e>"u"?"undefined":typeof e.toString=="function"?e.toString():Object.prototype.toString.call(e)}function nc(e){return!!e&&typeof e[Symbol.iterator]=="function"}var ic=new Ht(()=>{},()=>gt),gt=Object.freeze({done:!0,value:void 0});function ye(...e){if(e.length===1){let t=e[0];if(t instanceof Ht)return t;if(nc(t))return new Ht(()=>t[Symbol.iterator](),n=>n.next());if(typeof t.length=="number")return new Ht(()=>({index:0}),n=>n.index<t.length?{done:!1,value:t[n.index++]}:gt)}return e.length>1?new Ht(()=>({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++];nc(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}):ic}var nr=class extends Ht{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}},rc;(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})(rc||(rc={}));function oc(e,t={}){for(let[n,r]of Object.entries(e))n.startsWith("$")||(Array.isArray(r)?r.forEach((i,o)=>{Ue(i)&&(i.$container=e,i.$containerProperty=n,i.$containerIndex=o,t.deep&&oc(i,t))}):Ue(r)&&(r.$container=e,r.$containerProperty=n,t.deep&&oc(r,t)))}function Gi(e,t){let n=e;for(;n;){if(t(n))return n;n=n.$container}}function st(e){let n=Xs(e).$document;if(!n)throw new Error("AST node has no document.");return n}function Xs(e){for(;e.$container;)e=e.$container;return e}function Gp(e){return it(e)?e.ref?[e.ref]:[]:Dt(e)?e.items.map(t=>t.ref):[]}function sc(e,t){if(!e)throw new Error("Node must be an AstNode.");let n=t?.range;return new Ht(()=>({keys:Object.keys(e),keyIndex:0,arrayIndex:0}),r=>{for(;r.keyIndex<r.keys.length;){let i=r.keys[r.keyIndex];if(!i.startsWith("$")){let o=e[i];if(Ue(o)){if(r.keyIndex++,Up(o,n))return{done:!1,value:o}}else if(Array.isArray(o)){for(;r.arrayIndex<o.length;){let s=r.arrayIndex++,a=o[s];if(Ue(a)&&Up(a,n))return{done:!1,value:a}}r.arrayIndex=0}}r.keyIndex++}return gt})}function cn(e,t){if(!e)throw new Error("Root node must be an AstNode.");return new nr(e,n=>sc(n,t))}function yt(e,t){if(e){if(t?.range&&!Up(e,t.range))return new nr(e,()=>[])}else throw new Error("Root node must be an AstNode.");return new nr(e,n=>sc(n,t),{includeRoot:!0})}function Up(e,t){if(!t)return!0;let n=e.$cstNode?.range;return n?gE(n,t):!1}function Gr(e){return new Ht(()=>({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)||Dt(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)||Dt(o))return{done:!1,value:{reference:o,container:e,property:n,index:i}}}t.arrayIndex=0}}t.keyIndex++}return gt})}function hE(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]=mE(i.defaultValue))}function mE(e){return Array.isArray(e)?[...e.map(mE)]:e}var St={$type:"AbstractElement",cardinality:"cardinality"};function yc(e){return me.isInstance(e,St.$type)}var uc={$type:"AbstractParserRule"};function ir(e){return me.isInstance(e,uc.$type)}var ac={$type:"AbstractRule"};var zt={$type:"AbstractType"};var zr={$type:"Action",cardinality:"cardinality",feature:"feature",inferredType:"inferredType",operator:"operator",type:"type"};function or(e){return me.isInstance(e,zr.$type)}var fc={$type:"Alternatives",cardinality:"cardinality",elements:"elements"};function Qp(e){return me.isInstance(e,fc.$type)}var yE={$type:"ArrayLiteral",elements:"elements"};var zp={$type:"ArrayType",elementType:"elementType"};function _E(e){return me.isInstance(e,zp.$type)}var jr={$type:"Assignment",cardinality:"cardinality",feature:"feature",operator:"operator",predicate:"predicate",terminal:"terminal"};function fn(e){return me.isInstance(e,jr.$type)}var jp={$type:"BooleanLiteral",true:"true"};function vE(e){return me.isInstance(e,jp.$type)}var Yr={$type:"CharacterRange",cardinality:"cardinality",left:"left",lookahead:"lookahead",parenthesized:"parenthesized",right:"right"};function AE(e){return me.isInstance(e,Yr.$type)}var Hi={$type:"Condition"};var dc={$type:"Conjunction",left:"left",right:"right"};function kE(e){return me.isInstance(e,dc.$type)}var Vr={$type:"CrossReference",cardinality:"cardinality",deprecatedSyntax:"deprecatedSyntax",isMulti:"isMulti",terminal:"terminal",type:"type"};function dn(e){return me.isInstance(e,Vr.$type)}var pc={$type:"Disjunction",left:"left",right:"right"};function IE(e){return me.isInstance(e,pc.$type)}var Yp={$type:"EndOfFile",cardinality:"cardinality"};function RE(e){return me.isInstance(e,Yp.$type)}var Hr={$type:"Grammar",imports:"imports",interfaces:"interfaces",isDeclared:"isDeclared",name:"name",rules:"rules",types:"types"};var xE={$type:"GrammarImport",path:"path"};var zi={$type:"Group",cardinality:"cardinality",elements:"elements",guardCondition:"guardCondition",predicate:"predicate"};function Kr(e){return me.isInstance(e,zi.$type)}var Vp={$type:"InferredType",name:"name"};function xc(e){return me.isInstance(e,Vp.$type)}var Tn={$type:"InfixRule",call:"call",dataType:"dataType",inferredType:"inferredType",name:"name",operators:"operators",parameters:"parameters",returnType:"returnType"};function qr(e){return me.isInstance(e,Tn.$type)}var Hp={$type:"InfixRuleOperatorList",associativity:"associativity",operators:"operators"};var EE={$type:"InfixRuleOperators",precedences:"precedences"};var zs={$type:"Interface",attributes:"attributes",name:"name",superTypes:"superTypes"};function SE(e){return me.isInstance(e,zs.$type)}var js={$type:"Keyword",cardinality:"cardinality",predicate:"predicate",value:"value"};function jt(e){return me.isInstance(e,js.$type)}var lc={$type:"NamedArgument",calledByName:"calledByName",parameter:"parameter",value:"value"};var ji={$type:"NegatedToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function bE(e){return me.isInstance(e,ji.$type)}var Kp={$type:"Negation",value:"value"};function NE(e){return me.isInstance(e,Kp.$type)}var wE={$type:"NumberLiteral",value:"value"};var cc={$type:"Parameter",name:"name"};var qp={$type:"ParameterReference",parameter:"parameter"};function LE(e){return me.isInstance(e,qp.$type)}var un={$type:"ParserRule",dataType:"dataType",definition:"definition",entry:"entry",fragment:"fragment",inferredType:"inferredType",name:"name",parameters:"parameters",returnType:"returnType"};function at(e){return me.isInstance(e,un.$type)}var hc={$type:"ReferenceType",isMulti:"isMulti",referenceType:"referenceType"};function OE(e){return me.isInstance(e,hc.$type)}var Yi={$type:"RegexToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",regex:"regex"};function PE(e){return me.isInstance(e,Yi.$type)}var Zp={$type:"ReturnType",name:"name"};function CE(e){return me.isInstance(e,Zp.$type)}var Vi={$type:"RuleCall",arguments:"arguments",cardinality:"cardinality",predicate:"predicate",rule:"rule"};function pn(e){return me.isInstance(e,Vi.$type)}var Ys={$type:"SimpleType",primitiveType:"primitiveType",stringType:"stringType",typeRef:"typeRef"};function eh(e){return me.isInstance(e,Ys.$type)}var TE={$type:"StringLiteral",value:"value"};var Ki={$type:"TerminalAlternatives",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function $E(e){return me.isInstance(e,Ki.$type)}var Mt={$type:"TerminalElement",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};var qi={$type:"TerminalGroup",cardinality:"cardinality",elements:"elements",lookahead:"lookahead",parenthesized:"parenthesized"};function DE(e){return me.isInstance(e,qi.$type)}var rr={$type:"TerminalRule",definition:"definition",fragment:"fragment",hidden:"hidden",name:"name",type:"type"};function xt(e){return me.isInstance(e,rr.$type)}var Zi={$type:"TerminalRuleCall",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",rule:"rule"};function th(e){return me.isInstance(e,Zi.$type)}var mc={$type:"Type",name:"name",type:"type"};function nh(e){return me.isInstance(e,mc.$type)}var Us={$type:"TypeAttribute",defaultValue:"defaultValue",isOptional:"isOptional",name:"name",type:"type"};var Gs={$type:"TypeDefinition"};var Jp={$type:"UnionType",types:"types"};function ME(e){return me.isInstance(e,Jp.$type)}var gc={$type:"UnorderedGroup",cardinality:"cardinality",elements:"elements"};function rh(e){return me.isInstance(e,gc.$type)}var Ji={$type:"UntilToken",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized",terminal:"terminal"};function FE(e){return me.isInstance(e,Ji.$type)}var Hs={$type:"ValueLiteral"};var Vs={$type:"Wildcard",cardinality:"cardinality",lookahead:"lookahead",parenthesized:"parenthesized"};function BE(e){return me.isInstance(e,Vs.$type)}var Ks=class extends Xi{constructor(){super(...arguments),this.types={AbstractElement:{name:St.$type,properties:{cardinality:{name:St.cardinality,optional:!0}},superTypes:[]},AbstractParserRule:{name:uc.$type,properties:{},superTypes:[ac.$type,zt.$type]},AbstractRule:{name:ac.$type,properties:{},superTypes:[]},AbstractType:{name:zt.$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:zt.$type,optional:!0}},superTypes:[St.$type]},Alternatives:{name:fc.$type,properties:{cardinality:{name:fc.cardinality,optional:!0},elements:{name:fc.elements,defaultValue:[]}},superTypes:[St.$type]},ArrayLiteral:{name:yE.$type,properties:{elements:{name:yE.elements,defaultValue:[]}},superTypes:[Hs.$type]},ArrayType:{name:zp.$type,properties:{elementType:{name:zp.elementType}},superTypes:[Gs.$type]},Assignment:{name:jr.$type,properties:{cardinality:{name:jr.cardinality,optional:!0},feature:{name:jr.feature},operator:{name:jr.operator},predicate:{name:jr.predicate,optional:!0},terminal:{name:jr.terminal}},superTypes:[St.$type]},BooleanLiteral:{name:jp.$type,properties:{true:{name:jp.true,defaultValue:!1}},superTypes:[Hi.$type,Hs.$type]},CharacterRange:{name:Yr.$type,properties:{cardinality:{name:Yr.cardinality,optional:!0},left:{name:Yr.left},lookahead:{name:Yr.lookahead,optional:!0},parenthesized:{name:Yr.parenthesized,defaultValue:!1,optional:!0},right:{name:Yr.right,optional:!0}},superTypes:[Mt.$type]},Condition:{name:Hi.$type,properties:{},superTypes:[]},Conjunction:{name:dc.$type,properties:{left:{name:dc.left},right:{name:dc.right}},superTypes:[Hi.$type]},CrossReference:{name:Vr.$type,properties:{cardinality:{name:Vr.cardinality,optional:!0},deprecatedSyntax:{name:Vr.deprecatedSyntax,defaultValue:!1},isMulti:{name:Vr.isMulti,defaultValue:!1},terminal:{name:Vr.terminal,optional:!0},type:{name:Vr.type,referenceType:zt.$type}},superTypes:[St.$type]},Disjunction:{name:pc.$type,properties:{left:{name:pc.left},right:{name:pc.right}},superTypes:[Hi.$type]},EndOfFile:{name:Yp.$type,properties:{cardinality:{name:Yp.cardinality,optional:!0}},superTypes:[St.$type]},Grammar:{name:Hr.$type,properties:{imports:{name:Hr.imports,defaultValue:[]},interfaces:{name:Hr.interfaces,defaultValue:[]},isDeclared:{name:Hr.isDeclared,defaultValue:!1},name:{name:Hr.name,optional:!0},rules:{name:Hr.rules,defaultValue:[]},types:{name:Hr.types,defaultValue:[]}},superTypes:[]},GrammarImport:{name:xE.$type,properties:{path:{name:xE.path}},superTypes:[]},Group:{name:zi.$type,properties:{cardinality:{name:zi.cardinality,optional:!0},elements:{name:zi.elements,defaultValue:[]},guardCondition:{name:zi.guardCondition,optional:!0},predicate:{name:zi.predicate,optional:!0}},superTypes:[St.$type]},InferredType:{name:Vp.$type,properties:{name:{name:Vp.name}},superTypes:[zt.$type]},InfixRule:{name:Tn.$type,properties:{call:{name:Tn.call},dataType:{name:Tn.dataType,optional:!0},inferredType:{name:Tn.inferredType,optional:!0},name:{name:Tn.name},operators:{name:Tn.operators},parameters:{name:Tn.parameters,defaultValue:[]},returnType:{name:Tn.returnType,referenceType:zt.$type,optional:!0}},superTypes:[uc.$type]},InfixRuleOperatorList:{name:Hp.$type,properties:{associativity:{name:Hp.associativity,optional:!0},operators:{name:Hp.operators,defaultValue:[]}},superTypes:[]},InfixRuleOperators:{name:EE.$type,properties:{precedences:{name:EE.precedences,defaultValue:[]}},superTypes:[]},Interface:{name:zs.$type,properties:{attributes:{name:zs.attributes,defaultValue:[]},name:{name:zs.name},superTypes:{name:zs.superTypes,defaultValue:[],referenceType:zt.$type}},superTypes:[zt.$type]},Keyword:{name:js.$type,properties:{cardinality:{name:js.cardinality,optional:!0},predicate:{name:js.predicate,optional:!0},value:{name:js.value}},superTypes:[St.$type]},NamedArgument:{name:lc.$type,properties:{calledByName:{name:lc.calledByName,defaultValue:!1},parameter:{name:lc.parameter,referenceType:cc.$type,optional:!0},value:{name:lc.value}},superTypes:[]},NegatedToken:{name:ji.$type,properties:{cardinality:{name:ji.cardinality,optional:!0},lookahead:{name:ji.lookahead,optional:!0},parenthesized:{name:ji.parenthesized,defaultValue:!1,optional:!0},terminal:{name:ji.terminal}},superTypes:[Mt.$type]},Negation:{name:Kp.$type,properties:{value:{name:Kp.value}},superTypes:[Hi.$type]},NumberLiteral:{name:wE.$type,properties:{value:{name:wE.value}},superTypes:[Hs.$type]},Parameter:{name:cc.$type,properties:{name:{name:cc.name}},superTypes:[]},ParameterReference:{name:qp.$type,properties:{parameter:{name:qp.parameter,referenceType:cc.$type}},superTypes:[Hi.$type]},ParserRule:{name:un.$type,properties:{dataType:{name:un.dataType,optional:!0},definition:{name:un.definition},entry:{name:un.entry,defaultValue:!1},fragment:{name:un.fragment,defaultValue:!1},inferredType:{name:un.inferredType,optional:!0},name:{name:un.name},parameters:{name:un.parameters,defaultValue:[]},returnType:{name:un.returnType,referenceType:zt.$type,optional:!0}},superTypes:[uc.$type]},ReferenceType:{name:hc.$type,properties:{isMulti:{name:hc.isMulti,defaultValue:!1},referenceType:{name:hc.referenceType}},superTypes:[Gs.$type]},RegexToken:{name:Yi.$type,properties:{cardinality:{name:Yi.cardinality,optional:!0},lookahead:{name:Yi.lookahead,optional:!0},parenthesized:{name:Yi.parenthesized,defaultValue:!1,optional:!0},regex:{name:Yi.regex}},superTypes:[Mt.$type]},ReturnType:{name:Zp.$type,properties:{name:{name:Zp.name}},superTypes:[]},RuleCall:{name:Vi.$type,properties:{arguments:{name:Vi.arguments,defaultValue:[]},cardinality:{name:Vi.cardinality,optional:!0},predicate:{name:Vi.predicate,optional:!0},rule:{name:Vi.rule,referenceType:ac.$type}},superTypes:[St.$type]},SimpleType:{name:Ys.$type,properties:{primitiveType:{name:Ys.primitiveType,optional:!0},stringType:{name:Ys.stringType,optional:!0},typeRef:{name:Ys.typeRef,referenceType:zt.$type,optional:!0}},superTypes:[Gs.$type]},StringLiteral:{name:TE.$type,properties:{value:{name:TE.value}},superTypes:[Hs.$type]},TerminalAlternatives:{name:Ki.$type,properties:{cardinality:{name:Ki.cardinality,optional:!0},elements:{name:Ki.elements,defaultValue:[]},lookahead:{name:Ki.lookahead,optional:!0},parenthesized:{name:Ki.parenthesized,defaultValue:!1,optional:!0}},superTypes:[Mt.$type]},TerminalElement:{name:Mt.$type,properties:{cardinality:{name:Mt.cardinality,optional:!0},lookahead:{name:Mt.lookahead,optional:!0},parenthesized:{name:Mt.parenthesized,defaultValue:!1,optional:!0}},superTypes:[St.$type]},TerminalGroup:{name:qi.$type,properties:{cardinality:{name:qi.cardinality,optional:!0},elements:{name:qi.elements,defaultValue:[]},lookahead:{name:qi.lookahead,optional:!0},parenthesized:{name:qi.parenthesized,defaultValue:!1,optional:!0}},superTypes:[Mt.$type]},TerminalRule:{name:rr.$type,properties:{definition:{name:rr.definition},fragment:{name:rr.fragment,defaultValue:!1},hidden:{name:rr.hidden,defaultValue:!1},name:{name:rr.name},type:{name:rr.type,optional:!0}},superTypes:[ac.$type]},TerminalRuleCall:{name:Zi.$type,properties:{cardinality:{name:Zi.cardinality,optional:!0},lookahead:{name:Zi.lookahead,optional:!0},parenthesized:{name:Zi.parenthesized,defaultValue:!1,optional:!0},rule:{name:Zi.rule,referenceType:rr.$type}},superTypes:[Mt.$type]},Type:{name:mc.$type,properties:{name:{name:mc.name},type:{name:mc.type}},superTypes:[zt.$type]},TypeAttribute:{name:Us.$type,properties:{defaultValue:{name:Us.defaultValue,optional:!0},isOptional:{name:Us.isOptional,defaultValue:!1},name:{name:Us.name},type:{name:Us.type}},superTypes:[]},TypeDefinition:{name:Gs.$type,properties:{},superTypes:[]},UnionType:{name:Jp.$type,properties:{types:{name:Jp.types,defaultValue:[]}},superTypes:[Gs.$type]},UnorderedGroup:{name:gc.$type,properties:{cardinality:{name:gc.cardinality,optional:!0},elements:{name:gc.elements,defaultValue:[]}},superTypes:[St.$type]},UntilToken:{name:Ji.$type,properties:{cardinality:{name:Ji.cardinality,optional:!0},lookahead:{name:Ji.lookahead,optional:!0},parenthesized:{name:Ji.parenthesized,defaultValue:!1,optional:!0},terminal:{name:Ji.terminal}},superTypes:[Mt.$type]},ValueLiteral:{name:Hs.$type,properties:{},superTypes:[]},Wildcard:{name:Vs.$type,properties:{cardinality:{name:Vs.cardinality,optional:!0},lookahead:{name:Vs.lookahead,optional:!0},parenthesized:{name:Vs.parenthesized,defaultValue:!1,optional:!0}},superTypes:[Mt.$type]}}}},me=new Ks;function qs(e){return new nr(e,t=>tr(t)?t.content:[],{includeRoot:!0})}function UE(e,t){for(;e.container;)if(e=e.container,e===t)return!0;return!1}function GE(e){return{start:{line:e.startLine-1,character:e.startColumn-1},end:{line:e.endLine-1,character:e.endColumn}}}function Zs(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 _n;(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"})(_n||(_n={}));function lL(e,t){if(e.end.line<t.start.line||e.end.line===t.start.line&&e.end.character<=t.start.character)return _n.Before;if(e.start.line>t.end.line||e.start.line===t.end.line&&e.start.character>=t.end.character)return _n.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?_n.Inside:n?_n.OverlapBack:r?_n.OverlapFront:_n.Outside}function gE(e,t){return lL(e,t)>_n.After}var HE=/^[\w\p{L}]$/u;function zE(e,t){if(e){let n=cL(e,!0);if(n&&XE(n,t))return n;if(tc(e)){let r=e.content.findIndex(i=>!i.hidden);for(let i=r-1;i>=0;i--){let o=e.content[i];if(XE(o,t))return o}}}}function XE(e,t){return ec(e)&&t.includes(e.tokenType.name)}function cL(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 Ac={};Wp(Ac,{findAssignment:()=>gh,findNameAssignment:()=>_c,findNodeForKeyword:()=>hh,findNodeForProperty:()=>ra,findNodesForKeyword:()=>gL,findNodesForKeywordInternal:()=>mh,findNodesForProperty:()=>dh,getActionAtElement:()=>QE,getActionType:()=>tw,getAllReachableRules:()=>na,getAllRulesUsedForCrossReferences:()=>mL,getCrossReferenceTerminal:()=>uh,getEntryRule:()=>KE,getExplicitRuleType:()=>vc,getHiddenRules:()=>qE,getRuleType:()=>yh,getRuleTypeName:()=>TL,getTypeName:()=>ar,isArrayCardinality:()=>xL,isArrayOperator:()=>EL,isCommentTerminal:()=>fh,isDataType:()=>wL,isDataTypeRule:()=>ia,isOptionalCardinality:()=>yL,terminalRegex:()=>to});var Js=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 sr(e,t="Error: Got unexpected value."){throw new Error(typeof t=="string"?t:t())}function oe(e){return e.charCodeAt(0)}function Ec(e,t){Array.isArray(e)?e.forEach(function(n){t.push(n)}):t.push(e)}function eo(e,t){if(e[t]===!0)throw"duplicate flag "+t;let n=e[t];e[t]=!0}function Zr(e){if(e===void 0)throw Error("Internal Error - Should never get here!");return!0}function Qs(){throw Error("Internal Error - Should never get here!")}function ih(e){return e.type==="Character"}var ea=[];for(let e=oe("0");e<=oe("9");e++)ea.push(e);var ta=[oe("_")].concat(ea);for(let e=oe("a");e<=oe("z");e++)ta.push(e);for(let e=oe("A");e<=oe("Z");e++)ta.push(e);var oh=[oe(" "),oe("\f"),oe(`
3
3
  `),oe("\r"),oe(" "),oe("\v"),oe(" "),oe("\xA0"),oe("\u1680"),oe("\u2000"),oe("\u2001"),oe("\u2002"),oe("\u2003"),oe("\u2004"),oe("\u2005"),oe("\u2006"),oe("\u2007"),oe("\u2008"),oe("\u2009"),oe("\u200A"),oe("\u2028"),oe("\u2029"),oe("\u202F"),oe("\u205F"),oe("\u3000"),oe("\uFEFF")];var uL=/[0-9a-fA-F]/,wc=/[0-9]/,fL=/[1-9]/,Jr=class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(t){this.idx=t.idx,this.input=t.input,this.groupIdx=t.groupIdx}pattern(t){this.idx=0,this.input=t,this.groupIdx=0,this.consumeChar("/");let n=this.disjunction();this.consumeChar("/");let r={type:"Flags",loc:{begin:this.idx,end:t.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":eo(r,"global");break;case"i":eo(r,"ignoreCase");break;case"m":eo(r,"multiLine");break;case"u":eo(r,"unicode");break;case"y":eo(r,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:r,value:n,loc:this.loc(0)}}disjunction(){let t=[],n=this.idx;for(t.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),t.push(this.alternative());return{type:"Disjunction",value:t,loc:this.loc(n)}}alternative(){let t=[],n=this.idx;for(;this.isTerm();)t.push(this.term());return{type:"Alternative",value:t,loc:this.loc(n)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){let t=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(t)};case"$":return{type:"EndAnchor",loc:this.loc(t)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(t)};case"B":return{type:"NonWordBoundary",loc:this.loc(t)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let n;switch(this.popChar()){case"=":n="Lookahead";break;case"!":n="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":n="Lookbehind";break;case"!":n="NegativeLookbehind"}break}}Zr(n);let r=this.disjunction();return this.consumeChar(")"),{type:n,value:r,loc:this.loc(t)}}return Qs()}quantifier(t=!1){let n,r=this.idx;switch(this.popChar()){case"*":n={atLeast:0,atMost:1/0};break;case"+":n={atLeast:1,atMost:1/0};break;case"?":n={atLeast:0,atMost:1};break;case"{":let i=this.integerIncludingZero();switch(this.popChar()){case"}":n={atLeast:i,atMost:i};break;case",":let o;this.isDigit()?(o=this.integerIncludingZero(),n={atLeast:i,atMost:o}):n={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(t===!0&&n===void 0)return;Zr(n);break}if(!(t===!0&&n===void 0)&&Zr(n))return this.peekChar(0)==="?"?(this.consumeChar("?"),n.greedy=!1):n.greedy=!0,n.type="Quantifier",n.loc=this.loc(r),n}atom(){let t,n=this.idx;switch(this.peekChar()){case".":t=this.dotAll();break;case"\\":t=this.atomEscape();break;case"[":t=this.characterClass();break;case"(":t=this.group();break}return t===void 0&&this.isPatternCharacter()&&(t=this.patternCharacter()),Zr(t)?(t.loc=this.loc(n),this.isQuantifier()&&(t.quantifier=this.quantifier()),t):Qs()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[oe(`
4
4
  `),oe("\r"),oe("\u2028"),oe("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let t,n=!1;switch(this.popChar()){case"d":t=ea;break;case"D":t=ea,n=!0;break;case"s":t=oh;break;case"S":t=oh,n=!0;break;case"w":t=ta;break;case"W":t=ta,n=!0;break}return Zr(t)?{type:"Set",value:t,complement:n}:Qs()}controlEscapeAtom(){let t;switch(this.popChar()){case"f":t=oe("\f");break;case"n":t=oe(`
@@ -2917,5 +2917,5 @@ ${n}`),this.inline?`{${i}}`:i}};function XM(e,t,n){if(e==="linkplain"||e==="link
2917
2917
  `);)r--;for(;r>=0&&(t[r]===" "||t[r]===" ");)r--;return r<0||t[r]!=="\\"}},jR={parser:{TokenBuilder:()=>new Yy({indentTokenName:"INDENT",dedentTokenName:"DEDENT",whitespaceTokenName:"WS",ignoreIndentationDelimiters:[["[","]"]]}),Lexer:e=>new Pf(e),ParserConfig:()=>({maxLookahead:4}),ValueConverter:()=>new jy},validation:{NowlineValidator:()=>new Nd}};function Vy(e={}){let t=e.shared??Uo(Of(Cf),Xk),n=Uo(Lf({shared:t}),Uk,jR);return t.ServiceRegistry.register(n),zR(n),{shared:t,Nowline:n}}function Ky(e,t){return t.code===void 0?t.message:rn(e,t.code,...t.args??[])}function $i(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=ks(t),o=n.map(u=>kl(u,i)),s=new WeakMap,a=new WeakMap,l=u=>{let f=Ed(u,r);for(let[d,p]of f.waveOf)s.set(d,p);for(let[d,p]of f.leadOf)a.set(d,p)};l([...t.swimlanes.values()]);for(let u of t.isolatedRegions)l([...u.content.swimlanes.values()]);let c=u=>Ve(u)?s.get(u):void 0;return{waves:n,index:r,floors:o,waveOf:s,leadOf:a,memberWave:c,isMember:(u,f)=>{let d=c(u);return d!==void 0&&(f===void 0||d===f)}}}var Ol="en-US",U2={"en-US":{nowLabel:"now",quarterPrefix:"Q",waveHeldBy:"held by",waveNoItems:"no items",waveBackgroundItem:"Background (no wave)",waveLegendBackground:"Background work (not in a wave)"},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)"}};function YR(e,t){return t??e??Ol}function jn(e){let t={};for(let n of G2(e)){let r=U2[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 G2(e){let t=[],n=H2(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(Ol)||t.push(Ol),t}function H2(e){return e.split("-").map((n,r)=>r===0?n.toLowerCase():/^[a-zA-Z]{2}$/.test(n)?n.toUpperCase():n).join("-")}function Ld(e){return e==="hide"||e==="show"}var VR={red:"#f87171",blue:"#60a5fa",yellow:"#facc15",green:"#34d399",orange:"#fb923c",purple:"#a78bfa",gray:"#94a3b8",navy:"#818cf8",white:"#e2e8f0"},Yn={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"},qy={name:"dark",surface:{page:"#0b1220",chart:"#111827",headerBox:"#1e293b"},entities:{roadmap:{...Yn,headerHeight:"md",padding:"md"},swimlane:{...Yn,fg:"#e2e8f0",text:"#e2e8f0",padding:"sm",spacing:"none",textSize:"sm"},item:{...Yn,bg:"#0f172a",fg:"#94a3b8",text:"#e2e8f0",shadow:"subtle",cornerRadius:"sm"},parallel:{...Yn,bg:"#8c84ff",bracket:"dashed",padding:"xs"},group:{...Yn,bg:"#f0a832",bracket:"solid",padding:"xs",fg:"#94a3b8"},anchor:{...Yn,bg:"#0b1220",fg:"#cbd5e1",text:"#cbd5e1",cornerRadius:"sm"},milestone:{...Yn,bg:"#e2e8f0",fg:"#e2e8f0",text:"#0b1220",border:"solid"},footnote:{...Yn,bg:"none",fg:"#94a3b8",text:"#e2e8f0",textSize:"sm"},label:{...Yn,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 KR={red:"#4a4a4a",blue:"#6b6b6b",green:"#8a8a8a",yellow:"#c8c8c8",orange:"#5c5c5c",purple:"#3a3a3a",gray:"#9e9e9e",navy:"#2a2a2a",white:"#ffffff"},Vn={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"},Zy={name:"grayscale",surface:{page:"#f5f5f5",chart:"#ffffff",headerBox:"#ffffff"},entities:{roadmap:{...Vn,headerHeight:"md",padding:"md"},swimlane:{...Vn,fg:"#3a3a3a",text:"#3a3a3a",padding:"sm",spacing:"none",textSize:"sm"},item:{...Vn,bg:"#ffffff",fg:"#9e9e9e",text:"#1a1a1a",shadow:"subtle",cornerRadius:"sm"},parallel:{...Vn,bg:"#9e9e9e",bracket:"dashed",padding:"xs"},group:{...Vn,bg:"#595959",bracket:"solid",padding:"xs",fg:"#595959"},anchor:{...Vn,bg:"#1a1a1a",fg:"#1a1a1a",text:"#1a1a1a",cornerRadius:"sm"},milestone:{...Vn,bg:"#2a2a2a",fg:"#2a2a2a",text:"#ffffff",border:"solid"},footnote:{...Vn,bg:"none",fg:"#595959",text:"#595959",textSize:"sm"},label:{...Vn,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 qR={red:"#e53935",blue:"#1e88e5",yellow:"#fdd835",green:"#43a047",orange:"#fb8c00",purple:"#8e24aa",gray:"#9e9e9e",navy:"#0d47a1",white:"#ffffff"},Kn={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"},Jy={name:"light",surface:{page:"#f8fafc",chart:"#ffffff",headerBox:"#ffffff"},entities:{roadmap:{...Kn,headerHeight:"md",padding:"md"},swimlane:{...Kn,fg:"#334155",text:"#334155",padding:"sm",spacing:"none",textSize:"sm"},item:{...Kn,bg:"#ffffff",fg:"#94a3b8",text:"#0f172a",shadow:"subtle",cornerRadius:"sm"},parallel:{...Kn,bg:"#635cf1",bracket:"dashed",padding:"xs"},group:{...Kn,bg:"#ea9818",bracket:"solid",padding:"xs",fg:"#475569"},anchor:{...Kn,bg:"#0f172a",fg:"#0f172a",text:"#0f172a",cornerRadius:"sm"},milestone:{...Kn,bg:"#312e81",fg:"#312e81",text:"#ffffff",border:"solid"},footnote:{...Kn,bg:"none",fg:"#475569",text:"#475569",textSize:"sm"},label:{...Kn,bg:"#f1f5f9",fg:"#475569",text:"#475569",textSize:"xs",padding:"xs",cornerRadius:"full"}},swimlane:{bandEven:"#ffffff",bandOdd:"#f8fafc",separator:"#e2e8f0",frameTabText:"#334155",frameTabMuted:"#64748b",border:"#e2e8f0",tabFill:"#f1f5f9",tabStroke:"#cbd5e1",tabText:"#334155",ownerText:"#64748b",footnoteIndicator:"#dc2626",rowTintEven:"#ffffff",rowTintOdd:"#f8fafc",utilizationOk:"#10b981",utilizationWarn:"#f59e0b",utilizationOver:"#ef4444"},timeline:{gridLine:"#cbd5e1",minorGridLine:"#e2e8f0",nonWorkingSeam:"#a0aec0",nonWorkingFill:"#64748b",tickMark:"#cbd5e1",labelText:"#64748b",panelFill:"#ffffff",border:"#e2e8f0"},header:{cardBorder:"#e2e8f0",author:"#64748b"},item:{overflowX:"#dc2626",linkIconFg:"#0f172a",overflowTailFill:"#fee2e2",overflowTailStroke:"#ef4444",overflowCaption:"#b91c1c"},parallel:{bracketStroke:"#334155"},anchorDiamond:{fill:"#ffffff",stroke:"#334155",label:"#334155",cutLine:"#64748b"},milestoneDiamond:{fill:"#0f172a",label:"#0f172a",cutLineNormal:"#1e1b4b",cutLineOverrun:"#b91c1c",slack:"#0f172a"},footnotePanel:{fill:"#ffffff",border:"#e2e8f0",header:"#0f172a",title:"#0f172a",description:"#64748b",number:"#dc2626"},nowline:{stroke:"#e53e3e",labelText:"#ffffff",labelBg:"#e53e3e"},milestone:{dashedInk:"#94a3b8",overrun:"#ef4444"},anchor:{predecessorLine:"#94a3b8"},dependency:{edgeStroke:"#475569",overflowStroke:"#d32f2f"},footnote:{indicatorText:"#e53e3e",descriptionMuted:"#64748b"},includeRegion:{border:"#94a3b8",label:"#334155",badge:"#64748b",fill:"#f8fafc",tabFill:"#ffffff",tabStroke:"#cbd5e1",tabText:"#0f172a",badgeFill:"#e2e8f0",badgeStroke:"#cbd5e1",badgeText:"#475569"},wave:{stripFill:"#f0fdfa",stripFillAlt:"#ccfbf1",labelText:"#134e4a",labelMuted:"#0f766e",boundary:"#0d9488",hatch:"#0f172a",hatchOnDark:"#ffffff"},arrowhead:{neutral:"#475569",light:"#94a3b8",dark:"#0f172a"},status:{done:"#10b981",inProgress:"#3b82f6",atRisk:"#f59e0b",blocked:"#ef4444",planned:"#94a3b8",neutral:"#94a3b8"},statusTint:{done:"#ecfdf5",inProgress:"#eff6ff",atRisk:"#fffbeb",blocked:"#fee2e2",planned:"#f8fafc",neutral:"#f8fafc"},statusDot:{onLight:{done:"#065f46",inProgress:"#1e3a8a",atRisk:"#92400e",blocked:"#991b1b",planned:"#334155",neutral:"#334155"},onDark:{done:"#d1fae5",inProgress:"#dbeafe",atRisk:"#fef3c7",blocked:"#fee2e2",planned:"#e2e8f0",neutral:"#e2e8f0"}},attribution:{mark:"#94a3b8",link:"#e53e3e"},diagnostic:{overlayBg:"#fee2e2",errorText:"#991b1b"}};var ZR=["light","dark","grayscale"],Qy={light:Jy,dark:qy,grayscale:Zy};var z2={greyscale:"grayscale"};function ex(e){let t=e.toLowerCase(),n=z2[t]??t;return ZR.find(r=>r===n)}var j2={grey:"gray",violet:"purple"};function qn(e,t){if(e==="none")return"none";if(e.startsWith("#"))return e;let n=t.name==="dark"?VR:t.name==="grayscale"?KR:qR,r=j2[e]??e,i=n[r];return typeof i=="string"?i:e}function Y2(e,t){return{bg:qn(e.bg,t),fg:qn(e.fg,t),text:qn(e.text,t),border:e.border,icon:e.icon,shadow:e.shadow,font:e.font,weight:e.weight,italic:e.italic,textSize:e.textSize,padding:e.padding,spacing:e.spacing,headerHeight:e.headerHeight,cornerRadius:e.cornerRadius,bracket:e.bracket,headerPosition:"beside",capacityIcon:e.capacityIcon,timelinePosition:"top",minorGrid:!1,nonWorking:"hide"}}function JR(e,t,n,r){switch(t){case"bg":e.bg=qn(n,r);break;case"fg":e.fg=qn(n,r);break;case"text":e.text=qn(n,r);break;case"border":(n==="solid"||n==="dashed"||n==="dotted")&&(e.border=n);break;case"icon":e.icon=n;break;case"shadow":(n==="none"||n==="subtle"||n==="soft"||n==="hard")&&(e.shadow=n);break;case"font":(n==="sans"||n==="serif"||n==="mono")&&(e.font=n);break;case"weight":(n==="thin"||n==="light"||n==="normal"||n==="bold")&&(e.weight=n);break;case"italic":e.italic=n==="true";break;case"text-size":e.textSize=Pl(n,"xl");break;case"padding":e.padding=Pl(n,"xl");break;case"spacing":e.spacing=Pl(n,"xl");break;case"header-height":e.headerHeight=Pl(n,"xl");break;case"corner-radius":e.cornerRadius=Pl(n,"full");break;case"bracket":(n==="none"||n==="solid"||n==="dashed")&&(e.bracket=n);break;case"header-position":(n==="beside"||n==="above")&&(e.headerPosition=n);break;case"capacity-icon":e.capacityIcon=n;break;case"timeline-position":(n==="top"||n==="bottom"||n==="both")&&(e.timelinePosition=n);break;case"minor-grid":e.minorGrid=n==="true";break;case"non-working":Ld(n)&&(e.nonWorking=n);break;default:break}}function Pl(e,t){let n=["none","xs","sm","md","lg","xl","full"],r=n.indexOf(t),i=n.indexOf(e);return i<0?"md":i>r?n[r]:n[i]}function V2(e,t,n){if(t)for(let r of t.properties)JR(e,Q(r),r.value,n)}function K2(e,t,n){for(let r of t){let i=Q(r);r.value!==void 0&&JR(e,i,r.value,n)}}function Se(e,t,n){let r=n.theme.entities[e],i=Y2(r,n.theme);for(let o of Gf(e,t,n))switch(o.level){case"default":case"inline":K2(i,o.props,n.theme);break;case"label":break;default:V2(i,o.decl,n.theme)}return i}function QR(e,t){return Se("label",e.properties,t)}function tS(e,t){let r=vt(e.roadmapDecl?.properties??[],"scale")?.value,i="weeks",o,s;if(r)if(r==="days"||r==="weeks"||r==="months"||r==="quarters"||r==="years")i=r;else{let c=/^(\d+)([dwmqy])$/.exec(r);if(c){let u=Math.max(1,parseInt(c[1],10));switch(c[2]){case"d":i="days";break;case"w":i="weeks";break;case"m":i="months";break;case"q":i="quarters";break;case"y":i="years";break}o=tx(i)*u,s=1}}let a=s??Ek[i]??4,l=c=>s===void 0&&!c?{labelEveryDefault:!0}:{};if(t){let c=vt(t.properties,"label-every"),u=c&&parseInt(c.value,10)||0,f=u!==0?Math.max(1,u):a;return{unit:i,labelEvery:f,pixelsPerUnit:o??tx(i),...l(u!==0)}}return{unit:i,labelEvery:a,pixelsPerUnit:o??tx(i),...l(!1)}}function tx(e){switch(e){case"days":return mk;case"weeks":return 40;case"months":return 80;case"quarters":return 160;case"years":return 320}}var q2=.5,nx=.5,Cl=7;function Br(e){return e==="months"||e==="quarters"||e==="years"}function Od(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 Z2(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 Di(e,t,n,r,i){let o=Math.ceil(t-1e-6);if(i?.hasNonWorkingDays){if(!Br(n)&&o<=0)return 0;let a=o<=0?e:Xe(i.dateAtWorkingIndex(e,o-1),1),l=Br(n)?eS(a,n):n==="weeks"?nS(a,e,i.weekStart):a;return i.workingIndexOf(e,l)}if(!Br(n))return Math.ceil(t/r)*r;let s=Xe(e,o);return At(e,eS(s,n))}function eS(e,t){return Z2(e,t)?e:Od(e,t)}function nS(e,t,n){let r=n===void 0?-At(t,e):n-e.getUTCDay();return Xe(e,(r%Cl+Cl)%Cl)}function J2(e,t,n){return nS(Xe(e,1),t,n)}function Pd(e,t,n,r=Ol){if(e.calendar?.hasNonWorkingDays)return Q2(e,t,e.calendar,r);if(Br(t.unit))return oB(e,t,t.unit,r);let i=n.daysPerUnit(t.unit),o=i*e.pixelsPerDay,s=Math.max(1,Math.round(e.widthPx/e.pixelsPerDay)),a=Math.floor(s/i)+1,l=[];for(let c=0;c<a;c++){let u=c*i,f=e.originX+u*e.pixelsPerDay,d=c%t.labelEvery===0,p=c===a-1;l.push({x:f,labelX:p?void 0:f+o/2,major:d,label:d&&!p?ox(t.unit,Xe(e.domain[0],u),c,r):void 0})}return l}function Q2(e,t,n,r){let{unit:i}=t,[o,s]=e.domain,a=x=>Br(i)?Od(x,i):i==="weeks"?J2(x,o,n.weekStart):Xe(x,1),l=[o];for(let x=a(o);x<s;x=a(x))l.push(x);let c=e.forward(s),u=[];l.forEach((x,y)=>{let w=e.forward(x);(y+1<l.length?e.forward(l[y+1]):c)>w&&!nB(e,i,l,y)&&u.push({date:x,x:w})});let f=i==="days"&&t.labelEveryDefault===!0&&n.weekStart!==void 0,d=(x,y)=>f?tB(x,n,e.showsNonWorking):y%t.labelEvery===0,m=(e.showsNonWorking?VA(i):n.daysPerUnit(i))*e.pixelsPerDay,g=u.map(({date:x,x:y},w)=>{let _=(w+1<u.length?u[w+1].x:c)-y,k=d(x,w),N=k?ox(i,x,w,r):void 0,B=N===void 0?0:se(N,Ri),$=Br(i)?w===0||w===u.length-1:_<m-q2,X=N!==void 0&&!(B>_&&$);return{x:y,columnPx:_,major:k,label:N,labelPx:B,isNarrowed:$,isShown:X}});Br(i)||eB(g);let E=g.map(x=>({x:x.x,labelX:x.x+x.columnPx/2,major:x.major,label:x.isShown?x.label:void 0}));return s>o&&E.push({x:c,labelX:void 0,major:d(s,u.length),label:void 0}),E}function eB(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 tB(e,t,n){let r=t.weekStart;if(n)return e.getUTCDay()===r;let i=(e.getUTCDay()-r+Cl)%Cl;for(let o=1;o<=i;o++)if(t.isWorkingDay(Xe(e,-o)))return!1;return!0}function nB(e,t,n,r){let i=e.calendar;if(!e.showsNonWorking||!i||!Br(t)||r===0||r!==n.length-1)return!1;let[o,s]=e.domain;return i.workingIndexOf(o,n[r])>=i.workingIndexOf(o,s)}function rx(e,t,n,r){let i=e.calendar;if(!i?.hasNonWorkingDays)return;let o=i.nonWorkingRuns(e.domain[0],e.domain[1]);if(o.length===0)return;let[s,a]=e.range;if(e.showsNonWorking)return o.map(c=>iB(e,c,n));let l=c=>t.some(u=>Math.abs(u.x-c)<nx&&(u.major||r));return o.map(c=>{let u=e.forward(c.from),f={x:u,width:e.forward(Xe(c.through,1))-u,from:c.from,through:c.through};c.titles.length>0&&(f.titles=c.titles,f.label=iS(c,i.workingWeekdays),f.cut=!0);let d=u-s>nx&&a-u>nx;return n==="days"&&d&&!l(u)&&(f.seam=!0),f})}function ix(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:rB(r)}))}function rB(e){let t=At(e.from,e.through)+1;return`${e.titles.join(", ")}${rS}+${t}d`}var rS=" \xB7 ";function iS(e,t){let n=0;for(let i=e.from;i<=e.through;i=Xe(i,1))t.has(i.getUTCDay())&&n++;let r=e.titles.join(", ");return n>0?`${r}${rS}${n}d`:r}function iB(e,t,n){let[r,i]=e.range,o=Math.max(r,e.forward(t.from)),s=Math.min(i,e.forward(Xe(t.through,1))),a={x:o,width:s-o,from:t.from,through:t.through};return t.titles.length>0&&(a.titles=t.titles,e.calendar&&(a.label=iS(t,e.calendar.workingWeekdays))),(n==="days"||n==="weeks"||t.titles.length>0)&&(a.band=!0),a}function oB(e,t,n,r){let[i,o]=e.domain,s=[i];for(let c=Od(i,n);c<o;c=Od(c,n))s.push(c);o>i&&s.push(o);let a=s.map(c=>e.forward(c)),l=s.length-1;return s.map((c,u)=>{let f=a[u],d=u%t.labelEvery===0;if(u===l)return{x:f,labelX:void 0,major:d,label:void 0};let p=a[u+1]-f,m=d?ox(n,c,u,r):void 0,g=u===0||u===l-1;return m!==void 0&&g&&se(m,Ri)>p&&(m=void 0),{x:f,labelX:f+p/2,major:d,label:m}})}function ox(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`${jn(r).quarterPrefix}${i} ${t.getUTCFullYear()}`}case"years":return`${t.getUTCFullYear()}`}}function oS(e,t,n){let r=n.theme??"light",i=Qy[r],o=YR(n.locale,aB(e)),s={theme:i,styles:t.config.styles,defaults:t.config.defaults,labels:t.content.labels},a=Se("roadmap",e.roadmapDecl?.properties??[],s);return{themeName:r,theme:i,locale:o,styleCtx:s,roadmapStyle:a}}function sS(e,t,n,r,i){let{config:o,working:s}=Yf(e,t),a=tS(e,t.config.scale),{startDate:l,endDate:c}=sB(e,i,n.today,a),u=Ld(n.nonWorking)?n.nonWorking:r.roadmapStyle.nonWorking,f=u==="show"&&s.hasNonWorkingDays,d=Math.max(1,s.workingIndexOf(l,c)),p=f?Math.max(1,At(l,c)):d;return{cal:o,calendar:s,preset:a,schedule:i,startDate:l,naturalEndDate:c,spanDays:d,timelineDays:p,nonWorking:u}}function sB(e,t,n,r){let i=e.roadmapDecl?.properties??[],{config:o,working:s}=t.calendar,{startDate:a}=t,l=ie(i,"length"),c=0;if(l){let m=ls(l,o);m>0&&(c=m)}let u=t.extent.contentEndDay;if(n&&!(c>0)){let m=s.workingIndexOf(a,n);m>0&&(u=Math.max(u,m))}let f=jA(r.unit,o),d=Di(a,u>0?u:4*o.daysPerWeek,r.unit,f,s),p=Math.max(c,d);return{startDate:a,endDate:s.dateAtWorkingIndex(a,Math.max(1,p))}}function aB(e){return vt(e.directive?.properties??[],"locale")?.value}var lB=160,cB=64,uB=1e-6,Is=class{constructor(t,n){M(this,"scale");M(this,"startDate");M(this,"spanDays");M(this,"unit");M(this,"calendar");this.scale=n,this.startDate=t.startDate,this.spanDays=t.spanDays,this.unit=t.preset.unit,this.calendar=t.calendar}isPast(t,n){return this.scale.indexAtX(t)>n+uB}boundaryAtOrAfterX(t){return this.boundaryAtOrAfter(this.scale.indexAtX(t))}boundaryAtOrAfter(t){return Di(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)}}captionLimit(t){let{start:n,end:r}=this.captionColumn(t),i=this.xAt(n),o=r;for(let s=0;s<cB;s++){let a=this.nextBoundary(o);if(a<=o||this.xAt(a)-i>lB)break;o=a}return o}nextBoundary(t){return Di(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.captionLimit(n))}};function aS(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)aS(n,t)}function Rs(e,t){e.box.y+=t;for(let n of e.children)aS(n,t);for(let n of e.nested)Rs(n,t)}function lS(e,t){e.box.y+=t;for(let n of e.nestedSwimlanes)Rs(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 cS(e,t,n){e.cutTopY+=n,e.cutBottomY+=n,e.slackArrows?.forEach((r,i)=>{let o=t.slackArrows?.[i];o&&"y"in o&&(r.y+=n)})}var sx=class{constructor(t,n){M(this,"id");M(this,"anchor");this.id=t,this.anchor=n}place(t,n){let r=ie(this.anchor.properties,"date"),i=ve(r);if(!i)return null;let o=t.scale.forwardWithinDomain(i);if(o===null)return null;let s=Se("anchor",this.anchor.properties,t.styleCtx),a=t.markerRowPlacements.get(this.id),l=a?.centerY??t.timeline.markerRow.y,c={x:o,y:l},u=a?.labelBox??{x:o+6+6,y:l-4,width:0,height:12},f=a?.labelSide??"right";t.entityLeftEdges.set(this.id,o),t.entityRightEdges.set(this.id,o),t.entityMidpoints.set(this.id,c);let d={id:this.id,title:this.anchor.title??this.id,center:c,radius:6,style:s,predecessorPoints:[],cutTopY:t.chartTopY,cutBottomY:t.swimlaneBottomY,bumpedUp:(a?.rowIndex??0)>0,labelBox:u,labelSide:f};return!t.scale.showsNonWorking&&!t.calendar.isWorkingDay(i)&&(d.hiddenDate=Ti(i)),d}};function Cd(e,t,n){let r=[];for(let[i,o]of e){let s=new sx(i,o).place(t,n);s&&r.push(s)}return r}function Ml(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,xs(e));for(let n of e.children)t=Math.max(t,Ml(n));return t}function Wr(e){let t=0;for(let n of e)t=Math.max(t,uS(n.children)),n.nested.length>0&&(t=Math.max(t,Wr(n.nested)));return t}function uS(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,uS(n.children));return t}function Ss(e){let t=0;for(let n of e)t=Math.max(t,fS(n.children)),n.nested.length>0&&(t=Math.max(t,Ss(n.nested)));return t}function fS(e){let t=0;for(let n of e)n.kind==="item"?n.textSpills&&(t=Math.max(t,n.decorationsRightX)):t=Math.max(t,fS(n.children));return t}function dB(e){return e.box.y+e.box.height-nn/2}function ax(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:lx(e,t)}}function dS(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 lx(e,t){return e.textSpills?dB(e):e.box.y+t/2}function pS(e){let{box:t,afterDate:n,beforeDate:r,hasLinkIcon:i,footnoteCount:o}=e;if(!n&&!r)return[];let s=[],a=pt,l=t.y+lk,c=zg(t.width);if(n){let u=jg(t.x,i),f=c?{x:t.x-Bn-a,y:l}:{x:u,y:l};s.push({side:"after",isoDate:n,glyphTopLeft:f,glyphSize:a,spilled:c})}if(r){let u=t.x+t.width,f=Yg(u,o),d=c?{x:u+Bn,y:l}:{x:f,y:l};s.push({side:"before",isoDate:r,glyphTopLeft:d,glyphSize:a,spilled:c})}return s}function $d(e){let{box:t,afterDate:n,beforeDate:r,title:i}=e;if(!n&&!r)return[];let o=[],s=pt,a=t.y+(wl-s)/2,l=i?ys(t.x,!!n)+Ty(i):t.x;if(n&&(l=Math.max(l,t.x+s),o.push({side:"after",isoDate:n,glyphTopLeft:{x:t.x,y:a},glyphSize:s,spilled:!1})),r){let c=t.x+t.width-Hg-s,u=l>t.x?l+tn:t.x;o.push({side:"before",isoDate:r,glyphTopLeft:{x:Math.max(c,u),y:a},glyphSize:s,spilled:!1})}return o}function Rt(e){for(let t of e)if(ve(t))return t}function Xr(e){return{after:Be(e,"after").map(n=>{let r=ve(n);return r?{raw:n,date:r}:{raw:n,ref:n}})}}function Dd(e){return e.floors.map(t=>t?ve(t.date):null)}function Md(e,t,n,r,i=0,o){let s=n.map(c=>c??-1/0),a=[];for(let c=0;c<e;c++){let u=hS(c===0?t:a[c-1],s[c],i);a.push(c===0?u:Math.max(u,o?.S[c]??-1/0))}let l=a.map((c,u)=>Math.max(c,o?.E[u]??-1/0));for(let c=1;c<=e+1;c++){let u=r(a,l).memberEnd,f=[],d=[];for(let p=0;p<e;p++)f.push(p===0?a[0]:hS(d[p-1],s[p],i)),d.push(Math.max(f[p],u[p]??-1/0));if(mS(a,f)&&mS(l,d))return{S:a,E:l,passes:c,capped:!1};a=f,l=d}return r(a,l),{S:a,E:l,passes:e+1,capped:!0}}function hS(e,t,n){return t-e>n?t:e}function mS(e,t){for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function gS(e,t,n){return Dd(e).map(r=>r?n.workingIndexOf(t,r):null)}var Mi=class{constructor(t,n){M(this,"plan");M(this,"S");M(this,"memberEnd");M(this,"binding");M(this,"memberCount");this.plan=t,this.S=n;let r=t.waves.length;this.memberEnd=new Array(r).fill(-1/0),this.binding=new Array(r).fill(void 0),this.memberCount=new Array(r).fill(0)}floor(t){let n=this.plan.waveOf.get(t),r=t.$type==="ItemDeclaration"?void 0:this.plan.leadOf.get(t),i;return n!==void 0&&(i=this.S[n-1]),r!==void 0&&(i=Math.max(i??-1/0,this.S[r-1])),i}apply(t,n){let r=this.floor(t);return r===void 0?n:Math.max(n,r)}accumulate(t,n){let r=this.plan.memberWave(t);r!==void 0&&(this.memberCount[r-1]++,n>this.memberEnd[r-1]&&(this.memberEnd[r-1]=n,this.binding[r-1]=t))}};function Fd(e,t,n,r,i,o=0){return e.waves.map((s,a)=>{let l={id:s.name,index:a+1,start:t.S[a],end:t.E[a],memberCount:n.memberCount[a]},c=n.binding[a];if(c!==void 0&&n.memberEnd[a]===t.E[a]&&t.E[a]>t.S[a]){let p=c.name??c.title;p!==void 0&&(l.heldBy=p)}let u=i[a],f=e.floors[a]?.ref,d=a===0?r:t.E[a-1];return u!=null&&f!==void 0&&u-d>o&&(l.floorRef=f),l})}var Ot=.5;function yS(e,t,n,r,i){let o=e.waves.map(()=>n);return{plan:e,ids:e.waves.map(s=>s.name),origin:n,floors:Dd(e).map(s=>s?t.forward(s):null),S:o,E:o,pass:new Mi(e,o),frozen:!1,backgroundTooltip:r,visible:i}}function xS(e,t,n){e.S=t,e.E=n,e.pass=new Mi(e.plan,t)}function ES(e,t){e.S=t.S,e.E=t.E,e.frozen=!0,e.solve=t}function Bd(e,t,n){e.ids.forEach((r,i)=>{t.set(r,e.S[i]),n.set(r,e.E[i])})}function Ur(e,t,n){return n.waves?n.waves.pass.apply(e,t):t}function wS(e,t,n){n.waves&&!n.waves.frozen&&n.waves.pass.accumulate(e,t)}function TS(e,t){if(t.waves?.visible)return t.waves.plan.memberWave(e)!==void 0?"member":"background"}function _S(e,t){for(let n of[...e.S,...e.E])if(!(Math.abs(n-e.origin)<Ot)&&Math.abs(t-n)<Ot)return!0;return!1}function cx(e,t){let n=Math.round((e-t.timeline.originX)/t.timeline.pixelsPerDay);if(!t.scale.showsNonWorking)return n;let r=t.timeline.startDate;return t.calendar.workingIndexOf(r,Xe(r,n))}function Wd(e,t){return t.calendar.dateAtWorkingIndex(t.timeline.startDate,cx(e,t))}function vS(e,t,n){return jf(n.calendar,n.timeline.startDate,cx(e,n),cx(t,n))}function Fl(e,t,n){return Ur(e,Bl(e.properties,t,n),n)}var pB=!0;function AS(){return pB}function Bl(e,t,n){let{after:r}=Xr(e);if(r.length>0){let i=t;for(let o of r){if("date"in o){let a=n.scale.forwardWithinDomain(o.date);a!==null&&(i=Math.max(i,a));continue}let s=n.entityRightEdges.get(o.ref);s!==void 0&&(i=Math.max(i,s))}return i}return t}function kS(e,t,n){if(!n.calendar.hasNonWorkingDays)return;let r=hB(e);if(!r||n.calendar.isWorkingDay(r.date))return;let i=n.scale.forwardWithinDomain(r.date);if(!(i===null||Math.abs(t-i)>=Ot))return{key:r.key,pin:r.raw,start:Ti(Wd(t,n))}}function hB(e){let{after:t}=Xr(e);for(let n of t)if("date"in n)return{key:"after",raw:n.raw,date:n.date}}function ux(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 mB(e,t){return ux(e)>=.24?t.statusDot.onLight:t.statusDot.onDark}function IS(e,t,n){let r=mB(t,n),i={done:r.done,"in-progress":r.inProgress,"at-risk":r.atRisk,blocked:r.blocked,planned:r.planned,neutral:r.neutral};return i[e]??i.neutral}var gB=.24;function yB(e){return e==="none"?"transparent":e}function Xd(e){return ux(yB(e))>=gB?"dark":"light"}function bs(e,t,n){return e.scale.showsNonWorking?e.scale.advanceX(t,n)-t:n*e.timeline.pixelsPerDay}function Wl(e,t){return{x:e,startX:e,y:t,height:0}}function RS(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 xB(e){let t=new Map(e),n=r=>{for(let i of r.content)en(i)&&(i.name&&!t.has(i.name)&&t.set(i.name,i),n(i))};for(let r of e.values())n(r);return t}function Ud(e,t,n,r){return{cal:t.cal,schedule:t.schedule,styleCtx:{theme:t.theme,styles:e.config.styles,defaults:e.config.defaults,labels:e.content.labels},sizes:cs(e.content.sizes,t.cal),labels:e.content.labels,teams:xB(e.content.teams),persons:e.content.persons,symbols:e.config.symbols,footnoteIndex:r.footnotes?.index??new Map,footnoteHosts:r.footnotes?.hosts??new Map,timeline:t.timeline,scale:t.scale,calendar:t.calendar,...t.axisColumns?{axisColumns:t.axisColumns}:{},bandScale:t.bandScale,entityLeftEdges:new Map,entityRightEdges:new Map,entityMidpoints:new Map,markerIds:new Set([...e.content.anchors.keys(),...e.content.milestones.keys()]),placedItems:new Map,itemFlowKey:new Map,currentFlowKey:"",slackCorridors:[],markerRowPlacements:r.markerRowPlacements??new Map,chartTopY:n.chartTopY,chartBottomY:n.chartBottomY,swimlaneBottomY:n.swimlaneBottomY,nextParallelId:0,nextGroupId:0,...t.waves?{waves:t.waves}:{}}}var SS=12,EB=4,Gd=13,wB=11;function TB(e,t){return(e?se(e,wB):0)+t}function zd(e){return Math.max(0,Math.min(hk,(e-Kg)/2))}function fx(e){return Math.max(Kg,e-2*zd(e))}function bS(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 _B(e,t,n,r=t,i=r){let o=e,s=bS(e);if(s){if(s.length>=2)return{textSpills:!(n<=t&&s.every((u,f)=>se(u,Gd)<=(f===0?i:t))),titleLines:s};o=s[0]??""}let a=o.length>0&&se(o,Gd)>r,l=n>t;if(!a&&!l)return{textSpills:!1,titleLines:[o]};if(a&&!l)for(let c of[r,i]){let u=wi(o,t,Gd,c);if(u.length>=2&&u.length<=Bg&&u.every((f,d)=>se(f,Gd)<=(d===0?c:t)))return{textSpills:!1,titleLines:u}}return{textSpills:!0,titleLines:[o]}}function NS(e,t,n){let r=bS(e);return r&&r.length>=2?r:!t.textSpills&&!n&&t.titleLines.length>=2?t.titleLines:[r?r[0]??"":e]}function LS(e){let{visualWidth:t}=e,n=ds(!!e.hasLinkIcon,e.hasAfterGlyph?{barWidth:t}:void 0),r=Math.max(0,t-n-SS),i=TB(e.metaText,e.metaTrailingWidth??0),o=e.titleFirstLineRightReservePx??ul({barWidth:t,footnoteLabels:[],hasBeforeGlyph:!1}),s=Math.max(0,t-n-o),a=Math.max(s,t-n-Math.max(SS,o-Wt));return{leftInset:n,fit:_B(e.title,r,i,s,a)}}var vB;function OS(e,t,n){vB?.(e,t,n)}var Hd=class{constructor(t){M(this,"geometry");this.geometry=t}get id(){return this.geometry.id}measure(t){return{width:this.geometry.naturalWidth,height:t.bands.bandwidth()+this.geometry.barExtra}}place(t,n){let{naturalWidth:r,visualWidth:i,caption:o,barExtra:s}=this.geometry,a=n.bands.bandwidth(),l=t.x+zd(r),c={x:l,y:t.y,width:i,height:s>0?a+s:a},{textSpills:u,titleLines:f}=o.fit,d=u?l+i+EB:l+o.leftInset;return{id:this.geometry.id,box:c,textX:d,textSpills:u,titleLines:f}}};function AB(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 kB(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 IB(e,t){if(e)return/^\d+(?:\.\d+)?[dwmqy]$/.test(e)||/^\d+%$/.test(e)?e:t.sizes.get(e)?.effortLiteral??e}function RB(e,t){if(e)return t.teams.get(e)?.title??t.persons.get(e)?.title??e}function SB(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 jd(e,t,n,r,i){let o=QR(e,t),s=e.name??e.title??"",a=o.padding==="none"?"xs":o.padding,l=dk[a],c=Math.max(20,Math.round(s.length*5.5+l*2));return i!==void 0&&(c=Math.min(c,i)),{text:s,style:o,box:{x:n,y:r,width:c,height:$r}}}function bB(e,t){let n=UA(e,t.sizes,t.cal),r=WA(ie(e,"remaining"),t.sizes,t.cal),i=ie(e,"status"),o=AB(i),s=kB(i);s===0&&o==="done"&&(s=1);let a=/^(\d{1,3})%$/.exec(ie(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 NB(e,t,n,r,i,o){let s=ie(e,"duration"),a=!!s&&/^\d+(?:\.\d+)?[dwmqy]$/.test(s),l=n?n.title??n.name:"",c=a?s:l||void 0,u=ie(e,"remaining"),f=IB(u,t),d=RB(ie(e,"owner"),t),p=()=>[c,d].filter(Boolean).join(" "),m;if(r==="in-progress"&&f){let w=p();m=w?`${w} \u2014 ${f} remaining`:`${f} remaining`}else if(r==="in-progress"&&i>0&&i<1){let w=Math.round((1-i)*100),_=p();m=_?`${_} \u2014 ${w}% remaining`:`${w}% remaining`}else(d||c)&&(m=p()||void 0);let g=ie(e,"capacity"),E=Nr(g),x=null,y=0;if(E!==null){let w=el(E),_=tl(o,t.symbols),k=11,N=rl(w,_,k,m);x={value:E,text:w,icon:_,...N!==void 0?{iconDxTerms:N}:{}};let B=N!==void 0?k*ss:se(" ",k);y=(m?B:0)+nl(w,_,k)}return{metaText:m,ownerDisplay:d,capacity:x,capacityTrailingWidth:y}}function LB(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 OB(e,t,n){return ul({barWidth:e,footnoteLabels:t.map(String),hasBeforeGlyph:Rt(n)!==void 0})}var PB={done:"done","in-progress":"inProgress","at-risk":"atRisk",blocked:"blocked",planned:"planned",neutral:"neutral"};function CB(e,t,n){let r=PB[t],i={...e};return i.bg===n.entities.item.bg&&(i.bg=n.statusTint[r]),i.fg===n.entities.item.fg&&(i.fg=n.status[r]),i}function $B(e,t,n,r,i){if(n===0)return 0;let o=r-nn-$r-Wn,s;e&&t?s=Math.max(_i,i)+Wn:e?s=o:s=Math.max(o,i+Wn);let l=s+(n-1)*Jf+$r+Wn+nn;return Math.max(0,l-r)}function DB(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,Or))),{metaText:o,capacityTrailingWidth:s}=t.meta,a=(o?se(o,sl):0)+s,l=Math.max(i,a),c=Zf({barRightX:t.barRightX,iconSpills:t.iconSpills,captionWidth:l,footnoteCount:t.visualWidth<ps?t.footnoteCount:0,dotSpills:t.visualWidth<Cr}),u=r.captionCapX(t.barRightX);if(c.rightX<=u+MB||c.captionX===null)return{lines:e,truncated:!1};let f=c.rightX-(c.captionX+l),d=u-c.captionX-f,p=!1;return{lines:e.map(g=>{let E=MA(g,d,Or);return E!==g&&(p=!0),E}),truncated:p}}var MB=1e-6;function Yd(e,t,n){let r=e.properties,i=Se("item",r,n.styleCtx),o=ie(r,"size"),s=o?n.sizes.get(o)??null:null,a=RS(n,e),l=Be(r,"after"),c=Be(r,"before"),u=bs(n,t,a),f=fx(u),d=SB(ie(r,"link")),p=d.icon!=="none",m=fx(u),g=Be(r,"labels"),E=[];for(let z of g){let U=n.labels.get(z);if(!U)continue;let ee=jd(U,n.styleCtx,0,0);E.push({id:U,width:ee.box.width})}let x=0;for(let z=0;z<E.length;z+=1)z>0&&(x+=Xn),x+=E[z].width;let y=Math.max(0,m-2*Fn),w=E.length>0&&x>y,{status:_,progress:k}=bB(r,n),N=CB(i,_,n.styleCtx.theme),B=NB(r,n,s,_,k,N.capacityIcon),$=e.title??e.name??"",X=LB(e.name,n),j=LS({title:$,visualWidth:f,metaText:B.metaText,metaTrailingWidth:B.capacityTrailingWidth,hasLinkIcon:p,hasAfterGlyph:Rt(l)!==void 0,titleFirstLineRightReservePx:OB(m,X,c)}),D=p&&f<Gg,I=j.fit.textSpills||D,R=DB(NS($,j.fit,D),{textSpills:I,iconSpills:D,barRightX:t+zd(u)+f,visualWidth:f,footnoteCount:X.length,meta:B},n),P=R.lines,A=w?uk(E,f):null,L=A?A.rows.length:E.length>0?1:0,T=B.metaText!==void 0||B.capacity!==null,O=qf(P.length,T),S=Wg(P.length,T),F=$B(w,I,L,n.bandScale.bandwidth(),O);return{node:e,id:e.name??"",startX:t,durationDays:a,naturalWidth:u,visualWidth:f,naturalVisualWidth:m,style:N,size:s,status:_,progress:k,meta:B,link:d,chips:{samples:E,outside:w,pack:A,rowCount:L},footnoteIndicators:X,caption:{...j,title:$,iconSpills:D,lines:P,truncated:R.truncated,lastBaseline:O},barExtra:Math.max(S,F)}}function Vd(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=Ur(e,a,n));let l=kS(i,a,n),c=n.scale.startX(a),u=r??Yd(e,c,n);if(u.startX!==c)throw new Error(`layout: item "${e.name??e.title??"(unnamed)"}" was measured at x ${u.startX} but placed at x ${c}`);let{naturalWidth:f,style:d,status:p,progress:m,footnoteIndicators:g,caption:E}=u,{metaText:x,ownerDisplay:y,capacity:w,capacityTrailingWidth:_}=u.meta,k=u.link,N=k.icon!=="none",B=u.chips.samples,$=u.chips.outside,X=c,j=c+f,D=c+bs(n,c,u.durationDays),I=!1,R,P;if(s.length>0){let qe,er;for(let $t of s){let Ms=ve($t),Fs=Ms?n.scale.forwardWithinDomain(Ms)??void 0:n.entityLeftEdges.get($t);Fs!==void 0&&(qe===void 0||Fs<qe)&&(qe=Fs,er=$t)}qe!==void 0&&D>qe&&(I=!0,R={x:qe,y:t.y,width:j-qe,height:n.bandScale.bandwidth()},P=er)}let A=E.title,L=new Hd(u),T={time:n.scale,bands:n.bandScale,style:d},O=L.place({x:X,y:t.y},T),S=O.box,F=n.bandScale.bandwidth(),z=S.width<Cr,U=E.iconSpills,ee=S.width<ps,Y=O.textSpills||U,ne=E.lines,v=u.chips.pack,C=E.lastBaseline,W=u.barExtra,G=[],K=S.y+F-nn-$r-Wn,q=S.y+($&&Y?Math.max(_i,C):C)+Wn,re=$&&Y||!$&&B.length>0?Math.max(K,q):K,le=$?S.x+S.width+Bn:S.x+Fn,ce=le;if(v)for(let qe=0;qe<v.rows.length;qe+=1){let er=re+qe*Jf,$t=le;for(let Fs of v.rows[qe]){let fE=jd(Fs.id,n.styleCtx,$t,er);G.push(fE),$t+=fE.box.width+Xn}let Ms=$t-Xn;Ms>ce&&(ce=Ms)}else{let qe=le;for(let er of B){let $t=jd(er.id,n.styleCtx,qe,re);G.push($t),qe+=$t.box.width+Xn}ce=B.length>0?qe-Xn:le}let pe=y??ie(i,"owner"),rt=e.description?.text,ht=g.length>0&&ee,mt=null;if(Y){let qe=Math.max(...ne.map($t=>se($t,Or))),er=(x?se(x,11):0)+_;mt=Math.max(qe,er)}let Jl=Zf({barRightX:S.x+S.width,iconSpills:U,captionWidth:mt,footnoteCount:ht?g.length:0,dotSpills:z}),{iconSpillX:VN,footnoteSpillStartX:KN,dotSpillCx:qN}=Jl,ZN=Math.max(S.x+S.width,Jl.rightX),Ds=e.name;Ds&&(n.entityLeftEdges.set(Ds,X),n.entityRightEdges.set(Ds,D)),wS(e,D,n);let cE=Ds??dx(e);n.itemFlowKey.set(cE,n.currentFlowKey),t.startX=X,t.x=D,t.height=Math.max(t.height,n.bandScale.step()+W);let uE=pS({box:S,afterDate:Rt(o),beforeDate:Rt(s),hasLinkIcon:N,footnoteCount:g.length}),Qn={kind:"item",id:Ds,title:A,...ne.length>=2||ne[0]!==A?{titleLines:ne}:{},box:S,dateSpan:{startX:X,endX:j},status:p,statusDotColor:IS(p,d.bg,n.styleCtx.theme),progressFraction:m,footnoteIndicators:g,labelChips:G,chipsOutside:$,chipsRightX:ce,linkIcon:k.icon,linkHref:k.href,hasOverflow:I,overflowBox:R,overflowAnchorId:P,owner:pe,description:rt,metaText:x,textSpills:Y,dotSpills:z,iconSpills:U,footnoteSpills:ht,dotSpillCx:qN,iconSpillX:VN,footnoteSpillStartX:KN,decorationsRightX:ZN,capacity:w,size:u.size,style:d,inlineDatePins:uE.length>0?uE:void 0},Ql=TS(e,n);return Ql!==void 0&&(Qn.waveRole=Ql),Ql==="background"&&(Qn.waveHatch=Xd(d.bg)),l!==void 0&&(Qn.nonWorkingPin=l),E.truncated&&(Qn.titleTruncated=!0),Ql==="background"&&n.waves&&(Qn.waveTooltip=n.waves.backgroundTooltip),n.placedItems.set(cE,Qn),OS(L,T,Qn),Qn}function dx(e){let t=e.$cstNode?.range.start;return`#item@${t?t.line+1:0}:${t?t.character+1:0}`}function px(e){let t=new Map;for(let n of yA(e))Ve(n)&&t.set(n.name??dx(n),n);return t}var FB=.01;function BB(e,t){let n={blocks:[],edges:[]},r=new Map,i=(a,l,c)=>{n.blocks.push({x:a,y:c,width:l,height:0})},o=(a,l)=>{let{box:c}=a;if(a.kind==="item"){n.blocks.push({...c,width:Ml(a)-c.x}),n.edges.push({x:c.x,top:c.y,bottom:c.y+c.height},{x:c.x+c.width,top:c.y,bottom:c.y+c.height});return}l&&a.id&&r.set(a.id,a),a.kind==="group"&&a.waveOnly||(a.headerHeight>0&&n.blocks.push({x:c.x,y:c.y,width:Math.max(c.width,xs(a)-c.x),height:a.headerHeight}),i(c.x,c.width,c.y+c.height),n.edges.push({x:c.x,top:c.y,bottom:c.y+c.height},{x:c.x+c.width,top:c.y,bottom:c.y+c.height}));for(let u of a.children)o(u,l)},s=(a,l)=>{i(a.box.x,a.box.width,a.box.y),i(a.box.x,a.box.width,a.box.y+a.box.height);for(let c of a.children)o(c,l);for(let c of a.nested)s(c,l)};for(let a of e)s(a,!0);for(let a of t){i(a.box.x,a.box.width,a.box.y),i(a.box.x,a.box.width,a.box.y+a.box.height);for(let l of a.nestedSwimlanes)s(l,!1)}return{obstacles:n,containers:r}}function hx(e,t,n,r){let{obstacles:i,containers:o}=BB(t,n),s=r.bandScale.bandwidth(),a=Se("item",[],r.styleCtx),l=[];for(let[p,m]of e){let g=r.placedItems.get(p);if(!g)continue;let E=ax(g,s);for(let x of Be(m.properties,"after")){let y=r.placedItems.get(x),w=y?void 0:o.get(x),_;if(y?_=ax(y,s):w&&(_=dS(w)),_){l.push({fromId:x,toId:p,source:_,target:E});continue}let k=r.entityMidpoints.get(x);if(!k||E.startX-k.x<=FB)continue;let N=E.rowY??E.top;l.push({fromId:x,toId:p,waypoints:[{x:k.x,y:N},{x:E.paintedX,y:N}],slack:!0,...Es(E.bottom-E.top),style:a})}}let c=l.filter(p=>p!==null&&"source"in p),u=kk(c,i,r.scale.pixelsPerDay),f=new Map(c.map((p,m)=>[p,u[m]])),d=[];for(let p of l){if(!p)continue;if(!("source"in p)){d.push(p);continue}let m=f.get(p);m&&d.push({...m,style:a})}return d}function qd(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 Kd=11,WB=120,XB=6,PS="\u2014 ";function $S(e,t,n,r,i=[]){let o=Gt,s=n+Gt,a=r-2*Gt,l=o+2*Gt,c=o+a-Gt,u=s+ed+Gt,f=[],d=0,p=(g,E,x)=>{for(let[y,w]of g){let _=w.title??y,k=w.description?.text,N=UB(_,k,l,c),B=u+d*ms,$=j=>({x:j.x,y:B+j.row*ms,text:j.text}),X={number:E.footnoteIndex.get(y)??f.length+1,y:B,title:_,titleLines:N.title.map($),description:k,style:Se("footnote",w.properties,E.styleCtx)};N.description.length>0&&(X.descriptionLines=N.description.map($)),x!==void 0&&(X.region=x),f.push(X),d+=N.rows}};p(e,t);for(let g of i){if(g.footnotes.size===0)continue;let E=u+d*ms;d+=1;let x=f.length;p(g.footnotes,g.ctx,g.title),f[x].regionHeadingY=E}return{box:{x:o,y:s,width:a,height:f.length===0?0:ed+d*ms+Gt},entries:f}}function UB(e,t,n,r){let i=r-n,o=CS(e,i,i),s=o.map((g,E)=>({x:n,row:E,text:g}));if(!t)return{title:s,description:[],rows:o.length};let a=se(PS,Kd),l=t.trim().split(/\s+/)[0]??"",c=n+Math.max(WB,e.length*XB),u=o.length===1&&a+se(l,Kd)<=r-c,f=u?c:n,d=u?o.length-1:o.length,p=CS(t,i,r-f-a),m=p.map((g,E)=>({x:E===0?f:n,row:d+E,text:E===0?`${PS}${g}`:g}));return{title:s,description:m,rows:d+p.length}}function CS(e,t,n){if(se(e,Kd)<=n)return[e];let r=wi(e,t,Kd,n);return r.length>0?r:[e]}function Xl(e,t,n){let r=[],i=(o,s,a)=>{let l=ve(ie(s.properties,"date"));if(!l)return;let c=n.forwardWithinDomain(l);c!==null&&r.push({id:o,centerX:c,radius:6,title:s.title??o,fontSize:10,bold:a,date:l,isMilestone:a})};for(let[o,s]of e)i(o,s,!1);for(let[o,s]of t)i(o,s,!0);return r}function Jd(e,t){return[...HB(e),...zB(t)]}function Ns(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 mx(e){return`nonworking:${e.from.toISOString().slice(0,10)}`}function gx(e){return`working:${e.from.toISOString().slice(0,10)}`}function MS(e,t,n){return{id:e,centerX:t,radius:0,title:n,fontSize:10,bold:!1}}function HB(e){let t=[];for(let n of e??[])n.label!==void 0&&t.push(MS(mx(n),n.x,n.label));return t}function zB(e){return(e??[]).map(t=>MS(gx(t),t.x,t.label))}function Fi(e,t,n,r){let i=n;for(let o of e){let s=FS(o,r),a=o.centerX+o.radius+6+s,c=o.centerX-o.radius-6-s>=t&&o.slipFromX===void 0;a>n&&!c&&(i=Math.max(i,a+kt))}return i}function FS(e,t){return t(e.title,e.fontSize)*(e.bold?1.05:1)}function Qd(e){let t=[];for(let n of e)for(let r of n.slackArrows??[])"marker"in r&&r.marker!==n.id&&t.push({from:r.marker,to:n.id});return t}function Ls(e,t,n,r,i=[]){let o=[...e].sort((u,f)=>u.centerX-f.centerX),s=new Map,a=[],l=new Map(e.map(u=>[u.id,u])),c=i.filter(u=>l.has(u.from)&&l.has(u.to));for(let u of o){let f=FS(u,r),d=u.centerX+u.radius+6,p=u.centerX-u.radius-6-f,m=d+f<=n,g=p>=t,E=u.centerX-u.radius,x=u.centerX+u.radius,y=T=>T==="right"?d:p,w=T=>T==="right"?m:g,_=u.slipFromX===void 0?[]:[{left:u.slipFromX-u.radius,right:u.centerX-u.radius}],k=c.filter(T=>T.from===u.id).map(T=>{let O=l.get(T.to);return{left:Math.min(u.centerX,O.centerX)+u.radius,right:Math.max(u.centerX,O.centerX)-O.radius}}).concat(_).filter(T=>T.right>T.left),N=-1,B=Number.POSITIVE_INFINITY;for(let T of c){if(T.to===u.id){let O=s.get(T.from);O&&(B=Math.min(B,O.rowIndex))}if(T.from===u.id){let O=s.get(T.to);O&&(N=Math.max(N,O.rowIndex))}}let $=T=>{let O=y(T);return k.some(S=>S.left<O+f&&S.right>O)},X=T=>w(T)&&!$(T),j=X("right")||u.slipFromX!==void 0?"right":X("left")?"left":m?"right":"left",D=(T,O)=>{let S=Math.min(E,T),F=Math.max(x,T+f),z=[{left:S,right:F},...k];return a[O].some(U=>z.some(ee=>U.left<ee.right&&U.right>ee.left))},I=-1,R="right",P=d;e:for(let T=a.length-1;T>=0;T--)if(!(T<N||T>B))for(let O of["right","left"]){if(!X(O))continue;let S=y(O);if(!D(S,T)){I=T,R=O,P=S;break e}}if(I===-1&&N>=0&&N<B){let T=N+1;for(let[O,S]of s)S.rowIndex>=T&&s.set(O,{...S,rowIndex:S.rowIndex+1});a.splice(T,0,[]),I=T,R=j,P=y(R)}else if(I===-1){for(let[T,O]of s)s.set(T,{...O,rowIndex:O.rowIndex+1});a=[[],...a],I=0,R=j,P=y(R)}let A=Math.min(E,P),L=Math.max(x,P+f);a[I].push({left:A,right:L},...k),s.set(u.id,{rowIndex:I,labelBox:{x:P,y:0,width:f,height:12},labelSide:R})}return{placements:s,rowCount:a.length}}function yx(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?lx(i,t.bandScale.bandwidth()):void 0;if(!i&&t.waves?.plan.index.has(r)){n.push({ref:r,endX:o,y:s,flowKey:`wave:${r}`,wave:r});continue}let a=t.itemFlowKey.get(r)??`marker:${r}`;if(!i&&t.markerIds.has(r)){n.push({ref:r,endX:o,y:s,marker:!0,flowKey:a});continue}n.push({ref:r,endX:o,y:s,flowKey:a})}return n}function xx(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 jB(e,t){return Math.abs(t-e.endX)<=12}function BS(e,t){return e.endX>=t||e.wave!==void 0?null:e.y!==void 0?{x:e.endX,y:e.y}:e.marker&&!jB(e,t)?{x:e.endX,marker:e.ref}:null}function YB(e){let t=null;for(let n of e)n.wave===void 0&&(!t||n.endX>t.endX)&&(t=n);return t}function VB(e,t){let n;for(let r of e)r.wave===void 0||r.endX-t<Ot||(!n||r.endX>n.endX)&&(n=r);return n}var Ex=class{constructor(t,n){M(this,"id");M(this,"milestone");this.id=t,this.milestone=n}place(t){let n=this.milestone,r=Se("milestone",n.properties,t.styleCtx),i=ie(n.properties,"date"),o=Be(n.properties,"after"),s=ve(i),a=t.timeline.markerRow.y,l=6,c=n.title??this.id,u=null,f=a,d=!1,p,m=!1,g,E;if(s){let _=t.scale.forwardWithinDomain(s);if(_===null)return null;u=_,d=!0;let k=t.markerRowPlacements.get(this.id);k&&(f=k.centerY);let N=yx(o,t),B=xx(N),$=YB(B),X=VB(B,_);E=X?.wave;let j=Math.max($&&$.endX>_?$.endX:_,X?.endX??_);j>_&&(m=!0,j-_>12&&(g=j))}else if(o.length>0){let _=yx(o,t),k=xx(_);k.sort(($,X)=>X.endX-$.endX);let N=k[0]?.endX??t.timeline.originX;u=N,d=!1;let B=[];for(let $=1;$<k.length;$++){let X=BS(k[$],N);X&&B.push(X)}B.length>0&&(p=B)}if(u===null)return null;let x={x:u,y:f};t.entityLeftEdges.set(this.id,x.x),t.entityRightEdges.set(this.id,x.x),t.entityMidpoints.set(this.id,x);let y={id:this.id,title:c,x:u,radius:l,fixed:d,slackArrows:p,isOverrun:m,style:r,cutTopY:t.chartTopY,cutBottomY:t.swimlaneBottomY};g!==void 0&&(y.slipX=g);let w=g??u;return t.waves&&(g!==void 0||!m)&&_S(t.waves,w)&&(y.onWaveBoundary=!0),E!==void 0&&s&&(y.overrunByWave=E,y.overrunDate=Ti(s)),s&&!t.scale.showsNonWorking&&!t.calendar.isWorkingDay(s)&&(y.hiddenDate=Ti(s)),y}};function ep(e,t){let n=[];for(let[r,i]of e){let o=new Ex(r,i).place(t);o&&n.push(o)}return n}function tp(e,t){let n=r=>{let i=t.get(r);if(!i)throw new Error(`layout: marker "${r}" has no marker-row placement`);return i};return e.map(r=>{let i=n(r.id),o={id:r.id,title:r.title,center:{x:r.x,y:i.centerY},radius:r.radius,fixed:r.fixed,slackArrows:r.slackArrows?.map(s=>"y"in s?{x:s.x,y:s.y}:{x:s.x,y:n(s.marker).centerY}),isOverrun:r.isOverrun,style:r.style,cutTopY:r.cutTopY,cutBottomY:r.cutBottomY,labelBox:i.labelBox,labelSide:i.labelSide};return r.slipX!==void 0&&(o.slip={x:r.slipX}),r.onWaveBoundary&&(o.onWaveBoundary=!0),r.overrunByWave!==void 0&&(o.overrunByWave=r.overrunByWave),r.overrunDate!==void 0&&(o.overrunDate=r.overrunDate),r.hiddenDate!==void 0&&(o.hiddenDate=r.hiddenDate),o})}function WS(e,t){let n=[];for(let[r,i]of e){if(ve(ie(i.properties,"date")))continue;let o=yx(Be(i.properties,"after"),t),s=xx(o);if(s.length===0)continue;s.sort((l,c)=>c.endX-l.endX);let a=s[0].endX;for(let l=1;l<s.length;l++){let c=s[l],u=BS(c,a);u&&"y"in u&&n.push({xStart:c.endX,xEnd:a,y:u.y,slackPredId:c.ref,milestoneId:r})}}return n}var Ul=16,KB=8,qB=6;function US(e,t,n,r,i,o){wx(e.content.anchors,t);let s=ep(e.content.milestones,t),a=ZB(e.content.anchors,s,t);if(a.length===0)return{anchors:[],milestones:[],laneShift:0};let l=Ul,c=Ls(a,l,Fi(a,l,o-Ul,se),se,Qd(s)),u=n+KB,f=u+c.rowCount*26+qB-r,d=i+f,p=Ns(c.placements,u);t.markerRowPlacements=p,t.chartTopY=r+f,t.swimlaneBottomY=d;let m=Cd(e.content.anchors,t,new Set),g=tp(s.map(E=>({...E,cutTopY:t.chartTopY,cutBottomY:d,slackArrows:E.slackArrows?.map(x=>"y"in x?{x:x.x,y:x.y+f}:x)})),p);return{anchors:m,milestones:g,laneShift:f}}function GS(e,t){let n=[...(e.anchors??[]).map(i=>XS(i,!1)),...(e.milestones??[]).map(i=>XS(i,!0))];return n.length===0?t:Fi(n,e.box.x+Ul,t-Ul,se)+Ul}function HS(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 ZB(e,t,n){let r=Xl(e,new Map,n.scale),i=o=>({id:o.id,centerX:o.slipX??o.x,radius:o.radius,title:o.title,fontSize:10,bold:!0,...o.slipX!==void 0?{slipFromX:o.x}:{}});return r.push(...t.filter(o=>o.fixed).map(i)),r.push(...t.filter(o=>!o.fixed).map(i)),r}function XS(e,t){let n="slip"in e?e.slip?.x:void 0;return{id:e.id??"",centerX:n??e.center.x,radius:e.radius,title:e.title,fontSize:10,bold:t,...n!==void 0?{slipFromX:e.center.x}:{}}}function wx(e,t){for(let n of Xl(e,new Map,t.scale))t.entityLeftEdges.set(n.id,n.centerX),t.entityRightEdges.set(n.id,n.centerX)}var JB=.8,QB=1;function eW(e){let t=[];return jS(e,t),t}function jS(e,t){for(let n of e)if(n.kind==="item"){let r=tW(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")&&jS(n.children,t)}function tW(e){return e.capacity?e.capacity.value:e.size?1:0}function YS(e){if(e.capacityValue<=0||e.warnFraction===null&&e.overFraction===null)return null;let t=eW(e.children);if(t.length===0)return null;let n=new Set;for(let s of t)n.add(s.startX),n.add(s.endX);let r=Array.from(n).sort((s,a)=>s-a);if(r.length<2)return null;let i=[];for(let s=0;s<r.length-1;s++){let a=r[s],l=r[s+1],c=(a+l)/2,u=0;for(let f of t)f.startX<=c&&c<f.endX&&(u+=f.load);i.push({startX:a,endX:l,load:u,classification:nW(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 nW(e,t,n,r){let i=e/t;return r!==null&&i>=r?"red":n!==null&&i>=n?"yellow":"green"}function VS(e,t){let n=t.get("swimlane"),r=zS(ie(e.properties,"utilization-warn-at"),n?ie(n.properties,"utilization-warn-at"):void 0,JB),i=zS(ie(e.properties,"utilization-over-at"),n?ie(n.properties,"utilization-over-at"):void 0,QB);return{warn:r,over:i}}function zS(e,t,n){let i=oW(e??t);return i.kind==="unset"?n:i.kind==="none"?null:i.value}var rW=/^\d+(?:\.\d+)?%$/,iW=/^\d+\.\d+$/;function oW(e){if(e===void 0)return{kind:"unset"};if(e==="none")return{kind:"none"};if(rW.test(e)){let t=parseFloat(e)/100;return Number.isFinite(t)&&t>0?{kind:"number",value:t}:{kind:"unset"}}if(iW.test(e)){let t=parseFloat(e);return Number.isFinite(t)&&t>0?{kind:"number",value:t}:{kind:"unset"}}return{kind:"unset"}}var np=class{constructor(t){M(this,"rows");M(this,"opts");M(this,"paintedRightX");this.opts=t,this.paintedRightX=t.laneLeftX,this.rows=[{y:t.originY,height:t.minRowHeight,rightEdge:t.laneLeftX,spillX:t.laneLeftX,contentOffsetY:0}]}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+i.contentOffsetY}}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,n.contentOffsetY+Math.max(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.contentOffsetY=t.contentOffsetY??0,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,contentOffsetY:0};return this.rows.push(r),r}};function Tx(e){return Ve(e)?e.name?[e.name]:[]:_t(e).flatMap(Tx)}function rp(e,t,n,r){let i=n.bandScale.step(),o=t.leftX,s=new np({laneLeftX:o,originY:t.firstRowY,minRowHeight:i,slackCorridors:n.slackCorridors}),a=o,l=Number.POSITIVE_INFINITY,c=new Set(_t(e).flatMap(Tx)),u=[];for(let f of _t(e)){for(let $ of Tx(f))c.delete($);if(!Ve(f)){let $=Fl(f,a,n),{rowIndex:X,y:j}=s.placeBlock(),D=Wl($,j),I=r.sequenceOne(f,D,n);u.push(I);let R=I.box.x+I.box.width,P=Math.max(i,D.height),A=qS(I);s.commitBlock({rowIndex:X,placed:I,blockHeight:P,blockEnd:R,contentOffsetY:sW(I),spillReservation:A>R?A:null,paintedRight:Ml(I)}),l=Math.min(l,D.startX),a=Math.max(a,D.x);continue}let d=f,p=Fl(d,a,n),m=n.scale.startX(p),g=Yd(d,m,n),E=m+g.naturalWidth,x=i+g.barExtra,{rowIndex:y,y:w}=s.placeItem({childId:d.name??"",desiredStart:m,desiredEnd:E,predictedHeight:x,pendingIds:c}),_=Wl(p,w),k=Vd(d,_,n,g);u.push(k),l=Math.min(l,_.startX);let N=Math.max(m+g.naturalWidth,k.box.x+k.box.width),B=m+bs(n,m,g.durationDays);a=Math.max(a,B),s.commitItem({rowIndex:y,placed:k,logicalEnd:N,spillReservation:KS(k),rowHeight:x})}return l===Number.POSITIVE_INFINITY&&(l=n.scale.startX(o)),{children:u,timeCursorX:a,timeStartX:l,packer:s}}function sW(e){return e.kind==="item"?0:(e.children[0]?.box.y??e.box.y)-e.box.y}function KS(e){return e.textSpills||e.chipsOutside||e.dotSpills||e.iconSpills||e.footnoteSpills?Math.max(e.decorationsRightX,e.chipsOutside?e.chipsRightX:0)+6:null}function qS(e){let t=e.box.x+e.box.width;if(e.kind==="item")return Math.max(t,KS(e)??t);let n=xs(e);return Math.max(t,n>t?n+_k:t,...e.children.map(qS))}var _x=10;function aW(e,t,n){let r=ie(e.properties,"capacity"),i=Nr(r);if(i===null)return{capacity:null,badgeWidthPx:0};let o=el(i),s=tl(t.capacityIcon,n),a=nl(o,s,_x),l=rl(o,s,_x);return{capacity:{value:i,text:o,icon:s,...l!==void 0?{iconDxTerms:l}:{}},badgeWidthPx:a}}var lW=10,cW=38,uW=8;function fW(e,t){let n=ie(e.properties,"owner");if(!n)return;let r=t.teams.get(n);if(r)return{text:r.title??n,kind:"team"};let i=t.persons.get(n);return i?{text:i.title??n,kind:"person"}:{text:n,kind:"team"}}function dW(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 pW(e,t,n){for(let r of e.content)if(r.$type!=="DescriptionDirective")return n.scale.startX(Fl(r,t,n))}var Os=class{constructor(t,n){M(this,"input");M(this,"helpers");this.input=t,this.helpers=n}get id(){return this.input.lane.name??""}place(t,n){let{lane:r,bandIndex:i}=this.input,{helpers:o}=this,s=Se("swimlane",r.properties,n.styleCtx),a=t.x,l=n.bandScale.step(),c=n.currentFlowKey;n.currentFlowKey=`lane:${r.name??i}`;let{capacity:u,badgeWidthPx:f}=aW(r,s,n.symbols),d=dW(r,n),p=d.length>0?se(d.join(","),_x):0,m=0,g=fW(r,n),E=r.title??r.name??"",x=E?Ay(m,E,g?.text,f,p):null,y=x?.rightX??0,w=pW(r,a,n),_=!r.title||w===void 0||w>=y+uW,k=t.y+(_?lW:cW),N=rp(r,{leftX:a,firstRowY:k},n,o),{children:B}=N,$=k-t.y,X=Math.max(l+32,$+N.packer.usedHeight()+16),j=Math.max(N.packer.usedRightX(),y),D={x:m,y:t.y,width:0,height:X},I=u?(()=>{let{warn:R,over:P}=VS(r,n.styleCtx.defaults);return YS({children:B,capacityValue:u.value,warnFraction:R,overFraction:P})})():null;return n.currentFlowKey=c,{positioned:{id:r.name,title:E,box:D,bandIndex:i,children:B,nested:[],style:s,owner:g?.text,ownerKind:g?.kind,footnoteIndicators:d,capacity:u,tab:x,utilization:I},usedHeight:X,usedRightX:j}}};var hW=18,mW=14,gW=14,yW=16,xW=24;function vx(e,t,n,r,i){let o=n+hW,s=[],a=[],l=!0,c=t.footnoteIndex.size;for(let u of e){l||(o+=yW),l=!1;let f=u.content.roadmap?.title??u.sourcePath,d=o+mW,p=Ud(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:qd(u.content.footnotes,c)});c+=u.content.footnotes.size,t.waves?Bd(t.waves,p.entityLeftEdges,p.entityRightEdges):wx(u.content.anchors,p);let m=[],g=d,E=0;for(let N of u.content.swimlanes.values()){p.nextParallelId=0,p.nextGroupId=0;let{positioned:B,usedHeight:$}=new Os({lane:N,bandIndex:E},r).place({x:p.timeline.originX,y:g},p);m.push(B),g+=$,E++}let x=US(u,p,o,d,g,i);if(x.laneShift!==0){for(let N of m)Rs(N,x.laneShift);g+=x.laneShift}let y=g,w=Math.max(t.bandScale.bandwidth(),y-o+gW),_={x:0,y:o,width:0,height:w},k={sourcePath:u.sourcePath,label:f,box:_,nestedSwimlanes:m,style:Se("swimlane",[],t.styleCtx)};x.anchors.length>0&&(k.anchors=x.anchors),x.milestones.length>0&&(k.milestones=x.milestones),s.push(k),a.push(p),o+=w}return{regions:s,contexts:a,endY:o}}function ZS(e,t,n){let r=Gl(e,t,n);e.box.width=r;for(let i of e.nestedSwimlanes)i.box.width=r}function Gl(e,t,n){let r=e.box.x,{chromeRightX:i}=_l(r,e.label,e.sourcePath),o=Wr(e.nestedSwimlanes),s=Math.max(i,o,HS(e),n)+xW;return Math.min(t-r,s-r)}function JS(e,t,n,r){if(!e)return null;let i=t.scale.forwardWithinDomain(e);if(i===null)return null;let o=t.timeline.box.y,s=t.timeline.tickPanelY,a=jn(n).nowLabel,l=se(a,gl),c=Math.max(qg,Math.ceil(l+2*hs)),u=t.timeline.originX-kt,f=c/2,d;i-f<u?d="flag-right":i+f>r?d="flag-left":d="center";let p=t.timeline.bottomTickPanelY,m=t.timeline.bottomTickPanelHeight??0,g=p!==void 0&&m>0?p+m:t.swimlaneBottomY;return{x:i,topY:s,bottomY:g,pillTopY:o,pillMode:d,label:a,pillWidth:c,style:Se("item",[],t.styleCtx)}}function ip(e){let t=e.trim().replace(/^#/,"");if(t.length===3&&(t=t.split("").map(n=>n+n).join("")),!/^[0-9a-fA-F]{6}$/.test(t))throw new Error(`Unsupported hex colour: ${e}`);return[Number.parseInt(t.slice(0,2),16),Number.parseInt(t.slice(2,4),16),Number.parseInt(t.slice(4,6),16)]}function QS(e){let[t,n,r]=ip(e).map(i=>{let o=i/255;return o<=.03928?o/12.92:((o+.055)/1.055)**2.4});return .2126*t+.7152*n+.0722*r}function op(e,t){let n=QS(e),r=QS(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}var EW=4.5;function nb(e,t,n,r,i){if(!e.frozen||!e.solve)throw new Error("buildWaves: the wave barrier has not settled");let o=Fd(e.plan,e.solve,e.pass,e.origin,e.floors,Ot),s=o.every(y=>y.memberCount===0),a=t.timeline.waveStrip??{y:t.timeline.tickPanelY+t.timeline.tickPanelHeight,height:0};if(!t.timeline.waveStrip&&!s)throw new Error("buildWaves: the timeline has no wave strip");let l=t.timeline.box.x,c=l+t.timeline.box.width,u=a.y+ad,f=a.height-2*ad,d=0,p=o.map((y,w)=>{let _=e.plan.waves[w],k=_.title??y.id,N=y.memberCount===0,B=Wd(y.start,t),$=vS(y.start,y.end,t),X=N?void 0:d++,j=TW(y.id,t),D=_W(_.properties,X,t),I=Math.max(y.start,l),R=Math.min(y.end,c),P=Math.max(0,R-I),A=Rt(e.plan.floors[w]?.ref!==void 0?[e.plan.floors[w].ref]:[]),L=A!==void 0&&P>=cl+pt+Gn,T=L?pt+tn:0,O,S=!1;if(!N){if(j.length>0){let K=j.length*Xt;O=eb(k,y.id,w+1,P,K+T),S=O!==void 0}O??(O=eb(k,y.id,w+1,P,T))}let F=N?y.start:(I+R)/2,z=N?Ax(B):`${Ax(B)} \u2013 ${Ax($)}`,U=[k,z];N?U.push(n.waveNoItems):y.heldBy!==void 0&&U.push(`${n.waveHeldBy} ${y.heldBy}`);let ee,Y=o[w-1];if(!s&&Y!==void 0&&y.floorRef!==void 0&&y.start-Y.end>Ot){let K=Math.max(Y.end,l),q=Math.min(y.start,c),J=se(y.floorRef,Un);if(J+2*Gn<=q-K){let re=(K+q)/2,le=J+2*gs;ee={text:y.floorRef,x:re,halo:{x:re-le/2,y:u,width:le,height:f}}}}let ne={x:y.start,y:a.y,width:y.end-y.start,height:a.height},v=N?void 0:wW(ne,t.timeline.box),C,W,G;if(v){L&&A!==void 0&&(G={side:"after",isoDate:A,glyphTopLeft:{x:v.x+cl,y:a.y+(a.height-pt)/2},glyphSize:pt,spilled:!1});let K=v.x+v.width,q=S?j.length*Xt:0;if(q){let J=K-Gn+gs,re=K-Gn-q-gs;W={rightX:K-Gn,halo:{x:re,y:u,width:J-re,height:f}}}if(O){let J=rb(O.label),re=q?Math.min(F,K-Gn-q-J/2):F,le=G?Math.max(re,G.glyphTopLeft.x+pt+tn+J/2):re,ce=J+2*gs;C={x:le,halo:{x:le-ce/2,y:u,width:ce,height:f}}}}return{id:y.id,title:k,index:w,...X!==void 0?{visibleOrdinal:X}:{},startX:y.start,endX:y.end,startDate:B,endDate:$,memberCount:y.memberCount,empty:N,...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:a.y,width:y.end-y.start,height:a.height},...O?{label:O.label}:{},labelKind:O?.kind??"none",labelX:F,...v?{cell:v}:{},...C?{labelDraw:C}:{},...G?{inlineDatePin:G}:{},...W?{superscripts:W}:{},tooltip:U.join(" \xB7 "),footnotesShown:S,...ee?{gapLabel:ee}:{}},style:D,footnoteIndicators:j}}),m=s?[]:kW(p,e.origin,a.y,t),g=kx(r),E=i.map(y=>kx(y.nestedSwimlanes));return{waves:p,boundaries:m,crossings:tb(g,m),regionCrossings:E.map(y=>tb(y,m)),hasBackground:g.length+E.flat().length>0}}function wW(e,t){let n=Si,r={x:e.x,y:e.y+n,width:e.width,height:e.height-2*n},i={x:t.x+n,y:e.y,width:t.width-2*n,height:e.height},o=Math.max(r.x,i.x),s=Math.max(r.y,i.y),a=Math.min(r.x+r.width,i.x+i.width),l=Math.min(r.y+r.height,i.y+i.height);if(!(a<=o||l<=s))return{x:o,y:s,width:a-o,height:l-s}}function rb(e){return se(e,Un)*1.05}function eb(e,t,n,r,i){let o=a=>rb(a)+i+2*Gn<=r;if(o(e))return{kind:"title",label:e};if(t!==e&&o(t))return{kind:"id",label:t};for(let a=e.length-1;a>=3;a--){let l=e.slice(0,a).trimEnd();if(l.length<3)break;let c=`${l}\u2026`;if(o(c))return{kind:"ellipsis",label:c}}let s=`#${n}`;if(o(s))return{kind:"ordinal",label:s}}function TW(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 _W(e,t,n){let r=n.styleCtx.theme,i=new Map,o=ie(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=qn(p,r);return m==="none"?void 0:m},l=a("bg"),c=t!==void 0&&t%2===1?r.wave.stripFillAlt:r.wave.stripFill,u=l?vW(c,l,El)??c:c,f=i.get("border");return{...l?{tint:l}:{},stripFill:c,text:a("text")??AW(r.wave,u),boundary:a("fg")??r.wave.boundary,boundaryDash:f==="dashed"?"4 2":f==="dotted"?"1 2":null}}var sp=/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;function vW(e,t,n){if(!sp.test(e)||!sp.test(t))return;let r=ip(e),i=ip(t);return`#${r.map((o,s)=>Math.round(o*(1-n)+i[s]*n).toString(16).padStart(2,"0")).join("")}`}function AW(e,t){let n=e.labelText;return!sp.test(n)||!sp.test(t)||op(n,t)>=EW?n:op(e.hatch,t)>=op(e.hatchOnDark,t)?e.hatch:e.hatchOnDark}function kW(e,t,n,r){let i=[];for(let a of e)a.empty||(i.push({x:a.startX,wave:a,opening:!0}),i.push({x:a.endX,wave:a,opening:!1}));i.sort((a,l)=>a.x-l.x);let o=[],s=0;for(;s<i.length;){let a=s;for(;a<i.length&&i[a].x-i[s].x<Ot;)a++;let l=i.slice(s,a);s=a;let c=l[0].x;if(Math.abs(c-t)<Ot)continue;let u=(l.find(f=>f.opening)??l[0]).wave;o.push({x:c,topY:n,bottomY:r.swimlaneBottomY,stroke:u.style.boundary,dash:u.style.boundaryDash})}return o}function kx(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(...kx(r.nested));return t}function tb(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}function ib(e,t,n,r){if(!e.hasBackground)return;let i=t.timeline.originX,o=n.waveLegendBackground,s=ld+my,a=s+se(o,Un),l={kind:"background",text:o,swatch:{x:i,y:r+(od-cd)/2,width:ld,height:cd},hatch:Xd(t.styleCtx.theme.entities.item.bg),runs:[{text:o,x:i+s,y:r+gy}]};return{box:{x:i,y:r,width:a,height:od},entries:[l]}}function Ax(e){return e.toISOString().slice(0,10)}var ob=1e-6,Ps=class{constructor(t){M(this,"domain");M(this,"range");M(this,"pixelsPerDay");M(this,"calendar");M(this,"nonWorking");this.domain=t.domain,this.range=t.range,this.calendar=t.calendar,this.nonWorking=t.nonWorking??"hide";let n=Math.max(1,this.showsNonWorking?At(t.domain[0],t.domain[1]):this.indexOf(t.domain[1]));this.pixelsPerDay=(t.range[1]-t.range[0])/n}get showsNonWorking(){return this.nonWorking==="show"&&this.calendar?.hasNonWorkingDays===!0}indexOf(t){return this.calendar?this.calendar.workingIndexOf(this.domain[0],t):At(this.domain[0],t)}dayAt(t){let n=(t-this.range[0])/this.pixelsPerDay;return{days:n,day:Math.floor(n+ob)}}forward(t){return this.showsNonWorking?this.range[0]+At(this.domain[0],t)*this.pixelsPerDay:this.range[0]+this.indexOf(t)*this.pixelsPerDay}forwardWithinDomain(t){return t<this.domain[0]||t>this.domain[1]?null:this.forward(t)}invert(t){let n=Math.round((t-this.range[0])/this.pixelsPerDay);return this.showsNonWorking?Xe(this.domain[0],n):this.calendar?this.calendar.dateAtWorkingIndex(this.domain[0],n):Xe(this.domain[0],n)}indexAtX(t){let{days:n,day:r}=this.dayAt(t);if(!this.showsNonWorking||!this.calendar)return n;let i=Xe(this.domain[0],r),o=this.calendar.workingIndexOf(this.domain[0],i);return this.calendar.isWorkingDay(i)?o+Math.max(0,n-r):o}startX(t){if(!this.showsNonWorking||!this.calendar)return t;let n=Xe(this.domain[0],this.dayAt(t).day);if(this.calendar.isWorkingDay(n))return t;let r=this.calendar.workingIndexOf(this.domain[0],n);return this.forward(this.calendar.dateAtWorkingIndex(this.domain[0],r))}advanceX(t,n){if(!this.showsNonWorking||!this.calendar)return t+n*this.pixelsPerDay;let r=this.startX(t);if(n<=0)return r;let i=this.indexAtX(r)+n,o=Math.ceil(i-ob)-1,s=i-o,a=this.calendar.dateAtWorkingIndex(this.domain[0],o);return this.forward(a)+s*this.pixelsPerDay}get originX(){return this.range[0]}get widthPx(){return this.range[1]-this.range[0]}};var ap=6,RW=4,sb=8,cp=class{constructor(t){M(this,"input");this.input=t}measure(){let{title:t,author:n,style:r,logo:i}=this.input,o=r.headerPosition==="beside",s=SW(t,n,i),a=i?Math.max(ey,i.height+20):ey;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?sb:a+sb,minRowsBottomY:o?s.cardHeight+RW:0}}place(t,n){let{title:r,author:i,style:o}=this.input,s=t.position==="beside",a=s?{x:0,y:0,width:t.chartLeftX,height:n.chartBottomY}:{x:0,y:0,width:n.canvasRightX,height:t.aboveHeight},l=s?{x:ap,y:n.rowsBottomY-t.cardHeight,width:t.cardWidth,height:t.cardHeight}:{x:0,y:0,width:n.canvasRightX,height:t.aboveHeight},c,u;return t.logo&&(c={box:{x:a.x+l.x+16,y:a.y+l.y+(l.height-t.logo.height)/2,width:t.logo.width,height:t.logo.height},assetRef:t.logo.assetRef,intrinsic:t.logo.intrinsic},u={x:t.logoSlot,y:Math.max(0,(l.height-t.textCardHeight)/2)}),{box:a,position:o.headerPosition,title:r,author:i,titleLines:t.titleLines,authorLines:t.authorLines,cardBox:l,logo:c,...u?{textInset:u}:{},style:o}}};function SW(e,t,n){let r=Qg-32,i=wi(e,r,16),o=wi(t??"",r,11),s=0;for(let E of i)s=Math.max(s,se(E,16));for(let E of o)s=Math.max(s,se(E,11));let a=i.length>0||o.length>0,l=n?n.width+(a?12:0):0,c=s+32,u=Math.max(gk-ap,Math.min(Qg-ap,c)+l),f=i.length>0?(i.length-1)*20:0,d=o.length>0?18+(o.length-1)*14:0,p=26+f+d+14,m=n?Math.max(p,n.height+20):p,g=u+ap;return{titleLines:i,authorLines:o,cardWidth:u,cardHeight:m,textCardHeight:p,logoSlot:l,boxWidth:g}}function up(e){for(let t of e.waves?.values()??[])if(t.memberCount>0)return!0;return!1}function Hl(e,t,n={}){let r=Yf(e,t),{config:i,working:o}=r,s=cs(t.content.sizes,i),a=ie(e.roadmapDecl?.properties??[],"start"),l=ve(a)??bW(n.today??new Date),c=R=>o.workingIndexOf(l,R),u=R=>o.dateAtWorkingIndex(l,R),f=(R,P)=>jf(o,l,R,P),d=0,p=R=>{d=Math.max(d,R)},m=new Map,g=new Map,E=new Map,x=new Map,y=new WeakMap,w=new Map,_=new WeakMap,k=new Map;for(let[R,P]of t.content.anchors){let A=ve(ie(P.properties,"date"));if(A){let L=c(A);g.set(R,L),k.set(R,A),p(L)}}let N=()=>({itemEnd:m,anchorEnd:g,milestoneEnd:E,sizes:s,itemResults:x,inByNode:!0}),B=(R,P,A)=>{let L=S=>{if("date"in S)return c(S.date);let F=S.ref;return R.itemEnd.has(F)?R.itemEnd.get(F):R.anchorEnd.has(F)?R.anchorEnd.get(F):R.milestoneEnd.has(F)?R.milestoneEnd.get(F):0},T=(S,F)=>{let z=F;for(let U of _t(S))z=O(U,z),A(z);return z},O=(S,F)=>{if(Ve(S)){let z=XA(S.properties,R.sizes,i),{after:U}=Xr(S.properties),ee=U.length>0?Math.max(F,...U.map(L)):F;P&&(ee=P.apply(S,ee));let Y=ee+z,ne={start:u(ee),end:f(ee,Y),days:z};return R.inByNode&&y.set(S,ne),S.name&&(R.itemEnd.set(S.name,Y),R.itemResults?.set(S.name,ne)),P?.accumulate(S,Y),Y}if(et(S)){let{after:z}=Xr(S.properties),U=z.length>0?Math.max(F,...z.map(L)):F;P&&(U=P.apply(S,U));let ee=U;for(let Y of _t(S))ee=Math.max(ee,O(Y,U));return S.name&&R.itemEnd.set(S.name,ee),ee}if($e(S)){let{after:z}=Xr(S.properties),U=z.length>0?Math.max(F,...z.map(L)):F;P&&(U=P.apply(S,U));let ee=T(S,U);return S.name&&R.itemEnd.set(S.name,ee),ee}return F};return{walkLane:T,resolveAfterDay:L}},$=(R,P)=>{let A=ve(ie(R.properties,"date"));if(A)return c(A);let{after:L}=Xr(R.properties);return L.length>0?Math.max(0,...L.map(P)):void 0},X=(R,P)=>{let A=new Map,L=new Map,T=new Map;for(let[F,z]of R.anchors){let U=ve(ie(z.properties,"date"));if(U){let ee=c(U);L.set(F,ee),p(ee)}}let{walkLane:O,resolveAfterDay:S}=B({itemEnd:A,anchorEnd:L,milestoneEnd:T,sizes:cs(R.sizes,i),inByNode:P},void 0,p);for(let F of R.swimlanes.values())O(F,0);for(let[F,z]of R.milestones){let U=$(z,S);U!==void 0&&(T.set(F,U),p(U))}for(let F of R.isolatedRegions)X(F.content,!1)},j=n.plan!==void 0?n.plan??void 0:$i(t),D;if(j){let R=j.waves.map(S=>S.name),P=gS(j,l,o),A,L=0,T=S=>{L=Math.max(L,S)},O=Md(R.length,0,P,(S,F)=>{let z=R.map((Y,ne)=>[Y,F[ne]]);m=new Map(z),x=new Map,y=new WeakMap,L=0;let U=new Mi(j,S),{walkLane:ee}=B(N(),U,T);for(let Y of t.content.swimlanes.values())ee(Y,0);for(let Y of t.content.isolatedRegions){let ne=B({itemEnd:new Map(z),anchorEnd:new Map,milestoneEnd:new Map,sizes:cs(Y.content.sizes,i),inByNode:!0},U,T);for(let v of Y.content.swimlanes.values())ne.walkLane(v,0)}return A=U,U});p(Math.max(L,...O.S,...O.E.slice(-1))),D=new Map;for(let S of Fd(j,O,A,0,P))D.set(S.id,{index:S.index,start:u(S.start),end:f(S.start,S.end),memberCount:S.memberCount,...S.heldBy!==void 0?{heldBy:S.heldBy}:{},...S.floorRef!==void 0?{floorRef:S.floorRef}:{}})}else{let{walkLane:R}=B(N(),void 0,p);for(let P of t.content.swimlanes.values())R(P,0)}let{resolveAfterDay:I}=B(N(),void 0,p);for(let[R,P]of t.content.milestones){let A=$(P,I);if(A===void 0)continue;let L=ve(ie(P.properties,"date"))??u(A);E.set(R,A),w.set(R,L),_.set(P,L),p(A)}if(!j)for(let R of t.content.isolatedRegions)X(R.content,!0);return{startDate:l,calendar:r,items:x,byNode:y,milestones:w,milestoneByNode:_,anchors:k,...D?{waves:D}:{},...j?{plan:j}:{},resolved:t,extent:{contentEndDay:d}}}function bW(e){return new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()))}var NW=8;function cb(e,t,n,r,i){let{locale:o,styleCtx:s}=r,{calendar:a,preset:l,startDate:c,timelineDays:u,nonWorking:f}=i,d=i.naturalEndDate,p=up(i.schedule)?i.schedule.plan:void 0,m=r.roadmapStyle,g=fl[m.headerHeight]??fl.md,E=g>0&&m.timelinePosition!=="bottom",x=g>0&&(m.timelinePosition==="bottom"||m.timelinePosition==="both"),y=e.roadmapDecl?.title??e.roadmapDecl?.name??"",w=ie(e.roadmapDecl?.properties??[],"author"),_=new cp({title:y,author:w,style:m,logo:Ck(e,n.logo)}),k=_.measure(),{chartLeftX:N}=k,B=sk({naturalPixelsPerDay:l.pixelsPerUnit/a.daysPerUnit(l.unit),dayCount:u,chromeWidth:N+2*kt,maxWidth:n.width}),$=u*B,X=N+kt,j=$,I=n.today!==void 0&&n.today>=c&&n.today<=d?Ut:0,R=E?g:0,P=p?ly:0,A=new Ps({domain:[c,d],range:[X,X+$],calendar:a,nonWorking:f}),L=Jd(rx(A,[],l.unit,!1),ix(A)),T=t.content.anchors.size+t.content.milestones.size>0||L.length>0,O=X+j+kt,S=Xl(t.content.anchors,t.content.milestones,A),F=[...S,...L],z=Ls(F,N,Fi(F,N,O,se),se),U=T?Math.max(1,z.rowCount):0,ee=U*26,Y=I+R+P+ee,ne=Y+NW,v=Nx(k,Y),C=v+I,W=C+R,G=W+P,K=Pd(A,l,a,o),q={box:{x:X,y:v,width:$,height:0},ticks:K,pixelsPerDay:B,originX:X,startDate:c,endDate:d,labelStyle:Se("roadmap",[],s),pillRowHeight:I,tickPanelY:C,tickPanelHeight:R,markerRow:{y:G+13,height:ee,collisionY:G-8},minorGrid:m.minorGrid,...p?{waveStrip:{y:W,height:P}}:{}};return Lx(q,A,l.unit),{header:k,headerNode:_,axis:{originX:X,ppd:B,naturalWidth:$,scale:A},naturalChartRightX:O,bands:{timelineY:v,pillRowHeight:I,tickPanelY:C,tickPanelHeight:R,waveStripY:W,markerRowY:G,estimatedMarkerRows:U,rowsHeight:Y,chartTopY:v+ne,bottomTickPanelHeight:x?g:0},timeline:q,markers:{datePinned:S,placements:Ns(z.placements,G),hasEntities:T}}}function Nx(e,t){return Math.max(e.chartTopY,e.minRowsBottomY-t)}function Lx(e,t,n){let r=rx(t,e.ticks,n,e.minorGrid);r&&(e.nonWorkingDisplay=t.showsNonWorking?"show":"hide",e.nonWorking=r);let i=ix(t);i&&(e.workingExceptions=i)}var ub=8,Ox=class{constructor(t){M(this,"rightX");M(this,"frozen",!1);this.rightX=t}grow(t){if(this.frozen)throw new Error("layout: the canvas grew after it was frozen");return t<=this.rightX?!1:(this.rightX=t,!0)}freeze(){this.frozen=!0}get provisional(){return this.rightX}get final(){if(!this.frozen)throw new Error("layout: the canvas was read before it was final");return this.rightX}},LW;var fp=class{constructor(t,n,r,i,o,s,a){M(this,"file");M(this,"resolved");M(this,"options");M(this,"scope");M(this,"window");M(this,"measured");M(this,"chart");M(this,"canvas");M(this,"chartY");M(this,"draft",{});M(this,"scaleIsFinal",!1);M(this,"band");M(this,"rowsTop");M(this,"rowsBottom");M(this,"why");this.file=t,this.resolved=n,this.options=r,this.scope=i,this.window=o,this.measured=s,this.chart=a,this.canvas=new Ox(s.naturalChartRightX);let l=a.ctx;this.chartY={get top(){return l.chartTopY},set top(c){l.chartTopY=c},get swimlaneBottom(){return l.swimlaneBottomY},set swimlaneBottom(c){l.swimlaneBottomY=c},get bottom(){return l.chartBottomY},set bottom(c){l.chartBottomY=c}}}get ctx(){return this.chart.ctx}get scale(){return this.chart.ctx.scale}finalScale(){if(!this.scaleIsFinal)throw new Error("layout: the final scale was read before the timeline extension");return this.chart.ctx.scale}extendScale(t){if(this.scaleIsFinal)throw new Error("layout: the scale was extended after it was final");this.chart.ctx.scale=t}settleScale(){this.scaleIsFinal=!0}markerBand(){if(!this.band)throw new Error("layout: the marker band was read before the final pack");return this.band}setMarkerBand(t){if(this.band)throw new Error("layout: the marker band was packed twice");this.band=t,this.chart.ctx.markerRowPlacements=t.placements}headerRowsTop(){return this.rowsTop||(this.rowsTop=OW(this.measured,this.options.today,this.finalScale())),this.rowsTop}headerRowsBottom(){if(this.rowsBottom===void 0)throw new Error("layout: the header rows bottom was read before the rows grew");return this.rowsBottom}setHeaderRowsBottom(t){if(this.rowsBottom!==void 0)throw new Error("layout: the header rows grew twice");this.rowsBottom=t}explain(t){this.why=t}report(t,n){LW?.(t,n,this.why),this.why=void 0}};function OW(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=Nx(i,Ut+r.rowsHeight),a=s+Ut,l=a-r.tickPanelY;return{timelineY:s,pillRowHeight:Ut,tickPanelY:a,markerRowY:r.markerRowY+l,shift:l}}function PW(e){return e.canvas.grow(e.chart.maxRightX+kt)}function CW(e){let{swimlanes:t,includes:n,milestones:r}=e.chart,{calendar:i,preset:o,startDate:s,spanDays:a,nonWorking:l}=e.window,{originX:c,ppd:u}=e.measured.axis,f=e.measured.timeline,d=Wr(t);for(let N of n)d=Math.max(d,Wr(N.nestedSwimlanes));let p=0;for(let N of e.measured.markers.datePinned)p=Math.max(p,N.centerX+N.radius);let m=0;for(let N of r)N.fixed?p=Math.max(p,N.x+N.radius):m=Math.max(m,N.x+N.radius);for(let N of n){for(let B of N.anchors??[])p=Math.max(p,B.center.x+B.radius);for(let B of N.milestones??[])B.fixed?p=Math.max(p,B.center.x+B.radius):m=Math.max(m,B.center.x+B.radius)}let g=Math.max(d,p,m),E=i.daysPerUnit(o.unit),x=e.scale.showsNonWorking?e.scale.indexAtX(g):(g-c)/u,y=x>0?Di(s,x,o.unit,E,i):0,w=Ss(t);for(let N of n)w=Math.max(w,Ss(N.nestedSwimlanes));let _=new Is(e.window,e.scale);if(w>0){let N=Math.max(a,y);_.isPast(w,N)&&(y=Math.max(y,Math.min(_.boundaryAtOrAfterX(w),_.captionLimit(N))))}let k=!1;if(y>a){let N={bar:d,caption:w,datedMarker:p,afterMilestone:m};e.explain(Object.keys(N).filter(j=>N[j]>0&&_.isPast(N[j],a)));let B=i.dateAtWorkingIndex(s,y),$=e.scale.showsNonWorking?At(s,B)*u:y*u,X=new Ps({domain:[s,B],range:[c,c+$],calendar:i,nonWorking:l});e.extendScale(X),f.endDate=B,f.box.width=$,f.ticks=Pd(X,o,i,e.scope.locale),Lx(f,X,o.unit),e.canvas.grow(c+$+kt),k=!0}return e.settleScale(),k}function $W(e){let t=e.measured.timeline,n=new Map;for(let l of e.chart.milestones)l.slipX!==void 0&&n.set(l.id,l.slipX);let r=e.measured.markers.datePinned.map(l=>{let c=l.isMilestone?n.get(l.id):void 0;return{id:l.id,centerX:c??l.centerX,radius:l.radius,title:l.title,fontSize:l.fontSize,bold:l.bold,...c!==void 0?{slipFromX:l.centerX}:{}}});for(let l of e.chart.milestones)l.fixed||r.push({id:l.id,centerX:l.x,radius:l.radius,title:l.title,fontSize:10,bold:!0});let i=Jd(t.nonWorking,t.workingExceptions);r.push(...i),e.draft.markerEntries={all:r,calendarCount:i.length};let o=Fi(r,e.measured.header.chartLeftX,e.canvas.provisional,se),s=fb(e,e.draft.markerEntries);for(let l of e.chart.includes)o=Math.max(o,GS(l,e.canvas.provisional)),o=Math.max(o,l.box.x+Gl(l,Number.POSITIVE_INFINITY,s));let a=e.canvas.grow(o);return e.canvas.freeze(),a}function fb(e,t){let{swimlanes:n,includes:r}=e.chart,i=Math.max(Wr(n),Ss(n));for(let s of r){i=Math.max(i,Wr(s.nestedSwimlanes),Ss(s.nestedSwimlanes));for(let a of[...s.anchors??[],...s.milestones??[]])i=Math.max(i,a.labelBox.x+a.labelBox.width)}if(t){let s=t.all.slice(0,t.all.length-t.calendarCount);for(let a of s){let l=se(a.title,a.fontSize)*(a.bold?1.05:1);i=Math.max(i,a.centerX+a.radius+6+l)}}let o=e.options.today?e.scale.forwardWithinDomain(e.options.today):null;return o!==null&&(i=Math.max(i,o)),i}function DW(e){let t=e.canvas.final,n=e.measured.naturalChartRightX,r=fb(e,Pt(e.draft.markerEntries,"the marker entries")),i=e.chart.swimlanes.length>0&&t!==n;for(let o of e.chart.swimlanes)o.box.width=t;for(let o of e.chart.includes)Gl(o,t,r)!==Gl(o,n,r)&&(i=!0),ZS(o,t,r);return i}function MW(e){let t=Pt(e.draft.markerEntries,"the marker entries"),n=Ls(t.all,e.measured.header.chartLeftX,e.canvas.final,se,Qd(e.chart.milestones)),r=Ns(n.placements,e.headerRowsTop().markerRowY),i=e.measured.markers.hasEntities||t.calendarCount>0?Math.max(1,n.rowCount):0;e.setMarkerBand({rowCount:i,placements:r});let o=!1;for(let[s,a]of e.measured.markers.placements){let l=r.get(s);(!l||!ZW(a,l))&&(o=!0)}return o}function FW(e){let t=e.markerBand(),n=e.ctx,r=e.measured.timeline,i=tp(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(mx(s));a&&(s.labelBox=a.labelBox,s.labelSide=a.labelSide)}for(let s of r.workingExceptions??[]){let a=t.placements.get(gx(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 BW(e){let t=e.markerBand(),n=e.headerRowsTop(),r=e.measured.bands,i=r.estimatedMarkerRows,s=e.ctx.timeline,a=!1;n.pillRowHeight!==r.pillRowHeight&&(s.box.y=n.timelineY,s.pillRowHeight=n.pillRowHeight,s.tickPanelY=n.tickPanelY,s.waveStrip&&(s.waveStrip.y+=n.shift),s.markerRow.y+=n.shift,s.markerRow.collisionY+=n.shift,a=!0);let l=n.shift;t.rowCount>i&&(l+=(t.rowCount-i)*26,s.markerRow.height=t.rowCount*26,a=!0),e.setHeaderRowsBottom(n.markerRowY+s.markerRow.height);let c=r.chartTopY+l;e.chartY.top=c,e.chartY.bottom+=c,e.chartY.swimlaneBottom+=c,s.box.height=e.chartY.bottom-s.box.y;for(let d of e.chart.swimlanes)Rs(d,c);for(let d of e.chart.includes)lS(d,c);let u=e.chart.milestones,f=Pt(e.draft.milestones,"the milestones");for(let d=0;d<f.length;d++)cS(f[d],u[d],c);return a}function WW(e){let t=e.measured.bands.bottomTickPanelHeight;return t<=0?!1:(e.ctx.timeline.bottomTickPanelY=e.chartY.bottom+ub,e.ctx.timeline.bottomTickPanelHeight=t,e.chartY.bottom+=ub+t,!0)}function XW(e){e.finalScale();let t=e.ctx;if(!t.waves)return!1;let n=nb(t.waves,t,jn(e.scope.locale),e.chart.swimlanes,e.chart.includes);return n.regionCrossings.forEach((r,i)=>{r.length>0&&(e.chart.includes[i].waveCrossings=r)}),e.draft.waves=n,!0}function UW(e){e.finalScale(),e.markerBand();let t=new Set(Pt(e.draft.milestones,"the milestones").map(r=>r.center.x)),n=Cd(e.resolved.content.anchors,e.ctx,t);return e.draft.anchors=n,n.length>0}function GW(e){let t=px(e.chart.laneEntries),n=hx(t,e.chart.swimlanes,e.chart.includes,e.ctx);e.draft.edges=n;let r=0;return e.resolved.content.isolatedRegions.forEach((i,o)=>{let s=e.chart.includes[o],a=e.chart.regionContexts[o];if(!s||!a)return;let l=hx(px([...i.content.swimlanes.values()]),s.nestedSwimlanes,[],a);l.length>0&&(s.edges=l),r+=l.length}),n.length+r>0}function HW(e){e.finalScale();let t=JS(e.options.today,e.ctx,e.scope.locale,e.canvas.final);return e.draft.nowline=t,t!==null}function zW(e){let t=e.draft.waves;if(!t)return!1;let n=ib(t,e.ctx,jn(e.scope.locale),e.chartY.bottom+sd);return n?(e.chartY.bottom+=sd+n.box.height,e.draft.waveLegend=n,!0):!1}function jW(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=$S(e.resolved.content.footnotes,e.ctx,e.chartY.bottom,e.canvas.final,t);return e.draft.footnotes=n,n.entries.length>0}function YW(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 VW(e){let t=Pt(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-kt-oy,y:r+kt,width:oy,height:xk};return e.draft.attributionBox=i,e.draft.height=i.y+i.height+kt,!0}var KW=[{name:"growCanvasForSpill",reads:["placement"],writes:["canvas"],run:PW},{name:"extendTimeline",reads:["placement","window","scale"],writes:["scale","timeline","calendarRuns","canvas"],run:CW},{name:"growCanvasForMarkerLabels",reads:["placement","calendarRuns","canvas","scale"],writes:["markerEntries","canvas"],run:$W},{name:"fitWidths",reads:["placement","canvas","markerEntries","scale"],writes:["laneWidths"],run:DW},{name:"packMarkers",reads:["placement","canvas","markerEntries","headerBands","scale"],writes:["markerBand"],run:MW},{name:"placeMarkers",reads:["placement","markerBand","calendarRuns"],writes:["milestones","calendarLabels","markerMidpoints"],run:FW},{name:"growHeaderRows",reads:["placement","markerBand","headerBands","scale","milestones","chartTop","laneBottom"],writes:["chartTop","rowsBottom","laneBottom","chartBottom","laneY","milestones","timeline"],run:BW},{name:"bottomTickPanel",reads:["headerBands","chartBottom"],writes:["chartBottom","timeline"],run:WW},{name:"waves",reads:["scale","chartTop","laneBottom","timeline","laneY"],writes:["waves","timeline"],run:XW},{name:"anchors",reads:["scale","markerBand","chartTop","laneBottom","milestones"],writes:["anchors","markerMidpoints"],run:UW},{name:"dependencyEdges",reads:["laneY","markerMidpoints"],writes:["edges"],run:GW},{name:"nowline",reads:["scale","canvas","laneBottom","timeline"],writes:["nowline"],run:HW},{name:"waveLegend",reads:["waves","canvas","chartBottom"],writes:["legend","chartBottom"],run:zW},{name:"footnotePanel",reads:["chartBottom","canvas"],writes:["footnotes"],run:jW},{name:"header",reads:["chartBottom","canvas","rowsBottom"],writes:["header"],run:YW},{name:"attribution",reads:["footnotes","chartBottom","canvas"],writes:["attribution"],run:VW}];function db(e,t=KW){for(let n of t)e.report(n.name,n.run(e));return qW(e)}function qW(e){let{draft:t}=e,{themeName:n,theme:r}=e.scope,{swimlanes:i,includes:o,waveSolve:s}=e.chart,a=e.canvas.final,l=e.measured.header.chartLeftX,c=t.waves,u=t.waveLegend;return{width:a,height:Pt(t.height,"the canvas height"),theme:n,palette:r,backgroundColor:r.surface.page,header:{...Pt(t.header,"the header"),attributionBox:Pt(t.attributionBox,"the attribution box")},timeline:e.measured.timeline,nowline:Pt(t.nowline,"the now-line"),swimlanes:i,anchors:Pt(t.anchors,"the anchors"),milestones:Pt(t.milestones,"the milestones"),edges:Pt(t.edges,"the edges"),footnotes:Pt(t.footnotes,"the footnote panel"),includes:o,chartBox:{x:l,y:e.chartY.top,width:a-l,height:e.chartY.bottom-e.chartY.top},...s?{waveSolve:s}:{},...c?{waves:c.waves}:{},...c&&c.boundaries.length>0?{waveBoundaries:c.boundaries}:{},...c&&c.crossings.length>0?{waveCrossings:c.crossings}:{},...u?{waveLegend:u}:{}}}function Pt(e,t){if(e===void 0)throw new Error(`layout: ${t} was read before its step ran`);return e}function ZW(e,t){return e.rowIndex===t.rowIndex&&e.centerY===t.centerY&&e.labelSide===t.labelSide&&e.labelBox.x===t.labelBox.x&&e.labelBox.y===t.labelBox.y&&e.labelBox.width===t.labelBox.width&&e.labelBox.height===t.labelBox.height}var Cs=class extends Map{constructor(t,n=eX){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(JW(this,t),n)}delete(t){return super.delete(QW(this,t))}};function pb({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function JW({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function QW({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function eX(e){return e!==null&&typeof e=="object"?e.valueOf():e}function dp(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 pp(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}var hb=Symbol("implicit");function hp(){var e=new Cs,t=[],n=[],r=hb;function i(o){let s=e.get(o);if(s===void 0){if(r!==hb)return r;e.set(o,s=t.push(o)-1)}return n[s%n.length]}return i.domain=function(o){if(!arguments.length)return t.slice();t=[],e=new Cs;for(let s of o)e.has(s)||e.set(s,t.push(s)-1);return i},i.range=function(o){return arguments.length?(n=Array.from(o),i):n.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return hp(t,n).unknown(r)},pp.apply(i,arguments),i}function zl(){var e=hp().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,o,s,a=!1,l=0,c=0,u=.5;delete e.unknown;function f(){var d=t().length,p=i<r,m=p?i:r,g=p?r:i;o=(g-m)/Math.max(1,d-l+c*2),a&&(o=Math.floor(o)),m+=(g-m-o*(d-l))*u,s=o*(1-l),a&&(m=Math.round(m),s=Math.round(s));var E=dp(d).map(function(x){return m+o*x});return n(p?E.reverse():E)}return e.domain=function(d){return arguments.length?(t(d),f()):t()},e.range=function(d){return arguments.length?([r,i]=d,r=+r,i=+i,f()):[r,i]},e.rangeRound=function(d){return[r,i]=d,r=+r,i=+i,a=!0,f()},e.bandwidth=function(){return s},e.step=function(){return o},e.round=function(d){return arguments.length?(a=!!d,f()):a},e.padding=function(d){return arguments.length?(l=Math.min(1,c=+d),f()):l},e.paddingInner=function(d){return arguments.length?(l=Math.min(1,d),f()):l},e.paddingOuter=function(d){return arguments.length?(c=+d,f()):c},e.align=function(d){return arguments.length?(u=Math.max(0,Math.min(1,d)),f()):u},e.copy=function(){return zl(t(),[r,i]).round(a).paddingInner(l).paddingOuter(c).align(u)},pp.apply(f(),arguments)}var Px=class e{constructor(t,n,r){M(this,"bandwidthPx");M(this,"stepPx");M(this,"d3");this.bandwidthPx=t,this.stepPx=n,this.d3=r}static fixedRow(t){return new e(t.bandwidth,t.step)}static forRows(t){let n=Array.from({length:t.count},(i,o)=>String(o)),r=zl().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}},tX={bandwidth:56,step:64};function mb(){return Px.fixedRow(tX)}var gb=8;function yb(e,t,n,r,i){let{theme:o,styleCtx:s}=t,{cal:a,calendar:l,schedule:c}=n,u=c.plan,{originX:f,scale:d}=r.axis,{timeline:p}=r,m=Ud(e,{theme:o,cal:a,schedule:c,timeline:p,scale:d,calendar:l,axisColumns:new Is(n,d),bandScale:mb(),waves:u?yS(u,d,f,jn(t.locale).waveBackgroundItem,up(c)):void 0},{chartTopY:0,chartBottomY:0,swimlaneBottomY:0},{footnotes:qd(e.content.footnotes),markerRowPlacements:new Map(r.markers.placements)});for(let T of r.markers.datePinned){let O=m.markerRowPlacements.get(T.id);O&&(m.entityLeftEdges.set(T.id,T.centerX),m.entityRightEdges.set(T.id,T.centerX),m.entityMidpoints.set(T.id,{x:T.centerX,y:O.centerY}))}let g=new Map(m.entityLeftEdges),E=new Map(m.entityRightEdges),x=new Map(m.entityMidpoints),y=()=>{m.entityLeftEdges=new Map(g),m.entityRightEdges=new Map(E),m.entityMidpoints=new Map(x),m.placedItems=new Map,m.itemFlowKey=new Map,m.currentFlowKey="",m.waves&&Bd(m.waves,m.entityLeftEdges,m.entityRightEdges)},w=[...e.content.swimlanes.values()],_=Se("swimlane",[],s),k=fk[_.spacing]??0,N=()=>{m.nextParallelId=0,m.nextGroupId=0;let T=[],O=m.chartTopY,S=0,F=m.timeline.originX;for(let z of w){S>0&&(O+=k);let{positioned:U,usedHeight:ee,usedRightX:Y}=new Os({lane:z,bandIndex:S},i).place({x:m.timeline.originX,y:O},m);T.push(U),O+=ee,Y>F&&(F=Y),S++}return{swimlanes:T,nextY:O,maxRightX:F}},B=e.content.isolatedRegions,$,X,j=m.waves;if(j){let T,O=AS()?nX(j.ids,c,d):void 0,S=Md(j.ids.length,j.origin,j.floors,(F,z)=>(xS(j,F,z),y(),T=N(),B.length>0&&vx(B,m,T.nextY+gb,i,r.naturalChartRightX),j.pass),Ot,O);ES(j,S),X={passes:S.passes,capped:S.capped},$=T}else $=N();let D=$.swimlanes,I=$.nextY,R=WS(e.content.milestones,m);R.length>0&&(y(),m.slackCorridors=R,$=N(),D=$.swimlanes,I=$.nextY);let P=[],A=[];if(B.length>0){let T=vx(B,m,I+gb,i,r.naturalChartRightX);P=T.regions,A=T.contexts,I=T.endY}m.chartBottomY=I,m.swimlaneBottomY=I;let L=ep(e.content.milestones,m);return{ctx:m,swimlanes:D,includes:P,regionContexts:A,milestones:L,laneEntries:w,maxRightX:$.maxRightX,bottomY:I,...X?{waveSolve:X}:{}}}function nX(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 mp=class{constructor(t,n){M(this,"node");M(this,"helpers");this.node=t,this.helpers=n}get id(){return this.node.name??""}place(t,n){let{node:r}=this,{helpers:i}=this,o=Se("group",r.properties,n.styleCtx),s=Ur(r,Bl(r.properties,t.x,n),n),a=n.waves!==void 0&&r.title===void 0&&ie(r.properties,"wave")!==void 0&&ie(r.properties,"style")===void 0&&Be(r.properties,"labels").length===0,l=a?void 0:r.title??r.name,c=n.currentFlowKey;n.nextGroupId+=1,n.currentFlowKey=`${c}/group:${r.name??`group-${n.nextGroupId}`}`;let u=Rt(Be(r.properties,"after")),f=Rt(Be(r.properties,"before")),d=fd({drawn:!a,hasTitle:!!l,hasPins:!!(u||f),hasBracket:o.bracket!=="none"}),p=rp(r,{leftX:s,firstRowY:t.y+d.header+d.pad},n,i),{children:m,timeCursorX:g,timeStartX:E}=p,x=n.bandScale.step(),y=x-n.bandScale.bandwidth(),w=Math.max(x,p.packer.usedHeight())-y,_={x:E,y:t.y,width:g-E,height:d.header+d.pad+w+d.pad};t.startX=_.x,t.x=g,t.height=Math.max(t.height,_.height+y);let k=r.name;k&&(n.entityLeftEdges.set(k,_.x),n.entityRightEdges.set(k,g)),n.currentFlowKey=c;let N=a?[]:$d({box:_,afterDate:u,beforeDate:f,title:l});return{kind:"group",id:k,title:l,box:_,headerHeight:d.header,children:m,style:o,inlineDatePins:N.length>0?N:void 0,...a?{waveOnly:!0}:{}}}};var gp=class{constructor(t,n){M(this,"node");M(this,"helpers");this.node=t,this.helpers=n}get id(){return this.node.name??""}place(t,n){let{node:r}=this,{helpers:i}=this,o=Se("parallel",r.properties,n.styleCtx),s=Ur(r,t.x,n),a=Rt(Be(r.properties,"after")),l=Rt(Be(r.properties,"before")),c=r.title??r.name,u=fd({drawn:!0,hasTitle:!!c,hasPins:!!(a||l),hasBracket:o.bracket!=="none"}),f=t.y+u.header+u.pad,d=[],p=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY,g=0,E=n.currentFlowKey;n.nextParallelId+=1;let x=r.name??`parallel-${n.nextParallelId}`,y=0;for(let X of r.content){if(X.$type==="DescriptionDirective")continue;n.currentFlowKey=`${E}/par:${x}#${y}`;let j=Wl(s,f+g),D=i.sequenceOne(X,j,n);d.push(D),g+=Math.max(n.bandScale.step(),j.height),p=Math.min(p,j.startX),m=Math.max(m,j.x),y++}n.currentFlowKey=E,d.length===0&&(p=n.scale.showsNonWorking?n.scale.startX(s):s,m=p);let w=n.bandScale.step(),_=w-n.bandScale.bandwidth(),k=Math.max(w,g)-_,N={x:p,y:t.y,width:m-p,height:u.header+u.pad+k+u.pad};t.startX=N.x,t.x=m,t.height=Math.max(t.height,N.height+_);let B=r.name;B&&(n.entityLeftEdges.set(B,N.x),n.entityRightEdges.set(B,m));let $=$d({box:N,afterDate:a,beforeDate:l,title:c});return{kind:"parallel",id:B,title:c,box:N,headerHeight:u.header,children:d,style:o,inlineDatePins:$.length>0?$:void 0}}};function rX(e,t,n){return new gp(e,{sequenceOne:yp}).place(t,n)}function iX(e,t,n){return new mp(e,{sequenceOne:yp}).place(t,n)}function yp(e,t,n){if(Ve(e))return Vd(e,t,n);if(et(e))return rX(e,t,n);if($e(e))return iX(e,t,n);throw new Error(`Unknown swimlane child type: ${e.$type??"unknown"}`)}var xp=class{place(t,n,r,i){let o={sequenceOne:yp},s=oS(t,n,r),a=sS(t,n,r,s,i),l=cb(t,n,r,s,a),c=yb(n,s,a,l,o);return db(new fp(t,n,r,s,a,l,c))}};function Cx(e,t,n={}){let r=n.schedule?.resolved===t?n.schedule:Hl(e,t,{today:n.today,plan:$i(t)??null});return new xp().place(e,t,n,r)}function Ep(e){return e.toISOString().slice(0,10)}function xb(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 $x(e,t){for(let n of e)n.kind==="item"?t(n):$x(n.children,t)}function oX(e,t,n){let r=xb(e);e.textSpills&&n.push(sn(t,"NL.I1000","info",{name:r},r)),e.chipsOutside&&n.push(sn(t,"NL.I1001","info",{name:r},r)),(e.box.width<Cr||e.dotSpills||e.iconSpills||e.footnoteSpills)&&n.push(sn(t,"NL.I1002","info",{name:r},r)),e.hasOverflow&&n.push(sn(t,"NL.I1003","info",{name:r,anchor:e.overflowAnchorId},r)),Eb(e,t,n)}function Eb(e,t,n){let r=e.nonWorkingPin;if(!r)return;let i=xb(e);n.push(sn(t,"NL.I1008","info",{name:i,pin:r.pin,key:r.key,start:r.start},i))}function sn(e,t,n,r,i){return{message:rn(e,t,r),severity:n,code:t,entityId:i,lspSeverity:n==="warning"?2:3,data:{code:t,args:r}}}function wb(e,t,n){let r=e.id??e.title,i=[];$x(e.children,a=>i.push(a));for(let a of i)oX(a,t,n);let o=new Set(i.map(a=>a.box.y));o.size>1&&n.push(sn(t,"NL.I1004","info",{lane:r,rows:o.size},r)),(e.utilization?.segments.some(a=>a.classification==="red")??!1)&&n.push(sn(t,"NL.I1005","info",{lane:r},r));for(let a of e.nested)wb(a,t,n)}function Tb(e,t,n){$x(e.children,r=>{Eb(r,t,n)});for(let r of e.nested)Tb(r,t,n)}function sX(e,t,n){e.waveSolve?.capped&&n.push(sn(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={names:i};n.push(sn(t,"NL.I1006","info",o,i.length===1?i[0]:void 0))}for(let o of e.milestones){if(o.overrunByWave===void 0||o.overrunDate===void 0)continue;let s=r.find(l=>l.id===o.overrunByWave);if(!s)continue;let a=o.id??o.title;n.push(sn(t,"NL.I1007","info",{name:a,date:o.overrunDate,wave:s.id,end:Ep(s.endDate)},a))}}function Dx(e,t={}){let n=t.locale??"en-US",r=[];for(let i of e.swimlanes)wb(i,n,r);for(let i of e.includes)for(let o of i.nestedSwimlanes)Tb(o,n,r);if(sX(e,n,r),t.today){let i=t.today,o=e.timeline.startDate,s=e.timeline.endDate;(i<o||i>s)&&r.push(sn(n,"NL.W1000","warning",{date:Ep(i),start:Ep(o),end:Ep(s)}))}return r}var Bi=class extends Error{constructor(t){super(t),this.name="TimezoneError"}};function Mx(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 Bi(`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 Bi(`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 wp(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 _b=/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?)(Z|([+-])(\d{2})(?::?(\d{2}))?)$/,vb=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?$/;function Ab(e){return(ot.test(e)||_b.test(e)||vb.test(e))&&!He(e.slice(0,10))}function Fx(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(Ab(r))return;let i=ve(r);if(i)return i;let o=_b.exec(r);if(o){let s=new Date(r);if(!Number.isNaN(s.getTime())){if(o[2]==="Z")return wp(s,{kind:"utc"});let l=o[3]==="+"?1:-1,c=parseInt(o[4],10),u=o[5]!==void 0?parseInt(o[5],10):0,f=l*(c*60+u)*6e4;return wp(s,{kind:"offset",ms:f})}}return vb.test(r)?ve(r.slice(0,10))??void 0:void 0}return wp(n(),t)}}function aX(e){return e===2?"warning":e===3?"info":"error"}function kb(e,t){return{severity:aX(e.severity),code:ky(e),message:e.message,suggestion:hd(e.message),file:t,line:(e.range?.start.line??0)+1,column:(e.range?.start.character??0)+1}}function Bx(e,t){return{severity:"error",code:"parse-error",message:e.message,file:t,line:e.token?.startLine??1,column:e.token?.startColumn??1}}function Wx(e,t){return{severity:"error",code:"lex-error",message:e.message,file:t,line:e.line??1,column:e.column??1}}function Ib(e,t){if(e.syntax?.origin==="lexer")return Wx(e.syntax.error,e.sourcePath);if(e.syntax?.origin==="parser")return Bx(e.syntax.error,e.sourcePath);let n=(e.range?.start.line??e.line??0)+1,r=(e.range?.start.character??0)+1;if(!Fr(e))return{severity:e.severity,code:"include",message:e.message,file:e.sourcePath,line:n,column:1};let i=t?Ky(t,e):e.message,o=hd(i);return{severity:e.severity,code:e.code??md(e.message),message:i,...o===void 0?{}:{suggestion:o},file:e.sourcePath,line:n,column:r}}function Rb(e,t,n="warning"){return{severity:n,code:"render.warning",message:e,file:t,line:1,column:1}}function Sb(e,t){return{severity:e.severity,code:e.code,message:e.message,file:t,line:1,column:1}}var bb="__nowline_browser_noop_include__";async function Nb(e){throw new Error(`${bb}: include "${e}" was skipped \u2014 running in single-file mode.`)}function Xx(e){return e.includes(bb)}function Cb(e,t){let n=t==="image/png"?cX(e):t==="image/jpeg"?uX(e):fX(e);return n&&n.width>0&&n.height>0?n:void 0}var lX=[137,80,78,71,13,10,26,10];function Ux(e,t){return e[t]<<8|e[t+1]}function Lb(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function Ob(e,t){return e[t]|e[t+1]<<8}function Pb(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16}function Tp(e,t,n){return String.fromCharCode(...e.subarray(t,t+n))}function cX(e){if(!(e.length<24||lX.some((t,n)=>e[n]!==t))&&Tp(e,12,4)==="IHDR")return{width:Lb(e,16),height:Lb(e,20)}}function uX(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=Ux(e,t+2);if(n>=192&&n<=207&&n!==196&&n!==200&&n!==204)return t+8>=e.length?void 0:{width:Ux(e,t+7),height:Ux(e,t+5)};if(r<2)return;t+=2+r}}function fX(e){if(e.length<16||Tp(e,0,4)!=="RIFF"||Tp(e,8,4)!=="WEBP")return;let t=Tp(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:Ob(e,26)&16383,height:Ob(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+Pb(e,24),height:1+Pb(e,27)}}}var dX=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"]),pX=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"]),hX=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"]),mX=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"]),gX=new Set(["none","normal","auto","initial","inherit","unset"]);function yX(e){return e==="xlink:href"?!1:e.includes(":")||e.startsWith("data-")||e==="version"||e==="baseProfile"||e==="enable-background"}function xX(e){return e==="metadata"||e.includes(":")&&!e.startsWith("svg:")}var EX=new Set(["x","y","width","height"]);function Db(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=wX(e,n);if(i<0)break;let o=e.slice(n+1,i).trim(),s=o.endsWith("/"),a=s?o.slice(0,-1).trim():o,{name:l,attrs:c}=TX(a);t.push({kind:s?"self":"open",name:l,attrs:c}),n=i+1}return t}function wX(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 TX(e){let t=0;for(;t<e.length&&/\s/.test(e[t]);)t++;let n=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;let r=e.slice(n,t),i={};for(;t<e.length;){for(;t<e.length&&/\s/.test(e[t]);)t++;if(t>=e.length)break;let o=t;for(;t<e.length&&e[t]!=="="&&!/\s/.test(e[t]);)t++;let s=e.slice(o,t);if(t>=e.length||e[t]!=="="){s&&(i[s]="");continue}if(t++,t>=e.length)break;let a=e[t];if(a!=='"'&&a!=="'"){let c=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;i[s]=e.slice(c,t);continue}t++;let l=t;for(;t<e.length&&e[t]!==a;)t++;i[s]=e.slice(l,t),t<e.length&&t++}return{name:r,attrs:i}}function jl(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function _X(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 Mb(e,t={}){let n=t.idPrefix??"nl-logo",r=t.onWarn??(()=>{}),i=Db(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=vX(o,d=>r(`sanitizer: dropping ${d}`)),l=new Map,c=0;for(let d of i)if((d.kind==="open"||d.kind==="self")&&d.attrs&&"id"in d.attrs){let p=d.attrs.id;p&&!l.has(p)&&l.set(p,`${n}-${c++}`)}let u=[],f=[];for(let d of i)if(d.kind!=="comment"&&d.kind!=="decl"){if(d.kind==="cdata"){f[f.length-1]&&u.push(jl(d.text??""));continue}if(d.kind==="text"){if(f.length===0||f[f.length-1]){let p=(d.text??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");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"||xX(p)){d.kind==="open"&&f.push(!1);continue}if(!dX.has(p)){r(`sanitizer: dropping unknown element <${p}>`),d.kind==="open"&&f.push(!1);continue}let m=[`<${p}`],g=p==="svg"&&f.length===0,E=AX(d.attrs??{},a,r),x=Object.keys(E).sort();for(let y of x){let w=E[y];if(g&&t.stripRootSize&&EX.has(y))continue;if(/^on/i.test(y)){r(`sanitizer: dropping event handler ${y}`);continue}if(yX(y)||y==="class")continue;if(!pX.has(y)){r(`sanitizer: dropping attribute ${y}`);continue}if(y==="href"||y==="xlink:href"){let k=_X(w,l);if(k===null){r(`sanitizer: dropping external href ${w}`);continue}m.push(` ${y}="${jl(k)}"`);continue}if(y==="id"){let k=l.get(w);k&&m.push(` id="${jl(k)}"`);continue}let _=/url\(#([^)]+)\)/gi;if(/data:|javascript:|vbscript:|url\(|expression\s*\(|[\\{}]/i.test(w.replace(_,""))){r(`sanitizer: dropping suspicious value at ${y}`);continue}if(/url\(#/i.test(w)){let k=w.replace(_,(N,B)=>{let $=l.get(B);return $?`url(#${$})`:"none"});m.push(` ${y}="${jl(k)}"`);continue}m.push(` ${y}="${jl(w)}"`)}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 $b(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 _p(e){let t=Db(e).find(s=>(s.kind==="open"||s.kind==="self")&&s.name==="svg");if(!t)return;let n=t.attrs??{},r=$b(n.width),i=$b(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 Fb(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 vX(e,t){let n=[],r=e.replace(/\/\*[\s\S]*?\*\//g,""),i=/([^{}]+)\{([^{}]*)\}/g;for(let o of r.matchAll(i)){let s=o[1].trim(),a=s.split(",").map(l=>l.trim());if(s.startsWith("@")||!a.every(l=>/^\.[A-Za-z_][\w-]*$/.test(l))){t(`<style> rule ${s}`);continue}n.push({classes:a.map(l=>l.slice(1)),declarations:Fb(o[2])})}return/@[a-z-]+[^{;]*;/i.test(r)&&t("<style> at-rule"),n}function AX(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(...Fb(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)hX.has(s)?o[s]=a:!s.startsWith("-")&&!mX.has(s)&&!gX.has(a.toLowerCase())&&n(`sanitizer: dropping style property ${s}`);return o}var kX={".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".webp":"image/webp"};function IX(e){let t=e.slice(e.lastIndexOf("/")+1),n=t.lastIndexOf(".");return n>0?t.slice(n).toLowerCase():""}async function Bb(e,t,n){if(!e||!t)return;let r=IX(e),i=kX[r];if(!i){n(`unsupported logo format: ${r||"(none)"} (${e})`);return}let o;try{o=await t(e)}catch(l){let c=l instanceof Error?l.message:String(l);n(`logo file not found: ${e} (${c})`);return}let s=o.bytes,a=i==="image/svg+xml"?_p(new TextDecoder().decode(s)):Cb(s,i);if(!a){let l=i==="image/svg+xml"?"no viewBox and no pixel width/height on the root <svg>":`not a readable ${r.slice(1).toUpperCase()} header`;n(`logo could not be parsed: ${e} (${l})`);return}return{ref:e,dimensions:a,asset:o}}var RX=1,SX=0;function bX(){return Ce.parse(`memory:///stage-${++SX}.nowline`)}async function NX(e){if(e.document)return e.document;let{workspace:t}=e.services.shared,n=t.LangiumDocumentFactory.fromString(e.source,bX());return await t.DocumentBuilder.build([n],{validation:!0}),n}function LX(e){return e.origin!=="validation"||e.diagnostic.severity===RX}async function Gx(e){let t=await NX(e),n=bi(t);if(n.some(LX))return{kind:"invalid",document:t,diagnostics:n};let r=t.parseResult.value,i=await Dy(r,e.sourcePath,{services:e.services.Nowline,readFile:e.readSource}),o=e.isToleratedIncludeError??(()=>!1),s=i.diagnostics.filter(_=>_.severity==="error"&&!o(_)),a=i.diagnostics.filter(Fr),l=s.find(_=>!Fr(_));if(l)return{kind:"include-error",document:t,legacy:l,routed:[],resolved:i};if(s.length>0)return{kind:"include-error",document:t,routed:a,resolved:i};let c=[],u=await Bb(pd(r),e.assetResolver,_=>c.push(_)),{theme:f,today:d,width:p,locale:m,nonWorking:g}=e.layout,E={theme:f,today:d,width:p,locale:m,nonWorking:g},x=$i(i)??null,y=Hl(r,i,{today:d,plan:x}),w=Cx(r,i,{...E,schedule:y,logo:u?.dimensions});return{kind:"staged",document:t,ast:r,resolved:i,routed:a,logo:u,warnings:c,plan:x,schedule:y,model:w,layout:E}}var Wb=/&/g,Xb=/</g,Ub=/>/g,OX=/"/g,PX=/'/g;function tt(e){return e.replace(Wb,"&amp;").replace(Xb,"&lt;").replace(Ub,"&gt;")}function an(e){return e.replace(Wb,"&amp;").replace(Xb,"&lt;").replace(Ub,"&gt;").replace(OX,"&quot;").replace(PX,"&#39;")}function $s(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}="${an(String(i))}"`))}return n.length?` ${n.join(" ")}`:""}function H(e,t,n){return n===void 0||n===""?`<${e}${$s(t)}/>`:`<${e}${$s(t)}>${n}</${e}>`}function ae(e,t){return`<text${$s(e)}>${tt(t)}</text>`}function h(e){return Number.isFinite(e)?Number.isInteger(e)?e.toString():(Math.round(e*100)/100).toString():"0"}var DX="3 3";function vp(e,t){let n=e.waypoints;if(n.length<2)return"";let r=t.dependency.edgeStroke,i=n[n.length-1],o=n[n.length-2],s=Math.hypot(i.x-o.x,i.y-o.y);if(s===0)return"";let a=(i.x-o.x)/s,l=(i.y-o.y)/s,c=e.headWidth/2,u=e.head==="dot"?c:e.headWidth*5/7,f=s>u?[...n.slice(0,-1),{x:i.x-a*u,y:i.y-l*u}]:n.slice(0,-1),d=[MX(f,e.slack,r)],p=t.arrowhead.neutral;if(e.head==="dot")d.push(H("circle",{cx:h(i.x-a*c),cy:h(i.y-l*c),r:h(c),fill:p}));else{let m=i.x-a*u,g=i.y-l*u;d.push(H("path",{d:`M${h(m-l*c)} ${h(g+a*c)} L${h(i.x)} ${h(i.y)} L${h(m+l*c)} ${h(g-a*c)} z`,fill:p}))}return H("g",{"data-layer":"dependency"},d.join(""))}function MX(e,t,n){if(e.length<2)return"";let r={fill:"none",stroke:n,"stroke-width":1.1,"stroke-linejoin":"round"};if(!t)return H("path",{d:BX(e,id),...r});let{solid:i,dotted:o}=FX(e,id);return(i?H("path",{d:i,...r}):"")+(o?H("path",{d:o,...r,"stroke-dasharray":DX,"stroke-linecap":"round"}):"")}function FX(e,t){let n=e.length,r=[],i=[],o=[];for(let a=1;a<n-1;a++){let l=e[a-1],c=e[a],u=e[a+1],f=Math.hypot(c.x-l.x,c.y-l.y),d=Math.hypot(u.x-c.x,u.y-c.y),p=Math.min(t,f/2,d/2),m={x:Math.sign(c.x-l.x),y:Math.sign(c.y-l.y)},g={x:Math.sign(u.x-c.x),y:Math.sign(u.y-c.y)};r[a]={x:c.x-m.x*p,y:c.y-m.y*p},i[a]={x:c.x+g.x*p,y:c.y+g.y*p},p>0&&o.push(`M${h(r[a].x)} ${h(r[a].y)} Q${h(c.x)} ${h(c.y)} ${h(i[a].x)} ${h(i[a].y)}`)}let s=[];for(let a=0;a<n-1;a++){let l=a===0?e[0]:i[a],c=a===n-2?e[n-1]:r[a+1],u=`M${h(l.x)} ${h(l.y)} L${h(c.x)} ${h(c.y)}`;Math.abs(e[a+1].y-e[a].y)<1e-9?s.push(u):o.push(u)}return{solid:o.join(" "),dotted:s.join(" ")}}function BX(e,t){if(e.length<2)return"";let n=[`M${h(e[0].x)} ${h(e[0].y)}`];for(let r=1;r<e.length;r++){let i=e[r-1],o=e[r];if(r===e.length-1){n.push(`L${h(o.x)} ${h(o.y)}`);continue}let s=e[r+1],a=Math.sign(o.x-i.x),l=Math.sign(o.y-i.y),c=Math.sign(s.x-o.x),u=Math.sign(s.y-o.y),f=Math.hypot(o.x-i.x,o.y-i.y),d=Math.hypot(s.x-o.x,s.y-o.y),p=Math.min(t,f/2,d/2);if(p<=0||a!==0&&c!==0||l!==0&&u!==0){n.push(`L${h(o.x)} ${h(o.y)}`);continue}let m={x:o.x-a*p,y:o.y-l*p},g={x:o.x+c*p,y:o.y+u*p};n.push(`L${h(m.x)} ${h(m.y)}`),n.push(`Q${h(o.x)} ${h(o.y)} ${h(g.x)} ${h(g.y)}`)}return n.join(" ")}function Gb(e,t,n,r){if(e.entries.length===0)return"";let i=n.footnotePanel.fill,o=n.footnotePanel.border,s=n.footnotePanel.header,a=n.footnotePanel.title,l=n.footnotePanel.description,c=n.footnotePanel.number,u=[];u.push(H("rect",{x:h(e.box.x),y:h(e.box.y),width:h(e.box.width),height:h(e.box.height),rx:6,ry:6,fill:i,stroke:o,"stroke-width":1,filter:`url(#${t}-shadow-subtle)`})),u.push(ae({x:h(e.box.x+Gt),y:h(e.box.y+ty),"font-family":r.sans,"font-size":12,"font-weight":700,fill:s},"Footnotes"));let f=e.box.x+Gt;for(let d of e.entries){d.region!==void 0&&d.regionHeadingY!==void 0&&u.push(ae({x:h(f),y:h(d.regionHeadingY),"font-family":r.sans,"font-size":10,"font-weight":700,fill:s},d.region)),u.push(ae({x:h(f),y:h(d.y),"font-family":r.sans,"font-size":10,"font-weight":700,fill:c},String(d.number)));for(let p of d.titleLines)u.push(ae({x:h(p.x),y:h(p.y),"font-family":r.sans,"font-size":11,"font-weight":600,fill:a},p.text));for(let p of d.descriptionLines??[])u.push(ae({x:h(p.x),y:h(p.y),"font-family":r.sans,"font-size":11,fill:l},p.text))}return H("g",{"data-layer":"footnotes"},u.join(""))}function Hb(e,t,n,r){let i=e.box.x+e.cardBox.x,o=e.box.y+e.cardBox.y,s=e.cardBox.width,a=e.cardBox.height,l=e.style.bg==="none"?n.surface.headerBox:e.style.bg,c=n.header.cardBorder,u=H("rect",{x:h(i),y:h(o),width:h(s),height:h(a),rx:6,ry:6,fill:l,stroke:c,"stroke-width":1,filter:`url(#${t}-shadow-subtle)`}),f=i+16+(e.textInset?.x??0),d=o+(e.textInset?.y??0),p=[];e.titleLines.forEach((w,_)=>{p.push(ae({x:h(f),y:h(d+26+_*20),"font-family":r[e.style.font],"font-size":16,"font-weight":600,fill:e.style.text},w))});let m=p.join(""),g=d+26+Math.max(0,e.titleLines.length-1)*20,E=n.header.author,x=[];e.authorLines.forEach((w,_)=>{x.push(ae({x:h(f),y:h(g+18+_*14),"font-family":r[e.style.font],"font-size":11,fill:E},w))});let y=x.join("");return H("g",{"data-layer":"header","data-id":`${t}-header`},u+m+y)}function zb(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=Dr,a=ae({x:"0",y:s,"font-family":t.sans,"font-size":nd,"font-weight":400,fill:n},td)+ae({x:xl,y:s,"font-family":t.sans,"font-size":Dr,"font-weight":700,fill:n},"now")+H("rect",{x:ry,y:12,width:iy,height:Dr,fill:r})+ae({x:rd,y:s,"font-family":t.sans,"font-size":Dr,"font-weight":400,fill:n},"ine"),l=H("g",{transform:`translate(${h(i)} ${h(o)}) scale(${h(yl)})`},a);return H("a",{href:ny,target:"_blank",rel:"noopener","aria-label":"Powered by nowline"},H("g",{"data-layer":"attribution"},l))}async function jb(e,t,n,r){let i=e.assetRef??"",{x:o,y:s,width:a,height:l}=e.box,c;try{if(r.logo&&r.logo.ref===i)c=r.logo.asset;else if(t)c=await t(i);else return""}catch(d){let p=`logo file not found: ${i} (${d instanceof Error?d.message:String(d)})`;if(r.strict)throw d;return r.warn?.(p),""}let u=(c.mime??"").toLowerCase();if(u==="image/svg+xml"){let d=new TextDecoder().decode(c.bytes),p=e.intrinsic??_p(d)??{width:a,height:l},m=new Set,g=Mb(d,{idPrefix:`${n}-logo`,onWarn:E=>m.add(E.replace(/^sanitizer: dropping /,"")),stripRootSize:!0});return m.size>0&&r.warn?.(`logo ${i}: removed unsupported SVG content: ${[...m].join(", ")}`),H("svg",{"data-layer":"logo",x:h(o),y:h(s),width:h(a),height:h(l),viewBox:`0 0 ${h(p.width)} ${h(p.height)}`,preserveAspectRatio:"xMidYMid meet",overflow:"hidden"},g)}if(u==="image/png"||u==="image/jpeg"||u==="image/jpg"||u==="image/webp"){let d=WX(c.bytes);return H("image",{"data-layer":"logo",href:`data:${u};base64,${d}`,x:h(o),y:h(s),width:h(a),height:h(l),preserveAspectRatio:"xMidYMid meet"})}let f=`unsupported logo format: ${u} (${i})`;if(r.strict)throw new Error(f);return r.warn?.(f),""}function WX(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 Ap=class{constructor(t="nl"){M(this,"prefix");M(this,"counter",0);this.prefix=t}next(t){let n=`${this.prefix}-${this.counter++}`;return t?`${n}-${t}`:n}};function kp(e,t,n){let r=e.radius,i=e.center.x,o=e.center.y,s=t.anchorDiamond.fill,a=t.anchorDiamond.stroke,l=H("path",{d:`M${h(i)} ${h(o-r)} L${h(i+r)} ${h(o)} L${h(i)} ${h(o+r)} L${h(i-r)} ${h(o)} Z`,fill:s,stroke:a,"stroke-width":1.25}),c=t.anchorDiamond.label,u=e.labelSide==="left"?e.labelBox.x+e.labelBox.width:e.labelBox.x,f={x:h(u),y:h(o+4),"font-family":n.sans,"font-size":10,fill:c};e.labelSide==="left"&&(f["text-anchor"]="end");let d=e.title?ae(f,e.title):"";return H("g",{"data-layer":"anchor","data-id":e.id??null},Yb(e.hiddenDate)+l+d)}function Ip(e,t){let n=t.anchorDiamond.cutLine;return H("line",{x1:h(e.center.x),y1:h(e.center.y+e.radius+1),x2:h(e.center.x),y2:h(e.cutBottomY),stroke:n,"stroke-width":1,"stroke-dasharray":"1 3"})}function Rp(e,t,n){let r=e.center.x,i=e.center.y,o=e.radius,s=t.milestoneDiamond.cutLineOverrun,a=(m,g)=>H("path",{d:`M${h(m)} ${h(i-o)} L${h(m+o)} ${h(i)} L${h(m)} ${h(i+o)} L${h(m-o)} ${h(i)} Z`,fill:g,stroke:g,"stroke-width":1}),l=e.slip?.x,c;l!==void 0?c=a(r,s)+H("path",{d:`M${h(r+o)} ${h(i)} H${h(l-o)}`,fill:"none",stroke:s,"stroke-width":1.1,"stroke-dasharray":"3 3","stroke-linecap":"round"})+a(l,t.milestoneDiamond.fill):c=a(r,e.isOverrun?s:t.milestoneDiamond.fill);let u=e.isOverrun&&l===void 0?s:t.milestoneDiamond.label,f=e.labelSide==="left"?e.labelBox.x+e.labelBox.width:e.labelBox.x,d={x:h(f),y:h(i+4),"font-family":n.sans,"font-size":10,"font-weight":600,fill:u};e.labelSide==="left"&&(d["text-anchor"]="end");let p=e.title?ae(d,e.title):"";return H("g",{"data-layer":"milestone","data-id":e.id??null},Yb(e.hiddenDate)+c+p)}function Yb(e){return e===void 0?"":`<title>${tt(e)}</title>`}function Sp(e,t,n){let r=e.slip?.x??e.center.x,i=e.isOverrun&&e.slip===void 0?n.milestoneDiamond.cutLineOverrun:n.milestoneDiamond.cutLineNormal,o=[];if(e.onWaveBoundary||o.push(H("line",{x1:h(r),y1:h(e.center.y+e.radius+1),x2:h(r),y2:h(e.cutBottomY),stroke:i,"stroke-width":2,"stroke-dasharray":ml,"stroke-linecap":"round"})),e.slackArrows&&e.slackArrows.length>0)for(let s of e.slackArrows)o.push(H("path",{d:`M${h(s.x)} ${h(s.y)} H${h(e.center.x-6)}`,fill:"none",stroke:n.milestoneDiamond.slack,"stroke-width":1.1,"stroke-dasharray":"3 3","stroke-linecap":"round","marker-end":`url(#${t}-arrow-dark)`}));return o.join("")}var wn={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"}},XX={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"}},Vb={...wn,...XX};var pae={none:"",multiplier:"x",person:wn.person.ascii,people:wn.people.ascii,points:wn.points.ascii,time:wn.time.ascii};var UX={thin:100,light:300,normal:400,bold:700};function GX(e){return ki[e]??14}function bp(e,t,n){return{"font-family":t[e.font],"font-size":n??GX(e.textSize),"font-weight":UX[e.weight]??400,"font-style":e.italic?"italic":"normal",fill:e.text}}function HX(e){if(e.border==="dashed")return"4 3";if(e.border==="dotted")return"1 3"}function Kb(e,t,n,r,i,o={}){let s=Math.min(Ii[i.cornerRadius]??4,r/2,n/2);return H("rect",{x:h(e),y:h(t),width:h(n),height:h(r),rx:h(s),ry:h(s),fill:i.bg==="none"?"transparent":i.bg,stroke:i.fg,"stroke-width":1,"stroke-dasharray":HX(i)??null,...o})}function Np(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 zX={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 jX(e,t){let n=`${e}-shadow-${t}`,r=zX[t],i=`<feGaussianBlur in="SourceAlpha" stdDeviation="${r.stdDeviation}"/><feOffset dx="${r.dx}" dy="${r.dy}" result="offsetblur"/><feComponentTransfer><feFuncA type="linear" slope="${r.opacity}"/></feComponentTransfer><feMerge><feMergeNode/><feMergeNode in="SourceGraphic"/></feMerge>`;return H("filter",{id:n,x:"-50%",y:"-50%",width:"200%",height:"200%"},i)}function qb(e,t){return t==="none"?null:`url(#${e}-shadow-${t})`}function Zb(e){return["subtle","soft","hard"].map(t=>jX(e,t)).join("")}var YX=4,VX=8,KX=10;function Jb(e,t){return`url(#${e}-wave-hatch-${t})`}function Qb(e,t,n){let r=dy;return H("pattern",{id:`${e}-wave-hatch-${t}`,width:r,height:r,patternUnits:"userSpaceOnUse",patternTransform:"rotate(45)"},H("line",{x1:h(r/2),y1:0,x2:h(r/2),y2:r,stroke:t==="dark"?n.wave.hatch:n.wave.hatchOnDark,"stroke-width":py,opacity:fy}))}function eN(e){if(!e.waves)return[];let t=new Set,n=i=>{for(let o of i)o.kind==="item"?o.waveRole==="background"&&o.waveHatch&&t.add(o.waveHatch):n(o.children)},r=i=>{for(let o of i)n(o.children),r(o.nested)};r(e.swimlanes);for(let i of e.includes)r(i.nestedSwimlanes);for(let i of e.waveLegend?.entries??[])t.add(i.hatch);return["dark","light"].filter(i=>t.has(i))}function tN(e,t,n,r){let o=Math.min(Ii[t.cornerRadius]??4,e.height/2);return H("rect",{x:h(e.x+.5),y:h(e.y+.5),width:h(Math.max(0,e.width-2*.5)),height:h(Math.max(0,e.height-2*.5)),rx:h(o),ry:h(o),fill:Jb(r,n)})}var Hx=4;function qX(e,t){let n=Math.min(Hx-Si,e.width/2,e.height/2),r=1e-6;return{left:e.x<=t.box.x+Si+r?n:0,right:e.x+e.width>=t.box.x+t.box.width-Si-r?n:0}}function ZX(e,t){let{x:n,y:r,width:i,height:o}=e,s=(a,l,c)=>a>0?` A${h(a)} ${h(a)} 0 0 1 ${h(l)} ${h(c)}`:"";return`M${h(n+t.left)} ${h(r)} H${h(n+i-t.right)}`+s(t.right,n+i,r+t.right)+` V${h(r+o-t.right)}`+s(t.right,n+i-t.right,r+o)+` H${h(n+t.left)}`+s(t.left,n,r+o-t.left)+` V${h(r+t.left)}`+s(t.left,n+t.left,r)+" Z"}function zx(e,t,n){let r=o=>n&&(n.left>0||n.right>0)?H("path",{d:ZX(t,n),...o}):H("rect",{x:h(t.x),y:h(t.y),width:h(t.width),height:h(t.height),...o}),i=r({fill:e.style.stripFill});return e.style.tint?i+r({fill:e.style.tint,"fill-opacity":El}):i}function nN(e,t){let n=e.timeline,r=n.waveStrip;if(!e.waves||!r)return"";let i=[H("rect",{x:h(n.box.x),y:h(r.y),width:h(n.box.width),height:h(r.height),rx:Hx,ry:Hx,fill:t.timeline.panelFill,stroke:t.timeline.border,"stroke-width":1})];for(let o of e.waves){let s=o.strip.cell;s&&i.push(H("g",{"data-id":o.id},`<title>${tt(o.strip.tooltip)}</title>${zx(o,s,qX(s,n))}`))}return H("g",{"data-layer":"wave-strip"},i.join(""))}function Lp(e,t){let n=[];for(let r of e){if(!r.style.tint||r.empty)continue;let i=t?Np(r.columnBox,t):r.columnBox;!i||i.width<=0||i.height<=0||n.push(H("rect",{x:h(i.x),y:h(i.y),width:h(i.width),height:h(i.height),fill:r.style.tint,"fill-opacity":hy}))}return n.length===0?"":H("g",{"data-layer":"wave-bg"},n.join(""))}function Op(e,t){let n=[];for(let r of e??[]){let i=r.topY,o=r.bottomY;t&&(r.x<=t.x||r.x>=t.x+t.width||(i=Math.max(i,t.y),o=Math.min(o,t.y+t.height),o<=i))||n.push(H("line",{x1:h(r.x),y1:h(i),x2:h(r.x),y2:h(o),stroke:r.stroke,"stroke-width":cy,"stroke-dasharray":r.dash}))}return n.length===0?"":H("g",{"data-layer":"wave-boundary"},n.join(""))}function rN(e,t,n){let i=e.timeline.waveStrip;if(!e.waves||!i)return"";let o=i.y+i.height/2+YX,s=[],a=(l,c,u)=>H("rect",{x:h(u.x),y:h(u.y),width:h(u.width),height:h(u.height),fill:t.timeline.panelFill})+ae({x:h(l),y:h(o),"font-family":n.sans,"font-size":Un,"font-style":"italic",fill:t.wave.labelMuted,"text-anchor":"middle"},c);for(let l of e.waves){if(l.strip.gapLabel){let{text:d,x:p,halo:m}=l.strip.gapLabel;s.push(a(p,d,m))}if(!l.strip.cell)continue;let{labelDraw:c,superscripts:u,inlineDatePin:f}=l.strip;if(f&&s.push(Yl([f],l.style.text)),u&&s.push(zx(l,u.halo)),l.strip.label!==void 0&&c&&(s.push(zx(l,c.halo)),s.push(ae({x:h(c.x),y:h(o),"font-family":n.sans,"font-size":Un,"font-weight":600,fill:l.style.text,"text-anchor":"middle"},l.strip.label))),u){let d=u.rightX;for(let p=l.footnoteIndicators.length-1;p>=0;p--)s.push(ae({x:h(d),y:h(i.y+KX),"font-family":n.sans,"font-size":VX,"font-weight":700,fill:l.style.text,"text-anchor":"end"},String(l.footnoteIndicators[p]))),d-=Xt}}return s.length===0?"":H("g",{"data-layer":"wave-labels"},s.join(""))}function Pp(e){if(!e||e.length===0)return"";let t=e.map(n=>H("line",{x1:h(n.x),y1:h(n.topY),x2:h(n.x),y2:h(n.bottomY),stroke:n.stroke,"stroke-width":1,"stroke-dasharray":uy}));return H("g",{"data-layer":"wave-cross"},t.join(""))}function JX(e){let t=e.entities.item.bg;return t==="none"?"transparent":t}function iN(e,t,n,r){if(!e)return"";let i=[];for(let o of e.entries){let s=o.swatch,a=JX(n),l={x:h(s.x),y:h(s.y),width:h(s.width),height:h(s.height)};i.push(H("rect",{...l,rx:2,ry:2,fill:a,stroke:n.entities.item.fg,"stroke-width":1})),i.push(H("rect",{x:h(s.x+.5),y:h(s.y+.5),width:h(s.width-1),height:h(s.height-1),rx:2,ry:2,fill:Jb(t,o.hatch)}));for(let c of o.runs)i.push(ae({x:h(c.x),y:h(c.y),"font-family":r.sans,"font-size":Un,fill:n.wave.labelText},c.text))}return H("g",{"data-layer":"wave-legend"},i.join(""))}function oN(e,t){let n=e;for(let r of t.iconDxTerms??[])n+=r;return n}function jx(e,t,n,r,i,o){let s=t,{text:a,icon:l}=e,c={"font-family":i,"font-size":r,fill:o};if(!l)return ae({x:h(s),y:h(n),...c},a);if(l.kind==="builtin"&&l.name==="multiplier")return ae({x:h(s),y:h(n),...c},`${a}\xD7`);if(l.kind==="builtin"){let f=wn[l.name],d=ae({x:h(s),y:h(n),...c},a),p=r,m=oN(t,e),g=n-r*.85,E=`<svg x="${h(m)}" y="${h(g)}" width="${h(p)}" height="${h(p)}" viewBox="${f.viewBox}" style="color:${an(o)}" aria-hidden="true">${f.body}</svg>`;return d+E}let u=h(r*.1);return`<text x="${h(s)}" y="${h(n)}" font-family="${an(i)}" font-size="${r}" fill="${an(o)}">${tt(a)}<tspan dx="${u}">${tt(l.text)}</tspan></text>`}function QX(e){let{metaText:t,capacity:n,x:r,baselineY:i,fontSize:o,fontFamily:s,color:a}=e;if(!t&&!n)return"";let l={"font-family":s,"font-size":o,fill:a};if(!n)return ae({x:h(r),y:h(i),...l},t);if(!t)return jx(n,r,i,o,s,a);let c=h(o*ss),u=`<text x="${h(r)}" y="${h(i)}" font-family="${an(s)}" font-size="${o}" fill="${an(a)}">`,{text:f,icon:d}=n;if(!d)return u+tt(t)+`<tspan dx="${c}">${tt(f)}</tspan></text>`;if(d.kind==="builtin"&&d.name==="multiplier")return u+tt(t)+`<tspan dx="${c}">${tt(f)}\xD7</tspan></text>`;if(d.kind==="literal"){let k=h(o*.1);return u+tt(t)+`<tspan dx="${c}">${tt(f)}</tspan><tspan dx="${k}">${tt(d.text)}</tspan></text>`}let p=n.iconDxTerms??[],m=r;for(let k of p.slice(0,2))m+=k;let g=wn[d.name],E=o,x=oN(r,n),y=i-o*.85,w=u+tt(t)+"</text>"+ae({x:h(m),y:h(i),...l},f),_=`<svg x="${h(x)}" y="${h(y)}" width="${h(E)}" height="${h(E)}" viewBox="${g.viewBox}" style="color:${an(a)}" aria-hidden="true">${g.body}</svg>`;return w+_}function eU(e,t){let n=Vb.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:${an(t)}" aria-hidden="true">${n.body}</svg>`,i=`<title>${tt(e.isoDate)}</title>`;return H("g",{"data-layer":"inline-date-pin","data-side":e.side,"data-date":e.isoDate,"data-spilled":e.spilled?"true":null},i+r)}function Yl(e,t){return!e||e.length===0?"":e.map(n=>eU(n,t)).join("")}function sN(e){return e?.some(t=>t.side==="after")??!1}function tU(e){let t=[];return e.titleTruncated&&t.push(e.title),e.waveTooltip!==void 0&&t.push(e.waveTooltip),t.length>0?`<title>${tt(t.join(`
2920
- `))}</title>`:""}function nU(e,t){let n=[],r=qb(t,e.style.shadow);return n.push(Kb(e.box.x,e.box.y,e.box.width,e.box.height,e.style,{filter:r??null})),e.waveRole==="background"&&e.waveHatch&&n.push(tN(e.box,e.style,e.waveHatch,t)),n.join("")}function rU(e){if(e.progressFraction>0){let t=Math.max(0,Math.min(e.box.width,e.box.width*e.progressFraction));return H("rect",{x:h(e.box.x),y:h(e.box.y+e.box.height-nn),width:h(t),height:nn,fill:e.style.fg,opacity:.55})}return""}function iU(e){let t=e.dotSpills&&e.dotSpillCx!==null?e.dotSpillCx:e.box.x+e.box.width-vi;return H("circle",{cx:h(t),cy:h(e.box.y+Xg),r:Lr,fill:e.statusDotColor})}function oU(e,t){let n;if(e.textSpills)n=e.box.x+e.box.width+Bn,e.iconSpills&&(n+=Pr+Wt);else{let r=!!e.linkIcon&&e.linkIcon!=="none",o=e.inlineDatePins?.find(s=>s.side==="after"&&!s.spilled)?ds(r,{barWidth:e.box.width}):ds(!t.noLinks&&r&&!e.iconSpills);n=e.box.x+o}return n}function sU(e,t,n,r){let i=[],o=e.style.text,s=n.entities.item.text,a=e.textSpills?s:o,l=e.textSpills?s:e.style.fg,c=e.titleLines??(e.title?[e.title]:[]);return c.forEach((u,f)=>{u!==""&&i.push(ae({x:h(t),y:h(e.box.y+Vf+f*al),"font-family":r[e.style.font],"font-size":Or,"font-weight":600,fill:a},u))}),(e.metaText||e.capacity)&&i.push(QX({metaText:e.metaText,capacity:e.capacity,x:t,baselineY:e.box.y+Kf(c.length),fontSize:sl,fontFamily:r[e.style.font],color:l})),i.join("")}function aU(e,t,n){let r=[],i=t.entities.item.text;if(e.footnoteIndicators.length>0){let o=e.box.y+Ug;if(e.footnoteSpills&&e.footnoteSpillStartX!==null){let s=e.footnoteSpillStartX;for(let a=0;a<e.footnoteIndicators.length;a++){let l=e.footnoteIndicators[a];r.push(ae({x:h(s),y:h(o),"font-family":n.sans,"font-size":ll,"font-weight":700,fill:i},String(l))),s+=Xt}}else{let s=e.box.x+e.box.width-fs;for(let a=e.footnoteIndicators.length-1;a>=0;a--){let l=e.footnoteIndicators[a];r.push(ae({x:h(s),y:h(o),"font-family":n.sans,"font-size":ll,"font-weight":700,fill:e.style.text,"text-anchor":"end"},String(l))),s-=Xt}}}return r.join("")}function lU(e,t,n){let r=[];if(!t.noLinks&&e.linkIcon&&e.linkIcon!=="none"){let i={linear:"#5e6ad2",github:"#0f172a",jira:"#0052cc",generic:n.item.linkIconFg},o=i[e.linkIcon]??i.generic,s=Pr,a=e.iconSpills&&e.iconSpillX!==null?e.iconSpillX:e.box.x+Ai,l=e.box.y+Ai,c=H("rect",{x:h(a),y:h(l),width:s,height:s,rx:2,ry:2,fill:o}),u=a,f=l,d=H("path",{d:`M${h(u+4)} ${h(f+10)} L${h(u+10)} ${h(f+4)} M${h(u+6)} ${h(f+4)} H${h(u+10)} V${h(f+8)}`,stroke:"#ffffff",fill:"none","stroke-width":1.1,"stroke-linecap":"round","stroke-linejoin":"round"}),p=c+d,m=e.linkHref?H("a",{href:e.linkHref,target:"_blank",rel:"noopener"},p):p;r.push(m)}return r.join("")}function cU(e,t,n){let r=[];if(e.hasOverflow&&e.overflowBox){let i=t.item.overflowTailFill,o=t.item.overflowTailStroke,s=t.item.overflowCaption;r.push(H("rect",{x:h(e.overflowBox.x),y:h(e.overflowBox.y),width:h(e.overflowBox.width),height:h(e.overflowBox.height),fill:i,stroke:o,"stroke-width":1})),e.overflowAnchorId&&e.overflowBox.width>60&&r.push(ae({x:h(e.overflowBox.x+e.overflowBox.width/2),y:h(e.overflowBox.y+e.overflowBox.height/2+3),"font-family":n.sans,"font-size":9,"font-weight":700,fill:s,"text-anchor":"middle"},`past ${e.overflowAnchorId}`))}return r.join("")}function uU(e,t){let n=[];for(let r of e.labelChips){let i=Math.min(Ii[r.style.cornerRadius]??8,r.box.height/2);n.push(H("rect",{x:h(r.box.x),y:h(r.box.y),width:h(r.box.width),height:h(r.box.height),rx:h(i),ry:h(i),fill:r.style.bg==="none"?"transparent":r.style.bg,stroke:r.style.fg,"stroke-width":.5})),n.push(ae({x:h(r.box.x+r.box.width/2),y:h(r.box.y+r.box.height/2+3),...bp(r.style,t,ki.xs),"text-anchor":"middle"},r.text))}return n.join("")}function aN(e,t,n,r,i){let o=[];return o.push(tU(e)),o.push(nU(e,n)),o.push(rU(e)),o.push(iU(e)),o.push(Yl(e.inlineDatePins,e.style.fg)),o.push(sU(e,oU(e,t),r,i)),o.push(aU(e,r,i)),o.push(lU(e,t,r)),o.push(cU(e,r,i)),o.push(uU(e,i)),H("g",{"data-layer":"item","data-id":e.id??null},o.join(""))}function fU(e,t,n,r,i,o){let s=[];if(!(e.kind==="group"&&e.waveOnly)){let l=e.box.y+e.headerHeight,c=e.box.height-e.headerHeight;if(e.style.bg!=="none"){let f=t<=wy;s.push(H("rect",{x:h(e.box.x),y:h(l),width:h(e.box.width),height:h(c),fill:f?e.style.bg:"none","fill-opacity":f?t===1?xy:Ey: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+wl,d=e.box.x,p=e.box.x+e.box.width;s.push(H("path",{d:`M${h(d)} ${h(l)} V${h(f)} H${h(p)} V${h(l)}`,fill:"none",stroke:u,"stroke-width":1.2,"stroke-dasharray":e.style.bracket==="dashed"?"3 2":null}))}e.title&&e.headerHeight>0&&s.push(ae({x:h(ys(e.box.x,sN(e.inlineDatePins))),y:h(e.box.y+yy),...bp(e.style,o,ud),"font-weight":600,fill:u},e.title)),s.push(Yl(e.inlineDatePins,e.style.fg))}for(let l of e.children)s.push(cN(l,n,r,i,o,t));return H("g",{"data-layer":e.kind,"data-id":e.id??null},s.join(""))}function cN(e,t,n,r,i,o=0){return e.kind==="item"?aN(e,t,n,r,i):fU(e,o+1,t,n,r,i)}var lN=2;function dU(e,t){switch(e){case"green":return t.swimlane.utilizationOk;case"yellow":return t.swimlane.utilizationWarn;case"red":return t.swimlane.utilizationOver}}function pU(e,t){if(!e.utilization||e.utilization.segments.length===0)return"";let n=e.box.y+e.box.height-lN,r=e.utilization.segments.map(i=>{let o=i.endX-i.startX;return o<=0?"":H("rect",{x:h(i.startX),y:h(n),width:h(o),height:lN,fill:dU(i.classification,t),"data-utilization":i.classification,"data-load":h(i.load)})});return H("g",{"data-layer":"lane-utilization","data-id":e.id??null},r.join(""))}function uN(e,t){let n=e.bandIndex%2===0?t.swimlane.rowTintEven:t.swimlane.rowTintOdd,r=t.swimlane.border;return H("g",{"data-layer":"swimlane-bg","data-id":e.id??null},H("rect",{x:h(e.box.x),y:h(e.box.y),width:h(e.box.width),height:h(e.box.height),fill:n,stroke:r,"stroke-width":1}))}function Cp(e,t,n,r,i){let o=r.swimlane.tabFill,s=r.swimlane.tabStroke,a=r.swimlane.tabText,l=r.swimlane.ownerText,c=r.swimlane.footnoteIndicator,u=[],f=e.tab;if(f){let p=e.footnoteIndicators.length>0?e.footnoteIndicators.join(","):"",m=pl,g=e.box.y+10,E=g+hl;if(u.push(H("rect",{x:h(f.tabX),y:h(g),width:h(f.tabW),height:h(m),rx:4,ry:4,fill:o,stroke:s,"stroke-width":1})),u.push(ae({x:h(f.titleX),y:h(E),"font-family":i[e.style.font],"font-size":12,"font-weight":600,fill:a},e.title)),e.owner){let x=wn[e.ownerKind==="person"?"person":"people"],y=Tl;u.push(`<svg x="${h(f.ownerX)}" y="${h(E-y*.85)}" width="${h(y)}" height="${h(y)}" viewBox="${x.viewBox}" style="color:${an(l)}" aria-hidden="true">${x.body}</svg>`),u.push(ae({x:h(f.ownerTextX),y:h(E),"font-family":i[e.style.font],"font-size":10,fill:l},e.owner))}e.capacity&&u.push(jx(e.capacity,f.badgeX,E,10,i[e.style.font],l)),p&&u.push(ae({x:h(f.footnoteRightX),y:h(g+14),"font-family":i.sans,"font-size":10,"font-weight":700,fill:c,"text-anchor":"end"},p))}for(let d of e.children)u.push(cN(d,t,n,r,i));return u.push(pU(e,r)),H("g",{"data-layer":"swimlane","data-id":e.id??null},u.join(""))}function dN(e,t,n){let r=n.timeline.gridLine,i=n.timeline.minorGridLine,o=e.bottomTickPanelHeight??0,s=e.bottomTickPanelY!==void 0&&o>0,a=e.tickPanelY,l=s?e.bottomTickPanelY+o:e.box.y+e.box.height,c=t,u=e.box.y+e.box.height,f=[];for(let d of e.ticks)if(d.major)f.push(H("line",{x1:h(d.x),y1:h(a),x2:h(d.x),y2:h(l),stroke:r,"stroke-width":1}));else if(e.minorGrid){if(d.labelX===void 0)continue;f.push(H("line",{x1:h(d.x),y1:h(c),x2:h(d.x),y2:h(u),stroke:i,"stroke-width":1}))}for(let d of e.nonWorking??[])d.seam&&f.push(H("line",{x1:h(d.x),y1:h(c),x2:h(d.x),y2:h(u),stroke:n.timeline.nonWorkingSeam,"stroke-width":1,"stroke-dasharray":"1 3"}));return H("g",{"data-layer":"grid"},f.join(""))}function $p(e,t,n,r){let i=e.box.y+e.box.height,o=[];for(let s of e.nonWorking??[]){if(!s.band)continue;let a={x:s.x,y:t,width:s.width,height:i-t},l=r?Np(a,r):a;!l||l.width<=0||l.height<=0||o.push(H("rect",{x:h(l.x),y:h(l.y),width:h(l.width),height:h(l.height),fill:n.timeline.nonWorkingFill,"fill-opacity":ay}))}return o.length===0?"":H("g",{"data-layer":"non-working"},o.join(""))}function pN(e,t,n){let r=e.box.y+e.box.height,i=[];for(let o of e.nonWorking??[])o.label===void 0||!o.labelBox||(o.cut&&i.push(H("line",{x1:h(o.x),y1:h(o.labelBox.y+4),x2:h(o.x),y2:h(r),stroke:t.timeline.nonWorkingSeam,"stroke-width":1,"stroke-dasharray":"1 3"})),i.push(fN(o.label,o.labelBox,o.labelSide,t,n)));for(let o of e.workingExceptions??[])o.labelBox&&i.push(fN(o.label,o.labelBox,o.labelSide,t,n));return i.length===0?"":H("g",{"data-layer":"non-working-label"},i.join(""))}function fN(e,t,n,r,i){let o=n==="left",s=t.y+4,a={x:h(o?t.x+t.width:t.x),y:h(s+4),"font-family":i.sans,"font-size":10,fill:r.timeline.labelText};return o&&(a["text-anchor"]="end"),ae(a,e)}function hN(e,t,n){let r=t.timeline.panelFill,i=t.timeline.border,o=t.timeline.labelText,s=[],a=e.tickPanelY,l=e.tickPanelHeight,c=l>0,u=e.markerRow.height>0,f=e.waveStrip?e.waveStrip.y+e.waveStrip.height:a+l,d=e.markerRow.height,p=e.bottomTickPanelY,m=e.bottomTickPanelHeight??0,g=p!==void 0&&m>0;c&&s.push(H("rect",{x:h(e.box.x),y:h(a),width:h(e.box.width),height:h(l),rx:4,ry:4,fill:r,stroke:i,"stroke-width":1})),u&&s.push(H("rect",{x:h(e.box.x),y:h(f),width:h(e.box.width),height:h(d),rx:4,ry:4,fill:r,stroke:i,"stroke-width":1})),g&&s.push(H("rect",{x:h(e.box.x),y:h(p),width:h(e.box.width),height:h(m),rx:4,ry:4,fill:r,stroke:i,"stroke-width":1}));for(let E of e.ticks)E.major&&(!E.label||E.labelX===void 0||(c&&s.push(ae({x:h(E.labelX),y:h(a+dl(l)),"font-family":n.sans,"font-size":Ri,fill:o,"text-anchor":"middle"},E.label)),g&&s.push(ae({x:h(E.labelX),y:h(p+dl(m)),"font-family":n.sans,"font-size":Ri,fill:o,"text-anchor":"middle"},E.label))));return H("g",{"data-layer":"timeline"},s.join(""))}function mN(e,t,n,r,i,o){let s=r.includeRegion.border,a=r.includeRegion.fill,l=r.includeRegion.tabFill,c=r.includeRegion.tabStroke,u=r.includeRegion.tabText,f=r.includeRegion.badgeFill,d=r.includeRegion.badgeStroke,p=r.includeRegion.badgeText,m=e.box.x+8,g=e.box.y,E=e.box.width-16,x=e.box.height,y=H("rect",{x:h(m),y:h(g),width:h(E),height:h(x),rx:8,ry:8,fill:a,stroke:s,"stroke-width":1,"stroke-dasharray":ml}),w=pl,_=_l(e.box.x,e.label,e.sourcePath),k=g-w/2,N=H("rect",{x:h(_.tabX),y:h(k),width:h(_.tabWidth),height:w,rx:4,ry:4,fill:l,stroke:c,"stroke-width":1}),B=ae({x:h(_.tabLabelX),y:h(k+hl),"font-family":i.sans,"font-size":11,"font-weight":600,fill:u},e.label),$=_.badgeX,X=_.badgeSize,j=g-X/2,D=H("rect",{x:h($),y:h(j),width:X,height:X,rx:4,ry:4,fill:f,stroke:d,"stroke-width":1}),I=H("path",{d:`M${h($+7)} ${h(j+4)} H${h($+14)} V${h(j+11)} M${h($+4)} ${h(j+7)} H${h($+11)} V${h(j+14)} H${h($+4)} Z`,stroke:p,"stroke-width":1.4,fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}),R=9,P=g+4,A=H("rect",{x:h(_.sourceHaloX),y:h(P-R),width:h(_.sourceHaloWidth),height:R+6,fill:a}),L=ae({x:h(_.sourceTextX),y:h(P),"font-family":i.mono,"font-size":R,fill:p},e.sourcePath),T={x:m,y:g,width:E,height:x},O=o?$p(o.timeline,o.chartBox.y,r,T):"",S=o?.waves?Lp(o.waves,T)+Op(o.waveBoundaries,T):"",F=o?.waves?Pp(e.waveCrossings):"",z=e.nestedSwimlanes.map(v=>Cp(v,t,n,r,i)).join(""),U=(e.edges??[]).map(v=>vp(v,r)).join(""),ee=e.anchors??[],Y=e.milestones??[],ne=ee.map(v=>Ip(v,r)).join("")+Y.map(v=>Sp(v,n,r)).join("")+ee.map(v=>kp(v,r,i)).join("")+Y.map(v=>Rp(v,r,i)).join("");return H("g",{"data-layer":"include"},y+O+S+U+z+F+ne+N+B+D+I+A+L)}function gN(e,t,n){if(!e)return"";let r=t.nowline.stroke,i=t.nowline.labelText,o=H("line",{x1:h(e.x),y1:h(e.topY),x2:h(e.x),y2:h(e.bottomY),stroke:r,"stroke-width":Qf}),s=hU(e,r),a=mU(e,i,n);return H("g",{"data-layer":"nowline"},o+s+a)}function yN(e){let t=Qf/2;return e.pillMode==="flag-right"?e.x-t:e.pillMode==="flag-left"?e.x+t:e.x}function hU(e,t){let n=e.pillTopY,r=e.pillTopY+Ut,i=Zg,o=e.pillWidth;if(e.pillMode==="center")return H("rect",{x:h(e.x-o/2),y:h(n),width:h(o),height:h(Ut),rx:i,ry:i,fill:t});let s=yN(e);if(e.pillMode==="flag-right"){let c=s+o,u=[`M ${h(s)} ${h(n)}`,`L ${h(c-i)} ${h(n)}`,`A ${i} ${i} 0 0 1 ${h(c)} ${h(n+i)}`,`L ${h(c)} ${h(r-i)}`,`A ${i} ${i} 0 0 1 ${h(c-i)} ${h(r)}`,`L ${h(s)} ${h(r)}`,"Z"].join(" ");return H("path",{d:u,fill:t})}let a=s-o,l=[`M ${h(s)} ${h(n)}`,`L ${h(a+i)} ${h(n)}`,`A ${i} ${i} 0 0 0 ${h(a)} ${h(n+i)}`,`L ${h(a)} ${h(r-i)}`,`A ${i} ${i} 0 0 0 ${h(a+i)} ${h(r)}`,`L ${h(s)} ${h(r)}`,"Z"].join(" ");return H("path",{d:l,fill:t})}function mU(e,t,n){let r=e.pillTopY+Jg,i=yN(e),o,s;return e.pillMode==="center"?(o=e.x,s="middle"):e.pillMode==="flag-right"?(o=i+hs,s="start"):(o=i-hs,s="end"),ae({x:h(o),y:h(r),"font-family":n.sans,"font-size":gl,"font-weight":700,fill:t,"text-anchor":s},e.label)}async function Yx(e,t={}){let r=new Ap(t.idPrefix??"nl").next("root"),i=e.palette,o=t.fontFamilies??sy,s=[],a=(u,f)=>`<marker id="${u}" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" fill="${f}"/></marker>`,l=`<defs>${Zb(r)}`+a(`${r}-arrow-dark`,i.arrowhead.dark)+eN(e).map(u=>Qb(r,u,i)).join("")+"</defs>";s.push(l),s.push(H("rect",{x:0,y:0,width:h(e.width),height:h(e.height),fill:e.backgroundColor})),s.push(hN(e.timeline,i,o)),s.push(nN(e,i));for(let u of e.swimlanes)s.push(uN(u,i));s.push($p(e.timeline,e.chartBox.y,i)),e.waves&&s.push(Lp(e.waves)),s.push(dN(e.timeline,e.chartBox.y,i)),s.push(Op(e.waveBoundaries)),s.push(rN(e,i,o));for(let u of e.edges)s.push(vp(u,i));for(let u of e.swimlanes)s.push(Cp(u,t,r,i,o));for(let u of e.includes)s.push(mN(u,t,r,i,o,e));s.push(Pp(e.waveCrossings));for(let u of e.anchors)s.push(Ip(u,i));for(let u of e.milestones)s.push(Sp(u,r,i));s.push(pN(e.timeline,i,o));for(let u of e.anchors)s.push(kp(u,i,o));for(let u of e.milestones)s.push(Rp(u,i,o));if(s.push(gN(e.nowline,i,o)),s.push(Gb(e.footnotes,r,i,o)),s.push(iN(e.waveLegend,r,i,o)),s.push(Hb(e.header,r,i,o)),s.push(zb(e,o)),e.header.logo&&(t.logo||t.assetResolver)){let u=await jb(e.header.logo,t.assetResolver,r,t);u&&s.push(u)}return`<svg${$s({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 Vx="/browser-source.nowline",gU={error:3,warning:2,info:1},yU={error:3,warning:2,info:1};function xN(e,t){return gU[e]>=yU[t]}var Dp,EN=0;function wN(){return Dp||(Dp=Vy()),Dp}function xU(){return Ce.parse(`memory:///nowline-browser-${++EN}.nowline`)}async function Kx(e,t={}){let n=t.filePath??Vx,r=wN(),o=r.shared.workspace.LangiumDocumentFactory.fromString(e,xU());return await r.shared.workspace.DocumentBuilder.build([o],{validation:!0}),{ast:o.parseResult.value,diagnostics:TN(o,n)}}function TN(e,t){return _N(bi(e),t)}function _N(e,t){return e.map(n=>n.origin==="lexer"?Wx(n.error,t):n.origin==="parser"?Bx(n.error,t):kb(n.diagnostic,t))}async function qx(e,t={}){let n=t.filePath??Vx,r=wN(),i,o;if(t.timezone)try{i=Mx(t.timezone)}catch(w){if(!(w instanceof Bi))throw w;o=w}let s=o?void 0:Fx({now:t.today,zone:i}),a=await Gx({source:e,sourcePath:n,services:r,readSource:t.readFile??Nb,assetResolver:t.assetResolver,isToleratedIncludeError:w=>Xx(w.message),layout:{theme:t.theme,today:s,locale:t.locale,width:t.width,nonWorking:t.nonWorking}});if(a.kind==="invalid")return{kind:"diagnostics",diagnostics:_N(a.diagnostics,n)};let l=a.kind==="include-error"&&a.legacy!==void 0,c=TN(a.document,n);for(let w of a.resolved.diagnostics){if(w.severity==="error"&&Xx(w.message)){t.onSkippedInclude?.({sourcePath:w.sourcePath,message:w.message});continue}l&&Fr(w)||c.push(Ib(w))}if(a.kind==="include-error"||c.some(w=>w.severity==="error"))return{kind:"diagnostics",diagnostics:c};if(o)return{kind:"diagnostics",diagnostics:[{severity:"error",code:"invalid-timezone",message:o.message,file:n,line:1,column:1}]};let u=[...a.warnings],{logo:f,model:d}=a,p=t.diagnosticLevel??"error",m=Dx(d,{today:s??void 0,locale:t.locale??"en-US"}).map(w=>Sb(w,n)),g=t.showLinks!==!1,E=t.strict===!0,x=await Yx(d,{idPrefix:t.idPrefix,assetResolver:t.assetResolver,logo:f,noLinks:!g,strict:E,warn:w=>u.push(w),fontFamilies:t.fontFamilies}),y=[...m,...u.map(w=>Rb(w,n,E?"error":"warning"))].filter(w=>xN(w.severity,p));return E&&y.length>0?{kind:"diagnostics",diagnostics:[...c,...y]}:{kind:"svg",svg:x,warnings:y}}function Zx(){Dp=void 0,EN=0}var vN="/embed.nowline",Jx=!1;async function AN(e){let{ast:t,diagnostics:n}=await Kx(e,{filePath:vN});return{ast:t,errors:n.filter(r=>r.severity==="error").map(r=>r.message)}}async function Mp(e,t={}){let n={filePath:vN,theme:t.theme,today:t.today,timezone:t.timezone,locale:t.locale,width:t.width,nonWorking:t.nonWorking,idPrefix:t.idPrefix,onSkippedInclude:()=>{Jx||(Jx=!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 qx(e,n);if(r.kind==="svg")return r.svg;let i=r.diagnostics.filter(o=>o.severity==="error").map(o=>o.message);throw new Vl(`Failed to render Nowline source: ${i.join("; ")}`,i)}var Vl=class extends Error{constructor(n,r){super(n);M(this,"details",r);this.name="EmbedRenderError"}};function kN(){Jx=!1,Zx()}var ln=Uint8Array,Ct=Uint16Array,rE=Int32Array,iE=new ln([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]),oE=new ln([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]),IN=new ln([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),NN=function(e,t){for(var n=new Ct(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new rE(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}},LN=NN(iE,2),EU=LN.b,eE=LN.r;EU[28]=258,eE[258]=28;var ON=NN(oE,0),Sle=ON.b,RN=ON.r,tE=new Ct(32768);for(xe=0;xe<32768;++xe)Zn=(xe&43690)>>1|(xe&21845)<<1,Zn=(Zn&52428)>>2|(Zn&13107)<<2,Zn=(Zn&61680)>>4|(Zn&3855)<<4,tE[xe]=((Zn&65280)>>8|(Zn&255)<<8)>>1;var Zn,xe,Zl=(function(e,t,n){for(var r=e.length,i=0,o=new Ct(t);i<r;++i)e[i]&&++o[e[i]-1];var s=new Ct(t);for(i=1;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;var a;if(n){a=new Ct(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var c=i<<4|e[i],u=t-e[i],f=s[e[i]-1]++<<u,d=f|(1<<u)-1;f<=d;++f)a[tE[f]>>l]=c}else for(a=new Ct(r),i=0;i<r;++i)e[i]&&(a[i]=tE[s[e[i]-1]++]>>15-e[i]);return a}),Wi=new ln(288);for(xe=0;xe<144;++xe)Wi[xe]=8;var xe;for(xe=144;xe<256;++xe)Wi[xe]=9;var xe;for(xe=256;xe<280;++xe)Wi[xe]=7;var xe;for(xe=280;xe<288;++xe)Wi[xe]=8;var xe,Fp=new ln(32);for(xe=0;xe<32;++xe)Fp[xe]=5;var xe,wU=Zl(Wi,9,0);var TU=Zl(Fp,5,0);var PN=function(e){return(e+7)/8|0},_U=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new ln(e.subarray(t,n))};var Jn=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},Kl=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},Qx=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return{t:$N,l:0};if(i==1){var s=new ln(n[0].s+1);return s[n[0].s]=1,{t:s,l:1}}n.sort(function(k,N){return k.f-N.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],c=0,u=1,f=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=i-1;)a=n[n[c].f<n[f].f?c++:f++],l=n[c!=u&&n[c].f<n[f].f?c++:f++],n[u++]={s:-1,f:a.f+l.f,l:a,r:l};for(var d=o[0].s,r=1;r<i;++r)o[r].s>d&&(d=o[r].s);var p=new Ct(d+1),m=nE(n[u-1],p,0);if(m>t){var r=0,g=0,E=m-t,x=1<<E;for(o.sort(function(N,B){return p[B.s]-p[N.s]||N.f-B.f});r<i;++r){var y=o[r].s;if(p[y]>t)g+=x-(1<<m-p[y]),p[y]=t;else break}for(g>>=E;g>0;){var w=o[r].s;p[w]<t?g-=1<<t-p[w]++-1:++r}for(;r>=0&&g;--r){var _=o[r].s;p[_]==t&&(--p[_],++g)}m=t}return{t:new ln(p),l:m}},nE=function(e,t,n){return e.s==-1?Math.max(nE(e.l,t,n+1),nE(e.r,t,n+1)):t[e.s]=n},SN=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Ct(++t),r=0,i=e[0],o=1,s=function(l){n[r++]=l},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return{c:n.subarray(0,r),n:t}},ql=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},CN=function(e,t,n){var r=n.length,i=PN(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},bN=function(e,t,n,r,i,o,s,a,l,c,u){Jn(t,u++,n),++i[256];for(var f=Qx(i,15),d=f.t,p=f.l,m=Qx(o,15),g=m.t,E=m.l,x=SN(d),y=x.c,w=x.n,_=SN(g),k=_.c,N=_.n,B=new Ct(19),$=0;$<y.length;++$)++B[y[$]&31];for(var $=0;$<k.length;++$)++B[k[$]&31];for(var X=Qx(B,7),j=X.t,D=X.l,I=19;I>4&&!j[IN[I-1]];--I);var R=c+5<<3,P=ql(i,Wi)+ql(o,Fp)+s,A=ql(i,d)+ql(o,g)+s+14+3*I+ql(B,j)+2*B[16]+3*B[17]+7*B[18];if(l>=0&&R<=P&&R<=A)return CN(t,u,e.subarray(l,l+c));var L,T,O,S;if(Jn(t,u,1+(A<P)),u+=2,A<P){L=Zl(d,p,0),T=d,O=Zl(g,E,0),S=g;var F=Zl(j,D,0);Jn(t,u,w-257),Jn(t,u+5,N-1),Jn(t,u+10,I-4),u+=14;for(var $=0;$<I;++$)Jn(t,u+3*$,j[IN[$]]);u+=3*I;for(var z=[y,k],U=0;U<2;++U)for(var ee=z[U],$=0;$<ee.length;++$){var Y=ee[$]&31;Jn(t,u,F[Y]),u+=j[Y],Y>15&&(Jn(t,u,ee[$]>>5&127),u+=ee[$]>>12)}}else L=wU,T=Wi,O=TU,S=Fp;for(var $=0;$<a;++$){var ne=r[$];if(ne>255){var Y=ne>>18&31;Kl(t,u,L[Y+257]),u+=T[Y+257],Y>7&&(Jn(t,u,ne>>23&31),u+=iE[Y]);var v=ne&31;Kl(t,u,O[v]),u+=S[v],v>3&&(Kl(t,u,ne>>5&8191),u+=oE[v])}else Kl(t,u,L[ne]),u+=T[ne]}return Kl(t,u,L[256]),u+T[256]},vU=new rE([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),$N=new ln(0),AU=function(e,t,n,r,i,o){var s=o.z||e.length,a=new ln(r+s+5*(1+Math.ceil(s/7e3))+i),l=a.subarray(r,a.length-i),c=o.l,u=(o.r||0)&7;if(t){u&&(l[0]=o.r>>3);for(var f=vU[t-1],d=f>>13,p=f&8191,m=(1<<n)-1,g=o.p||new Ct(32768),E=o.h||new Ct(m+1),x=Math.ceil(n/3),y=2*x,w=function(le){return(e[le]^e[le+1]<<x^e[le+2]<<y)&m},_=new rE(25e3),k=new Ct(288),N=new Ct(32),B=0,$=0,X=o.i||0,j=0,D=o.w||0,I=0;X+2<s;++X){var R=w(X),P=X&32767,A=E[R];if(g[P]=A,E[R]=P,D<=X){var L=s-X;if((B>7e3||j>24576)&&(L>423||!c)){u=bN(e,l,0,_,k,N,$,j,I,X-I,u),j=B=$=0,I=X;for(var T=0;T<286;++T)k[T]=0;for(var T=0;T<30;++T)N[T]=0}var O=2,S=0,F=p,z=P-A&32767;if(L>2&&R==w(X-z))for(var U=Math.min(d,L)-1,ee=Math.min(32767,X),Y=Math.min(258,L);z<=ee&&--F&&P!=A;){if(e[X+O]==e[X+O-z]){for(var ne=0;ne<Y&&e[X+ne]==e[X+ne-z];++ne);if(ne>O){if(O=ne,S=z,ne>U)break;for(var v=Math.min(z,ne-2),C=0,T=0;T<v;++T){var W=X-z+T&32767,G=g[W],K=W-G&32767;K>C&&(C=K,A=W)}}}P=A,A=g[P],z+=P-A&32767}if(S){_[j++]=268435456|eE[O]<<18|RN[S];var q=eE[O]&31,J=RN[S]&31;$+=iE[q]+oE[J],++k[257+q],++N[J],D=X+O,++B}else _[j++]=e[X],++k[e[X]]}}for(X=Math.max(X,D);X<s;++X)_[j++]=e[X],++k[e[X]];u=bN(e,l,c,_,k,N,$,j,I,X-I,u),c||(o.r=u&7|l[u/8|0]<<3,u-=7,o.h=E,o.p=g,o.i=X,o.w=D)}else{for(var X=o.w||0;X<s+c;X+=65535){var re=X+65535;re>=s&&(l[u/8|0]=c,re=s),u=CN(l,u+1,e.subarray(X,re))}o.i=s}return _U(a,0,r+PN(u)+i)};var DN=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}}},kU=function(e,t,n,r,i){if(!i&&(i={l:1},t.dictionary)){var o=t.dictionary.subarray(-32768),s=new ln(o.length+e.length);s.set(o),s.set(e,o.length),e=s,i.w=o.length}return AU(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 MN=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};var IU=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=DN();i.p(t.dictionary),MN(e,2,i.d())}};function FN(e,t){t||(t={});var n=DN();n.p(e);var r=kU(e,t,t.dictionary?6:2,4);return IU(r,t),MN(r,r.length-4,n.d()),r}var RU=typeof TextDecoder<"u"&&new TextDecoder,SU=0;try{RU.decode($N,{stream:!0}),SU=1}catch{}var XN="https://free.nowline.io/open";function BN(e){let t=new TextEncoder().encode(e),n=FN(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 sE({source:e,sourceUrl:t,share:n}){if(n===!1||n==="none")return null;if(typeof n=="object")return t!==void 0&&WN(t)?n.remoteUrl.replace("{url}",encodeURIComponent(t)):n.textUrl.replace("{text}",BN(e));let r=n===!0?XN:n,i=new URL(r);return t!==void 0&&WN(t)?i.hash=`url=${encodeURIComponent(t)}`:i.hash=`text=${BN(e)}`,i.toString()}function WN(e){try{return new URL(e).protocol==="https:"}catch{return!1}}var UN=0;async function GN(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=++UN,s=e.share??!0,a=[],l=0;for(let c of Array.from(n)){let u=bU(c);if(!u)continue;let f=NU(c),d=`nl-r${o}-${l++}`,p={theme:e.theme,locale:e.locale,width:e.width,nonWorking:e.nonWorking,today:e.today,timezone:e.timezone,idPrefix:d},m=u.parentElement,g=u.nextSibling,x=c.getAttribute("data-nowline-source-url")??void 0??e.sourceUrl;a.push(Mp(f,p).then(y=>{if(LU(u,y),r++,m!==null){let w=sE({source:f,sourceUrl:x,share:s});if(w!==null){let _=t.createElement("a");_.className="nowline-share",_.href=w,_.target="_blank",_.rel="noopener noreferrer",_.textContent="Share on Nowline",m.insertBefore(_,g)}}},y=>{i++,console.error("nowline: render failed",y)}))}return await Promise.all(a),{rendered:r,failed:i}}function bU(e){let t=e.parentElement;return t&&t.tagName.toUpperCase()==="PRE"?t:e}function NU(e){return e.textContent??""}function LU(e,t){e.outerHTML=t}function HN(){UN=0}function Bp(){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 zN(e,t){return e&&e!=="auto"?ex(e)??t:t}var OU="0.0.0-dev.20261023234242.g7cd76e6",PU="7cd76e6",CU="pre code.language-nowline, code.language-nowline",jN={theme:"auto",startOnLoad:!0,selector:CU,systemTheme:Bp(),share:!0},Ae={...jN},aE=!1;function $U(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:Bp()}}function YN(){return{theme:zN(Ae.theme,Ae.systemTheme),locale:Ae.locale,width:Ae.width,nonWorking:Ae.nonWorking,today:Ae.today,timezone:Ae.timezone}}async function DU(e,t={}){let n={...YN(),...t};return Mp(e,n)}async function MU(e){return AN(e)}async function lE(e){let t={selector:e?.selector??Ae.selector,theme:e?.theme??YN().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 GN(t)}var FU=lE;if(typeof document<"u"&&!aE){aE=!0;let e=()=>{Ae.startOnLoad&&lE()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):queueMicrotask(e)}function BU(){Ae={...jN,systemTheme:Bp()},aE=!1,kN(),HN()}return oL(WU);})();
2920
+ `))}</title>`:""}function nU(e,t){let n=[],r=qb(t,e.style.shadow);return n.push(Kb(e.box.x,e.box.y,e.box.width,e.box.height,e.style,{filter:r??null})),e.waveRole==="background"&&e.waveHatch&&n.push(tN(e.box,e.style,e.waveHatch,t)),n.join("")}function rU(e){if(e.progressFraction>0){let t=Math.max(0,Math.min(e.box.width,e.box.width*e.progressFraction));return H("rect",{x:h(e.box.x),y:h(e.box.y+e.box.height-nn),width:h(t),height:nn,fill:e.style.fg,opacity:.55})}return""}function iU(e){let t=e.dotSpills&&e.dotSpillCx!==null?e.dotSpillCx:e.box.x+e.box.width-vi;return H("circle",{cx:h(t),cy:h(e.box.y+Xg),r:Lr,fill:e.statusDotColor})}function oU(e,t){let n;if(e.textSpills)n=e.box.x+e.box.width+Bn,e.iconSpills&&(n+=Pr+Wt);else{let r=!!e.linkIcon&&e.linkIcon!=="none",o=e.inlineDatePins?.find(s=>s.side==="after"&&!s.spilled)?ds(r,{barWidth:e.box.width}):ds(!t.noLinks&&r&&!e.iconSpills);n=e.box.x+o}return n}function sU(e,t,n,r){let i=[],o=e.style.text,s=n.entities.item.text,a=e.textSpills?s:o,l=e.textSpills?s:e.style.fg,c=e.titleLines??(e.title?[e.title]:[]);return c.forEach((u,f)=>{u!==""&&i.push(ae({x:h(t),y:h(e.box.y+Vf+f*al),"font-family":r[e.style.font],"font-size":Or,"font-weight":600,fill:a},u))}),(e.metaText||e.capacity)&&i.push(QX({metaText:e.metaText,capacity:e.capacity,x:t,baselineY:e.box.y+Kf(c.length),fontSize:sl,fontFamily:r[e.style.font],color:l})),i.join("")}function aU(e,t,n){let r=[],i=t.entities.item.text;if(e.footnoteIndicators.length>0){let o=e.box.y+Ug;if(e.footnoteSpills&&e.footnoteSpillStartX!==null){let s=e.footnoteSpillStartX;for(let a=0;a<e.footnoteIndicators.length;a++){let l=e.footnoteIndicators[a];r.push(ae({x:h(s),y:h(o),"font-family":n.sans,"font-size":ll,"font-weight":700,fill:i},String(l))),s+=Xt}}else{let s=e.box.x+e.box.width-fs;for(let a=e.footnoteIndicators.length-1;a>=0;a--){let l=e.footnoteIndicators[a];r.push(ae({x:h(s),y:h(o),"font-family":n.sans,"font-size":ll,"font-weight":700,fill:e.style.text,"text-anchor":"end"},String(l))),s-=Xt}}}return r.join("")}function lU(e,t,n){let r=[];if(!t.noLinks&&e.linkIcon&&e.linkIcon!=="none"){let i={linear:"#5e6ad2",github:"#0f172a",jira:"#0052cc",generic:n.item.linkIconFg},o=i[e.linkIcon]??i.generic,s=Pr,a=e.iconSpills&&e.iconSpillX!==null?e.iconSpillX:e.box.x+Ai,l=e.box.y+Ai,c=H("rect",{x:h(a),y:h(l),width:s,height:s,rx:2,ry:2,fill:o}),u=a,f=l,d=H("path",{d:`M${h(u+4)} ${h(f+10)} L${h(u+10)} ${h(f+4)} M${h(u+6)} ${h(f+4)} H${h(u+10)} V${h(f+8)}`,stroke:"#ffffff",fill:"none","stroke-width":1.1,"stroke-linecap":"round","stroke-linejoin":"round"}),p=c+d,m=e.linkHref?H("a",{href:e.linkHref,target:"_blank",rel:"noopener"},p):p;r.push(m)}return r.join("")}function cU(e,t,n){let r=[];if(e.hasOverflow&&e.overflowBox){let i=t.item.overflowTailFill,o=t.item.overflowTailStroke,s=t.item.overflowCaption;r.push(H("rect",{x:h(e.overflowBox.x),y:h(e.overflowBox.y),width:h(e.overflowBox.width),height:h(e.overflowBox.height),fill:i,stroke:o,"stroke-width":1})),e.overflowAnchorId&&e.overflowBox.width>60&&r.push(ae({x:h(e.overflowBox.x+e.overflowBox.width/2),y:h(e.overflowBox.y+e.overflowBox.height/2+3),"font-family":n.sans,"font-size":9,"font-weight":700,fill:s,"text-anchor":"middle"},`past ${e.overflowAnchorId}`))}return r.join("")}function uU(e,t){let n=[];for(let r of e.labelChips){let i=Math.min(Ii[r.style.cornerRadius]??8,r.box.height/2);n.push(H("rect",{x:h(r.box.x),y:h(r.box.y),width:h(r.box.width),height:h(r.box.height),rx:h(i),ry:h(i),fill:r.style.bg==="none"?"transparent":r.style.bg,stroke:r.style.fg,"stroke-width":.5})),n.push(ae({x:h(r.box.x+r.box.width/2),y:h(r.box.y+r.box.height/2+3),...bp(r.style,t,ki.xs),"text-anchor":"middle"},r.text))}return n.join("")}function aN(e,t,n,r,i){let o=[];return o.push(tU(e)),o.push(nU(e,n)),o.push(rU(e)),o.push(iU(e)),o.push(Yl(e.inlineDatePins,e.style.fg)),o.push(sU(e,oU(e,t),r,i)),o.push(aU(e,r,i)),o.push(lU(e,t,r)),o.push(cU(e,r,i)),o.push(uU(e,i)),H("g",{"data-layer":"item","data-id":e.id??null},o.join(""))}function fU(e,t,n,r,i,o){let s=[];if(!(e.kind==="group"&&e.waveOnly)){let l=e.box.y+e.headerHeight,c=e.box.height-e.headerHeight;if(e.style.bg!=="none"){let f=t<=wy;s.push(H("rect",{x:h(e.box.x),y:h(l),width:h(e.box.width),height:h(c),fill:f?e.style.bg:"none","fill-opacity":f?t===1?xy:Ey: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+wl,d=e.box.x,p=e.box.x+e.box.width;s.push(H("path",{d:`M${h(d)} ${h(l)} V${h(f)} H${h(p)} V${h(l)}`,fill:"none",stroke:u,"stroke-width":1.2,"stroke-dasharray":e.style.bracket==="dashed"?"3 2":null}))}e.title&&e.headerHeight>0&&s.push(ae({x:h(ys(e.box.x,sN(e.inlineDatePins))),y:h(e.box.y+yy),...bp(e.style,o,ud),"font-weight":600,fill:u},e.title)),s.push(Yl(e.inlineDatePins,e.style.fg))}for(let l of e.children)s.push(cN(l,n,r,i,o,t));return H("g",{"data-layer":e.kind,"data-id":e.id??null},s.join(""))}function cN(e,t,n,r,i,o=0){return e.kind==="item"?aN(e,t,n,r,i):fU(e,o+1,t,n,r,i)}var lN=2;function dU(e,t){switch(e){case"green":return t.swimlane.utilizationOk;case"yellow":return t.swimlane.utilizationWarn;case"red":return t.swimlane.utilizationOver}}function pU(e,t){if(!e.utilization||e.utilization.segments.length===0)return"";let n=e.box.y+e.box.height-lN,r=e.utilization.segments.map(i=>{let o=i.endX-i.startX;return o<=0?"":H("rect",{x:h(i.startX),y:h(n),width:h(o),height:lN,fill:dU(i.classification,t),"data-utilization":i.classification,"data-load":h(i.load)})});return H("g",{"data-layer":"lane-utilization","data-id":e.id??null},r.join(""))}function uN(e,t){let n=e.bandIndex%2===0?t.swimlane.rowTintEven:t.swimlane.rowTintOdd,r=t.swimlane.border;return H("g",{"data-layer":"swimlane-bg","data-id":e.id??null},H("rect",{x:h(e.box.x),y:h(e.box.y),width:h(e.box.width),height:h(e.box.height),fill:n,stroke:r,"stroke-width":1}))}function Cp(e,t,n,r,i){let o=r.swimlane.tabFill,s=r.swimlane.tabStroke,a=r.swimlane.tabText,l=r.swimlane.ownerText,c=r.swimlane.footnoteIndicator,u=[],f=e.tab;if(f){let p=e.footnoteIndicators.length>0?e.footnoteIndicators.join(","):"",m=pl,g=e.box.y+10,E=g+hl;if(u.push(H("rect",{x:h(f.tabX),y:h(g),width:h(f.tabW),height:h(m),rx:4,ry:4,fill:o,stroke:s,"stroke-width":1})),u.push(ae({x:h(f.titleX),y:h(E),"font-family":i[e.style.font],"font-size":12,"font-weight":600,fill:a},e.title)),e.owner){let x=wn[e.ownerKind==="person"?"person":"people"],y=Tl;u.push(`<svg x="${h(f.ownerX)}" y="${h(E-y*.85)}" width="${h(y)}" height="${h(y)}" viewBox="${x.viewBox}" style="color:${an(l)}" aria-hidden="true">${x.body}</svg>`),u.push(ae({x:h(f.ownerTextX),y:h(E),"font-family":i[e.style.font],"font-size":10,fill:l},e.owner))}e.capacity&&u.push(jx(e.capacity,f.badgeX,E,10,i[e.style.font],l)),p&&u.push(ae({x:h(f.footnoteRightX),y:h(g+14),"font-family":i.sans,"font-size":10,"font-weight":700,fill:c,"text-anchor":"end"},p))}for(let d of e.children)u.push(cN(d,t,n,r,i));return u.push(pU(e,r)),H("g",{"data-layer":"swimlane","data-id":e.id??null},u.join(""))}function dN(e,t,n){let r=n.timeline.gridLine,i=n.timeline.minorGridLine,o=e.bottomTickPanelHeight??0,s=e.bottomTickPanelY!==void 0&&o>0,a=e.tickPanelY,l=s?e.bottomTickPanelY+o:e.box.y+e.box.height,c=t,u=e.box.y+e.box.height,f=[];for(let d of e.ticks)if(d.major)f.push(H("line",{x1:h(d.x),y1:h(a),x2:h(d.x),y2:h(l),stroke:r,"stroke-width":1}));else if(e.minorGrid){if(d.labelX===void 0)continue;f.push(H("line",{x1:h(d.x),y1:h(c),x2:h(d.x),y2:h(u),stroke:i,"stroke-width":1}))}for(let d of e.nonWorking??[])d.seam&&f.push(H("line",{x1:h(d.x),y1:h(c),x2:h(d.x),y2:h(u),stroke:n.timeline.nonWorkingSeam,"stroke-width":1,"stroke-dasharray":"1 3"}));return H("g",{"data-layer":"grid"},f.join(""))}function $p(e,t,n,r){let i=e.box.y+e.box.height,o=[];for(let s of e.nonWorking??[]){if(!s.band)continue;let a={x:s.x,y:t,width:s.width,height:i-t},l=r?Np(a,r):a;!l||l.width<=0||l.height<=0||o.push(H("rect",{x:h(l.x),y:h(l.y),width:h(l.width),height:h(l.height),fill:n.timeline.nonWorkingFill,"fill-opacity":ay}))}return o.length===0?"":H("g",{"data-layer":"non-working"},o.join(""))}function pN(e,t,n){let r=e.box.y+e.box.height,i=[];for(let o of e.nonWorking??[])o.label===void 0||!o.labelBox||(o.cut&&i.push(H("line",{x1:h(o.x),y1:h(o.labelBox.y+4),x2:h(o.x),y2:h(r),stroke:t.timeline.nonWorkingSeam,"stroke-width":1,"stroke-dasharray":"1 3"})),i.push(fN(o.label,o.labelBox,o.labelSide,t,n)));for(let o of e.workingExceptions??[])o.labelBox&&i.push(fN(o.label,o.labelBox,o.labelSide,t,n));return i.length===0?"":H("g",{"data-layer":"non-working-label"},i.join(""))}function fN(e,t,n,r,i){let o=n==="left",s=t.y+4,a={x:h(o?t.x+t.width:t.x),y:h(s+4),"font-family":i.sans,"font-size":10,fill:r.timeline.labelText};return o&&(a["text-anchor"]="end"),ae(a,e)}function hN(e,t,n){let r=t.timeline.panelFill,i=t.timeline.border,o=t.timeline.labelText,s=[],a=e.tickPanelY,l=e.tickPanelHeight,c=l>0,u=e.markerRow.height>0,f=e.waveStrip?e.waveStrip.y+e.waveStrip.height:a+l,d=e.markerRow.height,p=e.bottomTickPanelY,m=e.bottomTickPanelHeight??0,g=p!==void 0&&m>0;c&&s.push(H("rect",{x:h(e.box.x),y:h(a),width:h(e.box.width),height:h(l),rx:4,ry:4,fill:r,stroke:i,"stroke-width":1})),u&&s.push(H("rect",{x:h(e.box.x),y:h(f),width:h(e.box.width),height:h(d),rx:4,ry:4,fill:r,stroke:i,"stroke-width":1})),g&&s.push(H("rect",{x:h(e.box.x),y:h(p),width:h(e.box.width),height:h(m),rx:4,ry:4,fill:r,stroke:i,"stroke-width":1}));for(let E of e.ticks)E.major&&(!E.label||E.labelX===void 0||(c&&s.push(ae({x:h(E.labelX),y:h(a+dl(l)),"font-family":n.sans,"font-size":Ri,fill:o,"text-anchor":"middle"},E.label)),g&&s.push(ae({x:h(E.labelX),y:h(p+dl(m)),"font-family":n.sans,"font-size":Ri,fill:o,"text-anchor":"middle"},E.label))));return H("g",{"data-layer":"timeline"},s.join(""))}function mN(e,t,n,r,i,o){let s=r.includeRegion.border,a=r.includeRegion.fill,l=r.includeRegion.tabFill,c=r.includeRegion.tabStroke,u=r.includeRegion.tabText,f=r.includeRegion.badgeFill,d=r.includeRegion.badgeStroke,p=r.includeRegion.badgeText,m=e.box.x+8,g=e.box.y,E=e.box.width-16,x=e.box.height,y=H("rect",{x:h(m),y:h(g),width:h(E),height:h(x),rx:8,ry:8,fill:a,stroke:s,"stroke-width":1,"stroke-dasharray":ml}),w=pl,_=_l(e.box.x,e.label,e.sourcePath),k=g-w/2,N=H("rect",{x:h(_.tabX),y:h(k),width:h(_.tabWidth),height:w,rx:4,ry:4,fill:l,stroke:c,"stroke-width":1}),B=ae({x:h(_.tabLabelX),y:h(k+hl),"font-family":i.sans,"font-size":11,"font-weight":600,fill:u},e.label),$=_.badgeX,X=_.badgeSize,j=g-X/2,D=H("rect",{x:h($),y:h(j),width:X,height:X,rx:4,ry:4,fill:f,stroke:d,"stroke-width":1}),I=H("path",{d:`M${h($+7)} ${h(j+4)} H${h($+14)} V${h(j+11)} M${h($+4)} ${h(j+7)} H${h($+11)} V${h(j+14)} H${h($+4)} Z`,stroke:p,"stroke-width":1.4,fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}),R=9,P=g+4,A=H("rect",{x:h(_.sourceHaloX),y:h(P-R),width:h(_.sourceHaloWidth),height:R+6,fill:a}),L=ae({x:h(_.sourceTextX),y:h(P),"font-family":i.mono,"font-size":R,fill:p},e.sourcePath),T={x:m,y:g,width:E,height:x},O=o?$p(o.timeline,o.chartBox.y,r,T):"",S=o?.waves?Lp(o.waves,T)+Op(o.waveBoundaries,T):"",F=o?.waves?Pp(e.waveCrossings):"",z=e.nestedSwimlanes.map(v=>Cp(v,t,n,r,i)).join(""),U=(e.edges??[]).map(v=>vp(v,r)).join(""),ee=e.anchors??[],Y=e.milestones??[],ne=ee.map(v=>Ip(v,r)).join("")+Y.map(v=>Sp(v,n,r)).join("")+ee.map(v=>kp(v,r,i)).join("")+Y.map(v=>Rp(v,r,i)).join("");return H("g",{"data-layer":"include"},y+O+S+U+z+F+ne+N+B+D+I+A+L)}function gN(e,t,n){if(!e)return"";let r=t.nowline.stroke,i=t.nowline.labelText,o=H("line",{x1:h(e.x),y1:h(e.topY),x2:h(e.x),y2:h(e.bottomY),stroke:r,"stroke-width":Qf}),s=hU(e,r),a=mU(e,i,n);return H("g",{"data-layer":"nowline"},o+s+a)}function yN(e){let t=Qf/2;return e.pillMode==="flag-right"?e.x-t:e.pillMode==="flag-left"?e.x+t:e.x}function hU(e,t){let n=e.pillTopY,r=e.pillTopY+Ut,i=Zg,o=e.pillWidth;if(e.pillMode==="center")return H("rect",{x:h(e.x-o/2),y:h(n),width:h(o),height:h(Ut),rx:i,ry:i,fill:t});let s=yN(e);if(e.pillMode==="flag-right"){let c=s+o,u=[`M ${h(s)} ${h(n)}`,`L ${h(c-i)} ${h(n)}`,`A ${i} ${i} 0 0 1 ${h(c)} ${h(n+i)}`,`L ${h(c)} ${h(r-i)}`,`A ${i} ${i} 0 0 1 ${h(c-i)} ${h(r)}`,`L ${h(s)} ${h(r)}`,"Z"].join(" ");return H("path",{d:u,fill:t})}let a=s-o,l=[`M ${h(s)} ${h(n)}`,`L ${h(a+i)} ${h(n)}`,`A ${i} ${i} 0 0 0 ${h(a)} ${h(n+i)}`,`L ${h(a)} ${h(r-i)}`,`A ${i} ${i} 0 0 0 ${h(a+i)} ${h(r)}`,`L ${h(s)} ${h(r)}`,"Z"].join(" ");return H("path",{d:l,fill:t})}function mU(e,t,n){let r=e.pillTopY+Jg,i=yN(e),o,s;return e.pillMode==="center"?(o=e.x,s="middle"):e.pillMode==="flag-right"?(o=i+hs,s="start"):(o=i-hs,s="end"),ae({x:h(o),y:h(r),"font-family":n.sans,"font-size":gl,"font-weight":700,fill:t,"text-anchor":s},e.label)}async function Yx(e,t={}){let r=new Ap(t.idPrefix??"nl").next("root"),i=e.palette,o=t.fontFamilies??sy,s=[],a=(u,f)=>`<marker id="${u}" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto"><path d="M 0 0 L 10 5 L 0 10 z" fill="${f}"/></marker>`,l=`<defs>${Zb(r)}`+a(`${r}-arrow-dark`,i.arrowhead.dark)+eN(e).map(u=>Qb(r,u,i)).join("")+"</defs>";s.push(l),s.push(H("rect",{x:0,y:0,width:h(e.width),height:h(e.height),fill:e.backgroundColor})),s.push(hN(e.timeline,i,o)),s.push(nN(e,i));for(let u of e.swimlanes)s.push(uN(u,i));s.push($p(e.timeline,e.chartBox.y,i)),e.waves&&s.push(Lp(e.waves)),s.push(dN(e.timeline,e.chartBox.y,i)),s.push(Op(e.waveBoundaries)),s.push(rN(e,i,o));for(let u of e.edges)s.push(vp(u,i));for(let u of e.swimlanes)s.push(Cp(u,t,r,i,o));for(let u of e.includes)s.push(mN(u,t,r,i,o,e));s.push(Pp(e.waveCrossings));for(let u of e.anchors)s.push(Ip(u,i));for(let u of e.milestones)s.push(Sp(u,r,i));s.push(pN(e.timeline,i,o));for(let u of e.anchors)s.push(kp(u,i,o));for(let u of e.milestones)s.push(Rp(u,i,o));if(s.push(gN(e.nowline,i,o)),s.push(Gb(e.footnotes,r,i,o)),s.push(iN(e.waveLegend,r,i,o)),s.push(Hb(e.header,r,i,o)),s.push(zb(e,o)),e.header.logo&&(t.logo||t.assetResolver)){let u=await jb(e.header.logo,t.assetResolver,r,t);u&&s.push(u)}return`<svg${$s({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 Vx="/browser-source.nowline",gU={error:3,warning:2,info:1},yU={error:3,warning:2,info:1};function xN(e,t){return gU[e]>=yU[t]}var Dp,EN=0;function wN(){return Dp||(Dp=Vy()),Dp}function xU(){return Ce.parse(`memory:///nowline-browser-${++EN}.nowline`)}async function Kx(e,t={}){let n=t.filePath??Vx,r=wN(),o=r.shared.workspace.LangiumDocumentFactory.fromString(e,xU());return await r.shared.workspace.DocumentBuilder.build([o],{validation:!0}),{ast:o.parseResult.value,diagnostics:TN(o,n)}}function TN(e,t){return _N(bi(e),t)}function _N(e,t){return e.map(n=>n.origin==="lexer"?Wx(n.error,t):n.origin==="parser"?Bx(n.error,t):kb(n.diagnostic,t))}async function qx(e,t={}){let n=t.filePath??Vx,r=wN(),i,o;if(t.timezone)try{i=Mx(t.timezone)}catch(w){if(!(w instanceof Bi))throw w;o=w}let s=o?void 0:Fx({now:t.today,zone:i}),a=await Gx({source:e,sourcePath:n,services:r,readSource:t.readFile??Nb,assetResolver:t.assetResolver,isToleratedIncludeError:w=>Xx(w.message),layout:{theme:t.theme,today:s,locale:t.locale,width:t.width,nonWorking:t.nonWorking}});if(a.kind==="invalid")return{kind:"diagnostics",diagnostics:_N(a.diagnostics,n)};let l=a.kind==="include-error"&&a.legacy!==void 0,c=TN(a.document,n);for(let w of a.resolved.diagnostics){if(w.severity==="error"&&Xx(w.message)){t.onSkippedInclude?.({sourcePath:w.sourcePath,message:w.message});continue}l&&Fr(w)||c.push(Ib(w))}if(a.kind==="include-error"||c.some(w=>w.severity==="error"))return{kind:"diagnostics",diagnostics:c};if(o)return{kind:"diagnostics",diagnostics:[{severity:"error",code:"invalid-timezone",message:o.message,file:n,line:1,column:1}]};let u=[...a.warnings],{logo:f,model:d}=a,p=t.diagnosticLevel??"error",m=Dx(d,{today:s??void 0,locale:t.locale??"en-US"}).map(w=>Sb(w,n)),g=t.showLinks!==!1,E=t.strict===!0,x=await Yx(d,{idPrefix:t.idPrefix,assetResolver:t.assetResolver,logo:f,noLinks:!g,strict:E,warn:w=>u.push(w),fontFamilies:t.fontFamilies}),y=[...m,...u.map(w=>Rb(w,n,E?"error":"warning"))].filter(w=>xN(w.severity,p));return E&&y.length>0?{kind:"diagnostics",diagnostics:[...c,...y]}:{kind:"svg",svg:x,warnings:y}}function Zx(){Dp=void 0,EN=0}var vN="/embed.nowline",Jx=!1;async function AN(e){let{ast:t,diagnostics:n}=await Kx(e,{filePath:vN});return{ast:t,errors:n.filter(r=>r.severity==="error").map(r=>r.message)}}async function Mp(e,t={}){let n={filePath:vN,theme:t.theme,today:t.today,timezone:t.timezone,locale:t.locale,width:t.width,nonWorking:t.nonWorking,idPrefix:t.idPrefix,onSkippedInclude:()=>{Jx||(Jx=!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 qx(e,n);if(r.kind==="svg")return r.svg;let i=r.diagnostics.filter(o=>o.severity==="error").map(o=>o.message);throw new Vl(`Failed to render Nowline source: ${i.join("; ")}`,i)}var Vl=class extends Error{constructor(n,r){super(n);M(this,"details",r);this.name="EmbedRenderError"}};function kN(){Jx=!1,Zx()}var ln=Uint8Array,Ct=Uint16Array,rE=Int32Array,iE=new ln([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]),oE=new ln([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]),IN=new ln([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),NN=function(e,t){for(var n=new Ct(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];for(var i=new rE(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}},LN=NN(iE,2),EU=LN.b,eE=LN.r;EU[28]=258,eE[258]=28;var ON=NN(oE,0),Sle=ON.b,RN=ON.r,tE=new Ct(32768);for(xe=0;xe<32768;++xe)Zn=(xe&43690)>>1|(xe&21845)<<1,Zn=(Zn&52428)>>2|(Zn&13107)<<2,Zn=(Zn&61680)>>4|(Zn&3855)<<4,tE[xe]=((Zn&65280)>>8|(Zn&255)<<8)>>1;var Zn,xe,Zl=(function(e,t,n){for(var r=e.length,i=0,o=new Ct(t);i<r;++i)e[i]&&++o[e[i]-1];var s=new Ct(t);for(i=1;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;var a;if(n){a=new Ct(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var c=i<<4|e[i],u=t-e[i],f=s[e[i]-1]++<<u,d=f|(1<<u)-1;f<=d;++f)a[tE[f]>>l]=c}else for(a=new Ct(r),i=0;i<r;++i)e[i]&&(a[i]=tE[s[e[i]-1]++]>>15-e[i]);return a}),Wi=new ln(288);for(xe=0;xe<144;++xe)Wi[xe]=8;var xe;for(xe=144;xe<256;++xe)Wi[xe]=9;var xe;for(xe=256;xe<280;++xe)Wi[xe]=7;var xe;for(xe=280;xe<288;++xe)Wi[xe]=8;var xe,Fp=new ln(32);for(xe=0;xe<32;++xe)Fp[xe]=5;var xe,wU=Zl(Wi,9,0);var TU=Zl(Fp,5,0);var PN=function(e){return(e+7)/8|0},_U=function(e,t,n){return(t==null||t<0)&&(t=0),(n==null||n>e.length)&&(n=e.length),new ln(e.subarray(t,n))};var Jn=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8},Kl=function(e,t,n){n<<=t&7;var r=t/8|0;e[r]|=n,e[r+1]|=n>>8,e[r+2]|=n>>16},Qx=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return{t:$N,l:0};if(i==1){var s=new ln(n[0].s+1);return s[n[0].s]=1,{t:s,l:1}}n.sort(function(k,N){return k.f-N.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],c=0,u=1,f=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=i-1;)a=n[n[c].f<n[f].f?c++:f++],l=n[c!=u&&n[c].f<n[f].f?c++:f++],n[u++]={s:-1,f:a.f+l.f,l:a,r:l};for(var d=o[0].s,r=1;r<i;++r)o[r].s>d&&(d=o[r].s);var p=new Ct(d+1),m=nE(n[u-1],p,0);if(m>t){var r=0,g=0,E=m-t,x=1<<E;for(o.sort(function(N,B){return p[B.s]-p[N.s]||N.f-B.f});r<i;++r){var y=o[r].s;if(p[y]>t)g+=x-(1<<m-p[y]),p[y]=t;else break}for(g>>=E;g>0;){var w=o[r].s;p[w]<t?g-=1<<t-p[w]++-1:++r}for(;r>=0&&g;--r){var _=o[r].s;p[_]==t&&(--p[_],++g)}m=t}return{t:new ln(p),l:m}},nE=function(e,t,n){return e.s==-1?Math.max(nE(e.l,t,n+1),nE(e.r,t,n+1)):t[e.s]=n},SN=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Ct(++t),r=0,i=e[0],o=1,s=function(l){n[r++]=l},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return{c:n.subarray(0,r),n:t}},ql=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},CN=function(e,t,n){var r=n.length,i=PN(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},bN=function(e,t,n,r,i,o,s,a,l,c,u){Jn(t,u++,n),++i[256];for(var f=Qx(i,15),d=f.t,p=f.l,m=Qx(o,15),g=m.t,E=m.l,x=SN(d),y=x.c,w=x.n,_=SN(g),k=_.c,N=_.n,B=new Ct(19),$=0;$<y.length;++$)++B[y[$]&31];for(var $=0;$<k.length;++$)++B[k[$]&31];for(var X=Qx(B,7),j=X.t,D=X.l,I=19;I>4&&!j[IN[I-1]];--I);var R=c+5<<3,P=ql(i,Wi)+ql(o,Fp)+s,A=ql(i,d)+ql(o,g)+s+14+3*I+ql(B,j)+2*B[16]+3*B[17]+7*B[18];if(l>=0&&R<=P&&R<=A)return CN(t,u,e.subarray(l,l+c));var L,T,O,S;if(Jn(t,u,1+(A<P)),u+=2,A<P){L=Zl(d,p,0),T=d,O=Zl(g,E,0),S=g;var F=Zl(j,D,0);Jn(t,u,w-257),Jn(t,u+5,N-1),Jn(t,u+10,I-4),u+=14;for(var $=0;$<I;++$)Jn(t,u+3*$,j[IN[$]]);u+=3*I;for(var z=[y,k],U=0;U<2;++U)for(var ee=z[U],$=0;$<ee.length;++$){var Y=ee[$]&31;Jn(t,u,F[Y]),u+=j[Y],Y>15&&(Jn(t,u,ee[$]>>5&127),u+=ee[$]>>12)}}else L=wU,T=Wi,O=TU,S=Fp;for(var $=0;$<a;++$){var ne=r[$];if(ne>255){var Y=ne>>18&31;Kl(t,u,L[Y+257]),u+=T[Y+257],Y>7&&(Jn(t,u,ne>>23&31),u+=iE[Y]);var v=ne&31;Kl(t,u,O[v]),u+=S[v],v>3&&(Kl(t,u,ne>>5&8191),u+=oE[v])}else Kl(t,u,L[ne]),u+=T[ne]}return Kl(t,u,L[256]),u+T[256]},vU=new rE([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),$N=new ln(0),AU=function(e,t,n,r,i,o){var s=o.z||e.length,a=new ln(r+s+5*(1+Math.ceil(s/7e3))+i),l=a.subarray(r,a.length-i),c=o.l,u=(o.r||0)&7;if(t){u&&(l[0]=o.r>>3);for(var f=vU[t-1],d=f>>13,p=f&8191,m=(1<<n)-1,g=o.p||new Ct(32768),E=o.h||new Ct(m+1),x=Math.ceil(n/3),y=2*x,w=function(le){return(e[le]^e[le+1]<<x^e[le+2]<<y)&m},_=new rE(25e3),k=new Ct(288),N=new Ct(32),B=0,$=0,X=o.i||0,j=0,D=o.w||0,I=0;X+2<s;++X){var R=w(X),P=X&32767,A=E[R];if(g[P]=A,E[R]=P,D<=X){var L=s-X;if((B>7e3||j>24576)&&(L>423||!c)){u=bN(e,l,0,_,k,N,$,j,I,X-I,u),j=B=$=0,I=X;for(var T=0;T<286;++T)k[T]=0;for(var T=0;T<30;++T)N[T]=0}var O=2,S=0,F=p,z=P-A&32767;if(L>2&&R==w(X-z))for(var U=Math.min(d,L)-1,ee=Math.min(32767,X),Y=Math.min(258,L);z<=ee&&--F&&P!=A;){if(e[X+O]==e[X+O-z]){for(var ne=0;ne<Y&&e[X+ne]==e[X+ne-z];++ne);if(ne>O){if(O=ne,S=z,ne>U)break;for(var v=Math.min(z,ne-2),C=0,T=0;T<v;++T){var W=X-z+T&32767,G=g[W],K=W-G&32767;K>C&&(C=K,A=W)}}}P=A,A=g[P],z+=P-A&32767}if(S){_[j++]=268435456|eE[O]<<18|RN[S];var q=eE[O]&31,J=RN[S]&31;$+=iE[q]+oE[J],++k[257+q],++N[J],D=X+O,++B}else _[j++]=e[X],++k[e[X]]}}for(X=Math.max(X,D);X<s;++X)_[j++]=e[X],++k[e[X]];u=bN(e,l,c,_,k,N,$,j,I,X-I,u),c||(o.r=u&7|l[u/8|0]<<3,u-=7,o.h=E,o.p=g,o.i=X,o.w=D)}else{for(var X=o.w||0;X<s+c;X+=65535){var re=X+65535;re>=s&&(l[u/8|0]=c,re=s),u=CN(l,u+1,e.subarray(X,re))}o.i=s}return _U(a,0,r+PN(u)+i)};var DN=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}}},kU=function(e,t,n,r,i){if(!i&&(i={l:1},t.dictionary)){var o=t.dictionary.subarray(-32768),s=new ln(o.length+e.length);s.set(o),s.set(e,o.length),e=s,i.w=o.length}return AU(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 MN=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};var IU=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=DN();i.p(t.dictionary),MN(e,2,i.d())}};function FN(e,t){t||(t={});var n=DN();n.p(e);var r=kU(e,t,t.dictionary?6:2,4);return IU(r,t),MN(r,r.length-4,n.d()),r}var RU=typeof TextDecoder<"u"&&new TextDecoder,SU=0;try{RU.decode($N,{stream:!0}),SU=1}catch{}var XN="https://free.nowline.io/open";function BN(e){let t=new TextEncoder().encode(e),n=FN(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 sE({source:e,sourceUrl:t,share:n}){if(n===!1||n==="none")return null;if(typeof n=="object")return t!==void 0&&WN(t)?n.remoteUrl.replace("{url}",encodeURIComponent(t)):n.textUrl.replace("{text}",BN(e));let r=n===!0?XN:n,i=new URL(r);return t!==void 0&&WN(t)?i.hash=`url=${encodeURIComponent(t)}`:i.hash=`text=${BN(e)}`,i.toString()}function WN(e){try{return new URL(e).protocol==="https:"}catch{return!1}}var UN=0;async function GN(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=++UN,s=e.share??!0,a=[],l=0;for(let c of Array.from(n)){let u=bU(c);if(!u)continue;let f=NU(c),d=`nl-r${o}-${l++}`,p={theme:e.theme,locale:e.locale,width:e.width,nonWorking:e.nonWorking,today:e.today,timezone:e.timezone,idPrefix:d},m=u.parentElement,g=u.nextSibling,x=c.getAttribute("data-nowline-source-url")??void 0??e.sourceUrl;a.push(Mp(f,p).then(y=>{if(LU(u,y),r++,m!==null){let w=sE({source:f,sourceUrl:x,share:s});if(w!==null){let _=t.createElement("a");_.className="nowline-share",_.href=w,_.target="_blank",_.rel="noopener noreferrer",_.textContent="Share on Nowline",m.insertBefore(_,g)}}},y=>{i++,console.error("nowline: render failed",y)}))}return await Promise.all(a),{rendered:r,failed:i}}function bU(e){let t=e.parentElement;return t&&t.tagName.toUpperCase()==="PRE"?t:e}function NU(e){return e.textContent??""}function LU(e,t){e.outerHTML=t}function HN(){UN=0}function Bp(){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 zN(e,t){return e&&e!=="auto"?ex(e)??t:t}var OU="0.0.0-dev.20261024005602.gaf04042",PU="af04042",CU="pre code.language-nowline, code.language-nowline",jN={theme:"auto",startOnLoad:!0,selector:CU,systemTheme:Bp(),share:!0},Ae={...jN},aE=!1;function $U(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:Bp()}}function YN(){return{theme:zN(Ae.theme,Ae.systemTheme),locale:Ae.locale,width:Ae.width,nonWorking:Ae.nonWorking,today:Ae.today,timezone:Ae.timezone}}async function DU(e,t={}){let n={...YN(),...t};return Mp(e,n)}async function MU(e){return AN(e)}async function lE(e){let t={selector:e?.selector??Ae.selector,theme:e?.theme??YN().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 GN(t)}var FU=lE;if(typeof document<"u"&&!aE){aE=!0;let e=()=>{Ae.startOnLoad&&lE()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):queueMicrotask(e)}function BU(){Ae={...jN,systemTheme:Bp()},aE=!1,kN(),HN()}return oL(WU);})();
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.20261023234242.g7cd76e6",
3
+ "version": "0.0.0-dev.20261024005602.gaf04042",
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.20261023234242.g7cd76e6",
43
- "@nowline/core": "0.0.0-dev.20261023234242.g7cd76e6",
44
- "@nowline/layout": "0.0.0-dev.20261023234242.g7cd76e6",
45
- "@nowline/renderer": "0.0.0-dev.20261023234242.g7cd76e6",
46
- "@nowline/share-link": "0.0.0-dev.20261023234242.g7cd76e6",
42
+ "@nowline/browser": "0.0.0-dev.20261024005602.gaf04042",
43
+ "@nowline/core": "0.0.0-dev.20261024005602.gaf04042",
44
+ "@nowline/layout": "0.0.0-dev.20261024005602.gaf04042",
45
+ "@nowline/renderer": "0.0.0-dev.20261024005602.gaf04042",
46
+ "@nowline/share-link": "0.0.0-dev.20261024005602.gaf04042",
47
47
  "langium": "~4.4.0"
48
48
  },
49
49
  "devDependencies": {