@leitwerk-dev/ui 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/dist/assets/{ChronicleMarkdown-BLgtHeEE.js → ChronicleMarkdown-iH1VLv7x.js} +1 -1
  2. package/dist/assets/{FutureLaunchDetailPage-KrXSGzHM.js → FutureLaunchDetailPage-BJphZBFH.js} +1 -1
  3. package/dist/assets/{GenericLauncher-Cv38FByt.js → GenericLauncher-tr1to52a.js} +1 -1
  4. package/dist/assets/{HomePage-Cd3lEtwZ.js → HomePage-CSHVQefI.js} +1 -1
  5. package/dist/assets/{PageHeader-D6pP4hIh.js → PageHeader-C4j3zJKF.js} +1 -1
  6. package/dist/assets/{ProcessActionsMenu-1QySGNy9.js → ProcessActionsMenu-gNiZGUCZ.js} +1 -1
  7. package/dist/assets/ProcessDetailPage-CGyVxjeH.js +12 -0
  8. package/dist/assets/{ProcessFlowDiagram-BAh_M_rb.js → ProcessFlowDiagram-BX_Zjm2n.js} +1 -1
  9. package/dist/assets/{ProcessesPage-DtPweRU-.js → ProcessesPage-D3jjufse.js} +1 -1
  10. package/dist/assets/{ScheduleDateTimePicker-CQGvY-Rc.js → ScheduleDateTimePicker-D72J6EhE.js} +1 -1
  11. package/dist/assets/{SkillsPage-bXuv0kEE.js → SkillsPage-CcYm4ATy.js} +1 -1
  12. package/dist/assets/WatchersPage-Bac86WLp.js +1 -0
  13. package/dist/assets/api-HGtUzekR.js +1 -0
  14. package/dist/assets/{dist-B7WNbObw.js → dist-DVNpSD5l.js} +1 -1
  15. package/dist/assets/{index-C8qCggeq.js → index-ChVsVf6R.js} +3 -3
  16. package/dist/assets/{router.svelte-COr45o9R.js → router.svelte-C2wi6I7k.js} +1 -1
  17. package/dist/index.html +5 -5
  18. package/package.json +6 -6
  19. package/src/lib/api.ts +0 -3
  20. package/src/lib/format.ts +0 -2
  21. package/src/pages/ProcessDetailPage.svelte +8 -1
  22. package/src/pages/WatchersPage.svelte +8 -44
  23. package/dist/assets/ProcessDetailPage-BLuc7sjV.js +0 -12
  24. package/dist/assets/WatchersPage-DNyUsU1y.js +0 -1
  25. package/dist/assets/api-CqECFdii.js +0 -1
