@intent-hq/web 2.324.0 → 2.324.1
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/package.json +1 -1
- package/web/app/immutable/chunks/{DkRyrpgd.js → 1eEcuHcS.js} +1 -1
- package/web/app/immutable/chunks/{dwOMHvst.js → 5S1qZlDD.js} +1 -1
- package/web/app/immutable/chunks/{BAS_DDrx.js → 6jrMk-C_.js} +1 -1
- package/web/app/immutable/chunks/{Dwl1U2Yv.js → 9SNY3EB9.js} +4 -4
- package/web/app/immutable/chunks/{Bv1YyxXs.js → 9mLk0Km9.js} +1 -1
- package/web/app/immutable/chunks/{D46Exibl.js → AN-5WX_c.js} +1 -1
- package/web/app/immutable/chunks/{DRFk8D8j.js → ATTw52No.js} +1 -1
- package/web/app/immutable/chunks/{rj-wRFR4.js → B-bq_ltD.js} +1 -1
- package/web/app/immutable/chunks/{Dw06QZ5K.js → B3SAbaUw.js} +1 -1
- package/web/app/immutable/chunks/{ZA2c_UV4.js → B4n_mdRo.js} +1 -1
- package/web/app/immutable/chunks/{kiCqsadm.js → BBAtPQBU.js} +1 -1
- package/web/app/immutable/chunks/{BiBHrbag.js → BBwPWV3o.js} +1 -1
- package/web/app/immutable/chunks/{lLIg9v9q.js → BDxgTj-Q.js} +1 -1
- package/web/app/immutable/chunks/{BQX6MpDU.js → BEWcSK-Z.js} +1 -1
- package/web/app/immutable/chunks/{gH9F0r3o.js → BFJrCHJ7.js} +1 -1
- package/web/app/immutable/chunks/{XeqQww8o.js → BHdlOQ18.js} +1 -1
- package/web/app/immutable/chunks/{-nhZ0nNk.js → BM9EAgHn.js} +1 -1
- package/web/app/immutable/chunks/{guvVB0-Q.js → BRVXCoHC.js} +1 -1
- package/web/app/immutable/chunks/{BXOh3iG1.js → BSkOEBtu.js} +1 -1
- package/web/app/immutable/chunks/{C73nd7h_.js → BYGvqRLs.js} +1 -1
- package/web/app/immutable/chunks/{B6hBcFly.js → B_aA47Rw.js} +1 -1
- package/web/app/immutable/chunks/{B-DqAnQ_.js → BaG-bb51.js} +2 -2
- package/web/app/immutable/chunks/{kN-pIg8U.js → BaN8MLaG.js} +1 -1
- package/web/app/immutable/chunks/{CHM9bwh2.js → BbuD6IF7.js} +1 -1
- package/web/app/immutable/chunks/{DCNtfwQI.js → BcIgCIVI.js} +1 -1
- package/web/app/immutable/chunks/{DS1K8giL.js → Blf_XS6o.js} +1 -1
- package/web/app/immutable/chunks/{Ddbm9CO3.js → Bmnfh3k3.js} +1 -1
- package/web/app/immutable/chunks/{ff5GWvuF.js → Bn4g8i34.js} +2 -2
- package/web/app/immutable/chunks/{BWxEfTfw.js → BpOTSlYU.js} +1 -1
- package/web/app/immutable/chunks/{CZdzzv7j.js → BpjBZaBN.js} +1 -1
- package/web/app/immutable/chunks/{DMqRI5mB.js → BrRq5glY.js} +1 -1
- package/web/app/immutable/chunks/{D6hXPuoQ.js → BrzHeDFL.js} +1 -1
- package/web/app/immutable/chunks/{BNpoIpK3.js → BuwOUSye.js} +1 -1
- package/web/app/immutable/chunks/{CwS-VFDa.js → Bv6BpGqB.js} +1 -1
- package/web/app/immutable/chunks/{BbJPpmJZ.js → BvehcAMH.js} +1 -1
- package/web/app/immutable/chunks/{BeFuCoSp.js → By_08IiR.js} +1 -1
- package/web/app/immutable/chunks/{4Co7oa1E.js → BzCZ0ySt.js} +1 -1
- package/web/app/immutable/chunks/{DYTaPFba.js → BzXYaZ27.js} +1 -1
- package/web/app/immutable/chunks/{BRjsxYDA.js → C-vFw5fg.js} +1 -1
- package/web/app/immutable/chunks/{IADOsM4I.js → C2JrJu0l.js} +1 -1
- package/web/app/immutable/chunks/{ChVRTdkj.js → C623z706.js} +2 -2
- package/web/app/immutable/chunks/{CwXihZzq.js → CCL1cHzZ.js} +1 -1
- package/web/app/immutable/chunks/{CQOPGB8W.js → CGeCOc38.js} +6 -6
- package/web/app/immutable/chunks/{xsyU0p2l.js → CGsrGQFv.js} +1 -1
- package/web/app/immutable/chunks/{CLC_EHyS.js → CHo0aT92.js} +2 -2
- package/web/app/immutable/chunks/{MCTJzu4E.js → CJ6mN5w4.js} +1 -1
- package/web/app/immutable/chunks/{9KkuRhnb.js → CJ9f1bCH.js} +1 -1
- package/web/app/immutable/chunks/{DC6ub8r4.js → CJJqYdTW.js} +1 -1
- package/web/app/immutable/chunks/{nJbYCzDf.js → CJeBMely.js} +1 -1
- package/web/app/immutable/chunks/{DkOappis.js → CJysbhf8.js} +1 -1
- package/web/app/immutable/chunks/{CFbpAAIH.js → CLRygoXX.js} +1 -1
- package/web/app/immutable/chunks/{C6j5ZNGg.js → CMYoNgeG.js} +1 -1
- package/web/app/immutable/chunks/{BKDHfRWh.js → CTNWfj01.js} +1 -1
- package/web/app/immutable/chunks/{CsWXL2nx.js → CTinGOMk.js} +1 -1
- package/web/app/immutable/chunks/{dUPFEVFf.js → CUlORLHD.js} +1 -1
- package/web/app/immutable/chunks/{DN8Bt6h5.js → CZYU-h5D.js} +1 -1
- package/web/app/immutable/chunks/{KcpuhlLy.js → CZjhyecI.js} +1 -1
- package/web/app/immutable/chunks/{yeZ43yxT.js → C_fhG6YK.js} +1 -1
- package/web/app/immutable/chunks/{Lxp0_8bR.js → CaDLa-o_.js} +1 -1
- package/web/app/immutable/chunks/{CeBMwYHT.js → CcATeaI9.js} +1 -1
- package/web/app/immutable/chunks/{CQyOHx6M.js → CdjyXCOH.js} +1 -1
- package/web/app/immutable/chunks/{DGL0v2_K.js → CfMQKf-j.js} +3 -3
- package/web/app/immutable/chunks/{CLw4HONO.js → CgUN6u-_.js} +1 -1
- package/web/app/immutable/chunks/{BhJHuPsV.js → Ch1eKq6l.js} +1 -1
- package/web/app/immutable/chunks/{B936R10a.js → ChhBfFca.js} +1 -1
- package/web/app/immutable/chunks/{Cjn6Una6.js → CigKENF5.js} +1 -1
- package/web/app/immutable/chunks/{C1maZVRS.js → CijDx9m6.js} +1 -1
- package/web/app/immutable/chunks/{pKEFLYyh.js → Cjg2jz_a.js} +1 -1
- package/web/app/immutable/chunks/{BpRe43-R.js → CkZbc2gD.js} +1 -1
- package/web/app/immutable/chunks/{BVfskea1.js → Ckz2jIHD.js} +1 -1
- package/web/app/immutable/chunks/{Dp4_L-mJ.js → ClaYICeR.js} +1 -1
- package/web/app/immutable/chunks/{CGJ9VzuP.js → CqIDDFDI.js} +1 -1
- package/web/app/immutable/chunks/{DUVnloFh.js → CuSAboZj.js} +1 -1
- package/web/app/immutable/chunks/{DQ6Y9dnn.js → D2lAsIeu.js} +1 -1
- package/web/app/immutable/chunks/{CpbsOacb.js → D3AcDR3o.js} +1 -1
- package/web/app/immutable/chunks/{BeMvgNvQ.js → D532ard4.js} +1 -1
- package/web/app/immutable/chunks/{DkQJFeTP.js → D6Ce7f2V.js} +2 -2
- package/web/app/immutable/chunks/{D57Ppo5L.js → D75IkkXv.js} +3 -3
- package/web/app/immutable/chunks/{Brd4CWXk.js → D7RDVSQr.js} +1 -1
- package/web/app/immutable/chunks/{BnEz7hpf.js → DHMy5FAq.js} +1 -1
- package/web/app/immutable/chunks/{BZjn_N94.js → DJCg-7KJ.js} +1 -1
- package/web/app/immutable/chunks/{Dsn_oUBL.js → DQC_mrNT.js} +1 -1
- package/web/app/immutable/chunks/{CRU2Ic4N.js → DQ_wgZoU.js} +3 -3
- package/web/app/immutable/chunks/{DnOAMlHx.js → DS4soA_f.js} +1 -1
- package/web/app/immutable/chunks/{z8GMbNej.js → DSlctBp2.js} +1 -1
- package/web/app/immutable/chunks/{D9l5OW3n.js → DTVPZt77.js} +1 -1
- package/web/app/immutable/chunks/{D0cFLlyl.js → DW8qqj88.js} +1 -1
- package/web/app/immutable/chunks/{BffXhPh0.js → DXsf6BJU.js} +1 -1
- package/web/app/immutable/chunks/{DsXgwl6C.js → D_NiIEQ6.js} +1 -1
- package/web/app/immutable/chunks/{D_Wkw7kr.js → Dc4zROVy.js} +4 -4
- package/web/app/immutable/chunks/{B0atVUKu.js → DeTs9jD5.js} +4 -4
- package/web/app/immutable/chunks/{nTVNhk4O.js → DgErwCEB.js} +1 -1
- package/web/app/immutable/chunks/{U8xWziLC.js → DjR5RZok.js} +3 -3
- package/web/app/immutable/chunks/{mpNBLC-M.js → DjsJtwwu.js} +1 -1
- package/web/app/immutable/chunks/{DnLsVCn0.js → DkezX7YW.js} +1 -1
- package/web/app/immutable/chunks/{QOF44Ax5.js → DlrPlPdU.js} +1 -1
- package/web/app/immutable/chunks/{DUK_WcWP.js → DmISwPRv.js} +4 -4
- package/web/app/immutable/chunks/{C-XAWPZ7.js → Dqz0GoEb.js} +1 -1
- package/web/app/immutable/chunks/{CH1XTxaS.js → DrUxg-Y7.js} +1 -1
- package/web/app/immutable/chunks/{Bjmlr17E.js → Ds8Q4xhB.js} +1 -1
- package/web/app/immutable/chunks/{DBTfX6rI.js → DsKrfPLi.js} +1 -1
- package/web/app/immutable/chunks/{DBmpoctk.js → DwO1y83i.js} +2 -2
- package/web/app/immutable/chunks/{DBhplgvj.js → DxNDvhDP.js} +1 -1
- package/web/app/immutable/chunks/{BXVNQtRc.js → Dy7u_TIm.js} +12 -12
- package/web/app/immutable/chunks/{Bp706RE4.js → Dzdq4O56.js} +1 -1
- package/web/app/immutable/chunks/{DPWsPeoA.js → JWiMpes2.js} +1 -1
- package/web/app/immutable/chunks/{Ci2Gifly.js → O1bAo7yo.js} +1 -1
- package/web/app/immutable/chunks/{CKrwXssS.js → PpwMLCep.js} +1 -1
- package/web/app/immutable/chunks/{BSD9VMOV.js → RSDIM4gD.js} +1 -1
- package/web/app/immutable/chunks/{Bnm7ygQV.js → RYhI8dYv.js} +1 -1
- package/web/app/immutable/chunks/{bRXMRmdl.js → SlxMd164.js} +2 -2
- package/web/app/immutable/chunks/{C-Y7-zdK.js → VXZwYyoB.js} +2 -2
- package/web/app/immutable/chunks/{toCIdgUz.js → _nQS1-Df.js} +1 -1
- package/web/app/immutable/chunks/{BrTciRFM.js → b08xwO0r.js} +1 -1
- package/web/app/immutable/chunks/{BsNePyuY.js → ghhvOz1y.js} +1 -1
- package/web/app/immutable/chunks/{C3TiZRkc.js → j0leTGhK.js} +1 -1
- package/web/app/immutable/chunks/{1f62sBkn.js → j1j9cU_K.js} +1 -1
- package/web/app/immutable/chunks/{cvvVus67.js → k6lXtlbO.js} +1 -1
- package/web/app/immutable/chunks/{CRqr6c7k.js → mAhKABz-.js} +1 -1
- package/web/app/immutable/chunks/{CfjgICqo.js → sYTqF3T1.js} +1 -1
- package/web/app/immutable/chunks/{Clcj0fwW.js → uqakVTxn.js} +3 -3
- package/web/app/immutable/chunks/{Bc2QIZ6t.js → xDi6FAPK.js} +1 -1
- package/web/app/immutable/chunks/{CASBM6UJ.js → xQKmWoYY.js} +1 -1
- package/web/app/immutable/entry/{app.Bc_1CKih.js → app.LbatBIRw.js} +2 -2
- package/web/app/immutable/entry/start.DTyCrHuH.js +1 -0
- package/web/app/immutable/nodes/{0.Da22RqTZ.js → 0.21ZdDYxW.js} +1 -1
- package/web/app/immutable/nodes/{1.C64Py_bd.js → 1.DX6wFID1.js} +1 -1
- package/web/app/immutable/nodes/{10.Fcw_jx1Y.js → 10.DdNSlx1G.js} +1 -1
- package/web/app/immutable/nodes/{14.CDmSmw_i.js → 14.4lx3m62g.js} +1 -1
- package/web/app/immutable/nodes/{17.C88kK0S3.js → 17.CZgoFvCc.js} +2 -2
- package/web/app/immutable/nodes/{2.DpEBmCCZ.js → 2.DieJaTIH.js} +4 -4
- package/web/app/immutable/nodes/{3.yMwaM28U.js → 3.B3SMgy_G.js} +1 -1
- package/web/app/immutable/nodes/{4.CGO7LYnU.js → 4.BFCur9Dx.js} +1 -1
- package/web/app/immutable/nodes/{5.O5xHx7D5.js → 5.BoGoB5Ro.js} +1 -1
- package/web/app/immutable/nodes/{6.Cc5CO6D3.js → 6.D6ZxB8ue.js} +1 -1
- package/web/app/immutable/nodes/{7.nX4FdCfv.js → 7.WRtV8iZu.js} +1 -1
- package/web/app/immutable/nodes/{8.CTXV-0qk.js → 8.0dbfCSYz.js} +4 -4
- package/web/app/immutable/nodes/{9.BauBy2np.js → 9.BmPzuZvn.js} +4 -4
- package/web/app/version.json +1 -1
- package/web/index.html +9 -9
- package/web/app/immutable/entry/start.C_E3N2hY.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as Mt}from"./
|
|
1
|
+
import{p as Mt}from"./Bv6BpGqB.js";import{aZ as Nt,U as zt,Y as Lt,b0 as Tt,V as Xt,a_ as At,b as u,a6 as Et,W as Yt,q as J,ay as Q,aX as It,B as Bt,r as Ft,X as V}from"./DeTs9jD5.js";import{p as Rt}from"./BzYnpYvA.js";var G=u((o,r)=>{const e=o<=1?o*100:o;if(e<0||e>100)throw new Error(`${r} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${o}`);return e},"toPercent"),X=u((o,r,e)=>({x:G(r,`${e} evolution`),y:G(o,`${e} visibility`)}),"toCoordinates"),K=u(o=>{if(o){if(o==="+<>")return"bidirectional";if(o==="+<")return"backward";if(o==="+>")return"forward"}},"getFlowFromPort"),Ot=u(o=>{if(!o?.startsWith("+"))return{};const e=/^\+'([^']*)'/.exec(o)?.[1];return o.includes("<>")?{flow:"bidirectional",label:e}:o.includes("<")?{flow:"backward",label:e}:o.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Wt=u((o,r)=>{if(Mt(o,r),o.size&&r.setSize(o.size.width,o.size.height),o.evolution){const e=o.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),h=o.evolution.stages.filter(a=>a.boundary!==void 0).map(a=>a.boundary);r.updateAxes({stages:e,stageBoundaries:h})}if(o.anchors.forEach(e=>{const h=X(e.visibility,e.evolution,`Anchor "${e.name}"`);r.addNode(e.name,e.name,h.x,h.y,"anchor")}),o.components.forEach(e=>{const h=X(e.visibility,e.evolution,`Component "${e.name}"`),a=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,w=e.decorator?.strategy;r.addNode(e.name,e.name,h.x,h.y,"component",a,d,e.inertia,w)}),o.notes.forEach(e=>{const h=X(e.visibility,e.evolution,`Note "${e.text}"`);r.addNote(e.text,h.x,h.y)}),o.pipelines.forEach(e=>{const h=r.getNode(e.parent);if(!h||typeof h.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const a=h.y;r.startPipeline(e.parent),e.components.forEach(d=>{const w=`${e.parent}_${d.name}`,C=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,R=G(d.evolution,`Pipeline component "${d.name}" evolution`);r.addNode(w,d.name,R,a,"pipeline-component",C,g),r.addPipelineComponent(e.parent,w)})}),o.links.forEach(e=>{const h=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let a=K(e.fromPort)??K(e.toPort);const{flow:d,label:w}=Ot(e.arrow);!a&&d&&(a=d);const C=e.linkLabel,g=w??C;r.addLink(r.resolveNodeId(e.from),r.resolveNodeId(e.to),h,g,a)}),o.evolves.forEach(e=>{const h=r.getNode(e.component);if(h?.y!==void 0){const a=G(e.target,`Evolve target for "${e.component}"`);r.addTrend(e.component,a,h.y)}}),o.annotations.length>0){const e=o.annotations[0],h=X(e.x,e.y,"Annotations box");r.setAnnotationsBox(h.x,h.y)}o.annotation.forEach(e=>{const h=X(e.x,e.y,`Annotation ${e.number}`);r.addAnnotation(e.number,[{x:h.x,y:h.y}],e.text)}),o.accelerators.forEach(e=>{const h=X(e.x,e.y,`Accelerator "${e.name}"`);r.addAccelerator(e.name,h.x,h.y)}),o.deaccelerators.forEach(e=>{const h=X(e.x,e.y,`Deaccelerator "${e.name}"`);r.addDeaccelerator(e.name,h.x,h.y)})},"populateDb"),tt={parser:{yy:void 0},parse:u(async o=>{const r=await Rt("wardley",o);Q.debug(r);const e=tt.parser?.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Wt(r,e)},"parse")},E,Dt=(E=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(r){const e=this.nodes.get(r.id)??{id:r.id,label:r.label},h={...e,...r,className:r.className??e.className,labelOffsetX:r.labelOffsetX??e.labelOffsetX,labelOffsetY:r.labelOffsetY??e.labelOffsetY};this.nodes.set(r.id,h)}addLink(r){this.links.push(r)}addTrend(r){this.trends.set(r.nodeId,r)}startPipeline(r){this.pipelines.set(r,{nodeId:r,componentIds:[]});const e=this.nodes.get(r);e&&(e.isPipelineParent=!0)}addPipelineComponent(r,e){const h=this.pipelines.get(r);h&&h.componentIds.push(e);const a=this.nodes.get(e);a&&(a.inPipeline=!0)}addAnnotation(r){this.annotations.push(r)}addNote(r){this.notes.push(r)}addAccelerator(r){this.accelerators.push(r)}addDeaccelerator(r){this.deaccelerators.push(r)}setAnnotationsBox(r,e){this.annotationsBox={x:r,y:e}}setAxes(r){this.axes={...this.axes,...r}}setSize(r,e){this.size={width:r,height:e}}getNode(r){return this.nodes.get(r)}resolveNodeId(r){if(this.nodes.has(r))return r;for(const[e,h]of this.nodes)if(h.label===r)return e;return r}build(){const r=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);r.push(e)}return{nodes:r,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},u(E,"WardleyBuilder"),E),k=new Dt;function et(){return V()["wardley-beta"]}u(et,"getConfig");function at(o,r,e,h,a,d,w,C,g){k.addNode({id:o,label:r,x:e,y:h,className:a,labelOffsetX:d,labelOffsetY:w,inertia:C,sourceStrategy:g})}u(at,"addNode");function rt(o,r,e=!1,h,a){k.addLink({source:o,target:r,dashed:e,label:h,flow:a})}u(rt,"addLink");function ot(o,r,e){k.addTrend({nodeId:o,targetX:r,targetY:e})}u(ot,"addTrend");function nt(o,r,e){k.addAnnotation({number:o,coordinates:r,text:e})}u(nt,"addAnnotation");function st(o,r,e){k.addNote({text:o,x:r,y:e})}u(st,"addNote");function it(o,r,e){k.addAccelerator({name:o,x:r,y:e})}u(it,"addAccelerator");function dt(o,r,e){k.addDeaccelerator({name:o,x:r,y:e})}u(dt,"addDeaccelerator");function lt(o,r){k.setAnnotationsBox(o,r)}u(lt,"setAnnotationsBox");function ct(o,r){k.setSize(o,r)}u(ct,"setSize");function pt(o){k.startPipeline(o)}u(pt,"startPipeline");function ft(o,r){k.addPipelineComponent(o,r)}u(ft,"addPipelineComponent");function ht(o){k.setAxes(o)}u(ht,"updateAxes");function xt(o){return k.getNode(o)}u(xt,"getNode");function gt(o){return k.resolveNodeId(o)}u(gt,"resolveNodeId");function yt(){return k.build()}u(yt,"getWardleyData");function ut(){k.clear(),Ft()}u(ut,"clear");var Gt={getConfig:et,addNode:at,addLink:rt,addTrend:ot,addAnnotation:nt,addNote:st,addAccelerator:it,addDeaccelerator:dt,setAnnotationsBox:lt,setSize:ct,startPipeline:pt,addPipelineComponent:ft,updateAxes:ht,getNode:xt,resolveNodeId:gt,getWardleyData:yt,clear:ut,setAccTitle:At,getAccTitle:Xt,setDiagramTitle:Tt,getDiagramTitle:Lt,getAccDescription:zt,setAccDescription:Nt},qt=["Genesis","Custom Built","Product","Commodity"],Ht=u(()=>{const{themeVariables:o}=V();return{backgroundColor:o.wardley?.backgroundColor??o.background??"#fff",axisColor:o.wardley?.axisColor??"#000",axisTextColor:o.wardley?.axisTextColor??o.primaryTextColor??"#222",gridColor:o.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:o.wardley?.componentFill??"#fff",componentStroke:o.wardley?.componentStroke??"#000",componentLabelColor:o.wardley?.componentLabelColor??o.primaryTextColor??"#222",linkStroke:o.wardley?.linkStroke??"#000",evolutionStroke:o.wardley?.evolutionStroke??"#dc3545",annotationStroke:o.wardley?.annotationStroke??"#000",annotationTextColor:o.wardley?.annotationTextColor??o.primaryTextColor??"#222",annotationFill:o.wardley?.annotationFill??o.background??"#fff"}},"getTheme"),jt=u(()=>{const o=V()["wardley-beta"];return{width:o?.width??900,height:o?.height??600,padding:o?.padding??48,nodeRadius:o?.nodeRadius??6,nodeLabelOffset:o?.nodeLabelOffset??8,axisFontSize:o?.axisFontSize??12,labelFontSize:o?.labelFontSize??10,showGrid:o?.showGrid??!1,useMaxWidth:o?.useMaxWidth??!0}},"getConfigValues"),Vt=u((o,r,e,h)=>{Q.debug(`Rendering Wardley map
|
|
2
2
|
`+o);const a=jt(),d=Ht(),w=a.nodeRadius*1.6,C=h.db,g=C.getWardleyData(),R=C.getDiagramTitle(),S=g.size?.width??a.width,b=g.size?.height??a.height,Y=It(r);Y.selectAll("*").remove(),Bt(Y,b,S,a.useMaxWidth),Y.attr("viewBox",`0 0 ${S} ${b}`);const v=Y.append("g").attr("class","wardley-map"),q=Y.append("defs");q.append("marker").attr("id",`arrow-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.evolutionStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-end-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.linkStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-start-${r}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",d.linkStroke).attr("stroke","none"),v.append("rect").attr("class","wardley-background").attr("width",S).attr("height",b).attr("fill",d.backgroundColor);const I=S-a.padding*2,B=b-a.padding*2;R&&v.append("text").attr("class","wardley-title").attr("x",S/2).attr("y",a.padding/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(R);const z=u(t=>a.padding+t/100*I,"projectX"),L=u(t=>b-a.padding-t/100*B,"projectY"),O=v.append("g").attr("class","wardley-axes");O.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1),O.append("line").attr("x1",a.padding).attr("x2",a.padding).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1);const wt=g.axes.xLabel??"Evolution",mt=g.axes.yLabel??"Visibility";O.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",a.padding+I/2).attr("y",b-a.padding/4).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(wt),O.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",a.padding/3).attr("y",a.padding+B/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${a.padding/3} ${a.padding+B/2})`).text(mt);const F=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:qt;if(F.length>0){const t=v.append("g").attr("class","wardley-stages"),s=g.axes.stageBoundaries,n=[];if(s&&s.length===F.length){let i=0;s.forEach(p=>{n.push({start:i,end:p}),i=p})}else{const i=1/F.length;F.forEach((p,l)=>{n.push({start:l*i,end:(l+1)*i})})}F.forEach((i,p)=>{const l=n[p],f=a.padding+l.start*I,x=a.padding+l.end*I,y=(f+x)/2;p>0&&t.append("line").attr("x1",f).attr("x2",f).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),t.append("text").attr("class","wardley-stage-label").attr("x",y).attr("y",b-a.padding/1.5).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(a.showGrid){const t=v.append("g").attr("class","wardley-grid");for(let s=1;s<4;s++){const n=s/4,i=a.padding+I*n;t.append("line").attr("x1",i).attr("x2",i).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding-B*n).attr("y2",b-a.padding-B*n).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6")}}const c=new Map;if(g.nodes.forEach(t=>{c.set(t.id,{x:z(t.x),y:L(t.y),node:t})}),g.pipelines.length>0){const t=v.append("g").attr("class","wardley-pipelines"),s=v.append("g").attr("class","wardley-pipeline-links");g.pipelines.forEach(n=>{if(n.componentIds.length===0)return;const i=n.componentIds.map(x=>({id:x,pos:c.get(x),node:g.nodes.find(y=>y.id===x)})).filter(x=>x.pos&&x.node).sort((x,y)=>x.node.x-y.node.x);for(let x=0;x<i.length-1;x++){const y=i[x],m=i[x+1];s.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",y.pos.x).attr("y1",y.pos.y).attr("x2",m.pos.x).attr("y2",m.pos.y).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let p=1/0,l=-1/0,f=0;if(n.componentIds.forEach(x=>{const y=c.get(x);y&&(p=Math.min(p,y.x),l=Math.max(l,y.x),f=y.y)}),p!==1/0&&l!==-1/0){const y=a.nodeRadius*4,m=f-y/2,P=c.get(n.nodeId);if(P){const N=(p+l)/2;P.x=N,P.y=m-w/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",p-15).attr("y",m).attr("width",l-p+30).attr("height",y).attr("fill","none").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const _=v.append("g").attr("class","wardley-links"),Z=new Map;g.pipelines.forEach(t=>{Z.set(t.nodeId,new Set(t.componentIds))});const U=g.links.filter(t=>!(!c.has(t.source)||!c.has(t.target)||Z.get(t.target)?.has(t.source)));_.selectAll("line").data(U).enter().append("line").attr("class",t=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f);return s.x+l/x*p}).attr("y1",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f);return s.y+f/x*p}).attr("x2",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,f=s.y-n.y,x=Math.sqrt(l*l+f*f);return n.x+l/x*p}).attr("y2",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,f=s.y-n.y,x=Math.sqrt(l*l+f*f);return n.y+f/x*p}).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",t=>t.dashed?"6 6":null).attr("marker-end",t=>t.flow==="forward"||t.flow==="bidirectional"?`url(#link-arrow-end-${r})`:null).attr("marker-start",t=>t.flow==="backward"||t.flow==="bidirectional"?`url(#link-arrow-start-${r})`:null),_.selectAll("text").data(U.filter(t=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=n.y-s.y,l=n.x-s.x,f=Math.sqrt(l*l+p*p),x=8,y=p/f;return i+y*x}).attr("y",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.y+n.y)/2,p=n.x-s.x,l=n.y-s.y,f=Math.sqrt(p*p+l*l),x=8,y=-p/f;return i+y*x}).attr("fill",d.axisTextColor).attr("font-size",a.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=(s.y+n.y)/2,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f),y=8,m=f/x,P=-l/x,N=i+m*y,W=p+P*y;let A=Math.atan2(f,l)*180/Math.PI;return(A>90||A<-90)&&(A+=180),`rotate(${A} ${N} ${W})`}).text(t=>t.label);const kt=v.append("g").attr("class","wardley-trends"),bt=g.trends.map(t=>{const s=c.get(t.nodeId);if(!s)return null;const n=z(t.targetX),i=L(t.targetY),p=n-s.x,l=i-s.y,f=Math.sqrt(p*p+l*l),x=a.nodeRadius+2,y=f>x?n-p/f*x:n,m=f>x?i-l/f*x:i;return{origin:s,targetX:n,targetY:i,adjustedX2:y,adjustedY2:m}}).filter(t=>t!==null);kt.selectAll("line").data(bt).enter().append("line").attr("class","wardley-trend").attr("x1",t=>t.origin.x).attr("y1",t=>t.origin.y).attr("x2",t=>t.adjustedX2).attr("y2",t=>t.adjustedY2).attr("stroke",d.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${r})`);const M=v.append("g").attr("class","wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr("class",t=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));M.filter(t=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#666").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#ccc").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const T=M.filter(t=>t.sourceStrategy==="market");T.append("circle").attr("class","wardley-market-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1);const H=a.nodeRadius*.7,$=a.nodeRadius*1.2;if(T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x).attr("y1",t=>c.get(t.id).y-$).attr("x2",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x).attr("y2",t=>c.get(t.id).y-$).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y-$).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),M.filter(t=>t.isPipelineParent===!0).append("rect").attr("x",t=>c.get(t.id).x-w/2).attr("y",t=>c.get(t.id).y-w/2).attr("width",w).attr("height",w).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",t=>{const s=c.get(t.id);let n=t.isPipelineParent?w/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y1",t=>{const s=c.get(t.id),n=t.isPipelineParent?w:a.nodeRadius*2;return s.y-n/2}).attr("x2",t=>{const s=c.get(t.id);let n=t.isPipelineParent?w/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y2",t=>{const s=c.get(t.id),n=t.isPipelineParent?w:a.nodeRadius*2;return s.y+n/2}).attr("stroke",d.componentStroke).attr("stroke-width",6),M.append("text").attr("x",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?s.x+t.labelOffsetX:s.x;let n=a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetX===void 0&&(n+=10);const i=t.labelOffsetX??n;return s.x+i}).attr("y",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?s.y+t.labelOffsetY:s.y-3;let n=-a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetY===void 0&&(n-=10);const i=t.labelOffsetY??n;return s.y+i}).attr("class","wardley-node-label").attr("fill",t=>t.className==="evolved"?d.evolutionStroke:t.className==="anchor"?"#000":d.componentLabelColor).attr("font-size",a.labelFontSize).attr("font-weight",t=>t.className==="anchor"?"bold":"normal").attr("text-anchor",t=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",t=>t.className==="anchor"?"middle":"auto").text(t=>t.label),g.annotations.length>0){const t=v.append("g").attr("class","wardley-annotations");if(g.annotations.forEach(s=>{const n=s.coordinates.map(i=>({x:z(i.x),y:L(i.y)}));if(n.length>1)for(let i=0;i<n.length-1;i++)t.append("line").attr("class","wardley-annotation-line").attr("x1",n[i].x).attr("y1",n[i].y).attr("x2",n[i+1].x).attr("y2",n[i+1].y).attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");n.forEach(i=>{const p=t.append("g").attr("class","wardley-annotation");p.append("circle").attr("cx",i.x).attr("cy",i.y).attr("r",10).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5),p.append("text").attr("x",i.x).attr("y",i.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.number)})}),g.annotationsBox){let s=z(g.annotationsBox.x),n=L(g.annotationsBox.y);const i=10,p=16,l=11,f=t.append("g").attr("class","wardley-annotations-box"),x=[...g.annotations].filter(m=>m.text).sort((m,P)=>m.number-P.number),y=[];if(x.forEach((m,P)=>{const N=f.append("text").attr("x",s+i).attr("y",n+i+(P+1)*p).attr("font-size",l).attr("fill",d.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${m.number}. ${m.text}`);y.push(N)}),y.length>0){let m=0,P=0;y.forEach(j=>{const D=j.node(),Ct=D.getComputedTextLength();m=Math.max(m,Ct);const St=D.getBBox();P=Math.max(P,St.height)});const N=m+i*2+105,W=x.length*p+i*2+P/2,A=a.padding,$t=S-a.padding-N,vt=a.padding,Pt=b-a.padding-W;s=Math.max(A,Math.min(s,$t)),n=Math.max(vt,Math.min(n,Pt)),y.forEach((j,D)=>{j.attr("x",s+i).attr("y",n+i+(D+1)*p)}),f.insert("rect","text").attr("x",s).attr("y",n).attr("width",N).attr("height",W).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(g.notes.length>0){const t=v.append("g").attr("class","wardley-notes");g.notes.forEach(s=>{const n=z(s.x),i=L(s.y);t.append("text").attr("x",n).attr("y",i).attr("text-anchor","start").attr("font-size",11).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.text)})}if(g.accelerators.length>0){const t=v.append("g").attr("class","wardley-accelerators");g.accelerators.forEach(s=>{const n=z(s.x),i=L(s.y),p=60,l=30,f=20,x=`
|
|
3
3
|
M ${n} ${i-l/2}
|
|
4
4
|
L ${n+p-f} ${i-l/2}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as ht,bq as U,by as $t,bs as It,b as yt,bu as d}from"./CNRXwQIm.js";import{bs as bt,ca as k,aD as t,c9 as s,a7 as Ct,ay as Rt,W as kt,bn as wt,bH as q,bV as v,aA as E}from"./DYhIMPy1.js";import{G as At}from"./Cbpg9otW.js";import{b as Dt}from"./BaIAhI85.js";import{Ia as a,eu as Pt,ev as St,nU as Ut,yW as Et,nY as _t,nZ as Ft,IG as Tt,IX as Wt,IL as xt,uN as Lt,u2 as Nt}from"./B_TVaDKX.js";import{aZ as qt}from"./
|
|
1
|
+
import{t as ht,bq as U,by as $t,bs as It,b as yt,bu as d}from"./CNRXwQIm.js";import{bs as bt,ca as k,aD as t,c9 as s,a7 as Ct,ay as Rt,W as kt,bn as wt,bH as q,bV as v,aA as E}from"./DYhIMPy1.js";import{G as At}from"./Cbpg9otW.js";import{b as Dt}from"./BaIAhI85.js";import{Ia as a,eu as Pt,ev as St,nU as Ut,yW as Et,nY as _t,nZ as Ft,IG as Tt,IX as Wt,IL as xt,uN as Lt,u2 as Nt}from"./B_TVaDKX.js";import{aZ as qt}from"./Dc4zROVy.js";import{g as vt}from"./DfN8_dcw.js";import{dp as Bt,bM as Ht,bB as Ot,bF as Mt,bD as Gt}from"./9uHm6kyM.js";import{ah as Kt}from"./DQ_wgZoU.js";import{C as Vt}from"./B_aA47Rw.js";import{V as jt}from"./BySsSVgI.js";import{bN as Zt,bK as Jt,b5 as Xt}from"./1eEcuHcS.js";import{i as Yt}from"./H2jLkRRS.js";function zt(_,f){if(new.target)return ht({component:zt,..._});bt(f,!0);const B=()=>d(Q,"$gitRoots$",n),F=()=>d(z,"$workspace",n),H=()=>d(st,"$ftCommits$",n),O=()=>d(ot,"$ftOlderCommits$",n),b=()=>d(tt,"$commitRead$",n),M=()=>d(X,"$foldUnchanged",n),G=()=>d(J,"$lineWrapping",n),K=()=>d(Y,"$diffSideBySide",n),V=()=>d(at,"$ftLoading$",n),[n,j]=It(),Z=e=>{jt(e,{embedded:!0,showExpand:!0,get expanded(){return t(C)},onToggleExpand:()=>{q(C,!t(C)),t(C)?t(R)?.expandAll():t(R)?.collapseAll()},get foldEnabled(){return M()},onToggleFold:()=>a.dispatch(xt()),get wrapEnabled(){return G()},onToggleWrap:()=>a.dispatch(Wt()),get splitEnabled(){return K()},onToggleSplit:()=>a.dispatch(Tt())})},J=Zt(),X=Jt(),Y=Xt();let h=U(f,"tab",7),i=U(f,"workspaceId",7),$=U(f,"isActive",7);const T=vt(),g=qt(()=>i()),z=Bt(g),Q=Kt(g),w=crypto.randomUUID(),tt=Ht(g,w),c=s(()=>h().data?.commitHash||""),W=s(()=>h().data?.commitMessage||"");k(()=>{const e=i();if(!(!$()||!e||t(r)))return a.dispatch(Pt(e,"history")),()=>a.dispatch(St(e,"history"))});const r=s(()=>h().data?.gitRootId||""),x=s(()=>t(r)&&B().find(e=>e.id===t(r))?.path||""),et=s(()=>t(x)||F()?.worktreePath||F()?.repositoryPath||""),st=Ot(g),ot=Mt(g),at=Gt(g),nt=s(()=>H()||[]),it=s(()=>O()||[]),p=s(()=>t(r)?void 0:t(nt).find(e=>e.hash===t(c))||t(it).find(e=>e.hash===t(c))),A=s(()=>t(p)?.files||[]),D=s(()=>b()?.request.kind==="commitDetails"&&b().request.commitHash===t(c)&&(b().request.gitRootId??"")===t(r)?b():void 0),l=s(()=>t(D)?.result?.kind==="commitDetails"?t(D).result.details:null),rt=s(()=>t(l)?t(l).fileDetails.length>0?t(l).fileDetails:t(l).files.map(e=>({path:e,additions:0,deletions:0})):[]),dt=s(()=>t(D)?.loading??!1);k(()=>{const e=t(c),o=i(),I=t(r);if(!e||!o||t(A).length>0)return;const u=crypto.randomUUID();return a.dispatch(Ut(o,w,u,{kind:"commitDetails",commitHash:e,gitRootId:I||void 0})),()=>a.dispatch(Et(o,w,u))});const ct=s(()=>t(A).length>0?t(A):t(rt));let C=v(!0),R=v(null);const lt=s(()=>t(ct).map(e=>{const o=typeof e=="string"?e:e.path||"",I=typeof e=="string"?0:e.additions||0,u=typeof e=="string"?0:e.deletions||0;return{filePath:Yt(o)?o:`${t(et)}/${o}`,action:"modify",additions:I,deletions:u,toolName:"local",toolCallId:`commit-${t(c)}-${o}`,staged:!1,category:"committed",commitHash:t(c),commitMessage:t(W)}}));k(()=>{!T||!$()||T.registerActions({display:Z})});const L=crypto.randomUUID();k(()=>{const e=i();if(!(!($()&&t(r))||!e))return a.dispatch(_t(e,L)),()=>a.dispatch(Ft(e,L))});var mt={get tab(){return h()},set tab(e){h(e),E()},get workspaceId(){return i()},set workspaceId(e){i(e),E()},get isActive(){return $()},set isActive(e){$(e),E()},$set:$t,$on:(e,o)=>yt(f,e,o)},N=Ct(),gt=Rt(N);At(gt,()=>JSON.stringify([i(),t(r),t(c)]),e=>{{let o=s(()=>V()||t(dt)),I=s(()=>t(r)||void 0),u=s(()=>t(x)||void 0),ut=s(()=>({hash:t(c),message:t(W),author:t(p)?.author||t(l)?.author,authorEmail:t(p)?.authorEmail||t(l)?.authorEmail,date:t(p)?.date||t(l)?.date,agentId:t(p)?.agentId,linkedNoteId:t(p)?.linkedNoteId}));Dt(Vt(e,{get isLoading(){return t(o)},get changes(){return t(lt)},get gitRootId(){return t(I)},get gitRootPath(){return t(u)},get commitInfo(){return t(ut)},onOpenAgent:(y,m)=>{const P=m?.metaKey||m?.ctrlKey||!1,S=m?.target?.closest("[data-panel-id]")?.getAttribute("data-panel-id")??void 0;a.dispatch(Nt(i(),{agentId:y,openInAdjacentPanel:P,sourcePanelId:S}))},onOpenNote:(y,m)=>{const P=m?.metaKey||m?.ctrlKey||!1,S=m?.target?.closest("[data-panel-id]")?.getAttribute("data-panel-id")??void 0;a.dispatch(Lt(i(),y,{openInAdjacentPanel:P,sourcePanelId:S}))}}),y=>q(R,y,!0),()=>t(R))}}),kt(_,N);var pt=wt(mt);return j(),pt}export{zt as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as Ni}from"./
|
|
1
|
+
import{g as Ni}from"./BRVXCoHC.js";import{s as Ci}from"./BYGvqRLs.js";import{U as Zs,aZ as jt,V as Qs,a_ as Gt,Y as bi,b0 as vi,b as h,aU as je,ay as _i,X as en,a1 as xi,aP as Mi,bh as wi,aV as Ui,r as Pi,O as Di,am as Fi,W as Bi,ab as $i,aG as ji,aA as Gi,aW as Wi}from"./DeTs9jD5.js";function Wt(s){console&&console.error&&console.error(`Error: ${s}`)}function tn(s){console&&console.warn&&console.warn(`Warning: ${s}`)}function sn(s){const e=new Date().getTime(),t=s();return{time:new Date().getTime()-e,value:t}}function nn(s){function e(){}e.prototype=s;const t=new e;function n(){return typeof t.bar}return n(),n(),s}function Ki(s){return Vi(s)?s.LABEL:s.name}function Vi(s){return typeof s.LABEL=="string"&&s.LABEL!==""}class te{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),this.definition.forEach(t=>{t.accept(e)})}}class K extends te{constructor(e){super([]),this.idx=1,Object.assign(this,ie(e))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class _e extends te{constructor(e){super(e.definition),this.orgText="",Object.assign(this,ie(e))}}class W extends te{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,ie(e))}}class G extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class se extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class ne extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class M extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class q extends te{constructor(e){super(e.definition),this.idx=1,Object.assign(this,ie(e))}}class Z extends te{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Object.assign(this,ie(e))}}class k{constructor(e){this.idx=1,Object.assign(this,ie(e))}accept(e){e.visit(this)}}function zi(s){return s.map(at)}function at(s){function e(t){return t.map(at)}if(s instanceof K){const t={type:"NonTerminal",name:s.nonTerminalName,idx:s.idx};return typeof s.label=="string"&&(t.label=s.label),t}else{if(s instanceof W)return{type:"Alternative",definition:e(s.definition)};if(s instanceof G)return{type:"Option",idx:s.idx,definition:e(s.definition)};if(s instanceof se)return{type:"RepetitionMandatory",idx:s.idx,definition:e(s.definition)};if(s instanceof ne)return{type:"RepetitionMandatoryWithSeparator",idx:s.idx,separator:at(new k({terminalType:s.separator})),definition:e(s.definition)};if(s instanceof q)return{type:"RepetitionWithSeparator",idx:s.idx,separator:at(new k({terminalType:s.separator})),definition:e(s.definition)};if(s instanceof M)return{type:"Repetition",idx:s.idx,definition:e(s.definition)};if(s instanceof Z)return{type:"Alternation",idx:s.idx,definition:e(s.definition)};if(s instanceof k){const t={type:"Terminal",name:s.terminalType.name,label:Ki(s.terminalType),idx:s.idx};typeof s.label=="string"&&(t.terminalLabel=s.label);const n=s.terminalType.PATTERN;return s.terminalType.PATTERN&&(t.pattern=n instanceof RegExp?n.source:n),t}else{if(s instanceof _e)return{type:"Rule",name:s.name,orgText:s.orgText,definition:e(s.definition)};throw Error("non exhaustive match")}}}function ie(s){return Object.fromEntries(Object.entries(s).filter(([,e])=>e!==void 0))}class xe{visit(e){const t=e;switch(t.constructor){case K:return this.visitNonTerminal(t);case W:return this.visitAlternative(t);case G:return this.visitOption(t);case se:return this.visitRepetitionMandatory(t);case ne:return this.visitRepetitionMandatoryWithSeparator(t);case q:return this.visitRepetitionWithSeparator(t);case M:return this.visitRepetition(t);case Z:return this.visitAlternation(t);case k:return this.visitTerminal(t);case _e:return this.visitRule(t);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function Hi(s){return s instanceof W||s instanceof G||s instanceof M||s instanceof se||s instanceof ne||s instanceof q||s instanceof k||s instanceof _e}function Tt(s,e=[]){return s instanceof G||s instanceof M||s instanceof q?!0:s instanceof Z?s.definition.some(n=>Tt(n,e)):s instanceof K&&e.includes(s)?!1:s instanceof te?(s instanceof K&&e.push(s),s.definition.every(n=>Tt(n,e))):!1}function Xi(s){return s instanceof Z}function ee(s){if(s instanceof K)return"SUBRULE";if(s instanceof G)return"OPTION";if(s instanceof Z)return"OR";if(s instanceof se)return"AT_LEAST_ONE";if(s instanceof ne)return"AT_LEAST_ONE_SEP";if(s instanceof q)return"MANY_SEP";if(s instanceof M)return"MANY";if(s instanceof k)return"CONSUME";throw Error("non exhaustive match")}class kt{walk(e,t=[]){e.definition.forEach((n,i)=>{const a=e.definition.slice(i+1);if(n instanceof K)this.walkProdRef(n,a,t);else if(n instanceof k)this.walkTerminal(n,a,t);else if(n instanceof W)this.walkFlat(n,a,t);else if(n instanceof G)this.walkOption(n,a,t);else if(n instanceof se)this.walkAtLeastOne(n,a,t);else if(n instanceof ne)this.walkAtLeastOneSep(n,a,t);else if(n instanceof q)this.walkManySep(n,a,t);else if(n instanceof M)this.walkMany(n,a,t);else if(n instanceof Z)this.walkOr(n,a,t);else throw Error("non exhaustive match")})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){const i=t.concat(n);this.walk(e,i)}walkOption(e,t,n){const i=t.concat(n);this.walk(e,i)}walkAtLeastOne(e,t,n){const i=[new G({definition:e.definition})].concat(t,n);this.walk(e,i)}walkAtLeastOneSep(e,t,n){const i=ys(e,t,n);this.walk(e,i)}walkMany(e,t,n){const i=[new G({definition:e.definition})].concat(t,n);this.walk(e,i)}walkManySep(e,t,n){const i=ys(e,t,n);this.walk(e,i)}walkOr(e,t,n){const i=t.concat(n);e.definition.forEach(a=>{const r=new W({definition:[a]});this.walk(r,i)})}}function ys(s,e,t){return[new G({definition:[new k({terminalType:s.separator})].concat(s.definition)})].concat(e,t)}function Je(s){if(s instanceof K)return Je(s.referencedRule);if(s instanceof k)return qi(s);if(Hi(s))return Yi(s);if(Xi(s))return Ji(s);throw Error("non exhaustive match")}function Yi(s){let e=[];const t=s.definition;let n=0,i=t.length>n,a,r=!0;for(;i&&r;)a=t[n],r=Tt(a),e=e.concat(Je(a)),n=n+1,i=t.length>n;return[...new Set(e)]}function Ji(s){const e=s.definition.map(t=>Je(t));return[...new Set(e.flat())]}function qi(s){return[s.terminalType]}const an="_~IN~_";class Zi extends kt{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){const i=ea(e.referencedRule,e.idx)+this.topProd.name,a=t.concat(n),r=new W({definition:a}),l=Je(r);this.follows[i]=l}}function Qi(s){const e={};return s.forEach(t=>{const n=new Zi(t).startWalking();Object.assign(e,n)}),e}function ea(s,e){return s.name+e+an}function S(s){return s.charCodeAt(0)}function Pt(s,e){Array.isArray(s)?s.forEach(function(t){e.push(t)}):e.push(s)}function Fe(s,e){if(s[e]===!0)throw"duplicate flag "+e;s[e],s[e]=!0}function Se(s){if(s===void 0)throw Error("Internal Error - Should never get here!");return!0}function ta(){throw Error("Internal Error - Should never get here!")}function Rs(s){return s.type==="Character"}const gt=[];for(let s=S("0");s<=S("9");s++)gt.push(s);const At=[S("_")].concat(gt);for(let s=S("a");s<=S("z");s++)At.push(s);for(let s=S("A");s<=S("Z");s++)At.push(s);const Os=[S(" "),S("\f"),S(`
|
|
2
2
|
`),S("\r"),S(" "),S("\v"),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S(" "),S("\u2028"),S("\u2029"),S(" "),S(" "),S(" "),S("\uFEFF")],sa=/[0-9a-fA-F]/,tt=/[0-9]/,na=/[1-9]/;class ia{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const t=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Fe(n,"global");break;case"i":Fe(n,"ignoreCase");break;case"m":Fe(n,"multiLine");break;case"u":Fe(n,"unicode");break;case"y":Fe(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:t,loc:this.loc(0)}}disjunction(){const e=[],t=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(t)}}alternative(){const e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let t;switch(this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":t="Lookbehind";break;case"!":t="NegativeLookbehind"}break}}Se(t);const n=this.disjunction();return this.consumeChar(")"),{type:t,value:n,loc:this.loc(e)}}return ta()}quantifier(e=!1){let t;const n=this.idx;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:i,atMost:i};break;case",":let a;this.isDigit()?(a=this.integerIncludingZero(),t={atLeast:i,atMost:a}):t={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&t===void 0)return;Se(t);break}if(!(e===!0&&t===void 0)&&Se(t))return this.peekChar(0)==="?"?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t.loc=this.loc(n),t}atom(){let e;const t=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),Se(e))return e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[S(`
|
|
3
3
|
`),S("\r"),S("\u2028"),S("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case"d":e=gt;break;case"D":e=gt,t=!0;break;case"s":e=Os;break;case"S":e=Os,t=!0;break;case"w":e=At;break;case"W":e=At,t=!0;break}if(Se(e))return{type:"Set",value:e,complement:t}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=S("\f");break;case"n":e=S(`
|
|
4
4
|
`);break;case"r":e=S("\r");break;case"t":e=S(" ");break;case"v":e=S("\v");break}if(Se(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:S("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:S(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as Jt}from"./
|
|
1
|
+
import{g as Jt}from"./BrRq5glY.js";import{g as Zt}from"./BRVXCoHC.js";import{s as $t}from"./BYGvqRLs.js";import{b as C,a$ as e1,ay as Z,X as Ae,a1 as t1,aP as s1,bh as at,a_ as i1,aZ as r1,b0 as a1,V as n1,U as u1,Y as o1,z as l1,ax as c1,J as h1,aq as st,as as d1,$ as it,aW as rt,r as p1,a2 as f1,N as g1,am as b1,aU as k1,ab as A1,x as m1,aT as C1,p as S1}from"./DeTs9jD5.js";import{c as D1}from"./CTNWfj01.js";import{aO as T1}from"./1eEcuHcS.js";var E1="flowchart-",y1=["laneRole","laneIndex","drawnExtent"];function Wt(s){if(!s||typeof s!="object")return s;const i={...s};for(const a of y1)Reflect.deleteProperty(i,a);return i}C(Wt,"withoutInternalKeys");var Pe,x1=(Pe=class{constructor(){this.vertexCounter=0,this.config=Ae(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.droppedSubGraphMembers=[],this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=i1,this.setAccDescription=r1,this.setDiagramTitle=a1,this.getAccTitle=n1,this.getAccDescription=u1,this.getDiagramTitle=o1,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(i){return l1.sanitizeText(i,this.config)}sanitizeNodeLabelType(i){switch(i){case"markdown":case"string":case"text":return i;default:return"markdown"}}setDiagramId(i){this.diagramId=i}lookUpDomId(i){for(const a of this.vertices.values())if(a.id===i)return this.diagramId?`${this.diagramId}-${a.domId}`:a.domId;return this.diagramId?`${this.diagramId}-${i}`:i}addVertex(i,a,n,r,l,g,o={},m){if(!i||i.trim().length===0)return;let d;if(m!==void 0){let f;m.includes(`
|
|
2
2
|
`)?f=m+`
|
|
3
3
|
`:f=`{
|
|
4
4
|
`+m+`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as _t,bq as _,a_ as L,by as mt,bs as gt,b as vt,bo as x,bu as be,bt as Te}from"./CNRXwQIm.js";import{bs as ht,cd as yt,ca as wt,bk as xt,a7 as N,ay as m,W as r,bn as It,aA as g,aD as t,bS as S,a5 as _e,bH as De,bA as me,b_ as M,aB as E,c9 as o,bf as kt,bl as oe,bO as ae,bV as Ct}from"./DYhIMPy1.js";import{v as $t,n as Pt,u as Be,i as At}from"./CSGwK3Iy.js";import{s as Me}from"./DCwCW5T0.js";import{c as z}from"./B84qHti4.js";import{cD as Et,bj as Ot,aI as Ft,F as ne,aV as Tt,aJ as Dt,bk as Bt,a4 as Ve,as as Lt}from"./C9E3dZMW.js";import{W as Nt,T as St,G as zt,C as Rt,X as Ht,J as Wt,V as Mt}from"./CXXJ19Uk.js";import{f as ge}from"./CzFRvFff.js";import{h as Vt}from"./CLC_EHyS.js";import{k as jt,R as Gt,o as Jt,n as qt,m as Kt,l as je}from"./BDHvJBXG.js";import{k as ve}from"./BdVXLC6D.js";import{c as Ut}from"./ChTqQfQN.js";import"./BYBI0ipE.js";import{Ia as Ge,mS as Xt,ES as Yt}from"./B_TVaDKX.js";import{w as Qt}from"./Cbpg9otW.js";import{i as U}from"./C6CEtMPQ.js";import{bl as Zt,b2 as er,a$ as tr}from"./rj-wRFR4.js";import{cl as rr}from"./9uHm6kyM.js";import{t as or}from"./H2jLkRRS.js";const ar={cursor:Rt,ghostty:zt,terminal:St,warp:Nt},nr={vscode:Mt,jetbrains:Wt,xcode:Ht};function sr(O){return ar[O.id]??nr[O.handlerType]??null}function Je(O){return O==="terminal"?Et:O==="finder"?Ot:Ft}const ir="shrink-0 text-muted-foreground hover:text-foreground focus-visible:text-foreground [&_svg]:size-4",Le="finder",lr={id:Le,name:"Finder",shortLabel:"Finder",appName:"Finder",category:"finder",handlerType:"finder",installed:!0,priority:0};function cr(O,s=[]){const se=new Set(s),X=O.filter(({installed:Y,id:ye})=>Y&&!se.has(ye));return X.some(({id:Y})=>Y===Le)||se.has(Le)?X:[...X,lr]}var dr=E('<img alt="" class="size-4"/>'),ur=E('<kbd class="type-caption ml-4 text-muted-foreground" aria-hidden="true"> </kbd>'),pr=E('<span class="min-w-0 flex-1 truncate"> </span> <!>',1),fr=E("<span> </span>"),he=E("<!> <!>",1),br=E("<span><!></span>"),_r=E('<img class="w-4 h-4"/>'),mr=E('<!> <span class="text-muted-foreground"> </span>',1),gr=E('<div class="inline-flex items-stretch rounded-md border border-border" data-open-combo-control=""><!> <!></div>'),vr=E('<div class="type-caption px-2 py-1.5 text-subtle"> </div>'),hr=E('<div class="w-60 max-w-full"><!> <!> <!></div>'),yr=E("<div><!></div>");function wr(O,s){if(new.target)return _t({component:wr,...O});ht(s,!0);const se=()=>be(Ue,"$installedEditors$",ie),X=()=>be(Xe,"$hiddenEditorIds$",ie),Y=()=>be(Ye,"$isWorkspaceHostLocal$",ie),ye=()=>be(Ke,"$openAction",ie),[ie,qe]=gt(),le=(e,d=kt)=>{var u=N(),p=m(u);z(p,()=>Gt,(te,G)=>{G(te,{get value(){return t(v).id},children:(F,B)=>{var k=N(),T=m(k);Pt(T,17,d,C=>C.id,(C,c)=>{var J=N(),h=m(J);{const $=a=>{var i=N(),y=m(i);{var H=l=>{var A=dr();M(()=>Be(A,"src",`data:image/png;base64,${t(c).iconBase64??""}`)),r(l,A)},b=l=>{const A=o(()=>t(c).icon);var W=N(),D=m(W);z(D,()=>t(A),(q,re)=>{re(q,{size:16})}),r(l,W)},P=l=>{{let A=o(()=>t(c).faIcon??Je(t(c).category));ne(l,{get icon(){return t(A)},class:"size-4 text-muted-foreground"})}};L(y,l=>{t(c).iconBase64?l(H):t(c).icon?l(b,1):l(P,-1)})}r(a,i)};let n=o(()=>!I());z(h,()=>jt,(a,i)=>{i(a,{get value(){return t(c).id},closeOnSelect:!0,get disabled(){return t(n)},onSelect:()=>tt(t(c).id),get textValue(){return t(c).label},leading:$,children:(y,H)=>{var b=pr(),P=m(b),l=oe(P,!0),A=S(P,2);{var W=D=>{var q=ur(),re=oe(q,!0);M(()=>ae(re,t(c).shortcut)),r(D,q)};L(A,D=>{t(c).shortcut&&D(W)})}M(()=>ae(l,t(c).label)),r(y,b)},$$slots:{leading:!0,default:!0}})})}r(C,J)}),r(F,k)},$$slots:{default:!0}})}),r(e,u)},Ne=Ut("OpenComboButton");let I=_(s,"filePath",7),ce=_(s,"workspaceId",7,""),de=_(s,"isDirectory",7,!0),we=_(s,"workspaceFolderPath",7),xe=_(s,"class",7,""),ue=_(s,"headerText",7),Ie=_(s,"usePortal",7,!0),ke=_(s,"side",7,"bottom"),V=_(s,"variant",7,"default"),Q=_(s,"branchName",7),Ce=_(s,"compact",7,!1),$e=_(s,"embedded",7,!1),Z=_(s,"inline",7,!1),j=_(s,"iconOnly",7,!1),R=_(s,"children",7,void 0);const Se=o(()=>V()==="sidebar"?"bg-sidebar hover:bg-sidebar/80":"bg-background hover:bg-muted"),Pe=yt(ce());wt(()=>{Pe.set(ce())});const Ke=Zt(),Ue=er(Pe),Xe=tr(),Ye=rr(Pe);let ee=Ct(!1);xt(()=>{Ge.dispatch(Xt())});function Qe(e){return{id:e.id,label:e.name,shortLabel:e.shortLabel,icon:sr(e),shortcut:e.shortcut,handlerType:e.handlerType,appName:e.appName,category:e.category,iconBase64:e.iconBase64}}const Ze=Qt("externalEditors");let f=o(()=>{const e=se(),d=cr(e,X()).map(Qe),u={id:"other",label:x.ui_openCombo_other_label(),shortLabel:x.ui_openCombo_other_label(),icon:null,faIcon:Bt,handlerType:"generic"},p=[{id:"copy",label:x.ui_openCombo_copyPath_label(),shortLabel:x.ui_openCombo_copy_shortLabel(),icon:null,faIcon:Tt},...Q()?[{id:"copy-branch",label:x.ui_openCombo_copyBranch_label(),shortLabel:x.ui_openCombo_copyBranch_shortLabel(),icon:null,faIcon:Dt}]:[]];return!Ze||!Y()?p:[...d,u,...p]});const pe=o(()=>t(f).some(e=>e.id!=="copy"&&e.id!=="copy-branch")),fe=o(()=>t(f).filter(e=>e.id!=="copy"&&e.id!=="copy-branch")),ze=o(()=>t(f).filter(e=>e.id==="copy"||e.id==="copy-branch")),v=o(()=>t(pe)?t(f).find(e=>e.id===ye())||t(f)[0]:t(f).find(e=>e.id==="copy")||t(f)[0]),Ae=o(()=>t(pe)?x.ui_openCombo_openIn_tooltip({name:t(v).label}):t(v).label);function Ee(){if(de())return I();const e=we()||I().substring(0,I().lastIndexOf("/"));return e?{folder:e,file:I()}:I()}async function Oe(e){if(!I())return;const d=de()?I():I().substring(0,I().lastIndexOf("/"));try{if(e==="copy"){await navigator.clipboard.writeText(or(I())),ve.success(x.ui_openCombo_pathCopied_label());return}if(e==="copy-branch"){Q()&&(await navigator.clipboard.writeText(Q()),ve.success(x.ui_openCombo_branchCopied_label()));return}if(e==="other"){const p=await U("external-editors:open-with-other",{path:d});p?.success?De(ee,!1):p?.error&&p.error!=="No application selected"&&ve.error(p.error);return}const u=t(f).find(p=>p.id===e);if(!u){Ne.warn(`Unknown action: ${e}`);return}switch(u.handlerType){case"finder":await U("shell:showItemInFolder",{path:d});break;case"vscode":await U("vscode:open",Ee());break;case"jetbrains":await U("jetbrains:open",Ee());break;case"xcode":await U("xcode:open",Ee());break;case"generic":default:{await U("external-editors:open",{editorId:u.id,path:d});break}}}catch(u){Ne.error(`Failed to execute action ${e}:`,u),ve.error(u instanceof Error?u.message:x.ui_openCombo_openFailed_error({name:e}))}}function Fe(e){e.stopPropagation(),Oe(t(v).id)}function et(e){e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),e.stopPropagation(),Oe(t(v).id))}function Re(e){e.stopPropagation()}function tt(e){Ge.dispatch(Yt(e)),Oe(e),De(ee,!1)}var rt={get filePath(){return I()},set filePath(e){I(e),g()},get workspaceId(){return ce()},set workspaceId(e=""){ce(e),g()},get isDirectory(){return de()},set isDirectory(e=!0){de(e),g()},get workspaceFolderPath(){return we()},set workspaceFolderPath(e){we(e),g()},get class(){return xe()},set class(e=""){xe(e),g()},get headerText(){return ue()},set headerText(e){ue(e),g()},get usePortal(){return Ie()},set usePortal(e=!0){Ie(e),g()},get side(){return ke()},set side(e="bottom"){ke(e),g()},get variant(){return V()},set variant(e="default"){V(e),g()},get branchName(){return Q()},set branchName(e){Q(e),g()},get compact(){return Ce()},set compact(e=!1){Ce(e),g()},get embedded(){return $e()},set embedded(e=!1){$e(e),g()},get inline(){return Z()},set inline(e=!1){Z(e),g()},get iconOnly(){return j()},set iconOnly(e=!1){j(e),g()},get children(){return R()},set children(e=void 0){R(e),g()},$set:mt,$on:(e,d)=>vt(s,e,d)},He=N(),ot=m(He);{var at=e=>{var d=he(),u=m(d);{var p=G=>{var F=he(),B=m(F);z(B,()=>Kt,(T,C)=>{C(T,{children:(c,J)=>{var h=he(),$=m(h);z($,()=>Jt,(a,i)=>{i(a,{get icon(){return Ve},children:(y,H)=>{var b=fr(),P=oe(b,!0);M(l=>ae(P,l),[()=>x.ui_openCombo_openInApp_tooltip()]),r(y,b)},$$slots:{default:!0}})});var n=S($,2);z(n,()=>qt,(a,i)=>{i(a,{class:"w-60",children:(y,H)=>{le(y,()=>t(fe))},$$slots:{default:!0}})}),r(c,h)},$$slots:{default:!0}})});var k=S(B,2);z(k,()=>je,(T,C)=>{C(T,{})}),r(G,F)};L(u,G=>{t(fe).length&&G(p)})}var te=S(u,2);le(te,()=>t(ze)),r(e,d)},nt=e=>{var d=yr(),u=_e(d);{const p=(F,B)=>{let k=()=>(B?.()).props;var T=N(),C=m(T);{var c=n=>{var a=br();At(a,()=>({role:"button",tabindex:"0",onclick:t(f).length>1?void 0:Fe,onkeydown:t(f).length>1?void 0:et,...t(f).length>1?k():{},class:"cursor-pointer break-words rounded-sm text-inherit underline decoration-muted-foreground/20 underline-offset-2 hover:decoration-current focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",title:t(Ae)}));var i=_e(a);Me(i,R),me(a),r(n,a)},J=n=>{{let a=o(()=>t(f).length>1?void 0:Fe),i=o(()=>j()&&V()!=="sidebar"?"plain":"ghost"),y=o(()=>j()?V()==="sidebar"?"icon-compact":"icon-sm":void 0),H=o(()=>j()&&V()==="sidebar"&&t(ee)),b=o(()=>!j()),P=o(()=>j()?V()==="sidebar"?ir:"cursor-pointer text-muted-foreground hover:text-foreground focus-visible:text-foreground":"cursor-pointer");ge(n,Te({type:"button",get onclick(){return t(a)}},()=>t(f).length>1?k():{},{get variant(){return t(i)},get size(){return t(y)},get active(){return t(H)},get wrapContent(){return t(b)},get class(){return t(P)},get title(){return t(Ae)},children:(l,A)=>{var W=N(),D=m(W);Me(D,R),r(l,W)},$$slots:{default:!0}}))}},h=n=>{{let a=o(()=>x.ui_openCombo_openInApp_tooltip());ge(n,Te(k,{variant:"ghost-light",size:"icon-xs",get tooltip(){return t(a)},tooltipSide:"bottom",children:(i,y)=>{ne(i,{get icon(){return Ve},size:"xs"})},$$slots:{default:!0}}))}},$=n=>{var a=gr(),i=_e(a);{let b=o(()=>t(f).length>1?"rounded-r-none":""),P=o(()=>t(Se)),l=o(()=>t(pe)?t(Ae):void 0);ge(i,{type:"button",variant:"ghost",size:"sm",get class(){return`gap-1.5 px-2 ${t(b)??""} ${t(P)??""}`},onpointerdown:Re,onkeydown:Re,onclick:Fe,get title(){return t(l)},children:(A,W)=>{var D=mr(),q=m(D);{var re=w=>{var K=_r();M(()=>{Be(K,"src",`data:image/png;base64,${t(v).iconBase64??""}`),Be(K,"alt",t(v).label)}),r(w,K)},it=w=>{const K=o(()=>t(v).icon);var We=N(),pt=m(We);z(pt,()=>t(K),(ft,bt)=>{bt(ft,{size:14})}),r(w,We)},lt=w=>{ne(w,{get icon(){return t(v).faIcon},class:"w-3.5 h-3.5 opacity-60"})},ct=w=>{{let K=o(()=>Je(t(v).category));ne(w,{get icon(){return t(K)},class:"w-3.5 h-3.5 opacity-60"})}};L(q,w=>{t(v).iconBase64?w(re):t(v).icon?w(it,1):t(v).faIcon?w(lt,2):w(ct,-1)})}var dt=S(q,2),ut=oe(dt,!0);M(w=>ae(ut,w),[()=>t(pe)?x.ui_openCombo_open_label():t(v).label]),r(A,D)},$$slots:{default:!0}})}var y=S(i,2);{var H=b=>{{let P=o(()=>x.ui_openCombo_openInApp_tooltip());ge(b,Te(k,{type:"button",variant:"ghost",size:"icon-sm",get"aria-label"(){return t(P)},get class(){return`rounded-l-none border-l border-border ${t(Se)??""}`},children:(l,A)=>{ne(l,{get icon(){return Lt},class:"size-3! text-muted-foreground"})},$$slots:{default:!0}}))}};L(y,b=>{t(f).length>1&&b(H)})}me(a),r(n,a)};L(C,n=>{Z()&&R()?n(c):R()?n(J,1):Ce()?n(h,2):n($,-1)})}r(F,T)},te=F=>{var B=hr(),k=_e(B);{var T=h=>{var $=vr(),n=oe($,!0);M(()=>ae(n,ue())),r(h,$)};L(k,h=>{ue()&&h(T)})}var C=S(k,2);{var c=h=>{var $=he(),n=m($);le(n,()=>t(fe));var a=S(n,2);z(a,()=>je,(i,y)=>{y(i,{})}),r(h,$)};L(C,h=>{t(fe).length&&h(c)})}var J=S(C,2);le(J,()=>t(ze)),me(B),r(F,B)};let G=o(()=>Z()&&R()?"contents!":"");Vt(u,{align:"end",get portal(){return Ie()},get side(){return ke()},get class(){return t(G)},get open(){return t(ee)},set open(F){De(ee,F,!0)},trigger:p,content:te,$$slots:{trigger:!0,content:!0}})}me(d),M(()=>$t(d,1,`${Z()&&R()?"contents":"inline-flex items-center"} ${xe()??""}`)),r(e,d)};L(ot,e=>{$e()?e(at):e(nt,-1)})}r(O,He);var st=It(rt);return qe(),st}export{wr as O,sr as a,Je as r,ir as s};
|
|
1
|
+
import{t as _t,bq as _,a_ as L,by as mt,bs as gt,b as vt,bo as x,bu as be,bt as Te}from"./CNRXwQIm.js";import{bs as ht,cd as yt,ca as wt,bk as xt,a7 as N,ay as m,W as r,bn as It,aA as g,aD as t,bS as S,a5 as _e,bH as De,bA as me,b_ as M,aB as E,c9 as o,bf as kt,bl as oe,bO as ae,bV as Ct}from"./DYhIMPy1.js";import{v as $t,n as Pt,u as Be,i as At}from"./CSGwK3Iy.js";import{s as Me}from"./DCwCW5T0.js";import{c as z}from"./B84qHti4.js";import{cD as Et,bj as Ot,aI as Ft,F as ne,aV as Tt,aJ as Dt,bk as Bt,a4 as Ve,as as Lt}from"./C9E3dZMW.js";import{W as Nt,T as St,G as zt,C as Rt,X as Ht,J as Wt,V as Mt}from"./CXXJ19Uk.js";import{f as ge}from"./CzFRvFff.js";import{h as Vt}from"./CHo0aT92.js";import{k as jt,R as Gt,o as Jt,n as qt,m as Kt,l as je}from"./BDHvJBXG.js";import{k as ve}from"./BdVXLC6D.js";import{c as Ut}from"./ChTqQfQN.js";import"./BYBI0ipE.js";import{Ia as Ge,mS as Xt,ES as Yt}from"./B_TVaDKX.js";import{w as Qt}from"./Cbpg9otW.js";import{i as U}from"./C6CEtMPQ.js";import{bl as Zt,b2 as er,a$ as tr}from"./B-bq_ltD.js";import{cl as rr}from"./9uHm6kyM.js";import{t as or}from"./H2jLkRRS.js";const ar={cursor:Rt,ghostty:zt,terminal:St,warp:Nt},nr={vscode:Mt,jetbrains:Wt,xcode:Ht};function sr(O){return ar[O.id]??nr[O.handlerType]??null}function Je(O){return O==="terminal"?Et:O==="finder"?Ot:Ft}const ir="shrink-0 text-muted-foreground hover:text-foreground focus-visible:text-foreground [&_svg]:size-4",Le="finder",lr={id:Le,name:"Finder",shortLabel:"Finder",appName:"Finder",category:"finder",handlerType:"finder",installed:!0,priority:0};function cr(O,s=[]){const se=new Set(s),X=O.filter(({installed:Y,id:ye})=>Y&&!se.has(ye));return X.some(({id:Y})=>Y===Le)||se.has(Le)?X:[...X,lr]}var dr=E('<img alt="" class="size-4"/>'),ur=E('<kbd class="type-caption ml-4 text-muted-foreground" aria-hidden="true"> </kbd>'),pr=E('<span class="min-w-0 flex-1 truncate"> </span> <!>',1),fr=E("<span> </span>"),he=E("<!> <!>",1),br=E("<span><!></span>"),_r=E('<img class="w-4 h-4"/>'),mr=E('<!> <span class="text-muted-foreground"> </span>',1),gr=E('<div class="inline-flex items-stretch rounded-md border border-border" data-open-combo-control=""><!> <!></div>'),vr=E('<div class="type-caption px-2 py-1.5 text-subtle"> </div>'),hr=E('<div class="w-60 max-w-full"><!> <!> <!></div>'),yr=E("<div><!></div>");function wr(O,s){if(new.target)return _t({component:wr,...O});ht(s,!0);const se=()=>be(Ue,"$installedEditors$",ie),X=()=>be(Xe,"$hiddenEditorIds$",ie),Y=()=>be(Ye,"$isWorkspaceHostLocal$",ie),ye=()=>be(Ke,"$openAction",ie),[ie,qe]=gt(),le=(e,d=kt)=>{var u=N(),p=m(u);z(p,()=>Gt,(te,G)=>{G(te,{get value(){return t(v).id},children:(F,B)=>{var k=N(),T=m(k);Pt(T,17,d,C=>C.id,(C,c)=>{var J=N(),h=m(J);{const $=a=>{var i=N(),y=m(i);{var H=l=>{var A=dr();M(()=>Be(A,"src",`data:image/png;base64,${t(c).iconBase64??""}`)),r(l,A)},b=l=>{const A=o(()=>t(c).icon);var W=N(),D=m(W);z(D,()=>t(A),(q,re)=>{re(q,{size:16})}),r(l,W)},P=l=>{{let A=o(()=>t(c).faIcon??Je(t(c).category));ne(l,{get icon(){return t(A)},class:"size-4 text-muted-foreground"})}};L(y,l=>{t(c).iconBase64?l(H):t(c).icon?l(b,1):l(P,-1)})}r(a,i)};let n=o(()=>!I());z(h,()=>jt,(a,i)=>{i(a,{get value(){return t(c).id},closeOnSelect:!0,get disabled(){return t(n)},onSelect:()=>tt(t(c).id),get textValue(){return t(c).label},leading:$,children:(y,H)=>{var b=pr(),P=m(b),l=oe(P,!0),A=S(P,2);{var W=D=>{var q=ur(),re=oe(q,!0);M(()=>ae(re,t(c).shortcut)),r(D,q)};L(A,D=>{t(c).shortcut&&D(W)})}M(()=>ae(l,t(c).label)),r(y,b)},$$slots:{leading:!0,default:!0}})})}r(C,J)}),r(F,k)},$$slots:{default:!0}})}),r(e,u)},Ne=Ut("OpenComboButton");let I=_(s,"filePath",7),ce=_(s,"workspaceId",7,""),de=_(s,"isDirectory",7,!0),we=_(s,"workspaceFolderPath",7),xe=_(s,"class",7,""),ue=_(s,"headerText",7),Ie=_(s,"usePortal",7,!0),ke=_(s,"side",7,"bottom"),V=_(s,"variant",7,"default"),Q=_(s,"branchName",7),Ce=_(s,"compact",7,!1),$e=_(s,"embedded",7,!1),Z=_(s,"inline",7,!1),j=_(s,"iconOnly",7,!1),R=_(s,"children",7,void 0);const Se=o(()=>V()==="sidebar"?"bg-sidebar hover:bg-sidebar/80":"bg-background hover:bg-muted"),Pe=yt(ce());wt(()=>{Pe.set(ce())});const Ke=Zt(),Ue=er(Pe),Xe=tr(),Ye=rr(Pe);let ee=Ct(!1);xt(()=>{Ge.dispatch(Xt())});function Qe(e){return{id:e.id,label:e.name,shortLabel:e.shortLabel,icon:sr(e),shortcut:e.shortcut,handlerType:e.handlerType,appName:e.appName,category:e.category,iconBase64:e.iconBase64}}const Ze=Qt("externalEditors");let f=o(()=>{const e=se(),d=cr(e,X()).map(Qe),u={id:"other",label:x.ui_openCombo_other_label(),shortLabel:x.ui_openCombo_other_label(),icon:null,faIcon:Bt,handlerType:"generic"},p=[{id:"copy",label:x.ui_openCombo_copyPath_label(),shortLabel:x.ui_openCombo_copy_shortLabel(),icon:null,faIcon:Tt},...Q()?[{id:"copy-branch",label:x.ui_openCombo_copyBranch_label(),shortLabel:x.ui_openCombo_copyBranch_shortLabel(),icon:null,faIcon:Dt}]:[]];return!Ze||!Y()?p:[...d,u,...p]});const pe=o(()=>t(f).some(e=>e.id!=="copy"&&e.id!=="copy-branch")),fe=o(()=>t(f).filter(e=>e.id!=="copy"&&e.id!=="copy-branch")),ze=o(()=>t(f).filter(e=>e.id==="copy"||e.id==="copy-branch")),v=o(()=>t(pe)?t(f).find(e=>e.id===ye())||t(f)[0]:t(f).find(e=>e.id==="copy")||t(f)[0]),Ae=o(()=>t(pe)?x.ui_openCombo_openIn_tooltip({name:t(v).label}):t(v).label);function Ee(){if(de())return I();const e=we()||I().substring(0,I().lastIndexOf("/"));return e?{folder:e,file:I()}:I()}async function Oe(e){if(!I())return;const d=de()?I():I().substring(0,I().lastIndexOf("/"));try{if(e==="copy"){await navigator.clipboard.writeText(or(I())),ve.success(x.ui_openCombo_pathCopied_label());return}if(e==="copy-branch"){Q()&&(await navigator.clipboard.writeText(Q()),ve.success(x.ui_openCombo_branchCopied_label()));return}if(e==="other"){const p=await U("external-editors:open-with-other",{path:d});p?.success?De(ee,!1):p?.error&&p.error!=="No application selected"&&ve.error(p.error);return}const u=t(f).find(p=>p.id===e);if(!u){Ne.warn(`Unknown action: ${e}`);return}switch(u.handlerType){case"finder":await U("shell:showItemInFolder",{path:d});break;case"vscode":await U("vscode:open",Ee());break;case"jetbrains":await U("jetbrains:open",Ee());break;case"xcode":await U("xcode:open",Ee());break;case"generic":default:{await U("external-editors:open",{editorId:u.id,path:d});break}}}catch(u){Ne.error(`Failed to execute action ${e}:`,u),ve.error(u instanceof Error?u.message:x.ui_openCombo_openFailed_error({name:e}))}}function Fe(e){e.stopPropagation(),Oe(t(v).id)}function et(e){e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),e.stopPropagation(),Oe(t(v).id))}function Re(e){e.stopPropagation()}function tt(e){Ge.dispatch(Yt(e)),Oe(e),De(ee,!1)}var rt={get filePath(){return I()},set filePath(e){I(e),g()},get workspaceId(){return ce()},set workspaceId(e=""){ce(e),g()},get isDirectory(){return de()},set isDirectory(e=!0){de(e),g()},get workspaceFolderPath(){return we()},set workspaceFolderPath(e){we(e),g()},get class(){return xe()},set class(e=""){xe(e),g()},get headerText(){return ue()},set headerText(e){ue(e),g()},get usePortal(){return Ie()},set usePortal(e=!0){Ie(e),g()},get side(){return ke()},set side(e="bottom"){ke(e),g()},get variant(){return V()},set variant(e="default"){V(e),g()},get branchName(){return Q()},set branchName(e){Q(e),g()},get compact(){return Ce()},set compact(e=!1){Ce(e),g()},get embedded(){return $e()},set embedded(e=!1){$e(e),g()},get inline(){return Z()},set inline(e=!1){Z(e),g()},get iconOnly(){return j()},set iconOnly(e=!1){j(e),g()},get children(){return R()},set children(e=void 0){R(e),g()},$set:mt,$on:(e,d)=>vt(s,e,d)},He=N(),ot=m(He);{var at=e=>{var d=he(),u=m(d);{var p=G=>{var F=he(),B=m(F);z(B,()=>Kt,(T,C)=>{C(T,{children:(c,J)=>{var h=he(),$=m(h);z($,()=>Jt,(a,i)=>{i(a,{get icon(){return Ve},children:(y,H)=>{var b=fr(),P=oe(b,!0);M(l=>ae(P,l),[()=>x.ui_openCombo_openInApp_tooltip()]),r(y,b)},$$slots:{default:!0}})});var n=S($,2);z(n,()=>qt,(a,i)=>{i(a,{class:"w-60",children:(y,H)=>{le(y,()=>t(fe))},$$slots:{default:!0}})}),r(c,h)},$$slots:{default:!0}})});var k=S(B,2);z(k,()=>je,(T,C)=>{C(T,{})}),r(G,F)};L(u,G=>{t(fe).length&&G(p)})}var te=S(u,2);le(te,()=>t(ze)),r(e,d)},nt=e=>{var d=yr(),u=_e(d);{const p=(F,B)=>{let k=()=>(B?.()).props;var T=N(),C=m(T);{var c=n=>{var a=br();At(a,()=>({role:"button",tabindex:"0",onclick:t(f).length>1?void 0:Fe,onkeydown:t(f).length>1?void 0:et,...t(f).length>1?k():{},class:"cursor-pointer break-words rounded-sm text-inherit underline decoration-muted-foreground/20 underline-offset-2 hover:decoration-current focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",title:t(Ae)}));var i=_e(a);Me(i,R),me(a),r(n,a)},J=n=>{{let a=o(()=>t(f).length>1?void 0:Fe),i=o(()=>j()&&V()!=="sidebar"?"plain":"ghost"),y=o(()=>j()?V()==="sidebar"?"icon-compact":"icon-sm":void 0),H=o(()=>j()&&V()==="sidebar"&&t(ee)),b=o(()=>!j()),P=o(()=>j()?V()==="sidebar"?ir:"cursor-pointer text-muted-foreground hover:text-foreground focus-visible:text-foreground":"cursor-pointer");ge(n,Te({type:"button",get onclick(){return t(a)}},()=>t(f).length>1?k():{},{get variant(){return t(i)},get size(){return t(y)},get active(){return t(H)},get wrapContent(){return t(b)},get class(){return t(P)},get title(){return t(Ae)},children:(l,A)=>{var W=N(),D=m(W);Me(D,R),r(l,W)},$$slots:{default:!0}}))}},h=n=>{{let a=o(()=>x.ui_openCombo_openInApp_tooltip());ge(n,Te(k,{variant:"ghost-light",size:"icon-xs",get tooltip(){return t(a)},tooltipSide:"bottom",children:(i,y)=>{ne(i,{get icon(){return Ve},size:"xs"})},$$slots:{default:!0}}))}},$=n=>{var a=gr(),i=_e(a);{let b=o(()=>t(f).length>1?"rounded-r-none":""),P=o(()=>t(Se)),l=o(()=>t(pe)?t(Ae):void 0);ge(i,{type:"button",variant:"ghost",size:"sm",get class(){return`gap-1.5 px-2 ${t(b)??""} ${t(P)??""}`},onpointerdown:Re,onkeydown:Re,onclick:Fe,get title(){return t(l)},children:(A,W)=>{var D=mr(),q=m(D);{var re=w=>{var K=_r();M(()=>{Be(K,"src",`data:image/png;base64,${t(v).iconBase64??""}`),Be(K,"alt",t(v).label)}),r(w,K)},it=w=>{const K=o(()=>t(v).icon);var We=N(),pt=m(We);z(pt,()=>t(K),(ft,bt)=>{bt(ft,{size:14})}),r(w,We)},lt=w=>{ne(w,{get icon(){return t(v).faIcon},class:"w-3.5 h-3.5 opacity-60"})},ct=w=>{{let K=o(()=>Je(t(v).category));ne(w,{get icon(){return t(K)},class:"w-3.5 h-3.5 opacity-60"})}};L(q,w=>{t(v).iconBase64?w(re):t(v).icon?w(it,1):t(v).faIcon?w(lt,2):w(ct,-1)})}var dt=S(q,2),ut=oe(dt,!0);M(w=>ae(ut,w),[()=>t(pe)?x.ui_openCombo_open_label():t(v).label]),r(A,D)},$$slots:{default:!0}})}var y=S(i,2);{var H=b=>{{let P=o(()=>x.ui_openCombo_openInApp_tooltip());ge(b,Te(k,{type:"button",variant:"ghost",size:"icon-sm",get"aria-label"(){return t(P)},get class(){return`rounded-l-none border-l border-border ${t(Se)??""}`},children:(l,A)=>{ne(l,{get icon(){return Lt},class:"size-3! text-muted-foreground"})},$$slots:{default:!0}}))}};L(y,b=>{t(f).length>1&&b(H)})}me(a),r(n,a)};L(C,n=>{Z()&&R()?n(c):R()?n(J,1):Ce()?n(h,2):n($,-1)})}r(F,T)},te=F=>{var B=hr(),k=_e(B);{var T=h=>{var $=vr(),n=oe($,!0);M(()=>ae(n,ue())),r(h,$)};L(k,h=>{ue()&&h(T)})}var C=S(k,2);{var c=h=>{var $=he(),n=m($);le(n,()=>t(fe));var a=S(n,2);z(a,()=>je,(i,y)=>{y(i,{})}),r(h,$)};L(C,h=>{t(fe).length&&h(c)})}var J=S(C,2);le(J,()=>t(ze)),me(B),r(F,B)};let G=o(()=>Z()&&R()?"contents!":"");Vt(u,{align:"end",get portal(){return Ie()},get side(){return ke()},get class(){return t(G)},get open(){return t(ee)},set open(F){De(ee,F,!0)},trigger:p,content:te,$$slots:{trigger:!0,content:!0}})}me(d),M(()=>$t(d,1,`${Z()&&R()?"contents":"inline-flex items-center"} ${xe()??""}`)),r(e,d)};L(ot,e=>{$e()?e(at):e(nt,-1)})}r(O,He);var st=It(rt);return qe(),st}export{wr as O,sr as a,Je as r,ir as s};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as Gt,aZ as Kt,U as Ht,Y as Yt,b0 as Xt,V as Zt,a_ as Jt,b as w,W as wt,aX as Qt,aW as ot,i as $t,an as te,au as ee,H as ne,B as se,r as ie,q as oe,O as re}from"./B0atVUKu.js";const kt=(t,n)=>Gt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,o=0;const r=[];if(e.length>1){const l=Et(e);for(let u=0;u<e.length;++u){const a=e[u];a.angle=Math.atan2(a.x-l.x,a.y-l.y)}e.sort((u,a)=>a.angle-u.angle);let f=e[e.length-1];for(let u=0;u<e.length;++u){const a=e[u];o+=(f.x+a.x)*(a.y-f.y);const y={x:(a.x+f.x)/2,y:(a.y+f.y)/2};let h=null;for(let b=0;b<a.parentIndex.length;++b)if(f.parentIndex.includes(a.parentIndex[b])){const p=t[a.parentIndex[b]],M=Math.atan2(a.x-p.x,a.y-p.y),E=Math.atan2(f.x-p.x,f.y-p.y);let _=E-M;_<0&&(_+=2*Math.PI);const S=E-_/2;let g=q(y,{x:p.x+p.radius*Math.sin(S),y:p.y+p.radius*Math.cos(S)});g>p.radius*2&&(g=p.radius*2),(h==null||h.width>g)&&(h={circle:p,width:g,p1:a,p2:f,large:g>p.radius,sweep:!0})}h!=null&&(r.push(h),i+=lt(h.circle.radius,h.width),f=a)}}else{let l=t[0];for(let u=1;u<t.length;++u)t[u].radius<l.radius&&(l=t[u]);let f=!1;for(let u=0;u<t.length;++u)if(q(t[u],l)>Math.abs(l.radius-t[u].radius)){f=!0;break}f?i=o=0:(i=l.radius*l.radius*Math.PI,r.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return o/=2,n&&(n.area=i+o,n.arcArea=i,n.polygonArea=o,n.arcs=r,n.innerPoints=e,n.intersectionPoints=s),i+o}function ae(t,n){return n.every(s=>q(t,s)<s.radius+_t)}function le(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=Tt(t[s],t[e]);for(const o of i)o.parentIndex=[s,e],n.push(o)}return n}function lt(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function q(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}function xt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Tt(t,n){const s=q(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const o=(e*e-i*i+s*s)/(2*s),r=Math.sqrt(e*e-o*o),l=t.x+o*(n.x-t.x)/s,f=t.y+o*(n.y-t.y)/s,u=-(n.y-t.y)*(r/s),a=-(n.x-t.x)*(r/s);return[{x:l+u,y:f-a},{x:l-u,y:f+a}]}function Et(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,o=e.tolerance||1e-10,r=t(n),l=t(s);let f=s-n;if(r*l>0)throw"Initial bisect points must have opposite signs";if(r===0)return n;if(l===0)return s;for(let u=0;u<i;++u){f/=2;const a=n+f,y=t(a);if(y*r>=0&&(n=a),Math.abs(f)<o||y===0)return a}return n+f}function ct(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}function Mt(t,n){return ct(t).map(()=>ct(n))}function $(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}function ut(t){return Math.sqrt($(t,t))}function ft(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function Z(t,n,s,e,i){for(let o=0;o<t.length;++o)t[o]=n*s[o]+e*i[o]}function zt(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,o=s.zeroDelta||.001,r=s.minErrorDelta||1e-6,l=s.minErrorDelta||1e-5,f=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,a=s.psi!==void 0?s.psi:-.5,y=s.sigma!==void 0?s.sigma:.5;let h;const b=n.length,p=new Array(b+1);p[0]=n,p[0].fx=t(n),p[0].id=0;for(let v=0;v<b;++v){const c=n.slice();c[v]=c[v]?c[v]*i:o,p[v+1]=c,p[v+1].fx=t(c),p[v+1].id=v+1}function M(v){for(let c=0;c<v.length;c++)p[b][c]=v[c];p[b].fx=v.fx}const E=(v,c)=>v.fx-c.fx,_=n.slice(),S=n.slice(),g=n.slice(),m=n.slice();for(let v=0;v<e;++v){if(p.sort(E),s.history){const x=p.map(d=>{const C=d.slice();return C.fx=d.fx,C.id=d.id,C});x.sort((d,C)=>d.id-C.id),s.history.push({x:p[0].slice(),fx:p[0].fx,simplex:x})}h=0;for(let x=0;x<b;++x)h=Math.max(h,Math.abs(p[0][x]-p[1][x]));if(Math.abs(p[0].fx-p[b].fx)<r&&h<l)break;for(let x=0;x<b;++x){_[x]=0;for(let d=0;d<b;++d)_[x]+=p[d][x];_[x]/=b}const c=p[b];if(Z(S,1+f,_,-f,c),S.fx=t(S),S.fx<p[0].fx)Z(m,1+u,_,-u,c),m.fx=t(m),m.fx<S.fx?M(m):M(S);else if(S.fx>=p[b-1].fx){let x=!1;if(S.fx>c.fx?(Z(g,1+a,_,-a,c),g.fx=t(g),g.fx<c.fx?M(g):x=!0):(Z(g,1-a*f,_,a*f,c),g.fx=t(g),g.fx<S.fx?M(g):x=!0),x){if(y>=1)break;for(let d=1;d<p.length;++d)Z(p[d],1-y,p[0],y,p[d]),p[d].fx=t(p[d])}}else M(S)}return p.sort(E),{fx:p[0].fx,x:p[0]}}function ue(t,n,s,e,i,o,r){const l=s.fx,f=$(s.fxprime,n);let u=l,a=l,y=f,h=0;i=i||1,o=o||1e-6,r=r||.1;function b(p,M,E){for(let _=0;_<16;++_)if(i=(p+M)/2,Z(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||u>=E)M=i;else{if(Math.abs(y)<=-r*f)return i;y*(M-p)>=0&&(M=p),p=i,E=u}return 0}for(let p=0;p<10;++p){if(Z(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||p&&u>=a)return b(h,i,a);if(Math.abs(y)<=-r*f)return i;if(y>=0)return b(i,h,u);a=u,h=i,i*=2}return i}function fe(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const o=n.slice();let r,l,f=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),r=e.fxprime.slice(),ft(r,e.fxprime,-1);for(let a=0;a<u;++a){if(f=ue(t,r,e,i,f),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),!f)ft(r,e.fxprime,-1);else{Z(o,1,i.fxprime,-1,e.fxprime);const y=$(e.fxprime,e.fxprime),h=Math.max(0,$(o,i.fxprime)/y);Z(r,h,r,-1,i.fxprime),l=e,e=i,i=l}if(ut(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),e}function At(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||xe,e=n.lossFunction||tt,i=he(t,n),o=s(i,n),r=Object.keys(o),l=[];for(const a of r)l.push(o[a].x),l.push(o[a].y);const u=zt(a=>{const y={};for(let h=0;h<r.length;++h){const b=r[h];y[b]={x:a[2*h],y:a[2*h+1],radius:o[b].radius}}return e(y,i)},l,n).x;for(let a=0;a<r.length;++a){const y=r[a];o[y].x=u[2*a],o[y].y=u[2*a+1]}return o}const Rt=1e-10;function ht(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Rt?Math.abs(t-n):ce(e=>xt(t,n,e)-s,0,t+n)}function he(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){const l=new Map;for(const f of e)for(let u=0;u<f.sets.length;u++){const a=String(f.sets[u]);l.set(a,f.size+(l.get(a)||0));for(let y=u+1;y<f.sets.length;y++){const h=String(f.sets[y]),b=`${a};${h}`,p=`${h};${a}`;l.set(b,f.size+(l.get(b)||0)),l.set(p,f.size+(l.get(p)||0))}}for(const f of e)f.sets.length<3&&(f.size=l.get(i(f.sets)))}const o=[],r=new Set;for(const l of e)if(l.sets.length===1)o.push(l.sets[0]);else if(l.sets.length===2){const f=l.sets[0],u=l.sets[1];r.add(i(l.sets)),r.add(i([u,f]))}o.sort((l,f)=>l===f?0:l<f?-1:1);for(let l=0;l<o.length;++l){const f=o[l];for(let u=l+1;u<o.length;++u){const a=o[u];r.has(i([f,a]))||e.push({sets:[f,a],size:0})}}return e}function de(t,n,s){const e=Mt(n.length,n.length),i=Mt(n.length,n.length);return t.filter(o=>o.sets.length===2).forEach(o=>{const r=s[o.sets[0]],l=s[o.sets[1]],f=Math.sqrt(n[r].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ht(f,u,o.size);e[r][l]=e[l][r]=a;let y=0;o.size+1e-10>=Math.min(n[r].size,n[l].size)?y=1:o.size<=1e-10&&(y=-1),i[r][l]=i[l][r]=y}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let o=0;o<n.length;++o)n[o]=0;let i=0;for(let o=0;o<s.length;++o){const r=t[2*o],l=t[2*o+1];for(let f=o+1;f<s.length;++f){const u=t[2*f],a=t[2*f+1],y=s[o][f],h=e[o][f],b=(u-r)*(u-r)+(a-l)*(a-l),p=Math.sqrt(b),M=b-y*y;h>0&&p<=y||h<0&&p>=y||(i+=2*M*M,n[2*o]+=4*M*(r-u),n[2*o+1]+=4*M*(l-a),n[2*f]+=4*M*(u-r),n[2*f+1]+=4*M*(a-l))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||tt;if(t.length>=8){const i=ye(t,n),o=e(i,t),r=e(s,t);o+1e-8<r&&(s=i)}return s}function ye(t,n={}){const s=n.restarts||10,e=[],i={};for(const h of t)h.sets.length===1&&(i[h.sets[0]]=e.length,e.push(h));let{distances:o,constraints:r}=de(t,e,i);const l=ut(o.map(ut))/o.length;o=o.map(h=>h.map(b=>b/l));const f=(h,b)=>ge(h,b,o,r);let u=null;for(let h=0;h<s;++h){const b=ct(o.length*2).map(Math.random),p=fe(f,b,n);(!u||p.fx<u.fx)&&(u=p)}const a=u.x,y={};for(let h=0;h<e.length;++h){const b=e[h];y[b.sets[0]]={x:a[2*h]*l,y:a[2*h+1]*l,radius:Math.sqrt(b.size/Math.PI)}}if(n.history)for(const h of n.history)ft(h.x,l);return y}function pe(t,n){const s=n&&n.lossFunction?n.lossFunction:tt,e={},i={};for(const y of t)if(y.sets.length===1){const h=y.sets[0];e[h]={x:1e10,y:1e10,rowid:e.length,size:y.size,radius:Math.sqrt(y.size/Math.PI)},i[h]=[]}t=t.filter(y=>y.sets.length===2);for(const y of t){let h=y.weight!=null?y.weight:1;const b=y.sets[0],p=y.sets[1];y.size+Rt>=Math.min(e[b].size,e[p].size)&&(h=0),i[b].push({set:p,size:y.size,weight:h}),i[p].push({set:b,size:y.size,weight:h})}const o=[];Object.keys(i).forEach(y=>{let h=0;for(let b=0;b<i[y].length;++b)h+=i[y][b].size*i[y][b].weight;o.push({set:y,size:h})});function r(y,h){return h.size-y.size}o.sort(r);const l={};function f(y){return y.set in l}function u(y,h){e[h].x=y.x,e[h].y=y.y,l[h]=!0}u({x:0,y:0},o[0].set);for(let y=1;y<o.length;++y){const h=o[y].set,b=i[h].filter(f),p=e[h];if(b.sort(r),b.length===0)throw"ERROR: missing pairwise overlap information";const M=[];for(var a=0;a<b.length;++a){const S=e[b[a].set],g=ht(p.radius,S.radius,b[a].size);M.push({x:S.x+g,y:S.y}),M.push({x:S.x-g,y:S.y}),M.push({y:S.y+g,x:S.x}),M.push({y:S.y-g,x:S.x});for(let m=a+1;m<b.length;++m){const v=e[b[m].set],c=ht(p.radius,v.radius,b[m].size),x=Tt({x:S.x,y:S.y,radius:g},{x:v.x,y:v.y,radius:c});M.push(...x)}}let E=1e50,_=M[0];for(const S of M){e[h].x=S.x,e[h].y=S.y;const g=s(e,t);g<E&&(E=g,_=S)}u(_,h)}return e}function tt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const r=t[e.sets[0]],l=t[e.sets[1]];i=xt(r.radius,l.radius,q(r,l))}else i=st(e.sets.map(r=>t[r]));const o=e.weight!=null?e.weight:1;s+=o*(i-e.size)*(i-e.size)}return s}function Ct(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],f=t[e.sets[1]];i=xt(l.radius,f.radius,q(l,f))}else i=st(e.sets.map(l=>t[l]));const o=e.weight!=null?e.weight:1,r=Math.log((i+1)/(e.size+1));s+=o*r*r}return s}function me(t,n,s){if(s==null?t.sort((i,o)=>o.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,o=t[0].y;for(const r of t)r.x-=i,r.y-=o}if(t.length===2&&q(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,o=Math.cos(i),r=Math.sin(i);for(const l of t){const f=l.x,u=l.y;l.x=o*f-r*u,l.y=r*f+o*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const o=t[1].y/(1e-10+t[1].x);for(const r of t){var e=(r.x+o*r.y)/(1+o*o);r.x=2*e-r.x,r.y=2*e*o-r.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,o){const r=n(i),l=n(o);r.parent=l}for(let i=0;i<t.length;++i)for(let o=i+1;o<t.length;++o){const r=t[i].radius+t[o].radius;q(t[i],t[o])+1e-10<r&&s(t[o],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const o=n(t[i]).parent.setid;e.has(o)||e.set(o,[]),e.get(o).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((o,r)=>Math.max(o,r[s]+r.radius),Number.NEGATIVE_INFINITY),i=t.reduce((o,r)=>Math.min(o,r[s]-r.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Dt(t,n,s){n==null&&(n=Math.PI/2);let e=Ft(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let o=e.bounds;const r=(o.xRange.max-o.xRange.min)/50;function l(u,a,y){if(!u)return;const h=u.bounds;let b,p;if(a)b=o.xRange.max-h.xRange.min+r;else{b=o.xRange.max-h.xRange.max;const M=(h.xRange.max-h.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;M<0&&(b+=M)}if(y)p=o.yRange.max-h.yRange.min+r;else{p=o.yRange.max-h.yRange.max;const M=(h.yRange.max-h.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;M<0&&(p+=M)}for(const M of u)M.x+=b,M.y+=p,e.push(M)}let f=1;for(;f<i.length;)l(i[f],!0,!1),l(i[f+1],!1,!0),l(i[f+2],!0,!0),f+=3,o=dt(e);return Nt(e)}function Ot(t,n,s,e,i){const o=Ft(t);n-=2*e,s-=2*e;const{xRange:r,yRange:l}=dt(o);if(r.max===r.min||l.max===l.min)return console.log("not scaling solution: zero size detected"),t;let f,u;if(i){const b=Math.sqrt(i/Math.PI)*2;f=n/b,u=s/b}else f=n/(r.max-r.min),u=s/(l.max-l.min);const a=Math.min(u,f),y=(n-(r.max-r.min)*a)/2,h=(s-(l.max-l.min)*a)/2;return Nt(o.map(b=>({radius:a*b.radius,x:e+y+(b.x-r.min)*a,y:e+h+(b.y-l.min)*a,setid:b.setid})))}function Nt(t){const n={};for(const s of t)n[s.setid]=s;return n}function Ft(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,o=1e3,r=Math.PI/2,l=!0,f=null,u=!0,a=!0,y=null,h=null,b=!1,p=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,E={},_=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],S=0,g=function(x){if(x in E)return E[x];var d=E[x]=_[S];return S+=1,S>=_.length&&(S=0),d},m=At,v=tt;function c(x){let d=x.datum();const C=new Set;d.forEach(k=>{k.size==0&&k.sets.length==1&&C.add(k.sets[0])}),d=d.filter(k=>!k.sets.some(O=>C.has(O)));let I={},D={};if(d.length>0){let k=m(d,{lossFunction:v,distinct:b});l&&(k=Dt(k,r,h)),I=Ot(k,s,e,i,f),D=Lt(I,d,M)}const U={};d.forEach(k=>{k.label&&(U[k.sets]=k.label)});function V(k){if(k.sets in U)return U[k.sets];if(k.sets.length==1)return""+k.sets[0]}x.selectAll("svg").data([I]).enter().append("svg");const F=x.select("svg");n?F.attr("viewBox",`0 0 ${s} ${e}`):F.attr("width",s).attr("height",e);const R={};let T=!1;F.selectAll(".venn-area path").each(function(k){const O=this.getAttribute("d");k.sets.length==1&&O&&!b&&(T=!0,R[k.sets[0]]=Me(O))});function A(k){return O=>{const K=k.sets.map(et=>{let Y=R[et],X=I[et];return Y||(Y={x:s/2,y:e/2,radius:1}),X||(X={x:s/2,y:e/2,radius:1}),{x:Y.x*(1-O)+X.x*O,y:Y.y*(1-O)+X.y*O,radius:Y.radius*(1-O)+X.radius*O}});return St(K,p)}}const W=F.selectAll(".venn-area").data(d,k=>k.sets),P=W.enter().append("g").attr("class",k=>`venn-area venn-${k.sets.length==1?"circle":"intersection"}${k.colour||k.color?" venn-coloured":""}`).attr("data-venn-sets",k=>k.sets.join("_")),B=P.append("path"),G=P.append("text").attr("class","label").text(k=>V(k)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(B.style("fill-opacity","0").filter(k=>k.sets.length==1).style("fill",k=>k.colour?k.colour:k.color?k.color:g(k.sets)).style("fill-opacity",".25"),G.style("fill",k=>k.colour||k.color?"#FFF":t.textFill?t.textFill:k.sets.length==1?g(k.sets):"#444"));function L(k){return typeof k.transition=="function"?k.transition("venn").duration(o):k}let z=x;T&&typeof z.transition=="function"?(z=L(x),z.selectAll("path").attrTween("d",A)):z.selectAll("path").attr("d",k=>St(k.sets.map(O=>I[O])),p);const N=z.selectAll("text").filter(k=>k.sets in D).text(k=>V(k)).attr("x",k=>Math.floor(D[k.sets].x)).attr("y",k=>Math.floor(D[k.sets].y));u&&(T?"on"in N?N.on("end",rt(I,V)):N.each("end",rt(I,V)):N.each(rt(I,V)));const j=L(W.exit()).remove();typeof W.transition=="function"&&j.selectAll("path").attrTween("d",A);const Q=j.selectAll("text").attr("x",s/2).attr("y",e/2);return y!==null&&(G.style("font-size","0px"),N.style("font-size",y),Q.style("font-size","0px")),{circles:I,textCentres:D,nodes:W,enter:P,update:z,exit:j}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(b=x,c):b},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(y=x,c):y},c.round=function(x){return arguments.length?(p=x,c):p},c.duration=function(x){return arguments.length?(o=x,c):o},c.layoutFunction=function(x){return arguments.length?(m=x,c):m},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(f=x,c):f},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(r=x,c):r},c.orientationOrder=function(x){return arguments.length?(h=x,c):h},c.lossFunction=function(x){return arguments.length?(v=x==="default"?tt:x==="logRatio"?Ct:x,c):v},c}function rt(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,o=n(s)||"",r=o.split(/\s+/).reverse(),f=(o.length+r.length)/3;let u=r.pop(),a=[u],y=0;const h=1.1;e.textContent=null;const b=[];function p(g){const m=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return m.textContent=g,b.push(m),e.append(m),m}let M=p(u);for(;u=r.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>f&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=p(u),y++)}const E=.35-y*h/2,_=e.getAttribute("x"),S=e.getAttribute("y");b.forEach((g,m)=>{g.setAttribute("x",_),g.setAttribute("y",S),g.setAttribute("dy",`${E+m*h}em`)})}}function at(t,n,s){let e=n[0].radius-q(n[0],t);for(let i=1;i<n.length;++i){const o=n[i].radius-q(n[i],t);o<=e&&(e=o)}for(let i=0;i<s.length;++i){const o=q(s[i],t)-s[i].radius;o<=e&&(e=o)}return e}function jt(t,n,s){const e=[];for(const a of t)e.push({x:a.x,y:a.y}),e.push({x:a.x+a.radius/2,y:a.y}),e.push({x:a.x-a.radius/2,y:a.y}),e.push({x:a.x,y:a.y+a.radius/2}),e.push({x:a.x,y:a.y-a.radius/2});let i=e[0],o=at(e[0],t,n);for(let a=1;a<e.length;++a){const y=at(e[a],t,n);y>=o&&(i=e[a],o=y)}const r=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:r[0],y:r[1]};let f=!0;for(const a of t)if(q(l,a)>a.radius){f=!1;break}for(const a of n)if(q(l,a)<a.radius){f=!1;break}if(f)return l;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return st(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?jt(t,[]):Et(u.arcs.map(a=>a.p1))}function Ie(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],o=t[i];for(let r=e+1;r<s.length;++r){const l=s[r],f=t[l],u=q(o,f);u+f.radius<=o.radius+1e-10?n[l].push(i):u+o.radius<=f.radius+1e-10&&n[i].push(l)}}return n}function Lt(t,n,s){const e={},i=Ie(t);for(let o=0;o<n.length;++o){const r=n[o].sets,l={},f={};for(let h=0;h<r.length;++h){l[r[h]]=!0;const b=i[r[h]];for(let p=0;p<b.length;++p)f[b[p]]=!0}const u=[],a=[];for(let h in t)h in l?u.push(t[h]):h in f||a.push(t[h]);const y=jt(u,a,s);e[r]=y,y.disjoint&&n[o].size>0&&console.log("WARNING: area "+r+" not represented on screen")}return e}function ke(t,n,s){const e=[];return e.push(`
|
|
1
|
+
import{c as Gt,aZ as Kt,U as Ht,Y as Yt,b0 as Xt,V as Zt,a_ as Jt,b as w,W as wt,aX as Qt,aW as ot,i as $t,an as te,au as ee,H as ne,B as se,r as ie,q as oe,O as re}from"./DeTs9jD5.js";const kt=(t,n)=>Gt(t,"a",-n),_t=1e-10;function st(t,n){const s=le(t),e=s.filter(l=>ae(l,t));let i=0,o=0;const r=[];if(e.length>1){const l=Et(e);for(let u=0;u<e.length;++u){const a=e[u];a.angle=Math.atan2(a.x-l.x,a.y-l.y)}e.sort((u,a)=>a.angle-u.angle);let f=e[e.length-1];for(let u=0;u<e.length;++u){const a=e[u];o+=(f.x+a.x)*(a.y-f.y);const y={x:(a.x+f.x)/2,y:(a.y+f.y)/2};let h=null;for(let b=0;b<a.parentIndex.length;++b)if(f.parentIndex.includes(a.parentIndex[b])){const p=t[a.parentIndex[b]],M=Math.atan2(a.x-p.x,a.y-p.y),E=Math.atan2(f.x-p.x,f.y-p.y);let _=E-M;_<0&&(_+=2*Math.PI);const S=E-_/2;let g=q(y,{x:p.x+p.radius*Math.sin(S),y:p.y+p.radius*Math.cos(S)});g>p.radius*2&&(g=p.radius*2),(h==null||h.width>g)&&(h={circle:p,width:g,p1:a,p2:f,large:g>p.radius,sweep:!0})}h!=null&&(r.push(h),i+=lt(h.circle.radius,h.width),f=a)}}else{let l=t[0];for(let u=1;u<t.length;++u)t[u].radius<l.radius&&(l=t[u]);let f=!1;for(let u=0;u<t.length;++u)if(q(t[u],l)>Math.abs(l.radius-t[u].radius)){f=!0;break}f?i=o=0:(i=l.radius*l.radius*Math.PI,r.push({circle:l,p1:{x:l.x,y:l.y+l.radius},p2:{x:l.x-_t,y:l.y+l.radius},width:l.radius*2,large:!0,sweep:!0}))}return o/=2,n&&(n.area=i+o,n.arcArea=i,n.polygonArea=o,n.arcs=r,n.innerPoints=e,n.intersectionPoints=s),i+o}function ae(t,n){return n.every(s=>q(t,s)<s.radius+_t)}function le(t){const n=[];for(let s=0;s<t.length;++s)for(let e=s+1;e<t.length;++e){const i=Tt(t[s],t[e]);for(const o of i)o.parentIndex=[s,e],n.push(o)}return n}function lt(t,n){return t*t*Math.acos(1-n/t)-(t-n)*Math.sqrt(n*(2*t-n))}function q(t,n){return Math.sqrt((t.x-n.x)*(t.x-n.x)+(t.y-n.y)*(t.y-n.y))}function xt(t,n,s){if(s>=t+n)return 0;if(s<=Math.abs(t-n))return Math.PI*Math.min(t,n)*Math.min(t,n);const e=t-(s*s-n*n+t*t)/(2*s),i=n-(s*s-t*t+n*n)/(2*s);return lt(t,e)+lt(n,i)}function Tt(t,n){const s=q(t,n),e=t.radius,i=n.radius;if(s>=e+i||s<=Math.abs(e-i))return[];const o=(e*e-i*i+s*s)/(2*s),r=Math.sqrt(e*e-o*o),l=t.x+o*(n.x-t.x)/s,f=t.y+o*(n.y-t.y)/s,u=-(n.y-t.y)*(r/s),a=-(n.x-t.x)*(r/s);return[{x:l+u,y:f-a},{x:l-u,y:f+a}]}function Et(t){const n={x:0,y:0};for(const s of t)n.x+=s.x,n.y+=s.y;return n.x/=t.length,n.y/=t.length,n}function ce(t,n,s,e){e=e||{};const i=e.maxIterations||100,o=e.tolerance||1e-10,r=t(n),l=t(s);let f=s-n;if(r*l>0)throw"Initial bisect points must have opposite signs";if(r===0)return n;if(l===0)return s;for(let u=0;u<i;++u){f/=2;const a=n+f,y=t(a);if(y*r>=0&&(n=a),Math.abs(f)<o||y===0)return a}return n+f}function ct(t){const n=new Array(t);for(let s=0;s<t;++s)n[s]=0;return n}function Mt(t,n){return ct(t).map(()=>ct(n))}function $(t,n){let s=0;for(let e=0;e<t.length;++e)s+=t[e]*n[e];return s}function ut(t){return Math.sqrt($(t,t))}function ft(t,n,s){for(let e=0;e<n.length;++e)t[e]=n[e]*s}function Z(t,n,s,e,i){for(let o=0;o<t.length;++o)t[o]=n*s[o]+e*i[o]}function zt(t,n,s){s=s||{};const e=s.maxIterations||n.length*200,i=s.nonZeroDelta||1.05,o=s.zeroDelta||.001,r=s.minErrorDelta||1e-6,l=s.minErrorDelta||1e-5,f=s.rho!==void 0?s.rho:1,u=s.chi!==void 0?s.chi:2,a=s.psi!==void 0?s.psi:-.5,y=s.sigma!==void 0?s.sigma:.5;let h;const b=n.length,p=new Array(b+1);p[0]=n,p[0].fx=t(n),p[0].id=0;for(let v=0;v<b;++v){const c=n.slice();c[v]=c[v]?c[v]*i:o,p[v+1]=c,p[v+1].fx=t(c),p[v+1].id=v+1}function M(v){for(let c=0;c<v.length;c++)p[b][c]=v[c];p[b].fx=v.fx}const E=(v,c)=>v.fx-c.fx,_=n.slice(),S=n.slice(),g=n.slice(),m=n.slice();for(let v=0;v<e;++v){if(p.sort(E),s.history){const x=p.map(d=>{const C=d.slice();return C.fx=d.fx,C.id=d.id,C});x.sort((d,C)=>d.id-C.id),s.history.push({x:p[0].slice(),fx:p[0].fx,simplex:x})}h=0;for(let x=0;x<b;++x)h=Math.max(h,Math.abs(p[0][x]-p[1][x]));if(Math.abs(p[0].fx-p[b].fx)<r&&h<l)break;for(let x=0;x<b;++x){_[x]=0;for(let d=0;d<b;++d)_[x]+=p[d][x];_[x]/=b}const c=p[b];if(Z(S,1+f,_,-f,c),S.fx=t(S),S.fx<p[0].fx)Z(m,1+u,_,-u,c),m.fx=t(m),m.fx<S.fx?M(m):M(S);else if(S.fx>=p[b-1].fx){let x=!1;if(S.fx>c.fx?(Z(g,1+a,_,-a,c),g.fx=t(g),g.fx<c.fx?M(g):x=!0):(Z(g,1-a*f,_,a*f,c),g.fx=t(g),g.fx<S.fx?M(g):x=!0),x){if(y>=1)break;for(let d=1;d<p.length;++d)Z(p[d],1-y,p[0],y,p[d]),p[d].fx=t(p[d])}}else M(S)}return p.sort(E),{fx:p[0].fx,x:p[0]}}function ue(t,n,s,e,i,o,r){const l=s.fx,f=$(s.fxprime,n);let u=l,a=l,y=f,h=0;i=i||1,o=o||1e-6,r=r||.1;function b(p,M,E){for(let _=0;_<16;++_)if(i=(p+M)/2,Z(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||u>=E)M=i;else{if(Math.abs(y)<=-r*f)return i;y*(M-p)>=0&&(M=p),p=i,E=u}return 0}for(let p=0;p<10;++p){if(Z(e.x,1,s.x,i,n),u=e.fx=t(e.x,e.fxprime),y=$(e.fxprime,n),u>l+o*i*f||p&&u>=a)return b(h,i,a);if(Math.abs(y)<=-r*f)return i;if(y>=0)return b(i,h,u);a=u,h=i,i*=2}return i}function fe(t,n,s){let e={x:n.slice(),fx:0,fxprime:n.slice()},i={x:n.slice(),fx:0,fxprime:n.slice()};const o=n.slice();let r,l,f=1,u;s=s||{},u=s.maxIterations||n.length*20,e.fx=t(e.x,e.fxprime),r=e.fxprime.slice(),ft(r,e.fxprime,-1);for(let a=0;a<u;++a){if(f=ue(t,r,e,i,f),s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),!f)ft(r,e.fxprime,-1);else{Z(o,1,i.fxprime,-1,e.fxprime);const y=$(e.fxprime,e.fxprime),h=Math.max(0,$(o,i.fxprime)/y);Z(r,h,r,-1,i.fxprime),l=e,e=i,i=l}if(ut(e.fxprime)<=1e-5)break}return s.history&&s.history.push({x:e.x.slice(),fx:e.fx,fxprime:e.fxprime.slice(),alpha:f}),e}function At(t,n={}){n.maxIterations=n.maxIterations||500;const s=n.initialLayout||xe,e=n.lossFunction||tt,i=he(t,n),o=s(i,n),r=Object.keys(o),l=[];for(const a of r)l.push(o[a].x),l.push(o[a].y);const u=zt(a=>{const y={};for(let h=0;h<r.length;++h){const b=r[h];y[b]={x:a[2*h],y:a[2*h+1],radius:o[b].radius}}return e(y,i)},l,n).x;for(let a=0;a<r.length;++a){const y=r[a];o[y].x=u[2*a],o[y].y=u[2*a+1]}return o}const Rt=1e-10;function ht(t,n,s){return Math.min(t,n)*Math.min(t,n)*Math.PI<=s+Rt?Math.abs(t-n):ce(e=>xt(t,n,e)-s,0,t+n)}function he(t,n={}){const s=n.distinct,e=t.map(l=>Object.assign({},l));function i(l){return l.join(";")}if(s){const l=new Map;for(const f of e)for(let u=0;u<f.sets.length;u++){const a=String(f.sets[u]);l.set(a,f.size+(l.get(a)||0));for(let y=u+1;y<f.sets.length;y++){const h=String(f.sets[y]),b=`${a};${h}`,p=`${h};${a}`;l.set(b,f.size+(l.get(b)||0)),l.set(p,f.size+(l.get(p)||0))}}for(const f of e)f.sets.length<3&&(f.size=l.get(i(f.sets)))}const o=[],r=new Set;for(const l of e)if(l.sets.length===1)o.push(l.sets[0]);else if(l.sets.length===2){const f=l.sets[0],u=l.sets[1];r.add(i(l.sets)),r.add(i([u,f]))}o.sort((l,f)=>l===f?0:l<f?-1:1);for(let l=0;l<o.length;++l){const f=o[l];for(let u=l+1;u<o.length;++u){const a=o[u];r.has(i([f,a]))||e.push({sets:[f,a],size:0})}}return e}function de(t,n,s){const e=Mt(n.length,n.length),i=Mt(n.length,n.length);return t.filter(o=>o.sets.length===2).forEach(o=>{const r=s[o.sets[0]],l=s[o.sets[1]],f=Math.sqrt(n[r].size/Math.PI),u=Math.sqrt(n[l].size/Math.PI),a=ht(f,u,o.size);e[r][l]=e[l][r]=a;let y=0;o.size+1e-10>=Math.min(n[r].size,n[l].size)?y=1:o.size<=1e-10&&(y=-1),i[r][l]=i[l][r]=y}),{distances:e,constraints:i}}function ge(t,n,s,e){for(let o=0;o<n.length;++o)n[o]=0;let i=0;for(let o=0;o<s.length;++o){const r=t[2*o],l=t[2*o+1];for(let f=o+1;f<s.length;++f){const u=t[2*f],a=t[2*f+1],y=s[o][f],h=e[o][f],b=(u-r)*(u-r)+(a-l)*(a-l),p=Math.sqrt(b),M=b-y*y;h>0&&p<=y||h<0&&p>=y||(i+=2*M*M,n[2*o]+=4*M*(r-u),n[2*o+1]+=4*M*(l-a),n[2*f]+=4*M*(u-r),n[2*f+1]+=4*M*(a-l))}}return i}function xe(t,n={}){let s=pe(t,n);const e=n.lossFunction||tt;if(t.length>=8){const i=ye(t,n),o=e(i,t),r=e(s,t);o+1e-8<r&&(s=i)}return s}function ye(t,n={}){const s=n.restarts||10,e=[],i={};for(const h of t)h.sets.length===1&&(i[h.sets[0]]=e.length,e.push(h));let{distances:o,constraints:r}=de(t,e,i);const l=ut(o.map(ut))/o.length;o=o.map(h=>h.map(b=>b/l));const f=(h,b)=>ge(h,b,o,r);let u=null;for(let h=0;h<s;++h){const b=ct(o.length*2).map(Math.random),p=fe(f,b,n);(!u||p.fx<u.fx)&&(u=p)}const a=u.x,y={};for(let h=0;h<e.length;++h){const b=e[h];y[b.sets[0]]={x:a[2*h]*l,y:a[2*h+1]*l,radius:Math.sqrt(b.size/Math.PI)}}if(n.history)for(const h of n.history)ft(h.x,l);return y}function pe(t,n){const s=n&&n.lossFunction?n.lossFunction:tt,e={},i={};for(const y of t)if(y.sets.length===1){const h=y.sets[0];e[h]={x:1e10,y:1e10,rowid:e.length,size:y.size,radius:Math.sqrt(y.size/Math.PI)},i[h]=[]}t=t.filter(y=>y.sets.length===2);for(const y of t){let h=y.weight!=null?y.weight:1;const b=y.sets[0],p=y.sets[1];y.size+Rt>=Math.min(e[b].size,e[p].size)&&(h=0),i[b].push({set:p,size:y.size,weight:h}),i[p].push({set:b,size:y.size,weight:h})}const o=[];Object.keys(i).forEach(y=>{let h=0;for(let b=0;b<i[y].length;++b)h+=i[y][b].size*i[y][b].weight;o.push({set:y,size:h})});function r(y,h){return h.size-y.size}o.sort(r);const l={};function f(y){return y.set in l}function u(y,h){e[h].x=y.x,e[h].y=y.y,l[h]=!0}u({x:0,y:0},o[0].set);for(let y=1;y<o.length;++y){const h=o[y].set,b=i[h].filter(f),p=e[h];if(b.sort(r),b.length===0)throw"ERROR: missing pairwise overlap information";const M=[];for(var a=0;a<b.length;++a){const S=e[b[a].set],g=ht(p.radius,S.radius,b[a].size);M.push({x:S.x+g,y:S.y}),M.push({x:S.x-g,y:S.y}),M.push({y:S.y+g,x:S.x}),M.push({y:S.y-g,x:S.x});for(let m=a+1;m<b.length;++m){const v=e[b[m].set],c=ht(p.radius,v.radius,b[m].size),x=Tt({x:S.x,y:S.y,radius:g},{x:v.x,y:v.y,radius:c});M.push(...x)}}let E=1e50,_=M[0];for(const S of M){e[h].x=S.x,e[h].y=S.y;const g=s(e,t);g<E&&(E=g,_=S)}u(_,h)}return e}function tt(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const r=t[e.sets[0]],l=t[e.sets[1]];i=xt(r.radius,l.radius,q(r,l))}else i=st(e.sets.map(r=>t[r]));const o=e.weight!=null?e.weight:1;s+=o*(i-e.size)*(i-e.size)}return s}function Ct(t,n){let s=0;for(const e of n){if(e.sets.length===1)continue;let i;if(e.sets.length===2){const l=t[e.sets[0]],f=t[e.sets[1]];i=xt(l.radius,f.radius,q(l,f))}else i=st(e.sets.map(l=>t[l]));const o=e.weight!=null?e.weight:1,r=Math.log((i+1)/(e.size+1));s+=o*r*r}return s}function me(t,n,s){if(s==null?t.sort((i,o)=>o.radius-i.radius):t.sort(s),t.length>0){const i=t[0].x,o=t[0].y;for(const r of t)r.x-=i,r.y-=o}if(t.length===2&&q(t[0],t[1])<Math.abs(t[1].radius-t[0].radius)&&(t[1].x=t[0].x+t[0].radius-t[1].radius-1e-10,t[1].y=t[0].y),t.length>1){const i=Math.atan2(t[1].x,t[1].y)-n,o=Math.cos(i),r=Math.sin(i);for(const l of t){const f=l.x,u=l.y;l.x=o*f-r*u,l.y=r*f+o*u}}if(t.length>2){let i=Math.atan2(t[2].x,t[2].y)-n;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const o=t[1].y/(1e-10+t[1].x);for(const r of t){var e=(r.x+o*r.y)/(1+o*o);r.x=2*e-r.x,r.y=2*e*o-r.y}}}}function be(t){t.forEach(i=>{i.parent=i});function n(i){return i.parent!==i&&(i.parent=n(i.parent)),i.parent}function s(i,o){const r=n(i),l=n(o);r.parent=l}for(let i=0;i<t.length;++i)for(let o=i+1;o<t.length;++o){const r=t[i].radius+t[o].radius;q(t[i],t[o])+1e-10<r&&s(t[o],t[i])}const e=new Map;for(let i=0;i<t.length;++i){const o=n(t[i]).parent.setid;e.has(o)||e.set(o,[]),e.get(o).push(t[i])}return t.forEach(i=>{delete i.parent}),Array.from(e.values())}function dt(t){const n=s=>{const e=t.reduce((o,r)=>Math.max(o,r[s]+r.radius),Number.NEGATIVE_INFINITY),i=t.reduce((o,r)=>Math.min(o,r[s]-r.radius),Number.POSITIVE_INFINITY);return{max:e,min:i}};return{xRange:n("x"),yRange:n("y")}}function Dt(t,n,s){n==null&&(n=Math.PI/2);let e=Ft(t).map(u=>Object.assign({},u));const i=be(e);for(const u of i){me(u,n,s);const a=dt(u);u.size=(a.xRange.max-a.xRange.min)*(a.yRange.max-a.yRange.min),u.bounds=a}i.sort((u,a)=>a.size-u.size),e=i[0];let o=e.bounds;const r=(o.xRange.max-o.xRange.min)/50;function l(u,a,y){if(!u)return;const h=u.bounds;let b,p;if(a)b=o.xRange.max-h.xRange.min+r;else{b=o.xRange.max-h.xRange.max;const M=(h.xRange.max-h.xRange.min)/2-(o.xRange.max-o.xRange.min)/2;M<0&&(b+=M)}if(y)p=o.yRange.max-h.yRange.min+r;else{p=o.yRange.max-h.yRange.max;const M=(h.yRange.max-h.yRange.min)/2-(o.yRange.max-o.yRange.min)/2;M<0&&(p+=M)}for(const M of u)M.x+=b,M.y+=p,e.push(M)}let f=1;for(;f<i.length;)l(i[f],!0,!1),l(i[f+1],!1,!0),l(i[f+2],!0,!0),f+=3,o=dt(e);return Nt(e)}function Ot(t,n,s,e,i){const o=Ft(t);n-=2*e,s-=2*e;const{xRange:r,yRange:l}=dt(o);if(r.max===r.min||l.max===l.min)return console.log("not scaling solution: zero size detected"),t;let f,u;if(i){const b=Math.sqrt(i/Math.PI)*2;f=n/b,u=s/b}else f=n/(r.max-r.min),u=s/(l.max-l.min);const a=Math.min(u,f),y=(n-(r.max-r.min)*a)/2,h=(s-(l.max-l.min)*a)/2;return Nt(o.map(b=>({radius:a*b.radius,x:e+y+(b.x-r.min)*a,y:e+h+(b.y-l.min)*a,setid:b.setid})))}function Nt(t){const n={};for(const s of t)n[s.setid]=s;return n}function Ft(t){return Object.keys(t).map(s=>Object.assign(t[s],{setid:s}))}function ve(t={}){let n=!1,s=600,e=350,i=15,o=1e3,r=Math.PI/2,l=!0,f=null,u=!0,a=!0,y=null,h=null,b=!1,p=null,M=t&&t.symmetricalTextCentre?t.symmetricalTextCentre:!1,E={},_=t&&t.colourScheme?t.colourScheme:t&&t.colorScheme?t.colorScheme:["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],S=0,g=function(x){if(x in E)return E[x];var d=E[x]=_[S];return S+=1,S>=_.length&&(S=0),d},m=At,v=tt;function c(x){let d=x.datum();const C=new Set;d.forEach(k=>{k.size==0&&k.sets.length==1&&C.add(k.sets[0])}),d=d.filter(k=>!k.sets.some(O=>C.has(O)));let I={},D={};if(d.length>0){let k=m(d,{lossFunction:v,distinct:b});l&&(k=Dt(k,r,h)),I=Ot(k,s,e,i,f),D=Lt(I,d,M)}const U={};d.forEach(k=>{k.label&&(U[k.sets]=k.label)});function V(k){if(k.sets in U)return U[k.sets];if(k.sets.length==1)return""+k.sets[0]}x.selectAll("svg").data([I]).enter().append("svg");const F=x.select("svg");n?F.attr("viewBox",`0 0 ${s} ${e}`):F.attr("width",s).attr("height",e);const R={};let T=!1;F.selectAll(".venn-area path").each(function(k){const O=this.getAttribute("d");k.sets.length==1&&O&&!b&&(T=!0,R[k.sets[0]]=Me(O))});function A(k){return O=>{const K=k.sets.map(et=>{let Y=R[et],X=I[et];return Y||(Y={x:s/2,y:e/2,radius:1}),X||(X={x:s/2,y:e/2,radius:1}),{x:Y.x*(1-O)+X.x*O,y:Y.y*(1-O)+X.y*O,radius:Y.radius*(1-O)+X.radius*O}});return St(K,p)}}const W=F.selectAll(".venn-area").data(d,k=>k.sets),P=W.enter().append("g").attr("class",k=>`venn-area venn-${k.sets.length==1?"circle":"intersection"}${k.colour||k.color?" venn-coloured":""}`).attr("data-venn-sets",k=>k.sets.join("_")),B=P.append("path"),G=P.append("text").attr("class","label").text(k=>V(k)).attr("text-anchor","middle").attr("dy",".35em").attr("x",s/2).attr("y",e/2);a&&(B.style("fill-opacity","0").filter(k=>k.sets.length==1).style("fill",k=>k.colour?k.colour:k.color?k.color:g(k.sets)).style("fill-opacity",".25"),G.style("fill",k=>k.colour||k.color?"#FFF":t.textFill?t.textFill:k.sets.length==1?g(k.sets):"#444"));function L(k){return typeof k.transition=="function"?k.transition("venn").duration(o):k}let z=x;T&&typeof z.transition=="function"?(z=L(x),z.selectAll("path").attrTween("d",A)):z.selectAll("path").attr("d",k=>St(k.sets.map(O=>I[O])),p);const N=z.selectAll("text").filter(k=>k.sets in D).text(k=>V(k)).attr("x",k=>Math.floor(D[k.sets].x)).attr("y",k=>Math.floor(D[k.sets].y));u&&(T?"on"in N?N.on("end",rt(I,V)):N.each("end",rt(I,V)):N.each(rt(I,V)));const j=L(W.exit()).remove();typeof W.transition=="function"&&j.selectAll("path").attrTween("d",A);const Q=j.selectAll("text").attr("x",s/2).attr("y",e/2);return y!==null&&(G.style("font-size","0px"),N.style("font-size",y),Q.style("font-size","0px")),{circles:I,textCentres:D,nodes:W,enter:P,update:z,exit:j}}return c.wrap=function(x){return arguments.length?(u=x,c):u},c.useViewBox=function(){return n=!0,c},c.width=function(x){return arguments.length?(s=x,c):s},c.height=function(x){return arguments.length?(e=x,c):e},c.padding=function(x){return arguments.length?(i=x,c):i},c.distinct=function(x){return arguments.length?(b=x,c):b},c.colours=function(x){return arguments.length?(g=x,c):g},c.colors=function(x){return arguments.length?(g=x,c):g},c.fontSize=function(x){return arguments.length?(y=x,c):y},c.round=function(x){return arguments.length?(p=x,c):p},c.duration=function(x){return arguments.length?(o=x,c):o},c.layoutFunction=function(x){return arguments.length?(m=x,c):m},c.normalize=function(x){return arguments.length?(l=x,c):l},c.scaleToFit=function(x){return arguments.length?(f=x,c):f},c.styled=function(x){return arguments.length?(a=x,c):a},c.orientation=function(x){return arguments.length?(r=x,c):r},c.orientationOrder=function(x){return arguments.length?(h=x,c):h},c.lossFunction=function(x){return arguments.length?(v=x==="default"?tt:x==="logRatio"?Ct:x,c):v},c}function rt(t,n){return function(s){const e=this,i=t[s.sets[0]].radius||50,o=n(s)||"",r=o.split(/\s+/).reverse(),f=(o.length+r.length)/3;let u=r.pop(),a=[u],y=0;const h=1.1;e.textContent=null;const b=[];function p(g){const m=e.ownerDocument.createElementNS(e.namespaceURI,"tspan");return m.textContent=g,b.push(m),e.append(m),m}let M=p(u);for(;u=r.pop(),!!u;){a.push(u);const g=a.join(" ");M.textContent=g,g.length>f&&M.getComputedTextLength()>i&&(a.pop(),M.textContent=a.join(" "),a=[u],M=p(u),y++)}const E=.35-y*h/2,_=e.getAttribute("x"),S=e.getAttribute("y");b.forEach((g,m)=>{g.setAttribute("x",_),g.setAttribute("y",S),g.setAttribute("dy",`${E+m*h}em`)})}}function at(t,n,s){let e=n[0].radius-q(n[0],t);for(let i=1;i<n.length;++i){const o=n[i].radius-q(n[i],t);o<=e&&(e=o)}for(let i=0;i<s.length;++i){const o=q(s[i],t)-s[i].radius;o<=e&&(e=o)}return e}function jt(t,n,s){const e=[];for(const a of t)e.push({x:a.x,y:a.y}),e.push({x:a.x+a.radius/2,y:a.y}),e.push({x:a.x-a.radius/2,y:a.y}),e.push({x:a.x,y:a.y+a.radius/2}),e.push({x:a.x,y:a.y-a.radius/2});let i=e[0],o=at(e[0],t,n);for(let a=1;a<e.length;++a){const y=at(e[a],t,n);y>=o&&(i=e[a],o=y)}const r=zt(a=>-1*at({x:a[0],y:a[1]},t,n),[i.x,i.y],{maxIterations:500,minErrorDelta:1e-10}).x,l={x:s?0:r[0],y:r[1]};let f=!0;for(const a of t)if(q(l,a)>a.radius){f=!1;break}for(const a of n)if(q(l,a)<a.radius){f=!1;break}if(f)return l;if(t.length==1)return{x:t[0].x,y:t[0].y};const u={};return st(t,u),u.arcs.length===0?{x:0,y:-1e3,disjoint:!0}:u.arcs.length==1?{x:u.arcs[0].circle.x,y:u.arcs[0].circle.y}:n.length?jt(t,[]):Et(u.arcs.map(a=>a.p1))}function Ie(t){const n={},s=Object.keys(t);for(const e of s)n[e]=[];for(let e=0;e<s.length;e++){const i=s[e],o=t[i];for(let r=e+1;r<s.length;++r){const l=s[r],f=t[l],u=q(o,f);u+f.radius<=o.radius+1e-10?n[l].push(i):u+o.radius<=f.radius+1e-10&&n[i].push(l)}}return n}function Lt(t,n,s){const e={},i=Ie(t);for(let o=0;o<n.length;++o){const r=n[o].sets,l={},f={};for(let h=0;h<r.length;++h){l[r[h]]=!0;const b=i[r[h]];for(let p=0;p<b.length;++p)f[b[p]]=!0}const u=[],a=[];for(let h in t)h in l?u.push(t[h]):h in f||a.push(t[h]);const y=jt(u,a,s);e[r]=y,y.disjoint&&n[o].size>0&&console.log("WARNING: area "+r+" not represented on screen")}return e}function ke(t,n,s){const e=[];return e.push(`
|
|
2
2
|
M`,t,n),e.push(`
|
|
3
3
|
m`,-s,0),e.push(`
|
|
4
4
|
a`,s,s,0,1,0,s*2,0),e.push(`
|