comisai 1.0.24 → 1.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_modules/@comis/agent/package.json +1 -1
- package/node_modules/@comis/channels/package.json +1 -1
- package/node_modules/@comis/cli/package.json +1 -1
- package/node_modules/@comis/core/dist/bootstrap.js +5 -0
- package/node_modules/@comis/core/dist/config/env-layer.d.ts +31 -0
- package/node_modules/@comis/core/dist/config/env-layer.js +41 -0
- package/node_modules/@comis/core/dist/config/layered.d.ts +9 -0
- package/node_modules/@comis/core/dist/config/layered.js +11 -0
- package/node_modules/@comis/core/package.json +1 -1
- package/node_modules/@comis/daemon/dist/daemon.js +3 -0
- package/node_modules/@comis/daemon/package.json +1 -1
- package/node_modules/@comis/gateway/package.json +1 -1
- package/node_modules/@comis/infra/package.json +1 -1
- package/node_modules/@comis/memory/package.json +1 -1
- package/node_modules/@comis/scheduler/package.json +1 -1
- package/node_modules/@comis/shared/package.json +1 -1
- package/node_modules/@comis/skills/package.json +1 -1
- package/node_modules/@comis/web/dist/assets/{agent-detail-BG9MGWWj.js → agent-detail-ru-AhppM.js} +270 -270
- package/node_modules/@comis/web/dist/assets/agent-editor-hjwRuFVp.js +2173 -0
- package/node_modules/@comis/web/dist/assets/{agent-list-LHCJ4rw2.js → agent-list-6Uotjatr.js} +170 -170
- package/node_modules/@comis/web/dist/assets/{approvals-q9VH_IKr.js → approvals-C-K6hN2U.js} +13 -13
- package/node_modules/@comis/web/dist/assets/billing-view-CxysXH0p.js +375 -0
- package/node_modules/@comis/web/dist/assets/{channel-detail-CaInesJM.js → channel-detail-BBCKtmne.js} +265 -265
- package/node_modules/@comis/web/dist/assets/channel-list-FkfeOLBQ.js +323 -0
- package/node_modules/@comis/web/dist/assets/{chat-console-CNmzl0JW.js → chat-console-BumBaIgO.js} +243 -246
- package/node_modules/@comis/web/dist/assets/{config-editor-DX4ITw6y.js → config-editor-C9BSwHGy.js} +477 -477
- package/node_modules/@comis/web/dist/assets/{context-dag-browser-BwiaF5tf.js → context-dag-browser-BHm00mJD.js} +105 -105
- package/node_modules/@comis/web/dist/assets/{context-engine-BZ5Am6hA.js → context-engine-BENY3pWE.js} +136 -136
- package/node_modules/@comis/web/dist/assets/decorate-BvWYovGE.js +38 -0
- package/node_modules/@comis/web/dist/assets/{delivery-view-OfBZof-m.js → delivery-view-BCnkPsAp.js} +134 -134
- package/node_modules/@comis/web/dist/assets/{diagnostics-view-YFwCxgr2.js → diagnostics-view-C_jQFG2H.js} +82 -82
- package/node_modules/@comis/web/dist/assets/directive-BOYXJ-K-.js +1 -0
- package/node_modules/@comis/web/dist/assets/{extract-variables-BM5qyK-s.js → extract-variables-B7-Doo7l.js} +39 -39
- package/node_modules/@comis/web/dist/assets/{ic-array-editor-B7m6x7-S.js → ic-array-editor-BLoEyeLS.js} +29 -29
- package/node_modules/@comis/web/dist/assets/{ic-breadcrumb-CUMpp3BL.js → ic-breadcrumb-DqN6G3gc.js} +16 -16
- package/node_modules/@comis/web/dist/assets/{ic-budget-segment-bar-BtJ6x5mN.js → ic-budget-segment-bar-zLsMzjDO.js} +20 -20
- package/node_modules/@comis/web/dist/assets/ic-chat-message-FdQcZsSQ.js +352 -0
- package/node_modules/@comis/web/dist/assets/{ic-confirm-dialog-CCDbB04e.js → ic-confirm-dialog-DGlPbV1T.js} +26 -26
- package/node_modules/@comis/web/dist/assets/{ic-connection-dot-CnT1b8xr.js → ic-connection-dot-BgYiK2N4.js} +13 -13
- package/node_modules/@comis/web/dist/assets/ic-data-table-CKIvr-ag.js +277 -0
- package/node_modules/@comis/web/dist/assets/ic-delivery-row-B3YwjjuM.js +67 -0
- package/node_modules/@comis/web/dist/assets/{ic-detail-panel-BF83r-if.js → ic-detail-panel-DiCe4hLr.js} +27 -27
- package/node_modules/@comis/web/dist/assets/{ic-empty-state-60l2ePhd.js → ic-empty-state-CM3Wbj2f.js} +19 -19
- package/node_modules/@comis/web/dist/assets/ic-graph-canvas-ByRjij68.js +359 -0
- package/node_modules/@comis/web/dist/assets/ic-icon-BGNCCPpZ.js +33 -0
- package/node_modules/@comis/web/dist/assets/{ic-layer-waterfall-COvEYMg5.js → ic-layer-waterfall-WkaFyu-l.js} +18 -18
- package/node_modules/@comis/web/dist/assets/ic-relative-time-B3UAnTqg.js +12 -0
- package/node_modules/@comis/web/dist/assets/{ic-search-input-CSOxY9g7.js → ic-search-input-B02AGw1i.js} +22 -22
- package/node_modules/@comis/web/dist/assets/{ic-select-Ce-Raudx.js → ic-select-BqfZISjw.js} +29 -29
- package/node_modules/@comis/web/dist/assets/ic-tabs-yBjkWKJH.js +95 -0
- package/node_modules/@comis/web/dist/assets/ic-tag-CvMVQFRR.js +33 -0
- package/node_modules/@comis/web/dist/assets/{ic-time-range-picker-CypCT68y.js → ic-time-range-picker-DXbYeBmY.js} +31 -31
- package/node_modules/@comis/web/dist/assets/{ic-tool-call-7MaXSsCW.js → ic-tool-call-DMPHsLyx.js} +51 -51
- package/node_modules/@comis/web/dist/assets/index-CVEaS9aY.css +2 -0
- package/node_modules/@comis/web/dist/assets/index-FLPhHz8p.js +2792 -0
- package/node_modules/@comis/web/dist/assets/{mcp-management-BNZPnpDn.js → mcp-management-5jyScQis.js} +209 -209
- package/node_modules/@comis/web/dist/assets/{media-config-BBvTYxOX.js → media-config-J9oT9PPs.js} +154 -154
- package/node_modules/@comis/web/dist/assets/{media-test-BkK3RCRK.js → media-test-DGTCtM8-.js} +259 -259
- package/node_modules/@comis/web/dist/assets/{memory-inspector-1hDGCGat.js → memory-inspector-D5Re9ptG.js} +450 -450
- package/node_modules/@comis/web/dist/assets/{message-center-CXefwsUu.js → message-center-cRLK6ZmG.js} +290 -290
- package/node_modules/@comis/web/dist/assets/{models-C1qcU_j3.js → models-D5vu07MR.js} +371 -371
- package/node_modules/@comis/web/dist/assets/observability-types-D0tkwElU.js +1 -0
- package/node_modules/@comis/web/dist/assets/{observe-view-C0VBhX4C.js → observe-view-CalNNEmd.js} +399 -399
- package/node_modules/@comis/web/dist/assets/pipeline-builder-DUYDGwZf.js +1495 -0
- package/node_modules/@comis/web/dist/assets/{pipeline-history-DkfOQ6SW.js → pipeline-history-BAO8brOe.js} +124 -124
- package/node_modules/@comis/web/dist/assets/{pipeline-history-detail-hyHgD0ai.js → pipeline-history-detail-DectIoQt.js} +65 -65
- package/node_modules/@comis/web/dist/assets/{pipeline-list-BPW8hV-q.js → pipeline-list-BHlaBKww.js} +227 -227
- package/node_modules/@comis/web/dist/assets/{pipeline-monitor-Bip16T7e.js → pipeline-monitor-BhtpNEHf.js} +298 -298
- package/node_modules/@comis/web/dist/assets/{scheduler-BGgwKd06.js → scheduler-VafN_8xi.js} +486 -486
- package/node_modules/@comis/web/dist/assets/{security-D15st4xx.js → security-QQXMRTlo.js} +389 -389
- package/node_modules/@comis/web/dist/assets/{session-detail-SGEYNJ0M.js → session-detail-BpZ_8Yih.js} +294 -294
- package/node_modules/@comis/web/dist/assets/session-key-parser-Dkqcj2Ss.js +1 -0
- package/node_modules/@comis/web/dist/assets/session-list-DfCm8Cec.js +231 -0
- package/node_modules/@comis/web/dist/assets/{setup-wizard-nT0tz9QP.js → setup-wizard-C-z477CG.js} +486 -494
- package/node_modules/@comis/web/dist/assets/{skills-D8yVfSUy.js → skills-BCOGPf6s.js} +329 -329
- package/node_modules/@comis/web/dist/assets/{subagents-HHXMeHYo.js → subagents-l-auUraL.js} +74 -74
- package/node_modules/@comis/web/dist/assets/{workspace-manager-BQlr10iH.js → workspace-manager-DlvBixiq.js} +236 -236
- package/node_modules/@comis/web/dist/index.html +3 -2
- package/node_modules/@comis/web/package.json +1 -1
- package/package.json +15 -15
- package/node_modules/@comis/web/dist/assets/agent-editor-C26Q_xCs.js +0 -2173
- package/node_modules/@comis/web/dist/assets/billing-view-CtYvBqTE.js +0 -375
- package/node_modules/@comis/web/dist/assets/channel-list-B8dj3O9a.js +0 -323
- package/node_modules/@comis/web/dist/assets/directive-DoeGSK_T.js +0 -1
- package/node_modules/@comis/web/dist/assets/ic-chat-message-CFyDJd0z.js +0 -352
- package/node_modules/@comis/web/dist/assets/ic-data-table-CKUNTxHw.js +0 -277
- package/node_modules/@comis/web/dist/assets/ic-delivery-row-GP5Fkygs.js +0 -67
- package/node_modules/@comis/web/dist/assets/ic-graph-canvas-C8FuSMe1.js +0 -359
- package/node_modules/@comis/web/dist/assets/ic-icon-xeGTVhVG.js +0 -33
- package/node_modules/@comis/web/dist/assets/ic-relative-time-3FqpjeAI.js +0 -12
- package/node_modules/@comis/web/dist/assets/ic-tabs-B7QtM_v8.js +0 -95
- package/node_modules/@comis/web/dist/assets/ic-tag-CPPUnDLF.js +0 -33
- package/node_modules/@comis/web/dist/assets/index-CEcM1R_C.js +0 -2830
- package/node_modules/@comis/web/dist/assets/index-CIJFuItj.css +0 -1
- package/node_modules/@comis/web/dist/assets/observability-types-D7jUtSde.js +0 -1
- package/node_modules/@comis/web/dist/assets/pipeline-builder-DcUUIrm0.js +0 -1496
- package/node_modules/@comis/web/dist/assets/session-key-parser-DPORMVyU.js +0 -1
- package/node_modules/@comis/web/dist/assets/session-list-6ybUTxbY.js +0 -231
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
import{c as e,d as t,f as n,h as r,l as i,m as a,p as o,r as s,s as c,t as l,u}from"./decorate-BvWYovGE.js";import{n as d,r as f,t as p}from"./directive-BOYXJ-K-.js";var m=.25,h={x:0,y:0,scale:1};function g(e,t,n,r){return{x:(e-n.left-r.x)/r.scale,y:(t-n.top-r.y)/r.scale}}function _(e,t,n,r,i,a){let o=r>0?.9:1.1,s=Math.max(i,Math.min(a,e.scale*o));return{x:t-(t-e.x)*(s/e.scale),y:n-(n-e.y)*(s/e.scale),scale:s}}var v=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),y=v((e,t)=>{var n=Object.defineProperty,r=(e,t,r)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,i=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),a=(e,t,n)=>r(e,typeof t==`symbol`?t:t+``,n),o=i((e,t)=>{var n=`\0`,r=`\0`,i=``,o=class{constructor(e){a(this,`_isDirected`,!0),a(this,`_isMultigraph`,!1),a(this,`_isCompound`,!1),a(this,`_label`),a(this,`_defaultNodeLabelFn`,()=>{}),a(this,`_defaultEdgeLabelFn`,()=>{}),a(this,`_nodes`,{}),a(this,`_in`,{}),a(this,`_preds`,{}),a(this,`_out`,{}),a(this,`_sucs`,{}),a(this,`_edgeObjs`,{}),a(this,`_edgeLabels`,{}),a(this,`_nodeCount`,0),a(this,`_edgeCount`,0),a(this,`_parent`),a(this,`_children`),e&&(this._isDirected=Object.hasOwn(e,`directed`)?e.directed:!0,this._isMultigraph=Object.hasOwn(e,`multigraph`)?e.multigraph:!1,this._isCompound=Object.hasOwn(e,`compound`)?e.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[r]={})}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 this._defaultNodeLabelFn=e,typeof e!=`function`&&(this._defaultNodeLabelFn=()=>e),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var e=this;return this.nodes().filter(t=>Object.keys(e._in[t]).length===0)}sinks(){var e=this;return this.nodes().filter(t=>Object.keys(e._out[t]).length===0)}setNodes(e,t){var n=arguments,r=this;return e.forEach(function(e){n.length>1?r.setNode(e,t):r.setNode(e)}),this}setNode(e,t){return Object.hasOwn(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=r,this._children[e]={},this._children[r][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 Object.hasOwn(this._nodes,e)}removeNode(e){var t=this;if(Object.hasOwn(this._nodes,e)){var n=e=>t.removeEdge(t._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(function(e){t.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(n),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(n),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=r;else{t+=``;for(var 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}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var t=this._parent[e];if(t!==r)return t}}children(e=r){if(this._isCompound){var t=this._children[e];if(t)return Object.keys(t)}else{if(e===r)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var t=this._preds[e];if(t)return Object.keys(t)}successors(e){var t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){var t=this.predecessors(e);if(t){let r=new Set(t);for(var n of this.successors(e))r.add(n);return Array.from(r.values())}}isLeaf(e){var t;return t=this.isDirected()?this.successors(e):this.neighbors(e),t.length===0}filterNodes(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;Object.entries(this._nodes).forEach(function([n,r]){e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))});var r={};function i(e){var a=n.parent(e);return a===void 0||t.hasNode(a)?(r[e]=a,a):a in r?r[a]:i(a)}return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,i(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=e,typeof e!=`function`&&(this._defaultEdgeLabelFn=()=>e),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){var n=this,r=arguments;return e.reduce(function(e,i){return r.length>1?n.setEdge(e,i,t):n.setEdge(e,i),i}),this}setEdge(){var e,t,n,r,i=!1,a=arguments[0];typeof a==`object`&&a&&`v`in a?(e=a.v,t=a.w,n=a.name,arguments.length===2&&(r=arguments[1],i=!0)):(e=a,t=arguments[1],n=arguments[3],arguments.length>2&&(r=arguments[2],i=!0)),e=``+e,t=``+t,n!==void 0&&(n=``+n);var o=l(this._isDirected,e,t,n);if(Object.hasOwn(this._edgeLabels,o))return i&&(this._edgeLabels[o]=r),this;if(n!==void 0&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(e),this.setNode(t),this._edgeLabels[o]=i?r:this._defaultEdgeLabelFn(e,t,n);var c=u(this._isDirected,e,t,n);return e=c.v,t=c.w,Object.freeze(c),this._edgeObjs[o]=c,s(this._preds[t],e),s(this._sucs[e],t),this._in[t][o]=c,this._out[e][o]=c,this._edgeCount++,this}edge(e,t,n){var r=arguments.length===1?d(this._isDirected,arguments[0]):l(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(){let e=this.edge(...arguments);return typeof e==`object`?e:{label:e}}hasEdge(e,t,n){var r=arguments.length===1?d(this._isDirected,arguments[0]):l(this._isDirected,e,t,n);return Object.hasOwn(this._edgeLabels,r)}removeEdge(e,t,n){var r=arguments.length===1?d(this._isDirected,arguments[0]):l(this._isDirected,e,t,n),i=this._edgeObjs[r];return i&&(e=i.v,t=i.w,delete this._edgeLabels[r],delete this._edgeObjs[r],c(this._preds[t],e),c(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),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)}filterEdges(e,t,n){if(e){var r=Object.values(e);return n?r.filter(function(e){return e.v===t&&e.w===n||e.v===n&&e.w===t}):r}}};function s(e,t){e[t]?e[t]++:e[t]=1}function c(e,t){--e[t]||delete e[t]}function l(e,t,r,a){var o=``+t,s=``+r;if(!e&&o>s){var c=o;o=s,s=c}return o+i+s+i+(a===void 0?n:a)}function u(e,t,n,r){var i=``+t,a=``+n;if(!e&&i>a){var o=i;i=a,a=o}var s={v:i,w:a};return r&&(s.name=r),s}function d(e,t){return l(e,t.v,t.w,t.name)}t.exports=o}),s=i((e,t)=>{t.exports=`3.0.2`}),c=i((e,t)=>{t.exports={Graph:o(),version:s()}}),l=i((e,t)=>{var n=o();t.exports={write:r,read:s};function r(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:i(e),edges:a(e)};return e.graph()!==void 0&&(t.value=structuredClone(e.graph())),t}function i(e){return e.nodes().map(function(t){var 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 a(e){return e.edges().map(function(t){var 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 s(e){var t=new n(e.options).setGraph(e.value);return e.nodes.forEach(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}}),u=i((e,t)=>{t.exports=r;var n=()=>1;function r(e,t,r,a){return i(e,String(t),r||n,a||function(t){return e.outEdges(t)})}function i(e,t,n,r){var i={},a=!0,o=0,s=e.nodes(),c=function(e){var 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){var n=t.v===e?t.v:t.w;c({v:n,w:n===t.v?t.w:t.v})})})};s.forEach(function(e){i[e]={distance:e===t?0:1/0}});for(var u=s.length,d=1;d<u&&(a=!1,o++,l(),a);d++);if(o===u-1&&(a=!1,l(),a))throw Error(`The graph contains a negative weight cycle`);return i}}),d=i((e,t)=>{t.exports=n;function n(e){var t={},n=[],r;function i(n){Object.hasOwn(t,n)||(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}}),f=i((e,t)=>{t.exports=class{constructor(){a(this,`_arr`,[]),a(this,`_keyIndices`,{})}size(){return this._arr.length}keys(){return this._arr.map(function(e){return e.key})}has(e){return Object.hasOwn(this._keyIndices,e)}priority(e){var 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){var n=this._keyIndices;if(e=String(e),!Object.hasOwn(n,e)){var r=this._arr,i=r.length;return n[e]=i,r.push({key:e,priority:t}),this._decrease(i),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw Error(`New priority is greater than current priority. Key: `+e+` Old: `+this._arr[n].priority+` New: `+t);this._arr[n].priority=t,this._decrease(n)}_heapify(e){var 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){for(var t=this._arr,n=t[e].priority,r;e!==0&&(r=e>>1,!(t[r].priority<n));)this._swap(e,r),e=r}_swap(e,t){var 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}}}),p=i((e,t)=>{var n=f();t.exports=i;var r=()=>1;function i(e,t,n,i){return a(e,String(t),n||r,i||function(t){return e.outEdges(t)})}function a(e,t,r,i){var a={},o=new n,s,c,l=function(e){var t=e.v===s?e.w:e.v,n=a[t],i=r(e),l=c.distance+i;if(i<0)throw Error(`dijkstra does not allow negative edge weights. Bad edge: `+e+` Weight: `+i);l<n.distance&&(n.distance=l,n.predecessor=s,o.decrease(t,l))};for(e.nodes().forEach(function(e){var n=e===t?0:1/0;a[e]={distance:n},o.add(e,n)});o.size()>0&&(s=o.removeMin(),c=a[s],c.distance!==1/0);)i(s).forEach(l);return a}}),m=i((e,t)=>{var n=p();t.exports=r;function r(e,t,r){return e.nodes().reduce(function(i,a){return i[a]=n(e,a,t,r),i},{})}}),h=i((e,t)=>{t.exports=n;function n(e,t,n){if(e[t].predecessor!==void 0)throw Error(`Invalid source vertex`);if(e[n].predecessor===void 0&&n!==t)throw Error(`Invalid destination vertex`);return{weight:e[n].distance,path:r(e,t,n)}}function r(e,t,n){for(var r=[],i=n;i!==t;)r.push(i),i=e[i].predecessor;return r.push(t),r.reverse()}}),g=i((e,t)=>{t.exports=n;function n(e){var t=0,n=[],r={},i=[];function a(o){var s=r[o]={onStack:!0,lowlink:t,index:t++};if(n.push(o),e.successors(o).forEach(function(e){Object.hasOwn(r,e)?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){var c=[],l;do l=n.pop(),r[l].onStack=!1,c.push(l);while(o!==l);i.push(c)}}return e.nodes().forEach(function(e){Object.hasOwn(r,e)||a(e)}),i}}),_=i((e,t)=>{var n=g();t.exports=r;function r(e){return n(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}}),v=i((e,t)=>{t.exports=r;var n=()=>1;function r(e,t,r){return i(e,t||n,r||function(t){return e.outEdges(t)})}function i(e,t,n){var r={},i=e.nodes();return i.forEach(function(e){r[e]={},r[e][e]={distance:0},i.forEach(function(t){e!==t&&(r[e][t]={distance:1/0})}),n(e).forEach(function(n){var i=n.v===e?n.w:n.v,a=t(n);r[e][i]={distance:a,predecessor:e}})}),i.forEach(function(e){var t=r[e];i.forEach(function(n){var a=r[n];i.forEach(function(n){var 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}}),y=i((e,t)=>{function n(e){var t={},n={},i=[];function a(o){if(Object.hasOwn(n,o))throw new r;Object.hasOwn(t,o)||(n[o]=!0,t[o]=!0,e.predecessors(o).forEach(a),delete n[o],i.push(o))}if(e.sinks().forEach(a),Object.keys(t).length!==e.nodeCount())throw new r;return i}var r=class extends Error{constructor(){super(...arguments)}};t.exports=n,n.CycleException=r}),b=i((e,t)=>{var n=y();t.exports=r;function r(e){try{n(e)}catch(e){if(e instanceof n.CycleException)return!1;throw e}return!0}}),x=i((e,t)=>{t.exports=n;function n(e,t,n,i,a){Array.isArray(t)||(t=[t]);var o=(e.isDirected()?e.successors:e.neighbors).bind(e),s={};return t.forEach(function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);a=r(e,t,n===`post`,s,o,i,a)}),a}function r(e,t,n,i,a,o,s){return Object.hasOwn(i,t)||(i[t]=!0,n||(s=o(s,t)),a(t).forEach(function(t){s=r(e,t,n,i,a,o,s)}),n&&(s=o(s,t))),s}}),S=i((e,t)=>{var n=x();t.exports=r;function r(e,t,r){return n(e,t,r,function(e,t){return e.push(t),e},[])}}),C=i((e,t)=>{var n=S();t.exports=r;function r(e,t){return n(e,t,`post`)}}),w=i((e,t)=>{var n=S();t.exports=r;function r(e,t){return n(e,t,`pre`)}}),T=i((e,t)=>{var n=o(),r=f();t.exports=i;function i(e,t){var i=new n,a={},o=new r,s;function c(e){var n=e.v===s?e.w:e.v,r=o.priority(n);if(r!==void 0){var i=t(e);i<r&&(a[n]=s,o.decrease(n,i))}}if(e.nodeCount()===0)return i;e.nodes().forEach(function(e){o.add(e,1/0),i.setNode(e)}),o.decrease(e.nodes()[0],0);for(var l=!1;o.size()>0;){if(s=o.removeMin(),Object.hasOwn(a,s))i.setEdge(s,a[s]);else{if(l)throw Error(`Input graph is not connected: `+e);l=!0}e.nodeEdges(s).forEach(c)}return i}}),E=i((e,t)=>{var n=p(),r=u();t.exports=i;function i(e,t,n,r){return a(e,t,n,r||function(t){return e.outEdges(t)})}function a(e,t,i,a){if(i===void 0)return n(e,t,i,a);for(var o=!1,s=e.nodes(),c=0;c<s.length;c++){for(var l=a(s[c]),u=0;u<l.length;u++){var d=l[u],f=d.v===s[c]?d.v:d.w;i({v:f,w:f===d.v?d.w:d.v})<0&&(o=!0)}if(o)return r(e,t,i,a)}return n(e,t,i,a)}}),D=i((e,t)=>{t.exports={bellmanFord:u(),components:d(),dijkstra:p(),dijkstraAll:m(),extractPath:h(),findCycles:_(),floydWarshall:v(),isAcyclic:b(),postorder:C(),preorder:w(),prim:T(),shortestPaths:E(),reduce:x(),tarjan:g(),topsort:y()}}),O=c();t.exports={Graph:O.Graph,json:l(),alg:D(),version:O.version}}),b=v((e,t)=>{var n=class{constructor(){let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return r(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&r(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,i)),n=n._prev;return`[`+e.join(`, `)+`]`}};function r(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function i(e,t){if(e!==`_next`&&e!==`_prev`)return t}t.exports=n}),x=v((e,t)=>{var n=y().Graph,r=b();t.exports=a;var i=()=>1;function a(e,t){if(e.nodeCount()<=1)return[];let n=c(e,t||i);return o(n.graph,n.buckets,n.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w))}function o(e,t,n){let r=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)s(e,t,n,o);for(;o=i.dequeue();)s(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(s(e,t,n,o,!0));break}}}return r}function s(e,t,n,r,i){let a=i?[]: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,l(t,n,s)}),e.outEdges(r.v).forEach(r=>{let i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,l(t,n,o)}),e.removeNode(r.v),a}function c(e,t){let i=new n,a=0,o=0;e.nodes().forEach(e=>{i.setNode(e,{v:e,in:0,out:0})}),e.edges().forEach(e=>{let n=i.edge(e.v,e.w)||0,r=t(e),s=n+r;i.setEdge(e.v,e.w,s),o=Math.max(o,i.node(e.v).out+=r),a=Math.max(a,i.node(e.w).in+=r)});let s=u(o+a+3).map(()=>new r),c=a+1;return i.nodes().forEach(e=>{l(s,c,i.node(e))}),{graph:i,buckets:s,zeroIdx:c}}function l(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}function u(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t}}),S=v((e,t)=>{var n=y().Graph;t.exports={addBorderNode:f,addDummyNode:r,applyWithChunking:h,asNonCompoundGraph:a,buildLayerMatrix:l,intersectRect:c,mapValues:T,maxRank:g,normalizeRanks:u,notime:b,partition:_,pick:w,predecessorWeights:s,range:C,removeEmptyRanks:d,simplify:i,successorWeights:o,time:v,uniqueId:S,zipObject:E};function r(e,t,n,r){for(var i=r;e.hasNode(i);)i=S(r);return n.dummy=t,e.setNode(i,n),i}function i(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 a(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 o(e){let t=e.nodes().map(t=>{let n={};return e.outEdges(t).forEach(t=>{n[t.w]=(n[t.w]||0)+e.edge(t).weight}),n});return E(e.nodes(),t)}function s(e){let t=e.nodes().map(t=>{let n={};return e.inEdges(t).forEach(t=>{n[t.v]=(n[t.v]||0)+e.edge(t).weight}),n});return E(e.nodes(),t)}function c(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 l(e){let t=C(g(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),i=r.rank;i!==void 0&&(t[i][r.order]=n)}),t}function u(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MAX_VALUE:n}),n=h(Math.min,t);e.nodes().forEach(t=>{let r=e.node(t);Object.hasOwn(r,`rank`)&&(r.rank-=n)})}function d(e){let t=e.nodes().map(t=>e.node(t).rank).filter(e=>e!==void 0),n=h(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 f(e,t,n,i){let a={width:0,height:0};return arguments.length>=4&&(a.rank=n,a.order=i),r(e,`border`,a,t)}function p(e,t=m){let n=[];for(let r=0;r<e.length;r+=t){let i=e.slice(r,r+t);n.push(i)}return n}var m=65535;function h(e,t){if(t.length>m){let n=p(t);return e.apply(null,n.map(t=>e.apply(null,t)))}else return e.apply(null,t)}function g(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MIN_VALUE:n});return h(Math.max,t)}function _(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function v(e,t){let n=Date.now();try{return t()}finally{console.log(e+` time: `+(Date.now()-n)+`ms`)}}function b(e,t){return t()}var x=0;function S(e){return e+(``+ ++x)}function C(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 w(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}function T(e,t){let n=t;return typeof t==`string`&&(n=e=>e[t]),Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})}function E(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}}),C=v((e,t)=>{var n=x(),r=S().uniqueId;t.exports={run:i,undo:o};function i(e){(e.graph().acyclicer===`greedy`?n(e,t(e)):a(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,r(`rev`))});function t(e){return t=>e.edge(t).weight}}function a(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 o(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)}})}}),w=v((e,t)=>{var n=S();t.exports={run:r,undo:a};function r(e){e.graph().dummyChains=[],e.edges().forEach(t=>i(e,t))}function i(e,t){let r=t.v,i=e.node(r).rank,a=t.w,o=e.node(a).rank,s=t.name,c=e.edge(t),l=c.labelRank;if(o===i+1)return;e.removeEdge(t);let u,d,f;for(f=0,++i;i<o;++f,++i)c.points=[],d={width:0,height:0,edgeLabel:c,edgeObj:t,rank:i},u=n.addDummyNode(e,`edge`,d,`_d`),i===l&&(d.width=c.width,d.height=c.height,d.dummy=`edge-label`,d.labelpos=c.labelpos),e.setEdge(r,u,{weight:c.weight},s),f===0&&e.graph().dummyChains.push(u),r=u;e.setEdge(r,a,{weight:c.weight},s)}function a(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)})}}),T=v((e,t)=>{var{applyWithChunking:n}=S();t.exports={longestPath:r,slack:i};function r(e){var t={};function r(i){var a=e.node(i);if(Object.hasOwn(t,i))return a.rank;t[i]=!0;let o=e.outEdges(i).map(t=>t==null?1/0:r(t.w)-e.edge(t).minlen);var s=n(Math.min,o);return s===1/0&&(s=0),a.rank=s}e.sources().forEach(r)}function i(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}),E=v((e,t)=>{var n=y().Graph,r=T().slack;t.exports=i;function i(e){var t=new n({directed:!1}),i=e.nodes()[0],c=e.nodeCount();t.setNode(i,{});for(var l,u;a(t,e)<c;)l=o(t,e),u=t.hasNode(l.v)?r(e,l):-r(e,l),s(t,e,u);return t}function a(e,t){function n(i){t.nodeEdges(i).forEach(a=>{var o=a.v,s=i===o?a.w:o;!e.hasNode(s)&&!r(t,a)&&(e.setNode(s,{}),e.setEdge(i,s,{}),n(s))})}return e.nodes().forEach(n),e.nodeCount()}function o(e,t){return t.edges().reduce((n,i)=>{let a=1/0;return e.hasNode(i.v)!==e.hasNode(i.w)&&(a=r(t,i)),a<n[0]?[a,i]:n},[1/0,null])[1]}function s(e,t,n){e.nodes().forEach(e=>t.node(e).rank+=n)}}),D=v((e,t)=>{var n=E(),r=T().slack,i=T().longestPath,a=y().alg.preorder,o=y().alg.postorder,s=S().simplify;t.exports=c,c.initLowLimValues=f,c.initCutValues=l,c.calcCutValue=d,c.leaveEdge=m,c.enterEdge=h,c.exchangeEdges=g;function c(e){e=s(e),i(e);var t=n(e);f(t),l(t,e);for(var r,a;r=m(t);)a=h(t,e,r),g(t,e,r,a)}function l(e,t){var n=o(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(n=>u(e,t,n))}function u(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=d(e,t,n)}function d(e,t,n){var r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;return a||=(i=!1,t.edge(r,n)),o=a.weight,t.nodeEdges(n).forEach(a=>{var s=a.v===n,c=s?a.w:a.v;if(c!==r){var l=s===i,u=t.edge(a).weight;if(o+=l?u:-u,v(e,n,c)){var d=e.edge(n,c).cutvalue;o+=l?-d:d}}}),o}function f(e,t){arguments.length<2&&(t=e.nodes()[0]),p(e,{},1,t)}function p(e,t,n,r,i){var a=n,o=e.node(r);return t[r]=!0,e.neighbors(r).forEach(i=>{Object.hasOwn(t,i)||(n=p(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function m(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function h(e,t,n){var i=n.v,a=n.w;t.hasEdge(i,a)||(i=n.w,a=n.v);var o=e.node(i),s=e.node(a),c=o,l=!1;return o.lim>s.lim&&(c=s,l=!0),t.edges().filter(t=>l===b(e,e.node(t.v),c)&&l!==b(e,e.node(t.w),c)).reduce((e,n)=>r(t,n)<r(t,e)?n:e)}function g(e,t,n,r){var i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),f(e),l(e,t),_(e,t)}function _(e,t){var n=a(e,e.nodes().find(e=>!t.node(e).parent));n=n.slice(1),n.forEach(n=>{var 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 v(e,t,n){return e.hasEdge(t,n)}function b(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}}),O=v((e,t)=>{var n=T().longestPath,r=E(),i=D();t.exports=a;function a(e){var t=e.graph().ranker;if(t instanceof Function)return t(e);switch(e.graph().ranker){case`network-simplex`:c(e);break;case`tight-tree`:s(e);break;case`longest-path`:o(e);break;case`none`:break;default:c(e)}}var o=n;function s(e){n(e),r(e)}function c(e){i(e)}}),ee=v((e,t)=>{t.exports=n;function n(e){let t=i(e);e.graph().dummyChains.forEach(n=>{let i=e.node(n),a=i.edgeObj,o=r(e,t,a.v,a.w),s=o.path,c=o.lca,l=0,u=s[l],d=!0;for(;n!==a.w;){if(i=e.node(n),d){for(;(u=s[l])!==c&&e.node(u).maxRank<i.rank;)l++;u===c&&(d=!1)}if(!d){for(;l<s.length-1&&e.node(u=s[l+1]).minRank<=i.rank;)l++;u=s[l]}e.setParent(n,u),n=e.successors(n)[0]}})}function r(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,l;c=n;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));for(l=c,c=r;(c=e.parent(c))!==l;)a.push(c);return{path:i.concat(a.reverse()),lca:l}}function i(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().forEach(r),t}}),te=v((e,t)=>{var n=S();t.exports={run:r,cleanup:s};function r(e){let t=n.addDummyNode(e,`root`,{},`_root`),r=a(e),s=Object.values(r),c=n.applyWithChunking(Math.max,s)-1,l=2*c+1;e.graph().nestingRoot=t,e.edges().forEach(t=>e.edge(t).minlen*=l);let u=o(e)+1;e.children().forEach(n=>i(e,t,l,u,c,r,n)),e.graph().nodeRankFactor=l}function i(e,t,r,a,o,s,c){let l=e.children(c);if(!l.length){c!==t&&e.setEdge(t,c,{weight:0,minlen:r});return}let u=n.addBorderNode(e,`_bt`),d=n.addBorderNode(e,`_bb`),f=e.node(c);e.setParent(u,c),f.borderTop=u,e.setParent(d,c),f.borderBottom=d,l.forEach(n=>{i(e,t,r,a,o,s,n);let l=e.node(n),f=l.borderTop?l.borderTop:n,p=l.borderBottom?l.borderBottom:n,m=l.borderTop?a:2*a,h=f===p?o-s[c]+1:1;e.setEdge(u,f,{weight:m,minlen:h,nestingEdge:!0}),e.setEdge(p,d,{weight:m,minlen:h,nestingEdge:!0})}),e.parent(c)||e.setEdge(t,u,{weight:0,minlen:o+s[c]})}function a(e){var t={};function n(r,i){var a=e.children(r);a&&a.length&&a.forEach(e=>n(e,i+1)),t[r]=i}return e.children().forEach(e=>n(e,1)),t}function o(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function s(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}}),ne=v((e,t)=>{var n=S();t.exports=r;function r(e){function t(n){let r=e.children(n),a=e.node(n);if(r.length&&r.forEach(t),Object.hasOwn(a,`minRank`)){a.borderLeft=[],a.borderRight=[];for(let t=a.minRank,r=a.maxRank+1;t<r;++t)i(e,`borderLeft`,`_bl`,n,a,t),i(e,`borderRight`,`_br`,n,a,t)}}e.children().forEach(t)}function i(e,t,r,i,a,o){let s={width:0,height:0,rank:o,borderType:t},c=a[t][o-1],l=n.addDummyNode(e,`border`,s,r);a[t][o]=l,e.setParent(l,i),c&&e.setEdge(c,l,{weight:1})}}),re=v((e,t)=>{t.exports={adjust:n,undo:r};function n(e){let t=e.graph().rankdir.toLowerCase();(t===`lr`||t===`rl`)&&i(e)}function r(e){let t=e.graph().rankdir.toLowerCase();(t===`bt`||t===`rl`)&&o(e),(t===`lr`||t===`rl`)&&(c(e),i(e))}function i(e){e.nodes().forEach(t=>a(e.node(t))),e.edges().forEach(t=>a(e.edge(t)))}function a(e){let t=e.width;e.width=e.height,e.height=t}function o(e){e.nodes().forEach(t=>s(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);n.points.forEach(s),Object.hasOwn(n,`y`)&&s(n)})}function s(e){e.y=-e.y}function c(e){e.nodes().forEach(t=>l(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);n.points.forEach(l),Object.hasOwn(n,`x`)&&l(n)})}function l(e){let t=e.x;e.x=e.y,e.y=t}}),k=v((e,t)=>{var n=S();t.exports=r;function r(e){let t={},r=e.nodes().filter(t=>!e.children(t).length),i=r.map(t=>e.node(t).rank),a=n.applyWithChunking(Math.max,i),o=n.range(a+1).map(()=>[]);function s(n){t[n]||(t[n]=!0,o[e.node(n).rank].push(n),e.successors(n).forEach(s))}return r.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(s),o}}),A=v((e,t)=>{var n=S().zipObject;t.exports=r;function r(e,t){let n=0;for(let r=1;r<t.length;++r)n+=i(e,t[r-1],t[r]);return n}function i(e,t,r){let i=n(r,r.map((e,t)=>t)),a=t.flatMap(t=>e.outEdges(t).map(t=>({pos:i[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos)),o=1;for(;o<r.length;)o<<=1;let s=2*o-1;--o;let c=Array(s).fill(0),l=0;return a.forEach(e=>{let t=e.pos+o;c[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=c[t+1]),t=t-1>>1,c[t]+=e.weight;l+=e.weight*n}),l}}),j=v((e,t)=>{t.exports=n;function n(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(n.length){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}}else return{v:t}})}}),M=v((e,t)=>{var n=S();t.exports=r;function r(e,t){let n={};return e.forEach((e,t)=>{let r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};e.barycenter!==void 0&&(r.barycenter=e.barycenter,r.weight=e.weight)}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];t!==void 0&&r!==void 0&&(r.indegree++,t.out.push(n[e.w]))}),i(Object.values(n).filter(e=>!e.indegree))}function i(e){let t=[];function r(e){return t=>{t.merged||(t.barycenter===void 0||e.barycenter===void 0||t.barycenter>=e.barycenter)&&a(e,t)}}function i(t){return n=>{n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){let n=e.pop();t.push(n),n.in.reverse().forEach(r(n)),n.out.forEach(i(n))}return t.filter(e=>!e.merged).map(e=>n.pick(e,[`vs`,`i`,`barycenter`,`weight`]))}function a(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}}),N=v((e,t)=>{var n=S();t.exports=r;function r(e,t){let r=n.partition(e,e=>Object.hasOwn(e,`barycenter`)),o=r.lhs,s=r.rhs.sort((e,t)=>t.i-e.i),c=[],l=0,u=0,d=0;o.sort(a(!!t)),d=i(c,s,d),o.forEach(e=>{d+=e.vs.length,c.push(e.vs),l+=e.barycenter*e.weight,u+=e.weight,d=i(c,s,d)});let f={vs:c.flat(!0)};return u&&(f.barycenter=l/u,f.weight=u),f}function i(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 a(e){return(t,n)=>t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}}),P=v((e,t)=>{var n=j(),r=M(),i=N();t.exports=a;function a(e,t,c,l){let u=e.children(t),d=e.node(t),f=d?d.borderLeft:void 0,p=d?d.borderRight:void 0,m={};f&&(u=u.filter(e=>e!==f&&e!==p));let h=n(e,u);h.forEach(t=>{if(e.children(t.v).length){let n=a(e,t.v,c,l);m[t.v]=n,Object.hasOwn(n,`barycenter`)&&s(t,n)}});let g=r(h,c);o(g,m);let _=i(g,l);if(f&&(_.vs=[f,_.vs,p].flat(!0),e.predecessors(f).length)){let t=e.node(e.predecessors(f)[0]),n=e.node(e.predecessors(p)[0]);Object.hasOwn(_,`barycenter`)||(_.barycenter=0,_.weight=0),_.barycenter=(_.barycenter*_.weight+t.order+n.order)/(_.weight+2),_.weight+=2}return _}function o(e,t){e.forEach(e=>{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}function s(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)}}),ie=v((e,t)=>{var n=y().Graph,r=S();t.exports=i;function i(e,t,r,i){i||=e.nodes();let o=a(e),s=new n({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(t=>e.node(t));return i.forEach(n=>{let i=e.node(n),a=e.parent(n);(i.rank===t||i.minRank<=t&&t<=i.maxRank)&&(s.setNode(n),s.setParent(n,a||o),e[r](n).forEach(t=>{let r=t.v===n?t.w:t.v,i=s.edge(r,n),a=i===void 0?0:i.weight;s.setEdge(r,n,{weight:e.edge(t).weight+a})}),Object.hasOwn(i,`minRank`)&&s.setNode(n,{borderLeft:i.borderLeft[t],borderRight:i.borderRight[t]}))}),s}function a(e){for(var t;e.hasNode(t=r.uniqueId(`_root`)););return t}}),F=v((e,t)=>{t.exports=n;function n(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}})}}),ae=v((e,t)=>{var n=k(),r=A(),i=P(),a=ie(),o=F(),s=y().Graph,c=S();t.exports=l;function l(e,t={}){if(typeof t.customOrder==`function`){t.customOrder(e,l);return}let i=c.maxRank(e),a=u(e,c.range(1,i+1),`inEdges`),o=u(e,c.range(i-1,-1,-1),`outEdges`),s=n(e);if(f(e,s),t.disableOptimalOrderHeuristic)return;let p=1/0,m,h=t.constraints||[];for(let t=0,n=0;n<4;++t,++n){d(t%2?a:o,t%4>=2,h),s=c.buildLayerMatrix(e);let i=r(e,s);i<p?(n=0,m=Object.assign({},s),p=i):i===p&&(m=structuredClone(s))}f(e,m)}function u(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 a(e,t,n,r.get(t)||[])})}function d(e,t,n){let r=new s;e.forEach(function(e){n.forEach(e=>r.setEdge(e.left,e.right));let a=e.graph().root,s=i(e,a,r,t);s.vs.forEach((t,n)=>e.node(t).order=n),o(e,r,s.vs)})}function f(e,t){Object.values(t).forEach(t=>t.forEach((t,n)=>e.node(t).order=n))}}),I=v((e,t)=>{var n=y().Graph,r=S();t.exports={positionX:h,findType1Conflicts:i,findType2Conflicts:a,addConflict:s,hasConflict:c,verticalAlignment:l,horizontalCompaction:u,alignCoordinates:p,findSmallestWidthAlignment:f,balance:m};function i(e,t){let n={};function r(t,r){let i=0,a=0,c=t.length,l=r[r.length-1];return r.forEach((t,u)=>{let d=o(e,t),f=d?e.node(d).order:c;(d||t===l)&&(r.slice(a,u+1).forEach(t=>{e.predecessors(t).forEach(r=>{let a=e.node(r),o=a.order;(o<i||f<o)&&!(a.dummy&&e.node(t).dummy)&&s(n,r,t)})}),a=u+1,i=f)}),r}return t.length&&t.reduce(r),n}function a(e,t){let n={};function i(t,i,a,o,c){let l;r.range(i,a).forEach(r=>{l=t[r],e.node(l).dummy&&e.predecessors(l).forEach(t=>{let r=e.node(t);r.dummy&&(r.order<o||r.order>c)&&s(n,t,l)})})}function a(t,n){let r=-1,a,o=0;return n.forEach((s,c)=>{if(e.node(s).dummy===`border`){let t=e.predecessors(s);t.length&&(a=e.node(t[0]).order,i(n,o,c,r,a),o=c,r=a)}i(n,o,n.length,a,t.length)}),n}return t.length&&t.reduce(a),n}function o(e,t){if(e.node(t).dummy)return e.predecessors(t).find(t=>e.node(t).dummy)}function s(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 c(e,t,n){if(t>n){let e=t;t=n,n=e}return!!e[t]&&Object.hasOwn(e[t],n)}function l(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.length){s=s.sort((e,t)=>o[e]-o[t]);let r=(s.length-1)/2;for(let l=Math.floor(r),u=Math.ceil(r);l<=u;++l){let r=s[l];a[e]===e&&t<o[r]&&!c(n,e,r)&&(a[r]=e,a[e]=i[e]=i[r],t=o[r])}}})}),{root:i,align:a}}function u(e,t,n,r,i){let a={},o=d(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){a[e]=o.inEdges(e).reduce((e,t)=>Math.max(e,a[t.v]+o.edge(t)),0)}function u(t){let n=o.outEdges(t).reduce((e,t)=>Math.min(e,a[t.w]-o.edge(t)),1/0),r=e.node(t);n!==1/0&&r.borderType!==s&&(a[t]=Math.max(a[t],n))}return c(l,o.predecessors.bind(o)),c(u,o.successors.bind(o)),Object.keys(r).forEach(e=>a[e]=a[n[e]]),a}function d(e,t,r,i){let a=new n,o=e.graph(),s=g(o.nodesep,o.edgesep,i);return t.forEach(t=>{let n;t.forEach(t=>{let i=r[t];if(a.setNode(i),n){var o=r[n],c=a.edge(o,i);a.setEdge(o,i,Math.max(s(e,t,n),c||0))}n=t})}),a}function f(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,i=1/0;Object.entries(n).forEach(([t,n])=>{let a=_(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 p(e,t){let n=Object.values(t),i=r.applyWithChunking(Math.min,n),a=r.applyWithChunking(Math.max,n);[`u`,`d`].forEach(n=>{[`l`,`r`].forEach(o=>{let s=n+o,c=e[s];if(c===t)return;let l=Object.values(c),u=i-r.applyWithChunking(Math.min,l);o!==`l`&&(u=a-r.applyWithChunking(Math.max,l)),u&&(e[s]=r.mapValues(c,e=>e+u))})})}function m(e,t){return r.mapValues(e.ul,(n,r)=>{if(t)return e[t.toLowerCase()][r];{let t=Object.values(e).map(e=>e[r]).sort((e,t)=>e-t);return(t[1]+t[2])/2}})}function h(e){let t=r.buildLayerMatrix(e),n=Object.assign(i(e,t),a(e,t)),o={},s;return[`u`,`d`].forEach(i=>{s=i===`u`?t:Object.values(t).reverse(),[`l`,`r`].forEach(t=>{t===`r`&&(s=s.map(e=>Object.values(e).reverse()));let a=(i===`u`?e.predecessors:e.successors).bind(e),c=l(e,s,n,a),d=u(e,s,c.root,c.align,t===`r`);t===`r`&&(d=r.mapValues(d,e=>-e)),o[i+t]=d})}),p(o,f(e,o)),m(o,e.graph().align)}function g(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=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),l=0,c}}function _(e,t){return e.node(t).width}}),oe=v((e,t)=>{var n=S(),r=I().positionX;t.exports=i;function i(e){e=n.asNonCompoundGraph(e),a(e),Object.entries(r(e)).forEach(([t,n])=>e.node(t).x=n)}function a(e){let t=n.buildLayerMatrix(e),r=e.graph().ranksep,i=e.graph().rankalign,a=0;t.forEach(t=>{let n=t.reduce((t,n)=>{let r=e.node(n).height;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})}}),L=v((e,t)=>{var n=C(),r=w(),i=O(),a=S().normalizeRanks,o=ee(),s=S().removeEmptyRanks,c=te(),l=ne(),u=re(),d=ae(),f=oe(),p=S(),m=y().Graph;t.exports=h;function h(e,t={}){let n=t.debugTiming?p.time:p.notime;return n(`layout`,()=>{let r=n(` buildLayoutGraph`,()=>j(e));return n(` runLayout`,()=>g(r,n,t)),n(` updateInputGraph`,()=>_(e,r)),r})}function g(e,t,m){t(` makeSpaceForEdgeLabels`,()=>M(e)),t(` removeSelfEdges`,()=>B(e)),t(` acyclic`,()=>n.run(e)),t(` nestingGraph.run`,()=>c.run(e)),t(` rank`,()=>i(p.asNonCompoundGraph(e))),t(` injectEdgeLabelProxies`,()=>N(e)),t(` removeEmptyRanks`,()=>s(e)),t(` nestingGraph.cleanup`,()=>c.cleanup(e)),t(` normalizeRanks`,()=>a(e)),t(` assignRankMinMax`,()=>P(e)),t(` removeEdgeLabelProxies`,()=>ie(e)),t(` normalize.run`,()=>r.run(e)),t(` parentDummyChains`,()=>o(e)),t(` addBorderSegments`,()=>l(e)),t(` order`,()=>d(e,m)),t(` insertSelfEdges`,()=>V(e)),t(` adjustCoordinateSystem`,()=>u.adjust(e)),t(` position`,()=>f(e)),t(` positionSelfEdges`,()=>H(e)),t(` removeBorderNodes`,()=>z(e)),t(` normalize.undo`,()=>r.undo(e)),t(` fixupEdgeLabelCoords`,()=>L(e)),t(` undoCoordinateSystem`,()=>u.undo(e)),t(` translateGraph`,()=>F(e)),t(` assignNodeIntersects`,()=>I(e)),t(` reversePoints`,()=>R(e)),t(` acyclic.undo`,()=>n.undo(e))}function _(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 v=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],b={ranksep:50,edgesep:20,nodesep:50,rankdir:`tb`,rankalign:`center`},x=[`acyclicer`,`ranker`,`rankdir`,`align`,`rankalign`],T=[`width`,`height`,`rank`],E={width:0,height:0},D=[`minlen`,`weight`,`width`,`height`,`labeloffset`],k={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},A=[`labelpos`];function j(e){let t=new m({multigraph:!0,compound:!0}),n=W(e.graph());return t.setGraph(Object.assign({},b,U(n,v),p.pick(n,x))),e.nodes().forEach(n=>{let r=U(W(e.node(n)),T);Object.keys(E).forEach(e=>{r[e]===void 0&&(r[e]=E[e])}),t.setNode(n,r),t.setParent(n,e.parent(n))}),e.edges().forEach(n=>{let r=W(e.edge(n));t.setEdge(n,Object.assign({},k,U(r,D),p.pick(r,A)))}),t}function M(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 N(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v),r={rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t};p.addDummyNode(e,`edge-proxy`,r,`_ep`)}})}function P(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 ie(e){e.nodes().forEach(t=>{let n=e.node(t);n.dummy===`edge-proxy`&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}function F(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 I(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(p.intersectRect(r,a)),n.points.push(p.intersectRect(i,o))})}function L(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 R(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function z(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 B(e){e.edges().forEach(t=>{if(t.v===t.w){var n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function V(e){p.buildLayerMatrix(e).forEach(t=>{var n=0;t.forEach((t,r)=>{var i=e.node(t);i.order=r+n,(i.selfEdges||[]).forEach(t=>{p.addDummyNode(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 H(e){e.nodes().forEach(t=>{var n=e.node(t);if(n.dummy===`selfedge`){var r=e.node(n.e.v),i=r.x+r.width/2,a=r.y,o=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function U(e,t){return p.mapValues(p.pick(e,t),Number)}function W(e){var t={};return e&&Object.entries(e).forEach(([e,n])=>{typeof e==`string`&&(e=e.toLowerCase()),t[e]=n}),t}}),R=v((e,t)=>{var n=S(),r=y().Graph;t.exports={debugOrdering:i};function i(e){let t=n.buildLayerMatrix(e),i=new r({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(t=>{i.setNode(t,{label:t}),i.setParent(t,`layer`+e.node(t).rank)}),e.edges().forEach(e=>i.setEdge(e.v,e.w,{},e.name)),t.forEach((e,t)=>{let n=`layer`+t;i.setNode(n,{rank:`same`}),e.reduce((e,t)=>(i.setEdge(e,t,{style:`invis`}),t))}),i}}),z=v((e,t)=>{t.exports=`2.0.4`}),B=v((e,t)=>{t.exports={graphlib:y(),layout:L(),debug:R(),util:{time:S().time,notime:S().notime},version:z()}})();function V(e){return{x:e.position.x+200/2,y:e.position.y+80}}function H(e){return{x:e.position.x+200/2,y:e.position.y}}function U(e,t){let n=Math.abs(t.y-e.y),r=Math.max(30,Math.min(n*.5,150));return[`M ${e.x} ${e.y}`,`C ${e.x} ${e.y+r},`,`${t.x} ${t.y-r},`,`${t.x} ${t.y}`].join(` `)}function W(e,t,n=8){let r=Math.abs(e.y-t.y),i=Math.max(30,Math.min(r*.5,150)),a=e.x,o=e.y-i,s=Math.atan2(e.y-o,e.x-a),c=e.x-n*Math.cos(s-Math.PI/6),l=e.y-n*Math.sin(s-Math.PI/6),u=e.x-n*Math.cos(s+Math.PI/6),d=e.y-n*Math.sin(s+Math.PI/6);return`M ${c} ${l} L ${e.x} ${e.y} L ${u} ${d} Z`}function se(e,t){if(e.length===0)return{positions:new Map};let n=new B.graphlib.Graph;n.setGraph({rankdir:`TB`,nodesep:60,ranksep:80,marginx:40,marginy:40,ranker:`tight-tree`}),n.setDefaultEdgeLabel(()=>({}));for(let t of e)n.setNode(t.id,{width:200,height:80});for(let e of t)n.setEdge(e.source,e.target);B.layout(n);let r=new Map;for(let t of e){let e=n.node(t.id);r.set(t.id,{x:e.x-200/2,y:e.y-80/2})}return{positions:r}}function ce(e,t,n,r=40){if(e.length===0)return{x:0,y:0,scale:1};let i=1/0,a=1/0,o=-1/0,s=-1/0;for(let t of e){let e=t.position.x,n=t.position.y,r=e+200,c=n+80;e<i&&(i=e),n<a&&(a=n),r>o&&(o=r),c>s&&(s=c)}let c=o-i,l=s-a,u=t-r*2,d=n-r*2,f=u/c,p=d/l,h=Math.max(m,Math.min(2,Math.min(f,p))),g=(i+o)/2,_=(a+s)/2,v=t/2,y=n/2;return{x:v-g*h,y:y-_*h,scale:h}}var{I:le}=o,G=e=>e,K=()=>document.createComment(``),q=(e,t,n)=>{let r=e._$AA.parentNode,i=t===void 0?e._$AB:t._$AA;if(n===void 0)n=new le(r.insertBefore(K(),i),r.insertBefore(K(),i),e,e.options);else{let t=n._$AB.nextSibling,a=n._$AM,o=a!==e;if(o){let t;n._$AQ?.(e),n._$AM=e,n._$AP!==void 0&&(t=e._$AU)!==a._$AU&&n._$AP(t)}if(t!==i||o){let e=n._$AA;for(;e!==t;){let t=G(e).nextSibling;G(r).insertBefore(e,i),e=t}}}return n},J=(e,t,n=e)=>(e._$AI(t,n),e),ue={},de=(e,t=ue)=>e._$AH=t,fe=e=>e._$AH,Y=e=>{e._$AR(),e._$AA.remove()},X=(e,t,n)=>{let r=new Map;for(let i=t;i<=n;i++)r.set(e[i],i);return r},Z=p(class extends d{constructor(e){if(super(e),e.type!==f.CHILD)throw Error(`repeat() can only be used in text expressions`)}dt(e,t,n){let r;n===void 0?n=t:t!==void 0&&(r=t);let i=[],a=[],o=0;for(let t of e)i[o]=r?r(t,o):o,a[o]=n(t,o),o++;return{values:a,keys:i}}render(e,t,n){return this.dt(e,t,n).values}update(e,[n,r,i]){let a=fe(e),{values:o,keys:s}=this.dt(n,r,i);if(!Array.isArray(a))return this.ut=s,o;let c=this.ut??=[],l=[],u,d,f=0,p=a.length-1,m=0,h=o.length-1;for(;f<=p&&m<=h;)if(a[f]===null)f++;else if(a[p]===null)p--;else if(c[f]===s[m])l[m]=J(a[f],o[m]),f++,m++;else if(c[p]===s[h])l[h]=J(a[p],o[h]),p--,h--;else if(c[f]===s[h])l[h]=J(a[f],o[h]),q(e,l[h+1],a[f]),f++,h--;else if(c[p]===s[m])l[m]=J(a[p],o[m]),q(e,a[f],a[p]),p--,m++;else if(u===void 0&&(u=X(s,m,h),d=X(c,f,p)),u.has(c[f]))if(u.has(c[p])){let t=d.get(s[m]),n=t===void 0?null:a[t];if(n===null){let t=q(e,a[f]);J(t,o[m]),l[m]=t}else l[m]=J(n,o[m]),q(e,a[f],n),a[t]=null;m++}else Y(a[p]),p--;else Y(a[f]),f++;for(;m<=h;){let t=q(e,l[h+1]);J(t,o[m]),l[m++]=t}for(;f<=p;){let e=a[f++];e!==null&&Y(e)}return this.ut=s,de(e,l),t}}),Q={agent:{label:`Agent`,color:`var(--ic-accent)`},debate:{label:`Debate`,color:`var(--ic-warning)`},vote:{label:`Vote`,color:`var(--ic-success)`},refine:{label:`Refine`,color:`var(--ic-info)`},collaborate:{label:`Collaborate`,color:`#a855f7`},"approval-gate":{label:`Approval Gate`,color:`var(--ic-error)`},"map-reduce":{label:`Map-Reduce`,color:`#f97316`}},$=class extends i{constructor(...e){super(...e),this.viewport={x:0,y:0,scale:1},this.interactionMode=`idle`,this.nodes=[],this.edges=[],this.selectedNodeIds=new Set,this.selectedEdgeId=null,this.snapToGrid=!1,this.highlightNodeIds=[],this.readOnly=!1,this.nodeStatuses=new Map,this.edgeStatuses=new Map,this._mode=`idle`,this._dragStartX=0,this._dragStartY=0,this._startPanX=0,this._startPanY=0,this._livePanX=0,this._livePanY=0,this._currentScale=1,this._dragNodeId=null,this._dragStartGraphX=0,this._dragStartGraphY=0,this._dragNodeStartX=0,this._dragNodeStartY=0,this._dragLiveX=0,this._dragLiveY=0,this._dragSelectedStarts=new Map,this._connectSourceNodeId=null,this._previewLine=null,this._svgTransformGroup=null,this._htmlTransformGroup=null,this._zoomIndicator=null,this._container=null,this._wheelHandler=null}static{this.styles=[s,r`
|
|
2
|
+
:host {
|
|
3
|
+
display: block;
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: 100%;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.canvas-container {
|
|
9
|
+
position: relative;
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 100%;
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
cursor: grab;
|
|
14
|
+
user-select: none;
|
|
15
|
+
touch-action: none;
|
|
16
|
+
background: var(--ic-bg);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.canvas-container[data-mode="panning"] {
|
|
20
|
+
cursor: grabbing;
|
|
21
|
+
}
|
|
22
|
+
.canvas-container[data-mode="dragging-node"] {
|
|
23
|
+
cursor: grabbing;
|
|
24
|
+
}
|
|
25
|
+
.canvas-container[data-mode="connecting-edge"] {
|
|
26
|
+
cursor: crosshair;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.svg-layer {
|
|
30
|
+
position: absolute;
|
|
31
|
+
inset: 0;
|
|
32
|
+
width: 100%;
|
|
33
|
+
height: 100%;
|
|
34
|
+
pointer-events: none;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.html-layer {
|
|
38
|
+
position: absolute;
|
|
39
|
+
inset: 0;
|
|
40
|
+
width: 100%;
|
|
41
|
+
height: 100%;
|
|
42
|
+
pointer-events: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.grid-dot {
|
|
46
|
+
fill: var(--ic-surface-2, #1f2937);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.zoom-indicator {
|
|
50
|
+
position: absolute;
|
|
51
|
+
bottom: 12px;
|
|
52
|
+
right: 12px;
|
|
53
|
+
padding: 4px 8px;
|
|
54
|
+
background: var(--ic-surface);
|
|
55
|
+
border: 1px solid var(--ic-border);
|
|
56
|
+
border-radius: var(--ic-radius-sm);
|
|
57
|
+
font-size: var(--ic-text-xs);
|
|
58
|
+
color: var(--ic-text-muted);
|
|
59
|
+
pointer-events: none;
|
|
60
|
+
font-variant-numeric: tabular-nums;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* Node card styles */
|
|
64
|
+
.node-card {
|
|
65
|
+
position: absolute;
|
|
66
|
+
width: ${200}px;
|
|
67
|
+
height: ${80}px;
|
|
68
|
+
overflow: hidden;
|
|
69
|
+
background: var(--ic-surface);
|
|
70
|
+
border: 1px solid var(--ic-border);
|
|
71
|
+
border-radius: var(--ic-radius-md);
|
|
72
|
+
padding: var(--ic-space-sm);
|
|
73
|
+
pointer-events: auto;
|
|
74
|
+
cursor: default;
|
|
75
|
+
transition: border-color var(--ic-transition), box-shadow var(--ic-transition);
|
|
76
|
+
}
|
|
77
|
+
.node-card:hover {
|
|
78
|
+
background: var(--ic-surface-2);
|
|
79
|
+
box-shadow: var(--ic-shadow-md);
|
|
80
|
+
}
|
|
81
|
+
.node-card--selected {
|
|
82
|
+
border: 2px solid var(--ic-accent);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.node-header {
|
|
86
|
+
display: flex;
|
|
87
|
+
align-items: center;
|
|
88
|
+
gap: var(--ic-space-xs);
|
|
89
|
+
margin-bottom: 4px;
|
|
90
|
+
}
|
|
91
|
+
.node-id {
|
|
92
|
+
font-family: var(--ic-font-mono);
|
|
93
|
+
font-size: var(--ic-text-sm);
|
|
94
|
+
font-weight: 600;
|
|
95
|
+
color: var(--ic-text);
|
|
96
|
+
}
|
|
97
|
+
.node-status-dot {
|
|
98
|
+
width: 6px;
|
|
99
|
+
height: 6px;
|
|
100
|
+
border-radius: 50%;
|
|
101
|
+
background: var(--ic-text-dim);
|
|
102
|
+
margin-right: var(--ic-space-xs);
|
|
103
|
+
flex-shrink: 0;
|
|
104
|
+
}
|
|
105
|
+
.node-agent-tag {
|
|
106
|
+
display: inline-block;
|
|
107
|
+
padding: 2px 8px;
|
|
108
|
+
border-radius: 9999px;
|
|
109
|
+
font-size: var(--ic-text-xs);
|
|
110
|
+
background: color-mix(in srgb, var(--ic-accent) 10%, transparent);
|
|
111
|
+
color: var(--ic-accent);
|
|
112
|
+
}
|
|
113
|
+
.node-type-tag {
|
|
114
|
+
display: inline-block;
|
|
115
|
+
padding: 2px 8px;
|
|
116
|
+
border-radius: 9999px;
|
|
117
|
+
font-size: var(--ic-text-xs);
|
|
118
|
+
white-space: nowrap;
|
|
119
|
+
margin-left: 4px;
|
|
120
|
+
}
|
|
121
|
+
.node-task-preview {
|
|
122
|
+
font-size: var(--ic-text-xs);
|
|
123
|
+
color: var(--ic-text-muted);
|
|
124
|
+
overflow: hidden;
|
|
125
|
+
text-overflow: ellipsis;
|
|
126
|
+
white-space: nowrap;
|
|
127
|
+
}
|
|
128
|
+
.node-constraints {
|
|
129
|
+
font-size: var(--ic-text-xs);
|
|
130
|
+
color: var(--ic-text-dim);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/* Port styles */
|
|
134
|
+
.port {
|
|
135
|
+
position: absolute;
|
|
136
|
+
width: 8px;
|
|
137
|
+
height: 8px;
|
|
138
|
+
border-radius: 50%;
|
|
139
|
+
border: 1.5px solid var(--ic-text-dim);
|
|
140
|
+
background: var(--ic-surface);
|
|
141
|
+
left: 50%;
|
|
142
|
+
transform: translateX(-50%);
|
|
143
|
+
pointer-events: auto;
|
|
144
|
+
cursor: crosshair;
|
|
145
|
+
}
|
|
146
|
+
.port:hover {
|
|
147
|
+
width: 12px;
|
|
148
|
+
height: 12px;
|
|
149
|
+
border-color: var(--ic-accent);
|
|
150
|
+
background: var(--ic-accent);
|
|
151
|
+
}
|
|
152
|
+
.port-in {
|
|
153
|
+
top: -4px;
|
|
154
|
+
}
|
|
155
|
+
.port-out {
|
|
156
|
+
bottom: -4px;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/* Edge styles (SVG) */
|
|
160
|
+
.edge-hit-area {
|
|
161
|
+
fill: none;
|
|
162
|
+
stroke: transparent;
|
|
163
|
+
stroke-width: 12;
|
|
164
|
+
pointer-events: stroke;
|
|
165
|
+
cursor: pointer;
|
|
166
|
+
}
|
|
167
|
+
.edge-path {
|
|
168
|
+
fill: none;
|
|
169
|
+
stroke: var(--ic-text-dim);
|
|
170
|
+
stroke-width: 1.5;
|
|
171
|
+
pointer-events: none;
|
|
172
|
+
}
|
|
173
|
+
.edge-path--selected {
|
|
174
|
+
stroke: var(--ic-accent);
|
|
175
|
+
stroke-width: 2;
|
|
176
|
+
}
|
|
177
|
+
.edge-arrow {
|
|
178
|
+
fill: var(--ic-text-dim);
|
|
179
|
+
stroke: none;
|
|
180
|
+
pointer-events: none;
|
|
181
|
+
}
|
|
182
|
+
.edge-arrow--selected {
|
|
183
|
+
fill: var(--ic-accent);
|
|
184
|
+
}
|
|
185
|
+
/* Edge preview line for connecting-edge mode */
|
|
186
|
+
.edge-preview {
|
|
187
|
+
fill: none;
|
|
188
|
+
stroke: var(--ic-accent);
|
|
189
|
+
stroke-width: 2;
|
|
190
|
+
stroke-dasharray: 6 4;
|
|
191
|
+
pointer-events: none;
|
|
192
|
+
opacity: 0.7;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/* Validation highlight pulse for click-to-highlight */
|
|
196
|
+
.node-card.highlight {
|
|
197
|
+
box-shadow: 0 0 0 3px var(--ic-error);
|
|
198
|
+
animation: highlight-pulse 0.6s ease-in-out 3;
|
|
199
|
+
}
|
|
200
|
+
@keyframes highlight-pulse {
|
|
201
|
+
0%, 100% { box-shadow: 0 0 0 3px var(--ic-error); }
|
|
202
|
+
50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.3); }
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/* Focus-visible outlines for keyboard navigation */
|
|
206
|
+
.node-card:focus-visible {
|
|
207
|
+
outline: 2px solid var(--ic-accent);
|
|
208
|
+
outline-offset: 2px;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/* A11Y-05: Disable animations for users who prefer reduced motion */
|
|
212
|
+
@media (prefers-reduced-motion: reduce) {
|
|
213
|
+
.node-card {
|
|
214
|
+
transition: none;
|
|
215
|
+
}
|
|
216
|
+
.node-card.highlight {
|
|
217
|
+
animation: none;
|
|
218
|
+
}
|
|
219
|
+
.edge-preview {
|
|
220
|
+
stroke-dasharray: none;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/* ---------------------------------------------------------------
|
|
225
|
+
* Monitor mode: read-only canvas styling
|
|
226
|
+
* --------------------------------------------------------------- */
|
|
227
|
+
|
|
228
|
+
/* Hide ports and change cursor in read-only mode */
|
|
229
|
+
:host([read-only]) .port { display: none; }
|
|
230
|
+
:host([read-only]) .node-card { cursor: default; }
|
|
231
|
+
:host([read-only]) .canvas-container { cursor: default; }
|
|
232
|
+
:host([read-only]) .canvas-container[data-mode="panning"] { cursor: grabbing; }
|
|
233
|
+
|
|
234
|
+
/* Status-colored node borders */
|
|
235
|
+
.node-card[data-status="running"] {
|
|
236
|
+
border: 2px solid var(--ic-info, #06b6d4);
|
|
237
|
+
box-shadow: 0 0 8px rgba(6, 182, 212, 0.3);
|
|
238
|
+
}
|
|
239
|
+
.node-card[data-status="completed"] {
|
|
240
|
+
border: 2px solid var(--ic-success, #22c55e);
|
|
241
|
+
}
|
|
242
|
+
.node-card[data-status="failed"] {
|
|
243
|
+
border: 2px solid var(--ic-error, #ef4444);
|
|
244
|
+
}
|
|
245
|
+
.node-card[data-status="skipped"] {
|
|
246
|
+
border: 2px dashed var(--ic-text-dim, #6b7280);
|
|
247
|
+
opacity: 0.6;
|
|
248
|
+
}
|
|
249
|
+
.node-card[data-status="pending"],
|
|
250
|
+
.node-card[data-status="ready"] {
|
|
251
|
+
border: 1px solid var(--ic-border);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/* Status dot coloring in node cards */
|
|
255
|
+
.node-card[data-status="running"] .node-status-dot { background: var(--ic-info, #06b6d4); }
|
|
256
|
+
.node-card[data-status="completed"] .node-status-dot { background: var(--ic-success, #22c55e); }
|
|
257
|
+
.node-card[data-status="failed"] .node-status-dot { background: var(--ic-error, #ef4444); }
|
|
258
|
+
.node-card[data-status="skipped"] .node-status-dot { background: var(--ic-text-dim, #6b7280); }
|
|
259
|
+
|
|
260
|
+
/* Status-colored edge strokes */
|
|
261
|
+
.edge-path--running {
|
|
262
|
+
stroke: var(--ic-info, #06b6d4);
|
|
263
|
+
stroke-width: 2;
|
|
264
|
+
stroke-dasharray: 8 4;
|
|
265
|
+
animation: edge-flow 1s linear infinite;
|
|
266
|
+
}
|
|
267
|
+
@keyframes edge-flow {
|
|
268
|
+
to { stroke-dashoffset: -12; }
|
|
269
|
+
}
|
|
270
|
+
.edge-path--completed {
|
|
271
|
+
stroke: var(--ic-success, #22c55e);
|
|
272
|
+
stroke-width: 1.5;
|
|
273
|
+
}
|
|
274
|
+
.edge-path--failed {
|
|
275
|
+
stroke: var(--ic-error, #ef4444);
|
|
276
|
+
stroke-width: 1.5;
|
|
277
|
+
}
|
|
278
|
+
.edge-path--skipped {
|
|
279
|
+
stroke: var(--ic-text-dim, #6b7280);
|
|
280
|
+
stroke-dasharray: 4 4;
|
|
281
|
+
opacity: 0.5;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/* Arrow colors for status */
|
|
285
|
+
.edge-arrow--running { fill: var(--ic-info, #06b6d4); }
|
|
286
|
+
.edge-arrow--completed { fill: var(--ic-success, #22c55e); }
|
|
287
|
+
.edge-arrow--failed { fill: var(--ic-error, #ef4444); }
|
|
288
|
+
.edge-arrow--skipped { fill: var(--ic-text-dim, #6b7280); opacity: 0.5; }
|
|
289
|
+
|
|
290
|
+
/* Respect prefers-reduced-motion for edge flow animation */
|
|
291
|
+
@media (prefers-reduced-motion: reduce) {
|
|
292
|
+
.edge-path--running { animation: none; }
|
|
293
|
+
}
|
|
294
|
+
`]}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{let e=this.renderRoot.querySelector(`.canvas-container`);this._wheelHandler=this._onWheel.bind(this),e?.addEventListener(`wheel`,this._wheelHandler,{passive:!1})})}disconnectedCallback(){this._wheelHandler&&this._container&&(this._container.removeEventListener(`wheel`,this._wheelHandler),this._wheelHandler=null),super.disconnectedCallback()}firstUpdated(){let e=this.renderRoot;this._svgTransformGroup=e.querySelector(`g.transform-group`),this._htmlTransformGroup=e.querySelector(`div.transform-group`),this._zoomIndicator=e.querySelector(`.zoom-indicator`),this._container=e.querySelector(`.canvas-container`),this._applyTransformGroups(this.viewport),this._currentScale=this.viewport.scale}willUpdate(e){e.has(`viewport`)&&(this._currentScale=this.viewport.scale,this._svgTransformGroup&&this._applyTransformGroups(this.viewport))}render(){let{x:e,y:t,scale:r}=this.viewport,i=`${Math.round(r*100)}%`,o=this.nodes.length;return n`
|
|
295
|
+
<div
|
|
296
|
+
class="canvas-container"
|
|
297
|
+
role="application"
|
|
298
|
+
aria-label=${`Graph canvas with ${o} node${o===1?``:`s`}`}
|
|
299
|
+
@pointerdown=${this._onPointerDown}
|
|
300
|
+
@pointermove=${this._onPointerMove}
|
|
301
|
+
@pointerup=${this._onPointerUp}
|
|
302
|
+
>
|
|
303
|
+
<svg class="svg-layer">
|
|
304
|
+
${a`
|
|
305
|
+
<defs>
|
|
306
|
+
<pattern id="dot-grid" width="24" height="24" patternUnits="userSpaceOnUse">
|
|
307
|
+
<circle cx="12" cy="12" r="1" class="grid-dot" />
|
|
308
|
+
</pattern>
|
|
309
|
+
</defs>
|
|
310
|
+
<g class="transform-group" style="transform: translate(${e}px, ${t}px) scale(${r})">
|
|
311
|
+
<rect x="-5000" y="-5000" width="10000" height="10000" fill="url(#dot-grid)" />
|
|
312
|
+
${this._renderEdges(this.edges,this.nodes,this.selectedEdgeId)}
|
|
313
|
+
</g>
|
|
314
|
+
`}
|
|
315
|
+
</svg>
|
|
316
|
+
<div class="html-layer">
|
|
317
|
+
<div
|
|
318
|
+
class="transform-group"
|
|
319
|
+
style="transform-origin: 0 0; transform: translate(${e}px, ${t}px) scale(${r})"
|
|
320
|
+
>
|
|
321
|
+
${this._renderNodes(this.nodes,this.selectedNodeIds,this.highlightNodeIds)}
|
|
322
|
+
</div>
|
|
323
|
+
</div>
|
|
324
|
+
<div class="zoom-indicator">${i}</div>
|
|
325
|
+
</div>
|
|
326
|
+
`}_renderNodes(e,t,r=[]){return Z(e,e=>e.id,e=>{let i=t.has(e.id),a=r.includes(e.id),o=this.nodeStatuses.get(e.id)??``,s=e.typeId&&Q[e.typeId]?`, type ${Q[e.typeId].label}`:``,c=e.typeConfig,l=e.agentId||(typeof c?.agent==`string`&&c.agent!==``?c.agent:``)||(Array.isArray(c?.agents)&&c.agents.length>0?c.agents.join(`, `):``),d=`Node ${e.id}${l?`, agent `+l:``}${s}, ${e.task.substring(0,50)}`;return n`
|
|
327
|
+
<div
|
|
328
|
+
class="node-card ${i?`node-card--selected`:``} ${a?`highlight`:``}"
|
|
329
|
+
data-node-id=${e.id}
|
|
330
|
+
data-status=${o}
|
|
331
|
+
tabindex="0"
|
|
332
|
+
role="button"
|
|
333
|
+
aria-label=${d}
|
|
334
|
+
aria-selected=${i?`true`:`false`}
|
|
335
|
+
style="transform: translate(${e.position.x}px, ${e.position.y}px)"
|
|
336
|
+
>
|
|
337
|
+
<div class="port port-in" data-node-id=${e.id} data-port="in"></div>
|
|
338
|
+
<div class="node-header">
|
|
339
|
+
<span class="node-status-dot"></span>
|
|
340
|
+
<span class="node-id">${e.id}</span>
|
|
341
|
+
</div>
|
|
342
|
+
${l?n`<span class="node-agent-tag">${l}</span>`:u}
|
|
343
|
+
${e.typeId&&Q[e.typeId]?n`<span class="node-type-tag" style="
|
|
344
|
+
background: color-mix(in srgb, ${Q[e.typeId].color} 15%, transparent);
|
|
345
|
+
color: ${Q[e.typeId].color};
|
|
346
|
+
">${Q[e.typeId].label}</span>`:u}
|
|
347
|
+
<div class="node-task-preview">
|
|
348
|
+
${this._truncateTask(e.task)}
|
|
349
|
+
</div>
|
|
350
|
+
${this._renderConstraints(e)}
|
|
351
|
+
<div class="port port-out" data-node-id=${e.id} data-port="out"></div>
|
|
352
|
+
</div>
|
|
353
|
+
`})}_renderConstraints(e){let t=[];return e.timeoutMs!=null&&t.push(`${Math.round(e.timeoutMs/1e3)}s`),e.maxSteps!=null&&t.push(`${e.maxSteps} steps`),t.length===0?u:n`<div class="node-constraints">${t.join(` | `)}</div>`}_truncateTask(e,t=40){return e.length>t?e.slice(0,t-1)+`…`:e}_renderEdges(e,t,n){let r=new Map(t.map(e=>[e.id,e]));return Z(e,e=>e.id,e=>{let t=r.get(e.source),i=r.get(e.target);if(!t||!i)return u;let o=V(t),s=H(i),c=U(o,s),l=W(s,o),d=n===e.id,f=this.edgeStatuses.get(e.id)??``,p=f?`edge-path--${f}`:``,m=f?`edge-arrow--${f}`:``;return a`
|
|
354
|
+
<g class="edge-group" data-edge-id=${e.id}>
|
|
355
|
+
<path class="edge-hit-area" d=${c} @click=${()=>this._onEdgeClick(e.id)} />
|
|
356
|
+
<path class="edge-path ${d?`edge-path--selected`:``} ${p}" d=${c} />
|
|
357
|
+
<path class="edge-arrow ${d?`edge-arrow--selected`:``} ${m}" d=${l} />
|
|
358
|
+
</g>
|
|
359
|
+
`})}_onEdgeClick(e){this.dispatchEvent(new CustomEvent(`edge-select`,{detail:e,bubbles:!0,composed:!0}))}_applyTransformGroups(e){let t=`translate(${e.x}px, ${e.y}px) scale(${e.scale})`;this._svgTransformGroup&&(this._svgTransformGroup.style.transform=t),this._htmlTransformGroup&&(this._htmlTransformGroup.style.transform=t)}_syncTransformImperative(e){this._applyTransformGroups(e),this._zoomIndicator&&(this._zoomIndicator.textContent=`${Math.round(e.scale*100)}%`),this._currentScale=e.scale}_dispatchViewportChange(e){this.dispatchEvent(new CustomEvent(`viewport-change`,{detail:e,bubbles:!0,composed:!0}))}_getCurrentViewport(){return{x:this._livePanX||this.viewport.x,y:this._livePanY||this.viewport.y,scale:this._currentScale}}_onPointerDown(e){if(this._mode!==`idle`)return;let t=e.composedPath();for(let n of t)if(n instanceof Element){if(n.classList.contains(`port`)&&n.classList.contains(`port-out`)){if(this.readOnly)return;let t=n.getAttribute(`data-node-id`);if(t){this._startEdgeConnection(e,t);return}}if(n.classList.contains(`port`)&&n.classList.contains(`port-in`))return;if(n.hasAttribute(`data-node-id`)&&n.classList.contains(`node-card`)){let t=n.getAttribute(`data-node-id`);if(this.readOnly){this.dispatchEvent(new CustomEvent(`node-inspect`,{detail:{nodeId:t},bubbles:!0,composed:!0}));return}this.dispatchEvent(new CustomEvent(`node-select`,{detail:{nodeId:t,multi:e.shiftKey},bubbles:!0,composed:!0})),this._startNodeDrag(e,t);return}}this.dispatchEvent(new CustomEvent(`canvas-click`,{bubbles:!0,composed:!0})),this._mode=`panning`,this._dragStartX=e.clientX,this._dragStartY=e.clientY,this._startPanX=this.viewport.x,this._startPanY=this.viewport.y,this._livePanX=this.viewport.x,this._livePanY=this.viewport.y,e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault(),this._container&&this._container.setAttribute(`data-mode`,`panning`),this.interactionMode=`panning`}_onPointerMove(e){switch(this._mode){case`panning`:this._onPointerMovePanning(e);break;case`dragging-node`:this._onPointerMoveDragNode(e);break;case`connecting-edge`:this._onPointerMoveConnecting(e);break}}_onPointerUp(e){switch(this._mode){case`panning`:{let e={x:this._livePanX,y:this._livePanY,scale:this._currentScale};this._dispatchViewportChange(e);break}case`dragging-node`:this._finishNodeDrag();break;case`connecting-edge`:this._finishEdgeConnection(e);break}this._mode=`idle`,this.interactionMode=`idle`,this._container&&this._container.removeAttribute(`data-mode`)}_onPointerMovePanning(e){let t=e.clientX-this._dragStartX,n=e.clientY-this._dragStartY,r=this._startPanX+t,i=this._startPanY+n,a=`translate(${r}px, ${i}px) scale(${this._currentScale})`;this._svgTransformGroup&&(this._svgTransformGroup.style.transform=a),this._htmlTransformGroup&&(this._htmlTransformGroup.style.transform=a),this._livePanX=r,this._livePanY=i}_startNodeDrag(e,t){this._mode=`dragging-node`,this._dragNodeId=t;let n=this._container?.getBoundingClientRect();if(!n)return;let r=this._getCurrentViewport(),i=g(e.clientX,e.clientY,n,r);this._dragStartGraphX=i.x,this._dragStartGraphY=i.y;let a=this.nodes.find(e=>e.id===t);a&&(this._dragNodeStartX=a.position.x,this._dragNodeStartY=a.position.y,this._dragLiveX=a.position.x,this._dragLiveY=a.position.y),this._dragSelectedStarts.clear(),a&&this._dragSelectedStarts.set(t,{...a.position});for(let e of this.selectedNodeIds){if(e===t)continue;let n=this.nodes.find(t=>t.id===e);n&&this._dragSelectedStarts.set(e,{...n.position})}e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault(),e.stopPropagation(),this._container&&this._container.setAttribute(`data-mode`,`dragging-node`),this.interactionMode=`dragging-node`}_onPointerMoveDragNode(e){let t=this._container?.getBoundingClientRect();if(!t)return;let n=this._getCurrentViewport(),r=g(e.clientX,e.clientY,t,n),i=r.x-this._dragStartGraphX,a=r.y-this._dragStartGraphY;for(let[e,t]of this._dragSelectedStarts){let n=t.x+i,r=t.y+a;this.snapToGrid&&(n=Math.round(n/24)*24,r=Math.round(r/24)*24);let o=this.renderRoot.querySelector(`.node-card[data-node-id="${e}"]`);o&&(o.style.transform=`translate(${n}px, ${r}px)`),this._updateConnectedEdges(e,n,r,i,a),e===this._dragNodeId&&(this._dragLiveX=n,this._dragLiveY=r)}}_updateConnectedEdges(e,t,n,r,i){for(let a of this.edges){if(a.source!==e&&a.target!==e)continue;let o;if(a.source===e)o={x:t,y:n};else{let e=this._dragSelectedStarts.get(a.source);if(e){let t=e.x+r,n=e.y+i;this.snapToGrid&&(t=Math.round(t/24)*24,n=Math.round(n/24)*24),o={x:t,y:n}}else{let e=this.nodes.find(e=>e.id===a.source);if(!e)continue;o=e.position}}let s;if(a.target===e)s={x:t,y:n};else{let e=this._dragSelectedStarts.get(a.target);if(e){let t=e.x+r,n=e.y+i;this.snapToGrid&&(t=Math.round(t/24)*24,n=Math.round(n/24)*24),s={x:t,y:n}}else{let e=this.nodes.find(e=>e.id===a.target);if(!e)continue;s=e.position}}let c=V({position:o}),l=H({position:s}),u=U(c,l),d=W(l,c),f=this.renderRoot.querySelector(`.edge-group[data-edge-id="${a.id}"]`);if(!f)continue;let p=f.querySelector(`.edge-hit-area`);p&&p.setAttribute(`d`,u);let m=f.querySelector(`.edge-path`);m&&m.setAttribute(`d`,u);let h=f.querySelector(`.edge-arrow`);h&&h.setAttribute(`d`,d)}}_finishNodeDrag(){let e=[],t=this._dragLiveX-this._dragNodeStartX,n=this._dragLiveY-this._dragNodeStartY;for(let[r,i]of this._dragSelectedStarts){let a=i.x+t,o=i.y+n;this.snapToGrid&&(a=Math.round(a/24)*24,o=Math.round(o/24)*24),e.push({nodeId:r,position:{x:a,y:o}})}e.length>0&&this.dispatchEvent(new CustomEvent(`node-drag-end`,{detail:{moves:e},bubbles:!0,composed:!0})),this._dragNodeId=null,this._dragSelectedStarts.clear()}_startEdgeConnection(e,t){this._mode=`connecting-edge`,this._connectSourceNodeId=t,this._previewLine=document.createElementNS(`http://www.w3.org/2000/svg`,`path`),this._previewLine.classList.add(`edge-preview`),this._svgTransformGroup?.appendChild(this._previewLine),e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault(),e.stopPropagation(),this._container&&this._container.setAttribute(`data-mode`,`connecting-edge`),this.interactionMode=`connecting-edge`}_onPointerMoveConnecting(e){if(!this._connectSourceNodeId||!this._previewLine)return;let t=this.nodes.find(e=>e.id===this._connectSourceNodeId);if(!t)return;let n=V(t),r=this._container?.getBoundingClientRect();if(!r)return;let i=this._getCurrentViewport(),a=U(n,g(e.clientX,e.clientY,r,i));this._previewLine.setAttribute(`d`,a)}_finishEdgeConnection(e){this._previewLine&&this._previewLine.parentNode&&this._previewLine.parentNode.removeChild(this._previewLine),this._previewLine=null;let t=e.composedPath(),n=null;for(let e of t)if(e instanceof Element&&e.classList.contains(`port-in`)&&e.hasAttribute(`data-node-id`)){n=e.getAttribute(`data-node-id`);break}n&&this._connectSourceNodeId&&n!==this._connectSourceNodeId&&this.dispatchEvent(new CustomEvent(`edge-create`,{detail:{source:this._connectSourceNodeId,target:n},bubbles:!0,composed:!0})),this._connectSourceNodeId=null}cancelInteraction(){this._mode===`connecting-edge`&&(this._previewLine&&this._previewLine.parentNode&&this._previewLine.parentNode.removeChild(this._previewLine),this._previewLine=null,this._connectSourceNodeId=null),this._mode=`idle`,this.interactionMode=`idle`,this._container&&this._container.removeAttribute(`data-mode`)}_onWheel(e){e.preventDefault();let t=this._container?.getBoundingClientRect();if(!t)return;let n=e.clientX-t.left,r=e.clientY-t.top,i=_(this._getCurrentViewport(),n,r,e.deltaY,m,2);this._syncTransformImperative(i),this._livePanX=i.x,this._livePanY=i.y,this._dispatchViewportChange(i)}};l([c({attribute:!1})],$.prototype,`viewport`,void 0),l([c({reflect:!0})],$.prototype,`interactionMode`,void 0),l([c({attribute:!1})],$.prototype,`nodes`,void 0),l([c({attribute:!1})],$.prototype,`edges`,void 0),l([c({attribute:!1})],$.prototype,`selectedNodeIds`,void 0),l([c({attribute:!1})],$.prototype,`selectedEdgeId`,void 0),l([c({type:Boolean,attribute:`snap-to-grid`})],$.prototype,`snapToGrid`,void 0),l([c({type:Array})],$.prototype,`highlightNodeIds`,void 0),l([c({type:Boolean,reflect:!0,attribute:`read-only`})],$.prototype,`readOnly`,void 0),l([c({attribute:!1})],$.prototype,`nodeStatuses`,void 0),l([c({attribute:!1})],$.prototype,`edgeStatuses`,void 0),$=l([e(`ic-graph-canvas`)],$);export{g as a,m as i,ce as n,_ as o,h as r,se as t};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import{c as e,f as t,h as n,l as r,r as i,s as a,t as o}from"./decorate-BvWYovGE.js";var s={telegram:`M20.3 3.5L2.6 10.3c-1.2.5-1.2 1.2-.2 1.5l4.5 1.4 1.7 5.3c.2.6.1.8.7.8.4 0 .7-.2.9-.4l2.2-2.1 4.5 3.3c.8.5 1.4.2 1.6-.8l2.9-13.6c.3-1.3-.5-1.9-1.6-1.2zM8.4 13l8.7-5.4c.4-.3.8-.1.5.2l-7.1 6.4-.3 3.1-1.8-4.3z`,discord:`M19.5 5.6A16 16 0 0015.5 4a12 12 0 00-.5 1.1 15 15 0 00-6 0A12 12 0 008.5 4 16 16 0 004.5 5.6 17 17 0 002 18.6a16 16 0 005 2.5c.4-.6.8-1.2 1.1-1.8a10 10 0 01-1.7-1l.4-.3a11.5 11.5 0 0010.4 0l.4.3c-.5.4-1.1.7-1.7 1 .3.6.7 1.2 1.1 1.8a16 16 0 005-2.5A17 17 0 0019.5 5.6zM8.3 16c-1 0-1.8-1-1.8-2.1s.8-2.1 1.8-2.1 1.9 1 1.8 2.1S9.4 16 8.3 16zm7.4 0c-1 0-1.8-1-1.8-2.1s.8-2.1 1.8-2.1 1.9 1 1.8 2.1S16.8 16 15.7 16z`,slack:`M5.1 15c0 1-.8 1.8-1.8 1.8S1.5 16 1.5 15s.8-1.8 1.8-1.8h1.8V15zm.9 0c0-1 .8-1.8 1.8-1.8s1.8.8 1.8 1.8v4.5c0 1-.8 1.8-1.8 1.8S6 20.5 6 19.5V15zM9 5.1c-1 0-1.8-.8-1.8-1.8S8 1.5 9 1.5s1.8.8 1.8 1.8v1.8H9zm0 .9c1 0 1.8.8 1.8 1.8S10 9.6 9 9.6H4.5c-1 0-1.8-.8-1.8-1.8S3.5 6 4.5 6H9zm9.9 1.8c0-1 .8-1.8 1.8-1.8s1.8.8 1.8 1.8-.8 1.8-1.8 1.8h-1.8V7.8zm-.9 0c0 1-.8 1.8-1.8 1.8S14.4 8.8 14.4 7.8V3.3c0-1 .8-1.8 1.8-1.8s1.8.8 1.8 1.8v4.5zM15 18.9c1 0 1.8.8 1.8 1.8s-.8 1.8-1.8 1.8-1.8-.8-1.8-1.8v-1.8H15zm0-.9c-1 0-1.8-.8-1.8-1.8s.8-1.8 1.8-1.8h4.5c1 0 1.8.8 1.8 1.8s-.8 1.8-1.8 1.8H15z`,whatsapp:`M17.5 14.4c-.3-.1-1.6-.8-1.9-.9-.3-.1-.5-.1-.7.1-.2.3-.7.9-.9 1.1-.2.2-.3.2-.6.1-.3-.1-1.2-.4-2.3-1.4-.9-.8-1.4-1.7-1.6-2-.2-.3 0-.5.1-.6l.4-.5c.1-.2.2-.3.2-.5.1-.2 0-.3 0-.5s-.7-1.6-.9-2.2c-.3-.6-.5-.5-.7-.5h-.6c-.2 0-.5.1-.8.3-.3.3-1 1-1 2.5s1.1 2.9 1.2 3.1c.2.2 2.1 3.2 5 4.5.7.3 1.3.5 1.7.6.7.2 1.3.2 1.8.1.6-.1 1.6-.7 1.9-1.3.2-.6.2-1.2.2-1.3-.1-.1-.3-.2-.6-.3zM12 2C6.5 2 2 6.5 2 12c0 1.8.5 3.5 1.3 4.9L2 22l5.2-1.4c1.4.8 3 1.2 4.8 1.2 5.5 0 10-4.5 10-10S17.5 2 12 2z`,line:`M22 10.8c0-4.8-4.8-8.7-10.8-8.7S.4 6 .4 10.8c0 4.3 3.8 7.9 9 8.6.3.1.8.2.9.5.1.3.1.6 0 .9l-.1.9c0 .3-.2 1.1.9.6s6.2-3.7 8.5-6.3c1.6-1.6 2.4-3.4 2.4-5.2zM7.5 13.3H5.7c-.3 0-.5-.2-.5-.5V9.2c0-.3.2-.5.5-.5s.5.2.5.5v3.1h1.3c.3 0 .5.2.5.5s-.2.5-.5.5zm1.9-.5c0 .3-.2.5-.5.5s-.5-.2-.5-.5V9.2c0-.3.2-.5.5-.5s.5.2.5.5v3.6zm5 0c0 .2-.1.4-.3.4l-.2.1-2.5-3.4v3c0 .3-.2.5-.5.5s-.5-.2-.5-.5V9.2c0-.2.1-.4.3-.4h.1l2.6 3.5V9.2c0-.3.2-.5.5-.5s.5.2.5.5v3.6zm3.5.5h-1.8c-.3 0-.5-.2-.5-.5V9.2c0-.3.2-.5.5-.5s.5.2.5.5v3.1h1.3c.3 0 .5.2.5.5s-.2.5-.5.5z`,signal:`M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2zm0 3c3.9 0 7 3.1 7 7s-3.1 7-7 7-7-3.1-7-7 3.1-7 7-7zm0 3a4 4 0 100 8 4 4 0 000-8zm0 2.5a1.5 1.5 0 110 3 1.5 1.5 0 010-3z`,imessage:`M12 2C6.5 2 2 5.8 2 10.5c0 2.7 1.5 5.1 3.8 6.7-.2 1-.6 2.5-1.8 3.8 2.1-.3 3.8-1.1 4.8-1.8.9.2 2 .3 3.2.3 5.5 0 10-3.8 10-8.5S17.5 2 12 2z`,irc:`M4 4h16v12H5.2L4 17.2V4zm2 2v8h12V6H6zm2 2h8v1H8V8zm0 3h6v1H8v-1z`,dashboard:`M3 3h7v7H3V3zm11 0h7v7h-7V3zM3 14h7v7H3v-7zm11 0h7v7h-7v-7z`,agents:`M16 11c1.7 0 3-1.3 3-3s-1.3-3-3-3-3 1.3-3 3 1.3 3 3 3zm-8 0c1.7 0 3-1.3 3-3S9.7 5 8 5 5 6.3 5 8s1.3 3 3 3zm0 2c-2.3 0-7 1.2-7 3.5V19h14v-2.5C15 14.2 10.3 13 8 13zm8 0c-.3 0-.6 0-.9.1 1.1.8 1.9 1.9 1.9 3.4V19h6v-2.5C23 14.2 18.3 13 16 13z`,channels:`M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2zm-2 15l-5-5 1.4-1.4L10 14.2l7.6-7.6L19 8l-9 9z`,skills:`M12 2L4.5 20.3l.7.2L12 18l6.8 2.5.7-.2L12 2zm0 3.5l5.5 13.3L12 16.5l-5.5 2.3L12 5.5z`,chat:`M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z`,memory:`M2 20h20v-4H2v4zm2-3h2v2H4v-2zM2 4v4h20V4H2zm4 3H4V5h2v2zm-4 7h20v-4H2v4zm2-3h2v2H4v-2z`,sessions:`M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-5 14H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z`,scheduler:`M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67V7z`,models:`M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2zm-1 17.9c-3.9-.5-7-3.9-7-7.9 0-.6.1-1.2.2-1.8L9 15v1c0 1.1.9 2 2 2v1.9zm6.9-2.5c-.3-.8-1-1.4-1.9-1.4h-1v-3c0-.6-.4-1-1-1H8v-2h2c.6 0 1-.4 1-1V7h2c1.1 0 2-.9 2-2v-.4c2.9 1.2 5 4.1 5 7.4 0 2.1-.8 4-2.1 5.4z`,observe:`M12 4.5C7 4.5 2.7 7.6 1 12c1.7 4.4 6 7.5 11 7.5s9.3-3.1 11-7.5c-1.7-4.4-6-7.5-11-7.5zM12 17c-2.8 0-5-2.2-5-5s2.2-5 5-5 5 2.2 5 5-2.2 5-5 5zm0-8c-1.7 0-3 1.3-3 3s1.3 3 3 3 3-1.3 3-3-1.3-3-3-3z`,security:`M12 1L3 5v6c0 5.6 3.8 10.7 9 12 5.2-1.3 9-6.4 9-12V5l-9-4zm0 10.99h7c-.5 4.1-3.3 7.8-7 8.9V12H5V6.3l7-3.1v8.79z`,approvals:`M23 12l-2.4-2.8.3-3.7-3.6-.8-1.9-3.2L12 3 8.6 1.5 6.7 4.7l-3.6.8.3 3.7L1 12l2.4 2.8-.3 3.7 3.6.8 1.9 3.2L12 21l3.4 1.5 1.9-3.2 3.6-.8-.3-3.7L23 12zm-12.5 5.5l-4.5-4.5 1.4-1.4 3.1 3.1 6.6-6.6 1.4 1.4-8 8z`,config:`M19.1 12.9a7 7 0 000-1.8l2-1.6a.5.5 0 00.1-.6l-1.9-3.3a.5.5 0 00-.6-.2l-2.3.9a7 7 0 00-1.6-.9l-.4-2.5a.5.5 0 00-.5-.4h-3.8a.5.5 0 00-.5.4l-.4 2.5a7 7 0 00-1.6.9l-2.3-.9a.5.5 0 00-.6.2L3 9a.5.5 0 00.1.6l2 1.6a7 7 0 000 1.8l-2 1.6a.5.5 0 00-.1.6l1.9 3.3a.5.5 0 00.6.2l2.3-.9a7 7 0 001.6.9l.4 2.5a.5.5 0 00.5.4h3.8a.5.5 0 00.5-.4l.4-2.5a7 7 0 001.6-.9l2.3.9a.5.5 0 00.6-.2l1.9-3.3a.5.5 0 00-.1-.6l-2-1.6zM12 15.5a3.5 3.5 0 110-7 3.5 3.5 0 010 7z`,setup:`M22 11V3h-7v3H9V3H2v8h7V8h2v10h4v3h7v-8h-7v3h-2V8h2v3h7zM7 9H4V5h3v4zm10 0V5h3v4h-3zm0 10v-4h3v4h-3z`,close:`M19 6.4L17.6 5 12 10.6 6.4 5 5 6.4 10.6 12 5 17.6 6.4 19 12 13.4 17.6 19 19 17.6 13.4 12 19 6.4z`,menu:`M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z`,bell:`M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2zm6-6v-5c0-3.1-1.6-5.6-4.5-6.3V4c0-.8-.7-1.5-1.5-1.5s-1.5.7-1.5 1.5v.7C7.6 5.4 6 7.9 6 11v5l-2 2v1h16v-1l-2-2z`,logout:`M17 7l-1.4 1.4L18.2 11H8v2h10.2l-2.6 2.6L17 17l5-5-5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4V5z`,"chevron-left":`M15.4 7.4L14 6l-6 6 6 6 1.4-1.4L10.8 12l4.6-4.6z`,"chevron-right":`M8.6 7.4L10 6l6 6-6 6-1.4-1.4L13.2 12 8.6 7.4z`,search:`M15.5 14h-.8l-.3-.3c1-1.1 1.6-2.6 1.6-4.2C16 5.9 13.1 3 9.5 3S3 5.9 3 9.5 5.9 16 9.5 16c1.6 0 3.1-.6 4.2-1.6l.3.3v.8l5 5 1.5-1.5-5-5zm-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14z`,check:`M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z`,x:`M19 6.4L17.6 5 12 10.6 6.4 5 5 6.4 10.6 12 5 17.6 6.4 19 12 13.4 17.6 19 19 17.6 13.4 12 19 6.4z`,plus:`M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z`,minus:`M19 13H5v-2h14v2z`,trash:`M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM8 9h8v10H8V9zm7.5-5l-1-1h-5l-1 1H5v2h14V4h-3.5z`,edit:`M3 17.3V21h3.8L17.8 9.9l-3.8-3.8L3 17.3zM20.7 7c.4-.4.4-1 0-1.4l-2.3-2.3c-.4-.4-1-.4-1.4 0l-1.8 1.8 3.8 3.8L20.7 7z`,copy:`M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z`,refresh:`M17.6 6.4A8 8 0 004.1 11H1l3.9 4 4-4H5.5a6 6 0 0110.8-3.2l1.3-1.4zM19 9l-4 4h3.5a6 6 0 01-10.8 3.2l-1.3 1.4A8 8 0 0019.9 13H23l-4-4z`,expand:`M21 11V3h-8l3.3 3.3-5 5 1.4 1.4 5-5L21 11zM3 13v8h8l-3.3-3.3 5-5-1.4-1.4-5 5L3 13z`,collapse:`M14 14h8l-3.3-3.3 3-3-1.4-1.4-3 3L14 6v8zM10 10H2l3.3 3.3-3 3 1.4 1.4 3-3L10 18v-8z`,settings:`M19.1 12.9a7 7 0 000-1.8l2-1.6a.5.5 0 00.1-.6l-1.9-3.3a.5.5 0 00-.6-.2l-2.3.9a7 7 0 00-1.6-.9l-.4-2.5a.5.5 0 00-.5-.4h-3.8a.5.5 0 00-.5.4l-.4 2.5a7 7 0 00-1.6.9l-2.3-.9a.5.5 0 00-.6.2L3 9a.5.5 0 00.1.6l2 1.6a7 7 0 000 1.8l-2 1.6a.5.5 0 00-.1.6l1.9 3.3a.5.5 0 00.6.2l2.3-.9a7 7 0 001.6.9l.4 2.5a.5.5 0 00.5.4h3.8a.5.5 0 00.5-.4l.4-2.5a7 7 0 001.6-.9l2.3.9a.5.5 0 00.6-.2l1.9-3.3a.5.5 0 00-.1-.6l-2-1.6zM12 15.5a3.5 3.5 0 110-7 3.5 3.5 0 010 7z`,pause:`M6 19h4V5H6v14zm8-14v14h4V5h-4z`,play:`M8 5v14l11-7L8 5z`,microphone:`M12 14c1.7 0 3-1.3 3-3V5c0-1.7-1.3-3-3-3S9 3.3 9 5v6c0 1.7 1.3 3 3 3zm5.3-3c0 3-2.5 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.4 2.7 6.2 6 6.7V21h2v-3.3c3.3-.5 6-3.3 6-6.7h-1.7z`,send:`M2.01 21L23 12 2.01 3 2 10l15 2-15 2z`,attach:`M16.5 6v11.5c0 2.5-2 4.5-4.5 4.5s-4.5-2-4.5-4.5V5c0-1.7 1.3-3 3-3s3 1.3 3 3v10.5c0 .8-.7 1.5-1.5 1.5s-1.5-.7-1.5-1.5V6H9v9.5c0 1.7 1.3 3 3 3s3-1.3 3-3V5c0-2.5-2-4.5-4.5-4.5S6 2.5 6 5v12.5c0 3.3 2.7 6 6 6s6-2.7 6-6V6h-1.5z`,stop:`M6 6h12v12H6z`,retry:`M17.6 6.4A8 8 0 004.1 11H1l3.9 4 4-4H5.5a6 6 0 0110.8-3.2l1.3-1.4zM19 9l-4 4h3.5a6 6 0 01-10.8 3.2l-1.3 1.4A8 8 0 0019.9 13H23l-4-4z`,download:`M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z`,image:`M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z`,"audio-wave":`M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.8-1-3.3-2.5-4v8c1.5-.7 2.5-2.2 2.5-4zM14 3.2v2.1c2.9.9 5 3.5 5 6.7s-2.1 5.8-5 6.7v2.1c4-.9 7-4.5 7-8.8s-3-7.9-7-8.8z`,slash:`M10 4L4 20h2l6-16h-2zm4 0l6 16h-2L12 4h2z`},c=class extends r{constructor(...e){super(...e),this.name=``,this.size=`1em`,this.color=`currentColor`,this.label=``}static{this.styles=[i,n`
|
|
2
|
+
:host {
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
line-height: 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
svg {
|
|
10
|
+
display: block;
|
|
11
|
+
}
|
|
12
|
+
`]}render(){let e=s[this.name];return e?this.label?t`
|
|
13
|
+
<svg
|
|
14
|
+
width=${this.size}
|
|
15
|
+
height=${this.size}
|
|
16
|
+
viewBox="0 0 24 24"
|
|
17
|
+
fill=${this.color}
|
|
18
|
+
role="img"
|
|
19
|
+
aria-label=${this.label}
|
|
20
|
+
>
|
|
21
|
+
<path d=${e} />
|
|
22
|
+
</svg>
|
|
23
|
+
`:t`
|
|
24
|
+
<svg
|
|
25
|
+
width=${this.size}
|
|
26
|
+
height=${this.size}
|
|
27
|
+
viewBox="0 0 24 24"
|
|
28
|
+
fill=${this.color}
|
|
29
|
+
aria-hidden="true"
|
|
30
|
+
>
|
|
31
|
+
<path d=${e} />
|
|
32
|
+
</svg>
|
|
33
|
+
`:t``}};o([a()],c.prototype,`name`,void 0),o([a()],c.prototype,`size`,void 0),o([a()],c.prototype,`color`,void 0),o([a()],c.prototype,`label`,void 0),c=o([e(`ic-icon`)],c);
|
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
import{
|
|
2
|
-
${this.layers.map(t=>{const i=a>0?s/a*100:0,e=a>0?t.durationMs/a*100:0;return s+=t.durationMs,l`
|
|
3
|
-
<div class="row">
|
|
4
|
-
<span class="layer-name" title="${d(t.name)}"
|
|
5
|
-
>${d(t.name)}</span
|
|
6
|
-
>
|
|
7
|
-
<div class="track">
|
|
8
|
-
<div
|
|
9
|
-
class="fill"
|
|
10
|
-
style="left: ${i}%; width: ${e}%;"
|
|
11
|
-
title="${t.name}: ${t.durationMs}ms (${t.messagesIn} -> ${t.messagesOut} messages)"
|
|
12
|
-
></div>
|
|
13
|
-
</div>
|
|
14
|
-
<span class="duration">${t.durationMs}ms</span>
|
|
15
|
-
</div>
|
|
16
|
-
`})}
|
|
17
|
-
`}};r.styles=[u,m`
|
|
1
|
+
import{c as e,f as t,h as n,l as r,r as i,s as a,t as o}from"./decorate-BvWYovGE.js";function s(e){let t=e.replace(/-/g,` `);return t.charAt(0).toUpperCase()+t.slice(1)}var c=class extends r{constructor(...e){super(...e),this.layers=[],this.totalDurationMs=0}static{this.styles=[i,n`
|
|
18
2
|
:host {
|
|
19
3
|
display: block;
|
|
20
4
|
}
|
|
@@ -66,4 +50,20 @@ import{s as u,i as m,n as p,a as v,b as l,t as f}from"./index-CEcM1R_C.js";var h
|
|
|
66
50
|
color: var(--ic-text-dim);
|
|
67
51
|
font-style: italic;
|
|
68
52
|
}
|
|
69
|
-
`]
|
|
53
|
+
`]}_getTotalDuration(){return this.totalDurationMs>0?this.totalDurationMs:this.layers.reduce((e,t)=>e+t.durationMs,0)}render(){if(this.layers.length===0)return t`<div class="empty">No layer data</div>`;let e=this._getTotalDuration(),n=0;return t`
|
|
54
|
+
${this.layers.map(r=>{let i=e>0?n/e*100:0,a=e>0?r.durationMs/e*100:0;return n+=r.durationMs,t`
|
|
55
|
+
<div class="row">
|
|
56
|
+
<span class="layer-name" title="${s(r.name)}"
|
|
57
|
+
>${s(r.name)}</span
|
|
58
|
+
>
|
|
59
|
+
<div class="track">
|
|
60
|
+
<div
|
|
61
|
+
class="fill"
|
|
62
|
+
style="left: ${i}%; width: ${a}%;"
|
|
63
|
+
title="${r.name}: ${r.durationMs}ms (${r.messagesIn} -> ${r.messagesOut} messages)"
|
|
64
|
+
></div>
|
|
65
|
+
</div>
|
|
66
|
+
<span class="duration">${r.durationMs}ms</span>
|
|
67
|
+
</div>
|
|
68
|
+
`})}
|
|
69
|
+
`}};o([a({attribute:!1})],c.prototype,`layers`,void 0),o([a({type:Number})],c.prototype,`totalDurationMs`,void 0),c=o([e(`ic-layer-waterfall`)],c);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{c as e,f as t,h as n,l as r,r as i,s as a,t as o}from"./decorate-BvWYovGE.js";function s(e,t){if(e<=0)return``;let n=t-e;if(n<0)return`just now`;let r=Math.floor(n/1e3);if(r<60)return`just now`;let i=Math.floor(r/60);if(i<60)return`${i}m ago`;let a=Math.floor(i/60);if(a<24)return`${a}h ago`;let o=Math.floor(a/24);return o<30?`${o}d ago`:new Date(e).toISOString().slice(0,10)}var c=class extends r{constructor(...e){super(...e),this.timestamp=0,this.updateInterval=6e4,this._intervalId=null}static{this.styles=[i,n`
|
|
2
|
+
:host {
|
|
3
|
+
display: inline-block;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
time {
|
|
7
|
+
color: var(--ic-text-muted);
|
|
8
|
+
font-size: var(--ic-text-xs);
|
|
9
|
+
}
|
|
10
|
+
`]}connectedCallback(){super.connectedCallback(),this._startTimer()}disconnectedCallback(){super.disconnectedCallback(),this._clearTimer()}_startTimer(){this._clearTimer(),this._intervalId=setInterval(()=>{this.requestUpdate()},this.updateInterval)}_clearTimer(){this._intervalId!==null&&(clearInterval(this._intervalId),this._intervalId=null)}render(){if(this.timestamp<=0)return t``;let e=Date.now();return t`
|
|
11
|
+
<time datetime=${new Date(this.timestamp).toISOString()} title=${new Date(this.timestamp).toLocaleString()}>${s(this.timestamp,e)}</time>
|
|
12
|
+
`}};o([a({type:Number})],c.prototype,`timestamp`,void 0),o([a({type:Number})],c.prototype,`updateInterval`,void 0),c=o([e(`ic-relative-time`)],c);
|