@pipelab/cli 2.0.0-beta.44 → 2.0.0-beta.45
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/index.mjs +30 -4
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/ui/assets/{AuthDialog-w67d5r4G.js → AuthDialog-DlU_WW6e.js} +1 -1
- package/ui/assets/{ReleaseFieldControl-DALuONGu.js → ReleaseFieldControl-BgZuHF66.js} +1 -1
- package/ui/assets/{ReleaseFlowWizard-t8PcFjz7.js → ReleaseFlowWizard-C1ayWNOQ.js} +1 -1
- package/ui/assets/{ReleaseStatus-CNqh0Ng8.js → ReleaseStatus-BiRuUd5Q.js} +1 -1
- package/ui/assets/{Settings-CtpMhnPn.js → Settings-b8oVSXyC.js} +1 -1
- package/ui/assets/{WebFilePicker-DbG965K4.js → WebFilePicker-GnTzUDGt.js} +1 -1
- package/ui/assets/{WorkflowLayout-ZVlPOfPm.js → WorkflowLayout-u-aSjl-f.js} +2 -2
- package/ui/assets/{cloud-files-Bwss9cDm.js → cloud-files-BpzwlEgg.js} +1 -1
- package/ui/assets/{connections-DEYT-R66.js → connections-Djk3Fk9U.js} +1 -1
- package/ui/assets/{connections-CXCq4WI0.js → connections-akr-Tw11.js} +1 -1
- package/ui/assets/{index-BGwbEQIW.js → index-3swN8pT8.js} +3 -3
- package/ui/assets/{pages-B5B77n7c.js → pages-aXNvwHy2.js} +1 -1
- package/ui/assets/{release-flow-BkiJdVEg.js → release-flow-BlvDg68b.js} +1 -1
- package/ui/assets/{run-detail-DgdlFRmC.js → run-detail-19oPx25U.js} +1 -1
- package/ui/assets/{useWorkflowDocument-BOayDtQT.js → useWorkflowDocument-6-o5gm97.js} +1 -1
- package/ui/assets/{workflow-artifacts-8LAkKUJH.js → workflow-artifacts-CIgleYIp.js} +1 -1
- package/ui/assets/{workflow-builds-wIJXMdtQ.js → workflow-builds-Czp-_TFW.js} +1 -1
- package/ui/assets/{workflow-plan-cJMJLnpz.js → workflow-plan-B-Iuxh0i.js} +1 -1
- package/ui/assets/{workflow-runs-B0lV45Qj.js → workflow-runs--207MNXD.js} +1 -1
- package/ui/assets/{workflow-settings-mLe6h-YN.js → workflow-settings-Bb-njArD.js} +1 -1
- package/ui/assets/{workflows-Bg1Gem2c.js → workflows-BWXkP514.js} +3 -3
- package/ui/index.html +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,D as t,d as n,f as r,l as i,t as ee}from"./index-
|
|
1
|
+
import{C as e,D as t,d as n,f as r,l as i,t as ee}from"./index-3swN8pT8.js";import{L as a,Pt as o,Y as s,Z as c,_t as l,d as u,f as d,i as f,jt as p,l as m,lt as h,p as g,t as te,u as _,v,x as y,y as b,z as x}from"./_plugin-vue_export-helper-p1XK9cLm.js";import{a as ne,t as re}from"./api-BxGTgrE5.js";import{_ as ie}from"./useApi-SF8tY_yo-D-2q1_yl.js";import{t as S}from"./devtools-RytpElE1-DjjeLr5W.js";import{t as ae}from"./useAgentAvailability-YDtT9EHJ.js";import{n as oe}from"./ui-runtime-RLNxd8zK.js";import{r as se}from"./workflow-load-state-Bu5S628y.js";import{n as C}from"./times-BF5NnquQ.js";import{t as w}from"./message-Bw5keJML.js";import{t as ce}from"./release-flow-BlvDg68b.js";var le={class:`dashboard-page`},ue={class:`dashboard-header`},de={class:`dashboard-actions`},fe={class:`overview-grid`},pe={key:0,class:`empty-copy`,role:`status`},me={key:0,class:`workflow-cards`},he={key:1,class:`empty-copy`},ge={key:3,class:`activity-state`,role:`status`,"aria-busy":`true`},_e={key:4,class:`activity-state activity-error`,role:`alert`},ve={class:`latest-main`},ye={id:`latest-title`},be={class:`latest-meta`},xe={key:0},Se=[`datetime`],Ce={key:1},we={key:0,class:`latest-error`},Te={class:`latest-actions`},Ee={key:0,class:`overview-card recent-executions`,"aria-labelledby":`recent-executions-title`},De={id:`recent-executions-title`},Oe=[`aria-label`],ke={class:`execution-name`},Ae=[`datetime`],je={key:1,class:`execution-row execution-row-static`},Me={class:`execution-name`},Ne=[`datetime`],T=te(y({__name:`index`,setup(te){let y=ie(),T=re(),E=n(),{t:D,locale:Pe}=t(),O=i(),k=r(),A=ae(),Fe=oe===`browser`,{files:j,selectedProjectId:M,error:N}=ne(k),P=m(()=>k.status===`ready`),F=m(()=>j.value.projects.find(e=>e.id===M.value)),I=m(()=>(j.value.workflows??[]).filter(e=>e.project===M.value)),Ie=m(()=>I.value.length),Le=m(()=>I.value.map(e=>`${e.id}:${e.lastModified}`).join(`|`)),L=h([]),R=h(),z=h(!1),B=0,V=h([]),H=h(!1),U=h(``),W=0;ee(m(()=>!A.isReady.value||!H.value&&!z.value));let G=e=>E.add({severity:`error`,summary:D(`base.error`),detail:e instanceof Error?e.message:String(e),life:5e3}),K=async()=>{let e=++W,t=M.value;if(V.value=[],U.value=``,!t||!P.value||!A.isReady.value)H.value=!1;else{H.value=!0;try{let n=await T.execute(`build-history:get-all`,{query:{projectId:t}});if(e!==W)return;if(n.type===`error`)throw Error(n.ipcError);V.value=n.result.entries.filter(e=>e.projectId===t).toSorted((e,t)=>t.startTime-e.startTime).slice(0,6)}catch(t){e===W&&(U.value=String(t))}finally{e===W&&(H.value=!1)}}};s([M,P,A.isReady],()=>void K(),{immediate:!0});let Re=m(()=>!H.value&&!U.value&&!q.value),q=m(()=>V.value[0]),J=m(()=>V.value.slice(1)),Y=m(()=>q.value?.status===`failed`||q.value?.status===`completed-with-errors`),ze=e=>{let t=Math.round(e/1e3),n=Math.floor(t/60);return n?`${n}m ${t%60}s`:`${t}s`},Be=()=>{let e=q.value;e?.workflowId&&X({id:e.workflowId,projectId:e.projectId,name:e.workflowName??``})},Ve=h(),He=m(()=>L.value.map(e=>({label:e.name,command:()=>X(e)}))),Ue=e=>{let[t]=L.value;L.value.length===1&&t?X(t):Ve.value?.toggle(e)},We=()=>y.push({path:`/workflows`,query:{create:`new`}}),X=e=>{e.projectId===M.value&&(A.isReady.value?R.value=e:E.add({severity:`warn`,summary:D(`home.ship-engine-required`),life:5e3}))};s(M,()=>R.value=void 0);let Z=e=>`/workflows/${e.workflowId}/${e.projectId}/runs/${e.id}`,Q=e=>D(`home.run-status-${e}`),$=e=>new Intl.DateTimeFormat(Pe.value,{dateStyle:`medium`,timeStyle:`short`}).format(e),Ge=async()=>{let e=++B,t=M.value;if(!t){L.value=[],z.value=!1;return}if(!P.value||!A.isReady.value){L.value.some(e=>e.projectId!==t)&&(L.value=[]),z.value=!1;return}let n=I.value.slice(0,12);if(!n.length)L.value=[],z.value=!1;else{z.value=!0;try{let r=await Promise.all(n.map(async e=>{try{return await T.execute(`workflow:load`,{workflowId:e.id,projectId:e.project})}catch(e){return{type:`error`,ipcError:e instanceof Error?e.message:String(e)}}}));if(e!==B||t!==M.value||!P.value||!A.isReady.value)return;let{loaded:i}=se(n,r);L.value=i.map(e=>({id:e.id,name:e.content.name,projectId:e.project}))}finally{e===B&&(z.value=!1)}}};return s([M,P,A.isReady,Le],()=>void Ge(),{immediate:!0}),(t,n)=>{let r=e;return a(),g(`main`,le,[_(`header`,ue,[_(`h1`,null,o(F.value?.name||t.$t(`home.choose-project`)),1),_(`div`,de,[b(l(C),{label:t.$t(`home.new-workflow`),icon:`mdi mdi-plus`,severity:`secondary`,outlined:``,disabled:!Fe&&(!P.value||!l(A).isReady.value||!F.value),onClick:We},null,8,[`label`,`disabled`]),b(l(C),{label:t.$t(`home.ship`),icon:`mdi mdi-rocket-launch-outline`,disabled:!L.value.length,"aria-haspopup":`menu`,onClick:Ue},null,8,[`label`,`disabled`])])]),P.value&&l(O).runtimeStatus===`error`?(a(),u(l(w),{key:0,severity:`warn`,closable:!1,role:`alert`,class:`dashboard-message`},{default:c(()=>[v(o(t.$t(`home.runtime-unavailable`,{error:l(O).runtimeError||``}))+` `,1),b(l(C),{label:t.$t(`home.retry-runtime`),text:``,size:`small`,onClick:n[0]||=e=>l(O).loadRuntimeInfo().catch(G)},null,8,[`label`])]),_:1})):d(``,!0),l(A).isReady.value&&!P.value&&l(N)?(a(),u(l(w),{key:1,severity:`error`,closable:!1,role:`alert`,class:`dashboard-message`},{default:c(()=>[v(o(l(N))+` `,1),b(l(C),{label:t.$t(`home.retry`),text:``,size:`small`,onClick:n[1]||=e=>l(k).load(!0).catch(G)},null,8,[`label`])]),_:1})):d(``,!0),_(`div`,fe,[P.value?l(A).isReady.value?Re.value?(a(),g(f,{key:2},[L.value.length?(a(),g(`div`,me,[(a(!0),g(f,null,x(L.value,e=>(a(),g(`article`,{key:e.id,class:`workflow-card`},[b(l(S),{class:`workflow-card-name`,to:`/workflows/${e.id}/${e.projectId}`,"aria-label":t.$t(`home.open-workflow`,{name:e.name})},{default:c(()=>[v(o(e.name),1)]),_:2},1032,[`to`,`aria-label`]),b(l(C),{label:t.$t(`home.ship`),icon:`mdi mdi-rocket-launch-outline`,"aria-label":t.$t(`home.ship-workflow-named`,{name:e.name}),onClick:t=>X(e)},null,8,[`label`,`aria-label`,`onClick`])]))),128))])):Ie.value===0?(a(),g(`p`,he,o(t.$t(`home.no-workflows-in-project`)),1)):d(``,!0)],64)):H.value?(a(),g(`div`,ge,o(t.$t(`home.loading-executions`)),1)):U.value?(a(),g(`div`,_e,[v(o(t.$t(`home.executions-unavailable`))+` `,1),b(l(C),{label:t.$t(`home.retry`),text:``,size:`small`,onClick:K},null,8,[`label`])])):(a(),g(f,{key:5},[_(`section`,{class:p([`latest-card`,`latest-${q.value.status}`]),"aria-labelledby":`latest-title`},[_(`div`,ve,[_(`span`,{class:p([`execution-status`,`status-${q.value.status}`])},o(Q(q.value.status)),3),_(`h2`,ye,o(q.value.workflowName||t.$t(`home.workflow-run`)),1),_(`p`,be,[q.value.version?(a(),g(`span`,xe,`v`+o(q.value.version),1)):d(``,!0),_(`time`,{datetime:new Date(q.value.startTime).toISOString()},o($(q.value.startTime)),9,Se),q.value.duration?(a(),g(`span`,Ce,o(ze(q.value.duration)),1)):d(``,!0)]),Y.value&&q.value.error?.message?(a(),g(`p`,we,o(q.value.error.message),1)):d(``,!0)]),_(`div`,Te,[Y.value&&q.value.workflowId?(a(),u(l(C),{key:0,label:t.$t(`home.retry`),icon:`mdi mdi-refresh`,onClick:Be},null,8,[`label`])):d(``,!0),q.value.workflowId?(a(),u(l(S),{key:1,class:`manage-workflows-link`,to:Z(q.value)},{default:c(()=>[v(o(t.$t(`home.view-run`))+` `,1),n[4]||=_(`i`,{class:`mdi mdi-arrow-right`,"aria-hidden":`true`},null,-1)]),_:1},8,[`to`])):d(``,!0)])],2),J.value.length?(a(),g(`section`,Ee,[_(`h2`,De,o(t.$t(`home.recent-executions`)),1),_(`div`,{class:`execution-list`,role:`list`,"aria-label":t.$t(`home.recent-executions`)},[(a(!0),g(f,null,x(J.value,e=>(a(),g(`div`,{key:e.id,role:`listitem`},[e.workflowId?(a(),u(l(S),{key:0,class:`execution-row`,to:Z(e),"aria-label":t.$t(`home.open-execution`,{workflow:e.workflowName||t.$t(`home.workflow-run`),status:Q(e.status)})},{default:c(()=>[_(`span`,{class:p([`execution-status`,`status-${e.status}`])},o(Q(e.status)),3),_(`span`,ke,o(e.workflowName||t.$t(`home.workflow-run`)),1),_(`time`,{datetime:new Date(e.startTime).toISOString()},o($(e.startTime)),9,Ae),n[5]||=_(`i`,{class:`mdi mdi-chevron-right`,"aria-hidden":`true`},null,-1)]),_:2},1032,[`to`,`aria-label`])):(a(),g(`div`,je,[_(`span`,{class:p([`execution-status`,`status-${e.status}`])},o(Q(e.status)),3),_(`span`,Me,o(e.workflowName||t.$t(`home.workflow-run`)),1),_(`time`,{datetime:new Date(e.startTime).toISOString()},o($(e.startTime)),9,Ne)]))]))),128))],8,Oe)])):d(``,!0)],64)):(a(),u(l(w),{key:1,severity:`warn`,closable:!1,role:`status`,class:`dashboard-message`},{default:c(()=>[v(o(t.$t(`home.executions-disconnected`))+` `,1),b(l(C),{label:t.$t(`home.reconnect-engine`),text:``,size:`small`,onClick:n[2]||=e=>l(A).reconnect().catch(G)},null,8,[`label`])]),_:1})):(a(),g(`p`,pe,o(l(A).isReady.value?t.$t(`home.executions-waiting-project`):t.$t(`home.project-overview-disconnected`)),1))]),b(r,{ref_key:`shipMenu`,ref:Ve,model:He.value,popup:``},null,8,[`model`]),R.value?(a(),u(ce,{key:2,"dashboard-mode":!0,"dashboard-flow-id":R.value.id,"dashboard-project-id":R.value.projectId,onCloseDashboard:n[3]||=e=>R.value=void 0},null,8,[`dashboard-flow-id`,`dashboard-project-id`])):d(``,!0)])}}}),[[`__scopeId`,`data-v-fa9eb1a6`]]);export{T as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-COiEfhsA.js";import{A as t,B as n,F as r,H as i,I as a,L as o,N as s,O as c,Pt as l,Q as u,U as d,V as f,Y as p,Z as m,_t as h,d as g,f as _,ft as v,g as y,i as b,jt as x,k as S,l as C,lt as w,o as T,p as E,q as ee,st as D,t as O,u as k,v as A,x as j,y as M,z as N}from"./_plugin-vue_export-helper-p1XK9cLm.js";import{a as P,f as te,l as F,n as I,p as ne,s as re}from"./times-BF5NnquQ.js";import{_ as ie,g as ae}from"./useApi-SF8tY_yo-D-2q1_yl.js";import{c as oe,t as se}from"./api-BxGTgrE5.js";import{$ as ce,A as le,B as ue,C as de,E as fe,G as pe,I as me,J as he,K as ge,M as _e,N as ve,P as ye,R as be,S as xe,U as Se,V as Ce,W as we,X as Te,Y as Ee,Z as De,_ as Oe,at as ke,d as Ae,et as je,i as Me,it as Ne,j as Pe,k as Fe,n as Ie,nt as Le,p as Re,q as ze,rt as Be,st as Ve,t as He,tt as Ue,v as We,y as Ge}from"./release-flow-model-DA5OtEda.js";import{D as Ke,Dt as qe,J as Je,Lt as Ye,P as Xe,Pt as Ze,Rt as Qe,V as $e,bt as et,jt as tt,mt as nt,o as rt,q as it,r as at,rt as ot,w as st}from"./basedirective-jm123zF5.js";import{t as ct}from"./zindex-1d7j-Dyg.js";import{n as lt}from"./ui-runtime-RLNxd8zK.js";import{t as ut}from"./useAgentAvailability-YDtT9EHJ.js";import{t as dt}from"./overlayeventbus-BIxzVXg6.js";import{i as ft,t as pt}from"./inputtext-C7g3_yEy.js";import{t as mt}from"./chevron-down-DJUsXNmb.js";import{t as ht}from"./dialog-Bg6uUBwG.js";import{A as gt,D as _t,E as vt,O as yt,h as bt,l as xt,m as St,t as Ct,u as wt}from"./index-
|
|
1
|
+
import{n as e}from"./rolldown-runtime-COiEfhsA.js";import{A as t,B as n,F as r,H as i,I as a,L as o,N as s,O as c,Pt as l,Q as u,U as d,V as f,Y as p,Z as m,_t as h,d as g,f as _,ft as v,g as y,i as b,jt as x,k as S,l as C,lt as w,o as T,p as E,q as ee,st as D,t as O,u as k,v as A,x as j,y as M,z as N}from"./_plugin-vue_export-helper-p1XK9cLm.js";import{a as P,f as te,l as F,n as I,p as ne,s as re}from"./times-BF5NnquQ.js";import{_ as ie,g as ae}from"./useApi-SF8tY_yo-D-2q1_yl.js";import{c as oe,t as se}from"./api-BxGTgrE5.js";import{$ as ce,A as le,B as ue,C as de,E as fe,G as pe,I as me,J as he,K as ge,M as _e,N as ve,P as ye,R as be,S as xe,U as Se,V as Ce,W as we,X as Te,Y as Ee,Z as De,_ as Oe,at as ke,d as Ae,et as je,i as Me,it as Ne,j as Pe,k as Fe,n as Ie,nt as Le,p as Re,q as ze,rt as Be,st as Ve,t as He,tt as Ue,v as We,y as Ge}from"./release-flow-model-DA5OtEda.js";import{D as Ke,Dt as qe,J as Je,Lt as Ye,P as Xe,Pt as Ze,Rt as Qe,V as $e,bt as et,jt as tt,mt as nt,o as rt,q as it,r as at,rt as ot,w as st}from"./basedirective-jm123zF5.js";import{t as ct}from"./zindex-1d7j-Dyg.js";import{n as lt}from"./ui-runtime-RLNxd8zK.js";import{t as ut}from"./useAgentAvailability-YDtT9EHJ.js";import{t as dt}from"./overlayeventbus-BIxzVXg6.js";import{i as ft,t as pt}from"./inputtext-C7g3_yEy.js";import{t as mt}from"./chevron-down-DJUsXNmb.js";import{t as ht}from"./dialog-Bg6uUBwG.js";import{A as gt,D as _t,E as vt,O as yt,h as bt,l as xt,m as St,t as Ct,u as wt}from"./index-3swN8pT8.js";import{a as Tt,n as Et,r as Dt,t as Ot}from"./provider-icons-CgkG5BRP.js";import{t as kt}from"./textarea-zQNpvw5f.js";import{t as At}from"./ReleaseFieldControl-BgZuHF66.js";import{t as jt}from"./toggleswitch-DE3Rpk7Q.js";import{t as Mt}from"./angle-right-GT6f2TbL.js";import{t as Nt}from"./message-Bw5keJML.js";import{t as Pt}from"./workflow-header-state-B-0MBtB0.js";import{t as Ft}from"./connections-Djk3Fk9U.js";import{a as It,n as Lt,o as Rt}from"./useWorkflowDocument-6-o5gm97.js";import{t as zt}from"./run-events-egZ2rllf.js";import{i as Bt,n as Vt,r as Ht,t as Ut}from"./run-notifications-CDKHwzAw.js";import{t as Wt}from"./tag-CBfU-PTU.js";import{t as Gt}from"./ReleaseStatus-BiRuUd5Q.js";var Kt=(e,t)=>qt((e.name??``).replace(/[\\/:*?"<>|\u0000-\u001f]/g,`-`).trim().replace(/^\.+/,``),`. `)||`Deployment ${t+1}`,qt=(e,t)=>{let n=e.length;for(;n>0&&t.includes(e[n-1]);)n--;return e.slice(0,n)},Jt=(e,t)=>{let n=e.includes(`\\`)&&!e.includes(`/`)?`\\`:`/`;return`${qt(e,`\\/`)}${n}${t}`},Yt=e=>{let t=Math.max(0,Math.round(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m ${t%60}s`:`${Math.floor(n/60)}h ${n%60}m`},Xt=[{on:`success`},{on:`failure`}],Zt=async e=>{let t=await e.readEnvironment(),n=Object.fromEntries(Object.entries(t).flatMap(([e,t])=>t===void 0?[]:[[e,t]]));return e.execute({...e.request,env:n})},Qt=at.extend({name:`tieredmenu`,style:`
|
|
2
2
|
.p-tieredmenu {
|
|
3
3
|
background: dt('tieredmenu.background');
|
|
4
4
|
color: dt('tieredmenu.color');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,I as t,L as n,Pt as r,Y as i,Z as a,_t as o,d as s,f as c,i as l,jt as u,l as d,lt as f,p,st as ee,t as te,u as m,v as h,x as g,y as ne,z as _}from"./_plugin-vue_export-helper-p1XK9cLm.js";import{l as re,t as ie}from"./index-BGwbEQIW.js";import{_ as ae,g as oe}from"./useApi-SF8tY_yo-D-2q1_yl.js";import{n as v}from"./times-BF5NnquQ.js";import{t as y}from"./tag-CBfU-PTU.js";import{t as b}from"./message-Bw5keJML.js";import{c as x,t as se}from"./api-BxGTgrE5.js";import{t as ce}from"./useAgentAvailability-YDtT9EHJ.js";import{n as le}from"./run-events-egZ2rllf.js";import{t as ue}from"./connections-DEYT-R66.js";import{n as de}from"./useWorkflowDocument-BOayDtQT.js";import{J as fe}from"./release-flow-model-DA5OtEda.js";import{i as pe,n as me,r as he,t as ge}from"./provider-icons-CgkG5BRP.js";var _e=async(e,t=4,n=250,r=()=>!0)=>{for(let i=0;i<=t;i++){if(!r())return;let a=await e();if(!r())return;if(a!==void 0)return a;i<t&&await new Promise(e=>setTimeout(e,n))}},S=e=>e.map(e=>({id:e.id,path:e.path,...typeof e.size==`number`&&e.size>0?{size:e.size}:{},descriptor:e.descriptor,version:e.version,stepId:e.stepId,artifact:e.artifact,checksum:e.checksum,cloud:e.cloud})),ve=()=>({selectedStepId:null,initialSelectionMade:!1,userSelectedStep:!1}),ye=e=>{e.selectedStepId=null,e.initialSelectionMade=!1,e.userSelectedStep=!1},be=(e,t)=>{e.userSelectedStep||e.initialSelectionMade||!t.length||(e.selectedStepId=t.find(e=>e.status===`running`)?.id||t.find(e=>e.status===`failed`)?.id||t[0].id,e.initialSelectionMade=!0)},xe=(e,t)=>{e.selectedStepId=t,e.userSelectedStep=!0},Se=(e,t,n)=>e.projectId===n&&e.workflowId===t,C=(e,t)=>{let n=new Map;for(let[r,i]of[[e,`current`],[t,`persisted`]])for(let e of r){let t=`${e.timestamp}:${e.source||``}:${e.message}:${e.level}`,r=n.get(t)||{current:[],persisted:[]};r[i].push(e),n.set(t,r)}return[...n.values()].flatMap(({current:e,persisted:t})=>[...e,...t.slice(e.length)]).toSorted((e,t)=>e.timestamp-t.timestamp)},w=new Set([`completed`,`failed`,`skipped`,`cancelled`]),Ce=(e,t)=>{let n=e.status!==`running`&&t.status===`running`,r=new Map(e.steps.map(e=>[e.id,e])),i=t.steps.map(e=>{let t=r.get(e.id);if(!t)return{...e,logs:[...e.logs]};let n=w.has(t.status),i=w.has(e.status),a=n&&!i||(t.error?.timestamp??t.endTime??0)>(e.error?.timestamp??e.endTime??0)?t:e;return{...a,error:a.error||t.error,phases:T(t.phases,e.phases),logs:C(t.logs,e.logs)}});return{...n?e:t,status:n?e.status:t.status,...n?{endTime:e.endTime,duration:e.duration,error:e.error}:{},steps:i,logs:C(e.logs,t.logs)}},T=(e,t)=>{if(!e)return t;if(!t)return e;let n=new Map(e.map(e=>[e.id,e]));return t.map(e=>{let t=n.get(e.id);if(!t)return e;let r=![`pending`,`running`].includes(t.status),i=![`pending`,`running`].includes(e.status);return{...r&&!i||(t.completedAt??t.startedAt??0)>(e.completedAt??e.startedAt??0)?t:e,warnings:[...new Set([...t.warnings,...e.warnings])]}})},we=e=>e.type===`success`&&e.result?.result===`ko`?`This run is no longer active.`:``,E=e=>/\bEACCES\b|\bEPERM\b|access is denied/i.test(e)?{category:`Permission`,summary:`A local file or folder could not be accessed.`,nextAction:`Check file permissions for the reported path, then rerun this workflow.`}:/\b403\b|forbidden|permission denied|insufficient (?:permission|scope)|not allowed/i.test(e)?{category:`Permission`,summary:`The destination account does not have permission to complete this action.`,nextAction:`Check the account's access and required permissions for this destination, then rerun this workflow.`}:/auth|credential|unauthori[sz]ed|\b401\b|login|sign.?in/i.test(e)?{category:`Authentication`,summary:`The account or session was not accepted.`,nextAction:`Sign in again or select a different account connection, then rerun this workflow.`}:/\bENOSPC\b|no space left|disk full|not enough disk space/i.test(e)?{category:`Disk space`,summary:`There is not enough free space to complete this step.`,nextAction:`Free disk space at the reported location, then rerun this workflow.`}:/\bENOENT\b|not found|missing (?:file|tool|command)|could not find|does not exist/i.test(e)?{category:`Missing tool or file`,summary:`A required command or file could not be found.`,nextAction:`Install the required tool or correct its configured path, then rerun this workflow.`}:/\bECONN|\bENOTFOUND\b|\bETIMEDOUT\b|network|fetch failed|offline|connection refused/i.test(e)||/\b5\d{2}\b|service unavailable/i.test(e)?{category:`Connection`,summary:`Pipelab could not reach a required service.`,nextAction:`Check the network connection and destination availability, then rerun this workflow.`}:{category:`Step failed`,summary:`This step reported an error while the workflow was running.`,nextAction:`Review this step's logs and provider details to resolve the error before rerunning.`},D=/api key|credential|token|authenticat|unauthori[sz]ed|\b401\b|pipelab login|log(?:ged)? ?in|sign(?:ed)? ?in|expired|invalid (?:key|token|password|secret)|was rejected|access denied/i,O=/\b(?:app ?id|depot|channel|project|branch|game|slug|username|namespace)\b|not configured|is required|missing|invalid .*\bid\b|does not exist|not found/i,k=(e,t)=>{if(/choose an output/i.test(e))return t?.destinationId?{kind:`deployment`,label:`Choose output`,destinationId:t.destinationId,...t.slotId?{slotId:t.slotId}:{}}:{kind:`configuration`,label:`Choose output`};if(D.test(e))return{kind:`connections`,label:`Fix connection`,...t?.destinationId?{destinationId:t.destinationId}:{}};if(t?.destinationId)return O.test(e)?{kind:`deployment`,label:t.destinationName?`Open ${t.destinationName} settings`:`Open settings`,destinationId:t.destinationId,...t.slotId?{slotId:t.slotId}:{}}:void 0;if(t&&O.test(e))return{kind:`builds`,label:`Review builds`}},Te=e=>{if(e.status!==`failed`&&e.status!==`completed-with-errors`)return[];let t=[],n=e.steps.filter(e=>e.status===`failed`);for(let r of n){let n=e.deliveries?.find(e=>e.id===r.id)||e.deliveries?.find(e=>e.status===`failed`&&e.destinationId===r.destinationId&&(!r.slotId||e.slotId===r.slotId)),i=r.error?.message||n?.error;if(!i)continue;let a=r.error?.code===`PREFLIGHT_FAILED`,o=a?{category:`Preflight`,summary:i,nextAction:`Nothing was run. Fix this destination's account, then rerun this workflow.`}:E(i),s=i.match(/pipelab login\s+\S+/i)?.[0],c=!s&&/`[^`]+`/.test(i);t.push({id:r.id,title:r.name||r.id,category:o.category,summary:c?i:o.summary,nextAction:s?`Run ${s} and try this step again.`:c?``:o.nextAction,stepId:r.id,...n?.destinationName||n?.destinationId||r.destinationName||r.destinationId?{destination:n?.destinationName||n?.destinationId||r.destinationName||r.destinationId}:{},...n?.slotId||r.slotId?{slotId:n?.slotId||r.slotId}:{},...(e=>e?{fix:e}:{})(k(i,{destinationId:r.destinationId??n?.destinationId,slotId:r.slotId??n?.slotId,destinationName:r.destinationName??n?.destinationName,uses:r.uses})),...a?{}:{rawMessage:i},...r.error?.stack?{rawStack:r.error.stack}:{},...r.error?.code&&!a?{errorCode:r.error.code}:{}})}if(e.error?.code===`PREFLIGHT_FAILED`&&n.length)return t;if(e.error&&!n.some(t=>t.error?.message===e.error?.message)){let n=E(e.error.message),r=/`[^`]+`/.test(e.error.message);t.unshift({id:`run-setup`,title:`Run setup`,category:n.category,summary:r?e.error.message:n.summary,nextAction:r?``:n.nextAction,...(e=>e?{fix:e}:{})(k(e.error.message)),rawMessage:e.error.message,...e.error.stack?{rawStack:e.error.stack}:{},...e.error.code?{errorCode:e.error.code}:{}})}return t},Ee=(e,t)=>{if(t.type===`workflow.completed`){let n=new Map(e.steps.map(e=>[e.id,e]));e.steps=Object.values(t.result.steps).map(e=>{let t=n.get(e.id);return Object.assign({id:e.id,name:t?.name||e.id,uses:e.uses,status:e.status,startTime:e.startedAt,endTime:e.completedAt,duration:e.duration,phases:e.phases,diagnostics:e.diagnostics},e.blockedBy?.length?{blockedBy:e.blockedBy}:{},{logs:t?.logs||[],output:e.outputs},e.error?{error:{message:e.error.message,code:e.error.name,timestamp:e.completedAt}}:{},e.delivery?{destinationId:e.delivery.destinationId,slotId:e.delivery.slotId}:{})}),e.status=t.result.status,e.endTime=t.timestamp,e.duration=t.duration,e.output=t.result.outputs,e.artifacts=S(t.result.artifacts),e.deliveries=t.result.deliveries,e.totalSteps=e.steps.length,e.completedSteps=e.steps.filter(e=>e.status===`completed`).length,e.failedSteps=e.steps.filter(e=>e.status===`failed`||e.status===`skipped`).length,e.cancelledSteps=e.steps.filter(e=>e.status===`cancelled`).length,e.updatedAt=t.timestamp;return}if(t.type===`workflow.failed`){e.status=`failed`,e.endTime=t.timestamp,e.duration=t.duration,e.error={message:t.error.message,code:t.error.name,timestamp:t.timestamp},e.completedSteps=e.steps.filter(e=>e.status===`completed`).length,e.failedSteps=e.steps.filter(e=>e.status===`failed`||e.status===`skipped`).length,e.cancelledSteps=e.steps.filter(e=>e.status===`cancelled`).length,e.updatedAt=t.timestamp;return}let n=`stepId`in t?e.steps.find(e=>e.id===t.stepId):void 0;if(n)switch(t.type){case`step.started`:n.status=`running`,n.startTime=t.timestamp;return;case`phase.started`:case`phase.completed`:case`phase.skipped`:case`phase.failed`:case`phase.warning`:case`phase.not-reached`:case`phase.not-reported`:{t.type===`phase.warning`&&t.diagnostic&&(n.diagnostics??=[],n.diagnostics.push(t.message));let e=n.phases?.find(e=>e.id===t.phaseId);if(!e)return;switch(t.type){case`phase.started`:e.status=`running`,e.startedAt=t.timestamp;break;case`phase.completed`:e.status=`completed`,e.completedAt=t.timestamp,e.duration=t.duration,t.message!==void 0&&(e.message=t.message);break;case`phase.skipped`:e.status=`skipped`,e.completedAt=t.timestamp,e.duration=t.duration,e.message=t.reason;break;case`phase.failed`:e.status=`failed`,e.completedAt=t.timestamp,e.duration=t.duration,e.error=t.error;break;case`phase.warning`:e.warnings.push(t.message);break;case`phase.not-reached`:e.status=`not-reached`,e.title=t.title,e.completedAt=t.timestamp;break;case`phase.not-reported`:e.status=`not-reported`,e.title=t.title,e.completedAt=t.timestamp}return}case`step.log`:{if(n.logs.some(e=>e.timestamp===t.timestamp&&e.message===t.message))return;let r={id:x(),timestamp:t.timestamp,level:t.stream===`stderr`?`error`:`info`,message:t.message,source:t.stepId};n.logs.push(r),e.logs.push(r);return}case`step.completed`:n.status=`completed`,n.endTime=t.timestamp,n.duration=t.duration,n.output=t.outputs;return;case`step.failed`:n.status=`failed`,n.endTime=t.timestamp,n.duration=t.duration,n.error={message:t.error.message,code:t.error.name,timestamp:t.timestamp};return;case`step.skipped`:n.status=`skipped`,n.endTime=t.timestamp,n.duration=0;return}},De=e=>`${e.descriptor.platform||e.descriptor.kind}${e.descriptor.format?` · ${e.descriptor.format}`:``}`,Oe=(e,t)=>t.find(t=>t.id===e.stepId)?.name||`Generated artifact`,ke=e=>({id:e.destinationId,serviceId:e.destinationId,name:e.destinationName||e.destinationId}),A={passthrough:`Prepare source`,"export-construct-project":`Export Construct project`,"archive/unzip":`Extract archive`,"godot:export":`Export Godot project`,"steam-upload":`Upload to Steam`,"fs/copy":`Copy to folder`,"archive/zip":`Create ZIP archive`},j=e=>{let t=e.replace(/:v\d+$/,``).replace(/[-_:/]+/g,` `).replace(/([a-z])([A-Z])/g,`$1 $2`).trim();return t?t.charAt(0).toUpperCase()+t.slice(1):e},M=[[/win(32|dows)?/i,`Windows`],[/linux/i,`Linux`],[/mac|darwin/i,`macOS`]],Ae=e=>{if(!e.uses)return e.name||e.id;let t=e.uses.replace(/^@pipelab\/(core|plugin-[^/]+)\//,``),n=/^@pipelab\/plugin-([^/]+)\//.exec(e.uses)?.[1],r=A[t]??(/package/.test(t)&&n?`Package with ${j(n)}`:j(t)),i=M.find(([t])=>t.test(e.id))?.[1];return i&&(r+=` · ${i}`),e.destinationName&&(r+=` · ${e.destinationName}`),r},je={class:`workflow-page`},Me={key:0,class:`run-page`},Ne={class:`run-header`},Pe={class:`run-title-row`},Fe={class:`run-title`},Ie={class:`title-line`},Le={key:0,class:`live-indicator`},Re={class:`run-meta`},ze=[`title`,`aria-label`],Be={class:`detail-tabs`,"aria-label":`Run detail sections`},Ve=[`aria-current`],He=[`aria-current`],Ue=[`aria-current`],We={class:`failure-body`},Ge={key:0,class:`failure-context`},Ke={key:1,class:`failure-raw`},qe={key:0},Je={key:1},Ye={class:`failure-buttons`},Xe={key:2,class:`execution-layout`,"aria-label":`Execution logs`},Ze={class:`step-sidebar`,"aria-label":`Execution steps`},Qe=[`aria-pressed`],$e={key:0,class:`step-empty`},et=[`aria-pressed`,`onClick`],tt={class:`step-label`},nt=[`title`],rt=[`src`],it={key:0},at={key:1},ot={class:`sr-only`},st=[`aria-label`],ct=[`aria-label`],lt={class:`phase-detail`},ut={key:0},dt={key:1,class:`phase-message`},ft={key:2,class:`phase-message phase-error`},pt={class:`log-panel`},mt={class:`log-heading`},ht={key:0,class:`streaming`},gt={key:0,class:`step-error`},_t=[`aria-label`],vt={key:0,class:`terminal-empty`},yt=[`datetime`],bt={class:`log-level`},xt={key:0,class:`log-source`},St={key:1,class:`cursor`,"aria-hidden":`true`},Ct={key:3,class:`output-panel`,"aria-label":`Run artifacts`},wt={key:0,class:`output-empty`},Tt={key:1,class:`artifact-list`},Et={class:`artifact-name`},Dt={key:0},Ot={class:`artifact-locations`},kt={class:`artifact-actions`},At={key:4,class:`output-panel`,"aria-label":`Run deliveries`},jt={key:0,class:`output-empty`},Mt={key:1,class:`delivery-list`},Nt={class:`destination-icon`},Pt={key:0,class:`delivery-error`},Ft={key:1,class:`load-state`},It={key:1,class:`loading-state`,"aria-busy":`true`},Lt={key:1,role:`status`},N=te(g({__name:`run-detail`,setup(te){let g=oe(),x=ae(),S=se(),C=ce(),w=re(),T=ue(),E=e=>e.destinationId?w.releaseCatalog.destinations.find(t=>t.id===e.destinationId):void 0,D=e=>{let t=E(e);if(!t)return Ae(e);let n=e.destinationName?`${t.label} — ${e.destinationName}`:t.label,r=k.value?.steps.filter(t=>t.destinationId===e.destinationId)??[];return r.length>1?`${n} · ${r.findIndex(t=>t.id===e.id)+1}`:n},O=e=>{let t=E(e);return t?ge(w.providerDefinitions,t.id,t.icon):e.uses?pe(w.providerDefinitions,e.uses):void 0},k=f(),A=f(``);ie(d(()=>!C.isReady.value||!!k.value||!!A.value));let j=f(``),M=ee(ve()),N=d({get:()=>M.selectedStepId,set:e=>xe(M,e)}),P=f(`logs`),Rt=d(()=>k.value?Te(k.value):[]),zt=e=>{let t=k.value?.steps.find(t=>t.id===e.stepId);return t?`${D(t)} failed`:e.title},F=e=>{if(e.status!==`skipped`||!e.blockedBy?.length)return``;let t=k.value?.steps.find(t=>t.id===e.blockedBy[0]);return t?`Skipped: ${D(t)} ${t.status===`skipped`?`was skipped`:`failed`}`:`Skipped`},I=ee(new Set),Bt=e=>I.has(e.id)||e.status===`running`||e.status===`failed`,Vt=e=>{_n(e),I.has(e)?I.delete(e):I.add(e)},L=f(!1),R=f(),z=0,B,V,Ht=d(()=>k.value?.id?k.value.id.slice(0,8):String(g.params.runId).slice(0,8)),Ut=d(()=>String(g.params.flowId||k.value?.workflowId||``)),H=d(()=>String(g.params.projectId||k.value?.projectId||``)),Wt=de({flowId:Ut,projectId:H}),U=d(()=>{let e=[k.value?.error?.message,...(k.value?.steps||[]).map(e=>e.error?.message)];for(let t of e){let e=t?.match(/PLAYWRIGHT_VIDEO:\s*([^\r\n]+)/i);if(e?.[1])return e[1].trim()}return``}),W=f(!1),Gt=f(``),Kt=d(()=>k.value?Y(k.value.duration??(k.value.status===`running`?Date.now()-k.value.startTime:(k.value.endTime||Date.now())-k.value.startTime)):`—`),G=d(()=>k.value?.steps.find(e=>e.id===N.value)),qt=d(()=>[...k.value?.logs?.length?k.value.logs:k.value?.steps.flatMap(e=>e.logs)||[]].toSorted((e,t)=>e.timestamp-t.timestamp)),K=d(()=>N.value===null?qt.value:G.value?.logs||[]),q=f(!0),J=()=>{R.value&&(R.value.scrollTop=R.value.scrollHeight)},Jt=()=>{let e=R.value;e&&(q.value=e.scrollHeight-e.scrollTop-e.clientHeight<40)},Yt=()=>{q.value=!0,J()};i(()=>K.value.length,()=>{q.value&&J()},{flush:`post`}),i([N,P],()=>{q.value=!0,J()},{flush:`post`});let Xt=d(()=>{let e=new Map;for(let t of k.value?.deliveries||[]){let n=ke(t),r=e.get(n.id)||{...n,items:[]};r.items.push(t),e.set(n.id,r)}return[...e.values()]}),Y=e=>{let t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60);return t%60?`${n}m ${t%60}s`:`${n}m`},Zt=e=>new Date(e).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}),Qt=e=>new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,fractionalSecondDigits:3}),$t=e=>{if(e==null||e<0)return`—`;if(e<1024)return`${e} B`;let t=[`KB`,`MB`,`GB`,`TB`],n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r++;return`${n.toFixed(n>=10?0:1)} ${t[r]}`},X=e=>De(e),Z=e=>e.cloud,en=e=>Oe(e,k.value?.steps||[]),tn=e=>e.descriptor.format||e.descriptor.kind,nn=async e=>{try{let t=await S.openPath(e);t.type===`error`&&(A.value=t.ipcError)}catch(e){A.value=e instanceof Error?e.message:String(e)}},rn=async e=>{let t=await S.execute(`pipelab-cloud:artifact-download-url`,{hostedArtifactId:e});if(t.type===`error`){A.value=t.ipcError;return}let n=document.createElement(`a`);n.href=t.result.url,n.target=`_blank`,n.rel=`noopener noreferrer`,n.click()},an=e=>e.duration==null?e.status===`running`?`Running`:``:e.duration>=1e3?Y(e.duration):``,on=e=>({pending:`Pending`,running:`Running`,completed:`Completed`,skipped:`Skipped`,failed:`Failed`,"not-reached":`Not reached`,"not-reported":`Not reported`})[e]||e,sn=e=>({pending:`mdi mdi-circle-outline`,running:`mdi mdi-loading`,completed:`mdi mdi-check-circle`,"completed-with-errors":`mdi mdi-alert-circle`,failed:`mdi mdi-close-circle`,cancelled:`mdi mdi-cancel`,skipped:`mdi mdi-skip-next-circle`,"not-reached":`mdi mdi-arrow-down-circle-outline`,"not-reported":`mdi mdi-help-circle-outline`})[e]||`mdi mdi-circle-outline`,cn=e=>e.replaceAll(`-`,` `),ln=e=>e===`completed`?`success`:e===`failed`?`danger`:e===`completed-with-errors`?`warn`:e===`running`?`info`:`secondary`,un=e=>e===`steam`?`mdi mdi-steam`:e===`itch`?`mdi mdi-controller-classic`:`mdi mdi-folder-upload-outline`,dn=()=>x.push(`/workflows/${Ut.value}/${H.value}/runs`),fn=async e=>{if(navigator.clipboard?.writeText){await navigator.clipboard.writeText(e);return}let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.append(t),t.select();let n=document.execCommand(`copy`);if(t.remove(),!n)throw Error(`Clipboard access is unavailable`)},pn=async()=>{if(U.value)try{await fn(U.value),W.value=!0,Gt.value=`Video path copied to clipboard.`,window.setTimeout(()=>W.value=!1,2e3)}catch{W.value=!1,Gt.value=`Could not copy automatically. Select the path above to copy it.`}},Q=f(!1),mn=d(()=>k.value?.id||String(g.params.runId)),hn=async()=>{try{await fn(mn.value),Q.value=!0,window.setTimeout(()=>Q.value=!1,2e3)}catch{Q.value=!1}},gn=async()=>{L.value=!0,j.value=``;try{let e=await S.execute(`workflow:cancel`,{runId:k.value?.id||String(g.params.runId)});e.type===`error`?A.value=e.ipcError:j.value=we(e)}catch(e){A.value=e instanceof Error?e.message:String(e)}finally{L.value=!1}},_n=e=>xe(M,e),vn=async e=>{let t={flowId:Ut.value,projectId:H.value};if(e.kind===`connections`){e.destinationId&&await Wt.ensure();let t=Wt.flow.value,n=t&&e.destinationId&&T.connections?fe(t,w.releaseCatalog,T.connections).find(t=>t.destinationId===e.destinationId)?.connectionId:void 0;x.push({name:`Connections`,...n?{params:{connectionId:n}}:{}})}else e.kind===`builds`?x.push({name:`WorkflowBuilds`,params:t}):e.kind===`deployment`&&e.destinationId?x.push(e.slotId?{name:`WorkflowDeployment`,params:{...t,destinationId:e.destinationId,slotId:e.slotId}}:{name:`WorkflowDestination`,params:{...t,destinationId:e.destinationId}}):x.push({name:`Workflow`,params:t})},yn=e=>{_n(e.stepId||null),P.value=`logs`},$=()=>{V&&clearTimeout(V),V=void 0};i(()=>k.value?.status,e=>{e&&e!==`running`&&$()});let bn=async()=>{if(!C.isReady.value)return;let t=++z,n=String(g.params.runId),r=String(g.params.projectId||``),i=String(g.params.flowId||``),a=()=>t===z&&String(g.params.runId)===n&&String(g.params.projectId||``)===r&&String(g.params.flowId||``)===i;$();let o=async()=>{try{let e=await S.execute(`build-history:get`,{id:n,...r?{projectId:r}:{}});if(!a()||!k.value)return;e.type===`success`&&e.result.entry&&(k.value=Ce(k.value,e.result.entry))}catch{}a()&&k.value?.status===`running`&&(V=setTimeout(()=>void o(),1e3))};try{let t=await _e(async()=>{let e=await S.execute(`build-history:get`,{id:n,...r?{projectId:r}:{}});if(e.type===`error`)throw Error(e.ipcError);return e.result.entry},4,250,a);if(!a())return;if(t){if(!Se(t,i,r)){k.value=void 0,await x.replace(`/workflows/${i}/${r}/runs`);return}k.value=t,A.value=``,B?.(),B=le(n,e=>{k.value&&Ee(k.value,e)}),k.value.status===`running`&&(V=setTimeout(()=>void o(),1e3)),P.value===`logs`&&be(M,k.value.steps),await e(),q.value&&J()}else A.value=`This run could not be found.`}catch(e){if(!a())return;A.value=e instanceof Error?e.message:String(e)}};return i(()=>[g.params.flowId,g.params.projectId,g.params.runId],()=>{$(),B?.(),B=void 0,k.value=void 0,A.value=``,ye(M),P.value=`logs`,C.isReady.value&&bn()}),i(C.isReady,e=>{e?bn():(z++,$(),B?.(),B=void 0)},{immediate:!0}),t(()=>{z++,$(),B?.()}),(e,t)=>(n(),p(`div`,je,[k.value?(n(),p(`main`,Me,[A.value?(n(),s(o(b),{key:0,severity:`error`,closable:!1,role:`alert`,class:`run-error`},{default:a(()=>[h(r(A.value),1)]),_:1})):c(``,!0),j.value?(n(),s(o(b),{key:1,severity:`info`,closable:!1,class:`run-error`},{default:a(()=>[h(r(j.value),1)]),_:1})):c(``,!0),m(`header`,Ne,[m(`div`,Pe,[m(`div`,Fe,[m(`div`,Ie,[ne(o(y),{value:cn(k.value.status),severity:ln(k.value.status)},null,8,[`value`,`severity`]),k.value.status===`running`?(n(),p(`span`,Le,[...t[4]||=[m(`i`,null,null,-1),h(`Live`,-1)]])):c(``,!0)]),m(`div`,Re,[m(`span`,null,r(Zt(k.value.startTime)),1),m(`span`,null,r(Kt.value),1),m(`button`,{type:`button`,class:`run-id-copy`,title:Q.value?`Copied`:`Copy run ID ${mn.value}`,"aria-label":`Copy run ID ${mn.value}`,onClick:hn},[m(`code`,null,`#`+r(Ht.value),1),m(`i`,{class:u(Q.value?`pi pi-check`:`pi pi-copy`)},null,2)],8,ze)])])]),m(`nav`,Be,[m(`button`,{class:u({active:P.value===`logs`}),"aria-current":P.value===`logs`?`page`:void 0,onClick:t[0]||=e=>P.value=`logs`},[...t[5]||=[m(`i`,{class:`mdi mdi-console-line`},null,-1),h(`Logs `,-1)]],10,Ve),m(`button`,{class:u({active:P.value===`artifacts`}),"aria-current":P.value===`artifacts`?`page`:void 0,onClick:t[1]||=e=>P.value=`artifacts`},[t[6]||=m(`i`,{class:`mdi mdi-package-variant-closed`},null,-1),t[7]||=h(`Artifacts `,-1),m(`span`,null,r(k.value.artifacts?.length||0),1)],10,He),m(`button`,{class:u({active:P.value===`deliveries`}),"aria-current":P.value===`deliveries`?`page`:void 0,onClick:t[2]||=e=>P.value=`deliveries`},[t[8]||=m(`i`,{class:`mdi mdi-cloud-upload-outline`},null,-1),t[9]||=h(`Deliveries `,-1),m(`span`,null,r(k.value.deliveries?.length||0),1)],10,Ue)]),U.value?(n(),s(o(v),{key:0,label:W.value?`Copied`:`Copy video path`,icon:W.value?`pi pi-check`:`mdi mdi-video-outline`,text:``,size:`small`,title:U.value,onClick:pn},null,8,[`label`,`icon`,`title`])):c(``,!0),k.value.status===`running`?(n(),s(o(v),{key:1,label:`Cancel run`,icon:`pi pi-stop-circle`,severity:`danger`,outlined:``,loading:L.value,onClick:gn},null,8,[`loading`])):c(``,!0)]),(n(!0),p(l,null,_(Rt.value,e=>(n(),p(`section`,{key:e.id,class:`failure-diagnostic`,"aria-label":`Failure diagnosis`},[t[11]||=m(`i`,{class:`mdi mdi-alert-circle-outline failure-icon`,"aria-hidden":`true`},null,-1),m(`div`,We,[m(`p`,null,[m(`strong`,null,r(zt(e)),1),h(` · `+r(e.summary)+` `+r(e.nextAction),1)]),e.destination?(n(),p(`p`,Ge,[h(r(e.destination),1),e.slotId?(n(),p(l,{key:0},[h(` · `+r(e.slotId),1)],64)):c(``,!0)])):c(``,!0),e.rawMessage?(n(),p(`details`,Ke,[t[10]||=m(`summary`,null,`Technical details`,-1),e.errorCode?(n(),p(`code`,qe,r(e.errorCode),1)):c(``,!0),m(`pre`,null,r(e.rawMessage),1),e.rawStack?(n(),p(`pre`,Je,r(e.rawStack),1)):c(``,!0)])):c(``,!0)]),m(`div`,Ye,[e.fix?(n(),s(o(v),{key:0,label:e.fix.label,icon:`mdi mdi-wrench-outline`,size:`small`,onClick:t=>vn(e.fix)},null,8,[`label`,`onClick`])):c(``,!0),ne(o(v),{label:e.stepId?`View logs`:`View run logs`,icon:`mdi mdi-console-line`,text:``,size:`small`,onClick:t=>yn(e)},null,8,[`label`,`onClick`])])]))),128)),P.value===`logs`?(n(),p(`section`,Xe,[m(`aside`,Ze,[t[13]||=m(`div`,{class:`sidebar-heading`},`Steps`,-1),m(`button`,{class:u([`step-item all-logs`,{selected:N.value===null}]),"aria-pressed":N.value===null,onClick:t[3]||=e=>_n(null)},[...t[12]||=[m(`i`,{class:`mdi mdi-text-box-multiple-outline`,"aria-hidden":`true`},null,-1),m(`span`,null,`All logs`,-1)]],10,Qe),k.value.steps.length?c(``,!0):(n(),p(`div`,$e,`Waiting for steps…`)),(n(!0),p(l,null,_(k.value.steps,(e,t)=>(n(),p(`div`,{key:e.id,class:`step-group`},[m(`button`,{class:u([`step-item`,[{selected:N.value===e.id},`step-${e.status}`]]),"aria-pressed":N.value===e.id,onClick:t=>Vt(e.id)},[m(`span`,{class:u([`step-icon`,`status-${e.status}`])},[m(`i`,{class:u(sn(e.status)),"aria-hidden":`true`},null,2)],2),m(`span`,tt,[m(`strong`,{title:e.id},[o(he)(O(e))?(n(),p(`img`,{key:0,class:`step-provider-icon`,src:o(he)(O(e)),alt:``},null,8,rt)):O(e)?(n(),p(`i`,{key:1,class:u([`step-provider-icon`,o(me)(O(e))]),"aria-hidden":`true`},null,2)):c(``,!0),h(r(D(e)),1)],8,nt),F(e)?(n(),p(`small`,it,r(F(e)),1)):an(e)?(n(),p(`small`,at,r(an(e)),1)):c(``,!0)]),e.phases?.length?(n(),p(`i`,{key:0,class:u([`mdi step-chevron`,Bt(e)?`mdi-chevron-up`:`mdi-chevron-down`]),"aria-hidden":`true`},null,2)):c(``,!0),m(`span`,ot,`Step `+r(t+1)+`, `+r(cn(e.status)),1)],10,et),e.phases?.length&&Bt(e)?(n(),p(`ol`,{key:0,class:`phase-checklist`,"aria-label":`${D(e)} phases`},[(n(!0),p(l,null,_(e.phases,e=>(n(),p(`li`,{key:e.id,class:u(`phase-${e.status}`)},[m(`span`,{class:`phase-status`,"aria-label":on(e.status)},[m(`i`,{class:u(sn(e.status)),"aria-hidden":`true`},null,2)],8,ct),m(`span`,lt,[m(`strong`,null,r(e.title),1),e.duration===void 0?c(``,!0):(n(),p(`small`,ut,r(Y(e.duration)),1)),e.message?(n(),p(`small`,dt,r(e.message),1)):c(``,!0),e.error?(n(),p(`small`,ft,r(e.error.message),1)):c(``,!0),(n(!0),p(l,null,_(e.warnings,(t,i)=>(n(),p(`small`,{key:`${e.id}-warning-${i}`,class:`phase-message phase-warning`},r(t),1))),128))])],2))),128))],8,st)):c(``,!0),(n(!0),p(l,null,_(e.diagnostics,(t,i)=>(n(),p(`small`,{key:`${e.id}-diagnostic-${i}`,class:`phase-message phase-warning step-diagnostic`},r(t),1))),128))]))),128))]),m(`div`,pt,[m(`header`,mt,[m(`div`,null,[m(`h3`,null,r(G.value?D(G.value):`All logs`),1)]),k.value.status===`running`?(n(),p(`span`,ht,[...t[14]||=[m(`i`,null,null,-1),h(`Streaming`,-1)]])):c(``,!0)]),G.value?.error&&!Rt.value.length?(n(),p(`div`,gt,[t[15]||=m(`i`,{class:`mdi mdi-alert-circle-outline`},null,-1),h(r(G.value.error.message),1)])):c(``,!0),m(`div`,{ref_key:`logViewport`,ref:R,class:`terminal`,onScrollPassive:Jt,role:`log`,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-label":`${G.value?D(G.value):`All`} execution logs`},[K.value.length?c(``,!0):(n(),p(`div`,vt,r(k.value.status===`running`?`Waiting for log output…`:G.value&&F(G.value)||`No logs recorded for this selection.`),1)),(n(!0),p(l,null,_(K.value,(e,t)=>(n(),p(`div`,{key:e.id||`${e.timestamp}-${t}`,class:u([`log-line`,[`log-${e.level}`,{"no-source":N.value!==null}]])},[m(`time`,{datetime:new Date(e.timestamp).toISOString()},r(Qt(e.timestamp)),9,yt),m(`span`,bt,r(e.level.toUpperCase()),1),e.source&&N.value===null?(n(),p(`span`,xt,r(e.source),1)):c(``,!0),m(`pre`,null,r(e.message),1)],2))),128)),k.value.status===`running`?(n(),p(`span`,St)):c(``,!0)],40,_t),!q.value&&K.value.length?(n(),s(o(v),{key:1,class:`jump-latest`,label:`Latest`,icon:`mdi mdi-arrow-down`,size:`small`,rounded:``,onClick:Yt})):c(``,!0)])])):P.value===`artifacts`?(n(),p(`section`,Ct,[k.value.artifacts?.length?(n(),p(`div`,Tt,[(n(!0),p(l,null,_(k.value.artifacts,e=>(n(),p(`article`,{key:e.id,class:`artifact-row`},[t[17]||=m(`i`,{class:`mdi mdi-package-variant`,"aria-hidden":`true`},null,-1),m(`div`,Et,[m(`strong`,null,r(X(e)),1),m(`small`,null,r(en(e)),1)]),m(`span`,null,r(tn(e)),1),e.size!==void 0&&e.size>0?(n(),p(`span`,Dt,r($t(e.size)),1)):c(``,!0),m(`span`,Ot,[`path`in e&&e.path?(n(),s(o(y),{key:0,value:`Local`,severity:`secondary`})):c(``,!0),Z(e)?(n(),s(o(y),{key:1,value:`Cloud`,severity:`info`})):c(``,!0)]),m(`div`,kt,[`path`in e&&e.path?(n(),s(o(v),{key:0,label:`Open`,icon:`mdi mdi-folder-open-outline`,text:``,size:`small`,"aria-label":`Open ${X(e)}`,"data-artifact-path":e.path,onClick:t=>nn(e.path)},null,8,[`aria-label`,`data-artifact-path`,`onClick`])):c(``,!0),Z(e)?(n(),s(o(v),{key:1,label:`Download`,icon:`mdi mdi-download`,text:``,size:`small`,"aria-label":`Download ${X(e)}`,onClick:t=>rn(Z(e).hostedArtifactId)},null,8,[`aria-label`,`onClick`])):c(``,!0)])]))),128))])):(n(),p(`div`,wt,[...t[16]||=[m(`i`,{class:`mdi mdi-package-variant-closed`},null,-1),m(`strong`,null,`No artifacts produced`,-1),m(`span`,null,`Artifacts created by this run will appear here.`,-1)]]))])):(n(),p(`section`,At,[k.value.deliveries?.length?(n(),p(`div`,Mt,[(n(!0),p(l,null,_(Xt.value,e=>(n(),p(`article`,{key:e.id,class:`delivery-group`},[m(`header`,null,[m(`div`,Nt,[m(`i`,{class:u(un(e.serviceId))},null,2)]),m(`div`,null,[m(`strong`,null,r(e.name),1),m(`small`,null,r(e.items.length)+` `+r(e.items.length===1?`delivery`:`deliveries`),1)])]),(n(!0),p(l,null,_(e.items,e=>(n(),p(`div`,{key:e.id,class:`delivery-row`},[m(`span`,{class:u([`delivery-status`,`status-${e.status}`])},[m(`i`,{class:u(e.status===`completed`?`mdi mdi-check-circle`:`mdi mdi-close-circle`)},null,2),h(r(e.status===`completed`?`Succeeded`:`Failed`),1)],2),m(`span`,null,r(e.slotId),1),m(`span`,null,r(Y(e.duration)),1),e.error?(n(),p(`span`,Pt,r(e.error),1)):c(``,!0)]))),128))]))),128))])):(n(),p(`div`,jt,[...t[18]||=[m(`i`,{class:`mdi mdi-cloud-upload-outline`},null,-1),m(`strong`,null,`No deliveries recorded`,-1),m(`span`,null,`Publishing results for this run will appear here.`,-1)]]))]))])):(n(),p(`main`,Ft,[A.value?(n(),s(o(b),{key:0,severity:`error`,closable:!1,role:`alert`},{default:a(()=>[h(r(A.value)+` `,1),ne(o(v),{label:`Back to runs`,text:``,onClick:dn})]),_:1})):(n(),p(`div`,It,[o(C).isReady.value?(n(),p(l,{key:0},[t[19]||=m(`i`,{class:`mdi mdi-loading`},null,-1),t[20]||=h(`Loading run…`,-1)],64)):(n(),p(`span`,Lt,`Run details are unavailable while the engine is disconnected.`))]))]))]))}}),[[`__scopeId`,`data-v-a15cc46a`]]);export{N as default};
|
|
1
|
+
import{A as e,I as t,L as n,Pt as r,Y as i,Z as a,_t as o,d as s,f as c,i as l,jt as u,l as d,lt as f,p,st as ee,t as te,u as m,v as h,x as g,y as ne,z as _}from"./_plugin-vue_export-helper-p1XK9cLm.js";import{l as re,t as ie}from"./index-3swN8pT8.js";import{_ as ae,g as oe}from"./useApi-SF8tY_yo-D-2q1_yl.js";import{n as v}from"./times-BF5NnquQ.js";import{t as y}from"./tag-CBfU-PTU.js";import{t as b}from"./message-Bw5keJML.js";import{c as x,t as se}from"./api-BxGTgrE5.js";import{t as ce}from"./useAgentAvailability-YDtT9EHJ.js";import{n as le}from"./run-events-egZ2rllf.js";import{t as ue}from"./connections-Djk3Fk9U.js";import{n as de}from"./useWorkflowDocument-6-o5gm97.js";import{J as fe}from"./release-flow-model-DA5OtEda.js";import{i as pe,n as me,r as he,t as ge}from"./provider-icons-CgkG5BRP.js";var _e=async(e,t=4,n=250,r=()=>!0)=>{for(let i=0;i<=t;i++){if(!r())return;let a=await e();if(!r())return;if(a!==void 0)return a;i<t&&await new Promise(e=>setTimeout(e,n))}},S=e=>e.map(e=>({id:e.id,path:e.path,...typeof e.size==`number`&&e.size>0?{size:e.size}:{},descriptor:e.descriptor,version:e.version,stepId:e.stepId,artifact:e.artifact,checksum:e.checksum,cloud:e.cloud})),ve=()=>({selectedStepId:null,initialSelectionMade:!1,userSelectedStep:!1}),ye=e=>{e.selectedStepId=null,e.initialSelectionMade=!1,e.userSelectedStep=!1},be=(e,t)=>{e.userSelectedStep||e.initialSelectionMade||!t.length||(e.selectedStepId=t.find(e=>e.status===`running`)?.id||t.find(e=>e.status===`failed`)?.id||t[0].id,e.initialSelectionMade=!0)},xe=(e,t)=>{e.selectedStepId=t,e.userSelectedStep=!0},Se=(e,t,n)=>e.projectId===n&&e.workflowId===t,C=(e,t)=>{let n=new Map;for(let[r,i]of[[e,`current`],[t,`persisted`]])for(let e of r){let t=`${e.timestamp}:${e.source||``}:${e.message}:${e.level}`,r=n.get(t)||{current:[],persisted:[]};r[i].push(e),n.set(t,r)}return[...n.values()].flatMap(({current:e,persisted:t})=>[...e,...t.slice(e.length)]).toSorted((e,t)=>e.timestamp-t.timestamp)},w=new Set([`completed`,`failed`,`skipped`,`cancelled`]),Ce=(e,t)=>{let n=e.status!==`running`&&t.status===`running`,r=new Map(e.steps.map(e=>[e.id,e])),i=t.steps.map(e=>{let t=r.get(e.id);if(!t)return{...e,logs:[...e.logs]};let n=w.has(t.status),i=w.has(e.status),a=n&&!i||(t.error?.timestamp??t.endTime??0)>(e.error?.timestamp??e.endTime??0)?t:e;return{...a,error:a.error||t.error,phases:T(t.phases,e.phases),logs:C(t.logs,e.logs)}});return{...n?e:t,status:n?e.status:t.status,...n?{endTime:e.endTime,duration:e.duration,error:e.error}:{},steps:i,logs:C(e.logs,t.logs)}},T=(e,t)=>{if(!e)return t;if(!t)return e;let n=new Map(e.map(e=>[e.id,e]));return t.map(e=>{let t=n.get(e.id);if(!t)return e;let r=![`pending`,`running`].includes(t.status),i=![`pending`,`running`].includes(e.status);return{...r&&!i||(t.completedAt??t.startedAt??0)>(e.completedAt??e.startedAt??0)?t:e,warnings:[...new Set([...t.warnings,...e.warnings])]}})},we=e=>e.type===`success`&&e.result?.result===`ko`?`This run is no longer active.`:``,E=e=>/\bEACCES\b|\bEPERM\b|access is denied/i.test(e)?{category:`Permission`,summary:`A local file or folder could not be accessed.`,nextAction:`Check file permissions for the reported path, then rerun this workflow.`}:/\b403\b|forbidden|permission denied|insufficient (?:permission|scope)|not allowed/i.test(e)?{category:`Permission`,summary:`The destination account does not have permission to complete this action.`,nextAction:`Check the account's access and required permissions for this destination, then rerun this workflow.`}:/auth|credential|unauthori[sz]ed|\b401\b|login|sign.?in/i.test(e)?{category:`Authentication`,summary:`The account or session was not accepted.`,nextAction:`Sign in again or select a different account connection, then rerun this workflow.`}:/\bENOSPC\b|no space left|disk full|not enough disk space/i.test(e)?{category:`Disk space`,summary:`There is not enough free space to complete this step.`,nextAction:`Free disk space at the reported location, then rerun this workflow.`}:/\bENOENT\b|not found|missing (?:file|tool|command)|could not find|does not exist/i.test(e)?{category:`Missing tool or file`,summary:`A required command or file could not be found.`,nextAction:`Install the required tool or correct its configured path, then rerun this workflow.`}:/\bECONN|\bENOTFOUND\b|\bETIMEDOUT\b|network|fetch failed|offline|connection refused/i.test(e)||/\b5\d{2}\b|service unavailable/i.test(e)?{category:`Connection`,summary:`Pipelab could not reach a required service.`,nextAction:`Check the network connection and destination availability, then rerun this workflow.`}:{category:`Step failed`,summary:`This step reported an error while the workflow was running.`,nextAction:`Review this step's logs and provider details to resolve the error before rerunning.`},D=/api key|credential|token|authenticat|unauthori[sz]ed|\b401\b|pipelab login|log(?:ged)? ?in|sign(?:ed)? ?in|expired|invalid (?:key|token|password|secret)|was rejected|access denied/i,O=/\b(?:app ?id|depot|channel|project|branch|game|slug|username|namespace)\b|not configured|is required|missing|invalid .*\bid\b|does not exist|not found/i,k=(e,t)=>{if(/choose an output/i.test(e))return t?.destinationId?{kind:`deployment`,label:`Choose output`,destinationId:t.destinationId,...t.slotId?{slotId:t.slotId}:{}}:{kind:`configuration`,label:`Choose output`};if(D.test(e))return{kind:`connections`,label:`Fix connection`,...t?.destinationId?{destinationId:t.destinationId}:{}};if(t?.destinationId)return O.test(e)?{kind:`deployment`,label:t.destinationName?`Open ${t.destinationName} settings`:`Open settings`,destinationId:t.destinationId,...t.slotId?{slotId:t.slotId}:{}}:void 0;if(t&&O.test(e))return{kind:`builds`,label:`Review builds`}},Te=e=>{if(e.status!==`failed`&&e.status!==`completed-with-errors`)return[];let t=[],n=e.steps.filter(e=>e.status===`failed`);for(let r of n){let n=e.deliveries?.find(e=>e.id===r.id)||e.deliveries?.find(e=>e.status===`failed`&&e.destinationId===r.destinationId&&(!r.slotId||e.slotId===r.slotId)),i=r.error?.message||n?.error;if(!i)continue;let a=r.error?.code===`PREFLIGHT_FAILED`,o=a?{category:`Preflight`,summary:i,nextAction:`Nothing was run. Fix this destination's account, then rerun this workflow.`}:E(i),s=i.match(/pipelab login\s+\S+/i)?.[0],c=!s&&/`[^`]+`/.test(i);t.push({id:r.id,title:r.name||r.id,category:o.category,summary:c?i:o.summary,nextAction:s?`Run ${s} and try this step again.`:c?``:o.nextAction,stepId:r.id,...n?.destinationName||n?.destinationId||r.destinationName||r.destinationId?{destination:n?.destinationName||n?.destinationId||r.destinationName||r.destinationId}:{},...n?.slotId||r.slotId?{slotId:n?.slotId||r.slotId}:{},...(e=>e?{fix:e}:{})(k(i,{destinationId:r.destinationId??n?.destinationId,slotId:r.slotId??n?.slotId,destinationName:r.destinationName??n?.destinationName,uses:r.uses})),...a?{}:{rawMessage:i},...r.error?.stack?{rawStack:r.error.stack}:{},...r.error?.code&&!a?{errorCode:r.error.code}:{}})}if(e.error?.code===`PREFLIGHT_FAILED`&&n.length)return t;if(e.error&&!n.some(t=>t.error?.message===e.error?.message)){let n=E(e.error.message),r=/`[^`]+`/.test(e.error.message);t.unshift({id:`run-setup`,title:`Run setup`,category:n.category,summary:r?e.error.message:n.summary,nextAction:r?``:n.nextAction,...(e=>e?{fix:e}:{})(k(e.error.message)),rawMessage:e.error.message,...e.error.stack?{rawStack:e.error.stack}:{},...e.error.code?{errorCode:e.error.code}:{}})}return t},Ee=(e,t)=>{if(t.type===`workflow.completed`){let n=new Map(e.steps.map(e=>[e.id,e]));e.steps=Object.values(t.result.steps).map(e=>{let t=n.get(e.id);return Object.assign({id:e.id,name:t?.name||e.id,uses:e.uses,status:e.status,startTime:e.startedAt,endTime:e.completedAt,duration:e.duration,phases:e.phases,diagnostics:e.diagnostics},e.blockedBy?.length?{blockedBy:e.blockedBy}:{},{logs:t?.logs||[],output:e.outputs},e.error?{error:{message:e.error.message,code:e.error.name,timestamp:e.completedAt}}:{},e.delivery?{destinationId:e.delivery.destinationId,slotId:e.delivery.slotId}:{})}),e.status=t.result.status,e.endTime=t.timestamp,e.duration=t.duration,e.output=t.result.outputs,e.artifacts=S(t.result.artifacts),e.deliveries=t.result.deliveries,e.totalSteps=e.steps.length,e.completedSteps=e.steps.filter(e=>e.status===`completed`).length,e.failedSteps=e.steps.filter(e=>e.status===`failed`||e.status===`skipped`).length,e.cancelledSteps=e.steps.filter(e=>e.status===`cancelled`).length,e.updatedAt=t.timestamp;return}if(t.type===`workflow.failed`){e.status=`failed`,e.endTime=t.timestamp,e.duration=t.duration,e.error={message:t.error.message,code:t.error.name,timestamp:t.timestamp},e.completedSteps=e.steps.filter(e=>e.status===`completed`).length,e.failedSteps=e.steps.filter(e=>e.status===`failed`||e.status===`skipped`).length,e.cancelledSteps=e.steps.filter(e=>e.status===`cancelled`).length,e.updatedAt=t.timestamp;return}let n=`stepId`in t?e.steps.find(e=>e.id===t.stepId):void 0;if(n)switch(t.type){case`step.started`:n.status=`running`,n.startTime=t.timestamp;return;case`phase.started`:case`phase.completed`:case`phase.skipped`:case`phase.failed`:case`phase.warning`:case`phase.not-reached`:case`phase.not-reported`:{t.type===`phase.warning`&&t.diagnostic&&(n.diagnostics??=[],n.diagnostics.push(t.message));let e=n.phases?.find(e=>e.id===t.phaseId);if(!e)return;switch(t.type){case`phase.started`:e.status=`running`,e.startedAt=t.timestamp;break;case`phase.completed`:e.status=`completed`,e.completedAt=t.timestamp,e.duration=t.duration,t.message!==void 0&&(e.message=t.message);break;case`phase.skipped`:e.status=`skipped`,e.completedAt=t.timestamp,e.duration=t.duration,e.message=t.reason;break;case`phase.failed`:e.status=`failed`,e.completedAt=t.timestamp,e.duration=t.duration,e.error=t.error;break;case`phase.warning`:e.warnings.push(t.message);break;case`phase.not-reached`:e.status=`not-reached`,e.title=t.title,e.completedAt=t.timestamp;break;case`phase.not-reported`:e.status=`not-reported`,e.title=t.title,e.completedAt=t.timestamp}return}case`step.log`:{if(n.logs.some(e=>e.timestamp===t.timestamp&&e.message===t.message))return;let r={id:x(),timestamp:t.timestamp,level:t.stream===`stderr`?`error`:`info`,message:t.message,source:t.stepId};n.logs.push(r),e.logs.push(r);return}case`step.completed`:n.status=`completed`,n.endTime=t.timestamp,n.duration=t.duration,n.output=t.outputs;return;case`step.failed`:n.status=`failed`,n.endTime=t.timestamp,n.duration=t.duration,n.error={message:t.error.message,code:t.error.name,timestamp:t.timestamp};return;case`step.skipped`:n.status=`skipped`,n.endTime=t.timestamp,n.duration=0;return}},De=e=>`${e.descriptor.platform||e.descriptor.kind}${e.descriptor.format?` · ${e.descriptor.format}`:``}`,Oe=(e,t)=>t.find(t=>t.id===e.stepId)?.name||`Generated artifact`,ke=e=>({id:e.destinationId,serviceId:e.destinationId,name:e.destinationName||e.destinationId}),A={passthrough:`Prepare source`,"export-construct-project":`Export Construct project`,"archive/unzip":`Extract archive`,"godot:export":`Export Godot project`,"steam-upload":`Upload to Steam`,"fs/copy":`Copy to folder`,"archive/zip":`Create ZIP archive`},j=e=>{let t=e.replace(/:v\d+$/,``).replace(/[-_:/]+/g,` `).replace(/([a-z])([A-Z])/g,`$1 $2`).trim();return t?t.charAt(0).toUpperCase()+t.slice(1):e},M=[[/win(32|dows)?/i,`Windows`],[/linux/i,`Linux`],[/mac|darwin/i,`macOS`]],Ae=e=>{if(!e.uses)return e.name||e.id;let t=e.uses.replace(/^@pipelab\/(core|plugin-[^/]+)\//,``),n=/^@pipelab\/plugin-([^/]+)\//.exec(e.uses)?.[1],r=A[t]??(/package/.test(t)&&n?`Package with ${j(n)}`:j(t)),i=M.find(([t])=>t.test(e.id))?.[1];return i&&(r+=` · ${i}`),e.destinationName&&(r+=` · ${e.destinationName}`),r},je={class:`workflow-page`},Me={key:0,class:`run-page`},Ne={class:`run-header`},Pe={class:`run-title-row`},Fe={class:`run-title`},Ie={class:`title-line`},Le={key:0,class:`live-indicator`},Re={class:`run-meta`},ze=[`title`,`aria-label`],Be={class:`detail-tabs`,"aria-label":`Run detail sections`},Ve=[`aria-current`],He=[`aria-current`],Ue=[`aria-current`],We={class:`failure-body`},Ge={key:0,class:`failure-context`},Ke={key:1,class:`failure-raw`},qe={key:0},Je={key:1},Ye={class:`failure-buttons`},Xe={key:2,class:`execution-layout`,"aria-label":`Execution logs`},Ze={class:`step-sidebar`,"aria-label":`Execution steps`},Qe=[`aria-pressed`],$e={key:0,class:`step-empty`},et=[`aria-pressed`,`onClick`],tt={class:`step-label`},nt=[`title`],rt=[`src`],it={key:0},at={key:1},ot={class:`sr-only`},st=[`aria-label`],ct=[`aria-label`],lt={class:`phase-detail`},ut={key:0},dt={key:1,class:`phase-message`},ft={key:2,class:`phase-message phase-error`},pt={class:`log-panel`},mt={class:`log-heading`},ht={key:0,class:`streaming`},gt={key:0,class:`step-error`},_t=[`aria-label`],vt={key:0,class:`terminal-empty`},yt=[`datetime`],bt={class:`log-level`},xt={key:0,class:`log-source`},St={key:1,class:`cursor`,"aria-hidden":`true`},Ct={key:3,class:`output-panel`,"aria-label":`Run artifacts`},wt={key:0,class:`output-empty`},Tt={key:1,class:`artifact-list`},Et={class:`artifact-name`},Dt={key:0},Ot={class:`artifact-locations`},kt={class:`artifact-actions`},At={key:4,class:`output-panel`,"aria-label":`Run deliveries`},jt={key:0,class:`output-empty`},Mt={key:1,class:`delivery-list`},Nt={class:`destination-icon`},Pt={key:0,class:`delivery-error`},Ft={key:1,class:`load-state`},It={key:1,class:`loading-state`,"aria-busy":`true`},Lt={key:1,role:`status`},N=te(g({__name:`run-detail`,setup(te){let g=oe(),x=ae(),S=se(),C=ce(),w=re(),T=ue(),E=e=>e.destinationId?w.releaseCatalog.destinations.find(t=>t.id===e.destinationId):void 0,D=e=>{let t=E(e);if(!t)return Ae(e);let n=e.destinationName?`${t.label} — ${e.destinationName}`:t.label,r=k.value?.steps.filter(t=>t.destinationId===e.destinationId)??[];return r.length>1?`${n} · ${r.findIndex(t=>t.id===e.id)+1}`:n},O=e=>{let t=E(e);return t?ge(w.providerDefinitions,t.id,t.icon):e.uses?pe(w.providerDefinitions,e.uses):void 0},k=f(),A=f(``);ie(d(()=>!C.isReady.value||!!k.value||!!A.value));let j=f(``),M=ee(ve()),N=d({get:()=>M.selectedStepId,set:e=>xe(M,e)}),P=f(`logs`),Rt=d(()=>k.value?Te(k.value):[]),zt=e=>{let t=k.value?.steps.find(t=>t.id===e.stepId);return t?`${D(t)} failed`:e.title},F=e=>{if(e.status!==`skipped`||!e.blockedBy?.length)return``;let t=k.value?.steps.find(t=>t.id===e.blockedBy[0]);return t?`Skipped: ${D(t)} ${t.status===`skipped`?`was skipped`:`failed`}`:`Skipped`},I=ee(new Set),Bt=e=>I.has(e.id)||e.status===`running`||e.status===`failed`,Vt=e=>{_n(e),I.has(e)?I.delete(e):I.add(e)},L=f(!1),R=f(),z=0,B,V,Ht=d(()=>k.value?.id?k.value.id.slice(0,8):String(g.params.runId).slice(0,8)),Ut=d(()=>String(g.params.flowId||k.value?.workflowId||``)),H=d(()=>String(g.params.projectId||k.value?.projectId||``)),Wt=de({flowId:Ut,projectId:H}),U=d(()=>{let e=[k.value?.error?.message,...(k.value?.steps||[]).map(e=>e.error?.message)];for(let t of e){let e=t?.match(/PLAYWRIGHT_VIDEO:\s*([^\r\n]+)/i);if(e?.[1])return e[1].trim()}return``}),W=f(!1),Gt=f(``),Kt=d(()=>k.value?Y(k.value.duration??(k.value.status===`running`?Date.now()-k.value.startTime:(k.value.endTime||Date.now())-k.value.startTime)):`—`),G=d(()=>k.value?.steps.find(e=>e.id===N.value)),qt=d(()=>[...k.value?.logs?.length?k.value.logs:k.value?.steps.flatMap(e=>e.logs)||[]].toSorted((e,t)=>e.timestamp-t.timestamp)),K=d(()=>N.value===null?qt.value:G.value?.logs||[]),q=f(!0),J=()=>{R.value&&(R.value.scrollTop=R.value.scrollHeight)},Jt=()=>{let e=R.value;e&&(q.value=e.scrollHeight-e.scrollTop-e.clientHeight<40)},Yt=()=>{q.value=!0,J()};i(()=>K.value.length,()=>{q.value&&J()},{flush:`post`}),i([N,P],()=>{q.value=!0,J()},{flush:`post`});let Xt=d(()=>{let e=new Map;for(let t of k.value?.deliveries||[]){let n=ke(t),r=e.get(n.id)||{...n,items:[]};r.items.push(t),e.set(n.id,r)}return[...e.values()]}),Y=e=>{let t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60);return t%60?`${n}m ${t%60}s`:`${n}m`},Zt=e=>new Date(e).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}),Qt=e=>new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,fractionalSecondDigits:3}),$t=e=>{if(e==null||e<0)return`—`;if(e<1024)return`${e} B`;let t=[`KB`,`MB`,`GB`,`TB`],n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r++;return`${n.toFixed(n>=10?0:1)} ${t[r]}`},X=e=>De(e),Z=e=>e.cloud,en=e=>Oe(e,k.value?.steps||[]),tn=e=>e.descriptor.format||e.descriptor.kind,nn=async e=>{try{let t=await S.openPath(e);t.type===`error`&&(A.value=t.ipcError)}catch(e){A.value=e instanceof Error?e.message:String(e)}},rn=async e=>{let t=await S.execute(`pipelab-cloud:artifact-download-url`,{hostedArtifactId:e});if(t.type===`error`){A.value=t.ipcError;return}let n=document.createElement(`a`);n.href=t.result.url,n.target=`_blank`,n.rel=`noopener noreferrer`,n.click()},an=e=>e.duration==null?e.status===`running`?`Running`:``:e.duration>=1e3?Y(e.duration):``,on=e=>({pending:`Pending`,running:`Running`,completed:`Completed`,skipped:`Skipped`,failed:`Failed`,"not-reached":`Not reached`,"not-reported":`Not reported`})[e]||e,sn=e=>({pending:`mdi mdi-circle-outline`,running:`mdi mdi-loading`,completed:`mdi mdi-check-circle`,"completed-with-errors":`mdi mdi-alert-circle`,failed:`mdi mdi-close-circle`,cancelled:`mdi mdi-cancel`,skipped:`mdi mdi-skip-next-circle`,"not-reached":`mdi mdi-arrow-down-circle-outline`,"not-reported":`mdi mdi-help-circle-outline`})[e]||`mdi mdi-circle-outline`,cn=e=>e.replaceAll(`-`,` `),ln=e=>e===`completed`?`success`:e===`failed`?`danger`:e===`completed-with-errors`?`warn`:e===`running`?`info`:`secondary`,un=e=>e===`steam`?`mdi mdi-steam`:e===`itch`?`mdi mdi-controller-classic`:`mdi mdi-folder-upload-outline`,dn=()=>x.push(`/workflows/${Ut.value}/${H.value}/runs`),fn=async e=>{if(navigator.clipboard?.writeText){await navigator.clipboard.writeText(e);return}let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.append(t),t.select();let n=document.execCommand(`copy`);if(t.remove(),!n)throw Error(`Clipboard access is unavailable`)},pn=async()=>{if(U.value)try{await fn(U.value),W.value=!0,Gt.value=`Video path copied to clipboard.`,window.setTimeout(()=>W.value=!1,2e3)}catch{W.value=!1,Gt.value=`Could not copy automatically. Select the path above to copy it.`}},Q=f(!1),mn=d(()=>k.value?.id||String(g.params.runId)),hn=async()=>{try{await fn(mn.value),Q.value=!0,window.setTimeout(()=>Q.value=!1,2e3)}catch{Q.value=!1}},gn=async()=>{L.value=!0,j.value=``;try{let e=await S.execute(`workflow:cancel`,{runId:k.value?.id||String(g.params.runId)});e.type===`error`?A.value=e.ipcError:j.value=we(e)}catch(e){A.value=e instanceof Error?e.message:String(e)}finally{L.value=!1}},_n=e=>xe(M,e),vn=async e=>{let t={flowId:Ut.value,projectId:H.value};if(e.kind===`connections`){e.destinationId&&await Wt.ensure();let t=Wt.flow.value,n=t&&e.destinationId&&T.connections?fe(t,w.releaseCatalog,T.connections).find(t=>t.destinationId===e.destinationId)?.connectionId:void 0;x.push({name:`Connections`,...n?{params:{connectionId:n}}:{}})}else e.kind===`builds`?x.push({name:`WorkflowBuilds`,params:t}):e.kind===`deployment`&&e.destinationId?x.push(e.slotId?{name:`WorkflowDeployment`,params:{...t,destinationId:e.destinationId,slotId:e.slotId}}:{name:`WorkflowDestination`,params:{...t,destinationId:e.destinationId}}):x.push({name:`Workflow`,params:t})},yn=e=>{_n(e.stepId||null),P.value=`logs`},$=()=>{V&&clearTimeout(V),V=void 0};i(()=>k.value?.status,e=>{e&&e!==`running`&&$()});let bn=async()=>{if(!C.isReady.value)return;let t=++z,n=String(g.params.runId),r=String(g.params.projectId||``),i=String(g.params.flowId||``),a=()=>t===z&&String(g.params.runId)===n&&String(g.params.projectId||``)===r&&String(g.params.flowId||``)===i;$();let o=async()=>{try{let e=await S.execute(`build-history:get`,{id:n,...r?{projectId:r}:{}});if(!a()||!k.value)return;e.type===`success`&&e.result.entry&&(k.value=Ce(k.value,e.result.entry))}catch{}a()&&k.value?.status===`running`&&(V=setTimeout(()=>void o(),1e3))};try{let t=await _e(async()=>{let e=await S.execute(`build-history:get`,{id:n,...r?{projectId:r}:{}});if(e.type===`error`)throw Error(e.ipcError);return e.result.entry},4,250,a);if(!a())return;if(t){if(!Se(t,i,r)){k.value=void 0,await x.replace(`/workflows/${i}/${r}/runs`);return}k.value=t,A.value=``,B?.(),B=le(n,e=>{k.value&&Ee(k.value,e)}),k.value.status===`running`&&(V=setTimeout(()=>void o(),1e3)),P.value===`logs`&&be(M,k.value.steps),await e(),q.value&&J()}else A.value=`This run could not be found.`}catch(e){if(!a())return;A.value=e instanceof Error?e.message:String(e)}};return i(()=>[g.params.flowId,g.params.projectId,g.params.runId],()=>{$(),B?.(),B=void 0,k.value=void 0,A.value=``,ye(M),P.value=`logs`,C.isReady.value&&bn()}),i(C.isReady,e=>{e?bn():(z++,$(),B?.(),B=void 0)},{immediate:!0}),t(()=>{z++,$(),B?.()}),(e,t)=>(n(),p(`div`,je,[k.value?(n(),p(`main`,Me,[A.value?(n(),s(o(b),{key:0,severity:`error`,closable:!1,role:`alert`,class:`run-error`},{default:a(()=>[h(r(A.value),1)]),_:1})):c(``,!0),j.value?(n(),s(o(b),{key:1,severity:`info`,closable:!1,class:`run-error`},{default:a(()=>[h(r(j.value),1)]),_:1})):c(``,!0),m(`header`,Ne,[m(`div`,Pe,[m(`div`,Fe,[m(`div`,Ie,[ne(o(y),{value:cn(k.value.status),severity:ln(k.value.status)},null,8,[`value`,`severity`]),k.value.status===`running`?(n(),p(`span`,Le,[...t[4]||=[m(`i`,null,null,-1),h(`Live`,-1)]])):c(``,!0)]),m(`div`,Re,[m(`span`,null,r(Zt(k.value.startTime)),1),m(`span`,null,r(Kt.value),1),m(`button`,{type:`button`,class:`run-id-copy`,title:Q.value?`Copied`:`Copy run ID ${mn.value}`,"aria-label":`Copy run ID ${mn.value}`,onClick:hn},[m(`code`,null,`#`+r(Ht.value),1),m(`i`,{class:u(Q.value?`pi pi-check`:`pi pi-copy`)},null,2)],8,ze)])])]),m(`nav`,Be,[m(`button`,{class:u({active:P.value===`logs`}),"aria-current":P.value===`logs`?`page`:void 0,onClick:t[0]||=e=>P.value=`logs`},[...t[5]||=[m(`i`,{class:`mdi mdi-console-line`},null,-1),h(`Logs `,-1)]],10,Ve),m(`button`,{class:u({active:P.value===`artifacts`}),"aria-current":P.value===`artifacts`?`page`:void 0,onClick:t[1]||=e=>P.value=`artifacts`},[t[6]||=m(`i`,{class:`mdi mdi-package-variant-closed`},null,-1),t[7]||=h(`Artifacts `,-1),m(`span`,null,r(k.value.artifacts?.length||0),1)],10,He),m(`button`,{class:u({active:P.value===`deliveries`}),"aria-current":P.value===`deliveries`?`page`:void 0,onClick:t[2]||=e=>P.value=`deliveries`},[t[8]||=m(`i`,{class:`mdi mdi-cloud-upload-outline`},null,-1),t[9]||=h(`Deliveries `,-1),m(`span`,null,r(k.value.deliveries?.length||0),1)],10,Ue)]),U.value?(n(),s(o(v),{key:0,label:W.value?`Copied`:`Copy video path`,icon:W.value?`pi pi-check`:`mdi mdi-video-outline`,text:``,size:`small`,title:U.value,onClick:pn},null,8,[`label`,`icon`,`title`])):c(``,!0),k.value.status===`running`?(n(),s(o(v),{key:1,label:`Cancel run`,icon:`pi pi-stop-circle`,severity:`danger`,outlined:``,loading:L.value,onClick:gn},null,8,[`loading`])):c(``,!0)]),(n(!0),p(l,null,_(Rt.value,e=>(n(),p(`section`,{key:e.id,class:`failure-diagnostic`,"aria-label":`Failure diagnosis`},[t[11]||=m(`i`,{class:`mdi mdi-alert-circle-outline failure-icon`,"aria-hidden":`true`},null,-1),m(`div`,We,[m(`p`,null,[m(`strong`,null,r(zt(e)),1),h(` · `+r(e.summary)+` `+r(e.nextAction),1)]),e.destination?(n(),p(`p`,Ge,[h(r(e.destination),1),e.slotId?(n(),p(l,{key:0},[h(` · `+r(e.slotId),1)],64)):c(``,!0)])):c(``,!0),e.rawMessage?(n(),p(`details`,Ke,[t[10]||=m(`summary`,null,`Technical details`,-1),e.errorCode?(n(),p(`code`,qe,r(e.errorCode),1)):c(``,!0),m(`pre`,null,r(e.rawMessage),1),e.rawStack?(n(),p(`pre`,Je,r(e.rawStack),1)):c(``,!0)])):c(``,!0)]),m(`div`,Ye,[e.fix?(n(),s(o(v),{key:0,label:e.fix.label,icon:`mdi mdi-wrench-outline`,size:`small`,onClick:t=>vn(e.fix)},null,8,[`label`,`onClick`])):c(``,!0),ne(o(v),{label:e.stepId?`View logs`:`View run logs`,icon:`mdi mdi-console-line`,text:``,size:`small`,onClick:t=>yn(e)},null,8,[`label`,`onClick`])])]))),128)),P.value===`logs`?(n(),p(`section`,Xe,[m(`aside`,Ze,[t[13]||=m(`div`,{class:`sidebar-heading`},`Steps`,-1),m(`button`,{class:u([`step-item all-logs`,{selected:N.value===null}]),"aria-pressed":N.value===null,onClick:t[3]||=e=>_n(null)},[...t[12]||=[m(`i`,{class:`mdi mdi-text-box-multiple-outline`,"aria-hidden":`true`},null,-1),m(`span`,null,`All logs`,-1)]],10,Qe),k.value.steps.length?c(``,!0):(n(),p(`div`,$e,`Waiting for steps…`)),(n(!0),p(l,null,_(k.value.steps,(e,t)=>(n(),p(`div`,{key:e.id,class:`step-group`},[m(`button`,{class:u([`step-item`,[{selected:N.value===e.id},`step-${e.status}`]]),"aria-pressed":N.value===e.id,onClick:t=>Vt(e.id)},[m(`span`,{class:u([`step-icon`,`status-${e.status}`])},[m(`i`,{class:u(sn(e.status)),"aria-hidden":`true`},null,2)],2),m(`span`,tt,[m(`strong`,{title:e.id},[o(he)(O(e))?(n(),p(`img`,{key:0,class:`step-provider-icon`,src:o(he)(O(e)),alt:``},null,8,rt)):O(e)?(n(),p(`i`,{key:1,class:u([`step-provider-icon`,o(me)(O(e))]),"aria-hidden":`true`},null,2)):c(``,!0),h(r(D(e)),1)],8,nt),F(e)?(n(),p(`small`,it,r(F(e)),1)):an(e)?(n(),p(`small`,at,r(an(e)),1)):c(``,!0)]),e.phases?.length?(n(),p(`i`,{key:0,class:u([`mdi step-chevron`,Bt(e)?`mdi-chevron-up`:`mdi-chevron-down`]),"aria-hidden":`true`},null,2)):c(``,!0),m(`span`,ot,`Step `+r(t+1)+`, `+r(cn(e.status)),1)],10,et),e.phases?.length&&Bt(e)?(n(),p(`ol`,{key:0,class:`phase-checklist`,"aria-label":`${D(e)} phases`},[(n(!0),p(l,null,_(e.phases,e=>(n(),p(`li`,{key:e.id,class:u(`phase-${e.status}`)},[m(`span`,{class:`phase-status`,"aria-label":on(e.status)},[m(`i`,{class:u(sn(e.status)),"aria-hidden":`true`},null,2)],8,ct),m(`span`,lt,[m(`strong`,null,r(e.title),1),e.duration===void 0?c(``,!0):(n(),p(`small`,ut,r(Y(e.duration)),1)),e.message?(n(),p(`small`,dt,r(e.message),1)):c(``,!0),e.error?(n(),p(`small`,ft,r(e.error.message),1)):c(``,!0),(n(!0),p(l,null,_(e.warnings,(t,i)=>(n(),p(`small`,{key:`${e.id}-warning-${i}`,class:`phase-message phase-warning`},r(t),1))),128))])],2))),128))],8,st)):c(``,!0),(n(!0),p(l,null,_(e.diagnostics,(t,i)=>(n(),p(`small`,{key:`${e.id}-diagnostic-${i}`,class:`phase-message phase-warning step-diagnostic`},r(t),1))),128))]))),128))]),m(`div`,pt,[m(`header`,mt,[m(`div`,null,[m(`h3`,null,r(G.value?D(G.value):`All logs`),1)]),k.value.status===`running`?(n(),p(`span`,ht,[...t[14]||=[m(`i`,null,null,-1),h(`Streaming`,-1)]])):c(``,!0)]),G.value?.error&&!Rt.value.length?(n(),p(`div`,gt,[t[15]||=m(`i`,{class:`mdi mdi-alert-circle-outline`},null,-1),h(r(G.value.error.message),1)])):c(``,!0),m(`div`,{ref_key:`logViewport`,ref:R,class:`terminal`,onScrollPassive:Jt,role:`log`,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-label":`${G.value?D(G.value):`All`} execution logs`},[K.value.length?c(``,!0):(n(),p(`div`,vt,r(k.value.status===`running`?`Waiting for log output…`:G.value&&F(G.value)||`No logs recorded for this selection.`),1)),(n(!0),p(l,null,_(K.value,(e,t)=>(n(),p(`div`,{key:e.id||`${e.timestamp}-${t}`,class:u([`log-line`,[`log-${e.level}`,{"no-source":N.value!==null}]])},[m(`time`,{datetime:new Date(e.timestamp).toISOString()},r(Qt(e.timestamp)),9,yt),m(`span`,bt,r(e.level.toUpperCase()),1),e.source&&N.value===null?(n(),p(`span`,xt,r(e.source),1)):c(``,!0),m(`pre`,null,r(e.message),1)],2))),128)),k.value.status===`running`?(n(),p(`span`,St)):c(``,!0)],40,_t),!q.value&&K.value.length?(n(),s(o(v),{key:1,class:`jump-latest`,label:`Latest`,icon:`mdi mdi-arrow-down`,size:`small`,rounded:``,onClick:Yt})):c(``,!0)])])):P.value===`artifacts`?(n(),p(`section`,Ct,[k.value.artifacts?.length?(n(),p(`div`,Tt,[(n(!0),p(l,null,_(k.value.artifacts,e=>(n(),p(`article`,{key:e.id,class:`artifact-row`},[t[17]||=m(`i`,{class:`mdi mdi-package-variant`,"aria-hidden":`true`},null,-1),m(`div`,Et,[m(`strong`,null,r(X(e)),1),m(`small`,null,r(en(e)),1)]),m(`span`,null,r(tn(e)),1),e.size!==void 0&&e.size>0?(n(),p(`span`,Dt,r($t(e.size)),1)):c(``,!0),m(`span`,Ot,[`path`in e&&e.path?(n(),s(o(y),{key:0,value:`Local`,severity:`secondary`})):c(``,!0),Z(e)?(n(),s(o(y),{key:1,value:`Cloud`,severity:`info`})):c(``,!0)]),m(`div`,kt,[`path`in e&&e.path?(n(),s(o(v),{key:0,label:`Open`,icon:`mdi mdi-folder-open-outline`,text:``,size:`small`,"aria-label":`Open ${X(e)}`,"data-artifact-path":e.path,onClick:t=>nn(e.path)},null,8,[`aria-label`,`data-artifact-path`,`onClick`])):c(``,!0),Z(e)?(n(),s(o(v),{key:1,label:`Download`,icon:`mdi mdi-download`,text:``,size:`small`,"aria-label":`Download ${X(e)}`,onClick:t=>rn(Z(e).hostedArtifactId)},null,8,[`aria-label`,`onClick`])):c(``,!0)])]))),128))])):(n(),p(`div`,wt,[...t[16]||=[m(`i`,{class:`mdi mdi-package-variant-closed`},null,-1),m(`strong`,null,`No artifacts produced`,-1),m(`span`,null,`Artifacts created by this run will appear here.`,-1)]]))])):(n(),p(`section`,At,[k.value.deliveries?.length?(n(),p(`div`,Mt,[(n(!0),p(l,null,_(Xt.value,e=>(n(),p(`article`,{key:e.id,class:`delivery-group`},[m(`header`,null,[m(`div`,Nt,[m(`i`,{class:u(un(e.serviceId))},null,2)]),m(`div`,null,[m(`strong`,null,r(e.name),1),m(`small`,null,r(e.items.length)+` `+r(e.items.length===1?`delivery`:`deliveries`),1)])]),(n(!0),p(l,null,_(e.items,e=>(n(),p(`div`,{key:e.id,class:`delivery-row`},[m(`span`,{class:u([`delivery-status`,`status-${e.status}`])},[m(`i`,{class:u(e.status===`completed`?`mdi mdi-check-circle`:`mdi mdi-close-circle`)},null,2),h(r(e.status===`completed`?`Succeeded`:`Failed`),1)],2),m(`span`,null,r(e.slotId),1),m(`span`,null,r(Y(e.duration)),1),e.error?(n(),p(`span`,Pt,r(e.error),1)):c(``,!0)]))),128))]))),128))])):(n(),p(`div`,jt,[...t[18]||=[m(`i`,{class:`mdi mdi-cloud-upload-outline`},null,-1),m(`strong`,null,`No deliveries recorded`,-1),m(`span`,null,`Publishing results for this run will appear here.`,-1)]]))]))])):(n(),p(`main`,Ft,[A.value?(n(),s(o(b),{key:0,severity:`error`,closable:!1,role:`alert`},{default:a(()=>[h(r(A.value)+` `,1),ne(o(v),{label:`Back to runs`,text:``,onClick:dn})]),_:1})):(n(),p(`div`,It,[o(C).isReady.value?(n(),p(l,{key:0},[t[19]||=m(`i`,{class:`mdi mdi-loading`},null,-1),t[20]||=h(`Loading run…`,-1)],64)):(n(),p(`span`,Lt,`Run details are unavailable while the engine is disconnected.`))]))]))]))}}),[[`__scopeId`,`data-v-a15cc46a`]]);export{N as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{E as e,R as t,Y as n,l as r,lt as i,ot as a}from"./_plugin-vue_export-helper-p1XK9cLm.js";import{t as o}from"./useAgentAvailability-YDtT9EHJ.js";import{t as s}from"./api-BxGTgrE5.js";import{l as c}from"./index-
|
|
1
|
+
import{E as e,R as t,Y as n,l as r,lt as i,ot as a}from"./_plugin-vue_export-helper-p1XK9cLm.js";import{t as o}from"./useAgentAvailability-YDtT9EHJ.js";import{t as s}from"./api-BxGTgrE5.js";import{l as c}from"./index-3swN8pT8.js";import{t as l}from"./connections-Djk3Fk9U.js";import{at as u,g as d}from"./release-flow-model-DA5OtEda.js";var f=(e,t)=>{if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((e,n)=>f(e,t[n]));let n=Object.keys(e).toSorted(),r=Object.keys(t).toSorted();return n.length===r.length&&n.every((n,i)=>n===r[i]&&f(Reflect.get(e,n),Reflect.get(t,n)))},p=({changeRevision:e,persistedRevision:t,saveState:n,buildSettingsOpen:r=!1,draftBuild:i,currentBuild:a})=>e!==t||n===`saving`||n===`error`||r&&!!i&&!f(i,a),m=(e,t)=>t?(e.preventDefault(),e.returnValue=``,!0):!1,h=async(e,t,n)=>e?await t()?(n(),!0):!1:!0,g=(e,t,n,r,i)=>e===t&&n&&!!i&&r===i,_=e=>e?JSON.stringify({engine:e.engine,config:e.config,targets:e.targets}):``,v=(e,t,n)=>{if(t)return e.find(e=>e.id===t);let r=n.match(/^builds\.(\d+)/);return r?e[Number(r[1])]:void 0},y=(e,t,n)=>{let r=`builds.${t}.`;if(!n.startsWith(r))return;let i=n.slice(r.length);if(i===`engine`)return`settings-engine-${e.id}`;if(i===`input`||i.startsWith(`input.`))return`settings-input-${e.id}`;if(i===`inputs`||i.startsWith(`inputs.`))return`settings-inputs-${e.id}`;if(i.startsWith(`config.`))return`build-${e.id}-${i.slice(7)}`;let a=i.match(/^targets\.(\d+)(?:\.(.*))?$/);if(!a)return;let o=e.targets[Number(a[1])];if(!o)return;let s=a[2]||``;return s.startsWith(`config.`)?`target-${e.id}-${o.id}-${s.slice(7)}`:`build-target-${e.id}-${o.id}`},b=e=>JSON.parse(JSON.stringify(e)),x=e=>{let{flowId:t,projectId:a,isReady:o,execute:s}=e,c=i(),l=i(),u=i(!1),f=i(``),m=i(!1),h=i(``),g=i(`saved`),_=i(``),v=i(0),y=i(0),x=r(()=>p({changeRevision:v.value,persistedRevision:y.value,saveState:g.value})),S=!1,C=0,w=0,T=0,E,D,O=new Set,k=new Set,A=e=>{S=!0,c.value=e,S=!1,v.value=0,y.value=0,g.value=`saved`,_.value=``},j=async()=>{if(!c.value||!o.value)return;let e=++T,t=v.value,n=b(c.value),r=JSON.stringify(n);u.value=!0,f.value=``;try{let i=await s(`release:plan`,{config:n});if(e!==T||t!==v.value||JSON.stringify(c.value)!==r)return;if(i.type===`error`){l.value=void 0,f.value=i.ipcError;return}return l.value=i.result,i.result}catch(n){e===T&&t===v.value&&(l.value=void 0,f.value=n instanceof Error?n.message:String(n));return}finally{if(e===T){u.value=!1;for(let e of k)e()}}},M=async()=>{u.value&&await new Promise(e=>{let t=n(u,n=>{n||(t(),e())})})},N=d(async()=>{if(!c.value)return;let t=e.saveBlockedReason?.(c.value);if(t)throw g.value=`error`,_.value=t,Error(t);if(!o.value||e.dataAvailable?.()===!1){if(!x.value)return;throw g.value=`error`,_.value=`The engine or required workflow data is unavailable before save.`,Error(_.value)}let n=++w,r=v.value,i=b(c.value);g.value=`saving`,_.value=``;let a=await s(`workflow:save`,{workflowId:i.id,projectId:i.project,data:i});if(n!==w||!o.value)throw Error(`The connection changed before the save could be confirmed.`);if(a.type===`error`)throw g.value=`error`,_.value=a.ipcError,Error(a.ipcError);y.value=r,y.value!==v.value||JSON.stringify(c.value)!==JSON.stringify(i)?N().catch(()=>{}):g.value=`saved`}),P=async()=>{clearTimeout(E),c.value&&x.value&&await N()};n(c,()=>{if(!S&&c.value){v.value+=1,T+=1,u.value=!0,clearTimeout(E),clearTimeout(D);for(let e of O)e();E=setTimeout(()=>void N().catch(()=>{}),700),D=setTimeout(()=>void j(),300)}},{deep:!0,flush:`sync`});let F=async()=>{if(!o.value)return{ok:!1,hydrated:!1};let e=++C,n=t.value,r=a.value;if(c.value&&(c.value.id!==n||c.value.project!==r)){clearTimeout(D);try{await P()}catch{return{ok:!1,hydrated:!1}}}if(e!==C)return{ok:!1,hydrated:!1};m.value=!0,h.value=``;try{let t=await s(`workflow:load`,{workflowId:n,projectId:r});if(e!==C)return{ok:!1,hydrated:!1};if(t.type===`error`)throw Error(t.ipcError);if(t.result.id!==n||t.result.project!==r)throw Error(`Loaded workflow identity does not match the requested route.`);let i=c.value?.id===n&&c.value?.project===r,a=i&&x.value;return i||(l.value=void 0,f.value=``),a||A(t.result),{ok:!0,hydrated:!a}}catch(t){return e===C&&(h.value=t instanceof Error?t.message:String(t)),{ok:!1,hydrated:!1}}finally{e===C&&(m.value=!1)}},I=()=>c.value?.id===t.value&&c.value?.project===a.value;return n(o,e=>{e||(C++,w++,T++,m.value=!1,u.value=!1,clearTimeout(E),clearTimeout(D),x.value&&(g.value=`error`,_.value=`The engine disconnected before these workflow changes could be saved.`))}),{flow:c,plan:l,planning:u,plannerError:f,loading:m,loadError:h,saveState:g,saveError:_,changeRevision:v,persistedRevision:y,hasUnsaved:x,hydrate:A,load:F,ensure:async()=>(m.value&&await new Promise(e=>{let t=n(m,n=>{n||(t(),e())})}),I()||(await F()).ok),sync:async()=>{if(!o.value||!c.value||m.value||x.value)return;let e=t.value,n=a.value,r=await s(`workflow:load`,{workflowId:e,projectId:n});r.type!==`error`&&c.value&&!x.value&&e===t.value&&n===a.value&&JSON.stringify(r.result)!==JSON.stringify(c.value)&&(A(r.result),await j())},refreshPlan:j,planned:M,save:N,flush:P,onEdit:e=>(O.add(e),()=>O.delete(e)),onPlanned:e=>(k.add(e),()=>k.delete(e)),dispose:()=>{clearTimeout(E),clearTimeout(D),O.clear(),k.clear()}}},S=Symbol(`workflow-document`),C=e=>{let t=o(),n=s(),i=c(),d=l(),f=x({flowId:e.flowId,projectId:e.projectId,isReady:r(()=>t.isReady.value),execute:n.execute,saveBlockedReason:e=>u(e).length>0?`Fix invalid environment variable names before saving workflow changes.`:void 0,dataAvailable:()=>d.status===`ready`&&i.providerStatus===`ready`});return a(f.dispose),f},w=e=>{let n=C(e);return t(S,n),n},T=t=>e(S,void 0)??C(t);export{p as a,v as c,y as i,h as l,T as n,m as o,_ as r,g as s,w as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as e,L as t,Pt as n,Y as r,Z as i,_t as a,d as o,f as s,i as c,l,lt as u,p as d,t as f,u as p,v as m,x as h,y as g,z as _}from"./_plugin-vue_export-helper-p1XK9cLm.js";import{t as ee}from"./workflow-header-state-B-0MBtB0.js";import{t as te}from"./WorkflowRunsSwitch-DLE0zpjB.js";import{t as ne}from"./index-
|
|
1
|
+
import{I as e,L as t,Pt as n,Y as r,Z as i,_t as a,d as o,f as s,i as c,l,lt as u,p as d,t as f,u as p,v as m,x as h,y as g,z as _}from"./_plugin-vue_export-helper-p1XK9cLm.js";import{t as ee}from"./workflow-header-state-B-0MBtB0.js";import{t as te}from"./WorkflowRunsSwitch-DLE0zpjB.js";import{t as ne}from"./index-3swN8pT8.js";import{_ as v,g as y}from"./useApi-SF8tY_yo-D-2q1_yl.js";import{n as b}from"./times-BF5NnquQ.js";import{t as x}from"./message-Bw5keJML.js";import{t as S}from"./tag-CBfU-PTU.js";import{t as re}from"./api-BxGTgrE5.js";import{t as C}from"./useAgentAvailability-YDtT9EHJ.js";var w=(e,t)=>{let n=t.artifact,r=t.descriptor.kind;return{id:`${e.id}:${t.id}`,runId:e.id,runLabel:e.version?`Release ${e.version}`:e.workflowName||e.projectName||`Workflow run`,workflowName:e.workflowName||e.projectName||`Workflow`,runDate:e.startTime,displayName:n,releaseVersion:e.version??t.version,...t.descriptor.platform?{platform:t.descriptor.platform}:{},...t.descriptor.architecture?{architecture:t.descriptor.architecture}:{},...t.descriptor.format?{format:t.descriptor.format}:{},...r?{kind:r}:{},...typeof t.size==`number`&&t.size>0?{size:t.size}:{},...t.path?{localPath:t.path}:{},...t.cloud?.hostedArtifactId?{hostedArtifactId:t.cloud.hostedArtifactId}:{}}},ie=(e,t,n)=>e.filter(e=>e.workflowId===t&&e.projectId===n).flatMap(e=>(e.artifacts??[]).map(t=>w(e,t))).sort((e,t)=>t.runDate-e.runDate),ae={class:`workflow-page`},oe=[`aria-busy`],se={class:`list-heading`},ce={key:0,class:`artifact-count`},le={class:`state-copy`},T={key:2,class:`state-copy`,role:`status`},E={key:3,class:`artifact-skeleton`,"aria-busy":`true`,"aria-label":`Loading artifacts`},D={key:4,class:`empty-state`,role:`status`},O={key:5,class:`artifact-list`,"aria-label":`Workflow artifacts`},k={class:`artifact-main`},A={class:`artifact-content`},j={class:`artifact-name`},M={class:`artifact-metadata`,"aria-label":`Artifact details`},N={key:0},P={key:1},F={key:2},I={key:3},L={key:4},R={key:5},z={class:`artifact-provenance`},ue={key:2},B={class:`artifact-actions`},V=f(h({__name:`workflow-artifacts`,setup(f){let h=y();ee(()=>void Q());let w=v(),V=re(),H=C(),U=l(()=>String(h.params.flowId||``)),W=l(()=>String(h.params.projectId||``)),G=l(()=>`/workflows/${U.value}/${W.value}`),K=u([]),q=u(!0),J=u(``);ne(l(()=>!H.isReady.value||!q.value));let Y=u(``),X=u(``);l(()=>X.value||K.value[0]?.workflowName||`Workflow`);let Z=0,Q=async()=>{if(!H.isReady.value)return;let e=++Z,t=U.value,n=W.value,r=()=>e===Z&&U.value===t&&W.value===n;K.value.length||(q.value=!0),J.value=``,Y.value=``,V.execute(`workflow:load`,{workflowId:t,projectId:n}).then(e=>{r()&&e.type===`success`&&e.result.id===t&&e.result.project===n&&(X.value=e.result.name)}).catch(()=>{});try{let e=await V.execute(`build-history:get-all`,{query:{workflowId:t,projectId:n}});if(!r())return;if(e.type===`error`)throw Error(e.ipcError);K.value=ie(e.result.entries,t,n)}catch(e){r()&&(J.value=e instanceof Error?e.message:String(e))}finally{r()&&(q.value=!1)}},de=e=>new Date(e).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}),fe=e=>{if(!Number.isFinite(e)||e<0)return`—`;if(e<1024)return`${e} B`;let t=[`KB`,`MB`,`GB`,`TB`],n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r++;return`${n.toFixed(n>=10?0:1)} ${t[r]}`},$=e=>e.length>12?e.slice(0,8):e,pe=()=>w.push(`${G.value}/runs`),me=e=>w.push(`${G.value}/runs/${e}`),he=async e=>{try{let t=await V.openPath(e);t.type===`error`&&(Y.value=t.ipcError)}catch(e){Y.value=e instanceof Error?e.message:String(e)}},ge=async e=>{if(H.isReady.value)try{let t=await V.execute(`pipelab-cloud:artifact-download-url`,{hostedArtifactId:e});if(t.type===`error`){Y.value=t.ipcError;return}let n=document.createElement(`a`);n.href=t.result.url,n.target=`_blank`,n.rel=`noopener noreferrer`,n.click()}catch(e){Y.value=e instanceof Error?e.message:String(e)}};return r([U,W],()=>{K.value=[],X.value=``,H.isReady.value?Q():q.value=!0}),r(H.isReady,e=>{e?Q():(Z++,K.value.length||(q.value=!0))},{immediate:!0}),e(()=>{Z++}),(e,r)=>(t(),d(`div`,ae,[p(`main`,{class:`artifacts-page`,"aria-busy":q.value},[p(`header`,se,[g(te,{"flow-id":U.value,"project-id":W.value,active:`artifacts`},null,8,[`flow-id`,`project-id`]),!q.value&&!J.value?(t(),d(`span`,ce,n(K.value.length)+` `+n(K.value.length===1?`artifact`:`artifacts`),1)):s(``,!0)]),J.value?(t(),o(a(x),{key:0,severity:`error`,closable:!1,role:`alert`},{default:i(()=>[p(`div`,le,[r[0]||=p(`strong`,null,`Couldn’t load artifacts`,-1),p(`span`,null,n(J.value),1),g(a(b),{label:`Retry`,text:``,size:`small`,onClick:Q})])]),_:1})):s(``,!0),Y.value?(t(),o(a(x),{key:1,severity:`error`,closable:!1,role:`alert`},{default:i(()=>[m(n(Y.value),1)]),_:1})):s(``,!0),!a(H).isReady.value&&!K.value.length?(t(),d(`p`,T,` Artifacts are unavailable while the engine is disconnected. `)):q.value&&!K.value.length?(t(),d(`div`,E,[(t(),d(c,null,_(4,e=>p(`div`,{key:e,class:`skeleton-row`},[...r[1]||=[p(`span`,null,null,-1),p(`span`,null,null,-1),p(`span`,null,null,-1)]])),64))])):!q.value&&!J.value&&!K.value.length?(t(),d(`div`,D,[r[2]||=p(`i`,{class:`mdi mdi-package-variant-closed`,"aria-hidden":`true`},null,-1),r[3]||=p(`strong`,null,`No artifacts yet`,-1),r[4]||=p(`span`,null,`Artifacts generated by this workflow will appear here.`,-1),g(a(b),{label:`View runs`,icon:`pi pi-arrow-right`,text:``,onClick:pe})])):K.value.length?(t(),d(`ul`,O,[(t(!0),d(c,null,_(K.value,e=>(t(),d(`li`,{key:e.id,class:`artifact-row`},[p(`div`,k,[r[6]||=p(`i`,{class:`mdi mdi-package-variant artifact-icon`,"aria-hidden":`true`},null,-1),p(`div`,A,[p(`strong`,j,n(e.displayName),1),p(`div`,M,[e.releaseVersion?(t(),d(`span`,N,`Release `+n(e.releaseVersion),1)):s(``,!0),e.platform?(t(),d(`span`,P,`Platform: `+n(e.platform),1)):s(``,!0),e.architecture?(t(),d(`span`,F,`Architecture: `+n(e.architecture),1)):s(``,!0),e.format?(t(),d(`span`,I,`Format: `+n(e.format),1)):s(``,!0),e.kind?(t(),d(`span`,L,`Kind: `+n(e.kind),1)):s(``,!0),e.size!==void 0&&e.size>0?(t(),d(`span`,R,n(fe(e.size)),1)):s(``,!0)]),p(`div`,z,[p(`span`,null,n(de(e.runDate)),1),r[5]||=p(`span`,{"aria-hidden":`true`},`·`,-1),p(`span`,null,n(e.runLabel)+` · #`+n($(e.runId)),1),e.localPath?(t(),o(a(S),{key:0,value:`Local`,severity:`secondary`})):s(``,!0),e.hostedArtifactId?(t(),o(a(S),{key:1,value:`Cloud`,severity:`info`})):s(``,!0),!e.localPath&&!e.hostedArtifactId?(t(),d(`span`,ue,`Unavailable`)):s(``,!0)])])]),p(`div`,B,[e.localPath?(t(),o(a(b),{key:0,label:`Open`,icon:`mdi mdi-folder-open-outline`,text:``,size:`small`,"aria-label":`Open ${e.displayName}`,onClick:t=>he(e.localPath)},null,8,[`aria-label`,`onClick`])):s(``,!0),e.hostedArtifactId?(t(),o(a(b),{key:1,label:`Download`,icon:`mdi mdi-download`,text:``,size:`small`,"aria-label":`Download ${e.displayName}`,onClick:t=>ge(e.hostedArtifactId)},null,8,[`aria-label`,`onClick`])):s(``,!0),g(a(b),{label:`View run`,icon:`mdi mdi-open-in-new`,text:``,size:`small`,"aria-label":`View run ${$(e.runId)} for ${e.displayName}`,onClick:t=>me(e.runId)},null,8,[`aria-label`,`onClick`])])]))),128))])):s(``,!0)],8,oe)]))}}),[[`__scopeId`,`data-v-135982de`]]);export{V as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{E as e,S as t,_ as n,g as r,h as i,k as a,l as o,m as s,r as ee,t as te,u as ne,v as re,x as ie}from"./index-
|
|
1
|
+
import{E as e,S as t,_ as n,g as r,h as i,k as a,l as o,m as s,r as ee,t as te,u as ne,v as re,x as ie}from"./index-3swN8pT8.js";import{t as c}from"./check-D9CjoRRm.js";import{t as l}from"./chevron-down-DJUsXNmb.js";import{a as u,i as ae,l as oe,n as d,s as se,t as ce}from"./times-BF5NnquQ.js";import{C as le,D as ue,Et as de,J as f,O as fe,Ot as p,P as m,Pt as h,Rt as g,V as _,b as pe,bt as me,ft as he,jt as v,mt as ge,o as _e,r as ve,rt as ye,w as y,wt as b,z as be}from"./basedirective-jm123zF5.js";import{t as x}from"./zindex-1d7j-Dyg.js";import{t as xe}from"./checkbox-DvpeZ8LQ.js";import{A as Se,B as S,H as Ce,I as we,L as C,Mt as w,Pt as T,Q as Te,U as E,V as D,Y as Ee,Z as O,_t as k,d as A,f as j,ft as M,g as De,i as N,jt as P,k as F,l as I,lt as L,o as Oe,ot as ke,p as R,t as Ae,u as z,v as B,x as je,y as V,z as H}from"./_plugin-vue_export-helper-p1XK9cLm.js";import{i as U,n as Me,t as Ne}from"./inputtext-C7g3_yEy.js";import{t as Pe}from"./overlayeventbus-BIxzVXg6.js";import{c as Fe,t as Ie}from"./api-BxGTgrE5.js";import{b as Le,y as Re}from"./devtools-RytpElE1-DjjeLr5W.js";import{_ as ze,g as Be}from"./useApi-SF8tY_yo-D-2q1_yl.js";import{t as Ve}from"./workflow-header-state-B-0MBtB0.js";import{a as He,c as Ue,i as We,l as Ge,n as Ke,o as qe,r as Je,s as Ye}from"./useWorkflowDocument-6-o5gm97.js";import{t as Xe}from"./connections-Djk3Fk9U.js";import{t as Ze}from"./useAgentAvailability-YDtT9EHJ.js";import{B as Qe,D as $e,E as et,F as tt,G as nt,K as rt,L as it,N as at,O as ot,Q as st,S as ct,T as lt,U as ut,W as dt,X as ft,a as pt,at as mt,b as ht,c as gt,et as _t,f as vt,h as yt,it as bt,k as xt,l as St,m as Ct,nt as wt,o as Tt,ot as Et,q as Dt,r as Ot,rt as kt,s as At,st as jt,t as Mt,tt as Nt,u as Pt,v as Ft,w as It,x as Lt,y as Rt,z as zt}from"./release-flow-model-DA5OtEda.js";import{t as Bt}from"./dialog-Bg6uUBwG.js";import{t as Vt}from"./message-Bw5keJML.js";import{t as Ht}from"./ReleaseStatus-BiRuUd5Q.js";import{t as Ut}from"./ReleaseFieldControl-BgZuHF66.js";import{t as W}from"./toggleswitch-DE3Rpk7Q.js";var G=ve.extend({name:`chip`,style:`
|
|
2
2
|
.p-chip {
|
|
3
3
|
display: inline-flex;
|
|
4
4
|
align-items: center;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/elk.bundled-tFDPHbnJ.js","assets/rolldown-runtime-COiEfhsA.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{E as t,c as n,l as r,t as i}from"./index-BGwbEQIW.js";import{$ as a,A as o,B as s,D as c,E as l,F as u,G as d,I as f,J as p,L as m,M as h,N as g,Nt as _,Pt as v,Q as y,R as b,S as x,U as S,V as C,Y as w,Z as T,_ as E,_t as D,at as O,ct as k,d as A,dt as j,et as M,f as N,ht as P,i as F,jt as I,k as L,l as R,lt as z,m as B,mt as V,ot as H,p as U,pt as W,rt as ee,st as G,t as te,tt as ne,u as K,v as re,w as q,x as J,y as Y,z as ie}from"./_plugin-vue_export-helper-p1XK9cLm.js";import{t as ae}from"./workflow-header-state-B-0MBtB0.js";import{g as oe}from"./useApi-SF8tY_yo-D-2q1_yl.js";import{ot as se,st as ce}from"./release-flow-model-DA5OtEda.js";import{t as le}from"./useAgentAvailability-YDtT9EHJ.js";import{n as ue}from"./useWorkflowDocument-BOayDtQT.js";import"./api-BxGTgrE5.js";import{a as de,i as fe,n as pe,r as me,t as he}from"./provider-icons-CgkG5BRP.js";import{n as ge}from"./times-BF5NnquQ.js";import{t as _e}from"./message-Bw5keJML.js";function ve(e){return ne()?(H(e),!0):!1}function ye(e){return typeof e==`function`?e():D(e)}var be=typeof window<`u`&&typeof document<`u`,xe=e=>e!==void 0,Se=Object.prototype.toString,Ce=e=>Se.call(e)===`[object Object]`,we=()=>{};function Te(e,t){function n(...n){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(r).catch(i)})}return n}var Ee=e=>e();function De(e=Ee){let t=z(!0);function n(){t.value=!1}function r(){t.value=!0}return{isActive:k(t),pause:n,resume:r,eventFilter:(...n)=>{t.value&&e(...n)}}}function Oe(e,t=!1,n=`Timeout`){return new Promise((r,i)=>{setTimeout(t?()=>i(n):r,e)})}function ke(e,t,n={}){let{eventFilter:r=Ee,...i}=n;return w(e,Te(r,t),i)}function Ae(e,t,n={}){let{eventFilter:r,...i}=n,{eventFilter:a,pause:o,resume:s,isActive:c}=De(r);return{stop:ke(e,t,{...i,eventFilter:a}),pause:o,resume:s,isActive:c}}function je(e,t={}){if(!ee(e))return V(e);let n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(let r in e.value)n[r]=a(()=>({get(){return e.value[r]},set(n){if(ye(t.replaceRef)??!0){if(Array.isArray(e.value)){let t=[...e.value];t[r]=n,e.value=t}else{let t={...e.value,[r]:n};Object.setPrototypeOf(t,Object.getPrototypeOf(e.value)),e.value=t}}else e.value[r]=n}}));return n}function Me(e,t=!1){function n(n,{flush:r=`sync`,deep:i=!1,timeout:a,throwOnTimeout:o}={}){let s=null,c=[new Promise(a=>{s=w(e,e=>{n(e)!==t&&(s?.(),a(e))},{flush:r,deep:i,immediate:!0})})];return a!=null&&c.push(Oe(a,o).then(()=>ye(e)).finally(()=>s?.())),Promise.race(c)}function r(r,i){if(!ee(r))return n(e=>e===r,i);let{flush:a=`sync`,deep:o=!1,timeout:s,throwOnTimeout:c}=i??{},l=null,u=[new Promise(n=>{l=w([e,r],([e,r])=>{t!==(e===r)&&(l?.(),n(e))},{flush:a,deep:o,immediate:!0})})];return s!=null&&u.push(Oe(s,c).then(()=>ye(e)).finally(()=>(l?.(),ye(e)))),Promise.race(u)}function i(e){return n(e=>!!e,e)}function a(e){return r(null,e)}function o(e){return r(void 0,e)}function s(e){return n(Number.isNaN,e)}function c(e,t){return n(t=>{let n=Array.from(t);return n.includes(e)||n.includes(ye(e))},t)}function l(e){return u(1,e)}function u(e=1,t){let r=-1;return n(()=>(r+=1,r>=e),t)}return Array.isArray(ye(e))?{toMatch:n,toContains:c,changed:l,changedTimes:u,get not(){return Me(e,!t)}}:{toMatch:n,toBe:r,toBeTruthy:i,toBeNull:a,toBeNaN:s,toBeUndefined:o,changed:l,changedTimes:u,get not(){return Me(e,!t)}}}function Ne(e){return Me(e)}function Pe(e){let t=ye(e);return t?.$el??t}var Fe=be?window:void 0;function Ie(...e){let t,n,r,i;if(typeof e[0]==`string`||Array.isArray(e[0])?([n,r,i]=e,t=Fe):[t,n,r,i]=e,!t)return we;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);let a=[],o=()=>{a.forEach(e=>e()),a.length=0},s=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),c=w(()=>[Pe(t),ye(i)],([e,t])=>{if(o(),!e)return;let i=Ce(t)?{...t}:t;a.push(...n.flatMap(t=>r.map(n=>s(e,t,n,i))))},{immediate:!0,flush:`post`}),l=()=>{c(),o()};return ve(l),l}function Le(e){return typeof e==`function`?e:typeof e==`string`?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Re(...e){let t,n,r={};e.length===3?(t=e[0],n=e[1],r=e[2]):e.length===2?typeof e[1]==`object`?(t=!0,n=e[0],r=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);let{target:i=Fe,eventName:a=`keydown`,passive:o=!1,dedupe:s=!1}=r,c=Le(t);return Ie(i,a,e=>{e.repeat&&ye(s)||c(e)&&n(e)},o)}function ze(e){return JSON.parse(JSON.stringify(e))}function Be(e,t,n,r={}){let{clone:i=!1,passive:a=!1,eventName:s,deep:c=!1,defaultValue:l,shouldEmit:u}=r,d=x(),f=n||d?.emit||(d?.$emit)?.bind(d)||(d?.proxy?.$emit)?.bind(d?.proxy),p=s;t||=`modelValue`,p||=`update:${t.toString()}`;let m=e=>i?typeof i==`function`?i(e):ze(e):e,h=()=>xe(e[t])?m(e[t]):l,g=e=>{u?u(e)&&f(p,e):f(p,e)};if(a){let n=h(),r=z(n),i=!1;return w(()=>e[t],e=>{i||(i=!0,r.value=m(e),o(()=>i=!1))}),w(r,n=>{!i&&(n!==e[t]||c)&&g(n)},{deep:c}),r}return R({get(){return h()},set(e){g(e)}})}var Ve={value:()=>{}};function He(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new Ue(n)}function Ue(e){this._=e}function We(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}Ue.prototype=He.prototype={constructor:Ue,on:function(e,t){var n=this._,r=We(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=Ge(n[i],e.name)))return i}else{if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=Ke(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Ke(n[i],e.name,null);return this}},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ue(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function Ge(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Ke(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Ve,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var qe=`http://www.w3.org/1999/xhtml`,Je={svg:`http://www.w3.org/2000/svg`,xhtml:qe,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function Ye(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),Je.hasOwnProperty(t)?{space:Je[t],local:e}:e}function Xe(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===qe&&t.documentElement.namespaceURI===qe?t.createElement(e):t.createElementNS(n,e)}}function Ze(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Qe(e){var t=Ye(e);return(t.local?Ze:Xe)(t)}function $e(){}function et(e){return e==null?$e:function(){return this.querySelector(e)}}function tt(e){typeof e!=`function`&&(e=et(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new Wn(r,this._parents)}function nt(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function rt(){return[]}function it(e){return e==null?rt:function(){return this.querySelectorAll(e)}}function at(e){return function(){return nt(e.apply(this,arguments))}}function ot(e){e=typeof e==`function`?at(e):it(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new Wn(r,i)}function st(e){return function(){return this.matches(e)}}function ct(e){return function(t){return t.matches(e)}}var lt=Array.prototype.find;function ut(e){return function(){return lt.call(this.children,e)}}function dt(){return this.firstElementChild}function ft(e){return this.select(e==null?dt:ut(typeof e==`function`?e:ct(e)))}var pt=Array.prototype.filter;function mt(){return Array.from(this.children)}function ht(e){return function(){return pt.call(this.children,e)}}function gt(e){return this.selectAll(e==null?mt:ht(typeof e==`function`?e:ct(e)))}function _t(e){typeof e!=`function`&&(e=st(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Wn(r,this._parents)}function vt(e){return Array(e.length)}function yt(){return new Wn(this._enter||this._groups.map(vt),this._parents)}function bt(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}bt.prototype={constructor:bt,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function xt(e){return function(){return e}}function St(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new bt(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function Ct(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new bt(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function wt(e){return e.__data__}function Tt(e,t){if(!arguments.length)return Array.from(this,wt);var n=t?Ct:St,r=this._parents,i=this._groups;typeof e!=`function`&&(e=xt(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=Et(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new Wn(o,r),o._enter=s,o._exit=c,o}function Et(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Dt(){return new Wn(this._exit||this._groups.map(vt),this._parents)}function Ot(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function kt(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new Wn(s,this._parents)}function At(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function jt(e){e||=Mt;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new Wn(i,this._parents).order()}function Mt(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Nt(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Pt(){return Array.from(this)}function Ft(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function It(){let e=0;for(let t of this)++e;return e}function Lt(){return!this.node()}function Rt(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function zt(e){return function(){this.removeAttribute(e)}}function Bt(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Vt(e,t){return function(){this.setAttribute(e,t)}}function Ht(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Ut(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Wt(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Gt(e,t){var n=Ye(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Bt:zt:typeof t==`function`?n.local?Wt:Ut:n.local?Ht:Vt)(n,t))}function Kt(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function qt(e){return function(){this.style.removeProperty(e)}}function Jt(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Yt(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Xt(e,t,n){return arguments.length>1?this.each((t==null?qt:typeof t==`function`?Yt:Jt)(e,t,n??``)):Zt(this.node(),e)}function Zt(e,t){return e.style.getPropertyValue(t)||Kt(e).getComputedStyle(e,null).getPropertyValue(t)}function Qt(e){return function(){delete this[e]}}function $t(e,t){return function(){this[e]=t}}function en(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function tn(e,t){return arguments.length>1?this.each((t==null?Qt:typeof t==`function`?en:$t)(e,t)):this.node()[e]}function nn(e){return e.trim().split(/^|\s+/)}function rn(e){return e.classList||new an(e)}function an(e){this._node=e,this._names=nn(e.getAttribute(`class`)||``)}an.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function on(e,t){for(var n=rn(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function sn(e,t){for(var n=rn(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function cn(e){return function(){on(this,e)}}function ln(e){return function(){sn(this,e)}}function un(e,t){return function(){(t.apply(this,arguments)?on:sn)(this,e)}}function dn(e,t){var n=nn(e+``);if(arguments.length<2){for(var r=rn(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?un:t?cn:ln)(n,t))}function fn(){this.textContent=``}function pn(e){return function(){this.textContent=e}}function mn(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function hn(e){return arguments.length?this.each(e==null?fn:(typeof e==`function`?mn:pn)(e)):this.node().textContent}function gn(){this.innerHTML=``}function _n(e){return function(){this.innerHTML=e}}function vn(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function yn(e){return arguments.length?this.each(e==null?gn:(typeof e==`function`?vn:_n)(e)):this.node().innerHTML}function bn(){this.nextSibling&&this.parentNode.appendChild(this)}function xn(){return this.each(bn)}function Sn(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Cn(){return this.each(Sn)}function wn(e){var t=typeof e==`function`?e:Qe(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Tn(){return null}function En(e,t){var n=typeof e==`function`?e:Qe(e),r=t==null?Tn:typeof t==`function`?t:et(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Dn(){var e=this.parentNode;e&&e.removeChild(this)}function On(){return this.each(Dn)}function kn(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function An(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function jn(e){return this.select(e?An:kn)}function Mn(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function Nn(e){return function(t){e.call(this,t,this.__data__)}}function Pn(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function Fn(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function In(e,t,n){return function(){var r=this.__on,i,a=Nn(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function Ln(e,t,n){var r=Pn(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}}else{for(s=t?In:Fn,i=0;i<a;++i)this.each(s(r[i],t,n));return this}}function Rn(e,t,n){var r=Kt(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function zn(e,t){return function(){return Rn(this,e,t)}}function Bn(e,t){return function(){return Rn(this,e,t.apply(this,arguments))}}function Vn(e,t){return this.each((typeof t==`function`?Bn:zn)(e,t))}function*Hn(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var Un=[null];function Wn(e,t){this._groups=e,this._parents=t}function Gn(){return new Wn([[document.documentElement]],Un)}function Kn(){return this}Wn.prototype=Gn.prototype={constructor:Wn,select:tt,selectAll:ot,selectChild:ft,selectChildren:gt,filter:_t,data:Tt,enter:yt,exit:Dt,join:Ot,merge:kt,selection:Kn,order:At,sort:jt,call:Nt,nodes:Pt,node:Ft,size:It,empty:Lt,each:Rt,attr:Gt,style:Xt,property:tn,classed:dn,text:hn,html:yn,raise:xn,lower:Cn,append:wn,insert:En,remove:On,clone:jn,datum:Mn,on:Ln,dispatch:Vn,[Symbol.iterator]:Hn};function qn(e){return typeof e==`string`?new Wn([[document.querySelector(e)]],[document.documentElement]):new Wn([[e]],Un)}function Jn(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Yn(e,t){if(e=Jn(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var Xn={passive:!1},Zn={capture:!0,passive:!1};function Qn(e){e.stopImmediatePropagation()}function $n(e){e.preventDefault(),e.stopImmediatePropagation()}function er(e){var t=e.document.documentElement,n=qn(e).on(`dragstart.drag`,$n,Zn);`onselectstart`in t?n.on(`selectstart.drag`,$n,Zn):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function tr(e,t){var n=e.document.documentElement,r=qn(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,$n,Zn),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var nr=e=>()=>e;function rr(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}rr.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function ir(e){return!e.ctrlKey&&!e.button}function ar(){return this.parentNode}function or(e,t){return t??{x:e.x,y:e.y}}function sr(){return navigator.maxTouchPoints||`ontouchstart`in this}function cr(){var e=ir,t=ar,n=or,r=sr,i={},a=He(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,Xn).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!u&&e.call(this,n,r)){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(qn(n.view).on(`mousemove.drag`,m,Zn).on(`mouseup.drag`,h,Zn),er(n.view),Qn(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if($n(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){qn(e.view).on(`mousemove.drag mouseup.drag`,null),tr(e.view,l),$n(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r))for(var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s=0,c;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(Qn(n),c(`start`,n,i[s]))}function _(e){for(var t=e.changedTouches,n=t.length,r=0,a;r<n;++r)(a=i[t[r].identifier])&&($n(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(Qn(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=Yn(l||r,t),p,m,h;if((h=n.call(e,new rr(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=Yn(l||a,t),_=o}u.call(r,e,new rr(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:nr(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:nr(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:nr(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:nr(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function lr(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ur(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function dr(){}var fr=.7,pr=1/fr,mr=`\\s*([+-]?\\d+)\\s*`,hr=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,gr=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,_r=/^#([0-9a-f]{3,8})$/,vr=RegExp(`^rgb\\(${mr},${mr},${mr}\\)$`),yr=RegExp(`^rgb\\(${gr},${gr},${gr}\\)$`),br=RegExp(`^rgba\\(${mr},${mr},${mr},${hr}\\)$`),xr=RegExp(`^rgba\\(${gr},${gr},${gr},${hr}\\)$`),Sr=RegExp(`^hsl\\(${hr},${gr},${gr}\\)$`),Cr=RegExp(`^hsla\\(${hr},${gr},${gr},${hr}\\)$`),wr={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};lr(dr,kr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Tr,formatHex:Tr,formatHex8:Er,formatHsl:Dr,formatRgb:Or,toString:Or});function Tr(){return this.rgb().formatHex()}function Er(){return this.rgb().formatHex8()}function Dr(){return Hr(this).formatHsl()}function Or(){return this.rgb().formatRgb()}function kr(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=_r.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Ar(t):n===3?new Pr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?jr(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?jr(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=vr.exec(e))?new Pr(t[1],t[2],t[3],1):(t=yr.exec(e))?new Pr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=br.exec(e))?jr(t[1],t[2],t[3],t[4]):(t=xr.exec(e))?jr(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Sr.exec(e))?Vr(t[1],t[2]/100,t[3]/100,1):(t=Cr.exec(e))?Vr(t[1],t[2]/100,t[3]/100,t[4]):wr.hasOwnProperty(e)?Ar(wr[e]):e===`transparent`?new Pr(NaN,NaN,NaN,0):null}function Ar(e){return new Pr(e>>16&255,e>>8&255,e&255,1)}function jr(e,t,n,r){return r<=0&&(e=t=n=NaN),new Pr(e,t,n,r)}function Mr(e){return e instanceof dr||(e=kr(e)),e?(e=e.rgb(),new Pr(e.r,e.g,e.b,e.opacity)):new Pr}function Nr(e,t,n,r){return arguments.length===1?Mr(e):new Pr(e,t,n,r??1)}function Pr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}lr(Pr,Nr,ur(dr,{brighter(e){return e=e==null?pr:pr**+e,new Pr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?fr:fr**+e,new Pr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Pr(zr(this.r),zr(this.g),zr(this.b),Rr(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Fr,formatHex:Fr,formatHex8:Ir,formatRgb:Lr,toString:Lr}));function Fr(){return`#${Br(this.r)}${Br(this.g)}${Br(this.b)}`}function Ir(){return`#${Br(this.r)}${Br(this.g)}${Br(this.b)}${Br((isNaN(this.opacity)?1:this.opacity)*255)}`}function Lr(){let e=Rr(this.opacity);return`${e===1?`rgb(`:`rgba(`}${zr(this.r)}, ${zr(this.g)}, ${zr(this.b)}${e===1?`)`:`, ${e})`}`}function Rr(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function zr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Br(e){return e=zr(e),(e<16?`0`:``)+e.toString(16)}function Vr(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Wr(e,t,n,r)}function Hr(e){if(e instanceof Wr)return new Wr(e.h,e.s,e.l,e.opacity);if(e instanceof dr||(e=kr(e)),!e)return new Wr;if(e instanceof Wr)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new Wr(o,s,c,e.opacity)}function Ur(e,t,n,r){return arguments.length===1?Hr(e):new Wr(e,t,n,r??1)}function Wr(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}lr(Wr,Ur,ur(dr,{brighter(e){return e=e==null?pr:pr**+e,new Wr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?fr:fr**+e,new Wr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Pr(qr(e>=240?e-240:e+120,i,r),qr(e,i,r),qr(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Wr(Gr(this.h),Kr(this.s),Kr(this.l),Rr(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=Rr(this.opacity);return`${e===1?`hsl(`:`hsla(`}${Gr(this.h)}, ${Kr(this.s)*100}%, ${Kr(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function Gr(e){return e=(e||0)%360,e<0?e+360:e}function Kr(e){return Math.max(0,Math.min(1,e||0))}function qr(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var Jr=e=>()=>e;function Yr(e,t){return function(n){return e+n*t}}function Xr(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Zr(e){return(e=+e)==1?Qr:function(t,n){return n-t?Xr(t,n,e):Jr(isNaN(t)?n:t)}}function Qr(e,t){var n=t-e;return n?Yr(e,n):Jr(isNaN(e)?t:e)}var $r=function e(t){var n=Zr(t);function r(e,t){var r=n((e=Nr(e)).r,(t=Nr(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Qr(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r}(1);function ei(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function ti(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ni(e,t){for(var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o=0;o<r;++o)i[o]=di(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function ri(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function ii(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function ai(e,t){var n={},r={},i;for(i in typeof e==`object`&&e||(e={}),typeof t==`object`&&t||(t={}),t)i in e?n[i]=di(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var oi=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,si=new RegExp(oi.source,`g`);function ci(e){return function(){return e}}function li(e){return function(t){return e(t)+``}}function ui(e,t){var n=oi.lastIndex=si.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=oi.exec(e))&&(i=si.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:ii(r,i)})),n=si.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?li(c[0].x):ci(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function di(e,t){var n=typeof t,r;return t==null||n===`boolean`?Jr(t):(n===`number`?ii:n===`string`?(r=kr(t))?(t=r,$r):ui:t instanceof kr?$r:t instanceof Date?ri:ti(t)?ei:Array.isArray(t)?ni:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?ai:ii)(e,t)}var fi=180/Math.PI,pi={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function mi(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*fi,skewX:Math.atan(c)*fi,scaleX:o,scaleY:s}}var hi;function gi(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?pi:mi(t.a,t.b,t.c,t.d,t.e,t.f)}function _i(e){return e==null||(hi||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),hi.setAttribute(`transform`,e),!(e=hi.transform.baseVal.consolidate()))?pi:(e=e.matrix,mi(e.a,e.b,e.c,e.d,e.e,e.f))}function vi(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:ii(e,i)},{i:c-2,x:ii(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:ii(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:ii(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:ii(e,n)},{i:s-2,x:ii(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var yi=vi(gi,`px, `,`px)`,`deg)`),bi=vi(_i,`, `,`)`,`)`),xi=1e-12;function Si(e){return((e=Math.exp(e))+1/e)/2}function Ci(e){return((e=Math.exp(e))-1/e)/2}function wi(e){return((e=Math.exp(2*e))-1)/(e+1)}var Ti=function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<xi)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=Si(y),c=s/(n*g)*(i*wi(t*r+y)-Ci(y));return[a+c*d,o+c*f,s*i/Si(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i}(Math.SQRT2,2,4),Ei=0,Di=0,Oi=0,ki=1e3,Ai,ji,Mi=0,Ni=0,Pi=0,Fi=typeof performance==`object`&&performance.now?performance:Date,Ii=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Li(){return Ni||=(Ii(Ri),Fi.now()+Pi)}function Ri(){Ni=0}function zi(){this._call=this._time=this._next=null}zi.prototype=Bi.prototype={constructor:zi,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?Li():+n)+(t==null?0:+t),!this._next&&ji!==this&&(ji?ji._next=this:Ai=this,ji=this),this._call=e,this._time=n,Gi()},stop:function(){this._call&&(this._call=null,this._time=1/0,Gi())}};function Bi(e,t,n){var r=new zi;return r.restart(e,t,n),r}function Vi(){Li(),++Ei;for(var e=Ai,t;e;)(t=Ni-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ei}function Hi(){Ni=(Mi=Fi.now())+Pi,Ei=Di=0;try{Vi()}finally{Ei=0,Wi(),Ni=0}}function Ui(){var e=Fi.now(),t=e-Mi;t>ki&&(Pi-=t,Mi=e)}function Wi(){for(var e,t=Ai,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Ai=n);ji=e,Gi(r)}function Gi(e){Ei||(Di&&=clearTimeout(Di),e-Ni>24?(e<1/0&&(Di=setTimeout(Hi,e-Fi.now()-Pi)),Oi&&=clearInterval(Oi)):(Oi||=(Mi=Fi.now(),setInterval(Ui,ki)),Ei=1,Ii(Hi)))}function Ki(e,t,n){var r=new zi;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var qi=He(`start`,`end`,`cancel`,`interrupt`),Ji=[],Yi=0,Xi=1,Zi=2,Qi=3,$i=4,ea=5,ta=6;function na(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;oa(e,n,{name:t,index:r,group:i,on:qi,tween:Ji,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Yi})}function ra(e,t){var n=aa(e,t);if(n.state>Yi)throw Error(`too late; already scheduled`);return n}function ia(e,t){var n=aa(e,t);if(n.state>Qi)throw Error(`too late; already running`);return n}function aa(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function oa(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Bi(a,0,n.time);function a(e){n.state=Xi,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==Xi)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===Qi)return Ki(o);f.state===$i?(f.state=ta,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=ta,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(Ki(function(){n.state===Qi&&(n.state=$i,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=Zi,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===Zi){for(n.state=Qi,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=ea,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===ea&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=ta,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function sa(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n)(r=n[o]).name===t?(i=r.state>Zi&&r.state<ea,r.state=ta,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]):a=!1;a&&delete e.__transition}}function ca(e){return this.each(function(){sa(this,e)})}function la(e,t){var n,r;return function(){var i=ia(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function ua(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=ia(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function da(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=aa(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?la:ua)(n,e,t))}function fa(e,t,n){var r=e._id;return e.each(function(){var e=ia(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return aa(e,r).value[t]}}function pa(e,t){var n;return(typeof t==`number`?ii:t instanceof kr?$r:(n=kr(t))?(t=n,$r):ui)(e,t)}function ma(e){return function(){this.removeAttribute(e)}}function ha(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ga(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function _a(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function va(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function ya(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function ba(e,t){var n=Ye(e),r=n===`transform`?bi:pa;return this.attrTween(e,typeof t==`function`?(n.local?ya:va)(n,r,fa(this,`attr.`+e,t)):t==null?(n.local?ha:ma)(n):(n.local?_a:ga)(n,r,t))}function xa(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Sa(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Ca(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Sa(e,i)),n}return i._value=t,i}function wa(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&xa(e,i)),n}return i._value=t,i}function Ta(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=Ye(e);return this.tween(n,(r.local?Ca:wa)(r,t))}function Ea(e,t){return function(){ra(this,e).delay=+t.apply(this,arguments)}}function Da(e,t){return t=+t,function(){ra(this,e).delay=t}}function Oa(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Ea:Da)(t,e)):aa(this.node(),t).delay}function ka(e,t){return function(){ia(this,e).duration=+t.apply(this,arguments)}}function Aa(e,t){return t=+t,function(){ia(this,e).duration=t}}function ja(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?ka:Aa)(t,e)):aa(this.node(),t).duration}function Ma(e,t){if(typeof t!=`function`)throw Error();return function(){ia(this,e).ease=t}}function Na(e){var t=this._id;return arguments.length?this.each(Ma(t,e)):aa(this.node(),t).ease}function Pa(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();ia(this,e).ease=n}}function Fa(e){if(typeof e!=`function`)throw Error();return this.each(Pa(this._id,e))}function Ia(e){typeof e!=`function`&&(e=st(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new fo(r,this._parents,this._name,this._id)}function La(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new fo(o,this._parents,this._name,this._id)}function Ra(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function za(e,t,n){var r,i,a=Ra(t)?ra:ia;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function Ba(e,t){var n=this._id;return arguments.length<2?aa(this.node(),n).on.on(e):this.each(za(n,e,t))}function Va(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Ha(){return this.on(`end.remove`,Va(this._id))}function Ua(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=et(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,na(l[f],t,n,f,l,aa(u,n)));return new fo(a,this._parents,t,n)}function Wa(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=it(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=aa(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&na(p,t,n,h,f,m);a.push(f),o.push(u)}return new fo(a,o,t,n)}var Ga=Gn.prototype.constructor;function Ka(){return new Ga(this._groups,this._parents)}function qa(e,t){var n,r,i;return function(){var a=Zt(this,e),o=(this.style.removeProperty(e),Zt(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function Ja(e){return function(){this.style.removeProperty(e)}}function Ya(e,t,n){var r,i=n+``,a;return function(){var o=Zt(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function Xa(e,t,n){var r,i,a;return function(){var o=Zt(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),Zt(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function Za(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=ia(this,e),l=c.on,u=c.value[a]==null?s||=Ja(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function Qa(e,t,n){var r=(e+=``)==`transform`?yi:pa;return t==null?this.styleTween(e,qa(e,r)).on(`end.style.`+e,Ja(e)):typeof t==`function`?this.styleTween(e,Xa(e,r,fa(this,`style.`+e,t))).each(Za(this._id,e)):this.styleTween(e,Ya(e,r,t),n).on(`end.style.`+e,null)}function $a(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function eo(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&$a(e,a,n)),r}return a._value=t,a}function to(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,eo(e,t,n??``))}function no(e){return function(){this.textContent=e}}function ro(e){return function(){var t=e(this);this.textContent=t??``}}function io(e){return this.tween(`text`,typeof e==`function`?ro(fa(this,`text`,e)):no(e==null?``:e+``))}function ao(e){return function(t){this.textContent=e.call(this,t)}}function oo(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&ao(r)),t}return r._value=e,r}function so(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,oo(e))}function co(){for(var e=this._name,t=this._id,n=po(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=aa(c,t);na(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new fo(r,this._parents,e,n)}function lo(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=ia(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var uo=0;function fo(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function po(){return++uo}var mo=Gn.prototype;fo.prototype={constructor:fo,select:Ua,selectAll:Wa,selectChild:mo.selectChild,selectChildren:mo.selectChildren,filter:Ia,merge:La,selection:Ka,transition:co,call:mo.call,nodes:mo.nodes,node:mo.node,size:mo.size,empty:mo.empty,each:mo.each,on:Ba,attr:ba,attrTween:Ta,style:Qa,styleTween:to,text:io,textTween:so,remove:Ha,tween:da,delay:Oa,duration:ja,ease:Na,easeVarying:Fa,end:lo,[Symbol.iterator]:mo[Symbol.iterator]};function ho(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var go={time:null,delay:0,duration:250,ease:ho};function _o(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function vo(e){var t,n;e instanceof fo?(t=e._id,e=e._name):(t=po(),(n=go).time=Li(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&na(c,e,t,l,o,n||_o(c,t));return new fo(r,this._parents,e,t)}Gn.prototype.interrupt=ca,Gn.prototype.transition=vo;var yo=e=>()=>e;function bo(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function xo(e,t,n){this.k=e,this.x=t,this.y=n}xo.prototype={constructor:xo,scale:function(e){return e===1?this:new xo(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new xo(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var So=new xo(1,0,0);xo.prototype;function Co(e){e.stopImmediatePropagation()}function wo(e){e.preventDefault(),e.stopImmediatePropagation()}function To(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function Eo(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Do(){return this.__zoom||So}function Oo(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function ko(){return navigator.maxTouchPoints||`ontouchstart`in this}function Ao(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function jo(){var e=To,t=Eo,n=Ao,r=Oo,i=ko,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=Ti,l=He(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,Do).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,Do),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(So.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new xo(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new xo(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new xo(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=qn(this.that).datum();l.call(e,this.that,new bo(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=Yn(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],sa(this),s.start();wo(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=qn(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=Yn(t,i),l=t.clientX,u=t.clientY;er(t.view),Co(t),a.mouse=[c,this.__zoom.invert(c)],sa(this),a.start();function d(e){if(wo(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=Yn(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),tr(e.view,a.moved),wo(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=Yn(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);wo(r),s>0?qn(this).transition().duration(s).call(x,d,c,r):qn(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(Co(t),s=0;s<i;++s)c=r[s],l=Yn(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),sa(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(wo(e),s=0;s<a;++s)c=i[s],l=Yn(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(Co(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=Yn(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=qn(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:yo(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:yo(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:yo(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:yo([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var X=(e=>(e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`,e))(X||{}),Mo=(e=>(e.Partial=`partial`,e.Full=`full`,e))(Mo||{}),No=(e=>(e.Bezier=`default`,e.SimpleBezier=`simple-bezier`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e))(No||{}),Po=(e=>(e.Strict=`strict`,e.Loose=`loose`,e))(Po||{}),Fo=(e=>(e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`,e))(Fo||{}),Io=(e=>(e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`,e))(Io||{}),Lo=(e=>(e.TopLeft=`top-left`,e.TopCenter=`top-center`,e.TopRight=`top-right`,e.BottomLeft=`bottom-left`,e.BottomCenter=`bottom-center`,e.BottomRight=`bottom-right`,e))(Lo||{}),Ro=[`INPUT`,`SELECT`,`TEXTAREA`],zo=typeof document<`u`?document:null;function Bo(e){let t=e.composedPath?.call(e)?.[0]||e.target,n=typeof t?.hasAttribute==`function`&&t.hasAttribute(`contenteditable`),r=typeof t?.closest==`function`?t.closest(`.nokey`):null;return Ro.includes(t?.nodeName)||n||!!r}function Vo(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function Ho(e,t,n,r){let i=t.replace(`+`,`
|
|
2
|
+
import{i as e}from"./rolldown-runtime-COiEfhsA.js";import{E as t,c as n,l as r,t as i}from"./index-3swN8pT8.js";import{$ as a,A as o,B as s,D as c,E as l,F as u,G as d,I as f,J as p,L as m,M as h,N as g,Nt as _,Pt as v,Q as y,R as b,S as x,U as S,V as C,Y as w,Z as T,_ as E,_t as D,at as O,ct as k,d as A,dt as j,et as M,f as N,ht as P,i as F,jt as I,k as L,l as R,lt as z,m as B,mt as V,ot as H,p as U,pt as W,rt as ee,st as G,t as te,tt as ne,u as K,v as re,w as q,x as J,y as Y,z as ie}from"./_plugin-vue_export-helper-p1XK9cLm.js";import{t as ae}from"./workflow-header-state-B-0MBtB0.js";import{g as oe}from"./useApi-SF8tY_yo-D-2q1_yl.js";import{ot as se,st as ce}from"./release-flow-model-DA5OtEda.js";import{t as le}from"./useAgentAvailability-YDtT9EHJ.js";import{n as ue}from"./useWorkflowDocument-6-o5gm97.js";import"./api-BxGTgrE5.js";import{a as de,i as fe,n as pe,r as me,t as he}from"./provider-icons-CgkG5BRP.js";import{n as ge}from"./times-BF5NnquQ.js";import{t as _e}from"./message-Bw5keJML.js";function ve(e){return ne()?(H(e),!0):!1}function ye(e){return typeof e==`function`?e():D(e)}var be=typeof window<`u`&&typeof document<`u`,xe=e=>e!==void 0,Se=Object.prototype.toString,Ce=e=>Se.call(e)===`[object Object]`,we=()=>{};function Te(e,t){function n(...n){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(r).catch(i)})}return n}var Ee=e=>e();function De(e=Ee){let t=z(!0);function n(){t.value=!1}function r(){t.value=!0}return{isActive:k(t),pause:n,resume:r,eventFilter:(...n)=>{t.value&&e(...n)}}}function Oe(e,t=!1,n=`Timeout`){return new Promise((r,i)=>{setTimeout(t?()=>i(n):r,e)})}function ke(e,t,n={}){let{eventFilter:r=Ee,...i}=n;return w(e,Te(r,t),i)}function Ae(e,t,n={}){let{eventFilter:r,...i}=n,{eventFilter:a,pause:o,resume:s,isActive:c}=De(r);return{stop:ke(e,t,{...i,eventFilter:a}),pause:o,resume:s,isActive:c}}function je(e,t={}){if(!ee(e))return V(e);let n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(let r in e.value)n[r]=a(()=>({get(){return e.value[r]},set(n){if(ye(t.replaceRef)??!0){if(Array.isArray(e.value)){let t=[...e.value];t[r]=n,e.value=t}else{let t={...e.value,[r]:n};Object.setPrototypeOf(t,Object.getPrototypeOf(e.value)),e.value=t}}else e.value[r]=n}}));return n}function Me(e,t=!1){function n(n,{flush:r=`sync`,deep:i=!1,timeout:a,throwOnTimeout:o}={}){let s=null,c=[new Promise(a=>{s=w(e,e=>{n(e)!==t&&(s?.(),a(e))},{flush:r,deep:i,immediate:!0})})];return a!=null&&c.push(Oe(a,o).then(()=>ye(e)).finally(()=>s?.())),Promise.race(c)}function r(r,i){if(!ee(r))return n(e=>e===r,i);let{flush:a=`sync`,deep:o=!1,timeout:s,throwOnTimeout:c}=i??{},l=null,u=[new Promise(n=>{l=w([e,r],([e,r])=>{t!==(e===r)&&(l?.(),n(e))},{flush:a,deep:o,immediate:!0})})];return s!=null&&u.push(Oe(s,c).then(()=>ye(e)).finally(()=>(l?.(),ye(e)))),Promise.race(u)}function i(e){return n(e=>!!e,e)}function a(e){return r(null,e)}function o(e){return r(void 0,e)}function s(e){return n(Number.isNaN,e)}function c(e,t){return n(t=>{let n=Array.from(t);return n.includes(e)||n.includes(ye(e))},t)}function l(e){return u(1,e)}function u(e=1,t){let r=-1;return n(()=>(r+=1,r>=e),t)}return Array.isArray(ye(e))?{toMatch:n,toContains:c,changed:l,changedTimes:u,get not(){return Me(e,!t)}}:{toMatch:n,toBe:r,toBeTruthy:i,toBeNull:a,toBeNaN:s,toBeUndefined:o,changed:l,changedTimes:u,get not(){return Me(e,!t)}}}function Ne(e){return Me(e)}function Pe(e){let t=ye(e);return t?.$el??t}var Fe=be?window:void 0;function Ie(...e){let t,n,r,i;if(typeof e[0]==`string`||Array.isArray(e[0])?([n,r,i]=e,t=Fe):[t,n,r,i]=e,!t)return we;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);let a=[],o=()=>{a.forEach(e=>e()),a.length=0},s=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),c=w(()=>[Pe(t),ye(i)],([e,t])=>{if(o(),!e)return;let i=Ce(t)?{...t}:t;a.push(...n.flatMap(t=>r.map(n=>s(e,t,n,i))))},{immediate:!0,flush:`post`}),l=()=>{c(),o()};return ve(l),l}function Le(e){return typeof e==`function`?e:typeof e==`string`?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function Re(...e){let t,n,r={};e.length===3?(t=e[0],n=e[1],r=e[2]):e.length===2?typeof e[1]==`object`?(t=!0,n=e[0],r=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);let{target:i=Fe,eventName:a=`keydown`,passive:o=!1,dedupe:s=!1}=r,c=Le(t);return Ie(i,a,e=>{e.repeat&&ye(s)||c(e)&&n(e)},o)}function ze(e){return JSON.parse(JSON.stringify(e))}function Be(e,t,n,r={}){let{clone:i=!1,passive:a=!1,eventName:s,deep:c=!1,defaultValue:l,shouldEmit:u}=r,d=x(),f=n||d?.emit||(d?.$emit)?.bind(d)||(d?.proxy?.$emit)?.bind(d?.proxy),p=s;t||=`modelValue`,p||=`update:${t.toString()}`;let m=e=>i?typeof i==`function`?i(e):ze(e):e,h=()=>xe(e[t])?m(e[t]):l,g=e=>{u?u(e)&&f(p,e):f(p,e)};if(a){let n=h(),r=z(n),i=!1;return w(()=>e[t],e=>{i||(i=!0,r.value=m(e),o(()=>i=!1))}),w(r,n=>{!i&&(n!==e[t]||c)&&g(n)},{deep:c}),r}return R({get(){return h()},set(e){g(e)}})}var Ve={value:()=>{}};function He(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new Ue(n)}function Ue(e){this._=e}function We(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}Ue.prototype=He.prototype={constructor:Ue,on:function(e,t){var n=this._,r=We(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=Ge(n[i],e.name)))return i}else{if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=Ke(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Ke(n[i],e.name,null);return this}},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ue(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function Ge(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Ke(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Ve,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var qe=`http://www.w3.org/1999/xhtml`,Je={svg:`http://www.w3.org/2000/svg`,xhtml:qe,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function Ye(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),Je.hasOwnProperty(t)?{space:Je[t],local:e}:e}function Xe(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===qe&&t.documentElement.namespaceURI===qe?t.createElement(e):t.createElementNS(n,e)}}function Ze(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Qe(e){var t=Ye(e);return(t.local?Ze:Xe)(t)}function $e(){}function et(e){return e==null?$e:function(){return this.querySelector(e)}}function tt(e){typeof e!=`function`&&(e=et(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new Wn(r,this._parents)}function nt(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function rt(){return[]}function it(e){return e==null?rt:function(){return this.querySelectorAll(e)}}function at(e){return function(){return nt(e.apply(this,arguments))}}function ot(e){e=typeof e==`function`?at(e):it(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new Wn(r,i)}function st(e){return function(){return this.matches(e)}}function ct(e){return function(t){return t.matches(e)}}var lt=Array.prototype.find;function ut(e){return function(){return lt.call(this.children,e)}}function dt(){return this.firstElementChild}function ft(e){return this.select(e==null?dt:ut(typeof e==`function`?e:ct(e)))}var pt=Array.prototype.filter;function mt(){return Array.from(this.children)}function ht(e){return function(){return pt.call(this.children,e)}}function gt(e){return this.selectAll(e==null?mt:ht(typeof e==`function`?e:ct(e)))}function _t(e){typeof e!=`function`&&(e=st(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Wn(r,this._parents)}function vt(e){return Array(e.length)}function yt(){return new Wn(this._enter||this._groups.map(vt),this._parents)}function bt(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}bt.prototype={constructor:bt,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function xt(e){return function(){return e}}function St(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new bt(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function Ct(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new bt(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function wt(e){return e.__data__}function Tt(e,t){if(!arguments.length)return Array.from(this,wt);var n=t?Ct:St,r=this._parents,i=this._groups;typeof e!=`function`&&(e=xt(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=Et(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new Wn(o,r),o._enter=s,o._exit=c,o}function Et(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Dt(){return new Wn(this._exit||this._groups.map(vt),this._parents)}function Ot(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function kt(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new Wn(s,this._parents)}function At(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function jt(e){e||=Mt;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new Wn(i,this._parents).order()}function Mt(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Nt(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Pt(){return Array.from(this)}function Ft(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function It(){let e=0;for(let t of this)++e;return e}function Lt(){return!this.node()}function Rt(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function zt(e){return function(){this.removeAttribute(e)}}function Bt(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Vt(e,t){return function(){this.setAttribute(e,t)}}function Ht(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Ut(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Wt(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Gt(e,t){var n=Ye(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Bt:zt:typeof t==`function`?n.local?Wt:Ut:n.local?Ht:Vt)(n,t))}function Kt(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function qt(e){return function(){this.style.removeProperty(e)}}function Jt(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Yt(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Xt(e,t,n){return arguments.length>1?this.each((t==null?qt:typeof t==`function`?Yt:Jt)(e,t,n??``)):Zt(this.node(),e)}function Zt(e,t){return e.style.getPropertyValue(t)||Kt(e).getComputedStyle(e,null).getPropertyValue(t)}function Qt(e){return function(){delete this[e]}}function $t(e,t){return function(){this[e]=t}}function en(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function tn(e,t){return arguments.length>1?this.each((t==null?Qt:typeof t==`function`?en:$t)(e,t)):this.node()[e]}function nn(e){return e.trim().split(/^|\s+/)}function rn(e){return e.classList||new an(e)}function an(e){this._node=e,this._names=nn(e.getAttribute(`class`)||``)}an.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function on(e,t){for(var n=rn(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function sn(e,t){for(var n=rn(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function cn(e){return function(){on(this,e)}}function ln(e){return function(){sn(this,e)}}function un(e,t){return function(){(t.apply(this,arguments)?on:sn)(this,e)}}function dn(e,t){var n=nn(e+``);if(arguments.length<2){for(var r=rn(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?un:t?cn:ln)(n,t))}function fn(){this.textContent=``}function pn(e){return function(){this.textContent=e}}function mn(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function hn(e){return arguments.length?this.each(e==null?fn:(typeof e==`function`?mn:pn)(e)):this.node().textContent}function gn(){this.innerHTML=``}function _n(e){return function(){this.innerHTML=e}}function vn(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function yn(e){return arguments.length?this.each(e==null?gn:(typeof e==`function`?vn:_n)(e)):this.node().innerHTML}function bn(){this.nextSibling&&this.parentNode.appendChild(this)}function xn(){return this.each(bn)}function Sn(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Cn(){return this.each(Sn)}function wn(e){var t=typeof e==`function`?e:Qe(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Tn(){return null}function En(e,t){var n=typeof e==`function`?e:Qe(e),r=t==null?Tn:typeof t==`function`?t:et(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Dn(){var e=this.parentNode;e&&e.removeChild(this)}function On(){return this.each(Dn)}function kn(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function An(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function jn(e){return this.select(e?An:kn)}function Mn(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function Nn(e){return function(t){e.call(this,t,this.__data__)}}function Pn(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function Fn(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function In(e,t,n){return function(){var r=this.__on,i,a=Nn(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function Ln(e,t,n){var r=Pn(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}}else{for(s=t?In:Fn,i=0;i<a;++i)this.each(s(r[i],t,n));return this}}function Rn(e,t,n){var r=Kt(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function zn(e,t){return function(){return Rn(this,e,t)}}function Bn(e,t){return function(){return Rn(this,e,t.apply(this,arguments))}}function Vn(e,t){return this.each((typeof t==`function`?Bn:zn)(e,t))}function*Hn(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var Un=[null];function Wn(e,t){this._groups=e,this._parents=t}function Gn(){return new Wn([[document.documentElement]],Un)}function Kn(){return this}Wn.prototype=Gn.prototype={constructor:Wn,select:tt,selectAll:ot,selectChild:ft,selectChildren:gt,filter:_t,data:Tt,enter:yt,exit:Dt,join:Ot,merge:kt,selection:Kn,order:At,sort:jt,call:Nt,nodes:Pt,node:Ft,size:It,empty:Lt,each:Rt,attr:Gt,style:Xt,property:tn,classed:dn,text:hn,html:yn,raise:xn,lower:Cn,append:wn,insert:En,remove:On,clone:jn,datum:Mn,on:Ln,dispatch:Vn,[Symbol.iterator]:Hn};function qn(e){return typeof e==`string`?new Wn([[document.querySelector(e)]],[document.documentElement]):new Wn([[e]],Un)}function Jn(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Yn(e,t){if(e=Jn(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var Xn={passive:!1},Zn={capture:!0,passive:!1};function Qn(e){e.stopImmediatePropagation()}function $n(e){e.preventDefault(),e.stopImmediatePropagation()}function er(e){var t=e.document.documentElement,n=qn(e).on(`dragstart.drag`,$n,Zn);`onselectstart`in t?n.on(`selectstart.drag`,$n,Zn):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function tr(e,t){var n=e.document.documentElement,r=qn(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,$n,Zn),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var nr=e=>()=>e;function rr(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}rr.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function ir(e){return!e.ctrlKey&&!e.button}function ar(){return this.parentNode}function or(e,t){return t??{x:e.x,y:e.y}}function sr(){return navigator.maxTouchPoints||`ontouchstart`in this}function cr(){var e=ir,t=ar,n=or,r=sr,i={},a=He(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,Xn).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!u&&e.call(this,n,r)){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(qn(n.view).on(`mousemove.drag`,m,Zn).on(`mouseup.drag`,h,Zn),er(n.view),Qn(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if($n(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){qn(e.view).on(`mousemove.drag mouseup.drag`,null),tr(e.view,l),$n(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r))for(var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s=0,c;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(Qn(n),c(`start`,n,i[s]))}function _(e){for(var t=e.changedTouches,n=t.length,r=0,a;r<n;++r)(a=i[t[r].identifier])&&($n(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(Qn(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=Yn(l||r,t),p,m,h;if((h=n.call(e,new rr(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=Yn(l||a,t),_=o}u.call(r,e,new rr(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:nr(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:nr(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:nr(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:nr(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function lr(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function ur(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function dr(){}var fr=.7,pr=1/fr,mr=`\\s*([+-]?\\d+)\\s*`,hr=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,gr=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,_r=/^#([0-9a-f]{3,8})$/,vr=RegExp(`^rgb\\(${mr},${mr},${mr}\\)$`),yr=RegExp(`^rgb\\(${gr},${gr},${gr}\\)$`),br=RegExp(`^rgba\\(${mr},${mr},${mr},${hr}\\)$`),xr=RegExp(`^rgba\\(${gr},${gr},${gr},${hr}\\)$`),Sr=RegExp(`^hsl\\(${hr},${gr},${gr}\\)$`),Cr=RegExp(`^hsla\\(${hr},${gr},${gr},${hr}\\)$`),wr={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};lr(dr,kr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Tr,formatHex:Tr,formatHex8:Er,formatHsl:Dr,formatRgb:Or,toString:Or});function Tr(){return this.rgb().formatHex()}function Er(){return this.rgb().formatHex8()}function Dr(){return Hr(this).formatHsl()}function Or(){return this.rgb().formatRgb()}function kr(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=_r.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Ar(t):n===3?new Pr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?jr(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?jr(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=vr.exec(e))?new Pr(t[1],t[2],t[3],1):(t=yr.exec(e))?new Pr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=br.exec(e))?jr(t[1],t[2],t[3],t[4]):(t=xr.exec(e))?jr(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Sr.exec(e))?Vr(t[1],t[2]/100,t[3]/100,1):(t=Cr.exec(e))?Vr(t[1],t[2]/100,t[3]/100,t[4]):wr.hasOwnProperty(e)?Ar(wr[e]):e===`transparent`?new Pr(NaN,NaN,NaN,0):null}function Ar(e){return new Pr(e>>16&255,e>>8&255,e&255,1)}function jr(e,t,n,r){return r<=0&&(e=t=n=NaN),new Pr(e,t,n,r)}function Mr(e){return e instanceof dr||(e=kr(e)),e?(e=e.rgb(),new Pr(e.r,e.g,e.b,e.opacity)):new Pr}function Nr(e,t,n,r){return arguments.length===1?Mr(e):new Pr(e,t,n,r??1)}function Pr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}lr(Pr,Nr,ur(dr,{brighter(e){return e=e==null?pr:pr**+e,new Pr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?fr:fr**+e,new Pr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Pr(zr(this.r),zr(this.g),zr(this.b),Rr(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Fr,formatHex:Fr,formatHex8:Ir,formatRgb:Lr,toString:Lr}));function Fr(){return`#${Br(this.r)}${Br(this.g)}${Br(this.b)}`}function Ir(){return`#${Br(this.r)}${Br(this.g)}${Br(this.b)}${Br((isNaN(this.opacity)?1:this.opacity)*255)}`}function Lr(){let e=Rr(this.opacity);return`${e===1?`rgb(`:`rgba(`}${zr(this.r)}, ${zr(this.g)}, ${zr(this.b)}${e===1?`)`:`, ${e})`}`}function Rr(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function zr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Br(e){return e=zr(e),(e<16?`0`:``)+e.toString(16)}function Vr(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Wr(e,t,n,r)}function Hr(e){if(e instanceof Wr)return new Wr(e.h,e.s,e.l,e.opacity);if(e instanceof dr||(e=kr(e)),!e)return new Wr;if(e instanceof Wr)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new Wr(o,s,c,e.opacity)}function Ur(e,t,n,r){return arguments.length===1?Hr(e):new Wr(e,t,n,r??1)}function Wr(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}lr(Wr,Ur,ur(dr,{brighter(e){return e=e==null?pr:pr**+e,new Wr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?fr:fr**+e,new Wr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Pr(qr(e>=240?e-240:e+120,i,r),qr(e,i,r),qr(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Wr(Gr(this.h),Kr(this.s),Kr(this.l),Rr(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=Rr(this.opacity);return`${e===1?`hsl(`:`hsla(`}${Gr(this.h)}, ${Kr(this.s)*100}%, ${Kr(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function Gr(e){return e=(e||0)%360,e<0?e+360:e}function Kr(e){return Math.max(0,Math.min(1,e||0))}function qr(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var Jr=e=>()=>e;function Yr(e,t){return function(n){return e+n*t}}function Xr(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Zr(e){return(e=+e)==1?Qr:function(t,n){return n-t?Xr(t,n,e):Jr(isNaN(t)?n:t)}}function Qr(e,t){var n=t-e;return n?Yr(e,n):Jr(isNaN(e)?t:e)}var $r=function e(t){var n=Zr(t);function r(e,t){var r=n((e=Nr(e)).r,(t=Nr(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Qr(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r}(1);function ei(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function ti(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function ni(e,t){for(var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o=0;o<r;++o)i[o]=di(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function ri(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function ii(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function ai(e,t){var n={},r={},i;for(i in typeof e==`object`&&e||(e={}),typeof t==`object`&&t||(t={}),t)i in e?n[i]=di(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var oi=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,si=new RegExp(oi.source,`g`);function ci(e){return function(){return e}}function li(e){return function(t){return e(t)+``}}function ui(e,t){var n=oi.lastIndex=si.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=oi.exec(e))&&(i=si.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:ii(r,i)})),n=si.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?li(c[0].x):ci(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function di(e,t){var n=typeof t,r;return t==null||n===`boolean`?Jr(t):(n===`number`?ii:n===`string`?(r=kr(t))?(t=r,$r):ui:t instanceof kr?$r:t instanceof Date?ri:ti(t)?ei:Array.isArray(t)?ni:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?ai:ii)(e,t)}var fi=180/Math.PI,pi={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function mi(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*fi,skewX:Math.atan(c)*fi,scaleX:o,scaleY:s}}var hi;function gi(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?pi:mi(t.a,t.b,t.c,t.d,t.e,t.f)}function _i(e){return e==null||(hi||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),hi.setAttribute(`transform`,e),!(e=hi.transform.baseVal.consolidate()))?pi:(e=e.matrix,mi(e.a,e.b,e.c,e.d,e.e,e.f))}function vi(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:ii(e,i)},{i:c-2,x:ii(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:ii(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:ii(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:ii(e,n)},{i:s-2,x:ii(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var yi=vi(gi,`px, `,`px)`,`deg)`),bi=vi(_i,`, `,`)`,`)`),xi=1e-12;function Si(e){return((e=Math.exp(e))+1/e)/2}function Ci(e){return((e=Math.exp(e))-1/e)/2}function wi(e){return((e=Math.exp(2*e))-1)/(e+1)}var Ti=function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<xi)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=Si(y),c=s/(n*g)*(i*wi(t*r+y)-Ci(y));return[a+c*d,o+c*f,s*i/Si(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i}(Math.SQRT2,2,4),Ei=0,Di=0,Oi=0,ki=1e3,Ai,ji,Mi=0,Ni=0,Pi=0,Fi=typeof performance==`object`&&performance.now?performance:Date,Ii=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Li(){return Ni||=(Ii(Ri),Fi.now()+Pi)}function Ri(){Ni=0}function zi(){this._call=this._time=this._next=null}zi.prototype=Bi.prototype={constructor:zi,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?Li():+n)+(t==null?0:+t),!this._next&&ji!==this&&(ji?ji._next=this:Ai=this,ji=this),this._call=e,this._time=n,Gi()},stop:function(){this._call&&(this._call=null,this._time=1/0,Gi())}};function Bi(e,t,n){var r=new zi;return r.restart(e,t,n),r}function Vi(){Li(),++Ei;for(var e=Ai,t;e;)(t=Ni-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ei}function Hi(){Ni=(Mi=Fi.now())+Pi,Ei=Di=0;try{Vi()}finally{Ei=0,Wi(),Ni=0}}function Ui(){var e=Fi.now(),t=e-Mi;t>ki&&(Pi-=t,Mi=e)}function Wi(){for(var e,t=Ai,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Ai=n);ji=e,Gi(r)}function Gi(e){Ei||(Di&&=clearTimeout(Di),e-Ni>24?(e<1/0&&(Di=setTimeout(Hi,e-Fi.now()-Pi)),Oi&&=clearInterval(Oi)):(Oi||=(Mi=Fi.now(),setInterval(Ui,ki)),Ei=1,Ii(Hi)))}function Ki(e,t,n){var r=new zi;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var qi=He(`start`,`end`,`cancel`,`interrupt`),Ji=[],Yi=0,Xi=1,Zi=2,Qi=3,$i=4,ea=5,ta=6;function na(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;oa(e,n,{name:t,index:r,group:i,on:qi,tween:Ji,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:Yi})}function ra(e,t){var n=aa(e,t);if(n.state>Yi)throw Error(`too late; already scheduled`);return n}function ia(e,t){var n=aa(e,t);if(n.state>Qi)throw Error(`too late; already running`);return n}function aa(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function oa(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Bi(a,0,n.time);function a(e){n.state=Xi,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==Xi)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===Qi)return Ki(o);f.state===$i?(f.state=ta,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=ta,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(Ki(function(){n.state===Qi&&(n.state=$i,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=Zi,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===Zi){for(n.state=Qi,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=ea,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===ea&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=ta,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function sa(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n)(r=n[o]).name===t?(i=r.state>Zi&&r.state<ea,r.state=ta,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]):a=!1;a&&delete e.__transition}}function ca(e){return this.each(function(){sa(this,e)})}function la(e,t){var n,r;return function(){var i=ia(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function ua(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=ia(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function da(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=aa(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?la:ua)(n,e,t))}function fa(e,t,n){var r=e._id;return e.each(function(){var e=ia(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return aa(e,r).value[t]}}function pa(e,t){var n;return(typeof t==`number`?ii:t instanceof kr?$r:(n=kr(t))?(t=n,$r):ui)(e,t)}function ma(e){return function(){this.removeAttribute(e)}}function ha(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ga(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function _a(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function va(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function ya(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function ba(e,t){var n=Ye(e),r=n===`transform`?bi:pa;return this.attrTween(e,typeof t==`function`?(n.local?ya:va)(n,r,fa(this,`attr.`+e,t)):t==null?(n.local?ha:ma)(n):(n.local?_a:ga)(n,r,t))}function xa(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Sa(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Ca(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Sa(e,i)),n}return i._value=t,i}function wa(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&xa(e,i)),n}return i._value=t,i}function Ta(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=Ye(e);return this.tween(n,(r.local?Ca:wa)(r,t))}function Ea(e,t){return function(){ra(this,e).delay=+t.apply(this,arguments)}}function Da(e,t){return t=+t,function(){ra(this,e).delay=t}}function Oa(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?Ea:Da)(t,e)):aa(this.node(),t).delay}function ka(e,t){return function(){ia(this,e).duration=+t.apply(this,arguments)}}function Aa(e,t){return t=+t,function(){ia(this,e).duration=t}}function ja(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?ka:Aa)(t,e)):aa(this.node(),t).duration}function Ma(e,t){if(typeof t!=`function`)throw Error();return function(){ia(this,e).ease=t}}function Na(e){var t=this._id;return arguments.length?this.each(Ma(t,e)):aa(this.node(),t).ease}function Pa(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();ia(this,e).ease=n}}function Fa(e){if(typeof e!=`function`)throw Error();return this.each(Pa(this._id,e))}function Ia(e){typeof e!=`function`&&(e=st(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new fo(r,this._parents,this._name,this._id)}function La(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new fo(o,this._parents,this._name,this._id)}function Ra(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function za(e,t,n){var r,i,a=Ra(t)?ra:ia;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function Ba(e,t){var n=this._id;return arguments.length<2?aa(this.node(),n).on.on(e):this.each(za(n,e,t))}function Va(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Ha(){return this.on(`end.remove`,Va(this._id))}function Ua(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=et(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,na(l[f],t,n,f,l,aa(u,n)));return new fo(a,this._parents,t,n)}function Wa(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=it(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=aa(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&na(p,t,n,h,f,m);a.push(f),o.push(u)}return new fo(a,o,t,n)}var Ga=Gn.prototype.constructor;function Ka(){return new Ga(this._groups,this._parents)}function qa(e,t){var n,r,i;return function(){var a=Zt(this,e),o=(this.style.removeProperty(e),Zt(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function Ja(e){return function(){this.style.removeProperty(e)}}function Ya(e,t,n){var r,i=n+``,a;return function(){var o=Zt(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function Xa(e,t,n){var r,i,a;return function(){var o=Zt(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),Zt(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function Za(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=ia(this,e),l=c.on,u=c.value[a]==null?s||=Ja(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function Qa(e,t,n){var r=(e+=``)==`transform`?yi:pa;return t==null?this.styleTween(e,qa(e,r)).on(`end.style.`+e,Ja(e)):typeof t==`function`?this.styleTween(e,Xa(e,r,fa(this,`style.`+e,t))).each(Za(this._id,e)):this.styleTween(e,Ya(e,r,t),n).on(`end.style.`+e,null)}function $a(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function eo(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&$a(e,a,n)),r}return a._value=t,a}function to(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,eo(e,t,n??``))}function no(e){return function(){this.textContent=e}}function ro(e){return function(){var t=e(this);this.textContent=t??``}}function io(e){return this.tween(`text`,typeof e==`function`?ro(fa(this,`text`,e)):no(e==null?``:e+``))}function ao(e){return function(t){this.textContent=e.call(this,t)}}function oo(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&ao(r)),t}return r._value=e,r}function so(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,oo(e))}function co(){for(var e=this._name,t=this._id,n=po(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=aa(c,t);na(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new fo(r,this._parents,e,n)}function lo(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=ia(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var uo=0;function fo(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function po(){return++uo}var mo=Gn.prototype;fo.prototype={constructor:fo,select:Ua,selectAll:Wa,selectChild:mo.selectChild,selectChildren:mo.selectChildren,filter:Ia,merge:La,selection:Ka,transition:co,call:mo.call,nodes:mo.nodes,node:mo.node,size:mo.size,empty:mo.empty,each:mo.each,on:Ba,attr:ba,attrTween:Ta,style:Qa,styleTween:to,text:io,textTween:so,remove:Ha,tween:da,delay:Oa,duration:ja,ease:Na,easeVarying:Fa,end:lo,[Symbol.iterator]:mo[Symbol.iterator]};function ho(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var go={time:null,delay:0,duration:250,ease:ho};function _o(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function vo(e){var t,n;e instanceof fo?(t=e._id,e=e._name):(t=po(),(n=go).time=Li(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&na(c,e,t,l,o,n||_o(c,t));return new fo(r,this._parents,e,t)}Gn.prototype.interrupt=ca,Gn.prototype.transition=vo;var yo=e=>()=>e;function bo(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function xo(e,t,n){this.k=e,this.x=t,this.y=n}xo.prototype={constructor:xo,scale:function(e){return e===1?this:new xo(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new xo(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var So=new xo(1,0,0);xo.prototype;function Co(e){e.stopImmediatePropagation()}function wo(e){e.preventDefault(),e.stopImmediatePropagation()}function To(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function Eo(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Do(){return this.__zoom||So}function Oo(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function ko(){return navigator.maxTouchPoints||`ontouchstart`in this}function Ao(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function jo(){var e=To,t=Eo,n=Ao,r=Oo,i=ko,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=Ti,l=He(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,Do).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,Do),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(So.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new xo(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new xo(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new xo(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=qn(this.that).datum();l.call(e,this.that,new bo(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=Yn(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],sa(this),s.start();wo(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=qn(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=Yn(t,i),l=t.clientX,u=t.clientY;er(t.view),Co(t),a.mouse=[c,this.__zoom.invert(c)],sa(this),a.start();function d(e){if(wo(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=Yn(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),tr(e.view,a.moved),wo(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=Yn(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);wo(r),s>0?qn(this).transition().duration(s).call(x,d,c,r):qn(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(Co(t),s=0;s<i;++s)c=r[s],l=Yn(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),sa(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(wo(e),s=0;s<a;++s)c=i[s],l=Yn(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(Co(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=Yn(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=qn(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:yo(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:yo(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:yo(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:yo([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var X=(e=>(e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`,e))(X||{}),Mo=(e=>(e.Partial=`partial`,e.Full=`full`,e))(Mo||{}),No=(e=>(e.Bezier=`default`,e.SimpleBezier=`simple-bezier`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e))(No||{}),Po=(e=>(e.Strict=`strict`,e.Loose=`loose`,e))(Po||{}),Fo=(e=>(e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`,e))(Fo||{}),Io=(e=>(e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`,e))(Io||{}),Lo=(e=>(e.TopLeft=`top-left`,e.TopCenter=`top-center`,e.TopRight=`top-right`,e.BottomLeft=`bottom-left`,e.BottomCenter=`bottom-center`,e.BottomRight=`bottom-right`,e))(Lo||{}),Ro=[`INPUT`,`SELECT`,`TEXTAREA`],zo=typeof document<`u`?document:null;function Bo(e){let t=e.composedPath?.call(e)?.[0]||e.target,n=typeof t?.hasAttribute==`function`&&t.hasAttribute(`contenteditable`),r=typeof t?.closest==`function`?t.closest(`.nokey`):null;return Ro.includes(t?.nodeName)||n||!!r}function Vo(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function Ho(e,t,n,r){let i=t.replace(`+`,`
|
|
3
3
|
`).replace(`
|
|
4
4
|
|
|
5
5
|
`,`
|