@@ -1,2 +1,2 @@
1
- import{$ as e,E as t,F as n,G as r,I as i,J as a,M as o,N as s,P as c,R as l,V as u,X as d,Y as f,d as p,dt as m,ft as h,gt as g,k as _,r as v,rt as y,tt as b,v as x,y as S,z as C}from"./index-client-BqF3_t3P.js";import"./api-CqECFdii.js";var w=null;function T(e){w=e}function E(e){if(!w||w.instanceId!==e)return null;let t=w;return w=null,t}function D(e){(!e||w?.instanceId===e)&&(w=null)}var O=Object.defineProperty,k=(e,t,n)=>t in e?O(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ee=(e,t)=>{for(var n in t)O(e,n,{get:t[n],enumerable:!0})},A=(e,t,n)=>k(e,typeof t==`symbol`?t:t+``,n),j={};ee(j,{Graph:()=>N,alg:()=>V,json:()=>R,version:()=>L});var te=Object.defineProperty,M=(e,t)=>{for(var n in t)te(e,n,{get:t[n],enumerable:!0})},N=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected=`directed`in e?e.directed:!0,this._isMultigraph=`multigraph`in e&&e.multigraph,this._isCompound=`compound`in e&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children[`\0`]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return typeof e==`function`?this._defaultNodeLabelFn=e:this._defaultNodeLabelFn=()=>e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(e=>{t===void 0?this.setNode(e):this.setNode(e,t)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=`\0`,this._children[e]={},this._children[`\0`][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(e=>{this.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error(`Cannot set parent in a non-compound graph`);if(t===void 0)t=`\0`;else{t+=``;for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw Error(`Setting `+t+` as parent of `+e+` would create a cycle`);this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!==`\0`)return t}}children(e=`\0`){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e===`\0`)return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t);for(let t of this.successors(e))n.add(t);return Array.from(n.values())}}isLeaf(e){let t;return t=this.isDirected()?this.successors(e):this.neighbors(e),t.length===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([n,r])=>{e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(e=>{t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,this.edge(e))});let n={},r=e=>{let i=this.parent(e);return!i||t.hasNode(i)?(n[e]=i??void 0,i??void 0):i in n?n[i]:r(i)};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,r(e))),t}setDefaultEdgeLabel(e){return typeof e==`function`?this._defaultEdgeLabelFn=e:this._defaultEdgeLabelFn=()=>e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((e,n)=>(t===void 0?this.setEdge(e,n):this.setEdge(e,n,t),n)),this}setEdge(e,t,n,r){let i,a,o,s,c=!1;typeof e==`object`&&e&&`v`in e?(i=e.v,a=e.w,o=e.name,arguments.length===2&&(s=t,c=!0)):(i=e,a=t,o=r,arguments.length>2&&(s=n,c=!0)),i=``+i,a=``+a,o!==void 0&&(o=``+o);let l=F(this._isDirected,i,a,o);if(l in this._edgeLabels)return c&&(this._edgeLabels[l]=s),this;if(o!==void 0&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(i),this.setNode(a),this._edgeLabels[l]=c?s:this._defaultEdgeLabelFn(i,a,o);let u=re(this._isDirected,i,a,o);return i=u.v,a=u.w,Object.freeze(u),this._edgeObjs[l]=u,ne(this._preds[a],i),ne(this._sucs[i],a),this._in[a][l]=u,this._out[i][l]=u,this._edgeCount++,this}edge(e,t,n){let r=arguments.length===1?I(this._isDirected,e):F(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(e,t,n){let r=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof r==`object`?r:{label:r}}hasEdge(e,t,n){return(arguments.length===1?I(this._isDirected,e):F(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let r=arguments.length===1?I(this._isDirected,e):F(this._isDirected,e,t,n),i=this._edgeObjs[r];if(i){let e=i.v,t=i.w;delete this._edgeLabels[r],delete this._edgeObjs[r],P(this._preds[t],e),P(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let r=Object.values(e);return n?r.filter(e=>e.v===t&&e.w===n||e.v===n&&e.w===t):r}};function ne(e,t){e[t]?e[t]++:e[t]=1}function P(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function F(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}return i+``+a+``+(r===void 0?`\0`:r)}function re(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}let o={v:i,w:a};return r&&(o.name=r),o}function I(e,t){return F(e,t.v,t.w,t.name)}var L=`4.0.1`,R={};M(R,{read:()=>ae,write:()=>z});function z(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:ie(e),edges:B(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function ie(e){return e.nodes().map(t=>{let n=e.node(t),r=e.parent(t),i={v:t};return n!==void 0&&(i.value=n),r!==void 0&&(i.parent=r),i})}function B(e){return e.edges().map(t=>{let n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function ae(e){let t=new N(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(e=>{t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(e=>{t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}var V={};M(V,{CycleException:()=>W,bellmanFord:()=>H,components:()=>ce,dijkstra:()=>U,dijkstraAll:()=>fe,findCycles:()=>me,floydWarshall:()=>ge,isAcyclic:()=>ye,postorder:()=>Ce,preorder:()=>we,prim:()=>Te,shortestPaths:()=>Ee,tarjan:()=>pe,topsort:()=>ve});var oe=()=>1;function H(e,t,n,r){return se(e,String(t),n||oe,r||function(t){return e.outEdges(t)})}function se(e,t,n,r){let i={},a,o=0,s=e.nodes(),c=function(e){let t=n(e);i[e.v].distance+t<i[e.w].distance&&(i[e.w]={distance:i[e.v].distance+t,predecessor:e.v},a=!0)},l=function(){s.forEach(function(e){r(e).forEach(function(t){let n=t.v===e?t.v:t.w,r=n===t.v?t.w:t.v;c({v:n,w:r})})})};s.forEach(function(e){i[e]={distance:e===t?0:1/0,predecessor:``}});let u=s.length;for(let e=1;e<u&&(a=!1,o++,l(),a);e++);if(o===u-1&&(a=!1,l(),a))throw Error(`The graph contains a negative weight cycle`);return i}function ce(e){let t={},n=[],r;function i(n){n in t||(t[n]=!0,r.push(n),e.successors(n).forEach(i),e.predecessors(n).forEach(i))}return e.nodes().forEach(function(e){r=[],i(e),r.length&&n.push(r)}),n}var le=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(e=>e.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw Error(`Queue underflow`);return this._arr[0].key}add(e,t){let n=this._keyIndices,r=String(e);if(!(r in n)){let e=this._arr,i=e.length;return n[r]=i,e.push({key:r,priority:t}),this._decrease(i),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw Error(`Key not found: ${e}`);let r=this._arr[n].priority;if(t>r)throw Error(`New priority is greater than current priority. Key: ${e} Old: ${r} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,r=n+1,i=e;n<t.length&&(i=t[n].priority<t[i].priority?n:i,r<t.length&&(i=t[r].priority<t[i].priority?r:i),i!==e&&(this._swap(e,i),this._heapify(i)))}_decrease(e){let t=this._arr,n=t[e].priority,r;for(;e!==0&&(r=e>>1,!(t[r].priority<n));)this._swap(e,r),e=r}_swap(e,t){let n=this._arr,r=this._keyIndices,i=n[e],a=n[t];n[e]=a,n[t]=i,r[a.key]=e,r[i.key]=t}},ue=()=>1;function U(e,t,n,r){return de(e,String(t),n||ue,r||function(t){return e.outEdges(t)})}function de(e,t,n,r){let i={},a=new le,o,s,c=function(e){let t=e.v===o?e.w:e.v,r=i[t],c=n(e),l=s.distance+c;if(c<0)throw Error(`dijkstra does not allow negative edge weights. Bad edge: `+e+` Weight: `+c);l<r.distance&&(r.distance=l,r.predecessor=o,a.decrease(t,l))};for(e.nodes().forEach(function(e){let n=e===t?0:1/0;i[e]={distance:n,predecessor:``},a.add(e,n)});a.size()>0&&(o=a.removeMin(),s=i[o],s.distance!==1/0);)r(o).forEach(c);return i}function fe(e,t,n){return e.nodes().reduce(function(r,i){return r[i]=U(e,i,t,n),r},{})}function pe(e){let t=0,n=[],r={},i=[];function a(o){let s=r[o]={onStack:!0,lowlink:t,index:t++};if(n.push(o),e.successors(o).forEach(function(e){e in r?r[e].onStack&&(s.lowlink=Math.min(s.lowlink,r[e].index)):(a(e),s.lowlink=Math.min(s.lowlink,r[e].lowlink))}),s.lowlink===s.index){let e=[],t;do t=n.pop(),r[t].onStack=!1,e.push(t);while(o!==t);i.push(e)}}return e.nodes().forEach(function(e){e in r||a(e)}),i}function me(e){return pe(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var he=()=>1;function ge(e,t,n){return _e(e,t||he,n||function(t){return e.outEdges(t)})}function _e(e,t,n){let r={},i=e.nodes();return i.forEach(function(e){r[e]={},r[e][e]={distance:0,predecessor:``},i.forEach(function(t){e!==t&&(r[e][t]={distance:1/0,predecessor:``})}),n(e).forEach(function(n){let i=n.v===e?n.w:n.v,a=t(n);r[e][i]={distance:a,predecessor:e}})}),i.forEach(function(e){let t=r[e];i.forEach(function(n){let a=r[n];i.forEach(function(n){let r=a[e],i=t[n],o=a[n],s=r.distance+i.distance;s<o.distance&&(o.distance=s,o.predecessor=i.predecessor)})})}),r}var W=class extends Error{constructor(...e){super(...e)}};function ve(e){let t={},n={},r=[];function i(a){if(a in n)throw new W;a in t||(n[a]=!0,t[a]=!0,e.predecessors(a).forEach(i),delete n[a],r.push(a))}if(e.sinks().forEach(i),Object.keys(t).length!==e.nodeCount())throw new W;return r}function ye(e){try{ve(e)}catch(e){if(e instanceof W)return!1;throw e}return!0}function be(e,t,n,r,i){Array.isArray(t)||(t=[t]);let a=(t=>(e.isDirected()?e.successors(t):e.neighbors(t))??[]),o={};return t.forEach(function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);i=xe(e,t,n===`post`,o,a,r,i)}),i}function xe(e,t,n,r,i,a,o){return t in r||(r[t]=!0,n||(o=a(o,t)),i(t).forEach(function(t){o=xe(e,t,n,r,i,a,o)}),n&&(o=a(o,t))),o}function Se(e,t,n){return be(e,t,n,function(e,t){return e.push(t),e},[])}function Ce(e,t){return Se(e,t,`post`)}function we(e,t){return Se(e,t,`pre`)}function Te(e,t){let n=new N,r={},i=new le,a;function o(e){let n=e.v===a?e.w:e.v,o=i.priority(n);if(o!==void 0){let s=t(e);s<o&&(r[n]=a,i.decrease(n,s))}}if(e.nodeCount()===0)return n;e.nodes().forEach(function(e){i.add(e,1/0),n.setNode(e)}),i.decrease(e.nodes()[0],0);let s=!1;for(;i.size()>0;){if(a=i.removeMin(),a in r)n.setEdge(a,r[a]);else{if(s)throw Error(`Input graph is not connected: `+e);s=!0}e.nodeEdges(a).forEach(o)}return n}function Ee(e,t,n,r){return De(e,t,n,r??(t=>e.outEdges(t)??[]))}function De(e,t,n,r){if(n===void 0)return U(e,t,n,r);let i=!1,a=e.nodes();for(let o=0;o<a.length;o++){let s=r(a[o]);for(let e=0;e<s.length;e++){let t=s[e],r=t.v===a[o]?t.v:t.w;n({v:r,w:r===t.v?t.w:t.v})<0&&(i=!0)}if(i)return H(e,t,n,r)}return U(e,t,n,r)}function G(e,t,n,r){let i=r;for(;e.hasNode(i);)i=Ve(r);return n.dummy=t,e.setNode(i,n),i}function Oe(e){let t=new N().setGraph(e.graph());return e.nodes().forEach(n=>t.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function ke(e){let t=new N({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function Ae(e,t){let n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);let c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function K(e){let t=J(Ie(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),i=r.rank;i!==void 0&&(t[i]||(t[i]=[]),t[i][r.order]=n)}),t}function je(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MAX_VALUE:n}),n=q(Math.min,t);e.nodes().forEach(t=>{let r=e.node(t);Object.hasOwn(r,`rank`)&&(r.rank-=n)})}function Me(e){let t=e.nodes().map(t=>e.node(t).rank).filter(e=>e!==void 0),n=q(Math.min,t),r=[];e.nodes().forEach(t=>{let i=e.node(t).rank-n;r[i]||(r[i]=[]),r[i].push(t)});let i=0,a=e.graph().nodeRankFactor;Array.from(r).forEach((t,n)=>{t===void 0&&n%a!==0?--i:t!==void 0&&i&&t.forEach(t=>e.node(t).rank+=i)})}function Ne(e,t,n,r){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),G(e,`border`,i,t)}function Pe(e,t=Fe){let n=[];for(let r=0;r<e.length;r+=t){let i=e.slice(r,r+t);n.push(i)}return n}var Fe=65535;function q(e,t){return t.length>Fe?e(...Pe(t).map(t=>e(...t))):e(...t)}function Ie(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MIN_VALUE:n});return q(Math.max,t)}function Le(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function Re(e,t){let n=Date.now();try{return t()}finally{console.log(e+` time: `+(Date.now()-n)+`ms`)}}function ze(e,t){return t()}var Be=0;function Ve(e){return e+(``+ ++Be)}function J(e,t,n=1){t??(t=e,e=0);let r=e=>e<t;n<0&&(r=e=>t<e);let i=[];for(let t=e;r(t);t+=n)i.push(t);return i}function Y(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}function X(e,t){let n;return n=typeof t==`string`?e=>e[t]:t,Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})}function He(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}var Z=`\0`,Ue=`3.0.0`,We=class{constructor(){A(this,`_sentinel`);let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return Ge(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&Ge(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,Ke)),n=n._prev;return`[`+e.join(`, `)+`]`}};function Ge(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Ke(e,t){if(e!==`_next`&&e!==`_prev`)return t}var qe=We,Je=()=>1;function Ye(e,t){if(e.nodeCount()<=1)return[];let n=Qe(e,t||Je);return Xe(n.graph,n.buckets,n.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w)||[])}function Xe(e,t,n){let r=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)Ze(e,t,n,o);for(;o=i.dequeue();)Ze(e,t,n,o);if(e.nodeCount()){for(let i=t.length-2;i>0;--i)if(o=t[i]?.dequeue(),o){r=r.concat(Ze(e,t,n,o,!0)||[]);break}}}return r}function Ze(e,t,n,r,i){let a=[],o=i?a:void 0;return(e.inEdges(r.v)||[]).forEach(r=>{let o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,$e(t,n,s)}),(e.outEdges(r.v)||[]).forEach(r=>{let i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,$e(t,n,o)}),e.removeNode(r.v),o}function Qe(e,t){let n=new N,r=0,i=0;e.nodes().forEach(e=>{n.setNode(e,{v:e,in:0,out:0})}),e.edges().forEach(e=>{let a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s);let c=n.node(e.v),l=n.node(e.w);i=Math.max(i,c.out+=o),r=Math.max(r,l.in+=o)});let a=et(i+r+3).map(()=>new qe),o=r+1;return n.nodes().forEach(e=>{$e(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function $e(e,t,n){var r,i,a;n.out?n.in?(a=e[n.out-n.in+t])==null||a.enqueue(n):(i=e[e.length-1])==null||i.enqueue(n):(r=e[0])==null||r.enqueue(n)}function et(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t}function tt(e){(e.graph().acyclicer===`greedy`?Ye(e,t(e)):nt(e)).forEach(t=>{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,Ve(`rev`))});function t(e){return t=>e.edge(t).weight}}function nt(e){let t=[],n={},r={};function i(a){Object.hasOwn(r,a)||(r[a]=!0,n[a]=!0,e.outEdges(a).forEach(e=>{Object.hasOwn(n,e.w)?t.push(e):i(e.w)}),delete n[a])}return e.nodes().forEach(i),t}function rt(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function it(e){e.graph().dummyChains=[],e.edges().forEach(t=>at(e,t))}function at(e,t){let n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a===r+1)return;e.removeEdge(t);let l,u,d;for(d=0,++r;r<a;++d,++r)s.points=[],u={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},l=G(e,`edge`,u,`_d`),r===c&&(u.width=s.width,u.height=s.height,u.dummy=`edge-label`,u.labelpos=s.labelpos),e.setEdge(n,l,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(l),n=l;e.setEdge(n,i,{weight:s.weight},o)}function ot(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function st(e){let t={};function n(r){let i=e.node(r);if(Object.hasOwn(t,r))return i.rank;t[r]=!0;let a=e.outEdges(r),o=a?a.map(t=>t==null?1/0:n(t.w)-e.edge(t).minlen):[],s=q(Math.min,o);return s===1/0&&(s=0),i.rank=s}e.sources().forEach(n)}function Q(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var ct=lt;function lt(e){let t=new N({directed:!1}),n=e.nodes();if(n.length===0)throw Error(`Graph must have at least one node`);let r=n[0],i=e.nodeCount();t.setNode(r,{});let a,o;for(;ut(t,e)<i&&(a=dt(t,e),a);)o=t.hasNode(a.v)?Q(e,a):-Q(e,a),ft(t,e,o);return t}function ut(e,t){function n(r){let i=t.nodeEdges(r);i&&i.forEach(i=>{let a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!Q(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return e.nodes().forEach(n),e.nodeCount()}function dt(e,t){return t.edges().reduce((n,r)=>{let i=1/0;return e.hasNode(r.v)!==e.hasNode(r.w)&&(i=Q(t,r)),i<n[0]?[i,r]:n},[1/0,null])[1]}function ft(e,t,n){e.nodes().forEach(e=>t.node(e).rank+=n)}var{preorder:pt,postorder:mt}=V,ht=$;$.initLowLimValues=yt,$.initCutValues=gt,$.calcCutValue=vt,$.leaveEdge=xt,$.enterEdge=St,$.exchangeEdges=Ct;function $(e){e=Oe(e),st(e);let t=ct(e);yt(t),gt(t,e);let n,r;for(;n=xt(t);)r=St(t,e,n),Ct(t,e,n,r)}function gt(e,t){let n=mt(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(n=>_t(e,t,n))}function _t(e,t,n){let r=e.node(n).parent,i=e.edge(n,r);i.cutvalue=vt(e,t,n)}function vt(e,t,n){let r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;a||=(i=!1,t.edge(r,n)),o=a.weight;let s=t.nodeEdges(n);return s&&s.forEach(a=>{let s=a.v===n,c=s?a.w:a.v;if(c!==r){let r=s===i,l=t.edge(a).weight;if(o+=r?l:-l,Tt(e,n,c)){let t=e.edge(n,c).cutvalue;o+=r?-t:t}}}),o}function yt(e,t){arguments.length<2&&(t=e.nodes()[0]),bt(e,{},1,t)}function bt(e,t,n,r,i){let a=n,o=e.node(r);t[r]=!0;let s=e.neighbors(r);return s&&s.forEach(i=>{Object.hasOwn(t,i)||(n=bt(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function xt(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function St(e,t,n){let r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);let a=e.node(r),o=e.node(i),s=a,c=!1;return a.lim>o.lim&&(s=o,c=!0),t.edges().filter(t=>c===Et(e,e.node(t.v),s)&&c!==Et(e,e.node(t.w),s)).reduce((e,n)=>Q(t,n)<Q(t,e)?n:e)}function Ct(e,t,n,r){let i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),yt(e),gt(e,t),wt(e,t)}function wt(e,t){let n=e.nodes().find(t=>!e.node(t).parent);if(!n)return;let r=pt(e,[n]);r=r.slice(1),r.forEach(n=>{let r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function Tt(e,t,n){return e.hasEdge(t,n)}function Et(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var Dt=Ot;function Ot(e){let t=e.graph().ranker;if(typeof t==`function`)return t(e);switch(t){case`network-simplex`:jt(e);break;case`tight-tree`:At(e);break;case`longest-path`:kt(e);break;case`none`:break;default:jt(e)}}var kt=st;function At(e){st(e),ct(e)}function jt(e){ht(e)}var Mt=Nt;function Nt(e){let t=Ft(e);e.graph().dummyChains.forEach(n=>{let r=e.node(n),i=r.edgeObj,a=Pt(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;for(;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(o[c+1]).minRank<=r.rank;)c++;l=o[c]}l!==void 0&&e.setParent(n,l),n=e.successors(n)[0]}})}function Pt(e,t,n,r){let i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c;c=n;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));let l=c,u=r;for(;(u=e.parent(u))!==l;)a.push(u);return{path:i.concat(a.reverse()),lca:l}}function Ft(e){let t={},n=0;function r(i){let a=n;e.children(i).forEach(r),t[i]={low:a,lim:n++}}return e.children(Z).forEach(r),t}function It(e){let t=G(e,`root`,{},`_root`),n=Rt(e),r=Object.values(n),i=q(Math.max,r)-1,a=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(t=>e.edge(t).minlen*=a);let o=zt(e)+1;e.children(Z).forEach(r=>Lt(e,t,a,o,i,n,r)),e.graph().nodeRankFactor=a}function Lt(e,t,n,r,i,a,o){let s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let c=Ne(e,`_bt`),l=Ne(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,s.forEach(s=>{Lt(e,t,n,r,i,a,s);let u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-(a[o]??0)+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+(a[o]??0)})}function Rt(e){let t={};function n(r,i){let a=e.children(r);a&&a.length&&a.forEach(e=>n(e,i+1)),t[r]=i}return e.children(Z).forEach(e=>n(e,1)),t}function zt(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function Bt(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}var Vt=Ht;function Ht(e){function t(n){let r=e.children(n),i=e.node(n);if(r.length&&r.forEach(t),Object.hasOwn(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,r=i.maxRank+1;t<r;++t)Ut(e,`borderLeft`,`_bl`,n,i,t),Ut(e,`borderRight`,`_br`,n,i,t)}}e.children(Z).forEach(t)}function Ut(e,t,n,r,i,a){let o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=G(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function Wt(e){let t=e.graph().rankdir?.toLowerCase();(t===`lr`||t===`rl`)&&Kt(e)}function Gt(e){let t=e.graph().rankdir?.toLowerCase();(t===`bt`||t===`rl`)&&Jt(e),(t===`lr`||t===`rl`)&&(Xt(e),Kt(e))}function Kt(e){e.nodes().forEach(t=>qt(e.node(t))),e.edges().forEach(t=>qt(e.edge(t)))}function qt(e){let t=e.width;e.width=e.height,e.height=t}function Jt(e){e.nodes().forEach(t=>Yt(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(Yt),Object.hasOwn(r,`y`)&&Yt(r)})}function Yt(e){e.y=-e.y}function Xt(e){e.nodes().forEach(t=>Zt(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(Zt),Object.hasOwn(r,`x`)&&Zt(r)})}function Zt(e){let t=e.x;e.x=e.y,e.y=t}function Qt(e){let t={},n=e.nodes().filter(t=>!e.children(t).length),r=n.map(t=>e.node(t).rank),i=J(q(Math.max,r)+1).map(()=>[]);function a(n){if(t[n])return;t[n]=!0;let r=e.node(n);i[r.rank].push(n);let o=e.successors(n);o&&o.forEach(a)}return n.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(a),i}function $t(e,t){let n=0;for(let r=1;r<t.length;++r)n+=en(e,t[r-1],t[r]);return n}function en(e,t,n){let r=He(n,n.map((e,t)=>t)),i=t.flatMap(t=>{let n=e.outEdges(t);return n?n.map(t=>({pos:r[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos):[]}),a=1;for(;a<n.length;)a<<=1;let o=2*a-1;--a;let s=Array(o).fill(0),c=0;return i.forEach(e=>{let t=e.pos+a;s[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n}),c}function tn(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(!n||!n.length)return{v:t};{let r=n.reduce((t,n)=>{let r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}})}function nn(e,t){let n={};return e.forEach((e,t)=>{let r={indegree:0,in:[],out:[],vs:[e.v],i:t};e.barycenter!==void 0&&(r.barycenter=e.barycenter,r.weight=e.weight),n[e.v]=r}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];t!==void 0&&r!==void 0&&(r.indegree++,t.out.push(r))}),rn(Object.values(n).filter(e=>!e.indegree))}function rn(e){let t=[];function n(e){return t=>{t.merged||(t.barycenter===void 0||e.barycenter===void 0||t.barycenter>=e.barycenter)&&an(e,t)}}function r(t){return n=>{n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return t.filter(e=>!e.merged).map(e=>Y(e,[`vs`,`i`,`barycenter`,`weight`]))}function an(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function on(e,t){let n=Le(e,e=>Object.hasOwn(e,`barycenter`)),r=n.lhs,i=n.rhs.sort((e,t)=>t.i-e.i),a=[],o=0,s=0,c=0;r.sort(cn(!!t)),c=sn(a,i,c),r.forEach(e=>{c+=e.vs.length,a.push(e.vs),o+=e.barycenter*e.weight,s+=e.weight,c=sn(a,i,c)});let l={vs:a.flat(1)};return s&&(l.barycenter=o/s,l.weight=s),l}function sn(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function cn(e){return(t,n)=>t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}function ln(e,t,n,r){let i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,c={};o&&(i=i.filter(e=>e!==o&&e!==s));let l=tn(e,i);l.forEach(t=>{if(e.children(t.v).length){let i=ln(e,t.v,n,r);c[t.v]=i,Object.hasOwn(i,`barycenter`)&&dn(t,i)}});let u=nn(l,n);un(u,c);let d=on(u,r);if(o&&s){d.vs=[o,d.vs,s].flat(1);let t=e.predecessors(o);if(t&&t.length){let n=e.node(t[0]),r=e.predecessors(s),i=e.node(r[0]);Object.hasOwn(d,`barycenter`)||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+n.order+i.order)/(d.weight+2),d.weight+=2}}return d}function un(e,t){e.forEach(e=>{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}function dn(e,t){e.barycenter===void 0?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function fn(e,t,n,r){r||=e.nodes();let i=pn(e),a=new N({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(t=>e.node(t));return r.forEach(r=>{let o=e.node(r),s=e.parent(r);if(o.rank===t||o.minRank<=t&&t<=o.maxRank){a.setNode(r),a.setParent(r,s||i);let c=e[n](r);c&&c.forEach(t=>{let n=t.v===r?t.w:t.v,i=a.edge(n,r),o=i===void 0?0:i.weight;a.setEdge(n,r,{weight:e.edge(t).weight+o})}),Object.hasOwn(o,`minRank`)&&a.setNode(r,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]})}}),a}function pn(e){let t;for(;e.hasNode(t=Ve(`_root`)););return t}function mn(e,t,n){let r={},i;n.forEach(n=>{let a=e.parent(n),o,s;for(;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function hn(e,t={}){if(typeof t.customOrder==`function`){t.customOrder(e,hn);return}let n=Ie(e),r=gn(e,J(1,n+1),`inEdges`),i=gn(e,J(n-1,-1,-1),`outEdges`),a=Qt(e);if(vn(e,a),t.disableOptimalOrderHeuristic)return;let o=1/0,s,c=t.constraints||[];for(let t=0,n=0;n<4;++t,++n){_n(t%2?r:i,t%4>=2,c),a=K(e);let l=$t(e,a);l<o?(n=0,s=Object.assign({},a),o=l):l===o&&(s=structuredClone(a))}vn(e,s)}function gn(e,t,n){let r=new Map,i=(e,t)=>{r.has(e)||r.set(e,[]),r.get(e).push(t)};for(let t of e.nodes()){let n=e.node(t);if(typeof n.rank==`number`&&i(n.rank,t),typeof n.minRank==`number`&&typeof n.maxRank==`number`)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&i(e,t)}return t.map(function(t){return fn(e,t,n,r.get(t)||[])})}function _n(e,t,n){let r=new N;e.forEach(function(e){n.forEach(e=>r.setEdge(e.left,e.right));let i=e.graph().root,a=ln(e,i,r,t);a.vs.forEach((t,n)=>e.node(t).order=n),mn(e,r,a.vs)})}function vn(e,t){Object.values(t).forEach(t=>t.forEach((t,n)=>e.node(t).order=n))}function yn(e,t){let n={};function r(t,r){let i=0,a=0,o=t.length,s=r[r.length-1];return r.forEach((t,c)=>{let l=xn(e,t),u=l?e.node(l).order:o;(l||t===s)&&(r.slice(a,c+1).forEach(t=>{let r=e.predecessors(t);r&&r.forEach(r=>{let a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&Sn(n,r,t)})}),a=c+1,i=u)}),r}return t.length&&t.reduce(r),n}function bn(e,t){let n={};function r(t,r,i,a,o){J(r,i).forEach(r=>{let i=t[r];if(i!==void 0&&e.node(i).dummy){let t=e.predecessors(i);t&&t.forEach(t=>{if(t===void 0)return;let r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&Sn(n,t,i)})}})}function i(t,n){let i=-1,a=-1,o=0;return n.forEach((s,c)=>{if(e.node(s).dummy===`border`){let t=e.predecessors(s);if(t&&t.length){let s=t[0];if(s===void 0)return;a=e.node(s).order,r(n,o,c,i,a),o=c,i=a}}r(n,o,n.length,a,t.length)}),n}return t.length&&t.reduce(i),n}function xn(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(t=>e.node(t).dummy)}}function Sn(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function Cn(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];return r!==void 0&&Object.hasOwn(r,n)}function wn(e,t,n,r){let i={},a={},o={};return t.forEach(e=>{e.forEach((e,t)=>{i[e]=e,a[e]=e,o[e]=t})}),t.forEach(e=>{let t=-1;e.forEach(e=>{let s=r(e);if(s&&s.length){let r=s.sort((e,t)=>{let n=o[e],r=o[t];return(n===void 0?0:n)-(r===void 0?0:r)}),c=(r.length-1)/2;for(let s=Math.floor(c),l=Math.ceil(c);s<=l;++s){let c=r[s];if(c===void 0)continue;let l=o[c];if(l!==void 0&&a[e]===e&&t<l&&!Cn(n,e,c)){let n=i[c];n!==void 0&&(a[c]=e,a[e]=i[e]=n,t=l)}}}})}),{root:i,align:a}}function Tn(e,t,n,r,i=!1){let a={},o=En(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){let n=o.nodes().slice(),r={},i=n.pop();for(;i;){if(r[i])e(i);else{r[i]=!0,n.push(i);for(let e of t(i))n.push(e)}i=n.pop()}}function l(e){let t=o.inEdges(e);t?a[e]=t.reduce((e,t)=>{let n=a[t.v]??0,r=o.edge(t);return Math.max(e,n+(r===void 0?0:r))},0):a[e]=0}function u(t){let n=o.outEdges(t),r=1/0;n&&(r=n.reduce((e,t)=>{let n=a[t.w],r=o.edge(t);return Math.min(e,(n===void 0?0:n)-(r===void 0?0:r))},1/0));let i=e.node(t);r!==1/0&&i.borderType!==s&&(a[t]=Math.max(a[t]===void 0?0:a[t],r))}function d(e){return o.predecessors(e)||[]}function f(e){return o.successors(e)||[]}return c(l,d),c(u,f),Object.keys(r).forEach(e=>{let t=n[e];t!==void 0&&(a[e]=a[t]??0)}),a}function En(e,t,n,r){let i=new N,a=e.graph(),o=jn(a.nodesep,a.edgesep,r);return t.forEach(t=>{let r;t.forEach(t=>{let a=n[t];if(a!==void 0){if(i.setNode(a),r!==void 0){let s=n[r];if(s!==void 0){let n=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),n||0))}}r=t}})}),i}function Dn(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,i=1/0;Object.entries(n).forEach(([t,n])=>{let a=Mn(e,t)/2;r=Math.max(n+a,r),i=Math.min(n-a,i)});let a=r-i;return a<t[0]&&(t=[a,n]),t},[1/0,null])[1]}function On(e,t){let n=Object.values(t),r=q(Math.min,n),i=q(Math.max,n);[`u`,`d`].forEach(n=>{[`l`,`r`].forEach(a=>{let o=n+a,s=e[o];if(!s||s===t)return;let c=Object.values(s),l=r-q(Math.min,c);a!==`l`&&(l=i-q(Math.max,c)),l&&(e[o]=X(s,e=>e+l))})})}function kn(e,t=void 0){let n=e.ul;return n?X(n,(n,r)=>{if(t){let n=e[t.toLowerCase()];if(n&&n[r]!==void 0)return n[r]}let i=Object.values(e).map(e=>{let t=e[r];return t===void 0?0:t}).sort((e,t)=>e-t);return((i[1]??0)+(i[2]??0))/2}):{}}function An(e){let t=K(e),n=Object.assign(yn(e,t),bn(e,t)),r={},i;return[`u`,`d`].forEach(a=>{i=a===`u`?t:Object.values(t).reverse(),[`l`,`r`].forEach(t=>{t===`r`&&(i=i.map(e=>Object.values(e).reverse()));let o=wn(e,i,n,t=>(a===`u`?e.predecessors(t):e.successors(t))||[]),s=Tn(e,i,o.root,o.align,t===`r`);t===`r`&&(s=X(s,e=>-e)),r[a+t]=s})}),On(r,Dn(e,r)),kn(r,e.graph().align)}function jn(e,t,n){return(r,i,a)=>{let o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.hasOwn(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2;break}if(l&&(c+=n?l:-l),l=void 0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.hasOwn(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2;break}return l&&(c+=n?l:-l),c}}function Mn(e,t){return e.node(t).width}function Nn(e){e=ke(e),Pn(e),Object.entries(An(e)).forEach(([t,n])=>e.node(t).x=n)}function Pn(e){let t=K(e),n=e.graph(),r=n.ranksep,i=n.rankalign,a=0;t.forEach(t=>{let n=t.reduce((t,n)=>{let r=e.node(n).height??0;return t>r?t:r},0);t.forEach(t=>{let r=e.node(t);i===`top`?r.y=a+r.height/2:i===`bottom`?r.y=a+n-r.height/2:r.y=a+n/2}),a+=n+r})}function Fn(e,t={}){let n=t.debugTiming?Re:ze;return n(`layout`,()=>{let r=n(` buildLayoutGraph`,()=>Kn(e));return n(` runLayout`,()=>In(r,n,t)),n(` updateInputGraph`,()=>Ln(e,r)),r})}function In(e,t,n){t(` makeSpaceForEdgeLabels`,()=>qn(e)),t(` removeSelfEdges`,()=>nr(e)),t(` acyclic`,()=>tt(e)),t(` nestingGraph.run`,()=>It(e)),t(` rank`,()=>Dt(ke(e))),t(` injectEdgeLabelProxies`,()=>Jn(e)),t(` removeEmptyRanks`,()=>Me(e)),t(` nestingGraph.cleanup`,()=>Bt(e)),t(` normalizeRanks`,()=>je(e)),t(` assignRankMinMax`,()=>Yn(e)),t(` removeEdgeLabelProxies`,()=>Xn(e)),t(` normalize.run`,()=>it(e)),t(` parentDummyChains`,()=>Mt(e)),t(` addBorderSegments`,()=>Vt(e)),t(` order`,()=>hn(e,n)),t(` insertSelfEdges`,()=>rr(e)),t(` adjustCoordinateSystem`,()=>Wt(e)),t(` position`,()=>Nn(e)),t(` positionSelfEdges`,()=>ir(e)),t(` removeBorderNodes`,()=>tr(e)),t(` normalize.undo`,()=>ot(e)),t(` fixupEdgeLabelCoords`,()=>$n(e)),t(` undoCoordinateSystem`,()=>Gt(e)),t(` translateGraph`,()=>Zn(e)),t(` assignNodeIntersects`,()=>Qn(e)),t(` reversePoints`,()=>er(e)),t(` acyclic.undo`,()=>rt(e))}function Ln(e,t){e.nodes().forEach(n=>{let r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,r.order=i.order,r.rank=i.rank,t.children(n).length&&(r.width=i.width,r.height=i.height))}),e.edges().forEach(n=>{let r=e.edge(n),i=t.edge(n);r.points=i.points,Object.hasOwn(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var Rn=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],zn={ranksep:50,edgesep:20,nodesep:50,rankdir:`TB`,rankalign:`center`},Bn=[`acyclicer`,`ranker`,`rankdir`,`align`,`rankalign`],Vn=[`width`,`height`,`rank`],Hn={width:0,height:0},Un=[`minlen`,`weight`,`width`,`height`,`labeloffset`],Wn={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},Gn=[`labelpos`];function Kn(e){let t=new N({multigraph:!0,compound:!0}),n=or(e.graph());return t.setGraph(Object.assign({},zn,ar(n,Rn),Y(n,Bn))),e.nodes().forEach(n=>{let r=ar(or(e.node(n)),Vn);Object.keys(Hn).forEach(e=>{r[e]===void 0&&(r[e]=Hn[e])}),t.setNode(n,r);let i=e.parent(n);i!==void 0&&t.setParent(n,i)}),e.edges().forEach(n=>{let r=or(e.edge(n));t.setEdge(n,Object.assign({},Wn,ar(r,Un),Y(r,Gn)))}),t}function qn(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function Jn(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v);G(e,`edge-proxy`,{rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t},`_ep`)}})}function Yn(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function Xn(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy===`edge-proxy`){let r=n;e.edge(r.e).labelRank=n.rank,e.removeNode(t)}})}function Zn(e){let t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){let a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}e.nodes().forEach(t=>c(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,`x`)&&c(n)}),t-=o,r-=s,e.nodes().forEach(n=>{let i=e.node(n);i.x-=t,i.y-=r}),e.edges().forEach(n=>{let i=e.edge(n);i.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(i,`x`)&&(i.x-=t),Object.hasOwn(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function Qn(e){e.edges().forEach(t=>{let n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(Ae(r,a)),n.points.push(Ae(i,o))})}function $n(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset;break}})}function er(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function tr(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy===`border`&&e.removeNode(t)})}function nr(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function rr(e){K(e).forEach(t=>{let n=0;t.forEach((t,r)=>{let i=e.node(t);i.order=r+n,(i.selfEdges||[]).forEach(t=>{G(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},`_se`)}),delete i.selfEdges})})}function ir(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy===`selfedge`){let r=n,i=e.node(r.e.v),a=i.x+i.width/2,o=i.y,s=n.x-a,c=i.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:a+2*s/3,y:o-c},{x:a+5*s/6,y:o-c},{x:a+s,y:o},{x:a+5*s/6,y:o+c},{x:a+2*s/3,y:o+c}],r.label.x=n.x,r.label.y=n.y}})}function ar(e,t){return X(Y(e,t),Number)}function or(e){let t={};return e&&Object.entries(e).forEach(([e,n])=>{typeof e==`string`&&(e=e.toLowerCase()),t[e]=n}),t}function sr(e){let t=K(e),n=new N({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(t=>{n.setNode(t,{label:t}),n.setParent(t,`layer`+e.node(t).rank)}),e.edges().forEach(e=>n.setEdge(e.v,e.w,{},e.name)),t.forEach((e,t)=>{let r=`layer`+t;n.setNode(r,{rank:`same`}),e.reduce((e,t)=>(n.setEdge(e,t,{style:`invis`}),t))}),n}var cr={graphlib:j,version:Ue,layout:Fn,debug:sr,util:{time:Re,notime:ze}},lr={charWidth:7.2,minNodeWidth:132,maxNodeWidth:280,nodeHeight:56,endNodeHeight:44,nodePaddingX:28,rankSep:56,nodeSep:36,edgeSep:18,edgeLabelCharWidth:6,edgeLabelHeight:18},ur=`__end__`;function dr(e){return`${ur}${e}`}function fr(e){return e===`completed`?`Completed`:`Aborted`}function pr(e){return e.length===0?``:e.length===1?e[0]:`${e.length} transitions`}function mr(e){switch(e){case`llm`:return`Agent turn`;case`human`:return`Operator decision`;case`external`:return`External wait`;case`automatic`:return`Automatic`;case`server_automatic`:return`Server step`}}function hr(e){switch(e){case`llm`:return`An AI agent does the work in this step, using its tools to plan, edit, or review.`;case`human`:return`You decide how the process continues by choosing one of the available actions.`;case`external`:return`The process pauses until an outside system or event reports back.`;case`automatic`:return`A deterministic step runs automatically in the workspace, with no AI or operator input.`;case`server_automatic`:return`The server runs this step automatically to prepare or finalize process state.`}}function gr(e,t,n=t.charWidth){let r=e.length*n+t.nodePaddingX*2;return Math.max(t.minNodeWidth,Math.min(t.maxNodeWidth,Math.round(r)))}function _r(e,t={}){let n={...lr,...t},r=new cr.graphlib.Graph({multigraph:!0});r.setGraph({rankdir:`TB`,ranksep:n.rankSep,nodesep:n.nodeSep,edgesep:n.edgeSep,marginx:12,marginy:12}),r.setDefaultEdgeLabel(()=>({}));let i=new Map;for(let t of e.nodes){i.set(t.turnId,t);let e=gr(t.description,n);r.setNode(t.turnId,{width:e,height:n.nodeHeight})}let a=new Set;for(let t of e.edges)t.lifecycleStatus!==null&&a.add(t.lifecycleStatus);for(let e of a){let t=fr(e);r.setNode(dr(e),{width:gr(t,n),height:n.endNodeHeight})}let o=new Map;for(let t of e.edges){let e=t.to??(t.lifecycleStatus?dr(t.lifecycleStatus):null);if(e===null||!r.hasNode(t.from)||!r.hasNode(e))continue;let n=`${t.from}|${e}|${t.kind}`,i=o.get(n);if(i){t.label&&!i.labels.includes(t.label)&&i.labels.push(t.label);continue}o.set(n,{from:t.from,target:e,kind:t.kind,labels:t.label?[t.label]:[]})}let s=new Map,c=0;for(let e of o.values()){let t=`e${c}`;c+=1;let i=pr(e.labels),a=i?{width:Math.round(i.length*n.edgeLabelCharWidth),height:n.edgeLabelHeight,labelpos:`c`}:{};r.setEdge(e.from,e.target,a,t),s.set(`${e.from}|${e.target}|${t}`,{kind:e.kind,labels:e.labels})}cr.layout(r);let l=r.graph(),u=[];for(let e of r.nodes()){let t=r.node(e);if(!t)continue;let n=i.get(e);if(n){u.push({id:e,kind:`turn`,x:t.x,y:t.y,width:t.width,height:t.height,title:n.description,subtitle:mr(n.turnType),role:n.role,turnType:n.turnType,lifecycleStatus:null,isEntry:n.isEntry});continue}let a=e.endsWith(`completed`)?`completed`:`aborted`;u.push({id:e,kind:`end`,x:t.x,y:t.y,width:t.width,height:t.height,title:fr(a),subtitle:`End state`,role:null,turnType:null,lifecycleStatus:a,isEntry:!1})}let d=[];for(let e of r.edges()){let t=r.edge(e);if(!t)continue;let n=s.get(`${e.v}|${e.w}|${e.name}`),i=(t.points??[]).map(e=>({x:e.x,y:e.y}));d.push({id:e.name??`${e.v}-${e.w}`,from:e.v,to:e.w,kind:n?.kind??`forward`,labels:n?.labels??[],points:i,labelX:typeof t.x==`number`?t.x:null,labelY:typeof t.y==`number`?t.y:null})}return{width:typeof l.width==`number`?l.width:0,height:typeof l.height==`number`?l.height:0,nodes:u,edges:d}}var vr=0,yr=n(`<span class="step-arrow svelte-1a1v0x8" aria-hidden="true">→</span>`),br=n(`<li class="flow-step svelte-1a1v0x8"><span class="step-chip svelte-1a1v0x8"> </span> <!></li>`),xr=n(`<li class="flow-step svelte-1a1v0x8" data-flow-end-state="completed"><span class="step-arrow svelte-1a1v0x8" aria-hidden="true">→</span> <span class="end-chip is-completed svelte-1a1v0x8">Completed</span></li>`),Sr=n(`<ol data-section="process-flow-diagram" data-flow-mode="happy" aria-label="Happy path"><!> <!></ol>`),Cr=i(`<marker viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M 0 0 L 10 5 L 0 10 z" class="svelte-1a1v0x8"></path></marker>`),wr=i(`<title> </title>`),Tr=i(`<g><rect class="flow-edge-label-bg svelte-1a1v0x8" y="-9" height="18" rx="5"></rect><text class="flow-edge-label-text svelte-1a1v0x8" x="0" y="0" dominant-baseline="middle" text-anchor="middle"> </text><!></g>`),Er=i(`<path fill="none"></path><!>`,1),Dr=i(`<rect class="flow-entry-tab svelte-1a1v0x8" x="0" y="0" height="3" rx="1.5"></rect>`),Or=i(`<text class="flow-box-subtitle svelte-1a1v0x8" text-anchor="middle" dominant-baseline="middle"> </text>`),kr=i(`<g role="listitem"><!><rect class="flow-box-rect svelte-1a1v0x8"></rect><!><text class="flow-box-title svelte-1a1v0x8" text-anchor="middle" dominant-baseline="middle"> </text><!></g>`),Ar=n(`<span class="flow-legend-item svelte-1a1v0x8"><span class="flow-legend-swatch is-branch svelte-1a1v0x8" aria-hidden="true"></span> Branch step</span>`),jr=n(`<span class="flow-legend-item svelte-1a1v0x8"><span class="flow-legend-line is-loopback svelte-1a1v0x8" aria-hidden="true"></span> Loops back</span>`),Mr=n(`<span class="flow-legend-item svelte-1a1v0x8"><span aria-hidden="true"></span> </span>`),Nr=n(`<figure class="process-flow-chart svelte-1a1v0x8" data-section="process-flow-diagram" data-flow-mode="full"><p class="sr-only"> </p> <div class="flow-svg-viewport svelte-1a1v0x8"><svg preserveAspectRatio="xMidYMid meet" class="flow-svg svelte-1a1v0x8" role="group" aria-label="Process flow chart"><defs></defs><g class="flow-edges" aria-hidden="true"></g><g class="flow-nodes" role="list" aria-label="Process steps"></g></svg></div> <figcaption class="flow-legend svelte-1a1v0x8"><span class="flow-legend-item svelte-1a1v0x8"><span class="flow-legend-swatch is-spine svelte-1a1v0x8" aria-hidden="true"></span> Happy path</span> <!> <!> <!></figcaption></figure>`),Pr=n(`<div><!></div>`),Fr=n(`<div class="flow-disclosure svelte-1a1v0x8" data-section="process-flow-disclosure"><div class="flow-disclosure-body svelte-1a1v0x8"><!></div> <button type="button" class="flow-toggle svelte-1a1v0x8" data-pressable="true"><span class="flow-toggle-label svelte-1a1v0x8"> </span> <span aria-hidden="true">›</span></button></div>`);function Ir(n,i){h(i,!0);let l=e=>{var n=Sr(),i=a(n);t(i,19,()=>u(A),e=>e.turnId,(e,t,n)=>{var i=br(),c=a(i),l=a(c,!0);g(c);var f=d(c,2),m=e=>{s(e,yr())};_(f,e=>{u(n)<u(A).length-1&&e(m)}),g(i),r(()=>{p(i,`data-flow-turn-id`,u(t).turnId),p(c,`data-turn-type`,u(t).turnType),o(l,u(t).description)}),s(e,i)});var c=d(i,2),l=e=>{s(e,xr())};_(c,e=>{u(j)&&e(l)}),g(n),r(()=>x(n,1,S([`process-flow`,E()&&`is-compact`]),`svelte-1a1v0x8`)),s(e,n)},w=e=>{var n=c(),i=f(n),l=e=>{var n=Nr(),i=a(n),c=a(i,!0);g(i);var l=d(i,2),m=a(l),h=a(m);t(h,20,()=>I,e=>e,(e,t)=>{var n=Cr();r(e=>{p(n,`id`,e),x(n,0,`flow-marker is-${t}`,`svelte-1a1v0x8`)},[()=>re(t)]),s(e,n)}),g(h);var v=d(h);t(v,21,()=>u(M).edges,e=>e.id,(e,t)=>{let n=y(()=>pr(u(t).labels));var i=Er(),c=f(i),l=d(c),m=e=>{var i=Tr(),c=a(i),l=d(c),f=a(l,!0);g(l);var m=d(l),h=e=>{var n=wr(),i=a(n,!0);g(n),r(e=>o(i,e),[()=>u(t).labels.join(`
1
+ import{$ as e,E as t,F as n,G as r,I as i,J as a,M as o,N as s,P as c,R as l,V as u,X as d,Y as f,d as p,dt as m,ft as h,gt as g,k as _,r as v,rt as y,tt as b,v as x,y as S,z as C}from"./index-client-BqF3_t3P.js";import"./api-HGtUzekR.js";var w=null;function T(e){w=e}function E(e){if(!w||w.instanceId!==e)return null;let t=w;return w=null,t}function D(e){(!e||w?.instanceId===e)&&(w=null)}var O=Object.defineProperty,k=(e,t,n)=>t in e?O(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ee=(e,t)=>{for(var n in t)O(e,n,{get:t[n],enumerable:!0})},A=(e,t,n)=>k(e,typeof t==`symbol`?t:t+``,n),j={};ee(j,{Graph:()=>N,alg:()=>V,json:()=>R,version:()=>L});var te=Object.defineProperty,M=(e,t)=>{for(var n in t)te(e,n,{get:t[n],enumerable:!0})},N=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected=`directed`in e?e.directed:!0,this._isMultigraph=`multigraph`in e&&e.multigraph,this._isCompound=`compound`in e&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children[`\0`]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return typeof e==`function`?this._defaultNodeLabelFn=e:this._defaultNodeLabelFn=()=>e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(e=>{t===void 0?this.setNode(e):this.setNode(e,t)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=`\0`,this._children[e]={},this._children[`\0`][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(e=>{this.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error(`Cannot set parent in a non-compound graph`);if(t===void 0)t=`\0`;else{t+=``;for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw Error(`Setting `+t+` as parent of `+e+` would create a cycle`);this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!==`\0`)return t}}children(e=`\0`){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e===`\0`)return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t);for(let t of this.successors(e))n.add(t);return Array.from(n.values())}}isLeaf(e){let t;return t=this.isDirected()?this.successors(e):this.neighbors(e),t.length===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([n,r])=>{e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(e=>{t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,this.edge(e))});let n={},r=e=>{let i=this.parent(e);return!i||t.hasNode(i)?(n[e]=i??void 0,i??void 0):i in n?n[i]:r(i)};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,r(e))),t}setDefaultEdgeLabel(e){return typeof e==`function`?this._defaultEdgeLabelFn=e:this._defaultEdgeLabelFn=()=>e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((e,n)=>(t===void 0?this.setEdge(e,n):this.setEdge(e,n,t),n)),this}setEdge(e,t,n,r){let i,a,o,s,c=!1;typeof e==`object`&&e&&`v`in e?(i=e.v,a=e.w,o=e.name,arguments.length===2&&(s=t,c=!0)):(i=e,a=t,o=r,arguments.length>2&&(s=n,c=!0)),i=``+i,a=``+a,o!==void 0&&(o=``+o);let l=F(this._isDirected,i,a,o);if(l in this._edgeLabels)return c&&(this._edgeLabels[l]=s),this;if(o!==void 0&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(i),this.setNode(a),this._edgeLabels[l]=c?s:this._defaultEdgeLabelFn(i,a,o);let u=re(this._isDirected,i,a,o);return i=u.v,a=u.w,Object.freeze(u),this._edgeObjs[l]=u,ne(this._preds[a],i),ne(this._sucs[i],a),this._in[a][l]=u,this._out[i][l]=u,this._edgeCount++,this}edge(e,t,n){let r=arguments.length===1?I(this._isDirected,e):F(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(e,t,n){let r=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof r==`object`?r:{label:r}}hasEdge(e,t,n){return(arguments.length===1?I(this._isDirected,e):F(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let r=arguments.length===1?I(this._isDirected,e):F(this._isDirected,e,t,n),i=this._edgeObjs[r];if(i){let e=i.v,t=i.w;delete this._edgeLabels[r],delete this._edgeObjs[r],P(this._preds[t],e),P(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let r=Object.values(e);return n?r.filter(e=>e.v===t&&e.w===n||e.v===n&&e.w===t):r}};function ne(e,t){e[t]?e[t]++:e[t]=1}function P(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function F(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}return i+``+a+``+(r===void 0?`\0`:r)}function re(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}let o={v:i,w:a};return r&&(o.name=r),o}function I(e,t){return F(e,t.v,t.w,t.name)}var L=`4.0.1`,R={};M(R,{read:()=>ae,write:()=>z});function z(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:ie(e),edges:B(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function ie(e){return e.nodes().map(t=>{let n=e.node(t),r=e.parent(t),i={v:t};return n!==void 0&&(i.value=n),r!==void 0&&(i.parent=r),i})}function B(e){return e.edges().map(t=>{let n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function ae(e){let t=new N(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(e=>{t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(e=>{t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}var V={};M(V,{CycleException:()=>W,bellmanFord:()=>H,components:()=>ce,dijkstra:()=>U,dijkstraAll:()=>fe,findCycles:()=>me,floydWarshall:()=>ge,isAcyclic:()=>ye,postorder:()=>Ce,preorder:()=>we,prim:()=>Te,shortestPaths:()=>Ee,tarjan:()=>pe,topsort:()=>ve});var oe=()=>1;function H(e,t,n,r){return se(e,String(t),n||oe,r||function(t){return e.outEdges(t)})}function se(e,t,n,r){let i={},a,o=0,s=e.nodes(),c=function(e){let t=n(e);i[e.v].distance+t<i[e.w].distance&&(i[e.w]={distance:i[e.v].distance+t,predecessor:e.v},a=!0)},l=function(){s.forEach(function(e){r(e).forEach(function(t){let n=t.v===e?t.v:t.w,r=n===t.v?t.w:t.v;c({v:n,w:r})})})};s.forEach(function(e){i[e]={distance:e===t?0:1/0,predecessor:``}});let u=s.length;for(let e=1;e<u&&(a=!1,o++,l(),a);e++);if(o===u-1&&(a=!1,l(),a))throw Error(`The graph contains a negative weight cycle`);return i}function ce(e){let t={},n=[],r;function i(n){n in t||(t[n]=!0,r.push(n),e.successors(n).forEach(i),e.predecessors(n).forEach(i))}return e.nodes().forEach(function(e){r=[],i(e),r.length&&n.push(r)}),n}var le=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(e=>e.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw Error(`Queue underflow`);return this._arr[0].key}add(e,t){let n=this._keyIndices,r=String(e);if(!(r in n)){let e=this._arr,i=e.length;return n[r]=i,e.push({key:r,priority:t}),this._decrease(i),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw Error(`Key not found: ${e}`);let r=this._arr[n].priority;if(t>r)throw Error(`New priority is greater than current priority. Key: ${e} Old: ${r} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,r=n+1,i=e;n<t.length&&(i=t[n].priority<t[i].priority?n:i,r<t.length&&(i=t[r].priority<t[i].priority?r:i),i!==e&&(this._swap(e,i),this._heapify(i)))}_decrease(e){let t=this._arr,n=t[e].priority,r;for(;e!==0&&(r=e>>1,!(t[r].priority<n));)this._swap(e,r),e=r}_swap(e,t){let n=this._arr,r=this._keyIndices,i=n[e],a=n[t];n[e]=a,n[t]=i,r[a.key]=e,r[i.key]=t}},ue=()=>1;function U(e,t,n,r){return de(e,String(t),n||ue,r||function(t){return e.outEdges(t)})}function de(e,t,n,r){let i={},a=new le,o,s,c=function(e){let t=e.v===o?e.w:e.v,r=i[t],c=n(e),l=s.distance+c;if(c<0)throw Error(`dijkstra does not allow negative edge weights. Bad edge: `+e+` Weight: `+c);l<r.distance&&(r.distance=l,r.predecessor=o,a.decrease(t,l))};for(e.nodes().forEach(function(e){let n=e===t?0:1/0;i[e]={distance:n,predecessor:``},a.add(e,n)});a.size()>0&&(o=a.removeMin(),s=i[o],s.distance!==1/0);)r(o).forEach(c);return i}function fe(e,t,n){return e.nodes().reduce(function(r,i){return r[i]=U(e,i,t,n),r},{})}function pe(e){let t=0,n=[],r={},i=[];function a(o){let s=r[o]={onStack:!0,lowlink:t,index:t++};if(n.push(o),e.successors(o).forEach(function(e){e in r?r[e].onStack&&(s.lowlink=Math.min(s.lowlink,r[e].index)):(a(e),s.lowlink=Math.min(s.lowlink,r[e].lowlink))}),s.lowlink===s.index){let e=[],t;do t=n.pop(),r[t].onStack=!1,e.push(t);while(o!==t);i.push(e)}}return e.nodes().forEach(function(e){e in r||a(e)}),i}function me(e){return pe(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var he=()=>1;function ge(e,t,n){return _e(e,t||he,n||function(t){return e.outEdges(t)})}function _e(e,t,n){let r={},i=e.nodes();return i.forEach(function(e){r[e]={},r[e][e]={distance:0,predecessor:``},i.forEach(function(t){e!==t&&(r[e][t]={distance:1/0,predecessor:``})}),n(e).forEach(function(n){let i=n.v===e?n.w:n.v,a=t(n);r[e][i]={distance:a,predecessor:e}})}),i.forEach(function(e){let t=r[e];i.forEach(function(n){let a=r[n];i.forEach(function(n){let r=a[e],i=t[n],o=a[n],s=r.distance+i.distance;s<o.distance&&(o.distance=s,o.predecessor=i.predecessor)})})}),r}var W=class extends Error{constructor(...e){super(...e)}};function ve(e){let t={},n={},r=[];function i(a){if(a in n)throw new W;a in t||(n[a]=!0,t[a]=!0,e.predecessors(a).forEach(i),delete n[a],r.push(a))}if(e.sinks().forEach(i),Object.keys(t).length!==e.nodeCount())throw new W;return r}function ye(e){try{ve(e)}catch(e){if(e instanceof W)return!1;throw e}return!0}function be(e,t,n,r,i){Array.isArray(t)||(t=[t]);let a=(t=>(e.isDirected()?e.successors(t):e.neighbors(t))??[]),o={};return t.forEach(function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);i=xe(e,t,n===`post`,o,a,r,i)}),i}function xe(e,t,n,r,i,a,o){return t in r||(r[t]=!0,n||(o=a(o,t)),i(t).forEach(function(t){o=xe(e,t,n,r,i,a,o)}),n&&(o=a(o,t))),o}function Se(e,t,n){return be(e,t,n,function(e,t){return e.push(t),e},[])}function Ce(e,t){return Se(e,t,`post`)}function we(e,t){return Se(e,t,`pre`)}function Te(e,t){let n=new N,r={},i=new le,a;function o(e){let n=e.v===a?e.w:e.v,o=i.priority(n);if(o!==void 0){let s=t(e);s<o&&(r[n]=a,i.decrease(n,s))}}if(e.nodeCount()===0)return n;e.nodes().forEach(function(e){i.add(e,1/0),n.setNode(e)}),i.decrease(e.nodes()[0],0);let s=!1;for(;i.size()>0;){if(a=i.removeMin(),a in r)n.setEdge(a,r[a]);else{if(s)throw Error(`Input graph is not connected: `+e);s=!0}e.nodeEdges(a).forEach(o)}return n}function Ee(e,t,n,r){return De(e,t,n,r??(t=>e.outEdges(t)??[]))}function De(e,t,n,r){if(n===void 0)return U(e,t,n,r);let i=!1,a=e.nodes();for(let o=0;o<a.length;o++){let s=r(a[o]);for(let e=0;e<s.length;e++){let t=s[e],r=t.v===a[o]?t.v:t.w;n({v:r,w:r===t.v?t.w:t.v})<0&&(i=!0)}if(i)return H(e,t,n,r)}return U(e,t,n,r)}function G(e,t,n,r){let i=r;for(;e.hasNode(i);)i=Ve(r);return n.dummy=t,e.setNode(i,n),i}function Oe(e){let t=new N().setGraph(e.graph());return e.nodes().forEach(n=>t.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function ke(e){let t=new N({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function Ae(e,t){let n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);let c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function K(e){let t=J(Ie(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),i=r.rank;i!==void 0&&(t[i]||(t[i]=[]),t[i][r.order]=n)}),t}function je(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MAX_VALUE:n}),n=q(Math.min,t);e.nodes().forEach(t=>{let r=e.node(t);Object.hasOwn(r,`rank`)&&(r.rank-=n)})}function Me(e){let t=e.nodes().map(t=>e.node(t).rank).filter(e=>e!==void 0),n=q(Math.min,t),r=[];e.nodes().forEach(t=>{let i=e.node(t).rank-n;r[i]||(r[i]=[]),r[i].push(t)});let i=0,a=e.graph().nodeRankFactor;Array.from(r).forEach((t,n)=>{t===void 0&&n%a!==0?--i:t!==void 0&&i&&t.forEach(t=>e.node(t).rank+=i)})}function Ne(e,t,n,r){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),G(e,`border`,i,t)}function Pe(e,t=Fe){let n=[];for(let r=0;r<e.length;r+=t){let i=e.slice(r,r+t);n.push(i)}return n}var Fe=65535;function q(e,t){return t.length>Fe?e(...Pe(t).map(t=>e(...t))):e(...t)}function Ie(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MIN_VALUE:n});return q(Math.max,t)}function Le(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function Re(e,t){let n=Date.now();try{return t()}finally{console.log(e+` time: `+(Date.now()-n)+`ms`)}}function ze(e,t){return t()}var Be=0;function Ve(e){return e+(``+ ++Be)}function J(e,t,n=1){t??(t=e,e=0);let r=e=>e<t;n<0&&(r=e=>t<e);let i=[];for(let t=e;r(t);t+=n)i.push(t);return i}function Y(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}function X(e,t){let n;return n=typeof t==`string`?e=>e[t]:t,Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})}function He(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}var Z=`\0`,Ue=`3.0.0`,We=class{constructor(){A(this,`_sentinel`);let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return Ge(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&Ge(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,Ke)),n=n._prev;return`[`+e.join(`, `)+`]`}};function Ge(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Ke(e,t){if(e!==`_next`&&e!==`_prev`)return t}var qe=We,Je=()=>1;function Ye(e,t){if(e.nodeCount()<=1)return[];let n=Qe(e,t||Je);return Xe(n.graph,n.buckets,n.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w)||[])}function Xe(e,t,n){let r=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)Ze(e,t,n,o);for(;o=i.dequeue();)Ze(e,t,n,o);if(e.nodeCount()){for(let i=t.length-2;i>0;--i)if(o=t[i]?.dequeue(),o){r=r.concat(Ze(e,t,n,o,!0)||[]);break}}}return r}function Ze(e,t,n,r,i){let a=[],o=i?a:void 0;return(e.inEdges(r.v)||[]).forEach(r=>{let o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,$e(t,n,s)}),(e.outEdges(r.v)||[]).forEach(r=>{let i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,$e(t,n,o)}),e.removeNode(r.v),o}function Qe(e,t){let n=new N,r=0,i=0;e.nodes().forEach(e=>{n.setNode(e,{v:e,in:0,out:0})}),e.edges().forEach(e=>{let a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s);let c=n.node(e.v),l=n.node(e.w);i=Math.max(i,c.out+=o),r=Math.max(r,l.in+=o)});let a=et(i+r+3).map(()=>new qe),o=r+1;return n.nodes().forEach(e=>{$e(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function $e(e,t,n){var r,i,a;n.out?n.in?(a=e[n.out-n.in+t])==null||a.enqueue(n):(i=e[e.length-1])==null||i.enqueue(n):(r=e[0])==null||r.enqueue(n)}function et(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t}function tt(e){(e.graph().acyclicer===`greedy`?Ye(e,t(e)):nt(e)).forEach(t=>{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,Ve(`rev`))});function t(e){return t=>e.edge(t).weight}}function nt(e){let t=[],n={},r={};function i(a){Object.hasOwn(r,a)||(r[a]=!0,n[a]=!0,e.outEdges(a).forEach(e=>{Object.hasOwn(n,e.w)?t.push(e):i(e.w)}),delete n[a])}return e.nodes().forEach(i),t}function rt(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function it(e){e.graph().dummyChains=[],e.edges().forEach(t=>at(e,t))}function at(e,t){let n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a===r+1)return;e.removeEdge(t);let l,u,d;for(d=0,++r;r<a;++d,++r)s.points=[],u={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},l=G(e,`edge`,u,`_d`),r===c&&(u.width=s.width,u.height=s.height,u.dummy=`edge-label`,u.labelpos=s.labelpos),e.setEdge(n,l,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(l),n=l;e.setEdge(n,i,{weight:s.weight},o)}function ot(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function st(e){let t={};function n(r){let i=e.node(r);if(Object.hasOwn(t,r))return i.rank;t[r]=!0;let a=e.outEdges(r),o=a?a.map(t=>t==null?1/0:n(t.w)-e.edge(t).minlen):[],s=q(Math.min,o);return s===1/0&&(s=0),i.rank=s}e.sources().forEach(n)}function Q(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var ct=lt;function lt(e){let t=new N({directed:!1}),n=e.nodes();if(n.length===0)throw Error(`Graph must have at least one node`);let r=n[0],i=e.nodeCount();t.setNode(r,{});let a,o;for(;ut(t,e)<i&&(a=dt(t,e),a);)o=t.hasNode(a.v)?Q(e,a):-Q(e,a),ft(t,e,o);return t}function ut(e,t){function n(r){let i=t.nodeEdges(r);i&&i.forEach(i=>{let a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!Q(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return e.nodes().forEach(n),e.nodeCount()}function dt(e,t){return t.edges().reduce((n,r)=>{let i=1/0;return e.hasNode(r.v)!==e.hasNode(r.w)&&(i=Q(t,r)),i<n[0]?[i,r]:n},[1/0,null])[1]}function ft(e,t,n){e.nodes().forEach(e=>t.node(e).rank+=n)}var{preorder:pt,postorder:mt}=V,ht=$;$.initLowLimValues=yt,$.initCutValues=gt,$.calcCutValue=vt,$.leaveEdge=xt,$.enterEdge=St,$.exchangeEdges=Ct;function $(e){e=Oe(e),st(e);let t=ct(e);yt(t),gt(t,e);let n,r;for(;n=xt(t);)r=St(t,e,n),Ct(t,e,n,r)}function gt(e,t){let n=mt(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(n=>_t(e,t,n))}function _t(e,t,n){let r=e.node(n).parent,i=e.edge(n,r);i.cutvalue=vt(e,t,n)}function vt(e,t,n){let r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;a||=(i=!1,t.edge(r,n)),o=a.weight;let s=t.nodeEdges(n);return s&&s.forEach(a=>{let s=a.v===n,c=s?a.w:a.v;if(c!==r){let r=s===i,l=t.edge(a).weight;if(o+=r?l:-l,Tt(e,n,c)){let t=e.edge(n,c).cutvalue;o+=r?-t:t}}}),o}function yt(e,t){arguments.length<2&&(t=e.nodes()[0]),bt(e,{},1,t)}function bt(e,t,n,r,i){let a=n,o=e.node(r);t[r]=!0;let s=e.neighbors(r);return s&&s.forEach(i=>{Object.hasOwn(t,i)||(n=bt(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function xt(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function St(e,t,n){let r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);let a=e.node(r),o=e.node(i),s=a,c=!1;return a.lim>o.lim&&(s=o,c=!0),t.edges().filter(t=>c===Et(e,e.node(t.v),s)&&c!==Et(e,e.node(t.w),s)).reduce((e,n)=>Q(t,n)<Q(t,e)?n:e)}function Ct(e,t,n,r){let i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),yt(e),gt(e,t),wt(e,t)}function wt(e,t){let n=e.nodes().find(t=>!e.node(t).parent);if(!n)return;let r=pt(e,[n]);r=r.slice(1),r.forEach(n=>{let r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function Tt(e,t,n){return e.hasEdge(t,n)}function Et(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var Dt=Ot;function Ot(e){let t=e.graph().ranker;if(typeof t==`function`)return t(e);switch(t){case`network-simplex`:jt(e);break;case`tight-tree`:At(e);break;case`longest-path`:kt(e);break;case`none`:break;default:jt(e)}}var kt=st;function At(e){st(e),ct(e)}function jt(e){ht(e)}var Mt=Nt;function Nt(e){let t=Ft(e);e.graph().dummyChains.forEach(n=>{let r=e.node(n),i=r.edgeObj,a=Pt(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;for(;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(o[c+1]).minRank<=r.rank;)c++;l=o[c]}l!==void 0&&e.setParent(n,l),n=e.successors(n)[0]}})}function Pt(e,t,n,r){let i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c;c=n;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));let l=c,u=r;for(;(u=e.parent(u))!==l;)a.push(u);return{path:i.concat(a.reverse()),lca:l}}function Ft(e){let t={},n=0;function r(i){let a=n;e.children(i).forEach(r),t[i]={low:a,lim:n++}}return e.children(Z).forEach(r),t}function It(e){let t=G(e,`root`,{},`_root`),n=Rt(e),r=Object.values(n),i=q(Math.max,r)-1,a=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(t=>e.edge(t).minlen*=a);let o=zt(e)+1;e.children(Z).forEach(r=>Lt(e,t,a,o,i,n,r)),e.graph().nodeRankFactor=a}function Lt(e,t,n,r,i,a,o){let s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let c=Ne(e,`_bt`),l=Ne(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,s.forEach(s=>{Lt(e,t,n,r,i,a,s);let u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-(a[o]??0)+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+(a[o]??0)})}function Rt(e){let t={};function n(r,i){let a=e.children(r);a&&a.length&&a.forEach(e=>n(e,i+1)),t[r]=i}return e.children(Z).forEach(e=>n(e,1)),t}function zt(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function Bt(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}var Vt=Ht;function Ht(e){function t(n){let r=e.children(n),i=e.node(n);if(r.length&&r.forEach(t),Object.hasOwn(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,r=i.maxRank+1;t<r;++t)Ut(e,`borderLeft`,`_bl`,n,i,t),Ut(e,`borderRight`,`_br`,n,i,t)}}e.children(Z).forEach(t)}function Ut(e,t,n,r,i,a){let o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=G(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function Wt(e){let t=e.graph().rankdir?.toLowerCase();(t===`lr`||t===`rl`)&&Kt(e)}function Gt(e){let t=e.graph().rankdir?.toLowerCase();(t===`bt`||t===`rl`)&&Jt(e),(t===`lr`||t===`rl`)&&(Xt(e),Kt(e))}function Kt(e){e.nodes().forEach(t=>qt(e.node(t))),e.edges().forEach(t=>qt(e.edge(t)))}function qt(e){let t=e.width;e.width=e.height,e.height=t}function Jt(e){e.nodes().forEach(t=>Yt(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(Yt),Object.hasOwn(r,`y`)&&Yt(r)})}function Yt(e){e.y=-e.y}function Xt(e){e.nodes().forEach(t=>Zt(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(Zt),Object.hasOwn(r,`x`)&&Zt(r)})}function Zt(e){let t=e.x;e.x=e.y,e.y=t}function Qt(e){let t={},n=e.nodes().filter(t=>!e.children(t).length),r=n.map(t=>e.node(t).rank),i=J(q(Math.max,r)+1).map(()=>[]);function a(n){if(t[n])return;t[n]=!0;let r=e.node(n);i[r.rank].push(n);let o=e.successors(n);o&&o.forEach(a)}return n.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(a),i}function $t(e,t){let n=0;for(let r=1;r<t.length;++r)n+=en(e,t[r-1],t[r]);return n}function en(e,t,n){let r=He(n,n.map((e,t)=>t)),i=t.flatMap(t=>{let n=e.outEdges(t);return n?n.map(t=>({pos:r[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos):[]}),a=1;for(;a<n.length;)a<<=1;let o=2*a-1;--a;let s=Array(o).fill(0),c=0;return i.forEach(e=>{let t=e.pos+a;s[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n}),c}function tn(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(!n||!n.length)return{v:t};{let r=n.reduce((t,n)=>{let r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}})}function nn(e,t){let n={};return e.forEach((e,t)=>{let r={indegree:0,in:[],out:[],vs:[e.v],i:t};e.barycenter!==void 0&&(r.barycenter=e.barycenter,r.weight=e.weight),n[e.v]=r}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];t!==void 0&&r!==void 0&&(r.indegree++,t.out.push(r))}),rn(Object.values(n).filter(e=>!e.indegree))}function rn(e){let t=[];function n(e){return t=>{t.merged||(t.barycenter===void 0||e.barycenter===void 0||t.barycenter>=e.barycenter)&&an(e,t)}}function r(t){return n=>{n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return t.filter(e=>!e.merged).map(e=>Y(e,[`vs`,`i`,`barycenter`,`weight`]))}function an(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function on(e,t){let n=Le(e,e=>Object.hasOwn(e,`barycenter`)),r=n.lhs,i=n.rhs.sort((e,t)=>t.i-e.i),a=[],o=0,s=0,c=0;r.sort(cn(!!t)),c=sn(a,i,c),r.forEach(e=>{c+=e.vs.length,a.push(e.vs),o+=e.barycenter*e.weight,s+=e.weight,c=sn(a,i,c)});let l={vs:a.flat(1)};return s&&(l.barycenter=o/s,l.weight=s),l}function sn(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function cn(e){return(t,n)=>t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}function ln(e,t,n,r){let i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,c={};o&&(i=i.filter(e=>e!==o&&e!==s));let l=tn(e,i);l.forEach(t=>{if(e.children(t.v).length){let i=ln(e,t.v,n,r);c[t.v]=i,Object.hasOwn(i,`barycenter`)&&dn(t,i)}});let u=nn(l,n);un(u,c);let d=on(u,r);if(o&&s){d.vs=[o,d.vs,s].flat(1);let t=e.predecessors(o);if(t&&t.length){let n=e.node(t[0]),r=e.predecessors(s),i=e.node(r[0]);Object.hasOwn(d,`barycenter`)||(d.barycenter=0,d.weight=0),d.barycenter=(d.barycenter*d.weight+n.order+i.order)/(d.weight+2),d.weight+=2}}return d}function un(e,t){e.forEach(e=>{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}function dn(e,t){e.barycenter===void 0?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function fn(e,t,n,r){r||=e.nodes();let i=pn(e),a=new N({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(t=>e.node(t));return r.forEach(r=>{let o=e.node(r),s=e.parent(r);if(o.rank===t||o.minRank<=t&&t<=o.maxRank){a.setNode(r),a.setParent(r,s||i);let c=e[n](r);c&&c.forEach(t=>{let n=t.v===r?t.w:t.v,i=a.edge(n,r),o=i===void 0?0:i.weight;a.setEdge(n,r,{weight:e.edge(t).weight+o})}),Object.hasOwn(o,`minRank`)&&a.setNode(r,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]})}}),a}function pn(e){let t;for(;e.hasNode(t=Ve(`_root`)););return t}function mn(e,t,n){let r={},i;n.forEach(n=>{let a=e.parent(n),o,s;for(;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function hn(e,t={}){if(typeof t.customOrder==`function`){t.customOrder(e,hn);return}let n=Ie(e),r=gn(e,J(1,n+1),`inEdges`),i=gn(e,J(n-1,-1,-1),`outEdges`),a=Qt(e);if(vn(e,a),t.disableOptimalOrderHeuristic)return;let o=1/0,s,c=t.constraints||[];for(let t=0,n=0;n<4;++t,++n){_n(t%2?r:i,t%4>=2,c),a=K(e);let l=$t(e,a);l<o?(n=0,s=Object.assign({},a),o=l):l===o&&(s=structuredClone(a))}vn(e,s)}function gn(e,t,n){let r=new Map,i=(e,t)=>{r.has(e)||r.set(e,[]),r.get(e).push(t)};for(let t of e.nodes()){let n=e.node(t);if(typeof n.rank==`number`&&i(n.rank,t),typeof n.minRank==`number`&&typeof n.maxRank==`number`)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&i(e,t)}return t.map(function(t){return fn(e,t,n,r.get(t)||[])})}function _n(e,t,n){let r=new N;e.forEach(function(e){n.forEach(e=>r.setEdge(e.left,e.right));let i=e.graph().root,a=ln(e,i,r,t);a.vs.forEach((t,n)=>e.node(t).order=n),mn(e,r,a.vs)})}function vn(e,t){Object.values(t).forEach(t=>t.forEach((t,n)=>e.node(t).order=n))}function yn(e,t){let n={};function r(t,r){let i=0,a=0,o=t.length,s=r[r.length-1];return r.forEach((t,c)=>{let l=xn(e,t),u=l?e.node(l).order:o;(l||t===s)&&(r.slice(a,c+1).forEach(t=>{let r=e.predecessors(t);r&&r.forEach(r=>{let a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&Sn(n,r,t)})}),a=c+1,i=u)}),r}return t.length&&t.reduce(r),n}function bn(e,t){let n={};function r(t,r,i,a,o){J(r,i).forEach(r=>{let i=t[r];if(i!==void 0&&e.node(i).dummy){let t=e.predecessors(i);t&&t.forEach(t=>{if(t===void 0)return;let r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&Sn(n,t,i)})}})}function i(t,n){let i=-1,a=-1,o=0;return n.forEach((s,c)=>{if(e.node(s).dummy===`border`){let t=e.predecessors(s);if(t&&t.length){let s=t[0];if(s===void 0)return;a=e.node(s).order,r(n,o,c,i,a),o=c,i=a}}r(n,o,n.length,a,t.length)}),n}return t.length&&t.reduce(i),n}function xn(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(t=>e.node(t).dummy)}}function Sn(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function Cn(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];return r!==void 0&&Object.hasOwn(r,n)}function wn(e,t,n,r){let i={},a={},o={};return t.forEach(e=>{e.forEach((e,t)=>{i[e]=e,a[e]=e,o[e]=t})}),t.forEach(e=>{let t=-1;e.forEach(e=>{let s=r(e);if(s&&s.length){let r=s.sort((e,t)=>{let n=o[e],r=o[t];return(n===void 0?0:n)-(r===void 0?0:r)}),c=(r.length-1)/2;for(let s=Math.floor(c),l=Math.ceil(c);s<=l;++s){let c=r[s];if(c===void 0)continue;let l=o[c];if(l!==void 0&&a[e]===e&&t<l&&!Cn(n,e,c)){let n=i[c];n!==void 0&&(a[c]=e,a[e]=i[e]=n,t=l)}}}})}),{root:i,align:a}}function Tn(e,t,n,r,i=!1){let a={},o=En(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){let n=o.nodes().slice(),r={},i=n.pop();for(;i;){if(r[i])e(i);else{r[i]=!0,n.push(i);for(let e of t(i))n.push(e)}i=n.pop()}}function l(e){let t=o.inEdges(e);t?a[e]=t.reduce((e,t)=>{let n=a[t.v]??0,r=o.edge(t);return Math.max(e,n+(r===void 0?0:r))},0):a[e]=0}function u(t){let n=o.outEdges(t),r=1/0;n&&(r=n.reduce((e,t)=>{let n=a[t.w],r=o.edge(t);return Math.min(e,(n===void 0?0:n)-(r===void 0?0:r))},1/0));let i=e.node(t);r!==1/0&&i.borderType!==s&&(a[t]=Math.max(a[t]===void 0?0:a[t],r))}function d(e){return o.predecessors(e)||[]}function f(e){return o.successors(e)||[]}return c(l,d),c(u,f),Object.keys(r).forEach(e=>{let t=n[e];t!==void 0&&(a[e]=a[t]??0)}),a}function En(e,t,n,r){let i=new N,a=e.graph(),o=jn(a.nodesep,a.edgesep,r);return t.forEach(t=>{let r;t.forEach(t=>{let a=n[t];if(a!==void 0){if(i.setNode(a),r!==void 0){let s=n[r];if(s!==void 0){let n=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),n||0))}}r=t}})}),i}function Dn(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,i=1/0;Object.entries(n).forEach(([t,n])=>{let a=Mn(e,t)/2;r=Math.max(n+a,r),i=Math.min(n-a,i)});let a=r-i;return a<t[0]&&(t=[a,n]),t},[1/0,null])[1]}function On(e,t){let n=Object.values(t),r=q(Math.min,n),i=q(Math.max,n);[`u`,`d`].forEach(n=>{[`l`,`r`].forEach(a=>{let o=n+a,s=e[o];if(!s||s===t)return;let c=Object.values(s),l=r-q(Math.min,c);a!==`l`&&(l=i-q(Math.max,c)),l&&(e[o]=X(s,e=>e+l))})})}function kn(e,t=void 0){let n=e.ul;return n?X(n,(n,r)=>{if(t){let n=e[t.toLowerCase()];if(n&&n[r]!==void 0)return n[r]}let i=Object.values(e).map(e=>{let t=e[r];return t===void 0?0:t}).sort((e,t)=>e-t);return((i[1]??0)+(i[2]??0))/2}):{}}function An(e){let t=K(e),n=Object.assign(yn(e,t),bn(e,t)),r={},i;return[`u`,`d`].forEach(a=>{i=a===`u`?t:Object.values(t).reverse(),[`l`,`r`].forEach(t=>{t===`r`&&(i=i.map(e=>Object.values(e).reverse()));let o=wn(e,i,n,t=>(a===`u`?e.predecessors(t):e.successors(t))||[]),s=Tn(e,i,o.root,o.align,t===`r`);t===`r`&&(s=X(s,e=>-e)),r[a+t]=s})}),On(r,Dn(e,r)),kn(r,e.graph().align)}function jn(e,t,n){return(r,i,a)=>{let o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.hasOwn(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2;break}if(l&&(c+=n?l:-l),l=void 0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.hasOwn(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2;break}return l&&(c+=n?l:-l),c}}function Mn(e,t){return e.node(t).width}function Nn(e){e=ke(e),Pn(e),Object.entries(An(e)).forEach(([t,n])=>e.node(t).x=n)}function Pn(e){let t=K(e),n=e.graph(),r=n.ranksep,i=n.rankalign,a=0;t.forEach(t=>{let n=t.reduce((t,n)=>{let r=e.node(n).height??0;return t>r?t:r},0);t.forEach(t=>{let r=e.node(t);i===`top`?r.y=a+r.height/2:i===`bottom`?r.y=a+n-r.height/2:r.y=a+n/2}),a+=n+r})}function Fn(e,t={}){let n=t.debugTiming?Re:ze;return n(`layout`,()=>{let r=n(` buildLayoutGraph`,()=>Kn(e));return n(` runLayout`,()=>In(r,n,t)),n(` updateInputGraph`,()=>Ln(e,r)),r})}function In(e,t,n){t(` makeSpaceForEdgeLabels`,()=>qn(e)),t(` removeSelfEdges`,()=>nr(e)),t(` acyclic`,()=>tt(e)),t(` nestingGraph.run`,()=>It(e)),t(` rank`,()=>Dt(ke(e))),t(` injectEdgeLabelProxies`,()=>Jn(e)),t(` removeEmptyRanks`,()=>Me(e)),t(` nestingGraph.cleanup`,()=>Bt(e)),t(` normalizeRanks`,()=>je(e)),t(` assignRankMinMax`,()=>Yn(e)),t(` removeEdgeLabelProxies`,()=>Xn(e)),t(` normalize.run`,()=>it(e)),t(` parentDummyChains`,()=>Mt(e)),t(` addBorderSegments`,()=>Vt(e)),t(` order`,()=>hn(e,n)),t(` insertSelfEdges`,()=>rr(e)),t(` adjustCoordinateSystem`,()=>Wt(e)),t(` position`,()=>Nn(e)),t(` positionSelfEdges`,()=>ir(e)),t(` removeBorderNodes`,()=>tr(e)),t(` normalize.undo`,()=>ot(e)),t(` fixupEdgeLabelCoords`,()=>$n(e)),t(` undoCoordinateSystem`,()=>Gt(e)),t(` translateGraph`,()=>Zn(e)),t(` assignNodeIntersects`,()=>Qn(e)),t(` reversePoints`,()=>er(e)),t(` acyclic.undo`,()=>rt(e))}function Ln(e,t){e.nodes().forEach(n=>{let r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,r.order=i.order,r.rank=i.rank,t.children(n).length&&(r.width=i.width,r.height=i.height))}),e.edges().forEach(n=>{let r=e.edge(n),i=t.edge(n);r.points=i.points,Object.hasOwn(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var Rn=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],zn={ranksep:50,edgesep:20,nodesep:50,rankdir:`TB`,rankalign:`center`},Bn=[`acyclicer`,`ranker`,`rankdir`,`align`,`rankalign`],Vn=[`width`,`height`,`rank`],Hn={width:0,height:0},Un=[`minlen`,`weight`,`width`,`height`,`labeloffset`],Wn={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},Gn=[`labelpos`];function Kn(e){let t=new N({multigraph:!0,compound:!0}),n=or(e.graph());return t.setGraph(Object.assign({},zn,ar(n,Rn),Y(n,Bn))),e.nodes().forEach(n=>{let r=ar(or(e.node(n)),Vn);Object.keys(Hn).forEach(e=>{r[e]===void 0&&(r[e]=Hn[e])}),t.setNode(n,r);let i=e.parent(n);i!==void 0&&t.setParent(n,i)}),e.edges().forEach(n=>{let r=or(e.edge(n));t.setEdge(n,Object.assign({},Wn,ar(r,Un),Y(r,Gn)))}),t}function qn(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function Jn(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v);G(e,`edge-proxy`,{rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t},`_ep`)}})}function Yn(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function Xn(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy===`edge-proxy`){let r=n;e.edge(r.e).labelRank=n.rank,e.removeNode(t)}})}function Zn(e){let t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){let a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}e.nodes().forEach(t=>c(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,`x`)&&c(n)}),t-=o,r-=s,e.nodes().forEach(n=>{let i=e.node(n);i.x-=t,i.y-=r}),e.edges().forEach(n=>{let i=e.edge(n);i.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(i,`x`)&&(i.x-=t),Object.hasOwn(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function Qn(e){e.edges().forEach(t=>{let n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(Ae(r,a)),n.points.push(Ae(i,o))})}function $n(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset;break}})}function er(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function tr(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy===`border`&&e.removeNode(t)})}function nr(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function rr(e){K(e).forEach(t=>{let n=0;t.forEach((t,r)=>{let i=e.node(t);i.order=r+n,(i.selfEdges||[]).forEach(t=>{G(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},`_se`)}),delete i.selfEdges})})}function ir(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy===`selfedge`){let r=n,i=e.node(r.e.v),a=i.x+i.width/2,o=i.y,s=n.x-a,c=i.height/2;e.setEdge(r.e,r.label),e.removeNode(t),r.label.points=[{x:a+2*s/3,y:o-c},{x:a+5*s/6,y:o-c},{x:a+s,y:o},{x:a+5*s/6,y:o+c},{x:a+2*s/3,y:o+c}],r.label.x=n.x,r.label.y=n.y}})}function ar(e,t){return X(Y(e,t),Number)}function or(e){let t={};return e&&Object.entries(e).forEach(([e,n])=>{typeof e==`string`&&(e=e.toLowerCase()),t[e]=n}),t}function sr(e){let t=K(e),n=new N({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(t=>{n.setNode(t,{label:t}),n.setParent(t,`layer`+e.node(t).rank)}),e.edges().forEach(e=>n.setEdge(e.v,e.w,{},e.name)),t.forEach((e,t)=>{let r=`layer`+t;n.setNode(r,{rank:`same`}),e.reduce((e,t)=>(n.setEdge(e,t,{style:`invis`}),t))}),n}var cr={graphlib:j,version:Ue,layout:Fn,debug:sr,util:{time:Re,notime:ze}},lr={charWidth:7.2,minNodeWidth:132,maxNodeWidth:280,nodeHeight:56,endNodeHeight:44,nodePaddingX:28,rankSep:56,nodeSep:36,edgeSep:18,edgeLabelCharWidth:6,edgeLabelHeight:18},ur=`__end__`;function dr(e){return`${ur}${e}`}function fr(e){return e===`completed`?`Completed`:`Aborted`}function pr(e){return e.length===0?``:e.length===1?e[0]:`${e.length} transitions`}function mr(e){switch(e){case`llm`:return`Agent turn`;case`human`:return`Operator decision`;case`external`:return`External wait`;case`automatic`:return`Automatic`;case`server_automatic`:return`Server step`}}function hr(e){switch(e){case`llm`:return`An AI agent does the work in this step, using its tools to plan, edit, or review.`;case`human`:return`You decide how the process continues by choosing one of the available actions.`;case`external`:return`The process pauses until an outside system or event reports back.`;case`automatic`:return`A deterministic step runs automatically in the workspace, with no AI or operator input.`;case`server_automatic`:return`The server runs this step automatically to prepare or finalize process state.`}}function gr(e,t,n=t.charWidth){let r=e.length*n+t.nodePaddingX*2;return Math.max(t.minNodeWidth,Math.min(t.maxNodeWidth,Math.round(r)))}function _r(e,t={}){let n={...lr,...t},r=new cr.graphlib.Graph({multigraph:!0});r.setGraph({rankdir:`TB`,ranksep:n.rankSep,nodesep:n.nodeSep,edgesep:n.edgeSep,marginx:12,marginy:12}),r.setDefaultEdgeLabel(()=>({}));let i=new Map;for(let t of e.nodes){i.set(t.turnId,t);let e=gr(t.description,n);r.setNode(t.turnId,{width:e,height:n.nodeHeight})}let a=new Set;for(let t of e.edges)t.lifecycleStatus!==null&&a.add(t.lifecycleStatus);for(let e of a){let t=fr(e);r.setNode(dr(e),{width:gr(t,n),height:n.endNodeHeight})}let o=new Map;for(let t of e.edges){let e=t.to??(t.lifecycleStatus?dr(t.lifecycleStatus):null);if(e===null||!r.hasNode(t.from)||!r.hasNode(e))continue;let n=`${t.from}|${e}|${t.kind}`,i=o.get(n);if(i){t.label&&!i.labels.includes(t.label)&&i.labels.push(t.label);continue}o.set(n,{from:t.from,target:e,kind:t.kind,labels:t.label?[t.label]:[]})}let s=new Map,c=0;for(let e of o.values()){let t=`e${c}`;c+=1;let i=pr(e.labels),a=i?{width:Math.round(i.length*n.edgeLabelCharWidth),height:n.edgeLabelHeight,labelpos:`c`}:{};r.setEdge(e.from,e.target,a,t),s.set(`${e.from}|${e.target}|${t}`,{kind:e.kind,labels:e.labels})}cr.layout(r);let l=r.graph(),u=[];for(let e of r.nodes()){let t=r.node(e);if(!t)continue;let n=i.get(e);if(n){u.push({id:e,kind:`turn`,x:t.x,y:t.y,width:t.width,height:t.height,title:n.description,subtitle:mr(n.turnType),role:n.role,turnType:n.turnType,lifecycleStatus:null,isEntry:n.isEntry});continue}let a=e.endsWith(`completed`)?`completed`:`aborted`;u.push({id:e,kind:`end`,x:t.x,y:t.y,width:t.width,height:t.height,title:fr(a),subtitle:`End state`,role:null,turnType:null,lifecycleStatus:a,isEntry:!1})}let d=[];for(let e of r.edges()){let t=r.edge(e);if(!t)continue;let n=s.get(`${e.v}|${e.w}|${e.name}`),i=(t.points??[]).map(e=>({x:e.x,y:e.y}));d.push({id:e.name??`${e.v}-${e.w}`,from:e.v,to:e.w,kind:n?.kind??`forward`,labels:n?.labels??[],points:i,labelX:typeof t.x==`number`?t.x:null,labelY:typeof t.y==`number`?t.y:null})}return{width:typeof l.width==`number`?l.width:0,height:typeof l.height==`number`?l.height:0,nodes:u,edges:d}}var vr=0,yr=n(`<span class="step-arrow svelte-1a1v0x8" aria-hidden="true">→</span>`),br=n(`<li class="flow-step svelte-1a1v0x8"><span class="step-chip svelte-1a1v0x8"> </span> <!></li>`),xr=n(`<li class="flow-step svelte-1a1v0x8" data-flow-end-state="completed"><span class="step-arrow svelte-1a1v0x8" aria-hidden="true">→</span> <span class="end-chip is-completed svelte-1a1v0x8">Completed</span></li>`),Sr=n(`<ol data-section="process-flow-diagram" data-flow-mode="happy" aria-label="Happy path"><!> <!></ol>`),Cr=i(`<marker viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M 0 0 L 10 5 L 0 10 z" class="svelte-1a1v0x8"></path></marker>`),wr=i(`<title> </title>`),Tr=i(`<g><rect class="flow-edge-label-bg svelte-1a1v0x8" y="-9" height="18" rx="5"></rect><text class="flow-edge-label-text svelte-1a1v0x8" x="0" y="0" dominant-baseline="middle" text-anchor="middle"> </text><!></g>`),Er=i(`<path fill="none"></path><!>`,1),Dr=i(`<rect class="flow-entry-tab svelte-1a1v0x8" x="0" y="0" height="3" rx="1.5"></rect>`),Or=i(`<text class="flow-box-subtitle svelte-1a1v0x8" text-anchor="middle" dominant-baseline="middle"> </text>`),kr=i(`<g role="listitem"><!><rect class="flow-box-rect svelte-1a1v0x8"></rect><!><text class="flow-box-title svelte-1a1v0x8" text-anchor="middle" dominant-baseline="middle"> </text><!></g>`),Ar=n(`<span class="flow-legend-item svelte-1a1v0x8"><span class="flow-legend-swatch is-branch svelte-1a1v0x8" aria-hidden="true"></span> Branch step</span>`),jr=n(`<span class="flow-legend-item svelte-1a1v0x8"><span class="flow-legend-line is-loopback svelte-1a1v0x8" aria-hidden="true"></span> Loops back</span>`),Mr=n(`<span class="flow-legend-item svelte-1a1v0x8"><span aria-hidden="true"></span> </span>`),Nr=n(`<figure class="process-flow-chart svelte-1a1v0x8" data-section="process-flow-diagram" data-flow-mode="full"><p class="sr-only"> </p> <div class="flow-svg-viewport svelte-1a1v0x8"><svg preserveAspectRatio="xMidYMid meet" class="flow-svg svelte-1a1v0x8" role="group" aria-label="Process flow chart"><defs></defs><g class="flow-edges" aria-hidden="true"></g><g class="flow-nodes" role="list" aria-label="Process steps"></g></svg></div> <figcaption class="flow-legend svelte-1a1v0x8"><span class="flow-legend-item svelte-1a1v0x8"><span class="flow-legend-swatch is-spine svelte-1a1v0x8" aria-hidden="true"></span> Happy path</span> <!> <!> <!></figcaption></figure>`),Pr=n(`<div><!></div>`),Fr=n(`<div class="flow-disclosure svelte-1a1v0x8" data-section="process-flow-disclosure"><div class="flow-disclosure-body svelte-1a1v0x8"><!></div> <button type="button" class="flow-toggle svelte-1a1v0x8" data-pressable="true"><span class="flow-toggle-label svelte-1a1v0x8"> </span> <span aria-hidden="true">›</span></button></div>`);function Ir(n,i){h(i,!0);let l=e=>{var n=Sr(),i=a(n);t(i,19,()=>u(A),e=>e.turnId,(e,t,n)=>{var i=br(),c=a(i),l=a(c,!0);g(c);var f=d(c,2),m=e=>{s(e,yr())};_(f,e=>{u(n)<u(A).length-1&&e(m)}),g(i),r(()=>{p(i,`data-flow-turn-id`,u(t).turnId),p(c,`data-turn-type`,u(t).turnType),o(l,u(t).description)}),s(e,i)});var c=d(i,2),l=e=>{s(e,xr())};_(c,e=>{u(j)&&e(l)}),g(n),r(()=>x(n,1,S([`process-flow`,E()&&`is-compact`]),`svelte-1a1v0x8`)),s(e,n)},w=e=>{var n=c(),i=f(n),l=e=>{var n=Nr(),i=a(n),c=a(i,!0);g(i);var l=d(i,2),m=a(l),h=a(m);t(h,20,()=>I,e=>e,(e,t)=>{var n=Cr();r(e=>{p(n,`id`,e),x(n,0,`flow-marker is-${t}`,`svelte-1a1v0x8`)},[()=>re(t)]),s(e,n)}),g(h);var v=d(h);t(v,21,()=>u(M).edges,e=>e.id,(e,t)=>{let n=y(()=>pr(u(t).labels));var i=Er(),c=f(i),l=d(c),m=e=>{var i=Tr(),c=a(i),l=d(c),f=a(l,!0);g(l);var m=d(l),h=e=>{var n=wr(),i=a(n,!0);g(n),r(e=>o(i,e),[()=>u(t).labels.join(`
2
2
  `)]),s(e,n)};_(m,e=>{u(t).labels.length>1&&e(h)}),g(i),r(()=>{x(i,0,S([`flow-edge-label`,u(t).labels.length>1&&`is-multi`]),`svelte-1a1v0x8`),p(i,`transform`,`translate(${u(t).labelX}, ${u(t).labelY})`),p(i,`data-flow-edge-label-from`,u(t).from),p(i,`data-flow-edge-label-to`,u(t).to),p(i,`data-flow-edge-label-count`,u(t).labels.length),p(c,`x`,-(u(n).length*3.4+6)),p(c,`width`,u(n).length*6.8+12),o(f,u(n))}),s(e,i)};_(l,e=>{u(n)&&u(t).labelX!==null&&u(t).labelY!==null&&e(m)}),r((e,n)=>{x(c,0,`flow-edge is-${u(t).kind}`,`svelte-1a1v0x8`),p(c,`d`,e),p(c,`marker-end`,n),p(c,`data-flow-edge-kind`,u(t).kind),p(c,`data-flow-edge-from`,u(t).from),p(c,`data-flow-edge-to`,u(t).to)},[()=>N(u(t)),()=>`url(#${re(u(t).kind)})`]),s(e,i)}),g(v);var b=d(v);t(b,21,()=>u(M).nodes,e=>e.id,(e,t)=>{var n=kr(),i=a(n),c=e=>{var n=wr(),i=a(n,!0);g(n),r(e=>o(i,e),[()=>hr(u(t).turnType)]),s(e,n)};_(i,e=>{u(t).kind===`turn`&&u(t).turnType&&e(c)});var l=d(i),f=d(l),m=e=>{var n=Dr();r(()=>p(n,`width`,u(t).width)),s(e,n)};_(f,e=>{u(t).isEntry&&e(m)});var h=d(f),v=a(h,!0);g(h);var y=d(h),b=e=>{var n=Or(),i=a(n,!0);g(n),r(()=>{p(n,`x`,u(t).width/2),p(n,`y`,u(t).height/2+10),o(i,u(t).subtitle)}),s(e,n)};_(y,e=>{u(t).kind===`turn`&&e(b)}),g(n),r((e,r)=>{x(n,0,e,`svelte-1a1v0x8`),p(n,`transform`,`translate(${u(t).x-u(t).width/2}, ${u(t).y-u(t).height/2})`),p(n,`data-flow-turn-id`,u(t).kind===`turn`?u(t).id:void 0),p(n,`data-flow-end-state`,u(t).kind===`end`?u(t).lifecycleStatus:void 0),p(n,`data-flow-node-role`,u(t).role??void 0),p(n,`aria-label`,r),p(l,`width`,u(t).width),p(l,`height`,u(t).height),p(l,`rx`,u(t).kind===`end`?9:13),p(h,`x`,u(t).width/2),p(h,`y`,u(t).kind===`end`?u(t).height/2:u(t).height/2-7),o(v,u(t).title)},[()=>S(ne(u(t))),()=>ae(u(t))]),s(e,n)}),g(b),g(m),g(l);var C=d(l,2),w=d(a(C),2),T=e=>{s(e,Ar())};_(w,e=>{u(z).length>0&&e(T)});var E=d(w,2),D=e=>{s(e,jr())},O=y(()=>u(ie).has(`loopback`));_(E,e=>{u(O)&&e(D)}),t(d(E,2),17,()=>u(B),e=>e.lifecycleStatus,(e,t)=>{var n=Mr(),i=a(n),c=d(i);g(n),r(()=>{x(i,1,`flow-legend-swatch is-end is-${u(t).lifecycleStatus}`,`svelte-1a1v0x8`),o(c,` ${u(t).lifecycleStatus===`completed`?`Completed`:`Aborted`}`)}),s(e,n)}),g(C),g(n),r(()=>{p(i,`id`,`${P}-desc`),o(c,u(oe)),p(m,`viewBox`,`0 0 ${u(M).width} ${u(M).height}`),p(m,`aria-describedby`,`${P}-desc`),p(C,`id`,V)}),s(e,n)};_(i,e=>{u(M)&&u(M).nodes.length>0&&e(l)}),s(e,n)},T=v(i,`mode`,3,`happy`),E=v(i,`compact`,3,!1),D=v(i,`expandable`,3,!1),O=b(!1),k=y(()=>i.flow??i.launcher?.processFlow??null),ee=y(()=>new Map((u(k)?.nodes??[]).map(e=>[e.turnId,e]))),A=y(()=>(u(k)?.spine??[]).map(e=>u(ee).get(e)).filter(e=>e!==void 0)),j=y(()=>(u(k)?.endStates??[]).find(e=>e.lifecycleStatus===`completed`)??null),te=y(()=>T()===`full`||D()&&u(O)),M=y(()=>u(k)&&u(te)?_r(u(k)):null);function N(e){let t=e.points;if(t.length===0)return``;if(t.length===1)return`M ${t[0].x} ${t[0].y}`;let n=`M ${t[0].x} ${t[0].y}`;for(let e=1;e<t.length-1;e+=1){let r=t[e],i=t[e+1],a=(r.x+i.x)/2,o=(r.y+i.y)/2;n+=` Q ${r.x} ${r.y} ${a} ${o}`}let r=t[t.length-1];return n+=` L ${r.x} ${r.y}`,n}function ne(e){return e.kind===`end`?`flow-box is-end is-${e.lifecycleStatus}`:`flow-box is-turn ${e.role===`spine`?`is-spine`:`is-branch`}`}let P=`process-flow-${vr++}`,F=`${P}-chart`;function re(e){return`${P}-arrow-${e}`}let I=[`forward`,`loopback`,`branch`,`terminal`],L=y(()=>u(k)!==null&&u(A).length>0),R=y(()=>u(k)!==null&&(u(M)?.nodes.length??0)>0),z=y(()=>(u(k)?.nodes??[]).filter(e=>e.role===`branch`)),ie=y(()=>new Set((u(M)?.edges??[]).map(e=>e.kind))),B=y(()=>u(k)?.endStates??[]);function ae(e){return e.kind===`end`?`End state: ${e.title}`:e.turnType?`${e.title}. ${mr(e.turnType)}. ${hr(e.turnType)}`:e.title}let V=`${P}-legend`,oe=y(()=>{if(!u(k))return``;let e=[],t=u(A).map(e=>e.description).join(`, then `);if(t&&e.push(`Happy path: ${t}.`),u(z).length>0&&e.push(`Branch and recovery steps: ${u(z).map(e=>e.description).join(`, `)}.`),u(B).length>0){let t=u(B).map(e=>e.lifecycleStatus===`completed`?`Completed`:`Aborted`).join(` or `);e.push(`Ends in: ${t}.`)}return e.join(` `)});var H=c(),se=f(H),ce=t=>{var n=Fr(),i=a(n),c=a(i),f=e=>{var t=Pr(),n=a(t);w(n),g(t),r(()=>p(t,`id`,F)),s(e,t)},m=e=>{l(e)};_(c,e=>{u(O)&&u(R)?e(f):e(m,-1)}),g(i);var h=d(i,2),v=a(h),y=a(v,!0);g(v);var b=d(v,2);g(h),g(n),r(()=>{p(h,`aria-expanded`,u(O)),p(h,`aria-controls`,F),o(y,u(O)?`Hide flow`:`Show full flow`),x(b,1,S([`flow-toggle-caret`,u(O)&&`is-open`]),`svelte-1a1v0x8`)}),C(`click`,h,()=>e(O,!u(O))),s(t,n)},le=e=>{l(e)},ue=e=>{w(e)};_(se,e=>{D()&&u(L)?e(ce):T()===`happy`&&u(L)?e(le,1):T()===`full`&&u(R)&&e(ue,2)}),s(n,H),m()}l([`click`]);export{T as i,D as n,E as r,Ir as t};
@@ -1 +1 @@
1
- import{$ as e,B as t,D as n,E as r,F as i,G as a,J as o,K as s,L as c,M as l,N as u,P as d,R as f,V as p,X as m,Y as h,Z as g,_t as ee,a as _,d as v,dt as te,ft as ne,g as re,gt as y,h as b,ht as ie,k as x,nt as S,ot as ae,p as oe,q as se,rt as C,st as ce,tt as w,u as le,v as T,vt as E,z as D}from"./index-client-BqF3_t3P.js";import{J as ue,K as de,X as O,Z as k,_t as fe,ct as A,dt as j,ht as pe,mt as M,yt as N}from"./api-CqECFdii.js";import{r as me,s as he,u as ge}from"./router.svelte-COr45o9R.js";import{b as _e,i as ve,r as ye,s as P,y as be}from"./index-C8qCggeq.js";import{t as xe}from"./browser-storage-LbKCyf_w.js";import{t as Se}from"./PageHeader-D6pP4hIh.js";import{r as Ce,t as we}from"./ProcessActionsMenu-1QySGNy9.js";var F=M([`all`,`running`,`scheduled`,`needs_attention`,`completed`,`aborted`]),I=j({key:M([`status`,`title`,`timeline`]),direction:M([`asc`,`desc`])}),L=j({status:F,processType:pe(N(),A(200)),sort:I}),R=`leitwerk.process-browser-view.v1`,z={status:`all`,processType:``,sort:{key:`timeline`,direction:`desc`}},Te={all:0,running:0,scheduled:0,needs_attention:0,completed:0,aborted:0};function Ee(e){try{let t=e?.getItem(R),n=t&&fe(L,JSON.parse(t));return n?.success?n.output:z}catch{return z}}function De(e,t){try{e?.setItem(R,JSON.stringify(t))}catch{}}function B(e){return e.lifecycleStatus===`completed`||e.lifecycleStatus===`aborted`?e.lifecycleStatus:e.lifecycleStatus===`error`||e.lifecycleStatus===`waiting`?`needs_attention`:`running`}function V(e){let t=O(e.lifecycleStatus);return e.selectedTurnId?`${t} · ${k(e.selectedTurnId)}`:t}function H(e){if(e.kind===`process`){let t=e.item;return{id:t.instanceId,kind:`process`,title:t.title,processId:t.processId,processDisplayName:t.processDisplayName?.trim()||de(t.processId),statusFilter:B(t),statusDetail:V(t),initialPrompt:t.initialPromptPreview,createdAt:t.createdAt,updatedAt:t.updatedAt,sortAt:t.statusCategory===`terminal`?t.closedAt??t.updatedAt??t.createdAt:t.updatedAt??t.createdAt,instanceId:t.instanceId,futureExecutionId:null,lifecycleStatus:t.lifecycleStatus}}let t=e.item;return{id:t.id,kind:`future`,title:t.title,processId:t.processId,processDisplayName:t.kind===`launch`&&t.launcherLabel||de(t.processId),statusFilter:`scheduled`,statusDetail:t.kind===`action`?`Scheduled action · ${t.actionLabel}`:t.scheduleKind===`cron`?`Recurring scheduled start`:`Scheduled start`,initialPrompt:t.initialPromptPreview,createdAt:null,updatedAt:t.nextRunAt,sortAt:t.nextRunAt,instanceId:t.instanceId,futureExecutionId:t.kind===`launch`?t.id:null,lifecycleStatus:null}}function Oe(e){return e.map(H)}function ke(e){return e.status!==`all`||e.query.trim()!==``||e.processType!==``}var Ae=i(`<button type="button" data-pressable="true"><span> </span> <span class="chip-count svelte-m0hp6c"> </span></button>`),je=i(`<button type="button"><span> </span> <span class="sort-arrow svelte-m0hp6c" aria-hidden="true"><!></span></button>`),Me=i(`<option> </option>`),Ne=i(`<button type="button" class="reset-view-button svelte-m0hp6c" data-pressable="true">Clear filters</button>`),Pe=i(`<div class="state-banner svelte-m0hp6c" role="status" data-state="process-list-error"><p class="svelte-m0hp6c">Process list couldn’t refresh. Existing results may be out of date.</p> <button type="button" data-pressable="true" class="svelte-m0hp6c">Try again</button></div>`),Fe=i(`<div class="skeleton-row svelte-m0hp6c"></div>`),Ie=i(`<div class="skeleton-list svelte-m0hp6c" data-state="processes-loading" role="status"></div>`),Le=i(`<div class="empty-state svelte-m0hp6c" data-state="processes-no-results"><h2 class="svelte-m0hp6c">No processes match these filters</h2> <p class="svelte-m0hp6c">Change the search or filters to see more process records.</p> <button type="button" class="clear-button svelte-m0hp6c" data-pressable="true">Clear search and filters</button></div>`),Re=i(`<div class="empty-state svelte-m0hp6c" data-state="processes-empty"><h2 class="svelte-m0hp6c">No process records yet</h2> <p class="svelte-m0hp6c">Started and scheduled processes will appear here.</p></div>`),ze=i(`<span class="muted svelte-m0hp6c">No initial prompt captured</span>`),Be=i(`<span class="future-action-note svelte-m0hp6c">Scheduled start</span>`),Ve=i(`<article class="process-browser-row svelte-m0hp6c" data-process-browser-row=""><a class="row-main svelte-m0hp6c" data-pressable="true"><span aria-hidden="true"> </span> <span class="row-process svelte-m0hp6c"><span class="row-title svelte-m0hp6c"> </span> <span class="row-meta svelte-m0hp6c"> </span></span> <span class="prompt-cell svelte-m0hp6c"><!></span> <span class="time-cell svelte-m0hp6c"> </span></a> <div class="row-actions svelte-m0hp6c"><!></div></article>`),He=i(`<div class="process-table svelte-m0hp6c" data-section="process-browser-results"></div>`),Ue=i(`<div class="pagination-row svelte-m0hp6c"><button type="button" class="show-more-button svelte-m0hp6c" data-pressable="true">Show more</button></div>`),We=i(`<section class="processes-page svelte-m0hp6c" data-section="all-processes-page"><!> <div class="browser-panel svelte-m0hp6c" data-section="process-browser"><div class="browser-toolbar svelte-m0hp6c" data-section="process-browse-controls"><label class="search-field svelte-m0hp6c"><span class="sr-only svelte-m0hp6c">Search</span> <input type="search" placeholder="Search processes by title or prompt" aria-label="Search processes by title or prompt" class="svelte-m0hp6c"/></label> <label class="type-filter svelte-m0hp6c"><span class="sr-only svelte-m0hp6c">Process type</span> <select data-filter="process-type" class="svelte-m0hp6c"><option>All process types</option><!><!></select></label> <p class="result-count svelte-m0hp6c" aria-live="polite"><span class="svelte-m0hp6c"> </span> </p> <!> <button type="button" class="refresh-button svelte-m0hp6c" data-action="refresh-processes" data-pressable="true"> </button></div> <div class="filter-row svelte-m0hp6c" role="group" aria-label="Process status filters"><span class="filter-row-label svelte-m0hp6c">Status</span> <div class="filter-group svelte-m0hp6c"><!></div> <div class="filter-group archive-group svelte-m0hp6c"><!></div></div> <!> <div class="process-table-shell svelte-m0hp6c"><div class="process-table-heading svelte-m0hp6c"><!> <!> <span class="prompt-heading svelte-m0hp6c">Initial prompt</span> <!> <span class="actions-heading svelte-m0hp6c">Actions</span></div> <!></div> <!></div></section>`);function Ge(i,f){ne(f,!0);let de=()=>ce(ye,`$browseItems`,k),O=()=>ce(ve,`$browseState`,k),[k,fe]=ae(),A=(e,t=E,n)=>{let i=S(()=>ee(n?.(),!1));var s=d();r(h(s),17,t,e=>e.value,(e,t)=>{var n=Ae();let r;var s=o(n),c=o(s,!0);y(s);var d=m(s,2),f=o(d,!0);y(d),y(n),a(()=>{r=T(n,1,`filter-chip svelte-m0hp6c`,null,r,{"archive-chip":p(i),"is-active":p(R)===p(t).value}),v(n,`data-filter-status`,p(t).value),v(n,`aria-pressed`,p(R)===p(t).value),l(c,p(t).label),l(f,p(Ke)[p(t).value])}),D(`click`,n,()=>$e(p(t).value)),u(e,n)}),u(e,s)},j=(e,t=E,n=E)=>{var r=je();let i;var s=o(r),d=o(s,!0);y(s);var f=m(s,2),h=o(f),g=e=>{var t=c();a(()=>l(t,p(B).direction===`asc`?`↑`:`↓`)),u(e,t)},ee=e=>{u(e,c(`↕`))};x(h,e=>{p(B).key===t()?e(g):e(ee,-1)}),y(f),y(r),a(e=>{i=T(r,1,`column-sort svelte-m0hp6c`,null,i,{"is-active":p(B).key===t()}),v(r,`data-sort-key`,t()),v(r,`aria-label`,e),l(d,n())},[()=>Xe(t(),n())]),D(`click`,r,()=>Ze(t())),u(e,r)},pe=[{value:`all`,label:`All`},{value:`running`,label:`Running`},{value:`scheduled`,label:`Scheduled`},{value:`needs_attention`,label:`Needs attention`}],M=[{value:`completed`,label:`Completed`},{value:`aborted`,label:`Aborted`}],N=xe(),F=Ee(N),I=w(null),L=w(``),R=w(g(F.status)),z=w(g(F.processType)),B=w(g(F.sort)),V=C(()=>Oe(de())),H=C(()=>O().facets?.processTypes??[]),Ge=C(()=>({status:p(R),query:p(L),processType:p(z)})),Ke=C(()=>O().facets?.statusCounts??Te),qe=C(()=>!!O().pagination?.hasMore),Je=C(()=>(O().pagination?.processTotal??0)+(O().pagination?.futureExecutionTotal??0)),Ye=C(()=>ke(p(Ge)));function U(e=100,t){return{limit:e,...t===void 0?{}:{offset:t},query:p(L),status:p(R),processType:p(z),sortKey:p(B).key,sortDirection:p(B).direction}}s(()=>{De(N,{status:p(R),processType:p(z),sort:p(B)})}),s(()=>{let e=setTimeout(()=>void P(U()),p(L).trim()?180:0);return()=>clearTimeout(e)});function Xe(e,t){if(p(B).key!==e)return`Sort by ${t}`;let n=p(B).direction===`asc`?`descending`:`ascending`;return`${t}, sorted ${p(B).direction===`asc`?`ascending`:`descending`}. Activate to sort ${n}.`}function Ze(t){p(B).key===t?e(B,{key:t,direction:p(B).direction===`asc`?`desc`:`asc`},!0):e(B,{key:t,direction:t===`title`?`asc`:`desc`},!0)}function Qe(t){e(L,t.currentTarget.value,!0)}function $e(t){e(R,t,!0)}function et(t){e(z,t.currentTarget.value,!0)}function tt(){e(L,``),e(R,`all`),e(z,``),p(I)?.focus()}function nt(){let e=O().pagination;e&&P(U(e.limit,p(V).length),{append:!0})}function W(){P(U())}function rt(e){return e.kind===`future`&&e.futureExecutionId?he(e.futureExecutionId):ge(e.instanceId??e.id)}function it(e,t){t.preventDefault(),me(rt(e))}function at(e){switch(e.statusFilter){case`running`:return`R`;case`scheduled`:return`S`;case`needs_attention`:return`W`;case`completed`:return Ce(`completed`);case`aborted`:return Ce(`aborted`);default:return`?`}}function ot(e){if(!e.sortAt)return`No timestamp`;let t=ue(e.sortAt);return e.statusFilter===`scheduled`?`Runs ${t}`:e.statusFilter===`completed`||e.statusFilter===`aborted`?`Closed ${t}`:`Updated ${t}`}function st(e){let t=e.initialPrompt?` Initial prompt: ${e.initialPrompt}`:``;return`${e.title}. ${e.statusDetail}. ${ot(e)}.${t}`}function ct(e){e.defaultPrevented||!be(e)||e.key!==`/`||_e(e.target)||(e.preventDefault(),p(I)?.focus(),p(I)?.select())}var G=We();t(`keydown`,se,ct);var lt=o(G);Se(lt,{title:`All processes`,subtitle:`Browse current, scheduled, and past process records. Search or filter to narrow the list.`});var ut=m(lt,2),K=o(ut),q=o(K),J=m(o(q),2);le(J),_(J,t=>e(I,t),()=>p(I)),y(q);var Y=m(q,2),X=m(o(Y),2),Z=o(X);Z.value=Z.__value=``;var dt=m(Z),ft=e=>{var t=Me(),n=o(t);y(t);var r={};a(()=>{l(n,`${p(z)??``} (unavailable)`),r!==(r=p(z))&&(t.value=(t.__value=p(z))??``)}),u(e,t)},pt=C(()=>O().facets&&p(z)&&!p(H).some(e=>e.value===p(z)));x(dt,e=>{p(pt)&&e(ft)}),r(m(dt),17,()=>p(H),e=>e.value,(e,t)=>{var n=Me(),r=o(n);y(n);var i={};a(()=>{l(r,`${p(t).label??``} (${p(t).count??``})`),i!==(i=p(t).value)&&(n.value=(n.__value=p(t).value)??``)}),u(e,n)}),y(X);var mt;b(X),y(Y);var Q=m(Y,2),ht=o(Q),gt=o(ht,!0);y(ht);var _t=m(ht);y(Q);var vt=m(Q,2),yt=e=>{var t=Ne();D(`click`,t,tt),u(e,t)};x(vt,e=>{p(Ye)&&e(yt)});var $=m(vt,2),bt=o($,!0);y($),y(K);var xt=m(K,2),St=m(o(xt),2);A(o(St),()=>pe),y(St);var Ct=m(St,2);A(o(Ct),()=>M,()=>!0),y(Ct),y(xt);var wt=m(xt,2),Tt=e=>{var t=Pe(),n=m(o(t),2);y(t),D(`click`,n,W),u(e,t)};x(wt,e=>{O().error&&e(Tt)});var Et=m(wt,2),Dt=o(Et),Ot=o(Dt);j(Ot,()=>`status`,()=>`Status`);var kt=m(Ot,2);j(kt,()=>`title`,()=>`Process`),j(m(kt,4),()=>`timeline`,()=>`Timeline`),ie(2),y(Dt);var At=m(Dt,2),jt=e=>{var t=Ie();r(t,20,()=>[,,,,,,],n,(e,t)=>{u(e,Fe())}),y(t),u(e,t)},Mt=e=>{var t=Le(),n=m(o(t),4);y(t),D(`click`,n,tt),u(e,t)},Nt=e=>{u(e,Re())},Pt=e=>{var t=He();r(t,21,()=>p(V),e=>e.id,(e,t)=>{var n=Ve(),r=o(n),i=o(r),s=o(i,!0);y(i);var d=m(i,2),f=o(d),h=o(f,!0);y(f);var g=m(f,2),ee=o(g);y(g),y(d);var _=m(d,2),te=o(_),ne=e=>{var n=c();a(()=>l(n,p(t).initialPrompt)),u(e,n)},re=e=>{u(e,ze())};x(te,e=>{p(t).initialPrompt?e(ne):e(re,-1)}),y(_);var b=m(_,2),ie=o(b,!0);y(b),y(r);var S=m(r,2),ae=o(S),oe=e=>{we(e,{get instanceId(){return p(t).instanceId},get lifecycleStatus(){return p(t).lifecycleStatus},get processLabel(){return p(t).title},onDeleted:W})},se=e=>{u(e,Be())};x(ae,e=>{p(t).kind===`process`&&p(t).instanceId?e(oe):e(se,-1)}),y(S),y(n),a((e,a,o,c)=>{v(n,`data-item-id`,p(t).id),v(n,`data-item-kind`,p(t).kind),v(n,`data-status-filter`,p(t).statusFilter),v(r,`href`,e),v(r,`aria-label`,a),T(i,1,`status-mark ${p(t).statusFilter}`,`svelte-m0hp6c`),l(s,o),l(h,p(t).title),l(ee,`${p(t).statusDetail??``} · ${p(t).processDisplayName??``}`),l(ie,c),v(S,`data-process-actions-for`,p(t).instanceId??p(t).id)},[()=>rt(p(t)),()=>st(p(t)),()=>at(p(t)),()=>ot(p(t))]),D(`click`,r,e=>it(p(t),e)),u(e,n)}),y(t),u(e,t)};x(At,e=>{O().loading&&p(V).length===0?e(jt):p(V).length===0&&p(Ye)?e(Mt,1):p(V).length===0?e(Nt,2):e(Pt,-1)}),y(Et);var Ft=m(Et,2),It=e=>{var t=Ue(),n=o(t);y(t),D(`click`,n,nt),u(e,t)};x(Ft,e=>{p(qe)&&e(It)}),y(ut),y(G),a(()=>{oe(J,p(L)),mt!==(mt=p(z))&&(X.value=(X.__value=p(z))??``,re(X,p(z))),l(gt,p(Je)),l(_t,` ${p(Je)===1?`record`:`records`}`),$.disabled=O().loading,l(bt,O().loading?`Refreshing…`:`Refresh`)}),D(`input`,J,Qe),D(`change`,X,et),D(`click`,$,W),u(i,G),te(),fe()}f([`click`,`input`,`change`]);export{Ge as default};
1
+ import{$ as e,B as t,D as n,E as r,F as i,G as a,J as o,K as s,L as c,M as l,N as u,P as d,R as f,V as p,X as m,Y as h,Z as g,_t as ee,a as _,d as v,dt as te,ft as ne,g as re,gt as y,h as b,ht as ie,k as x,nt as S,ot as ae,p as oe,q as se,rt as C,st as ce,tt as w,u as le,v as T,vt as E,z as D}from"./index-client-BqF3_t3P.js";import{J as ue,K as de,X as O,Z as k,_t as fe,ct as A,dt as j,ht as pe,mt as M,yt as N}from"./api-HGtUzekR.js";import{r as me,s as he,u as ge}from"./router.svelte-C2wi6I7k.js";import{b as _e,i as ve,r as ye,s as P,y as be}from"./index-ChVsVf6R.js";import{t as xe}from"./browser-storage-LbKCyf_w.js";import{t as Se}from"./PageHeader-C4j3zJKF.js";import{r as Ce,t as we}from"./ProcessActionsMenu-gNiZGUCZ.js";var F=M([`all`,`running`,`scheduled`,`needs_attention`,`completed`,`aborted`]),I=j({key:M([`status`,`title`,`timeline`]),direction:M([`asc`,`desc`])}),L=j({status:F,processType:pe(N(),A(200)),sort:I}),R=`leitwerk.process-browser-view.v1`,z={status:`all`,processType:``,sort:{key:`timeline`,direction:`desc`}},Te={all:0,running:0,scheduled:0,needs_attention:0,completed:0,aborted:0};function Ee(e){try{let t=e?.getItem(R),n=t&&fe(L,JSON.parse(t));return n?.success?n.output:z}catch{return z}}function De(e,t){try{e?.setItem(R,JSON.stringify(t))}catch{}}function B(e){return e.lifecycleStatus===`completed`||e.lifecycleStatus===`aborted`?e.lifecycleStatus:e.lifecycleStatus===`error`||e.lifecycleStatus===`waiting`?`needs_attention`:`running`}function V(e){let t=O(e.lifecycleStatus);return e.selectedTurnId?`${t} · ${k(e.selectedTurnId)}`:t}function H(e){if(e.kind===`process`){let t=e.item;return{id:t.instanceId,kind:`process`,title:t.title,processId:t.processId,processDisplayName:t.processDisplayName?.trim()||de(t.processId),statusFilter:B(t),statusDetail:V(t),initialPrompt:t.initialPromptPreview,createdAt:t.createdAt,updatedAt:t.updatedAt,sortAt:t.statusCategory===`terminal`?t.closedAt??t.updatedAt??t.createdAt:t.updatedAt??t.createdAt,instanceId:t.instanceId,futureExecutionId:null,lifecycleStatus:t.lifecycleStatus}}let t=e.item;return{id:t.id,kind:`future`,title:t.title,processId:t.processId,processDisplayName:t.kind===`launch`&&t.launcherLabel||de(t.processId),statusFilter:`scheduled`,statusDetail:t.kind===`action`?`Scheduled action · ${t.actionLabel}`:t.scheduleKind===`cron`?`Recurring scheduled start`:`Scheduled start`,initialPrompt:t.initialPromptPreview,createdAt:null,updatedAt:t.nextRunAt,sortAt:t.nextRunAt,instanceId:t.instanceId,futureExecutionId:t.kind===`launch`?t.id:null,lifecycleStatus:null}}function Oe(e){return e.map(H)}function ke(e){return e.status!==`all`||e.query.trim()!==``||e.processType!==``}var Ae=i(`<button type="button" data-pressable="true"><span> </span> <span class="chip-count svelte-m0hp6c"> </span></button>`),je=i(`<button type="button"><span> </span> <span class="sort-arrow svelte-m0hp6c" aria-hidden="true"><!></span></button>`),Me=i(`<option> </option>`),Ne=i(`<button type="button" class="reset-view-button svelte-m0hp6c" data-pressable="true">Clear filters</button>`),Pe=i(`<div class="state-banner svelte-m0hp6c" role="status" data-state="process-list-error"><p class="svelte-m0hp6c">Process list couldn’t refresh. Existing results may be out of date.</p> <button type="button" data-pressable="true" class="svelte-m0hp6c">Try again</button></div>`),Fe=i(`<div class="skeleton-row svelte-m0hp6c"></div>`),Ie=i(`<div class="skeleton-list svelte-m0hp6c" data-state="processes-loading" role="status"></div>`),Le=i(`<div class="empty-state svelte-m0hp6c" data-state="processes-no-results"><h2 class="svelte-m0hp6c">No processes match these filters</h2> <p class="svelte-m0hp6c">Change the search or filters to see more process records.</p> <button type="button" class="clear-button svelte-m0hp6c" data-pressable="true">Clear search and filters</button></div>`),Re=i(`<div class="empty-state svelte-m0hp6c" data-state="processes-empty"><h2 class="svelte-m0hp6c">No process records yet</h2> <p class="svelte-m0hp6c">Started and scheduled processes will appear here.</p></div>`),ze=i(`<span class="muted svelte-m0hp6c">No initial prompt captured</span>`),Be=i(`<span class="future-action-note svelte-m0hp6c">Scheduled start</span>`),Ve=i(`<article class="process-browser-row svelte-m0hp6c" data-process-browser-row=""><a class="row-main svelte-m0hp6c" data-pressable="true"><span aria-hidden="true"> </span> <span class="row-process svelte-m0hp6c"><span class="row-title svelte-m0hp6c"> </span> <span class="row-meta svelte-m0hp6c"> </span></span> <span class="prompt-cell svelte-m0hp6c"><!></span> <span class="time-cell svelte-m0hp6c"> </span></a> <div class="row-actions svelte-m0hp6c"><!></div></article>`),He=i(`<div class="process-table svelte-m0hp6c" data-section="process-browser-results"></div>`),Ue=i(`<div class="pagination-row svelte-m0hp6c"><button type="button" class="show-more-button svelte-m0hp6c" data-pressable="true">Show more</button></div>`),We=i(`<section class="processes-page svelte-m0hp6c" data-section="all-processes-page"><!> <div class="browser-panel svelte-m0hp6c" data-section="process-browser"><div class="browser-toolbar svelte-m0hp6c" data-section="process-browse-controls"><label class="search-field svelte-m0hp6c"><span class="sr-only svelte-m0hp6c">Search</span> <input type="search" placeholder="Search processes by title or prompt" aria-label="Search processes by title or prompt" class="svelte-m0hp6c"/></label> <label class="type-filter svelte-m0hp6c"><span class="sr-only svelte-m0hp6c">Process type</span> <select data-filter="process-type" class="svelte-m0hp6c"><option>All process types</option><!><!></select></label> <p class="result-count svelte-m0hp6c" aria-live="polite"><span class="svelte-m0hp6c"> </span> </p> <!> <button type="button" class="refresh-button svelte-m0hp6c" data-action="refresh-processes" data-pressable="true"> </button></div> <div class="filter-row svelte-m0hp6c" role="group" aria-label="Process status filters"><span class="filter-row-label svelte-m0hp6c">Status</span> <div class="filter-group svelte-m0hp6c"><!></div> <div class="filter-group archive-group svelte-m0hp6c"><!></div></div> <!> <div class="process-table-shell svelte-m0hp6c"><div class="process-table-heading svelte-m0hp6c"><!> <!> <span class="prompt-heading svelte-m0hp6c">Initial prompt</span> <!> <span class="actions-heading svelte-m0hp6c">Actions</span></div> <!></div> <!></div></section>`);function Ge(i,f){ne(f,!0);let de=()=>ce(ye,`$browseItems`,k),O=()=>ce(ve,`$browseState`,k),[k,fe]=ae(),A=(e,t=E,n)=>{let i=S(()=>ee(n?.(),!1));var s=d();r(h(s),17,t,e=>e.value,(e,t)=>{var n=Ae();let r;var s=o(n),c=o(s,!0);y(s);var d=m(s,2),f=o(d,!0);y(d),y(n),a(()=>{r=T(n,1,`filter-chip svelte-m0hp6c`,null,r,{"archive-chip":p(i),"is-active":p(R)===p(t).value}),v(n,`data-filter-status`,p(t).value),v(n,`aria-pressed`,p(R)===p(t).value),l(c,p(t).label),l(f,p(Ke)[p(t).value])}),D(`click`,n,()=>$e(p(t).value)),u(e,n)}),u(e,s)},j=(e,t=E,n=E)=>{var r=je();let i;var s=o(r),d=o(s,!0);y(s);var f=m(s,2),h=o(f),g=e=>{var t=c();a(()=>l(t,p(B).direction===`asc`?`↑`:`↓`)),u(e,t)},ee=e=>{u(e,c(`↕`))};x(h,e=>{p(B).key===t()?e(g):e(ee,-1)}),y(f),y(r),a(e=>{i=T(r,1,`column-sort svelte-m0hp6c`,null,i,{"is-active":p(B).key===t()}),v(r,`data-sort-key`,t()),v(r,`aria-label`,e),l(d,n())},[()=>Xe(t(),n())]),D(`click`,r,()=>Ze(t())),u(e,r)},pe=[{value:`all`,label:`All`},{value:`running`,label:`Running`},{value:`scheduled`,label:`Scheduled`},{value:`needs_attention`,label:`Needs attention`}],M=[{value:`completed`,label:`Completed`},{value:`aborted`,label:`Aborted`}],N=xe(),F=Ee(N),I=w(null),L=w(``),R=w(g(F.status)),z=w(g(F.processType)),B=w(g(F.sort)),V=C(()=>Oe(de())),H=C(()=>O().facets?.processTypes??[]),Ge=C(()=>({status:p(R),query:p(L),processType:p(z)})),Ke=C(()=>O().facets?.statusCounts??Te),qe=C(()=>!!O().pagination?.hasMore),Je=C(()=>(O().pagination?.processTotal??0)+(O().pagination?.futureExecutionTotal??0)),Ye=C(()=>ke(p(Ge)));function U(e=100,t){return{limit:e,...t===void 0?{}:{offset:t},query:p(L),status:p(R),processType:p(z),sortKey:p(B).key,sortDirection:p(B).direction}}s(()=>{De(N,{status:p(R),processType:p(z),sort:p(B)})}),s(()=>{let e=setTimeout(()=>void P(U()),p(L).trim()?180:0);return()=>clearTimeout(e)});function Xe(e,t){if(p(B).key!==e)return`Sort by ${t}`;let n=p(B).direction===`asc`?`descending`:`ascending`;return`${t}, sorted ${p(B).direction===`asc`?`ascending`:`descending`}. Activate to sort ${n}.`}function Ze(t){p(B).key===t?e(B,{key:t,direction:p(B).direction===`asc`?`desc`:`asc`},!0):e(B,{key:t,direction:t===`title`?`asc`:`desc`},!0)}function Qe(t){e(L,t.currentTarget.value,!0)}function $e(t){e(R,t,!0)}function et(t){e(z,t.currentTarget.value,!0)}function tt(){e(L,``),e(R,`all`),e(z,``),p(I)?.focus()}function nt(){let e=O().pagination;e&&P(U(e.limit,p(V).length),{append:!0})}function W(){P(U())}function rt(e){return e.kind===`future`&&e.futureExecutionId?he(e.futureExecutionId):ge(e.instanceId??e.id)}function it(e,t){t.preventDefault(),me(rt(e))}function at(e){switch(e.statusFilter){case`running`:return`R`;case`scheduled`:return`S`;case`needs_attention`:return`W`;case`completed`:return Ce(`completed`);case`aborted`:return Ce(`aborted`);default:return`?`}}function ot(e){if(!e.sortAt)return`No timestamp`;let t=ue(e.sortAt);return e.statusFilter===`scheduled`?`Runs ${t}`:e.statusFilter===`completed`||e.statusFilter===`aborted`?`Closed ${t}`:`Updated ${t}`}function st(e){let t=e.initialPrompt?` Initial prompt: ${e.initialPrompt}`:``;return`${e.title}. ${e.statusDetail}. ${ot(e)}.${t}`}function ct(e){e.defaultPrevented||!be(e)||e.key!==`/`||_e(e.target)||(e.preventDefault(),p(I)?.focus(),p(I)?.select())}var G=We();t(`keydown`,se,ct);var lt=o(G);Se(lt,{title:`All processes`,subtitle:`Browse current, scheduled, and past process records. Search or filter to narrow the list.`});var ut=m(lt,2),K=o(ut),q=o(K),J=m(o(q),2);le(J),_(J,t=>e(I,t),()=>p(I)),y(q);var Y=m(q,2),X=m(o(Y),2),Z=o(X);Z.value=Z.__value=``;var dt=m(Z),ft=e=>{var t=Me(),n=o(t);y(t);var r={};a(()=>{l(n,`${p(z)??``} (unavailable)`),r!==(r=p(z))&&(t.value=(t.__value=p(z))??``)}),u(e,t)},pt=C(()=>O().facets&&p(z)&&!p(H).some(e=>e.value===p(z)));x(dt,e=>{p(pt)&&e(ft)}),r(m(dt),17,()=>p(H),e=>e.value,(e,t)=>{var n=Me(),r=o(n);y(n);var i={};a(()=>{l(r,`${p(t).label??``} (${p(t).count??``})`),i!==(i=p(t).value)&&(n.value=(n.__value=p(t).value)??``)}),u(e,n)}),y(X);var mt;b(X),y(Y);var Q=m(Y,2),ht=o(Q),gt=o(ht,!0);y(ht);var _t=m(ht);y(Q);var vt=m(Q,2),yt=e=>{var t=Ne();D(`click`,t,tt),u(e,t)};x(vt,e=>{p(Ye)&&e(yt)});var $=m(vt,2),bt=o($,!0);y($),y(K);var xt=m(K,2),St=m(o(xt),2);A(o(St),()=>pe),y(St);var Ct=m(St,2);A(o(Ct),()=>M,()=>!0),y(Ct),y(xt);var wt=m(xt,2),Tt=e=>{var t=Pe(),n=m(o(t),2);y(t),D(`click`,n,W),u(e,t)};x(wt,e=>{O().error&&e(Tt)});var Et=m(wt,2),Dt=o(Et),Ot=o(Dt);j(Ot,()=>`status`,()=>`Status`);var kt=m(Ot,2);j(kt,()=>`title`,()=>`Process`),j(m(kt,4),()=>`timeline`,()=>`Timeline`),ie(2),y(Dt);var At=m(Dt,2),jt=e=>{var t=Ie();r(t,20,()=>[,,,,,,],n,(e,t)=>{u(e,Fe())}),y(t),u(e,t)},Mt=e=>{var t=Le(),n=m(o(t),4);y(t),D(`click`,n,tt),u(e,t)},Nt=e=>{u(e,Re())},Pt=e=>{var t=He();r(t,21,()=>p(V),e=>e.id,(e,t)=>{var n=Ve(),r=o(n),i=o(r),s=o(i,!0);y(i);var d=m(i,2),f=o(d),h=o(f,!0);y(f);var g=m(f,2),ee=o(g);y(g),y(d);var _=m(d,2),te=o(_),ne=e=>{var n=c();a(()=>l(n,p(t).initialPrompt)),u(e,n)},re=e=>{u(e,ze())};x(te,e=>{p(t).initialPrompt?e(ne):e(re,-1)}),y(_);var b=m(_,2),ie=o(b,!0);y(b),y(r);var S=m(r,2),ae=o(S),oe=e=>{we(e,{get instanceId(){return p(t).instanceId},get lifecycleStatus(){return p(t).lifecycleStatus},get processLabel(){return p(t).title},onDeleted:W})},se=e=>{u(e,Be())};x(ae,e=>{p(t).kind===`process`&&p(t).instanceId?e(oe):e(se,-1)}),y(S),y(n),a((e,a,o,c)=>{v(n,`data-item-id`,p(t).id),v(n,`data-item-kind`,p(t).kind),v(n,`data-status-filter`,p(t).statusFilter),v(r,`href`,e),v(r,`aria-label`,a),T(i,1,`status-mark ${p(t).statusFilter}`,`svelte-m0hp6c`),l(s,o),l(h,p(t).title),l(ee,`${p(t).statusDetail??``} · ${p(t).processDisplayName??``}`),l(ie,c),v(S,`data-process-actions-for`,p(t).instanceId??p(t).id)},[()=>rt(p(t)),()=>st(p(t)),()=>at(p(t)),()=>ot(p(t))]),D(`click`,r,e=>it(p(t),e)),u(e,n)}),y(t),u(e,t)};x(At,e=>{O().loading&&p(V).length===0?e(jt):p(V).length===0&&p(Ye)?e(Mt,1):p(V).length===0?e(Nt,2):e(Pt,-1)}),y(Et);var Ft=m(Et,2),It=e=>{var t=Ue(),n=o(t);y(t),D(`click`,n,nt),u(e,t)};x(Ft,e=>{p(qe)&&e(It)}),y(ut),y(G),a(()=>{oe(J,p(L)),mt!==(mt=p(z))&&(X.value=(X.__value=p(z))??``,re(X,p(z))),l(gt,p(Je)),l(_t,` ${p(Je)===1?`record`:`records`}`),$.disabled=O().loading,l(bt,O().loading?`Refreshing…`:`Refresh`)}),D(`input`,J,Qe),D(`change`,X,et),D(`click`,$,W),u(i,G),te(),fe()}f([`click`,`input`,`change`]);export{Ge as default};
@@ -1 +1 @@
1
- import{E as e,F as t,G as n,J as r,M as i,N as a,R as o,V as s,X as c,Y as l,at as u,d,dt as f,ft as p,g as m,gt as h,h as g,k as _,l as v,r as y,rt as b,v as x,z as S}from"./index-client-BqF3_t3P.js";import"./api-CqECFdii.js";var C=t(`<span class="required-marker svelte-1uuuk71" title="This field is required" aria-hidden="true">*</span>`),w=t(`<div class="checkbox-row svelte-1uuuk71"><input/> <label class="checkbox-label svelte-1uuuk71"> <!></label></div>`),T=t(`<label class="field-label svelte-1uuuk71"> <!></label>`),E=t(`<p class="field-description svelte-1uuuk71"> </p>`),D=t(`<textarea></textarea>`),O=t(`<option> </option>`),k=t(`<p class="field-option-description svelte-1uuuk71"> </p>`),A=t(`<select><option>Choose an option</option><!></select> <!>`,1),j=t(`<button type="button" class="field-recent-chip svelte-1uuuk71"> </button>`),M=t(`<div class="field-recents svelte-1uuuk71"><p class="field-recents-label svelte-1uuuk71">Recent</p> <div class="field-recent-chip-list svelte-1uuuk71"></div></div>`),N=t(`<input/> <!>`,1),ee=t(`<li class="svelte-1uuuk71"> </li>`),P=t(`<ul class="field-error-list svelte-1uuuk71" role="alert"></ul>`),te=t(`<div><!> <!> <!> <!></div>`);function F(t,o){p(o,!0);let m=y(o,`errors`,19,()=>[]),g=y(o,`descriptionId`,3,void 0),F=y(o,`errorId`,3,void 0),I=y(o,`describedBy`,3,void 0),L=y(o,`marker`,3,`launcher`),R=y(o,`textareaRows`,3,4),z=y(o,`options`,19,()=>[]),B=y(o,`selectedOptionDescription`,3,null),V=y(o,`selectedOptionDescriptionId`,3,void 0),H=y(o,`recentValues`,19,()=>[]),U=y(o,`layout`,3,`stacked`),W=y(o,`onTextBlur`,3,void 0),G=y(o,`onRecentValue`,3,void 0),K=b(()=>L()===`action`?{"data-action-form-field":!0}:{"data-launcher-form-field":!0}),q=b(()=>m().length>0),J=b(()=>String(o.value??``)),ne=b(()=>o.value===!0);var Y=te();let X;var Z=r(Y),re=e=>{var t=w(),l=r(t),u=e=>o.onValueChange(o.field,e.currentTarget.checked);v(l,()=>({id:o.id,...s(K),type:`checkbox`,required:o.field.required?!0:void 0,checked:s(ne),"aria-describedby":I(),"aria-invalid":s(q),"aria-required":o.field.required?!0:void 0,onchange:u}),void 0,void 0,void 0,`svelte-1uuuk71`,!0);var f=c(l,2),p=r(f),m=c(p),g=e=>{a(e,C())};_(m,e=>{o.field.required&&e(g)}),h(f),h(t),n(()=>{d(f,`for`,o.id),i(p,`${o.field.label??``} `)}),a(e,t)},ie=e=>{var t=T(),s=r(t),l=c(s),u=e=>{a(e,C())};_(l,e=>{o.field.required&&e(u)}),h(t),n(()=>{d(t,`for`,o.id),i(s,`${o.field.label??``} `)}),a(e,t)};_(Z,e=>{o.field.kind===`boolean`?e(re):e(ie,-1)});var Q=c(Z,2),ae=e=>{var t=E(),s=r(t,!0);h(t),n(()=>{d(t,`id`,g()),i(s,o.field.description)}),a(e,t)};_(Q,e=>{o.field.description&&e(ae)});var $=c(Q,2),oe=e=>{var t=D();u(t);var n=e=>o.onValueChange(o.field,e.currentTarget.value);v(t,()=>({id:o.id,...s(K),rows:R(),required:o.field.required?!0:void 0,value:s(J),placeholder:o.field.placeholder??void 0,"aria-describedby":I(),"aria-invalid":s(q),"aria-required":o.field.required?!0:void 0,oninput:n,onblur:W()}),void 0,void 0,void 0,`svelte-1uuuk71`),a(e,t)},se=t=>{var u=A(),f=l(u),p=e=>o.onValueChange(o.field,e.currentTarget.value);v(f,()=>({id:o.id,...s(K),value:s(J),required:o.field.required?!0:void 0,"aria-describedby":I(),"aria-invalid":s(q),"aria-required":o.field.required?!0:void 0,onchange:p}),void 0,void 0,void 0,`svelte-1uuuk71`);var m=r(f);m.value=m.__value=``,e(c(m),19,z,(e,t)=>`${e.value}:${e.label}:${t}`,(e,t)=>{var o=O(),c=r(o,!0);h(o);var l={};n(()=>{i(c,s(t).label),l!==(l=s(t).value)&&(o.value=(o.__value=s(t).value)??``)}),a(e,o)}),h(f);var g=c(f,2),y=e=>{var t=k(),o=r(t,!0);h(t),n(()=>{d(t,`id`,V()),i(o,B())}),a(e,t)};_(g,e=>{B()&&e(y)}),a(t,u)},ce=e=>{},le=t=>{var u=N(),f=l(u),p=e=>o.onValueChange(o.field,e.currentTarget.value);v(f,()=>({id:o.id,...s(K),type:o.field.kind===`number`?`number`:`text`,required:o.field.required?!0:void 0,value:s(J),placeholder:o.field.placeholder??void 0,"aria-describedby":I(),"aria-invalid":s(q),"aria-required":o.field.required?!0:void 0,oninput:p,onblur:W()}),void 0,void 0,void 0,`svelte-1uuuk71`,!0);var m=c(f,2),g=t=>{var s=M(),l=c(r(s),2);e(l,20,H,e=>e,(e,t)=>{var s=j(),c=r(s,!0);h(s),n(()=>{d(s,`data-recent-value`,t),i(c,t)}),S(`click`,s,()=>(G()??o.onValueChange)(o.field,t)),a(e,s)}),h(l),h(s),n(()=>d(s,`data-field-recents`,o.field.id)),a(t,s)};_(m,e=>{o.field.kind===`text`&&H().length>0&&e(g)}),a(t,u)};_($,e=>{o.field.kind===`textarea`?e(oe):o.field.kind===`select`?e(se,1):o.field.kind===`boolean`?e(ce,2):e(le,-1)});var ue=c($,2),de=t=>{var o=P();e(o,20,m,e=>e,(e,t)=>{var o=ee(),s=r(o,!0);h(o),n(()=>i(s,t)),a(e,o)}),h(o),n(()=>d(o,`id`,F())),a(t,o)};_(ue,e=>{m().length>0&&e(de)}),h(Y),n(()=>X=x(Y,1,`form-field-group svelte-1uuuk71`,null,X,{"is-split":U()===`split`&&o.field.kind!==`boolean`})),a(t,Y),f()}o([`click`]);function I(e){return String(e).padStart(2,`0`)}function L(){return Array.from({length:24},(e,t)=>{let n=I(t);return{value:n,label:n}})}function R(e=1){if(!Number.isInteger(e)||e<1||e>60||60%e!=0)throw Error(`stepMinutes must evenly divide 60`);return Array.from({length:60/e},(t,n)=>{let r=I(n*e);return{value:r,label:r}})}function z(e){let t=/^(\d{2}):(\d{2})$/.exec(e.trim());return t?{hour:t[1],minute:t[2]}:{hour:``,minute:``}}function B(e){let t=typeof e.hour==`string`?e.hour.trim():``,n=typeof e.minute==`string`?e.minute.trim():``;return/^\d{2}$/.test(t)&&/^\d{2}$/.test(n)?`${t}:${n}`:``}function V(e){let t=e.getFullYear(),n=I(e.getMonth()+1),r=I(e.getDate()),i=I(e.getHours()),a=I(e.getMinutes());return{date:`${t}-${n}-${r}`,time:`${i}:${a}`}}function H(){return V(new Date)}function U(e){return V(new Date(e))}function W(e){let t=typeof e.date==`string`?e.date.trim():``,n=typeof e.time==`string`?e.time.trim():``;if(!t||!n)return null;let r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t),i=/^(\d{2}):(\d{2})$/.exec(n);if(!r||!i)return null;let[,a,o,s]=r,[,c,l]=i,u=Number(a),d=Number(o),f=Number(s),p=Number(c),m=Number(l);if(!Number.isInteger(u)||!Number.isInteger(d)||!Number.isInteger(f)||!Number.isInteger(p)||!Number.isInteger(m)||d<1||d>12||f<1||f>31||p<0||p>23||m<0||m>59)return null;let h=new Date(u,d-1,f,p,m,0,0);return h.getFullYear()!==u||h.getMonth()!==d-1||h.getDate()!==f||h.getHours()!==p||h.getMinutes()!==m?null:h.toISOString()}var G=t(`<option> </option>`),K=t(`<div class="schedule-date-time-picker svelte-qeywfq" data-time-format="24-hour"><input/> <div class="schedule-time-picker svelte-qeywfq"><select aria-label="Hour (24-hour)" class="svelte-qeywfq"><option>HH</option><!></select> <span class="schedule-time-separator svelte-qeywfq" aria-hidden="true">:</span> <select aria-label="Minute" class="svelte-qeywfq"><option>MM</option><!></select></div></div>`);function q(t,o){p(o,!0);let l=y(o,`dataSection`,3,`schedule-date-time-picker`),u=y(o,`marker`,3,null),_=L(),x=R(),C=b(()=>u()===`action`?{"data-action-form-field":!0}:u()===`launcher`?{"data-launcher-form-field":!0}:{});var w=K(),T=r(w),E=e=>o.onDateChange(e.currentTarget.value);v(T,()=>({id:o.dateId,...s(C),type:`date`,value:o.dateValue,oninput:E}),void 0,void 0,void 0,`svelte-qeywfq`,!0);var D=c(T,2),O=r(D),k=r(O);k.value=k.__value=``,e(c(k),17,()=>_,e=>e.value,(e,t)=>{var o=G(),c=r(o,!0);h(o);var l={};n(()=>{i(c,s(t).label),l!==(l=s(t).value)&&(o.value=(o.__value=s(t).value)??``)}),a(e,o)}),h(O);var A;g(O);var j=c(O,4),M=r(j);M.value=M.__value=``,e(c(M),17,()=>x,e=>e.value,(e,t)=>{var o=G(),c=r(o,!0);h(o);var l={};n(()=>{i(c,s(t).label),l!==(l=s(t).value)&&(o.value=(o.__value=s(t).value)??``)}),a(e,o)}),h(j);var N;g(j),h(D),h(w),n(()=>{d(w,`data-section`,l()),d(O,`id`,o.hourId),A!==(A=o.hourValue)&&(O.value=(O.__value=o.hourValue)??``,m(O,o.hourValue)),d(j,`id`,o.minuteId),N!==(N=o.minuteValue)&&(j.value=(j.__value=o.minuteValue)??``,m(j,o.minuteValue))}),S(`change`,O,e=>o.onHourChange(e.currentTarget.value)),S(`change`,j,e=>o.onMinuteChange(e.currentTarget.value)),a(t,w),f()}o([`change`]);export{W as a,U as i,B as n,z as o,H as r,F as s,q as t};
1
+ import{E as e,F as t,G as n,J as r,M as i,N as a,R as o,V as s,X as c,Y as l,at as u,d,dt as f,ft as p,g as m,gt as h,h as g,k as _,l as v,r as y,rt as b,v as x,z as S}from"./index-client-BqF3_t3P.js";import"./api-HGtUzekR.js";var C=t(`<span class="required-marker svelte-1uuuk71" title="This field is required" aria-hidden="true">*</span>`),w=t(`<div class="checkbox-row svelte-1uuuk71"><input/> <label class="checkbox-label svelte-1uuuk71"> <!></label></div>`),T=t(`<label class="field-label svelte-1uuuk71"> <!></label>`),E=t(`<p class="field-description svelte-1uuuk71"> </p>`),D=t(`<textarea></textarea>`),O=t(`<option> </option>`),k=t(`<p class="field-option-description svelte-1uuuk71"> </p>`),A=t(`<select><option>Choose an option</option><!></select> <!>`,1),j=t(`<button type="button" class="field-recent-chip svelte-1uuuk71"> </button>`),M=t(`<div class="field-recents svelte-1uuuk71"><p class="field-recents-label svelte-1uuuk71">Recent</p> <div class="field-recent-chip-list svelte-1uuuk71"></div></div>`),N=t(`<input/> <!>`,1),ee=t(`<li class="svelte-1uuuk71"> </li>`),P=t(`<ul class="field-error-list svelte-1uuuk71" role="alert"></ul>`),te=t(`<div><!> <!> <!> <!></div>`);function F(t,o){p(o,!0);let m=y(o,`errors`,19,()=>[]),g=y(o,`descriptionId`,3,void 0),F=y(o,`errorId`,3,void 0),I=y(o,`describedBy`,3,void 0),L=y(o,`marker`,3,`launcher`),R=y(o,`textareaRows`,3,4),z=y(o,`options`,19,()=>[]),B=y(o,`selectedOptionDescription`,3,null),V=y(o,`selectedOptionDescriptionId`,3,void 0),H=y(o,`recentValues`,19,()=>[]),U=y(o,`layout`,3,`stacked`),W=y(o,`onTextBlur`,3,void 0),G=y(o,`onRecentValue`,3,void 0),K=b(()=>L()===`action`?{"data-action-form-field":!0}:{"data-launcher-form-field":!0}),q=b(()=>m().length>0),J=b(()=>String(o.value??``)),ne=b(()=>o.value===!0);var Y=te();let X;var Z=r(Y),re=e=>{var t=w(),l=r(t),u=e=>o.onValueChange(o.field,e.currentTarget.checked);v(l,()=>({id:o.id,...s(K),type:`checkbox`,required:o.field.required?!0:void 0,checked:s(ne),"aria-describedby":I(),"aria-invalid":s(q),"aria-required":o.field.required?!0:void 0,onchange:u}),void 0,void 0,void 0,`svelte-1uuuk71`,!0);var f=c(l,2),p=r(f),m=c(p),g=e=>{a(e,C())};_(m,e=>{o.field.required&&e(g)}),h(f),h(t),n(()=>{d(f,`for`,o.id),i(p,`${o.field.label??``} `)}),a(e,t)},ie=e=>{var t=T(),s=r(t),l=c(s),u=e=>{a(e,C())};_(l,e=>{o.field.required&&e(u)}),h(t),n(()=>{d(t,`for`,o.id),i(s,`${o.field.label??``} `)}),a(e,t)};_(Z,e=>{o.field.kind===`boolean`?e(re):e(ie,-1)});var Q=c(Z,2),ae=e=>{var t=E(),s=r(t,!0);h(t),n(()=>{d(t,`id`,g()),i(s,o.field.description)}),a(e,t)};_(Q,e=>{o.field.description&&e(ae)});var $=c(Q,2),oe=e=>{var t=D();u(t);var n=e=>o.onValueChange(o.field,e.currentTarget.value);v(t,()=>({id:o.id,...s(K),rows:R(),required:o.field.required?!0:void 0,value:s(J),placeholder:o.field.placeholder??void 0,"aria-describedby":I(),"aria-invalid":s(q),"aria-required":o.field.required?!0:void 0,oninput:n,onblur:W()}),void 0,void 0,void 0,`svelte-1uuuk71`),a(e,t)},se=t=>{var u=A(),f=l(u),p=e=>o.onValueChange(o.field,e.currentTarget.value);v(f,()=>({id:o.id,...s(K),value:s(J),required:o.field.required?!0:void 0,"aria-describedby":I(),"aria-invalid":s(q),"aria-required":o.field.required?!0:void 0,onchange:p}),void 0,void 0,void 0,`svelte-1uuuk71`);var m=r(f);m.value=m.__value=``,e(c(m),19,z,(e,t)=>`${e.value}:${e.label}:${t}`,(e,t)=>{var o=O(),c=r(o,!0);h(o);var l={};n(()=>{i(c,s(t).label),l!==(l=s(t).value)&&(o.value=(o.__value=s(t).value)??``)}),a(e,o)}),h(f);var g=c(f,2),y=e=>{var t=k(),o=r(t,!0);h(t),n(()=>{d(t,`id`,V()),i(o,B())}),a(e,t)};_(g,e=>{B()&&e(y)}),a(t,u)},ce=e=>{},le=t=>{var u=N(),f=l(u),p=e=>o.onValueChange(o.field,e.currentTarget.value);v(f,()=>({id:o.id,...s(K),type:o.field.kind===`number`?`number`:`text`,required:o.field.required?!0:void 0,value:s(J),placeholder:o.field.placeholder??void 0,"aria-describedby":I(),"aria-invalid":s(q),"aria-required":o.field.required?!0:void 0,oninput:p,onblur:W()}),void 0,void 0,void 0,`svelte-1uuuk71`,!0);var m=c(f,2),g=t=>{var s=M(),l=c(r(s),2);e(l,20,H,e=>e,(e,t)=>{var s=j(),c=r(s,!0);h(s),n(()=>{d(s,`data-recent-value`,t),i(c,t)}),S(`click`,s,()=>(G()??o.onValueChange)(o.field,t)),a(e,s)}),h(l),h(s),n(()=>d(s,`data-field-recents`,o.field.id)),a(t,s)};_(m,e=>{o.field.kind===`text`&&H().length>0&&e(g)}),a(t,u)};_($,e=>{o.field.kind===`textarea`?e(oe):o.field.kind===`select`?e(se,1):o.field.kind===`boolean`?e(ce,2):e(le,-1)});var ue=c($,2),de=t=>{var o=P();e(o,20,m,e=>e,(e,t)=>{var o=ee(),s=r(o,!0);h(o),n(()=>i(s,t)),a(e,o)}),h(o),n(()=>d(o,`id`,F())),a(t,o)};_(ue,e=>{m().length>0&&e(de)}),h(Y),n(()=>X=x(Y,1,`form-field-group svelte-1uuuk71`,null,X,{"is-split":U()===`split`&&o.field.kind!==`boolean`})),a(t,Y),f()}o([`click`]);function I(e){return String(e).padStart(2,`0`)}function L(){return Array.from({length:24},(e,t)=>{let n=I(t);return{value:n,label:n}})}function R(e=1){if(!Number.isInteger(e)||e<1||e>60||60%e!=0)throw Error(`stepMinutes must evenly divide 60`);return Array.from({length:60/e},(t,n)=>{let r=I(n*e);return{value:r,label:r}})}function z(e){let t=/^(\d{2}):(\d{2})$/.exec(e.trim());return t?{hour:t[1],minute:t[2]}:{hour:``,minute:``}}function B(e){let t=typeof e.hour==`string`?e.hour.trim():``,n=typeof e.minute==`string`?e.minute.trim():``;return/^\d{2}$/.test(t)&&/^\d{2}$/.test(n)?`${t}:${n}`:``}function V(e){let t=e.getFullYear(),n=I(e.getMonth()+1),r=I(e.getDate()),i=I(e.getHours()),a=I(e.getMinutes());return{date:`${t}-${n}-${r}`,time:`${i}:${a}`}}function H(){return V(new Date)}function U(e){return V(new Date(e))}function W(e){let t=typeof e.date==`string`?e.date.trim():``,n=typeof e.time==`string`?e.time.trim():``;if(!t||!n)return null;let r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(t),i=/^(\d{2}):(\d{2})$/.exec(n);if(!r||!i)return null;let[,a,o,s]=r,[,c,l]=i,u=Number(a),d=Number(o),f=Number(s),p=Number(c),m=Number(l);if(!Number.isInteger(u)||!Number.isInteger(d)||!Number.isInteger(f)||!Number.isInteger(p)||!Number.isInteger(m)||d<1||d>12||f<1||f>31||p<0||p>23||m<0||m>59)return null;let h=new Date(u,d-1,f,p,m,0,0);return h.getFullYear()!==u||h.getMonth()!==d-1||h.getDate()!==f||h.getHours()!==p||h.getMinutes()!==m?null:h.toISOString()}var G=t(`<option> </option>`),K=t(`<div class="schedule-date-time-picker svelte-qeywfq" data-time-format="24-hour"><input/> <div class="schedule-time-picker svelte-qeywfq"><select aria-label="Hour (24-hour)" class="svelte-qeywfq"><option>HH</option><!></select> <span class="schedule-time-separator svelte-qeywfq" aria-hidden="true">:</span> <select aria-label="Minute" class="svelte-qeywfq"><option>MM</option><!></select></div></div>`);function q(t,o){p(o,!0);let l=y(o,`dataSection`,3,`schedule-date-time-picker`),u=y(o,`marker`,3,null),_=L(),x=R(),C=b(()=>u()===`action`?{"data-action-form-field":!0}:u()===`launcher`?{"data-launcher-form-field":!0}:{});var w=K(),T=r(w),E=e=>o.onDateChange(e.currentTarget.value);v(T,()=>({id:o.dateId,...s(C),type:`date`,value:o.dateValue,oninput:E}),void 0,void 0,void 0,`svelte-qeywfq`,!0);var D=c(T,2),O=r(D),k=r(O);k.value=k.__value=``,e(c(k),17,()=>_,e=>e.value,(e,t)=>{var o=G(),c=r(o,!0);h(o);var l={};n(()=>{i(c,s(t).label),l!==(l=s(t).value)&&(o.value=(o.__value=s(t).value)??``)}),a(e,o)}),h(O);var A;g(O);var j=c(O,4),M=r(j);M.value=M.__value=``,e(c(M),17,()=>x,e=>e.value,(e,t)=>{var o=G(),c=r(o,!0);h(o);var l={};n(()=>{i(c,s(t).label),l!==(l=s(t).value)&&(o.value=(o.__value=s(t).value)??``)}),a(e,o)}),h(j);var N;g(j),h(D),h(w),n(()=>{d(w,`data-section`,l()),d(O,`id`,o.hourId),A!==(A=o.hourValue)&&(O.value=(O.__value=o.hourValue)??``,m(O,o.hourValue)),d(j,`id`,o.minuteId),N!==(N=o.minuteValue)&&(j.value=(j.__value=o.minuteValue)??``,m(j,o.minuteValue))}),S(`change`,O,e=>o.onHourChange(e.currentTarget.value)),S(`change`,j,e=>o.onMinuteChange(e.currentTarget.value)),a(t,w),f()}o([`change`]);export{W as a,U as i,B as n,z as o,H as r,F as s,q as t};
@@ -1,2 +1,2 @@
1
- import{t as e}from"./ChronicleMarkdown-BLgtHeEE.js";import{$ as t,B as n,E as r,F as i,G as a,H as o,J as s,K as c,M as l,N as u,P as d,R as f,U as p,V as m,X as h,Y as g,a as _,d as v,dt as y,ft as b,gt as x,ht as S,k as C,m as w,n as T,q as E,r as D,rt as O,s as k,tt as A,u as j,v as M,vt as N,z as P}from"./index-client-BqF3_t3P.js";import{A as F,M as I,j as ee,o as L,q as te,v as ne,y as re}from"./api-CqECFdii.js";import{f as R,l as ie,o as ae,r as z,t as oe,u as se}from"./router.svelte-COr45o9R.js";import{t as ce}from"./index-C8qCggeq.js";import{t as le}from"./PageHeader-D6pP4hIh.js";var ue=(e,t=N)=>{var n=H(),i=h(s(n)),o=e=>{u(e,me())},c=e=>{var n=V();r(n,21,t,e=>e.instanceId,(e,t)=>{var n=B(),r=s(n),i=s(r),o=s(i,!0);x(i);var c=h(i),d=s(c);x(c),x(r);var f=h(r),p=s(f);x(f),x(n),a((e,r)=>{v(n,`href`,e),l(o,m(t).title),l(d,`Attached ${r??``}`),l(p,`${m(t).invocationCount??``} ${m(t).invocationCount===1?`invocation`:`invocations`}`)},[()=>se(m(t).instanceId),()=>te(m(t).attachedAt)]),P(`click`,n,e=>oe(e,se(m(t).instanceId))),u(e,n)}),x(n),u(e,n)};C(i,e=>{t().length===0?e(o):e(c,-1)}),x(n),u(e,n)},de=i(`<span class="conflict svelte-1cuomf">ID conflict</span>`),fe=i(`<tr><td class="svelte-1cuomf"><a class="svelte-1cuomf"><strong class="svelte-1cuomf"> </strong> <span class="svelte-1cuomf"> </span></a></td><td class="svelte-1cuomf"><span class="svelte-1cuomf"> </span> <code class="svelte-1cuomf"> </code></td><td class="svelte-1cuomf"><span> </span> <!></td><td class="svelte-1cuomf"><strong class="svelte-1cuomf"> </strong><span class="svelte-1cuomf"> </span></td><td class="svelte-1cuomf"><strong class="svelte-1cuomf"> </strong><span class="svelte-1cuomf"> </span></td></tr>`),pe=i(`<dl class="detail-meta svelte-1cuomf"><div class="svelte-1cuomf"><dt class="svelte-1cuomf">Repository</dt><dd class="svelte-1cuomf"> </dd></div><div class="svelte-1cuomf"><dt class="svelte-1cuomf">Configured ref</dt><dd class="svelte-1cuomf"><code class="svelte-1cuomf"> </code></dd></div><div class="full svelte-1cuomf"><dt class="svelte-1cuomf">Repository URL</dt><dd class="svelte-1cuomf"><code class="svelte-1cuomf"> </code></dd></div><div class="svelte-1cuomf"><dt class="svelte-1cuomf">Source path</dt><dd class="svelte-1cuomf"><code class="svelte-1cuomf"> </code></dd></div><div class="svelte-1cuomf"><dt class="svelte-1cuomf">Discovered revision</dt><dd class="svelte-1cuomf"><code class="svelte-1cuomf"> </code></dd></div><div class="svelte-1cuomf"><dt class="svelte-1cuomf">Usage</dt><dd class="svelte-1cuomf"> </dd></div></dl>`),me=i(`<p class="svelte-1cuomf">No process has attached this skill yet.</p>`),B=i(`<a class="svelte-1cuomf"><span class="svelte-1cuomf"><strong class="svelte-1cuomf"> </strong><small class="svelte-1cuomf"> </small></span><span class="invocation-count svelte-1cuomf"> </span></a>`),V=i(`<div class="process-usage-list svelte-1cuomf"></div>`),H=i(`<section class="usage-section svelte-1cuomf"><h3 class="svelte-1cuomf">Process usage</h3><!></section>`),he=i(`<button class="page-header-button svelte-1cuomf" type="button"> </button>`),ge=i(`<div class="status-banner success svelte-1cuomf" role="status"> </div>`),_e=i(`<option> </option>`),ve=i(`<label class="svelte-1cuomf"><span class="sr-only">Repository</span><select class="svelte-1cuomf"><option>All repositories</option><!></select></label> <label class="svelte-1cuomf"><span class="sr-only">Remote skill state</span><select class="svelte-1cuomf"><option>Not installed</option><option>All states</option><option>Updates available</option><option>Invoked in 30 days</option><option>No longer available</option></select></label>`,1),ye=i(`<div class="catalog-state svelte-1cuomf" role="status">Loading the skill catalog…</div>`),be=i(`<div class="catalog-state error svelte-1cuomf" role="alert"><strong class="svelte-1cuomf">We couldn't load the skill catalog.</strong><span> </span></div>`),xe=i(`<div class="catalog-state svelte-1cuomf"><strong class="svelte-1cuomf">No skills are installed.</strong><span>Open Available remotely to pull a skill, or configure a direct skill in <code>leitwerk.yaml</code>.</span></div>`),Se=i(`<div class="catalog-state svelte-1cuomf"><strong class="svelte-1cuomf">No skill repositories are configured.</strong><span>Add <code>skill_repositories</code> to <code>leitwerk.yaml</code>, then restart Leitwerk.</span></div>`),Ce=i(`<div class="catalog-state svelte-1cuomf"><strong class="svelte-1cuomf">No remote skills were discovered.</strong><span>Check repository paths and ensure each skill contains a root <code>SKILL.md</code>.</span></div>`),we=i(`<div class="catalog-state svelte-1cuomf"><strong class="svelte-1cuomf">No skills match these filters.</strong><span>Clear the search or broaden the selected state.</span></div>`),Te=i(`<p class="inline-error svelte-1cuomf" role="status"> </p>`),Ee=i(`<!> <div class="skill-table-wrap svelte-1cuomf"><table class="skill-table svelte-1cuomf"><thead><tr><th class="svelte-1cuomf">Skill</th><th class="svelte-1cuomf"> </th><th class="svelte-1cuomf">Status</th><th class="svelte-1cuomf">Attached</th><th class="svelte-1cuomf">Invoked</th></tr></thead><tbody class="svelte-1cuomf"><!></tbody></table></div>`,1),De=i(`<div class="detail-state svelte-1cuomf" role="status">Loading skill details…</div>`),Oe=i(`<div class="detail-state error svelte-1cuomf" aria-live="polite"> </div>`),ke=i(`<div class="status-banner success detail-feedback svelte-1cuomf" role="status"> </div>`),Ae=i(`<p class="action-note warning svelte-1cuomf">This revision was not found during the latest successful repository refresh. It remains visible for history but cannot be installed or updated.</p>`),je=i(`<p class="action-note warning svelte-1cuomf">This skill ID conflicts with another repository or a configuration-managed skill. Resolve the conflict before installing it.</p>`),Me=i(`<div class="detail-actions svelte-1cuomf"><button class="primary-action svelte-1cuomf" type="button"> </button></div> <!> <!>`,1),Ne=i(`<button class="primary-action svelte-1cuomf" type="button"> </button>`),Pe=i(`<button class="secondary-action danger svelte-1cuomf" type="button">Remove</button>`),Fe=i(`<p class="action-note svelte-1cuomf">This skill is managed by <code>leitwerk.yaml</code>. Change configuration to remove or update it.</p>`),Ie=i(`<div class="remove-confirmation svelte-1cuomf" role="group"><strong> </strong><p class="svelte-1cuomf">Existing processes and schedules keep their pinned revision.</p><div class="svelte-1cuomf"><button class="danger-action svelte-1cuomf" type="button"> </button><button class="secondary-action svelte-1cuomf" type="button">Cancel</button></div></div>`),Le=i(`<div class="detail-actions svelte-1cuomf"><!> <!></div> <!> <!>`,1),Re=i(`<p class="action-note error svelte-1cuomf" role="alert"> </p>`),ze=i(`<span class="status-chip registered svelte-1cuomf">Active</span>`),Be=i(`<div class="svelte-1cuomf"><span class="svelte-1cuomf"><code class="svelte-1cuomf"> </code><small class="svelte-1cuomf"> </small></span><!></div>`),Ve=i(`<dl class="detail-meta svelte-1cuomf"><div class="svelte-1cuomf"><dt class="svelte-1cuomf">Managed by</dt><dd class="svelte-1cuomf"> </dd></div><div class="svelte-1cuomf"><dt class="svelte-1cuomf">Active revision</dt><dd class="svelte-1cuomf"><code class="svelte-1cuomf"> </code></dd></div><div class="svelte-1cuomf"><dt class="svelte-1cuomf">Usage</dt><dd class="svelte-1cuomf"> </dd></div></dl> <section class="revision-section svelte-1cuomf"><h3 class="svelte-1cuomf">Revision history</h3><div class="revision-list svelte-1cuomf"></div></section>`,1),He=i(`<div id="skill-overview" role="tabpanel"><!> <!></div>`),Ue=i(`<section id="skill-instructions" class="instructions-section svelte-1cuomf" role="tabpanel"><h3 class="svelte-1cuomf">Instructions</h3><!></section>`),We=i(`<header class="detail-header svelte-1cuomf"><div><h2 class="svelte-1cuomf"> </h2><p class="svelte-1cuomf"> </p></div><span> </span></header> <!> <!> <!> <div class="detail-tabs svelte-1cuomf" role="tablist" aria-label="Skill detail sections"><button type="button" role="tab" aria-controls="skill-overview" class="svelte-1cuomf">Overview</button> <button type="button" role="tab" aria-controls="skill-instructions" class="svelte-1cuomf">Instructions</button></div> <!>`,1),Ge=i(`<aside class="detail-pane svelte-1cuomf" aria-label="Skill details"><div class="mobile-detail-nav svelte-1cuomf"><a class="mobile-back-button svelte-1cuomf"><svg viewBox="0 0 20 20" aria-hidden="true" class="svelte-1cuomf"><path d="m13 15-5-5 5-5"></path></svg> <span>Back to Skills list</span></a></div> <a class="detail-close svelte-1cuomf" aria-label="Close skill details"><svg viewBox="0 0 20 20" aria-hidden="true" class="svelte-1cuomf"><path d="m5 5 10 10M15 5 5 15"></path></svg></a> <!></aside>`),Ke=i(`<div class="status-banner error svelte-1cuomf" role="alert"> </div>`),qe=i(`<p class="repository-card-error svelte-1cuomf" role="alert"> </p>`),Je=i(`<div><div class="repository-card-header svelte-1cuomf"><strong class="svelte-1cuomf"> </strong> <span> </span></div> <dl class="repository-card-meta svelte-1cuomf"><div><dt class="svelte-1cuomf">Repository URL</dt><dd class="svelte-1cuomf"><code> </code></dd></div> <div><dt class="svelte-1cuomf">Ref</dt><dd class="svelte-1cuomf"><code> </code></dd></div> <div><dt class="svelte-1cuomf">Path</dt><dd class="svelte-1cuomf"><code> </code></dd></div></dl> <!></div>`),Ye=i(`<header class="repository-modal-header svelte-1cuomf"><h2 id="repository-modal-title" class="svelte-1cuomf">Configured repositories</h2> <p class="svelte-1cuomf">Skill repositories configured in <code>leitwerk.yaml</code>.</p></header> <!> <!> <div class="repository-modal-list svelte-1cuomf"></div> <footer class="repository-modal-footer svelte-1cuomf"><button class="secondary-action svelte-1cuomf" type="button"> </button> <button class="primary-action svelte-1cuomf" type="button">Done</button></footer>`,1),Xe=i(`<div class="skills-page svelte-1cuomf" data-page="skills"><section><!> <!> <div class="catalog-tabs svelte-1cuomf" role="group" aria-label="Skill catalog view"><button type="button" data-catalog-view="installed" class="svelte-1cuomf">Installed <span class="svelte-1cuomf"> </span></button> <button type="button" data-catalog-view="available" class="svelte-1cuomf">Available remotely <span class="svelte-1cuomf"> </span></button></div> <p class="view-explanation svelte-1cuomf"> </p> <div class="catalog-controls svelte-1cuomf"><label class="search-field svelte-1cuomf"><span class="sr-only">Search skills</span> <svg viewBox="0 0 20 20" aria-hidden="true" class="svelte-1cuomf"><circle cx="8.5" cy="8.5" r="5.5"></circle><path d="m13 13 4 4"></path></svg> <input type="search" class="svelte-1cuomf"/></label> <!> <span class="result-count svelte-1cuomf"> </span></div> <!></section> <!></div> <!>`,1);function U(i,f){b(f,!0);let se=(e,t=N)=>{let n=O(()=>t().value),r=O(()=>t().kind===`available`),i=O(()=>m(r)?t().value.repositoryId:t().value.sourceRepositoryId),o=O(()=>m(r)?null:t().value.registrationKind),c=O(()=>m(r)?t().value.sourceRevision:t().value.activeSourceRevision),d=O(()=>m(r)?ae(t().value.repositoryId,m(n).id):ie(m(n).id)),f=O(()=>m(ht)===`${t().kind}/${m(r)?`${t().value.repositoryId}/`:``}${m(n).id}`),p=O(()=>yt(m(n))),g=O(()=>m(o)===`configuration`?`Configuration`:m(ft).get(m(i)??``)??m(i)??`Repository`);var _=fe();let y;var b=s(_),S=s(b),w=s(S),T=s(w,!0);x(w);var E=h(w,2),D=s(E,!0);x(E),x(S),x(b);var k=h(b),A=s(k),j=s(A,!0);x(A);var F=h(A,2),I=s(F);x(F),x(k);var ee=h(k),L=s(ee),te=s(L,!0);x(L);var ne=h(L,2),re=e=>{u(e,de())};C(ne,e=>{m(r)&&t().value.conflict&&e(re)}),x(ee);var R=h(ee),z=s(R),se=s(z,!0);x(z);var ce=h(z),le=s(ce);x(ce),x(R);var ue=h(R),pe=s(ue),me=s(pe,!0);x(pe);var B=h(pe),V=s(B);x(B),x(ue),x(_),a((e,t)=>{y=M(_,1,`svelte-1cuomf`,null,y,{selected:m(f)}),v(S,`href`,m(d)),l(T,m(n).label),l(D,m(n).description??m(n).id),l(j,m(g)),l(I,`${e??``}${t??``}`),M(L,1,`status-chip ${m(p).className}`,`svelte-1cuomf`),l(te,m(p).label),l(se,m(n).usage.attachedLast30Days),l(le,`30d · ${m(n).usage.attachedAllTime??``} total`),l(me,m(n).usage.invokedLast30Days),l(V,`30d · ${m(n).usage.invokedAllTime??``} total`)},[()=>m(i)&&m(ft).get(m(i))&&m(ft).get(m(i))!==m(i)?`${m(i)} · `:``,()=>m(c)?.slice(0,8)??`local`]),P(`click`,_,e=>{e.target?.closest(`a, button, select, input`)||oe(e,m(d))}),P(`click`,S,e=>oe(e,m(d))),u(e,_)},me=(e,t=N)=>{let n=O(()=>m(pt).get(t().repositoryId));var r=pe(),i=s(r),o=h(s(i)),c=s(o,!0);x(o),x(i);var d=h(i),f=h(s(d)),p=s(f),g=s(p,!0);x(p),x(f),x(d);var _=h(d),v=h(s(_)),y=s(v),b=s(y,!0);x(y),x(v),x(_);var S=h(_),C=h(s(S)),w=s(C),T=s(w,!0);x(w),x(C),x(S);var E=h(S),D=h(s(E)),k=s(D),A=s(k,!0);x(k),x(D),x(E);var j=h(E),M=h(s(j)),P=s(M);x(M),x(j),x(r),a(()=>{l(c,m(n)?.label??t().repositoryId),l(g,m(n)?.ref??`—`),l(b,m(n)?.url??`—`),l(T,t().sourcePath),l(A,t().sourceRevision),l(P,`${t().usage.attachedAllTime??``} attached · ${t().usage.invokedAllTime??``} invoked`)}),u(e,r)},B=D(f,`detailKind`,3,null),V=D(f,`repositoryId`,3,null),H=D(f,`skillId`,3,null),U=A([]),W=A([]),G=A([]),K=A(null),Ze=A(`installed`),Qe=A(!0),q=A(!1),$e=A(!1),J=A(null),et=A(null),Y=A(null),X=A(null),Z=A(!1),tt=A(!1),Q=A(`overview`),nt=A(!1),rt=A(``),it=A(`all`),at=A(`available`),ot=0,st=null,ct=A(null),lt=A(null);function ut(e){let n=document.activeElement,r=n&&(n.tagName===`INPUT`||n.tagName===`SELECT`||n.tagName===`TEXTAREA`);e.key===`/`&&!r?(e.preventDefault(),st?.focus()):e.key===`Escape`&&(m(nt)?t(nt,!1):m(tt)?Ot():m(ht)&&z(R()))}let dt=O(()=>B()===`available`?`available`:B()===`installed`?`installed`:null),$=O(()=>m(dt)??m(Ze)),ft=O(()=>new Map(m(U).map(e=>[e.id,e.label]))),pt=O(()=>new Map(m(U).map(e=>[e.id,e]))),mt=O(()=>m(W).filter(e=>!e.registered)),ht=O(()=>H()?B()===`available`&&V()?`available/${V()}/${H()}`:B()===`installed`?`installed/${H()}`:null:null),gt=O(()=>{let e=m(rt).trim().toLocaleLowerCase();return m(G).filter(t=>!e||[t.label,t.id,t.description??``].join(` `).toLocaleLowerCase().includes(e))}),_t=O(()=>{let e=m(rt).trim().toLocaleLowerCase();return m(W).filter(t=>m(it)!==`all`&&t.repositoryId!==m(it)||m(at)===`available`&&t.registered||m(at)===`updates`&&!t.updateAvailable||m(at)===`invoked`&&t.usage.invokedLast30Days===0||m(at)===`stale`&&!t.stale?!1:!e||[t.label,t.id,t.description??``,m(ft).get(t.repositoryId)??``,t.repositoryId].join(` `).toLocaleLowerCase().includes(e))}),vt=O(()=>m($)===`installed`?m(gt).length:m(_t).length);function yt(e){return`stale`in e&&e.stale?{label:`No longer available`,className:`stale`}:e.updateAvailable?{label:`Update available`,className:`update`}:!(`registered`in e)||e.registered?{label:`Installed`,className:`registered`}:{label:`Available`,className:``}}let bt=O(()=>m(K)?yt(m(K).value):{label:``,className:``});function xt(e){t(U,e.repositories),t(W,e.availableSkills),t(G,e.installedSkills)}async function St(){t(Qe,m(G).length===0&&m(W).length===0,!0),t(J,null);try{xt(await re())}catch(e){t(J,e instanceof Error?e.message:`The skill catalog could not be loaded.`,!0)}finally{t(Qe,!1)}}async function Ct(){t(q,!0),t(J,null),t(X,null);try{xt(await F()),await Tt(),t(X,m(U).length===1?`Repository refresh complete.`:`${m(U).length} repository refreshes complete.`,!0)}catch(e){t(J,e instanceof Error?e.message:`Skill repositories could not be refreshed.`,!0)}finally{t(q,!1)}}async function wt(e,n,r){let i=++ot;t($e,!0),t(et,null),t(Y,null),t(tt,!1),t(Q,`overview`),t(K,null);try{if(e===`available`&&n){let e=await ne(n,r);i===ot&&t(K,{kind:`available`,value:e})}else if(e===`installed`){let e=await L(r);i===ot&&t(K,{kind:`installed`,value:e})}}catch(e){if(i!==ot)return;t(et,e instanceof Error?e.message:`Skill details could not be loaded.`,!0)}finally{i===ot&&t($e,!1)}}async function Tt(){B()&&H()&&await wt(B(),V(),H())}async function Et(e){let n=e??V();if(!n||!H())return;let r=!!m(K)?.value.updateAvailable;t(Z,!0),t(Y,null),t(X,null);try{await ee(n,H()),await St(),B()===`installed`?await wt(`installed`,null,H()):z(ie(H())),t(X,r?`Skill updated.`:`Skill installed.`,!0)}catch(e){t(Y,e instanceof Error?e.message:`The skill could not be registered.`,!0)}finally{t(Z,!1)}}async function Dt(){t(tt,!0),await o(),m(lt)?.focus()}async function Ot(){t(tt,!1),await o(),m(ct)?.focus()}async function kt(){if(!H())return;let e=m(K)?.value.label??H();t(Z,!0),t(Y,null),t(X,null);try{await I(H()),t(tt,!1),await St(),z(R()),t(X,`${e} removed from future runs.`)}catch(e){t(Y,e instanceof Error?e.message:`The skill could not be removed.`,!0)}finally{t(Z,!1)}}function At(e){if(!e.startsWith(`---`))return e;let t=e.indexOf(`
1
+ import{t as e}from"./ChronicleMarkdown-iH1VLv7x.js";import{$ as t,B as n,E as r,F as i,G as a,H as o,J as s,K as c,M as l,N as u,P as d,R as f,U as p,V as m,X as h,Y as g,a as _,d as v,dt as y,ft as b,gt as x,ht as S,k as C,m as w,n as T,q as E,r as D,rt as O,s as k,tt as A,u as j,v as M,vt as N,z as P}from"./index-client-BqF3_t3P.js";import{A as F,M as I,j as ee,o as L,q as te,v as ne,y as re}from"./api-HGtUzekR.js";import{f as R,l as ie,o as ae,r as z,t as oe,u as se}from"./router.svelte-C2wi6I7k.js";import{t as ce}from"./index-ChVsVf6R.js";import{t as le}from"./PageHeader-C4j3zJKF.js";var ue=(e,t=N)=>{var n=H(),i=h(s(n)),o=e=>{u(e,me())},c=e=>{var n=V();r(n,21,t,e=>e.instanceId,(e,t)=>{var n=B(),r=s(n),i=s(r),o=s(i,!0);x(i);var c=h(i),d=s(c);x(c),x(r);var f=h(r),p=s(f);x(f),x(n),a((e,r)=>{v(n,`href`,e),l(o,m(t).title),l(d,`Attached ${r??``}`),l(p,`${m(t).invocationCount??``} ${m(t).invocationCount===1?`invocation`:`invocations`}`)},[()=>se(m(t).instanceId),()=>te(m(t).attachedAt)]),P(`click`,n,e=>oe(e,se(m(t).instanceId))),u(e,n)}),x(n),u(e,n)};C(i,e=>{t().length===0?e(o):e(c,-1)}),x(n),u(e,n)},de=i(`<span class="conflict svelte-1cuomf">ID conflict</span>`),fe=i(`<tr><td class="svelte-1cuomf"><a class="svelte-1cuomf"><strong class="svelte-1cuomf"> </strong> <span class="svelte-1cuomf"> </span></a></td><td class="svelte-1cuomf"><span class="svelte-1cuomf"> </span> <code class="svelte-1cuomf"> </code></td><td class="svelte-1cuomf"><span> </span> <!></td><td class="svelte-1cuomf"><strong class="svelte-1cuomf"> </strong><span class="svelte-1cuomf"> </span></td><td class="svelte-1cuomf"><strong class="svelte-1cuomf"> </strong><span class="svelte-1cuomf"> </span></td></tr>`),pe=i(`<dl class="detail-meta svelte-1cuomf"><div class="svelte-1cuomf"><dt class="svelte-1cuomf">Repository</dt><dd class="svelte-1cuomf"> </dd></div><div class="svelte-1cuomf"><dt class="svelte-1cuomf">Configured ref</dt><dd class="svelte-1cuomf"><code class="svelte-1cuomf"> </code></dd></div><div class="full svelte-1cuomf"><dt class="svelte-1cuomf">Repository URL</dt><dd class="svelte-1cuomf"><code class="svelte-1cuomf"> </code></dd></div><div class="svelte-1cuomf"><dt class="svelte-1cuomf">Source path</dt><dd class="svelte-1cuomf"><code class="svelte-1cuomf"> </code></dd></div><div class="svelte-1cuomf"><dt class="svelte-1cuomf">Discovered revision</dt><dd class="svelte-1cuomf"><code class="svelte-1cuomf"> </code></dd></div><div class="svelte-1cuomf"><dt class="svelte-1cuomf">Usage</dt><dd class="svelte-1cuomf"> </dd></div></dl>`),me=i(`<p class="svelte-1cuomf">No process has attached this skill yet.</p>`),B=i(`<a class="svelte-1cuomf"><span class="svelte-1cuomf"><strong class="svelte-1cuomf"> </strong><small class="svelte-1cuomf"> </small></span><span class="invocation-count svelte-1cuomf"> </span></a>`),V=i(`<div class="process-usage-list svelte-1cuomf"></div>`),H=i(`<section class="usage-section svelte-1cuomf"><h3 class="svelte-1cuomf">Process usage</h3><!></section>`),he=i(`<button class="page-header-button svelte-1cuomf" type="button"> </button>`),ge=i(`<div class="status-banner success svelte-1cuomf" role="status"> </div>`),_e=i(`<option> </option>`),ve=i(`<label class="svelte-1cuomf"><span class="sr-only">Repository</span><select class="svelte-1cuomf"><option>All repositories</option><!></select></label> <label class="svelte-1cuomf"><span class="sr-only">Remote skill state</span><select class="svelte-1cuomf"><option>Not installed</option><option>All states</option><option>Updates available</option><option>Invoked in 30 days</option><option>No longer available</option></select></label>`,1),ye=i(`<div class="catalog-state svelte-1cuomf" role="status">Loading the skill catalog…</div>`),be=i(`<div class="catalog-state error svelte-1cuomf" role="alert"><strong class="svelte-1cuomf">We couldn't load the skill catalog.</strong><span> </span></div>`),xe=i(`<div class="catalog-state svelte-1cuomf"><strong class="svelte-1cuomf">No skills are installed.</strong><span>Open Available remotely to pull a skill, or configure a direct skill in <code>leitwerk.yaml</code>.</span></div>`),Se=i(`<div class="catalog-state svelte-1cuomf"><strong class="svelte-1cuomf">No skill repositories are configured.</strong><span>Add <code>skill_repositories</code> to <code>leitwerk.yaml</code>, then restart Leitwerk.</span></div>`),Ce=i(`<div class="catalog-state svelte-1cuomf"><strong class="svelte-1cuomf">No remote skills were discovered.</strong><span>Check repository paths and ensure each skill contains a root <code>SKILL.md</code>.</span></div>`),we=i(`<div class="catalog-state svelte-1cuomf"><strong class="svelte-1cuomf">No skills match these filters.</strong><span>Clear the search or broaden the selected state.</span></div>`),Te=i(`<p class="inline-error svelte-1cuomf" role="status"> </p>`),Ee=i(`<!> <div class="skill-table-wrap svelte-1cuomf"><table class="skill-table svelte-1cuomf"><thead><tr><th class="svelte-1cuomf">Skill</th><th class="svelte-1cuomf"> </th><th class="svelte-1cuomf">Status</th><th class="svelte-1cuomf">Attached</th><th class="svelte-1cuomf">Invoked</th></tr></thead><tbody class="svelte-1cuomf"><!></tbody></table></div>`,1),De=i(`<div class="detail-state svelte-1cuomf" role="status">Loading skill details…</div>`),Oe=i(`<div class="detail-state error svelte-1cuomf" aria-live="polite"> </div>`),ke=i(`<div class="status-banner success detail-feedback svelte-1cuomf" role="status"> </div>`),Ae=i(`<p class="action-note warning svelte-1cuomf">This revision was not found during the latest successful repository refresh. It remains visible for history but cannot be installed or updated.</p>`),je=i(`<p class="action-note warning svelte-1cuomf">This skill ID conflicts with another repository or a configuration-managed skill. Resolve the conflict before installing it.</p>`),Me=i(`<div class="detail-actions svelte-1cuomf"><button class="primary-action svelte-1cuomf" type="button"> </button></div> <!> <!>`,1),Ne=i(`<button class="primary-action svelte-1cuomf" type="button"> </button>`),Pe=i(`<button class="secondary-action danger svelte-1cuomf" type="button">Remove</button>`),Fe=i(`<p class="action-note svelte-1cuomf">This skill is managed by <code>leitwerk.yaml</code>. Change configuration to remove or update it.</p>`),Ie=i(`<div class="remove-confirmation svelte-1cuomf" role="group"><strong> </strong><p class="svelte-1cuomf">Existing processes and schedules keep their pinned revision.</p><div class="svelte-1cuomf"><button class="danger-action svelte-1cuomf" type="button"> </button><button class="secondary-action svelte-1cuomf" type="button">Cancel</button></div></div>`),Le=i(`<div class="detail-actions svelte-1cuomf"><!> <!></div> <!> <!>`,1),Re=i(`<p class="action-note error svelte-1cuomf" role="alert"> </p>`),ze=i(`<span class="status-chip registered svelte-1cuomf">Active</span>`),Be=i(`<div class="svelte-1cuomf"><span class="svelte-1cuomf"><code class="svelte-1cuomf"> </code><small class="svelte-1cuomf"> </small></span><!></div>`),Ve=i(`<dl class="detail-meta svelte-1cuomf"><div class="svelte-1cuomf"><dt class="svelte-1cuomf">Managed by</dt><dd class="svelte-1cuomf"> </dd></div><div class="svelte-1cuomf"><dt class="svelte-1cuomf">Active revision</dt><dd class="svelte-1cuomf"><code class="svelte-1cuomf"> </code></dd></div><div class="svelte-1cuomf"><dt class="svelte-1cuomf">Usage</dt><dd class="svelte-1cuomf"> </dd></div></dl> <section class="revision-section svelte-1cuomf"><h3 class="svelte-1cuomf">Revision history</h3><div class="revision-list svelte-1cuomf"></div></section>`,1),He=i(`<div id="skill-overview" role="tabpanel"><!> <!></div>`),Ue=i(`<section id="skill-instructions" class="instructions-section svelte-1cuomf" role="tabpanel"><h3 class="svelte-1cuomf">Instructions</h3><!></section>`),We=i(`<header class="detail-header svelte-1cuomf"><div><h2 class="svelte-1cuomf"> </h2><p class="svelte-1cuomf"> </p></div><span> </span></header> <!> <!> <!> <div class="detail-tabs svelte-1cuomf" role="tablist" aria-label="Skill detail sections"><button type="button" role="tab" aria-controls="skill-overview" class="svelte-1cuomf">Overview</button> <button type="button" role="tab" aria-controls="skill-instructions" class="svelte-1cuomf">Instructions</button></div> <!>`,1),Ge=i(`<aside class="detail-pane svelte-1cuomf" aria-label="Skill details"><div class="mobile-detail-nav svelte-1cuomf"><a class="mobile-back-button svelte-1cuomf"><svg viewBox="0 0 20 20" aria-hidden="true" class="svelte-1cuomf"><path d="m13 15-5-5 5-5"></path></svg> <span>Back to Skills list</span></a></div> <a class="detail-close svelte-1cuomf" aria-label="Close skill details"><svg viewBox="0 0 20 20" aria-hidden="true" class="svelte-1cuomf"><path d="m5 5 10 10M15 5 5 15"></path></svg></a> <!></aside>`),Ke=i(`<div class="status-banner error svelte-1cuomf" role="alert"> </div>`),qe=i(`<p class="repository-card-error svelte-1cuomf" role="alert"> </p>`),Je=i(`<div><div class="repository-card-header svelte-1cuomf"><strong class="svelte-1cuomf"> </strong> <span> </span></div> <dl class="repository-card-meta svelte-1cuomf"><div><dt class="svelte-1cuomf">Repository URL</dt><dd class="svelte-1cuomf"><code> </code></dd></div> <div><dt class="svelte-1cuomf">Ref</dt><dd class="svelte-1cuomf"><code> </code></dd></div> <div><dt class="svelte-1cuomf">Path</dt><dd class="svelte-1cuomf"><code> </code></dd></div></dl> <!></div>`),Ye=i(`<header class="repository-modal-header svelte-1cuomf"><h2 id="repository-modal-title" class="svelte-1cuomf">Configured repositories</h2> <p class="svelte-1cuomf">Skill repositories configured in <code>leitwerk.yaml</code>.</p></header> <!> <!> <div class="repository-modal-list svelte-1cuomf"></div> <footer class="repository-modal-footer svelte-1cuomf"><button class="secondary-action svelte-1cuomf" type="button"> </button> <button class="primary-action svelte-1cuomf" type="button">Done</button></footer>`,1),Xe=i(`<div class="skills-page svelte-1cuomf" data-page="skills"><section><!> <!> <div class="catalog-tabs svelte-1cuomf" role="group" aria-label="Skill catalog view"><button type="button" data-catalog-view="installed" class="svelte-1cuomf">Installed <span class="svelte-1cuomf"> </span></button> <button type="button" data-catalog-view="available" class="svelte-1cuomf">Available remotely <span class="svelte-1cuomf"> </span></button></div> <p class="view-explanation svelte-1cuomf"> </p> <div class="catalog-controls svelte-1cuomf"><label class="search-field svelte-1cuomf"><span class="sr-only">Search skills</span> <svg viewBox="0 0 20 20" aria-hidden="true" class="svelte-1cuomf"><circle cx="8.5" cy="8.5" r="5.5"></circle><path d="m13 13 4 4"></path></svg> <input type="search" class="svelte-1cuomf"/></label> <!> <span class="result-count svelte-1cuomf"> </span></div> <!></section> <!></div> <!>`,1);function U(i,f){b(f,!0);let se=(e,t=N)=>{let n=O(()=>t().value),r=O(()=>t().kind===`available`),i=O(()=>m(r)?t().value.repositoryId:t().value.sourceRepositoryId),o=O(()=>m(r)?null:t().value.registrationKind),c=O(()=>m(r)?t().value.sourceRevision:t().value.activeSourceRevision),d=O(()=>m(r)?ae(t().value.repositoryId,m(n).id):ie(m(n).id)),f=O(()=>m(ht)===`${t().kind}/${m(r)?`${t().value.repositoryId}/`:``}${m(n).id}`),p=O(()=>yt(m(n))),g=O(()=>m(o)===`configuration`?`Configuration`:m(ft).get(m(i)??``)??m(i)??`Repository`);var _=fe();let y;var b=s(_),S=s(b),w=s(S),T=s(w,!0);x(w);var E=h(w,2),D=s(E,!0);x(E),x(S),x(b);var k=h(b),A=s(k),j=s(A,!0);x(A);var F=h(A,2),I=s(F);x(F),x(k);var ee=h(k),L=s(ee),te=s(L,!0);x(L);var ne=h(L,2),re=e=>{u(e,de())};C(ne,e=>{m(r)&&t().value.conflict&&e(re)}),x(ee);var R=h(ee),z=s(R),se=s(z,!0);x(z);var ce=h(z),le=s(ce);x(ce),x(R);var ue=h(R),pe=s(ue),me=s(pe,!0);x(pe);var B=h(pe),V=s(B);x(B),x(ue),x(_),a((e,t)=>{y=M(_,1,`svelte-1cuomf`,null,y,{selected:m(f)}),v(S,`href`,m(d)),l(T,m(n).label),l(D,m(n).description??m(n).id),l(j,m(g)),l(I,`${e??``}${t??``}`),M(L,1,`status-chip ${m(p).className}`,`svelte-1cuomf`),l(te,m(p).label),l(se,m(n).usage.attachedLast30Days),l(le,`30d · ${m(n).usage.attachedAllTime??``} total`),l(me,m(n).usage.invokedLast30Days),l(V,`30d · ${m(n).usage.invokedAllTime??``} total`)},[()=>m(i)&&m(ft).get(m(i))&&m(ft).get(m(i))!==m(i)?`${m(i)} · `:``,()=>m(c)?.slice(0,8)??`local`]),P(`click`,_,e=>{e.target?.closest(`a, button, select, input`)||oe(e,m(d))}),P(`click`,S,e=>oe(e,m(d))),u(e,_)},me=(e,t=N)=>{let n=O(()=>m(pt).get(t().repositoryId));var r=pe(),i=s(r),o=h(s(i)),c=s(o,!0);x(o),x(i);var d=h(i),f=h(s(d)),p=s(f),g=s(p,!0);x(p),x(f),x(d);var _=h(d),v=h(s(_)),y=s(v),b=s(y,!0);x(y),x(v),x(_);var S=h(_),C=h(s(S)),w=s(C),T=s(w,!0);x(w),x(C),x(S);var E=h(S),D=h(s(E)),k=s(D),A=s(k,!0);x(k),x(D),x(E);var j=h(E),M=h(s(j)),P=s(M);x(M),x(j),x(r),a(()=>{l(c,m(n)?.label??t().repositoryId),l(g,m(n)?.ref??`—`),l(b,m(n)?.url??`—`),l(T,t().sourcePath),l(A,t().sourceRevision),l(P,`${t().usage.attachedAllTime??``} attached · ${t().usage.invokedAllTime??``} invoked`)}),u(e,r)},B=D(f,`detailKind`,3,null),V=D(f,`repositoryId`,3,null),H=D(f,`skillId`,3,null),U=A([]),W=A([]),G=A([]),K=A(null),Ze=A(`installed`),Qe=A(!0),q=A(!1),$e=A(!1),J=A(null),et=A(null),Y=A(null),X=A(null),Z=A(!1),tt=A(!1),Q=A(`overview`),nt=A(!1),rt=A(``),it=A(`all`),at=A(`available`),ot=0,st=null,ct=A(null),lt=A(null);function ut(e){let n=document.activeElement,r=n&&(n.tagName===`INPUT`||n.tagName===`SELECT`||n.tagName===`TEXTAREA`);e.key===`/`&&!r?(e.preventDefault(),st?.focus()):e.key===`Escape`&&(m(nt)?t(nt,!1):m(tt)?Ot():m(ht)&&z(R()))}let dt=O(()=>B()===`available`?`available`:B()===`installed`?`installed`:null),$=O(()=>m(dt)??m(Ze)),ft=O(()=>new Map(m(U).map(e=>[e.id,e.label]))),pt=O(()=>new Map(m(U).map(e=>[e.id,e]))),mt=O(()=>m(W).filter(e=>!e.registered)),ht=O(()=>H()?B()===`available`&&V()?`available/${V()}/${H()}`:B()===`installed`?`installed/${H()}`:null:null),gt=O(()=>{let e=m(rt).trim().toLocaleLowerCase();return m(G).filter(t=>!e||[t.label,t.id,t.description??``].join(` `).toLocaleLowerCase().includes(e))}),_t=O(()=>{let e=m(rt).trim().toLocaleLowerCase();return m(W).filter(t=>m(it)!==`all`&&t.repositoryId!==m(it)||m(at)===`available`&&t.registered||m(at)===`updates`&&!t.updateAvailable||m(at)===`invoked`&&t.usage.invokedLast30Days===0||m(at)===`stale`&&!t.stale?!1:!e||[t.label,t.id,t.description??``,m(ft).get(t.repositoryId)??``,t.repositoryId].join(` `).toLocaleLowerCase().includes(e))}),vt=O(()=>m($)===`installed`?m(gt).length:m(_t).length);function yt(e){return`stale`in e&&e.stale?{label:`No longer available`,className:`stale`}:e.updateAvailable?{label:`Update available`,className:`update`}:!(`registered`in e)||e.registered?{label:`Installed`,className:`registered`}:{label:`Available`,className:``}}let bt=O(()=>m(K)?yt(m(K).value):{label:``,className:``});function xt(e){t(U,e.repositories),t(W,e.availableSkills),t(G,e.installedSkills)}async function St(){t(Qe,m(G).length===0&&m(W).length===0,!0),t(J,null);try{xt(await re())}catch(e){t(J,e instanceof Error?e.message:`The skill catalog could not be loaded.`,!0)}finally{t(Qe,!1)}}async function Ct(){t(q,!0),t(J,null),t(X,null);try{xt(await F()),await Tt(),t(X,m(U).length===1?`Repository refresh complete.`:`${m(U).length} repository refreshes complete.`,!0)}catch(e){t(J,e instanceof Error?e.message:`Skill repositories could not be refreshed.`,!0)}finally{t(q,!1)}}async function wt(e,n,r){let i=++ot;t($e,!0),t(et,null),t(Y,null),t(tt,!1),t(Q,`overview`),t(K,null);try{if(e===`available`&&n){let e=await ne(n,r);i===ot&&t(K,{kind:`available`,value:e})}else if(e===`installed`){let e=await L(r);i===ot&&t(K,{kind:`installed`,value:e})}}catch(e){if(i!==ot)return;t(et,e instanceof Error?e.message:`Skill details could not be loaded.`,!0)}finally{i===ot&&t($e,!1)}}async function Tt(){B()&&H()&&await wt(B(),V(),H())}async function Et(e){let n=e??V();if(!n||!H())return;let r=!!m(K)?.value.updateAvailable;t(Z,!0),t(Y,null),t(X,null);try{await ee(n,H()),await St(),B()===`installed`?await wt(`installed`,null,H()):z(ie(H())),t(X,r?`Skill updated.`:`Skill installed.`,!0)}catch(e){t(Y,e instanceof Error?e.message:`The skill could not be registered.`,!0)}finally{t(Z,!1)}}async function Dt(){t(tt,!0),await o(),m(lt)?.focus()}async function Ot(){t(tt,!1),await o(),m(ct)?.focus()}async function kt(){if(!H())return;let e=m(K)?.value.label??H();t(Z,!0),t(Y,null),t(X,null);try{await I(H()),t(tt,!1),await St(),z(R()),t(X,`${e} removed from future runs.`)}catch(e){t(Y,e instanceof Error?e.message:`The skill could not be removed.`,!0)}finally{t(Z,!1)}}function At(e){if(!e.startsWith(`---`))return e;let t=e.indexOf(`
2
2
  ---`,3);return t<0?e:e.slice(t+4).trimStart()}function jt(e){t(Ze,e,!0),m(ht)&&z(R())}function Mt(e){if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`)return;e.preventDefault(),t(Q,m(Q)===`overview`?`instructions`:`overview`,!0);let n=e.currentTarget.parentElement?.querySelectorAll(`[role="tab"]`);o().then(()=>n?.[m(Q)===`overview`?0:1]?.focus())}T(()=>{St()}),c(()=>{let e=B(),n=H(),r=V();e&&n?p(()=>wt(e,r,n)):(ot+=1,t(K,null),t($e,!1))});var Nt=Xe();n(`keydown`,E,ut);var Pt=g(Nt),Ft=s(Pt);let It;var Lt=s(Ft);le(Lt,{title:`Skills`,subtitle:`Manage skills imported into Leitwerk and discover new ones from configured repositories.`,actions:e=>{var n=d(),r=g(n),i=e=>{var n=he(),r=s(n);x(n),a(()=>l(r,`Repositories (${m(U).length??``})`)),P(`click`,n,()=>t(nt,!0)),u(e,n)};C(r,e=>{m(U).length>0&&e(i)}),u(e,n)},$$slots:{actions:!0}});var Rt=h(Lt,2),zt=e=>{var t=ge(),n=s(t,!0);x(t),a(()=>l(n,m(X))),u(e,t)};C(Rt,e=>{m(X)&&!m(ht)&&e(zt)});var Bt=h(Rt,2),Vt=s(Bt),Ht=h(s(Vt)),Ut=s(Ht,!0);x(Ht),x(Vt);var Wt=h(Vt,2),Gt=h(s(Wt)),Kt=s(Gt,!0);x(Gt),x(Wt),x(Bt);var qt=h(Bt,2),Jt=s(qt,!0);x(qt);var Yt=h(qt,2),Xt=s(Yt),Zt=h(s(Xt),4);j(Zt),_(Zt,e=>st=e,()=>st),x(Xt);var Qt=h(Xt,2),$t=e=>{var n=ve(),i=g(n),o=h(s(i)),c=s(o);c.value=c.__value=`all`,r(h(c),17,()=>m(U),e=>e.id,(e,t)=>{var n=_e(),r=s(n,!0);x(n);var i={};a(()=>{l(r,m(t).label===m(t).id?m(t).label:`${m(t).label} (${m(t).id})`),i!==(i=m(t).id)&&(n.value=(n.__value=m(t).id)??``)}),u(e,n)}),x(o),x(i);var d=h(i,2),f=h(s(d)),p=s(f);p.value=p.__value=`available`;var _=h(p);_.value=_.__value=`all`;var v=h(_);v.value=v.__value=`updates`;var y=h(v);y.value=y.__value=`invoked`;var b=h(y);b.value=b.__value=`stale`,x(f),x(d),w(o,()=>m(it),e=>t(it,e)),w(f,()=>m(at),e=>t(at,e)),u(e,n)};C(Qt,e=>{m($)===`available`&&e($t)});var en=h(Qt,2),tn=s(en);x(en),x(Yt);var nn=h(Yt,2),rn=e=>{u(e,ye())},an=e=>{var t=be(),n=h(s(t)),r=s(n,!0);x(n),x(t),a(()=>l(r,m(J))),u(e,t)},on=e=>{u(e,xe())},sn=e=>{u(e,Se())},cn=e=>{u(e,Ce())},ln=e=>{u(e,we())},un=e=>{var t=Ee(),n=g(t),i=e=>{var t=Te(),n=s(t);x(t),a(()=>l(n,`${m(J)??``} Showing the last catalog we loaded.`)),u(e,t)};C(n,e=>{m(J)&&e(i)});var o=h(n,2),c=s(o),f=s(c),p=s(f),_=h(s(p)),v=s(_,!0);x(_),S(3),x(p),x(f);var y=h(f),b=s(y),w=e=>{var t=d();r(g(t),17,()=>m(gt),e=>e.id,(e,t)=>{se(e,()=>({kind:`installed`,value:m(t)}))}),u(e,t)},T=e=>{var t=d();r(g(t),17,()=>m(_t),e=>`${e.repositoryId}/${e.id}`,(e,t)=>{se(e,()=>({kind:`available`,value:m(t)}))}),u(e,t)};C(b,e=>{m($)===`installed`?e(w):e(T,-1)}),x(y),x(c),x(o),a(()=>l(v,m($)===`installed`?`Managed by`:`Repository`)),u(e,t)};C(nn,e=>{m(Qe)?e(rn):m(J)&&m(G).length===0&&m(W).length===0?e(an,1):m($)===`installed`&&m(G).length===0?e(on,2):m($)===`available`&&m(U).length===0?e(sn,3):m($)===`available`&&m(W).length===0?e(cn,4):m(vt)===0?e(ln,5):e(un,-1)}),x(Ft);var dn=h(Ft,2),fn=n=>{var i=Ge(),o=s(i),c=s(o);x(o);var d=h(o,2),f=h(d,2),p=e=>{u(e,De())},y=e=>{var t=Oe(),n=s(t,!0);x(t),a(()=>l(n,m(et)??`Skill details are unavailable.`)),u(e,t)},b=n=>{var i=We(),o=g(i),c=s(o),d=s(c),f=s(d,!0);x(d);var p=h(d),y=s(p,!0);x(p),x(c);var b=h(c),S=s(b,!0);x(b),x(o);var w=h(o,2),T=e=>{var t=ke(),n=s(t,!0);x(t),a(()=>l(n,m(X))),u(e,t)};C(w,e=>{m(X)&&e(T)});var E=h(w,2),D=e=>{var t=Me(),n=g(t),r=s(n),i=s(r,!0);x(r),x(n);var o=h(n,2),c=e=>{u(e,Ae())};C(o,e=>{m(K).value.stale&&e(c)});var d=h(o,2),f=e=>{u(e,je())};C(d,e=>{m(K).value.conflict&&e(f)}),a(()=>{r.disabled=m(Z)||m(K).value.stale||m(K).value.conflict||m(K).value.registered&&!m(K).value.updateAvailable,l(i,m(Z)?`Working…`:m(K).value.updateAvailable?`Update skill`:m(K).value.registered?`Already installed`:`Install skill`)}),P(`click`,r,()=>void Et()),u(e,t)},k=e=>{var n=Le(),r=g(n),i=s(r),o=e=>{var t=Ne(),n=s(t,!0);x(t),a(()=>{t.disabled=m(Z),l(n,m(Z)?`Updating…`:`Update skill`)}),P(`click`,t,()=>void Et(m(K).value.sourceRepositoryId)),u(e,t)};C(i,e=>{m(K).value.updateAvailable&&m(K).value.sourceRepositoryId&&e(o)});var c=h(i,2),d=e=>{var n=Pe();_(n,e=>t(ct,e),()=>m(ct)),a(()=>n.disabled=m(Z)),P(`click`,n,()=>void Dt()),u(e,n)};C(c,e=>{m(K).value.registrationKind===`catalog`&&e(d)}),x(r);var f=h(r,2),p=e=>{u(e,Fe())};C(f,e=>{m(K).value.registrationKind===`configuration`&&e(p)});var y=h(f,2),b=e=>{var n=Ie(),r=s(n),i=s(r);x(r);var o=h(r,2),c=s(o),d=s(c,!0);x(c),_(c,e=>t(lt,e),()=>m(lt));var f=h(c);x(o),x(n),a(()=>{v(n,`aria-label`,`Remove ${m(K).value.label}`),l(i,`Remove ${m(K).value.label??``} from future runs?`),c.disabled=m(Z),l(d,m(Z)?`Removing…`:`Confirm removal`),f.disabled=m(Z)}),P(`click`,c,()=>void kt()),P(`click`,f,()=>void Ot()),u(e,n)};C(y,e=>{m(tt)&&e(b)}),u(e,n)};C(E,e=>{m(K).kind===`available`?e(D):e(k,-1)});var A=h(E,2),j=e=>{var t=Re(),n=s(t);x(t),a(()=>l(n,`${m(Y)??``} Try again.`)),u(e,t)};C(A,e=>{m(Y)&&e(j)});var N=h(A,2),F=s(N),I=h(F,2);x(N);var ee=h(N,2),L=e=>{var t=He(),n=s(t),i=e=>{me(e,()=>m(K).value)},o=e=>{var t=Ve(),n=g(t),i=s(n),o=h(s(i)),c=s(o,!0);x(o),x(i);var d=h(i),f=h(s(d)),p=s(f),_=s(p,!0);x(p),x(f),x(d);var v=h(d),y=h(s(v)),b=s(y);x(y),x(v),x(n);var S=h(n,2),w=h(s(S));r(w,21,()=>m(K).value.revisions,e=>e.id,(e,t)=>{var n=Be(),r=s(n),i=s(r),o=s(i,!0);x(i);var c=h(i),d=s(c);x(c),x(r);var f=h(r),p=e=>{u(e,ze())};C(f,e=>{m(t).active&&e(p)}),x(n),a(e=>{l(o,m(t).sourceRevision??m(t).id),l(d,`Imported ${e??``}`)},[()=>te(m(t).importedAt)]),u(e,n)}),x(w),x(S),a(e=>{l(c,e),l(_,m(K).value.activeSourceRevision??m(K).value.activeRevisionId),l(b,`${m(K).value.usage.attachedAllTime??``} attached · ${m(K).value.usage.invokedAllTime??``} invoked`)},[()=>m(K).value.registrationKind===`configuration`?`Configuration`:m(ft).get(m(K).value.sourceRepositoryId??``)??m(K).value.sourceRepositoryId??`Repository`]),u(e,t)};C(n,e=>{m(K).kind===`available`?e(i):e(o,-1)}),ue(h(n,2),()=>m(K).value.processes),x(t),u(e,t)},ne=t=>{var n=Ue(),r=h(s(n));{let t=O(()=>At(m(K).value.skillMarkdown));e(r,{get markdown(){return m(t)}})}x(n),u(t,n)};C(ee,e=>{m(Q)===`overview`?e(L):e(ne,-1)}),a(()=>{l(f,m(K).value.label),l(y,m(K).value.description??m(K).value.id),M(b,1,`status-chip ${m(bt).className}`,`svelte-1cuomf`),l(S,m(bt).label),v(F,`aria-selected`,m(Q)===`overview`),v(F,`tabindex`,m(Q)===`overview`?0:-1),v(I,`aria-selected`,m(Q)===`instructions`),v(I,`tabindex`,m(Q)===`instructions`?0:-1)}),P(`click`,F,()=>t(Q,`overview`)),P(`keydown`,F,Mt),P(`click`,I,()=>t(Q,`instructions`)),P(`keydown`,I,Mt),u(n,i)};C(f,e=>{m($e)?e(p):m(et)||!m(K)?e(y,1):e(b,-1)}),x(i),a((e,t)=>{v(c,`href`,e),v(d,`href`,t)},[()=>R(),()=>R()]),P(`click`,c,e=>oe(e,R())),P(`click`,d,e=>oe(e,R())),u(n,i)};C(dn,e=>{m(ht)&&e(fn)}),x(Pt),ce(h(Pt,2),{get open(){return m(nt)},titleId:`repository-modal-title`,closeLabel:`Close configured repositories`,onClose:()=>t(nt,!1),dataSection:`repository-modal`,children:(e,n)=>{var i=Ye(),o=h(g(i),2),c=e=>{var t=ge(),n=s(t,!0);x(t),a(()=>l(n,m(X))),u(e,t)};C(o,e=>{m(X)&&e(c)});var d=h(o,2),f=e=>{var t=Ke(),n=s(t);x(t),a(()=>l(n,`${m(J)??``} Check the repository configuration and try again.`)),u(e,t)};C(d,e=>{m(J)&&e(f)});var p=h(d,2);r(p,21,()=>m(U),e=>e.id,(e,t)=>{var n=Je();let r;var i=s(n),o=s(i),c=s(o,!0);x(o);var d=h(o,2);let f;var p=s(d,!0);x(d),x(i);var g=h(i,2),_=s(g),v=h(s(_)),y=s(v),b=s(y,!0);x(y),x(v),x(_);var S=h(_,2),w=h(s(S)),T=s(w),E=s(T,!0);x(T),x(w),x(S);var D=h(S,2),O=h(s(D)),k=s(O),A=s(k,!0);x(k),x(O),x(D),x(g);var j=h(g,2),N=e=>{var n=qe(),r=s(n,!0);x(n),a(()=>l(r,m(t).error)),u(e,n)};C(j,e=>{m(t).error&&e(N)}),x(n),a((e,i,a)=>{r=M(n,1,`repository-card svelte-1cuomf`,null,r,e),l(c,m(t).label===m(t).id?m(t).label:`${m(t).label} (${m(t).id})`),f=M(d,1,`repository-sync-chip svelte-1cuomf`,null,f,i),l(p,a),l(b,m(t).url),l(E,m(t).ref),l(A,m(t).path)},[()=>({error:!!m(t).error,refreshing:m(q)}),()=>({"error-chip":!!m(t).error}),()=>m(q)?`Refreshing…`:m(t).error?`Refresh failed`:m(t).lastRefreshedAt?`Synced ${te(m(t).lastRefreshedAt)}`:`Not refreshed`]),u(e,n)}),x(p);var _=h(p,2),v=s(_),y=s(v,!0);x(v);var b=h(v,2);x(_),a(()=>{v.disabled=m(q)||m(U).length===0,l(y,m(q)?`Refreshing…`:`Refresh all`)}),P(`click`,v,()=>void Ct()),P(`click`,b,()=>t(nt,!1)),u(e,i)},$$slots:{default:!0}}),a(e=>{It=M(Ft,1,`catalog-pane svelte-1cuomf`,null,It,e),v(Vt,`aria-pressed`,m($)===`installed`),l(Ut,m(G).length),v(Wt,`aria-pressed`,m($)===`available`),l(Kt,m(mt).length),l(Jt,m($)===`installed`?`Installed skills are available to attach to new process launches.`:`Remote skills must be installed before they can be attached to a process.`),v(Zt,`placeholder`,m($)===`installed`?`Search installed skills`:`Search remote skills`),l(tn,`${m(vt)??``} ${m(vt)===1?`skill`:`skills`}`)},[()=>({"with-detail":!!m(ht)})]),P(`click`,Vt,()=>jt(`installed`)),P(`click`,Wt,()=>jt(`available`)),k(Zt,()=>m(rt),e=>t(rt,e)),u(i,Nt),y()}f([`click`,`keydown`]);export{U as default};
@@ -0,0 +1 @@
1
+ import{$ as e,D as t,E as n,F as r,G as i,J as a,K as o,L as s,M as c,N as l,R as u,V as d,X as f,Y as p,Z as m,d as h,dt as g,ft as _,gt as v,k as y,tt as b,v as x,z as S}from"./index-client-BqF3_t3P.js";import{x as C}from"./api-HGtUzekR.js";import{t as w}from"./PageHeader-C4j3zJKF.js";var T=r(`<button type="button" class="page-header-button" data-pressable="true">Refresh</button>`),E=r(`<div class="state-card svelte-1in03l4">Loading watcher registrations…</div>`),D=r(`<div class="state-card error svelte-1in03l4" role="alert"><p class="state-title svelte-1in03l4">We couldn't load the watcher registry.</p> <p class="svelte-1in03l4"> </p></div>`),O=r(`<div class="state-card svelte-1in03l4"><p class="state-title svelte-1in03l4">No watchers are currently registered.</p> <p class="svelte-1in03l4">Configure process watchers in <code class="svelte-1in03l4">leitwerk.yaml</code> to see them here.</p></div>`),k=r(`<p class="refresh-error svelte-1in03l4" role="status">We couldn't refresh the watcher list — showing the last data we loaded.</p>`),A=r(`<code class="svelte-1in03l4"> </code>`),j=r(`<div class="svelte-1in03l4"><dt class="svelte-1in03l4"> </dt> <dd class="svelte-1in03l4"><!></dd></div>`),M=r(`<article class="watcher-card svelte-1in03l4"><header class="watcher-card-header svelte-1in03l4"><div><p class="watcher-type svelte-1in03l4"> </p> <h2 class="svelte-1in03l4"> </h2> <p class="watcher-description svelte-1in03l4"> </p></div> <span> </span></header> <dl class="watcher-meta svelte-1in03l4"><div class="svelte-1in03l4"><dt class="svelte-1in03l4">Process</dt> <dd class="svelte-1in03l4"> <span class="muted svelte-1in03l4"> </span></dd></div> <div class="svelte-1in03l4"><dt class="svelte-1in03l4">Watcher ID</dt> <dd class="svelte-1in03l4"> </dd></div> <div class="svelte-1in03l4"><dt class="svelte-1in03l4">Target</dt> <dd class="svelte-1in03l4"> </dd></div> <div class="svelte-1in03l4"><dt class="svelte-1in03l4">Config path</dt> <dd class="svelte-1in03l4"><code class="svelte-1in03l4"> </code></dd></div> <div class="full-width svelte-1in03l4"><dt class="svelte-1in03l4">Launch model</dt> <dd class="svelte-1in03l4"> </dd></div> <!></dl></article>`),N=r(`<!> <div class="watcher-list svelte-1in03l4"></div>`,1),P=r(`<div class="watchers-page svelte-1in03l4" data-page="watchers"><section class="watchers-shell svelte-1in03l4"><!> <!></section></div>`);function F(r,u){_(u,!0);let F=b(m([])),I=b(!1),L=b(null),R=0;function z(e){let t=[];return e.launchModel.defaultModelProfileId&&t.push(`Default: ${e.launchModel.defaultModelProfileId}`),e.launchModel.turnConfigs.length>0&&t.push(`Turns: ${e.launchModel.turnConfigs.map(e=>`${e.turnId} → ${e.modelProfileId??`—`}`).join(`, `)}`),t.length>0?t.join(` · `):`No watcher-specific launch model overrides`}async function B(){let t=++R;e(I,!0),e(L,null);try{let n=await C();if(t!==R)return;e(F,n,!0)}catch(n){if(t!==R)return;e(L,n instanceof Error?n.message:`Couldn't load registered watchers`,!0)}finally{t===R&&e(I,!1)}}o(()=>{B()});var V=P(),H=a(V),U=a(H);w(U,{title:`Watchers`,subtitle:`Review configured watcher registrations, their triggers, and launch model overrides.`,actions:e=>{var t=T();S(`click`,t,()=>void B()),l(e,t)},$$slots:{actions:!0}});var W=f(U,2),G=e=>{l(e,E())},K=e=>{var t=D(),n=f(a(t),2),r=a(n,!0);v(n),v(t),i(()=>c(r,d(L))),l(e,t)},q=e=>{l(e,O())},J=e=>{var r=N(),o=p(r),u=e=>{l(e,k())};y(o,e=>{d(L)&&e(u)});var m=f(o,2);n(m,21,()=>d(F),e=>`${e.processId}:${e.watcherId}`,(e,r)=>{var o=M(),u=a(o),p=a(u),m=a(p),g=a(m,!0);v(m);var _=f(m,2),b=a(_,!0);v(_);var S=f(_,2),C=a(S,!0);v(S),v(p);var w=f(p,2);let T;var E=a(w,!0);v(w),v(u);var D=f(u,2),O=a(D),k=f(a(O),2),N=a(k),P=f(N),F=a(P);v(P),v(k),v(O);var I=f(O,2),L=f(a(I),2),R=a(L,!0);v(L),v(I);var B=f(I,2),V=f(a(B),2),H=a(V,!0);v(V),v(B);var U=f(B,2),W=f(a(U),2),G=a(W),K=a(G,!0);v(G),v(W),v(U);var q=f(U,2),J=f(a(q),2),Y=a(J,!0);v(J),v(q),n(f(q,2),17,()=>d(r).details,t,(e,t)=>{var n=j(),r=a(n),o=a(r,!0);v(r);var u=f(r,2),p=a(u),m=e=>{var n=A(),r=a(n,!0);v(n),i(()=>c(r,d(t).value)),l(e,n)},h=e=>{var n=s();i(()=>c(n,d(t).value)),l(e,n)};y(p,e=>{d(t).format===`code`?e(m):e(h,-1)}),v(u),v(n),i(()=>c(o,d(t).label)),l(e,n)}),v(D),v(o),i(e=>{h(o,`data-watcher-source`,d(r).sourceId),c(g,d(r).sourceLabel),c(b,d(r).label),c(C,d(r).description),T=x(w,1,`watcher-status svelte-1in03l4`,null,T,{enabled:d(r).enabled}),c(E,d(r).enabled?`Enabled`:`Disabled`),c(N,`${d(r).processDisplayName??``} `),c(F,`(${d(r).processId??``})`),c(R,d(r).watcherId),c(H,d(r).targetSummary),c(K,d(r).configPath),c(Y,e)},[()=>z(d(r))]),l(e,o)}),v(m),l(e,r)};y(W,e=>{d(I)&&d(F).length===0?e(G):d(L)&&d(F).length===0?e(K,1):d(F).length===0?e(q,2):e(J,-1)}),v(H),v(V),l(r,V),g()}u([`click`]);export{F as default};
@@ -0,0 +1 @@
1
+ typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var e;function t(t){return{lang:t?.lang??e?.lang,message:t?.message,abortEarly:t?.abortEarly??e?.abortEarly,abortPipeEarly:t?.abortPipeEarly??e?.abortPipeEarly}}var n;function r(e){return n?.get(e)}var i;function a(e){return i?.get(e)}var o;function s(e,t){return o?.get(e)?.get(t)}function c(e){let t=typeof e;return t===`string`?`"${e}"`:t===`number`||t===`bigint`||t===`boolean`?`${e}`:t===`object`||t===`function`?(e&&Object.getPrototypeOf(e)?.constructor?.name)??`null`:t}function l(e,t,n,i,o){let l=o&&`input`in o?o.input:n.value,u=o?.expected??e.expects??null,d=o?.received??c(l),f={kind:e.kind,type:e.type,input:l,expected:u,received:d,message:`Invalid ${t}: ${u?`Expected ${u} but r`:`R`}eceived ${d}`,requirement:e.requirement,path:o?.path,issues:o?.issues,lang:i.lang,abortEarly:i.abortEarly,abortPipeEarly:i.abortPipeEarly},p=e.kind===`schema`,m=o?.message??e.message??s(e.reference,f.lang)??(p?a(f.lang):null)??i.message??r(f.lang);m!==void 0&&(f.message=typeof m==`function`?m(f):m),p&&(n.typed=!1),n.issues?n.issues.push(f):n.issues=[f]}function u(e){return{version:1,vendor:`valibot`,validate(n){return e[`~run`]({value:n},t())}}}function d(e,t){return Object.hasOwn(e,t)&&t!==`__proto__`&&t!==`prototype`&&t!==`constructor`}function f(e,t){let n=[...new Set(e)];return n.length>1?`(${n.join(` ${t} `)})`:n[0]??`never`}function p(e){if(e.path){let t=``;for(let n of e.path)if(typeof n.key==`string`||typeof n.key==`number`)t?t+=`.${n.key}`:t+=n.key;else return null;return t}return null}function m(e,t){return{kind:`validation`,type:`check`,reference:m,async:!1,expects:null,requirement:e,message:t,"~run"(e,t){return e.typed&&!this.requirement(e.value)&&l(this,`input`,e,t),e}}}function h(e){return{kind:`validation`,type:`finite`,reference:h,async:!1,expects:null,requirement:Number.isFinite,message:e,"~run"(e,t){return e.typed&&!this.requirement(e.value)&&l(this,`finite`,e,t),e}}}function g(e,t){return{kind:`validation`,type:`max_length`,reference:g,async:!1,expects:`<=${e}`,requirement:e,message:t,"~run"(e,t){return e.typed&&e.value.length>this.requirement&&l(this,`length`,e,t,{received:`${e.value.length}`}),e}}}function _(e,t){return{kind:`transformation`,type:`parse_json`,reference:_,config:e,message:t,async:!1,"~run"(e,t){try{e.value=JSON.parse(e.value,this.config?.reviver)}catch(n){if(n instanceof Error)l(this,`JSON`,e,t,{received:`"${n.message}"`}),e.typed=!1;else throw n}return e}}}function v(e,t,n){return typeof e.fallback==`function`?e.fallback(t,n):e.fallback}function y(e,t,n){return typeof e.default==`function`?e.default(t,n):e.default}function ee(e,t){return!e[`~run`]({value:t},{abortEarly:!0}).issues}function b(e,t){return{kind:`schema`,type:`array`,reference:b,expects:`Array`,async:!1,item:e,message:t,get"~standard"(){return u(this)},"~run"(e,t){let n=e.value;if(Array.isArray(n)){e.typed=!0,e.value=[];for(let r=0;r<n.length;r++){let i=n[r],a=this.item[`~run`]({value:i},t);if(a.issues){let o={type:`array`,origin:`value`,input:n,key:r,value:i};for(let t of a.issues)t.path?t.path.unshift(o):t.path=[o],e.issues?.push(t);if(e.issues||=a.issues,t.abortEarly){e.typed=!1;break}}a.typed||(e.typed=!1),e.value.push(a.value)}}else l(this,`type`,e,t);return e}}}function x(e){return{kind:`schema`,type:`boolean`,reference:x,expects:`boolean`,async:!1,message:e,get"~standard"(){return u(this)},"~run"(e,t){return typeof e.value==`boolean`?e.typed=!0:l(this,`type`,e,t),e}}}function S(e,t){return{kind:`schema`,type:`custom`,reference:S,expects:`unknown`,async:!1,check:e,message:t,get"~standard"(){return u(this)},"~run"(e,t){return this.check(e.value)?e.typed=!0:l(this,`type`,e,t),e}}}function C(e,t){return{kind:`schema`,type:`literal`,reference:C,expects:c(e),async:!1,literal:e,message:t,get"~standard"(){return u(this)},"~run"(e,t){return e.value===this.literal?e.typed=!0:l(this,`type`,e,t),e}}}function w(e,t){return{kind:`schema`,type:`loose_object`,reference:w,expects:`Object`,async:!1,entries:e,message:t,get"~standard"(){return u(this)},"~run"(e,t){let n=e.value;if(n&&typeof n==`object`){e.typed=!0,e.value={};for(let r in this.entries){let i=this.entries[r];if(r in n||(i.type===`exact_optional`||i.type===`optional`||i.type===`nullish`)&&i.default!==void 0){let a=r in n?n[r]:y(i),o=i[`~run`]({value:a},t);if(o.issues){let i={type:`object`,origin:`value`,input:n,key:r,value:a};for(let t of o.issues)t.path?t.path.unshift(i):t.path=[i],e.issues?.push(t);if(e.issues||=o.issues,t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value[r]=o.value}else if(i.fallback!==void 0)e.value[r]=v(i);else if(i.type!==`exact_optional`&&i.type!==`optional`&&i.type!==`nullish`&&(l(this,`key`,e,t,{input:void 0,expected:`"${r}"`,path:[{type:`object`,origin:`key`,input:n,key:r,value:n[r]}]}),t.abortEarly))break}if(!e.issues||!t.abortEarly)for(let t in n)d(n,t)&&!(t in this.entries)&&(e.value[t]=n[t])}else l(this,`type`,e,t);return e}}}function T(e,t){return{kind:`schema`,type:`nullable`,reference:T,expects:`(${e.expects} | null)`,async:!1,wrapped:e,default:t,get"~standard"(){return u(this)},"~run"(e,t){return e.value===null&&(this.default!==void 0&&(e.value=y(this,e,t)),e.value===null)?(e.typed=!0,e):this.wrapped[`~run`](e,t)}}}function E(e){return{kind:`schema`,type:`number`,reference:E,expects:`number`,async:!1,message:e,get"~standard"(){return u(this)},"~run"(e,t){return typeof e.value==`number`&&!isNaN(e.value)?e.typed=!0:l(this,`type`,e,t),e}}}function D(e,t){return{kind:`schema`,type:`object`,reference:D,expects:`Object`,async:!1,entries:e,message:t,get"~standard"(){return u(this)},"~run"(e,t){let n=e.value;if(n&&typeof n==`object`){e.typed=!0,e.value={};for(let r in this.entries){let i=this.entries[r];if(r in n||(i.type===`exact_optional`||i.type===`optional`||i.type===`nullish`)&&i.default!==void 0){let a=r in n?n[r]:y(i),o=i[`~run`]({value:a},t);if(o.issues){let i={type:`object`,origin:`value`,input:n,key:r,value:a};for(let t of o.issues)t.path?t.path.unshift(i):t.path=[i],e.issues?.push(t);if(e.issues||=o.issues,t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value[r]=o.value}else if(i.fallback!==void 0)e.value[r]=v(i);else if(i.type!==`exact_optional`&&i.type!==`optional`&&i.type!==`nullish`&&(l(this,`key`,e,t,{input:void 0,expected:`"${r}"`,path:[{type:`object`,origin:`key`,input:n,key:r,value:n[r]}]}),t.abortEarly))break}}else l(this,`type`,e,t);return e}}}function O(e,t){return{kind:`schema`,type:`optional`,reference:O,expects:`(${e.expects} | undefined)`,async:!1,wrapped:e,default:t,get"~standard"(){return u(this)},"~run"(e,t){return e.value===void 0&&(this.default!==void 0&&(e.value=y(this,e,t)),e.value===void 0)?(e.typed=!0,e):this.wrapped[`~run`](e,t)}}}function k(e,t){return{kind:`schema`,type:`picklist`,reference:k,expects:f(e.map(c),`|`),async:!1,options:e,message:t,get"~standard"(){return u(this)},"~run"(e,t){return this.options.includes(e.value)?e.typed=!0:l(this,`type`,e,t),e}}}function A(e,t,n){return{kind:`schema`,type:`record`,reference:A,expects:`Object`,async:!1,key:e,value:t,message:n,get"~standard"(){return u(this)},"~run"(e,t){let n=e.value;if(n&&typeof n==`object`){e.typed=!0,e.value={};for(let r in n)if(d(n,r)){let i=n[r],a=this.key[`~run`]({value:r},t);if(a.issues){let o={type:`object`,origin:`key`,input:n,key:r,value:i};for(let t of a.issues)t.path=[o],e.issues?.push(t);if(e.issues||=a.issues,t.abortEarly){e.typed=!1;break}}let o=this.value[`~run`]({value:i},t);if(o.issues){let a={type:`object`,origin:`value`,input:n,key:r,value:i};for(let t of o.issues)t.path?t.path.unshift(a):t.path=[a],e.issues?.push(t);if(e.issues||=o.issues,t.abortEarly){e.typed=!1;break}}(!a.typed||!o.typed)&&(e.typed=!1),a.typed&&(e.value[a.value]=o.value)}}else l(this,`type`,e,t);return e}}}function j(e,t){return{kind:`schema`,type:`strict_object`,reference:j,expects:`Object`,async:!1,entries:e,message:t,get"~standard"(){return u(this)},"~run"(e,t){let n=e.value;if(n&&typeof n==`object`){e.typed=!0,e.value={};for(let r in this.entries){let i=this.entries[r];if(r in n||(i.type===`exact_optional`||i.type===`optional`||i.type===`nullish`)&&i.default!==void 0){let a=r in n?n[r]:y(i),o=i[`~run`]({value:a},t);if(o.issues){let i={type:`object`,origin:`value`,input:n,key:r,value:a};for(let t of o.issues)t.path?t.path.unshift(i):t.path=[i],e.issues?.push(t);if(e.issues||=o.issues,t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value[r]=o.value}else if(i.fallback!==void 0)e.value[r]=v(i);else if(i.type!==`exact_optional`&&i.type!==`optional`&&i.type!==`nullish`&&(l(this,`key`,e,t,{input:void 0,expected:`"${r}"`,path:[{type:`object`,origin:`key`,input:n,key:r,value:n[r]}]}),t.abortEarly))break}if(!e.issues||!t.abortEarly){for(let r in n)if(!(r in this.entries)){l(this,`key`,e,t,{input:r,expected:`never`,path:[{type:`object`,origin:`key`,input:n,key:r,value:n[r]}]});break}}}else l(this,`type`,e,t);return e}}}function M(e){return{kind:`schema`,type:`string`,reference:M,expects:`string`,async:!1,message:e,get"~standard"(){return u(this)},"~run"(e,t){return typeof e.value==`string`?e.typed=!0:l(this,`type`,e,t),e}}}function N(){return{kind:`schema`,type:`unknown`,reference:N,expects:`unknown`,async:!1,get"~standard"(){return u(this)},"~run"(e){return e.typed=!0,e}}}function P(e,t,n){return{kind:`schema`,type:`variant`,reference:P,expects:`Object`,async:!1,key:e,options:t,message:n,get"~standard"(){return u(this)},"~run"(e,t){let n=e.value;if(n&&typeof n==`object`){let r,i=0,a=this.key,o=[],s=(e,c)=>{for(let l of e.options){if(l.type===`variant`)s(l,new Set(c).add(l.key));else{let e=!0,s=0;for(let t of c){let r=l.entries[t];if(t in n?r[`~run`]({typed:!1,value:n[t]},{abortEarly:!0}).issues:r.type!==`exact_optional`&&r.type!==`optional`&&r.type!==`nullish`){e=!1,a!==t&&(i<s||i===s&&t in n&&!(a in n))&&(i=s,a=t,o=[]),a===t&&o.push(l.entries[t].expects);break}s++}if(e){let e=l[`~run`]({value:n},t);(!r||!r.typed&&e.typed)&&(r=e)}}if(r&&!r.issues)break}};if(s(this,new Set([this.key])),r)return r;l(this,`type`,e,t,{input:n[a],expected:f(o,`|`),path:[{type:`object`,origin:`value`,input:n,key:a,value:n[a]}]})}else l(this,`type`,e,t);return e}}}function F(...e){return{...e[0],pipe:e,get"~standard"(){return u(this)},"~run"(t,n){for(let r of e)if(r.kind!==`metadata`){if(t.issues&&(r.kind===`schema`||r.kind===`transformation`)){t.typed=!1;break}(!t.issues||!n.abortEarly&&!n.abortPipeEarly)&&(t=r[`~run`](t,n))}return t}}}function I(e,n,r){let i=e[`~run`]({value:n},t(r));return{typed:i.typed,success:!i.issues,output:i.value,issues:i.issues}}var te={discovered:`Queued`,active:`Running`,waiting:`Waiting`,error:`Error`,completed:`Completed`,aborted:`Aborted`},ne={api:`API`,id:`ID`,llm:`LLM`,mr:`MR`,pi:`Pi`,ui:`UI`};function L(e){return e.split(/[_-]+/).filter(e=>e.length>0).map(e=>ne[e.toLowerCase()]??e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function re(e){return te[e]??e}function ie(e){return e?L(e):`Unknown`}function R(e){return L(e)}function ae(e){let t=Date.now()-new Date(e).getTime();if(t<0)return`just now`;let n=Math.floor(t/1e3);if(n<60)return`${n}s ago`;let r=Math.floor(n/60);if(r<60)return`${r}m ago`;let i=Math.floor(r/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}function oe(e){return new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}).format(new Date(e))}function se(e){return new Intl.DateTimeFormat(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`}).format(new Date(e))}function ce(e){return`${new Intl.DateTimeFormat(void 0,{year:`numeric`,month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`,timeZone:`UTC`}).format(new Date(e))} UTC`}var le=`modulepreload`,ue=function(e){return`/`+e},z={},B=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=ue(t,n),t=s(t),t in z)return;z[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:le,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},de=3e3,fe=15e3,pe=1e4,me=Symbol.for(`leitwerk.uiRuntimeTransportConfig`);function V(){return globalThis[me]??{}}function H(e){let{apiBaseUrl:t}=V();return t?new URL(e,t).toString():e}function U(e){return H(e)}function he(){let{wsUrl:e}=V();return e||`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}/ws`}function ge(){return V().reconnectDelayMs??de}function _e(){return V().heartbeatIntervalMs??fe}function ve(){return V().heartbeatTimeoutMs??pe}function W(){return V().fetchImpl??globalThis.fetch.bind(globalThis)}function ye(){let{webSocketCtor:e}=V();if(e)return e;if(typeof WebSocket<`u`)return WebSocket;throw Error(`Missing WebSocket implementation`)}function be(){let{moduleImporter:e}=V();return e||(e=>B(()=>import(e),[]))}var G=class extends Error{status;constructor(e,t){super(e),this.name=`ApiResponseError`,this.status=t}};async function xe(e){let t=await W()(U(`/api/processes/${encodeURIComponent(e.instanceId)}/question-requests/${encodeURIComponent(e.requestId)}/answers`),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({draft:e.draft})});if(!t.ok)throw new G(X(await q(t))??`Couldn't send answers`,t.status);return(await J(t,`Malformed question response`)).request}async function Se(){let e=await W()(U(`/api/auth/me`));if(e.status===401)return{authEnabled:!0,actor:null};if(!e.ok)throw new G(`Couldn't load authentication status: ${e.status}`,e.status);return J(e,`Malformed auth status response`)}function Ce(e,t){return new Promise((n,r)=>{if(t?.aborted){r(t.reason??new DOMException(`Aborted`,`AbortError`));return}let i=()=>{clearTimeout(a),r(t?.reason??new DOMException(`Aborted`,`AbortError`))},a=setTimeout(()=>{t?.removeEventListener(`abort`,i),n()},e);t?.addEventListener(`abort`,i,{once:!0})})}function we(e){return e instanceof G?[502,503,504].includes(e.status):e instanceof TypeError}async function Te(e={}){let t=e.maxAttempts??60,n=e.baseDelayMs??250,r=e.maxDelayMs??2e3,i=e.sleep??Ce,a=0;for(;;){a+=1;try{return await Se()}catch(o){if(e.signal?.aborted||!we(o)||a>=t)throw o;let s=Math.min(r,n*2**Math.min(a-1,8));e.onRetry?.(o,a,s),await i(s,e.signal)}}}var K=F(N(),m(e=>typeof e==`object`&&!!e&&!Array.isArray(e),`Expected object`),A(M(),N()));async function q(e){try{return await e.json()}catch{return null}}async function J(e,t){let n=await q(e);if(!I(K,n).success)throw Error(`${t}: response body must be a JSON object`);return n}function Y(e){return typeof e==`string`?e:null}function X(e){let t=e,n=Y(t?.error)??Y(t?.message);return n&&n.trim()!==``?n:null}async function Z(e,t){if(e.ok)return;let n=await q(e);throw Error(X(n)??`${t}: ${e.status}`)}function Ee(e){let t=I(K,e);if(!t.success)return!1;let n=t.output;return typeof n.code==`string`&&typeof n.message==`string`&&(n.fieldId===void 0||typeof n.fieldId==`string`)}function De(e){let t=I(K,e);return!t.success||!Array.isArray(t.output.errors)?[]:t.output.errors.filter(Ee)}async function Oe(){let e=await W()(U(`/api/processes/overview`));if(!e.ok)throw Error(`Couldn't load the process list: ${e.status}`);return J(e,`Malformed process overview response`)}async function ke(e={}){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))r!==void 0&&r!==``&&t.set(n,String(r));let n=t.size>0?`?${t.toString()}`:``,r=await W()(U(`/api/processes/browse${n}`));if(!r.ok)throw Error(`Couldn't browse processes: ${r.status}`);return J(r,`Malformed process browse response`)}async function Ae(){let e=await W()(U(`/api/launchers`));if(!e.ok)throw Error(`Couldn't load available processes: ${e.status}`);return(await J(e,`Malformed launchers response`)).launchers}async function je(){let e=await W()(U(`/api/watchers`));if(!e.ok)throw Error(`Couldn't load registered watchers: ${e.status}`);return(await J(e,`Malformed watchers response`)).watchers}async function Me(){let e=await W()(U(`/api/skills`));if(!e.ok)throw Error(`Couldn't load the skill catalog: ${e.status}`);return J(e,`Malformed skill catalog response`)}async function Ne(){let e=await W()(U(`/api/skills/refresh`),{method:`POST`});if(!e.ok)throw Error(`Couldn't refresh skill repositories: ${e.status}`);return J(e,`Malformed skill catalog response`)}async function Pe(e,t){let n=await W()(U(`/api/skills/available/${encodeURIComponent(e)}/${encodeURIComponent(t)}`));if(!n.ok)throw Error(`Couldn't load skill details: ${n.status}`);return(await J(n,`Malformed skill detail response`)).skill}async function Fe(e){let t=await W()(U(`/api/skills/installed/${encodeURIComponent(e)}`));if(!t.ok)throw Error(`Couldn't load installed skill details: ${t.status}`);return(await J(t,`Malformed installed skill detail response`)).skill}async function Ie(e,t){await Z(await W()(U(`/api/skills/available/${encodeURIComponent(e)}/${encodeURIComponent(t)}/register`),{method:`POST`}),`Couldn't register the skill`)}async function Le(e){await Z(await W()(U(`/api/skills/installed/${encodeURIComponent(e)}`),{method:`DELETE`}),`Couldn't remove the skill`)}async function Re(e){let t=await W()(U(`/api/launchers/${encodeURIComponent(e)}/defaults`));if(!t.ok)throw Error(`Couldn't load default values: ${t.status}`);return J(t,`Malformed launcher defaults response`)}async function ze(e){let t=await W()(U(`/api/launchers/${encodeURIComponent(e)}/recent-values`));if(!t.ok)throw Error(`Couldn't load recent launcher values: ${t.status}`);return(await J(t,`Malformed launcher recent values response`)).values}async function Be(e,t){let n=await W()(U(`/api/launchers/${encodeURIComponent(e)}/options`),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({launcherInput:t})});if(!n.ok)throw Error(`Couldn't refresh the available options: ${n.status}`);return(await J(n,`Malformed launcher options response`)).options}async function Ve(e,t,n={}){let r=await W()(U(`/api/launchers/${encodeURIComponent(e)}/model-config-preview`),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({launcherInput:t,modelConfig:n})});if(!r.ok)throw Error(`Couldn't refresh the model preview: ${r.status}`);return(await J(r,`Malformed launcher model preview response`)).preview}async function Q(e,t){let n=await q(e),r=De(n);return r.length>0?{kind:`validation_error`,status:e.status,errors:r}:{kind:`failure`,status:e.status,error:X(n)??`${t}: ${e.status}`}}async function He(e,t,n,r={},i={mode:`now`},a=[]){let o=await W()(U(`/api/launchers/${encodeURIComponent(e)}/launch`),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({title:t,launcherInput:n,modelConfig:r,schedule:i,skillIds:a})});if(!o.ok)return Q(o,`Couldn't start this process`);let s=await J(o,`Malformed launcher launch response`),c=s.projects??[],l=s.error??`Couldn't start this process: ${o.status}`;if(o.status===201&&s.futureExecution)return{kind:`scheduled`,futureExecution:s.futureExecution};if(o.status===201&&s.process)return{kind:`success`,process:s.process,projects:c};if(s.process)return{kind:`partial_success`,status:o.status,warning:l,process:s.process,projects:c};let u=s.errors??[];return u.length>0?{kind:`validation_error`,status:o.status,errors:u}:{kind:`failure`,status:o.status,error:l}}async function Ue(e){let t=await W()(U(`/api/processes/${encodeURIComponent(e)}/ui-snapshot`));if(!t.ok)throw Error(`Couldn't load this process: ${t.status}`);return J(t,`Malformed process UI snapshot response`)}async function We(e,t,n,r){let i=new URLSearchParams({sessionSignature:n??``}),a=await W()(U(`/api/processes/${encodeURIComponent(e)}/turn-records/${encodeURIComponent(t)}/reasoning?${i.toString()}`),{signal:r});if(a.status===409)throw Error(`The process changed while reasoning details were loading. Retry with the latest snapshot.`);if(!a.ok)throw Error(`Couldn't load reasoning details: ${a.status}`);return J(a,`Malformed reasoning detail response`)}async function Ge(e){let t=await W()(U(`/api/future-executions/${encodeURIComponent(e)}`));if(!t.ok)throw new G(`Couldn't load scheduled item: ${t.status}`,t.status);return J(t,`Malformed scheduled item response`)}async function Ke(e,t,n){let r=await W()(U(`/api/processes/${encodeURIComponent(e)}/retry`),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({...t===void 0?{}:{nextTurnModelProfileId:t},...n===void 0?{}:{providerOptions:n}})});if(!r.ok)throw Error(`Couldn't retry this process: ${r.status}`)}async function qe(e,t){let n=await W()(U(`/api/processes/${encodeURIComponent(e)}/model-profiles/${encodeURIComponent(t)}/provider-options`));if(!n.ok){let e=await q(n);throw Error(X(e)??`Couldn't load provider options: ${n.status}`)}return await n.json()}async function Je(e,t,n,r,i){let a=await W()(U(`/api/processes/${encodeURIComponent(e)}/turn-records/${encodeURIComponent(t)}/continue`),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({...n===void 0?{}:{prompt:n},...r===void 0?{}:{nextTurnModelProfileId:r},...i===void 0?{}:{providerOptions:i}})});if(!a.ok){let e=await q(a);throw Error(X(e)??`Couldn't continue this failed turn: ${a.status}`)}}async function Ye(e,t,n,r){let i=await W()(U(`/api/processes/${encodeURIComponent(e)}/turn-starts/${encodeURIComponent(t)}/retry`),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({...n===void 0?{}:{nextTurnModelProfileId:n},...r===void 0?{}:{providerOptions:r}})});if(!i.ok){let e=await q(i);throw Error(X(e)??`Couldn't retry worker startup: ${i.status}`)}}async function Xe(e){await Z(await W()(U(`/api/processes/${encodeURIComponent(e)}`),{method:`DELETE`}),`Couldn't delete this process`)}async function Ze(e){await Z(await W()(U(`/api/processes/${encodeURIComponent(e)}/abort`),{method:`POST`}),`Couldn't abort this process`)}async function $(e){await Z(await W()(U(`/api/processes/${encodeURIComponent(e)}/abort-turn`),{method:`POST`}),`Couldn't stop this turn`)}async function Qe(e){let t=await W()(U(`/api/processes/${encodeURIComponent(e)}/retry-config`));if(!t.ok)throw Error(`Couldn't load retry config: ${t.status}`);return J(t,`Malformed process retry config response`)}async function $e(e,t,n={}){let r=await W()(U(`/api/processes/${encodeURIComponent(e)}/actions/${encodeURIComponent(t)}/model-preview`),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({input:n})});if(!r.ok){let e=await q(r);throw Error(X(e)??`Couldn't refresh the action model preview: ${r.status}`)}return(await J(r,`Malformed process action model preview response`)).preview}async function et(e,t,n={},r={}){let i=await W()(U(`/api/processes/${encodeURIComponent(e)}/actions/${encodeURIComponent(t)}`),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({input:n,schedule:r.schedule??{mode:`now`},...r.nextTurnModelProfileId===void 0?{}:{nextTurnModelProfileId:r.nextTurnModelProfileId}})});if(!i.ok){let e=await q(i);throw Error(X(e)??`Couldn't run "${R(t)}": ${i.status}`)}let a=await J(i,`Malformed process action response`);return a.scheduledAction?{kind:`scheduled`,scheduledAction:a.scheduledAction}:{kind:`success`}}async function tt(e,t,n,r,i,a=[]){let o=await W()(U(`/api/future-executions/${encodeURIComponent(e)}/launch`),{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({title:t,launcherInput:n,modelConfig:r,schedule:i,skillIds:a})});if(!o.ok)return Q(o,`Couldn't update this scheduled launch`);let s=await J(o,`Malformed scheduled launch update response`),c=s.projects??[],l=s.error??`Couldn't update this scheduled launch: ${o.status}`;if(s.futureExecution)return{kind:`scheduled`,futureExecution:s.futureExecution};if(s.process)return{kind:`success`,process:s.process,projects:c};let u=s.errors??[];return u.length>0?{kind:`validation_error`,status:o.status,errors:u}:{kind:`failure`,status:o.status,error:l}}async function nt(e,t,n){let r=await W()(U(`/api/future-executions/${encodeURIComponent(e)}/action`),{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({input:t,schedule:n.schedule,...n.nextTurnModelProfileId===void 0?{}:{nextTurnModelProfileId:n.nextTurnModelProfileId}})});if(!r.ok){let e=await q(r);throw Error(X(e)??`Couldn't update this scheduled action: ${r.status}`)}let i=await J(r,`Malformed scheduled action update response`);return i.scheduledAction?{kind:`scheduled`,scheduledAction:i.scheduledAction}:{kind:`success`}}async function rt(e){let t=await W()(U(`/api/future-executions/${encodeURIComponent(e)}`),{method:`DELETE`});if(!t.ok){let e=await q(t);throw Error(X(e)??`Couldn't cancel this scheduled item: ${t.status}`)}}async function it(e){let t=await W()(U(`/api/future-executions/cron-preview`),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({expression:e})});if(!t.ok){let e=await q(t);throw Error(X(e)??`Couldn't preview this cron: ${t.status}`)}let n=await J(t,`Malformed cron preview response`);if(typeof n.nextRunAt!=`string`)throw Error(`Malformed cron preview response: nextRunAt must be a string`);return n.nextRunAt}export{b as $,Ne as A,ge as B,Ze as C,Ye as D,Ke as E,tt as F,B as G,U as H,W as I,se as J,R as K,_e as L,Le as M,xe as N,Je as O,nt as P,ce as Q,ve as R,He as S,et as T,H as U,ye as V,he as W,re as X,ae as Y,ie as Z,Oe as _,I as _t,Ge as a,ee as at,We as b,N as bt,Ve as c,g as ct,Ae as d,D as dt,x as et,qe as f,O as ft,Qe as g,A as gt,Ue as h,F as ht,Te as i,p as it,Ie as j,it as k,Be as l,T as lt,ke as m,k as mt,rt as n,S as nt,Fe as o,C as ot,$e as p,_ as pt,oe as q,Xe as r,h as rt,Re as s,w as st,G as t,m as tt,ze as u,E as ut,Pe as v,j as vt,$ as w,je as x,P as xt,Me as y,M as yt,be as z};