pmac-cli
Version:
CLI tools for Project Management as Code (PMaC) - Standalone npm package with interactive backlog viewer
168 lines • 207 kB
JavaScript
import{P as Gl,n as Ae,s as at,a as Xl,r as ct,i as il,S as ht,b as pt,e as ye,d as j,c as xe,f as tt,g as Nt,t as ts,h as B,j as a,l as ge,k as p,m as v,o as A,p as u,q as as,u as Je,v as Jt,w as $,x as Ls,y as ue,z as dt,A as Ie,B as Te,C as rt,D as ot,E as fn,F as bt,G as _t,H as kt,I as vt,J as ll,K as Hs,L as un}from"./svelte-DvuOi6vQ.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const r of l.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&n(r)}).observe(document,{childList:!0,subtree:!0});function t(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function n(i){if(i.ep)return;i.ep=!0;const l=t(i);fetch(i.href,l)}})();typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Gl);const Vs=Symbol.for("yaml.alias"),Ds=Symbol.for("yaml.document"),ut=Symbol.for("yaml.map"),rl=Symbol.for("yaml.pair"),nt=Symbol.for("yaml.scalar"),Rt=Symbol.for("yaml.seq"),Ze=Symbol.for("yaml.node.type"),St=s=>!!s&&typeof s=="object"&&s[Ze]===Vs,gs=s=>!!s&&typeof s=="object"&&s[Ze]===Ds,Wt=s=>!!s&&typeof s=="object"&&s[Ze]===ut,Re=s=>!!s&&typeof s=="object"&&s[Ze]===rl,Ee=s=>!!s&&typeof s=="object"&&s[Ze]===nt,Qt=s=>!!s&&typeof s=="object"&&s[Ze]===Rt;function De(s){if(s&&typeof s=="object")switch(s[Ze]){case ut:case Rt:return!0}return!1}function $e(s){if(s&&typeof s=="object")switch(s[Ze]){case Vs:case ut:case nt:case Rt:return!0}return!1}const ol=s=>(Ee(s)||De(s))&&!!s.anchor,mt=Symbol("break visit"),Wl=Symbol("skip children"),Vt=Symbol("remove node");function qt(s,e){const t=Ql(e);gs(s)?Et(null,s.contents,t,Object.freeze([s]))===Vt&&(s.contents=null):Et(null,s,t,Object.freeze([]))}qt.BREAK=mt;qt.SKIP=Wl;qt.REMOVE=Vt;function Et(s,e,t,n){const i=Zl(s,e,t,n);if($e(i)||Re(i))return er(s,n,i),Et(s,i,t,n);if(typeof i!="symbol"){if(De(e)){n=Object.freeze(n.concat(e));for(let l=0;l<e.items.length;++l){const r=Et(l,e.items[l],t,n);if(typeof r=="number")l=r-1;else{if(r===mt)return mt;r===Vt&&(e.items.splice(l,1),l-=1)}}}else if(Re(e)){n=Object.freeze(n.concat(e));const l=Et("key",e.key,t,n);if(l===mt)return mt;l===Vt&&(e.key=null);const r=Et("value",e.value,t,n);if(r===mt)return mt;r===Vt&&(e.value=null)}}return i}function Ql(s){return typeof s=="object"&&(s.Collection||s.Node||s.Value)?Object.assign({Alias:s.Node,Map:s.Node,Scalar:s.Node,Seq:s.Node},s.Value&&{Map:s.Value,Scalar:s.Value,Seq:s.Value},s.Collection&&{Map:s.Collection,Seq:s.Collection},s):s}function Zl(s,e,t,n){var i,l,r,o,c;if(typeof t=="function")return t(s,e,n);if(Wt(e))return(i=t.Map)==null?void 0:i.call(t,s,e,n);if(Qt(e))return(l=t.Seq)==null?void 0:l.call(t,s,e,n);if(Re(e))return(r=t.Pair)==null?void 0:r.call(t,s,e,n);if(Ee(e))return(o=t.Scalar)==null?void 0:o.call(t,s,e,n);if(St(e))return(c=t.Alias)==null?void 0:c.call(t,s,e,n)}function er(s,e,t){const n=e[e.length-1];if(De(n))n.items[s]=t;else if(Re(n))s==="key"?n.key=t:n.value=t;else if(gs(n))n.contents=t;else{const i=St(n)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const tr={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},sr=s=>s.replace(/[!,[\]{}]/g,e=>tr[e]);class Ve{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Ve.defaultYaml,e),this.tags=Object.assign({},Ve.defaultTags,t)}clone(){const e=new Ve(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new Ve(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Ve.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Ve.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:Ve.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Ve.defaultTags),this.atNextDocument=!1);const n=e.trim().split(/[ \t]+/),i=n.shift();switch(i){case"%TAG":{if(n.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;const[l,r]=n;return this.tags[l]=r,!0}case"%YAML":{if(this.yaml.explicit=!0,n.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;const[l]=n;if(l==="1.1"||l==="1.2")return this.yaml.version=l,!0;{const r=/^\d+\.\d+$/.test(l);return t(6,`Unsupported YAML version ${l}`,r),!1}}default:return t(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const r=e.slice(2,-1);return r==="!"||r==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),r)}const[,n,i]=e.match(/^(.*!)([^!]*)$/s);i||t(`The ${e} tag has no suffix`);const l=this.tags[n];if(l)try{return l+decodeURIComponent(i)}catch(r){return t(String(r)),null}return n==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+sr(e.substring(n.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],n=Object.entries(this.tags);let i;if(e&&n.length>0&&$e(e.contents)){const l={};qt(e.contents,(r,o)=>{$e(o)&&o.tag&&(l[o.tag]=!0)}),i=Object.keys(l)}else i=[];for(const[l,r]of n)l==="!!"&&r==="tag:yaml.org,2002:"||(!e||i.some(o=>o.startsWith(r)))&&t.push(`%TAG ${l} ${r}`);return t.join(`
`)}}Ve.defaultYaml={explicit:!1,version:"1.2"};Ve.defaultTags={"!!":"tag:yaml.org,2002:"};function al(s){if(/[\x00-\x19\s,[\]{}]/.test(s)){const t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(s)}`;throw new Error(t)}return!0}function cl(s){const e=new Set;return qt(s,{Value(t,n){n.anchor&&e.add(n.anchor)}}),e}function fl(s,e){for(let t=1;;++t){const n=`${s}${t}`;if(!e.has(n))return n}}function nr(s,e){const t=[],n=new Map;let i=null;return{onAnchor:l=>{t.push(l),i??(i=cl(s));const r=fl(e,i);return i.add(r),r},setAnchors:()=>{for(const l of t){const r=n.get(l);if(typeof r=="object"&&r.anchor&&(Ee(r.node)||De(r.node)))r.node.anchor=r.anchor;else{const o=new Error("Failed to resolve repeated object (this should not happen)");throw o.source=l,o}}},sourceObjects:n}}function It(s,e,t,n){if(n&&typeof n=="object")if(Array.isArray(n))for(let i=0,l=n.length;i<l;++i){const r=n[i],o=It(s,n,String(i),r);o===void 0?delete n[i]:o!==r&&(n[i]=o)}else if(n instanceof Map)for(const i of Array.from(n.keys())){const l=n.get(i),r=It(s,n,i,l);r===void 0?n.delete(i):r!==l&&n.set(i,r)}else if(n instanceof Set)for(const i of Array.from(n)){const l=It(s,n,i,i);l===void 0?n.delete(i):l!==i&&(n.delete(i),n.add(l))}else for(const[i,l]of Object.entries(n)){const r=It(s,n,i,l);r===void 0?delete n[i]:r!==l&&(n[i]=r)}return s.call(e,t,n)}function Qe(s,e,t){if(Array.isArray(s))return s.map((n,i)=>Qe(n,String(i),t));if(s&&typeof s.toJSON=="function"){if(!t||!ol(s))return s.toJSON(e,t);const n={aliasCount:0,count:1,res:void 0};t.anchors.set(s,n),t.onCreate=l=>{n.res=l,delete t.onCreate};const i=s.toJSON(e,t);return t.onCreate&&t.onCreate(i),i}return typeof s=="bigint"&&!(t!=null&&t.keep)?Number(s):s}class zs{constructor(e){Object.defineProperty(this,Ze,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:i,reviver:l}={}){if(!gs(e))throw new TypeError("A document argument is required");const r={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},o=Qe(this,"",r);if(typeof i=="function")for(const{count:c,res:f}of r.anchors.values())i(f,c);return typeof l=="function"?It(l,{"":o},"",o):o}}class Js extends zs{constructor(e){super(Vs),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){let n;t!=null&&t.aliasResolveCache?n=t.aliasResolveCache:(n=[],qt(e,{Node:(l,r)=>{(St(r)||ol(r))&&n.push(r)}}),t&&(t.aliasResolveCache=n));let i;for(const l of n){if(l===this)break;l.anchor===this.source&&(i=l)}return i}toJSON(e,t){if(!t)return{source:this.source};const{anchors:n,doc:i,maxAliasCount:l}=t,r=this.resolve(i,t);if(!r){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let o=n.get(r);if(o||(Qe(r,null,t),o=n.get(r)),!o||o.res===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(l>=0&&(o.count+=1,o.aliasCount===0&&(o.aliasCount=cs(i,r,n)),o.count*o.aliasCount>l)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return o.res}toString(e,t,n){const i=`*${this.source}`;if(e){if(al(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(l)}if(e.implicitKey)return`${i} `}return i}}function cs(s,e,t){if(St(e)){const n=e.resolve(s),i=t&&n&&t.get(n);return i?i.count*i.aliasCount:0}else if(De(e)){let n=0;for(const i of e.items){const l=cs(s,i,t);l>n&&(n=l)}return n}else if(Re(e)){const n=cs(s,e.key,t),i=cs(s,e.value,t);return Math.max(n,i)}return 1}const ul=s=>!s||typeof s!="function"&&typeof s!="object";class de extends zs{constructor(e){super(nt),this.value=e}toJSON(e,t){return t!=null&&t.keep?this.value:Qe(this.value,e,t)}toString(){return String(this.value)}}de.BLOCK_FOLDED="BLOCK_FOLDED";de.BLOCK_LITERAL="BLOCK_LITERAL";de.PLAIN="PLAIN";de.QUOTE_DOUBLE="QUOTE_DOUBLE";de.QUOTE_SINGLE="QUOTE_SINGLE";const ir="tag:yaml.org,2002:";function lr(s,e,t){if(e){const n=t.filter(l=>l.tag===e),i=n.find(l=>!l.format)??n[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return t.find(n=>{var i;return((i=n.identify)==null?void 0:i.call(n,s))&&!n.format})}function Gt(s,e,t){var h,m,g;if(gs(s)&&(s=s.contents),$e(s))return s;if(Re(s)){const k=(m=(h=t.schema[ut]).createNode)==null?void 0:m.call(h,t.schema,null,t);return k.items.push(s),k}(s instanceof String||s instanceof Number||s instanceof Boolean||typeof BigInt<"u"&&s instanceof BigInt)&&(s=s.valueOf());const{aliasDuplicateObjects:n,onAnchor:i,onTagObj:l,schema:r,sourceObjects:o}=t;let c;if(n&&s&&typeof s=="object"){if(c=o.get(s),c)return c.anchor??(c.anchor=i(s)),new Js(c.anchor);c={anchor:null,node:null},o.set(s,c)}e!=null&&e.startsWith("!!")&&(e=ir+e.slice(2));let f=lr(s,e,r.tags);if(!f){if(s&&typeof s.toJSON=="function"&&(s=s.toJSON()),!s||typeof s!="object"){const k=new de(s);return c&&(c.node=k),k}f=s instanceof Map?r[ut]:Symbol.iterator in Object(s)?r[Rt]:r[ut]}l&&(l(f),delete t.onTagObj);const d=f!=null&&f.createNode?f.createNode(t.schema,s,t):typeof((g=f==null?void 0:f.nodeClass)==null?void 0:g.from)=="function"?f.nodeClass.from(t.schema,s,t):new de(s);return e?d.tag=e:f.default||(d.tag=f.tag),c&&(c.node=d),d}function ds(s,e,t){let n=t;for(let i=e.length-1;i>=0;--i){const l=e[i];if(typeof l=="number"&&Number.isInteger(l)&&l>=0){const r=[];r[l]=n,n=r}else n=new Map([[l,n]])}return Gt(n,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:s,sourceObjects:new Map})}const Ut=s=>s==null||typeof s=="object"&&!!s[Symbol.iterator]().next().done;class dl extends zs{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(n=>$e(n)||Re(n)?n.clone(e):n),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Ut(e))this.add(t);else{const[n,...i]=e,l=this.get(n,!0);if(De(l))l.addIn(i,t);else if(l===void 0&&this.schema)this.set(n,ds(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}deleteIn(e){const[t,...n]=e;if(n.length===0)return this.delete(t);const i=this.get(t,!0);if(De(i))return i.deleteIn(n);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){const[n,...i]=e,l=this.get(n,!0);return i.length===0?!t&&Ee(l)?l.value:l:De(l)?l.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!Re(t))return!1;const n=t.value;return n==null||e&&Ee(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){const[t,...n]=e;if(n.length===0)return this.has(t);const i=this.get(t,!0);return De(i)?i.hasIn(n):!1}setIn(e,t){const[n,...i]=e;if(i.length===0)this.set(n,t);else{const l=this.get(n,!0);if(De(l))l.setIn(i,t);else if(l===void 0&&this.schema)this.set(n,ds(this.schema,i,t));else throw new Error(`Expected YAML collection at ${n}. Remaining path: ${i}`)}}}const rr=s=>s.replace(/^(?!$)(?: $)?/gm,"#");function it(s,e){return/^\n+$/.test(s)?s.substring(1):e?s.replace(/^(?! *$)/gm,e):s}const gt=(s,e,t)=>s.endsWith(`
`)?it(t,e):t.includes(`
`)?`
`+it(t,e):(s.endsWith(" ")?"":" ")+t,hl="flow",$s="block",fs="quoted";function ys(s,e,t="flow",{indentAtStart:n,lineWidth:i=80,minContentWidth:l=20,onFold:r,onOverflow:o}={}){if(!i||i<0)return s;i<l&&(l=0);const c=Math.max(1+l,1+i-e.length);if(s.length<=c)return s;const f=[],d={};let h=i-e.length;typeof n=="number"&&(n>i-Math.max(2,l)?f.push(0):h=i-n);let m,g,k=!1,y=-1,b=-1,_=-1;t===$s&&(y=dn(s,y,e.length),y!==-1&&(h=y+c));for(let N;N=s[y+=1];){if(t===fs&&N==="\\"){switch(b=y,s[y+1]){case"x":y+=3;break;case"u":y+=5;break;case"U":y+=9;break;default:y+=1}_=y}if(N===`
`)t===$s&&(y=dn(s,y,e.length)),h=y+e.length+c,m=void 0;else{if(N===" "&&g&&g!==" "&&g!==`
`&&g!==" "){const S=s[y+1];S&&S!==" "&&S!==`
`&&S!==" "&&(m=y)}if(y>=h)if(m)f.push(m),h=m+c,m=void 0;else if(t===fs){for(;g===" "||g===" ";)g=N,N=s[y+=1],k=!0;const S=y>_+1?y-2:b-1;if(d[S])return s;f.push(S),d[S]=!0,h=S+c,m=void 0}else k=!0}g=N}if(k&&o&&o(),f.length===0)return s;r&&r();let w=s.slice(0,f[0]);for(let N=0;N<f.length;++N){const S=f[N],C=f[N+1]||s.length;S===0?w=`
${e}${s.slice(0,C)}`:(t===fs&&d[S]&&(w+=`${s[S]}\\`),w+=`
${e}${s.slice(S+1,C)}`)}return w}function dn(s,e,t){let n=e,i=e+1,l=s[i];for(;l===" "||l===" ";)if(e<i+t)l=s[++e];else{do l=s[++e];while(l&&l!==`
`);n=e,i=e+1,l=s[i]}return n}const bs=(s,e)=>({indentAtStart:e?s.indent.length:s.indentAtStart,lineWidth:s.options.lineWidth,minContentWidth:s.options.minContentWidth}),_s=s=>/^(%|---|\.\.\.)/m.test(s);function or(s,e,t){if(!e||e<0)return!1;const n=e-t,i=s.length;if(i<=n)return!1;for(let l=0,r=0;l<i;++l)if(s[l]===`
`){if(l-r>n)return!0;if(r=l+1,i-r<=n)return!1}return!0}function zt(s,e){const t=JSON.stringify(s);if(e.options.doubleQuotedAsJSON)return t;const{implicitKey:n}=e,i=e.options.doubleQuotedMinMultiLineLength,l=e.indent||(_s(s)?" ":"");let r="",o=0;for(let c=0,f=t[c];f;f=t[++c])if(f===" "&&t[c+1]==="\\"&&t[c+2]==="n"&&(r+=t.slice(o,c)+"\\ ",c+=1,o=c,f="\\"),f==="\\")switch(t[c+1]){case"u":{r+=t.slice(o,c);const d=t.substr(c+2,4);switch(d){case"0000":r+="\\0";break;case"0007":r+="\\a";break;case"000b":r+="\\v";break;case"001b":r+="\\e";break;case"0085":r+="\\N";break;case"00a0":r+="\\_";break;case"2028":r+="\\L";break;case"2029":r+="\\P";break;default:d.substr(0,2)==="00"?r+="\\x"+d.substr(2):r+=t.substr(c,6)}c+=5,o=c+1}break;case"n":if(n||t[c+2]==='"'||t.length<i)c+=1;else{for(r+=t.slice(o,c)+`
`;t[c+2]==="\\"&&t[c+3]==="n"&&t[c+4]!=='"';)r+=`
`,c+=2;r+=l,t[c+2]===" "&&(r+="\\"),c+=1,o=c+1}break;default:c+=1}return r=o?r+t.slice(o):t,n?r:ys(r,l,fs,bs(e,!1))}function Rs(s,e){if(e.options.singleQuote===!1||e.implicitKey&&s.includes(`
`)||/[ \t]\n|\n[ \t]/.test(s))return zt(s,e);const t=e.indent||(_s(s)?" ":""),n="'"+s.replace(/'/g,"''").replace(/\n+/g,`$&
${t}`)+"'";return e.implicitKey?n:ys(n,t,hl,bs(e,!1))}function Mt(s,e){const{singleQuote:t}=e.options;let n;if(t===!1)n=zt;else{const i=s.includes('"'),l=s.includes("'");i&&!l?n=Rs:l&&!i?n=zt:n=t?Rs:zt}return n(s,e)}let qs;try{qs=new RegExp(`(^|(?<!
))
+(?!
|$)`,"g")}catch{qs=/\n+(?!\n|$)/g}function us({comment:s,type:e,value:t},n,i,l){const{blockQuote:r,commentString:o,lineWidth:c}=n.options;if(!r||/\n[\t ]+$/.test(t)||/^\s*$/.test(t))return Mt(t,n);const f=n.indent||(n.forceBlockIndent||_s(t)?" ":""),d=r==="literal"?!0:r==="folded"||e===de.BLOCK_FOLDED?!1:e===de.BLOCK_LITERAL?!0:!or(t,c,f.length);if(!t)return d?`|
`:`>
`;let h,m;for(m=t.length;m>0;--m){const C=t[m-1];if(C!==`
`&&C!==" "&&C!==" ")break}let g=t.substring(m);const k=g.indexOf(`
`);k===-1?h="-":t===g||k!==g.length-1?(h="+",l&&l()):h="",g&&(t=t.slice(0,-g.length),g[g.length-1]===`
`&&(g=g.slice(0,-1)),g=g.replace(qs,`$&${f}`));let y=!1,b,_=-1;for(b=0;b<t.length;++b){const C=t[b];if(C===" ")y=!0;else if(C===`
`)_=b;else break}let w=t.substring(0,_<b?_+1:b);w&&(t=t.substring(w.length),w=w.replace(/\n+/g,`$&${f}`));let S=(y?f?"2":"1":"")+h;if(s&&(S+=" "+o(s.replace(/ ?[\r\n]+/g," ")),i&&i()),!d){const C=t.replace(/\n+/g,`
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${f}`);let L=!1;const E=bs(n,!0);r!=="folded"&&e!==de.BLOCK_FOLDED&&(E.onOverflow=()=>{L=!0});const O=ys(`${w}${C}${g}`,f,$s,E);if(!L)return`>${S}
${f}${O}`}return t=t.replace(/\n+/g,`$&${f}`),`|${S}
${f}${w}${t}${g}`}function ar(s,e,t,n){const{type:i,value:l}=s,{actualString:r,implicitKey:o,indent:c,indentStep:f,inFlow:d}=e;if(o&&l.includes(`
`)||d&&/[[\]{},]/.test(l))return Mt(l,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(l))return o||d||!l.includes(`
`)?Mt(l,e):us(s,e,t,n);if(!o&&!d&&i!==de.PLAIN&&l.includes(`
`))return us(s,e,t,n);if(_s(l)){if(c==="")return e.forceBlockIndent=!0,us(s,e,t,n);if(o&&c===f)return Mt(l,e)}const h=l.replace(/\n+/g,`$&
${c}`);if(r){const m=y=>{var b;return y.default&&y.tag!=="tag:yaml.org,2002:str"&&((b=y.test)==null?void 0:b.test(h))},{compat:g,tags:k}=e.doc.schema;if(k.some(m)||g!=null&&g.some(m))return Mt(l,e)}return o?h:ys(h,c,hl,bs(e,!1))}function Gs(s,e,t,n){const{implicitKey:i,inFlow:l}=e,r=typeof s.value=="string"?s:Object.assign({},s,{value:String(s.value)});let{type:o}=s;o!==de.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(r.value)&&(o=de.QUOTE_DOUBLE);const c=d=>{switch(d){case de.BLOCK_FOLDED:case de.BLOCK_LITERAL:return i||l?Mt(r.value,e):us(r,e,t,n);case de.QUOTE_DOUBLE:return zt(r.value,e);case de.QUOTE_SINGLE:return Rs(r.value,e);case de.PLAIN:return ar(r,e,t,n);default:return null}};let f=c(o);if(f===null){const{defaultKeyType:d,defaultStringType:h}=e.options,m=i&&d||h;if(f=c(m),f===null)throw new Error(`Unsupported default string type ${m}`)}return f}function pl(s,e){const t=Object.assign({blockQuote:!0,commentString:rr,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},s.schema.toStringOptions,e);let n;switch(t.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:s,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:n,options:t}}function cr(s,e){var i;if(e.tag){const l=s.filter(r=>r.tag===e.tag);if(l.length>0)return l.find(r=>r.format===e.format)??l[0]}let t,n;if(Ee(e)){n=e.value;let l=s.filter(r=>{var o;return(o=r.identify)==null?void 0:o.call(r,n)});if(l.length>1){const r=l.filter(o=>o.test);r.length>0&&(l=r)}t=l.find(r=>r.format===e.format)??l.find(r=>!r.format)}else n=e,t=s.find(l=>l.nodeClass&&n instanceof l.nodeClass);if(!t){const l=((i=n==null?void 0:n.constructor)==null?void 0:i.name)??(n===null?"null":typeof n);throw new Error(`Tag not resolved for ${l} value`)}return t}function fr(s,e,{anchors:t,doc:n}){if(!n.directives)return"";const i=[],l=(Ee(s)||De(s))&&s.anchor;l&&al(l)&&(t.add(l),i.push(`&${l}`));const r=s.tag??(e.default?null:e.tag);return r&&i.push(n.directives.tagString(r)),i.join(" ")}function Bt(s,e,t,n){var c;if(Re(s))return s.toString(e,t,n);if(St(s)){if(e.doc.directives)return s.toString(e);if((c=e.resolvedAliases)!=null&&c.has(s))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(s):e.resolvedAliases=new Set([s]),s=s.resolve(e.doc)}let i;const l=$e(s)?s:e.doc.createNode(s,{onTagObj:f=>i=f});i??(i=cr(e.doc.schema.tags,l));const r=fr(l,i,e);r.length>0&&(e.indentAtStart=(e.indentAtStart??0)+r.length+1);const o=typeof i.stringify=="function"?i.stringify(l,e,t,n):Ee(l)?Gs(l,e,t,n):l.toString(e,t,n);return r?Ee(l)||o[0]==="{"||o[0]==="["?`${r} ${o}`:`${r}
${e.indent}${o}`:o}function ur({key:s,value:e},t,n,i){const{allNullValues:l,doc:r,indent:o,indentStep:c,options:{commentString:f,indentSeq:d,simpleKeys:h}}=t;let m=$e(s)&&s.comment||null;if(h){if(m)throw new Error("With simple keys, key nodes cannot have comments");if(De(s)||!$e(s)&&typeof s=="object"){const E="With simple keys, collection cannot be used as a key value";throw new Error(E)}}let g=!h&&(!s||m&&e==null&&!t.inFlow||De(s)||(Ee(s)?s.type===de.BLOCK_FOLDED||s.type===de.BLOCK_LITERAL:typeof s=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!g&&(h||!l),indent:o+c});let k=!1,y=!1,b=Bt(s,t,()=>k=!0,()=>y=!0);if(!g&&!t.inFlow&&b.length>1024){if(h)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");g=!0}if(t.inFlow){if(l||e==null)return k&&n&&n(),b===""?"?":g?`? ${b}`:b}else if(l&&!h||e==null&&g)return b=`? ${b}`,m&&!k?b+=gt(b,t.indent,f(m)):y&&i&&i(),b;k&&(m=null),g?(m&&(b+=gt(b,t.indent,f(m))),b=`? ${b}
${o}:`):(b=`${b}:`,m&&(b+=gt(b,t.indent,f(m))));let _,w,N;$e(e)?(_=!!e.spaceBefore,w=e.commentBefore,N=e.comment):(_=!1,w=null,N=null,e&&typeof e=="object"&&(e=r.createNode(e))),t.implicitKey=!1,!g&&!m&&Ee(e)&&(t.indentAtStart=b.length+1),y=!1,!d&&c.length>=2&&!t.inFlow&&!g&&Qt(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let S=!1;const C=Bt(e,t,()=>S=!0,()=>y=!0);let L=" ";if(m||_||w){if(L=_?`
`:"",w){const E=f(w);L+=`
${it(E,t.indent)}`}C===""&&!t.inFlow?L===`
`&&(L=`
`):L+=`
${t.indent}`}else if(!g&&De(e)){const E=C[0],O=C.indexOf(`
`),P=O!==-1,Y=t.inFlow??e.flow??e.items.length===0;if(P||!Y){let z=!1;if(P&&(E==="&"||E==="!")){let I=C.indexOf(" ");E==="&"&&I!==-1&&I<O&&C[I+1]==="!"&&(I=C.indexOf(" ",I+1)),(I===-1||O<I)&&(z=!0)}z||(L=`
${t.indent}`)}}else(C===""||C[0]===`
`)&&(L="");return b+=L+C,t.inFlow?S&&n&&n():N&&!S?b+=gt(b,t.indent,f(N)):y&&i&&i(),b}function ml(s,e){(s==="debug"||s==="warn")&&console.warn(e)}const ss="<<",lt={identify:s=>s===ss||typeof s=="symbol"&&s.description===ss,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new de(Symbol(ss)),{addToJSMap:gl}),stringify:()=>ss},dr=(s,e)=>(lt.identify(e)||Ee(e)&&(!e.type||e.type===de.PLAIN)&<.identify(e.value))&&(s==null?void 0:s.doc.schema.tags.some(t=>t.tag===lt.tag&&t.default));function gl(s,e,t){if(t=s&&St(t)?t.resolve(s.doc):t,Qt(t))for(const n of t.items)Os(s,e,n);else if(Array.isArray(t))for(const n of t)Os(s,e,n);else Os(s,e,t)}function Os(s,e,t){const n=s&&St(t)?t.resolve(s.doc):t;if(!Wt(n))throw new Error("Merge sources must be maps or map aliases");const i=n.toJSON(null,s,Map);for(const[l,r]of i)e instanceof Map?e.has(l)||e.set(l,r):e instanceof Set?e.add(l):Object.prototype.hasOwnProperty.call(e,l)||Object.defineProperty(e,l,{value:r,writable:!0,enumerable:!0,configurable:!0});return e}function yl(s,e,{key:t,value:n}){if($e(t)&&t.addToJSMap)t.addToJSMap(s,e,n);else if(dr(s,t))gl(s,e,n);else{const i=Qe(t,"",s);if(e instanceof Map)e.set(i,Qe(n,i,s));else if(e instanceof Set)e.add(i);else{const l=hr(t,i,s),r=Qe(n,l,s);l in e?Object.defineProperty(e,l,{value:r,writable:!0,enumerable:!0,configurable:!0}):e[l]=r}}return e}function hr(s,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if($e(s)&&(t!=null&&t.doc)){const n=pl(t.doc,{});n.anchors=new Set;for(const l of t.anchors.keys())n.anchors.add(l.anchor);n.inFlow=!0,n.inStringifyKey=!0;const i=s.toString(n);if(!t.mapKeyWarned){let l=JSON.stringify(i);l.length>40&&(l=l.substring(0,36)+'..."'),ml(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${l}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return i}return JSON.stringify(e)}function Xs(s,e,t){const n=Gt(s,void 0,t),i=Gt(e,void 0,t);return new ze(n,i)}class ze{constructor(e,t=null){Object.defineProperty(this,Ze,{value:rl}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return $e(t)&&(t=t.clone(e)),$e(n)&&(n=n.clone(e)),new ze(t,n)}toJSON(e,t){const n=t!=null&&t.mapAsMap?new Map:{};return yl(t,n,this)}toString(e,t,n){return e!=null&&e.doc?ur(this,e,t,n):JSON.stringify(this)}}function bl(s,e,t){return(e.inFlow??s.flow?mr:pr)(s,e,t)}function pr({comment:s,items:e},t,{blockItemPrefix:n,flowChars:i,itemIndent:l,onChompKeep:r,onComment:o}){const{indent:c,options:{commentString:f}}=t,d=Object.assign({},t,{indent:l,type:null});let h=!1;const m=[];for(let k=0;k<e.length;++k){const y=e[k];let b=null;if($e(y))!h&&y.spaceBefore&&m.push(""),hs(t,m,y.commentBefore,h),y.comment&&(b=y.comment);else if(Re(y)){const w=$e(y.key)?y.key:null;w&&(!h&&w.spaceBefore&&m.push(""),hs(t,m,w.commentBefore,h))}h=!1;let _=Bt(y,d,()=>b=null,()=>h=!0);b&&(_+=gt(_,l,f(b))),h&&b&&(h=!1),m.push(n+_)}let g;if(m.length===0)g=i.start+i.end;else{g=m[0];for(let k=1;k<m.length;++k){const y=m[k];g+=y?`
${c}${y}`:`
`}}return s?(g+=`
`+it(f(s),c),o&&o()):h&&r&&r(),g}function mr({items:s},e,{flowChars:t,itemIndent:n}){const{indent:i,indentStep:l,flowCollectionPadding:r,options:{commentString:o}}=e;n+=l;const c=Object.assign({},e,{indent:n,inFlow:!0,type:null});let f=!1,d=0;const h=[];for(let k=0;k<s.length;++k){const y=s[k];let b=null;if($e(y))y.spaceBefore&&h.push(""),hs(e,h,y.commentBefore,!1),y.comment&&(b=y.comment);else if(Re(y)){const w=$e(y.key)?y.key:null;w&&(w.spaceBefore&&h.push(""),hs(e,h,w.commentBefore,!1),w.comment&&(f=!0));const N=$e(y.value)?y.value:null;N?(N.comment&&(b=N.comment),N.commentBefore&&(f=!0)):y.value==null&&(w!=null&&w.comment)&&(b=w.comment)}b&&(f=!0);let _=Bt(y,c,()=>b=null);k<s.length-1&&(_+=","),b&&(_+=gt(_,n,o(b))),!f&&(h.length>d||_.includes(`
`))&&(f=!0),h.push(_),d=h.length}const{start:m,end:g}=t;if(h.length===0)return m+g;if(!f){const k=h.reduce((y,b)=>y+b.length+2,2);f=e.options.lineWidth>0&&k>e.options.lineWidth}if(f){let k=m;for(const y of h)k+=y?`
${l}${i}${y}`:`
`;return`${k}
${i}${g}`}else return`${m}${r}${h.join(" ")}${r}${g}`}function hs({indent:s,options:{commentString:e}},t,n,i){if(n&&i&&(n=n.replace(/^\n+/,"")),n){const l=it(e(n),s);t.push(l.trimStart())}}function yt(s,e){const t=Ee(e)?e.value:e;for(const n of s)if(Re(n)&&(n.key===e||n.key===t||Ee(n.key)&&n.key.value===t))return n}class We extends dl{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(ut,e),this.items=[]}static from(e,t,n){const{keepUndefined:i,replacer:l}=n,r=new this(e),o=(c,f)=>{if(typeof l=="function")f=l.call(t,c,f);else if(Array.isArray(l)&&!l.includes(c))return;(f!==void 0||i)&&r.items.push(Xs(c,f,n))};if(t instanceof Map)for(const[c,f]of t)o(c,f);else if(t&&typeof t=="object")for(const c of Object.keys(t))o(c,t[c]);return typeof e.sortMapEntries=="function"&&r.items.sort(e.sortMapEntries),r}add(e,t){var r;let n;Re(e)?n=e:!e||typeof e!="object"||!("key"in e)?n=new ze(e,e==null?void 0:e.value):n=new ze(e.key,e.value);const i=yt(this.items,n.key),l=(r=this.schema)==null?void 0:r.sortMapEntries;if(i){if(!t)throw new Error(`Key ${n.key} already set`);Ee(i.value)&&ul(n.value)?i.value.value=n.value:i.value=n.value}else if(l){const o=this.items.findIndex(c=>l(n,c)<0);o===-1?this.items.push(n):this.items.splice(o,0,n)}else this.items.push(n)}delete(e){const t=yt(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){const n=yt(this.items,e),i=n==null?void 0:n.value;return(!t&&Ee(i)?i.value:i)??void 0}has(e){return!!yt(this.items,e)}set(e,t){this.add(new ze(e,t),!0)}toJSON(e,t,n){const i=n?new n:t!=null&&t.mapAsMap?new Map:{};t!=null&&t.onCreate&&t.onCreate(i);for(const l of this.items)yl(t,i,l);return i}toString(e,t,n){if(!e)return JSON.stringify(this);for(const i of this.items)if(!Re(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),bl(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}}const Ft={collection:"map",default:!0,nodeClass:We,tag:"tag:yaml.org,2002:map",resolve(s,e){return Wt(s)||e("Expected a mapping for this tag"),s},createNode:(s,e,t)=>We.from(s,e,t)};class wt extends dl{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Rt,e),this.items=[]}add(e){this.items.push(e)}delete(e){const t=ns(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){const n=ns(e);if(typeof n!="number")return;const i=this.items[n];return!t&&Ee(i)?i.value:i}has(e){const t=ns(e);return typeof t=="number"&&t<this.items.length}set(e,t){const n=ns(e);if(typeof n!="number")throw new Error(`Expected a valid index, not ${e}.`);const i=this.items[n];Ee(i)&&ul(t)?i.value=t:this.items[n]=t}toJSON(e,t){const n=[];t!=null&&t.onCreate&&t.onCreate(n);let i=0;for(const l of this.items)n.push(Qe(l,String(i++),t));return n}toString(e,t,n){return e?bl(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){const{replacer:i}=n,l=new this(e);if(t&&Symbol.iterator in Object(t)){let r=0;for(let o of t){if(typeof i=="function"){const c=t instanceof Set?o:String(r++);o=i.call(t,c,o)}l.items.push(Gt(o,void 0,n))}}return l}}function ns(s){let e=Ee(s)?s.value:s;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}const xt={collection:"seq",default:!0,nodeClass:wt,tag:"tag:yaml.org,2002:seq",resolve(s,e){return Qt(s)||e("Expected a sequence for this tag"),s},createNode:(s,e,t)=>wt.from(s,e,t)},ks={identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify(s,e,t,n){return e=Object.assign({actualString:!0},e),Gs(s,e,t,n)}},ws={identify:s=>s==null,createNode:()=>new de(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new de(null),stringify:({source:s},e)=>typeof s=="string"&&ws.test.test(s)?s:e.options.nullStr},Ws={identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:s=>new de(s[0]==="t"||s[0]==="T"),stringify({source:s,value:e},t){if(s&&Ws.test.test(s)){const n=s[0]==="t"||s[0]==="T";if(e===n)return s}return e?t.options.trueStr:t.options.falseStr}};function st({format:s,minFractionDigits:e,tag:t,value:n}){if(typeof n=="bigint")return String(n);const i=typeof n=="number"?n:Number(n);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let l=JSON.stringify(n);if(!s&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^\d/.test(l)){let r=l.indexOf(".");r<0&&(r=l.length,l+=".");let o=e-(l.length-r-1);for(;o-- >0;)l+="0"}return l}const _l={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:st},kl={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:s=>parseFloat(s),stringify(s){const e=Number(s.value);return isFinite(e)?e.toExponential():st(s)}},wl={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(s){const e=new de(parseFloat(s)),t=s.indexOf(".");return t!==-1&&s[s.length-1]==="0"&&(e.minFractionDigits=s.length-t-1),e},stringify:st},vs=s=>typeof s=="bigint"||Number.isInteger(s),Qs=(s,e,t,{intAsBigInt:n})=>n?BigInt(s):parseInt(s.substring(e),t);function vl(s,e,t){const{value:n}=s;return vs(n)&&n>=0?t+n.toString(e):st(s)}const Sl={identify:s=>vs(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(s,e,t)=>Qs(s,2,8,t),stringify:s=>vl(s,8,"0o")},Cl={identify:vs,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(s,e,t)=>Qs(s,0,10,t),stringify:st},Tl={identify:s=>vs(s)&&s>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(s,e,t)=>Qs(s,2,16,t),stringify:s=>vl(s,16,"0x")},gr=[Ft,xt,ks,ws,Ws,Sl,Cl,Tl,_l,kl,wl];function hn(s){return typeof s=="bigint"||Number.isInteger(s)}const is=({value:s})=>JSON.stringify(s),yr=[{identify:s=>typeof s=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:s=>s,stringify:is},{identify:s=>s==null,createNode:()=>new de(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:is},{identify:s=>typeof s=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:s=>s==="true",stringify:is},{identify:hn,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(s,e,{intAsBigInt:t})=>t?BigInt(s):parseInt(s,10),stringify:({value:s})=>hn(s)?s.toString():JSON.stringify(s)},{identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:s=>parseFloat(s),stringify:is}],br={default:!0,tag:"",test:/^/,resolve(s,e){return e(`Unresolved plain scalar ${JSON.stringify(s)}`),s}},_r=[Ft,xt].concat(yr,br),Zs={identify:s=>s instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(s,e){if(typeof atob=="function"){const t=atob(s.replace(/[\n\r]/g,"")),n=new Uint8Array(t.length);for(let i=0;i<t.length;++i)n[i]=t.charCodeAt(i);return n}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),s},stringify({comment:s,type:e,value:t},n,i,l){if(!t)return"";const r=t;let o;if(typeof btoa=="function"){let c="";for(let f=0;f<r.length;++f)c+=String.fromCharCode(r[f]);o=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=de.BLOCK_LITERAL),e!==de.QUOTE_DOUBLE){const c=Math.max(n.options.lineWidth-n.indent.length,n.options.minContentWidth),f=Math.ceil(o.length/c),d=new Array(f);for(let h=0,m=0;h<f;++h,m+=c)d[h]=o.substr(m,c);o=d.join(e===de.BLOCK_LITERAL?`
`:" ")}return Gs({comment:s,type:e,value:o},n,i,l)}};function Nl(s,e){if(Qt(s))for(let t=0;t<s.items.length;++t){let n=s.items[t];if(!Re(n)){if(Wt(n)){n.items.length>1&&e("Each pair must have its own sequence indicator");const i=n.items[0]||new ze(new de(null));if(n.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${n.commentBefore}
${i.key.commentBefore}`:n.commentBefore),n.comment){const l=i.value??i.key;l.comment=l.comment?`${n.comment}
${l.comment}`:n.comment}n=i}s.items[t]=Re(n)?n:new ze(n)}}else e("Expected a sequence for this tag");return s}function Al(s,e,t){const{replacer:n}=t,i=new wt(s);i.tag="tag:yaml.org,2002:pairs";let l=0;if(e&&Symbol.iterator in Object(e))for(let r of e){typeof n=="function"&&(r=n.call(e,String(l++),r));let o,c;if(Array.isArray(r))if(r.length===2)o=r[0],c=r[1];else throw new TypeError(`Expected [key, value] tuple: ${r}`);else if(r&&r instanceof Object){const f=Object.keys(r);if(f.length===1)o=f[0],c=r[o];else throw new TypeError(`Expected tuple with one key, not ${f.length} keys`)}else o=r;i.items.push(Xs(o,c,t))}return i}const en={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Nl,createNode:Al};class Pt extends wt{constructor(){super(),this.add=We.prototype.add.bind(this),this.delete=We.prototype.delete.bind(this),this.get=We.prototype.get.bind(this),this.has=We.prototype.has.bind(this),this.set=We.prototype.set.bind(this),this.tag=Pt.tag}toJSON(e,t){if(!t)return super.toJSON(e);const n=new Map;t!=null&&t.onCreate&&t.onCreate(n);for(const i of this.items){let l,r;if(Re(i)?(l=Qe(i.key,"",t),r=Qe(i.value,l,t)):l=Qe(i,"",t),n.has(l))throw new Error("Ordered maps must not include duplicate keys");n.set(l,r)}return n}static from(e,t,n){const i=Al(e,t,n),l=new this;return l.items=i.items,l}}Pt.tag="tag:yaml.org,2002:omap";const tn={collection:"seq",identify:s=>s instanceof Map,nodeClass:Pt,default:!1,tag:"tag:yaml.org,2002:omap",resolve(s,e){const t=Nl(s,e),n=[];for(const{key:i}of t.items)Ee(i)&&(n.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):n.push(i.value));return Object.assign(new Pt,t)},createNode:(s,e,t)=>Pt.from(s,e,t)};function Ll({value:s,source:e},t){return e&&(s?Ol:El).test.test(e)?e:s?t.options.trueStr:t.options.falseStr}const Ol={identify:s=>s===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new de(!0),stringify:Ll},El={identify:s=>s===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new de(!1),stringify:Ll},kr={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:s=>s.slice(-3).toLowerCase()==="nan"?NaN:s[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:st},wr={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:s=>parseFloat(s.replace(/_/g,"")),stringify(s){const e=Number(s.value);return isFinite(e)?e.toExponential():st(s)}},vr={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(s){const e=new de(parseFloat(s.replace(/_/g,""))),t=s.indexOf(".");if(t!==-1){const n=s.substring(t+1).replace(/_/g,"");n[n.length-1]==="0"&&(e.minFractionDigits=n.length)}return e},stringify:st},Zt=s=>typeof s=="bigint"||Number.isInteger(s);function Ss(s,e,t,{intAsBigInt:n}){const i=s[0];if((i==="-"||i==="+")&&(e+=1),s=s.substring(e).replace(/_/g,""),n){switch(t){case 2:s=`0b${s}`;break;case 8:s=`0o${s}`;break;case 16:s=`0x${s}`;break}const r=BigInt(s);return i==="-"?BigInt(-1)*r:r}const l=parseInt(s,t);return i==="-"?-1*l:l}function sn(s,e,t){const{value:n}=s;if(Zt(n)){const i=n.toString(e);return n<0?"-"+t+i.substr(1):t+i}return st(s)}const Sr={identify:Zt,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(s,e,t)=>Ss(s,2,2,t),stringify:s=>sn(s,2,"0b")},Cr={identify:Zt,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(s,e,t)=>Ss(s,1,8,t),stringify:s=>sn(s,8,"0")},Tr={identify:Zt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(s,e,t)=>Ss(s,0,10,t),stringify:st},Nr={identify:Zt,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(s,e,t)=>Ss(s,2,16,t),stringify:s=>sn(s,16,"0x")};class jt extends We{constructor(e){super(e),this.tag=jt.tag}add(e){let t;Re(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new ze(e.key,null):t=new ze(e,null),yt(this.items,t.key)||this.items.push(t)}get(e,t){const n=yt(this.items,e);return!t&&Re(n)?Ee(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);const n=yt(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new ze(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw new Error("Set items must all have null values")}static from(e,t,n){const{replacer:i}=n,l=new this(e);if(t&&Symbol.iterator in Object(t))for(let r of t)typeof i=="function"&&(r=i.call(t,r,r)),l.items.push(Xs(r,null,n));return l}}jt.tag="tag:yaml.org,2002:set";const nn={collection:"map",identify:s=>s instanceof Set,nodeClass:jt,default:!1,tag:"tag:yaml.org,2002:set",createNode:(s,e,t)=>jt.from(s,e,t),resolve(s,e){if(Wt(s)){if(s.hasAllNullValues(!0))return Object.assign(new jt,s);e("Set items must all have null values")}else e("Expected a mapping for this tag");return s}};function ln(s,e){const t=s[0],n=t==="-"||t==="+"?s.substring(1):s,i=r=>e?BigInt(r):Number(r),l=n.replace(/_/g,"").split(":").reduce((r,o)=>r*i(60)+i(o),i(0));return t==="-"?i(-1)*l:l}function Il(s){let{value:e}=s,t=r=>r;if(typeof e=="bigint")t=r=>BigInt(r);else if(isNaN(e)||!isFinite(e))return st(s);let n="";e<0&&(n="-",e*=t(-1));const i=t(60),l=[e%i];return e<60?l.unshift(0):(e=(e-l[0])/i,l.unshift(e%i),e>=60&&(e=(e-l[0])/i,l.unshift(e))),n+l.map(r=>String(r).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const Ml={identify:s=>typeof s=="bigint"||Number.isInteger(s),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(s,e,{intAsBigInt:t})=>ln(s,t),stringify:Il},Pl={identify:s=>typeof s=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:s=>ln(s,!1),stringify:Il},Cs={identify:s=>s instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(s){const e=s.match(Cs.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,t,n,i,l,r,o]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0;let f=Date.UTC(t,n-1,i,l||0,r||0,o||0,c);const d=e[8];if(d&&d!=="Z"){let h=ln(d,!1);Math.abs(h)<30&&(h*=60),f-=6e4*h}return new Date(f)},stringify:({value:s})=>(s==null?void 0:s.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},pn=[Ft,xt,ks,ws,Ol,El,Sr,Cr,Tr,Nr,kr,wr,vr,Zs,lt,tn,en,nn,Ml,Pl,Cs],mn=new Map([["core",gr],["failsafe",[Ft,xt,ks]],["json",_r],["yaml11",pn],["yaml-1.1",pn]]),gn={binary:Zs,bool:Ws,float:wl,floatExp:kl,floatNaN:_l,floatTime:Pl,int:Cl,intHex:Tl,intOct:Sl,intTime:Ml,map:Ft,merge:lt,null:ws,omap:tn,pairs:en,seq:xt,set:nn,timestamp:Cs},Ar={"tag:yaml.org,2002:binary":Zs,"tag:yaml.org,2002:merge":lt,"tag:yaml.org,2002:omap":tn,"tag:yaml.org,2002:pairs":en,"tag:yaml.org,2002:set":nn,"tag:yaml.org,2002:timestamp":Cs};function Es(s,e,t){const n=mn.get(e);if(n&&!s)return t&&!n.includes(lt)?n.concat(lt):n.slice();let i=n;if(!i)if(Array.isArray(s))i=[];else{const l=Array.from(mn.keys()).filter(r=>r!=="yaml11").map(r=>JSON.stringify(r)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${l} or define customTags array`)}if(Array.isArray(s))for(const l of s)i=i.concat(l);else typeof s=="function"&&(i=s(i.slice()));return t&&(i=i.concat(lt)),i.reduce((l,r)=>{const o=typeof r=="string"?gn[r]:r;if(!o){const c=JSON.stringify(r),f=Object.keys(gn).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${f}`)}return l.includes(o)||l.push(o),l},[])}const Lr=(s,e)=>s.key<e.key?-1:s.key>e.key?1:0;class rn{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:i,schema:l,sortMapEntries:r,toStringDefaults:o}){this.compat=Array.isArray(e)?Es(e,"compat"):e?Es(null,e):null,this.name=typeof l=="string"&&l||"core",this.knownTags=i?Ar:{},this.tags=Es(t,this.name,n),this.toStringOptions=o??null,Object.defineProperty(this,ut,{value:Ft}),Object.defineProperty(this,nt,{value:ks}),Object.defineProperty(this,Rt,{value:xt}),this.sortMapEntries=typeof r=="function"?r:r===!0?Lr:null}clone(){const e=Object.create(rn.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}function Or(s,e){var c;const t=[];let n=e.directives===!0;if(e.directives!==!1&&s.directives){const f=s.directives.toString(s);f?(t.push(f),n=!0):s.directives.docStart&&(n=!0)}n&&t.push("---");const i=pl(s,e),{commentString:l}=i.options;if(s.commentBefore){t.length!==1&&t.unshift("");const f=l(s.commentBefore);t.unshift(it(f,""))}let r=!1,o=null;if(s.contents){if($e(s.contents)){if(s.contents.spaceBefore&&n&&t.push(""),s.contents.commentBefore){const h=l(s.contents.commentBefore);t.push(it(h,""))}i.forceBlockIndent=!!s.comment,o=s.contents.comment}const f=o?void 0:()=>r=!0;let d=Bt(s.contents,i,()=>o=null,f);o&&(d+=gt(d,"",l(o))),(d[0]==="|"||d[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${d}`:t.push(d)}else t.push(Bt(s.contents,i));if((c=s.directives)!=null&&c.docEnd)if(s.comment){const f=l(s.comment);f.includes(`
`)?(t.push("..."),t.push(it(f,""))):t.push(`... ${f}`)}else t.push("...");else{let f=s.comment;f&&r&&(f=f.replace(/^\n+/,"")),f&&((!r||o)&&t[t.length-1]!==""&&t.push(""),t.push(it(l(f),"")))}return t.join(`
`)+`
`}class Ts{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Ze,{value:Ds});let i=null;typeof t=="function"||Array.isArray(t)?i=t:n===void 0&&t&&(n=t,t=void 0);const l=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=l;let{version:r}=l;n!=null&&n._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(r=this.directives.yaml.version)):this.directives=new Ve({version:r}),this.setSchema(r,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){const e=Object.create(Ts.prototype,{[Ze]:{value:Ds}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=$e(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){At(this.contents)&&this.contents.add(e)}addIn(e,t){At(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const n=cl(this);e.anchor=!t||n.has(t)?fl(t||"a",n):t}return new Js(e.anchor)}createNode(e,t,n){let i;if(typeof t=="function")e=t.call({"":e},"",e),i=t;else if(Array.isArray(t)){const b=w=>typeof w=="number"||w instanceof String||w instanceof Number,_=t.filter(b).map(String);_.length>0&&(t=t.concat(_)),i=t}else n===void 0&&t&&(n=t,t=void 0);const{aliasDuplicateObjects:l,anchorPrefix:r,flow:o,keepUndefined:c,onTagObj:f,tag:d}=n??{},{onAnchor:h,setAnchors:m,sourceObjects:g}=nr(this,r||"a"),k={aliasDuplicateObjects:l??!0,keepUndefined:c??!1,onAnchor:h,onTagObj:f,replacer:i,schema:this.schema,sourceObjects:g},y=Gt(e,d,k);return o&&De(y)&&(y.flow=!0),m(),y}createPair(e,t,n={}){const i=this.createNode(e,null,n),l=this.createNode(t,null,n);return new ze(i,l)}delete(e){return At(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Ut(e)?this.contents==null?!1:(this.contents=null,!0):At(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return De(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Ut(e)?!t&&Ee(this.contents)?this.contents.value:this.contents:De(this.contents)?this.contents.getIn(e,t):void 0}has(e){return De(this.contents)?this.contents.has(e):!1}hasIn(e){return Ut(e)?this.contents!==void 0:De(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=ds(this.schema,[e],t):At(this.contents)&&this.contents.set(e,t)}setIn(e,t){Ut(e)?this.contents=t:this.contents==null?this.contents=ds(this.schema,Array.from(e),t):At(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let n;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Ve({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Ve({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{const i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new rn(Object.assign(n,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:i,onAnchor:l,reviver:r}={}){const o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=Qe(this.contents,t??"",o);if(typeof l=="function")for(const{count:f,res:d}of o.anchors.values())l(d,f);return typeof r=="function"?It(r,{"":c},"",c):c}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return Or(this,e)}}function At(s){if(De(s))return!0;throw new Error("Expected a YAML collection as document contents")}class jl extends Error{constructor(e,t,n,i){super(),this.name=e,this.code=n,this.message=i,this.pos=t}}class Yt extends jl{constructor(e,t,n){super("YAMLParseError",e,t,n)}}class Er extends jl{constructor(e,t,n){super("YAMLWarning",e,t,n)}}const yn=(s,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(o=>e.linePos(o));const{line:n,col:i}=t.linePos[0];t.message+=` at line ${n}, column ${i}`;let l=i-1,r=s.substring(e.lineStarts[n-1],e.lineStarts[n]).replace(/[\n\r]+$/,"");if(l>=60&&r.length>80){const o=Math.min(l-39,r.length-79);r="…"+r.substring(o),l-=o-1}if(r.length>80&&(r=r.substring(0,79)+"…"),n>1&&/^ *$/.test(r.substring(0,l))){let o=s.substring(e.lineStarts[n-2],e.lineStarts[n-1]);o.length>80&&(o=o.substring(0,79)+`…
`),r=o+r}if(/[^ ]/.test(r)){let o=1;const c=t.linePos[1];c&&c.line===n&&c.col>i&&(o=Math.max(1,Math.min(c.col-i,80-l)));const f=" ".repeat(l)+"^".repeat(o);t.message+=`:
${r}
${f}
`}};function Dt(s,{flow:e,indicator:t,next:n,offset:i,onError:l,parentIndent:r,startOnNewline:o}){let c=!1,f=o,d=o,h="",m="",g=!1,k=!1,y=null,b=null,_=null,w=null,N=null,S=null,C=null;for(const O of s)switch(k&&(O.type!=="space"&&O.type!=="newline"&&O.type!=="comma"&&l(O.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),k=!1),y&&(f&&O.type!=="comment"&&O.type!=="newline"&&l(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),y=null),O.type){case"space":!e&&(t!=="doc-start"||(n==null?void 0:n.type)!=="flow-collection")&&O.source.includes(" ")&&(y=O),d=!0;break;case"comment":{d||l(O,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const P=O.source.substring(1)||" ";h?h+=m+P:h=P,m="",f=!1;break}case"newline":f?h?h+=O.source:(!S||t!=="seq-item-ind")&&(c=!0):m+=O.source,f=!0,g=!0,(b||_)&&(w=O),d=!0;break;case"anchor":b&&l(O,"MULTIPLE_ANCHORS","A node can have at most one anchor"),O.source.endsWith(":")&&l(O.offset+O.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),b=O,C??(C=O.offset),f=!1,d=!1,k=!0;break;case"tag":{_&&l(O,"MULTIPLE_TAGS","A node can have at most one tag"),_=O,C??(C=O.offset),f=!1,d=!1,k=!0;break}case t:(b||_)&&l(O,"BAD_PROP_ORDER",`Anchors and tags must be after the ${O.source} indicator`),S&&l(O,"UNEXPECTED_TOKEN",`Unexpected ${O.source} in ${e??"collection"}`),S=O,f=t==="seq-item-ind"||t==="explicit-key-ind",d=!1;break;case"comma":if(e){N&&l(O,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),N=O,f=!1,d=!1;break}default:l(O,"UNEXPECTED_TOKEN",`Unexpected ${O.type} token`),f=!1,d=!1}const L=s[s.length-1],E=L?L.offset+L.source.length:i;return k&&n&&n.type!=="space"&&n.type!=="newline"&&n.type!=="comma"&&(n.type!=="scalar"||n.source!=="")&&l(n.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y&&(f&&y.indent<=r||(n==null?void 0:n.type)==="block-map"||(n==null?void 0:n.type)==="block-seq")&&l(y,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:N,found:S,spaceBefore:c,comment:h,hasNewline:g,anchor:b,tag:_,newlineAfterProp:w,end:E,start:C??E}}function Xt(s){if(!s)return null;switch(s.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(s.source.includes(`
`))return!0;if(s.end){for(const e of s.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(const e of s.items){for(const t of e.start)if(t.type==="newline")return!0;if(e.sep){for(const t of e.sep)if(t.type==="newline")return!0}if(Xt(e.key)||Xt(e.value))return!0}return!1;default:return!0}}function Fs(s,e,t){if((e==null?void 0:e.type)==="flow-collection"){const n=e.end[0];n.indent===s&&(n.source==="]"||n.source==="}")&&Xt(e)&&t(n,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Bl(s,e,t){const{uniqueKeys:n}=s.options;if(n===!1)return!1;const i=typeof n=="function"?n:(l,r)=>l===r||Ee(l)&&Ee(r)&&l.value===r.value;return e.some(l=>i(l.key,t))}const bn="All mapping items must start at the same column";function Ir({composeNode:s,composeEmptyNode:e},t,n,i,l){var d;const r=(l==null?void 0:l.nodeClass)??We,o=new r(t.schema);t.atRoot&&(t.atRoot=!1);let c=n.offset,f=null;for(const h of n.items){const{start:m,key:g,sep:k,value:y}=h,b=Dt(m,{indicator:"explicit-key-ind",next:g??(k==null?void 0:k[0]),offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0}),_=!b.found;if(_){if(g&&(g.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in g&&g.indent!==n.indent&&i(c,"BAD_INDENT",bn)),!b.anchor&&!b.tag&&!k){f=b.end,b.comment&&(o.comment?o.comment+=`
`+b.comment:o.comment=b.comment);continue}(b.newlineAfterProp||Xt(g))&&i(g??m[m.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((d=b.found)==null?void 0:d.indent)!==n.indent&&i(c,"BAD_INDENT",bn);t.atKey=!0;const w=b.end,N=g?s(t,g,b,i):e(t,w,m,null,b,i);t.schema.compat&&Fs(n.indent,g,i),t.atKey=!1,Bl(t,o.items,N)&&i(w,"DUPLICATE_KEY","Map keys must be unique");const S=Dt(k??[],{indicator:"map-value-ind",next:y,offset:N.range[2],onError:i,parentIndent:n.indent,startOnNewline:!g||g.type==="block-scalar"});if(c=S.end,S.found){_&&((y==null?void 0:y.type)==="block-map"&&!S.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&b.start<S.found.offset-1024&&i(N.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const C=y?s(t,y,S,i):e(t,c,k,null,S,i);t.schema.compat&&Fs(n.indent,y,i),c=C.range[2];const L=new ze(N,C);t.options.keepSourceTokens&&(L.srcToken=h),o.items.push(L)}else{_&&i(N.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),S.comment&&(N.comment?N.comment+=`
`+S.comment:N.comment=S.comment);const C=new ze(N);t.options.keepSourceTokens&&(C.srcToken=h),o.items.push(C)}}return f&&f<c&&i(f,"IMPOSSIBLE","Map comment with trailing content"),o.range=[n.offset,c,f??c],o}function Mr({composeNode:s,composeEmptyNode:e},t,n,i,l){const r=(l==null?void 0:l.nodeClass)??wt,o=new r(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let c=n.offset,f=null;for(const{start:d,value:h}of n.items){const m=Dt(d,{indicator:"seq-item-ind",next:h,offset:c,onError:i,parentIndent:n.indent,startOnNewline:!0});if(!m.found)if(m.anchor||m.tag||h)h&&h.type==="block-seq"?i(m.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{f=m.end,m.comment&&(o.comment=m.comment);continue}const g=h?s(t,h,m,i):e(t,m.end,d,null,m,i);t.schema.compat&&Fs(n.indent,h,i),c=g.range[2],o.items.push(g)}return o.range=[n.offset,c,f??c],o}function es(s,e,t,n){let i="";if(s){let l=!1,r="";for(const o of s){const{source:c,type:f}=o;switch(f){case"space":l=!0;break;case"comment":{t&&!l&&n(o,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const d=c.substring(1)||" ";i?i+=r+d:i=d,r="";break}case"newline":i&&(r+=c),l=!0;break;default:n(o,"UNEXPECTED_TOKEN",`Unexpected ${f} at node end`)}e+=c.length}}return{comment:i,offset:e}}const Is="Block collections are not allowed within flow collections",Ms=s=>s&&(s.type==="block-map"||s.type==="block-seq");function Pr({composeNode:s,composeEmptyNode:e},t,n,i,l){const r=n.start.source==="{",o=r?"flow map":"flow sequence",c=(l==null?void 0:l.nodeClass)??(r?We:wt),f=new c(t.schema);f.flow=!0;const d=t.atRoot;d&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let h=n.offset+n.start.source.length;for(let b=0;b<n.items.length;++b){const _=n.items[b],{start:w,key:N,sep:S,value:C}=_,L=Dt(w,{flow:o,indicator:"explicit-key-ind",next:N??(S==null?void 0:S[0]),offset:h,onError:i,parentIndent:n.indent,startOnNewline:!1});if(!L.found){if(!L.anchor&&!L.tag&&!S&&!C){b===0&&L.comma?i(L.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`):b<n.items.length-1&&i(L.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${o}`),L.comment&&(f.comment?f.comment+=`
`+L.comment:f.comment=L.comment),h=L.end;continue}!r&&t.options.strict&&Xt(N)&&i(N,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(b===0)L.comma&&i(L.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${o}`);else if(L.comma||i(L.start,"MISSING_CHAR",`Missing , between ${o} items`),L.comment){let E="";e:for(const O of w)switch(O.type){case"comma":case"space":break;case"comment":E=O.source.substring(1);break e;default:break e}if(E){let O=f.items[f.items.length-1];Re(O)&&(O=O.value??O.key),O.comment?O.comment+=`
`+E:O.comment=E,L.comment=L.comment.substring(E.length+1)}}if(!r&&!S&&!L.found){const E=C?s(t,C,L,i):e(t,L.end,S,null,L,i);f.items.push(E),h=E.range[2],Ms(C)&&i(E.range,"BLOCK_IN_FLOW",Is)}else{t.atKey=!0;const E=L.end,O=N?s(t,N,L,i):e(t,E,w,null,L,i);Ms(N)&&i(O.range,"BLOCK_IN_FLOW",Is),t.atKey=!1;const P=Dt(S??[],{flow:o,indicator:"map-value-ind",next:C,offset:O.range[2],onError:i,parentIndent:n.indent,startOnNewline:!1});if(P.found){if(!r&&!L.found&&t.options.strict){if(S)for(const I of S){if(I===P.found)break;if(I.type==="newline"){i(I,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}L.start<P.found.offset-1024&&i(P.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else C&&("source"in C&&C.source&&C.source[0]===":"?i(C,"MISSING_CHAR",`Missing space after : in ${o}`):i(P.start,"MISSING_CHAR",`Missing , or : between ${o} items`));const Y=C?s(t,C,P,i):P.found?e(t,P.end,S,null,P,i):null;Y?Ms(C)&&i(Y.range,"BLOCK_IN_FLOW",Is):P.comment&&(O.comment?O.comment+=`
`+P.comment:O.comment=P.comment);const z=new ze(O,Y);if(t.options.keepSourceTokens&&(z.srcToken=_),r){const I=f;Bl(t,I.items,O)&&i(E,"DUPLICATE_KEY","Map keys must be unique"),I.items.push(z)}else{const I=new We(t.schema);I.flow=!0,I.items.push(z);const G=(Y??O).range;I.range=[O.range[0],G[1],G[2]],f.items.push(I)}h=Y?Y.range[2]:P.end}}const m=r?"}":"]",[g,...k]=n.end;let y=h;if(g&&g.source===m)y=g.offset+g.source.length;else{const b=o[0].toUpperCase()+o.substring(1),_=d?`${b} must end with a ${m}`:`${b} in block collection must be sufficiently indented and end with a ${m}`;i(h,d?"MISSING_CHAR":"BAD_INDENT",_),g&&g.source.length!==1&&k.unshift(g)}if(k.length>0){const b=es(k,y,t.options.strict,i);b.comment&&(f.comment?f.comment+=`
`+b.comment:f.comment=b.comment),f.range=[n.offset,y,b.offset]}else f.range=[n.offset,y,y];return f}function Ps(s,e,t,n,i,l){const r=t.type==="block-map"?Ir(s,e,t,n,l):t.type==="block-seq"?Mr(s,e,t,n,l):Pr(s,e,t,n,l),o=r.constructor;return i==="!"||i===o.tagName?(r.tag=o.tagName,r):(i&&(r.tag=i),r)}function jr(s,e,t,n,i){var m;const l=n.tag,r=l?e.directives.tagName(l.source,g=>i(l,"TAG_RESOLVE_FAILED",g)):null;if(t.type==="block-seq"){const{anchor:g,newlineAfterProp:k}=n,y=g&&l?g.offset>l.offset?g:l:g??l;y&&(!k||k.offset<y.offset)&&i(y,"MISSING_CHAR","Missing newline after block sequence props")}const o=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!l||!r||r==="!"||r===We.tagName&&o==="map"||r===wt.tagName&&o==="seq")return Ps(s,e,t,i,r);let c=e.schema.tags.find(g=>g.tag===r&&g.collection===o);if(!c){const g=e.schema.knownTags[r];if(g&&g.collection===o)e.schema.tags.push(Object.assign({},g,{default:!1})),c=g;else return g?i(l,"BAD_COLLECTION_TYPE",`${g.tag} used for ${o} collection, but expects ${g.collection??"scalar"}`,!0):i(l,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,!0),Ps(s,e,t,i,r)}const f=Ps(s,e,t,i,r,c),d=((m=c.resolve)==null?void 0:m.call(c,f,g=>i(l,"TAG_RESOLVE_FAILED",g),e.options))??f,h=$e(d)?d:new de(d);return h.range=f.range,h.tag=r,c!=null&&c.format&&(h.format=c.format),h}function Br(s,e,t){const n=e.offset,i=Dr(e,s.options.strict,t);if(!i)return{value:"",type:null,comment:"",range:[n,n,n]};const l=i.mode===">"?de.BLOCK_FOLDED:de.BLOCK_LITERAL,r=e.source?$r(e.source):[];let o=r.length;for(let y=r.length-1;y>=0;--y){const b=r[y][1];if(b===""||b==="\r")o=y;else break}if(o===0){const y=i.chomp==="+"&&r.length>0?`
`.repeat(Math.max(1,r.length-1)):"";let b=n+i.length;return e.source&&(b+=e.source.length),{value:y,type:l,comment:i.comment,range:[n,b,b]}}let c=e.indent+i.indent,f=e.offset+i.length,d=0;for(let y=0;y<o;++y){const[b,_]=r[y];if(_===""||_==="\r")i.indent===0&&b.length>c&&(c=b.length);else{b.length<c&&t(f+b.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(c=b.length),d=y,c===0&&!s.atRoot&&t(f,"BAD_INDENT","Block scalar values in collections must be indented");break}f+=b.length+_.length+1}for(let y=r.length-1;y>=o;--y)r[y][0].length>c&&(o=y+1);let h="",m="",g=!1;for(let y=0;y<d;++y)h+=r[y][0].slice(c)+`
`;for(let y=d;y<o;++y){let[b,_]=r[y];f+=b.length+_.length+1;const w=_[_.length-1]==="\r";if(w&&(_=_.slice(0,-1)),_&&b.length<c){const S=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;t(f-_.length-(w?2:1),"BAD_INDENT",S),b=""}l===de.BLOCK_LITERAL?(h+=m+b.slice(c)+_,m=`
`):b.length>c||_[0]===" "?(m===" "?m=`
`:!g&&m===`
`&&(m=`
`),h+=m+b.slice(c)+_,m=`
`,g=!0):_===""?m===`
`?h+=`
`:m=`
`:(h+=m+_,m=" ",g=!1)}switch(i.chomp){case"-":break;case"+":for(let y=o;y<r.length;++y)h+=`
`+r[y][0].slice(c);h[h.length-1]!==`
`&&(h+=`
`);break;default:h+=`
`}const k=n+i.length+e.source.length;return{value:h,type:l,comment:i.comment,range:[n,k,k]}}function Dr({offset:s,props:e},t,n){if(e[0].type!=="block-scalar-header")return n(e[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:i}=e[0],l=i[0];let r=0,o="",c=-1;for(let m=1;m<i.length;++m){const g=i[m];if(!o&&(g==="-"||g==="+"))o=g;else{const k=Number(g);!r&&k?r=k:c===-1&&(c=s+m)}}c!==-1&&n(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let f=!1,d="",h=i.length;for(let m=1;m<e.length;++m){const g=e[m];switch(g.type){case"space":f=!0;case"newline":h+=g.source.length;break;case"comment":t&&!f&&n(g,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),h+=g.source.length,d=g.source.substring(1);break;case"error":n(g,"UNEXPECTED_TOKEN",g.message),h+=g.source.length;break;default:{const k=`Unexpected token in block scalar header: ${g.type}`;n(g,"UNEXPECTED_TOKEN",k);const y=g.source;y&&typeof y=="string"&&(h+=y.length)}}}return{mode:l,indent:r,chomp:o,comment:d,length:h}}function $r(s){const e=s.split(/\n( *)/),t=e[0],n=t.match(/^( *)/),l=[n!=null&&n[1]?[n[1],t.slice(n[1].length)]:["",t]];for(let r=1;r<e.length;r+=2)l.push([e[r],e[r+1]]);return l}function Rr(s,e,t){const{offset:n,type:i,source:l,end:r}=s;let o,c;const f=(m,g,k)=>t(n+m,g,k);switch(i){case"scalar":o=de.PLAIN,c=qr(l,f);break;case"single-quoted-scalar":o=de.QUOTE_SINGLE,c=Fr(l,f);break;case"double-quoted-scalar":o=de.QUOTE_DOUBLE,c=xr(l,f);break;default:return t(s,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[n,n+l.length,n+l.length]}}const d=n+l.length,h=es(r,d,e,t);return{value:c,type:o,comment:h.comment,range:[n,d,h.offset]}}function qr(s,e){let t="";switch(s[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${s[0]}`;break}case"@":case"`":{t=`reserved character ${s[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),Dl(s)}function Fr(s,e){return(s[s.length-1]!=="'"||s.length===1)&&e(s.length,"MISSING_CHAR","Missing closing 'quote"),Dl(s.slice(1,-1)).replace(/''/g,"'")}function Dl(s){let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
`,"sy"),t=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let n=e.exec(s);if(!n)return s;let i=n[1],l=" ",r=e.lastIndex;for(t.lastIndex=r;n=t.exec(s);)n[1]===""?l===`
`?i+=l:l=`
`:(i+=l+n[1],l=" "),r=t.lastIndex;const o=/[ \t]*(.*)/sy;return o.lastIndex=r,n=o.exec(s),i+l+((n==null?void 0:n[1])??"")}function xr(s,e){let t="";for(let n=1;n<s.length-1;++n){const i=s[n];if(!(i==="\r"&&s[n+1]===`
`))if(i===`
`){const{fold:l,offset:r}=Kr(s,n);t+=l,n=r}else if(i==="\\"){let l=s[++n];const r=Ur[l];if(r)t+=r;else if(l===`
`)for(l=s[n+1];l===" "||l===" ";)l=s[++n+1];else if(l==="\r"&&s[n+1]===`
`)for(l=s[++n+1];l===" "||l===" ";)l=s[++n+1];else if(l==="x"||l==="u"||l==="U"){const o={x:2,u:4,U:8}[l];t+=Yr(s,n+1,o,e),n+=o}else{const o=s.substr(n-1,2);e(n-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),t+=o}}else if(i===" "||i===" "){const l=n;let r=s[n+1];for(;r===" "||r===" ";)r=s[++n+1];r!==`
`&&!(r==="\r"&&s[n+2]===`
`)&&(t+=n>l?s.slice(l,n+1):i)}else t+=i}return(s[s.length-1]!=='"'||s.length===1)&&e(s.length,"MISSING_CHAR",'Missing closing "quote'),t}function Kr(s,e){let t="",n=s[e+1];for(;(n===" "||n===" "||n===`
`||n==="\r")&&!(n==="\r"&&s[e+2]!==`
`);)n===`
`&&(t+=`
`),e+=1,n=s[e+1];return t||(t=" "),{fold:t,offset:e}}const Ur={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Yr(s,e,t,n){const i=s.substr(e,t),r=i.length===t&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(r)){const o=s.substr(e-2,t+2);return n(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),o}return String.fromCodePoint(r)}function $l(s,e,t,n){const{value:i,type:l,comment:r,range:o}=e.type==="block-scalar"?Br(s,e,n):Rr(e,s.options.strict,n),c=t?s.directives.tagName(t.source,h=>n(t,"TAG_RESOLVE_FAILED",h)):null;let f;s.options.stringKeys&&s.atKey?f=s.schema[nt]:c?f=Hr(s.schema,i,c,t,n):e.type==="scalar"?f=Vr(s,i,e,n):f=s.schema[nt];let d;try{const h=f.resolve(i,m=>n(t??e,"TAG_RESOLVE_FAILED",m),s.options);d=Ee(h)?h:new de(h)}catch(h){const m=h instanceof Error?h.message:String(h);n(t??e,"TAG_RESOLVE_FAILED",m),d=new de(i)}return d.range=o,d.source=i,l&&(d.type=l),c&&(d.tag=c),f.format&&(d.format=f.format),r&&(d.comment=r),d}function Hr(s,e,t,n,i){var o;if(t==="!")return s[nt];const l=[];for(const c of s.tags)if(!c.collection&&c.tag===t)if(c.default&&c.test)l.push(c);else return c;for(const c of l)if((o=c.test)!=null&&o.test(e))return c;const r=s.knownTags[t];return r&&!r.collection?(s.tags.push(Object.assign({},r,{default:!1,test:void 0})),r):(i(n,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),s[nt])}function Vr({atKey:s,directives:e,schema:t},n,i,l){const r=t.tags.find(o=>{var c;return(o.default===!0||s&&o.default==="key")&&((c=o.test)==null?void 0:c.test(n))})||t[nt];if(t.compat){const o=t.compat.find(c=>{var f;return c.default&&((f=c.test)==null?void 0:f.test(n))})??t[nt];if(r.tag!==o.tag){const c=e.tagString(r.tag),f=e.tagString(o.tag),d=`Value may be parsed as either ${c} or ${f}`;l(i,"TAG_RESOLVE_FAILED",d,!0)}}return r}function zr(s,e,t){if(e){t??(t=e.length);for(let n=t-1;n>=0;--n){let i=e[n];switch(i.type){case"space":case"comment":case"newline":s-=i.source.length;continue}for(i=e[++n];(i==null?void 0:i.type)==="space";)s+=i.source.length,i=e[++n];break}}return s}const Jr={composeNode:Rl,composeEmptyNode:on};function Rl(s,e,t,n){const i=s.atKey,{spaceBefore:l,comment:r,anchor:o,tag:c}=t;let f,d=!0;switch(e.type){case"alias":f=Gr(s,e,n),(o||c)&&n(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":f=$l(s,e,c,n),o&&(f.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":f=jr(Jr,s,e,t,n),o&&(f.anchor=o.source.substring(1));break;default:{const h=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;n(e,"UNEXPECTED_TOKEN",h),f=on(s,e.offset,void 0,null,t,n),d=!1}}return o&&f.anchor===""&&n(o,"BAD_ALIAS","Anchor cannot be an empty string"),i&&s.options.stringKeys&&(!Ee(f)||typeof f.value!="string"||f.tag&&f.tag!=="tag:yaml.org,2002:str")&&n(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),l&&(f.spaceBefore=!0),r&&(e.type==="scalar"&&e.source===""?f.comment=r:f.commentBefore=r),s.options.keepSourceTokens&&d&&(f.srcToken=e),f}function on(s,e,t,n,{spaceBefore:i,comment:l,anchor:r,tag:o,end:c},f){const d={type:"scalar",offset:zr(e,t,n),indent:-1,source:""},h=$l(s,d,o,f);return r&&(h.anchor=r.source.substring(1),h.anchor===""&&f(r,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(h.spaceBefore=!0),l&&(h.comment=l,h.range[2]=c),h}function Gr({options:s},{offset:e,source:t,end:n},i){const l=new Js(t.substring(1));l.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),l.source.endsWith(":")&&i(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const r=e+t.length,o=es(n,r,s.strict,i);return l.range=[e,r,o.offset],o.comment&&(l.comment=o.comment),l}function Xr(s,e,{offset:t,start:n,value:i,end:l},r){const o=Object.assign({_directives:e},s),c=new Ts(void 0,o),f={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=Dt(n,{indicator:"doc-start",next:i??(l==null?void 0:l[0]),offset:t,onError:r,parentIndent:0,startOnNewline:!0});d.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!d.hasNewline&&r(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?Rl(f,i,d,r):on(f,d.end,n,null,d,r);const h=c.contents.range[2],m=es(l,h,!1,r);return m.comment&&(c.comment=m.comment),c.range=[t,h,m.offset],c}function Kt(s){if(typeof s=="number")return[s,s+1];if(Array.isArray(s))return s.length===2?s:[s[0],s[1]];const{offset:e,source:t}=s;return[e,e+(typeof t=="string"?t.length:1)]}function _n(s){var i;let e="",t=!1,n=!1;for(let l=0;l<s.length;++l){const r=s[l];switch(r[0]){case"#":e+=(e===""?"":n?`
`:`
`)+(r.substring(1)||" "),t=!0,n=!1;break;case"%":((i=s[l+1])==null?void 0:i[0])!=="#"&&(l+=1),t=!1;break;default:t||(n=!0),t=!1}}return{comment:e,afterEmptyLine:n}}class Wr{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,n,i,l)=>{const r=Kt(t);l?this.warnings.push(new Er(r,n,i)):this.errors.push(new Yt(r,n,i))},this.directives=new Ve({version:e.version||"1.2"}),this.options=e}decorate(e,t){const{comment:n,afterEmptyLine:i}=_n(this.prelude);if(n){const l=e.contents;if(t)e.comment=e.comment?`${e.comment}
${n}`:n;else if(i||e.directives.docStart||!l)e.commentBefore=n;else if(De(l)&&!l.flow&&l.items.length>0){let r=l.items[0];Re(r)&&(r=r.key);const o=r.commentBefore;r.commentBefore=o?`${n}
${o}`:n}else{const r=l.commentBefore;l.commentBefore=r?`${n}
${r}`:n}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:_n(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(const i of e)yield*this.next(i);yield*this.end(t,n)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(t,n,i)=>{const l=Kt(e);l[0]+=t,this.onError(l,"BAD_DIRECTIVE",n,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const t=Xr(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Yt(Kt(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){const n="Unexpected doc-end without preceding document";this.errors.push(new Yt(Kt(e),"UNEXPECTED_TOKEN",n));break}this.doc.directives.docEnd=!0;const t=es(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){const n=this.doc.comment;this.doc.comment=n?`${n}
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Yt(Kt(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const n=Object.assign({_directives:this.directives},this.options),i=new Ts(void 0,n);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,t,t],this.decorate(i,!1),yield i}}}const ql="\uFEFF",Fl="",xl="",xs="";function Qr(s){switch(s){case ql:return"byte-order-mark";case Fl:return"doc-mode";case xl:return"flow-error-end";case xs:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
`:case`\r
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(s[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function et(s){switch(s){case void 0:case" ":case`
`:case"\r":case" ":return!0;default:return!1}}const kn=new Set("0123456789ABCDEFabcdef"),Zr=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),ls=new Set(",[]{}"),eo=new Set(` ,[]{}
\r `),js=s=>!s||eo.has(s);class to{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??"stream";for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
`?!0:t==="\r"?this.buffer[e+1]===`
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===" ";)t=this.buffer[++n+e];if(t==="\r"){const i=this.buffer[n+e+1];if(i===`
`||!i&&!this.atEnd)return e+n+1}return t===`
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t==="-"||t==="."){const n=this.buffer.substr(e,3);if((n==="---"||n==="...")&&et(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===ql&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,n=e.indexOf("#");for(;n!==-1;){const l=e[n-1];if(l===" "||l===" "){t=n-1;break}else n=e.indexOf("#",n+1)}for(;;){const l=e[t-1];if(l===" "||l===" ")t-=1;else break}const i=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){const t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield Fl,yield*this.parseLineStart()}*parseLineStart(){const e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const t=this.peek(3);if((t==="---"||t==="...")&&et(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!et(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&et(t)){const n=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=n,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(js),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);const i=this.getLine();if(i===null)return this.setNext("flow");if((n!==-1&&n<this.indentNext&&i[0]!=="#"||n===0&&(i.startsWith("---")||i.startsWith("..."))&&et(i[3]))&&!(n===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield xl,yield*this.parseLineStart();let l=0;for(;i[l]===",";)l+=yield*this.pushCount(1),l+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(l+=yield*this.pushIndicators(),i[l]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-l),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(js),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const r=this.charAt(1);if(this.flowKey||et(r)||r===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const e=this.charAt(0);let t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let l=0;for(;this.buffer[t-1-l]==="\\";)l+=1;if(l%2===0)break;t=this.buffer.indexOf('"',t+1)}const n=this.buffer.substring(0,t);let i=n.indexOf(`
`,this.pos);if(i!==-1){for(;i!==-1;){const l=this.continueScalar(i+1);if(l===-1)break;i=n.indexOf(`
`,l)}i!==-1&&(t=i-(n[i-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>et(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,n;e:for(let l=this.pos;n=this.buffer[l];++l)switch(n){case" ":t+=1;break;case`
`:e=l,t=0;break;case"\r":{const r=this.buffer[l+1];if(!r&&!this.atEnd)return this.setNext("block-scalar");if(r===`
`)break}default:break e}if(!n&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const l=this.continueScalar(e+1);if(l===-1)break;e=this.buffer.indexOf(`
`,l)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(n=this.buffer[i];n===" ";)n=this.buffer[++i];if(n===" "){for(;n===" "||n===" "||n==="\r"||n===`
`;)n=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let l=e-1,r=this.buffer[l];r==="\r"&&(r=this.buffer[--l]);const o=l;for(;r===" ";)r=this.buffer[--l];if(r===`
`&&l>=this.pos&&l+1+t>o)e=l;else break}while(!0);return yield xs,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let t=this.pos-1,n=this.pos-1,i;for(;i=this.buffer[++n];)if(i===":"){const l=this.buffer[n+1];if(et(l)||e&&ls.has(l))break;t=n}else if(et(i)){let l=this.buffer[n+1];if(i==="\r"&&(l===`
`?(n+=1,i=`
`,l=this.buffer[n+1]):t=n),l==="#"||e&&ls.has(l))break;if(i===`
`){const r=this.continueScalar(n+1);if(r===-1)break;n=Math.max(n,r-2)}}else{if(e&&ls.has(i))break;t=n}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield xs,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){const n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(js))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const e=this.flowLevel>0,t=this.charAt(1);if(et(t)||e&&ls.has(t))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!et(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(Zr.has(t))t=this.buffer[++e];else if(t==="%"&&kn.has(this.buffer[e+1])&&kn.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return e===`
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===" "||e&&n===" ");const i=t-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=t),i}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}class so{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){const l=t+n>>1;this.lineStarts[l]<e?t=l+1:n=l}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};const i=this.lineStarts[t-1];return{line:t,col:e-i+1}}}}function ft(s,e){for(let t=0;t<s.length;++t)if(s[t].type===e)return!0;return!1}function wn(s){for(let e=0;e<s.length;++e)switch(s[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function Kl(s){switch(s==null?void 0:s.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function rs(s){switch(s.type){case"document":return s.start;case"block-map":{const e=s.items[s.items.length-1];return e.sep??e.start}case"block-seq":return s.items[s.items.length-1].start;default:return[]}}function Lt(s){var t;if(s.length===0)return[];let e=s.length;e:for(;--e>=0;)switch(s[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((t=s[++e])==null?void 0:t.type)==="space";);return s.splice(e,s.length)}function vn(s){if(s.start.type==="flow-seq-start")for(const e of s.items)e.sep&&!e.value&&!ft(e.start,"explicit-key-ind")&&!ft(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Kl(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}class no{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new to,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}const t=Qr(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{const n=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:n,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if(this.type==="doc-end"&&(!e||e.type!=="doc-end")){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){const t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{const n=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in n?n.indent:0:t.type==="flow-collection"&&n.type==="document"&&(t.indent=0),t.type==="flow-collection"&&vn(t),n.type){case"document":n.value=t;break;case"block-scalar":n.props.push(t);break;case"block-map":{const i=n.items[n.items.length-1];if(i.value){n.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=t;else{Object.assign(i,{key:t,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{const i=n.items[n.items.length-1];i.value?n.items.push({start:[],value:t}):i.value=t;break}case"flow-collection":{const i=n.items[n.items.length-1];!i||i.value?n.items.push({start:[],key:t,sep:[]}):i.sep?i.value=t:Object.assign(i,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((n.type==="document"||n.type==="block-map"||n.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){const i=t.items[t.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&wn(i.start)===-1&&(t.indent===0||i.start.every(l=>l.type!=="comment"||l.indent<t.indent))&&(n.type==="document"?n.end=i.start:n.items.push({start:i.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{wn(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}const t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){const t=rs(this.peek(2)),n=Lt(t);let i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];const l={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){var n;const t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){const i="end"in t.value?t.value.end:void 0,l=Array.isArray(i)?i[i.length-1]:void 0;(l==null?void 0:l.type)==="comment"?i==null||i.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){const i=e.items[e.items.length-2],l=(n=i==null?void 0:i.value)==null?void 0:n.end;if(Array.isArray(l)){Array.prototype.push.apply(l,t.start),l.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const i=!this.onKeyLine&&this.indent===e.indent,l=i&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind";let r=[];if(l&&t.sep&&!t.value){const o=[];for(let c=0;c<t.sep.length;++c){const f=t.sep[c];switch(f.type){case"newline":o.push(c);break;case"space":break;case"comment":f.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(r=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":l||t.value?(r.push(this.sourceToken),e.items.push({start:r}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):l||t.value?(r.push(this.sourceToken),e.items.push({start:r,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ft(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]});else if(Kl(t.key)&&!ft(t.sep,"newline")){const o=Lt(t.start),c=t.key,f=t.sep;f.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:c,sep:f}]})}else r.length>0?t.sep=t.sep.concat(r,this.sourceToken):t.sep.push(this.sourceToken);else if(ft(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{const o=Lt(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||l?e.items.push({start:r,key:null,sep:[this.sourceToken]}):ft(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);l||t.value?(e.items.push({start:r,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!t.explicitKey&&t.sep&&!ft(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&e.items.push({start:r});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){var n;const t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){const i="end"in t.value?t.value.end:void 0,l=Array.isArray(i)?i[i.length-1]:void 0;(l==null?void 0:l.type)==="comment"?i==null||i.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){const i=e.items[e.items.length-2],l=(n=i==null?void 0:i.value)==null?void 0:n.end;if(Array.isArray(l)){Array.prototype.push.apply(l,t.start),l.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||ft(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){const i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let n;do yield*this.pop(),n=this.peek(1);while(n&&n.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const i=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:i,sep:[]}):t.sep?this.stack.push(i):Object.assign(t,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{const n=this.peek(2);if(n.type==="block-map"&&(this.type==="map-value-ind"&&n.indent===e.indent||this.type==="newline"&&!n.items[n.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&n.type!=="flow-collection"){const i=rs(n),l=Lt(i);vn(e);const r=e.end.splice(1,e.end.length);r.push(this.sourceToken);const o={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:l,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const t=rs(e),n=Lt(t);return n.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const t=rs(e),n=Lt(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(n=>n.type==="newline"||n.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function io(s){const e=s.prettyErrors!==!1;return{lineCounter:s.lineCounter||e&&new so||null,prettyErrors:e}}function lo(s,e={}){const{lineCounter:t,prettyErrors:n}=io(e),i=new no(t==null?void 0:t.addNewLine),l=new Wr(e);let r=null;for(const o of l.compose(i.parse(s),!0,s.length))if(!r)r=o;else if(r.options.logLevel!=="silent"){r.errors.push(new Yt(o.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return n&&t&&(r.errors.forEach(yn(s,t)),r.warnings.forEach(yn(s,t))),r}function ro(s,e,t){let n;const i=lo(s,t);if(!i)return null;if(i.warnings.forEach(l=>ml(i.options.logLevel,l)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:n},t))}function Ul(s){return typeof s=="string"&&["ready","in_progress","testing","completed","blocked"].includes(s)}function Yl(s){return typeof s=="string"&&["critical","high","medium","low"].includes(s)}function oo(s){return typeof s=="string"&&["high","medium","low"].includes(s)}const ps={ready:"status-pending",in_progress:"status-in-progress",testing:"status-in-progress",completed:"status-completed",blocked:"status-blocked"},ms={critical:"priority-critical",high:"priority-high",medium:"priority-medium",low:"priority-low"};function os(s,e={}){const{validateSchema:t=!0,strict:n=!0,allowPartial:i=!1}=e;try{const l=ro(s);if(!l||typeof l!="object")return{success:!1,error:"Invalid YAML structure: The root element must be an object. Please ensure your YAML file starts with key-value pairs.",context:"Root validation"};if(t){const o=ao(l,{strict:n,allowPartial:i});if(!o.success&&!i)return{success:!1,error:`Schema validation failed: ${o.error}`,warnings:o.warnings,context:o.context||"Schema validation"};if(!o.success&&i){const c=o.warnings||[];return c.push("Partial data mode: Some validation errors were ignored"),{success:!0,data:Sn(l),warnings:c,context:"Partial data processing"}}}return{success:!0,data:i?Sn(l):go(l),warnings:[],context:i?"Partial data processing":"Full data processing"}}catch(l){let r="Unknown parsing error",o="General parsing";return l instanceof Error&&(r=l.message,r.includes("bad indentation")?(r=`YAML indentation error: ${r}. Please check that your YAML file uses consistent indentation (spaces, not tabs).`,o="YAML indentation"):r.includes("unexpected character")?(r=`YAML syntax error: ${r}. Please check for invalid characters or missing quotes around string values.`,o="YAML syntax"):r.includes("expected")&&(r=`YAML structure error: ${r}. Please check your YAML structure and ensure all required fields are present.`,o="YAML structure")),{success:!1,error:r,context:o}}}function ao(s,e={}){const{strict:t=!0,allowPartial:n=!1}=e,i=[],l=[];if(!s.metadata)i.push({field:"metadata",message:"Missing required metadata section. Please add project metadata including project name, version, and last_updated fields."});else{const r=co(s.metadata);i.push(...r)}if(!s.phases)i.push({field:"phases",message:"Missing required phases section. Please add at least one phase with tasks."});else if(typeof s.phases!="object")i.push({field:"phases",message:"Phases must be an object with phase names as keys. Please check your YAML structure."});else{const r=fo(s.phases);i.push(...r)}if(s.epic_summary){const r=po(s.epic_summary);i.push(...r)}if(s.risks){const r=mo(s.risks);i.push(...r)}if(t){const r=["metadata","phases","epic_summary","risks"],o=Object.keys(s).filter(c=>!r.includes(c));for(const c of o)l.push(`Unknown field: ${c}`)}return i.length>0&&!n?{success:!1,error:`Validation failed: ${i.length===1?`${i[0].field}: ${i[0].message}`:`${i.length} validation errors found:
${i.map(o=>`• ${o.field}: ${o.message}`).join(`
`)}`}`,warnings:l,context:"Schema validation"}:{success:!0,warnings:l}}function co(s,e){const t=[];if(typeof s!="object"||s===null)return t.push({field:"metadata",message:"Metadata must be an object"}),t;const n=["project","version","last_updated"];for(const i of n)s[i]?typeof s[i]!="string"&&t.push({field:`metadata.${i}`,message:`Field ${i} must be a string`}):t.push({field:`metadata.${i}`,message:`Missing required field: ${i}`});return t}function fo(s,e){const t=[];if(!s||typeof s!="object")return t.push({field:"phases",message:"Phases must be an object"}),t;for(const[n,i]of Object.entries(s)){const l=uo(i,`phases.${n}`);t.push(...l)}return t}function uo(s,e,t){const n=[];if(!s||typeof s!="object")return n.push({field:e,message:"Phase must be an object"}),n;const i=["title","description","status","estimated_duration","tasks"];for(const l of i)s[l]||n.push({field:`${e}.${l}`,message:`Missing required field: ${l}`});if(s.tasks&&Array.isArray(s.tasks))for(let l=0;l<s.tasks.length;l++){const r=ho(s.tasks[l],`${e}.tasks[${l}]`);n.push(...r)}else s.tasks&&n.push({field:`${e}.tasks`,message:"Tasks must be an array"});return n}function ho(s,e,t){const n=[];if(!s||typeof s!="object")return n.push({field:e,message:"Task must be an object"}),n;const i=["id","title","status","priority","estimated_hours","requirements","dependencies","blocks","notes"];for(const r of i)s[r]===void 0&&n.push({field:`${e}.${r}`,message:`Missing required field: ${r}`});s.status&&!Ul(s.status)&&n.push({field:`${e}.status`,message:`Invalid status: ${s.status}`}),s.priority&&!Yl(s.priority)&&n.push({field:`${e}.priority`,message:`Invalid priority: ${s.priority}`}),s.estimated_hours&&typeof s.estimated_hours!="number"&&n.push({field:`${e}.estimated_hours`,message:"Estimated hours must be a number"});const l=["requirements","acceptance_criteria","dependencies","blocks","notes"];for(const r of l)s[r]&&!Array.isArray(s[r])&&n.push({field:`${e}.${r}`,message:`${r} must be an array`});return n}function po(s,e){const t=[];return!s||typeof s!="object"?(t.push({field:"epic_summary",message:"Epic summary must be an object"}),t):(s.total_estimated_hours&&typeof s.total_estimated_hours!="number"&&t.push({field:"epic_summary.total_estimated_hours",message:"Total estimated hours must be a number"}),t)}function mo(s,e){const t=[];if(!s||typeof s!="object")return t.push({field:"risks",message:"Risks must be an object"}),t;for(const[n,i]of Object.entries(s)){if(!oo(n)){t.push({field:`risks.${n}`,message:`Invalid risk level: ${n}`});continue}if(!Array.isArray(i)){t.push({field:`risks.${n}`,message:`Risk level ${n} must be an array`});continue}for(let l=0;l<i.length;l++){const r=i[l];if(!r||typeof r!="object"){t.push({field:`risks.${n}[${l}]`,message:"Risk must be an object"});continue}(!r.risk||typeof r.risk!="string")&&t.push({field:`risks.${n}[${l}].risk`,message:"Risk description must be a string"}),(!r.mitigation||typeof r.mitigation!="string")&&t.push({field:`risks.${n}[${l}].mitigation`,message:"Risk mitigation must be a string"})}}return t}function go(s){const e={metadata:s.metadata,phases:{}};for(const[t,n]of Object.entries(s.phases)){const i=n;e.phases[t]={title:i.title,description:i.description,status:i.status,estimated_duration:i.estimated_duration,tasks:i.tasks||[]}}return s.epic_summary&&(e.epic_summary=s.epic_summary),s.risks&&(e.risks=s.risks),e}function Sn(s){const e={project:"Unknown Project",version:"1.0.0",last_updated:new Date().toISOString().split("T")[0],current_sprint:"unknown",pmac_methodology:"project-management-as-code.md",technical_requirements:"project-requirements.md",decision_log:"prompts-log.md",ai_instructions:"CLAUDE.md"},t={fallback:{title:"Fallback Phase",description:"Default phase for recovered data",status:"active",estimated_duration:"Unknown",tasks:[]}},n={...e,...s.metadata||{}};let i=s.phases||{};return typeof i!="object"?i=t:Object.keys(i).forEach(l=>{const r=i[l];if(typeof r!="object"){i[l]=t.fallback;return}i[l]={title:r.title||l,description:r.description||"No description available",status:r.status||"active",estimated_duration:r.estimated_duration||"Unknown",tasks:Array.isArray(r.tasks)?r.tasks:[]},i[l].tasks=i[l].tasks.map((o,c)=>typeof o!="object"?yo(l,c):{id:o.id||`${l}-${c+1}`,title:o.title||"Untitled Task",status:Ul(o.status)?o.status:"ready",priority:Yl(o.priority)?o.priority:"medium",estimated_hours:typeof o.estimated_hours=="number"?o.estimated_hours:4,actual_hours:typeof o.actual_hours=="number"?o.actual_hours:void 0,assignee:o.assignee||void 0,requirements:Array.isArray(o.requirements)?o.requirements:[],acceptance_criteria:Array.isArray(o.acceptance_criteria)?o.acceptance_criteria:[],dependencies:Array.isArray(o.dependencies)?o.dependencies:[],blocks:Array.isArray(o.blocks)?o.blocks:[],notes:Array.isArray(o.notes)?o.notes:[]})}),{metadata:n,phases:i,epic_summary:s.epic_summary,risks:s.risks}}function yo(s,e){return{id:`${s}-FALLBACK-${e+1}`,title:"Recovered Task (Data Corrupted)",status:"ready",priority:"low",estimated_hours:1,requirements:["Task data was corrupted and recovered with defaults"],acceptance_criteria:["Review and update task information"],dependencies:[],blocks:[],notes:[`Task created from corrupted data on ${new Date().toISOString().split("T")[0]}`]}}const Ot=[];function Hl(s,e){return{subscribe:Ct(s,e).subscribe}}function Ct(s,e=Ae){let t;const n=new Set;function i(o){if(at(s,o)&&(s=o,t)){const c=!Ot.length;for(const f of n)f[1](),Ot.push(f,s);if(c){for(let f=0;f<Ot.length;f+=2)Ot[f][0](Ot[f+1]);Ot.length=0}}}function l(o){i(o(s))}function r(o,c=Ae){const f=[o,c];return n.add(f),n.size===1&&(t=e(i,l)||Ae),o(s),()=>{n.delete(f),n.size===0&&t&&(t(),t=null)}}return{set:i,update:l,subscribe:r}}function Tt(s,e,t){const n=!Array.isArray(s),i=n?[s]:s;if(!i.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const l=e.length<2;return Hl(t,(r,o)=>{let c=!1;const f=[];let d=0,h=Ae;const m=()=>{if(d)return;h();const k=e(n?f[0]:f,r,o);l?r(k):h=il(k)?k:Ae},g=i.map((k,y)=>Xl(k,b=>{f[y]=b,d&=~(1<<y),c&&m()},()=>{d|=1<<y}));return c=!0,m(),function(){ct(g),h(),c=!1}})}const Xe=Ct({isLoading:!0,backlog:null,error:null,lastUpdated:null,viewState:{filters:{status:null,priority:null,phase:null,assignee:null,search:null},selection:{selectedTaskId:null,selectedPhase:null},collapsedPhases:new Set,showCriticalPath:!1,showDependencyGraph:!1,showRiskPanel:!1}}),bo=Tt(Xe,s=>{var e;return((e=s.backlog)==null?void 0:e.metadata.project)||"PMaC Backlog Viewer"}),Ge=Ct({status:null,priority:null,phase:null,search:"",showCompleted:!0}),an=Ct(null),cn=Ct(!1),Ns=Ct(new Set);function _o(s,e){if(s.status==="blocked")return!0;if(s.status==="completed"||s.status==="in_progress"||s.status==="testing")return!1;for(const t of s.dependencies){const n=e.find(i=>i.id===t);if(!n||n.status!=="completed")return!0}return!1}function ko(s,e){return _o(s,e)?"blocked":s.status}const As=Tt(Xe,s=>{if(!s.backlog)return[];const e=[];for(const[t,n]of Object.entries(s.backlog.phases))for(const i of n.tasks)e.push({...i,phase:t,phaseTitle:n.title});for(const t of e)t.effectiveStatus=ko(t,e);return e}),Vl=Tt([As,Ge],([s,e])=>{let t=s;if(e.status&&(t=t.filter(n=>(n.effectiveStatus||n.status)===e.status)),e.priority&&(t=t.filter(n=>n.priority===e.priority)),e.phase&&(t=t.filter(n=>n.phase===e.phase)),e.search){const n=e.search.toLowerCase();t=t.filter(i=>i.title.toLowerCase().includes(n)||i.id.toLowerCase().includes(n)||i.requirements.some(l=>l.toLowerCase().includes(n))||i.acceptance_criteria&&i.acceptance_criteria.some(l=>l.toLowerCase().includes(n)))}return e.showCompleted||(t=t.filter(n=>n.status!=="completed")),t}),zl=Tt(As,s=>{const e={totalTasks:s.length,completedTasks:0,totalHours:0,completedHours:0,phaseStats:{},completionPercentage:0},t=new Map;for(const n of s)t.has(n.phase)||t.set(n.phase,[]),t.get(n.phase).push(n);for(const[n,i]of t){const l={total:i.length,completed:0,inProgress:0,pending:0,blocked:0,totalHours:0,completedHours:0};for(const r of i){l.totalHours+=r.estimated_hours,e.totalHours+=r.estimated_hours;const o=r.effectiveStatus||r.status;o==="completed"?(l.completed++,e.completedTasks++,l.completedHours+=r.estimated_hours,e.completedHours+=r.estimated_hours):o==="in_progress"||o==="testing"?l.inProgress++:o==="blocked"?l.blocked++:l.pending++}e.phaseStats[n]=l}return e.completionPercentage=e.totalTasks>0?e.completedTasks/e.totalTasks*100:0,e}),wo=Tt([As,Xe],([s,e])=>{const t=new Set,n=new Set,i=new Set;for(const l of s){const r=l.effectiveStatus||l.status;t.add(r),n.add(l.priority),i.add(l.phase)}return{statuses:Array.from(t),priorities:Array.from(n),phases:Array.from(i),phaseLabels:e.backlog?Object.fromEntries(Object.entries(e.backlog.phases).map(([l,r])=>[l,r.title])):{}}}),vo=Tt([Vl,Xe],([s,e])=>{if(!e.backlog)return new Map;const t=new Map;for(const n of Object.keys(e.backlog.phases))t.set(n,[]);for(const n of s){const i=t.get(n.phase)||[];i.push(n),t.set(n.phase,i)}return t}),Ks=Ct({theme:"dark",showTaskIds:!0,showEstimatedHours:!0,showProgress:!0,autoRefresh:!1,refreshInterval:3e4,defaultView:"phases",collapsedPhases:[]});function So(s){Xe.update(e=>{const t=JSON.stringify(s),n=e.backlog?JSON.stringify(e.backlog):null;return t===n?{...e,lastUpdated:new Date().toISOString()}:{...e,backlog:s,error:null,lastUpdated:new Date().toISOString()}})}function Cn(s){Xe.update(e=>({...e,isLoading:s}))}function Tn(s){Xe.update(e=>({...e,error:s}))}function Co(){Ge.set({status:null,priority:null,phase:null,search:"",showCompleted:!0})}function To(s){Ge.update(e=>({...e,status:s}))}function No(s){Ge.update(e=>({...e,priority:s}))}function Us(s){Ge.update(e=>({...e,phase:s}))}function Ao(s){Ge.update(e=>({...e,search:s}))}function Lo(s){an.set(s),cn.set(!0)}function Oo(){cn.set(!1),an.set(null)}function Eo(s){Ns.update(e=>{const t=new Set(e);return t.has(s)?t.delete(s):t.add(s),t})}function Io(){if(typeof window<"u"){const s=localStorage.getItem("pmac-viewer-preferences");if(s)try{const e=JSON.parse(s);Ks.set(e),e.collapsedPhases&&Ns.set(new Set(e.collapsedPhases))}catch(e){console.warn("Failed to load user preferences:",e)}}}function Mo(){typeof window<"u"&&(Ks.subscribe(s=>{localStorage.setItem("pmac-viewer-preferences",JSON.stringify(s))}),Ns.subscribe(s=>{Ks.update(e=>({...e,collapsedPhases:Array.from(s)}))}))}Hl(new Date,s=>{const e=setInterval(()=>{s(new Date)},1e3);return()=>clearInterval(e)});Tt(Xe,s=>!s.isLoading&&s.backlog!==null);function Nn(s,e,t){const n=s.slice();return n[14]=e[t],n}function An(s,e,t){const n=s.slice();return n[17]=e[t],n}function Ln(s,e,t){const n=s.slice();return n[20]=e[t],n}function On(s){let e;return{c(){e=p("span"),e.textContent="Filters Active",u(e,"class","text-xs px-2 py-1 bg-blue-900/30 text-blue-300 rounded border border-blue-500/30")},m(t,n){B(t,e,n)},d(t){t&&j(e)}}}function En(s){let e,t=(s[20]==="in_progress"?"In Progress":s[20].replace("_"," ").replace(/\b\w/g,Pn))+"",n,i,l;return{c(){e=p("option"),n=A(t),i=v(),e.__value=l=s[20],tt(e,e.__value)},m(r,o){B(r,e,o),a(e,n),a(e,i)},p(r,o){o&4&&t!==(t=(r[20]==="in_progress"?"In Progress":r[20].replace("_"," ").replace(/\b\w/g,Pn))+"")&&$(n,t),o&4&&l!==(l=r[20])&&(e.__value=l,tt(e,e.__value))},d(r){r&&j(e)}}}function In(s){let e,t=s[17]+"",n,i;return{c(){e=p("option"),n=A(t),e.__value=i=s[17],tt(e,e.__value),u(e,"class","capitalize")},m(l,r){B(l,e,r),a(e,n)},p(l,r){r&4&&t!==(t=l[17]+"")&&$(n,t),r&4&&i!==(i=l[17])&&(e.__value=i,tt(e,e.__value))},d(l){l&&j(e)}}}function Mn(s){let e,t=(s[2].phaseLabels[s[14]]||s[14])+"",n,i;return{c(){e=p("option"),n=A(t),e.__value=i=s[14],tt(e,e.__value)},m(l,r){B(l,e,r),a(e,n)},p(l,r){r&4&&t!==(t=(l[2].phaseLabels[l[14]]||l[14])+"")&&$(n,t),r&4&&i!==(i=l[14])&&(e.__value=i,tt(e,e.__value))},d(l){l&&j(e)}}}function Po(s){let e,t,n,i,l,r,o,c,f,d,h,m,g,k,y,b,_,w,N,S,C,L,E,O,P,Y,z,I,G,V,F,X,q,U,ne,D=s[1]&&On(),H=ye(s[2].statuses),Q=[];for(let K=0;K<H.length;K+=1)Q[K]=En(Ln(s,H,K));let x=ye(s[2].priorities),M=[];for(let K=0;K<x.length;K+=1)M[K]=In(An(s,x,K));let ee=ye(s[2].phases),R=[];for(let K=0;K<ee.length;K+=1)R[K]=Mn(Nn(s,ee,K));return{c(){e=p("div"),t=p("div"),n=p("h2"),n.textContent="Filter Tasks",i=v(),D&&D.c(),l=v(),r=p("div"),o=p("div"),c=p("label"),c.innerHTML=`<svg class="w-4 h-4 inline mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path></svg>
Search`,f=v(),d=p("input"),h=v(),m=p("div"),g=p("label"),g.textContent="Status",k=v(),y=p("select"),b=p("option"),b.textContent="All Statuses";for(let K=0;K<Q.length;K+=1)Q[K].c();_=v(),w=p("div"),N=p("label"),N.textContent="Priority",S=v(),C=p("select"),L=p("option"),L.textContent="All Priorities";for(let K=0;K<M.length;K+=1)M[K].c();E=v(),O=p("div"),P=p("label"),P.textContent="Phase",Y=v(),z=p("select"),I=p("option"),I.textContent="All Phases";for(let K=0;K<R.length;K+=1)R[K].c();G=v(),V=p("div"),F=p("button"),X=A("Clear Filters"),u(n,"class","text-lg font-semibold text-gray-100"),u(t,"class","flex items-center justify-between mb-4"),u(c,"for","search-input"),u(c,"class","block text-sm font-medium text-gray-300 mb-2"),u(d,"id","search-input"),u(d,"type","text"),u(d,"class","w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded-md text-gray-100 placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-colors"),u(d,"placeholder","Search tasks..."),u(g,"for","status-select"),u(g,"class","block text-sm font-medium text-gray-300 mb-2"),b.__value="",tt(b,b.__value),u(y,"id","status-select"),u(y,"class","w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded-md text-gray-100 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-colors svelte-1gyyg8x"),s[0].status===void 0&&as(()=>s[9].call(y)),u(N,"for","priority-select"),u(N,"class","block text-sm font-medium text-gray-300 mb-2"),L.__value="",tt(L,L.__value),u(C,"id","priority-select"),u(C,"class","w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded-md text-gray-100 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-colors svelte-1gyyg8x"),s[0].priority===void 0&&as(()=>s[10].call(C)),u(P,"for","phase-select"),u(P,"class","block text-sm font-medium text-gray-300 mb-2"),I.__value="",tt(I,I.__value),u(z,"id","phase-select"),u(z,"class","w-full px-3 py-2 bg-gray-700 border border-gray-600 rounded-md text-gray-100 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-colors svelte-1gyyg8x"),s[0].phase===void 0&&as(()=>s[11].call(z)),u(r,"class","grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-4 min-w-0"),u(F,"class","px-4 py-2 text-gray-300 bg-gray-700 border border-gray-600 rounded-md hover:bg-gray-600 hover:text-gray-100 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"),F.disabled=q=!s[1],ts(F,"bg-gray-600",s[1]),ts(F,"text-gray-100",s[1]),u(V,"class","flex justify-end pt-4 border-t border-gray-700"),u(e,"class","bg-gray-800 border border-gray-700 rounded-lg p-6 mb-6")},m(K,ae){B(K,e,ae),a(e,t),a(t,n),a(t,i),D&&D.m(t,null),a(e,l),a(e,r),a(r,o),a(o,c),a(o,f),a(o,d),tt(d,s[0].search),a(r,h),a(r,m),a(m,g),a(m,k),a(m,y),a(y,b);for(let T=0;T<Q.length;T+=1)Q[T]&&Q[T].m(y,null);Nt(y,s[0].status,!0),a(r,_),a(r,w),a(w,N),a(w,S),a(w,C),a(C,L);for(let T=0;T<M.length;T+=1)M[T]&&M[T].m(C,null);Nt(C,s[0].priority,!0),a(r,E),a(r,O),a(O,P),a(O,Y),a(O,z),a(z,I);for(let T=0;T<R.length;T+=1)R[T]&&R[T].m(z,null);Nt(z,s[0].phase,!0),a(e,G),a(e,V),a(V,F),a(F,X),U||(ne=[ge(d,"input",s[8]),ge(d,"input",s[4]),ge(y,"change",s[9]),ge(y,"change",s[5]),ge(C,"change",s[10]),ge(C,"change",s[6]),ge(z,"change",s[11]),ge(z,"change",s[7]),ge(F,"click",s[3])],U=!0)},p(K,[ae]){if(K[1]?D||(D=On(),D.c(),D.m(t,null)):D&&(D.d(1),D=null),ae&5&&d.value!==K[0].search&&tt(d,K[0].search),ae&4){H=ye(K[2].statuses);let T;for(T=0;T<H.length;T+=1){const W=Ln(K,H,T);Q[T]?Q[T].p(W,ae):(Q[T]=En(W),Q[T].c(),Q[T].m(y,null))}for(;T<Q.length;T+=1)Q[T].d(1);Q.length=H.length}if(ae&5&&Nt(y,K[0].status),ae&4){x=ye(K[2].priorities);let T;for(T=0;T<x.length;T+=1){const W=An(K,x,T);M[T]?M[T].p(W,ae):(M[T]=In(W),M[T].c(),M[T].m(C,null))}for(;T<M.length;T+=1)M[T].d(1);M.length=x.length}if(ae&5&&Nt(C,K[0].priority),ae&4){ee=ye(K[2].phases);let T;for(T=0;T<ee.length;T+=1){const W=Nn(K,ee,T);R[T]?R[T].p(W,ae):(R[T]=Mn(W),R[T].c(),R[T].m(z,null))}for(;T<R.length;T+=1)R[T].d(1);R.length=ee.length}ae&5&&Nt(z,K[0].phase),ae&2&&q!==(q=!K[1])&&(F.disabled=q),ae&2&&ts(F,"bg-gray-600",K[1]),ae&2&&ts(F,"text-gray-100",K[1])},i:Ae,o:Ae,d(K){K&&j(e),D&&D.d(),xe(Q,K),xe(M,K),xe(R,K),U=!1,ct(ne)}}}const Pn=s=>s.toUpperCase();function jo(s,e,t){let n,i,l;Je(s,Ge,_=>t(0,i=_)),Je(s,wo,_=>t(2,l=_));function r(){const _=new URLSearchParams;i.search&&_.set("search",i.search),i.status&&_.set("status",i.status),i.priority&&_.set("priority",i.priority),i.phase&&_.set("phase",i.phase);const w=_.toString()?`${window.location.pathname}?${_.toString()}`:window.location.pathname;window.history.replaceState({},"",w)}function o(){const _=new URLSearchParams(window.location.search);Ge.update(w=>({...w,search:_.get("search")||"",status:_.get("status")||null,priority:_.get("priority")||null,phase:_.get("phase")||null}))}Jt(()=>{o()});function c(){Co(),window.history.replaceState({},"",window.location.pathname)}function f(_){const w=_.target;Ao((w==null?void 0:w.value)||"")}function d(_){const w=_.target;To((w==null?void 0:w.value)||null)}function h(_){const w=_.target;No((w==null?void 0:w.value)||null)}function m(_){const w=_.target;Us((w==null?void 0:w.value)||null)}function g(){i.search=this.value,Ge.set(i)}function k(){i.status=Ls(this),Ge.set(i)}function y(){i.priority=Ls(this),Ge.set(i)}function b(){i.phase=Ls(this),Ge.set(i)}return s.$$.update=()=>{s.$$.dirty&1&&i&&r(),s.$$.dirty&1&&t(1,n=!!(i.search||i.status||i.priority||i.phase))},[i,n,l,c,f,d,h,m,g,k,y,b]}class Bo extends ht{constructor(e){super(),pt(this,e,jo,Po,at,{})}}function Do(s){const e=s-1;return e*e*e+1}function jn(s,{delay:e=0,duration:t=400,easing:n=Do,axis:i="y"}={}){const l=getComputedStyle(s),r=+l.opacity,o=i==="y"?"height":"width",c=parseFloat(l[o]),f=i==="y"?["top","bottom"]:["left","right"],d=f.map(_=>`${_[0].toUpperCase()}${_.slice(1)}`),h=parseFloat(l[`padding${d[0]}`]),m=parseFloat(l[`padding${d[1]}`]),g=parseFloat(l[`margin${d[0]}`]),k=parseFloat(l[`margin${d[1]}`]),y=parseFloat(l[`border${d[0]}Width`]),b=parseFloat(l[`border${d[1]}Width`]);return{delay:e,duration:t,easing:n,css:_=>`overflow: hidden;opacity: ${Math.min(_*20,1)*r};${o}: ${_*c}px;padding-${f[0]}: ${_*h}px;padding-${f[1]}: ${_*m}px;margin-${f[0]}: ${_*g}px;margin-${f[1]}: ${_*k}px;border-${f[0]}-width: ${_*y}px;border-${f[1]}-width: ${_*b}px;`}}function Bn(s,e,t){const n=s.slice();return n[9]=e[t],n}function Dn(s){let e,t;return{c(){e=ue("svg"),t=ue("path"),u(t,"fill-rule","evenodd"),u(t,"d","M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z"),u(t,"clip-rule","evenodd"),u(e,"class","w-3 h-3 inline ml-1"),u(e,"fill","currentColor"),u(e,"viewBox","0 0 20 20")},m(n,i){B(n,e,i),a(e,t)},d(n){n&&j(e)}}}function $n(s){let e,t,n,i,l,r=Math.round(s[6])+"",o,c,f,d,h;return{c(){e=p("div"),t=p("div"),n=p("span"),n.textContent="Progress",i=v(),l=p("span"),o=A(r),c=A("%"),f=v(),d=p("div"),h=p("div"),u(t,"class","flex items-center justify-between text-xs text-gray-400 mb-1"),u(h,"class","bg-blue-500 h-2 rounded-full transition-all duration-300"),dt(h,"width",s[6]+"%"),u(d,"class","w-full bg-gray-700 rounded-full h-2"),u(e,"class","mb-3")},m(m,g){B(m,e,g),a(e,t),a(t,n),a(t,i),a(t,l),a(l,o),a(l,c),a(e,f),a(e,d),a(d,h)},p(m,g){g&64&&r!==(r=Math.round(m[6])+"")&&$(o,r),g&64&&dt(h,"width",m[6]+"%")},d(m){m&&j(e)}}}function Rn(s){let e,t,n=s[0].actual_hours+"",i,l;return{c(){e=p("span"),t=A("Act: "),i=A(n),l=A("h")},m(r,o){B(r,e,o),a(e,t),a(e,i),a(e,l)},p(r,o){o&1&&n!==(n=r[0].actual_hours+"")&&$(i,n)},d(r){r&&j(e)}}}function qn(s){let e,t,n=s[0].assignee+"",i;return{c(){e=p("span"),t=A("@"),i=A(n),u(e,"class","text-gray-300")},m(l,r){B(l,e,r),a(e,t),a(e,i)},p(l,r){r&1&&n!==(n=l[0].assignee+"")&&$(i,n)},d(l){l&&j(e)}}}function Fn(s){let e,t,n,i,l,r=ye(s[0].requirements.slice(0,3)),o=[];for(let f=0;f<r.length;f+=1)o[f]=xn(Bn(s,r,f));let c=s[0].requirements.length>3&&Kn(s);return{c(){e=p("div"),t=p("h4"),t.textContent="Requirements:",n=v(),i=p("ul");for(let f=0;f<o.length;f+=1)o[f].c();l=v(),c&&c.c(),u(t,"class","text-xs font-medium text-gray-300 mb-1"),u(i,"class","text-xs text-gray-400 space-y-1"),u(e,"class","mb-3")},m(f,d){B(f,e,d),a(e,t),a(e,n),a(e,i);for(let h=0;h<o.length;h+=1)o[h]&&o[h].m(i,null);a(i,l),c&&c.m(i,null)},p(f,d){if(d&1){r=ye(f[0].requirements.slice(0,3));let h;for(h=0;h<r.length;h+=1){const m=Bn(f,r,h);o[h]?o[h].p(m,d):(o[h]=xn(m),o[h].c(),o[h].m(i,l))}for(;h<o.length;h+=1)o[h].d(1);o.length=r.length}f[0].requirements.length>3?c?c.p(f,d):(c=Kn(f),c.c(),c.m(i,null)):c&&(c.d(1),c=null)},d(f){f&&j(e),xe(o,f),c&&c.d()}}}function xn(s){let e,t,n,i,l=s[9]+"",r;return{c(){e=p("li"),t=p("span"),t.textContent="•",n=v(),i=p("span"),r=A(l),u(t,"class","text-gray-500 mt-0.5"),u(i,"class","line-clamp-1 svelte-bikqbo"),u(e,"class","flex items-start gap-1")},m(o,c){B(o,e,c),a(e,t),a(e,n),a(e,i),a(i,r)},p(o,c){c&1&&l!==(l=o[9]+"")&&$(r,l)},d(o){o&&j(e)}}}function Kn(s){let e,t,n=s[0].requirements.length-3+"",i,l;return{c(){e=p("li"),t=A("+"),i=A(n),l=A(" more..."),u(e,"class","text-gray-500 italic")},m(r,o){B(r,e,o),a(e,t),a(e,i),a(e,l)},p(r,o){o&1&&n!==(n=r[0].requirements.length-3+"")&&$(i,n)},d(r){r&&j(e)}}}function Un(s){let e;return{c(){e=p("div"),e.innerHTML='<div class="flex items-center gap-2 text-xs text-red-400"><svg class="w-3 h-3" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z" clip-rule="evenodd"></path></svg> <span>Blocked by incomplete dependencies</span></div>',u(e,"class","bg-red-600/10 border border-red-500/20 rounded-md p-2 mb-3")},m(t,n){B(t,e,n)},d(t){t&&j(e)}}}function Yn(s){let e,t,n,i=s[4]&&Hn(s),l=s[3]&&Vn(s);return{c(){e=p("div"),t=p("div"),i&&i.c(),n=v(),l&&l.c(),u(t,"class","flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-4 text-xs"),u(e,"class","border-t border-gray-700 pt-3")},m(r,o){B(r,e,o),a(e,t),i&&i.m(t,null),a(t,n),l&&l.m(t,null)},p(r,o){r[4]?i?i.p(r,o):(i=Hn(r),i.c(),i.m(t,n)):i&&(i.d(1),i=null),r[3]?l?l.p(r,o):(l=Vn(r),l.c(),l.m(t,null)):l&&(l.d(1),l=null)},d(r){r&&j(e),i&&i.d(),l&&l.d()}}}function Hn(s){let e,t,n,i,l,r,o,c=s[0].dependencies.join(", ")+"",f,d;return{c(){e=p("div"),t=ue("svg"),n=ue("path"),l=v(),r=p("span"),o=A("Depends on: "),f=A(c),u(n,"fill-rule","evenodd"),u(n,"d","M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z"),u(n,"clip-rule","evenodd"),u(t,"class",i="w-3 h-3 "+(s[2]?"text-red-500":"text-orange-500")+" mt-0.5 flex-shrink-0"),u(t,"fill","currentColor"),u(t,"viewBox","0 0 20 20"),u(r,"class",d=(s[2]?"text-red-400":"text-orange-400")+" break-words"),u(e,"class","flex items-start gap-1 flex-1 min-w-0")},m(h,m){B(h,e,m),a(e,t),a(t,n),a(e,l),a(e,r),a(r,o),a(r,f)},p(h,m){m&4&&i!==(i="w-3 h-3 "+(h[2]?"text-red-500":"text-orange-500")+" mt-0.5 flex-shrink-0")&&u(t,"class",i),m&1&&c!==(c=h[0].dependencies.join(", ")+"")&&$(f,c),m&4&&d!==(d=(h[2]?"text-red-400":"text-orange-400")+" break-words")&&u(r,"class",d)},d(h){h&&j(e)}}}function Vn(s){let e,t,n,i,l,r,o=s[0].blocks.join(", ")+"",c;return{c(){e=p("div"),t=ue("svg"),n=ue("path"),i=v(),l=p("span"),r=A("Blocks: "),c=A(o),u(n,"fill-rule","evenodd"),u(n,"d","M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z"),u(n,"clip-rule","evenodd"),u(t,"class","w-3 h-3 text-red-500 mt-0.5 flex-shrink-0"),u(t,"fill","currentColor"),u(t,"viewBox","0 0 20 20"),u(l,"class","text-red-400 break-words"),u(e,"class","flex items-start gap-1 flex-1 min-w-0")},m(f,d){B(f,e,d),a(e,t),a(t,n),a(e,i),a(e,l),a(l,r),a(l,c)},p(f,d){d&1&&o!==(o=f[0].blocks.join(", ")+"")&&$(c,o)},d(f){f&&j(e)}}}function $o(s){let e,t,n,i,l=s[0].id+"",r,o,c,f,d,h,m,g,k,y=s[0].priority+"",b,_,w,N,S,C=s[0].title+"",L,E,O,P,Y=s[0].phaseTitle+"",z,I,G,V,F,X,q,U=s[0].estimated_hours+"",ne,D,H,Q,x,M,ee,R,K,ae,T,W=s[2]&&Dn(),ie=s[6]>0&&$n(s),re=s[0].actual_hours&&Rn(s),te=s[0].assignee&&qn(s),fe=s[0].requirements&&s[0].requirements.length>0&&Fn(s),ke=s[2]&&Un(),Se=(s[4]||s[3])&&Yn(s);return{c(){e=p("button"),t=p("header"),n=p("div"),i=p("span"),r=A(l),o=v(),c=p("div"),f=p("span"),d=A(s[5]),h=v(),W&&W.c(),g=v(),k=p("span"),b=A(y),w=v(),N=p("div"),S=p("h3"),L=A(C),E=v(),O=p("div"),P=p("span"),z=A(Y),I=v(),ie&&ie.c(),G=v(),V=p("div"),F=p("div"),X=p("span"),q=A("Est: "),ne=A(U),D=A("h"),H=v(),re&&re.c(),Q=v(),te&&te.c(),x=v(),fe&&fe.c(),M=v(),ke&&ke.c(),ee=v(),Se&&Se.c(),R=v(),K=p("div"),K.innerHTML='<svg class="w-4 h-4 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"></path></svg>',u(i,"class","text-sm font-mono text-gray-400 shrink-0"),u(f,"class",m=ps[s[1]]+" px-2 py-1 rounded text-xs border capitalize svelte-bikqbo"),u(k,"class",_=ms[s[0].priority]+" px-2 py-1 rounded text-xs border capitalize svelte-bikqbo"),u(c,"class","flex items-center gap-2 shrink-0"),u(n,"class","flex items-center justify-between mb-2"),u(S,"class","text-gray-100 font-medium"),u(N,"class","mb-2"),u(P,"class","px-2 py-1 rounded bg-gray-700 text-gray-300"),u(O,"class","flex items-center gap-2 text-xs"),u(t,"class","mb-3"),u(F,"class","flex items-center gap-4"),u(V,"class","flex items-center justify-between text-xs text-gray-400 mb-3"),u(K,"class","absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity"),u(e,"class","bg-gray-800 border border-gray-700 rounded-lg p-4 hover:bg-gray-700 active:bg-gray-600 transition-colors cursor-pointer touch-manipulation max-w-full overflow-hidden w-full text-left"),u(e,"type","button")},m(oe,Oe){B(oe,e,Oe),a(e,t),a(t,n),a(n,i),a(i,r),a(n,o),a(n,c),a(c,f),a(f,d),a(f,h),W&&W.m(f,null),a(c,g),a(c,k),a(k,b),a(t,w),a(t,N),a(N,S),a(S,L),a(t,E),a(t,O),a(O,P),a(P,z),a(e,I),ie&&ie.m(e,null),a(e,G),a(e,V),a(V,F),a(F,X),a(X,q),a(X,ne),a(X,D),a(F,H),re&&re.m(F,null),a(V,Q),te&&te.m(V,null),a(e,x),fe&&fe.m(e,null),a(e,M),ke&&ke.m(e,null),a(e,ee),Se&&Se.m(e,null),a(e,R),a(e,K),ae||(T=ge(e,"click",s[7]),ae=!0)},p(oe,[Oe]){Oe&1&&l!==(l=oe[0].id+"")&&$(r,l),Oe&32&&$(d,oe[5]),oe[2]?W||(W=Dn(),W.c(),W.m(f,null)):W&&(W.d(1),W=null),Oe&2&&m!==(m=ps[oe[1]]+" px-2 py-1 rounded text-xs border capitalize svelte-bikqbo")&&u(f,"class",m),Oe&1&&y!==(y=oe[0].priority+"")&&$(b,y),Oe&1&&_!==(_=ms[oe[0].priority]+" px-2 py-1 rounded text-xs border capitalize svelte-bikqbo")&&u(k,"class",_),Oe&1&&C!==(C=oe[0].title+"")&&$(L,C),Oe&1&&Y!==(Y=oe[0].phaseTitle+"")&&$(z,Y),oe[6]>0?ie?ie.p(oe,Oe):(ie=$n(oe),ie.c(),ie.m(e,G)):ie&&(ie.d(1),ie=null),Oe&1&&U!==(U=oe[0].estimated_hours+"")&&$(ne,U),oe[0].actual_hours?re?re.p(oe,Oe):(re=Rn(oe),re.c(),re.m(F,null)):re&&(re.d(1),re=null),oe[0].assignee?te?te.p(oe,Oe):(te=qn(oe),te.c(),te.m(V,null)):te&&(te.d(1),te=null),oe[0].requirements&&oe[0].requirements.length>0?fe?fe.p(oe,Oe):(fe=Fn(oe),fe.c(),fe.m(e,M)):fe&&(fe.d(1),fe=null),oe[2]?ke||(ke=Un(),ke.c(),ke.m(e,ee)):ke&&(ke.d(1),ke=null),oe[4]||oe[3]?Se?Se.p(oe,Oe):(Se=Yn(oe),Se.c(),Se.m(e,R)):Se&&(Se.d(1),Se=null)},i:Ae,o:Ae,d(oe){oe&&j(e),W&&W.d(),ie&&ie.d(),re&&re.d(),te&&te.d(),fe&&fe.d(),ke&&ke.d(),Se&&Se.d(),ae=!1,T()}}}function Ro(s,e,t){let n,i,l,r,o,c,{task:f}=e,{onClick:d=void 0}=e;function h(){d&&d(f)}return s.$$set=m=>{"task"in m&&t(0,f=m.task),"onClick"in m&&t(8,d=m.onClick)},s.$$.update=()=>{s.$$.dirty&1&&t(1,n=f.effectiveStatus||f.status),s.$$.dirty&3&&t(6,i=f.actual_hours&&f.estimated_hours?Math.min(f.actual_hours/f.estimated_hours*100,100):n==="completed"?100:0),s.$$.dirty&2&&t(5,l=n==="in_progress"?"in progress":n.replace("_"," ").toLowerCase()),s.$$.dirty&1&&t(4,r=f.dependencies&&f.dependencies.length>0),s.$$.dirty&1&&t(3,o=f.blocks&&f.blocks.length>0),s.$$.dirty&3&&t(2,c=n==="blocked"&&f.status!=="blocked")},[f,n,c,o,r,l,i,h,d]}class qo extends ht{constructor(e){super(),pt(this,e,Ro,$o,at,{task:0,onClick:8})}}function zn(s,e,t){const n=s.slice();return n[12]=e[t],n}function Jn(s){let e,t,n,i,l=s[3].completed+"",r,o,c,f,d,h,m=s[3].inProgress+"",g,k,y,b,_,w,N=s[3].pending+"",S,C,L,E,O,P,Y=s[3].blocked+"",z,I,G,V,F,X,q,U,ne;const D=[xo,Fo],H=[];function Q(x,M){return x[2].length===0?0:1}return F=Q(s),X=H[F]=D[F](s),{c(){e=p("div"),t=p("div"),n=p("div"),i=p("div"),r=A(l),o=v(),c=p("div"),c.textContent="Completed",f=v(),d=p("div"),h=p("div"),g=A(m),k=v(),y=p("div"),y.textContent="In Progress",b=v(),_=p("div"),w=p("div"),S=A(N),C=v(),L=p("div"),L.textContent="Pending",E=v(),O=p("div"),P=p("div"),z=A(Y),I=v(),G=p("div"),G.textContent="Blocked",V=v(),X.c(),u(i,"class","text-lg font-bold text-green-400"),u(c,"class","text-xs text-gray-400"),u(n,"class","text-center"),u(h,"class","text-lg font-bold text-blue-400"),u(y,"class","text-xs text-gray-400"),u(d,"class","text-center"),u(w,"class","text-lg font-bold text-yellow-400"),u(L,"class","text-xs text-gray-400"),u(_,"class","text-center"),u(P,"class","text-lg font-bold text-red-400"),u(G,"class","text-xs text-gray-400"),u(O,"class","text-center"),u(t,"class","grid grid-cols-2 md:grid-cols-4 gap-4 mb-6 p-4 bg-gray-750 rounded-lg min-w-0 svelte-n0zt00"),u(e,"id",q="phase-"+s[0]+"-content"),u(e,"class","p-4")},m(x,M){B(x,e,M),a(e,t),a(t,n),a(n,i),a(i,r),a(n,o),a(n,c),a(t,f),a(t,d),a(d,h),a(h,g),a(d,k),a(d,y),a(t,b),a(t,_),a(_,w),a(w,S),a(_,C),a(_,L),a(t,E),a(t,O),a(O,P),a(P,z),a(O,I),a(O,G),a(e,V),H[F].m(e,null),ne=!0},p(x,M){(!ne||M&8)&&l!==(l=x[3].completed+"")&&$(r,l),(!ne||M&8)&&m!==(m=x[3].inProgress+"")&&$(g,m),(!ne||M&8)&&N!==(N=x[3].pending+"")&&$(S,N),(!ne||M&8)&&Y!==(Y=x[3].blocked+"")&&$(z,Y);let ee=F;F=Q(x),F===ee?H[F].p(x,M):(rt(),Ie(H[ee],1,1,()=>{H[ee]=null}),ot(),X=H[F],X?X.p(x,M):(X=H[F]=D[F](x),X.c()),Te(X,1),X.m(e,null)),(!ne||M&1&&q!==(q="phase-"+x[0]+"-content"))&&u(e,"id",q)},i(x){ne||(Te(X),x&&as(()=>{ne&&(U||(U=fn(e,jn,{duration:200},!0)),U.run(1))}),ne=!0)},o(x){Ie(X),x&&(U||(U=fn(e,jn,{duration:200},!1)),U.run(0)),ne=!1},d(x){x&&j(e),H[F].d(),x&&U&&U.end()}}}function Fo(s){let e,t,n=ye(s[2]),i=[];for(let r=0;r<n.length;r+=1)i[r]=Gn(zn(s,n,r));const l=r=>Ie(i[r],1,1,()=>{i[r]=null});return{c(){e=p("div");for(let r=0;r<i.length;r+=1)i[r].c();u(e,"class","grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4")},m(r,o){B(r,e,o);for(let c=0;c<i.length;c+=1)i[c]&&i[c].m(e,null);t=!0},p(r,o){if(o&260){n=ye(r[2]);let c;for(c=0;c<n.length;c+=1){const f=zn(r,n,c);i[c]?(i[c].p(f,o),Te(i[c],1)):(i[c]=Gn(f),i[c].c(),Te(i[c],1),i[c].m(e,null))}for(rt(),c=n.length;c<i.length;c+=1)l(c);ot()}},i(r){if(!t){for(let o=0;o<n.length;o+=1)Te(i[o]);t=!0}},o(r){i=i.filter(Boolean);for(let o=0;o<i.length;o+=1)Ie(i[o]);t=!1},d(r){r&&j(e),xe(i,r)}}}function xo(s){let e;return{c(){e=p("div"),e.innerHTML='<p class="text-gray-400">No tasks in this phase match the current filters.</p>',u(e,"class","text-center py-8")},m(t,n){B(t,e,n)},p:Ae,i:Ae,o:Ae,d(t){t&&j(e)}}}function Gn(s){let e,t;return e=new qo({props:{task:s[12],onClick:s[8]}}),{c(){kt(e.$$.fragment)},m(n,i){_t(e,n,i),t=!0},p(n,i){const l={};i&4&&(l.task=n[12]),e.$set(l)},i(n){t||(Te(e.$$.fragment,n),t=!0)},o(n){Ie(e.$$.fragment,n),t=!1},d(n){bt(e,n)}}}function Ko(s){let e,t,n,i,l,r,o,c,f,d,h=s[1].title+"",m,g,k,y,b,_,w=s[1].description+"",N,S,C,L,E,O,P,Y,z,I=s[1].estimated_duration+"",G,V,F,X,q=s[3].total+"",U,ne,D,H,Q=s[3].totalHours+"",x,M,ee,R,K,ae=s[3].completed+"",T,W,ie=s[3].total+"",re,te,fe,ke,Se=Math.round(s[5])+"",oe,Oe,He,qe,Ke,Ue,Pe,Fe,Z,be,we,ce=Math.round(s[5])+"",pe,Ne,_e,me,Ce,ve,Le,je,se,he,Ye,Be,J=!s[6]&&Jn(s);return{c(){e=p("div"),t=p("header"),n=p("div"),i=p("div"),l=p("div"),r=ue("svg"),o=ue("path"),f=v(),d=p("h2"),m=A(h),g=v(),k=p("span"),y=A(s[0]),b=v(),_=p("p"),N=A(w),S=v(),C=p("div"),L=p("span"),E=A("Status: "),O=A(s[4]),P=v(),Y=p("span"),z=A("Duration: "),G=A(I),V=v(),F=p("span"),X=A("Tasks: "),U=A(q),ne=v(),D=p("span"),H=A("Hours: "),x=A(Q),M=v(),ee=p("div"),R=p("div"),K=p("div"),T=A(ae),W=A("/"),re=A(ie),te=A(" Complete"),fe=v(),ke=p("div"),oe=A(Se),Oe=A("% done"),He=v(),qe=p("div"),Ke=ue("svg"),Ue=ue("path"),Pe=ue("path"),Z=v(),be=p("div"),we=p("span"),pe=A(ce),Ne=A("%"),_e=v(),me=p("div"),Ce=p("div"),ve=p("div"),se=v(),J&&J.c(),u(o,"stroke-linecap","round"),u(o,"stroke-linejoin","round"),u(o,"stroke-width","2"),u(o,"d","M9 5l7 7-7 7"),u(r,"class",c="w-5 h-5 text-gray-400 transition-transform duration-200 "+(s[6]?"":"rotate-90")),u(r,"fill","none"),u(r,"stroke","currentColor"),u(r,"viewBox","0 0 24 24"),u(d,"class","text-xl font-semibold text-gray-100 truncate min-w-0"),u(k,"class","px-2 py-1 bg-gray-600 text-gray-300 text-xs font-mono rounded"),u(l,"class","flex items-center gap-3 mb-2"),u(_,"class","text-sm text-gray-400 mb-3 line-clamp-2 svelte-n0zt00"),u(L,"class","capitalize whitespace-nowrap"),u(Y,"class","whitespace-nowrap"),u(F,"class","whitespace-nowrap"),u(D,"class","whitespace-nowrap"),u(C,"class","flex flex-wrap items-center gap-2 sm:gap-4 text-xs text-gray-400"),u(i,"class","flex-1 min-w-0"),u(K,"class","text-sm font-medium text-gray-100"),u(ke,"class","text-xs text-gray-400"),u(R,"class","text-right"),u(Ue,"class","text-gray-700"),u(Ue,"stroke","currentColor"),u(Ue,"stroke-width","3"),u(Ue,"fill","none"),u(Ue,"d","M18 3 a15 15 0 0 1 0 30 a15 15 0 0 1 0 -30"),u(Pe,"class","text-blue-500"),u(Pe,"stroke","currentColor"),u(Pe,"stroke-width","3"),u(Pe,"fill","none"),u(Pe,"stroke-linecap","round"),u(Pe,"stroke-dasharray",Fe=s[5]+", 100"),u(Pe,"d","M18 3 a15 15 0 0 1 0 30 a15 15 0 0 1 0 -30"),u(Ke,"class","w-12 h-12 transform -rotate-90"),u(Ke,"viewBox","0 0 36 36"),u(we,"class","text-xs font-medium text-gray-100"),u(be,"class","absolute inset-0 flex items-center justify-center"),u(qe,"class","relative w-12 h-12"),u(ee,"class","flex items-center gap-4 shrink-0 ml-4"),u(n,"class","flex items-center justify-between"),u(ve,"class","bg-blue-500 h-2 rounded-full transition-all duration-300"),dt(ve,"width",s[5]+"%"),u(Ce,"class","w-full bg-gray-700 rounded-full h-2"),u(me,"class","mt-3"),u(t,"class","p-4 bg-gray-750 border-b border-gray-700 cursor-pointer hover:bg-gray-700 transition-colors svelte-n0zt00"),u(t,"tabindex","0"),u(t,"role","button"),u(t,"aria-expanded",Le=!s[6]),u(t,"aria-controls",je="phase-"+s[0]+"-content"),u(e,"class","bg-gray-800 border border-gray-700 rounded-lg mb-6 overflow-hidden max-w-full")},m(le,Me){B(le,e,Me),a(e,t),a(t,n),a(n,i),a(i,l),a(l,r),a(r,o),a(l,f),a(l,d),a(d,m),a(l,g),a(l,k),a(k,y),a(i,b),a(i,_),a(_,N),a(i,S),a(i,C),a(C,L),a(L,E),a(L,O),a(C,P),a(C,Y),a(Y,z),a(Y,G),a(C,V),a(C,F),a(F,X),a(F,U),a(C,ne),a(C,D),a(D,H),a(D,x),a(n,M),a(n,ee),a(ee,R),a(R,K),a(K,T),a(K,W),a(K,re),a(K,te),a(R,fe),a(R,ke),a(ke,oe),a(ke,Oe),a(ee,He),a(ee,qe),a(qe,Ke),a(Ke,Ue),a(Ke,Pe),a(qe,Z),a(qe,be),a(be,we),a(we,pe),a(we,Ne),a(t,_e),a(t,me),a(me,Ce),a(Ce,ve),a(e,se),J&&J.m(e,null),he=!0,Ye||(Be=[ge(t,"click",s[7]),ge(t,"keydown",s[11])],Ye=!0)},p(le,[Me]){(!he||Me&64&&c!==(c="w-5 h-5 text-gray-400 transition-transform duration-200 "+(le[6]?"":"rotate-90")))&&u(r,"class",c),(!he||Me&2)&&h!==(h=le[1].title+"")&&$(m,h),(!he||Me&1)&&$(y,le[0]),(!he||Me&2)&&w!==(w=le[1].description+"")&&$(N,w),(!he||Me&16)&&$(O,le[4]),(!he||Me&2)&&I!==(I=le[1].estimated_duration+"")&&$(G,I),(!he||Me&8)&&q!==(q=le[3].total+"")&&$(U,q),(!he||Me&8)&&Q!==(Q=le[3].totalHours+"")&&$(x,Q),(!he||Me&8)&&ae!==(ae=le[3].completed+"")&&$(T,ae),(!he||Me&8)&&ie!==(ie=le[3].total+"")&&$(re,ie),(!he||Me&32)&&Se!==(Se=Math.round(le[5])+"")&&$(oe,Se),(!he||Me&32&&Fe!==(Fe=le[5]+", 100"))&&u(Pe,"stroke-dasharray",Fe),(!he||Me&32)&&ce!==(ce=Math.round(le[5])+"")&&$(pe,ce),(!he||Me&32)&&dt(ve,"width",le[5]+"%"),(!he||Me&64&&Le!==(Le=!le[6]))&&u(t,"aria-expanded",Le),(!he||Me&1&&je!==(je="phase-"+le[0]+"-content"))&&u(t,"aria-controls",je),le[6]?J&&(rt(),Ie(J,1,1,()=>{J=null}),ot()):J?(J.p(le,Me),Me&64&&Te(J,1)):(J=Jn(le),J.c(),Te(J,1),J.m(e,null))},i(le){he||(Te(J),he=!0)},o(le){Ie(J),he=!1},d(le){le&&j(e),J&&J.d(),Ye=!1,ct(Be)}}}function Uo(s,e,t){let n,i,l,r;Je(s,Ns,y=>t(10,r=y));let{phaseId:o}=e,{phase:c}=e,{tasks:f}=e,{stats:d}=e,{onTaskClick:h=void 0}=e;function m(){Eo(o)}function g(y){h&&h(y)}const k=y=>y.key==="Enter"&&m();return s.$$set=y=>{"phaseId"in y&&t(0,o=y.phaseId),"phase"in y&&t(1,c=y.phase),"tasks"in y&&t(2,f=y.tasks),"stats"in y&&t(3,d=y.stats),"onTaskClick"in y&&t(9,h=y.onTaskClick)},s.$$.update=()=>{s.$$.dirty&1025&&t(6,n=r.has(o)),s.$$.dirty&8&&t(5,i=d.total>0?d.completed/d.total*100:0),s.$$.dirty&2&&t(4,l=c.status.replace("_"," ").toLowerCase())},[o,c,f,d,l,i,n,m,g,h,r,k]}class Yo extends ht{constructor(e){super(),pt(this,e,Uo,Ko,at,{phaseId:0,phase:1,tasks:2,stats:3,onTaskClick:9})}}function Xn(s,e,t){const n=s.slice();return n[11]=e[t],n}function Wn(s,e,t){const n=s.slice();return n[14]=e[t],n}function Qn(s,e,t){const n=s.slice();return n[17]=e[t],n}function Zn(s,e,t){const n=s.slice();return n[20]=e[t],n}function ei(s,e,t){const n=s.slice();return n[23]=e[t],n}function ti(s){let e,t,n,i,l,r,o,c=s[0].id+"",f,d,h,m=s[0].title+"",g,k,y,b,_=s[0].phaseTitle+"",w,N,S,C,L,E,O,P,Y=s[0].priority+"",z,I,G,V,F,X,q,U,ne,D,H,Q,x,M,ee,R=s[0].estimated_hours+"",K,ae,T,W,ie,re,te,fe,ke,Se,oe,Oe,He,qe,Ke,Ue,Pe,Fe,Z,be,we=s[3]&&si(),ce=s[0].actual_hours&&ni(s),pe=s[0].assignee&&ii(s),Ne=s[5]>0&&li(s),_e=s[0].dependencies&&s[0].dependencies.length>0&&ri(s),me=s[0].blocks&&s[0].blocks.length>0&&ai(s),Ce=(!s[0].dependencies||s[0].dependencies.length===0)&&(!s[0].blocks||s[0].blocks.length===0)&&fi(),ve=s[0].requirements&&s[0].requirements.length>0&&ui(s),Le=s[0].acceptance_criteria&&s[0].acceptance_criteria.length>0&&hi(s),je=s[0].notes&&s[0].notes.length>0&&mi(s);return{c(){e=p("div"),t=p("div"),n=p("header"),i=p("div"),l=p("div"),r=p("div"),o=p("span"),f=A(c),d=v(),h=p("h1"),g=A(m),k=v(),y=p("div"),b=p("span"),w=A(_),N=v(),S=p("span"),C=A(s[4]),L=v(),we&&we.c(),O=v(),P=p("span"),z=A(Y),G=v(),V=p("button"),V.innerHTML='<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg>',F=v(),X=p("div"),q=p("div"),U=p("div"),ne=p("h3"),ne.textContent="Time & Progress",D=v(),H=p("div"),Q=p("div"),x=p("span"),x.textContent="Estimated Hours:",M=v(),ee=p("span"),K=A(R),ae=A("h"),T=v(),ce&&ce.c(),W=v(),pe&&pe.c(),ie=v(),Ne&&Ne.c(),re=v(),te=p("div"),fe=p("h3"),fe.textContent="Dependencies",ke=v(),_e&&_e.c(),Se=v(),me&&me.c(),oe=v(),Ce&&Ce.c(),Oe=v(),ve&&ve.c(),He=v(),Le&&Le.c(),qe=v(),je&&je.c(),Ke=v(),Ue=p("footer"),Pe=p("div"),Fe=p("button"),Fe.textContent="Close",u(o,"class","text-sm font-mono text-gray-400 shrink-0"),u(h,"id","task-title"),u(h,"class","text-xl font-semibold text-gray-100"),u(r,"class","flex items-center gap-3 mb-2"),u(b,"class","px-2 py-1 rounded bg-gray-700 text-gray-300"),u(S,"class",E=ps[s[2]]+" px-2 py-1 rounded text-xs border capitalize svelte-j4uahw"),u(P,"class",I=ms[s[0].priority]+" px-2 py-1 rounded text-xs border capitalize svelte-j4uahw"),u(y,"class","flex items-center gap-3 text-sm"),u(l,"class","flex-1 min-w-0"),u(V,"class","text-gray-400 hover:text-gray-100 p-2 hover:bg-gray-700 rounded-md transition-colors"),u(V,"aria-label","Close modal"),u(i,"class","flex items-start justify-between"),u(n,"class","sticky top-0 bg-gray-800 border-b border-gray-700 p-6 z-10"),u(ne,"class","text-lg font-medium text-gray-100"),u(x,"class","text-gray-400"),u(ee,"class","text-gray-100"),u(Q,"class","flex justify-between"),u(H,"class","space-y-3"),u(U,"class","space-y-4"),u(fe,"class","text-lg font-medium text-gray-100"),u(te,"class","space-y-4"),u(q,"class","grid grid-cols-1 md:grid-cols-2 gap-6"),u(X,"class","p-6 space-y-6"),u(Fe,"class","px-4 py-2 text-gray-400 hover:text-gray-100 hover:bg-gray-700 rounded-md transition-colors"),u(Pe,"class","flex justify-end gap-3"),u(Ue,"class","sticky bottom-0 bg-gray-800 border-t border-gray-700 p-6"),u(t,"class","bg-gray-800 border border-gray-700 rounded-lg max-w-4xl w-full max-h-[90vh] overflow-y-auto min-w-0"),u(e,"class","fixed inset-0 bg-black bg-opacity-50 z-50 flex items-center justify-center p-4"),u(e,"role","dialog"),u(e,"aria-modal","true"),u(e,"aria-labelledby","task-title")},m(se,he){B(se,e,he),a(e,t),a(t,n),a(n,i),a(i,l),a(l,r),a(r,o),a(o,f),a(r,d),a(r,h),a(h,g),a(l,k),a(l,y),a(y,b),a(b,w),a(y,N),a(y,S),a(S,C),a(S,L),we&&we.m(S,null),a(y,O),a(y,P),a(P,z),a(i,G),a(i,V),a(t,F),a(t,X),a(X,q),a(q,U),a(U,ne),a(U,D),a(U,H),a(H,Q),a(Q,x),a(Q,M),a(Q,ee),a(ee,K),a(ee,ae),a(H,T),ce&&ce.m(H,null),a(H,W),pe&&pe.m(H,null),a(U,ie),Ne&&Ne.m(U,null),a(q,re),a(q,te),a(te,fe),a(te,ke),_e&&_e.m(te,null),a(te,Se),me&&me.m(te,null),a(te,oe),Ce&&Ce.m(te,null),a(X,Oe),ve&&ve.m(X,null),a(X,He),Le&&Le.m(X,null),a(X,qe),je&&je.m(X,null),a(t,Ke),a(t,Ue),a(Ue,Pe),a(Pe,Fe),Z||(be=[ge(V,"click",s[6]),ge(Fe,"click",s[6]),ge(e,"click",s[7]),ge(e,"keydown",s[8])],Z=!0)},p(se,he){he&1&&c!==(c=se[0].id+"")&&$(f,c),he&1&&m!==(m=se[0].title+"")&&$(g,m),he&1&&_!==(_=se[0].phaseTitle+"")&&$(w,_),he&16&&$(C,se[4]),se[3]?we||(we=si(),we.c(),we.m(S,null)):we&&(we.d(1),we=null),he&4&&E!==(E=ps[se[2]]+" px-2 py-1 rounded text-xs border capitalize svelte-j4uahw")&&u(S,"class",E),he&1&&Y!==(Y=se[0].priority+"")&&$(z,Y),he&1&&I!==(I=ms[se[0].priority]+" px-2 py-1 rounded text-xs border capitalize svelte-j4uahw")&&u(P,"class",I),he&1&&R!==(R=se[0].estimated_hours+"")&&$(K,R),se[0].actual_hours?ce?ce.p(se,he):(ce=ni(se),ce.c(),ce.m(H,W)):ce&&(ce.d(1),ce=null),se[0].assignee?pe?pe.p(se,he):(pe=ii(se),pe.c(),pe.m(H,null)):pe&&(pe.d(1),pe=null),se[5]>0?Ne?Ne.p(se,he):(Ne=li(se),Ne.c(),Ne.m(U,null)):Ne&&(Ne.d(1),Ne=null),se[0].dependencies&&se[0].dependencies.length>0?_e?_e.p(se,he):(_e=ri(se),_e.c(),_e.m(te,Se)):_e&&(_e.d(1),_e=null),se[0].blocks&&se[0].blocks.length>0?me?me.p(se,he):(me=ai(se),me.c(),me.m(te,oe)):me&&(me.d(1),me=null),(!se[0].dependencies||se[0].dependencies.length===0)&&(!se[0].blocks||se[0].blocks.length===0)?Ce||(Ce=fi(),Ce.c(),Ce.m(te,null)):Ce&&(Ce.d(1),Ce=null),se[0].requirements&&se[0].requirements.length>0?ve?ve.p(se,he):(ve=ui(se),ve.c(),ve.m(X,He)):ve&&(ve.d(1),ve=null),se[0].acceptance_criteria&&se[0].acceptance_criteria.length>0?Le?Le.p(se,he):(Le=hi(se),Le.c(),Le.m(X,qe)):Le&&(Le.d(1),Le=null),se[0].notes&&se[0].notes.length>0?je?je.p(se,he):(je=mi(se),je.c(),je.m(X,null)):je&&(je.d(1),je=null)},d(se){se&&j(e),we&&we.d(),ce&&ce.d(),pe&&pe.d(),Ne&&Ne.d(),_e&&_e.d(),me&&me.d(),Ce&&Ce.d(),ve&&ve.d(),Le&&Le.d(),je&&je.d(),Z=!1,ct(be)}}}function si(s){let e,t;return{c(){e=ue("svg"),t=ue("path"),u(t,"fill-rule","evenodd"),u(t,"d","M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z"),u(t,"clip-rule","evenodd"),u(e,"class","w-3 h-3 inline ml-1"),u(e,"fill","currentColor"),u(e,"viewBox","0 0 20 20")},m(n,i){B(n,e,i),a(e,t)},d(n){n&&j(e)}}}function ni(s){let e,t,n,i,l=s[0].actual_hours+"",r,o;return{c(){e=p("div"),t=p("span"),t.textContent="Actual Hours:",n=v(),i=p("span"),r=A(l),o=A("h"),u(t,"class","text-gray-400"),u(i,"class","text-gray-100"),u(e,"class","flex justify-between")},m(c,f){B(c,e,f),a(e,t),a(e,n),a(e,i),a(i,r),a(i,o)},p(c,f){f&1&&l!==(l=c[0].actual_hours+"")&&$(r,l)},d(c){c&&j(e)}}}function ii(s){let e,t,n,i,l,r=s[0].assignee+"",o;return{c(){e=p("div"),t=p("span"),t.textContent="Assignee:",n=v(),i=p("span"),l=A("@"),o=A(r),u(t,"class","text-gray-400"),u(i,"class","text-gray-100"),u(e,"class","flex justify-between")},m(c,f){B(c,e,f),a(e,t),a(e,n),a(e,i),a(i,l),a(i,o)},p(c,f){f&1&&r!==(r=c[0].assignee+"")&&$(o,r)},d(c){c&&j(e)}}}function li(s){let e,t,n,i,l,r=Math.round(s[5])+"",o,c,f,d,h;return{c(){e=p("div"),t=p("div"),n=p("span"),n.textContent="Progress",i=v(),l=p("span"),o=A(r),c=A("%"),f=v(),d=p("div"),h=p("div"),u(t,"class","flex justify-between text-sm text-gray-400 mb-2"),u(h,"class","bg-blue-500 h-3 rounded-full transition-all duration-300"),dt(h,"width",s[5]+"%"),u(d,"class","w-full bg-gray-700 rounded-full h-3")},m(m,g){B(m,e,g),a(e,t),a(t,n),a(t,i),a(t,l),a(l,o),a(l,c),a(e,f),a(e,d),a(d,h)},p(m,g){g&32&&r!==(r=Math.round(m[5])+"")&&$(o,r),g&32&&dt(h,"width",m[5]+"%")},d(m){m&&j(e)}}}function ri(s){let e,t,n,i,l=ye(s[0].dependencies),r=[];for(let o=0;o<l.length;o+=1)r[o]=oi(ei(s,l,o));return{c(){e=p("div"),t=p("h4"),t.textContent="Depends on:",n=v(),i=p("div");for(let o=0;o<r.length;o+=1)r[o].c();u(t,"class","text-sm font-medium text-orange-400 mb-2"),u(i,"class","flex flex-wrap gap-2")},m(o,c){B(o,e,c),a(e,t),a(e,n),a(e,i);for(let f=0;f<r.length;f+=1)r[f]&&r[f].m(i,null)},p(o,c){if(c&1){l=ye(o[0].dependencies);let f;for(f=0;f<l.length;f+=1){const d=ei(o,l,f);r[f]?r[f].p(d,c):(r[f]=oi(d),r[f].c(),r[f].m(i,null))}for(;f<r.length;f+=1)r[f].d(1);r.length=l.length}},d(o){o&&j(e),xe(r,o)}}}function oi(s){let e,t=s[23]+"",n,i;return{c(){e=p("span"),n=A(t),i=v(),u(e,"class","px-2 py-1 bg-orange-900/30 text-orange-300 text-xs rounded border border-orange-500/30")},m(l,r){B(l,e,r),a(e,n),a(e,i)},p(l,r){r&1&&t!==(t=l[23]+"")&&$(n,t)},d(l){l&&j(e)}}}function ai(s){let e,t,n,i,l=ye(s[0].blocks),r=[];for(let o=0;o<l.length;o+=1)r[o]=ci(Zn(s,l,o));return{c(){e=p("div"),t=p("h4"),t.textContent="Blocks:",n=v(),i=p("div");for(let o=0;o<r.length;o+=1)r[o].c();u(t,"class","text-sm font-medium text-red-400 mb-2"),u(i,"class","flex flex-wrap gap-2")},m(o,c){B(o,e,c),a(e,t),a(e,n),a(e,i);for(let f=0;f<r.length;f+=1)r[f]&&r[f].m(i,null)},p(o,c){if(c&1){l=ye(o[0].blocks);let f;for(f=0;f<l.length;f+=1){const d=Zn(o,l,f);r[f]?r[f].p(d,c):(r[f]=ci(d),r[f].c(),r[f].m(i,null))}for(;f<r.length;f+=1)r[f].d(1);r.length=l.length}},d(o){o&&j(e),xe(r,o)}}}function ci(s){let e,t=s[20]+"",n,i;return{c(){e=p("span"),n=A(t),i=v(),u(e,"class","px-2 py-1 bg-red-900/30 text-red-300 text-xs rounded border border-red-500/30")},m(l,r){B(l,e,r),a(e,n),a(e,i)},p(l,r){r&1&&t!==(t=l[20]+"")&&$(n,t)},d(l){l&&j(e)}}}function fi(s){let e;return{c(){e=p("p"),e.textContent="No dependencies or blocking relationships",u(e,"class","text-gray-400 text-sm")},m(t,n){B(t,e,n)},d(t){t&&j(e)}}}function ui(s){let e,t,n,i,l=ye(s[0].requirements),r=[];for(let o=0;o<l.length;o+=1)r[o]=di(Qn(s,l,o));return{c(){e=p("div"),t=p("h3"),t.textContent="Requirements",n=v(),i=p("ul");for(let o=0;o<r.length;o+=1)r[o].c();u(t,"class","text-lg font-medium text-gray-100 mb-3"),u(i,"class","space-y-2")},m(o,c){B(o,e,c),a(e,t),a(e,n),a(e,i);for(let f=0;f<r.length;f+=1)r[f]&&r[f].m(i,null)},p(o,c){if(c&1){l=ye(o[0].requirements);let f;for(f=0;f<l.length;f+=1){const d=Qn(o,l,f);r[f]?r[f].p(d,c):(r[f]=di(d),r[f].c(),r[f].m(i,null))}for(;f<r.length;f+=1)r[f].d(1);r.length=l.length}},d(o){o&&j(e),xe(r,o)}}}function di(s){let e,t,n,i,l=$t(s[17])+"",r;return{c(){e=p("li"),t=p("span"),t.textContent="•",n=v(),i=p("span"),r=v(),u(t,"class","text-blue-400 mt-1 text-sm"),u(i,"class","text-gray-300"),u(e,"class","flex items-start gap-2")},m(o,c){B(o,e,c),a(e,t),a(e,n),a(e,i),i.innerHTML=l,a(e,r)},p(o,c){c&1&&l!==(l=$t(o[17])+"")&&(i.innerHTML=l)},d(o){o&&j(e)}}}function hi(s){let e,t,n,i,l=ye(s[0].acceptance_criteria),r=[];for(let o=0;o<l.length;o+=1)r[o]=pi(Wn(s,l,o));return{c(){e=p("div"),t=p("h3"),t.textContent="Acceptance Criteria",n=v(),i=p("ul");for(let o=0;o<r.length;o+=1)r[o].c();u(t,"class","text-lg font-medium text-gray-100 mb-3"),u(i,"class","space-y-2")},m(o,c){B(o,e,c),a(e,t),a(e,n),a(e,i);for(let f=0;f<r.length;f+=1)r[f]&&r[f].m(i,null)},p(o,c){if(c&1){l=ye(o[0].acceptance_criteria);let f;for(f=0;f<l.length;f+=1){const d=Wn(o,l,f);r[f]?r[f].p(d,c):(r[f]=pi(d),r[f].c(),r[f].m(i,null))}for(;f<r.length;f+=1)r[f].d(1);r.length=l.length}},d(o){o&&j(e),xe(r,o)}}}function pi(s){let e,t,n,i,l,r=$t(s[14])+"",o;return{c(){e=p("li"),t=ue("svg"),n=ue("path"),i=v(),l=p("span"),o=v(),u(n,"fill-rule","evenodd"),u(n,"d","M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z"),u(n,"clip-rule","evenodd"),u(t,"class","w-4 h-4 text-green-400 mt-0.5 shrink-0"),u(t,"fill","currentColor"),u(t,"viewBox","0 0 20 20"),u(l,"class","text-gray-300"),u(e,"class","flex items-start gap-2")},m(c,f){B(c,e,f),a(e,t),a(t,n),a(e,i),a(e,l),l.innerHTML=r,a(e,o)},p(c,f){f&1&&r!==(r=$t(c[14])+"")&&(l.innerHTML=r)},d(c){c&&j(e)}}}function mi(s){let e,t,n,i,l=ye(s[0].notes),r=[];for(let o=0;o<l.length;o+=1)r[o]=gi(Xn(s,l,o));return{c(){e=p("div"),t=p("h3"),t.textContent="Notes & History",n=v(),i=p("div");for(let o=0;o<r.length;o+=1)r[o].c();u(t,"class","text-lg font-medium text-gray-100 mb-3"),u(i,"class","space-y-3 max-h-60 overflow-y-auto")},m(o,c){B(o,e,c),a(e,t),a(e,n),a(e,i);for(let f=0;f<r.length;f+=1)r[f]&&r[f].m(i,null)},p(o,c){if(c&1){l=ye(o[0].notes);let f;for(f=0;f<l.length;f+=1){const d=Xn(o,l,f);r[f]?r[f].p(d,c):(r[f]=gi(d),r[f].c(),r[f].m(i,null))}for(;f<r.length;f+=1)r[f].d(1);r.length=l.length}},d(o){o&&j(e),xe(r,o)}}}function gi(s){let e,t,n=$t(s[11])+"",i;return{c(){e=p("div"),t=p("p"),i=v(),u(t,"class","text-gray-300 text-sm"),u(e,"class","bg-gray-750 p-3 rounded border border-gray-600 svelte-j4uahw")},m(l,r){B(l,e,r),a(e,t),t.innerHTML=n,a(e,i)},p(l,r){r&1&&n!==(n=$t(l[11])+"")&&(t.innerHTML=n)},d(l){l&&j(e)}}}function Ho(s){let e,t=s[1]&&ti(s);return{c(){t&&t.c(),e=vt()},m(n,i){t&&t.m(n,i),B(n,e,i)},p(n,[i]){n[1]?t?t.p(n,i):(t=ti(n),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:Ae,o:Ae,d(n){n&&j(e),t&&t.d(n)}}}function $t(s){return s.replace(/`([^`]+)`/g,'<code class="inline-code">$1</code>').replace(/```(\w+)?\n([\s\S]*?)\n```/g,'<pre class="code-block"><code>$2</code></pre>').replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>")}function Vo(s,e,t){let n,i,l,r,{task:o}=e,{isOpen:c=!1}=e;const f=ll();function d(){f("close")}function h(k){c&&k.key==="Escape"&&d()}function m(k){k.target===k.currentTarget&&d()}function g(k){(k.key==="Enter"||k.key===" ")&&k.target===k.currentTarget&&d()}return Jt(()=>{document.addEventListener("keydown",h)}),Hs(()=>{document.removeEventListener("keydown",h)}),s.$$set=k=>{"task"in k&&t(0,o=k.task),"isOpen"in k&&t(1,c=k.isOpen)},s.$$.update=()=>{s.$$.dirty&1&&t(2,n=o.effectiveStatus||o.status),s.$$.dirty&5&&t(5,i=o.actual_hours&&o.estimated_hours?Math.min(o.actual_hours/o.estimated_hours*100,100):n==="completed"?100:0),s.$$.dirty&4&&t(4,l=n==="in_progress"?"in progress":n.replace("_"," ").toLowerCase()),s.$$.dirty&5&&t(3,r=n==="blocked"&&o.status!=="blocked")},[o,c,n,r,l,i,d,m,g]}class zo extends ht{constructor(e){super(),pt(this,e,Vo,Ho,at,{task:0,isOpen:1})}}function yi(s,e,t){const n=s.slice();return n[42]=e[t],n}function bi(s,e,t){const n=s.slice();return n[45]=e[t],n}function _i(s){let e,t,n,i,l,r,o,c,f,d;return{c(){e=ue("line"),u(e,"x1",t=s[45].fromX+Ht),u(e,"y1",n=s[45].fromY),u(e,"x2",i=s[45].toX-Ht),u(e,"y2",l=s[45].toY),u(e,"stroke",r=Ci(s[45])),u(e,"stroke-width",o=s[45].isCritical?3:2),u(e,"marker-end",c=s[45].isCritical?"url(#arrowhead-critical)":"url(#arrowhead)"),u(e,"filter",f=s[45].isCritical?"url(#glow)":"none"),u(e,"opacity",d=s[45].isCritical?1:.7)},m(h,m){B(h,e,m)},p(h,m){m[0]&32&&t!==(t=h[45].fromX+Ht)&&u(e,"x1",t),m[0]&32&&n!==(n=h[45].fromY)&&u(e,"y1",n),m[0]&32&&i!==(i=h[45].toX-Ht)&&u(e,"x2",i),m[0]&32&&l!==(l=h[45].toY)&&u(e,"y2",l),m[0]&32&&r!==(r=Ci(h[45]))&&u(e,"stroke",r),m[0]&32&&o!==(o=h[45].isCritical?3:2)&&u(e,"stroke-width",o),m[0]&32&&c!==(c=h[45].isCritical?"url(#arrowhead-critical)":"url(#arrowhead)")&&u(e,"marker-end",c),m[0]&32&&f!==(f=h[45].isCritical?"url(#glow)":"none")&&u(e,"filter",f),m[0]&32&&d!==(d=h[45].isCritical?1:.7)&&u(e,"opacity",d)},d(h){h&&j(e)}}}function ki(s){let e,t=s[45].fromX!==void 0&&s[45].fromY!==void 0&&s[45].toX!==void 0&&s[45].toY!==void 0&&_i(s);return{c(){t&&t.c(),e=vt()},m(n,i){t&&t.m(n,i),B(n,e,i)},p(n,i){n[45].fromX!==void 0&&n[45].fromY!==void 0&&n[45].toX!==void 0&&n[45].toY!==void 0?t?t.p(n,i):(t=_i(n),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(n){n&&j(e),t&&t.d(n)}}}function wi(s){let e,t,n,i=s[42].title.substring(0,25)+"",l,r=s[42].title.length>25?"...":"",o,c,f,d=s[42].status.replace("_"," ")+"",h,m,g,k=s[42].priority+"",y,b,_,w=s[42].estimated_hours+"",N,S=s[42].isCritical&&vi();return{c(){e=ue("g"),t=ue("rect"),n=ue("text"),l=A(i),o=A(r),c=ue("text"),f=A("Status: "),h=A(d),m=ue("text"),g=A("Priority: "),y=A(k),b=ue("text"),_=A("Hours: "),N=A(w),S&&S.c(),u(t,"x","0"),u(t,"y","0"),u(t,"width","200"),u(t,"height","80"),u(t,"fill","#1f2937"),u(t,"stroke","#4b5563"),u(t,"stroke-width","1"),u(t,"rx","4"),u(n,"x","8"),u(n,"y","16"),u(n,"fill","#f3f4f6"),u(n,"font-size","12"),u(n,"font-weight","bold"),u(c,"x","8"),u(c,"y","32"),u(c,"fill","#9ca3af"),u(c,"font-size","10"),u(m,"x","8"),u(m,"y","46"),u(m,"fill","#9ca3af"),u(m,"font-size","10"),u(b,"x","8"),u(b,"y","60"),u(b,"fill","#9ca3af"),u(b,"font-size","10"),u(e,"class","tooltip svelte-1s8h4ev"),u(e,"transform","translate(30, -10)")},m(C,L){B(C,e,L),a(e,t),a(e,n),a(n,l),a(n,o),a(e,c),a(c,f),a(c,h),a(e,m),a(m,g),a(m,y),a(e,b),a(b,_),a(b,N),S&&S.m(e,null)},p(C,L){L[0]&16&&i!==(i=C[42].title.substring(0,25)+"")&&$(l,i),L[0]&16&&r!==(r=C[42].title.length>25?"...":"")&&$(o,r),L[0]&16&&d!==(d=C[42].status.replace("_"," ")+"")&&$(h,d),L[0]&16&&k!==(k=C[42].priority+"")&&$(y,k),L[0]&16&&w!==(w=C[42].estimated_hours+"")&&$(N,w),C[42].isCritical?S||(S=vi(),S.c(),S.m(e,null)):S&&(S.d(1),S=null)},d(C){C&&j(e),S&&S.d()}}}function vi(s){let e,t;return{c(){e=ue("text"),t=A(`⚡ Critical Path
`),u(e,"x","8"),u(e,"y","74"),u(e,"fill","#f59e0b"),u(e,"font-size","10"),u(e,"font-weight","bold")},m(n,i){B(n,e,i),a(e,t)},d(n){n&&j(e)}}}function Si(s){let e,t,n,i,l,r,o,c,f=(s[42].id.split("-")[1]||s[42].id)+"",d,h,m,g,k=s[7]===s[42].id&&wi(s);function y(){return s[24](s[42])}function b(){return s[25](s[42])}return{c(){e=ue("g"),t=ue("circle"),c=ue("text"),d=A(f),k&&k.c(),u(t,"r",Ht),u(t,"fill",n=s[19](s[42])),u(t,"stroke",i=s[42].id===s[8]?"#ffffff":"#374151"),u(t,"stroke-width",l=s[42].id===s[8]?3:2),u(t,"filter",r=s[42].isCritical?"url(#glow)":"none"),u(t,"opacity",o=s[42].id===s[7]?.8:1),u(t,"class","svelte-1s8h4ev"),u(c,"text-anchor","middle"),u(c,"dominant-baseline","middle"),u(c,"fill","white"),u(c,"font-size","10"),u(c,"font-weight","bold"),u(c,"pointer-events","none"),u(e,"class","node cursor-pointer svelte-1s8h4ev"),u(e,"transform",h="translate("+s[42].x+", "+s[42].y+")"),u(e,"role","button"),u(e,"tabindex","0")},m(_,w){B(_,e,w),a(e,t),a(e,c),a(c,d),k&&k.m(e,null),m||(g=[ge(e,"click",y),ge(e,"mouseenter",b),ge(e,"mouseleave",s[26])],m=!0)},p(_,w){s=_,w[0]&16&&n!==(n=s[19](s[42]))&&u(t,"fill",n),w[0]&272&&i!==(i=s[42].id===s[8]?"#ffffff":"#374151")&&u(t,"stroke",i),w[0]&272&&l!==(l=s[42].id===s[8]?3:2)&&u(t,"stroke-width",l),w[0]&16&&r!==(r=s[42].isCritical?"url(#glow)":"none")&&u(t,"filter",r),w[0]&144&&o!==(o=s[42].id===s[7]?.8:1)&&u(t,"opacity",o),w[0]&16&&f!==(f=(s[42].id.split("-")[1]||s[42].id)+"")&&$(d,f),s[7]===s[42].id?k?k.p(s,w):(k=wi(s),k.c(),k.m(e,null)):k&&(k.d(1),k=null),w[0]&16&&h!==(h="translate("+s[42].x+", "+s[42].y+")")&&u(e,"transform",h)},d(_){_&&j(e),k&&k.d(),m=!1,ct(g)}}}function Jo(s){let e,t,n,i,l,r,o=s[6].length+"",c,f,d=s[4].filter(Ti).reduce(Ni,0)+"",h,m,g,k,y,b,_,w,N,S,C,L,E,O,P,Y,z,I,G,V,F,X,q,U,ne,D=ye(s[5]),H=[];for(let M=0;M<D.length;M+=1)H[M]=ki(bi(s,D,M));let Q=ye(s[4]),x=[];for(let M=0;M<Q.length;M+=1)x[M]=Si(yi(s,Q,M));return{c(){e=p("div"),t=p("div"),n=p("button"),n.textContent="Reset View",i=v(),l=p("div"),r=A("Critical Path: "),c=A(o),f=A(` tasks,
`),h=A(d),m=A(" hours"),g=v(),k=p("div"),k.textContent="Use mouse wheel to zoom, drag to pan",y=v(),b=p("div"),_=ue("svg"),w=ue("defs"),N=ue("marker"),S=ue("polygon"),C=ue("marker"),L=ue("polygon"),E=ue("filter"),O=ue("feGaussianBlur"),P=ue("feMerge"),Y=ue("feMergeNode"),z=ue("feMergeNode"),I=ue("g");for(let M=0;M<H.length;M+=1)H[M].c();G=vt();for(let M=0;M<x.length;M+=1)x[M].c();X=v(),q=p("div"),q.innerHTML='<div class="flex items-center gap-2"><div class="w-4 h-4 rounded-full bg-green-500"></div> <span class="text-gray-300">Completed</span></div> <div class="flex items-center gap-2"><div class="w-4 h-4 rounded-full bg-blue-500"></div> <span class="text-gray-300">In Progress</span></div> <div class="flex items-center gap-2"><div class="w-4 h-4 rounded-full bg-purple-500"></div> <span class="text-gray-300">Testing</span></div> <div class="flex items-center gap-2"><div class="w-4 h-4 rounded-full bg-gray-500"></div> <span class="text-gray-300">Ready</span></div> <div class="flex items-center gap-2"><div class="w-4 h-4 rounded-full bg-red-500"></div> <span class="text-gray-300">Blocked</span></div> <div class="flex items-center gap-2"><div class="w-4 h-4 rounded-full bg-yellow-500" style="filter: drop-shadow(0 0 6px #f59e0b);"></div> <span class="text-gray-300">Critical Path</span></div>',u(n,"class","px-3 py-1 bg-gray-700 text-gray-300 rounded hover:bg-gray-600 transition-colors text-sm"),u(l,"class","text-sm text-gray-400"),u(k,"class","text-xs text-gray-500"),u(t,"class","controls mb-4 flex items-center gap-4"),u(S,"points","0 0, 10 3.5, 0 7"),u(S,"fill","#4b5563"),u(N,"id","arrowhead"),u(N,"markerWidth","10"),u(N,"markerHeight","7"),u(N,"refX","9"),u(N,"refY","3.5"),u(N,"orient","auto"),u(L,"points","0 0, 10 3.5, 0 7"),u(L,"fill","#f59e0b"),u(C,"id","arrowhead-critical"),u(C,"markerWidth","10"),u(C,"markerHeight","7"),u(C,"refX","9"),u(C,"refY","3.5"),u(C,"orient","auto"),u(O,"stdDeviation","3"),u(O,"result","coloredBlur"),u(Y,"in","coloredBlur"),u(z,"in","SourceGraphic"),u(E,"id","glow"),u(I,"transform",V="translate("+s[10]+", "+s[11]+") scale("+s[9]+")"),u(_,"width",s[0]),u(_,"height",s[1]),u(_,"viewBox",F="0 0 "+s[0]+" "+s[1]),u(_,"class","cursor-grab active:cursor-grabbing w-full h-auto"),u(b,"class","graph-container border border-gray-700 rounded-lg overflow-hidden bg-gray-800 min-w-0 max-w-full svelte-1s8h4ev"),u(q,"class","legend mt-4 grid grid-cols-2 md:grid-cols-4 gap-4 text-sm"),u(e,"class","critical-path-container svelte-1s8h4ev")},m(M,ee){B(M,e,ee),a(e,t),a(t,n),a(t,i),a(t,l),a(l,r),a(l,c),a(l,f),a(l,h),a(l,m),a(t,g),a(t,k),a(e,y),a(e,b),a(b,_),a(_,w),a(w,N),a(N,S),a(w,C),a(C,L),a(w,E),a(E,O),a(E,P),a(P,Y),a(P,z),a(_,I);for(let R=0;R<H.length;R+=1)H[R]&&H[R].m(I,null);a(I,G);for(let R=0;R<x.length;R+=1)x[R]&&x[R].m(I,null);s[27](_),s[28](b),a(e,X),a(e,q),U||(ne=[ge(n,"click",s[20]),ge(_,"mousedown",s[12]),ge(_,"wheel",s[16]),ge(_,"touchstart",s[13]),ge(_,"touchmove",s[14]),ge(_,"touchend",s[15])],U=!0)},p(M,ee){if(ee[0]&64&&o!==(o=M[6].length+"")&&$(c,o),ee[0]&16&&d!==(d=M[4].filter(Ti).reduce(Ni,0)+"")&&$(h,d),ee[0]&32){D=ye(M[5]);let R;for(R=0;R<D.length;R+=1){const K=bi(M,D,R);H[R]?H[R].p(K,ee):(H[R]=ki(K),H[R].c(),H[R].m(I,G))}for(;R<H.length;R+=1)H[R].d(1);H.length=D.length}if(ee[0]&917904){Q=ye(M[4]);let R;for(R=0;R<Q.length;R+=1){const K=yi(M,Q,R);x[R]?x[R].p(K,ee):(x[R]=Si(K),x[R].c(),x[R].m(I,null))}for(;R<x.length;R+=1)x[R].d(1);x.length=Q.length}ee[0]&3584&&V!==(V="translate("+M[10]+", "+M[11]+") scale("+M[9]+")")&&u(I,"transform",V),ee[0]&1&&u(_,"width",M[0]),ee[0]&2&&u(_,"height",M[1]),ee[0]&3&&F!==(F="0 0 "+M[0]+" "+M[1])&&u(_,"viewBox",F)},i:Ae,o:Ae,d(M){M&&j(e),xe(H,M),xe(x,M),s[27](null),s[28](null),U=!1,ct(ne)}}}const Ht=25;function Ci(s){return s.isCritical?"#f59e0b":"#4b5563"}const Ti=s=>s.isCritical,Ni=(s,e)=>s+e.estimated_hours;function Go(s,e,t){let n,i,l,{tasks:r=[]}=e,{width:o=800}=e,{height:c=600}=e,f,d=o,h=c;function m(){if(f){const T=f.offsetWidth;t(0,d=Math.max(T-40,320)),t(1,h=Math.max(Math.min(d*.6,600),300))}}Jt(()=>{m(),window.addEventListener("resize",m)}),Hs(()=>{window.removeEventListener("resize",m)});const g=ll();let k,y=[],b=[],_=[],w=null,N=null,S=1,C=0,L=0,E=!1,O=0,P=0;function Y(T){var Fe;const W=new Map,ie=new Map,re=new Map,te=new Map,fe=new Map;for(const Z of T)W.set(Z.id,Z),re.set(Z.id,[]),te.set(Z.id,0),fe.set(Z.id,0),ie.set(Z.id,{id:Z.id,title:Z.title,status:Z.status,priority:Z.priority,phase:Z.phase,dependencies:Z.dependencies||[],blocks:Z.blocks||[],x:0,y:0,estimated_hours:Z.estimated_hours,isCritical:!1});for(const Z of T)for(const be of Z.dependencies||[])W.has(be)&&((Fe=re.get(be))==null||Fe.push(Z.id),te.set(Z.id,(te.get(Z.id)||0)+1));const ke=[],Se=new Map;for(const[Z,be]of te)be===0&&(ke.push(Z),Se.set(Z,0));let oe=0;for(;ke.length>0;){const Z=ke.shift(),be=W.get(Z),we=Se.get(Z)||0,ce=fe.get(Z)||0;for(const pe of re.get(Z)||[]){const Ne=ce+be.estimated_hours;Ne>(fe.get(pe)||0)&&fe.set(pe,Ne);const _e=we+1;_e>(Se.get(pe)||0)&&(Se.set(pe,_e),oe=Math.max(oe,_e));const me=(te.get(pe)||0)-1;te.set(pe,me),me===0&&ke.push(pe)}}const Oe=Math.max(...Array.from(fe.values())),He=[];for(const[Z,be]of fe)if(be===Oe){He.push(Z);break}const qe=[];if(He.length>0){let Z=He[0];for(qe.push(Z);Z;){const be=W.get(Z);let we=null,ce=-1;for(const pe of(be==null?void 0:be.dependencies)||[]){const Ne=fe.get(pe)||0;Ne>ce&&(ce=Ne,we=pe)}if(we)qe.unshift(we),Z=we;else break}}for(const Z of qe){const be=ie.get(Z);be&&(be.isCritical=!0)}const Ke=new Map;for(const[Z,be]of Se)Ke.has(be)||Ke.set(be,[]),Ke.get(be).push(Z);let Ue=l;for(let Z=0;Z<=oe;Z++){const be=Ke.get(Z)||[],we=be.length*i,ce=(h-we)/2;be.forEach((pe,Ne)=>{const _e=ie.get(pe);_e&&(_e.x=Ue,_e.y=ce+Ne*i+i/2)}),Ue+=n}const Pe=[];for(const[Z,be]of W){const we=ie.get(Z);if(we)for(const ce of be.dependencies||[]){const pe=ie.get(ce);pe&&Pe.push({from:ce,to:Z,type:"dependency",fromX:pe.x||0,fromY:pe.y||0,toX:we.x||0,toY:we.y||0,isCritical:qe.includes(ce)&&qe.includes(Z)})}}return{nodes:Array.from(ie.values()),edges:Pe,criticalPath:qe}}function z(T){E=!0,O=T.clientX,P=T.clientY,T.preventDefault()}function I(T){if(!E)return;const W=T.clientX-O,ie=T.clientY-P;t(10,C+=W),t(11,L+=ie),O=T.clientX,P=T.clientY}function G(){E=!1}let V=0,F=1;function X(T){if(T.preventDefault(),T.touches.length===1)E=!0,O=T.touches[0].clientX,P=T.touches[0].clientY;else if(T.touches.length===2){E=!1;const W=T.touches[0],ie=T.touches[1];V=Math.hypot(ie.clientX-W.clientX,ie.clientY-W.clientY),F=S}}function q(T){if(T.preventDefault(),T.touches.length===1&&E){const W=T.touches[0],ie=W.clientX-O,re=W.clientY-P;t(10,C+=ie),t(11,L+=re),O=W.clientX,P=W.clientY}else if(T.touches.length===2){const W=T.touches[0],ie=T.touches[1],te=Math.hypot(ie.clientX-W.clientX,ie.clientY-W.clientY)/V;t(9,S=Math.max(.1,Math.min(F*te,3)))}}function U(T){T.preventDefault(),T.touches.length===0&&(E=!1)}function ne(T){T.preventDefault();const W=k.getBoundingClientRect(),ie=T.clientX-W.left,re=T.clientY-W.top,te=T.deltaY>0?.9:1.1,fe=Math.max(.2,Math.min(3,S*te)),ke=fe/S;t(10,C=ie-(ie-C)*ke),t(11,L=re-(re-L)*ke),t(9,S=fe)}function D(T){t(8,N=T.id);const W=r.find(ie=>ie.id===T.id);W&&g("taskSelect",{task:W})}function H(T){t(7,w=T)}function Q(T){if(T.isCritical)return T.id===N?"#ef4444":"#f59e0b";switch(T.status){case"completed":return"#10b981";case"in_progress":return"#3b82f6";case"testing":return"#8b5cf6";case"blocked":return"#ef4444";default:return"#6b7280"}}function x(){t(9,S=1),t(10,C=0),t(11,L=0)}Jt(()=>(document.addEventListener("mousemove",I),document.addEventListener("mouseup",G),()=>{document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",G)}));const M=T=>D(T),ee=T=>H(T.id),R=()=>H(null);function K(T){un[T?"unshift":"push"](()=>{k=T,t(3,k)})}function ae(T){un[T?"unshift":"push"](()=>{f=T,t(2,f)})}return s.$$set=T=>{"tasks"in T&&t(21,r=T.tasks),"width"in T&&t(22,o=T.width),"height"in T&&t(23,c=T.height)},s.$$.update=()=>{if(s.$$.dirty[0]&1&&(n=Math.max(d/6,120)),s.$$.dirty[0]&2&&(i=Math.max(h/8,80)),s.$$.dirty[0]&1&&(l=Math.max(d/20,40)),s.$$.dirty[0]&2097152&&r&&r.length>0){const T=Y(r);t(4,y=T.nodes),t(5,b=T.edges),t(6,_=T.criticalPath)}},[d,h,f,k,y,b,_,w,N,S,C,L,z,X,q,U,ne,D,H,Q,x,r,o,c,M,ee,R,K,ae]}class Xo extends ht{constructor(e){super(),pt(this,e,Go,Jo,at,{tasks:21,width:22,height:23},null,[-1,-1])}}function Ai(s){let e,t,n,i,l,r,o,c,f=s[2].metadata.version+"",d,h,m,g,k,y,b=Ei(s[2].metadata.last_updated)+"",_,w,N,S,C,L,E=s[2].metadata.current_sprint+"",O,P,Y,z,I,G,V,F=Object.keys(s[2].phases).length+"",X,q=s[2].epic_summary&&Li(s);return{c(){e=p("div"),t=p("div"),t.innerHTML='<div class="w-10 h-10 bg-purple-600 rounded-lg flex items-center justify-center"><svg class="w-6 h-6 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg></div> <div><h3 class="text-lg font-semibold text-gray-100">Project Info</h3> <p class="text-sm text-gray-400">Metadata and timeline</p></div>',n=v(),i=p("div"),l=p("div"),r=p("span"),r.textContent="Version:",o=v(),c=p("span"),d=A(f),h=v(),m=p("div"),g=p("span"),g.textContent="Last Updated:",k=v(),y=p("span"),_=A(b),w=v(),N=p("div"),S=p("span"),S.textContent="Current Sprint:",C=v(),L=p("span"),O=A(E),P=v(),q&&q.c(),Y=v(),z=p("div"),I=p("span"),I.textContent="Phases:",G=v(),V=p("span"),X=A(F),u(t,"class","flex items-center gap-3 mb-4"),u(r,"class","text-sm text-gray-400 flex-shrink-0"),u(c,"class","text-sm text-gray-100 font-mono break-all text-right"),u(l,"class","flex justify-between items-start"),u(g,"class","text-sm text-gray-400 flex-shrink-0"),u(y,"class","text-sm text-gray-100 break-all text-right"),u(m,"class","flex justify-between items-start"),u(S,"class","text-sm text-gray-400 flex-shrink-0"),u(L,"class","text-sm text-gray-100 capitalize break-all text-right"),u(N,"class","flex justify-between items-start"),u(I,"class","text-sm text-gray-400 flex-shrink-0"),u(V,"class","text-sm text-gray-100 break-all text-right"),u(z,"class","flex justify-between items-start"),u(i,"class","space-y-3"),u(e,"class","bg-gray-800 border border-gray-700 rounded-lg p-6 min-w-0 max-w-full")},m(U,ne){B(U,e,ne),a(e,t),a(e,n),a(e,i),a(i,l),a(l,r),a(l,o),a(l,c),a(c,d),a(i,h),a(i,m),a(m,g),a(m,k),a(m,y),a(y,_),a(i,w),a(i,N),a(N,S),a(N,C),a(N,L),a(L,O),a(i,P),q&&q.m(i,null),a(i,Y),a(i,z),a(z,I),a(z,G),a(z,V),a(V,X)},p(U,ne){ne&4&&f!==(f=U[2].metadata.version+"")&&$(d,f),ne&4&&b!==(b=Ei(U[2].metadata.last_updated)+"")&&$(_,b),ne&4&&E!==(E=U[2].metadata.current_sprint+"")&&$(O,E),U[2].epic_summary?q?q.p(U,ne):(q=Li(U),q.c(),q.m(i,Y)):q&&(q.d(1),q=null),ne&4&&F!==(F=Object.keys(U[2].phases).length+"")&&$(X,F)},d(U){U&&j(e),q&&q.d()}}}function Li(s){let e,t,n,i,l=s[2].epic_summary.estimated_duration+"",r;return{c(){e=p("div"),t=p("span"),t.textContent="Duration:",n=v(),i=p("span"),r=A(l),u(t,"class","text-sm text-gray-400 flex-shrink-0"),u(i,"class","text-sm text-gray-100 break-all text-right"),u(e,"class","flex justify-between items-start")},m(o,c){B(o,e,c),a(e,t),a(e,n),a(e,i),a(i,r)},p(o,c){c&4&&l!==(l=o[2].epic_summary.estimated_duration+"")&&$(r,l)},d(o){o&&j(e)}}}function Oi(s){let e,t,n,i,l,r,o=s[2].epic_summary.total_estimated_hours+"",c,f,d,h,m,g,k=s[2].epic_summary.estimated_duration+"",y,b,_,w,N,S,C=Ii(s[0].totalHours-s[0].completedHours)+"",L,E,O;return{c(){e=p("div"),t=p("div"),t.innerHTML='<div class="w-10 h-10 bg-orange-600 rounded-lg flex items-center justify-center"><svg class="w-6 h-6 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg></div> <div><h3 class="text-lg font-semibold text-gray-100">Timeline</h3> <p class="text-sm text-gray-400">Estimated completion</p></div>',n=v(),i=p("div"),l=p("div"),r=p("div"),c=A(o),f=v(),d=p("div"),d.textContent="Total Hours",h=v(),m=p("div"),g=p("div"),y=A(k),b=v(),_=p("div"),_.textContent="Estimated Duration",w=v(),N=p("div"),S=p("div"),L=A(C),E=v(),O=p("div"),O.textContent="Remaining Work",u(t,"class","flex items-center gap-3 mb-4"),u(r,"class","text-2xl font-bold text-orange-400"),u(d,"class","text-xs text-gray-400"),u(l,"class","text-center"),u(g,"class","text-lg font-semibold text-gray-100"),u(_,"class","text-xs text-gray-400"),u(m,"class","text-center"),u(S,"class","text-sm text-gray-300"),u(O,"class","text-xs text-gray-400"),u(N,"class","text-center"),u(i,"class","space-y-3"),u(e,"class","bg-gray-800 border border-gray-700 rounded-lg p-6 min-w-0 max-w-full")},m(P,Y){B(P,e,Y),a(e,t),a(e,n),a(e,i),a(i,l),a(l,r),a(r,c),a(l,f),a(l,d),a(i,h),a(i,m),a(m,g),a(g,y),a(m,b),a(m,_),a(i,w),a(i,N),a(N,S),a(S,L),a(N,E),a(N,O)},p(P,Y){Y&4&&o!==(o=P[2].epic_summary.total_estimated_hours+"")&&$(c,o),Y&4&&k!==(k=P[2].epic_summary.estimated_duration+"")&&$(y,k),Y&1&&C!==(C=Ii(P[0].totalHours-P[0].completedHours)+"")&&$(L,C)},d(P){P&&j(e)}}}function Wo(s){var ie;let e,t,n,i,l,r,o,c,f,d=Math.round(s[1])+"",h,m,g,k,y,b,_,w,N,S=s[0].completedTasks+"",C,L,E,O,P=s[0].totalTasks+"",Y,z,I,G,V,F,X,q=s[0].completedHours+"",U,ne,D,H,Q=s[0].totalHours+"",x,M,ee,R,K,ae,T=s[2]&&Ai(s),W=((ie=s[2])==null?void 0:ie.epic_summary)&&Oi(s);return{c(){e=p("div"),t=p("div"),n=p("div"),n.innerHTML='<div class="w-10 h-10 bg-blue-600 rounded-lg flex items-center justify-center"><svg class="w-6 h-6 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"></path></svg></div> <div><h3 class="text-lg font-semibold text-gray-100">Project Summary</h3> <p class="text-sm text-gray-400">Overall progress and statistics</p></div>',i=v(),l=p("div"),r=p("div"),o=p("span"),o.textContent="Overall Progress",c=v(),f=p("span"),h=A(d),m=A("%"),g=v(),k=p("div"),y=p("div"),b=v(),_=p("div"),w=p("div"),N=p("div"),C=A(S),L=v(),E=p("div"),O=A("of "),Y=A(P),z=A(" tasks"),I=v(),G=p("div"),G.textContent="Completed",V=v(),F=p("div"),X=p("div"),U=A(q),ne=v(),D=p("div"),H=A("of "),x=A(Q),M=A(" hours"),ee=v(),R=p("div"),R.textContent="Hours Done",K=v(),T&&T.c(),ae=v(),W&&W.c(),u(n,"class","flex items-center gap-3 mb-4"),u(o,"class","text-sm font-medium text-gray-300"),u(f,"class","text-sm text-gray-400"),u(r,"class","flex justify-between items-center mb-2"),u(y,"class","bg-gradient-to-r from-blue-500 to-green-500 h-3 rounded-full transition-all duration-500"),dt(y,"width",s[1]+"%"),u(k,"class","w-full bg-gray-700 rounded-full h-3"),u(l,"class","mb-6"),u(N,"class","text-2xl font-bold text-blue-400"),u(E,"class","text-xs text-gray-400"),u(G,"class","text-xs text-gray-500 mt-1"),u(w,"class","text-center"),u(X,"class","text-2xl font-bold text-green-400"),u(D,"class","text-xs text-gray-400"),u(R,"class","text-xs text-gray-500 mt-1"),u(F,"class","text-center"),u(_,"class","grid grid-cols-2 gap-4"),u(t,"class","bg-gray-800 border border-gray-700 rounded-lg p-6 min-w-0 max-w-full"),u(e,"class","grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-6 max-w-full")},m(re,te){B(re,e,te),a(e,t),a(t,n),a(t,i),a(t,l),a(l,r),a(r,o),a(r,c),a(r,f),a(f,h),a(f,m),a(l,g),a(l,k),a(k,y),a(t,b),a(t,_),a(_,w),a(w,N),a(N,C),a(w,L),a(w,E),a(E,O),a(E,Y),a(E,z),a(w,I),a(w,G),a(_,V),a(_,F),a(F,X),a(X,U),a(F,ne),a(F,D),a(D,H),a(D,x),a(D,M),a(F,ee),a(F,R),a(e,K),T&&T.m(e,null),a(e,ae),W&&W.m(e,null)},p(re,[te]){var fe;te&2&&d!==(d=Math.round(re[1])+"")&&$(h,d),te&2&&dt(y,"width",re[1]+"%"),te&1&&S!==(S=re[0].completedTasks+"")&&$(C,S),te&1&&P!==(P=re[0].totalTasks+"")&&$(Y,P),te&1&&q!==(q=re[0].completedHours+"")&&$(U,q),te&1&&Q!==(Q=re[0].totalHours+"")&&$(x,Q),re[2]?T?T.p(re,te):(T=Ai(re),T.c(),T.m(e,ae)):T&&(T.d(1),T=null),(fe=re[2])!=null&&fe.epic_summary?W?W.p(re,te):(W=Oi(re),W.c(),W.m(e,null)):W&&(W.d(1),W=null)},i:Ae,o:Ae,d(re){re&&j(e),T&&T.d(),W&&W.d()}}}function Ei(s){try{return new Date(s).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}catch{return s}}function Ii(s){return s<24?`${s}h`:`${Math.floor(s/8)}d`}function Qo(s,e,t){let n,i,l,r,o;return Je(s,zl,c=>t(3,r=c)),Je(s,Xe,c=>t(4,o=c)),s.$$.update=()=>{s.$$.dirty&16&&t(2,n=o.backlog),s.$$.dirty&8&&t(0,i=r),s.$$.dirty&1&&t(1,l=i.totalTasks>0?i.completedTasks/i.totalTasks*100:0)},[i,l,n,r,o]}class Zo extends ht{constructor(e){super(),pt(this,e,Qo,Wo,at,{})}}function Mi(s,e,t){const n=s.slice();return n[10]=e[t],n}function Pi(s,e,t){const n=s.slice();return n[13]=e[t],n}function ji(s){let e,t;return{c(){e=p("span"),t=A(s[2]),u(e,"class","text-xs px-2 py-1 bg-gray-700 text-gray-300 rounded")},m(n,i){B(n,e,i),a(e,t)},p(n,i){i&4&&$(t,n[2])},d(n){n&&j(e)}}}function ea(s){let e,t;return{c(){e=p("p"),t=A(s[1])},m(n,i){B(n,e,i),a(e,t)},p(n,i){i&2&&$(t,n[1])},d(n){n&&j(e)}}}function ta(s){let e,t;return{c(){e=p("pre"),t=A(s[1]),u(e,"class","whitespace-pre-wrap font-mono text-sm bg-gray-900 p-3 rounded border-l-4 border-red-500 svelte-14ld7m2")},m(n,i){B(n,e,i),a(e,t)},p(n,i){i&2&&$(t,n[1])},d(n){n&&j(e)}}}function Bi(s){let e,t,n,i,l=ye(s[6]),r=[];for(let o=0;o<l.length;o+=1)r[o]=Di(Pi(s,l,o));return{c(){e=p("div"),t=p("h3"),t.textContent="💡 Suggestions:",n=v(),i=p("ul");for(let o=0;o<r.length;o+=1)r[o].c();u(t,"class","text-sm font-semibold text-gray-300 mb-2"),u(i,"class","text-sm text-gray-400 space-y-1"),u(e,"class","mb-4")},m(o,c){B(o,e,c),a(e,t),a(e,n),a(e,i);for(let f=0;f<r.length;f+=1)r[f]&&r[f].m(i,null)},p(o,c){if(c&64){l=ye(o[6]);let f;for(f=0;f<l.length;f+=1){const d=Pi(o,l,f);r[f]?r[f].p(d,c):(r[f]=Di(d),r[f].c(),r[f].m(i,null))}for(;f<r.length;f+=1)r[f].d(1);r.length=l.length}},d(o){o&&j(e),xe(r,o)}}}function Di(s){let e,t,n,i,l=s[13]+"",r,o;return{c(){e=p("li"),t=p("span"),t.textContent="•",n=v(),i=p("span"),r=A(l),o=v(),u(t,"class","text-gray-500 mt-1"),u(e,"class","flex items-start gap-2")},m(c,f){B(c,e,f),a(e,t),a(e,n),a(e,i),a(i,r),a(e,o)},p(c,f){f&64&&l!==(l=c[13]+"")&&$(r,l)},d(c){c&&j(e)}}}function $i(s){let e,t,n,i,l,r=s[3].length+"",o,c,f=s[3].length!==1?"s":"",d,h,m,g,k,y,b,_,w=s[0]&&Ri(s);return{c(){e=p("div"),t=p("button"),n=p("span"),n.textContent="⚠️",i=v(),l=p("span"),o=A(r),c=A(" Warning"),d=A(f),h=v(),m=ue("svg"),g=ue("path"),y=v(),w&&w.c(),u(g,"stroke-linecap","round"),u(g,"stroke-linejoin","round"),u(g,"stroke-width","2"),u(g,"d","M9 5l7 7-7 7"),u(m,"class",k="w-4 h-4 transition-transform "+(s[0]?"rotate-90":"")),u(m,"fill","none"),u(m,"stroke","currentColor"),u(m,"viewBox","0 0 24 24"),u(t,"class","flex items-center gap-2 text-sm font-semibold text-yellow-400 hover:text-yellow-300 transition-colors"),u(e,"class","mb-4")},m(N,S){B(N,e,S),a(e,t),a(t,n),a(t,i),a(t,l),a(l,o),a(l,c),a(l,d),a(t,h),a(t,m),a(m,g),a(e,y),w&&w.m(e,null),b||(_=ge(t,"click",s[9]),b=!0)},p(N,S){S&8&&r!==(r=N[3].length+"")&&$(o,r),S&8&&f!==(f=N[3].length!==1?"s":"")&&$(d,f),S&1&&k!==(k="w-4 h-4 transition-transform "+(N[0]?"rotate-90":""))&&u(m,"class",k),N[0]?w?w.p(N,S):(w=Ri(N),w.c(),w.m(e,null)):w&&(w.d(1),w=null)},d(N){N&&j(e),w&&w.d(),b=!1,_()}}}function Ri(s){let e,t=ye(s[3]),n=[];for(let i=0;i<t.length;i+=1)n[i]=qi(Mi(s,t,i));return{c(){e=p("ul");for(let i=0;i<n.length;i+=1)n[i].c();u(e,"class","mt-2 text-sm text-yellow-300 space-y-1 ml-6")},m(i,l){B(i,e,l);for(let r=0;r<n.length;r+=1)n[r]&&n[r].m(e,null)},p(i,l){if(l&8){t=ye(i[3]);let r;for(r=0;r<t.length;r+=1){const o=Mi(i,t,r);n[r]?n[r].p(o,l):(n[r]=qi(o),n[r].c(),n[r].m(e,null))}for(;r<n.length;r+=1)n[r].d(1);n.length=t.length}},d(i){i&&j(e),xe(n,i)}}}function qi(s){let e,t,n,i,l=s[10]+"",r,o;return{c(){e=p("li"),t=p("span"),t.textContent="•",n=v(),i=p("span"),r=A(l),o=v(),u(t,"class","text-yellow-500 mt-1"),u(e,"class","flex items-start gap-2")},m(c,f){B(c,e,f),a(e,t),a(e,n),a(e,i),a(i,r),a(e,o)},p(c,f){f&8&&l!==(l=c[10]+"")&&$(r,l)},d(c){c&&j(e)}}}function Fi(s){let e,t,n;return{c(){e=p("button"),e.textContent="🔄 Retry",u(e,"class","px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium transition-colors")},m(i,l){B(i,e,l),t||(n=ge(e,"click",function(){il(s[4])&&s[4].apply(this,arguments)}),t=!0)},p(i,l){s=i},d(i){i&&j(e),t=!1,n()}}}function sa(s){let e,t,n,i,l,r,o,c,f=s[5]==="yaml"?"YAML Parsing Error":s[5]==="validation"?"Validation Error":s[5]==="network"?"Network Error":s[5]==="file"?"File Error":"Error Loading Backlog",d,h,m,g,k,y,b,_,w,N,S,C=s[0]?"👁️ Hide Details":"🔍 Show Details",L,E,O,P,Y=s[2]&&ji(s);function z(q,U){return U&2&&(k=null),k==null&&(k=!!q[1].includes(`
`)),k?ta:ea}let I=z(s,-1),G=I(s),V=s[6].length>0&&Bi(s),F=s[3]&&s[3].length>0&&$i(s),X=s[4]&&Fi(s);return{c(){e=p("div"),t=p("div"),n=p("div"),i=A(s[8]),l=v(),r=p("div"),o=p("div"),c=p("h2"),d=A(f),h=v(),Y&&Y.c(),m=v(),g=p("div"),G.c(),y=v(),V&&V.c(),b=v(),F&&F.c(),_=v(),w=p("div"),X&&X.c(),N=v(),S=p("button"),L=A(C),u(n,"class","text-2xl flex-shrink-0 mt-1"),u(c,"class","text-xl font-semibold text-red-400"),u(o,"class","flex items-center justify-between mb-2"),u(g,"class","text-red-300 mb-4 leading-relaxed"),u(S,"class","px-4 py-2 bg-gray-700 hover:bg-gray-600 text-gray-300 rounded-md text-sm font-medium transition-colors"),u(w,"class","flex items-center gap-3"),u(r,"class","flex-1 min-w-0"),u(t,"class","flex items-start gap-4"),u(e,"class",E="bg-gray-800 border "+s[7]+" p-6 rounded-lg mb-6")},m(q,U){B(q,e,U),a(e,t),a(t,n),a(n,i),a(t,l),a(t,r),a(r,o),a(o,c),a(c,d),a(o,h),Y&&Y.m(o,null),a(r,m),a(r,g),G.m(g,null),a(r,y),V&&V.m(r,null),a(r,b),F&&F.m(r,null),a(r,_),a(r,w),X&&X.m(w,null),a(w,N),a(w,S),a(S,L),O||(P=ge(S,"click",s[9]),O=!0)},p(q,[U]){U&256&&$(i,q[8]),U&32&&f!==(f=q[5]==="yaml"?"YAML Parsing Error":q[5]==="validation"?"Validation Error":q[5]==="network"?"Network Error":q[5]==="file"?"File Error":"Error Loading Backlog")&&$(d,f),q[2]?Y?Y.p(q,U):(Y=ji(q),Y.c(),Y.m(o,null)):Y&&(Y.d(1),Y=null),I===(I=z(q,U))&&G?G.p(q,U):(G.d(1),G=I(q),G&&(G.c(),G.m(g,null))),q[6].length>0?V?V.p(q,U):(V=Bi(q),V.c(),V.m(r,b)):V&&(V.d(1),V=null),q[3]&&q[3].length>0?F?F.p(q,U):(F=$i(q),F.c(),F.m(r,_)):F&&(F.d(1),F=null),q[4]?X?X.p(q,U):(X=Fi(q),X.c(),X.m(w,N)):X&&(X.d(1),X=null),U&1&&C!==(C=q[0]?"👁️ Hide Details":"🔍 Show Details")&&$(L,C),U&128&&E!==(E="bg-gray-800 border "+q[7]+" p-6 rounded-lg mb-6")&&u(e,"class",E)},i:Ae,o:Ae,d(q){q&&j(e),Y&&Y.d(),G.d(),V&&V.d(),F&&F.d(),X&&X.d(),O=!1,P()}}}function na(s){return s.includes("YAML")?"yaml":s.includes("Schema")||s.includes("validation")?"validation":s.includes("Network")||s.includes("fetch")?"network":s.includes("File")||s.includes("not found")?"file":"general"}function ia(s){switch(s){case"yaml":return"📝";case"validation":return"🔍";case"network":return"🌐";case"file":return"📁";default:return"⚠️"}}function la(s){switch(s){case"yaml":return"border-yellow-500/20 bg-yellow-600/10";case"validation":return"border-blue-500/20 bg-blue-600/10";case"network":return"border-purple-500/20 bg-purple-600/10";case"file":return"border-orange-500/20 bg-orange-600/10";default:return"border-red-500/20 bg-red-600/10"}}function ra(s,e){const t=[];return s==="yaml"?(t.push("Check your YAML indentation (use spaces, not tabs)"),t.push("Ensure all strings with special characters are quoted"),t.push("Verify that colons are followed by a space"),t.push('Use "pmac validate" to check your project-backlog.yml file')):s==="validation"?(t.push("Check that all required fields are present"),t.push("Verify your task IDs are unique"),t.push("Ensure task dependencies reference existing tasks"),t.push('Run "pmac validate" to check for issues')):s==="network"?(t.push("Check your internet connection"),t.push("Verify the backlog file path is correct"),t.push("Try refreshing the page"),t.push('Use "pmac --backlog path/to/file.yml viewer" to specify custom path')):s==="file"?(t.push('Run "pmac init --existing" to create project-backlog.yml in current directory'),t.push('Run "pmac init project-name" to create a new PMaC project'),t.push("Ensure you're in a directory with a project-backlog.yml file"),t.push('Use "pmac --backlog path/to/file.yml viewer" to specify custom backlog path'),t.push("Check that the backlog file exists and has proper read permissions")):(t.push('Run "pmac init --existing" to initialize PMaC in current directory'),t.push("Ensure you have a project-backlog.yml file in your project directory"),t.push('Use "pmac help" to see all available commands'),t.push('Use "pmac --backlog custom/path.yml viewer" for custom backlog locations')),t}function oa(s,e,t){let n,i,l,r,{error:o}=e,{context:c=void 0}=e,{warnings:f=[]}=e,{showDetails:d=!1}=e,{onRetry:h=void 0}=e;function m(){t(0,d=!d)}return s.$$set=g=>{"error"in g&&t(1,o=g.error),"context"in g&&t(2,c=g.context),"warnings"in g&&t(3,f=g.warnings),"showDetails"in g&&t(0,d=g.showDetails),"onRetry"in g&&t(4,h=g.onRetry)},s.$$.update=()=>{s.$$.dirty&2&&t(5,n=na(o)),s.$$.dirty&32&&t(8,i=ia(n)),s.$$.dirty&32&&t(7,l=la(n)),s.$$.dirty&36&&t(6,r=ra(n))},[d,o,c,f,h,n,r,l,i,m]}class aa extends ht{constructor(e){super(),pt(this,e,oa,sa,at,{error:1,context:2,warnings:3,showDetails:0,onRetry:4})}}const Ys={backlogPath:"./project-backlog.yml",refreshInterval:5e3,enableAutoRefresh:!0,fallbackToSample:!1};function ca(){const s={...Ys};if(typeof window<"u"){const e=new URLSearchParams(window.location.search),t=e.get("backlog");t&&(s.backlogPath=t);const n=e.get("refresh");if(n){const r=parseInt(n,10);!isNaN(r)&&r>0&&(s.refreshInterval=r*1e3)}const i=e.get("autoRefresh");i&&(s.enableAutoRefresh=i==="true");const l=e.get("fallback");l&&(s.fallbackToSample=l==="true")}return s}const Bs={LOCAL:"./project-backlog.yml",PARENT:"../project-backlog.yml",VIEWER:"./viewer/project-backlog.yml"};async function fa(s){const e=[s||Ys.backlogPath,Bs.LOCAL,Bs.PARENT,Bs.VIEWER].filter(Boolean);for(const t of e)try{if((await fetch(t)).ok)return t}catch{continue}return s||Ys.backlogPath}const ua={backlogPath:"./project-backlog.yml",enableAutoRefresh:!1,refreshInterval:0,fallbackToSample:!1};function da(){const s=ua,e=ca();return{...s,...e}}function xi(s,e,t){const n=s.slice();return n[33]=e[t][0],n[34]=e[t][1],n}function Ki(s,e,t){const n=s.slice();return n[37]=e[t],n}function Ui(s,e,t){const n=s.slice();return n[40]=e[t][0],n[41]=e[t][1],n}function ha(s,e,t){const n=s.slice();return n[46]=e[t],n[48]=t,n}function Yi(s,e,t){const n=s.slice();return n[40]=e[t][0],n[41]=e[t][1],n}function Hi(s){let e,t,n;return{c(){e=p("div"),u(e,"class","fixed inset-0 bg-black bg-opacity-50 z-40 md:hidden"),u(e,"role","button"),u(e,"tabindex","0")},m(i,l){B(i,e,l),t||(n=[ge(e,"click",s[21]),ge(e,"keydown",s[22])],t=!0)},p:Ae,d(i){i&&j(e),t=!1,ct(n)}}}function pa(s){let e,t=ye(Array(5)),n=[];for(let i=0;i<t.length;i+=1)n[i]=ga(ha(s,t,i));return{c(){e=p("ul");for(let i=0;i<n.length;i+=1)n[i].c();u(e,"class","space-y-1")},m(i,l){B(i,e,l);for(let r=0;r<n.length;r+=1)n[r]&&n[r].m(e,null)},p:Ae,d(i){i&&j(e),xe(n,i)}}}function ma(s){let e,t,n,i,l,r,o,c=s[10].length+"",f,d,h,m=Math.round(s[11].completionPercentage)+"",g,k,y,b,_,w,N=ye(Object.entries(s[6].phases)),S=[];for(let C=0;C<N.length;C+=1)S[C]=Vi(Yi(s,N,C));return{c(){e=p("ul"),t=p("li"),n=p("button"),i=p("div"),l=p("span"),l.textContent="All Phases",r=v(),o=p("span"),f=A(c),d=v(),h=p("div"),g=A(m),k=A("% complete"),b=v();for(let C=0;C<S.length;C+=1)S[C].c();u(o,"class","text-xs text-gray-400"),u(i,"class","flex items-center justify-between"),u(h,"class","text-xs text-gray-400 mt-1"),u(n,"class",y="w-full text-left px-3 py-2 rounded-md text-sm hover:bg-gray-700 transition-colors "+(s[9].phase===null?"bg-gray-700 text-blue-400":"text-gray-300")),u(e,"class","space-y-1")},m(C,L){B(C,e,L),a(e,t),a(t,n),a(n,i),a(i,l),a(i,r),a(i,o),a(o,f),a(n,d),a(n,h),a(h,g),a(h,k),a(e,b);for(let E=0;E<S.length;E+=1)S[E]&&S[E].m(e,null);_||(w=ge(n,"click",s[23]),_=!0)},p(C,L){if(L[0]&1024&&c!==(c=C[10].length+"")&&$(f,c),L[0]&2048&&m!==(m=Math.round(C[11].completionPercentage)+"")&&$(g,m),L[0]&512&&y!==(y="w-full text-left px-3 py-2 rounded-md text-sm hover:bg-gray-700 transition-colors "+(C[9].phase===null?"bg-gray-700 text-blue-400":"text-gray-300"))&&u(n,"class",y),L[0]&576){N=ye(Object.entries(C[6].phases));let E;for(E=0;E<N.length;E+=1){const O=Yi(C,N,E);S[E]?S[E].p(O,L):(S[E]=Vi(O),S[E].c(),S[E].m(e,null))}for(;E<S.length;E+=1)S[E].d(1);S.length=N.length}},d(C){C&&j(e),xe(S,C),_=!1,w()}}}function ga(s){let e;return{c(){e=p("li"),e.innerHTML=`<div class="px-3 py-2 rounded-md"><div class="flex items-center justify-between"><div class="h-4 bg-gray-700 rounded animate-pulse" style="width: ${60+s[48]*10}%"></div> <div class="h-3 bg-gray-700 rounded animate-pulse w-6"></div></div> <div class="h-3 bg-gray-700 rounded animate-pulse w-12 mt-2"></div></div> `},m(t,n){B(t,e,n)},p:Ae,d(t){t&&j(e)}}}function Vi(s){let e,t,n,i,l=s[41].title+"",r,o,c,f=s[41].tasks.length+"",d,h,m,g=s[41].status+"",k,y,b,_,w;function N(){return s[24](s[40])}return{c(){e=p("li"),t=p("button"),n=p("div"),i=p("span"),r=A(l),o=v(),c=p("span"),d=A(f),h=v(),m=p("div"),k=A(g),b=v(),u(c,"class","text-xs text-gray-400"),u(n,"class","flex items-center justify-between"),u(m,"class","text-xs text-gray-400 mt-1"),u(t,"class",y="w-full text-left px-3 py-2 rounded-md text-sm hover:bg-gray-700 transition-colors "+(s[9].phase===s[40]?"bg-gray-700 text-blue-400":"text-gray-300"))},m(S,C){B(S,e,C),a(e,t),a(t,n),a(n,i),a(i,r),a(n,o),a(n,c),a(c,d),a(t,h),a(t,m),a(m,k),a(e,b),_||(w=ge(t,"click",N),_=!0)},p(S,C){s=S,C[0]&64&&l!==(l=s[41].title+"")&&$(r,l),C[0]&64&&f!==(f=s[41].tasks.length+"")&&$(d,f),C[0]&64&&g!==(g=s[41].status+"")&&$(k,g),C[0]&576&&y!==(y="w-full text-left px-3 py-2 rounded-md text-sm hover:bg-gray-700 transition-colors "+(s[9].phase===s[40]?"bg-gray-700 text-blue-400":"text-gray-300"))&&u(t,"class",y)},d(S){S&&j(e),_=!1,w()}}}function zi(s){let e,t,n=s[6].metadata.version+"",i,l,r,o,c=s[6].metadata.last_updated+"",f;return{c(){e=p("div"),t=A("Version: "),i=A(n),l=v(),r=p("div"),o=A("Updated: "),f=A(c),u(e,"class","mb-2")},m(d,h){B(d,e,h),a(e,t),a(e,i),B(d,l,h),B(d,r,h),a(r,o),a(r,f)},p(d,h){h[0]&64&&n!==(n=d[6].metadata.version+"")&&$(i,n),h[0]&64&&c!==(c=d[6].metadata.last_updated+"")&&$(f,c)},d(d){d&&(j(e),j(l),j(r))}}}function Ji(s){let e,t,n;return{c(){e=p("div"),t=A("Loading from: "),n=A(s[4]),u(e,"class","text-xs text-gray-500 hidden lg:block truncate max-w-48")},m(i,l){B(i,e,l),a(e,t),a(e,n)},p(i,l){l[0]&16&&$(n,i[4])},d(i){i&&j(e)}}}function Gi(s){let e,t=Object.keys(s[6].phases).length+"",n,i,l,r,o=s[12].length+"",c,f,d,h,m,g,k,y;return{c(){e=p("div"),n=A(t),i=A(" phases"),l=v(),r=p("div"),c=A(o),f=A(" tasks"),d=v(),h=p("div"),m=p("div"),k=v(),y=p("span"),y.textContent="Live",u(e,"class","text-sm text-gray-400 hidden sm:block whitespace-nowrap"),u(r,"class","text-sm text-gray-400 whitespace-nowrap"),u(m,"class",g="w-2 h-2 bg-green-500 rounded-full "+(s[7]?"animate-pulse":"")),u(y,"class","text-xs text-gray-500 whitespace-nowrap"),u(h,"class","flex items-center space-x-2 flex-shrink-0")},m(b,_){B(b,e,_),a(e,n),a(e,i),B(b,l,_),B(b,r,_),a(r,c),a(r,f),B(b,d,_),B(b,h,_),a(h,m),a(h,k),a(h,y)},p(b,_){_[0]&64&&t!==(t=Object.keys(b[6].phases).length+"")&&$(n,t),_[0]&4096&&o!==(o=b[12].length+"")&&$(c,o),_[0]&128&&g!==(g="w-2 h-2 bg-green-500 rounded-full "+(b[7]?"animate-pulse":""))&&u(m,"class",g)},d(b){b&&(j(e),j(l),j(r),j(d),j(h))}}}function ya(s){let e;return{c(){e=p("div"),e.textContent=`Auto-refresh: ${s[17].refreshInterval/1e3}s`,u(e,"class","text-xs text-green-500 hidden lg:block whitespace-nowrap")},m(t,n){B(t,e,n)},p:Ae,d(t){t&&j(e)}}}function ba(s){let e,t,n,i,l,r,o,c,f,d,h,m,g,k,y,b,_,w,N,S,C,L;t=new Zo({}),i=new Bo({});let E=s[1]&&Xi(s);const O=[va,wa],P=[];function Y(I,G){return I[13].size===0?0:1}b=Y(s),_=P[b]=O[b](s);let z=s[6].risks&&Zi(s);return{c(){e=p("div"),kt(t.$$.fragment),n=v(),kt(i.$$.fragment),l=v(),r=p("div"),o=p("header"),c=p("div"),f=ue("svg"),d=ue("path"),m=v(),g=p("h2"),g.textContent="Critical Path Analysis",k=v(),E&&E.c(),y=v(),_.c(),w=v(),z&&z.c(),N=vt(),u(e,"class","mb-6"),u(d,"stroke-linecap","round"),u(d,"stroke-linejoin","round"),u(d,"stroke-width","2"),u(d,"d","M9 5l7 7-7 7"),u(f,"class",h="w-5 h-5 text-gray-400 transition-transform duration-200 "+(s[1]?"rotate-90":"")),u(f,"fill","none"),u(f,"stroke","currentColor"),u(f,"viewBox","0 0 24 24"),u(g,"class","text-xl font-semibold text-gray-100"),u(c,"class","flex items-center gap-3"),u(o,"class","p-4 bg-gray-750 border-b border-gray-700 cursor-pointer hover:bg-gray-700 transition-colors"),u(o,"tabindex","0"),u(o,"role","button"),u(o,"aria-expanded",s[1]),u(o,"aria-controls","critical-path-content"),u(r,"class","bg-gray-800 border border-gray-700 rounded-lg mb-6 overflow-hidden")},m(I,G){B(I,e,G),_t(t,e,null),B(I,n,G),_t(i,I,G),B(I,l,G),B(I,r,G),a(r,o),a(o,c),a(c,f),a(f,d),a(c,m),a(c,g),a(r,k),E&&E.m(r,null),B(I,y,G),P[b].m(I,G),B(I,w,G),z&&z.m(I,G),B(I,N,G),S=!0,C||(L=[ge(o,"click",s[28]),ge(o,"keydown",s[29])],C=!0)},p(I,G){(!S||G[0]&2&&h!==(h="w-5 h-5 text-gray-400 transition-transform duration-200 "+(I[1]?"rotate-90":"")))&&u(f,"class",h),(!S||G[0]&2)&&u(o,"aria-expanded",I[1]),I[1]?E?(E.p(I,G),G[0]&2&&Te(E,1)):(E=Xi(I),E.c(),Te(E,1),E.m(r,null)):E&&(rt(),Ie(E,1,1,()=>{E=null}),ot());let V=b;b=Y(I),b===V?P[b].p(I,G):(rt(),Ie(P[V],1,1,()=>{P[V]=null}),ot(),_=P[b],_?_.p(I,G):(_=P[b]=O[b](I),_.c()),Te(_,1),_.m(w.parentNode,w)),I[6].risks?z?z.p(I,G):(z=Zi(I),z.c(),z.m(N.parentNode,N)):z&&(z.d(1),z=null)},i(I){S||(Te(t.$$.fragment,I),Te(i.$$.fragment,I),Te(E),Te(_),S=!0)},o(I){Ie(t.$$.fragment,I),Ie(i.$$.fragment,I),Ie(E),Ie(_),S=!1},d(I){I&&(j(e),j(n),j(l),j(r),j(y),j(w),j(N)),bt(t),bt(i,I),E&&E.d(),P[b].d(I),z&&z.d(I),C=!1,ct(L)}}}function _a(s){let e,t;return e=new aa({props:{error:s[5],context:"Loading backlog",onRetry:s[27]}}),{c(){kt(e.$$.fragment)},m(n,i){_t(e,n,i),t=!0},p(n,i){const l={};i[0]&32&&(l.error=n[5]),e.$set(l)},i(n){t||(Te(e.$$.fragment,n),t=!0)},o(n){Ie(e.$$.fragment,n),t=!1},d(n){bt(e,n)}}}function ka(s){let e;return{c(){e=p("div"),e.innerHTML='<div class="spinner"></div> <span class="ml-4 text-gray-400">Loading project backlog...</span>',u(e,"class","flex items-center justify-center min-h-64")},m(t,n){B(t,e,n)},p:Ae,i:Ae,o:Ae,d(t){t&&j(e)}}}function Xi(s){let e,t,n;return t=new Xo({props:{tasks:s[12]}}),t.$on("taskSelect",s[30]),{c(){e=p("div"),kt(t.$$.fragment),u(e,"id","critical-path-content"),u(e,"class","p-6")},m(i,l){B(i,e,l),_t(t,e,null),n=!0},p(i,l){const r={};l[0]&4096&&(r.tasks=i[12]),t.$set(r)},i(i){n||(Te(t.$$.fragment,i),n=!0)},o(i){Ie(t.$$.fragment,i),n=!1},d(i){i&&j(e),bt(t)}}}function wa(s){let e,t,n=ye(Object.entries(s[6].phases)),i=[];for(let r=0;r<n.length;r+=1)i[r]=Qi(Ui(s,n,r));const l=r=>Ie(i[r],1,1,()=>{i[r]=null});return{c(){for(let r=0;r<i.length;r+=1)i[r].c();e=vt()},m(r,o){for(let c=0;c<i.length;c+=1)i[c]&&i[c].m(r,o);B(r,e,o),t=!0},p(r,o){if(o[0]&75840){n=ye(Object.entries(r[6].phases));let c;for(c=0;c<n.length;c+=1){const f=Ui(r,n,c);i[c]?(i[c].p(f,o),Te(i[c],1)):(i[c]=Qi(f),i[c].c(),Te(i[c],1),i[c].m(e.parentNode,e))}for(rt(),c=n.length;c<i.length;c+=1)l(c);ot()}},i(r){if(!t){for(let o=0;o<n.length;o+=1)Te(i[o]);t=!0}},o(r){i=i.filter(Boolean);for(let o=0;o<i.length;o+=1)Ie(i[o]);t=!1},d(r){r&&j(e),xe(i,r)}}}function va(s){let e;return{c(){e=p("div"),e.innerHTML='<p class="text-gray-400 text-lg">No phases found in the project backlog.</p>',u(e,"class","text-center py-12")},m(t,n){B(t,e,n)},p:Ae,i:Ae,o:Ae,d(t){t&&j(e)}}}function Wi(s){let e,t;return e=new Yo({props:{phaseId:s[40],phase:s[41],tasks:s[13].get(s[40])||[],stats:s[11].phaseStats[s[40]]||{total:0,completed:0,inProgress:0,pending:0,blocked:0,totalHours:0,completedHours:0},onTaskClick:s[16]}}),{c(){kt(e.$$.fragment)},m(n,i){_t(e,n,i),t=!0},p(n,i){const l={};i[0]&64&&(l.phaseId=n[40]),i[0]&64&&(l.phase=n[41]),i[0]&8256&&(l.tasks=n[13].get(n[40])||[]),i[0]&2112&&(l.stats=n[11].phaseStats[n[40]]||{total:0,completed:0,inProgress:0,pending:0,blocked:0,totalHours:0,completedHours:0}),e.$set(l)},i(n){t||(Te(e.$$.fragment,n),t=!0)},o(n){Ie(e.$$.fragment,n),t=!1},d(n){bt(e,n)}}}function Qi(s){let e=s[13].has(s[40]),t,n,i=e&&Wi(s);return{c(){i&&i.c(),t=vt()},m(l,r){i&&i.m(l,r),B(l,t,r),n=!0},p(l,r){r[0]&8256&&(e=l[13].has(l[40])),e?i?(i.p(l,r),r[0]&8256&&Te(i,1)):(i=Wi(l),i.c(),Te(i,1),i.m(t.parentNode,t)):i&&(rt(),Ie(i,1,1,()=>{i=null}),ot())},i(l){n||(Te(i),n=!0)},o(l){Ie(i),n=!1},d(l){l&&j(t),i&&i.d(l)}}}function Zi(s){let e,t,n,i=ye(Object.entries(s[6].risks)),l=[];for(let r=0;r<i.length;r+=1)l[r]=tl(xi(s,i,r));return{c(){e=p("div"),t=p("h3"),t.textContent="Risk Assessment",n=v();for(let r=0;r<l.length;r+=1)l[r].c();u(t,"class","text-lg font-semibold mb-4 text-gray-100"),u(e,"class","bg-gray-800 border border-gray-700 rounded-lg p-6 mb-6 hover:bg-gray-700 transition-colors")},m(r,o){B(r,e,o),a(e,t),a(e,n);for(let c=0;c<l.length;c+=1)l[c]&&l[c].m(e,null)},p(r,o){if(o[0]&64){i=ye(Object.entries(r[6].risks));let c;for(c=0;c<i.length;c+=1){const f=xi(r,i,c);l[c]?l[c].p(f,o):(l[c]=tl(f),l[c].c(),l[c].m(e,null))}for(;c<l.length;c+=1)l[c].d(1);l.length=i.length}},d(r){r&&j(e),xe(l,r)}}}function el(s){let e,t,n=s[37].risk+"",i,l,r,o,c,f=s[37].mitigation+"",d,h;return{c(){e=p("div"),t=p("p"),i=A(n),l=v(),r=p("p"),o=p("span"),o.textContent="Mitigation:",c=v(),d=A(f),h=v(),u(t,"class","text-sm text-gray-100 mb-1"),u(o,"class","font-medium"),u(r,"class","text-xs text-gray-400"),u(e,"class","bg-gray-700 p-3 rounded border border-gray-600")},m(m,g){B(m,e,g),a(e,t),a(t,i),a(e,l),a(e,r),a(r,o),a(r,c),a(r,d),a(e,h)},p(m,g){g[0]&64&&n!==(n=m[37].risk+"")&&$(i,n),g[0]&64&&f!==(f=m[37].mitigation+"")&&$(d,f)},d(m){m&&j(e)}}}function tl(s){let e,t,n=s[33]+"",i,l,r,o,c,f=ye(s[34]),d=[];for(let h=0;h<f.length;h+=1)d[h]=el(Ki(s,f,h));return{c(){e=p("div"),t=p("h4"),i=A(n),l=A(" Risk"),r=v(),o=p("div");for(let h=0;h<d.length;h+=1)d[h].c();c=v(),u(t,"class","text-sm font-medium text-gray-300 mb-2 capitalize"),u(o,"class","space-y-2"),u(e,"class","mb-4")},m(h,m){B(h,e,m),a(e,t),a(t,i),a(t,l),a(e,r),a(e,o);for(let g=0;g<d.length;g+=1)d[g]&&d[g].m(o,null);a(e,c)},p(h,m){if(m[0]&64&&n!==(n=h[33]+"")&&$(i,n),m[0]&64){f=ye(h[34]);let g;for(g=0;g<f.length;g+=1){const k=Ki(h,f,g);d[g]?d[g].p(k,m):(d[g]=el(k),d[g].c(),d[g].m(o,null))}for(;g<d.length;g+=1)d[g].d(1);d.length=f.length}},d(h){h&&j(e),xe(d,h)}}}function sl(s){let e,t,n,i,l;return{c(){e=p("div"),t=p("h3"),t.textContent="Test Results:",n=v(),i=p("pre"),l=A(s[2]),u(t,"class","text-sm font-semibold mb-2 text-gray-100"),u(i,"class","text-xs text-gray-300 whitespace-pre-wrap font-mono max-h-64 overflow-y-auto"),u(e,"class","bg-gray-700 p-4 rounded-md")},m(r,o){B(r,e,o),a(e,t),a(e,n),a(e,i),a(i,l)},p(r,o){o[0]&4&&$(l,r[2])},d(r){r&&j(e)}}}function nl(s){let e,t;return e=new zo({props:{task:s[15],isOpen:s[14]}}),e.$on("close",Oo),{c(){kt(e.$$.fragment)},m(n,i){_t(e,n,i),t=!0},p(n,i){const l={};i[0]&32768&&(l.task=n[15]),i[0]&16384&&(l.isOpen=n[14]),e.$set(l)},i(n){t||(Te(e.$$.fragment,n),t=!0)},o(n){Ie(e.$$.fragment,n),t=!1},d(n){bt(e,n)}}}function Sa(s){let e,t,n,i,l,r,o,c,f,d,h,m,g,k,y,b,_,w,N,S,C,L,E,O,P,Y,z,I,G,V,F,X,q,U,ne,D,H,Q,x,M,ee,R,K,ae,T,W,ie,re,te,fe,ke=s[3]==="Running tests..."?"Running...":"Run Parser Tests",Se,oe,Oe,He,qe,Ke,Ue,Pe,Fe,Z,be,we,ce=s[0]&&Hi(s);function pe(J,le){return J[6]?ma:pa}let Ne=pe(s),_e=Ne(s),me=s[6]&&zi(s),Ce=s[4]&&Ji(s),ve=s[6]&&Gi(s),Le=s[17].enableAutoRefresh&&ya(s);const je=[ka,_a,ba],se=[];function he(J,le){return J[7]&&!J[6]?0:J[5]&&!J[6]?1:J[6]?2:-1}~(ee=he(s))&&(R=se[ee]=je[ee](s));let Ye=s[2]&&sl(s),Be=s[14]&&s[15]&&nl(s);return{c(){e=p("main"),ce&&ce.c(),t=v(),n=p("aside"),i=p("div"),l=p("h2"),r=A(s[8]),o=v(),c=p("p"),c.textContent="Visualize your project's backlog",f=v(),d=p("nav"),h=p("h3"),h.textContent="Phases",m=v(),_e.c(),g=v(),k=p("div"),y=p("div"),me&&me.c(),_=v(),w=p("div"),N=p("header"),S=p("div"),C=p("div"),L=p("button"),L.innerHTML='<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path></svg>',E=v(),O=p("div"),P=p("h1"),Y=A(s[8]),z=v(),I=p("p"),I.textContent="Visualization tool for PMaC project backlogs",G=v(),V=p("div"),Ce&&Ce.c(),F=v(),ve&&ve.c(),X=v(),Le&&Le.c(),q=v(),U=p("button"),ne=ue("svg"),D=ue("path"),Q=v(),x=p("div"),M=p("div"),R&&R.c(),K=v(),ae=p("div"),T=p("h2"),T.textContent="YAML Parser Testing",W=v(),ie=p("p"),ie.textContent="Test the PMaC backlog YAML parser with validation and error handling.",re=v(),te=p("div"),fe=p("button"),Se=A(ke),Oe=v(),He=p("span"),qe=A("Status: "),Ke=A(s[3]),Ue=v(),Ye&&Ye.c(),Pe=v(),Be&&Be.c(),Fe=vt(),u(l,"class","text-lg font-semibold text-gray-100 truncate"),u(c,"class","text-xs text-gray-400 mt-1 truncate"),u(i,"class","p-4 border-b border-gray-700 min-w-0"),u(h,"class","text-sm font-medium text-gray-300 mb-3 uppercase tracking-wide"),u(d,"class","flex-1 p-4"),u(y,"class","text-xs text-gray-400"),u(k,"class","p-4 border-t border-gray-700"),u(n,"class",b="w-64 bg-gray-800 border-r border-gray-700 flex flex-col flex-shrink-0 "+(s[0]?"fixed inset-y-0 left-0 z-50 md:relative md:z-auto":"hidden md:flex")),u(L,"class","md:hidden mr-4 p-2 rounded-md text-gray-400 hover:text-gray-100 hover:bg-gray-700 flex-shrink-0"),u(P,"class","text-xl font-bold text-gray-100 truncate"),u(I,"class","text-gray-400 text-sm truncate"),u(O,"class","min-w-0 flex-1"),u(C,"class","flex items-center min-w-0 flex-1"),u(D,"stroke-linecap","round"),u(D,"stroke-linejoin","round"),u(D,"stroke-width","2"),u(D,"d","M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0V9a8.002 8.002 0 0115.356 2M15 15v5h-.582M8.05 21.418A8.001 8.001 0 0019.418 15m0 0V15a8.002 8.002 0 00-15.356-2"),u(ne,"class",H="w-4 h-4 "+(s[7]?"animate-spin":"")),u(ne,"fill","none"),u(ne,"stroke","currentColor"),u(ne,"viewBox","0 0 24 24"),u(U,"class","text-gray-400 hover:text-gray-100 p-1 rounded-md hover:bg-gray-700 transition-colors"),U.disabled=s[7],u(U,"title","Refresh backlog data"),u(V,"class","flex items-center space-x-2 sm:space-x-4 flex-shrink-0"),u(S,"class","flex items-center justify-between min-w-0"),u(N,"class","bg-gray-800 border-b border-gray-700 p-4 min-w-0"),u(T,"class","text-xl font-semibold mb-4 text-gray-100"),u(ie,"class","text-gray-400 mb-4"),u(fe,"class","bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-md transition-colors disabled:opacity-50"),fe.disabled=oe=s[3]==="Running tests...",u(He,"class","text-sm text-gray-400"),u(te,"class","flex items-center gap-4 mb-4"),u(ae,"class","bg-gray-800 border border-gray-700 rounded-lg p-6 max-w-2xl hover:bg-gray-700 transition-colors"),u(M,"class","p-4 sm:p-6 max-w-full min-w-0"),u(x,"class","flex-1 overflow-y-auto overflow-x-hidden"),u(w,"class","flex-1 flex flex-col min-w-0"),u(e,"class","min-h-screen bg-gray-900 text-gray-100 flex overflow-x-hidden w-full")},m(J,le){B(J,e,le),ce&&ce.m(e,null),a(e,t),a(e,n),a(n,i),a(i,l),a(l,r),a(i,o),a(i,c),a(n,f),a(n,d),a(d,h),a(d,m),_e.m(d,null),a(n,g),a(n,k),a(k,y),me&&me.m(y,null),a(e,_),a(e,w),a(w,N),a(N,S),a(S,C),a(C,L),a(C,E),a(C,O),a(O,P),a(P,Y),a(O,z),a(O,I),a(S,G),a(S,V),Ce&&Ce.m(V,null),a(V,F),ve&&ve.m(V,null),a(V,X),Le&&Le.m(V,null),a(V,q),a(V,U),a(U,ne),a(ne,D),a(w,Q),a(w,x),a(x,M),~ee&&se[ee].m(M,null),a(M,K),a(M,ae),a(ae,T),a(ae,W),a(ae,ie),a(ae,re),a(ae,te),a(te,fe),a(fe,Se),a(te,Oe),a(te,He),a(He,qe),a(He,Ke),a(ae,Ue),Ye&&Ye.m(ae,null),B(J,Pe,le),Be&&Be.m(J,le),B(J,Fe,le),Z=!0,be||(we=[ge(L,"click",s[25]),ge(U,"click",s[26]),ge(fe,"click",s[19])],be=!0)},p(J,le){J[0]?ce?ce.p(J,le):(ce=Hi(J),ce.c(),ce.m(e,t)):ce&&(ce.d(1),ce=null),(!Z||le[0]&256)&&$(r,J[8]),Ne===(Ne=pe(J))&&_e?_e.p(J,le):(_e.d(1),_e=Ne(J),_e&&(_e.c(),_e.m(d,null))),J[6]?me?me.p(J,le):(me=zi(J),me.c(),me.m(y,null)):me&&(me.d(1),me=null),(!Z||le[0]&1&&b!==(b="w-64 bg-gray-800 border-r border-gray-700 flex flex-col flex-shrink-0 "+(J[0]?"fixed inset-y-0 left-0 z-50 md:relative md:z-auto":"hidden md:flex")))&&u(n,"class",b),(!Z||le[0]&256)&&$(Y,J[8]),J[4]?Ce?Ce.p(J,le):(Ce=Ji(J),Ce.c(),Ce.m(V,F)):Ce&&(Ce.d(1),Ce=null),J[6]?ve?ve.p(J,le):(ve=Gi(J),ve.c(),ve.m(V,X)):ve&&(ve.d(1),ve=null),J[17].enableAutoRefresh&&Le.p(J,le),(!Z||le[0]&128&&H!==(H="w-4 h-4 "+(J[7]?"animate-spin":"")))&&u(ne,"class",H),(!Z||le[0]&128)&&(U.disabled=J[7]);let Me=ee;ee=he(J),ee===Me?~ee&&se[ee].p(J,le):(R&&(rt(),Ie(se[Me],1,1,()=>{se[Me]=null}),ot()),~ee?(R=se[ee],R?R.p(J,le):(R=se[ee]=je[ee](J),R.c()),Te(R,1),R.m(M,K)):R=null),(!Z||le[0]&8)&&ke!==(ke=J[3]==="Running tests..."?"Running...":"Run Parser Tests")&&$(Se,ke),(!Z||le[0]&8&&oe!==(oe=J[3]==="Running tests..."))&&(fe.disabled=oe),(!Z||le[0]&8)&&$(Ke,J[3]),J[2]?Ye?Ye.p(J,le):(Ye=sl(J),Ye.c(),Ye.m(ae,null)):Ye&&(Ye.d(1),Ye=null),J[14]&&J[15]?Be?(Be.p(J,le),le[0]&49152&&Te(Be,1)):(Be=nl(J),Be.c(),Te(Be,1),Be.m(Fe.parentNode,Fe)):Be&&(rt(),Ie(Be,1,1,()=>{Be=null}),ot())},i(J){Z||(Te(R),Te(Be),Z=!0)},o(J){Ie(R),Ie(Be),Z=!1},d(J){J&&(j(e),j(Pe),j(Fe)),ce&&ce.d(),_e.d(),me&&me.d(),Ce&&Ce.d(),ve&&ve.d(),Le&&Le.d(),~ee&&se[ee].d(),Ye&&Ye.d(),Be&&Be.d(J),be=!1,ct(we)}}}function Ca(s,e,t){let n,i,l,r,o,c,f,d,h,m,g,k;Je(s,Xe,D=>t(20,r=D)),Je(s,bo,D=>t(8,o=D)),Je(s,Ge,D=>t(9,c=D)),Je(s,As,D=>t(10,f=D)),Je(s,zl,D=>t(11,d=D)),Je(s,Vl,D=>t(12,h=D)),Je(s,vo,D=>t(13,m=D)),Je(s,cn,D=>t(14,g=D)),Je(s,an,D=>t(15,k=D));let y=!1,b=!1;function _(D){Lo(D)}let w="",N="Ready to test",S=da(),C,L="";async function E(D=!1){D||Cn(!0);try{let H;try{const x=await fetch("/api/backlog");if(x.ok){const M=await x.json();H=M.content,t(4,L=M.path||"API endpoint")}else throw new Error("API endpoint not available")}catch{t(4,L=await fa(S.backlogPath));const M=await fetch(L);if(!M.ok)throw new Error(`Failed to load backlog from ${L}: ${M.status}`);H=await M.text()}const Q=os(H,{validateSchema:!0,strict:!1,allowPartial:!0});if(Q.success&&Q.data)So(Q.data),Q.warnings&&Q.warnings.length>0?(console.warn("Backlog loaded with warnings:",Q.warnings),Xe.update(x=>({...x,warnings:Q.warnings}))):Tn(null);else{const x=Q.error||"Failed to parse backlog YAML",M=Q.context?` (${Q.context})`:"";throw new Error(x+M)}}catch(H){let Q=H instanceof Error?H.message:"Unknown error loading backlog";H instanceof Error&&H.message.includes("Failed to load backlog")&&(Q=`Network error: Could not load backlog from ${L}. Please check your connection and file path.`),Tn(Q)}finally{D||Cn(!1)}}function O(){S.enableAutoRefresh&&S.refreshInterval>0&&(C=setInterval(()=>E(!0),S.refreshInterval))}Jt(async()=>{Io(),Mo(),await E(),O()}),Hs(()=>{C&&clearInterval(C)});function P(){t(2,w=""),t(3,N="Running tests...");const D=console.log,H=console.error;let Q="";console.log=(...x)=>{Q+=x.join(" ")+`
`,D(...x)},console.error=(...x)=>{Q+="ERROR: "+x.join(" ")+`
`,H(...x)};try{console.log("Running YAML parser tests...");const M=os(`
metadata:
project: "Test Project"
version: "1.0.0"
last_updated: "2025-01-15"
current_sprint: "test"
pmac_methodology: "test.md"
technical_requirements: "test.md"
decision_log: "test.md"
ai_instructions: "test.md"
phases:
test:
title: "Test Phase"
description: "Test description"
status: "active"
estimated_duration: "1 week"
tasks:
- id: "TEST-001"
title: "Test Task"
status: "ready"
priority: "medium"
estimated_hours: 4
requirements: ["Test requirement"]
dependencies: []
blocks: []
notes: []
`);M.success?console.log("✓ Valid YAML parsing test passed"):console.log("✗ Valid YAML parsing test failed:",M.error),os("invalid: yaml: content: [[[").success?console.log("✗ Invalid YAML handling test failed"):console.log("✓ Invalid YAML handling test passed"),os("").success?console.log("✗ Empty content handling test failed"):console.log("✓ Empty content handling test passed"),console.log("✅ Basic parser tests completed"),t(2,w=Q),t(3,N="Basic tests completed!")}catch(x){t(2,w=Q+`
Unexpected error: `+x),t(3,N="Tests failed with error")}finally{console.log=D,console.error=H}}const Y=()=>t(0,y=!1),z=D=>D.key==="Escape"&&t(0,y=!1),I=()=>{Us(null),Xe.update(D=>({...D,viewState:{...D.viewState,selection:{...D.viewState.selection,selectedPhase:null}}}))},G=D=>{Us(D),Xe.update(H=>({...H,viewState:{...H.viewState,selection:{...H.viewState.selection,selectedPhase:D}}}))},V=()=>t(0,y=!y),F=()=>E(!0),X=()=>E(),q=()=>t(1,b=!b),U=D=>D.key==="Enter"&&t(1,b=!b),ne=D=>_(D.detail.task);return s.$$.update=()=>{s.$$.dirty[0]&1048576&&t(7,n=r.isLoading),s.$$.dirty[0]&1048576&&t(6,i=r.backlog),s.$$.dirty[0]&1048576&&t(5,l=r.error)},[y,b,w,N,L,l,i,n,o,c,f,d,h,m,g,k,_,S,E,P,r,Y,z,I,G,V,F,X,q,U,ne]}class Ta extends ht{constructor(e){super(),pt(this,e,Ca,Sa,at,{},null,[-1,-1])}}const Jl=document.getElementById("app");Jl.innerHTML="";new Ta({target:Jl});
//# sourceMappingURL=index-DKrlT_Vg.js.map