@toclocoinc/lattice-grid 1.71.1 → 1.71.3

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.
Files changed (195) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +1 -1
  3. package/angular/package.json +1 -1
  4. package/docs/API.html +42 -8
  5. package/docs/api/adapters.html +1 -1
  6. package/docs/api/ai.html +1 -1
  7. package/docs/api/alarms.html +1 -1
  8. package/docs/api/charts.html +39 -5
  9. package/docs/api/data-router.html +1 -1
  10. package/docs/api/gantt.html +1 -1
  11. package/docs/api/grid.html +2 -2
  12. package/docs/api/index.html +2 -2
  13. package/docs/api/kanban.html +1 -1
  14. package/docs/api/kpi.html +1 -1
  15. package/docs/api/layout.html +1 -1
  16. package/docs/api/mock-socket.html +1 -1
  17. package/docs/api/tabs.html +1 -1
  18. package/docs/api/types.html +1 -1
  19. package/docs/api-detail.html +4 -4
  20. package/docs/warnings.json +13 -2
  21. package/lattice-grid.d.ts +31 -7
  22. package/lattice-grid.esm.min.js +3 -3
  23. package/lattice-grid.min.cjs +3 -3
  24. package/lattice-grid.min.js +3 -3
  25. package/modules/ai.d.ts +1 -1
  26. package/modules/ai.esm.min.js +2 -2
  27. package/modules/ai.min.cjs +2 -2
  28. package/modules/ai.min.js +2 -2
  29. package/modules/alarms.d.ts +1 -1
  30. package/modules/alarms.esm.min.js +2 -2
  31. package/modules/alarms.min.cjs +2 -2
  32. package/modules/alarms.min.js +2 -2
  33. package/modules/angular.d.ts +1 -1
  34. package/modules/angular.esm.min.js +2 -2
  35. package/modules/angular.min.cjs +2 -2
  36. package/modules/angular.min.js +2 -2
  37. package/modules/chart-alluvial.d.ts +1 -1
  38. package/modules/chart-alluvial.esm.min.js +1 -1
  39. package/modules/chart-alluvial.min.cjs +1 -1
  40. package/modules/chart-alluvial.min.js +1 -1
  41. package/modules/chart-arc.d.ts +1 -1
  42. package/modules/chart-arc.esm.min.js +1 -1
  43. package/modules/chart-arc.min.cjs +1 -1
  44. package/modules/chart-arc.min.js +1 -1
  45. package/modules/chart-bubblemap.d.ts +1 -1
  46. package/modules/chart-bubblemap.esm.min.js +1 -1
  47. package/modules/chart-bubblemap.min.cjs +1 -1
  48. package/modules/chart-bubblemap.min.js +1 -1
  49. package/modules/chart-bump.d.ts +1 -1
  50. package/modules/chart-bump.esm.min.js +1 -1
  51. package/modules/chart-bump.min.cjs +1 -1
  52. package/modules/chart-bump.min.js +1 -1
  53. package/modules/chart-calendar.d.ts +1 -1
  54. package/modules/chart-calendar.esm.min.js +1 -1
  55. package/modules/chart-calendar.min.cjs +1 -1
  56. package/modules/chart-calendar.min.js +1 -1
  57. package/modules/chart-decomposition.d.ts +1 -1
  58. package/modules/chart-decomposition.esm.min.js +1 -1
  59. package/modules/chart-decomposition.min.cjs +1 -1
  60. package/modules/chart-decomposition.min.js +1 -1
  61. package/modules/chart-diverging.d.ts +1 -1
  62. package/modules/chart-diverging.esm.min.js +1 -1
  63. package/modules/chart-diverging.min.cjs +1 -1
  64. package/modules/chart-diverging.min.js +1 -1
  65. package/modules/chart-dumbbell.d.ts +1 -1
  66. package/modules/chart-dumbbell.esm.min.js +1 -1
  67. package/modules/chart-dumbbell.min.cjs +1 -1
  68. package/modules/chart-dumbbell.min.js +1 -1
  69. package/modules/chart-fan.d.ts +1 -1
  70. package/modules/chart-fan.esm.min.js +1 -1
  71. package/modules/chart-fan.min.cjs +1 -1
  72. package/modules/chart-fan.min.js +1 -1
  73. package/modules/chart-hexbin.d.ts +1 -1
  74. package/modules/chart-hexbin.esm.min.js +1 -1
  75. package/modules/chart-hexbin.min.cjs +1 -1
  76. package/modules/chart-hexbin.min.js +1 -1
  77. package/modules/chart-hexmap.d.ts +1 -1
  78. package/modules/chart-hexmap.esm.min.js +1 -1
  79. package/modules/chart-hexmap.min.cjs +1 -1
  80. package/modules/chart-hexmap.min.js +1 -1
  81. package/modules/chart-icicle.d.ts +1 -1
  82. package/modules/chart-icicle.esm.min.js +1 -1
  83. package/modules/chart-icicle.min.cjs +1 -1
  84. package/modules/chart-icicle.min.js +1 -1
  85. package/modules/chart-markermap.d.ts +1 -1
  86. package/modules/chart-markermap.esm.min.js +1 -1
  87. package/modules/chart-markermap.min.cjs +1 -1
  88. package/modules/chart-markermap.min.js +1 -1
  89. package/modules/chart-parallel.d.ts +1 -1
  90. package/modules/chart-parallel.esm.min.js +1 -1
  91. package/modules/chart-parallel.min.cjs +1 -1
  92. package/modules/chart-parallel.min.js +1 -1
  93. package/modules/chart-ridgeline.d.ts +1 -1
  94. package/modules/chart-ridgeline.esm.min.js +1 -1
  95. package/modules/chart-ridgeline.min.cjs +1 -1
  96. package/modules/chart-ridgeline.min.js +1 -1
  97. package/modules/chart-roc.d.ts +1 -1
  98. package/modules/chart-roc.esm.min.js +1 -1
  99. package/modules/chart-roc.min.cjs +1 -1
  100. package/modules/chart-roc.min.js +1 -1
  101. package/modules/chart-slope.d.ts +1 -1
  102. package/modules/chart-slope.esm.min.js +1 -1
  103. package/modules/chart-slope.min.cjs +1 -1
  104. package/modules/chart-slope.min.js +1 -1
  105. package/modules/chart-splom.d.ts +1 -1
  106. package/modules/chart-splom.esm.min.js +1 -1
  107. package/modules/chart-splom.min.cjs +1 -1
  108. package/modules/chart-splom.min.js +1 -1
  109. package/modules/chart-waffle.d.ts +1 -1
  110. package/modules/chart-waffle.esm.min.js +1 -1
  111. package/modules/chart-waffle.min.cjs +1 -1
  112. package/modules/chart-waffle.min.js +1 -1
  113. package/modules/charts.d.ts +1 -1
  114. package/modules/charts.esm.min.js +13 -9
  115. package/modules/charts.esm.min.js.map +2 -2
  116. package/modules/charts.min.cjs +141 -137
  117. package/modules/charts.min.js +141 -137
  118. package/modules/charts.min.js.map +2 -2
  119. package/modules/data-router.d.ts +1 -1
  120. package/modules/data-router.esm.min.js +2 -2
  121. package/modules/data-router.min.cjs +2 -2
  122. package/modules/data-router.min.js +2 -2
  123. package/modules/devtools.d.ts +1 -1
  124. package/modules/devtools.esm.min.js +1 -1
  125. package/modules/devtools.min.cjs +1 -1
  126. package/modules/devtools.min.js +1 -1
  127. package/modules/dhtmlx-compat.d.ts +1 -1
  128. package/modules/dhtmlx-compat.esm.min.js +2 -2
  129. package/modules/dhtmlx-compat.min.cjs +2 -2
  130. package/modules/dhtmlx-compat.min.js +2 -2
  131. package/modules/gantt.d.ts +1 -1
  132. package/modules/gantt.esm.min.js +2 -2
  133. package/modules/gantt.min.cjs +2 -2
  134. package/modules/gantt.min.js +2 -2
  135. package/modules/geo-europe-nuts.d.ts +1 -1
  136. package/modules/geo-europe-nuts.esm.min.js +1 -1
  137. package/modules/geo-europe-nuts.min.cjs +1 -1
  138. package/modules/geo-europe-nuts.min.js +1 -1
  139. package/modules/geo-uk.d.ts +1 -1
  140. package/modules/geo-uk.esm.min.js +1 -1
  141. package/modules/geo-uk.min.cjs +1 -1
  142. package/modules/geo-uk.min.js +1 -1
  143. package/modules/geo-us-states.d.ts +1 -1
  144. package/modules/geo-us-states.esm.min.js +1 -1
  145. package/modules/geo-us-states.min.cjs +1 -1
  146. package/modules/geo-us-states.min.js +1 -1
  147. package/modules/geo-world-110m.d.ts +1 -1
  148. package/modules/geo-world-110m.esm.min.js +1 -1
  149. package/modules/geo-world-110m.min.cjs +1 -1
  150. package/modules/geo-world-110m.min.js +1 -1
  151. package/modules/geo-world-50m.d.ts +1 -1
  152. package/modules/geo-world-50m.esm.min.js +1 -1
  153. package/modules/geo-world-50m.min.cjs +1 -1
  154. package/modules/geo-world-50m.min.js +1 -1
  155. package/modules/htmx.d.ts +1 -1
  156. package/modules/htmx.esm.min.js +3 -3
  157. package/modules/htmx.min.cjs +3 -3
  158. package/modules/htmx.min.js +3 -3
  159. package/modules/kanban.d.ts +1 -1
  160. package/modules/kanban.esm.min.js +2 -2
  161. package/modules/kanban.min.cjs +2 -2
  162. package/modules/kanban.min.js +2 -2
  163. package/modules/kpi.d.ts +1 -1
  164. package/modules/kpi.esm.min.js +2 -2
  165. package/modules/kpi.min.cjs +2 -2
  166. package/modules/kpi.min.js +2 -2
  167. package/modules/layout.d.ts +1 -1
  168. package/modules/layout.esm.min.js +2 -2
  169. package/modules/layout.min.cjs +2 -2
  170. package/modules/layout.min.js +2 -2
  171. package/modules/mock-socket.d.ts +1 -1
  172. package/modules/mock-socket.esm.min.js +1 -1
  173. package/modules/mock-socket.min.cjs +1 -1
  174. package/modules/mock-socket.min.js +1 -1
  175. package/modules/react.d.ts +1 -1
  176. package/modules/react.esm.min.js +2 -2
  177. package/modules/react.min.cjs +2 -2
  178. package/modules/react.min.js +2 -2
  179. package/modules/svelte.d.ts +1 -1
  180. package/modules/svelte.esm.min.js +2 -2
  181. package/modules/svelte.min.cjs +2 -2
  182. package/modules/svelte.min.js +2 -2
  183. package/modules/tabs.d.ts +1 -1
  184. package/modules/tabs.esm.min.js +2 -2
  185. package/modules/tabs.min.cjs +2 -2
  186. package/modules/tabs.min.js +2 -2
  187. package/modules/vue.d.ts +1 -1
  188. package/modules/vue.esm.min.js +2 -2
  189. package/modules/vue.min.cjs +2 -2
  190. package/modules/vue.min.js +2 -2
  191. package/modules/webcomponent.d.ts +1 -1
  192. package/modules/webcomponent.esm.min.js +3 -3
  193. package/modules/webcomponent.min.cjs +3 -3
  194. package/modules/webcomponent.min.js +3 -3
  195. package/package.json +1 -1
@@ -1,9 +1,9 @@
1
1
  /*!
2
- * Lattice Grid 1.71.1, gantt module
2
+ * Lattice Grid 1.71.3, gantt module
3
3
  * Copyright (c) 2026 TOCLOCO Inc. All rights reserved.
4
4
  * https://latticegrid.dev
5
5
  */
