orcaq 1.1.7 → 1.1.9
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/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{BRVpLa1E.js → B-E4SrDA.js} +2 -2
- package/.output/public/_nuxt/B-OC4Wzf.js +9 -0
- package/.output/public/_nuxt/{DTlu-CJn.js → B-cBPXHS.js} +1 -1
- package/.output/public/_nuxt/B1ydsdXg.js +1 -0
- package/.output/public/_nuxt/B2Wngdut.js +1 -0
- package/.output/public/_nuxt/{CB56S0b2.js → B3ZoiMh5.js} +3 -3
- package/.output/public/_nuxt/B3jyHGmo.js +1 -0
- package/.output/public/_nuxt/{CrwM3gOU.js → B6aTbrvX.js} +1 -1
- package/.output/public/_nuxt/B9vFZSzU.js +20 -0
- package/.output/public/_nuxt/BFlFdtcI.js +12 -0
- package/.output/public/_nuxt/BFxd7ZWZ.js +1 -0
- package/.output/public/_nuxt/BI0OYmAG.js +1 -0
- package/.output/public/_nuxt/BIYjBgOJ.js +1 -0
- package/.output/public/_nuxt/BMwuBt1W.js +1 -0
- package/.output/public/_nuxt/BP23Jaxf.js +1 -0
- package/.output/public/_nuxt/BWpduGRB.js +1 -0
- package/.output/public/_nuxt/{CWGzL6OE.js → BX-NC3FD.js} +1 -1
- package/.output/public/_nuxt/{CJnTtXrv.js → BY0VC_fp.js} +1 -1
- package/.output/public/_nuxt/BZOLz5Xw.js +1 -0
- package/.output/public/_nuxt/BblWMS7J.js +26 -0
- package/.output/public/_nuxt/{CG4v011f.js → Bc7Kpanq.js} +1 -1
- package/.output/public/_nuxt/{DzaPC1WB.js → BcbezgEJ.js} +1 -1
- package/.output/public/_nuxt/BeMg7yb6.js +2 -0
- package/.output/public/_nuxt/Bg0K-n53.js +18 -0
- package/.output/public/_nuxt/BgFbw5aK.js +1 -0
- package/.output/public/_nuxt/BkHJ3kuB.js +1 -0
- package/.output/public/_nuxt/BlVXGJOG.js +1 -0
- package/.output/public/_nuxt/BorA7uj6.js +1 -0
- package/.output/public/_nuxt/BqQfmS94.js +1 -0
- package/.output/public/_nuxt/{DzN4YRfa.js → Btu3pVWi.js} +2 -2
- package/.output/public/_nuxt/{BLEKzUmC.js → C0kVUAwR.js} +1 -1
- package/.output/public/_nuxt/C1GKs4YV.js +1 -0
- package/.output/public/_nuxt/C4fd0pgB.js +1 -0
- package/.output/public/_nuxt/{Ch-A9iSC.js → C4zVAAUp.js} +1 -1
- package/.output/public/_nuxt/{DtgJAz2h.js → C6ajLfO0.js} +1 -1
- package/.output/public/_nuxt/{Clm3Z8VL.js → C9JT2-RE.js} +1 -1
- package/.output/public/_nuxt/{RTN5rY4m.js → CAnZNTn6.js} +1 -1
- package/.output/public/_nuxt/CB2XoHaK.js +2 -0
- package/.output/public/_nuxt/{DStg2VwN.js → CBy17iCN.js} +1 -1
- package/.output/public/_nuxt/{Cj9tYr3P.js → CCwJzmTT.js} +1 -1
- package/.output/public/_nuxt/{DzjHXopz.js → CGlRJg9T.js} +1 -1
- package/.output/public/_nuxt/{jJeqAxmP.js → CH3m0zKs.js} +1 -1
- package/.output/public/_nuxt/{DuKway_J.js → CHFYZcjC.js} +1 -1
- package/.output/public/_nuxt/CM4UzWO5.js +1 -0
- package/.output/public/_nuxt/{D_fdC3mJ.js → CM7fDldV.js} +1 -1
- package/.output/public/_nuxt/{DLIUYAz9.js → CQi4GvAy.js} +1 -1
- package/.output/public/_nuxt/{CpkrwN3Q.js → CRtMS55w.js} +1 -1
- package/.output/public/_nuxt/CSIDbD5d.js +1 -0
- package/.output/public/_nuxt/{2TwRWQjG.js → CT4V-SdE.js} +1 -1
- package/.output/public/_nuxt/{3vYvhEat.js → CV3uHXW4.js} +1 -1
- package/.output/public/_nuxt/{CBgbjsPd.js → CX2dGf8T.js} +1 -1
- package/.output/public/_nuxt/{BGAd-CMD.js → Ce00XEKL.js} +1 -1
- package/.output/public/_nuxt/{z1xPtaLw.js → CfglFxLQ.js} +1 -1
- package/.output/public/_nuxt/{Bw-4PosZ.js → Cgc3lXst.js} +1 -1
- package/.output/public/_nuxt/{39ZZCZCn.js → CiGbpFVs.js} +1 -1
- package/.output/public/_nuxt/{BG_B-fo0.js → Cilp0euQ.js} +1 -1
- package/.output/public/_nuxt/CjE9xodL.js +1 -0
- package/.output/public/_nuxt/{CRDIOG8r.js → Ck7gJ0Ru.js} +1 -1
- package/.output/public/_nuxt/CkVRbNxk.js +1 -0
- package/.output/public/_nuxt/CmROOZW3.js +1 -0
- package/.output/public/_nuxt/{Cym7bWgs.js → CqwK0iC2.js} +1 -1
- package/.output/public/_nuxt/{LUfaevBS.js → CsRqTS8p.js} +1 -1
- package/.output/public/_nuxt/Cv8aMucD.js +31 -0
- package/.output/public/_nuxt/CvFBHqKj.js +1 -0
- package/.output/public/_nuxt/{BCm7jnPt.js → CvrjITPr.js} +1 -1
- package/.output/public/_nuxt/CwEAH09c.js +1 -0
- package/.output/public/_nuxt/{B-u0WX5Q.js → D0TQTmc_.js} +1 -1
- package/.output/public/_nuxt/D33qa5aT.js +1 -0
- package/.output/public/_nuxt/D6FGhPpz.js +53 -0
- package/.output/public/_nuxt/{gWmEw6BT.js → D8dLCNO1.js} +1 -1
- package/.output/public/_nuxt/DA2L1Ivx.js +1 -0
- package/.output/public/_nuxt/{DcXAnOS1.js → DB45HoaN.js} +1 -1
- package/.output/public/_nuxt/DBIf1geQ.js +1 -0
- package/.output/public/_nuxt/{D7uoAo-G.js → DD6NieRw.js} +74 -74
- package/.output/public/_nuxt/{BjpSpz5C.js → DDNFAZ6A.js} +1 -1
- package/.output/public/_nuxt/DDgsZmht.js +1 -0
- package/.output/public/_nuxt/DEBj_roB.js +1 -0
- package/.output/public/_nuxt/{nrlEwpIH.js → DI-I25kb.js} +1 -1
- package/.output/public/_nuxt/{BhT0iBlH.js → DMhhDVL0.js} +1 -1
- package/.output/public/_nuxt/{D0oaRUYx.js → DNL5Q-iy.js} +1 -1
- package/.output/public/_nuxt/DX42Brjy.js +1 -0
- package/.output/public/_nuxt/DYBPW385.js +1 -0
- package/.output/public/_nuxt/{DEjwIQuc.js → DYFx7Tau.js} +1 -1
- package/.output/public/_nuxt/{BO-QgaRL.js → DZJEpoYA.js} +1 -1
- package/.output/public/_nuxt/{XVZ0obUR.js → D_dxq6Av.js} +1 -1
- package/.output/public/_nuxt/DcIKg-oA.js +52 -0
- package/.output/public/_nuxt/Dcf3u1x9.js +1 -0
- package/.output/public/_nuxt/{vGkKA7iH.js → DdjYB9eX.js} +2 -2
- package/.output/public/_nuxt/{B41tp0B8.js → DeGwWuWf.js} +1 -1
- package/.output/public/_nuxt/Dgh1FhxQ.js +1 -0
- package/.output/public/_nuxt/{CxZK-Vs6.js → DghZRCwT.js} +1 -1
- package/.output/public/_nuxt/DngnCd9Q.js +1 -0
- package/.output/public/_nuxt/{Z5g5B4NJ.js → Dpdssse1.js} +1 -1
- package/.output/public/_nuxt/{CczQKYUP.js → DrfFcngk.js} +1 -1
- package/.output/public/_nuxt/{C7A87LE3.js → Ds4LpS8e.js} +1 -1
- package/.output/public/_nuxt/{DUvUg_V7.js → DsHltPpv.js} +1 -1
- package/.output/public/_nuxt/DuvFgQqu.js +1 -0
- package/.output/public/_nuxt/{DSOwr8Hs.js → Dzy2Amcc.js} +4 -4
- package/.output/public/_nuxt/{RFRrMFyH.js → EzQMUIRl.js} +1 -1
- package/.output/public/_nuxt/FrxNy5Hb.js +2 -0
- package/.output/public/_nuxt/ImQ5Dcjp.js +1 -0
- package/.output/public/_nuxt/{DxF9DsEl.js → QZbgg6bx.js} +1 -1
- package/.output/public/_nuxt/{BV4g1sVY.js → RCyqQNC4.js} +1 -1
- package/.output/public/_nuxt/{DQdL5Jcl.js → RpDfSk0l.js} +1 -1
- package/.output/public/_nuxt/UowwUtRH.js +1 -0
- package/.output/public/_nuxt/{BvD9dW-2.js → V_GiMERb.js} +1 -1
- package/.output/public/_nuxt/{1VXrIDkr.js → W2el5otm.js} +1 -1
- package/.output/public/_nuxt/{_fileId_.DxhkUVGK.css → _fileId_.CiauI_x3.css} +1 -1
- package/.output/public/_nuxt/{CCk2r9DD.js → bJGrilFb.js} +1 -1
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/657bdee4-fa56-4862-bc13-309345429302.json +1 -0
- package/.output/public/_nuxt/entry.CQwtqNMg.css +1 -0
- package/.output/public/_nuxt/jgZoykhT.js +1 -0
- package/.output/public/_nuxt/lFU3Ma5J.js +1 -0
- package/.output/public/_nuxt/{BZQUF1W4.js → lPZuSUw2.js} +1 -1
- package/.output/public/_nuxt/ljX6O69y.js +1 -0
- package/.output/public/_nuxt/mtBjWkj4.js +1 -0
- package/.output/public/_nuxt/ngeX9iiO.js +1 -0
- package/.output/public/_nuxt/s10hyhzI.js +1 -0
- package/.output/public/_nuxt/w8sha2t6.js +3 -0
- package/.output/public/_nuxt/yPPOBtqs.js +1 -0
- package/.output/server/chunks/_/tables.factory.mjs +1 -1
- package/.output/server/chunks/build/client.manifest.mjs +838 -736
- package/.output/server/chunks/build/client.manifest.mjs.map +1 -1
- package/.output/server/chunks/nitro/nitro.mjs +704 -655
- package/.output/server/package.json +1 -1
- package/package.json +1 -1
- package/.output/public/_nuxt/1fIGBJPQ.js +0 -1
- package/.output/public/_nuxt/1kY3DHv7.js +0 -1
- package/.output/public/_nuxt/9bnMBg54.js +0 -1
- package/.output/public/_nuxt/BFMjnjgH.js +0 -1
- package/.output/public/_nuxt/BN2mQ8OV.js +0 -20
- package/.output/public/_nuxt/BNnChlxR.js +0 -1
- package/.output/public/_nuxt/BNyWhB4W.js +0 -1
- package/.output/public/_nuxt/BOVFFCPB.js +0 -1
- package/.output/public/_nuxt/BXziI6Bt.js +0 -3
- package/.output/public/_nuxt/BZmEvFAZ.js +0 -28
- package/.output/public/_nuxt/Ba_fqsW2.js +0 -1
- package/.output/public/_nuxt/BbzZxPNQ.js +0 -1
- package/.output/public/_nuxt/Bhm1GL_M.js +0 -1
- package/.output/public/_nuxt/BiSZmDoN.js +0 -1
- package/.output/public/_nuxt/BjK8Fug8.js +0 -1
- package/.output/public/_nuxt/BkqB6n0T.js +0 -1
- package/.output/public/_nuxt/BoPjUGS6.js +0 -1
- package/.output/public/_nuxt/BtwwqY0e.js +0 -1
- package/.output/public/_nuxt/C0l_59dE.js +0 -1
- package/.output/public/_nuxt/C1TOiVRQ.js +0 -9
- package/.output/public/_nuxt/C80Zs8U0.js +0 -1
- package/.output/public/_nuxt/CFZerEKx.js +0 -2
- package/.output/public/_nuxt/CSPqdI4x.js +0 -1
- package/.output/public/_nuxt/CTYqoFvv.js +0 -1
- package/.output/public/_nuxt/CYJEOEaU.js +0 -1
- package/.output/public/_nuxt/CYu-xp_f.js +0 -1
- package/.output/public/_nuxt/CZvnl0uO.js +0 -52
- package/.output/public/_nuxt/CadjlDLt.js +0 -1
- package/.output/public/_nuxt/CeXr_3vU.js +0 -2
- package/.output/public/_nuxt/Culm7V2R.js +0 -53
- package/.output/public/_nuxt/CzBFxx8v.js +0 -1
- package/.output/public/_nuxt/D8KJQqug.js +0 -1
- package/.output/public/_nuxt/D8Z5BXgG.js +0 -26
- package/.output/public/_nuxt/DDK9-_jm.js +0 -1
- package/.output/public/_nuxt/DDQU7vSH.js +0 -1
- package/.output/public/_nuxt/DRuCf0Sx.js +0 -1
- package/.output/public/_nuxt/DSEkO8kW.js +0 -1
- package/.output/public/_nuxt/Da1F0IxL.js +0 -1
- package/.output/public/_nuxt/DdtQIDaq.js +0 -1
- package/.output/public/_nuxt/Dfz8k_Rn.js +0 -1
- package/.output/public/_nuxt/DitYzGT4.js +0 -1
- package/.output/public/_nuxt/Djh3G2Nf.js +0 -1
- package/.output/public/_nuxt/DmWFeTaU.js +0 -1
- package/.output/public/_nuxt/DyFXtlg0.js +0 -1
- package/.output/public/_nuxt/_ltJfz1p.js +0 -1
- package/.output/public/_nuxt/builds/meta/1cbed594-12e2-48e6-bea9-7a9159c3c1d3.json +0 -1
- package/.output/public/_nuxt/dkyHOJLf.js +0 -1
- package/.output/public/_nuxt/entry.D1DMaixs.css +0 -1
- package/.output/public/_nuxt/ixgiI20S.js +0 -1
- package/.output/public/_nuxt/lisFd8W1.js +0 -2
- package/.output/public/_nuxt/uHyBIwWw.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{aS as $,r as m,aH as O,i as p,K as E,at as V,am as K,ah as _,d as F,c as B,o as R,n as P,q as N,b as U,a as C,w as D,f as j,t as w,u as x,bj as q,k as A,m as W,e as g,z,F as L,x as H,B as M}from"./DD6NieRw.js";var G=(a=>(a.Tree="tree",a.List="list",a))(G||{});const Y=(a,s=0)=>({connectionId:a,selectedDatabaseIndex:s,viewMode:"tree",keyPattern:"*",keyTypeFilter:[],selectedKey:null,activeTool:"browser"}),J=$("redis-workspace",()=>{const a=m({}),s=(d,n=0)=>(a.value[d]||(a.value[d]=Y(d,n)),a.value[d]);return{sessions:a,ensureSession:s,patchSession:(d,n)=>{Object.assign(s(d),n)}}}),Q=a=>{const s=Number.parseInt(a||"0",10);return Number.isFinite(s)?s:0},X=a=>{var s,t,d;if(typeof a=="string")return a;if(a&&typeof a=="object"){const n=a;return((s=n.data)==null?void 0:s.message)||((d=(t=n.response)==null?void 0:t._data)==null?void 0:d.message)||n.message||"Request failed."}return"Request failed."},Z=(a,s)=>{const t=X(a);return/READONLY/i.test(t)?"This Redis endpoint is read-only. Value updates are unavailable.":/NOPERM|NOAUTH|WRONGPASS|ACL/i.test(t)?"The connected Redis account does not have permission to edit values.":""},T=a=>({method:a.method,stringConnection:a.connectionString,host:a.host,port:a.port,username:a.username,password:a.password,database:a.database,ssl:a.ssl,ssh:a.ssh});function ee({connection:a,session:s,store:t}){const d=m([]),n=m([]),r=O(null),v=m(!1),f=m(!1),l=m(!1),o=m("");let e=0;const c=p(()=>!!r.value&&!o.value),y=async()=>{if(!a.value||!s.value){d.value=[],n.value=[],r.value=null;return}v.value=!0;try{const i=await $fetch("/api/redis/browser",{method:"POST",body:{...T(a.value),databaseIndex:s.value.selectedDatabaseIndex,keyPattern:s.value.keyPattern}});d.value=i.keys,n.value=i.databases,o.value=""}finally{v.value=!1}},b=async()=>{if(!a.value||!s.value){n.value=[];return}n.value=await $fetch("/api/redis/browser/databases",{method:"POST",body:{...T(a.value),databaseIndex:s.value.selectedDatabaseIndex}})},u=async(i=(k=>(k=s.value)==null?void 0:k.selectedKey)())=>{if(!a.value||!s.value||!i){r.value=null,o.value="",f.value=!1;return}const S=++e;r.value=null,f.value=!0;try{const I=await $fetch("/api/redis/browser/value",{method:"POST",body:{...T(a.value),databaseIndex:s.value.selectedDatabaseIndex,key:i}});if(S!==e)return;r.value=I,o.value=""}finally{S===e&&(f.value=!1)}},h=async i=>{s.value&&t.patchSession(s.value.connectionId,{selectedKey:i,activeTool:"browser"})};return{keys:d,databases:n,selectedKeyDetail:r,loadingKeys:v,loadingSelectedKeyDetail:f,savingValue:l,editUnavailableReason:o,canEditSelectedValue:c,refreshKeys:y,refreshDatabases:b,refreshSelectedKeyDetail:u,openKey:h,focusKey:async i=>{s.value&&(await h(i),await u(i))},saveSelectedValue:async i=>{var k;if(!(!a.value||!((k=s.value)!=null&&k.selectedKey))){l.value=!0;try{r.value=await $fetch("/api/redis/browser/value",{method:"PATCH",body:{...T(a.value),databaseIndex:s.value.selectedDatabaseIndex,key:s.value.selectedKey,previewKind:i.previewKind,stringFormat:i.stringFormat,tableKind:i.tableKind,ttlSeconds:i.ttlSeconds,value:i.value}}),o.value="",E.success("Redis key saved successfully",{description:`Updated ${s.value.selectedKey}`})}catch(S){const I=Z(S);if(I){o.value=I;return}console.error("[useRedisWorkspace] Failed to save Redis value",S)}finally{l.value=!1}}}}}function ue(a){const s=V(a.connection),t=a.tabInfo?V(a.tabInfo):void 0,d=a.mode??"browser",n=J(),r=p(()=>{var e;return(e=s.value)!=null&&e.id?n.ensureSession(s.value.id,Q(s.value.database)):null}),v=p({get:()=>{var e;return((e=r.value)==null?void 0:e.selectedDatabaseIndex)??0},set:e=>{r.value&&n.patchSession(r.value.connectionId,{selectedDatabaseIndex:e})}}),f=p({get:()=>{var e;return((e=r.value)==null?void 0:e.keyPattern)??"*"},set:e=>{r.value&&n.patchSession(r.value.connectionId,{keyPattern:e||"*"})}}),l=ee({connection:s,session:r,store:n}),o=m(!1);return K(()=>t==null?void 0:t.value,async e=>{var c,y,b,u;if(!(!r.value||!e)){if(e.type===_.RedisPubSub){n.patchSession(r.value.connectionId,{activeTool:"pubsub",selectedDatabaseIndex:typeof((c=e.metadata)==null?void 0:c.databaseIndex)=="number"?e.metadata.databaseIndex:r.value.selectedDatabaseIndex}),l.refreshDatabases();return}o.value=!0;try{n.patchSession(r.value.connectionId,{activeTool:"browser",selectedDatabaseIndex:typeof((y=e.metadata)==null?void 0:y.databaseIndex)=="number"?e.metadata.databaseIndex:r.value.selectedDatabaseIndex,keyPattern:typeof((b=e.metadata)==null?void 0:b.keyPattern)=="string"?e.metadata.keyPattern:r.value.keyPattern,selectedKey:typeof((u=e.metadata)==null?void 0:u.selectedKey)=="string"?e.metadata.selectedKey:r.value.selectedKey}),await l.refreshKeys(),l.refreshSelectedKeyDetail()}finally{o.value=!1}}},{immediate:!0}),K(()=>{var e,c;return[(e=r.value)==null?void 0:e.selectedDatabaseIndex,(c=r.value)==null?void 0:c.keyPattern]},([e,c],y)=>{if(!(t!=null&&t.value)||t.value.type!==_.RedisBrowser||o.value)return;const[b,u]=y??[];e===b&&c===u||l.refreshKeys()}),K(()=>{var e;return(e=r.value)==null?void 0:e.selectedKey},(e,c)=>{!(t!=null&&t.value)||t.value.type!==_.RedisBrowser||o.value||e===c||l.refreshSelectedKeyDetail(e)}),K(()=>{var e;return(e=r.value)==null?void 0:e.selectedDatabaseIndex},(e,c)=>{if(e!==c){if(t!=null&&t.value){t.value.type===_.RedisPubSub&&l.refreshDatabases();return}d==="meta"&&l.refreshDatabases()}}),K(()=>{var e;return(e=s.value)==null?void 0:e.id},e=>{if(!(!e||t!=null&&t.value)){if(d==="meta"){l.refreshDatabases();return}l.refreshKeys()}},{immediate:!0}),{session:r,keys:l.keys,databases:l.databases,selectedKeyDetail:l.selectedKeyDetail,loadingKeys:l.loadingKeys,loadingSelectedKeyDetail:l.loadingSelectedKeyDetail,savingValue:l.savingValue,selectedDatabaseIndex:v,keyPattern:f,canEditSelectedValue:l.canEditSelectedValue,editUnavailableReason:l.editUnavailableReason,refreshKeys:l.refreshKeys,openKey:l.openKey,focusKey:l.focusKey,saveSelectedValue:l.saveSelectedValue}}const ae={class:"flex min-w-0 items-center gap-1.5 pr-5 text-left"},te={class:"flex min-w-0 items-center gap-2"},se={class:"truncate"},le={class:"text-xxs text-muted-foreground"},ie=F({__name:"RedisDBSelector",props:{databases:{},databaseIndex:{},compact:{type:Boolean},label:{},triggerId:{},triggerClass:{}},emits:["update:databaseIndex"],setup(a,{emit:s}){const t=a,d=s,n=p(()=>t.databases.length>0?t.databases:[{index:t.databaseIndex,label:`DB ${t.databaseIndex}`,keyCount:0,expires:0,avgTtl:null}]),r=p(()=>t.triggerId||"redis-db-index"),v=p(()=>n.value.find(l=>l.index===t.databaseIndex)??n.value[0]),f=p(()=>t.compact?["h-6! w-fit gap-1 px-2 text-xs",t.triggerClass].filter(Boolean).join(" "):["w-full",t.triggerClass].filter(Boolean).join(" "));return(l,o)=>{const e=W,c=M,y=z,b=A;return R(),B("div",{class:P(l.compact?"w-[132px]":"space-y-1")},[l.compact?U("",!0):(R(),N(x(q),{key:0,for:x(r)},{default:D(()=>[j(w(l.label||"Databases"),1)]),_:1},8,["for"])),C(b,{"model-value":String(l.databaseIndex),"onUpdate:modelValue":o[0]||(o[0]=u=>d("update:databaseIndex",Number(u)||0)),size:"sm"},{default:D(()=>[C(e,{id:x(r),class:P(x(f))},{default:D(()=>{var u,h;return[g("div",ae,[g("span",{class:P(l.compact?"truncate text-xs":"truncate text-sm")},w(((u=x(v))==null?void 0:u.label)||"Select DB"),3),g("span",{class:P(["shrink-0 text-muted-foreground",(l.compact,"text-xxs")])},w(((h=x(v))==null?void 0:h.keyCount)??0)+" keys ",3)])]}),_:1},8,["id","class"]),C(y,null,{default:D(()=>[(R(!0),B(L,null,H(x(n),u=>(R(),N(c,{key:u.index,value:String(u.index)},{default:D(()=>[g("div",te,[g("span",se,w(u.label),1),g("span",le,w(u.keyCount)+" keys ",1)])]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["model-value"])],2)}}});export{G as R,ie as _,ue as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as b,aj as T,ak as x,aa as $,a0 as C,q as h,o as y,w as v,E as g,u as e,ab as q,al as A,r as u,i as O,am as D,an as F,ao as I,a as M,s as E,b as H,ap as P,aq as V}from"./DD6NieRw.js";const[w,j]=$("CollapsibleRoot");var S=b({__name:"CollapsibleRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:open"],setup(i,{expose:d,emit:s}){const o=i,n=T(o,"open",s,{defaultValue:o.defaultOpen,passive:o.open===void 0}),{disabled:l,unmountOnHide:p}=x(o);return j({contentId:"",disabled:l,open:n,unmountOnHide:p,onOpenToggle:()=>{l.value||(n.value=!n.value)}}),d({open:n}),C(),(r,f)=>(y(),h(e(q),{as:r.as,"as-child":o.asChild,"data-state":e(n)?"open":"closed","data-disabled":e(l)?"":void 0},{default:v(()=>[g(r.$slots,"default",{open:e(n)})]),_:3},8,["as","as-child","data-state","data-disabled"]))}}),J=S,L=b({inheritAttrs:!1,__name:"CollapsibleContent",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["contentFound"],setup(i,{emit:d}){const s=i,o=d,t=w();t.contentId||(t.contentId=A(void 0,"reka-collapsible-content"));const n=u(),{forwardRef:l,currentElement:p}=C(),r=u(0),f=u(0),k=O(()=>t.open.value),m=u(k.value),c=u();D(()=>{var a;return[k.value,(a=n.value)==null?void 0:a.present]},async()=>{await V();const a=p.value;if(!a)return;c.value=c.value||{transitionDuration:a.style.transitionDuration,animationName:a.style.animationName},a.style.transitionDuration="0s",a.style.animationName="none";const _=a.getBoundingClientRect();f.value=_.height,r.value=_.width,m.value||(a.style.transitionDuration=c.value.transitionDuration,a.style.animationName=c.value.animationName)},{immediate:!0});const N=O(()=>m.value&&t.open.value);return F(()=>{requestAnimationFrame(()=>{m.value=!1})}),I(p,"beforematch",a=>{requestAnimationFrame(()=>{t.onOpenToggle(),o("contentFound")})}),(a,_)=>(y(),h(e(P),{ref_key:"presentRef",ref:n,present:a.forceMount||e(t).open.value,"force-mount":!0},{default:v(({present:B})=>{var R;return[M(e(q),E(a.$attrs,{id:e(t).contentId,ref:e(l),"as-child":s.asChild,as:a.as,hidden:B?void 0:e(t).unmountOnHide.value?"":"until-found","data-state":N.value?void 0:e(t).open.value?"open":"closed","data-disabled":(R=e(t).disabled)!=null&&R.value?"":void 0,style:{"--reka-collapsible-content-height":`${f.value}px`,"--reka-collapsible-content-width":`${r.value}px`}}),{default:v(()=>[!e(t).unmountOnHide.value||B?g(a.$slots,"default",{key:0}):H("v-if",!0)]),_:2},1040,["id","as-child","as","hidden","data-state","data-disabled","style"])]}),_:3},8,["present"]))}}),K=L,z=b({__name:"CollapsibleTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(i){const d=i;C();const s=w();return(o,t)=>{var n,l;return y(),h(e(q),{type:o.as==="button"?"button":void 0,as:o.as,"as-child":d.asChild,"aria-controls":e(s).contentId,"aria-expanded":e(s).open.value,"data-state":e(s).open.value?"open":"closed","data-disabled":(n=e(s).disabled)!=null&&n.value?"":void 0,disabled:(l=e(s).disabled)==null?void 0:l.value,onClick:e(s).onOpenToggle},{default:v(()=>[g(o.$slots,"default")]),_:3},8,["type","as","as-child","aria-controls","aria-expanded","data-state","data-disabled","disabled","onClick"])}}}),Q=z;export{J as C,K as a,Q as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as H}from"./s10hyhzI.js";import{d as R,bz as K,c as a,e as d,a as o,bj as U,w,u as r,_ as N,N as G,o as t,f as k,q as V,t as u,b as S,bm as W,r as q,i as M,an as J,F as y,x as T,n as z,p as X,bi as Y,V as Z,l as ee,bA as te,bB as se,bC as ne}from"./DD6NieRw.js";import{_ as oe,a as ae}from"./DghZRCwT.js";import{_ as ie}from"./CvFBHqKj.js";import{_ as P}from"./D_dxq6Av.js";import{_ as re}from"./C1GKs4YV.js";const de={class:"flex flex-col gap-2 rounded-lg border bg-card p-4 sm:flex-row sm:items-end sm:justify-between"},le={class:"flex min-w-0 flex-1 flex-col gap-1.5"},ce={class:"flex h-9 items-center justify-center sm:w-6"},ue={class:"flex min-w-0 flex-1 flex-col gap-1.5"},me=R({__name:"SchemaDiffConnectionSelector",props:{sourceConnection:{},targetConnection:{},connections:{},isLoading:{type:Boolean}},emits:["update:targetConnection","run"],setup(x,{emit:_}){const{workspaceId:p}=K(),l=_;return(n,f)=>{var e,c;const g=U,v=N,C=G;return t(),a("div",de,[d("div",le,[o(g,{class:"text-xs font-medium text-muted-foreground"},{default:w(()=>f[2]||(f[2]=[k("Source")])),_:1}),o(P,{class:"h-9 w-full","workspace-id":r(p)||"","connection-id":((e=n.sourceConnection)==null?void 0:e.id)||"",connection:n.sourceConnection||void 0,connections:n.sourceConnection?[n.sourceConnection]:[],disabled:""},null,8,["workspace-id","connection-id","connection","connections"])]),d("div",ce,[o(v,{name:"hugeicons:arrow-right-02",class:"size-4 text-muted-foreground"})]),d("div",ue,[o(g,{class:"text-xs font-medium text-muted-foreground"},{default:w(()=>f[3]||(f[3]=[k("Target")])),_:1}),o(P,{class:"h-9 w-full","workspace-id":r(p)||"","connection-id":((c=n.targetConnection)==null?void 0:c.id)||"",connection:n.targetConnection||void 0,connections:n.connections,"onUpdate:connectionId":f[0]||(f[0]=$=>l("update:targetConnection",n.connections.find(b=>b.id===$)||null)),"skip-strict-mode-connections":""},null,8,["workspace-id","connection-id","connection","connections"])]),o(C,{disabled:!n.sourceConnection||!n.targetConnection||n.isLoading,size:"sm",onClick:f[1]||(f[1]=$=>l("run"))},{default:w(()=>[n.isLoading?(t(),V(v,{key:0,name:"hugeicons:loading-03",class:"size-4 animate-spin"})):(t(),V(v,{key:1,name:"hugeicons:git-compare",class:"size-4"})),k(" "+u(n.isLoading?"Comparing...":"Run Diff"),1)]),_:1},8,["disabled"])])}}}),fe={class:"flex flex-col gap-3"},pe={class:"flex items-center gap-3"},ge={class:"flex items-center gap-2 text-sm"},xe={class:"text-xs text-muted-foreground"},_e={class:"ml-auto flex items-center gap-2 text-xs"},he={key:0,class:"flex items-center gap-1 rounded-md bg-red-100 px-2 py-1 text-xs text-red-700 dark:bg-red-900/30 dark:text-red-400"},ve={key:0,class:"flex items-start gap-2 rounded-md border border-amber-200 bg-amber-50 p-3 text-xs text-amber-800 dark:border-amber-800 dark:bg-amber-900/20 dark:text-amber-300"},ye={key:2,class:"min-h-32 flex items-center justify-center rounded-md border bg-muted/30 p-4 font-mono text-xs text-muted-foreground"},ke=R({__name:"SchemaDiffSqlPanel",props:{sql:{},safeMode:{type:Boolean},statementCount:{},destructiveCount:{}},emits:["update:safeMode"],setup(x,{emit:_}){const p=_;return(l,n)=>{const f=N,g=U,v=W,C=re;return t(),a("div",fe,[d("div",pe,[d("div",ge,[o(f,{name:"hugeicons:code",class:"size-4 text-muted-foreground"}),n[1]||(n[1]=d("span",{class:"font-medium"},"Generated SQL",-1)),d("span",xe,"("+u(l.statementCount)+" statements)",1)]),d("div",_e,[o(g,{for:"safe-mode-toggle",class:"cursor-pointer text-muted-foreground"},{default:w(()=>n[2]||(n[2]=[k(" Safe mode ")])),_:1}),o(v,{id:"safe-mode-toggle","model-value":l.safeMode,"onUpdate:modelValue":n[0]||(n[0]=e=>p("update:safeMode",e))},null,8,["model-value"])]),l.destructiveCount>0&&!l.safeMode?(t(),a("div",he,[o(f,{name:"hugeicons:alert-circle",class:"size-3.5"}),k(" "+u(l.destructiveCount)+" destructive ",1)])):S("",!0)]),l.safeMode?(t(),a("div",ve,[o(f,{name:"hugeicons:shield-01",class:"mt-0.5 size-3.5 shrink-0"}),n[3]||(n[3]=d("span",null,"Safe mode is on — destructive statements (DROP TABLE, DROP COLUMN) are commented out. Disable to include them.",-1))])):S("",!0),l.sql?(t(),V(C,{key:1,code:l.sql,language:"sql","max-height":"400px"},null,8,["code"])):(t(),a("div",ye," No SQL statements generated. "))])}}}),be={class:"space-y-1 font-mono text-sm"},Ce={class:"mb-3 flex flex-wrap gap-2"},we=["onClick"],$e={key:0,class:"divide-y"},ze=["onClick"],Se={class:"flex-1 truncate"},De={class:"flex-1 truncate text-xs"},qe={class:"shrink-0 text-xxs text-muted-foreground"},Le={class:"flex-1 truncate text-xs"},Te={class:"flex-1 truncate"},Me={class:"flex-1 truncate"},Ve={key:0,class:"flex flex-col items-center gap-2 py-12 text-muted-foreground"},Be=R({__name:"SchemaDiffTree",props:{result:{}},setup(x){const _=q(new Set),p=q(new Set),l={added:{label:"Added",class:"text-emerald-600 dark:text-emerald-400",icon:"hugeicons:plus-sign"},removed:{label:"Removed",class:"text-red-600 dark:text-red-400",icon:"hugeicons:minus-sign"},modified:{label:"Modified",class:"text-amber-600 dark:text-amber-400",icon:"hugeicons:edit-02"},unchanged:{label:"Unchanged",class:"text-muted-foreground",icon:"hugeicons:check-01"}},n={added:"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-400 rounded-sm",removed:"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-400 rounded-sm",modified:"bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-400 rounded-sm"},f=e=>{_.value.has(e)?_.value.delete(e):_.value.add(e)},g=e=>{p.value.has(e)?p.value.delete(e):p.value.add(e)},v=(e,c)=>`${e}.${c}`,C=M(()=>x.result.schemas.filter(e=>e.tables.some(c=>c.status!=="unchanged")||e.views.some(c=>c.status!=="unchanged")||e.functions.some(c=>c.status!=="unchanged")));return J(()=>{for(const e of C.value)_.value.add(e.name)}),(e,c)=>{const $=Y,b=N;return t(),a("div",be,[d("div",Ce,[(t(!0),a(y,null,T(e.result.summary,(h,s)=>(t(),a(y,{key:s},[s!=="unchanged"?(t(),V($,{key:0,variant:"outline",class:z(r(X)(n[s],"capitalize border-0"))},{default:w(()=>[k(u(h)+" "+u(s),1)]),_:2},1032,["class"])):S("",!0)],64))),128))]),(t(!0),a(y,null,T(r(C),h=>(t(),a("div",{key:h.name,class:"rounded-md border overflow-hidden"},[d("button",{class:"flex w-full items-center gap-2 bg-muted/50 px-3 py-2 text-left text-xs font-semibold capitalize text-muted-foreground hover:bg-muted",onClick:s=>f(h.name)},[o(b,{name:r(_).has(h.name)?"hugeicons:arrow-down-01":"hugeicons:arrow-right-01",class:"size-3.5 shrink-0"},null,8,["name"]),o(b,{name:"hugeicons:database",class:"size-3.5 shrink-0"}),k(" "+u(h.name),1)],8,we),r(_).has(h.name)?(t(),a("div",$e,[(t(!0),a(y,null,T(h.tables.filter(s=>s.status!=="unchanged"),s=>(t(),a(y,{key:s.name},[d("div",{class:z(["flex cursor-pointer items-center gap-2 px-4 py-2 hover:bg-muted/30",l[s.status].class]),onClick:i=>g(v(h.name,s.name))},[o(b,{name:r(p).has(v(h.name,s.name))?"hugeicons:arrow-down-01":"hugeicons:arrow-right-01",class:"size-3 shrink-0 text-muted-foreground"},null,8,["name"]),o(b,{name:"hugeicons:table-01",class:"size-3.5 shrink-0"}),d("span",Se,u(s.name),1),d("span",{class:z(["ml-auto shrink-0 rounded px-1.5 py-0.5 text-xxs font-medium capitalize",n[s.status]])},u(s.status),3)],10,ze),r(p).has(v(h.name,s.name))?(t(),a(y,{key:0},[(t(!0),a(y,null,T(s.columns.filter(i=>i.status!=="unchanged"),i=>{var D,m,B;return t(),a("div",{key:i.name,class:z(["flex items-center gap-2 py-1.5 pl-10 pr-4",l[i.status].class])},[o(b,{name:"hugeicons:columns-02",class:"size-3 shrink-0 opacity-60"}),d("span",De,u(i.name),1),d("span",qe,[i.status==="added"?(t(),a(y,{key:0},[k(u((D=i.source)==null?void 0:D.type),1)],64)):i.status==="removed"?(t(),a(y,{key:1},[k(u((m=i.target)==null?void 0:m.type),1)],64)):(B=i.changes)!=null&&B.type?(t(),a(y,{key:2},[k(u(i.changes.type.from)+" → "+u(i.changes.type.to),1)],64)):S("",!0)]),d("span",{class:z(["shrink-0 rounded px-1 py-0.5 text-[9px] font-medium capitalize",n[i.status]])},u(i.status),3)],2)}),128)),(t(!0),a(y,null,T(s.foreignKeys.filter(i=>i.status!=="unchanged"),i=>(t(),a("div",{key:i.key,class:z(["flex items-center gap-2 py-1.5 pl-10 pr-4",l[i.status].class])},[o(b,{name:"hugeicons:link-01",class:"size-3 shrink-0 opacity-60"}),d("span",Le,u(i.key),1),d("span",{class:z(["shrink-0 rounded px-1 py-0.5 text-[9px] font-medium capitalize",n[i.status]])},u(i.status),3)],2))),128))],64)):S("",!0)],64))),128)),(t(!0),a(y,null,T(h.views.filter(s=>s.status!=="unchanged"),s=>(t(),a("div",{key:s.name,class:z(["flex items-center gap-2 px-4 py-2",l[s.status].class])},[o(b,{name:"hugeicons:eye",class:"size-3.5 shrink-0"}),d("span",Te,u(s.name),1),c[0]||(c[0]=d("span",{class:"ml-2 shrink-0 text-xxs text-muted-foreground"},"view",-1)),d("span",{class:z(["ml-auto shrink-0 rounded px-1.5 py-0.5 text-xxs font-medium capitalize",n[s.status]])},u(s.status),3)],2))),128)),(t(!0),a(y,null,T(h.functions.filter(s=>s.status!=="unchanged"),s=>(t(),a("div",{key:s.signature,class:z(["flex items-center gap-2 px-4 py-2",l[s.status].class])},[o(b,{name:"hugeicons:function-of-x",class:"size-3.5 shrink-0"}),d("span",Me,u(s.name),1),c[1]||(c[1]=d("span",{class:"ml-2 shrink-0 text-xxs text-muted-foreground"},"fn",-1)),d("span",{class:z(["ml-auto shrink-0 rounded px-1.5 py-0.5 text-xxs font-medium capitalize",n[s.status]])},u(s.status),3)],2))),128))])):S("",!0)]))),128)),r(C).length===0?(t(),a("div",Ve,[o(b,{name:"hugeicons:checkmark-circle-02",class:"size-10 text-emerald-500"}),c[2]||(c[2]=d("p",{class:"text-sm font-medium"},"Schemas are identical",-1)),c[3]||(c[3]=d("p",{class:"text-xs"},"No differences detected between source and target.",-1))])):S("",!0)])}}}),Ie={diff:x=>$fetch("/api/schema-diff",{method:"POST",body:x})};function Re(){const x=q(null),_=q(!1),p=q(null),l=q(!0),n=e=>({type:e.type,connectionString:e.connectionString,host:e.host,port:e.port,username:e.username,password:e.password,database:e.database,ssl:e.ssl,ssh:e.ssh}),f=async(e,c)=>{_.value=!0,p.value=null,x.value=null;try{x.value=await Ie.diff({source:n(e),target:n(c),safeMode:l.value})}catch($){p.value=$ instanceof Error?$.message:"Schema diff failed. Check connection details."}finally{_.value=!1}},g=()=>{x.value=null,p.value=null},v=M(()=>x.value?l.value?x.value.sql.safe:x.value.sql.full:""),C=M(()=>{if(!x.value)return!1;const{added:e,removed:c,modified:$}=x.value.summary;return e+c+$>0});return{result:x,isLoading:_,error:p,safeMode:l,currentSql:v,hasDifferences:C,runDiff:f,reset:g}}const Ne={class:"flex h-full flex-col gap-4 overflow-hidden p-4"},je={class:"flex items-center justify-between gap-2"},Pe={key:0,class:"ml-1 rounded-full bg-primary px-1.5 py-0.5 text-xxs text-primary-foreground"},Ue={key:0,class:"ml-1 rounded-full bg-muted px-1.5 py-0.5 text-xxs text-muted-foreground"},Ae={class:"text-xs text-muted-foreground"},Oe={key:0,class:"flex-1 overflow-y-auto"},Qe={key:1,class:"flex-1 overflow-y-auto"},Ee={key:2,class:"flex flex-1 flex-col items-center justify-center gap-3 text-muted-foreground"},Xe=R({__name:"SchemaDiffContainer",props:{sourceConnectionId:{}},setup(x){const _=x,p=Z(),l=M(()=>p.connections.find(D=>D.id===_.sourceConnectionId)??null),n=M(()=>p.connections.filter(D=>D.id!==_.sourceConnectionId)),f=q(null),{result:g,isLoading:v,error:C,safeMode:e,currentSql:c,hasDifferences:$,runDiff:b}=Re(),h=async()=>{!l.value||!f.value||await b(l.value,f.value)},s=M(()=>{var D;return((D=g.value)==null?void 0:D.sql.statements.filter(m=>m.destructive).length)??0}),i=q("diff");return(D,m)=>{const B=H,I=N,A=ie,O=ae,Q=oe,j=ne,E=se,F=te;return t(),a("div",Ne,[o(B,{icon:"hugeicons:git-compare",title:"Schema Diff",description:"Compare schemas between two database connections and generate sync SQL."}),o(me,{"source-connection":r(l),"target-connection":r(f),connections:r(n),"is-loading":r(v),"onUpdate:targetConnection":m[0]||(m[0]=L=>f.value=L),onRun:h},null,8,["source-connection","target-connection","connections","is-loading"]),r(C)?(t(),V(Q,{key:0,class:"border-border bg-muted/30"},{default:w(()=>[o(I,{name:"hugeicons:alert-circle",class:"size-4 text-destructive"}),o(A,{class:"text-destructive"},{default:w(()=>m[5]||(m[5]=[k("Diff Failed")])),_:1}),o(O,{class:"text-muted-foreground"},{default:w(()=>[k(u(r(C)),1)]),_:1})]),_:1})):S("",!0),r(g)?(t(),a(y,{key:1},[d("div",je,[o(F,{modelValue:r(i),"onUpdate:modelValue":m[3]||(m[3]=L=>ee(i)?i.value=L:null),class:"min-w-0 flex-1 gap-0"},{default:w(()=>[o(E,{size:"sm",class:"max-w-full justify-start! overflow-x-auto"},{default:w(()=>[o(j,{size:"xs",value:"diff",class:"min-w-fit shrink-0 cursor-pointer rounded-sm",onClick:m[1]||(m[1]=L=>i.value="diff")},{default:w(()=>[o(I,{name:"hugeicons:git-compare",class:"shrink-0 size-3.5"}),m[6]||(m[6]=k(" Diff View ")),r($)?(t(),a("span",Pe,u(r(g).summary.added+r(g).summary.removed+r(g).summary.modified),1)):S("",!0)]),_:1}),o(j,{value:"sql",class:"min-w-fit shrink-0 cursor-pointer rounded-sm px-1.5 text-xs",onClick:m[2]||(m[2]=L=>i.value="sql")},{default:w(()=>[o(I,{name:"hugeicons:code",class:"shrink-0 size-3.5"}),m[7]||(m[7]=k(" SQL ")),r(g).sql.statements.length>0?(t(),a("span",Ue,u(r(g).sql.statements.length),1)):S("",!0)]),_:1})]),_:1})]),_:1},8,["modelValue"]),d("div",Ae,u(r(i)==="diff"?"Visualize structural differences":"Review synchronization script"),1)]),r(i)==="diff"?(t(),a("div",Oe,[o(Be,{result:r(g)},null,8,["result"])])):(t(),a("div",Qe,[o(ke,{sql:r(c),"safe-mode":r(e),"statement-count":r(g).sql.statements.length,"destructive-count":r(s),"onUpdate:safeMode":m[4]||(m[4]=L=>e.value=L)},null,8,["sql","safe-mode","statement-count","destructive-count"])]))],64)):r(v)?S("",!0):(t(),a("div",Ee,[o(I,{name:"hugeicons:git-compare",class:"size-14 opacity-30"}),m[8]||(m[8]=d("p",{class:"text-sm"},"Select a target connection and run the diff",-1))]))])}}});export{Xe as _};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as V}from"./BO-QgaRL.js";import{I as X}from"./DTlu-CJn.js";import{_ as $,t as J,q as Q,s as Z,g as rr,a as er,b as tr,l as m,d as ar,u as sr,F as nr,A as or,k as E,G as cr,H as ir,I as dr,K as hr}from"./DSOwr8Hs.js";import{p as lr}from"./DzaPC1WB.js";import"./D7uoAo-G.js";var p={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},$r=dr.gitGraph,q=$(()=>cr({...$r,...ir().gitGraph}),"getConfig"),i=new X(()=>{const t=q(),r=t.mainBranchName,a=t.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:a}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function z(){return hr({length:7})}$(z,"getID");function W(t,r){const a=Object.create(null);return t.reduce((n,e)=>{const s=r(e);return a[s]||(a[s]=!0,n.push(e)),n},[])}$(W,"uniqBy");var fr=$(function(t){i.records.direction=t},"setDirection"),yr=$(function(t){m.debug("options str",t),t=t==null?void 0:t.trim(),t=t||"{}";try{i.records.options=JSON.parse(t)}catch(r){m.error("error while parsing gitGraph options",r.message)}},"setOptions"),gr=$(function(){return i.records.options},"getOptions"),xr=$(function(t){let r=t.msg,a=t.id;const n=t.type;let e=t.tags;m.info("commit",r,a,n,e),m.debug("Entering commit:",r,a,n,e);const s=q();a=E.sanitizeText(a,s),r=E.sanitizeText(r,s),e=e==null?void 0:e.map(c=>E.sanitizeText(c,s));const o={id:a||i.records.seq+"-"+z(),message:r,seq:i.records.seq++,type:n??p.NORMAL,tags:e??[],parents:i.records.head==null?[]:[i.records.head.id],branch:i.records.currBranch};i.records.head=o,m.info("main branch",s.mainBranchName),i.records.commits.has(o.id)&&m.warn(`Commit ID ${o.id} already exists`),i.records.commits.set(o.id,o),i.records.branches.set(i.records.currBranch,o.id),m.debug("in pushCommit "+o.id)},"commit"),ur=$(function(t){let r=t.name;const a=t.order;if(r=E.sanitizeText(r,q()),i.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);i.records.branches.set(r,i.records.head!=null?i.records.head.id:null),i.records.branchConfig.set(r,{name:r,order:a}),S(r),m.debug("in createBranch")},"branch"),pr=$(t=>{let r=t.branch,a=t.id;const n=t.type,e=t.tags,s=q();r=E.sanitizeText(r,s),a&&(a=E.sanitizeText(a,s));const o=i.records.branches.get(i.records.currBranch),c=i.records.branches.get(r),d=o?i.records.commits.get(o):void 0,h=c?i.records.commits.get(c):void 0;if(d&&h&&d.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(i.records.currBranch===r){const l=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw l.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},l}if(d===void 0||!d){const l=new Error(`Incorrect usage of "merge". Current branch (${i.records.currBranch})has no commits`);throw l.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},l}if(!i.records.branches.has(r)){const l=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw l.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},l}if(h===void 0||!h){const l=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw l.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},l}if(d===h){const l=new Error('Incorrect usage of "merge". Both branches have same head');throw l.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},l}if(a&&i.records.commits.has(a)){const l=new Error('Incorrect usage of "merge". Commit with id:'+a+" already exists, use different custom id");throw l.hash={text:`merge ${r} ${a} ${n} ${e==null?void 0:e.join(" ")}`,token:`merge ${r} ${a} ${n} ${e==null?void 0:e.join(" ")}`,expected:[`merge ${r} ${a}_UNIQUE ${n} ${e==null?void 0:e.join(" ")}`]},l}const f=c||"",y={id:a||`${i.records.seq}-${z()}`,message:`merged branch ${r} into ${i.records.currBranch}`,seq:i.records.seq++,parents:i.records.head==null?[]:[i.records.head.id,f],branch:i.records.currBranch,type:p.MERGE,customType:n,customId:!!a,tags:e??[]};i.records.head=y,i.records.commits.set(y.id,y),i.records.branches.set(i.records.currBranch,y.id),m.debug(i.records.branches),m.debug("in mergeBranch")},"merge"),br=$(function(t){let r=t.id,a=t.targetId,n=t.tags,e=t.parent;m.debug("Entering cherryPick:",r,a,n);const s=q();if(r=E.sanitizeText(r,s),a=E.sanitizeText(a,s),n=n==null?void 0:n.map(d=>E.sanitizeText(d,s)),e=E.sanitizeText(e,s),!r||!i.records.commits.has(r)){const d=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw d.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},d}const o=i.records.commits.get(r);if(o===void 0||!o)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(e&&!(Array.isArray(o.parents)&&o.parents.includes(e)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const c=o.branch;if(o.type===p.MERGE&&!e)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!a||!i.records.commits.has(a)){if(c===i.records.currBranch){const y=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw y.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},y}const d=i.records.branches.get(i.records.currBranch);if(d===void 0||!d){const y=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw y.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},y}const h=i.records.commits.get(d);if(h===void 0||!h){const y=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw y.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},y}const f={id:i.records.seq+"-"+z(),message:`cherry-picked ${o==null?void 0:o.message} into ${i.records.currBranch}`,seq:i.records.seq++,parents:i.records.head==null?[]:[i.records.head.id,o.id],branch:i.records.currBranch,type:p.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${o.id}${o.type===p.MERGE?`|parent:${e}`:""}`]};i.records.head=f,i.records.commits.set(f.id,f),i.records.branches.set(i.records.currBranch,f.id),m.debug(i.records.branches),m.debug("in cherryPick")}},"cherryPick"),S=$(function(t){if(t=E.sanitizeText(t,q()),i.records.branches.has(t)){i.records.currBranch=t;const r=i.records.branches.get(i.records.currBranch);r===void 0||!r?i.records.head=null:i.records.head=i.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw r.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},r}},"checkout");function D(t,r,a){const n=t.indexOf(r);n===-1?t.push(a):t.splice(n,1,a)}$(D,"upsert");function F(t){const r=t.reduce((e,s)=>e.seq>s.seq?e:s,t[0]);let a="";t.forEach(function(e){e===r?a+=" *":a+=" |"});const n=[a,r.id,r.seq];for(const e in i.records.branches)i.records.branches.get(e)===r.id&&n.push(e);if(m.debug(n.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const e=i.records.commits.get(r.parents[0]);D(t,r,e),r.parents[1]&&t.push(i.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const e=i.records.commits.get(r.parents[0]);D(t,r,e)}}t=W(t,e=>e.id),F(t)}$(F,"prettyPrintCommitHistory");var mr=$(function(){m.debug(i.records.commits);const t=j()[0];F([t])},"prettyPrint"),wr=$(function(){i.reset(),or()},"clear"),vr=$(function(){return[...i.records.branchConfig.values()].map((r,a)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${a}`)}).sort((r,a)=>(r.order??0)-(a.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),Cr=$(function(){return i.records.branches},"getBranches"),Er=$(function(){return i.records.commits},"getCommits"),j=$(function(){const t=[...i.records.commits.values()];return t.forEach(function(r){m.debug(r.id)}),t.sort((r,a)=>r.seq-a.seq),t},"getCommitsArray"),Br=$(function(){return i.records.currBranch},"getCurrentBranch"),Tr=$(function(){return i.records.direction},"getDirection"),Lr=$(function(){return i.records.head},"getHead"),K={commitType:p,getConfig:q,setDirection:fr,setOptions:yr,getOptions:gr,commit:xr,branch:ur,merge:pr,cherryPick:br,checkout:S,prettyPrint:mr,clear:wr,getBranchesAsObjArray:vr,getBranches:Cr,getCommits:Er,getCommitsArray:j,getCurrentBranch:Br,getDirection:Tr,getHead:Lr,setAccTitle:tr,getAccTitle:er,getAccDescription:rr,setAccDescription:Z,setDiagramTitle:Q,getDiagramTitle:J},kr=$((t,r)=>{V(t,r),t.dir&&r.setDirection(t.dir);for(const a of t.statements)Mr(a,r)},"populate"),Mr=$((t,r)=>{const n={Commit:$(e=>r.commit(Ir(e)),"Commit"),Branch:$(e=>r.branch(Rr(e)),"Branch"),Merge:$(e=>r.merge(Gr(e)),"Merge"),Checkout:$(e=>r.checkout(Or(e)),"Checkout"),CherryPicking:$(e=>r.cherryPick(qr(e)),"CherryPicking")}[t.$type];n?n(t):m.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),Ir=$(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?p[t.type]:p.NORMAL,tags:t.tags??void 0}),"parseCommit"),Rr=$(t=>({name:t.name,order:t.order??0}),"parseBranch"),Gr=$(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?p[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),Or=$(t=>t.branch,"parseCheckout"),qr=$(t=>{var a;return{id:t.id,targetId:"",tags:((a=t.tags)==null?void 0:a.length)===0?void 0:t.tags,parent:t.parent}},"parseCherryPicking"),Ar={parse:$(async t=>{const r=await lr("gitGraph",t);m.debug(r),kr(r,K)},"parse")},I=10,R=40,B=4,L=2,O=8,v=new Map,C=new Map,P=30,A=new Map,_=[],M=0,x="LR",Hr=$(()=>{v.clear(),C.clear(),A.clear(),M=0,_=[],x="LR"},"clear"),Y=$(t=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof t=="string"?t.split(/\\n|\n|<br\s*\/?>/gi):t).forEach(n=>{const e=document.createElementNS("http://www.w3.org/2000/svg","tspan");e.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),e.setAttribute("dy","1em"),e.setAttribute("x","0"),e.setAttribute("class","row"),e.textContent=n.trim(),r.appendChild(e)}),r},"drawText"),U=$(t=>{let r,a,n;return x==="BT"?(a=$((e,s)=>e<=s,"comparisonFunc"),n=1/0):(a=$((e,s)=>e>=s,"comparisonFunc"),n=0),t.forEach(e=>{var o,c;const s=x==="TB"||x=="BT"?(o=C.get(e))==null?void 0:o.y:(c=C.get(e))==null?void 0:c.x;s!==void 0&&a(s,n)&&(r=e,n=s)}),r},"findClosestParent"),Pr=$(t=>{let r="",a=1/0;return t.forEach(n=>{const e=C.get(n).y;e<=a&&(r=n,a=e)}),r||void 0},"findClosestParentBT"),_r=$((t,r,a)=>{let n=a,e=a;const s=[];t.forEach(o=>{const c=r.get(o);if(!c)throw new Error(`Commit not found for key ${o}`);c.parents.length?(n=Dr(c),e=Math.max(n,e)):s.push(c),Fr(c,n)}),n=e,s.forEach(o=>{Nr(o,n,a)}),t.forEach(o=>{const c=r.get(o);if(c!=null&&c.parents.length){const d=Pr(c.parents);n=C.get(d).y-R,n<=e&&(e=n);const h=v.get(c.branch).pos,f=n-I;C.set(c.id,{x:h,y:f})}})},"setParallelBTPos"),zr=$(t=>{var n;const r=U(t.parents.filter(e=>e!==null));if(!r)throw new Error(`Closest parent not found for commit ${t.id}`);const a=(n=C.get(r))==null?void 0:n.y;if(a===void 0)throw new Error(`Closest parent position not found for commit ${t.id}`);return a},"findClosestParentPos"),Dr=$(t=>zr(t)+R,"calculateCommitPosition"),Fr=$((t,r)=>{const a=v.get(t.branch);if(!a)throw new Error(`Branch not found for commit ${t.id}`);const n=a.pos,e=r+I;return C.set(t.id,{x:n,y:e}),{x:n,y:e}},"setCommitPosition"),Nr=$((t,r,a)=>{const n=v.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const e=r+a,s=n.pos;C.set(t.id,{x:s,y:e})},"setRootPosition"),Wr=$((t,r,a,n,e,s)=>{if(s===p.HIGHLIGHT)t.append("rect").attr("x",a.x-10).attr("y",a.y-10).attr("width",20).attr("height",20).attr("class",`commit ${r.id} commit-highlight${e%O} ${n}-outer`),t.append("rect").attr("x",a.x-6).attr("y",a.y-6).attr("width",12).attr("height",12).attr("class",`commit ${r.id} commit${e%O} ${n}-inner`);else if(s===p.CHERRY_PICK)t.append("circle").attr("cx",a.x).attr("cy",a.y).attr("r",10).attr("class",`commit ${r.id} ${n}`),t.append("circle").attr("cx",a.x-3).attr("cy",a.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${r.id} ${n}`),t.append("circle").attr("cx",a.x+3).attr("cy",a.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${r.id} ${n}`),t.append("line").attr("x1",a.x+3).attr("y1",a.y+1).attr("x2",a.x).attr("y2",a.y-5).attr("stroke","#fff").attr("class",`commit ${r.id} ${n}`),t.append("line").attr("x1",a.x-3).attr("y1",a.y+1).attr("x2",a.x).attr("y2",a.y-5).attr("stroke","#fff").attr("class",`commit ${r.id} ${n}`);else{const o=t.append("circle");if(o.attr("cx",a.x),o.attr("cy",a.y),o.attr("r",r.type===p.MERGE?9:10),o.attr("class",`commit ${r.id} commit${e%O}`),s===p.MERGE){const c=t.append("circle");c.attr("cx",a.x),c.attr("cy",a.y),c.attr("r",6),c.attr("class",`commit ${n} ${r.id} commit${e%O}`)}s===p.REVERSE&&t.append("path").attr("d",`M ${a.x-5},${a.y-5}L${a.x+5},${a.y+5}M${a.x-5},${a.y+5}L${a.x+5},${a.y-5}`).attr("class",`commit ${n} ${r.id} commit${e%O}`)}},"drawCommitBullet"),Sr=$((t,r,a,n,e)=>{var s;if(r.type!==p.CHERRY_PICK&&(r.customId&&r.type===p.MERGE||r.type!==p.MERGE)&&e.showCommitLabel){const o=t.append("g"),c=o.insert("rect").attr("class","commit-label-bkg"),d=o.append("text").attr("x",n).attr("y",a.y+25).attr("class","commit-label").text(r.id),h=(s=d.node())==null?void 0:s.getBBox();if(h&&(c.attr("x",a.posWithOffset-h.width/2-L).attr("y",a.y+13.5).attr("width",h.width+2*L).attr("height",h.height+2*L),x==="TB"||x==="BT"?(c.attr("x",a.x-(h.width+4*B+5)).attr("y",a.y-12),d.attr("x",a.x-(h.width+4*B)).attr("y",a.y+h.height-12)):d.attr("x",a.posWithOffset-h.width/2),e.rotateCommitLabel))if(x==="TB"||x==="BT")d.attr("transform","rotate(-45, "+a.x+", "+a.y+")"),c.attr("transform","rotate(-45, "+a.x+", "+a.y+")");else{const f=-7.5-(h.width+10)/25*9.5,y=10+h.width/25*8.5;o.attr("transform","translate("+f+", "+y+") rotate(-45, "+n+", "+a.y+")")}}},"drawCommitLabel"),jr=$((t,r,a,n)=>{var e;if(r.tags.length>0){let s=0,o=0,c=0;const d=[];for(const h of r.tags.reverse()){const f=t.insert("polygon"),y=t.append("circle"),l=t.append("text").attr("y",a.y-16-s).attr("class","tag-label").text(h),g=(e=l.node())==null?void 0:e.getBBox();if(!g)throw new Error("Tag bbox not found");o=Math.max(o,g.width),c=Math.max(c,g.height),l.attr("x",a.posWithOffset-g.width/2),d.push({tag:l,hole:y,rect:f,yOffset:s}),s+=20}for(const{tag:h,hole:f,rect:y,yOffset:l}of d){const g=c/2,u=a.y-19.2-l;if(y.attr("class","tag-label-bkg").attr("points",`
|
|
1
|
+
import{p as V}from"./DZJEpoYA.js";import{I as X}from"./B-cBPXHS.js";import{_ as $,t as J,q as Q,s as Z,g as rr,a as er,b as tr,l as m,d as ar,u as sr,F as nr,A as or,k as E,G as cr,H as ir,I as dr,K as hr}from"./Dzy2Amcc.js";import{p as lr}from"./BcbezgEJ.js";import"./DD6NieRw.js";var p={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},$r=dr.gitGraph,q=$(()=>cr({...$r,...ir().gitGraph}),"getConfig"),i=new X(()=>{const t=q(),r=t.mainBranchName,a=t.mainBranchOrder;return{mainBranchName:r,commits:new Map,head:null,branchConfig:new Map([[r,{name:r,order:a}]]),branches:new Map([[r,null]]),currBranch:r,direction:"LR",seq:0,options:{}}});function z(){return hr({length:7})}$(z,"getID");function W(t,r){const a=Object.create(null);return t.reduce((n,e)=>{const s=r(e);return a[s]||(a[s]=!0,n.push(e)),n},[])}$(W,"uniqBy");var fr=$(function(t){i.records.direction=t},"setDirection"),yr=$(function(t){m.debug("options str",t),t=t==null?void 0:t.trim(),t=t||"{}";try{i.records.options=JSON.parse(t)}catch(r){m.error("error while parsing gitGraph options",r.message)}},"setOptions"),gr=$(function(){return i.records.options},"getOptions"),xr=$(function(t){let r=t.msg,a=t.id;const n=t.type;let e=t.tags;m.info("commit",r,a,n,e),m.debug("Entering commit:",r,a,n,e);const s=q();a=E.sanitizeText(a,s),r=E.sanitizeText(r,s),e=e==null?void 0:e.map(c=>E.sanitizeText(c,s));const o={id:a||i.records.seq+"-"+z(),message:r,seq:i.records.seq++,type:n??p.NORMAL,tags:e??[],parents:i.records.head==null?[]:[i.records.head.id],branch:i.records.currBranch};i.records.head=o,m.info("main branch",s.mainBranchName),i.records.commits.has(o.id)&&m.warn(`Commit ID ${o.id} already exists`),i.records.commits.set(o.id,o),i.records.branches.set(i.records.currBranch,o.id),m.debug("in pushCommit "+o.id)},"commit"),ur=$(function(t){let r=t.name;const a=t.order;if(r=E.sanitizeText(r,q()),i.records.branches.has(r))throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${r}")`);i.records.branches.set(r,i.records.head!=null?i.records.head.id:null),i.records.branchConfig.set(r,{name:r,order:a}),S(r),m.debug("in createBranch")},"branch"),pr=$(t=>{let r=t.branch,a=t.id;const n=t.type,e=t.tags,s=q();r=E.sanitizeText(r,s),a&&(a=E.sanitizeText(a,s));const o=i.records.branches.get(i.records.currBranch),c=i.records.branches.get(r),d=o?i.records.commits.get(o):void 0,h=c?i.records.commits.get(c):void 0;if(d&&h&&d.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(i.records.currBranch===r){const l=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw l.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},l}if(d===void 0||!d){const l=new Error(`Incorrect usage of "merge". Current branch (${i.records.currBranch})has no commits`);throw l.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},l}if(!i.records.branches.has(r)){const l=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw l.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},l}if(h===void 0||!h){const l=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw l.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},l}if(d===h){const l=new Error('Incorrect usage of "merge". Both branches have same head');throw l.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},l}if(a&&i.records.commits.has(a)){const l=new Error('Incorrect usage of "merge". Commit with id:'+a+" already exists, use different custom id");throw l.hash={text:`merge ${r} ${a} ${n} ${e==null?void 0:e.join(" ")}`,token:`merge ${r} ${a} ${n} ${e==null?void 0:e.join(" ")}`,expected:[`merge ${r} ${a}_UNIQUE ${n} ${e==null?void 0:e.join(" ")}`]},l}const f=c||"",y={id:a||`${i.records.seq}-${z()}`,message:`merged branch ${r} into ${i.records.currBranch}`,seq:i.records.seq++,parents:i.records.head==null?[]:[i.records.head.id,f],branch:i.records.currBranch,type:p.MERGE,customType:n,customId:!!a,tags:e??[]};i.records.head=y,i.records.commits.set(y.id,y),i.records.branches.set(i.records.currBranch,y.id),m.debug(i.records.branches),m.debug("in mergeBranch")},"merge"),br=$(function(t){let r=t.id,a=t.targetId,n=t.tags,e=t.parent;m.debug("Entering cherryPick:",r,a,n);const s=q();if(r=E.sanitizeText(r,s),a=E.sanitizeText(a,s),n=n==null?void 0:n.map(d=>E.sanitizeText(d,s)),e=E.sanitizeText(e,s),!r||!i.records.commits.has(r)){const d=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw d.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},d}const o=i.records.commits.get(r);if(o===void 0||!o)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(e&&!(Array.isArray(o.parents)&&o.parents.includes(e)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const c=o.branch;if(o.type===p.MERGE&&!e)throw new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");if(!a||!i.records.commits.has(a)){if(c===i.records.currBranch){const y=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw y.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},y}const d=i.records.branches.get(i.records.currBranch);if(d===void 0||!d){const y=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw y.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},y}const h=i.records.commits.get(d);if(h===void 0||!h){const y=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw y.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},y}const f={id:i.records.seq+"-"+z(),message:`cherry-picked ${o==null?void 0:o.message} into ${i.records.currBranch}`,seq:i.records.seq++,parents:i.records.head==null?[]:[i.records.head.id,o.id],branch:i.records.currBranch,type:p.CHERRY_PICK,tags:n?n.filter(Boolean):[`cherry-pick:${o.id}${o.type===p.MERGE?`|parent:${e}`:""}`]};i.records.head=f,i.records.commits.set(f.id,f),i.records.branches.set(i.records.currBranch,f.id),m.debug(i.records.branches),m.debug("in cherryPick")}},"cherryPick"),S=$(function(t){if(t=E.sanitizeText(t,q()),i.records.branches.has(t)){i.records.currBranch=t;const r=i.records.branches.get(i.records.currBranch);r===void 0||!r?i.records.head=null:i.records.head=i.records.commits.get(r)??null}else{const r=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);throw r.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]},r}},"checkout");function D(t,r,a){const n=t.indexOf(r);n===-1?t.push(a):t.splice(n,1,a)}$(D,"upsert");function F(t){const r=t.reduce((e,s)=>e.seq>s.seq?e:s,t[0]);let a="";t.forEach(function(e){e===r?a+=" *":a+=" |"});const n=[a,r.id,r.seq];for(const e in i.records.branches)i.records.branches.get(e)===r.id&&n.push(e);if(m.debug(n.join(" ")),r.parents&&r.parents.length==2&&r.parents[0]&&r.parents[1]){const e=i.records.commits.get(r.parents[0]);D(t,r,e),r.parents[1]&&t.push(i.records.commits.get(r.parents[1]))}else{if(r.parents.length==0)return;if(r.parents[0]){const e=i.records.commits.get(r.parents[0]);D(t,r,e)}}t=W(t,e=>e.id),F(t)}$(F,"prettyPrintCommitHistory");var mr=$(function(){m.debug(i.records.commits);const t=j()[0];F([t])},"prettyPrint"),wr=$(function(){i.reset(),or()},"clear"),vr=$(function(){return[...i.records.branchConfig.values()].map((r,a)=>r.order!==null&&r.order!==void 0?r:{...r,order:parseFloat(`0.${a}`)}).sort((r,a)=>(r.order??0)-(a.order??0)).map(({name:r})=>({name:r}))},"getBranchesAsObjArray"),Cr=$(function(){return i.records.branches},"getBranches"),Er=$(function(){return i.records.commits},"getCommits"),j=$(function(){const t=[...i.records.commits.values()];return t.forEach(function(r){m.debug(r.id)}),t.sort((r,a)=>r.seq-a.seq),t},"getCommitsArray"),Br=$(function(){return i.records.currBranch},"getCurrentBranch"),Tr=$(function(){return i.records.direction},"getDirection"),Lr=$(function(){return i.records.head},"getHead"),K={commitType:p,getConfig:q,setDirection:fr,setOptions:yr,getOptions:gr,commit:xr,branch:ur,merge:pr,cherryPick:br,checkout:S,prettyPrint:mr,clear:wr,getBranchesAsObjArray:vr,getBranches:Cr,getCommits:Er,getCommitsArray:j,getCurrentBranch:Br,getDirection:Tr,getHead:Lr,setAccTitle:tr,getAccTitle:er,getAccDescription:rr,setAccDescription:Z,setDiagramTitle:Q,getDiagramTitle:J},kr=$((t,r)=>{V(t,r),t.dir&&r.setDirection(t.dir);for(const a of t.statements)Mr(a,r)},"populate"),Mr=$((t,r)=>{const n={Commit:$(e=>r.commit(Ir(e)),"Commit"),Branch:$(e=>r.branch(Rr(e)),"Branch"),Merge:$(e=>r.merge(Gr(e)),"Merge"),Checkout:$(e=>r.checkout(Or(e)),"Checkout"),CherryPicking:$(e=>r.cherryPick(qr(e)),"CherryPicking")}[t.$type];n?n(t):m.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),Ir=$(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?p[t.type]:p.NORMAL,tags:t.tags??void 0}),"parseCommit"),Rr=$(t=>({name:t.name,order:t.order??0}),"parseBranch"),Gr=$(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?p[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),Or=$(t=>t.branch,"parseCheckout"),qr=$(t=>{var a;return{id:t.id,targetId:"",tags:((a=t.tags)==null?void 0:a.length)===0?void 0:t.tags,parent:t.parent}},"parseCherryPicking"),Ar={parse:$(async t=>{const r=await lr("gitGraph",t);m.debug(r),kr(r,K)},"parse")},I=10,R=40,B=4,L=2,O=8,v=new Map,C=new Map,P=30,A=new Map,_=[],M=0,x="LR",Hr=$(()=>{v.clear(),C.clear(),A.clear(),M=0,_=[],x="LR"},"clear"),Y=$(t=>{const r=document.createElementNS("http://www.w3.org/2000/svg","text");return(typeof t=="string"?t.split(/\\n|\n|<br\s*\/?>/gi):t).forEach(n=>{const e=document.createElementNS("http://www.w3.org/2000/svg","tspan");e.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),e.setAttribute("dy","1em"),e.setAttribute("x","0"),e.setAttribute("class","row"),e.textContent=n.trim(),r.appendChild(e)}),r},"drawText"),U=$(t=>{let r,a,n;return x==="BT"?(a=$((e,s)=>e<=s,"comparisonFunc"),n=1/0):(a=$((e,s)=>e>=s,"comparisonFunc"),n=0),t.forEach(e=>{var o,c;const s=x==="TB"||x=="BT"?(o=C.get(e))==null?void 0:o.y:(c=C.get(e))==null?void 0:c.x;s!==void 0&&a(s,n)&&(r=e,n=s)}),r},"findClosestParent"),Pr=$(t=>{let r="",a=1/0;return t.forEach(n=>{const e=C.get(n).y;e<=a&&(r=n,a=e)}),r||void 0},"findClosestParentBT"),_r=$((t,r,a)=>{let n=a,e=a;const s=[];t.forEach(o=>{const c=r.get(o);if(!c)throw new Error(`Commit not found for key ${o}`);c.parents.length?(n=Dr(c),e=Math.max(n,e)):s.push(c),Fr(c,n)}),n=e,s.forEach(o=>{Nr(o,n,a)}),t.forEach(o=>{const c=r.get(o);if(c!=null&&c.parents.length){const d=Pr(c.parents);n=C.get(d).y-R,n<=e&&(e=n);const h=v.get(c.branch).pos,f=n-I;C.set(c.id,{x:h,y:f})}})},"setParallelBTPos"),zr=$(t=>{var n;const r=U(t.parents.filter(e=>e!==null));if(!r)throw new Error(`Closest parent not found for commit ${t.id}`);const a=(n=C.get(r))==null?void 0:n.y;if(a===void 0)throw new Error(`Closest parent position not found for commit ${t.id}`);return a},"findClosestParentPos"),Dr=$(t=>zr(t)+R,"calculateCommitPosition"),Fr=$((t,r)=>{const a=v.get(t.branch);if(!a)throw new Error(`Branch not found for commit ${t.id}`);const n=a.pos,e=r+I;return C.set(t.id,{x:n,y:e}),{x:n,y:e}},"setCommitPosition"),Nr=$((t,r,a)=>{const n=v.get(t.branch);if(!n)throw new Error(`Branch not found for commit ${t.id}`);const e=r+a,s=n.pos;C.set(t.id,{x:s,y:e})},"setRootPosition"),Wr=$((t,r,a,n,e,s)=>{if(s===p.HIGHLIGHT)t.append("rect").attr("x",a.x-10).attr("y",a.y-10).attr("width",20).attr("height",20).attr("class",`commit ${r.id} commit-highlight${e%O} ${n}-outer`),t.append("rect").attr("x",a.x-6).attr("y",a.y-6).attr("width",12).attr("height",12).attr("class",`commit ${r.id} commit${e%O} ${n}-inner`);else if(s===p.CHERRY_PICK)t.append("circle").attr("cx",a.x).attr("cy",a.y).attr("r",10).attr("class",`commit ${r.id} ${n}`),t.append("circle").attr("cx",a.x-3).attr("cy",a.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${r.id} ${n}`),t.append("circle").attr("cx",a.x+3).attr("cy",a.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${r.id} ${n}`),t.append("line").attr("x1",a.x+3).attr("y1",a.y+1).attr("x2",a.x).attr("y2",a.y-5).attr("stroke","#fff").attr("class",`commit ${r.id} ${n}`),t.append("line").attr("x1",a.x-3).attr("y1",a.y+1).attr("x2",a.x).attr("y2",a.y-5).attr("stroke","#fff").attr("class",`commit ${r.id} ${n}`);else{const o=t.append("circle");if(o.attr("cx",a.x),o.attr("cy",a.y),o.attr("r",r.type===p.MERGE?9:10),o.attr("class",`commit ${r.id} commit${e%O}`),s===p.MERGE){const c=t.append("circle");c.attr("cx",a.x),c.attr("cy",a.y),c.attr("r",6),c.attr("class",`commit ${n} ${r.id} commit${e%O}`)}s===p.REVERSE&&t.append("path").attr("d",`M ${a.x-5},${a.y-5}L${a.x+5},${a.y+5}M${a.x-5},${a.y+5}L${a.x+5},${a.y-5}`).attr("class",`commit ${n} ${r.id} commit${e%O}`)}},"drawCommitBullet"),Sr=$((t,r,a,n,e)=>{var s;if(r.type!==p.CHERRY_PICK&&(r.customId&&r.type===p.MERGE||r.type!==p.MERGE)&&e.showCommitLabel){const o=t.append("g"),c=o.insert("rect").attr("class","commit-label-bkg"),d=o.append("text").attr("x",n).attr("y",a.y+25).attr("class","commit-label").text(r.id),h=(s=d.node())==null?void 0:s.getBBox();if(h&&(c.attr("x",a.posWithOffset-h.width/2-L).attr("y",a.y+13.5).attr("width",h.width+2*L).attr("height",h.height+2*L),x==="TB"||x==="BT"?(c.attr("x",a.x-(h.width+4*B+5)).attr("y",a.y-12),d.attr("x",a.x-(h.width+4*B)).attr("y",a.y+h.height-12)):d.attr("x",a.posWithOffset-h.width/2),e.rotateCommitLabel))if(x==="TB"||x==="BT")d.attr("transform","rotate(-45, "+a.x+", "+a.y+")"),c.attr("transform","rotate(-45, "+a.x+", "+a.y+")");else{const f=-7.5-(h.width+10)/25*9.5,y=10+h.width/25*8.5;o.attr("transform","translate("+f+", "+y+") rotate(-45, "+n+", "+a.y+")")}}},"drawCommitLabel"),jr=$((t,r,a,n)=>{var e;if(r.tags.length>0){let s=0,o=0,c=0;const d=[];for(const h of r.tags.reverse()){const f=t.insert("polygon"),y=t.append("circle"),l=t.append("text").attr("y",a.y-16-s).attr("class","tag-label").text(h),g=(e=l.node())==null?void 0:e.getBBox();if(!g)throw new Error("Tag bbox not found");o=Math.max(o,g.width),c=Math.max(c,g.height),l.attr("x",a.posWithOffset-g.width/2),d.push({tag:l,hole:y,rect:f,yOffset:s}),s+=20}for(const{tag:h,hole:f,rect:y,yOffset:l}of d){const g=c/2,u=a.y-19.2-l;if(y.attr("class","tag-label-bkg").attr("points",`
|
|
2
2
|
${n-o/2-B/2},${u+L}
|
|
3
3
|
${n-o/2-B/2},${u-L}
|
|
4
4
|
${a.posWithOffset-o/2-B},${u-g-L}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as s,c as xt,l as E,d as q,ac as kt,ad as vt,ae as _t,af as bt,E as wt,ag as St,A as Et}from"./
|
|
1
|
+
import{_ as s,c as xt,l as E,d as q,ac as kt,ad as vt,ae as _t,af as bt,E as wt,ag as St,A as Et}from"./Dzy2Amcc.js";import{d as nt}from"./Ce00XEKL.js";import"./DD6NieRw.js";var X=function(){var n=s(function(f,r,a,h){for(a=a||{},h=f.length;h--;a[f[h]]=r);return a},"o"),t=[6,8,10,11,12,14,16,17,20,21],e=[1,9],l=[1,10],i=[1,11],d=[1,12],c=[1,13],g=[1,16],m=[1,17],p={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,period_statement:18,event_statement:19,period:20,event:21,$accept:0,$end:1},terminals_:{2:"error",4:"timeline",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",20:"period",21:"event"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[18,1],[19,1]],performAction:s(function(r,a,h,u,y,o,S){var k=o.length-1;switch(y){case 1:return o[k-1];case 2:this.$=[];break;case 3:o[k-1].push(o[k]),this.$=o[k-1];break;case 4:case 5:this.$=o[k];break;case 6:case 7:this.$=[];break;case 8:u.getCommonDb().setDiagramTitle(o[k].substr(6)),this.$=o[k].substr(6);break;case 9:this.$=o[k].trim(),u.getCommonDb().setAccTitle(this.$);break;case 10:case 11:this.$=o[k].trim(),u.getCommonDb().setAccDescription(this.$);break;case 12:u.addSection(o[k].substr(8)),this.$=o[k].substr(8);break;case 15:u.addTask(o[k],0,""),this.$=o[k];break;case 16:u.addEvent(o[k].substr(2)),this.$=o[k];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},n(t,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:e,12:l,14:i,16:d,17:c,18:14,19:15,20:g,21:m},n(t,[2,7],{1:[2,1]}),n(t,[2,3]),{9:18,11:e,12:l,14:i,16:d,17:c,18:14,19:15,20:g,21:m},n(t,[2,5]),n(t,[2,6]),n(t,[2,8]),{13:[1,19]},{15:[1,20]},n(t,[2,11]),n(t,[2,12]),n(t,[2,13]),n(t,[2,14]),n(t,[2,15]),n(t,[2,16]),n(t,[2,4]),n(t,[2,9]),n(t,[2,10])],defaultActions:{},parseError:s(function(r,a){if(a.recoverable)this.trace(r);else{var h=new Error(r);throw h.hash=a,h}},"parseError"),parse:s(function(r){var a=this,h=[0],u=[],y=[null],o=[],S=this.table,k="",M=0,C=0,B=2,J=1,O=o.slice.call(arguments,1),v=Object.create(this.lexer),N={yy:{}};for(var L in this.yy)Object.prototype.hasOwnProperty.call(this.yy,L)&&(N.yy[L]=this.yy[L]);v.setInput(r,N.yy),N.yy.lexer=v,N.yy.parser=this,typeof v.yylloc>"u"&&(v.yylloc={});var b=v.yylloc;o.push(b);var $=v.options&&v.options.ranges;typeof N.yy.parseError=="function"?this.parseError=N.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function R(T){h.length=h.length-2*T,y.length=y.length-T,o.length=o.length-T}s(R,"popStack");function P(){var T;return T=u.pop()||v.lex()||J,typeof T!="number"&&(T instanceof Array&&(u=T,T=u.pop()),T=a.symbols_[T]||T),T}s(P,"lex");for(var w,A,I,K,z={},j,H,et,G;;){if(A=h[h.length-1],this.defaultActions[A]?I=this.defaultActions[A]:((w===null||typeof w>"u")&&(w=P()),I=S[A]&&S[A][w]),typeof I>"u"||!I.length||!I[0]){var Q="";G=[];for(j in S[A])this.terminals_[j]&&j>B&&G.push("'"+this.terminals_[j]+"'");v.showPosition?Q="Parse error on line "+(M+1)+`:
|
|
2
2
|
`+v.showPosition()+`
|
|
3
3
|
Expecting `+G.join(", ")+", got '"+(this.terminals_[w]||w)+"'":Q="Parse error on line "+(M+1)+": Unexpected "+(w==J?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(Q,{text:v.match,token:this.terminals_[w]||w,line:v.yylineno,loc:b,expected:G})}if(I[0]instanceof Array&&I.length>1)throw new Error("Parse Error: multiple actions possible at state: "+A+", token: "+w);switch(I[0]){case 1:h.push(w),y.push(v.yytext),o.push(v.yylloc),h.push(I[1]),w=null,C=v.yyleng,k=v.yytext,M=v.yylineno,b=v.yylloc;break;case 2:if(H=this.productions_[I[1]][1],z.$=y[y.length-H],z._$={first_line:o[o.length-(H||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(H||1)].first_column,last_column:o[o.length-1].last_column},$&&(z._$.range=[o[o.length-(H||1)].range[0],o[o.length-1].range[1]]),K=this.performAction.apply(z,[k,C,M,N.yy,I[1],y,o].concat(O)),typeof K<"u")return K;H&&(h=h.slice(0,-1*H*2),y=y.slice(0,-1*H),o=o.slice(0,-1*H)),h.push(this.productions_[I[1]][0]),y.push(z.$),o.push(z._$),et=S[h[h.length-2]][h[h.length-1]],h.push(et);break;case 3:return!0}}return!0},"parse")},x=function(){var f={EOF:1,parseError:s(function(a,h){if(this.yy.parser)this.yy.parser.parseError(a,h);else throw new Error(a)},"parseError"),setInput:s(function(r,a){return this.yy=a||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:s(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var a=r.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:s(function(r){var a=r.length,h=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var y=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===u.length?this.yylloc.first_column:0)+u[u.length-h.length].length-h[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:s(function(r){this.unput(this.match.slice(r))},"less"),pastInput:s(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var r=this.pastInput(),a=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{U as a,D as n}from"./Dzy2Amcc.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as a,c as s,a as e,C as t}from"./EzQMUIRl.js";import{_ as i}from"./Dzy2Amcc.js";import"./CM7fDldV.js";import"./BX-NC3FD.js";import"./CAnZNTn6.js";import"./CHFYZcjC.js";import"./DD6NieRw.js";var n={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as w,G as te,H as ae,L as he,e as ue,l as K,b5 as P,d as j,b as pe,a as fe,q as ge,t as me,g as ye,s as Se,I as ve,b6 as xe,A as be}from"./DSOwr8Hs.js";import{s as we}from"./DuKway_J.js";import{p as Ce}from"./BO-QgaRL.js";import{p as Te}from"./DzaPC1WB.js";import{b as O}from"./DX6XiGOO.js";import{o as J}from"./CmKTTxBW.js";import"./D7uoAo-G.js";import"./Gi6I4Gst.js";function Le(t){var a=0,l=t.children,n=l&&l.length;if(!n)a=1;else for(;--n>=0;)a+=l[n].value;t.value=a}function $e(){return this.eachAfter(Le)}function Ae(t,a){let l=-1;for(const n of this)t.call(a,n,++l,this);return this}function Fe(t,a){for(var l=this,n=[l],o,s,d=-1;l=n.pop();)if(t.call(a,l,++d,this),o=l.children)for(s=o.length-1;s>=0;--s)n.push(o[s]);return this}function ke(t,a){for(var l=this,n=[l],o=[],s,d,h,g=-1;l=n.pop();)if(o.push(l),s=l.children)for(d=0,h=s.length;d<h;++d)n.push(s[d]);for(;l=o.pop();)t.call(a,l,++g,this);return this}function Ne(t,a){let l=-1;for(const n of this)if(t.call(a,n,++l,this))return n}function Me(t){return this.eachAfter(function(a){for(var l=+t(a.data)||0,n=a.children,o=n&&n.length;--o>=0;)l+=n[o].value;a.value=l})}function _e(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function ze(t){for(var a=this,l=Ve(a,t),n=[a];a!==l;)a=a.parent,n.push(a);for(var o=n.length;t!==l;)n.splice(o,0,t),t=t.parent;return n}function Ve(t,a){if(t===a)return t;var l=t.ancestors(),n=a.ancestors(),o=null;for(t=l.pop(),a=n.pop();t===a;)o=t,t=l.pop(),a=n.pop();return o}function De(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function Pe(){return Array.from(this)}function Be(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function Re(){var t=this,a=[];return t.each(function(l){l!==t&&a.push({source:l.parent,target:l})}),a}function*Ee(){var t=this,a,l=[t],n,o,s;do for(a=l.reverse(),l=[];t=a.pop();)if(yield t,n=t.children)for(o=0,s=n.length;o<s;++o)l.push(n[o]);while(l.length)}function Q(t,a){t instanceof Map?(t=[void 0,t],a===void 0&&(a=Ie)):a===void 0&&(a=He);for(var l=new U(t),n,o=[l],s,d,h,g;n=o.pop();)if((d=a(n.data))&&(g=(d=Array.from(d)).length))for(n.children=d,h=g-1;h>=0;--h)o.push(s=d[h]=new U(d[h])),s.parent=n,s.depth=n.depth+1;return l.eachBefore(Ge)}function We(){return Q(this).eachBefore(Oe)}function He(t){return t.children}function Ie(t){return Array.isArray(t)?t[1]:null}function Oe(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Ge(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function U(t){this.data=t,this.depth=this.height=0,this.parent=null}U.prototype=Q.prototype={constructor:U,count:$e,each:Ae,eachAfter:ke,eachBefore:Fe,find:Ne,sum:Me,sort:_e,path:ze,ancestors:De,descendants:Pe,leaves:Be,links:Re,copy:We,[Symbol.iterator]:Ee};function qe(t){if(typeof t!="function")throw new Error;return t}function G(){return 0}function q(t){return function(){return t}}function Xe(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Ye(t,a,l,n,o){for(var s=t.children,d,h=-1,g=s.length,c=t.value&&(n-a)/t.value;++h<g;)d=s[h],d.y0=l,d.y1=o,d.x0=a,d.x1=a+=d.value*c}function je(t,a,l,n,o){for(var s=t.children,d,h=-1,g=s.length,c=t.value&&(o-l)/t.value;++h<g;)d=s[h],d.x0=a,d.x1=n,d.y0=l,d.y1=l+=d.value*c}var Ue=(1+Math.sqrt(5))/2;function Ze(t,a,l,n,o,s){for(var d=[],h=a.children,g,c,u=0,b=0,r=h.length,x,S,v=a.value,p,m,N,k,V,E,M;u<r;){x=o-l,S=s-n;do p=h[b++].value;while(!p&&b<r);for(m=N=p,E=Math.max(S/x,x/S)/(v*t),M=p*p*E,V=Math.max(N/M,M/m);b<r;++b){if(p+=c=h[b].value,c<m&&(m=c),c>N&&(N=c),M=p*p*E,k=Math.max(N/M,M/m),k>V){p-=c;break}V=k}d.push(g={value:p,dice:x<S,children:h.slice(u,b)}),g.dice?Ye(g,l,n,o,v?n+=S*p/v:s):je(g,l,n,v?l+=x*p/v:o,s),v-=p,u=b}return d}const Je=function t(a){function l(n,o,s,d,h){Ze(a,n,o,s,d,h)}return l.ratio=function(n){return t((n=+n)>1?n:1)},l}(Ue);function Ke(){var t=Je,a=!1,l=1,n=1,o=[0],s=G,d=G,h=G,g=G,c=G;function u(r){return r.x0=r.y0=0,r.x1=l,r.y1=n,r.eachBefore(b),o=[0],a&&r.eachBefore(Xe),r}function b(r){var x=o[r.depth],S=r.x0+x,v=r.y0+x,p=r.x1-x,m=r.y1-x;p<S&&(S=p=(S+p)/2),m<v&&(v=m=(v+m)/2),r.x0=S,r.y0=v,r.x1=p,r.y1=m,r.children&&(x=o[r.depth+1]=s(r)/2,S+=c(r)-x,v+=d(r)-x,p-=h(r)-x,m-=g(r)-x,p<S&&(S=p=(S+p)/2),m<v&&(v=m=(v+m)/2),t(r,S,v,p,m))}return u.round=function(r){return arguments.length?(a=!!r,u):a},u.size=function(r){return arguments.length?(l=+r[0],n=+r[1],u):[l,n]},u.tile=function(r){return arguments.length?(t=qe(r),u):t},u.padding=function(r){return arguments.length?u.paddingInner(r).paddingOuter(r):u.paddingInner()},u.paddingInner=function(r){return arguments.length?(s=typeof r=="function"?r:q(+r),u):s},u.paddingOuter=function(r){return arguments.length?u.paddingTop(r).paddingRight(r).paddingBottom(r).paddingLeft(r):u.paddingTop()},u.paddingTop=function(r){return arguments.length?(d=typeof r=="function"?r:q(+r),u):d},u.paddingRight=function(r){return arguments.length?(h=typeof r=="function"?r:q(+r),u):h},u.paddingBottom=function(r){return arguments.length?(g=typeof r=="function"?r:q(+r),u):g},u.paddingLeft=function(r){return arguments.length?(c=typeof r=="function"?r:q(+r),u):c},u}var R,ne=(R=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=pe,this.getAccTitle=fe,this.setDiagramTitle=ge,this.getDiagramTitle=me,this.getAccDescription=ye,this.setAccDescription=Se}getNodes(){return this.nodes}getConfig(){const a=ve,l=ae();return te({...a.treemap,...l.treemap??{}})}addNode(a,l){this.nodes.push(a),this.levels.set(a,l),l===0&&(this.outerNodes.push(a),this.root??(this.root=a))}getRoot(){return{name:"",children:this.outerNodes}}addClass(a,l){const n=this.classes.get(a)??{id:a,styles:[],textStyles:[]},o=l.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");o&&o.forEach(s=>{xe(s)&&(n!=null&&n.textStyles?n.textStyles.push(s):n.textStyles=[s]),n!=null&&n.styles?n.styles.push(s):n.styles=[s]}),this.classes.set(a,n)}getClasses(){return this.classes}getStylesForClass(a){var l;return((l=this.classes.get(a))==null?void 0:l.styles)??[]}clear(){be(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},w(R,"TreeMapDB"),R);function le(t){if(!t.length)return[];const a=[],l=[];return t.forEach(n=>{const o={name:n.name,children:n.type==="Leaf"?void 0:[]};for(o.classSelector=n==null?void 0:n.classSelector,n!=null&&n.cssCompiledStyles&&(o.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(o.value=n.value);l.length>0&&l[l.length-1].level>=n.level;)l.pop();if(l.length===0)a.push(o);else{const s=l[l.length-1].node;s.children?s.children.push(o):s.children=[o]}n.type!=="Leaf"&&l.push({node:o,level:n.level})}),a}w(le,"buildHierarchy");var Qe=w((t,a)=>{Ce(t,a);const l=[];for(const s of t.TreemapRows??[])s.$type==="ClassDefStatement"&&a.addClass(s.className??"",s.styleText??"");for(const s of t.TreemapRows??[]){const d=s.item;if(!d)continue;const h=s.indent?parseInt(s.indent):0,g=et(d),c=d.classSelector?a.getStylesForClass(d.classSelector):[],u=c.length>0?c:void 0,b={level:h,name:g,type:d.$type,value:d.value,classSelector:d.classSelector,cssCompiledStyles:u};l.push(b)}const n=le(l),o=w((s,d)=>{for(const h of s)a.addNode(h,d),h.children&&h.children.length>0&&o(h.children,d+1)},"addNodesRecursively");o(n,0)},"populate"),et=w(t=>t.name?String(t.name):"","getItemName"),re={parser:{yy:void 0},parse:w(async t=>{var a;try{const n=await Te("treemap",t);K.debug("Treemap AST:",n);const o=(a=re.parser)==null?void 0:a.yy;if(!(o instanceof ne))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Qe(n,o)}catch(l){throw K.error("Error parsing treemap:",l),l}},"parse")},tt=10,B=10,X=25,at=w((t,a,l,n)=>{const o=n.db,s=o.getConfig(),d=s.padding??tt,h=o.getDiagramTitle(),g=o.getRoot(),{themeVariables:c}=ae();if(!g)return;const u=h?30:0,b=he(a),r=s.nodeWidth?s.nodeWidth*B:960,x=s.nodeHeight?s.nodeHeight*B:500,S=r,v=x+u;b.attr("viewBox",`0 0 ${S} ${v}`),ue(b,v,S,s.useMaxWidth);let p;try{const e=s.valueFormat||",";if(e==="$0,0")p=w(i=>"$"+O(",")(i),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const i=/\.\d+/.exec(e),f=i?i[0]:"";p=w(C=>"$"+O(","+f)(C),"valueFormat")}else if(e.startsWith("$")){const i=e.substring(1);p=w(f=>"$"+O(i||"")(f),"valueFormat")}else p=O(e)}catch(e){K.error("Error creating format function:",e),p=O(",")}const m=J().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),N=J().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),k=J().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);h&&b.append("text").attr("x",S/2).attr("y",u/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(h);const V=b.append("g").attr("transform",`translate(0, ${u})`).attr("class","treemapContainer"),E=Q(g).sum(e=>e.value??0).sort((e,i)=>(i.value??0)-(e.value??0)),ee=Ke().size([r,x]).paddingTop(e=>e.children&&e.children.length>0?X+B:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?B:0).paddingRight(e=>e.children&&e.children.length>0?B:0).paddingBottom(e=>e.children&&e.children.length>0?B:0).round(!0)(E),se=ee.descendants().filter(e=>e.children&&e.children.length>0),W=V.selectAll(".treemapSection").data(se).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);W.append("rect").attr("width",e=>e.x1-e.x0).attr("height",X).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),W.append("clipPath").attr("id",(e,i)=>`clip-section-${a}-${i}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",X),W.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,i)=>`treemapSection section${i}`).attr("fill",e=>m(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>N(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const i=P({cssCompiledStyles:e.data.cssCompiledStyles});return i.nodeStyles+";"+i.borderStyles.join(";")}),W.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",X/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("style",e=>{if(e.depth===0)return"display: none;";const i="dominant-baseline: middle; font-size: 12px; fill:"+k(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=P({cssCompiledStyles:e.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const i=j(this),f=e.data.name;i.text(f);const C=e.x1-e.x0,$=6;let A;s.showValues!==!1&&e.value?A=C-10-30-10-$:A=C-$-6;const F=Math.max(15,A),y=i.node();if(y.getComputedTextLength()>F){const T="...";let L=f;for(;L.length>0;){if(L=f.substring(0,L.length-1),L.length===0){i.text(T),y.getComputedTextLength()>F&&i.text("");break}if(i.text(L+T),y.getComputedTextLength()<=F)break}}}),s.showValues!==!1&&W.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",X/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?p(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const i="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+k(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=P({cssCompiledStyles:e.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")});const ie=ee.leaves(),Y=V.selectAll(".treemapLeafGroup").data(ie).enter().append("g").attr("class",(e,i)=>`treemapNode treemapLeafGroup leaf${i}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);Y.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?m(e.parent.data.name):m(e.data.name)).attr("style",e=>P({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?m(e.parent.data.name):m(e.data.name)).attr("stroke-width",3),Y.append("clipPath").attr("id",(e,i)=>`clip-${a}-${i}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),Y.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const i="text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:"+k(e.data.name)+";",f=P({cssCompiledStyles:e.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,i)=>`url(#clip-${a}-${i})`).text(e=>e.data.name).each(function(e){const i=j(this),f=e.x1-e.x0,C=e.y1-e.y0,$=i.node(),A=4,D=f-2*A,F=C-2*A;if(D<10||F<10){i.style("display","none");return}let y=parseInt(i.style("font-size"),10);const _=8,T=28,L=.6,z=6,H=2;for(;$.getComputedTextLength()>D&&y>_;)y--,i.style("font-size",`${y}px`);let I=Math.max(z,Math.min(T,Math.round(y*L))),Z=y+H+I;for(;Z>F&&y>_&&(y--,I=Math.max(z,Math.min(T,Math.round(y*L))),!(I<z&&y===_));)i.style("font-size",`${y}px`),Z=y+H+I;i.style("font-size",`${y}px`),($.getComputedTextLength()>D||y<_||F<y)&&i.style("display","none")}),s.showValues!==!1&&Y.append("text").attr("class","treemapValue").attr("x",i=>(i.x1-i.x0)/2).attr("y",function(i){return(i.y1-i.y0)/2}).attr("style",i=>{const f="text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+k(i.data.name)+";",C=P({cssCompiledStyles:i.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(i,f)=>`url(#clip-${a}-${f})`).text(i=>i.value?p(i.value):"").each(function(i){const f=j(this),C=this.parentNode;if(!C){f.style("display","none");return}const $=j(C).select(".treemapLabel");if($.empty()||$.style("display")==="none"){f.style("display","none");return}const A=parseFloat($.style("font-size")),D=28,F=.6,y=6,_=2,T=Math.max(y,Math.min(D,Math.round(A*F)));f.style("font-size",`${T}px`);const z=(i.y1-i.y0)/2+A/2+_;f.attr("y",z);const H=i.x1-i.x0,ce=i.y1-i.y0-4,de=H-2*4;f.node().getComputedTextLength()>de||z+T>ce||T<y?f.style("display","none"):f.style("display",null)});const oe=s.diagramPadding??8;we(b,oe,"flowchart",(s==null?void 0:s.useMaxWidth)||!1)},"draw"),nt=w(function(t,a){return a.db.getClasses()},"getClasses"),lt={draw:at,getClasses:nt},rt={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelColor:"black",labelFontSize:"12px",valueFontSize:"10px",valueColor:"black",titleColor:"black",titleFontSize:"14px"},st=w(({treemap:t}={})=>{const a=te(rt,t);return`
|
|
1
|
+
import{_ as w,G as te,H as ae,L as he,e as ue,l as K,b5 as P,d as j,b as pe,a as fe,q as ge,t as me,g as ye,s as Se,I as ve,b6 as xe,A as be}from"./Dzy2Amcc.js";import{s as we}from"./CHFYZcjC.js";import{p as Ce}from"./DZJEpoYA.js";import{p as Te}from"./BcbezgEJ.js";import{b as O}from"./DX6XiGOO.js";import{o as J}from"./CmKTTxBW.js";import"./DD6NieRw.js";import"./Gi6I4Gst.js";function Le(t){var a=0,l=t.children,n=l&&l.length;if(!n)a=1;else for(;--n>=0;)a+=l[n].value;t.value=a}function $e(){return this.eachAfter(Le)}function Ae(t,a){let l=-1;for(const n of this)t.call(a,n,++l,this);return this}function Fe(t,a){for(var l=this,n=[l],o,s,d=-1;l=n.pop();)if(t.call(a,l,++d,this),o=l.children)for(s=o.length-1;s>=0;--s)n.push(o[s]);return this}function ke(t,a){for(var l=this,n=[l],o=[],s,d,h,g=-1;l=n.pop();)if(o.push(l),s=l.children)for(d=0,h=s.length;d<h;++d)n.push(s[d]);for(;l=o.pop();)t.call(a,l,++g,this);return this}function Ne(t,a){let l=-1;for(const n of this)if(t.call(a,n,++l,this))return n}function Me(t){return this.eachAfter(function(a){for(var l=+t(a.data)||0,n=a.children,o=n&&n.length;--o>=0;)l+=n[o].value;a.value=l})}function _e(t){return this.eachBefore(function(a){a.children&&a.children.sort(t)})}function ze(t){for(var a=this,l=Ve(a,t),n=[a];a!==l;)a=a.parent,n.push(a);for(var o=n.length;t!==l;)n.splice(o,0,t),t=t.parent;return n}function Ve(t,a){if(t===a)return t;var l=t.ancestors(),n=a.ancestors(),o=null;for(t=l.pop(),a=n.pop();t===a;)o=t,t=l.pop(),a=n.pop();return o}function De(){for(var t=this,a=[t];t=t.parent;)a.push(t);return a}function Pe(){return Array.from(this)}function Be(){var t=[];return this.eachBefore(function(a){a.children||t.push(a)}),t}function Re(){var t=this,a=[];return t.each(function(l){l!==t&&a.push({source:l.parent,target:l})}),a}function*Ee(){var t=this,a,l=[t],n,o,s;do for(a=l.reverse(),l=[];t=a.pop();)if(yield t,n=t.children)for(o=0,s=n.length;o<s;++o)l.push(n[o]);while(l.length)}function Q(t,a){t instanceof Map?(t=[void 0,t],a===void 0&&(a=Ie)):a===void 0&&(a=He);for(var l=new U(t),n,o=[l],s,d,h,g;n=o.pop();)if((d=a(n.data))&&(g=(d=Array.from(d)).length))for(n.children=d,h=g-1;h>=0;--h)o.push(s=d[h]=new U(d[h])),s.parent=n,s.depth=n.depth+1;return l.eachBefore(Ge)}function We(){return Q(this).eachBefore(Oe)}function He(t){return t.children}function Ie(t){return Array.isArray(t)?t[1]:null}function Oe(t){t.data.value!==void 0&&(t.value=t.data.value),t.data=t.data.data}function Ge(t){var a=0;do t.height=a;while((t=t.parent)&&t.height<++a)}function U(t){this.data=t,this.depth=this.height=0,this.parent=null}U.prototype=Q.prototype={constructor:U,count:$e,each:Ae,eachAfter:ke,eachBefore:Fe,find:Ne,sum:Me,sort:_e,path:ze,ancestors:De,descendants:Pe,leaves:Be,links:Re,copy:We,[Symbol.iterator]:Ee};function qe(t){if(typeof t!="function")throw new Error;return t}function G(){return 0}function q(t){return function(){return t}}function Xe(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function Ye(t,a,l,n,o){for(var s=t.children,d,h=-1,g=s.length,c=t.value&&(n-a)/t.value;++h<g;)d=s[h],d.y0=l,d.y1=o,d.x0=a,d.x1=a+=d.value*c}function je(t,a,l,n,o){for(var s=t.children,d,h=-1,g=s.length,c=t.value&&(o-l)/t.value;++h<g;)d=s[h],d.x0=a,d.x1=n,d.y0=l,d.y1=l+=d.value*c}var Ue=(1+Math.sqrt(5))/2;function Ze(t,a,l,n,o,s){for(var d=[],h=a.children,g,c,u=0,b=0,r=h.length,x,S,v=a.value,p,m,N,k,V,E,M;u<r;){x=o-l,S=s-n;do p=h[b++].value;while(!p&&b<r);for(m=N=p,E=Math.max(S/x,x/S)/(v*t),M=p*p*E,V=Math.max(N/M,M/m);b<r;++b){if(p+=c=h[b].value,c<m&&(m=c),c>N&&(N=c),M=p*p*E,k=Math.max(N/M,M/m),k>V){p-=c;break}V=k}d.push(g={value:p,dice:x<S,children:h.slice(u,b)}),g.dice?Ye(g,l,n,o,v?n+=S*p/v:s):je(g,l,n,v?l+=x*p/v:o,s),v-=p,u=b}return d}const Je=function t(a){function l(n,o,s,d,h){Ze(a,n,o,s,d,h)}return l.ratio=function(n){return t((n=+n)>1?n:1)},l}(Ue);function Ke(){var t=Je,a=!1,l=1,n=1,o=[0],s=G,d=G,h=G,g=G,c=G;function u(r){return r.x0=r.y0=0,r.x1=l,r.y1=n,r.eachBefore(b),o=[0],a&&r.eachBefore(Xe),r}function b(r){var x=o[r.depth],S=r.x0+x,v=r.y0+x,p=r.x1-x,m=r.y1-x;p<S&&(S=p=(S+p)/2),m<v&&(v=m=(v+m)/2),r.x0=S,r.y0=v,r.x1=p,r.y1=m,r.children&&(x=o[r.depth+1]=s(r)/2,S+=c(r)-x,v+=d(r)-x,p-=h(r)-x,m-=g(r)-x,p<S&&(S=p=(S+p)/2),m<v&&(v=m=(v+m)/2),t(r,S,v,p,m))}return u.round=function(r){return arguments.length?(a=!!r,u):a},u.size=function(r){return arguments.length?(l=+r[0],n=+r[1],u):[l,n]},u.tile=function(r){return arguments.length?(t=qe(r),u):t},u.padding=function(r){return arguments.length?u.paddingInner(r).paddingOuter(r):u.paddingInner()},u.paddingInner=function(r){return arguments.length?(s=typeof r=="function"?r:q(+r),u):s},u.paddingOuter=function(r){return arguments.length?u.paddingTop(r).paddingRight(r).paddingBottom(r).paddingLeft(r):u.paddingTop()},u.paddingTop=function(r){return arguments.length?(d=typeof r=="function"?r:q(+r),u):d},u.paddingRight=function(r){return arguments.length?(h=typeof r=="function"?r:q(+r),u):h},u.paddingBottom=function(r){return arguments.length?(g=typeof r=="function"?r:q(+r),u):g},u.paddingLeft=function(r){return arguments.length?(c=typeof r=="function"?r:q(+r),u):c},u}var R,ne=(R=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=pe,this.getAccTitle=fe,this.setDiagramTitle=ge,this.getDiagramTitle=me,this.getAccDescription=ye,this.setAccDescription=Se}getNodes(){return this.nodes}getConfig(){const a=ve,l=ae();return te({...a.treemap,...l.treemap??{}})}addNode(a,l){this.nodes.push(a),this.levels.set(a,l),l===0&&(this.outerNodes.push(a),this.root??(this.root=a))}getRoot(){return{name:"",children:this.outerNodes}}addClass(a,l){const n=this.classes.get(a)??{id:a,styles:[],textStyles:[]},o=l.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");o&&o.forEach(s=>{xe(s)&&(n!=null&&n.textStyles?n.textStyles.push(s):n.textStyles=[s]),n!=null&&n.styles?n.styles.push(s):n.styles=[s]}),this.classes.set(a,n)}getClasses(){return this.classes}getStylesForClass(a){var l;return((l=this.classes.get(a))==null?void 0:l.styles)??[]}clear(){be(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}},w(R,"TreeMapDB"),R);function le(t){if(!t.length)return[];const a=[],l=[];return t.forEach(n=>{const o={name:n.name,children:n.type==="Leaf"?void 0:[]};for(o.classSelector=n==null?void 0:n.classSelector,n!=null&&n.cssCompiledStyles&&(o.cssCompiledStyles=n.cssCompiledStyles),n.type==="Leaf"&&n.value!==void 0&&(o.value=n.value);l.length>0&&l[l.length-1].level>=n.level;)l.pop();if(l.length===0)a.push(o);else{const s=l[l.length-1].node;s.children?s.children.push(o):s.children=[o]}n.type!=="Leaf"&&l.push({node:o,level:n.level})}),a}w(le,"buildHierarchy");var Qe=w((t,a)=>{Ce(t,a);const l=[];for(const s of t.TreemapRows??[])s.$type==="ClassDefStatement"&&a.addClass(s.className??"",s.styleText??"");for(const s of t.TreemapRows??[]){const d=s.item;if(!d)continue;const h=s.indent?parseInt(s.indent):0,g=et(d),c=d.classSelector?a.getStylesForClass(d.classSelector):[],u=c.length>0?c:void 0,b={level:h,name:g,type:d.$type,value:d.value,classSelector:d.classSelector,cssCompiledStyles:u};l.push(b)}const n=le(l),o=w((s,d)=>{for(const h of s)a.addNode(h,d),h.children&&h.children.length>0&&o(h.children,d+1)},"addNodesRecursively");o(n,0)},"populate"),et=w(t=>t.name?String(t.name):"","getItemName"),re={parser:{yy:void 0},parse:w(async t=>{var a;try{const n=await Te("treemap",t);K.debug("Treemap AST:",n);const o=(a=re.parser)==null?void 0:a.yy;if(!(o instanceof ne))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Qe(n,o)}catch(l){throw K.error("Error parsing treemap:",l),l}},"parse")},tt=10,B=10,X=25,at=w((t,a,l,n)=>{const o=n.db,s=o.getConfig(),d=s.padding??tt,h=o.getDiagramTitle(),g=o.getRoot(),{themeVariables:c}=ae();if(!g)return;const u=h?30:0,b=he(a),r=s.nodeWidth?s.nodeWidth*B:960,x=s.nodeHeight?s.nodeHeight*B:500,S=r,v=x+u;b.attr("viewBox",`0 0 ${S} ${v}`),ue(b,v,S,s.useMaxWidth);let p;try{const e=s.valueFormat||",";if(e==="$0,0")p=w(i=>"$"+O(",")(i),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const i=/\.\d+/.exec(e),f=i?i[0]:"";p=w(C=>"$"+O(","+f)(C),"valueFormat")}else if(e.startsWith("$")){const i=e.substring(1);p=w(f=>"$"+O(i||"")(f),"valueFormat")}else p=O(e)}catch(e){K.error("Error creating format function:",e),p=O(",")}const m=J().range(["transparent",c.cScale0,c.cScale1,c.cScale2,c.cScale3,c.cScale4,c.cScale5,c.cScale6,c.cScale7,c.cScale8,c.cScale9,c.cScale10,c.cScale11]),N=J().range(["transparent",c.cScalePeer0,c.cScalePeer1,c.cScalePeer2,c.cScalePeer3,c.cScalePeer4,c.cScalePeer5,c.cScalePeer6,c.cScalePeer7,c.cScalePeer8,c.cScalePeer9,c.cScalePeer10,c.cScalePeer11]),k=J().range([c.cScaleLabel0,c.cScaleLabel1,c.cScaleLabel2,c.cScaleLabel3,c.cScaleLabel4,c.cScaleLabel5,c.cScaleLabel6,c.cScaleLabel7,c.cScaleLabel8,c.cScaleLabel9,c.cScaleLabel10,c.cScaleLabel11]);h&&b.append("text").attr("x",S/2).attr("y",u/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(h);const V=b.append("g").attr("transform",`translate(0, ${u})`).attr("class","treemapContainer"),E=Q(g).sum(e=>e.value??0).sort((e,i)=>(i.value??0)-(e.value??0)),ee=Ke().size([r,x]).paddingTop(e=>e.children&&e.children.length>0?X+B:0).paddingInner(d).paddingLeft(e=>e.children&&e.children.length>0?B:0).paddingRight(e=>e.children&&e.children.length>0?B:0).paddingBottom(e=>e.children&&e.children.length>0?B:0).round(!0)(E),se=ee.descendants().filter(e=>e.children&&e.children.length>0),W=V.selectAll(".treemapSection").data(se).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);W.append("rect").attr("width",e=>e.x1-e.x0).attr("height",X).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>e.depth===0?"display: none;":""),W.append("clipPath").attr("id",(e,i)=>`clip-section-${a}-${i}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",X),W.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,i)=>`treemapSection section${i}`).attr("fill",e=>m(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>N(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(e.depth===0)return"display: none;";const i=P({cssCompiledStyles:e.data.cssCompiledStyles});return i.nodeStyles+";"+i.borderStyles.join(";")}),W.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",X/2).attr("dominant-baseline","middle").text(e=>e.depth===0?"":e.data.name).attr("font-weight","bold").attr("style",e=>{if(e.depth===0)return"display: none;";const i="dominant-baseline: middle; font-size: 12px; fill:"+k(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=P({cssCompiledStyles:e.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).each(function(e){if(e.depth===0)return;const i=j(this),f=e.data.name;i.text(f);const C=e.x1-e.x0,$=6;let A;s.showValues!==!1&&e.value?A=C-10-30-10-$:A=C-$-6;const F=Math.max(15,A),y=i.node();if(y.getComputedTextLength()>F){const T="...";let L=f;for(;L.length>0;){if(L=f.substring(0,L.length-1),L.length===0){i.text(T),y.getComputedTextLength()>F&&i.text("");break}if(i.text(L+T),y.getComputedTextLength()<=F)break}}}),s.showValues!==!1&&W.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",X/2).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?p(e.value):"").attr("font-style","italic").attr("style",e=>{if(e.depth===0)return"display: none;";const i="text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+k(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;",f=P({cssCompiledStyles:e.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")});const ie=ee.leaves(),Y=V.selectAll(".treemapLeafGroup").data(ie).enter().append("g").attr("class",(e,i)=>`treemapNode treemapLeafGroup leaf${i}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);Y.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?m(e.parent.data.name):m(e.data.name)).attr("style",e=>P({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?m(e.parent.data.name):m(e.data.name)).attr("stroke-width",3),Y.append("clipPath").attr("id",(e,i)=>`clip-${a}-${i}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4)),Y.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>{const i="text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:"+k(e.data.name)+";",f=P({cssCompiledStyles:e.data.cssCompiledStyles});return i+f.labelStyles.replace("color:","fill:")}).attr("clip-path",(e,i)=>`url(#clip-${a}-${i})`).text(e=>e.data.name).each(function(e){const i=j(this),f=e.x1-e.x0,C=e.y1-e.y0,$=i.node(),A=4,D=f-2*A,F=C-2*A;if(D<10||F<10){i.style("display","none");return}let y=parseInt(i.style("font-size"),10);const _=8,T=28,L=.6,z=6,H=2;for(;$.getComputedTextLength()>D&&y>_;)y--,i.style("font-size",`${y}px`);let I=Math.max(z,Math.min(T,Math.round(y*L))),Z=y+H+I;for(;Z>F&&y>_&&(y--,I=Math.max(z,Math.min(T,Math.round(y*L))),!(I<z&&y===_));)i.style("font-size",`${y}px`),Z=y+H+I;i.style("font-size",`${y}px`),($.getComputedTextLength()>D||y<_||F<y)&&i.style("display","none")}),s.showValues!==!1&&Y.append("text").attr("class","treemapValue").attr("x",i=>(i.x1-i.x0)/2).attr("y",function(i){return(i.y1-i.y0)/2}).attr("style",i=>{const f="text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:"+k(i.data.name)+";",C=P({cssCompiledStyles:i.data.cssCompiledStyles});return f+C.labelStyles.replace("color:","fill:")}).attr("clip-path",(i,f)=>`url(#clip-${a}-${f})`).text(i=>i.value?p(i.value):"").each(function(i){const f=j(this),C=this.parentNode;if(!C){f.style("display","none");return}const $=j(C).select(".treemapLabel");if($.empty()||$.style("display")==="none"){f.style("display","none");return}const A=parseFloat($.style("font-size")),D=28,F=.6,y=6,_=2,T=Math.max(y,Math.min(D,Math.round(A*F)));f.style("font-size",`${T}px`);const z=(i.y1-i.y0)/2+A/2+_;f.attr("y",z);const H=i.x1-i.x0,ce=i.y1-i.y0-4,de=H-2*4;f.node().getComputedTextLength()>de||z+T>ce||T<y?f.style("display","none"):f.style("display",null)});const oe=s.diagramPadding??8;we(b,oe,"flowchart",(s==null?void 0:s.useMaxWidth)||!1)},"draw"),nt=w(function(t,a){return a.db.getClasses()},"getClasses"),lt={draw:at,getClasses:nt},rt={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelColor:"black",labelFontSize:"12px",valueFontSize:"10px",valueColor:"black",titleColor:"black",titleFontSize:"14px"},st=w(({treemap:t}={})=>{const a=te(rt,t);return`
|
|
2
2
|
.treemapNode.section {
|
|
3
3
|
stroke: ${a.sectionStrokeColor};
|
|
4
4
|
stroke-width: ${a.sectionStrokeWidth};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as l}from"./
|
|
1
|
+
import{_ as l}from"./Dzy2Amcc.js";function m(e,c){var i,t,o;e.accDescr&&((i=c.setAccDescription)==null||i.call(c,e.accDescr)),e.accTitle&&((t=c.setAccTitle)==null||t.call(c,e.accTitle)),e.title&&((o=c.setDiagramTitle)==null||o.call(c,e.title))}l(m,"populateCommonDb");export{m as p};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as L,r as x,
|
|
1
|
+
import{d as L,r as x,g as G,h as H,i as T,j as J,c as a,F as f,a as l,u as o,k as K,l as Q,w as u,o as s,m as W,n as X,p as Y,q as c,b as r,e as _,s as $,v as A,t as b,x as v,y as D,z as Z,A as ee,f as ne,_ as te,B as se,C as oe}from"./DD6NieRw.js";import{i as ae,a as M,g as ie}from"./Cilp0euQ.js";import{_ as le}from"./BgFbw5aK.js";const ce={key:0,class:"flex items-center gap-2 truncate"},re={class:"truncate"},de={key:1,class:"flex flex-shrink-0 items-center gap-1 overflow-hidden"},ue={key:1,class:"opacity-50"},pe={class:"flex items-center gap-2 w-full"},me={class:"truncate"},fe={key:1,class:"flex items-center gap-1 ml-auto flex-shrink-0"},_e={key:2,class:"text-xs text-muted-foreground"},ke=L({__name:"PureConnectionSelector",props:{class:{},workspaceId:{},connectionId:{},disabled:{type:Boolean},connections:{},connection:{},skipStrictModeConnections:{type:Boolean}},emits:["update:connectionId"],setup(N,{emit:q}){const z=q,i=N,p=x(!1),{createConnection:E}=G(),S=H(),V=J(),g=x(!1),I=T(()=>ae(V.public.sqlite3ConnectionsEnabled)),P=e=>{E(e)},U=()=>{g.value=!0,p.value=!1},C=e=>S.getTagsByIds(e.tagIds??[]),F=e=>C(e).some(n=>n.strictMode),y=e=>!i.skipStrictModeConnections&&F(e)||M(e,I.value),O=e=>{if(i.disabled)return;const n=i.connections.find(k=>k.id===e);!n||y(n)||z("update:connectionId",e)},h=T(()=>i.connection?S.getTagsByIds(i.connection.tagIds??[]):[]),w=e=>{var n;return e?(n=ie(e.type))==null?void 0:n.icon:null},m=e=>{var n;return(n=w(e))==null?void 0:n.type},B=e=>{var n;return((n=w(e))==null?void 0:n.props)??{}};return(e,n)=>{const k=te,R=oe,j=Z;return s(),a(f,null,[l(o(le),{open:o(g),"editing-connection":null,"onUpdate:open":n[0]||(n[0]=t=>g.value=t),onAddNew:P,workspaceId:e.workspaceId},null,8,["open","workspaceId"]),l(o(K),{"onUpdate:modelValue":n[1]||(n[1]=t=>O(t)),"model-value":e.connectionId,disabled:e.disabled,open:o(p),"onUpdate:open":n[2]||(n[2]=t=>Q(p)?p.value=t:null),size:"sm"},{default:u(()=>[l(o(W),{class:X(o(Y)("cursor-pointer font-normal",i.class)),disabled:e.disabled},{default:u(()=>{var t;return[e.connection?(s(),a("div",ce,[m(e.connection)?(s(),c(A(m(e.connection)),$({key:0},B(e.connection),{class:"size-4! min-w-4!"}),null,16)):r("",!0),_("span",re,b((t=e.connection)==null?void 0:t.name),1),o(h).length?(s(),a("div",de,[(s(!0),a(f,null,v(o(h),d=>(s(),c(o(D),{key:d.id,tag:d},null,8,["tag"]))),128))])):r("",!0)])):(s(),a("div",ue,"Select connection"))]}),_:1},8,["class","disabled"]),l(j,null,{default:u(()=>[l(o(ee),null,{default:u(()=>[_("div",{class:"flex px-2 py-0.5 h-8 hover:bg-muted rounded-md font-normal text-sm items-center gap-1 cursor-pointer",onClick:U},[l(k,{name:"lucide:plus"}),n[3]||(n[3]=ne(" Add new connection "))]),e.connections.length?(s(),c(R,{key:0})):r("",!0),(s(!0),a(f,null,v(e.connections,t=>(s(),c(o(se),{class:"cursor-pointer",value:t.id,disabled:y(t)},{default:u(()=>[_("div",pe,[m(t)?(s(),c(A(m(t)),$({key:0,ref_for:!0},B(t),{class:"size-4!"}),null,16)):r("",!0),_("span",me,b(t.name),1),C(t).length?(s(),a("div",fe,[(s(!0),a(f,null,v(C(t),d=>(s(),c(o(D),{key:d.id,tag:d},null,8,["tag"]))),128))])):r("",!0),y(t)?(s(),a("span",_e,b(o(M)(t,o(I))?"Disabled":"Not allowed"),1)):r("",!0)])]),_:2},1032,["value","disabled"]))),256))]),_:1})]),_:1})]),_:1},8,["model-value","disabled","open"])],64)}}});export{ke as _};
|