6
- var qt=Object.create(null),Xt=Object.create(null);function Et(m,pt){qt[m]=pt}function Jt(m){var pt=Xt[m];if(pt)return pt;var Mt=Object.create(null);Xt[m]=Mt;var dt=qt[m];if(!dt)throw new Error("[lattice] missing module: "+m);return dt(Mt,Jt),Mt}Et("packages/core/src/internal/util.js",function(m,pt){"use strict";Object.defineProperty(m,"VERSION",{enumerable:!0,get:function(){return ot}}),Object.defineProperty(m,"reportedWarnings",{enumerable:!0,get:function(){return D}}),Object.defineProperty(m,"warnOnce",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(m,"infoOnce",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(m,"resetWarnings",{enumerable:!0,get:function(){return O}}),Object.defineProperty(m,"fail",{enumerable:!0,get:function(){return I}}),Object.defineProperty(m,"invariant",{enumerable:!0,get:function(){return M}}),Object.defineProperty(m,"DEV",{enumerable:!0,get:function(){return ct}}),Object.defineProperty(m,"isObject",{enumerable:!0,get:function(){return F}}),Object.defineProperty(m,"isFunction",{enumerable:!0,get:function(){return V}}),Object.defineProperty(m,"isNil",{enumerable:!0,get:function(){return H}}),Object.defineProperty(m,"isBlank",{enumerable:!0,get:function(){return q}}),Object.defineProperty(m,"isCtor",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(m,"pathGetter",{enumerable:!0,get:function(){return S}}),Object.defineProperty(m,"pathSetter",{enumerable:!0,get:function(){return N}}),Object.defineProperty(m,"getPath",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(m,"setPath",{enumerable:!0,get:function(){return L}}),Object.defineProperty(m,"humanise",{enumerable:!0,get:function(){return et}}),Object.defineProperty(m,"escapeHtml",{enumerable:!0,get:function(){return K}}),Object.defineProperty(m,"titleCase",{enumerable:!0,get:function(){return f}}),Object.defineProperty(m,"expand",{enumerable:!0,get:function(){return E}}),Object.defineProperty(m,"toArray",{enumerable:!0,get:function(){return y}}),Object.defineProperty(m,"merge",{enumerable:!0,get:function(){return l}}),Object.defineProperty(m,"mergeRow",{enumerable:!0,get:function(){return U}}),Object.defineProperty(m,"Lru",{enumerable:!0,get:function(){return z}}),Object.defineProperty(m,"collator",{enumerable:!0,get:function(){return g}}),Object.defineProperty(m,"defaultCompare",{enumerable:!0,get:function(){return C}}),Object.defineProperty(m,"now",{enumerable:!0,get:function(){return c}}),Object.defineProperty(m,"nextFrame",{enumerable:!0,get:function(){return at}}),Object.defineProperty(m,"cancelFrame",{enumerable:!0,get:function(){return gt}}),Object.defineProperty(m,"frameBatched",{enumerable:!0,get:function(){return J}}),Object.defineProperty(m,"settleDebounce",{enumerable:!0,get:function(){return r}}),Object.defineProperty(m,"whenIdle",{enumerable:!0,get:function(){return d}}),Object.defineProperty(m,"uid",{enumerable:!0,get:function(){return k}});const Mt="1.71.1";async function dt(){return Mt}const ot="1.71.1",W=new Set,nt=2e3;function T(o){if(W.add(o),W.size>nt){const i=W.values().next().value;i!==void 0&&W.delete(i)}}const X=[],u=500;function $(o,i,n){X.push({key:o,level:i,message:n.map(t=>typeof t=="string"?t:A(t)).join(" "),at:Date.now()}),X.length>u&&X.shift()}function A(o){if(o instanceof Error)return o.message;try{return JSON.stringify(o)}catch{return String(o)}}function D(){return X.map(o=>({...o}))}function lt(o,...i){W.has(o)||(T(o),$(o,"warn",i),console.warn("[lattice]",...i))}function ut(o,...i){W.has(o)||(T(o),$(o,"info",i),console.info("[lattice]",...i))}function O(){W.clear(),X.length=0}function I(o,i){const n=new Error(`[lattice] ${o}`);throw i!==void 0&&(n.cause=i),n}function M(o,i){o||I(i)}const ct=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function F(o){return o!==null&&typeof o=="object"&&!Array.isArray(o)}function V(o){return typeof o=="function"}function H(o){return o==null}function q(o){return o==null||o===""}function tt(o){return typeof o!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(o))?!0:!!(o.prototype&&Object.getOwnPropertyNames(o.prototype).length>1)}const st=new Map;function S(o){let i=st.get(o);if(i)return i;if(!o.includes("."))i=n=>n?.[o];else{const n=o.split("."),t=n.length;i=e=>{let s=e;for(let a=0;a<t;a++){if(s==null)return;s=s[n[a]]}return s}}return st.set(o,i),i}const b=new Map;function N(o){let i=b.get(o);if(i)return i;if(!o.includes("."))i=(n,t)=>{n!=null&&(n[o]=t)};else{const n=o.split("."),t=n.length-1;i=(e,s)=>{let a=e;for(let w=0;w<t;w++){if(a==null)return;const h=n[w];a[h]==null&&(a[h]={}),a=a[h]}a!=null&&(a[n[t]]=s)}}return b.set(o,i),i}function Z(o,i){return S(i)(o)}function L(o,i,n){N(i)(o,n)}function et(o){return o?(o.includes(".")?o.slice(o.lastIndexOf(".")+1):o).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,n=>n.toUpperCase()):""}const j={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function K(o){const i=o==null?"":String(o);return/[&<>"']/.test(i)?i.replace(/[&<>"']/g,n=>j[n]):i}function f(o){return String(o).replace(/\w\S*/g,i=>i[0].toUpperCase()+i.slice(1).toLowerCase())}function E(o,i,n){if(o!==void 0)return o===!0?{enabled:!0,...n}:o===!1?{enabled:!1}:F(o)?o:{[i]:o,enabled:!0}}function y(o){return o==null?[]:Array.isArray(o)?o:[o]}const R=Object.freeze(new Set(["__proto__","constructor","prototype"]));function l(o,i){if(!F(o))return F(i)?{...i}:i;if(!F(i))return i===void 0?o:i;const n={...o};for(const t of Object.keys(i)){if(R.has(t))continue;const e=i[t];e!==void 0&&(n[t]=F(e)&&F(n[t])?l(n[t],e):e)}return n}function U(o,i){if(!F(o)||!F(i)||o===i)return i;const n=Object.create(Object.getPrototypeOf(o));return Object.assign(n,o,i),n}class z{#n;#o=new Map;#t;constructor(i=256,n=null){this.#n=i,this.#t=n}get size(){return this.#o.size}get max(){return this.#n}set max(i){this.#n=i,this.#e()}has(i){return this.#o.has(i)}get(i){const n=this.#o;if(!n.has(i))return;const t=n.get(i);return n.delete(i),n.set(i,t),t}peek(i){return this.#o.get(i)}set(i,n){const t=this.#o;return t.has(i)&&t.delete(i),t.set(i,n),this.#e(),n}delete(i){const n=this.#o.get(i);return this.#o.delete(i)&&this.#t&&this.#t(n,i),n}clear(){if(this.#t)for(const[i,n]of this.#o)this.#t(n,i);this.#o.clear()}keys(){return this.#o.keys()}values(){return this.#o.values()}#e(){const i=this.#o;for(;i.size>this.#n;){const n=i.keys().next().value,t=i.get(n);i.delete(n),this.#t&&this.#t(t,n)}}}const Y=new Map;function g(o,i){const n=`${o||""}|${i?JSON.stringify(i):""}`;let t=Y.get(n);return t||(t=new Intl.Collator(o||void 0,{numeric:!0,sensitivity:"variant",...i}),Y.set(n,t)),t}function C(o,i){if(o===i)return 0;if(o==null)return 1;if(i==null)return-1;if(typeof o=="number"&&typeof i=="number")return Number.isNaN(o)?Number.isNaN(i)?0:1:Number.isNaN(i)||o<i?-1:o>i?1:0;const n=String(o),t=String(i);return n<t?-1:n>t?1:0}function c(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const B=typeof requestAnimationFrame=="function";function at(o){return B?requestAnimationFrame(o):setTimeout(()=>o(c()),16)}function gt(o){o!=null&&(B?cancelAnimationFrame(o):clearTimeout(o))}function J(o){let i=null,n=null;const t=()=>{i=null;const s=n;n=null,o(...s||[])},e=(...s)=>{n=s,i===null&&(i=at(t))};return e.cancel=()=>{gt(i),i=null,n=null},e.flush=()=>{i!==null&&(gt(i),t())},e}function r(o,i){let n=null,t=null;const e=()=>{if(n=null,t===null)return;const w=t;t=null,o(...w),s()},s=()=>{n=setTimeout(e,i),typeof n?.unref=="function"&&n.unref()},a=(...w)=>{n===null?(o(...w),s()):(t=w,clearTimeout(n),s())};return a.flush=()=>{if(n!==null&&clearTimeout(n),n=null,t===null)return;const w=t;t=null,o(...w)},a.cancel=()=>{n!==null&&clearTimeout(n),n=null,t=null},a.pending=()=>n!==null||t!==null,a}function d(o,i=50){return typeof requestIdleCallback=="function"?requestIdleCallback(o,{timeout:i}):setTimeout(()=>o({timeRemaining:()=>0,didTimeout:!0}),1)}let p=0;function k(o="l"){return`${o}${(++p).toString(36)}`}}),Et("packages/modules/gantt/time.js",function(m,pt){"use strict";Object.defineProperty(m,"toDayNumber",{enumerable:!0,get:function(){return W}}),Object.defineProperty(m,"fromDayNumber",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(m,"toISODate",{enumerable:!0,get:function(){return T}}),Object.defineProperty(m,"resolveProjectEpoch",{enumerable:!0,get:function(){return X}});const dt=pt("packages/core/src/internal/util.js").warnOnce,ot=864e5;function W(u){if(u==null||u==="")return null;if(typeof u=="number")return Number.isFinite(u)?u:null;if(u instanceof Date)return Number.isFinite(u.getTime())?Math.floor(Date.UTC(u.getFullYear(),u.getMonth(),u.getDate())/ot):null;const $=Date.parse(u);return Number.isFinite($)?Math.floor($/ot):null}function nt(u){return Number.isFinite(u)?new Date(Math.round(u)*ot):null}function T(u){const $=nt(u);return $?$.toISOString().slice(0,10):null}function X(u){if(u==null||u==="")return 0;const $=W(u);return Number.isFinite($)?$:(dt(`gantt.projectEpoch:${String(u)}`,`[lattice] gantt: projectEpoch ${JSON.stringify(u)} is not a date or a day number; the plan is rendered against the Unix epoch (day 0 = 1970-01-01).`),0)}}),Et("packages/modules/gantt/calendar.js",function(m,pt){"use strict";Object.defineProperty(m,"createCalendar",{enumerable:!0,get:function(){return nt}});const Mt=pt("packages/modules/gantt/time.js"),dt=Mt.fromDayNumber,ot=Mt.toDayNumber,W=Object.freeze([1,2,3,4,5]);function nt(T,X=0){if(T==null)return null;let u,$;T==="weekends"?(u=W,$=new Set):(u=Array.isArray(T.workdays)&&T.workdays.length?T.workdays.map(Number).filter(V=>V>=0&&V<=6):W,$=new Set((Array.isArray(T.holidays)?T.holidays:[]).map(V=>ot(V)).filter(V=>V!=null)));const A=new Set(u);if(A.size===7&&$.size===0||A.size===0)return null;const D=V=>{const H=dt(V);return H?A.has(H.getUTCDay())&&!$.has(V):!1},lt=V=>{let H=V;for(;!D(H);)H+=1;return H},ut=V=>{let H=V;for(;!D(H);)H-=1;return H},O=lt(Math.round(Number.isFinite(X)?X:0)),I=new Map([[0,O]]),M=new Map([[O,0]]);return{isWorking:D,nextWorking:lt,dayOf:V=>{const H=Math.round(V);if(I.has(H))return I.get(H);if(H>0){let st=H-1;for(;!I.has(st);)st-=1;let S=I.get(st);for(let b=st+1;b<=H;b+=1)S=lt(S+1),I.set(b,S),M.set(S,b);return I.get(H)}let q=H+1;for(;!I.has(q);)q+=1;let tt=I.get(q);for(let st=q-1;st>=H;st-=1)tt=ut(tt-1),I.set(st,tt),M.set(tt,st);return I.get(H)},indexOf:V=>{const H=lt(Math.round(V));if(M.has(H))return M.get(H);if(H>O){let st=0,S=O;for(;M.has(lt(S+1))&&S<H;)S=lt(S+1),st=M.get(S);for(;S<H;)S=lt(S+1),st+=1,I.set(st,S),M.set(S,st);return st}let q=0,tt=O;for(;tt>H;)tt=ut(tt-1),q-=1,I.set(q,tt),M.set(tt,q);return q},anchor:O}}}),Et("packages/modules/gantt/schedule.js",function(m,pt){"use strict";Object.defineProperty(m,"LINK_TYPES",{enumerable:!0,get:function(){return X}}),Object.defineProperty(m,"CONSTRAINT_TYPES",{enumerable:!0,get:function(){return u}}),Object.defineProperty(m,"EPS",{enumerable:!0,get:function(){return A}}),Object.defineProperty(m,"SCHEDULE_ERROR",{enumerable:!0,get:function(){return D}}),Object.defineProperty(m,"TASK_FIELDS",{enumerable:!0,get:function(){return O}}),Object.defineProperty(m,"taskIdReader",{enumerable:!0,get:function(){return M}}),Object.defineProperty(m,"taskFieldWriters",{enumerable:!0,get:function(){return ct}}),Object.defineProperty(m,"normalizeTasks",{enumerable:!0,get:function(){return V}}),Object.defineProperty(m,"buildTree",{enumerable:!0,get:function(){return H}}),Object.defineProperty(m,"normalizeLinkSpec",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(m,"normalizeDependencies",{enumerable:!0,get:function(){return st}}),Object.defineProperty(m,"expandDependencies",{enumerable:!0,get:function(){return S}}),Object.defineProperty(m,"topoOrder",{enumerable:!0,get:function(){return b}}),Object.defineProperty(m,"computeSchedule",{enumerable:!0,get:function(){return et}}),Object.defineProperty(m,"findViolations",{enumerable:!0,get:function(){return E}});const dt=pt("packages/core/src/internal/util.js").warnOnce,W=pt("packages/modules/gantt/calendar.js").createCalendar,T=pt("packages/modules/gantt/time.js").toDayNumber,X=["FS","SS","FF","SF"],u=["MSO","MFO","ALAP"],$=Object.freeze({mso:"MSO","must-start-on":"MSO",muststarton:"MSO","start-on":"MSO",mfo:"MFO","must-finish-on":"MFO",mustfinishon:"MFO","finish-on":"MFO",alap:"ALAP","as-late-as-possible":"ALAP",aslateaspossible:"ALAP",late:"ALAP"}),A=1e-9,D={CYCLE:"cycle",DUPLICATE_ID:"duplicate-id",UNKNOWN_TASK:"unknown-task",BAD_DURATION:"bad-duration",BAD_LINK_TYPE:"bad-link-type",SELF_DEPENDENCY:"self-dependency",UNKNOWN_PARENT:"unknown-parent",PARENT_CYCLE:"parent-cycle",DEP_ACROSS_HIERARCHY:"dep-across-hierarchy"};function lt(y){if(y==null||y==="")return null;const R=typeof y=="number"?y:Number(y);return Number.isFinite(R)?R:null}function ut(y){return y==null||y===""?null:T(y)}const O=Object.freeze(["id","name","start","end","duration","milestone","percentComplete","parent","baselineStart","baselineEnd","constraint","constraintDate"]);function I(y){const R=y&&typeof y=="object"?y:{},l={};for(const U of O){const z=R[U];if(typeof z=="function")l[U]=z;else if(typeof z=="string"&&z!==""){const Y=z;l[U]=g=>g[Y]}else l[U]=Y=>Y[U]}return l}function M(y){return I(y).id}function ct(y){const R=y&&typeof y=="object"?y:{},l={};for(const U of O){const z=R[U];typeof z=="string"&&z!==""?l[U]=z:typeof z=="function"?l[U]=null:l[U]=U}return l}function F(y,R){const l=R.constraint(y),U=l??(y&&y.constraintType);if(U==null||U==="")return null;const z=$[String(U).toLowerCase().replace(/\s+/g,"-")]??(u.includes(String(U).toUpperCase())?String(U).toUpperCase():null);if(!z)return null;const Y=ut(R.constraintDate(y)??y.constraintAt??y.at);return{type:z,at:Y}}function V(y,R){const l=new Map,U=[],z=I(R);if(!Array.isArray(y))return{ok:!1,error:{code:D.BAD_DURATION,message:"tasks must be an array"},order:U,byId:l};for(const Y of y){const g=Y?z.id(Y):null,C=g!=null?String(g):null;if(C==null)return{ok:!1,error:{code:D.UNKNOWN_TASK,message:"every task needs an id"},order:U,byId:l};if(l.has(C))return{ok:!1,error:{code:D.DUPLICATE_ID,message:`duplicate task id "${C}"`,id:C},order:U,byId:l};const c=ut(z.start(Y)),B=ut(z.end(Y)),at=z.milestone(Y)===!0;let gt=at?0:lt(z.duration(Y));if(gt==null&&c!=null&&B!=null&&(gt=B-c),gt!=null&&gt<0)return{ok:!1,error:{code:D.BAD_DURATION,message:`task "${C}" has negative duration ${gt}`,id:C},order:U,byId:l};const J=z.name(Y),r=z.parent(Y);l.set(C,{id:C,name:J!=null?String(J):C,duration:gt,milestoneFlag:at,earliestStart:c,placedStart:c,placedEnd:B,percentComplete:lt(z.percentComplete(Y)),parent:r!=null?String(r):null,constraint:F(Y,z),baselineStart:ut(z.baselineStart(Y)??(Y.baseline&&Y.baseline.start)),baselineEnd:ut(z.baselineEnd(Y)??(Y.baseline&&Y.baseline.end))}),U.push(C)}return{ok:!0,order:U,byId:l}}function H(y,R){const l=new Map(y.map(C=>[C,[]]));for(const C of y){const c=R.get(C).parent;if(c!=null){if(!R.has(c))return{ok:!1,error:{code:D.UNKNOWN_PARENT,message:`task "${C}" names unknown parent "${c}"`,id:C}};l.get(c).push(C)}}for(const C of y){const c=new Set;let B=R.get(C).parent;for(;B!=null;){if(B===C||c.has(B))return{ok:!1,error:{code:D.PARENT_CYCLE,message:`parent cycle at "${C}"`,id:C}};c.add(B),B=R.get(B)?.parent??null}}const U=C=>l.get(C).length>0,z=new Map,Y=C=>{if(z.has(C))return z.get(C);const c=l.get(C),B=c.length===0?[C]:c.flatMap(at=>Y(at));return z.set(C,B),B};return{ok:!0,children:l,isSummary:U,descendantLeaves:Y,ancestors:C=>{const c=new Set;let B=R.get(C).parent;for(;B!=null;)c.add(B),B=R.get(B).parent;return c}}}const q=/^\s*(FS|SS|FF|SF)\s*(?:([+-])\s*(\d+(?:\.\d+)?))?\s*$/i;function tt(y){const R={...y||null};if(typeof R.type!="string")return R;const l=q.exec(R.type);if(!l||!l[2])return R;const U=(l[2]==="-"?-1:1)*Number(l[3]);R.type=l[1].toUpperCase();const z=lt(y.lag);return z!=null&&z!==U?(dt(`gantt-link-shorthand-${String(y.type)}-${z}`,`[lattice] gantt: dependency type ${JSON.stringify(y.type)} carries a lag of ${U} but lag: ${z} was also given; the explicit lag wins. Give one or the other.`),R):(R.lag=U,R)}function st(y,R,l={}){const U=[];if(y==null)return{ok:!0,edges:U};if(!Array.isArray(y))return{ok:!1,error:{code:D.UNKNOWN_TASK,message:"dependencies must be an array"},edges:U};const z=typeof l.ancestors=="function"?l.ancestors:null;for(const Y of y){const g=tt(Y),C=g&&g.from!=null?String(g.from):null,c=g&&g.to!=null?String(g.to):null,B=g&&g.type!=null?String(g.type).toUpperCase():"FS",at=lt(g.lag)??0;if(C==null||c==null)return{ok:!1,error:{code:D.UNKNOWN_TASK,message:"a dependency needs both `from` and `to`"},edges:U};if(!R.has(C))return{ok:!1,error:{code:D.UNKNOWN_TASK,message:`dependency references unknown task "${C}"`,id:C},edges:U};if(!R.has(c))return{ok:!1,error:{code:D.UNKNOWN_TASK,message:`dependency references unknown task "${c}"`,id:c},edges:U};if(C===c)return{ok:!1,error:{code:D.SELF_DEPENDENCY,message:`task "${C}" depends on itself`,id:C},edges:U};if(!X.includes(B))return{ok:!1,error:{code:D.BAD_LINK_TYPE,message:`unknown link type "${B}" (expected one of ${X.join("/")})`},edges:U};if(z&&(z(C).has(c)||z(c).has(C)))return{ok:!1,error:{code:D.DEP_ACROSS_HIERARCHY,message:`dependency between "${C}" and "${c}" crosses their own parent/child hierarchy`,from:C,to:c},edges:U};U.push({from:C,to:c,type:B,lag:at})}return{ok:!0,edges:U}}function S(y,R){const l=new Set,U=[];for(const z of y){(R.isSummary(z.from)||R.isSummary(z.to))&&z.type!=="FS"&&dt(`gantt-summary-link-${z.type}-${z.from}-${z.to}`,`[lattice] gantt: ${z.type} link with a summary endpoint (${z.from} -> ${z.to}) is expanded to descendant leaves — a conservative v1 reading; only FS is exact for summary endpoints.`);for(const g of R.descendantLeaves(z.from))for(const C of R.descendantLeaves(z.to)){if(g===C)continue;const c=[g,C,z.type,z.lag].join("");l.has(c)||(l.add(c),U.push({from:g,to:C,type:z.type,lag:z.lag}))}}return U}function b(y,R){const l=new Map(y.map(g=>[g,0])),U=new Map(y.map(g=>[g,[]]));for(const g of R)N(l,g.to),U.get(g.from).push(g.to);const z=y.filter(g=>l.get(g)===0),Y=[];for(;z.length;){const g=z.shift();Y.push(g);for(const C of U.get(g)){const c=l.get(C)-1;l.set(C,c),c===0&&z.push(C)}}return Y.length===y.length?{ok:!0,sorted:Y}:{ok:!1,cycle:Z(y,U,new Set(Y))}}function N(y,R){y.set(R,y.get(R)+1)}function Z(y,R,l){const U=y.find(C=>!l.has(C)),z=[],Y=new Map;let g=U;for(;g!=null&&!Y.has(g);)Y.set(g,z.length),z.push(g),g=R.get(g).find(C=>!l.has(C));return g==null?z:z.slice(Y.get(g)).concat(g)}function L(y,R,l,U,z,Y=new Map){const g=b(y,l);if(!g.ok)return dt(`gantt-cycle-${g.cycle.join(">")}`,`[lattice] gantt: dependency cycle detected (${g.cycle.join(" -> ")}); schedule refused.`),{ok:!1,error:{code:D.CYCLE,message:`dependency cycle: ${g.cycle.join(" -> ")}`,cycle:g.cycle}};const C=g.sorted,c=new Map(y.map(k=>[k,[]])),B=new Map(y.map(k=>[k,[]]));for(const k of l)c.get(k.to).push(k),B.get(k.from).push(k);const at=new Map;for(const k of y){const o=R.get(k);at.set(k,{id:k,name:o.name,duration:o.duration,es:0,ef:0,ls:0,lf:0,totalFloat:0,critical:!1,percentComplete:o.percentComplete,parent:o.parent,isSummary:!1,isMilestone:o.duration===0,children:[]})}const gt=[];for(const k of C){const o=R.get(k),i=at.get(k);let n=Math.max(U,o.earliestStart??U);for(const e of c.get(k)){const s=at.get(e.from);let a;switch(e.type){case"FS":a=s.ef+e.lag;break;case"SS":a=s.es+e.lag;break;case"FF":a=s.ef+e.lag-i.duration;break;case"SF":a=s.es+e.lag-i.duration;break;default:a=-1/0}a>n&&(n=a)}const t=Y.get(k);if(t&&t.type!=="ALAP"&&t.at!=null){const e=t.type==="MFO"?t.at-i.duration:t.at;e<n-A?gt.push({id:k,type:t.type,at:t.at,earliestFeasible:n}):n=e,i.pinned=!0}i.es=n,i.ef=n+i.duration}const J=y.length?Math.max(...y.map(k=>at.get(k).ef)):U,r=Number.isFinite(z)?z:J;for(let k=C.length-1;k>=0;k-=1){const o=C[k],i=at.get(o);let n=r;for(const t of B.get(o)){const e=at.get(t.to);let s;switch(t.type){case"FS":s=e.ls-t.lag;break;case"SS":s=e.ls-t.lag+i.duration;break;case"FF":s=e.lf-t.lag;break;case"SF":s=e.lf-t.lag+i.duration;break;default:s=1/0}s<n&&(n=s)}i.pinned&&(n=i.ef),i.lf=n,i.ls=n-i.duration,i.totalFloat=i.ls-i.es,i.critical=i.totalFloat<=A}for(const k of y){const o=Y.get(k);if(!o||o.type!=="ALAP")continue;const i=at.get(k);i.es=i.ls,i.ef=i.lf,i.totalFloat=0,i.critical=!0}const d=y.filter(k=>at.get(k).critical),p=f(y,l,at);return{ok:!0,tasks:at,critical:d,criticalPaths:p,projectFinish:J,conflicts:gt}}function et(y,R=[],l={}){const U=ut(l.projectStart)??0,z=ut(l.deadline),Y=W(l.calendar,U),g=a=>a==null?null:Y?Y.indexOf(a):a,C=a=>Y?Y.dayOf(a):a,c=V(y,l.fields);if(!c.ok)return{ok:!1,error:c.error};const{order:B,byId:at}=c,gt=H(B,at);if(!gt.ok)return{ok:!1,error:gt.error};const J=st(R,at,gt);if(!J.ok)return{ok:!1,error:J.error};for(const a of B)if(!gt.isSummary(a)&&at.get(a).duration==null)return{ok:!1,error:{code:D.BAD_DURATION,message:`task "${a}" has no duration and no start+end to derive one`,id:a}};const r=B.filter(a=>!gt.isSummary(a)),d=new Map(r.map(a=>{const w=at.get(a);return[a,{...w,earliestStart:g(w.earliestStart)}]})),p=new Map;for(const a of r){const w=at.get(a).constraint;w&&p.set(a,{type:w.type,at:g(w.at)})}const k=Y?Y.indexOf(U):U,o=z==null?void 0:g(z),i=S(J.edges,gt),n=L(r,d,i,k,o,p);if(!n.ok)return{ok:!1,error:n.error};const t=n.tasks;for(const a of r){const w=t.get(a);w.es=C(w.es),w.ef=C(w.ef),w.ls=C(w.ls),w.lf=C(w.lf),j(w,at.get(a).baselineStart,at.get(a).baselineEnd)}for(let a=B.length-1;a>=0;a-=1){const w=B[a];gt.isSummary(w)&&t.set(w,K(w,at.get(w),gt,t))}for(const a of B)gt.isSummary(a)&&(t.get(a).children=gt.children.get(a).slice());const e=Y?Y.anchor:U,s=C(n.projectFinish);return{ok:!0,tasks:t,order:B,critical:n.critical,criticalPaths:n.criticalPaths,projectStart:e,projectFinish:s,projectDuration:s-e,conflicts:n.conflicts||[],calendar:!!Y}}function j(y,R,l){R==null&&l==null||(y.baselineStart=R??null,y.baselineEnd=l??null,y.startVariance=R==null?null:y.es-R,y.finishVariance=l==null?null:y.ef-l,y.durationVariance=R==null||l==null?null:y.ef-y.es-(l-R))}function K(y,R,l,U){const z=l.children.get(y).map(p=>U.get(p)),Y=Math.min(...z.map(p=>p.es)),g=Math.max(...z.map(p=>p.ef)),C=Math.min(...z.map(p=>p.ls)),c=Math.max(...z.map(p=>p.lf)),B=l.descendantLeaves(y).map(p=>U.get(p)),at=B.reduce((p,k)=>p+k.duration,0),gt=at>A?B.reduce((p,k)=>p+k.duration*(k.percentComplete??0),0)/at:null,J={id:y,name:R.name,duration:g-Y,es:Y,ef:g,ls:C,lf:c,totalFloat:C-Y,critical:z.some(p=>p.critical),percentComplete:gt,parent:R.parent,isSummary:!0,isMilestone:!1,children:[]},r=B.map(p=>p.baselineStart).filter(p=>p!=null),d=B.map(p=>p.baselineEnd).filter(p=>p!=null);return(r.length||d.length)&&j(J,r.length?Math.min(...r):null,d.length?Math.max(...d):null),J}function f(y,R,l){const U=new Map(y.map(c=>[c,[]])),z=new Set;for(const c of R){const B=l.get(c.from),at=l.get(c.to);if(!B.critical||!at.critical)continue;let gt;switch(c.type){case"FS":gt=B.ef+c.lag;break;case"SS":gt=B.es+c.lag;break;case"FF":gt=B.ef+c.lag-at.duration;break;case"SF":gt=B.es+c.lag-at.duration;break;default:gt=-1/0}Math.abs(gt-at.es)<=A&&(U.get(c.from).push(c.to),z.add(c.to))}const Y=y.filter(c=>l.get(c).critical&&!z.has(c)),g=[],C=(c,B)=>{const at=U.get(c);if(!at.length){g.push(B);return}for(const gt of at)C(gt,B.concat(gt))};for(const c of Y)C(c,[c]);return g}function E(y,R,l){if(!R||!R.ok)return[];const U=[],z=I(l);for(const Y of y){const g=Y?z.id(Y):null,C=g!=null?String(g):null;if(C==null||!R.tasks.has(C))continue;const c=R.tasks.get(C);if(c.isSummary)continue;const B=lt(z.start(Y));B!=null&&B<c.es-A&&U.push({id:C,placedStart:B,earliestStart:c.es,by:c.es-B})}return U}}),Et("packages/modules/gantt/resources.js",function(m,pt){"use strict";Object.defineProperty(m,"parseAssignments",{enumerable:!0,get:function(){return A}}),Object.defineProperty(m,"normalizeCapacities",{enumerable:!0,get:function(){return D}}),Object.defineProperty(m,"sweepLoad",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(m,"computeResourceLoad",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(m,"levelResources",{enumerable:!0,get:function(){return M}});const dt=pt("packages/core/src/internal/util.js").warnOnce,ot=pt("packages/modules/gantt/schedule.js"),W=ot.computeSchedule,nt=ot.EPS,T=ot.taskIdReader,u=pt("packages/modules/gantt/calendar.js").createCalendar;function $(F){if(F==null||F==="")return null;const V=typeof F=="number"?F:Number(F);return Number.isFinite(V)?V:null}function A(F){if(F&&Array.isArray(F.assignments))return F.assignments.map(q=>{const tt=q&&(q.resource??q.name??q.id);if(tt==null||tt==="")return null;const st=$(q.units)??$(q.allocation)??1;return{resource:String(tt),units:st}}).filter(Boolean);const V=F?F.assignee??F.assignees??F.owner:null;return(Array.isArray(V)?V:V==null||V===""?[]:[V]).map(q=>String(q)).filter(q=>q!=="").map(q=>({resource:q,units:1}))}function D(F,V){const H=new Map;if(Array.isArray(F))for(const q of F){const tt=q&&(q.id??q.name??q.resource);if(tt==null||tt==="")continue;const st=$(q.capacity??q.maxUnits??q.max??q.units);H.set(String(tt),st??V)}else if(F&&typeof F=="object")for(const[q,tt]of Object.entries(F)){const st=$(tt);H.set(String(q),st??V)}return H}function lt(F){if(!F.length)return[];const V=new Set;for(const tt of F)V.add(tt.s),V.add(tt.e);const H=[...V].sort((tt,st)=>tt-st),q=[];for(let tt=0;tt<H.length-1;tt+=1){const st=H[tt],S=H[tt+1];if(S<=st)continue;let b=0;const N=[];for(const Z of F)Z.s<=st&&Z.e>=S&&(b+=Z.units,N.push(Z.taskId));N.length&&q.push({s:st,e:S,load:b,taskIds:N})}return q}function ut(F,V,H={}){const q={ok:!1,resources:[],overAllocations:[],byResource:new Map};if(!V||!V.ok)return q;const tt=$(H.defaultCapacity)??1,st=D(H.resources,tt),S=H.calendar!=null?u(H.calendar,V.projectStart):null,b=E=>st.has(E)?st.get(E):tt,N=E=>S?S.indexOf(E):E,Z=E=>S?S.dayOf(E):E,L=T(H.fields),et=new Map;for(const E of V.order){const y=V.tasks.get(E);if(!y||y.isSummary)continue;const R=F.find(Y=>Y&&L(Y)!=null&&String(L(Y))===E);if(!R)continue;const l=A(R);if(!l.length)continue;const U=N(y.es),z=N(y.ef);if(!(z<=U))for(const Y of l)et.has(Y.resource)||et.set(Y.resource,[]),et.get(Y.resource).push({s:U,e:z,units:Y.units,taskId:E})}const j=new Map,K=[],f=[];for(const[E,y]of et){const R=b(E),l=lt(y);let U=0;const z=l.map(g=>{g.load>U&&(U=g.load);const C={start:Z(g.s),end:Z(g.e),load:g.load,taskIds:g.taskIds};return g.load>R+nt&&f.push({resource:E,capacity:R,start:C.start,end:C.end,load:g.load,taskIds:g.taskIds.slice()}),C}),Y={resource:E,capacity:R,peak:U,segments:z};j.set(E,Y),K.push(Y)}return K.sort((E,y)=>E.resource<y.resource?-1:E.resource>y.resource?1:0),f.sort((E,y)=>E.start-y.start||(E.resource<y.resource?-1:1)),{ok:!0,resources:K,overAllocations:f,byResource:j}}function O(F){if(!F)return!1;const V=F.constraint??F.constraintType;if(V==null||V==="")return!1;const H=String(V).toLowerCase().replace(/\s+/g,"-");return H==="mso"||H==="must-start-on"||H==="muststarton"||H==="start-on"||H==="mfo"||H==="must-finish-on"||H==="mustfinishon"||H==="finish-on"}function I(F,V){return F?$(F[V])??0:0}function M(F,V,H={}){const q={projectStart:H.projectStart,deadline:H.deadline,calendar:H.calendar,fields:H.fields},tt=H.priorityField||"priority",st=H.maxIterations!=null?H.maxIterations:Math.max(100,F.length*F.length*2),S=T(H.fields),b=F.map(f=>({...f})),N=b.map(f=>String(S(f))),Z=f=>N.indexOf(f);let L=W(b,V,q);if(!L.ok)return{ok:!1,error:L.error};const et=new Map;for(const f of L.order){const E=L.tasks.get(f);E&&!E.isSummary&&et.set(f,E.es)}let j=0;for(;j<st;j+=1){const f=ut(b,L,H);if(!f.overAllocations.length)return{ok:!0,resolved:!0,tasks:b,schedule:L,moves:ct(et,L),iterations:j};const E=f.overAllocations.slice().sort((g,C)=>g.start-C.start||C.load-g.load)[0],y=new Map(b.map(g=>[String(S(g)),g])),R=E.taskIds.map(g=>L.tasks.get(g)).filter(Boolean),l=R.filter(g=>!O(y.get(g.id)));if(!l.length)return{ok:!0,resolved:!1,tasks:b,schedule:L,moves:ct(et,L),remaining:f.overAllocations,iterations:j};l.sort((g,C)=>{if(C.totalFloat!==g.totalFloat)return C.totalFloat-g.totalFloat;const c=I(y.get(g.id),tt),B=I(y.get(C.id),tt);return c!==B?c-B:C.es!==g.es?C.es-g.es:Z(C.id)-Z(g.id)});const U=l[0],z=R.filter(g=>g.id!==U.id).map(g=>g.ef).filter(g=>g>U.es+nt),Y=z.length?Math.min(...z):U.es+1;if(y.get(U.id).start=Y,L=W(b,V,q),!L.ok)return{ok:!1,error:L.error}}const K=ut(b,L,H);return K.overAllocations.length&&dt("gantt-level-unresolved",`[lattice] gantt: resource leveling hit its ${st}-iteration cap with ${K.overAllocations.length} over-allocation(s) unresolved; returning the partial result.`),{ok:!0,resolved:K.overAllocations.length===0,tasks:b,schedule:L,moves:ct(et,L),remaining:K.overAllocations,iterations:j}}function ct(F,V){const H=[];for(const q of V.order){const tt=V.tasks.get(q);if(!tt||tt.isSummary)continue;const st=F.get(q);st!=null&&tt.es>st+nt&&H.push({id:q,from:st,to:tt.es,delay:tt.es-st})}return H}}),Et("packages/modules/gantt/earned-value.js",function(m,pt){"use strict";Object.defineProperty(m,"computeEarnedValue",{enumerable:!0,get:function(){return u}});const dt=pt("packages/modules/gantt/time.js").toDayNumber,ot=1e-9;function W($){if($==null||$==="")return null;const A=typeof $=="number"?$:Number($);return Number.isFinite(A)?A:null}function nt($,A,D){return D-A<=ot?$>=D?1:0:$<=A?0:$>=D?1:($-A)/(D-A)}function T($,A,D,lt,ut){const O=A?W(A[lt]):null,I=O??$.duration,M=A?W(A[ut]):null,ct=$.percentComplete==null?0:Math.max(0,Math.min(100,$.percentComplete))/100,F=$.baselineStart!=null||$.baselineEnd!=null,V=$.baselineStart!=null?$.baselineStart:$.es,H=$.baselineEnd!=null?$.baselineEnd:$.ef,q=I*nt(D,V,H),tt=I*ct;return{bac:I,pv:q,ev:tt,ac:M,hasBaseline:F}}function X($){const A=$.ac;return{bac:$.bac,pv:$.pv,ev:$.ev,ac:A,sv:$.ev-$.pv,cv:A==null?null:$.ev-A,spi:Math.abs($.pv)<ot?null:$.ev/$.pv,cpi:A==null||Math.abs(A)<ot?null:$.ev/A}}function u($,A,D={}){if(!A||!A.ok||!A.tasks||!A.order)return{ok:!1,error:{code:"NO_SCHEDULE",message:"earned value needs a successful schedule"}};const lt=D.costField||"cost",ut=D.actualCostField||"actualCost",O=D.statusDate==null?A.projectFinish:dt(D.statusDate)??A.projectFinish,I=new Map;for(const tt of Array.isArray($)?$:[])tt&&tt.id!=null&&I.set(String(tt.id),tt);const M=()=>({bac:0,pv:0,ev:0,ac:0,acAny:!1,hasBaseline:!1}),ct=new Map;for(const tt of A.order)ct.set(tt,M());const F=M();for(const tt of A.order){const st=A.tasks.get(tt);if(!st||st.isSummary)continue;const S=T(st,I.get(tt),O,lt,ut);let b=tt;for(;b!=null&&ct.has(b);){const N=ct.get(b);N.bac+=S.bac,N.pv+=S.pv,N.ev+=S.ev,S.ac!=null&&(N.ac+=S.ac,N.acAny=!0),S.hasBaseline&&(N.hasBaseline=!0),b=A.tasks.get(b).parent}F.bac+=S.bac,F.pv+=S.pv,F.ev+=S.ev,S.ac!=null&&(F.ac+=S.ac,F.acAny=!0),S.hasBaseline&&(F.hasBaseline=!0)}const V=tt=>X({bac:tt.bac,pv:tt.pv,ev:tt.ev,ac:tt.acAny?tt.ac:null}),H=new Map,q=[];for(const tt of A.order){const st=A.tasks.get(tt),S=ct.get(tt),b={id:st.id,name:st.name,isSummary:!!st.isSummary,isMilestone:!!st.isMilestone,percentComplete:st.percentComplete??null,hasBaseline:S.hasBaseline,hasActualCost:S.acAny,...V(S)};H.set(tt,b),q.push(b)}return{ok:!0,statusDate:O,byTask:H,rows:q,project:{hasActualCost:F.acAny,hasBaseline:F.hasBaseline,...V(F)}}}}),Et("packages/modules/gantt/mspdi.js",function(m,pt){"use strict";Object.defineProperty(m,"parseXml",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(m,"importMSPDI",{enumerable:!0,get:function(){return st}}),Object.defineProperty(m,"exportMSPDI",{enumerable:!0,get:function(){return b}});const dt=pt("packages/core/src/internal/util.js").warnOnce,ot=pt("packages/modules/gantt/time.js"),W=ot.toDayNumber,nt=ot.toISODate,T=Object.freeze({0:"FF",1:"FS",2:"SF",3:"SS"}),X=Object.freeze({FF:0,FS:1,SF:2,SS:3}),u=Object.freeze({1:"as-late-as-possible",2:"must-start-on",3:"must-finish-on"}),$=Object.freeze({ALAP:1,MSO:2,MFO:3});function A(j){return String(j).replace(/&(#x?[0-9a-fA-F]+|lt|gt|amp|quot|apos);/g,(K,f)=>{if(f[0]==="#"){const E=f[1]==="x"||f[1]==="X"?parseInt(f.slice(2),16):parseInt(f.slice(1),10);return Number.isFinite(E)?String.fromCodePoint(E):K}return{lt:"<",gt:">",amp:"&",quot:'"',apos:"'"}[f]??K})}function D(j){return String(j??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}function lt(j){const K=j.indexOf(":");return K<0?j:j.slice(K+1)}function ut(j){const K=String(j);let f=0;const E=[];let y=null;for(;f<K.length;){const R=K.indexOf("<",f);if(R<0)break;if(R>f&&E.length){const B=K.slice(f,R);B.trim()&&(E[E.length-1].text+=A(B))}if(K.startsWith("<?",R)){const B=K.indexOf("?>",R);f=B<0?K.length:B+2;continue}if(K.startsWith("<!--",R)){const B=K.indexOf("-->",R);f=B<0?K.length:B+3;continue}if(K.startsWith("<![CDATA[",R)){const B=K.indexOf("]]>",R);E.length&&(E[E.length-1].text+=K.slice(R+9,B<0?K.length:B)),f=B<0?K.length:B+3;continue}if(K.startsWith("<!",R)){const B=K.indexOf(">",R);f=B<0?K.length:B+1;continue}const l=K.indexOf(">",R);if(l<0)break;let U=K.slice(R+1,l).trim();if(U[0]==="/"){E.pop(),f=l+1;continue}const z=U.endsWith("/");z&&(U=U.slice(0,-1).trim());const Y=U.search(/\s/),g=lt(Y<0?U:U.slice(0,Y)),C={};if(Y>=0)for(const B of U.slice(Y).matchAll(/([\w:.-]+)\s*=\s*"([^"]*)"|([\w:.-]+)\s*=\s*'([^']*)'/g))C[lt(B[1]??B[3])]=A(B[2]??B[4]??"");const c={name:g,attrs:C,children:[],text:""};E.length?E[E.length-1].children.push(c):y||(y=c),z||E.push(c),f=l+1}return y}function O(j,K){return j?j.children.find(f=>f.name===K):void 0}function I(j,K){return j?j.children.filter(f=>f.name===K):[]}function M(j,K){const f=O(j,K);return f?f.text.trim():void 0}function ct(j){if(!j)return null;const K=String(j).match(/^\d{4}-\d{2}-\d{2}/);return W(K?K[0]:j)}function F(j,K){return`${nt(j)}T${String(K).padStart(2,"0")}:00:00`}function V(j,K){if(!j)return null;const f=String(j).match(/PT?(?:(\d+(?:\.\d+)?)H)?(?:(\d+(?:\.\d+)?)M)?(?:(\d+(?:\.\d+)?)S)?/);return f?((Number(f[1])||0)+(Number(f[2])||0)/60+(Number(f[3])||0)/3600)/K:null}function H(j,K){return`PT${Math.round((j||0)*K*1e3)/1e3}H0M0S`}function q(j,K){return(Number(j)||0)/(600*K)}function tt(j,K){return Math.round((j||0)*10*60*K)}function st(j,K={}){const f=K.hoursPerDay??8,E=ut(j);if(!E||E.name!=="Project")return dt("gantt-mspdi-not-project","[lattice] gantt: importMSPDI input is not an MSPDI <Project> document."),{ok:!1,error:"not an MSPDI <Project> document",tasks:[],dependencies:[],resources:[]};const y=ct(M(E,"StartDate")),R=O(E,"Resources"),l=new Map,U=[];for(const d of I(R,"Resource")){const p=M(d,"UID"),k=M(d,"Name");if(p==null||k==null||k==="")continue;l.set(p,k);const o=M(d,"MaxUnits");U.push({id:k,name:k,capacity:o==null?1:Number(o)})}const z=O(E,"Assignments"),Y=new Map;for(const d of I(z,"Assignment")){const p=M(d,"TaskUID"),k=M(d,"ResourceUID"),o=l.get(k);if(p==null||o==null)continue;const i=M(d,"Units");Y.has(p)||Y.set(p,[]),Y.get(p).push({resource:o,units:i==null?1:Number(i)})}const g=O(E,"Tasks"),C=[],c=[],B=new Map,at=[],gt=[];for(const d of I(g,"Task")){if(M(d,"IsNull")==="1")continue;const p=M(d,"UID");if(p==null||p==="0")continue;const k=p;B.set(p,k);const o=Number(M(d,"OutlineLevel"))||1;for(;at.length&&at[at.length-1].level>=o;)at.pop();const i=at.length?at[at.length-1].uid:null;at.push({uid:p,level:o});const n=M(d,"Summary")==="1",t=M(d,"Milestone")==="1",e={id:k,name:M(d,"Name")??k};if(i&&(e.parent=i),t&&(e.milestone=!0),!n&&!t){const _=V(M(d,"Duration"),f);_!=null&&(e.duration=_)}const s=ct(M(d,"Start"));!n&&s!=null&&(e.start=s);const a=M(d,"PercentComplete");a!=null&&(e.percentComplete=Number(a));const w=u[Number(M(d,"ConstraintType"))];if(w){e.constraint=w;const _=ct(M(d,"ConstraintDate"));_!=null&&(e.constraintDate=_)}const h=O(d,"Baseline");if(h){const _=ct(M(h,"Start")),G=ct(M(h,"Finish"));_!=null&&(e.baselineStart=_),G!=null&&(e.baselineEnd=G)}const P=Y.get(p);P&&P.length&&(e.assignments=P),C.push(e);for(const _ of I(d,"PredecessorLink"))gt.push({raw:_,uid:p})}for(const{raw:d,uid:p}of gt){const k=M(d,"PredecessorUID"),o=B.get(k),i=B.get(p);if(o==null||i==null)continue;const n=T[Number(M(d,"Type")??1)]??"FS",t=q(M(d,"LinkLag"),f),e={from:o,to:i,type:n};t&&(e.lag=t),c.push(e)}const J=S(E),r={ok:!0,tasks:C,dependencies:c,resources:U};return y!=null&&(r.projectStart=y),J&&(r.calendar=J),r}function S(j){const K=O(j,"Calendars"),f=I(K,"Calendar"),E=M(j,"CalendarUID"),y=f.find(g=>M(g,"UID")===E)??f[0];if(!y)return null;const R=O(y,"WeekDays"),l=[];let U=!1;for(const g of I(R,"WeekDay")){const C=Number(M(g,"DayType"));C>=1&&C<=7&&(U=!0,M(g,"DayWorking")==="1"&&l.push(C-1))}const z=[],Y=O(y,"Exceptions");for(const g of I(Y,"Exception")){if(M(g,"DayWorking")==="1")continue;const C=O(g,"TimePeriod"),c=ct(M(C,"FromDate")),B=ct(M(C,"ToDate"))??c;if(c!=null)for(let at=c;at<=B;at+=1)z.push(at)}return!U&&!z.length?null:{workdays:U?l:[1,2,3,4,5],holidays:z}}function b(j,K={}){const f=K.hoursPerDay??8,E=Array.isArray(j.tasks)?j.tasks:[],y=Array.isArray(j.dependencies)?j.dependencies:[],R=Array.isArray(j.resources)?j.resources:j.resources&&typeof j.resources=="object"?Object.entries(j.resources).map(([r,d])=>({id:r,name:r,capacity:d})):[],l=j.schedule&&j.schedule.ok?j.schedule:null,U=new Map;E.forEach((r,d)=>{const p=String(r.id);U.set(p,/^\d+$/.test(p)?p:String(d+1))});const z=new Map;for(const r of E){const d=r.parent!=null?String(r.parent):null;d&&(z.has(d)||z.set(d,[]),z.get(d).push(String(r.id)))}const Y=r=>z.has(r),g=r=>{let d=1,p=E.find(k=>String(k.id)===r);for(;p&&p.parent!=null;)d+=1,p=E.find(k=>String(k.id)===String(p.parent));return d},C=new Map;for(const r of y){const d=String(r.to);C.has(d)||C.set(d,[]),C.get(d).push(r)}const c=[];c.push('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'),c.push('<Project xmlns="http://schemas.microsoft.com/project">'),c.push(` <Name>${D(K.projectName||"Lattice Gantt export")}</Name>`);const B=j.projectStart!=null?W(j.projectStart):l?l.projectStart:null;B!=null&&c.push(` <StartDate>${F(B,8)}</StartDate>`);const at=Z(j.calendar);if(at&&c.push(" <CalendarUID>1</CalendarUID>"),at){c.push(" <Calendars>"),c.push(" <Calendar>"),c.push(" <UID>1</UID>"),c.push(" <Name>Standard</Name>"),c.push(" <IsBaseCalendar>1</IsBaseCalendar>"),c.push(" <WeekDays>");for(let r=0;r<=6;r+=1){const d=at.workdays.includes(r);c.push(" <WeekDay>"),c.push(` <DayType>${r+1}</DayType>`),c.push(` <DayWorking>${d?1:0}</DayWorking>`),c.push(" </WeekDay>")}if(c.push(" </WeekDays>"),at.holidays.length){c.push(" <Exceptions>");for(const r of at.holidays)c.push(" <Exception>"),c.push(" <DayWorking>0</DayWorking>"),c.push(` <TimePeriod><FromDate>${F(r,0)}</FromDate><ToDate>${F(r,23)}</ToDate></TimePeriod>`),c.push(" </Exception>");c.push(" </Exceptions>")}c.push(" </Calendar>"),c.push(" </Calendars>")}c.push(" <Tasks>");for(const r of E){const d=String(r.id),p=U.get(d),k=Y(d),o=!!r.milestone||!k&&Number(r.duration)===0,i=l?l.tasks.get(d):null;c.push(" <Task>"),c.push(` <UID>${D(p)}</UID>`),c.push(` <ID>${D(p)}</ID>`),c.push(` <Name>${D(r.name!=null?r.name:d)}</Name>`),c.push(` <OutlineLevel>${g(d)}</OutlineLevel>`),c.push(` <Summary>${k?1:0}</Summary>`),c.push(` <Milestone>${o?1:0}</Milestone>`);const n=i?i.duration:r.duration!=null?Number(r.duration):null;n!=null&&c.push(` <Duration>${H(n,f)}</Duration>`),c.push(" <DurationFormat>7</DurationFormat>");const t=i?i.es:r.start!=null?W(r.start):null,e=i?i.ef:r.end!=null?W(r.end):t!=null&&n!=null?t+n:null;t!=null&&c.push(` <Start>${F(t,8)}</Start>`),e!=null&&c.push(` <Finish>${F(e,17)}</Finish>`);const s=i?i.percentComplete:r.percentComplete;s!=null&&c.push(` <PercentComplete>${Math.round(Number(s))}</PercentComplete>`);const a=L(r.constraint??r.constraintType);if(a!=null){c.push(` <ConstraintType>${a}</ConstraintType>`);const P=et(r.constraintDate??r.constraintAt??r.at);P!=null&&c.push(` <ConstraintDate>${F(P,8)}</ConstraintDate>`)}const w=et(r.baselineStart??(r.baseline&&r.baseline.start)),h=et(r.baselineEnd??(r.baseline&&r.baseline.end));(w!=null||h!=null)&&(c.push(" <Baseline>"),c.push(" <Number>0</Number>"),w!=null&&c.push(` <Start>${F(w,8)}</Start>`),h!=null&&c.push(` <Finish>${F(h,17)}</Finish>`),w!=null&&h!=null&&c.push(` <Duration>${H(h-w,f)}</Duration>`),c.push(" </Baseline>"));for(const P of C.get(d)||[]){const _=U.get(String(P.from));_!=null&&(c.push(" <PredecessorLink>"),c.push(` <PredecessorUID>${D(_)}</PredecessorUID>`),c.push(` <Type>${X[P.type?String(P.type).toUpperCase():"FS"]??1}</Type>`),P.lag&&(c.push(` <LinkLag>${tt(Number(P.lag),f)}</LinkLag>`),c.push(" <LagFormat>7</LagFormat>")),c.push(" </PredecessorLink>"))}c.push(" </Task>")}c.push(" </Tasks>");const gt=new Map;R.forEach((r,d)=>{const p=String(r.name??r.id??`Resource ${d+1}`);gt.set(p,{uid:String(d+1),capacity:r.capacity??r.maxUnits??1})});const J=[];for(const r of E)for(const d of N(r))gt.has(d.resource)||gt.set(d.resource,{uid:String(gt.size+1),capacity:1}),J.push({taskUid:U.get(String(r.id)),resUid:gt.get(d.resource).uid,units:d.units});c.push(" <Resources>");for(const[r,d]of gt)c.push(" <Resource>"),c.push(` <UID>${D(d.uid)}</UID>`),c.push(` <ID>${D(d.uid)}</ID>`),c.push(` <Name>${D(r)}</Name>`),c.push(` <MaxUnits>${Number(d.capacity)}</MaxUnits>`),c.push(" </Resource>");return c.push(" </Resources>"),c.push(" <Assignments>"),J.forEach((r,d)=>{c.push(" <Assignment>"),c.push(` <UID>${d+1}</UID>`),c.push(` <TaskUID>${D(r.taskUid)}</TaskUID>`),c.push(` <ResourceUID>${D(r.resUid)}</ResourceUID>`),c.push(` <Units>${Number(r.units)}</Units>`),c.push(" </Assignment>")}),c.push(" </Assignments>"),c.push("</Project>"),c.join(`
6
+ var qt=Object.create(null),Xt=Object.create(null);function Et(m,pt){qt[m]=pt}function Jt(m){var pt=Xt[m];if(pt)return pt;var Mt=Object.create(null);Xt[m]=Mt;var dt=qt[m];if(!dt)throw new Error("[lattice] missing module: "+m);return dt(Mt,Jt),Mt}Et("packages/core/src/internal/util.js",function(m,pt){"use strict";Object.defineProperty(m,"VERSION",{enumerable:!0,get:function(){return ot}}),Object.defineProperty(m,"reportedWarnings",{enumerable:!0,get:function(){return D}}),Object.defineProperty(m,"warnOnce",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(m,"infoOnce",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(m,"resetWarnings",{enumerable:!0,get:function(){return O}}),Object.defineProperty(m,"fail",{enumerable:!0,get:function(){return I}}),Object.defineProperty(m,"invariant",{enumerable:!0,get:function(){return M}}),Object.defineProperty(m,"DEV",{enumerable:!0,get:function(){return ct}}),Object.defineProperty(m,"isObject",{enumerable:!0,get:function(){return F}}),Object.defineProperty(m,"isFunction",{enumerable:!0,get:function(){return V}}),Object.defineProperty(m,"isNil",{enumerable:!0,get:function(){return H}}),Object.defineProperty(m,"isBlank",{enumerable:!0,get:function(){return q}}),Object.defineProperty(m,"isCtor",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(m,"pathGetter",{enumerable:!0,get:function(){return S}}),Object.defineProperty(m,"pathSetter",{enumerable:!0,get:function(){return N}}),Object.defineProperty(m,"getPath",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(m,"setPath",{enumerable:!0,get:function(){return L}}),Object.defineProperty(m,"humanise",{enumerable:!0,get:function(){return et}}),Object.defineProperty(m,"escapeHtml",{enumerable:!0,get:function(){return K}}),Object.defineProperty(m,"titleCase",{enumerable:!0,get:function(){return f}}),Object.defineProperty(m,"expand",{enumerable:!0,get:function(){return E}}),Object.defineProperty(m,"toArray",{enumerable:!0,get:function(){return y}}),Object.defineProperty(m,"merge",{enumerable:!0,get:function(){return l}}),Object.defineProperty(m,"mergeRow",{enumerable:!0,get:function(){return U}}),Object.defineProperty(m,"Lru",{enumerable:!0,get:function(){return z}}),Object.defineProperty(m,"collator",{enumerable:!0,get:function(){return g}}),Object.defineProperty(m,"defaultCompare",{enumerable:!0,get:function(){return C}}),Object.defineProperty(m,"now",{enumerable:!0,get:function(){return c}}),Object.defineProperty(m,"nextFrame",{enumerable:!0,get:function(){return at}}),Object.defineProperty(m,"cancelFrame",{enumerable:!0,get:function(){return gt}}),Object.defineProperty(m,"frameBatched",{enumerable:!0,get:function(){return J}}),Object.defineProperty(m,"settleDebounce",{enumerable:!0,get:function(){return r}}),Object.defineProperty(m,"whenIdle",{enumerable:!0,get:function(){return d}}),Object.defineProperty(m,"uid",{enumerable:!0,get:function(){return k}});const Mt="1.71.3";async function dt(){return Mt}const ot="1.71.3",W=new Set,nt=2e3;function T(o){if(W.add(o),W.size>nt){const i=W.values().next().value;i!==void 0&&W.delete(i)}}const X=[],u=500;function $(o,i,n){X.push({key:o,level:i,message:n.map(t=>typeof t=="string"?t:A(t)).join(" "),at:Date.now()}),X.length>u&&X.shift()}function A(o){if(o instanceof Error)return o.message;try{return JSON.stringify(o)}catch{return String(o)}}function D(){return X.map(o=>({...o}))}function lt(o,...i){W.has(o)||(T(o),$(o,"warn",i),console.warn("[lattice]",...i))}function ut(o,...i){W.has(o)||(T(o),$(o,"info",i),console.info("[lattice]",...i))}function O(){W.clear(),X.length=0}function I(o,i){const n=new Error(`[lattice] ${o}`);throw i!==void 0&&(n.cause=i),n}function M(o,i){o||I(i)}const ct=(()=>{try{return!(typeof process<"u"&&process.env&&process.env.NODE_ENV==="production")}catch{return!0}})();function F(o){return o!==null&&typeof o=="object"&&!Array.isArray(o)}function V(o){return typeof o=="function"}function H(o){return o==null}function q(o){return o==null||o===""}function tt(o){return typeof o!="function"?!1:/^class[\s{]/.test(Function.prototype.toString.call(o))?!0:!!(o.prototype&&Object.getOwnPropertyNames(o.prototype).length>1)}const st=new Map;function S(o){let i=st.get(o);if(i)return i;if(!o.includes("."))i=n=>n?.[o];else{const n=o.split("."),t=n.length;i=e=>{let s=e;for(let a=0;a<t;a++){if(s==null)return;s=s[n[a]]}return s}}return st.set(o,i),i}const b=new Map;function N(o){let i=b.get(o);if(i)return i;if(!o.includes("."))i=(n,t)=>{n!=null&&(n[o]=t)};else{const n=o.split("."),t=n.length-1;i=(e,s)=>{let a=e;for(let w=0;w<t;w++){if(a==null)return;const h=n[w];a[h]==null&&(a[h]={}),a=a[h]}a!=null&&(a[n[t]]=s)}}return b.set(o,i),i}function Z(o,i){return S(i)(o)}function L(o,i,n){N(i)(o,n)}function et(o){return o?(o.includes(".")?o.slice(o.lastIndexOf(".")+1):o).replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/\s+/g," ").trim().replace(/^./,n=>n.toUpperCase()):""}const j={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function K(o){const i=o==null?"":String(o);return/[&<>"']/.test(i)?i.replace(/[&<>"']/g,n=>j[n]):i}function f(o){return String(o).replace(/\w\S*/g,i=>i[0].toUpperCase()+i.slice(1).toLowerCase())}function E(o,i,n){if(o!==void 0)return o===!0?{enabled:!0,...n}:o===!1?{enabled:!1}:F(o)?o:{[i]:o,enabled:!0}}function y(o){return o==null?[]:Array.isArray(o)?o:[o]}const R=Object.freeze(new Set(["__proto__","constructor","prototype"]));function l(o,i){if(!F(o))return F(i)?{...i}:i;if(!F(i))return i===void 0?o:i;const n={...o};for(const t of Object.keys(i)){if(R.has(t))continue;const e=i[t];e!==void 0&&(n[t]=F(e)&&F(n[t])?l(n[t],e):e)}return n}function U(o,i){if(!F(o)||!F(i)||o===i)return i;const n=Object.create(Object.getPrototypeOf(o));return Object.assign(n,o,i),n}class z{#n;#o=new Map;#t;constructor(i=256,n=null){this.#n=i,this.#t=n}get size(){return this.#o.size}get max(){return this.#n}set max(i){this.#n=i,this.#e()}has(i){return this.#o.has(i)}get(i){const n=this.#o;if(!n.has(i))return;const t=n.get(i);return n.delete(i),n.set(i,t),t}peek(i){return this.#o.get(i)}set(i,n){const t=this.#o;return t.has(i)&&t.delete(i),t.set(i,n),this.#e(),n}delete(i){const n=this.#o.get(i);return this.#o.delete(i)&&this.#t&&this.#t(n,i),n}clear(){if(this.#t)for(const[i,n]of this.#o)this.#t(n,i);this.#o.clear()}keys(){return this.#o.keys()}values(){return this.#o.values()}#e(){const i=this.#o;for(;i.size>this.#n;){const n=i.keys().next().value,t=i.get(n);i.delete(n),this.#t&&this.#t(t,n)}}}const Y=new Map;function g(o,i){const n=`${o||""}|${i?JSON.stringify(i):""}`;let t=Y.get(n);return t||(t=new Intl.Collator(o||void 0,{numeric:!0,sensitivity:"variant",...i}),Y.set(n,t)),t}function C(o,i){if(o===i)return 0;if(o==null)return 1;if(i==null)return-1;if(typeof o=="number"&&typeof i=="number")return Number.isNaN(o)?Number.isNaN(i)?0:1:Number.isNaN(i)||o<i?-1:o>i?1:0;const n=String(o),t=String(i);return n<t?-1:n>t?1:0}function c(){return typeof performance<"u"&&performance.now?performance.now():Date.now()}const B=typeof requestAnimationFrame=="function";function at(o){return B?requestAnimationFrame(o):setTimeout(()=>o(c()),16)}function gt(o){o!=null&&(B?cancelAnimationFrame(o):clearTimeout(o))}function J(o){let i=null,n=null;const t=()=>{i=null;const s=n;n=null,o(...s||[])},e=(...s)=>{n=s,i===null&&(i=at(t))};return e.cancel=()=>{gt(i),i=null,n=null},e.flush=()=>{i!==null&&(gt(i),t())},e}function r(o,i){let n=null,t=null;const e=()=>{if(n=null,t===null)return;const w=t;t=null,o(...w),s()},s=()=>{n=setTimeout(e,i),typeof n?.unref=="function"&&n.unref()},a=(...w)=>{n===null?(o(...w),s()):(t=w,clearTimeout(n),s())};return a.flush=()=>{if(n!==null&&clearTimeout(n),n=null,t===null)return;const w=t;t=null,o(...w)},a.cancel=()=>{n!==null&&clearTimeout(n),n=null,t=null},a.pending=()=>n!==null||t!==null,a}function d(o,i=50){return typeof requestIdleCallback=="function"?requestIdleCallback(o,{timeout:i}):setTimeout(()=>o({timeRemaining:()=>0,didTimeout:!0}),1)}let p=0;function k(o="l"){return`${o}${(++p).toString(36)}`}}),Et("packages/modules/gantt/time.js",function(m,pt){"use strict";Object.defineProperty(m,"toDayNumber",{enumerable:!0,get:function(){return W}}),Object.defineProperty(m,"fromDayNumber",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(m,"toISODate",{enumerable:!0,get:function(){return T}}),Object.defineProperty(m,"resolveProjectEpoch",{enumerable:!0,get:function(){return X}});const dt=pt("packages/core/src/internal/util.js").warnOnce,ot=864e5;function W(u){if(u==null||u==="")return null;if(typeof u=="number")return Number.isFinite(u)?u:null;if(u instanceof Date)return Number.isFinite(u.getTime())?Math.floor(Date.UTC(u.getFullYear(),u.getMonth(),u.getDate())/ot):null;const $=Date.parse(u);return Number.isFinite($)?Math.floor($/ot):null}function nt(u){return Number.isFinite(u)?new Date(Math.round(u)*ot):null}function T(u){const $=nt(u);return $?$.toISOString().slice(0,10):null}function X(u){if(u==null||u==="")return 0;const $=W(u);return Number.isFinite($)?$:(dt(`gantt.projectEpoch:${String(u)}`,`[lattice] gantt: projectEpoch ${JSON.stringify(u)} is not a date or a day number; the plan is rendered against the Unix epoch (day 0 = 1970-01-01).`),0)}}),Et("packages/modules/gantt/calendar.js",function(m,pt){"use strict";Object.defineProperty(m,"createCalendar",{enumerable:!0,get:function(){return nt}});const Mt=pt("packages/modules/gantt/time.js"),dt=Mt.fromDayNumber,ot=Mt.toDayNumber,W=Object.freeze([1,2,3,4,5]);function nt(T,X=0){if(T==null)return null;let u,$;T==="weekends"?(u=W,$=new Set):(u=Array.isArray(T.workdays)&&T.workdays.length?T.workdays.map(Number).filter(V=>V>=0&&V<=6):W,$=new Set((Array.isArray(T.holidays)?T.holidays:[]).map(V=>ot(V)).filter(V=>V!=null)));const A=new Set(u);if(A.size===7&&$.size===0||A.size===0)return null;const D=V=>{const H=dt(V);return H?A.has(H.getUTCDay())&&!$.has(V):!1},lt=V=>{let H=V;for(;!D(H);)H+=1;return H},ut=V=>{let H=V;for(;!D(H);)H-=1;return H},O=lt(Math.round(Number.isFinite(X)?X:0)),I=new Map([[0,O]]),M=new Map([[O,0]]);return{isWorking:D,nextWorking:lt,dayOf:V=>{const H=Math.round(V);if(I.has(H))return I.get(H);if(H>0){let st=H-1;for(;!I.has(st);)st-=1;let S=I.get(st);for(let b=st+1;b<=H;b+=1)S=lt(S+1),I.set(b,S),M.set(S,b);return I.get(H)}let q=H+1;for(;!I.has(q);)q+=1;let tt=I.get(q);for(let st=q-1;st>=H;st-=1)tt=ut(tt-1),I.set(st,tt),M.set(tt,st);return I.get(H)},indexOf:V=>{const H=lt(Math.round(V));if(M.has(H))return M.get(H);if(H>O){let st=0,S=O;for(;M.has(lt(S+1))&&S<H;)S=lt(S+1),st=M.get(S);for(;S<H;)S=lt(S+1),st+=1,I.set(st,S),M.set(S,st);return st}let q=0,tt=O;for(;tt>H;)tt=ut(tt-1),q-=1,I.set(q,tt),M.set(tt,q);return q},anchor:O}}}),Et("packages/modules/gantt/schedule.js",function(m,pt){"use strict";Object.defineProperty(m,"LINK_TYPES",{enumerable:!0,get:function(){return X}}),Object.defineProperty(m,"CONSTRAINT_TYPES",{enumerable:!0,get:function(){return u}}),Object.defineProperty(m,"EPS",{enumerable:!0,get:function(){return A}}),Object.defineProperty(m,"SCHEDULE_ERROR",{enumerable:!0,get:function(){return D}}),Object.defineProperty(m,"TASK_FIELDS",{enumerable:!0,get:function(){return O}}),Object.defineProperty(m,"taskIdReader",{enumerable:!0,get:function(){return M}}),Object.defineProperty(m,"taskFieldWriters",{enumerable:!0,get:function(){return ct}}),Object.defineProperty(m,"normalizeTasks",{enumerable:!0,get:function(){return V}}),Object.defineProperty(m,"buildTree",{enumerable:!0,get:function(){return H}}),Object.defineProperty(m,"normalizeLinkSpec",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(m,"normalizeDependencies",{enumerable:!0,get:function(){return st}}),Object.defineProperty(m,"expandDependencies",{enumerable:!0,get:function(){return S}}),Object.defineProperty(m,"topoOrder",{enumerable:!0,get:function(){return b}}),Object.defineProperty(m,"computeSchedule",{enumerable:!0,get:function(){return et}}),Object.defineProperty(m,"findViolations",{enumerable:!0,get:function(){return E}});const dt=pt("packages/core/src/internal/util.js").warnOnce,W=pt("packages/modules/gantt/calendar.js").createCalendar,T=pt("packages/modules/gantt/time.js").toDayNumber,X=["FS","SS","FF","SF"],u=["MSO","MFO","ALAP"],$=Object.freeze({mso:"MSO","must-start-on":"MSO",muststarton:"MSO","start-on":"MSO",mfo:"MFO","must-finish-on":"MFO",mustfinishon:"MFO","finish-on":"MFO",alap:"ALAP","as-late-as-possible":"ALAP",aslateaspossible:"ALAP",late:"ALAP"}),A=1e-9,D={CYCLE:"cycle",DUPLICATE_ID:"duplicate-id",UNKNOWN_TASK:"unknown-task",BAD_DURATION:"bad-duration",BAD_LINK_TYPE:"bad-link-type",SELF_DEPENDENCY:"self-dependency",UNKNOWN_PARENT:"unknown-parent",PARENT_CYCLE:"parent-cycle",DEP_ACROSS_HIERARCHY:"dep-across-hierarchy"};function lt(y){if(y==null||y==="")return null;const R=typeof y=="number"?y:Number(y);return Number.isFinite(R)?R:null}function ut(y){return y==null||y===""?null:T(y)}const O=Object.freeze(["id","name","start","end","duration","milestone","percentComplete","parent","baselineStart","baselineEnd","constraint","constraintDate"]);function I(y){const R=y&&typeof y=="object"?y:{},l={};for(const U of O){const z=R[U];if(typeof z=="function")l[U]=z;else if(typeof z=="string"&&z!==""){const Y=z;l[U]=g=>g[Y]}else l[U]=Y=>Y[U]}return l}function M(y){return I(y).id}function ct(y){const R=y&&typeof y=="object"?y:{},l={};for(const U of O){const z=R[U];typeof z=="string"&&z!==""?l[U]=z:typeof z=="function"?l[U]=null:l[U]=U}return l}function F(y,R){const l=R.constraint(y),U=l??(y&&y.constraintType);if(U==null||U==="")return null;const z=$[String(U).toLowerCase().replace(/\s+/g,"-")]??(u.includes(String(U).toUpperCase())?String(U).toUpperCase():null);if(!z)return null;const Y=ut(R.constraintDate(y)??y.constraintAt??y.at);return{type:z,at:Y}}function V(y,R){const l=new Map,U=[],z=I(R);if(!Array.isArray(y))return{ok:!1,error:{code:D.BAD_DURATION,message:"tasks must be an array"},order:U,byId:l};for(const Y of y){const g=Y?z.id(Y):null,C=g!=null?String(g):null;if(C==null)return{ok:!1,error:{code:D.UNKNOWN_TASK,message:"every task needs an id"},order:U,byId:l};if(l.has(C))return{ok:!1,error:{code:D.DUPLICATE_ID,message:`duplicate task id "${C}"`,id:C},order:U,byId:l};const c=ut(z.start(Y)),B=ut(z.end(Y)),at=z.milestone(Y)===!0;let gt=at?0:lt(z.duration(Y));if(gt==null&&c!=null&&B!=null&&(gt=B-c),gt!=null&&gt<0)return{ok:!1,error:{code:D.BAD_DURATION,message:`task "${C}" has negative duration ${gt}`,id:C},order:U,byId:l};const J=z.name(Y),r=z.parent(Y);l.set(C,{id:C,name:J!=null?String(J):C,duration:gt,milestoneFlag:at,earliestStart:c,placedStart:c,placedEnd:B,percentComplete:lt(z.percentComplete(Y)),parent:r!=null?String(r):null,constraint:F(Y,z),baselineStart:ut(z.baselineStart(Y)??(Y.baseline&&Y.baseline.start)),baselineEnd:ut(z.baselineEnd(Y)??(Y.baseline&&Y.baseline.end))}),U.push(C)}return{ok:!0,order:U,byId:l}}function H(y,R){const l=new Map(y.map(C=>[C,[]]));for(const C of y){const c=R.get(C).parent;if(c!=null){if(!R.has(c))return{ok:!1,error:{code:D.UNKNOWN_PARENT,message:`task "${C}" names unknown parent "${c}"`,id:C}};l.get(c).push(C)}}for(const C of y){const c=new Set;let B=R.get(C).parent;for(;B!=null;){if(B===C||c.has(B))return{ok:!1,error:{code:D.PARENT_CYCLE,message:`parent cycle at "${C}"`,id:C}};c.add(B),B=R.get(B)?.parent??null}}const U=C=>l.get(C).length>0,z=new Map,Y=C=>{if(z.has(C))return z.get(C);const c=l.get(C),B=c.length===0?[C]:c.flatMap(at=>Y(at));return z.set(C,B),B};return{ok:!0,children:l,isSummary:U,descendantLeaves:Y,ancestors:C=>{const c=new Set;let B=R.get(C).parent;for(;B!=null;)c.add(B),B=R.get(B).parent;return c}}}const q=/^\s*(FS|SS|FF|SF)\s*(?:([+-])\s*(\d+(?:\.\d+)?))?\s*$/i;function tt(y){const R={...y||null};if(typeof R.type!="string")return R;const l=q.exec(R.type);if(!l||!l[2])return R;const U=(l[2]==="-"?-1:1)*Number(l[3]);R.type=l[1].toUpperCase();const z=lt(y.lag);return z!=null&&z!==U?(dt(`gantt-link-shorthand-${String(y.type)}-${z}`,`[lattice] gantt: dependency type ${JSON.stringify(y.type)} carries a lag of ${U} but lag: ${z} was also given; the explicit lag wins. Give one or the other.`),R):(R.lag=U,R)}function st(y,R,l={}){const U=[];if(y==null)return{ok:!0,edges:U};if(!Array.isArray(y))return{ok:!1,error:{code:D.UNKNOWN_TASK,message:"dependencies must be an array"},edges:U};const z=typeof l.ancestors=="function"?l.ancestors:null;for(const Y of y){const g=tt(Y),C=g&&g.from!=null?String(g.from):null,c=g&&g.to!=null?String(g.to):null,B=g&&g.type!=null?String(g.type).toUpperCase():"FS",at=lt(g.lag)??0;if(C==null||c==null)return{ok:!1,error:{code:D.UNKNOWN_TASK,message:"a dependency needs both `from` and `to`"},edges:U};if(!R.has(C))return{ok:!1,error:{code:D.UNKNOWN_TASK,message:`dependency references unknown task "${C}"`,id:C},edges:U};if(!R.has(c))return{ok:!1,error:{code:D.UNKNOWN_TASK,message:`dependency references unknown task "${c}"`,id:c},edges:U};if(C===c)return{ok:!1,error:{code:D.SELF_DEPENDENCY,message:`task "${C}" depends on itself`,id:C},edges:U};if(!X.includes(B))return{ok:!1,error:{code:D.BAD_LINK_TYPE,message:`unknown link type "${B}" (expected one of ${X.join("/")})`},edges:U};if(z&&(z(C).has(c)||z(c).has(C)))return{ok:!1,error:{code:D.DEP_ACROSS_HIERARCHY,message:`dependency between "${C}" and "${c}" crosses their own parent/child hierarchy`,from:C,to:c},edges:U};U.push({from:C,to:c,type:B,lag:at})}return{ok:!0,edges:U}}function S(y,R){const l=new Set,U=[];for(const z of y){(R.isSummary(z.from)||R.isSummary(z.to))&&z.type!=="FS"&&dt(`gantt-summary-link-${z.type}-${z.from}-${z.to}`,`[lattice] gantt: ${z.type} link with a summary endpoint (${z.from} -> ${z.to}) is expanded to descendant leaves — a conservative v1 reading; only FS is exact for summary endpoints.`);for(const g of R.descendantLeaves(z.from))for(const C of R.descendantLeaves(z.to)){if(g===C)continue;const c=[g,C,z.type,z.lag].join("");l.has(c)||(l.add(c),U.push({from:g,to:C,type:z.type,lag:z.lag}))}}return U}function b(y,R){const l=new Map(y.map(g=>[g,0])),U=new Map(y.map(g=>[g,[]]));for(const g of R)N(l,g.to),U.get(g.from).push(g.to);const z=y.filter(g=>l.get(g)===0),Y=[];for(;z.length;){const g=z.shift();Y.push(g);for(const C of U.get(g)){const c=l.get(C)-1;l.set(C,c),c===0&&z.push(C)}}return Y.length===y.length?{ok:!0,sorted:Y}:{ok:!1,cycle:Z(y,U,new Set(Y))}}function N(y,R){y.set(R,y.get(R)+1)}function Z(y,R,l){const U=y.find(C=>!l.has(C)),z=[],Y=new Map;let g=U;for(;g!=null&&!Y.has(g);)Y.set(g,z.length),z.push(g),g=R.get(g).find(C=>!l.has(C));return g==null?z:z.slice(Y.get(g)).concat(g)}function L(y,R,l,U,z,Y=new Map){const g=b(y,l);if(!g.ok)return dt(`gantt-cycle-${g.cycle.join(">")}`,`[lattice] gantt: dependency cycle detected (${g.cycle.join(" -> ")}); schedule refused.`),{ok:!1,error:{code:D.CYCLE,message:`dependency cycle: ${g.cycle.join(" -> ")}`,cycle:g.cycle}};const C=g.sorted,c=new Map(y.map(k=>[k,[]])),B=new Map(y.map(k=>[k,[]]));for(const k of l)c.get(k.to).push(k),B.get(k.from).push(k);const at=new Map;for(const k of y){const o=R.get(k);at.set(k,{id:k,name:o.name,duration:o.duration,es:0,ef:0,ls:0,lf:0,totalFloat:0,critical:!1,percentComplete:o.percentComplete,parent:o.parent,isSummary:!1,isMilestone:o.duration===0,children:[]})}const gt=[];for(const k of C){const o=R.get(k),i=at.get(k);let n=Math.max(U,o.earliestStart??U);for(const e of c.get(k)){const s=at.get(e.from);let a;switch(e.type){case"FS":a=s.ef+e.lag;break;case"SS":a=s.es+e.lag;break;case"FF":a=s.ef+e.lag-i.duration;break;case"SF":a=s.es+e.lag-i.duration;break;default:a=-1/0}a>n&&(n=a)}const t=Y.get(k);if(t&&t.type!=="ALAP"&&t.at!=null){const e=t.type==="MFO"?t.at-i.duration:t.at;e<n-A?gt.push({id:k,type:t.type,at:t.at,earliestFeasible:n}):n=e,i.pinned=!0}i.es=n,i.ef=n+i.duration}const J=y.length?Math.max(...y.map(k=>at.get(k).ef)):U,r=Number.isFinite(z)?z:J;for(let k=C.length-1;k>=0;k-=1){const o=C[k],i=at.get(o);let n=r;for(const t of B.get(o)){const e=at.get(t.to);let s;switch(t.type){case"FS":s=e.ls-t.lag;break;case"SS":s=e.ls-t.lag+i.duration;break;case"FF":s=e.lf-t.lag;break;case"SF":s=e.lf-t.lag+i.duration;break;default:s=1/0}s<n&&(n=s)}i.pinned&&(n=i.ef),i.lf=n,i.ls=n-i.duration,i.totalFloat=i.ls-i.es,i.critical=i.totalFloat<=A}for(const k of y){const o=Y.get(k);if(!o||o.type!=="ALAP")continue;const i=at.get(k);i.es=i.ls,i.ef=i.lf,i.totalFloat=0,i.critical=!0}const d=y.filter(k=>at.get(k).critical),p=f(y,l,at);return{ok:!0,tasks:at,critical:d,criticalPaths:p,projectFinish:J,conflicts:gt}}function et(y,R=[],l={}){const U=ut(l.projectStart)??0,z=ut(l.deadline),Y=W(l.calendar,U),g=a=>a==null?null:Y?Y.indexOf(a):a,C=a=>Y?Y.dayOf(a):a,c=V(y,l.fields);if(!c.ok)return{ok:!1,error:c.error};const{order:B,byId:at}=c,gt=H(B,at);if(!gt.ok)return{ok:!1,error:gt.error};const J=st(R,at,gt);if(!J.ok)return{ok:!1,error:J.error};for(const a of B)if(!gt.isSummary(a)&&at.get(a).duration==null)return{ok:!1,error:{code:D.BAD_DURATION,message:`task "${a}" has no duration and no start+end to derive one`,id:a}};const r=B.filter(a=>!gt.isSummary(a)),d=new Map(r.map(a=>{const w=at.get(a);return[a,{...w,earliestStart:g(w.earliestStart)}]})),p=new Map;for(const a of r){const w=at.get(a).constraint;w&&p.set(a,{type:w.type,at:g(w.at)})}const k=Y?Y.indexOf(U):U,o=z==null?void 0:g(z),i=S(J.edges,gt),n=L(r,d,i,k,o,p);if(!n.ok)return{ok:!1,error:n.error};const t=n.tasks;for(const a of r){const w=t.get(a);w.es=C(w.es),w.ef=C(w.ef),w.ls=C(w.ls),w.lf=C(w.lf),j(w,at.get(a).baselineStart,at.get(a).baselineEnd)}for(let a=B.length-1;a>=0;a-=1){const w=B[a];gt.isSummary(w)&&t.set(w,K(w,at.get(w),gt,t))}for(const a of B)gt.isSummary(a)&&(t.get(a).children=gt.children.get(a).slice());const e=Y?Y.anchor:U,s=C(n.projectFinish);return{ok:!0,tasks:t,order:B,critical:n.critical,criticalPaths:n.criticalPaths,projectStart:e,projectFinish:s,projectDuration:s-e,conflicts:n.conflicts||[],calendar:!!Y}}function j(y,R,l){R==null&&l==null||(y.baselineStart=R??null,y.baselineEnd=l??null,y.startVariance=R==null?null:y.es-R,y.finishVariance=l==null?null:y.ef-l,y.durationVariance=R==null||l==null?null:y.ef-y.es-(l-R))}function K(y,R,l,U){const z=l.children.get(y).map(p=>U.get(p)),Y=Math.min(...z.map(p=>p.es)),g=Math.max(...z.map(p=>p.ef)),C=Math.min(...z.map(p=>p.ls)),c=Math.max(...z.map(p=>p.lf)),B=l.descendantLeaves(y).map(p=>U.get(p)),at=B.reduce((p,k)=>p+k.duration,0),gt=at>A?B.reduce((p,k)=>p+k.duration*(k.percentComplete??0),0)/at:null,J={id:y,name:R.name,duration:g-Y,es:Y,ef:g,ls:C,lf:c,totalFloat:C-Y,critical:z.some(p=>p.critical),percentComplete:gt,parent:R.parent,isSummary:!0,isMilestone:!1,children:[]},r=B.map(p=>p.baselineStart).filter(p=>p!=null),d=B.map(p=>p.baselineEnd).filter(p=>p!=null);return(r.length||d.length)&&j(J,r.length?Math.min(...r):null,d.length?Math.max(...d):null),J}function f(y,R,l){const U=new Map(y.map(c=>[c,[]])),z=new Set;for(const c of R){const B=l.get(c.from),at=l.get(c.to);if(!B.critical||!at.critical)continue;let gt;switch(c.type){case"FS":gt=B.ef+c.lag;break;case"SS":gt=B.es+c.lag;break;case"FF":gt=B.ef+c.lag-at.duration;break;case"SF":gt=B.es+c.lag-at.duration;break;default:gt=-1/0}Math.abs(gt-at.es)<=A&&(U.get(c.from).push(c.to),z.add(c.to))}const Y=y.filter(c=>l.get(c).critical&&!z.has(c)),g=[],C=(c,B)=>{const at=U.get(c);if(!at.length){g.push(B);return}for(const gt of at)C(gt,B.concat(gt))};for(const c of Y)C(c,[c]);return g}function E(y,R,l){if(!R||!R.ok)return[];const U=[],z=I(l);for(const Y of y){const g=Y?z.id(Y):null,C=g!=null?String(g):null;if(C==null||!R.tasks.has(C))continue;const c=R.tasks.get(C);if(c.isSummary)continue;const B=lt(z.start(Y));B!=null&&B<c.es-A&&U.push({id:C,placedStart:B,earliestStart:c.es,by:c.es-B})}return U}}),Et("packages/modules/gantt/resources.js",function(m,pt){"use strict";Object.defineProperty(m,"parseAssignments",{enumerable:!0,get:function(){return A}}),Object.defineProperty(m,"normalizeCapacities",{enumerable:!0,get:function(){return D}}),Object.defineProperty(m,"sweepLoad",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(m,"computeResourceLoad",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(m,"levelResources",{enumerable:!0,get:function(){return M}});const dt=pt("packages/core/src/internal/util.js").warnOnce,ot=pt("packages/modules/gantt/schedule.js"),W=ot.computeSchedule,nt=ot.EPS,T=ot.taskIdReader,u=pt("packages/modules/gantt/calendar.js").createCalendar;function $(F){if(F==null||F==="")return null;const V=typeof F=="number"?F:Number(F);return Number.isFinite(V)?V:null}function A(F){if(F&&Array.isArray(F.assignments))return F.assignments.map(q=>{const tt=q&&(q.resource??q.name??q.id);if(tt==null||tt==="")return null;const st=$(q.units)??$(q.allocation)??1;return{resource:String(tt),units:st}}).filter(Boolean);const V=F?F.assignee??F.assignees??F.owner:null;return(Array.isArray(V)?V:V==null||V===""?[]:[V]).map(q=>String(q)).filter(q=>q!=="").map(q=>({resource:q,units:1}))}function D(F,V){const H=new Map;if(Array.isArray(F))for(const q of F){const tt=q&&(q.id??q.name??q.resource);if(tt==null||tt==="")continue;const st=$(q.capacity??q.maxUnits??q.max??q.units);H.set(String(tt),st??V)}else if(F&&typeof F=="object")for(const[q,tt]of Object.entries(F)){const st=$(tt);H.set(String(q),st??V)}return H}function lt(F){if(!F.length)return[];const V=new Set;for(const tt of F)V.add(tt.s),V.add(tt.e);const H=[...V].sort((tt,st)=>tt-st),q=[];for(let tt=0;tt<H.length-1;tt+=1){const st=H[tt],S=H[tt+1];if(S<=st)continue;let b=0;const N=[];for(const Z of F)Z.s<=st&&Z.e>=S&&(b+=Z.units,N.push(Z.taskId));N.length&&q.push({s:st,e:S,load:b,taskIds:N})}return q}function ut(F,V,H={}){const q={ok:!1,resources:[],overAllocations:[],byResource:new Map};if(!V||!V.ok)return q;const tt=$(H.defaultCapacity)??1,st=D(H.resources,tt),S=H.calendar!=null?u(H.calendar,V.projectStart):null,b=E=>st.has(E)?st.get(E):tt,N=E=>S?S.indexOf(E):E,Z=E=>S?S.dayOf(E):E,L=T(H.fields),et=new Map;for(const E of V.order){const y=V.tasks.get(E);if(!y||y.isSummary)continue;const R=F.find(Y=>Y&&L(Y)!=null&&String(L(Y))===E);if(!R)continue;const l=A(R);if(!l.length)continue;const U=N(y.es),z=N(y.ef);if(!(z<=U))for(const Y of l)et.has(Y.resource)||et.set(Y.resource,[]),et.get(Y.resource).push({s:U,e:z,units:Y.units,taskId:E})}const j=new Map,K=[],f=[];for(const[E,y]of et){const R=b(E),l=lt(y);let U=0;const z=l.map(g=>{g.load>U&&(U=g.load);const C={start:Z(g.s),end:Z(g.e),load:g.load,taskIds:g.taskIds};return g.load>R+nt&&f.push({resource:E,capacity:R,start:C.start,end:C.end,load:g.load,taskIds:g.taskIds.slice()}),C}),Y={resource:E,capacity:R,peak:U,segments:z};j.set(E,Y),K.push(Y)}return K.sort((E,y)=>E.resource<y.resource?-1:E.resource>y.resource?1:0),f.sort((E,y)=>E.start-y.start||(E.resource<y.resource?-1:1)),{ok:!0,resources:K,overAllocations:f,byResource:j}}function O(F){if(!F)return!1;const V=F.constraint??F.constraintType;if(V==null||V==="")return!1;const H=String(V).toLowerCase().replace(/\s+/g,"-");return H==="mso"||H==="must-start-on"||H==="muststarton"||H==="start-on"||H==="mfo"||H==="must-finish-on"||H==="mustfinishon"||H==="finish-on"}function I(F,V){return F?$(F[V])??0:0}function M(F,V,H={}){const q={projectStart:H.projectStart,deadline:H.deadline,calendar:H.calendar,fields:H.fields},tt=H.priorityField||"priority",st=H.maxIterations!=null?H.maxIterations:Math.max(100,F.length*F.length*2),S=T(H.fields),b=F.map(f=>({...f})),N=b.map(f=>String(S(f))),Z=f=>N.indexOf(f);let L=W(b,V,q);if(!L.ok)return{ok:!1,error:L.error};const et=new Map;for(const f of L.order){const E=L.tasks.get(f);E&&!E.isSummary&&et.set(f,E.es)}let j=0;for(;j<st;j+=1){const f=ut(b,L,H);if(!f.overAllocations.length)return{ok:!0,resolved:!0,tasks:b,schedule:L,moves:ct(et,L),iterations:j};const E=f.overAllocations.slice().sort((g,C)=>g.start-C.start||C.load-g.load)[0],y=new Map(b.map(g=>[String(S(g)),g])),R=E.taskIds.map(g=>L.tasks.get(g)).filter(Boolean),l=R.filter(g=>!O(y.get(g.id)));if(!l.length)return{ok:!0,resolved:!1,tasks:b,schedule:L,moves:ct(et,L),remaining:f.overAllocations,iterations:j};l.sort((g,C)=>{if(C.totalFloat!==g.totalFloat)return C.totalFloat-g.totalFloat;const c=I(y.get(g.id),tt),B=I(y.get(C.id),tt);return c!==B?c-B:C.es!==g.es?C.es-g.es:Z(C.id)-Z(g.id)});const U=l[0],z=R.filter(g=>g.id!==U.id).map(g=>g.ef).filter(g=>g>U.es+nt),Y=z.length?Math.min(...z):U.es+1;if(y.get(U.id).start=Y,L=W(b,V,q),!L.ok)return{ok:!1,error:L.error}}const K=ut(b,L,H);return K.overAllocations.length&&dt("gantt-level-unresolved",`[lattice] gantt: resource leveling hit its ${st}-iteration cap with ${K.overAllocations.length} over-allocation(s) unresolved; returning the partial result.`),{ok:!0,resolved:K.overAllocations.length===0,tasks:b,schedule:L,moves:ct(et,L),remaining:K.overAllocations,iterations:j}}function ct(F,V){const H=[];for(const q of V.order){const tt=V.tasks.get(q);if(!tt||tt.isSummary)continue;const st=F.get(q);st!=null&&tt.es>st+nt&&H.push({id:q,from:st,to:tt.es,delay:tt.es-st})}return H}}),Et("packages/modules/gantt/earned-value.js",function(m,pt){"use strict";Object.defineProperty(m,"computeEarnedValue",{enumerable:!0,get:function(){return u}});const dt=pt("packages/modules/gantt/time.js").toDayNumber,ot=1e-9;function W($){if($==null||$==="")return null;const A=typeof $=="number"?$:Number($);return Number.isFinite(A)?A:null}function nt($,A,D){return D-A<=ot?$>=D?1:0:$<=A?0:$>=D?1:($-A)/(D-A)}function T($,A,D,lt,ut){const O=A?W(A[lt]):null,I=O??$.duration,M=A?W(A[ut]):null,ct=$.percentComplete==null?0:Math.max(0,Math.min(100,$.percentComplete))/100,F=$.baselineStart!=null||$.baselineEnd!=null,V=$.baselineStart!=null?$.baselineStart:$.es,H=$.baselineEnd!=null?$.baselineEnd:$.ef,q=I*nt(D,V,H),tt=I*ct;return{bac:I,pv:q,ev:tt,ac:M,hasBaseline:F}}function X($){const A=$.ac;return{bac:$.bac,pv:$.pv,ev:$.ev,ac:A,sv:$.ev-$.pv,cv:A==null?null:$.ev-A,spi:Math.abs($.pv)<ot?null:$.ev/$.pv,cpi:A==null||Math.abs(A)<ot?null:$.ev/A}}function u($,A,D={}){if(!A||!A.ok||!A.tasks||!A.order)return{ok:!1,error:{code:"NO_SCHEDULE",message:"earned value needs a successful schedule"}};const lt=D.costField||"cost",ut=D.actualCostField||"actualCost",O=D.statusDate==null?A.projectFinish:dt(D.statusDate)??A.projectFinish,I=new Map;for(const tt of Array.isArray($)?$:[])tt&&tt.id!=null&&I.set(String(tt.id),tt);const M=()=>({bac:0,pv:0,ev:0,ac:0,acAny:!1,hasBaseline:!1}),ct=new Map;for(const tt of A.order)ct.set(tt,M());const F=M();for(const tt of A.order){const st=A.tasks.get(tt);if(!st||st.isSummary)continue;const S=T(st,I.get(tt),O,lt,ut);let b=tt;for(;b!=null&&ct.has(b);){const N=ct.get(b);N.bac+=S.bac,N.pv+=S.pv,N.ev+=S.ev,S.ac!=null&&(N.ac+=S.ac,N.acAny=!0),S.hasBaseline&&(N.hasBaseline=!0),b=A.tasks.get(b).parent}F.bac+=S.bac,F.pv+=S.pv,F.ev+=S.ev,S.ac!=null&&(F.ac+=S.ac,F.acAny=!0),S.hasBaseline&&(F.hasBaseline=!0)}const V=tt=>X({bac:tt.bac,pv:tt.pv,ev:tt.ev,ac:tt.acAny?tt.ac:null}),H=new Map,q=[];for(const tt of A.order){const st=A.tasks.get(tt),S=ct.get(tt),b={id:st.id,name:st.name,isSummary:!!st.isSummary,isMilestone:!!st.isMilestone,percentComplete:st.percentComplete??null,hasBaseline:S.hasBaseline,hasActualCost:S.acAny,...V(S)};H.set(tt,b),q.push(b)}return{ok:!0,statusDate:O,byTask:H,rows:q,project:{hasActualCost:F.acAny,hasBaseline:F.hasBaseline,...V(F)}}}}),Et("packages/modules/gantt/mspdi.js",function(m,pt){"use strict";Object.defineProperty(m,"parseXml",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(m,"importMSPDI",{enumerable:!0,get:function(){return st}}),Object.defineProperty(m,"exportMSPDI",{enumerable:!0,get:function(){return b}});const dt=pt("packages/core/src/internal/util.js").warnOnce,ot=pt("packages/modules/gantt/time.js"),W=ot.toDayNumber,nt=ot.toISODate,T=Object.freeze({0:"FF",1:"FS",2:"SF",3:"SS"}),X=Object.freeze({FF:0,FS:1,SF:2,SS:3}),u=Object.freeze({1:"as-late-as-possible",2:"must-start-on",3:"must-finish-on"}),$=Object.freeze({ALAP:1,MSO:2,MFO:3});function A(j){return String(j).replace(/&(#x?[0-9a-fA-F]+|lt|gt|amp|quot|apos);/g,(K,f)=>{if(f[0]==="#"){const E=f[1]==="x"||f[1]==="X"?parseInt(f.slice(2),16):parseInt(f.slice(1),10);return Number.isFinite(E)?String.fromCodePoint(E):K}return{lt:"<",gt:">",amp:"&",quot:'"',apos:"'"}[f]??K})}function D(j){return String(j??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}function lt(j){const K=j.indexOf(":");return K<0?j:j.slice(K+1)}function ut(j){const K=String(j);let f=0;const E=[];let y=null;for(;f<K.length;){const R=K.indexOf("<",f);if(R<0)break;if(R>f&&E.length){const B=K.slice(f,R);B.trim()&&(E[E.length-1].text+=A(B))}if(K.startsWith("<?",R)){const B=K.indexOf("?>",R);f=B<0?K.length:B+2;continue}if(K.startsWith("<!--",R)){const B=K.indexOf("-->",R);f=B<0?K.length:B+3;continue}if(K.startsWith("<![CDATA[",R)){const B=K.indexOf("]]>",R);E.length&&(E[E.length-1].text+=K.slice(R+9,B<0?K.length:B)),f=B<0?K.length:B+3;continue}if(K.startsWith("<!",R)){const B=K.indexOf(">",R);f=B<0?K.length:B+1;continue}const l=K.indexOf(">",R);if(l<0)break;let U=K.slice(R+1,l).trim();if(U[0]==="/"){E.pop(),f=l+1;continue}const z=U.endsWith("/");z&&(U=U.slice(0,-1).trim());const Y=U.search(/\s/),g=lt(Y<0?U:U.slice(0,Y)),C={};if(Y>=0)for(const B of U.slice(Y).matchAll(/([\w:.-]+)\s*=\s*"([^"]*)"|([\w:.-]+)\s*=\s*'([^']*)'/g))C[lt(B[1]??B[3])]=A(B[2]??B[4]??"");const c={name:g,attrs:C,children:[],text:""};E.length?E[E.length-1].children.push(c):y||(y=c),z||E.push(c),f=l+1}return y}function O(j,K){return j?j.children.find(f=>f.name===K):void 0}function I(j,K){return j?j.children.filter(f=>f.name===K):[]}function M(j,K){const f=O(j,K);return f?f.text.trim():void 0}function ct(j){if(!j)return null;const K=String(j).match(/^\d{4}-\d{2}-\d{2}/);return W(K?K[0]:j)}function F(j,K){return`${nt(j)}T${String(K).padStart(2,"0")}:00:00`}function V(j,K){if(!j)return null;const f=String(j).match(/PT?(?:(\d+(?:\.\d+)?)H)?(?:(\d+(?:\.\d+)?)M)?(?:(\d+(?:\.\d+)?)S)?/);return f?((Number(f[1])||0)+(Number(f[2])||0)/60+(Number(f[3])||0)/3600)/K:null}function H(j,K){return`PT${Math.round((j||0)*K*1e3)/1e3}H0M0S`}function q(j,K){return(Number(j)||0)/(600*K)}function tt(j,K){return Math.round((j||0)*10*60*K)}function st(j,K={}){const f=K.hoursPerDay??8,E=ut(j);if(!E||E.name!=="Project")return dt("gantt-mspdi-not-project","[lattice] gantt: importMSPDI input is not an MSPDI <Project> document."),{ok:!1,error:"not an MSPDI <Project> document",tasks:[],dependencies:[],resources:[]};const y=ct(M(E,"StartDate")),R=O(E,"Resources"),l=new Map,U=[];for(const d of I(R,"Resource")){const p=M(d,"UID"),k=M(d,"Name");if(p==null||k==null||k==="")continue;l.set(p,k);const o=M(d,"MaxUnits");U.push({id:k,name:k,capacity:o==null?1:Number(o)})}const z=O(E,"Assignments"),Y=new Map;for(const d of I(z,"Assignment")){const p=M(d,"TaskUID"),k=M(d,"ResourceUID"),o=l.get(k);if(p==null||o==null)continue;const i=M(d,"Units");Y.has(p)||Y.set(p,[]),Y.get(p).push({resource:o,units:i==null?1:Number(i)})}const g=O(E,"Tasks"),C=[],c=[],B=new Map,at=[],gt=[];for(const d of I(g,"Task")){if(M(d,"IsNull")==="1")continue;const p=M(d,"UID");if(p==null||p==="0")continue;const k=p;B.set(p,k);const o=Number(M(d,"OutlineLevel"))||1;for(;at.length&&at[at.length-1].level>=o;)at.pop();const i=at.length?at[at.length-1].uid:null;at.push({uid:p,level:o});const n=M(d,"Summary")==="1",t=M(d,"Milestone")==="1",e={id:k,name:M(d,"Name")??k};if(i&&(e.parent=i),t&&(e.milestone=!0),!n&&!t){const _=V(M(d,"Duration"),f);_!=null&&(e.duration=_)}const s=ct(M(d,"Start"));!n&&s!=null&&(e.start=s);const a=M(d,"PercentComplete");a!=null&&(e.percentComplete=Number(a));const w=u[Number(M(d,"ConstraintType"))];if(w){e.constraint=w;const _=ct(M(d,"ConstraintDate"));_!=null&&(e.constraintDate=_)}const h=O(d,"Baseline");if(h){const _=ct(M(h,"Start")),G=ct(M(h,"Finish"));_!=null&&(e.baselineStart=_),G!=null&&(e.baselineEnd=G)}const P=Y.get(p);P&&P.length&&(e.assignments=P),C.push(e);for(const _ of I(d,"PredecessorLink"))gt.push({raw:_,uid:p})}for(const{raw:d,uid:p}of gt){const k=M(d,"PredecessorUID"),o=B.get(k),i=B.get(p);if(o==null||i==null)continue;const n=T[Number(M(d,"Type")??1)]??"FS",t=q(M(d,"LinkLag"),f),e={from:o,to:i,type:n};t&&(e.lag=t),c.push(e)}const J=S(E),r={ok:!0,tasks:C,dependencies:c,resources:U};return y!=null&&(r.projectStart=y),J&&(r.calendar=J),r}function S(j){const K=O(j,"Calendars"),f=I(K,"Calendar"),E=M(j,"CalendarUID"),y=f.find(g=>M(g,"UID")===E)??f[0];if(!y)return null;const R=O(y,"WeekDays"),l=[];let U=!1;for(const g of I(R,"WeekDay")){const C=Number(M(g,"DayType"));C>=1&&C<=7&&(U=!0,M(g,"DayWorking")==="1"&&l.push(C-1))}const z=[],Y=O(y,"Exceptions");for(const g of I(Y,"Exception")){if(M(g,"DayWorking")==="1")continue;const C=O(g,"TimePeriod"),c=ct(M(C,"FromDate")),B=ct(M(C,"ToDate"))??c;if(c!=null)for(let at=c;at<=B;at+=1)z.push(at)}return!U&&!z.length?null:{workdays:U?l:[1,2,3,4,5],holidays:z}}function b(j,K={}){const f=K.hoursPerDay??8,E=Array.isArray(j.tasks)?j.tasks:[],y=Array.isArray(j.dependencies)?j.dependencies:[],R=Array.isArray(j.resources)?j.resources:j.resources&&typeof j.resources=="object"?Object.entries(j.resources).map(([r,d])=>({id:r,name:r,capacity:d})):[],l=j.schedule&&j.schedule.ok?j.schedule:null,U=new Map;E.forEach((r,d)=>{const p=String(r.id);U.set(p,/^\d+$/.test(p)?p:String(d+1))});const z=new Map;for(const r of E){const d=r.parent!=null?String(r.parent):null;d&&(z.has(d)||z.set(d,[]),z.get(d).push(String(r.id)))}const Y=r=>z.has(r),g=r=>{let d=1,p=E.find(k=>String(k.id)===r);for(;p&&p.parent!=null;)d+=1,p=E.find(k=>String(k.id)===String(p.parent));return d},C=new Map;for(const r of y){const d=String(r.to);C.has(d)||C.set(d,[]),C.get(d).push(r)}const c=[];c.push('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'),c.push('<Project xmlns="http://schemas.microsoft.com/project">'),c.push(` <Name>${D(K.projectName||"Lattice Gantt export")}</Name>`);const B=j.projectStart!=null?W(j.projectStart):l?l.projectStart:null;B!=null&&c.push(` <StartDate>${F(B,8)}</StartDate>`);const at=Z(j.calendar);if(at&&c.push(" <CalendarUID>1</CalendarUID>"),at){c.push(" <Calendars>"),c.push(" <Calendar>"),c.push(" <UID>1</UID>"),c.push(" <Name>Standard</Name>"),c.push(" <IsBaseCalendar>1</IsBaseCalendar>"),c.push(" <WeekDays>");for(let r=0;r<=6;r+=1){const d=at.workdays.includes(r);c.push(" <WeekDay>"),c.push(` <DayType>${r+1}</DayType>`),c.push(` <DayWorking>${d?1:0}</DayWorking>`),c.push(" </WeekDay>")}if(c.push(" </WeekDays>"),at.holidays.length){c.push(" <Exceptions>");for(const r of at.holidays)c.push(" <Exception>"),c.push(" <DayWorking>0</DayWorking>"),c.push(` <TimePeriod><FromDate>${F(r,0)}</FromDate><ToDate>${F(r,23)}</ToDate></TimePeriod>`),c.push(" </Exception>");c.push(" </Exceptions>")}c.push(" </Calendar>"),c.push(" </Calendars>")}c.push(" <Tasks>");for(const r of E){const d=String(r.id),p=U.get(d),k=Y(d),o=!!r.milestone||!k&&Number(r.duration)===0,i=l?l.tasks.get(d):null;c.push(" <Task>"),c.push(` <UID>${D(p)}</UID>`),c.push(` <ID>${D(p)}</ID>`),c.push(` <Name>${D(r.name!=null?r.name:d)}</Name>`),c.push(` <OutlineLevel>${g(d)}</OutlineLevel>`),c.push(` <Summary>${k?1:0}</Summary>`),c.push(` <Milestone>${o?1:0}</Milestone>`);const n=i?i.duration:r.duration!=null?Number(r.duration):null;n!=null&&c.push(` <Duration>${H(n,f)}</Duration>`),c.push(" <DurationFormat>7</DurationFormat>");const t=i?i.es:r.start!=null?W(r.start):null,e=i?i.ef:r.end!=null?W(r.end):t!=null&&n!=null?t+n:null;t!=null&&c.push(` <Start>${F(t,8)}</Start>`),e!=null&&c.push(` <Finish>${F(e,17)}</Finish>`);const s=i?i.percentComplete:r.percentComplete;s!=null&&c.push(` <PercentComplete>${Math.round(Number(s))}</PercentComplete>`);const a=L(r.constraint??r.constraintType);if(a!=null){c.push(` <ConstraintType>${a}</ConstraintType>`);const P=et(r.constraintDate??r.constraintAt??r.at);P!=null&&c.push(` <ConstraintDate>${F(P,8)}</ConstraintDate>`)}const w=et(r.baselineStart??(r.baseline&&r.baseline.start)),h=et(r.baselineEnd??(r.baseline&&r.baseline.end));(w!=null||h!=null)&&(c.push(" <Baseline>"),c.push(" <Number>0</Number>"),w!=null&&c.push(` <Start>${F(w,8)}</Start>`),h!=null&&c.push(` <Finish>${F(h,17)}</Finish>`),w!=null&&h!=null&&c.push(` <Duration>${H(h-w,f)}</Duration>`),c.push(" </Baseline>"));for(const P of C.get(d)||[]){const _=U.get(String(P.from));_!=null&&(c.push(" <PredecessorLink>"),c.push(` <PredecessorUID>${D(_)}</PredecessorUID>`),c.push(` <Type>${X[P.type?String(P.type).toUpperCase():"FS"]??1}</Type>`),P.lag&&(c.push(` <LinkLag>${tt(Number(P.lag),f)}</LinkLag>`),c.push(" <LagFormat>7</LagFormat>")),c.push(" </PredecessorLink>"))}c.push(" </Task>")}c.push(" </Tasks>");const gt=new Map;R.forEach((r,d)=>{const p=String(r.name??r.id??`Resource ${d+1}`);gt.set(p,{uid:String(d+1),capacity:r.capacity??r.maxUnits??1})});const J=[];for(const r of E)for(const d of N(r))gt.has(d.resource)||gt.set(d.resource,{uid:String(gt.size+1),capacity:1}),J.push({taskUid:U.get(String(r.id)),resUid:gt.get(d.resource).uid,units:d.units});c.push(" <Resources>");for(const[r,d]of gt)c.push(" <Resource>"),c.push(` <UID>${D(d.uid)}</UID>`),c.push(` <ID>${D(d.uid)}</ID>`),c.push(` <Name>${D(r)}</Name>`),c.push(` <MaxUnits>${Number(d.capacity)}</MaxUnits>`),c.push(" </Resource>");return c.push(" </Resources>"),c.push(" <Assignments>"),J.forEach((r,d)=>{c.push(" <Assignment>"),c.push(` <UID>${d+1}</UID>`),c.push(` <TaskUID>${D(r.taskUid)}</TaskUID>`),c.push(` <ResourceUID>${D(r.resUid)}</ResourceUID>`),c.push(` <Units>${Number(r.units)}</Units>`),c.push(" </Assignment>")}),c.push(" </Assignments>"),c.push("</Project>"),c.join(`
7
7
  `)}function N(j){if(j&&Array.isArray(j.assignments))return j.assignments.map(E=>{const y=E&&(E.resource??E.name??E.id);if(y==null||y==="")return null;const R=Number(E.units??E.allocation??1);return{resource:String(y),units:Number.isFinite(R)?R:1}}).filter(Boolean);const K=j?j.assignee??j.assignees??j.owner:null;return(Array.isArray(K)?K:K==null||K===""?[]:[K]).map(E=>String(E)).filter(E=>E!=="").map(E=>({resource:E,units:1}))}function Z(j){if(j==null)return null;if(j==="weekends")return{workdays:[1,2,3,4,5],holidays:[]};const K=Array.isArray(j.workdays)&&j.workdays.length?j.workdays.map(Number).filter(E=>E>=0&&E<=6):[1,2,3,4,5],f=(Array.isArray(j.holidays)?j.holidays:[]).map(E=>W(E)).filter(E=>E!=null);return{workdays:K,holidays:f}}function L(j){if(j==null||j==="")return null;const K=String(j).toLowerCase().replace(/\s+/g,"-"),E={mso:"MSO","must-start-on":"MSO",muststarton:"MSO","start-on":"MSO",mfo:"MFO","must-finish-on":"MFO",mustfinishon:"MFO","finish-on":"MFO",alap:"ALAP","as-late-as-possible":"ALAP",aslateaspossible:"ALAP",late:"ALAP"}[K]??(["MSO","MFO","ALAP"].includes(String(j).toUpperCase())?String(j).toUpperCase():null);return E?$[E]:null}function et(j){return j==null||j===""?null:W(j)}}),Et("packages/modules/gantt/workload.js",function(m,pt){"use strict";Object.defineProperty(m,"WORKLOAD_DEFAULTS",{enumerable:!0,get:function(){return A}}),Object.defineProperty(m,"statedHours",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(m,"taskContour",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(m,"contourTotal",{enumerable:!0,get:function(){return O}}),Object.defineProperty(m,"serializeContour",{enumerable:!0,get:function(){return I}}),Object.defineProperty(m,"contourSpan",{enumerable:!0,get:function(){return M}}),Object.defineProperty(m,"spanDuration",{enumerable:!0,get:function(){return ct}}),Object.defineProperty(m,"spreadHours",{enumerable:!0,get:function(){return F}}),Object.defineProperty(m,"setContourBucket",{enumerable:!0,get:function(){return V}}),Object.defineProperty(m,"retimeContour",{enumerable:!0,get:function(){return H}}),Object.defineProperty(m,"recordWorkingDays",{enumerable:!0,get:function(){return q}}),Object.defineProperty(m,"workloadBuckets",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(m,"computeWorkload",{enumerable:!0,get:function(){return st}}),Object.defineProperty(m,"formatHours",{enumerable:!0,get:function(){return S}});const dt=pt("packages/modules/gantt/resources.js").parseAssignments,ot=pt("packages/modules/gantt/schedule.js"),W=ot.EPS,nt=ot.taskIdReader,T=pt("packages/modules/gantt/time.js"),X=T.fromDayNumber,u=T.toDayNumber,$=T.toISODate,A=Object.freeze({hoursPerDay:8,height:160,rowHeight:28,decimals:1,totals:!0});function D(b){if(b==null||b===""||typeof b=="boolean")return null;const N=typeof b=="number"?b:Number(b);return Number.isFinite(N)?N:null}function lt(b){if(!b||Array.isArray(b.work))return null;const N=D(b.work);return N??D(b.hours)}function ut(b){if(!b||!Array.isArray(b.work))return null;const N=[];for(const L of b.work){if(!L||typeof L!="object")continue;const et=u(L.date),j=D(L.hours);et==null||j==null||N.push({day:Math.round(et),hours:j})}N.sort((L,et)=>L.day-et.day);const Z=[];for(const L of N){const et=Z[Z.length-1];et&&et.day===L.day?et.hours+=L.hours:Z.push({day:L.day,hours:L.hours})}return Z}function O(b){return(Array.isArray(b)?b:[]).reduce((N,Z)=>N+(D(Z.hours)??0),0)}function I(b){const N=[];for(const Z of Array.isArray(b)?b:[]){const L=D(Z.hours);if(L==null||!(Math.abs(L)>W))continue;const et=$(Z.day);et!=null&&N.push({date:et,hours:Math.round(L*1e6)/1e6})}return N}function M(b){const N=(Array.isArray(b)?b:[]).filter(Z=>Math.abs(D(Z.hours)??0)>W);return N.length?{first:N[0].day,last:N[N.length-1].day}:null}function ct(b,N,Z=null){if(!Number.isFinite(b)||!Number.isFinite(N)||N<b)return 0;if(typeof Z!="function")return Math.round(N-b)+1;let L=0;for(let et=Math.round(b);et<=Math.round(N);et+=1)Z(et)&&(L+=1);return L}function F(b,N){if(!Array.isArray(b)||!b.length)return[];const Z=N/b.length;return b.map(L=>({day:L,hours:Z}))}function V(b,N,Z,L){const et=(Array.isArray(b)?b:[]).filter(K=>!(K.day>=N.start&&K.day<N.end)),j=Math.abs(L)>W?F(Z,L):[];return[...et,...j].sort((K,f)=>K.day-f.day)}function H(b,N,Z){const L=Array.isArray(N)?N:[],et=Array.isArray(Z)?Z:[];if(!Array.isArray(b)||!L.length||!et.length)return Array.isArray(b)?b:[];const j=new Map(b.map(y=>[y.day,D(y.hours)??0])),K=L.map(y=>j.get(y)??0),f=K.length,E=[];for(let y=0;y<et.length;y+=1){const R=K[Math.min(f-1,Math.floor(y*f/et.length))];Math.abs(R)>W&&E.push({day:et[y],hours:R})}return E}function q(b,N=null){const Z=[];if(!b||!Number.isFinite(b.es)||!Number.isFinite(b.ef))return Z;for(let L=Math.floor(b.es);L<Math.ceil(b.ef);L+=1)(typeof N!="function"||N(L))&&Z.push(L);return Z}function tt(b,N,Z){const L=Math.floor(N),et=Math.ceil(Z),j=[];if(!(et>L))return j;if(b==="day"){for(let E=L;E<et;E+=1)j.push({start:E,end:E+1});return j}if(b==="month"||b==="quarter"){const E=X(L);if(!E)return j;let y=Date.UTC(E.getUTCFullYear(),E.getUTCMonth(),1)/864e5;for(;y<et;){const R=X(y),l=Date.UTC(R.getUTCFullYear(),R.getUTCMonth()+1,1)/864e5;j.push({start:y,end:l}),y=l}return j}const K=X(L);let f=L-(K?K.getUTCDay():0);for(;f<et;f+=7)j.push({start:f,end:f+7});return j}function st(b,N,Z={}){const L=Array.isArray(Z.buckets)?Z.buckets:[],et={ok:!1,buckets:[],rows:[],totals:L.map(()=>null),grandTotal:0};if(!N||!N.ok)return et;const j=D(Z.hoursPerDay)??A.hoursPerDay,K=typeof Z.isWorking=="function"?Z.isWorking:null,f=Z.capacities instanceof Map?Z.capacities:null,E=nt(Z.fields),y=new Map,R=(J,r,d,p)=>{y.has(J)||y.set(J,{days:new Map,tasks:new Map});const k=y.get(J);k.days.set(r,(k.days.get(r)||0)+d),k.tasks.has(p.id)||k.tasks.set(p.id,{...p,days:new Map});const o=k.tasks.get(p.id);o.days.set(r,(o.days.get(r)||0)+d)},l=new Map;for(const J of Array.isArray(b)?b:[]){const r=J?E(J):null;r!=null&&l.set(String(r),J)}const U=Array.isArray(b)&&N.order.length===b.length;for(let J=0;J<N.order.length;J+=1){const r=N.order[J],d=N.tasks.get(r);if(!d||d.isSummary)continue;const p=l.get(r)||(U?b[J]:null);if(!p)continue;const k=q(d,K),o=ut(p);if(!o&&!k.length)continue;const i=dt(p),n=i.length?i:[{resource:null,units:1}],t=n.reduce((s,a)=>s+(D(a.units)??0),0);if(!(t>0))continue;let e;if(o)e=o.filter(s=>Math.abs(s.hours)>W);else{const s=lt(p),a=s??k.length*j*t;if(!(Math.abs(a)>W))continue;e=F(k,a)}if(e.length)for(const s of n){const a=D(s.units)??0,w=a/t;if(!(Math.abs(w)>0))continue;const h={id:r,name:d.name,units:a,unitsTotal:t,raw:p};for(const P of e)R(s.resource,P.day,P.hours*w,h)}}const z=J=>{let r=0,d=L.length-1;for(;r<=d;){const p=r+d>>1;if(J<L[p].start)d=p-1;else if(J>=L[p].end)r=p+1;else return p}return-1},Y=L.map(J=>{let r=0;for(let d=Math.floor(J.start);d<Math.ceil(J.end);d+=1)(!K||K(d))&&(r+=1);return{start:J.start,end:J.end,workingDays:r}}),g=J=>{const r=Y.map(()=>0);for(const[d,p]of J){const k=z(d);k>=0&&(r[k]+=p)}return r},C=[...y.keys()].filter(J=>J!=null).sort(),c=y.has(null)?[...C,null]:C,B=[],at=Y.map(()=>0);let gt=0;for(const J of c){const r=y.get(J),d=g(r.days),p=J!=null&&f&&f.has(J)?f.get(J):null,k=d.map(t=>Math.abs(t)>W?t:null),o=d.map((t,e)=>{if(p==null)return!1;const s=p*j*Y[e].workingDays;return t>s+W});let i=0;d.forEach((t,e)=>{i+=t,at[e]+=t}),gt+=i;const n=[...r.tasks.values()].map(t=>{const e=g(t.days);return{id:t.id,name:t.name,units:t.units,unitsTotal:t.unitsTotal,raw:t.raw,cells:e.map(s=>Math.abs(s)>W?s:null),total:e.reduce((s,a)=>s+a,0)}});B.push({resource:J,capacity:p,cells:k,over:o,total:i,tasks:n})}return{ok:!0,buckets:Y,rows:B,totals:at.map(J=>Math.abs(J)>W?J:null),grandTotal:gt}}function S(b,N){if(b==null||!Number.isFinite(b))return"";const L=10**(Number.isFinite(N)?Math.max(0,Math.min(6,Math.round(N))):1),et=Math.round(b*L)/L;return Object.is(et,-0)||et===0?"0":String(et)}}),Et("packages/modules/shared/autosize.js",function(m,pt){"use strict";Object.defineProperty(m,"contentWidth",{enumerable:!0,get:function(){return ot}}),Object.defineProperty(m,"contentHeight",{enumerable:!0,get:function(){return W}}),Object.defineProperty(m,"firstMeasured",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(m,"watchSize",{enumerable:!0,get:function(){return T}}),Object.defineProperty(m,"watchBox",{enumerable:!0,get:function(){return X}});const dt=pt("packages/core/src/internal/util.js").warnOnce;function ot(u){if(!u||typeof u!="object")return null;const $=Number(u.clientWidth);if(Number.isFinite($)&&$>0)return $;if(typeof u.getBoundingClientRect=="function"){const A=u.getBoundingClientRect(),D=A&&Number(A.width);if(Number.isFinite(D)&&D>0)return D}return null}function W(u){if(!u||typeof u!="object")return null;const $=Number(u.clientHeight);if(Number.isFinite($)&&$>0)return $;if(typeof u.getBoundingClientRect=="function"){const A=u.getBoundingClientRect(),D=A&&Number(A.height);if(Number.isFinite(D)&&D>0)return D}return null}function nt(u,$=ot){for(const A of u||[]){const D=$(A);if(Number.isFinite(D)&&D>0)return D}return null}function T(u){const $=(u&&Array.isArray(u.targets)?u.targets:[]).filter(Boolean),A=u&&typeof u.read=="function"?u.read:()=>null,D=u&&typeof u.apply=="function"?u.apply:()=>{},lt=Number.isFinite(u&&u.epsilon)?Number(u.epsilon):1;let ut=null,O=!1;const I=()=>{if(O)return!1;const H=A();if(!Number.isFinite(H)||H<=0||ut!=null&&Math.abs(H-ut)<lt)return!1;ut=H,O=!0;try{D(H)}finally{O=!1}return!0};I();const M=$[0],ct=u&&u.view||M&&M.ownerDocument&&M.ownerDocument.defaultView||globalThis,F=ct&&ct.ResizeObserver;let V=null;if(typeof F=="function"&&$.length){V=new F(()=>{I()});for(const H of $)H&&typeof V.observe=="function"&&V.observe(H)}else $.length&&dt("shared.autosize.no-resize-observer","ResizeObserver is unavailable; this view was sized once at mount and will not follow its container.");return{refresh:I,get applied(){return ut},release(){if(V&&typeof V.disconnect=="function")try{V.disconnect()}catch{}V=null}}}function X(u){const $=(u&&Array.isArray(u.targets)?u.targets:[]).filter(Boolean),A=u&&typeof u.read=="function"?u.read:()=>({}),D=u&&typeof u.apply=="function"?u.apply:()=>{},lt=Number.isFinite(u&&u.epsilon)?Number(u.epsilon):1;let ut=null,O=!1;const I=q=>{if(ut==null)return!0;for(const[tt,st]of Object.entries(q)){if(!Number.isFinite(st)||st<=0)continue;const S=ut[tt];if(!Number.isFinite(S)||Math.abs(st-S)>=lt)return!0}return!1},M=()=>{if(O)return!1;const q=A();if(!q||typeof q!="object"||!Object.values(q).some(st=>Number.isFinite(st)&&st>0)||!I(q))return!1;ut={...ut,...q},O=!0;try{D(q)}finally{O=!1}return!0};M();const ct=$[0],F=u&&u.view||ct&&ct.ownerDocument&&ct.ownerDocument.defaultView||globalThis,V=F&&F.ResizeObserver;let H=null;if(typeof V=="function"&&$.length){H=new V(()=>{M()});for(const q of $)q&&typeof H.observe=="function"&&H.observe(q)}else $.length&&dt("shared.autosize.no-resize-observer","ResizeObserver is unavailable; this view was sized once at mount and will not follow its container.");return{refresh:M,get applied(){return ut},release(){if(H&&typeof H.disconnect=="function")try{H.disconnect()}catch{}H=null}}}}),Et("packages/modules/shared/axislabels.js",function(m,pt){"use strict";Object.defineProperty(m,"CHAR_RATIO",{enumerable:!0,get:function(){return Mt}}),Object.defineProperty(m,"BOLD_FACTOR",{enumerable:!0,get:function(){return dt}}),Object.defineProperty(m,"MIN_GAP",{enumerable:!0,get:function(){return ot}}),Object.defineProperty(m,"estimateLabelWidth",{enumerable:!0,get:function(){return W}}),Object.defineProperty(m,"thinLabels",{enumerable:!0,get:function(){return nt}});const Mt=.62,dt=1.05,ot=6;function W(T,X,u=!1){return String(T??"").length*X*Mt*(u?dt:1)}function nt(T,X){const u=Number.isFinite(X.gap)?Number(X.gap):ot,$=Number.isFinite(X.fontSize)?Number(X.fontSize):11,A=typeof X.measure=="function"?X.measure:I=>W(I,$,!!X.bold),D=T.filter(I=>I&&Number.isFinite(I.at)).map(I=>({...I,width:A(String(I.text??""))})).sort((I,M)=>I.at-M.at);if(D.length<2)return{every:1,kept:D};const lt=I=>{let M=null;for(let ct=0;ct<D.length;ct+=I){const F=D[ct];if(M&&F.at-M.at<M.width+u)return!1;M=F}return!0};let ut=1;for(;ut<D.length&&!lt(ut);)ut++;const O=[];for(let I=0;I<D.length;I+=ut)O.push(D[I]);return{every:ut,kept:O}}}),Et("packages/modules/charts/svg.js",function(m,pt){"use strict";Object.defineProperty(m,"SVG_NS",{enumerable:!0,get:function(){return Mt}}),Object.defineProperty(m,"el",{enumerable:!0,get:function(){return dt}}),Object.defineProperty(m,"svg",{enumerable:!0,get:function(){return ot}}),Object.defineProperty(m,"attr",{enumerable:!0,get:function(){return W}}),Object.defineProperty(m,"attrs",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(m,"setText",{enumerable:!0,get:function(){return T}}),Object.defineProperty(m,"clear",{enumerable:!0,get:function(){return X}}),Object.defineProperty(m,"append",{enumerable:!0,get:function(){return u}}),Object.defineProperty(m,"path",{enumerable:!0,get:function(){return $}}),Object.defineProperty(m,"ribbonPath",{enumerable:!0,get:function(){return A}}),Object.defineProperty(m,"round",{enumerable:!0,get:function(){return D}}),Object.defineProperty(m,"pathRings",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(m,"insideRings",{enumerable:!0,get:function(){return ut}});const Mt="http://www.w3.org/2000/svg";function dt(O,I,M){const ct=O.createElement(I);return M&&ct.setAttribute("class",M),ct}function ot(O,I,M){const ct=O.createElementNS(Mt,I);if(M)for(const F of Object.keys(M))ct.setAttribute(F,String(M[F]));return ct}function W(O,I,M){O&&(M==null?O.removeAttribute(I):O.setAttribute(I,String(M)))}function nt(O,I){if(O)for(const M of Object.keys(I))W(O,M,I[M])}function T(O,I){O&&(O.textContent=I==null?"":String(I))}function X(O){if(O)for(;O.firstChild;)O.removeChild(O.firstChild)}function u(O,I){for(const M of I)M&&O.appendChild(M);return O}function $(O){return O.join(" ")}function A(O){if(!O||O.length<2)return"";const I=["M",O[0].x,O[0].upper];for(let M=1;M<O.length;M++)I.push("L",O[M].x,O[M].upper);for(let M=O.length-1;M>=0;M--)I.push("L",O[M].x,O[M].lower);return I.push("Z"),$(I)}function D(O){return Math.round(O*100)/100}function lt(O){const I=[];let M=[];const ct=String(O||"").match(/[A-Za-z]|-?\d*\.?\d+(?:e[-+]?\d+)?/gi)||[];let F="",V=[];const H=()=>{if(!F||!V.length){V=[];return}if(F==="M"||F==="L")for(let q=0;q+1<V.length;q+=2)M.push([V[q],V[q+1]]);else F!=="Z"&&V.length>=2&&M.push([V[V.length-2],V[V.length-1]]);V=[]};for(const q of ct){if(/[A-Za-z]/.test(q)){if(H(),q==="Z"||q==="z"){M.length>2&&I.push(M),M=[],F="";continue}q==="M"&&M.length>2&&(I.push(M),M=[]),F=q;continue}V.push(Number(q))}return H(),M.length>2&&I.push(M),I}function ut(O,I,M){let ct=!1;for(const F of O)for(let V=0,H=F.length-1;V<F.length;H=V++){const[q,tt]=F[V],[st,S]=F[H];tt>M!=S>M&&I<(st-q)*(M-tt)/(S-tt||1e-12)+q&&(ct=!ct)}return ct}}),Et("packages/modules/charts/scale.js",function(m,pt){"use strict";Object.defineProperty(m,"isNumber",{enumerable:!0,get:function(){return u}}),Object.defineProperty(m,"toNumber",{enumerable:!0,get:function(){return $}}),Object.defineProperty(m,"toTime",{enumerable:!0,get:function(){return A}}),Object.defineProperty(m,"extent",{enumerable:!0,get:function(){return D}}),Object.defineProperty(m,"niceStep",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(m,"niceDomain",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(m,"measureDomain",{enumerable:!0,get:function(){return O}}),Object.defineProperty(m,"linearTicks",{enumerable:!0,get:function(){return I}}),Object.defineProperty(m,"timeStepFor",{enumerable:!0,get:function(){return M}}),Object.defineProperty(m,"timeTicks",{enumerable:!0,get:function(){return F}}),Object.defineProperty(m,"linearScale",{enumerable:!0,get:function(){return V}}),Object.defineProperty(m,"timeScale",{enumerable:!0,get:function(){return H}}),Object.defineProperty(m,"key",{enumerable:!0,get:function(){return q}}),Object.defineProperty(m,"bandScale",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(m,"sqrtScale",{enumerable:!0,get:function(){return st}});const Mt=[1,2,2.5,5,10],dt=6e4,ot=36e5,W=864e5,nt=365.25*W,T=[1,2,5,10,20,25,50,100],X=[1,5,10,25,50,100,250,500,1e3,5e3,15e3,3e4,dt,5*dt,15*dt,30*dt,ot,3*ot,6*ot,12*ot,W,2*W,7*W,14*W,30*W,90*W,180*W,...T.map(S=>S*nt)];function u(S){return typeof S=="number"&&Number.isFinite(S)}function $(S){if(S==null||S==="")return null;if(S instanceof Date){const N=S.getTime();return Number.isFinite(N)?N:null}if(typeof S=="boolean")return S?1:0;const b=Number(S);return Number.isFinite(b)?b:null}function A(S){if(S==null||S==="")return null;if(S instanceof Date){const N=S.getTime();return Number.isFinite(N)?N:null}if(typeof S=="number")return Number.isFinite(S)?S:null;const b=Date.parse(String(S));return Number.isFinite(b)?b:null}function D(S){let b=1/0,N=-1/0;for(let Z=0;Z<S.length;Z++){const L=S[Z];u(L)&&(L<b&&(b=L),L>N&&(N=L))}return b===1/0?null:{min:b,max:N}}function lt(S){if(!(S>0))return 1;const b=10**Math.floor(Math.log10(S));for(const N of Mt)if(S<=N*b)return N*b;return 10*b}function ut(S,b=5){const N=lt((S.max-S.min)/Math.max(1,b));return{min:Math.floor(S.min/N)*N,max:Math.ceil(S.max/N)*N,step:N}}function O(S,b={}){const N=D(S)||{min:0,max:1};let{min:Z,max:L}=N;if(b.zero&&(Z>0&&(Z=0),L<0&&(L=0)),Z===L){const et=Math.abs(Z)>0?Math.abs(Z)/10:1;Z-=et,L+=et}if(b.nice!==!1){const et=ut({min:Z,max:L},b.ticks||5);Z=et.min,L=et.max}return u(b.min)&&(Z=b.min),u(b.max)&&(L=b.max),Z===L&&(L=Z+1),{min:Z,max:L}}function I(S,b=5){const N=lt((S.max-S.min)/Math.max(1,b)),Z=Math.ceil(S.min/N),L=Math.floor(S.max/N),et=[];for(let j=Z;j<=L;j++){const K=j*N;et.push(Math.abs(K)<N/1e6?0:Number(K.toPrecision(12)))}return et}function M(S,b=5){const N=Math.max(1,b),Z=S/N;let L=X[X.length-1];for(const K of X)if(K>=Z){L=K;break}if(L<nt)return L;let et=L,j=Math.abs(S/L-N);for(const K of X){if(K<nt)continue;const f=Math.abs(S/K-N);f<j&&(j=f,et=K)}return et}function ct(S,b){const N=new Date(S.min).getUTCFullYear();let Z=Math.ceil(N/b)*b;Date.UTC(Z,0,1)<S.min&&(Z+=b);const L=[];for(;Date.UTC(Z,0,1)<=S.max;Z+=b)L.push(Date.UTC(Z,0,1));return L}function F(S,b=5){const N=M(S.max-S.min,b);if(N>=nt)return ct(S,Math.round(N/nt));const Z=[],L=Math.ceil(S.min/N)*N;for(let et=L;et<=S.max;et+=N)Z.push(et);return Z}function V(S,b){const N=S.max-S.min||1,[Z,L]=b;return{kind:"linear",domain:S,range:b,of(et){return Z+(et-S.min)/N*(L-Z)},invert(et){return S.min+(et-Z)/(L-Z||1)*N},ticks(et=5){return I(S,et)}}}function H(S,b){return{...V(S,b),kind:"time",ticks(Z=5){return F(S,Z)}}}function q(S){if(S==null)return" null";if(S instanceof Date)return` date:${S.getTime()}`;if(typeof S=="object"){const b=S,N=b.id??b.key??b.value;return N!==void 0&&typeof N!="object"?` obj:${String(N)}`:` obj:${String(S)}`}return String(S)}function tt(S,b,N=.2){const Z=Math.min(.9,Math.max(0,N)),[L,et]=b,j=new Map;for(let E=0;E<S.length;E++){const y=q(S[E]);j.has(y)||j.set(y,E)}const K=S.length?(et-L)/S.length:et-L,f=Math.max(0,K*(1-Z));return{kind:"band",domain:S,range:b,bandwidth:f,step:K,of(E){const y=j.get(q(E));return y===void 0?NaN:L+y*K+(K-f)/2},centre(E){const y=this.of(E);return Number.isNaN(y)?NaN:y+f/2},ticks(){return S}}}function st(S,b){const[N,Z]=b,L=Math.max(Math.abs(S.max),Math.abs(S.min),0)||1;return{kind:"sqrt",domain:S,range:b,of(et){const j=Math.sqrt(Math.abs(et)/L);return N+j*(Z-N)}}}}),Et("packages/modules/gantt/links.js",function(m,pt){"use strict";Object.defineProperty(m,"LINK_SIDES",{enumerable:!0,get:function(){return W}}),Object.defineProperty(m,"linkSides",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(m,"routeLink",{enumerable:!0,get:function(){return T}}),Object.defineProperty(m,"arrowheadPath",{enumerable:!0,get:function(){return X}});const Mt=pt("packages/modules/charts/svg.js"),dt=Mt.path,ot=Mt.round,W=Object.freeze({FS:Object.freeze({depart:1,arrive:-1}),SS:Object.freeze({depart:-1,arrive:-1}),FF:Object.freeze({depart:1,arrive:1}),SF:Object.freeze({depart:-1,arrive:1})});function nt(u){return W[String(u||"FS").toUpperCase()]||W.FS}function T(u){const $=Number(u.sx),A=Number(u.sy),D=Number(u.ex),lt=Number(u.ey),ut=Number.isFinite(u.elbow)&&u.elbow>0?Number(u.elbow):8,O=Number.isFinite(u.rowGap)&&u.rowGap>0?Number(u.rowGap):ut,I=nt(u.type),M=-I.arrive,ct=Math.abs(lt-A)<.5,F=(D-$)*M;if(ct&&F>0)return{d:dt(["M",ot($),ot(A),"H",ot(D)]),arrowDir:M,route:"straight"};if(F>=0)return{d:dt(["M",ot($),ot(A),"V",ot(lt),"H",ot(D)]),arrowDir:M,route:"drop"};const V=ct?A+O:(A+lt)/2,H=$+I.depart*ut,q=D+I.arrive*ut;return{d:dt(["M",ot($),ot(A),"H",ot(H),"V",ot(V),"H",ot(q),"V",ot(lt),"H",ot(D)]),arrowDir:M,route:"detour"}}function X(u,$,A,D=4){return dt(["M",ot(u),ot($),"L",ot(u-A*D),ot($-D),"L",ot(u-A*D),ot($+D),"Z"])}}),Et("packages/modules/gantt/messages.js",function(m,pt){"use strict";Object.defineProperty(m,"FALLBACK_EN",{enumerable:!0,get:function(){return ot}}),Object.defineProperty(m,"createTranslator",{enumerable:!0,get:function(){return W}});const dt=pt("packages/core/src/internal/util.js").isFunction,ot=Object.freeze({"gantt.lag":"+{days}d","gantt.lead":"{days}d","gantt.a11y.moved":"{name} moved to {date}","gantt.a11y.day":"day {day}","gantt.a11y.resized":"{name} resized to {days} days","gantt.a11y.linkFrom":"Linking from {name}. Focus the successor and press L.","gantt.a11y.linked":"Linked {from} to {to}, finish to start.","gantt.a11y.linkCancelled":"Link cancelled.","gantt.a11y.deleted":"{name} deleted.","gantt.workload.title":"Resource workload","gantt.workload.resource":"Resource","gantt.workload.total":"Total","gantt.workload.unassigned":"Unassigned","gantt.workload.cell":"{hours} h from {date}","gantt.workload.over":"{hours} h from {date}, over a capacity of {capacity} h","gantt.workload.expand":"Show {name}’s tasks","gantt.workload.collapse":"Hide {name}’s tasks","gantt.row.expand":"Expand {name}","gantt.row.collapse":"Collapse {name}","gantt.resource.over":"{name} — over-allocated","gantt.a11y.hoursSet":"{name}: {hours} h from {date}","gantt.a11y.hoursCleared":"{name}: no hours from {date}","gantt.a11y.hoursRefused":"{date} is not a working day; {name} was not changed.","gantt.tip.range":"{from} to {to}","gantt.tip.duration":"{days}d","gantt.tip.slack":"slack {days}d"});function W(nt,T){return function(u,$){const A=dt(T)?T():null,D=nt&&nt.grid,lt=A&&dt(A.t)&&A||D&&D.messages&&dt(D.messages.t)&&D.messages||null;if(lt){let O;try{O=lt.t(u,$)}catch{O=null}if(typeof O=="string"&&O&&O!==u)return O}const ut=ot[u];return ut?ut.replace(/\{(\w+)\}/g,(O,I)=>$&&I in $?String($[I]):O):u}}}),Et("packages/modules/gantt/gestures.js",function(m,pt){"use strict";Object.defineProperty(m,"describeTask",{enumerable:!0,get:function(){return ot}}),Object.defineProperty(m,"GanttGestures",{enumerable:!0,get:function(){return W}});const dt=pt("packages/modules/charts/svg.js").round;function ot(nt,T){const X=nt.isSummary?"summary":nt.isMilestone?"milestone":"task",u=T.dateAxis===!1?`day ${dt(nt.es)} to ${dt(nt.ef)}`:`${T.iso(nt.es)} to ${T.iso(nt.ef)}`,$=[`${nt.name}, ${X}`,u];return nt.isMilestone||$.push(`${dt(nt.duration)} days`),nt.percentComplete!=null&&$.push(`${Math.round(nt.percentComplete)}% complete`),$.push(`slack ${dt(nt.totalFloat)} days`),nt.critical&&$.push("on the critical path"),$.join(", ")}class W{#n;#o=null;#t=null;#e=null;constructor(T){this.#n=T}#i(){return this.#n.options()||{}}get dragging(){return this.#o!==null}#r(){const T=this.#n.plot();if(T&&typeof T.getScreenCTM=="function"){let u=null;try{u=T.getScreenCTM()}catch{u=null}if(u&&Number.isFinite(u.a)&&u.a>0)return{scale:u.a,origin:Number.isFinite(u.e)?u.e:0}}const X=T&&T.getBoundingClientRect?T.getBoundingClientRect():null;return{scale:1,origin:X&&X.left||0}}#u(T){const{scale:X,origin:u}=this.#r();return((T.clientX||0)-u)/X}#a(T){const{scale:X}=this.#r();return Math.round(T/X/(this.#n.pxPerDay()||1))}onPointerDown(T){const X=this.#n.controller.schedule;if(!X||!X.ok)return;const u=this.#n.rowOf(T.target);if(!u)return;const $=u.getAttribute("data-task"),A=X.tasks.get($);if(!A||A.isSummary)return;const D=this.#n.barOf(u);if(!D)return;const lt=this.#u(T),ut=Number.isFinite(this.#i().resizeZone)?Number(this.#i().resizeZone):6,O=!A.isMilestone&&lt>=this.#y(D)-ut?"resize":"move";this.#o={id:$,mode:O,startX:T.clientX||0,origStart:A.es,origDuration:A.duration,barEl:D},T.preventDefault&&T.preventDefault();const I=ct=>this.#s(ct),M=ct=>this.#N(ct);this.#t={move:I,up:M},this.#n.doc.addEventListener("pointermove",I),this.#n.doc.addEventListener("pointerup",M)}#y(T){const X=parseFloat(T.getAttribute("x")),u=parseFloat(T.getAttribute("width"));return Number.isFinite(X)&&Number.isFinite(u)?X+u:Number.POSITIVE_INFINITY}#s(T){if(!this.#o)return;const X=this.#n.pxPerDay()||1,u=this.#a((T.clientX||0)-this.#o.startX),$=this.#o.barEl;if(this.#o.mode==="move")$.getAttribute("d")?this.#x($,u*X):($.setAttribute("x",dt(parseFloat($.getAttribute("x"))+u*X-this.#c($))),this.#w($,u*X));else{const A=Math.max(1,parseFloat($.getAttribute("width"))+(u*X-this.#c($)));$.setAttribute("width",dt(A)),this.#w($,u*X)}}#c(T){return parseFloat(T.getAttribute("data-preview")||"0")}#w(T,X){T.setAttribute("data-preview",String(X))}#x(T,X){const u=this.#c(T),$=T.getAttribute("d").split(" ");for(let A=1;A<$.length;A+=1){const D=parseFloat($[A]);!Number.isNaN(D)&&A%3===1&&($[A]=String(dt(D+(X-u))))}T.setAttribute("d",$.join(" ")),this.#w(T,X)}#N(T){const X=this.#o;if(this.#g(),this.#o=null,!X)return;const u=this.#a((T.clientX||0)-X.startX);if(u===0){this.#n.redraw();return}X.mode==="move"?this.#n.controller.applyEdit({id:X.id,start:X.origStart+u},{writeBack:!0}):this.#n.controller.applyEdit({id:X.id,duration:Math.max(0,X.origDuration+u)},{writeBack:!0}),this.#n.redraw()}#g(){this.#t&&(this.#n.doc.removeEventListener("pointermove",this.#t.move),this.#n.doc.removeEventListener("pointerup",this.#t.up),this.#t=null)}onKey(T){const X=this.#n.controller,u=X.schedule;if(!u||!u.ok)return;const $=this.#n.rowOf(T.target),A=$?$.getAttribute("data-task"):null,D=A?u.tasks.get(A):null;if(!D)return;const lt=this.#i(),ut=Number.isFinite(lt.moveStep)?Number(lt.moveStep):1,O=T.key,I=this.#n.t;if(O==="ArrowRight"||O==="ArrowLeft"){if(D.isSummary)return;const M=O==="ArrowRight"?1:-1;if(this.#n.focusTask(A),T.shiftKey){if(D.isMilestone)return;const ct=Math.max(0,D.duration+M*ut);X.applyEdit({id:A,duration:ct},{writeBack:!0}),this.#n.announce(I("gantt.a11y.resized",{name:D.name,days:ct}))}else{const ct=D.es+M*ut,F=lt.dateAxis===!1?I("gantt.a11y.day",{day:ct}):this.#n.iso(ct);X.applyEdit({id:A,start:ct},{writeBack:!0}),this.#n.announce(I("gantt.a11y.moved",{name:D.name,date:F}))}T.preventDefault&&T.preventDefault()}else if(O==="l"||O==="L"){if(D.isSummary)return;if(!this.#e)this.#e=A,this.#n.announce(I("gantt.a11y.linkFrom",{name:D.name}));else if(this.#e!==A){const M=this.#e;this.#e=null,this.#n.focusTask(A),X.setDependencies([...X.dependencies,{from:M,to:A,type:"FS"}]),this.#n.announce(I("gantt.a11y.linked",{from:M,to:D.name}))}T.preventDefault&&T.preventDefault()}else if(O==="Delete"||O==="Backspace"){if(D.isSummary)return;X.deleteTask(A),this.#n.announce(I("gantt.a11y.deleted",{name:D.name})),T.preventDefault&&T.preventDefault()}else O==="Escape"&&this.#e&&(this.#e=null,this.#n.announce(I("gantt.a11y.linkCancelled")))}destroy(){this.#g(),this.#o=null,this.#e=null}}}),Et("packages/modules/gantt/render.js",function(m,pt){"use strict";Object.defineProperty(m,"NS",{enumerable:!0,get:function(){return f}}),Object.defineProperty(m,"GanttView",{enumerable:!0,get:function(){return at}}),Object.defineProperty(m,"mountGantt",{enumerable:!0,get:function(){return gt}});const dt=pt("packages/core/src/internal/util.js").warnOnce,ot=pt("packages/modules/shared/autosize.js"),W=ot.contentWidth,nt=ot.firstMeasured,T=ot.watchSize,u=pt("packages/modules/shared/axislabels.js").thinLabels,$=pt("packages/modules/charts/svg.js"),A=$.svg,D=$.el,lt=$.setText,ut=$.path,O=$.round,M=pt("packages/modules/charts/scale.js").linearScale,ct=pt("packages/modules/gantt/time.js"),F=ct.toISODate,V=ct.fromDayNumber,H=ct.toDayNumber,q=ct.resolveProjectEpoch,tt=pt("packages/modules/gantt/links.js"),st=tt.routeLink,S=tt.arrowheadPath,N=pt("packages/modules/gantt/schedule.js").EPS,Z=pt("packages/modules/gantt/messages.js"),L=Z.createTranslator,et=pt("packages/modules/gantt/gestures.js"),j=et.GanttGestures,K=et.describeTask;Object.defineProperty(m,"FALLBACK_EN",{enumerable:!0,get:function(){return Z.FALLBACK_EN}});const f="lat-gantt",E="data-lat-gantt-styles",y=720,R=Object.freeze({messages:null,width:"container",rowHeight:26,barPadding:4,labelWidth:160,axisHeight:22,rightPadding:16,rowLabels:!0,showArrows:!0,showCritical:!0,showProgress:!0,hoverChain:!0,dateAxis:!0,label:"name",today:null,nonWorking:null,editable:!0,resizeZone:6,zoom:null,projectEpoch:null,scrollToToday:!1,tooltip:!0,groupBy:null,keyboard:!0,moveStep:1}),l=11,U=Object.freeze({day:{px:28,step:1,level:"day"},week:{px:12,step:7,level:"week"},month:{px:4,step:30,level:"month"},quarter:{px:1.6,step:91,level:"quarter"}});function z(){return`
8
8
  .${f}{font:12px/1.4 system-ui,sans-serif;color:#1f2933;overflow:auto}
9
9
  .${f}__plot{max-width:100%;height:auto;display:block}