aitu-app 0.5.19 → 0.5.21
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/README.md +3 -3
- package/assets/{ChatMessagesArea-Ch59SNgH.js → ChatMessagesArea-CAnmzKeA.js} +3 -3
- package/assets/{Serializer-Cg6t80B7.js → Serializer-DPCLjt6U.js} +1 -1
- package/assets/{ToolboxDrawer-Cn19rT41.js → ToolboxDrawer-D-ZDs49h.js} +1 -1
- package/assets/{_baseUniq-BjMbNK7A.js → _baseUniq-CHS3E5If.js} +1 -1
- package/assets/{advancedFormat-CDLa36LX.js → advancedFormat-Chr195ZY.js} +1 -1
- package/assets/{ai-analyze-WtCDy3ZB.js → ai-analyze-D3V-tpIV.js} +1 -1
- package/assets/{arc-D9IlPPHA.js → arc-lNLKXIKC.js} +1 -1
- package/assets/{architectureDiagram-VXUJARFQ-DAi2Ql0h.js → architectureDiagram-VXUJARFQ-CCzBT9XK.js} +1 -1
- package/assets/{batch-image-generation-DV_OX9T-.js → batch-image-generation-CgR-a8Ii.js} +1 -1
- package/assets/{blockDiagram-38ab4fdb-DphBLWgP.js → blockDiagram-38ab4fdb-CbcE_DRD.js} +1 -1
- package/assets/{blockDiagram-VD42YOAC-DEdondrA.js → blockDiagram-VD42YOAC-CgcfCyW1.js} +1 -1
- package/assets/{c4Diagram-3d4e48cf-Dx9EfEeD.js → c4Diagram-3d4e48cf-DqzYo_xg.js} +1 -1
- package/assets/{c4Diagram-YG6GDRKO-L_mFEOlx.js → c4Diagram-YG6GDRKO-BTZAWhX1.js} +1 -1
- package/assets/channel-Bew-Iahk.js +1 -0
- package/assets/{chunk-4BX2VUAB-c4TqXEDY.js → chunk-4BX2VUAB-DH-I_3Sl.js} +1 -1
- package/assets/{chunk-55IACEB6-C_xrLA9o.js → chunk-55IACEB6-BJKBSn0v.js} +1 -1
- package/assets/{chunk-B4BG7PRW-7RUe0XXI.js → chunk-B4BG7PRW-BIhB4ChZ.js} +1 -1
- package/assets/{chunk-DI55MBZ5-DLuCH9xI.js → chunk-DI55MBZ5-NlFLhYIc.js} +1 -1
- package/assets/{chunk-FMBD7UC4-dQp1CjpU.js → chunk-FMBD7UC4-QVfOPBEJ.js} +1 -1
- package/assets/{chunk-QN33PNHL-CsrJvUSJ.js → chunk-QN33PNHL-C_DotWZ6.js} +1 -1
- package/assets/{chunk-QZHKN3VN-CHMAVu-X.js → chunk-QZHKN3VN-Ei6ogyMg.js} +1 -1
- package/assets/{chunk-TZMSLE5B-B5jMoFbi.js → chunk-TZMSLE5B-CKPTgIMs.js} +1 -1
- package/assets/classDiagram-2ON5EDUG-DIttp4Yk.js +1 -0
- package/assets/{classDiagram-70f12bd4-D688uUCQ.js → classDiagram-70f12bd4-DeAD0Lw4.js} +1 -1
- package/assets/classDiagram-v2-WZHVMYZB-DIttp4Yk.js +1 -0
- package/assets/{classDiagram-v2-f2320105-3YFouHva.js → classDiagram-v2-f2320105-DR43MMrr.js} +1 -1
- package/assets/clone-Y0952eQY.js +1 -0
- package/assets/{cose-bilkent-S5V4N54A-oMoeWwIQ.js → cose-bilkent-S5V4N54A-CE31mcuy.js} +1 -1
- package/assets/{createText-2e5e7dd3-BSV0wq-Y.js → createText-2e5e7dd3-DuyGuD-n.js} +1 -1
- package/assets/{cytoscape-cose-bilkent-Cl0QJgdi.js → cytoscape-cose-bilkent-DTqUuT3l.js} +1 -1
- package/assets/{dagre-6UL2VRFP-Bpy-rze3.js → dagre-6UL2VRFP-CuJmVGl3.js} +1 -1
- package/assets/{diagram-PSM6KHXK-BWluHme0.js → diagram-PSM6KHXK-D5Y5dlL9.js} +1 -1
- package/assets/{diagram-QEK2KX5R-CkBlUzzL.js → diagram-QEK2KX5R-DOWAGxHq.js} +1 -1
- package/assets/{diagram-S2PKOQOG-VVOhaYjg.js → diagram-S2PKOQOG-ykMhl6fc.js} +1 -1
- package/assets/{edges-e0da2a9e-DzHLI4vk.js → edges-e0da2a9e-BpsZLv9t.js} +1 -1
- package/assets/{erDiagram-9861fffd-DXOA4RaO.js → erDiagram-9861fffd-rZLPDBgy.js} +1 -1
- package/assets/{erDiagram-Q2GNP2WA-Vx9fvEgn.js → erDiagram-Q2GNP2WA-zRo1erex.js} +1 -1
- package/assets/{flowDb-956e92f1-FnWlEDP7.js → flowDb-956e92f1-f4MK2XS7.js} +1 -1
- package/assets/{flowDiagram-66a62f08-D6iEkMdm.js → flowDiagram-66a62f08-_6Eo5sZi.js} +1 -1
- package/assets/{flowDiagram-NV44I4VS-DDyj-APM.js → flowDiagram-NV44I4VS-CFCClCRc.js} +1 -1
- package/assets/flowDiagram-v2-96b9c2cf-Dn2WmcvX.js +1 -0
- package/assets/{flowchart-elk-definition-4a651766-CNXS-IfJ.js → flowchart-elk-definition-4a651766-t4QJuK_b.js} +1 -1
- package/assets/{ganttDiagram-JELNMOA3-Do_oFAQb.js → ganttDiagram-JELNMOA3-DIX2ad-2.js} +1 -1
- package/assets/{ganttDiagram-c361ad54-DTVCrQ2z.js → ganttDiagram-c361ad54-dX5QjWrh.js} +1 -1
- package/assets/{gitGraphDiagram-72cf32ee-CEEpXU_f.js → gitGraphDiagram-72cf32ee-BBZSqS6J.js} +1 -1
- package/assets/{gitGraphDiagram-NY62KEGX-BHeKaPX4.js → gitGraphDiagram-NY62KEGX-C-FRyLSQ.js} +1 -1
- package/assets/{graph-CAUEelZT.js → graph-BpCqwwyJ.js} +1 -1
- package/assets/{graph-BzDiTfOi.js → graph-dwf5l9kJ.js} +1 -1
- package/assets/{grid-image-E2cpPzPN.js → grid-image-DRAUp_wj.js} +1 -1
- package/assets/{has-DJTgTa4o.js → has-BBSmRLAB.js} +1 -1
- package/assets/{hasIn-C2tUur8R.js → hasIn-CGUnHN5L.js} +1 -1
- package/assets/{index-3862675e-Bj_I7evL.js → index-3862675e-BmuXVGGA.js} +1 -1
- package/assets/{index-CW4nHV7C.js → index-CISxTBJ3.js} +1 -1
- package/assets/{index-CfB4rV_M.js → index-DCs3C-gs.js} +1 -1
- package/assets/{index-CGrtxS_H.js → index-DEjUAZUe.js} +1 -1
- package/assets/{index-Ctm2XA4G.js → index-DNIlXgAo.js} +1 -1
- package/assets/{index-BWxm5yOF.js → index-Ds1UcDjn.js} +167 -167
- package/assets/{index-CKrel5et.js → index-DvbaH1wH.js} +1 -1
- package/assets/{index-C3qFnFDn.js → index-_FyCDKGq.js} +4 -4
- package/assets/{index-B-mM3YWS.js → index-eOV7y-oZ.js} +1 -1
- package/assets/{infoDiagram-WHAUD3N6-BF_OzWIs.js → infoDiagram-WHAUD3N6-Cw6LtQsv.js} +1 -1
- package/assets/{infoDiagram-f8f76790-BbelCJ2m.js → infoDiagram-f8f76790-suYKggbB.js} +1 -1
- package/assets/{inspiration-board-DV86wa1f.js → inspiration-board-8CO8xK39.js} +1 -1
- package/assets/{isEmpty-Cp2Tv4FQ.js → isEmpty-BZ44SF3F.js} +1 -1
- package/assets/{journeyDiagram-49397b02-DGh5N8os.js → journeyDiagram-49397b02-DLzRdow3.js} +1 -1
- package/assets/{journeyDiagram-XKPGCS4Q-DK7erCLu.js → journeyDiagram-XKPGCS4Q-CcD6LNVi.js} +1 -1
- package/assets/{kanban-definition-3W4ZIXB7-BFF2KL61.js → kanban-definition-3W4ZIXB7-DWA3YqY9.js} +1 -1
- package/assets/{layout-qmk5pO0s.js → layout-D8KZ21ze.js} +1 -1
- package/assets/{layout-BPv0HZG9.js → layout-jxFX0Ar3.js} +1 -1
- package/assets/{line-CywZXhHj.js → line-B3fXWiyE.js} +1 -1
- package/assets/{linear-pa733wdy.js → linear-DsVcoO9v.js} +1 -1
- package/assets/{mermaid.core-KMjnbwgP.js → mermaid.core-ruaJ9d8x.js} +4 -4
- package/assets/{min-Bc3x3akU.js → min-B6fh4WRE.js} +1 -1
- package/assets/{mindmap-definition-VGOIOE7T-DVcOM0FI.js → mindmap-definition-VGOIOE7T-BzeNa7DW.js} +1 -1
- package/assets/{mindmap-definition-fc14e90a-HwaGSjso.js → mindmap-definition-fc14e90a-C3sElkm0.js} +1 -1
- package/assets/{photo-wall-splitter-CNTlJyZR.js → photo-wall-splitter-C1GbxYBl.js} +1 -1
- package/assets/{pick-gLHWXRuR.js → pick-DUB8w7iE.js} +1 -1
- package/assets/{pie-DsRhVpZa.js → pie-DAYMJpRO.js} +1 -1
- package/assets/{pieDiagram-8a3498a8-L88PAEa1.js → pieDiagram-8a3498a8-CZI3pF7g.js} +1 -1
- package/assets/{pieDiagram-ADFJNKIX-9WAIdjc_.js → pieDiagram-ADFJNKIX-BqonG77Q.js} +1 -1
- package/assets/{quadrantDiagram-120e2f19-D4j9BCco.js → quadrantDiagram-120e2f19-Q2bVMK-T.js} +1 -1
- package/assets/{quadrantDiagram-AYHSOK5B-DBSbnnFT.js → quadrantDiagram-AYHSOK5B-yJZRIs-Q.js} +1 -1
- package/assets/{requirementDiagram-UZGBJVZJ-D8YxWTM0.js → requirementDiagram-UZGBJVZJ-3kaAkLjO.js} +1 -1
- package/assets/{requirementDiagram-deff3bca-zGj5AP9N.js → requirementDiagram-deff3bca-DHOhXBYo.js} +1 -1
- package/assets/{sankeyDiagram-04a897e0-DduczcAe.js → sankeyDiagram-04a897e0-3UqYNZg9.js} +1 -1
- package/assets/{sankeyDiagram-TZEHDZUN-DkbFlDGy.js → sankeyDiagram-TZEHDZUN-Ce844Tbc.js} +1 -1
- package/assets/{sequenceDiagram-704730f1-B9RpaPZz.js → sequenceDiagram-704730f1-CBXqjnXl.js} +1 -1
- package/assets/{sequenceDiagram-WL72ISMW-DbWs-j5O.js → sequenceDiagram-WL72ISMW-DBN2cRGt.js} +1 -1
- package/assets/{settings-dialog-D6Dt2QOJ.js → settings-dialog-aU8BHcuS.js} +1 -1
- package/assets/{stateDiagram-587899a1-egRctDUF.js → stateDiagram-587899a1-BGKPA37n.js} +1 -1
- package/assets/{stateDiagram-FKZM4ZOC-CNjsDfIy.js → stateDiagram-FKZM4ZOC-Czg5Opf0.js} +1 -1
- package/assets/stateDiagram-v2-4FDKWEC3-4Ev4KuVZ.js +1 -0
- package/assets/{stateDiagram-v2-d93cdb3a-C5VVZ9tT.js → stateDiagram-v2-d93cdb3a-DWU3UljE.js} +1 -1
- package/assets/{styles-6aaf32cf-Dyz4aY1-.js → styles-6aaf32cf-BVLDN8CD.js} +1 -1
- package/assets/{styles-9a916d00-KRIZzkny.js → styles-9a916d00-vSy8MhZp.js} +1 -1
- package/assets/{styles-c10674c1-DQd1SzGU.js → styles-c10674c1-dzTvI8BU.js} +1 -1
- package/assets/{svgDrawCommon-08f97a94-CKfxKKyE.js → svgDrawCommon-08f97a94-dptVwf62.js} +1 -1
- package/assets/{timeline-definition-85554ec2-BaHbbrQK.js → timeline-definition-85554ec2-jKiT0ZaE.js} +1 -1
- package/assets/{timeline-definition-IT6M3QCI-RN_IT2J8.js → timeline-definition-IT6M3QCI-B2NoE4jH.js} +1 -1
- package/assets/{treemap-KMMF4GRG-BT1Q5_WZ.js → treemap-KMMF4GRG-1nrNbz-r.js} +1 -1
- package/assets/{ttd-dialog-CLdKh3ta.js → ttd-dialog-WN-s4x87.js} +5 -5
- package/assets/{union-COslGvLL.js → union-B2D_ldts.js} +1 -1
- package/assets/{upload-CeQfFagJ.js → upload-Crej215t.js} +1 -1
- package/assets/{video-recovery-service-yDgwgmGp.js → video-recovery-service-Zb_336FQ.js} +1 -1
- package/assets/{xychartDiagram-PRI3JC2R-Bax4Ei7u.js → xychartDiagram-PRI3JC2R-UPkX0dfi.js} +1 -1
- package/assets/{xychartDiagram-e933f94c-DGuz5JXj.js → xychartDiagram-e933f94c-BXYMaBZh.js} +1 -1
- package/assets/{zipObject-DmxVzLzs.js → zipObject-bwVIVuzi.js} +1 -1
- package/package.json +1 -1
- package/sw.js +6 -6
- package/version.json +2 -2
- package/assets/channel-Dhbn0Sbl.js +0 -1
- package/assets/classDiagram-2ON5EDUG-CMcmKpqO.js +0 -1
- package/assets/classDiagram-v2-WZHVMYZB-CMcmKpqO.js +0 -1
- package/assets/clone-C3EwcCUy.js +0 -1
- package/assets/flowDiagram-v2-96b9c2cf-ChSvTtTA.js +0 -1
- package/assets/stateDiagram-v2-4FDKWEC3-CVDgynyz.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as c,g as ae,s as oe,q as ce,p as le,a as ue,b as de,c as rt,d as fe,l as et,j as he,i as me,y as ke,u as ye}from"./mermaid.core-KMjnbwgP.js";import{s as ht,a as P}from"./Serializer-Cg6t80B7.js";import{t as ge,m as pe,a as ve,i as Te,b as be,c as Wt,d as Nt,e as xe,f as we,g as _e,h as De,j as Se,k as Ce,l as Ee,n as Rt,o as Bt,p as zt,s as jt,q as qt,r as Ie,u as Me,v as Ae,w as Fe}from"./advancedFormat-CDLa36LX.js";import{aC as Le}from"./index-BWxm5yOF.js";import{l as $e}from"./linear-pa733wdy.js";import"./line-CywZXhHj.js";import"./array-BKyUJesY.js";import"./path-CbwjOpE9.js";import"./isEmpty-Cp2Tv4FQ.js";import"./init-Gi6I4Gst.js";import"./defaultLocale-Bu4YK2AB.js";var mt={exports:{}},Ye=mt.exports,Ht;function Oe(){return Ht||(Ht=1,(function(t,r){(function(n,i){t.exports=i()})(Ye,(function(){var n,i,a=1e3,g=6e4,x=36e5,M=864e5,$=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,R=31536e6,C=2628e6,Y=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,W={years:R,months:C,days:M,hours:x,minutes:g,seconds:a,milliseconds:1,weeks:6048e5},O=function(E){return E instanceof X},L=function(E,v,f){return new X(E,f,v.$l)},_=function(E){return i.p(E)+"s"},J=function(E){return E<0},B=function(E){return J(E)?Math.ceil(E):Math.floor(E)},Q=function(E){return Math.abs(E)},j=function(E,v){return E?J(E)?{negative:!0,format:""+Q(E)+v}:{negative:!1,format:""+E+v}:{negative:!1,format:""}},X=(function(){function E(f,u,k){var y=this;if(this.$d={},this.$l=k,f===void 0&&(this.$ms=0,this.parseFromMilliseconds()),u)return L(f*W[_(u)],this);if(typeof f=="number")return this.$ms=f,this.parseFromMilliseconds(),this;if(typeof f=="object")return Object.keys(f).forEach((function(o){y.$d[_(o)]=f[o]})),this.calMilliseconds(),this;if(typeof f=="string"){var p=f.match(Y);if(p){var m=p.slice(2).map((function(o){return o!=null?Number(o):0}));return this.$d.years=m[0],this.$d.months=m[1],this.$d.weeks=m[2],this.$d.days=m[3],this.$d.hours=m[4],this.$d.minutes=m[5],this.$d.seconds=m[6],this.calMilliseconds(),this}}return this}var v=E.prototype;return v.calMilliseconds=function(){var f=this;this.$ms=Object.keys(this.$d).reduce((function(u,k){return u+(f.$d[k]||0)*W[k]}),0)},v.parseFromMilliseconds=function(){var f=this.$ms;this.$d.years=B(f/R),f%=R,this.$d.months=B(f/C),f%=C,this.$d.days=B(f/M),f%=M,this.$d.hours=B(f/x),f%=x,this.$d.minutes=B(f/g),f%=g,this.$d.seconds=B(f/a),f%=a,this.$d.milliseconds=f},v.toISOString=function(){var f=j(this.$d.years,"Y"),u=j(this.$d.months,"M"),k=+this.$d.days||0;this.$d.weeks&&(k+=7*this.$d.weeks);var y=j(k,"D"),p=j(this.$d.hours,"H"),m=j(this.$d.minutes,"M"),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3,o=Math.round(1e3*o)/1e3);var l=j(o,"S"),h=f.negative||u.negative||y.negative||p.negative||m.negative||l.negative,d=p.format||m.format||l.format?"T":"",T=(h?"-":"")+"P"+f.format+u.format+y.format+d+p.format+m.format+l.format;return T==="P"||T==="-P"?"P0D":T},v.toJSON=function(){return this.toISOString()},v.format=function(f){var u=f||"YYYY-MM-DDTHH:mm:ss",k={Y:this.$d.years,YY:i.s(this.$d.years,2,"0"),YYYY:i.s(this.$d.years,4,"0"),M:this.$d.months,MM:i.s(this.$d.months,2,"0"),D:this.$d.days,DD:i.s(this.$d.days,2,"0"),H:this.$d.hours,HH:i.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:i.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:i.s(this.$d.seconds,2,"0"),SSS:i.s(this.$d.milliseconds,3,"0")};return u.replace($,(function(y,p){return p||String(k[y])}))},v.as=function(f){return this.$ms/W[_(f)]},v.get=function(f){var u=this.$ms,k=_(f);return k==="milliseconds"?u%=1e3:u=k==="weeks"?B(u/W[k]):this.$d[k],u||0},v.add=function(f,u,k){var y;return y=u?f*W[_(u)]:O(f)?f.$ms:L(f,this).$ms,L(this.$ms+y*(k?-1:1),this)},v.subtract=function(f,u){return this.add(f,u,!0)},v.locale=function(f){var u=this.clone();return u.$l=f,u},v.clone=function(){return L(this.$ms,this)},v.humanize=function(f){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!f)},v.valueOf=function(){return this.asMilliseconds()},v.milliseconds=function(){return this.get("milliseconds")},v.asMilliseconds=function(){return this.as("milliseconds")},v.seconds=function(){return this.get("seconds")},v.asSeconds=function(){return this.as("seconds")},v.minutes=function(){return this.get("minutes")},v.asMinutes=function(){return this.as("minutes")},v.hours=function(){return this.get("hours")},v.asHours=function(){return this.as("hours")},v.days=function(){return this.get("days")},v.asDays=function(){return this.as("days")},v.weeks=function(){return this.get("weeks")},v.asWeeks=function(){return this.as("weeks")},v.months=function(){return this.get("months")},v.asMonths=function(){return this.as("months")},v.years=function(){return this.get("years")},v.asYears=function(){return this.as("years")},E})(),Z=function(E,v,f){return E.add(v.years()*f,"y").add(v.months()*f,"M").add(v.days()*f,"d").add(v.hours()*f,"h").add(v.minutes()*f,"m").add(v.seconds()*f,"s").add(v.milliseconds()*f,"ms")};return function(E,v,f){n=f,i=f().$utils(),f.duration=function(y,p){var m=f.locale();return L(y,{$l:m},p)},f.isDuration=O;var u=v.prototype.add,k=v.prototype.subtract;v.prototype.add=function(y,p){return O(y)?Z(this,y,1):u.bind(this)(y,p)},v.prototype.subtract=function(y,p){return O(y)?Z(this,y,-1):k.bind(this)(y,p)}}}))})(mt)),mt.exports}var Pe=Oe();const Ve=Le(Pe);var wt=(function(){var t=c(function(m,o,l,h){for(l=l||{},h=m.length;h--;l[m[h]]=o);return l},"o"),r=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],i=[1,27],a=[1,28],g=[1,29],x=[1,30],M=[1,31],$=[1,32],R=[1,33],C=[1,34],Y=[1,9],W=[1,10],O=[1,11],L=[1,12],_=[1,13],J=[1,14],B=[1,15],Q=[1,16],j=[1,19],X=[1,20],Z=[1,21],E=[1,22],v=[1,23],f=[1,25],u=[1,35],k={trace:c(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:c(function(o,l,h,d,T,s,A){var e=s.length-1;switch(T){case 1:return s[e-1];case 2:this.$=[];break;case 3:s[e-1].push(s[e]),this.$=s[e-1];break;case 4:case 5:this.$=s[e];break;case 6:case 7:this.$=[];break;case 8:d.setWeekday("monday");break;case 9:d.setWeekday("tuesday");break;case 10:d.setWeekday("wednesday");break;case 11:d.setWeekday("thursday");break;case 12:d.setWeekday("friday");break;case 13:d.setWeekday("saturday");break;case 14:d.setWeekday("sunday");break;case 15:d.setWeekend("friday");break;case 16:d.setWeekend("saturday");break;case 17:d.setDateFormat(s[e].substr(11)),this.$=s[e].substr(11);break;case 18:d.enableInclusiveEndDates(),this.$=s[e].substr(18);break;case 19:d.TopAxis(),this.$=s[e].substr(8);break;case 20:d.setAxisFormat(s[e].substr(11)),this.$=s[e].substr(11);break;case 21:d.setTickInterval(s[e].substr(13)),this.$=s[e].substr(13);break;case 22:d.setExcludes(s[e].substr(9)),this.$=s[e].substr(9);break;case 23:d.setIncludes(s[e].substr(9)),this.$=s[e].substr(9);break;case 24:d.setTodayMarker(s[e].substr(12)),this.$=s[e].substr(12);break;case 27:d.setDiagramTitle(s[e].substr(6)),this.$=s[e].substr(6);break;case 28:this.$=s[e].trim(),d.setAccTitle(this.$);break;case 29:case 30:this.$=s[e].trim(),d.setAccDescription(this.$);break;case 31:d.addSection(s[e].substr(8)),this.$=s[e].substr(8);break;case 33:d.addTask(s[e-1],s[e]),this.$="task";break;case 34:this.$=s[e-1],d.setClickEvent(s[e-1],s[e],null);break;case 35:this.$=s[e-2],d.setClickEvent(s[e-2],s[e-1],s[e]);break;case 36:this.$=s[e-2],d.setClickEvent(s[e-2],s[e-1],null),d.setLink(s[e-2],s[e]);break;case 37:this.$=s[e-3],d.setClickEvent(s[e-3],s[e-2],s[e-1]),d.setLink(s[e-3],s[e]);break;case 38:this.$=s[e-2],d.setClickEvent(s[e-2],s[e],null),d.setLink(s[e-2],s[e-1]);break;case 39:this.$=s[e-3],d.setClickEvent(s[e-3],s[e-1],s[e]),d.setLink(s[e-3],s[e-2]);break;case 40:this.$=s[e-1],d.setLink(s[e-1],s[e]);break;case 41:case 47:this.$=s[e-1]+" "+s[e];break;case 42:case 43:case 45:this.$=s[e-2]+" "+s[e-1]+" "+s[e];break;case 44:case 46:this.$=s[e-3]+" "+s[e-2]+" "+s[e-1]+" "+s[e];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(r,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:i,14:a,15:g,16:x,17:M,18:$,19:18,20:R,21:C,22:Y,23:W,24:O,25:L,26:_,27:J,28:B,29:Q,30:j,31:X,33:Z,35:E,36:v,37:24,38:f,40:u},t(r,[2,7],{1:[2,1]}),t(r,[2,3]),{9:36,11:17,12:n,13:i,14:a,15:g,16:x,17:M,18:$,19:18,20:R,21:C,22:Y,23:W,24:O,25:L,26:_,27:J,28:B,29:Q,30:j,31:X,33:Z,35:E,36:v,37:24,38:f,40:u},t(r,[2,5]),t(r,[2,6]),t(r,[2,17]),t(r,[2,18]),t(r,[2,19]),t(r,[2,20]),t(r,[2,21]),t(r,[2,22]),t(r,[2,23]),t(r,[2,24]),t(r,[2,25]),t(r,[2,26]),t(r,[2,27]),{32:[1,37]},{34:[1,38]},t(r,[2,30]),t(r,[2,31]),t(r,[2,32]),{39:[1,39]},t(r,[2,8]),t(r,[2,9]),t(r,[2,10]),t(r,[2,11]),t(r,[2,12]),t(r,[2,13]),t(r,[2,14]),t(r,[2,15]),t(r,[2,16]),{41:[1,40],43:[1,41]},t(r,[2,4]),t(r,[2,28]),t(r,[2,29]),t(r,[2,33]),t(r,[2,34],{42:[1,42],43:[1,43]}),t(r,[2,40],{41:[1,44]}),t(r,[2,35],{43:[1,45]}),t(r,[2,36]),t(r,[2,38],{42:[1,46]}),t(r,[2,37]),t(r,[2,39])],defaultActions:{},parseError:c(function(o,l){if(l.recoverable)this.trace(o);else{var h=new Error(o);throw h.hash=l,h}},"parseError"),parse:c(function(o){var l=this,h=[0],d=[],T=[null],s=[],A=this.table,e="",b=0,I=0,S=2,D=1,V=s.slice.call(arguments,1),w=Object.create(this.lexer),U={yy:{}};for(var ot in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ot)&&(U.yy[ot]=this.yy[ot]);w.setInput(o,U.yy),U.yy.lexer=w,U.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var vt=w.yylloc;s.push(vt);var re=w.options&&w.options.ranges;typeof U.yy.parseError=="function"?this.parseError=U.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ne(z){h.length=h.length-2*z,T.length=T.length-z,s.length=s.length-z}c(ne,"popStack");function Pt(){var z;return z=d.pop()||w.lex()||D,typeof z!="number"&&(z instanceof Array&&(d=z,z=d.pop()),z=l.symbols_[z]||z),z}c(Pt,"lex");for(var N,tt,q,Tt,it={},dt,G,Vt,ft;;){if(tt=h[h.length-1],this.defaultActions[tt]?q=this.defaultActions[tt]:((N===null||typeof N>"u")&&(N=Pt()),q=A[tt]&&A[tt][N]),typeof q>"u"||!q.length||!q[0]){var bt="";ft=[];for(dt in A[tt])this.terminals_[dt]&&dt>S&&ft.push("'"+this.terminals_[dt]+"'");w.showPosition?bt="Parse error on line "+(b+1)+`:
|
|
1
|
+
import{_ as c,g as ae,s as oe,q as ce,p as le,a as ue,b as de,c as rt,d as fe,l as et,j as he,i as me,y as ke,u as ye}from"./mermaid.core-ruaJ9d8x.js";import{s as ht,a as P}from"./Serializer-DPCLjt6U.js";import{t as ge,m as pe,a as ve,i as Te,b as be,c as Wt,d as Nt,e as xe,f as we,g as _e,h as De,j as Se,k as Ce,l as Ee,n as Rt,o as Bt,p as zt,s as jt,q as qt,r as Ie,u as Me,v as Ae,w as Fe}from"./advancedFormat-Chr195ZY.js";import{aC as Le}from"./index-Ds1UcDjn.js";import{l as $e}from"./linear-DsVcoO9v.js";import"./line-B3fXWiyE.js";import"./array-BKyUJesY.js";import"./path-CbwjOpE9.js";import"./isEmpty-BZ44SF3F.js";import"./init-Gi6I4Gst.js";import"./defaultLocale-Bu4YK2AB.js";var mt={exports:{}},Ye=mt.exports,Ht;function Oe(){return Ht||(Ht=1,(function(t,r){(function(n,i){t.exports=i()})(Ye,(function(){var n,i,a=1e3,g=6e4,x=36e5,M=864e5,$=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,R=31536e6,C=2628e6,Y=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,W={years:R,months:C,days:M,hours:x,minutes:g,seconds:a,milliseconds:1,weeks:6048e5},O=function(E){return E instanceof X},L=function(E,v,f){return new X(E,f,v.$l)},_=function(E){return i.p(E)+"s"},J=function(E){return E<0},B=function(E){return J(E)?Math.ceil(E):Math.floor(E)},Q=function(E){return Math.abs(E)},j=function(E,v){return E?J(E)?{negative:!0,format:""+Q(E)+v}:{negative:!1,format:""+E+v}:{negative:!1,format:""}},X=(function(){function E(f,u,k){var y=this;if(this.$d={},this.$l=k,f===void 0&&(this.$ms=0,this.parseFromMilliseconds()),u)return L(f*W[_(u)],this);if(typeof f=="number")return this.$ms=f,this.parseFromMilliseconds(),this;if(typeof f=="object")return Object.keys(f).forEach((function(o){y.$d[_(o)]=f[o]})),this.calMilliseconds(),this;if(typeof f=="string"){var p=f.match(Y);if(p){var m=p.slice(2).map((function(o){return o!=null?Number(o):0}));return this.$d.years=m[0],this.$d.months=m[1],this.$d.weeks=m[2],this.$d.days=m[3],this.$d.hours=m[4],this.$d.minutes=m[5],this.$d.seconds=m[6],this.calMilliseconds(),this}}return this}var v=E.prototype;return v.calMilliseconds=function(){var f=this;this.$ms=Object.keys(this.$d).reduce((function(u,k){return u+(f.$d[k]||0)*W[k]}),0)},v.parseFromMilliseconds=function(){var f=this.$ms;this.$d.years=B(f/R),f%=R,this.$d.months=B(f/C),f%=C,this.$d.days=B(f/M),f%=M,this.$d.hours=B(f/x),f%=x,this.$d.minutes=B(f/g),f%=g,this.$d.seconds=B(f/a),f%=a,this.$d.milliseconds=f},v.toISOString=function(){var f=j(this.$d.years,"Y"),u=j(this.$d.months,"M"),k=+this.$d.days||0;this.$d.weeks&&(k+=7*this.$d.weeks);var y=j(k,"D"),p=j(this.$d.hours,"H"),m=j(this.$d.minutes,"M"),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3,o=Math.round(1e3*o)/1e3);var l=j(o,"S"),h=f.negative||u.negative||y.negative||p.negative||m.negative||l.negative,d=p.format||m.format||l.format?"T":"",T=(h?"-":"")+"P"+f.format+u.format+y.format+d+p.format+m.format+l.format;return T==="P"||T==="-P"?"P0D":T},v.toJSON=function(){return this.toISOString()},v.format=function(f){var u=f||"YYYY-MM-DDTHH:mm:ss",k={Y:this.$d.years,YY:i.s(this.$d.years,2,"0"),YYYY:i.s(this.$d.years,4,"0"),M:this.$d.months,MM:i.s(this.$d.months,2,"0"),D:this.$d.days,DD:i.s(this.$d.days,2,"0"),H:this.$d.hours,HH:i.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:i.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:i.s(this.$d.seconds,2,"0"),SSS:i.s(this.$d.milliseconds,3,"0")};return u.replace($,(function(y,p){return p||String(k[y])}))},v.as=function(f){return this.$ms/W[_(f)]},v.get=function(f){var u=this.$ms,k=_(f);return k==="milliseconds"?u%=1e3:u=k==="weeks"?B(u/W[k]):this.$d[k],u||0},v.add=function(f,u,k){var y;return y=u?f*W[_(u)]:O(f)?f.$ms:L(f,this).$ms,L(this.$ms+y*(k?-1:1),this)},v.subtract=function(f,u){return this.add(f,u,!0)},v.locale=function(f){var u=this.clone();return u.$l=f,u},v.clone=function(){return L(this.$ms,this)},v.humanize=function(f){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!f)},v.valueOf=function(){return this.asMilliseconds()},v.milliseconds=function(){return this.get("milliseconds")},v.asMilliseconds=function(){return this.as("milliseconds")},v.seconds=function(){return this.get("seconds")},v.asSeconds=function(){return this.as("seconds")},v.minutes=function(){return this.get("minutes")},v.asMinutes=function(){return this.as("minutes")},v.hours=function(){return this.get("hours")},v.asHours=function(){return this.as("hours")},v.days=function(){return this.get("days")},v.asDays=function(){return this.as("days")},v.weeks=function(){return this.get("weeks")},v.asWeeks=function(){return this.as("weeks")},v.months=function(){return this.get("months")},v.asMonths=function(){return this.as("months")},v.years=function(){return this.get("years")},v.asYears=function(){return this.as("years")},E})(),Z=function(E,v,f){return E.add(v.years()*f,"y").add(v.months()*f,"M").add(v.days()*f,"d").add(v.hours()*f,"h").add(v.minutes()*f,"m").add(v.seconds()*f,"s").add(v.milliseconds()*f,"ms")};return function(E,v,f){n=f,i=f().$utils(),f.duration=function(y,p){var m=f.locale();return L(y,{$l:m},p)},f.isDuration=O;var u=v.prototype.add,k=v.prototype.subtract;v.prototype.add=function(y,p){return O(y)?Z(this,y,1):u.bind(this)(y,p)},v.prototype.subtract=function(y,p){return O(y)?Z(this,y,-1):k.bind(this)(y,p)}}}))})(mt)),mt.exports}var Pe=Oe();const Ve=Le(Pe);var wt=(function(){var t=c(function(m,o,l,h){for(l=l||{},h=m.length;h--;l[m[h]]=o);return l},"o"),r=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],i=[1,27],a=[1,28],g=[1,29],x=[1,30],M=[1,31],$=[1,32],R=[1,33],C=[1,34],Y=[1,9],W=[1,10],O=[1,11],L=[1,12],_=[1,13],J=[1,14],B=[1,15],Q=[1,16],j=[1,19],X=[1,20],Z=[1,21],E=[1,22],v=[1,23],f=[1,25],u=[1,35],k={trace:c(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:c(function(o,l,h,d,T,s,A){var e=s.length-1;switch(T){case 1:return s[e-1];case 2:this.$=[];break;case 3:s[e-1].push(s[e]),this.$=s[e-1];break;case 4:case 5:this.$=s[e];break;case 6:case 7:this.$=[];break;case 8:d.setWeekday("monday");break;case 9:d.setWeekday("tuesday");break;case 10:d.setWeekday("wednesday");break;case 11:d.setWeekday("thursday");break;case 12:d.setWeekday("friday");break;case 13:d.setWeekday("saturday");break;case 14:d.setWeekday("sunday");break;case 15:d.setWeekend("friday");break;case 16:d.setWeekend("saturday");break;case 17:d.setDateFormat(s[e].substr(11)),this.$=s[e].substr(11);break;case 18:d.enableInclusiveEndDates(),this.$=s[e].substr(18);break;case 19:d.TopAxis(),this.$=s[e].substr(8);break;case 20:d.setAxisFormat(s[e].substr(11)),this.$=s[e].substr(11);break;case 21:d.setTickInterval(s[e].substr(13)),this.$=s[e].substr(13);break;case 22:d.setExcludes(s[e].substr(9)),this.$=s[e].substr(9);break;case 23:d.setIncludes(s[e].substr(9)),this.$=s[e].substr(9);break;case 24:d.setTodayMarker(s[e].substr(12)),this.$=s[e].substr(12);break;case 27:d.setDiagramTitle(s[e].substr(6)),this.$=s[e].substr(6);break;case 28:this.$=s[e].trim(),d.setAccTitle(this.$);break;case 29:case 30:this.$=s[e].trim(),d.setAccDescription(this.$);break;case 31:d.addSection(s[e].substr(8)),this.$=s[e].substr(8);break;case 33:d.addTask(s[e-1],s[e]),this.$="task";break;case 34:this.$=s[e-1],d.setClickEvent(s[e-1],s[e],null);break;case 35:this.$=s[e-2],d.setClickEvent(s[e-2],s[e-1],s[e]);break;case 36:this.$=s[e-2],d.setClickEvent(s[e-2],s[e-1],null),d.setLink(s[e-2],s[e]);break;case 37:this.$=s[e-3],d.setClickEvent(s[e-3],s[e-2],s[e-1]),d.setLink(s[e-3],s[e]);break;case 38:this.$=s[e-2],d.setClickEvent(s[e-2],s[e],null),d.setLink(s[e-2],s[e-1]);break;case 39:this.$=s[e-3],d.setClickEvent(s[e-3],s[e-1],s[e]),d.setLink(s[e-3],s[e-2]);break;case 40:this.$=s[e-1],d.setLink(s[e-1],s[e]);break;case 41:case 47:this.$=s[e-1]+" "+s[e];break;case 42:case 43:case 45:this.$=s[e-2]+" "+s[e-1]+" "+s[e];break;case 44:case 46:this.$=s[e-3]+" "+s[e-2]+" "+s[e-1]+" "+s[e];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(r,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:i,14:a,15:g,16:x,17:M,18:$,19:18,20:R,21:C,22:Y,23:W,24:O,25:L,26:_,27:J,28:B,29:Q,30:j,31:X,33:Z,35:E,36:v,37:24,38:f,40:u},t(r,[2,7],{1:[2,1]}),t(r,[2,3]),{9:36,11:17,12:n,13:i,14:a,15:g,16:x,17:M,18:$,19:18,20:R,21:C,22:Y,23:W,24:O,25:L,26:_,27:J,28:B,29:Q,30:j,31:X,33:Z,35:E,36:v,37:24,38:f,40:u},t(r,[2,5]),t(r,[2,6]),t(r,[2,17]),t(r,[2,18]),t(r,[2,19]),t(r,[2,20]),t(r,[2,21]),t(r,[2,22]),t(r,[2,23]),t(r,[2,24]),t(r,[2,25]),t(r,[2,26]),t(r,[2,27]),{32:[1,37]},{34:[1,38]},t(r,[2,30]),t(r,[2,31]),t(r,[2,32]),{39:[1,39]},t(r,[2,8]),t(r,[2,9]),t(r,[2,10]),t(r,[2,11]),t(r,[2,12]),t(r,[2,13]),t(r,[2,14]),t(r,[2,15]),t(r,[2,16]),{41:[1,40],43:[1,41]},t(r,[2,4]),t(r,[2,28]),t(r,[2,29]),t(r,[2,33]),t(r,[2,34],{42:[1,42],43:[1,43]}),t(r,[2,40],{41:[1,44]}),t(r,[2,35],{43:[1,45]}),t(r,[2,36]),t(r,[2,38],{42:[1,46]}),t(r,[2,37]),t(r,[2,39])],defaultActions:{},parseError:c(function(o,l){if(l.recoverable)this.trace(o);else{var h=new Error(o);throw h.hash=l,h}},"parseError"),parse:c(function(o){var l=this,h=[0],d=[],T=[null],s=[],A=this.table,e="",b=0,I=0,S=2,D=1,V=s.slice.call(arguments,1),w=Object.create(this.lexer),U={yy:{}};for(var ot in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ot)&&(U.yy[ot]=this.yy[ot]);w.setInput(o,U.yy),U.yy.lexer=w,U.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var vt=w.yylloc;s.push(vt);var re=w.options&&w.options.ranges;typeof U.yy.parseError=="function"?this.parseError=U.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ne(z){h.length=h.length-2*z,T.length=T.length-z,s.length=s.length-z}c(ne,"popStack");function Pt(){var z;return z=d.pop()||w.lex()||D,typeof z!="number"&&(z instanceof Array&&(d=z,z=d.pop()),z=l.symbols_[z]||z),z}c(Pt,"lex");for(var N,tt,q,Tt,it={},dt,G,Vt,ft;;){if(tt=h[h.length-1],this.defaultActions[tt]?q=this.defaultActions[tt]:((N===null||typeof N>"u")&&(N=Pt()),q=A[tt]&&A[tt][N]),typeof q>"u"||!q.length||!q[0]){var bt="";ft=[];for(dt in A[tt])this.terminals_[dt]&&dt>S&&ft.push("'"+this.terminals_[dt]+"'");w.showPosition?bt="Parse error on line "+(b+1)+`:
|
|
2
2
|
`+w.showPosition()+`
|
|
3
3
|
Expecting `+ft.join(", ")+", got '"+(this.terminals_[N]||N)+"'":bt="Parse error on line "+(b+1)+": Unexpected "+(N==D?"end of input":"'"+(this.terminals_[N]||N)+"'"),this.parseError(bt,{text:w.match,token:this.terminals_[N]||N,line:w.yylineno,loc:vt,expected:ft})}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+tt+", token: "+N);switch(q[0]){case 1:h.push(N),T.push(w.yytext),s.push(w.yylloc),h.push(q[1]),N=null,I=w.yyleng,e=w.yytext,b=w.yylineno,vt=w.yylloc;break;case 2:if(G=this.productions_[q[1]][1],it.$=T[T.length-G],it._$={first_line:s[s.length-(G||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(G||1)].first_column,last_column:s[s.length-1].last_column},re&&(it._$.range=[s[s.length-(G||1)].range[0],s[s.length-1].range[1]]),Tt=this.performAction.apply(it,[e,I,b,U.yy,q[1],T,s].concat(V)),typeof Tt<"u")return Tt;G&&(h=h.slice(0,-1*G*2),T=T.slice(0,-1*G),s=s.slice(0,-1*G)),h.push(this.productions_[q[1]][0]),T.push(it.$),s.push(it._$),Vt=A[h[h.length-2]][h[h.length-1]],h.push(Vt);break;case 3:return!0}}return!0},"parse")},y=(function(){var m={EOF:1,parseError:c(function(l,h){if(this.yy.parser)this.yy.parser.parseError(l,h);else throw new Error(l)},"parseError"),setInput:c(function(o,l){return this.yy=l||this.yy||{},this._input=o,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:c(function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var l=o.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:c(function(o){var l=o.length,h=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var d=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 T=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===d.length?this.yylloc.first_column:0)+d[d.length-h.length].length-h[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[T[0],T[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:c(function(){return this._more=!0,this},"more"),reject:c(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:c(function(o){this.unput(this.match.slice(o))},"less"),pastInput:c(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:c(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:c(function(){var o=this.pastInput(),l=new Array(o.length+1).join("-");return o+this.upcomingInput()+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Qt,s as Zt,n as $t,o as te,b as ee,c as se,g as U,d as ie,l as ht,j as ne,i as re,q as ae,u as ce}from"./index-
|
|
1
|
+
import{a as Qt,s as Zt,n as $t,o as te,b as ee,c as se,g as U,d as ie,l as ht,j as ne,i as re,q as ae,u as ce}from"./index-_FyCDKGq.js";import{s as ut,a as I}from"./Serializer-DPCLjt6U.js";import{t as oe,m as le,a as ue,i as de,b as fe,c as Lt,d as Ft,e as he,f as me,g as ke,h as ye,j as ge,k as pe,l as be,n as Mt,o as Vt,p as Pt,s as Ot,q as Rt,r as Te,u as xe,v as ve,w as _e}from"./advancedFormat-Chr195ZY.js";import{l as we}from"./linear-DsVcoO9v.js";import"./index-Ds1UcDjn.js";import"./isEmpty-BZ44SF3F.js";import"./init-Gi6I4Gst.js";import"./defaultLocale-Bu4YK2AB.js";var gt=(function(){var t=function(g,i,u,d){for(u=u||{},d=g.length;d--;u[g[d]]=i);return u},s=[6,8,10,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,30,32,33,35,37],n=[1,25],r=[1,26],a=[1,27],h=[1,28],f=[1,29],F=[1,30],O=[1,31],R=[1,9],E=[1,10],A=[1,11],N=[1,12],M=[1,13],V=[1,14],v=[1,15],tt=[1,16],et=[1,18],st=[1,19],it=[1,20],nt=[1,21],rt=[1,22],at=[1,24],ct=[1,32],m={trace:function(){},yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,dateFormat:19,inclusiveEndDates:20,topAxis:21,axisFormat:22,tickInterval:23,excludes:24,includes:25,todayMarker:26,title:27,acc_title:28,acc_title_value:29,acc_descr:30,acc_descr_value:31,acc_descr_multiline_value:32,section:33,clickStatement:34,taskTxt:35,taskData:36,click:37,callbackname:38,callbackargs:39,href:40,clickStatementDebug:41,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",19:"dateFormat",20:"inclusiveEndDates",21:"topAxis",22:"axisFormat",23:"tickInterval",24:"excludes",25:"includes",26:"todayMarker",27:"title",28:"acc_title",29:"acc_title_value",30:"acc_descr",31:"acc_descr_value",32:"acc_descr_multiline_value",33:"section",35:"taskTxt",36:"taskData",37:"click",38:"callbackname",39:"callbackargs",40:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[34,2],[34,3],[34,3],[34,4],[34,3],[34,4],[34,2],[41,2],[41,3],[41,3],[41,4],[41,3],[41,4],[41,2]],performAction:function(i,u,d,c,k,e,S){var l=e.length-1;switch(k){case 1:return e[l-1];case 2:this.$=[];break;case 3:e[l-1].push(e[l]),this.$=e[l-1];break;case 4:case 5:this.$=e[l];break;case 6:case 7:this.$=[];break;case 8:c.setWeekday("monday");break;case 9:c.setWeekday("tuesday");break;case 10:c.setWeekday("wednesday");break;case 11:c.setWeekday("thursday");break;case 12:c.setWeekday("friday");break;case 13:c.setWeekday("saturday");break;case 14:c.setWeekday("sunday");break;case 15:c.setDateFormat(e[l].substr(11)),this.$=e[l].substr(11);break;case 16:c.enableInclusiveEndDates(),this.$=e[l].substr(18);break;case 17:c.TopAxis(),this.$=e[l].substr(8);break;case 18:c.setAxisFormat(e[l].substr(11)),this.$=e[l].substr(11);break;case 19:c.setTickInterval(e[l].substr(13)),this.$=e[l].substr(13);break;case 20:c.setExcludes(e[l].substr(9)),this.$=e[l].substr(9);break;case 21:c.setIncludes(e[l].substr(9)),this.$=e[l].substr(9);break;case 22:c.setTodayMarker(e[l].substr(12)),this.$=e[l].substr(12);break;case 24:c.setDiagramTitle(e[l].substr(6)),this.$=e[l].substr(6);break;case 25:this.$=e[l].trim(),c.setAccTitle(this.$);break;case 26:case 27:this.$=e[l].trim(),c.setAccDescription(this.$);break;case 28:c.addSection(e[l].substr(8)),this.$=e[l].substr(8);break;case 30:c.addTask(e[l-1],e[l]),this.$="task";break;case 31:this.$=e[l-1],c.setClickEvent(e[l-1],e[l],null);break;case 32:this.$=e[l-2],c.setClickEvent(e[l-2],e[l-1],e[l]);break;case 33:this.$=e[l-2],c.setClickEvent(e[l-2],e[l-1],null),c.setLink(e[l-2],e[l]);break;case 34:this.$=e[l-3],c.setClickEvent(e[l-3],e[l-2],e[l-1]),c.setLink(e[l-3],e[l]);break;case 35:this.$=e[l-2],c.setClickEvent(e[l-2],e[l],null),c.setLink(e[l-2],e[l-1]);break;case 36:this.$=e[l-3],c.setClickEvent(e[l-3],e[l-1],e[l]),c.setLink(e[l-3],e[l-2]);break;case 37:this.$=e[l-1],c.setLink(e[l-1],e[l]);break;case 38:case 44:this.$=e[l-1]+" "+e[l];break;case 39:case 40:case 42:this.$=e[l-2]+" "+e[l-1]+" "+e[l];break;case 41:case 43:this.$=e[l-3]+" "+e[l-2]+" "+e[l-1]+" "+e[l];break}},table:[{3:1,4:[1,2]},{1:[3]},t(s,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:r,14:a,15:h,16:f,17:F,18:O,19:R,20:E,21:A,22:N,23:M,24:V,25:v,26:tt,27:et,28:st,30:it,32:nt,33:rt,34:23,35:at,37:ct},t(s,[2,7],{1:[2,1]}),t(s,[2,3]),{9:33,11:17,12:n,13:r,14:a,15:h,16:f,17:F,18:O,19:R,20:E,21:A,22:N,23:M,24:V,25:v,26:tt,27:et,28:st,30:it,32:nt,33:rt,34:23,35:at,37:ct},t(s,[2,5]),t(s,[2,6]),t(s,[2,15]),t(s,[2,16]),t(s,[2,17]),t(s,[2,18]),t(s,[2,19]),t(s,[2,20]),t(s,[2,21]),t(s,[2,22]),t(s,[2,23]),t(s,[2,24]),{29:[1,34]},{31:[1,35]},t(s,[2,27]),t(s,[2,28]),t(s,[2,29]),{36:[1,36]},t(s,[2,8]),t(s,[2,9]),t(s,[2,10]),t(s,[2,11]),t(s,[2,12]),t(s,[2,13]),t(s,[2,14]),{38:[1,37],40:[1,38]},t(s,[2,4]),t(s,[2,25]),t(s,[2,26]),t(s,[2,30]),t(s,[2,31],{39:[1,39],40:[1,40]}),t(s,[2,37],{38:[1,41]}),t(s,[2,32],{40:[1,42]}),t(s,[2,33]),t(s,[2,35],{39:[1,43]}),t(s,[2,34]),t(s,[2,36])],defaultActions:{},parseError:function(i,u){if(u.recoverable)this.trace(i);else{var d=new Error(i);throw d.hash=u,d}},parse:function(i){var u=this,d=[0],c=[],k=[null],e=[],S=this.table,l="",o=0,y=0,C=2,x=1,_=e.slice.call(arguments,1),T=Object.create(this.lexer),w={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(w.yy[J]=this.yy[J]);T.setInput(i,w.yy),w.yy.lexer=T,w.yy.parser=this,typeof T.yylloc>"u"&&(T.yylloc={});var K=T.yylloc;e.push(K);var Jt=T.options&&T.options.ranges;typeof w.yy.parseError=="function"?this.parseError=w.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Kt(){var Y;return Y=c.pop()||T.lex()||x,typeof Y!="number"&&(Y instanceof Array&&(c=Y,Y=c.pop()),Y=u.symbols_[Y]||Y),Y}for(var L,q,P,kt,X={},ot,W,It,lt;;){if(q=d[d.length-1],this.defaultActions[q]?P=this.defaultActions[q]:((L===null||typeof L>"u")&&(L=Kt()),P=S[q]&&S[q][L]),typeof P>"u"||!P.length||!P[0]){var yt="";lt=[];for(ot in S[q])this.terminals_[ot]&&ot>C&<.push("'"+this.terminals_[ot]+"'");T.showPosition?yt="Parse error on line "+(o+1)+`:
|
|
2
2
|
`+T.showPosition()+`
|
|
3
3
|
Expecting `+lt.join(", ")+", got '"+(this.terminals_[L]||L)+"'":yt="Parse error on line "+(o+1)+": Unexpected "+(L==x?"end of input":"'"+(this.terminals_[L]||L)+"'"),this.parseError(yt,{text:T.match,token:this.terminals_[L]||L,line:T.yylineno,loc:K,expected:lt})}if(P[0]instanceof Array&&P.length>1)throw new Error("Parse Error: multiple actions possible at state: "+q+", token: "+L);switch(P[0]){case 1:d.push(L),k.push(T.yytext),e.push(T.yylloc),d.push(P[1]),L=null,y=T.yyleng,l=T.yytext,o=T.yylineno,K=T.yylloc;break;case 2:if(W=this.productions_[P[1]][1],X.$=k[k.length-W],X._$={first_line:e[e.length-(W||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(W||1)].first_column,last_column:e[e.length-1].last_column},Jt&&(X._$.range=[e[e.length-(W||1)].range[0],e[e.length-1].range[1]]),kt=this.performAction.apply(X,[l,y,o,w.yy,P[1],k,e].concat(_)),typeof kt<"u")return kt;W&&(d=d.slice(0,-1*W*2),k=k.slice(0,-1*W),e=e.slice(0,-1*W)),d.push(this.productions_[P[1]][0]),k.push(X.$),e.push(X._$),It=S[d[d.length-2]][d[d.length-1]],d.push(It);break;case 3:return!0}}return!0}},b=(function(){var g={EOF:1,parseError:function(u,d){if(this.yy.parser)this.yy.parser.parseError(u,d);else throw new Error(u)},setInput:function(i,u){return this.yy=u||this.yy||{},this._input=i,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},input:function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var u=i.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},unput:function(i){var u=i.length,d=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var c=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),d.length-1&&(this.yylineno-=d.length-1);var k=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:d?(d.length===c.length?this.yylloc.first_column:0)+c[c.length-d.length].length-d[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[k[0],k[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject: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},less:function(i){this.unput(this.match.slice(i))},pastInput:function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var i=this.pastInput(),u=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
|
package/assets/{gitGraphDiagram-72cf32ee-CEEpXU_f.js → gitGraphDiagram-72cf32ee-BBZSqS6J.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as vt,o as Ct,s as Ot,a as Pt,b as Gt,c as St,g as C,l as B,u as At,x as It,q as Nt,j as D,y as Ht}from"./index-C3qFnFDn.js";import{s as Bt}from"./Serializer-Cg6t80B7.js";import"./index-BWxm5yOF.js";import"./isEmpty-Cp2Tv4FQ.js";var mt=(function(){var r=function(S,o,u,d){for(u=u||{},d=S.length;d--;u[S[d]]=o);return u},n=[1,3],l=[1,6],h=[1,4],i=[1,5],c=[2,5],p=[1,12],m=[5,7,13,19,21,23,24,26,28,31,37,40,47],x=[7,13,19,21,23,24,26,28,31,37,40],y=[7,12,13,19,21,23,24,26,28,31,37,40],a=[7,13,47],R=[1,42],_=[1,41],b=[7,13,29,32,35,38,47],f=[1,55],k=[1,56],g=[1,57],E=[7,13,32,35,42,47],z={trace:function(){},yy:{},symbols_:{error:2,start:3,eol:4,GG:5,document:6,EOF:7,":":8,DIR:9,options:10,body:11,OPT:12,NL:13,line:14,statement:15,commitStatement:16,mergeStatement:17,cherryPickStatement:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,section:24,branchStatement:25,CHECKOUT:26,ref:27,BRANCH:28,ORDER:29,NUM:30,CHERRY_PICK:31,COMMIT_ID:32,STR:33,PARENT_COMMIT:34,COMMIT_TAG:35,EMPTYSTR:36,MERGE:37,COMMIT_TYPE:38,commitType:39,COMMIT:40,commit_arg:41,COMMIT_MSG:42,NORMAL:43,REVERSE:44,HIGHLIGHT:45,ID:46,";":47,$accept:0,$end:1},terminals_:{2:"error",5:"GG",7:"EOF",8:":",9:"DIR",12:"OPT",13:"NL",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"section",26:"CHECKOUT",28:"BRANCH",29:"ORDER",30:"NUM",31:"CHERRY_PICK",32:"COMMIT_ID",33:"STR",34:"PARENT_COMMIT",35:"COMMIT_TAG",36:"EMPTYSTR",37:"MERGE",38:"COMMIT_TYPE",40:"COMMIT",42:"COMMIT_MSG",43:"NORMAL",44:"REVERSE",45:"HIGHLIGHT",46:"ID",47:";"},productions_:[0,[3,2],[3,3],[3,4],[3,5],[6,0],[6,2],[10,2],[10,1],[11,0],[11,2],[14,2],[14,1],[15,1],[15,1],[15,1],[15,2],[15,2],[15,1],[15,1],[15,1],[15,2],[25,2],[25,4],[18,3],[18,5],[18,5],[18,7],[18,7],[18,5],[18,5],[18,5],[18,7],[18,7],[18,7],[18,7],[17,2],[17,4],[17,4],[17,4],[17,6],[17,6],[17,6],[17,6],[17,6],[17,6],[17,8],[17,8],[17,8],[17,8],[17,8],[17,8],[16,2],[16,3],[16,3],[16,5],[16,5],[16,3],[16,5],[16,5],[16,5],[16,5],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,3],[16,5],[16,5],[16,5],[16,5],[16,5],[16,5],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[41,0],[41,1],[39,1],[39,1],[39,1],[27,1],[27,1],[4,1],[4,1],[4,1]],performAction:function(o,u,d,s,T,t,X){var e=t.length-1;switch(T){case 2:return t[e];case 3:return t[e-1];case 4:return s.setDirection(t[e-3]),t[e-1];case 6:s.setOptions(t[e-1]),this.$=t[e];break;case 7:t[e-1]+=t[e],this.$=t[e-1];break;case 9:this.$=[];break;case 10:t[e-1].push(t[e]),this.$=t[e-1];break;case 11:this.$=t[e-1];break;case 16:this.$=t[e].trim(),s.setAccTitle(this.$);break;case 17:case 18:this.$=t[e].trim(),s.setAccDescription(this.$);break;case 19:s.addSection(t[e].substr(8)),this.$=t[e].substr(8);break;case 21:s.checkout(t[e]);break;case 22:s.branch(t[e]);break;case 23:s.branch(t[e-2],t[e]);break;case 24:s.cherryPick(t[e],"",void 0);break;case 25:s.cherryPick(t[e-2],"",void 0,t[e]);break;case 26:s.cherryPick(t[e-2],"",t[e]);break;case 27:s.cherryPick(t[e-4],"",t[e],t[e-2]);break;case 28:s.cherryPick(t[e-4],"",t[e-2],t[e]);break;case 29:s.cherryPick(t[e],"",t[e-2]);break;case 30:s.cherryPick(t[e],"","");break;case 31:s.cherryPick(t[e-2],"","");break;case 32:s.cherryPick(t[e-4],"","",t[e-2]);break;case 33:s.cherryPick(t[e-4],"","",t[e]);break;case 34:s.cherryPick(t[e-2],"",t[e-4],t[e]);break;case 35:s.cherryPick(t[e-2],"","",t[e]);break;case 36:s.merge(t[e],"","","");break;case 37:s.merge(t[e-2],t[e],"","");break;case 38:s.merge(t[e-2],"",t[e],"");break;case 39:s.merge(t[e-2],"","",t[e]);break;case 40:s.merge(t[e-4],t[e],"",t[e-2]);break;case 41:s.merge(t[e-4],"",t[e],t[e-2]);break;case 42:s.merge(t[e-4],"",t[e-2],t[e]);break;case 43:s.merge(t[e-4],t[e-2],t[e],"");break;case 44:s.merge(t[e-4],t[e-2],"",t[e]);break;case 45:s.merge(t[e-4],t[e],t[e-2],"");break;case 46:s.merge(t[e-6],t[e-4],t[e-2],t[e]);break;case 47:s.merge(t[e-6],t[e],t[e-4],t[e-2]);break;case 48:s.merge(t[e-6],t[e-4],t[e],t[e-2]);break;case 49:s.merge(t[e-6],t[e-2],t[e-4],t[e]);break;case 50:s.merge(t[e-6],t[e],t[e-2],t[e-4]);break;case 51:s.merge(t[e-6],t[e-2],t[e],t[e-4]);break;case 52:s.commit(t[e]);break;case 53:s.commit("","",s.commitType.NORMAL,t[e]);break;case 54:s.commit("","",t[e],"");break;case 55:s.commit("","",t[e],t[e-2]);break;case 56:s.commit("","",t[e-2],t[e]);break;case 57:s.commit("",t[e],s.commitType.NORMAL,"");break;case 58:s.commit("",t[e-2],s.commitType.NORMAL,t[e]);break;case 59:s.commit("",t[e],s.commitType.NORMAL,t[e-2]);break;case 60:s.commit("",t[e-2],t[e],"");break;case 61:s.commit("",t[e],t[e-2],"");break;case 62:s.commit("",t[e-4],t[e-2],t[e]);break;case 63:s.commit("",t[e-4],t[e],t[e-2]);break;case 64:s.commit("",t[e-2],t[e-4],t[e]);break;case 65:s.commit("",t[e],t[e-4],t[e-2]);break;case 66:s.commit("",t[e],t[e-2],t[e-4]);break;case 67:s.commit("",t[e-2],t[e],t[e-4]);break;case 68:s.commit(t[e],"",s.commitType.NORMAL,"");break;case 69:s.commit(t[e],"",s.commitType.NORMAL,t[e-2]);break;case 70:s.commit(t[e-2],"",s.commitType.NORMAL,t[e]);break;case 71:s.commit(t[e-2],"",t[e],"");break;case 72:s.commit(t[e],"",t[e-2],"");break;case 73:s.commit(t[e],t[e-2],s.commitType.NORMAL,"");break;case 74:s.commit(t[e-2],t[e],s.commitType.NORMAL,"");break;case 75:s.commit(t[e-4],"",t[e-2],t[e]);break;case 76:s.commit(t[e-4],"",t[e],t[e-2]);break;case 77:s.commit(t[e-2],"",t[e-4],t[e]);break;case 78:s.commit(t[e],"",t[e-4],t[e-2]);break;case 79:s.commit(t[e],"",t[e-2],t[e-4]);break;case 80:s.commit(t[e-2],"",t[e],t[e-4]);break;case 81:s.commit(t[e-4],t[e],t[e-2],"");break;case 82:s.commit(t[e-4],t[e-2],t[e],"");break;case 83:s.commit(t[e-2],t[e],t[e-4],"");break;case 84:s.commit(t[e],t[e-2],t[e-4],"");break;case 85:s.commit(t[e],t[e-4],t[e-2],"");break;case 86:s.commit(t[e-2],t[e-4],t[e],"");break;case 87:s.commit(t[e-4],t[e],s.commitType.NORMAL,t[e-2]);break;case 88:s.commit(t[e-4],t[e-2],s.commitType.NORMAL,t[e]);break;case 89:s.commit(t[e-2],t[e],s.commitType.NORMAL,t[e-4]);break;case 90:s.commit(t[e],t[e-2],s.commitType.NORMAL,t[e-4]);break;case 91:s.commit(t[e],t[e-4],s.commitType.NORMAL,t[e-2]);break;case 92:s.commit(t[e-2],t[e-4],s.commitType.NORMAL,t[e]);break;case 93:s.commit(t[e-6],t[e-4],t[e-2],t[e]);break;case 94:s.commit(t[e-6],t[e-4],t[e],t[e-2]);break;case 95:s.commit(t[e-6],t[e-2],t[e-4],t[e]);break;case 96:s.commit(t[e-6],t[e],t[e-4],t[e-2]);break;case 97:s.commit(t[e-6],t[e-2],t[e],t[e-4]);break;case 98:s.commit(t[e-6],t[e],t[e-2],t[e-4]);break;case 99:s.commit(t[e-4],t[e-6],t[e-2],t[e]);break;case 100:s.commit(t[e-4],t[e-6],t[e],t[e-2]);break;case 101:s.commit(t[e-2],t[e-6],t[e-4],t[e]);break;case 102:s.commit(t[e],t[e-6],t[e-4],t[e-2]);break;case 103:s.commit(t[e-2],t[e-6],t[e],t[e-4]);break;case 104:s.commit(t[e],t[e-6],t[e-2],t[e-4]);break;case 105:s.commit(t[e],t[e-4],t[e-2],t[e-6]);break;case 106:s.commit(t[e-2],t[e-4],t[e],t[e-6]);break;case 107:s.commit(t[e],t[e-2],t[e-4],t[e-6]);break;case 108:s.commit(t[e-2],t[e],t[e-4],t[e-6]);break;case 109:s.commit(t[e-4],t[e-2],t[e],t[e-6]);break;case 110:s.commit(t[e-4],t[e],t[e-2],t[e-6]);break;case 111:s.commit(t[e-2],t[e-4],t[e-6],t[e]);break;case 112:s.commit(t[e],t[e-4],t[e-6],t[e-2]);break;case 113:s.commit(t[e-2],t[e],t[e-6],t[e-4]);break;case 114:s.commit(t[e],t[e-2],t[e-6],t[e-4]);break;case 115:s.commit(t[e-4],t[e-2],t[e-6],t[e]);break;case 116:s.commit(t[e-4],t[e],t[e-6],t[e-2]);break;case 117:this.$="";break;case 118:this.$=t[e];break;case 119:this.$=s.commitType.NORMAL;break;case 120:this.$=s.commitType.REVERSE;break;case 121:this.$=s.commitType.HIGHLIGHT;break}},table:[{3:1,4:2,5:n,7:l,13:h,47:i},{1:[3]},{3:7,4:2,5:n,7:l,13:h,47:i},{6:8,7:c,8:[1,9],9:[1,10],10:11,13:p},r(m,[2,124]),r(m,[2,125]),r(m,[2,126]),{1:[2,1]},{7:[1,13]},{6:14,7:c,10:11,13:p},{8:[1,15]},r(x,[2,9],{11:16,12:[1,17]}),r(y,[2,8]),{1:[2,2]},{7:[1,18]},{6:19,7:c,10:11,13:p},{7:[2,6],13:[1,22],14:20,15:21,16:23,17:24,18:25,19:[1,26],21:[1,27],23:[1,28],24:[1,29],25:30,26:[1,31],28:[1,35],31:[1,34],37:[1,33],40:[1,32]},r(y,[2,7]),{1:[2,3]},{7:[1,36]},r(x,[2,10]),{4:37,7:l,13:h,47:i},r(x,[2,12]),r(a,[2,13]),r(a,[2,14]),r(a,[2,15]),{20:[1,38]},{22:[1,39]},r(a,[2,18]),r(a,[2,19]),r(a,[2,20]),{27:40,33:R,46:_},r(a,[2,117],{41:43,32:[1,46],33:[1,48],35:[1,44],38:[1,45],42:[1,47]}),{27:49,33:R,46:_},{32:[1,50],35:[1,51]},{27:52,33:R,46:_},{1:[2,4]},r(x,[2,11]),r(a,[2,16]),r(a,[2,17]),r(a,[2,21]),r(b,[2,122]),r(b,[2,123]),r(a,[2,52]),{33:[1,53]},{39:54,43:f,44:k,45:g},{33:[1,58]},{33:[1,59]},r(a,[2,118]),r(a,[2,36],{32:[1,60],35:[1,62],38:[1,61]}),{33:[1,63]},{33:[1,64],36:[1,65]},r(a,[2,22],{29:[1,66]}),r(a,[2,53],{32:[1,68],38:[1,67],42:[1,69]}),r(a,[2,54],{32:[1,71],35:[1,70],42:[1,72]}),r(E,[2,119]),r(E,[2,120]),r(E,[2,121]),r(a,[2,57],{35:[1,73],38:[1,74],42:[1,75]}),r(a,[2,68],{32:[1,78],35:[1,76],38:[1,77]}),{33:[1,79]},{39:80,43:f,44:k,45:g},{33:[1,81]},r(a,[2,24],{34:[1,82],35:[1,83]}),{32:[1,84]},{32:[1,85]},{30:[1,86]},{39:87,43:f,44:k,45:g},{33:[1,88]},{33:[1,89]},{33:[1,90]},{33:[1,91]},{33:[1,92]},{33:[1,93]},{39:94,43:f,44:k,45:g},{33:[1,95]},{33:[1,96]},{39:97,43:f,44:k,45:g},{33:[1,98]},r(a,[2,37],{35:[1,100],38:[1,99]}),r(a,[2,38],{32:[1,102],35:[1,101]}),r(a,[2,39],{32:[1,103],38:[1,104]}),{33:[1,105]},{33:[1,106],36:[1,107]},{33:[1,108]},{33:[1,109]},r(a,[2,23]),r(a,[2,55],{32:[1,110],42:[1,111]}),r(a,[2,59],{38:[1,112],42:[1,113]}),r(a,[2,69],{32:[1,115],38:[1,114]}),r(a,[2,56],{32:[1,116],42:[1,117]}),r(a,[2,61],{35:[1,118],42:[1,119]}),r(a,[2,72],{32:[1,121],35:[1,120]}),r(a,[2,58],{38:[1,122],42:[1,123]}),r(a,[2,60],{35:[1,124],42:[1,125]}),r(a,[2,73],{35:[1,127],38:[1,126]}),r(a,[2,70],{32:[1,129],38:[1,128]}),r(a,[2,71],{32:[1,131],35:[1,130]}),r(a,[2,74],{35:[1,133],38:[1,132]}),{39:134,43:f,44:k,45:g},{33:[1,135]},{33:[1,136]},{33:[1,137]},{33:[1,138]},{39:139,43:f,44:k,45:g},r(a,[2,25],{35:[1,140]}),r(a,[2,26],{34:[1,141]}),r(a,[2,31],{34:[1,142]}),r(a,[2,29],{34:[1,143]}),r(a,[2,30],{34:[1,144]}),{33:[1,145]},{33:[1,146]},{39:147,43:f,44:k,45:g},{33:[1,148]},{39:149,43:f,44:k,45:g},{33:[1,150]},{33:[1,151]},{33:[1,152]},{33:[1,153]},{33:[1,154]},{33:[1,155]},{33:[1,156]},{39:157,43:f,44:k,45:g},{33:[1,158]},{33:[1,159]},{33:[1,160]},{39:161,43:f,44:k,45:g},{33:[1,162]},{39:163,43:f,44:k,45:g},{33:[1,164]},{33:[1,165]},{33:[1,166]},{39:167,43:f,44:k,45:g},{33:[1,168]},r(a,[2,43],{35:[1,169]}),r(a,[2,44],{38:[1,170]}),r(a,[2,42],{32:[1,171]}),r(a,[2,45],{35:[1,172]}),r(a,[2,40],{38:[1,173]}),r(a,[2,41],{32:[1,174]}),{33:[1,175],36:[1,176]},{33:[1,177]},{33:[1,178]},{33:[1,179]},{33:[1,180]},r(a,[2,66],{42:[1,181]}),r(a,[2,79],{32:[1,182]}),r(a,[2,67],{42:[1,183]}),r(a,[2,90],{38:[1,184]}),r(a,[2,80],{32:[1,185]}),r(a,[2,89],{38:[1,186]}),r(a,[2,65],{42:[1,187]}),r(a,[2,78],{32:[1,188]}),r(a,[2,64],{42:[1,189]}),r(a,[2,84],{35:[1,190]}),r(a,[2,77],{32:[1,191]}),r(a,[2,83],{35:[1,192]}),r(a,[2,63],{42:[1,193]}),r(a,[2,91],{38:[1,194]}),r(a,[2,62],{42:[1,195]}),r(a,[2,85],{35:[1,196]}),r(a,[2,86],{35:[1,197]}),r(a,[2,92],{38:[1,198]}),r(a,[2,76],{32:[1,199]}),r(a,[2,87],{38:[1,200]}),r(a,[2,75],{32:[1,201]}),r(a,[2,81],{35:[1,202]}),r(a,[2,82],{35:[1,203]}),r(a,[2,88],{38:[1,204]}),{33:[1,205]},{39:206,43:f,44:k,45:g},{33:[1,207]},{33:[1,208]},{39:209,43:f,44:k,45:g},{33:[1,210]},r(a,[2,27]),r(a,[2,32]),r(a,[2,28]),r(a,[2,33]),r(a,[2,34]),r(a,[2,35]),{33:[1,211]},{33:[1,212]},{33:[1,213]},{39:214,43:f,44:k,45:g},{33:[1,215]},{39:216,43:f,44:k,45:g},{33:[1,217]},{33:[1,218]},{33:[1,219]},{33:[1,220]},{33:[1,221]},{33:[1,222]},{33:[1,223]},{39:224,43:f,44:k,45:g},{33:[1,225]},{33:[1,226]},{33:[1,227]},{39:228,43:f,44:k,45:g},{33:[1,229]},{39:230,43:f,44:k,45:g},{33:[1,231]},{33:[1,232]},{33:[1,233]},{39:234,43:f,44:k,45:g},r(a,[2,46]),r(a,[2,48]),r(a,[2,47]),r(a,[2,49]),r(a,[2,51]),r(a,[2,50]),r(a,[2,107]),r(a,[2,108]),r(a,[2,105]),r(a,[2,106]),r(a,[2,110]),r(a,[2,109]),r(a,[2,114]),r(a,[2,113]),r(a,[2,112]),r(a,[2,111]),r(a,[2,116]),r(a,[2,115]),r(a,[2,104]),r(a,[2,103]),r(a,[2,102]),r(a,[2,101]),r(a,[2,99]),r(a,[2,100]),r(a,[2,98]),r(a,[2,97]),r(a,[2,96]),r(a,[2,95]),r(a,[2,93]),r(a,[2,94])],defaultActions:{7:[2,1],13:[2,2],18:[2,3],36:[2,4]},parseError:function(o,u){if(u.recoverable)this.trace(o);else{var d=new Error(o);throw d.hash=u,d}},parse:function(o){var u=this,d=[0],s=[],T=[null],t=[],X=this.table,e="",rt=0,ft=0,wt=2,pt=1,Lt=t.slice.call(arguments,1),O=Object.create(this.lexer),F={yy:{}};for(var ct in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ct)&&(F.yy[ct]=this.yy[ct]);O.setInput(o,F.yy),F.yy.lexer=O,F.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var ot=O.yylloc;t.push(ot);var Rt=O.options&&O.options.ranges;typeof F.yy.parseError=="function"?this.parseError=F.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Mt(){var j;return j=s.pop()||O.lex()||pt,typeof j!="number"&&(j instanceof Array&&(s=j,j=s.pop()),j=u.symbols_[j]||j),j}for(var N,K,V,lt,J={},it,q,bt,st;;){if(K=d[d.length-1],this.defaultActions[K]?V=this.defaultActions[K]:((N===null||typeof N>"u")&&(N=Mt()),V=X[K]&&X[K][N]),typeof V>"u"||!V.length||!V[0]){var ht="";st=[];for(it in X[K])this.terminals_[it]&&it>wt&&st.push("'"+this.terminals_[it]+"'");O.showPosition?ht="Parse error on line "+(rt+1)+`:
|
|
1
|
+
import{n as vt,o as Ct,s as Ot,a as Pt,b as Gt,c as St,g as C,l as B,u as At,x as It,q as Nt,j as D,y as Ht}from"./index-_FyCDKGq.js";import{s as Bt}from"./Serializer-DPCLjt6U.js";import"./index-Ds1UcDjn.js";import"./isEmpty-BZ44SF3F.js";var mt=(function(){var r=function(S,o,u,d){for(u=u||{},d=S.length;d--;u[S[d]]=o);return u},n=[1,3],l=[1,6],h=[1,4],i=[1,5],c=[2,5],p=[1,12],m=[5,7,13,19,21,23,24,26,28,31,37,40,47],x=[7,13,19,21,23,24,26,28,31,37,40],y=[7,12,13,19,21,23,24,26,28,31,37,40],a=[7,13,47],R=[1,42],_=[1,41],b=[7,13,29,32,35,38,47],f=[1,55],k=[1,56],g=[1,57],E=[7,13,32,35,42,47],z={trace:function(){},yy:{},symbols_:{error:2,start:3,eol:4,GG:5,document:6,EOF:7,":":8,DIR:9,options:10,body:11,OPT:12,NL:13,line:14,statement:15,commitStatement:16,mergeStatement:17,cherryPickStatement:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,section:24,branchStatement:25,CHECKOUT:26,ref:27,BRANCH:28,ORDER:29,NUM:30,CHERRY_PICK:31,COMMIT_ID:32,STR:33,PARENT_COMMIT:34,COMMIT_TAG:35,EMPTYSTR:36,MERGE:37,COMMIT_TYPE:38,commitType:39,COMMIT:40,commit_arg:41,COMMIT_MSG:42,NORMAL:43,REVERSE:44,HIGHLIGHT:45,ID:46,";":47,$accept:0,$end:1},terminals_:{2:"error",5:"GG",7:"EOF",8:":",9:"DIR",12:"OPT",13:"NL",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"section",26:"CHECKOUT",28:"BRANCH",29:"ORDER",30:"NUM",31:"CHERRY_PICK",32:"COMMIT_ID",33:"STR",34:"PARENT_COMMIT",35:"COMMIT_TAG",36:"EMPTYSTR",37:"MERGE",38:"COMMIT_TYPE",40:"COMMIT",42:"COMMIT_MSG",43:"NORMAL",44:"REVERSE",45:"HIGHLIGHT",46:"ID",47:";"},productions_:[0,[3,2],[3,3],[3,4],[3,5],[6,0],[6,2],[10,2],[10,1],[11,0],[11,2],[14,2],[14,1],[15,1],[15,1],[15,1],[15,2],[15,2],[15,1],[15,1],[15,1],[15,2],[25,2],[25,4],[18,3],[18,5],[18,5],[18,7],[18,7],[18,5],[18,5],[18,5],[18,7],[18,7],[18,7],[18,7],[17,2],[17,4],[17,4],[17,4],[17,6],[17,6],[17,6],[17,6],[17,6],[17,6],[17,8],[17,8],[17,8],[17,8],[17,8],[17,8],[16,2],[16,3],[16,3],[16,5],[16,5],[16,3],[16,5],[16,5],[16,5],[16,5],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,3],[16,5],[16,5],[16,5],[16,5],[16,5],[16,5],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,7],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[16,9],[41,0],[41,1],[39,1],[39,1],[39,1],[27,1],[27,1],[4,1],[4,1],[4,1]],performAction:function(o,u,d,s,T,t,X){var e=t.length-1;switch(T){case 2:return t[e];case 3:return t[e-1];case 4:return s.setDirection(t[e-3]),t[e-1];case 6:s.setOptions(t[e-1]),this.$=t[e];break;case 7:t[e-1]+=t[e],this.$=t[e-1];break;case 9:this.$=[];break;case 10:t[e-1].push(t[e]),this.$=t[e-1];break;case 11:this.$=t[e-1];break;case 16:this.$=t[e].trim(),s.setAccTitle(this.$);break;case 17:case 18:this.$=t[e].trim(),s.setAccDescription(this.$);break;case 19:s.addSection(t[e].substr(8)),this.$=t[e].substr(8);break;case 21:s.checkout(t[e]);break;case 22:s.branch(t[e]);break;case 23:s.branch(t[e-2],t[e]);break;case 24:s.cherryPick(t[e],"",void 0);break;case 25:s.cherryPick(t[e-2],"",void 0,t[e]);break;case 26:s.cherryPick(t[e-2],"",t[e]);break;case 27:s.cherryPick(t[e-4],"",t[e],t[e-2]);break;case 28:s.cherryPick(t[e-4],"",t[e-2],t[e]);break;case 29:s.cherryPick(t[e],"",t[e-2]);break;case 30:s.cherryPick(t[e],"","");break;case 31:s.cherryPick(t[e-2],"","");break;case 32:s.cherryPick(t[e-4],"","",t[e-2]);break;case 33:s.cherryPick(t[e-4],"","",t[e]);break;case 34:s.cherryPick(t[e-2],"",t[e-4],t[e]);break;case 35:s.cherryPick(t[e-2],"","",t[e]);break;case 36:s.merge(t[e],"","","");break;case 37:s.merge(t[e-2],t[e],"","");break;case 38:s.merge(t[e-2],"",t[e],"");break;case 39:s.merge(t[e-2],"","",t[e]);break;case 40:s.merge(t[e-4],t[e],"",t[e-2]);break;case 41:s.merge(t[e-4],"",t[e],t[e-2]);break;case 42:s.merge(t[e-4],"",t[e-2],t[e]);break;case 43:s.merge(t[e-4],t[e-2],t[e],"");break;case 44:s.merge(t[e-4],t[e-2],"",t[e]);break;case 45:s.merge(t[e-4],t[e],t[e-2],"");break;case 46:s.merge(t[e-6],t[e-4],t[e-2],t[e]);break;case 47:s.merge(t[e-6],t[e],t[e-4],t[e-2]);break;case 48:s.merge(t[e-6],t[e-4],t[e],t[e-2]);break;case 49:s.merge(t[e-6],t[e-2],t[e-4],t[e]);break;case 50:s.merge(t[e-6],t[e],t[e-2],t[e-4]);break;case 51:s.merge(t[e-6],t[e-2],t[e],t[e-4]);break;case 52:s.commit(t[e]);break;case 53:s.commit("","",s.commitType.NORMAL,t[e]);break;case 54:s.commit("","",t[e],"");break;case 55:s.commit("","",t[e],t[e-2]);break;case 56:s.commit("","",t[e-2],t[e]);break;case 57:s.commit("",t[e],s.commitType.NORMAL,"");break;case 58:s.commit("",t[e-2],s.commitType.NORMAL,t[e]);break;case 59:s.commit("",t[e],s.commitType.NORMAL,t[e-2]);break;case 60:s.commit("",t[e-2],t[e],"");break;case 61:s.commit("",t[e],t[e-2],"");break;case 62:s.commit("",t[e-4],t[e-2],t[e]);break;case 63:s.commit("",t[e-4],t[e],t[e-2]);break;case 64:s.commit("",t[e-2],t[e-4],t[e]);break;case 65:s.commit("",t[e],t[e-4],t[e-2]);break;case 66:s.commit("",t[e],t[e-2],t[e-4]);break;case 67:s.commit("",t[e-2],t[e],t[e-4]);break;case 68:s.commit(t[e],"",s.commitType.NORMAL,"");break;case 69:s.commit(t[e],"",s.commitType.NORMAL,t[e-2]);break;case 70:s.commit(t[e-2],"",s.commitType.NORMAL,t[e]);break;case 71:s.commit(t[e-2],"",t[e],"");break;case 72:s.commit(t[e],"",t[e-2],"");break;case 73:s.commit(t[e],t[e-2],s.commitType.NORMAL,"");break;case 74:s.commit(t[e-2],t[e],s.commitType.NORMAL,"");break;case 75:s.commit(t[e-4],"",t[e-2],t[e]);break;case 76:s.commit(t[e-4],"",t[e],t[e-2]);break;case 77:s.commit(t[e-2],"",t[e-4],t[e]);break;case 78:s.commit(t[e],"",t[e-4],t[e-2]);break;case 79:s.commit(t[e],"",t[e-2],t[e-4]);break;case 80:s.commit(t[e-2],"",t[e],t[e-4]);break;case 81:s.commit(t[e-4],t[e],t[e-2],"");break;case 82:s.commit(t[e-4],t[e-2],t[e],"");break;case 83:s.commit(t[e-2],t[e],t[e-4],"");break;case 84:s.commit(t[e],t[e-2],t[e-4],"");break;case 85:s.commit(t[e],t[e-4],t[e-2],"");break;case 86:s.commit(t[e-2],t[e-4],t[e],"");break;case 87:s.commit(t[e-4],t[e],s.commitType.NORMAL,t[e-2]);break;case 88:s.commit(t[e-4],t[e-2],s.commitType.NORMAL,t[e]);break;case 89:s.commit(t[e-2],t[e],s.commitType.NORMAL,t[e-4]);break;case 90:s.commit(t[e],t[e-2],s.commitType.NORMAL,t[e-4]);break;case 91:s.commit(t[e],t[e-4],s.commitType.NORMAL,t[e-2]);break;case 92:s.commit(t[e-2],t[e-4],s.commitType.NORMAL,t[e]);break;case 93:s.commit(t[e-6],t[e-4],t[e-2],t[e]);break;case 94:s.commit(t[e-6],t[e-4],t[e],t[e-2]);break;case 95:s.commit(t[e-6],t[e-2],t[e-4],t[e]);break;case 96:s.commit(t[e-6],t[e],t[e-4],t[e-2]);break;case 97:s.commit(t[e-6],t[e-2],t[e],t[e-4]);break;case 98:s.commit(t[e-6],t[e],t[e-2],t[e-4]);break;case 99:s.commit(t[e-4],t[e-6],t[e-2],t[e]);break;case 100:s.commit(t[e-4],t[e-6],t[e],t[e-2]);break;case 101:s.commit(t[e-2],t[e-6],t[e-4],t[e]);break;case 102:s.commit(t[e],t[e-6],t[e-4],t[e-2]);break;case 103:s.commit(t[e-2],t[e-6],t[e],t[e-4]);break;case 104:s.commit(t[e],t[e-6],t[e-2],t[e-4]);break;case 105:s.commit(t[e],t[e-4],t[e-2],t[e-6]);break;case 106:s.commit(t[e-2],t[e-4],t[e],t[e-6]);break;case 107:s.commit(t[e],t[e-2],t[e-4],t[e-6]);break;case 108:s.commit(t[e-2],t[e],t[e-4],t[e-6]);break;case 109:s.commit(t[e-4],t[e-2],t[e],t[e-6]);break;case 110:s.commit(t[e-4],t[e],t[e-2],t[e-6]);break;case 111:s.commit(t[e-2],t[e-4],t[e-6],t[e]);break;case 112:s.commit(t[e],t[e-4],t[e-6],t[e-2]);break;case 113:s.commit(t[e-2],t[e],t[e-6],t[e-4]);break;case 114:s.commit(t[e],t[e-2],t[e-6],t[e-4]);break;case 115:s.commit(t[e-4],t[e-2],t[e-6],t[e]);break;case 116:s.commit(t[e-4],t[e],t[e-6],t[e-2]);break;case 117:this.$="";break;case 118:this.$=t[e];break;case 119:this.$=s.commitType.NORMAL;break;case 120:this.$=s.commitType.REVERSE;break;case 121:this.$=s.commitType.HIGHLIGHT;break}},table:[{3:1,4:2,5:n,7:l,13:h,47:i},{1:[3]},{3:7,4:2,5:n,7:l,13:h,47:i},{6:8,7:c,8:[1,9],9:[1,10],10:11,13:p},r(m,[2,124]),r(m,[2,125]),r(m,[2,126]),{1:[2,1]},{7:[1,13]},{6:14,7:c,10:11,13:p},{8:[1,15]},r(x,[2,9],{11:16,12:[1,17]}),r(y,[2,8]),{1:[2,2]},{7:[1,18]},{6:19,7:c,10:11,13:p},{7:[2,6],13:[1,22],14:20,15:21,16:23,17:24,18:25,19:[1,26],21:[1,27],23:[1,28],24:[1,29],25:30,26:[1,31],28:[1,35],31:[1,34],37:[1,33],40:[1,32]},r(y,[2,7]),{1:[2,3]},{7:[1,36]},r(x,[2,10]),{4:37,7:l,13:h,47:i},r(x,[2,12]),r(a,[2,13]),r(a,[2,14]),r(a,[2,15]),{20:[1,38]},{22:[1,39]},r(a,[2,18]),r(a,[2,19]),r(a,[2,20]),{27:40,33:R,46:_},r(a,[2,117],{41:43,32:[1,46],33:[1,48],35:[1,44],38:[1,45],42:[1,47]}),{27:49,33:R,46:_},{32:[1,50],35:[1,51]},{27:52,33:R,46:_},{1:[2,4]},r(x,[2,11]),r(a,[2,16]),r(a,[2,17]),r(a,[2,21]),r(b,[2,122]),r(b,[2,123]),r(a,[2,52]),{33:[1,53]},{39:54,43:f,44:k,45:g},{33:[1,58]},{33:[1,59]},r(a,[2,118]),r(a,[2,36],{32:[1,60],35:[1,62],38:[1,61]}),{33:[1,63]},{33:[1,64],36:[1,65]},r(a,[2,22],{29:[1,66]}),r(a,[2,53],{32:[1,68],38:[1,67],42:[1,69]}),r(a,[2,54],{32:[1,71],35:[1,70],42:[1,72]}),r(E,[2,119]),r(E,[2,120]),r(E,[2,121]),r(a,[2,57],{35:[1,73],38:[1,74],42:[1,75]}),r(a,[2,68],{32:[1,78],35:[1,76],38:[1,77]}),{33:[1,79]},{39:80,43:f,44:k,45:g},{33:[1,81]},r(a,[2,24],{34:[1,82],35:[1,83]}),{32:[1,84]},{32:[1,85]},{30:[1,86]},{39:87,43:f,44:k,45:g},{33:[1,88]},{33:[1,89]},{33:[1,90]},{33:[1,91]},{33:[1,92]},{33:[1,93]},{39:94,43:f,44:k,45:g},{33:[1,95]},{33:[1,96]},{39:97,43:f,44:k,45:g},{33:[1,98]},r(a,[2,37],{35:[1,100],38:[1,99]}),r(a,[2,38],{32:[1,102],35:[1,101]}),r(a,[2,39],{32:[1,103],38:[1,104]}),{33:[1,105]},{33:[1,106],36:[1,107]},{33:[1,108]},{33:[1,109]},r(a,[2,23]),r(a,[2,55],{32:[1,110],42:[1,111]}),r(a,[2,59],{38:[1,112],42:[1,113]}),r(a,[2,69],{32:[1,115],38:[1,114]}),r(a,[2,56],{32:[1,116],42:[1,117]}),r(a,[2,61],{35:[1,118],42:[1,119]}),r(a,[2,72],{32:[1,121],35:[1,120]}),r(a,[2,58],{38:[1,122],42:[1,123]}),r(a,[2,60],{35:[1,124],42:[1,125]}),r(a,[2,73],{35:[1,127],38:[1,126]}),r(a,[2,70],{32:[1,129],38:[1,128]}),r(a,[2,71],{32:[1,131],35:[1,130]}),r(a,[2,74],{35:[1,133],38:[1,132]}),{39:134,43:f,44:k,45:g},{33:[1,135]},{33:[1,136]},{33:[1,137]},{33:[1,138]},{39:139,43:f,44:k,45:g},r(a,[2,25],{35:[1,140]}),r(a,[2,26],{34:[1,141]}),r(a,[2,31],{34:[1,142]}),r(a,[2,29],{34:[1,143]}),r(a,[2,30],{34:[1,144]}),{33:[1,145]},{33:[1,146]},{39:147,43:f,44:k,45:g},{33:[1,148]},{39:149,43:f,44:k,45:g},{33:[1,150]},{33:[1,151]},{33:[1,152]},{33:[1,153]},{33:[1,154]},{33:[1,155]},{33:[1,156]},{39:157,43:f,44:k,45:g},{33:[1,158]},{33:[1,159]},{33:[1,160]},{39:161,43:f,44:k,45:g},{33:[1,162]},{39:163,43:f,44:k,45:g},{33:[1,164]},{33:[1,165]},{33:[1,166]},{39:167,43:f,44:k,45:g},{33:[1,168]},r(a,[2,43],{35:[1,169]}),r(a,[2,44],{38:[1,170]}),r(a,[2,42],{32:[1,171]}),r(a,[2,45],{35:[1,172]}),r(a,[2,40],{38:[1,173]}),r(a,[2,41],{32:[1,174]}),{33:[1,175],36:[1,176]},{33:[1,177]},{33:[1,178]},{33:[1,179]},{33:[1,180]},r(a,[2,66],{42:[1,181]}),r(a,[2,79],{32:[1,182]}),r(a,[2,67],{42:[1,183]}),r(a,[2,90],{38:[1,184]}),r(a,[2,80],{32:[1,185]}),r(a,[2,89],{38:[1,186]}),r(a,[2,65],{42:[1,187]}),r(a,[2,78],{32:[1,188]}),r(a,[2,64],{42:[1,189]}),r(a,[2,84],{35:[1,190]}),r(a,[2,77],{32:[1,191]}),r(a,[2,83],{35:[1,192]}),r(a,[2,63],{42:[1,193]}),r(a,[2,91],{38:[1,194]}),r(a,[2,62],{42:[1,195]}),r(a,[2,85],{35:[1,196]}),r(a,[2,86],{35:[1,197]}),r(a,[2,92],{38:[1,198]}),r(a,[2,76],{32:[1,199]}),r(a,[2,87],{38:[1,200]}),r(a,[2,75],{32:[1,201]}),r(a,[2,81],{35:[1,202]}),r(a,[2,82],{35:[1,203]}),r(a,[2,88],{38:[1,204]}),{33:[1,205]},{39:206,43:f,44:k,45:g},{33:[1,207]},{33:[1,208]},{39:209,43:f,44:k,45:g},{33:[1,210]},r(a,[2,27]),r(a,[2,32]),r(a,[2,28]),r(a,[2,33]),r(a,[2,34]),r(a,[2,35]),{33:[1,211]},{33:[1,212]},{33:[1,213]},{39:214,43:f,44:k,45:g},{33:[1,215]},{39:216,43:f,44:k,45:g},{33:[1,217]},{33:[1,218]},{33:[1,219]},{33:[1,220]},{33:[1,221]},{33:[1,222]},{33:[1,223]},{39:224,43:f,44:k,45:g},{33:[1,225]},{33:[1,226]},{33:[1,227]},{39:228,43:f,44:k,45:g},{33:[1,229]},{39:230,43:f,44:k,45:g},{33:[1,231]},{33:[1,232]},{33:[1,233]},{39:234,43:f,44:k,45:g},r(a,[2,46]),r(a,[2,48]),r(a,[2,47]),r(a,[2,49]),r(a,[2,51]),r(a,[2,50]),r(a,[2,107]),r(a,[2,108]),r(a,[2,105]),r(a,[2,106]),r(a,[2,110]),r(a,[2,109]),r(a,[2,114]),r(a,[2,113]),r(a,[2,112]),r(a,[2,111]),r(a,[2,116]),r(a,[2,115]),r(a,[2,104]),r(a,[2,103]),r(a,[2,102]),r(a,[2,101]),r(a,[2,99]),r(a,[2,100]),r(a,[2,98]),r(a,[2,97]),r(a,[2,96]),r(a,[2,95]),r(a,[2,93]),r(a,[2,94])],defaultActions:{7:[2,1],13:[2,2],18:[2,3],36:[2,4]},parseError:function(o,u){if(u.recoverable)this.trace(o);else{var d=new Error(o);throw d.hash=u,d}},parse:function(o){var u=this,d=[0],s=[],T=[null],t=[],X=this.table,e="",rt=0,ft=0,wt=2,pt=1,Lt=t.slice.call(arguments,1),O=Object.create(this.lexer),F={yy:{}};for(var ct in this.yy)Object.prototype.hasOwnProperty.call(this.yy,ct)&&(F.yy[ct]=this.yy[ct]);O.setInput(o,F.yy),F.yy.lexer=O,F.yy.parser=this,typeof O.yylloc>"u"&&(O.yylloc={});var ot=O.yylloc;t.push(ot);var Rt=O.options&&O.options.ranges;typeof F.yy.parseError=="function"?this.parseError=F.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Mt(){var j;return j=s.pop()||O.lex()||pt,typeof j!="number"&&(j instanceof Array&&(s=j,j=s.pop()),j=u.symbols_[j]||j),j}for(var N,K,V,lt,J={},it,q,bt,st;;){if(K=d[d.length-1],this.defaultActions[K]?V=this.defaultActions[K]:((N===null||typeof N>"u")&&(N=Mt()),V=X[K]&&X[K][N]),typeof V>"u"||!V.length||!V[0]){var ht="";st=[];for(it in X[K])this.terminals_[it]&&it>wt&&st.push("'"+this.terminals_[it]+"'");O.showPosition?ht="Parse error on line "+(rt+1)+`:
|
|
2
2
|
`+O.showPosition()+`
|
|
3
3
|
Expecting `+st.join(", ")+", got '"+(this.terminals_[N]||N)+"'":ht="Parse error on line "+(rt+1)+": Unexpected "+(N==pt?"end of input":"'"+(this.terminals_[N]||N)+"'"),this.parseError(ht,{text:O.match,token:this.terminals_[N]||N,line:O.yylineno,loc:ot,expected:st})}if(V[0]instanceof Array&&V.length>1)throw new Error("Parse Error: multiple actions possible at state: "+K+", token: "+N);switch(V[0]){case 1:d.push(N),T.push(O.yytext),t.push(O.yylloc),d.push(V[1]),N=null,ft=O.yyleng,e=O.yytext,rt=O.yylineno,ot=O.yylloc;break;case 2:if(q=this.productions_[V[1]][1],J.$=T[T.length-q],J._$={first_line:t[t.length-(q||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(q||1)].first_column,last_column:t[t.length-1].last_column},Rt&&(J._$.range=[t[t.length-(q||1)].range[0],t[t.length-1].range[1]]),lt=this.performAction.apply(J,[e,ft,rt,F.yy,V[1],T,t].concat(Lt)),typeof lt<"u")return lt;q&&(d=d.slice(0,-1*q*2),T=T.slice(0,-1*q),t=t.slice(0,-1*q)),d.push(this.productions_[V[1]][0]),T.push(J.$),t.push(J._$),bt=X[d[d.length-2]][d[d.length-1]],d.push(bt);break;case 3:return!0}}return!0}},M=(function(){var S={EOF:1,parseError:function(u,d){if(this.yy.parser)this.yy.parser.parseError(u,d);else throw new Error(u)},setInput:function(o,u){return this.yy=u||this.yy||{},this._input=o,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},input:function(){var o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var u=o.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},unput:function(o){var u=o.length,d=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var s=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),d.length-1&&(this.yylineno-=d.length-1);var T=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:d?(d.length===s.length?this.yylloc.first_column:0)+s[s.length-d.length].length-d[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[T[0],T[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject: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},less:function(o){this.unput(this.match.slice(o))},pastInput:function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var o=this.pastInput(),u=new Array(o.length+1).join("-");return o+this.upcomingInput()+`
|
package/assets/{gitGraphDiagram-NY62KEGX-BHeKaPX4.js → gitGraphDiagram-NY62KEGX-C-FRyLSQ.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as Z}from"./chunk-4BX2VUAB-c4TqXEDY.js";import{I as F}from"./chunk-QZHKN3VN-CHMAVu-X.js";import{_ as h,q as U,p as rr,s as er,g as tr,a as ar,b as nr,l as m,c as sr,u as or,B as cr,y as ir,j as B,C as dr,D as hr,E as lr,F as $r}from"./mermaid.core-KMjnbwgP.js";import{p as fr}from"./treemap-KMMF4GRG-BT1Q5_WZ.js";import{s as gr}from"./Serializer-Cg6t80B7.js";import"./index-BWxm5yOF.js";import"./line-CywZXhHj.js";import"./array-BKyUJesY.js";import"./path-CbwjOpE9.js";import"./isEmpty-Cp2Tv4FQ.js";import"./min-Bc3x3akU.js";import"./_baseUniq-BjMbNK7A.js";import"./hasIn-C2tUur8R.js";var x={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},yr=lr.gitGraph,z=h(()=>dr({...yr,...hr().gitGraph}),"getConfig"),i=new F(()=>{const t=z(),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 j(){return $r({length:7})}h(j,"getID");function N(t,r){const a=Object.create(null);return t.reduce((s,e)=>{const n=r(e);return a[n]||(a[n]=!0,s.push(e)),s},[])}h(N,"uniqBy");var pr=h(function(t){i.records.direction=t},"setDirection"),xr=h(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"),ur=h(function(){return i.records.options},"getOptions"),br=h(function(t){let r=t.msg,a=t.id;const s=t.type;let e=t.tags;m.info("commit",r,a,s,e),m.debug("Entering commit:",r,a,s,e);const n=z();a=B.sanitizeText(a,n),r=B.sanitizeText(r,n),e=e==null?void 0:e.map(o=>B.sanitizeText(o,n));const c={id:a||i.records.seq+"-"+j(),message:r,seq:i.records.seq++,type:s??x.NORMAL,tags:e??[],parents:i.records.head==null?[]:[i.records.head.id],branch:i.records.currBranch};i.records.head=c,m.info("main branch",n.mainBranchName),i.records.commits.has(c.id)&&m.warn(`Commit ID ${c.id} already exists`),i.records.commits.set(c.id,c),i.records.branches.set(i.records.currBranch,c.id),m.debug("in pushCommit "+c.id)},"commit"),mr=h(function(t){let r=t.name;const a=t.order;if(r=B.sanitizeText(r,z()),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}),_(r),m.debug("in createBranch")},"branch"),wr=h(t=>{let r=t.branch,a=t.id;const s=t.type,e=t.tags,n=z();r=B.sanitizeText(r,n),a&&(a=B.sanitizeText(a,n));const c=i.records.branches.get(i.records.currBranch),o=i.records.branches.get(r),$=c?i.records.commits.get(c):void 0,l=o?i.records.commits.get(o):void 0;if($&&l&&$.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(i.records.currBranch===r){const d=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},d}if($===void 0||!$){const d=new Error(`Incorrect usage of "merge". Current branch (${i.records.currBranch})has no commits`);throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},d}if(!i.records.branches.has(r)){const d=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},d}if(l===void 0||!l){const d=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},d}if($===l){const d=new Error('Incorrect usage of "merge". Both branches have same head');throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},d}if(a&&i.records.commits.has(a)){const d=new Error('Incorrect usage of "merge". Commit with id:'+a+" already exists, use different custom id");throw d.hash={text:`merge ${r} ${a} ${s} ${e==null?void 0:e.join(" ")}`,token:`merge ${r} ${a} ${s} ${e==null?void 0:e.join(" ")}`,expected:[`merge ${r} ${a}_UNIQUE ${s} ${e==null?void 0:e.join(" ")}`]},d}const f=o||"",g={id:a||`${i.records.seq}-${j()}`,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:x.MERGE,customType:s,customId:!!a,tags:e??[]};i.records.head=g,i.records.commits.set(g.id,g),i.records.branches.set(i.records.currBranch,g.id),m.debug(i.records.branches),m.debug("in mergeBranch")},"merge"),vr=h(function(t){let r=t.id,a=t.targetId,s=t.tags,e=t.parent;m.debug("Entering cherryPick:",r,a,s);const n=z();if(r=B.sanitizeText(r,n),a=B.sanitizeText(a,n),s=s==null?void 0:s.map($=>B.sanitizeText($,n)),e=B.sanitizeText(e,n),!r||!i.records.commits.has(r)){const $=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw $.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},$}const c=i.records.commits.get(r);if(c===void 0||!c)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(e&&!(Array.isArray(c.parents)&&c.parents.includes(e)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const o=c.branch;if(c.type===x.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(o===i.records.currBranch){const g=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw g.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},g}const $=i.records.branches.get(i.records.currBranch);if($===void 0||!$){const g=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw g.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},g}const l=i.records.commits.get($);if(l===void 0||!l){const g=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw g.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},g}const f={id:i.records.seq+"-"+j(),message:`cherry-picked ${c==null?void 0:c.message} into ${i.records.currBranch}`,seq:i.records.seq++,parents:i.records.head==null?[]:[i.records.head.id,c.id],branch:i.records.currBranch,type:x.CHERRY_PICK,tags:s?s.filter(Boolean):[`cherry-pick:${c.id}${c.type===x.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"),_=h(function(t){if(t=B.sanitizeText(t,z()),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 s=t.indexOf(r);s===-1?t.push(a):t.splice(s,1,a)}h(D,"upsert");function A(t){const r=t.reduce((e,n)=>e.seq>n.seq?e:n,t[0]);let a="";t.forEach(function(e){e===r?a+=" *":a+=" |"});const s=[a,r.id,r.seq];for(const e in i.records.branches)i.records.branches.get(e)===r.id&&s.push(e);if(m.debug(s.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=N(t,e=>e.id),A(t)}h(A,"prettyPrintCommitHistory");var Cr=h(function(){m.debug(i.records.commits);const t=V()[0];A([t])},"prettyPrint"),Er=h(function(){i.reset(),ir()},"clear"),Br=h(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"),kr=h(function(){return i.records.branches},"getBranches"),Lr=h(function(){return i.records.commits},"getCommits"),V=h(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"),Tr=h(function(){return i.records.currBranch},"getCurrentBranch"),Mr=h(function(){return i.records.direction},"getDirection"),Rr=h(function(){return i.records.head},"getHead"),X={commitType:x,getConfig:z,setDirection:pr,setOptions:xr,getOptions:ur,commit:br,branch:mr,merge:wr,cherryPick:vr,checkout:_,prettyPrint:Cr,clear:Er,getBranchesAsObjArray:Br,getBranches:kr,getCommits:Lr,getCommitsArray:V,getCurrentBranch:Tr,getDirection:Mr,getHead:Rr,setAccTitle:nr,getAccTitle:ar,getAccDescription:tr,setAccDescription:er,setDiagramTitle:rr,getDiagramTitle:U},Ir=h((t,r)=>{Z(t,r),t.dir&&r.setDirection(t.dir);for(const a of t.statements)qr(a,r)},"populate"),qr=h((t,r)=>{const s={Commit:h(e=>r.commit(Or(e)),"Commit"),Branch:h(e=>r.branch(zr(e)),"Branch"),Merge:h(e=>r.merge(Gr(e)),"Merge"),Checkout:h(e=>r.checkout(Hr(e)),"Checkout"),CherryPicking:h(e=>r.cherryPick(Pr(e)),"CherryPicking")}[t.$type];s?s(t):m.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),Or=h(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?x[t.type]:x.NORMAL,tags:t.tags??void 0}),"parseCommit"),zr=h(t=>({name:t.name,order:t.order??0}),"parseBranch"),Gr=h(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?x[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),Hr=h(t=>t.branch,"parseCheckout"),Pr=h(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"),Wr={parse:h(async t=>{const r=await fr("gitGraph",t);m.debug(r),Ir(r,X)},"parse")},S=sr(),b=S==null?void 0:S.gitGraph,R=10,I=40,k=4,L=2,O=8,C=new Map,E=new Map,P=30,G=new Map,W=[],M=0,p="LR",jr=h(()=>{C.clear(),E.clear(),G.clear(),M=0,W=[],p="LR"},"clear"),J=h(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(s=>{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=s.trim(),r.appendChild(e)}),r},"drawText"),Q=h(t=>{let r,a,s;return p==="BT"?(a=h((e,n)=>e<=n,"comparisonFunc"),s=1/0):(a=h((e,n)=>e>=n,"comparisonFunc"),s=0),t.forEach(e=>{var c,o;const n=p==="TB"||p=="BT"?(c=E.get(e))==null?void 0:c.y:(o=E.get(e))==null?void 0:o.x;n!==void 0&&a(n,s)&&(r=e,s=n)}),r},"findClosestParent"),Sr=h(t=>{let r="",a=1/0;return t.forEach(s=>{const e=E.get(s).y;e<=a&&(r=s,a=e)}),r||void 0},"findClosestParentBT"),Dr=h((t,r,a)=>{let s=a,e=a;const n=[];t.forEach(c=>{const o=r.get(c);if(!o)throw new Error(`Commit not found for key ${c}`);o.parents.length?(s=Yr(o),e=Math.max(s,e)):n.push(o),Kr(o,s)}),s=e,n.forEach(c=>{Nr(c,s,a)}),t.forEach(c=>{const o=r.get(c);if(o!=null&&o.parents.length){const $=Sr(o.parents);s=E.get($).y-I,s<=e&&(e=s);const l=C.get(o.branch).pos,f=s-R;E.set(o.id,{x:l,y:f})}})},"setParallelBTPos"),Ar=h(t=>{var s;const r=Q(t.parents.filter(e=>e!==null));if(!r)throw new Error(`Closest parent not found for commit ${t.id}`);const a=(s=E.get(r))==null?void 0:s.y;if(a===void 0)throw new Error(`Closest parent position not found for commit ${t.id}`);return a},"findClosestParentPos"),Yr=h(t=>Ar(t)+I,"calculateCommitPosition"),Kr=h((t,r)=>{const a=C.get(t.branch);if(!a)throw new Error(`Branch not found for commit ${t.id}`);const s=a.pos,e=r+R;return E.set(t.id,{x:s,y:e}),{x:s,y:e}},"setCommitPosition"),Nr=h((t,r,a)=>{const s=C.get(t.branch);if(!s)throw new Error(`Branch not found for commit ${t.id}`);const e=r+a,n=s.pos;E.set(t.id,{x:n,y:e})},"setRootPosition"),_r=h((t,r,a,s,e,n)=>{if(n===x.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} ${s}-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} ${s}-inner`);else if(n===x.CHERRY_PICK)t.append("circle").attr("cx",a.x).attr("cy",a.y).attr("r",10).attr("class",`commit ${r.id} ${s}`),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} ${s}`),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} ${s}`),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} ${s}`),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} ${s}`);else{const c=t.append("circle");if(c.attr("cx",a.x),c.attr("cy",a.y),c.attr("r",r.type===x.MERGE?9:10),c.attr("class",`commit ${r.id} commit${e%O}`),n===x.MERGE){const o=t.append("circle");o.attr("cx",a.x),o.attr("cy",a.y),o.attr("r",6),o.attr("class",`commit ${s} ${r.id} commit${e%O}`)}n===x.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 ${s} ${r.id} commit${e%O}`)}},"drawCommitBullet"),Vr=h((t,r,a,s)=>{var e;if(r.type!==x.CHERRY_PICK&&(r.customId&&r.type===x.MERGE||r.type!==x.MERGE)&&(b!=null&&b.showCommitLabel)){const n=t.append("g"),c=n.insert("rect").attr("class","commit-label-bkg"),o=n.append("text").attr("x",s).attr("y",a.y+25).attr("class","commit-label").text(r.id),$=(e=o.node())==null?void 0:e.getBBox();if($&&(c.attr("x",a.posWithOffset-$.width/2-L).attr("y",a.y+13.5).attr("width",$.width+2*L).attr("height",$.height+2*L),p==="TB"||p==="BT"?(c.attr("x",a.x-($.width+4*k+5)).attr("y",a.y-12),o.attr("x",a.x-($.width+4*k)).attr("y",a.y+$.height-12)):o.attr("x",a.posWithOffset-$.width/2),b.rotateCommitLabel))if(p==="TB"||p==="BT")o.attr("transform","rotate(-45, "+a.x+", "+a.y+")"),c.attr("transform","rotate(-45, "+a.x+", "+a.y+")");else{const l=-7.5-($.width+10)/25*9.5,f=10+$.width/25*8.5;n.attr("transform","translate("+l+", "+f+") rotate(-45, "+s+", "+a.y+")")}}},"drawCommitLabel"),Xr=h((t,r,a,s)=>{var e;if(r.tags.length>0){let n=0,c=0,o=0;const $=[];for(const l of r.tags.reverse()){const f=t.insert("polygon"),g=t.append("circle"),d=t.append("text").attr("y",a.y-16-n).attr("class","tag-label").text(l),y=(e=d.node())==null?void 0:e.getBBox();if(!y)throw new Error("Tag bbox not found");c=Math.max(c,y.width),o=Math.max(o,y.height),d.attr("x",a.posWithOffset-y.width/2),$.push({tag:d,hole:g,rect:f,yOffset:n}),n+=20}for(const{tag:l,hole:f,rect:g,yOffset:d}of $){const y=o/2,u=a.y-19.2-d;if(g.attr("class","tag-label-bkg").attr("points",`
|
|
1
|
+
import{p as Z}from"./chunk-4BX2VUAB-DH-I_3Sl.js";import{I as F}from"./chunk-QZHKN3VN-Ei6ogyMg.js";import{_ as h,q as U,p as rr,s as er,g as tr,a as ar,b as nr,l as m,c as sr,u as or,B as cr,y as ir,j as B,C as dr,D as hr,E as lr,F as $r}from"./mermaid.core-ruaJ9d8x.js";import{p as fr}from"./treemap-KMMF4GRG-1nrNbz-r.js";import{s as gr}from"./Serializer-DPCLjt6U.js";import"./index-Ds1UcDjn.js";import"./line-B3fXWiyE.js";import"./array-BKyUJesY.js";import"./path-CbwjOpE9.js";import"./isEmpty-BZ44SF3F.js";import"./min-B6fh4WRE.js";import"./_baseUniq-CHS3E5If.js";import"./hasIn-CGUnHN5L.js";var x={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4},yr=lr.gitGraph,z=h(()=>dr({...yr,...hr().gitGraph}),"getConfig"),i=new F(()=>{const t=z(),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 j(){return $r({length:7})}h(j,"getID");function N(t,r){const a=Object.create(null);return t.reduce((s,e)=>{const n=r(e);return a[n]||(a[n]=!0,s.push(e)),s},[])}h(N,"uniqBy");var pr=h(function(t){i.records.direction=t},"setDirection"),xr=h(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"),ur=h(function(){return i.records.options},"getOptions"),br=h(function(t){let r=t.msg,a=t.id;const s=t.type;let e=t.tags;m.info("commit",r,a,s,e),m.debug("Entering commit:",r,a,s,e);const n=z();a=B.sanitizeText(a,n),r=B.sanitizeText(r,n),e=e==null?void 0:e.map(o=>B.sanitizeText(o,n));const c={id:a||i.records.seq+"-"+j(),message:r,seq:i.records.seq++,type:s??x.NORMAL,tags:e??[],parents:i.records.head==null?[]:[i.records.head.id],branch:i.records.currBranch};i.records.head=c,m.info("main branch",n.mainBranchName),i.records.commits.has(c.id)&&m.warn(`Commit ID ${c.id} already exists`),i.records.commits.set(c.id,c),i.records.branches.set(i.records.currBranch,c.id),m.debug("in pushCommit "+c.id)},"commit"),mr=h(function(t){let r=t.name;const a=t.order;if(r=B.sanitizeText(r,z()),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}),_(r),m.debug("in createBranch")},"branch"),wr=h(t=>{let r=t.branch,a=t.id;const s=t.type,e=t.tags,n=z();r=B.sanitizeText(r,n),a&&(a=B.sanitizeText(a,n));const c=i.records.branches.get(i.records.currBranch),o=i.records.branches.get(r),$=c?i.records.commits.get(c):void 0,l=o?i.records.commits.get(o):void 0;if($&&l&&$.branch===r)throw new Error(`Cannot merge branch '${r}' into itself.`);if(i.records.currBranch===r){const d=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},d}if($===void 0||!$){const d=new Error(`Incorrect usage of "merge". Current branch (${i.records.currBranch})has no commits`);throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["commit"]},d}if(!i.records.branches.has(r)){const d=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") does not exist");throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:[`branch ${r}`]},d}if(l===void 0||!l){const d=new Error('Incorrect usage of "merge". Branch to be merged ('+r+") has no commits");throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:['"commit"']},d}if($===l){const d=new Error('Incorrect usage of "merge". Both branches have same head');throw d.hash={text:`merge ${r}`,token:`merge ${r}`,expected:["branch abc"]},d}if(a&&i.records.commits.has(a)){const d=new Error('Incorrect usage of "merge". Commit with id:'+a+" already exists, use different custom id");throw d.hash={text:`merge ${r} ${a} ${s} ${e==null?void 0:e.join(" ")}`,token:`merge ${r} ${a} ${s} ${e==null?void 0:e.join(" ")}`,expected:[`merge ${r} ${a}_UNIQUE ${s} ${e==null?void 0:e.join(" ")}`]},d}const f=o||"",g={id:a||`${i.records.seq}-${j()}`,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:x.MERGE,customType:s,customId:!!a,tags:e??[]};i.records.head=g,i.records.commits.set(g.id,g),i.records.branches.set(i.records.currBranch,g.id),m.debug(i.records.branches),m.debug("in mergeBranch")},"merge"),vr=h(function(t){let r=t.id,a=t.targetId,s=t.tags,e=t.parent;m.debug("Entering cherryPick:",r,a,s);const n=z();if(r=B.sanitizeText(r,n),a=B.sanitizeText(a,n),s=s==null?void 0:s.map($=>B.sanitizeText($,n)),e=B.sanitizeText(e,n),!r||!i.records.commits.has(r)){const $=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');throw $.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},$}const c=i.records.commits.get(r);if(c===void 0||!c)throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');if(e&&!(Array.isArray(c.parents)&&c.parents.includes(e)))throw new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");const o=c.branch;if(c.type===x.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(o===i.records.currBranch){const g=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');throw g.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},g}const $=i.records.branches.get(i.records.currBranch);if($===void 0||!$){const g=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw g.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},g}const l=i.records.commits.get($);if(l===void 0||!l){const g=new Error(`Incorrect usage of "cherry-pick". Current branch (${i.records.currBranch})has no commits`);throw g.hash={text:`cherryPick ${r} ${a}`,token:`cherryPick ${r} ${a}`,expected:["cherry-pick abc"]},g}const f={id:i.records.seq+"-"+j(),message:`cherry-picked ${c==null?void 0:c.message} into ${i.records.currBranch}`,seq:i.records.seq++,parents:i.records.head==null?[]:[i.records.head.id,c.id],branch:i.records.currBranch,type:x.CHERRY_PICK,tags:s?s.filter(Boolean):[`cherry-pick:${c.id}${c.type===x.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"),_=h(function(t){if(t=B.sanitizeText(t,z()),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 s=t.indexOf(r);s===-1?t.push(a):t.splice(s,1,a)}h(D,"upsert");function A(t){const r=t.reduce((e,n)=>e.seq>n.seq?e:n,t[0]);let a="";t.forEach(function(e){e===r?a+=" *":a+=" |"});const s=[a,r.id,r.seq];for(const e in i.records.branches)i.records.branches.get(e)===r.id&&s.push(e);if(m.debug(s.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=N(t,e=>e.id),A(t)}h(A,"prettyPrintCommitHistory");var Cr=h(function(){m.debug(i.records.commits);const t=V()[0];A([t])},"prettyPrint"),Er=h(function(){i.reset(),ir()},"clear"),Br=h(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"),kr=h(function(){return i.records.branches},"getBranches"),Lr=h(function(){return i.records.commits},"getCommits"),V=h(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"),Tr=h(function(){return i.records.currBranch},"getCurrentBranch"),Mr=h(function(){return i.records.direction},"getDirection"),Rr=h(function(){return i.records.head},"getHead"),X={commitType:x,getConfig:z,setDirection:pr,setOptions:xr,getOptions:ur,commit:br,branch:mr,merge:wr,cherryPick:vr,checkout:_,prettyPrint:Cr,clear:Er,getBranchesAsObjArray:Br,getBranches:kr,getCommits:Lr,getCommitsArray:V,getCurrentBranch:Tr,getDirection:Mr,getHead:Rr,setAccTitle:nr,getAccTitle:ar,getAccDescription:tr,setAccDescription:er,setDiagramTitle:rr,getDiagramTitle:U},Ir=h((t,r)=>{Z(t,r),t.dir&&r.setDirection(t.dir);for(const a of t.statements)qr(a,r)},"populate"),qr=h((t,r)=>{const s={Commit:h(e=>r.commit(Or(e)),"Commit"),Branch:h(e=>r.branch(zr(e)),"Branch"),Merge:h(e=>r.merge(Gr(e)),"Merge"),Checkout:h(e=>r.checkout(Hr(e)),"Checkout"),CherryPicking:h(e=>r.cherryPick(Pr(e)),"CherryPicking")}[t.$type];s?s(t):m.error(`Unknown statement type: ${t.$type}`)},"parseStatement"),Or=h(t=>({id:t.id,msg:t.message??"",type:t.type!==void 0?x[t.type]:x.NORMAL,tags:t.tags??void 0}),"parseCommit"),zr=h(t=>({name:t.name,order:t.order??0}),"parseBranch"),Gr=h(t=>({branch:t.branch,id:t.id??"",type:t.type!==void 0?x[t.type]:void 0,tags:t.tags??void 0}),"parseMerge"),Hr=h(t=>t.branch,"parseCheckout"),Pr=h(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"),Wr={parse:h(async t=>{const r=await fr("gitGraph",t);m.debug(r),Ir(r,X)},"parse")},S=sr(),b=S==null?void 0:S.gitGraph,R=10,I=40,k=4,L=2,O=8,C=new Map,E=new Map,P=30,G=new Map,W=[],M=0,p="LR",jr=h(()=>{C.clear(),E.clear(),G.clear(),M=0,W=[],p="LR"},"clear"),J=h(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(s=>{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=s.trim(),r.appendChild(e)}),r},"drawText"),Q=h(t=>{let r,a,s;return p==="BT"?(a=h((e,n)=>e<=n,"comparisonFunc"),s=1/0):(a=h((e,n)=>e>=n,"comparisonFunc"),s=0),t.forEach(e=>{var c,o;const n=p==="TB"||p=="BT"?(c=E.get(e))==null?void 0:c.y:(o=E.get(e))==null?void 0:o.x;n!==void 0&&a(n,s)&&(r=e,s=n)}),r},"findClosestParent"),Sr=h(t=>{let r="",a=1/0;return t.forEach(s=>{const e=E.get(s).y;e<=a&&(r=s,a=e)}),r||void 0},"findClosestParentBT"),Dr=h((t,r,a)=>{let s=a,e=a;const n=[];t.forEach(c=>{const o=r.get(c);if(!o)throw new Error(`Commit not found for key ${c}`);o.parents.length?(s=Yr(o),e=Math.max(s,e)):n.push(o),Kr(o,s)}),s=e,n.forEach(c=>{Nr(c,s,a)}),t.forEach(c=>{const o=r.get(c);if(o!=null&&o.parents.length){const $=Sr(o.parents);s=E.get($).y-I,s<=e&&(e=s);const l=C.get(o.branch).pos,f=s-R;E.set(o.id,{x:l,y:f})}})},"setParallelBTPos"),Ar=h(t=>{var s;const r=Q(t.parents.filter(e=>e!==null));if(!r)throw new Error(`Closest parent not found for commit ${t.id}`);const a=(s=E.get(r))==null?void 0:s.y;if(a===void 0)throw new Error(`Closest parent position not found for commit ${t.id}`);return a},"findClosestParentPos"),Yr=h(t=>Ar(t)+I,"calculateCommitPosition"),Kr=h((t,r)=>{const a=C.get(t.branch);if(!a)throw new Error(`Branch not found for commit ${t.id}`);const s=a.pos,e=r+R;return E.set(t.id,{x:s,y:e}),{x:s,y:e}},"setCommitPosition"),Nr=h((t,r,a)=>{const s=C.get(t.branch);if(!s)throw new Error(`Branch not found for commit ${t.id}`);const e=r+a,n=s.pos;E.set(t.id,{x:n,y:e})},"setRootPosition"),_r=h((t,r,a,s,e,n)=>{if(n===x.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} ${s}-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} ${s}-inner`);else if(n===x.CHERRY_PICK)t.append("circle").attr("cx",a.x).attr("cy",a.y).attr("r",10).attr("class",`commit ${r.id} ${s}`),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} ${s}`),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} ${s}`),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} ${s}`),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} ${s}`);else{const c=t.append("circle");if(c.attr("cx",a.x),c.attr("cy",a.y),c.attr("r",r.type===x.MERGE?9:10),c.attr("class",`commit ${r.id} commit${e%O}`),n===x.MERGE){const o=t.append("circle");o.attr("cx",a.x),o.attr("cy",a.y),o.attr("r",6),o.attr("class",`commit ${s} ${r.id} commit${e%O}`)}n===x.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 ${s} ${r.id} commit${e%O}`)}},"drawCommitBullet"),Vr=h((t,r,a,s)=>{var e;if(r.type!==x.CHERRY_PICK&&(r.customId&&r.type===x.MERGE||r.type!==x.MERGE)&&(b!=null&&b.showCommitLabel)){const n=t.append("g"),c=n.insert("rect").attr("class","commit-label-bkg"),o=n.append("text").attr("x",s).attr("y",a.y+25).attr("class","commit-label").text(r.id),$=(e=o.node())==null?void 0:e.getBBox();if($&&(c.attr("x",a.posWithOffset-$.width/2-L).attr("y",a.y+13.5).attr("width",$.width+2*L).attr("height",$.height+2*L),p==="TB"||p==="BT"?(c.attr("x",a.x-($.width+4*k+5)).attr("y",a.y-12),o.attr("x",a.x-($.width+4*k)).attr("y",a.y+$.height-12)):o.attr("x",a.posWithOffset-$.width/2),b.rotateCommitLabel))if(p==="TB"||p==="BT")o.attr("transform","rotate(-45, "+a.x+", "+a.y+")"),c.attr("transform","rotate(-45, "+a.x+", "+a.y+")");else{const l=-7.5-($.width+10)/25*9.5,f=10+$.width/25*8.5;n.attr("transform","translate("+l+", "+f+") rotate(-45, "+s+", "+a.y+")")}}},"drawCommitLabel"),Xr=h((t,r,a,s)=>{var e;if(r.tags.length>0){let n=0,c=0,o=0;const $=[];for(const l of r.tags.reverse()){const f=t.insert("polygon"),g=t.append("circle"),d=t.append("text").attr("y",a.y-16-n).attr("class","tag-label").text(l),y=(e=d.node())==null?void 0:e.getBBox();if(!y)throw new Error("Tag bbox not found");c=Math.max(c,y.width),o=Math.max(o,y.height),d.attr("x",a.posWithOffset-y.width/2),$.push({tag:d,hole:g,rect:f,yOffset:n}),n+=20}for(const{tag:l,hole:f,rect:g,yOffset:d}of $){const y=o/2,u=a.y-19.2-d;if(g.attr("class","tag-label-bkg").attr("points",`
|
|
2
2
|
${s-c/2-k/2},${u+L}
|
|
3
3
|
${s-c/2-k/2},${u-L}
|
|
4
4
|
${a.posWithOffset-c/2-k},${u-y-L}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{x as f,y as b,z as _,A as l}from"./index-
|
|
1
|
+
import{x as f,y as b,z as _,A as l}from"./index-Ds1UcDjn.js";import{f as g,a as d,r as L}from"./_baseUniq-CHS3E5If.js";import{u as j,v as p}from"./union-B2D_ldts.js";import{i as E}from"./isEmpty-BZ44SF3F.js";var v="\0",a="\0",O="";class N{constructor(e={}){this._isDirected=Object.prototype.hasOwnProperty.call(e,"directed")?e.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(e,"multigraph")?e.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(e,"compound")?e.compound:!1,this._label=void 0,this._defaultNodeLabelFn=f(void 0),this._defaultEdgeLabelFn=f(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[a]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return b(e)||(e=f(e)),this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return _(this._nodes)}sources(){var e=this;return g(this.nodes(),function(t){return E(e._in[t])})}sinks(){var e=this;return g(this.nodes(),function(t){return E(e._out[t])})}setNodes(e,t){var s=arguments,i=this;return d(e,function(r){s.length>1?i.setNode(r,t):i.setNode(r)}),this}setNode(e,t){return Object.prototype.hasOwnProperty.call(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=a,this._children[e]={},this._children[a][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var t=s=>this.removeEdge(this._edgeObjs[s]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],d(this.children(e),s=>{this.setParent(s)}),delete this._children[e]),d(_(this._in[e]),t),delete this._in[e],delete this._preds[e],d(_(this._out[e]),t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(l(t))t=a;else{t+="";for(var s=t;!l(s);s=this.parent(s))if(s===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var t=this._parent[e];if(t!==a)return t}}children(e){if(l(e)&&(e=a),this._isCompound){var t=this._children[e];if(t)return _(t)}else{if(e===a)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var t=this._preds[e];if(t)return _(t)}successors(e){var t=this._sucs[e];if(t)return _(t)}neighbors(e){var t=this.predecessors(e);if(t)return j(t,this.successors(e))}isLeaf(e){var t;return this.isDirected()?t=this.successors(e):t=this.neighbors(e),t.length===0}filterNodes(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var s=this;d(this._nodes,function(n,h){e(h)&&t.setNode(h,n)}),d(this._edgeObjs,function(n){t.hasNode(n.v)&&t.hasNode(n.w)&&t.setEdge(n,s.edge(n))});var i={};function r(n){var h=s.parent(n);return h===void 0||t.hasNode(h)?(i[n]=h,h):h in i?i[h]:r(h)}return this._isCompound&&d(t.nodes(),function(n){t.setParent(n,r(n))}),t}setDefaultEdgeLabel(e){return b(e)||(e=f(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return p(this._edgeObjs)}setPath(e,t){var s=this,i=arguments;return L(e,function(r,n){return i.length>1?s.setEdge(r,n,t):s.setEdge(r,n),n}),this}setEdge(){var e,t,s,i,r=!1,n=arguments[0];typeof n=="object"&&n!==null&&"v"in n?(e=n.v,t=n.w,s=n.name,arguments.length===2&&(i=arguments[1],r=!0)):(e=n,t=arguments[1],s=arguments[3],arguments.length>2&&(i=arguments[2],r=!0)),e=""+e,t=""+t,l(s)||(s=""+s);var h=c(this._isDirected,e,t,s);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,h))return r&&(this._edgeLabels[h]=i),this;if(!l(s)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[h]=r?i:this._defaultEdgeLabelFn(e,t,s);var u=P(this._isDirected,e,t,s);return e=u.v,t=u.w,Object.freeze(u),this._edgeObjs[h]=u,y(this._preds[t],e),y(this._sucs[e],t),this._in[t][h]=u,this._out[e][h]=u,this._edgeCount++,this}edge(e,t,s){var i=arguments.length===1?m(this._isDirected,arguments[0]):c(this._isDirected,e,t,s);return this._edgeLabels[i]}hasEdge(e,t,s){var i=arguments.length===1?m(this._isDirected,arguments[0]):c(this._isDirected,e,t,s);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(e,t,s){var i=arguments.length===1?m(this._isDirected,arguments[0]):c(this._isDirected,e,t,s),r=this._edgeObjs[i];return r&&(e=r.v,t=r.w,delete this._edgeLabels[i],delete this._edgeObjs[i],C(this._preds[t],e),C(this._sucs[e],t),delete this._in[t][i],delete this._out[e][i],this._edgeCount--),this}inEdges(e,t){var s=this._in[e];if(s){var i=p(s);return t?g(i,function(r){return r.v===t}):i}}outEdges(e,t){var s=this._out[e];if(s){var i=p(s);return t?g(i,function(r){return r.w===t}):i}}nodeEdges(e,t){var s=this.inEdges(e,t);if(s)return s.concat(this.outEdges(e,t))}}N.prototype._nodeCount=0;N.prototype._edgeCount=0;function y(o,e){o[e]?o[e]++:o[e]=1}function C(o,e){--o[e]||delete o[e]}function c(o,e,t,s){var i=""+e,r=""+t;if(!o&&i>r){var n=i;i=r,r=n}return i+O+r+O+(l(s)?v:s)}function P(o,e,t,s){var i=""+e,r=""+t;if(!o&&i>r){var n=i;i=r,r=n}var h={v:i,w:r};return s&&(h.name=s),h}function m(o,e){return c(o,e.v,e.w,e.name)}export{N as G};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as o}from"./has-
|
|
1
|
+
import{h as o}from"./has-BBSmRLAB.js";import{x as c,y as E,z as f,A as l}from"./index-Ds1UcDjn.js";import{f as m,a as u,r as O}from"./_baseUniq-CHS3E5If.js";import{u as j,v as p}from"./union-B2D_ldts.js";import{i as C}from"./isEmpty-BZ44SF3F.js";var F="\0",a="\0",N="";class D{constructor(e={}){this._isDirected=o(e,"directed")?e.directed:!0,this._isMultigraph=o(e,"multigraph")?e.multigraph:!1,this._isCompound=o(e,"compound")?e.compound:!1,this._label=void 0,this._defaultNodeLabelFn=c(void 0),this._defaultEdgeLabelFn=c(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[a]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return E(e)||(e=c(e)),this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return f(this._nodes)}sources(){var e=this;return m(this.nodes(),function(t){return C(e._in[t])})}sinks(){var e=this;return m(this.nodes(),function(t){return C(e._out[t])})}setNodes(e,t){var s=arguments,i=this;return u(e,function(r){s.length>1?i.setNode(r,t):i.setNode(r)}),this}setNode(e,t){return o(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=a,this._children[e]={},this._children[a][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return o(this._nodes,e)}removeNode(e){var t=this;if(o(this._nodes,e)){var s=function(i){t.removeEdge(t._edgeObjs[i])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],u(this.children(e),function(i){t.setParent(i)}),delete this._children[e]),u(f(this._in[e]),s),delete this._in[e],delete this._preds[e],u(f(this._out[e]),s),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(l(t))t=a;else{t+="";for(var s=t;!l(s);s=this.parent(s))if(s===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var t=this._parent[e];if(t!==a)return t}}children(e){if(l(e)&&(e=a),this._isCompound){var t=this._children[e];if(t)return f(t)}else{if(e===a)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var t=this._preds[e];if(t)return f(t)}successors(e){var t=this._sucs[e];if(t)return f(t)}neighbors(e){var t=this.predecessors(e);if(t)return j(t,this.successors(e))}isLeaf(e){var t;return this.isDirected()?t=this.successors(e):t=this.neighbors(e),t.length===0}filterNodes(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var s=this;u(this._nodes,function(n,h){e(h)&&t.setNode(h,n)}),u(this._edgeObjs,function(n){t.hasNode(n.v)&&t.hasNode(n.w)&&t.setEdge(n,s.edge(n))});var i={};function r(n){var h=s.parent(n);return h===void 0||t.hasNode(h)?(i[n]=h,h):h in i?i[h]:r(h)}return this._isCompound&&u(t.nodes(),function(n){t.setParent(n,r(n))}),t}setDefaultEdgeLabel(e){return E(e)||(e=c(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return p(this._edgeObjs)}setPath(e,t){var s=this,i=arguments;return O(e,function(r,n){return i.length>1?s.setEdge(r,n,t):s.setEdge(r,n),n}),this}setEdge(){var e,t,s,i,r=!1,n=arguments[0];typeof n=="object"&&n!==null&&"v"in n?(e=n.v,t=n.w,s=n.name,arguments.length===2&&(i=arguments[1],r=!0)):(e=n,t=arguments[1],s=arguments[3],arguments.length>2&&(i=arguments[2],r=!0)),e=""+e,t=""+t,l(s)||(s=""+s);var h=g(this._isDirected,e,t,s);if(o(this._edgeLabels,h))return r&&(this._edgeLabels[h]=i),this;if(!l(s)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[h]=r?i:this._defaultEdgeLabelFn(e,t,s);var _=y(this._isDirected,e,t,s);return e=_.v,t=_.w,Object.freeze(_),this._edgeObjs[h]=_,L(this._preds[t],e),L(this._sucs[e],t),this._in[t][h]=_,this._out[e][h]=_,this._edgeCount++,this}edge(e,t,s){var i=arguments.length===1?b(this._isDirected,arguments[0]):g(this._isDirected,e,t,s);return this._edgeLabels[i]}hasEdge(e,t,s){var i=arguments.length===1?b(this._isDirected,arguments[0]):g(this._isDirected,e,t,s);return o(this._edgeLabels,i)}removeEdge(e,t,s){var i=arguments.length===1?b(this._isDirected,arguments[0]):g(this._isDirected,e,t,s),r=this._edgeObjs[i];return r&&(e=r.v,t=r.w,delete this._edgeLabels[i],delete this._edgeObjs[i],v(this._preds[t],e),v(this._sucs[e],t),delete this._in[t][i],delete this._out[e][i],this._edgeCount--),this}inEdges(e,t){var s=this._in[e];if(s){var i=p(s);return t?m(i,function(r){return r.v===t}):i}}outEdges(e,t){var s=this._out[e];if(s){var i=p(s);return t?m(i,function(r){return r.w===t}):i}}nodeEdges(e,t){var s=this.inEdges(e,t);if(s)return s.concat(this.outEdges(e,t))}}D.prototype._nodeCount=0;D.prototype._edgeCount=0;function L(d,e){d[e]?d[e]++:d[e]=1}function v(d,e){--d[e]||delete d[e]}function g(d,e,t,s){var i=""+e,r=""+t;if(!d&&i>r){var n=i;i=r,r=n}return i+N+r+N+(l(s)?F:s)}function y(d,e,t,s){var i=""+e,r=""+t;if(!d&&i>r){var n=i;i=r,r=n}var h={v:i,w:r};return s&&(h.name=s),h}function b(d,e){return g(d,e.v,e.w,e.name)}export{D as G};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{G as s,t as g,c as M,g as f,d as G,e as E}from"./index-
|
|
1
|
+
import{G as s,t as g,c as M,g as f,d as G,e as E}from"./index-Ds1UcDjn.js";function S(){var e;return f.get().imageModelName||((e=G[0])==null?void 0:e.id)||"gemini-2.5-flash-image-vip"}function w(t,e){const a=E.zh;return a(t,e.rows,e.cols)}function v(t,e){const{theme:a,rows:I=s.gridConfig.rows,cols:n=s.gridConfig.cols,layoutStyle:m=s.layoutStyle,imageSize:y=s.imageSize,referenceImages:d,model:T}=t,h=T||S();if(!a||typeof a!="string")return{success:!1,error:"缺少必填参数 theme(主题描述)",type:"error"};const c=Math.min(Math.max(2,I),5),i=Math.min(Math.max(2,n),5),o={rows:c,cols:i},u=w(a,o),l=d==null?void 0:d.map((r,k)=>({type:"url",url:r,name:`reference-${k+1}`}));try{let r;if(e!=null&&e.retryTaskId){if(g.retryTask(e.retryTaskId),r=g.getTask(e.retryTaskId),!r)throw new Error(`重试任务不存在: ${e.retryTaskId}`)}else r=g.createTask({prompt:u,size:y,model:h,uploadedImages:l&&l.length>0?l:void 0,gridImageRows:c,gridImageCols:i,gridImageLayoutStyle:m,originalTheme:a,batchId:e==null?void 0:e.batchId,globalIndex:(e==null?void 0:e.globalIndex)||1,autoInsertToCanvas:!0},M.IMAGE);return{success:!0,data:{taskId:r.id,theme:a,gridConfig:o,layoutStyle:m,prompt:u.substring(0,100)+"..."},type:"image",taskId:r.id,task:r}}catch(r){return console.error("[GridImage] Failed to create task:",r),{success:!1,error:r.message||"创建宫格图任务失败",type:"error"}}}export{v as createGridImageTask};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t}from"./hasIn-
|
|
1
|
+
import{h as t}from"./hasIn-CGUnHN5L.js";var n=Object.prototype,o=n.hasOwnProperty;function s(r,a){return r!=null&&o.call(r,a)}function h(r,a){return r!=null&&t(r,a,s)}export{h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ar as e,as as t,at as f,au as g,av as h,n as d,q as v}from"./index-
|
|
1
|
+
import{ar as e,as as t,at as f,au as g,av as h,n as d,q as v}from"./index-Ds1UcDjn.js";function A(n,a,u){var s=n==null?void 0:e(n,a);return s===void 0?u:s}function m(n,a){return n!=null&&a in Object(n)}function x(n,a,u){a=t(a,n);for(var s=-1,r=a.length,l=!1;++s<r;){var i=f(a[s]);if(!(l=n!=null&&u(n,i)))break;n=n[i]}return l||++s!=r?l:(r=n==null?0:n.length,!!r&&g(r)&&h(i,r)&&(d(n)||v(n)))}function P(n,a){return n!=null&&x(n,a,m)}export{P as a,A as g,x as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{G as A}from"./graph-BzDiTfOi.js";import{l as H}from"./layout-qmk5pO0s.js";import{A as N}from"./index-BWxm5yOF.js";import{c as V}from"./clone-C3EwcCUy.js";import{m as $}from"./min-Bc3x3akU.js";import{i as U,u as W,s as _,c as q,b as z,g as D,d as O,a as K,p as Q,e as B,f as J,h as Y,j as Z}from"./edges-e0da2a9e-DzHLI4vk.js";import{l as s,g as T,r as S}from"./index-C3qFnFDn.js";import{c as I}from"./createText-2e5e7dd3-BSV0wq-Y.js";import{s as L}from"./Serializer-Cg6t80B7.js";function y(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:tt(e),edges:et(e)};return N(e.graph())||(t.value=V(e.graph())),t}function tt(e){return $(e.nodes(),function(t){var n=e.node(t),r=e.parent(t),i={v:t};return N(n)||(i.value=n),N(r)||(i.parent=r),i})}function et(e){return $(e.edges(),function(t){var n=e.edge(t),r={v:t.v,w:t.w};return N(t.name)||(r.name=t.name),N(n)||(r.value=n),r})}let l={},g={},R={};const nt=()=>{g={},R={},l={}},p=(e,t)=>(s.trace("In isDescendant",t," ",e," = ",g[t].includes(e)),!!g[t].includes(e)),it=(e,t)=>(s.info("Descendants of ",t," is ",g[t]),s.info("Edge is ",e),e.v===t||e.w===t?!1:g[t]?g[t].includes(e.v)||p(e.v,t)||p(e.w,t)||g[t].includes(e.w):(s.debug("Tilt, ",t,",not in descendants"),!1)),P=(e,t,n,r)=>{s.warn("Copying children of ",e,"root",r,"data",t.node(e),r);const i=t.children(e)||[];e!==r&&i.push(e),s.warn("Copying (nodes) clusterId",e,"nodes",i),i.forEach(a=>{if(t.children(a).length>0)P(a,t,n,r);else{const d=t.node(a);s.info("cp ",a," to ",r," with parent ",e),n.setNode(a,d),r!==t.parent(a)&&(s.warn("Setting parent",a,t.parent(a)),n.setParent(a,t.parent(a))),e!==r&&a!==e?(s.debug("Setting parent",a,e),n.setParent(a,e)):(s.info("In copy ",e,"root",r,"data",t.node(e),r),s.debug("Not Setting parent for node=",a,"cluster!==rootId",e!==r,"node!==clusterId",a!==e));const u=t.edges(a);s.debug("Copying Edges",u),u.forEach(f=>{s.info("Edge",f);const h=t.edge(f.v,f.w,f.name);s.info("Edge data",h,r);try{it(f,r)?(s.info("Copying as ",f.v,f.w,h,f.name),n.setEdge(f.v,f.w,h,f.name),s.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):s.info("Skipping copy of edge ",f.v,"-->",f.w," rootId: ",r," clusterId:",e)}catch(w){s.error(w)}})}s.debug("Removing node",a),t.removeNode(a)})},k=(e,t)=>{const n=t.children(e);let r=[...n];for(const i of n)R[i]=e,r=[...r,...k(i,t)];return r},C=(e,t)=>{s.trace("Searching",e);const n=t.children(e);if(s.trace("Searching children of id ",e,n),n.length<1)return s.trace("This is a valid node",e),e;for(const r of n){const i=C(r,t);if(i)return s.trace("Found replacement for",e," => ",i),i}},X=e=>!l[e]||!l[e].externalConnections?e:l[e]?l[e].id:e,st=(e,t)=>{if(!e||t>10){s.debug("Opting out, no graph ");return}else s.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(s.warn("Cluster identified",n," Replacement id in edges: ",C(n,e)),g[n]=k(n,e),l[n]={id:C(n,e),clusterData:e.node(n)})}),e.nodes().forEach(function(n){const r=e.children(n),i=e.edges();r.length>0?(s.debug("Cluster identified",n,g),i.forEach(a=>{if(a.v!==n&&a.w!==n){const d=p(a.v,n),u=p(a.w,n);d^u&&(s.warn("Edge: ",a," leaves cluster ",n),s.warn("Descendants of XXX ",n,": ",g[n]),l[n].externalConnections=!0)}})):s.debug("Not a cluster ",n,g)});for(let n of Object.keys(l)){const r=l[n].id,i=e.parent(r);i!==n&&l[i]&&!l[i].externalConnections&&(l[n].id=i)}e.edges().forEach(function(n){const r=e.edge(n);s.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),s.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let i=n.v,a=n.w;if(s.warn("Fix XXX",l,"ids:",n.v,n.w,"Translating: ",l[n.v]," --- ",l[n.w]),l[n.v]&&l[n.w]&&l[n.v]===l[n.w]){s.warn("Fixing and trixing link to self - removing XXX",n.v,n.w,n.name),s.warn("Fixing and trixing - removing XXX",n.v,n.w,n.name),i=X(n.v),a=X(n.w),e.removeEdge(n.v,n.w,n.name);const d=n.w+"---"+n.v;e.setNode(d,{domId:d,id:d,labelStyle:"",labelText:r.label,padding:0,shape:"labelRect",style:""});const u=structuredClone(r),f=structuredClone(r);u.label="",u.arrowTypeEnd="none",f.label="",u.fromCluster=n.v,f.toCluster=n.v,e.setEdge(i,d,u,n.name+"-cyclic-special"),e.setEdge(d,a,f,n.name+"-cyclic-special")}else if(l[n.v]||l[n.w]){if(s.warn("Fixing and trixing - removing XXX",n.v,n.w,n.name),i=X(n.v),a=X(n.w),e.removeEdge(n.v,n.w,n.name),i!==n.v){const d=e.parent(i);l[d].externalConnections=!0,r.fromCluster=n.v}if(a!==n.w){const d=e.parent(a);l[d].externalConnections=!0,r.toCluster=n.w}s.warn("Fix Replacing with XXX",i,a,n.name),e.setEdge(i,a,r,n.name)}}),s.warn("Adjusted Graph",y(e)),F(e,0),s.trace(l)},F=(e,t)=>{if(s.warn("extractor - ",t,y(e),e.children("D")),t>10){s.error("Bailing out");return}let n=e.nodes(),r=!1;for(const i of n){const a=e.children(i);r=r||a.length>0}if(!r){s.debug("Done, no node has children",e.nodes());return}s.debug("Nodes = ",n,t);for(const i of n)if(s.debug("Extracting node",i,l,l[i]&&!l[i].externalConnections,!e.parent(i),e.node(i),e.children("D")," Depth ",t),!l[i])s.debug("Not a cluster",i,t);else if(!l[i].externalConnections&&e.children(i)&&e.children(i).length>0){s.warn("Cluster without external connections, without a parent and with children",i,t);let d=e.graph().rankdir==="TB"?"LR":"TB";l[i]&&l[i].clusterData&&l[i].clusterData.dir&&(d=l[i].clusterData.dir,s.warn("Fixing dir",l[i].clusterData.dir,d));const u=new A({multigraph:!0,compound:!0}).setGraph({rankdir:d,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});s.warn("Old graph before copy",y(e)),P(i,e,u,i),e.setNode(i,{clusterNode:!0,id:i,clusterData:l[i].clusterData,labelText:l[i].labelText,graph:u}),s.warn("New graph after copy node: (",i,")",y(u)),s.debug("Old graph after copy",y(e))}else s.warn("Cluster ** ",i," **not meeting the criteria !externalConnections:",!l[i].externalConnections," no parent: ",!e.parent(i)," children ",e.children(i)&&e.children(i).length>0,e.children("D"),t),s.debug(l);n=e.nodes(),s.warn("New list of nodes",n);for(const i of n){const a=e.node(i);s.warn(" Now next level",i,a),a.clusterNode&&F(a.graph,t+1)}},G=(e,t)=>{if(t.length===0)return[];let n=Object.assign(t);return t.forEach(r=>{const i=e.children(r),a=G(e,i);n=[...n,...a]}),n},rt=e=>G(e,e.children()),at=(e,t)=>{s.info("Creating subgraph rect for ",t.id,t);const n=T(),r=e.insert("g").attr("class","cluster"+(t.class?" "+t.class:"")).attr("id",t.id),i=r.insert("rect",":first-child"),a=S(n.flowchart.htmlLabels),d=r.insert("g").attr("class","cluster-label"),u=t.labelType==="markdown"?I(d,t.labelText,{style:t.labelStyle,useHtmlLabels:a}):d.node().appendChild(J(t.labelText,t.labelStyle,void 0,!0));let f=u.getBBox();if(S(n.flowchart.htmlLabels)){const c=u.children[0],o=L(u);f=c.getBoundingClientRect(),o.attr("width",f.width),o.attr("height",f.height)}const h=0*t.padding,w=h/2,m=t.width<=f.width+h?f.width+h:t.width;t.width<=f.width+h?t.diff=(f.width-t.width)/2-t.padding/2:t.diff=-t.padding/2,s.trace("Data ",t,JSON.stringify(t)),i.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-m/2).attr("y",t.y-t.height/2-w).attr("width",m).attr("height",t.height+h);const{subGraphTitleTopMargin:v}=D(n);a?d.attr("transform",`translate(${t.x-f.width/2}, ${t.y-t.height/2+v})`):d.attr("transform",`translate(${t.x}, ${t.y-t.height/2+v})`);const x=i.node().getBBox();return t.width=x.width,t.height=x.height,t.intersect=function(c){return B(t,c)},r},ct=(e,t)=>{const n=e.insert("g").attr("class","note-cluster").attr("id",t.id),r=n.insert("rect",":first-child"),i=0*t.padding,a=i/2;r.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-a).attr("y",t.y-t.height/2-a).attr("width",t.width+i).attr("height",t.height+i).attr("fill","none");const d=r.node().getBBox();return t.width=d.width,t.height=d.height,t.intersect=function(u){return B(t,u)},n},ot=(e,t)=>{const n=T(),r=e.insert("g").attr("class",t.classes).attr("id",t.id),i=r.insert("rect",":first-child"),a=r.insert("g").attr("class","cluster-label"),d=r.append("rect"),u=a.node().appendChild(J(t.labelText,t.labelStyle,void 0,!0));let f=u.getBBox();if(S(n.flowchart.htmlLabels)){const c=u.children[0],o=L(u);f=c.getBoundingClientRect(),o.attr("width",f.width),o.attr("height",f.height)}f=u.getBBox();const h=0*t.padding,w=h/2,m=t.width<=f.width+t.padding?f.width+t.padding:t.width;t.width<=f.width+t.padding?t.diff=(f.width+t.padding*0-t.width)/2:t.diff=-t.padding/2,i.attr("class","outer").attr("x",t.x-m/2-w).attr("y",t.y-t.height/2-w).attr("width",m+h).attr("height",t.height+h),d.attr("class","inner").attr("x",t.x-m/2-w).attr("y",t.y-t.height/2-w+f.height-1).attr("width",m+h).attr("height",t.height+h-f.height-3);const{subGraphTitleTopMargin:v}=D(n);a.attr("transform",`translate(${t.x-f.width/2}, ${t.y-t.height/2-t.padding/3+(S(n.flowchart.htmlLabels)?5:3)+v})`);const x=i.node().getBBox();return t.height=x.height,t.intersect=function(c){return B(t,c)},r},lt=(e,t)=>{const n=e.insert("g").attr("class",t.classes).attr("id",t.id),r=n.insert("rect",":first-child"),i=0*t.padding,a=i/2;r.attr("class","divider").attr("x",t.x-t.width/2-a).attr("y",t.y-t.height/2).attr("width",t.width+i).attr("height",t.height+i);const d=r.node().getBBox();return t.width=d.width,t.height=d.height,t.diff=-t.padding/2,t.intersect=function(u){return B(t,u)},n},ft={rect:at,roundedWithTitle:ot,noteGroup:ct,divider:lt};let j={};const dt=(e,t)=>{s.trace("Inserting cluster");const n=t.shape||"rect";j[t.id]=ft[n](e,t)},ut=()=>{j={}},M=async(e,t,n,r,i,a)=>{s.info("Graph in recursive render: XXX",y(t),i);const d=t.graph().rankdir;s.trace("Dir in recursive render - dir:",d);const u=e.insert("g").attr("class","root");t.nodes()?s.info("Recursive render XXX",t.nodes()):s.info("No nodes found for",t),t.edges().length>0&&s.trace("Recursive edges",t.edge(t.edges()[0]));const f=u.insert("g").attr("class","clusters"),h=u.insert("g").attr("class","edgePaths"),w=u.insert("g").attr("class","edgeLabels"),m=u.insert("g").attr("class","nodes");await Promise.all(t.nodes().map(async function(c){const o=t.node(c);if(i!==void 0){const b=JSON.parse(JSON.stringify(i.clusterData));s.info("Setting data for cluster XXX (",c,") ",b,i),t.setNode(i.id,b),t.parent(c)||(s.trace("Setting parent",c,i.id),t.setParent(c,i.id,b))}if(s.info("(Insert) Node XXX"+c+": "+JSON.stringify(t.node(c))),o&&o.clusterNode){s.info("Cluster identified",c,o.width,t.node(c));const b=await M(m,o.graph,n,r,t.node(c),a),E=b.elem;W(o,E),o.diff=b.diff||0,s.info("Node bounds (abc123)",c,o,o.width,o.x,o.y),_(E,o),s.warn("Recursive render complete ",E,o)}else t.children(c).length>0?(s.info("Cluster - the non recursive path XXX",c,o.id,o,t),s.info(C(o.id,t)),l[o.id]={id:C(o.id,t),node:o}):(s.info("Node - the non recursive path",c,o.id,o),await q(m,t.node(c),d))})),t.edges().forEach(function(c){const o=t.edge(c.v,c.w,c.name);s.info("Edge "+c.v+" -> "+c.w+": "+JSON.stringify(c)),s.info("Edge "+c.v+" -> "+c.w+": ",c," ",JSON.stringify(t.edge(c))),s.info("Fix",l,"ids:",c.v,c.w,"Translating: ",l[c.v],l[c.w]),z(w,o)}),t.edges().forEach(function(c){s.info("Edge "+c.v+" -> "+c.w+": "+JSON.stringify(c))}),s.info("#############################################"),s.info("### Layout ###"),s.info("#############################################"),s.info(t),H(t),s.info("Graph after layout:",y(t));let v=0;const{subGraphTitleTotalMargin:x}=D(a);return rt(t).forEach(function(c){const o=t.node(c);s.info("Position "+c+": "+JSON.stringify(t.node(c))),s.info("Position "+c+": ("+o.x,","+o.y,") width: ",o.width," height: ",o.height),o&&o.clusterNode?(o.y+=x,O(o)):t.children(c).length>0?(o.height+=x,dt(f,o),l[o.id].node=o):(o.y+=x/2,O(o))}),t.edges().forEach(function(c){const o=t.edge(c);s.info("Edge "+c.v+" -> "+c.w+": "+JSON.stringify(o),o),o.points.forEach(E=>E.y+=x/2);const b=K(h,c,o,l,n,t,r);Q(o,b)}),t.nodes().forEach(function(c){const o=t.node(c);s.info(c,o.type,o.diff),o.type==="group"&&(v=o.diff)}),{elem:u,diff:v}},Nt=async(e,t,n,r,i)=>{U(e,n,r,i),Y(),Z(),ut(),nt(),s.warn("Graph at first:",JSON.stringify(y(t))),st(t),s.warn("Graph after:",JSON.stringify(y(t)));const a=T();await M(e,t,r,i,void 0,a)};export{Nt as r};
|
|
1
|
+
import{G as A}from"./graph-dwf5l9kJ.js";import{l as H}from"./layout-D8KZ21ze.js";import{A as N}from"./index-Ds1UcDjn.js";import{c as V}from"./clone-Y0952eQY.js";import{m as $}from"./min-B6fh4WRE.js";import{i as U,u as W,s as _,c as q,b as z,g as D,d as O,a as K,p as Q,e as B,f as J,h as Y,j as Z}from"./edges-e0da2a9e-BpsZLv9t.js";import{l as s,g as T,r as S}from"./index-_FyCDKGq.js";import{c as I}from"./createText-2e5e7dd3-DuyGuD-n.js";import{s as L}from"./Serializer-DPCLjt6U.js";function y(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:tt(e),edges:et(e)};return N(e.graph())||(t.value=V(e.graph())),t}function tt(e){return $(e.nodes(),function(t){var n=e.node(t),r=e.parent(t),i={v:t};return N(n)||(i.value=n),N(r)||(i.parent=r),i})}function et(e){return $(e.edges(),function(t){var n=e.edge(t),r={v:t.v,w:t.w};return N(t.name)||(r.name=t.name),N(n)||(r.value=n),r})}let l={},g={},R={};const nt=()=>{g={},R={},l={}},p=(e,t)=>(s.trace("In isDescendant",t," ",e," = ",g[t].includes(e)),!!g[t].includes(e)),it=(e,t)=>(s.info("Descendants of ",t," is ",g[t]),s.info("Edge is ",e),e.v===t||e.w===t?!1:g[t]?g[t].includes(e.v)||p(e.v,t)||p(e.w,t)||g[t].includes(e.w):(s.debug("Tilt, ",t,",not in descendants"),!1)),P=(e,t,n,r)=>{s.warn("Copying children of ",e,"root",r,"data",t.node(e),r);const i=t.children(e)||[];e!==r&&i.push(e),s.warn("Copying (nodes) clusterId",e,"nodes",i),i.forEach(a=>{if(t.children(a).length>0)P(a,t,n,r);else{const d=t.node(a);s.info("cp ",a," to ",r," with parent ",e),n.setNode(a,d),r!==t.parent(a)&&(s.warn("Setting parent",a,t.parent(a)),n.setParent(a,t.parent(a))),e!==r&&a!==e?(s.debug("Setting parent",a,e),n.setParent(a,e)):(s.info("In copy ",e,"root",r,"data",t.node(e),r),s.debug("Not Setting parent for node=",a,"cluster!==rootId",e!==r,"node!==clusterId",a!==e));const u=t.edges(a);s.debug("Copying Edges",u),u.forEach(f=>{s.info("Edge",f);const h=t.edge(f.v,f.w,f.name);s.info("Edge data",h,r);try{it(f,r)?(s.info("Copying as ",f.v,f.w,h,f.name),n.setEdge(f.v,f.w,h,f.name),s.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))):s.info("Skipping copy of edge ",f.v,"-->",f.w," rootId: ",r," clusterId:",e)}catch(w){s.error(w)}})}s.debug("Removing node",a),t.removeNode(a)})},k=(e,t)=>{const n=t.children(e);let r=[...n];for(const i of n)R[i]=e,r=[...r,...k(i,t)];return r},C=(e,t)=>{s.trace("Searching",e);const n=t.children(e);if(s.trace("Searching children of id ",e,n),n.length<1)return s.trace("This is a valid node",e),e;for(const r of n){const i=C(r,t);if(i)return s.trace("Found replacement for",e," => ",i),i}},X=e=>!l[e]||!l[e].externalConnections?e:l[e]?l[e].id:e,st=(e,t)=>{if(!e||t>10){s.debug("Opting out, no graph ");return}else s.debug("Opting in, graph ");e.nodes().forEach(function(n){e.children(n).length>0&&(s.warn("Cluster identified",n," Replacement id in edges: ",C(n,e)),g[n]=k(n,e),l[n]={id:C(n,e),clusterData:e.node(n)})}),e.nodes().forEach(function(n){const r=e.children(n),i=e.edges();r.length>0?(s.debug("Cluster identified",n,g),i.forEach(a=>{if(a.v!==n&&a.w!==n){const d=p(a.v,n),u=p(a.w,n);d^u&&(s.warn("Edge: ",a," leaves cluster ",n),s.warn("Descendants of XXX ",n,": ",g[n]),l[n].externalConnections=!0)}})):s.debug("Not a cluster ",n,g)});for(let n of Object.keys(l)){const r=l[n].id,i=e.parent(r);i!==n&&l[i]&&!l[i].externalConnections&&(l[n].id=i)}e.edges().forEach(function(n){const r=e.edge(n);s.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),s.warn("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(e.edge(n)));let i=n.v,a=n.w;if(s.warn("Fix XXX",l,"ids:",n.v,n.w,"Translating: ",l[n.v]," --- ",l[n.w]),l[n.v]&&l[n.w]&&l[n.v]===l[n.w]){s.warn("Fixing and trixing link to self - removing XXX",n.v,n.w,n.name),s.warn("Fixing and trixing - removing XXX",n.v,n.w,n.name),i=X(n.v),a=X(n.w),e.removeEdge(n.v,n.w,n.name);const d=n.w+"---"+n.v;e.setNode(d,{domId:d,id:d,labelStyle:"",labelText:r.label,padding:0,shape:"labelRect",style:""});const u=structuredClone(r),f=structuredClone(r);u.label="",u.arrowTypeEnd="none",f.label="",u.fromCluster=n.v,f.toCluster=n.v,e.setEdge(i,d,u,n.name+"-cyclic-special"),e.setEdge(d,a,f,n.name+"-cyclic-special")}else if(l[n.v]||l[n.w]){if(s.warn("Fixing and trixing - removing XXX",n.v,n.w,n.name),i=X(n.v),a=X(n.w),e.removeEdge(n.v,n.w,n.name),i!==n.v){const d=e.parent(i);l[d].externalConnections=!0,r.fromCluster=n.v}if(a!==n.w){const d=e.parent(a);l[d].externalConnections=!0,r.toCluster=n.w}s.warn("Fix Replacing with XXX",i,a,n.name),e.setEdge(i,a,r,n.name)}}),s.warn("Adjusted Graph",y(e)),F(e,0),s.trace(l)},F=(e,t)=>{if(s.warn("extractor - ",t,y(e),e.children("D")),t>10){s.error("Bailing out");return}let n=e.nodes(),r=!1;for(const i of n){const a=e.children(i);r=r||a.length>0}if(!r){s.debug("Done, no node has children",e.nodes());return}s.debug("Nodes = ",n,t);for(const i of n)if(s.debug("Extracting node",i,l,l[i]&&!l[i].externalConnections,!e.parent(i),e.node(i),e.children("D")," Depth ",t),!l[i])s.debug("Not a cluster",i,t);else if(!l[i].externalConnections&&e.children(i)&&e.children(i).length>0){s.warn("Cluster without external connections, without a parent and with children",i,t);let d=e.graph().rankdir==="TB"?"LR":"TB";l[i]&&l[i].clusterData&&l[i].clusterData.dir&&(d=l[i].clusterData.dir,s.warn("Fixing dir",l[i].clusterData.dir,d));const u=new A({multigraph:!0,compound:!0}).setGraph({rankdir:d,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});s.warn("Old graph before copy",y(e)),P(i,e,u,i),e.setNode(i,{clusterNode:!0,id:i,clusterData:l[i].clusterData,labelText:l[i].labelText,graph:u}),s.warn("New graph after copy node: (",i,")",y(u)),s.debug("Old graph after copy",y(e))}else s.warn("Cluster ** ",i," **not meeting the criteria !externalConnections:",!l[i].externalConnections," no parent: ",!e.parent(i)," children ",e.children(i)&&e.children(i).length>0,e.children("D"),t),s.debug(l);n=e.nodes(),s.warn("New list of nodes",n);for(const i of n){const a=e.node(i);s.warn(" Now next level",i,a),a.clusterNode&&F(a.graph,t+1)}},G=(e,t)=>{if(t.length===0)return[];let n=Object.assign(t);return t.forEach(r=>{const i=e.children(r),a=G(e,i);n=[...n,...a]}),n},rt=e=>G(e,e.children()),at=(e,t)=>{s.info("Creating subgraph rect for ",t.id,t);const n=T(),r=e.insert("g").attr("class","cluster"+(t.class?" "+t.class:"")).attr("id",t.id),i=r.insert("rect",":first-child"),a=S(n.flowchart.htmlLabels),d=r.insert("g").attr("class","cluster-label"),u=t.labelType==="markdown"?I(d,t.labelText,{style:t.labelStyle,useHtmlLabels:a}):d.node().appendChild(J(t.labelText,t.labelStyle,void 0,!0));let f=u.getBBox();if(S(n.flowchart.htmlLabels)){const c=u.children[0],o=L(u);f=c.getBoundingClientRect(),o.attr("width",f.width),o.attr("height",f.height)}const h=0*t.padding,w=h/2,m=t.width<=f.width+h?f.width+h:t.width;t.width<=f.width+h?t.diff=(f.width-t.width)/2-t.padding/2:t.diff=-t.padding/2,s.trace("Data ",t,JSON.stringify(t)),i.attr("style",t.style).attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-m/2).attr("y",t.y-t.height/2-w).attr("width",m).attr("height",t.height+h);const{subGraphTitleTopMargin:v}=D(n);a?d.attr("transform",`translate(${t.x-f.width/2}, ${t.y-t.height/2+v})`):d.attr("transform",`translate(${t.x}, ${t.y-t.height/2+v})`);const x=i.node().getBBox();return t.width=x.width,t.height=x.height,t.intersect=function(c){return B(t,c)},r},ct=(e,t)=>{const n=e.insert("g").attr("class","note-cluster").attr("id",t.id),r=n.insert("rect",":first-child"),i=0*t.padding,a=i/2;r.attr("rx",t.rx).attr("ry",t.ry).attr("x",t.x-t.width/2-a).attr("y",t.y-t.height/2-a).attr("width",t.width+i).attr("height",t.height+i).attr("fill","none");const d=r.node().getBBox();return t.width=d.width,t.height=d.height,t.intersect=function(u){return B(t,u)},n},ot=(e,t)=>{const n=T(),r=e.insert("g").attr("class",t.classes).attr("id",t.id),i=r.insert("rect",":first-child"),a=r.insert("g").attr("class","cluster-label"),d=r.append("rect"),u=a.node().appendChild(J(t.labelText,t.labelStyle,void 0,!0));let f=u.getBBox();if(S(n.flowchart.htmlLabels)){const c=u.children[0],o=L(u);f=c.getBoundingClientRect(),o.attr("width",f.width),o.attr("height",f.height)}f=u.getBBox();const h=0*t.padding,w=h/2,m=t.width<=f.width+t.padding?f.width+t.padding:t.width;t.width<=f.width+t.padding?t.diff=(f.width+t.padding*0-t.width)/2:t.diff=-t.padding/2,i.attr("class","outer").attr("x",t.x-m/2-w).attr("y",t.y-t.height/2-w).attr("width",m+h).attr("height",t.height+h),d.attr("class","inner").attr("x",t.x-m/2-w).attr("y",t.y-t.height/2-w+f.height-1).attr("width",m+h).attr("height",t.height+h-f.height-3);const{subGraphTitleTopMargin:v}=D(n);a.attr("transform",`translate(${t.x-f.width/2}, ${t.y-t.height/2-t.padding/3+(S(n.flowchart.htmlLabels)?5:3)+v})`);const x=i.node().getBBox();return t.height=x.height,t.intersect=function(c){return B(t,c)},r},lt=(e,t)=>{const n=e.insert("g").attr("class",t.classes).attr("id",t.id),r=n.insert("rect",":first-child"),i=0*t.padding,a=i/2;r.attr("class","divider").attr("x",t.x-t.width/2-a).attr("y",t.y-t.height/2).attr("width",t.width+i).attr("height",t.height+i);const d=r.node().getBBox();return t.width=d.width,t.height=d.height,t.diff=-t.padding/2,t.intersect=function(u){return B(t,u)},n},ft={rect:at,roundedWithTitle:ot,noteGroup:ct,divider:lt};let j={};const dt=(e,t)=>{s.trace("Inserting cluster");const n=t.shape||"rect";j[t.id]=ft[n](e,t)},ut=()=>{j={}},M=async(e,t,n,r,i,a)=>{s.info("Graph in recursive render: XXX",y(t),i);const d=t.graph().rankdir;s.trace("Dir in recursive render - dir:",d);const u=e.insert("g").attr("class","root");t.nodes()?s.info("Recursive render XXX",t.nodes()):s.info("No nodes found for",t),t.edges().length>0&&s.trace("Recursive edges",t.edge(t.edges()[0]));const f=u.insert("g").attr("class","clusters"),h=u.insert("g").attr("class","edgePaths"),w=u.insert("g").attr("class","edgeLabels"),m=u.insert("g").attr("class","nodes");await Promise.all(t.nodes().map(async function(c){const o=t.node(c);if(i!==void 0){const b=JSON.parse(JSON.stringify(i.clusterData));s.info("Setting data for cluster XXX (",c,") ",b,i),t.setNode(i.id,b),t.parent(c)||(s.trace("Setting parent",c,i.id),t.setParent(c,i.id,b))}if(s.info("(Insert) Node XXX"+c+": "+JSON.stringify(t.node(c))),o&&o.clusterNode){s.info("Cluster identified",c,o.width,t.node(c));const b=await M(m,o.graph,n,r,t.node(c),a),E=b.elem;W(o,E),o.diff=b.diff||0,s.info("Node bounds (abc123)",c,o,o.width,o.x,o.y),_(E,o),s.warn("Recursive render complete ",E,o)}else t.children(c).length>0?(s.info("Cluster - the non recursive path XXX",c,o.id,o,t),s.info(C(o.id,t)),l[o.id]={id:C(o.id,t),node:o}):(s.info("Node - the non recursive path",c,o.id,o),await q(m,t.node(c),d))})),t.edges().forEach(function(c){const o=t.edge(c.v,c.w,c.name);s.info("Edge "+c.v+" -> "+c.w+": "+JSON.stringify(c)),s.info("Edge "+c.v+" -> "+c.w+": ",c," ",JSON.stringify(t.edge(c))),s.info("Fix",l,"ids:",c.v,c.w,"Translating: ",l[c.v],l[c.w]),z(w,o)}),t.edges().forEach(function(c){s.info("Edge "+c.v+" -> "+c.w+": "+JSON.stringify(c))}),s.info("#############################################"),s.info("### Layout ###"),s.info("#############################################"),s.info(t),H(t),s.info("Graph after layout:",y(t));let v=0;const{subGraphTitleTotalMargin:x}=D(a);return rt(t).forEach(function(c){const o=t.node(c);s.info("Position "+c+": "+JSON.stringify(t.node(c))),s.info("Position "+c+": ("+o.x,","+o.y,") width: ",o.width," height: ",o.height),o&&o.clusterNode?(o.y+=x,O(o)):t.children(c).length>0?(o.height+=x,dt(f,o),l[o.id].node=o):(o.y+=x/2,O(o))}),t.edges().forEach(function(c){const o=t.edge(c);s.info("Edge "+c.v+" -> "+c.w+": "+JSON.stringify(o),o),o.points.forEach(E=>E.y+=x/2);const b=K(h,c,o,l,n,t,r);Q(o,b)}),t.nodes().forEach(function(c){const o=t.node(c);s.info(c,o.type,o.diff),o.type==="group"&&(v=o.diff)}),{elem:u,diff:v}},Nt=async(e,t,n,r,i)=>{U(e,n,r,i),Y(),Z(),ut(),nt(),s.warn("Graph at first:",JSON.stringify(y(t))),st(t),s.warn("Graph after:",JSON.stringify(y(t)));const a=T();await M(e,t,r,i,void 0,a)};export{Nt as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aC as P}from"./index-
|
|
1
|
+
import{aC as P}from"./index-Ds1UcDjn.js";function _(n){if(n)throw n}var w,b;function v(){if(b)return w;b=1;var n=Object.prototype.hasOwnProperty,l=Object.prototype.toString,s=Object.defineProperty,y=Object.getOwnPropertyDescriptor,r=function(t){return typeof Array.isArray=="function"?Array.isArray(t):l.call(t)==="[object Array]"},p=function(t){if(!t||l.call(t)!=="[object Object]")return!1;var e=n.call(t,"constructor"),f=t.constructor&&t.constructor.prototype&&n.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!e&&!f)return!1;var c;for(c in t);return typeof c>"u"||n.call(t,c)},i=function(t,e){s&&e.name==="__proto__"?s(t,e.name,{enumerable:!0,configurable:!0,value:e.newValue,writable:!0}):t[e.name]=e.newValue},u=function(t,e){if(e==="__proto__")if(n.call(t,e)){if(y)return y(t,e).value}else return;return t[e]};return w=function o(){var t,e,f,c,d,g,a=arguments[0],h=1,x=arguments.length,O=!1;for(typeof a=="boolean"&&(O=a,a=arguments[1]||{},h=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});h<x;++h)if(t=arguments[h],t!=null)for(e in t)f=u(a,e),c=u(t,e),a!==c&&(O&&c&&(p(c)||(d=r(c)))?(d?(d=!1,g=f&&r(f)?f:[]):g=f&&p(f)?f:{},i(a,{name:e,newValue:o(O,g,c)})):typeof c<"u"&&i(a,{name:e,newValue:c}));return a},w}var m=v();const j=P(m);function S(n){if(typeof n!="object"||n===null)return!1;const l=Object.getPrototypeOf(n);return(l===null||l===Object.prototype||Object.getPrototypeOf(l)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)}function C(){const n=[],l={run:s,use:y};return l;function s(...r){let p=-1;const i=r.pop();if(typeof i!="function")throw new TypeError("Expected function as last argument, not "+i);u(null,...r);function u(o,...t){const e=n[++p];let f=-1;if(o){i(o);return}for(;++f<r.length;)(t[f]===null||t[f]===void 0)&&(t[f]=r[f]);r=t,e?E(e,u)(...t):i(null,...t)}}function y(r){if(typeof r!="function")throw new TypeError("Expected `middelware` to be a function, not "+r);return n.push(r),l}}function E(n,l){let s;return y;function y(...i){const u=n.length>i.length;let o;u&&i.push(r);try{o=n.apply(this,i)}catch(t){const e=t;if(u&&s)throw e;return r(e)}u||(o&&o.then&&typeof o.then=="function"?o.then(p,r):o instanceof Error?r(o):p(o))}function r(i,...u){s||(s=!0,l(i,...u))}function p(i){r(null,i)}}export{_ as b,j as e,S as i,C as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a8 as Z,a9 as V,aa as $,ab as ne,ac as re,ad as K,ae as P,u as F,af as H,$ as Y,c as U,ag as q,ah as Q,ai as X,aj as ee,S as O,U as R,ak as oe,r as I,W as C,a2 as ce,J as l,K as le,L as de,al as z,am as te}from"./index-BWxm5yOF.js";import{U as pe}from"./upload-CeQfFagJ.js";const me=2,se="aitu-backup";function ae(E){return E.map(n=>n.id?n:{...n,id:`imported-${Date.now()}-${Math.random().toString(36).slice(2,9)}`})}function L(E){return{"image/jpeg":".jpg","image/jpg":".jpg","image/png":".png","image/gif":".gif","image/webp":".webp","image/svg+xml":".svg","video/mp4":".mp4","video/webm":".webm","video/quicktime":".mov"}[E]||""}function ie(E){return E.replace(/[<>:"/\\|?*]/g,"_").replace(/\s+/g," ").trim()||"unnamed"}class ue{async exportToZip(n,e){const t=new Z;e==null||e(5,"正在准备数据...");const s=V.getCurrentBoard(),o={currentBoardId:(s==null?void 0:s.id)||null,currentBoardName:s==null?void 0:s.name,viewport:s==null?void 0:s.viewport},m={signature:se,version:me,createdAt:Date.now(),includes:{prompts:n.includePrompts,projects:n.includeProjects,assets:n.includeAssets},stats:{promptCount:0,videoPromptCount:0,imagePromptCount:0,folderCount:0,boardCount:0,assetCount:0,taskCount:0},workspaceState:o};if(n.includePrompts){e==null||e(10,"正在导出提示词...");const p=await this.collectPromptData();t.file("prompts.json",JSON.stringify(p,null,2)),m.stats.promptCount=p.promptHistory.length,m.stats.videoPromptCount=p.videoPromptHistory.length,m.stats.imagePromptCount=p.imagePromptHistory.length}n.includeProjects&&(e==null||e(25,"正在导出项目..."),await this.exportProjects(t,m,e)),n.includeAssets&&(e==null||e(50,"正在导出素材..."),await this.exportAssets(t,m,e)),e==null||e(80,"正在写入清单..."),t.file("manifest.json",JSON.stringify(m,null,2)),e==null||e(85,"正在压缩文件...");const u=await t.generateAsync({type:"blob",compression:"DEFLATE",compressionOptions:{level:6}},p=>{const i=85+Math.round(p.percent*.14);e==null||e(i,"正在压缩...")});return e==null||e(100,"导出完成"),u}async exportProjects(n,e,t){const s=n.folder("projects");if(!s)return;const[o,m]=await Promise.all([$.loadAllFolders(),$.loadAllBoards()]),u=this.buildFolderPathMap(o);for(const p of o){const i=u.get(p.id)||p.name;s.folder(i)}e.stats.folderCount=o.length;for(let p=0;p<m.length;p++){const i=m[p],b=i.folderId?u.get(i.folderId):null,j=ie(i.name),c=b?`${b}/${j}.drawnix`:`${j}.drawnix`,x={type:ne.drawnix,version:re.drawnix,source:"backup",elements:i.elements||[],viewport:i.viewport||{zoom:1},theme:i.theme,boardMeta:{id:i.id,name:i.name,folderId:i.folderId,order:i.order,createdAt:i.createdAt,updatedAt:i.updatedAt}};if(s.file(c,JSON.stringify(x,null,2)),t&&m.length>0){const f=25+Math.round((p+1)/m.length*20);t(f,`正在导出画板 (${p+1}/${m.length})...`)}}e.stats.boardCount=m.length}buildFolderPathMap(n){const e=new Map,t=new Map;for(const o of n)t.set(o.id,o);const s=o=>{if(e.has(o))return e.get(o);const m=t.get(o);if(!m)return"";const u=ie(m.name);if(m.parentId){const p=s(m.parentId),i=p?`${p}/${u}`:u;return e.set(o,i),i}return e.set(o,u),u};for(const o of n)s(o.id);return e}async exportAssets(n,e,t){var a;const s=n.folder("assets");if(!s)return;const o=new Set;let m=0;const u=K.createInstance({name:P.STORAGE_NAME,storeName:P.STORE_NAME}),p=await u.keys(),i=p.length;for(let r=0;r<p.length;r++){try{const d=await u.getItem(p[r]);if(d){s.file(`${d.id}.meta.json`,JSON.stringify(d,null,2));const h=await F.getCachedBlob(d.url);if(h){const g=L(d.mimeType);s.file(`${d.id}${g}`,h),o.add(d.url),m++}}}catch(d){console.warn(`[BackupRestore] Failed to load asset ${p[r]}:`,d)}if(t&&i>0){const d=50+Math.round((r+1)/i*15);t(d,`正在导出本地素材 (${r+1}/${i})...`)}}const j=(await F.getAllCacheMetadata()).filter(r=>!o.has(r.url)),c=j.length;for(let r=0;r<j.length;r++){const d=j[r];try{const h=((a=d.metadata)==null?void 0:a.taskId)||this.generateIdFromUrl(d.url),g={id:h,url:d.url,type:d.type==="video"?"VIDEO":"IMAGE",mimeType:d.mimeType,size:d.size,source:"AI_GENERATED",createdAt:d.cachedAt,updatedAt:d.lastUsed,metadata:d.metadata};s.file(`${h}.meta.json`,JSON.stringify(g,null,2));const v=await F.getCachedBlob(d.url);if(v){const _=L(d.mimeType);s.file(`${h}${_}`,v),o.add(d.url),m++}}catch(h){console.warn(`[BackupRestore] Failed to export cached media ${d.url}:`,h)}if(t&&c>0){const h=65+Math.round((r+1)/c*10);t(h,`正在导出缓存媒体 (${r+1}/${c})...`)}}e.stats.assetCount=m,t==null||t(75,"正在导出任务数据...");const f=H.getAllTasks().filter(r=>{var d;return r.status===Y.COMPLETED&&(r.type===U.IMAGE||r.type===U.VIDEO)&&((d=r.result)==null?void 0:d.url)});f.length>0&&(n.file("tasks.json",JSON.stringify(f,null,2)),e.stats.taskCount=f.length)}generateIdFromUrl(n){let e=0;for(let t=0;t<n.length;t++){const s=n.charCodeAt(t);e=(e<<5)-e+s,e=e&e}return`cache-${Math.abs(e).toString(36)}`}async importFromZip(n,e){const t={success:!1,prompts:{imported:0,skipped:0},projects:{folders:0,boards:0,merged:0,skipped:0},assets:{imported:0,skipped:0},tasks:{imported:0,skipped:0},errors:[]};try{e==null||e(5,"正在读取文件...");const s=await Z.loadAsync(n);e==null||e(10,"正在验证文件格式...");const o=s.file("manifest.json");if(!o)throw new Error("无效的备份文件:未找到 manifest.json");const m=await o.async("string"),u=JSON.parse(m);if(u.signature!==se)throw new Error("无效的备份文件:签名不匹配");if(u.includes.prompts){e==null||e(20,"正在导入提示词...");const p=s.file("prompts.json");if(p){const i=await p.async("string"),b=JSON.parse(i);t.prompts=await this.importPromptData(b)}}u.includes.projects&&(e==null||e(40,"正在导入项目..."),t.projects=await this.importProjects(s,e)),u.includes.assets&&(e==null||e(60,"正在导入素材..."),t.assets=await this.importAssets(s,e),e==null||e(85,"正在导入任务数据..."),t.tasks=await this.importTasks(s)),(t.projects.folders>0||t.projects.boards>0)&&await V.reload(),u.workspaceState&&(t.workspaceState=u.workspaceState),t.success=t.errors.length===0,e==null||e(100,"导入完成")}catch(s){const o=s instanceof Error?s.message:String(s);t.errors.push(o)}return t}downloadZip(n,e){const t=new Date,s=t.toISOString().split("T")[0],o=t.toTimeString().split(" ")[0].replace(/:/g,""),m=`aitu_backup_${s}_${o}.zip`,u=URL.createObjectURL(n),p=document.createElement("a");p.href=u,p.download=e||m,document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(u)}async collectPromptData(){await q();const n=Q();let e=X(),t=ee();const s=H.getTasksByStatus(Y.COMPLETED),o=s.filter(c=>{var x;return c.type===U.IMAGE&&((x=c.params)==null?void 0:x.prompt)}).map(c=>({id:`task_${c.id}`,content:c.params.prompt.trim(),timestamp:c.completedAt||c.createdAt})).filter(c=>c.content.length>0),m=s.filter(c=>{var x;return c.type===U.VIDEO&&((x=c.params)==null?void 0:x.prompt)}).map(c=>({id:`task_${c.id}`,content:c.params.prompt.trim(),timestamp:c.completedAt||c.createdAt})).filter(c=>c.content.length>0),u=new Set(t.map(c=>c.content)),p=o.filter(c=>!u.has(c.content));t=[...t,...p];const i=new Set(e.map(c=>c.content)),b=m.filter(c=>!i.has(c.content));e=[...e,...b];const j=await O.get(R.PRESET_SETTINGS);return{promptHistory:n,videoPromptHistory:e,imagePromptHistory:t,presetSettings:j||{image:{pinnedPrompts:[],deletedPrompts:[]},video:{pinnedPrompts:[],deletedPrompts:[]}}}}async importPromptData(n){let e=0,t=0;const s=n.promptHistory||[],o=n.videoPromptHistory||[],m=n.imagePromptHistory||[];await q();const u=Q(),p=X(),i=ee(),b=new Set(u.map(k=>k.id)),j=new Set(u.map(k=>k.content)),c=s.filter(k=>b.has(k.id)||j.has(k.content)?(t++,!1):(e++,!0)),x=new Set(p.map(k=>k.id)),f=new Set(p.map(k=>k.content)),a=o.filter(k=>x.has(k.id)||f.has(k.content)?(t++,!1):(e++,!0)),r=new Set(i.map(k=>k.id)),d=new Set(i.map(k=>k.content)),h=m.filter(k=>r.has(k.id)||d.has(k.content)?(t++,!1):(e++,!0)),g=[...u,...c],v=[...p,...a],_=[...i,...h];await O.set(R.PROMPT_HISTORY,g),await O.set(R.VIDEO_PROMPT_HISTORY,v),await O.set(R.IMAGE_PROMPT_HISTORY,_);const S=await O.get(R.PRESET_SETTINGS);if(S&&n.presetSettings){const k={image:{pinnedPrompts:[...new Set([...S.image.pinnedPrompts,...n.presetSettings.image.pinnedPrompts])],deletedPrompts:[...new Set([...S.image.deletedPrompts,...n.presetSettings.image.deletedPrompts])]},video:{pinnedPrompts:[...new Set([...S.video.pinnedPrompts,...n.presetSettings.video.pinnedPrompts])],deletedPrompts:[...new Set([...S.video.deletedPrompts,...n.presetSettings.video.deletedPrompts])]}};await O.set(R.PRESET_SETTINGS,k)}else n.presetSettings&&await O.set(R.PRESET_SETTINGS,n.presetSettings);return await oe(),{imported:e,skipped:t}}async importProjects(n,e){let t=0,s=0,o=0,m=0;const u=await $.loadAllFolders(),p=await $.loadAllBoards(),i=new Set(p.map(f=>f.id)),b=Object.keys(n.files).filter(f=>f.startsWith("projects/")&&f.endsWith(".drawnix")&&!f.includes("/_"));if(b.length===0)return{folders:0,boards:0,merged:0,skipped:0};const j=new Set,c=new Map;for(const f of b){const r=f.replace(/^projects\//,"").split("/");if(r.length>1){let d="";for(let h=0;h<r.length-1;h++)d=d?`${d}/${r[h]}`:r[h],j.add(d)}}const x=Array.from(j).sort((f,a)=>{const r=f.split("/").length,d=a.split("/").length;return r-d||f.localeCompare(a)});for(let f=0;f<x.length;f++){const a=x[f],r=a.split("/"),d=r[r.length-1],h=r.length>1?r.slice(0,-1).join("/"):null,g=h&&c.get(h)||null,v=this.generateId();c.set(a,v);const _=u.find(k=>k.name===d&&k.parentId===g);if(_){c.set(a,_.id),m++;continue}const S={id:v,name:d,parentId:g,order:f,isExpanded:!0,createdAt:Date.now(),updatedAt:Date.now()};await $.saveFolder(S),t++}for(let f=0;f<b.length;f++){const a=b[f];try{const r=n.file(a);if(r){const d=await r.async("string"),h=JSON.parse(d),g=h.boardMeta,_=a.replace(/^projects\//,"").split("/"),S=_.length>1?_.slice(0,-1).join("/"):null,k=S&&(c.get(S)||(g==null?void 0:g.folderId))||null,G=_[_.length-1]||"unnamed.drawnix",D=(g==null?void 0:g.name)||G.replace(".drawnix","");if(g!=null&&g.id&&i.has(g.id)){const w=p.find(y=>y.id===g.id);if(w){const y=new Set((w.elements||[]).map(A=>A.id).filter(A=>!!A)),B=(h.elements||[]).filter(A=>A.id?!y.has(A.id):!0),N=[...w.elements||[],...ae(B)],J={...w,elements:N,viewport:h.viewport||w.viewport,theme:h.theme||w.theme,updatedAt:Date.now()};await $.saveBoard(J),o++;continue}}const M={id:(g==null?void 0:g.id)||this.generateId(),name:D,folderId:k,order:(g==null?void 0:g.order)??f,elements:ae(h.elements||[]),viewport:h.viewport,theme:h.theme,createdAt:(g==null?void 0:g.createdAt)||Date.now(),updatedAt:(g==null?void 0:g.updatedAt)||Date.now()};await $.saveBoard(M),s++}}catch(r){console.warn(`[BackupRestore] Failed to import board ${a}:`,r)}if(e&&b.length>0){const r=40+Math.round((f+1)/b.length*15);e(r,`正在导入画板 (${f+1}/${b.length})...`)}}return{folders:t,boards:s,merged:o,skipped:m}}async importAssets(n,e){var b,j,c;let t=0,s=0;const o=Object.keys(n.files).filter(x=>x.startsWith("assets/")&&x.endsWith(".meta.json"));if(o.length===0)return{imported:0,skipped:0};const m=K.createInstance({name:P.STORAGE_NAME,storeName:P.STORE_NAME}),u=await m.keys(),p=new Set(u),i=new Set(await F.getAllCachedUrls());for(let x=0;x<o.length;x++){const f=o[x],a=f.replace("assets/","").replace(".meta.json","");try{const r=n.file(f);if(!r){s++;continue}const d=await r.async("string"),h=JSON.parse(d),g=h.source==="AI_GENERATED";if(g){if(i.has(h.url)){s++;continue}}else if(p.has(a)){s++;continue}const v=[".jpg",".png",".gif",".webp",".mp4",".webm",".mov",".svg"];let _=null;for(const S of v){const k=n.file(`assets/${a}${S}`);if(k){_=await k.async("blob");break}}if(!_&&h.mimeType){const S=L(h.mimeType);if(S){const k=n.file(`assets/${a}${S}`);k&&(_=await k.async("blob"))}}if(_){const S=h.type==="VIDEO"?"video":"image";await F.cacheMediaFromBlob(h.url,_,S,{taskId:((b=h.metadata)==null?void 0:b.taskId)||a,prompt:(j=h.metadata)==null?void 0:j.prompt,model:(c=h.metadata)==null?void 0:c.model}),g||await m.setItem(a,h),t++}else console.warn(`[BackupRestore] No media file found for asset ${a}, skipping`),s++}catch(r){console.warn(`[BackupRestore] Failed to import asset ${a}:`,r),s++}if(e&&o.length>0){const r=60+Math.round((x+1)/o.length*35);e(r,`正在导入素材 (${x+1}/${o.length})...`)}}return{imported:t,skipped:s}}async importTasks(n){let e=0,t=0;const s=n.file("tasks.json");if(!s)return{imported:0,skipped:0};try{const o=await s.async("string"),m=JSON.parse(o);if(!Array.isArray(m)||m.length===0)return{imported:0,skipped:0};const u=H.getAllTasks(),p=new Set(u.map(b=>b.id)),i=m.filter(b=>p.has(b.id)?(t++,!1):!0);i.length>0&&(await H.restoreTasks(i),e=i.length)}catch(o){console.warn("[BackupRestore] Failed to import tasks:",o)}return{imported:e,skipped:t}}generateId(){return`${Date.now().toString(36)}-${Math.random().toString(36).substring(2,11)}`}}const W=new ue,ge=({open:E,onOpenChange:n,container:e,onSwitchBoard:t,onBeforeImport:s})=>{var M;const[o,m]=I.useState("backup"),[u,p]=I.useState({includePrompts:!0,includeProjects:!0,includeAssets:!0}),[i,b]=I.useState(!1),[j,c]=I.useState(0),[x,f]=I.useState(""),[a,r]=I.useState(null),[d,h]=I.useState(null),g=I.useRef(null),v=I.useCallback(async w=>{if(!w.currentBoardId||!t)return;const y=V.getBoard(w.currentBoardId);if(!y)return;const T=V.getCurrentBoard();if(!T||!T.elements||T.elements.length===0)await t(w.currentBoardId,w.viewport),C.success(`已切换到画板「${y.name}」`);else{const N=ce.confirm({header:"恢复画布状态",body:`备份时正在编辑画板「${w.currentBoardName||y.name}」,是否切换到该画板?`,confirmBtn:"切换",cancelBtn:"取消",onConfirm:async()=>{await t(w.currentBoardId,w.viewport),C.success(`已切换到画板「${y.name}」`),N.destroy()},onCancel:()=>{N.destroy()}})}},[t]),_=I.useCallback(async()=>{if(!i){if(d&&(await v(d),h(null)),a&&a.tasks&&a.tasks.imported>0){window.location.reload();return}n(!1),c(0),f(""),r(null)}},[i,n,a,d,v]),S=I.useCallback(async()=>{if(!u.includePrompts&&!u.includeProjects&&!u.includeAssets){C.warning("请至少选择一项要备份的内容");return}b(!0),c(0),f("正在准备...");try{const w=await W.exportToZip(u,(y,T)=>{c(y),f(T)});W.downloadZip(w),C.success("备份成功!"),_()}catch(w){console.error("[BackupRestore] Export failed:",w),C.error("备份失败,请重试")}finally{b(!1)}},[u,_]),k=I.useCallback(()=>{var w;(w=g.current)==null||w.click()},[]),G=I.useCallback(async w=>{var T,B;const y=(T=w.target.files)==null?void 0:T[0];if(y){if(!y.name.endsWith(".zip")){C.warning("请选择 ZIP 格式的备份文件");return}b(!0),c(0),f("正在保存当前画板..."),r(null);try{s&&await s(),f("正在读取文件...");const N=await W.importFromZip(y,(J,A)=>{c(J),f(A)});r(N),(B=N.workspaceState)!=null&&B.currentBoardId&&h(N.workspaceState),N.success?C.success("导入成功!"):N.errors.length>0&&C.warning("导入完成,但有部分错误")}catch(N){console.error("[BackupRestore] Import failed:",N),C.error("导入失败,请检查文件格式")}finally{b(!1),g.current&&(g.current.value="")}}},[s]),D=I.useCallback((w,y)=>{p(T=>({...T,[w]:y}))},[]);return l.jsx(le,{open:E,onOpenChange:_,children:l.jsxs(de,{className:"backup-restore-dialog",container:e,children:[l.jsx("h2",{className:"backup-restore-dialog__title",children:"备份 / 恢复"}),l.jsxs("div",{className:"backup-restore-dialog__tabs",children:[l.jsx("button",{className:`backup-restore-dialog__tab ${o==="backup"?"backup-restore-dialog__tab--active":""}`,onClick:()=>m("backup"),disabled:i,children:"备份"}),l.jsx("button",{className:`backup-restore-dialog__tab ${o==="restore"?"backup-restore-dialog__tab--active":""}`,onClick:()=>m("restore"),disabled:i,children:"恢复"})]}),o==="backup"&&l.jsxs("div",{className:"backup-restore-dialog__panel",children:[l.jsx("p",{className:"backup-restore-dialog__description",children:"选择要备份的内容,将导出为 ZIP 压缩包:"}),l.jsxs("div",{className:"backup-restore-dialog__options",children:[l.jsx(z,{checked:u.includePrompts,onChange:w=>D("includePrompts",w),disabled:i,children:l.jsxs("div",{className:"backup-restore-dialog__option-content",children:[l.jsx("span",{className:"backup-restore-dialog__option-title",children:"提示词"}),l.jsx("span",{className:"backup-restore-dialog__option-desc",children:"包含图片和视频生成的历史提示词"})]})}),l.jsx(z,{checked:u.includeProjects,onChange:w=>D("includeProjects",w),disabled:i,children:l.jsxs("div",{className:"backup-restore-dialog__option-content",children:[l.jsx("span",{className:"backup-restore-dialog__option-title",children:"项目"}),l.jsx("span",{className:"backup-restore-dialog__option-desc",children:"包含所有文件夹和画板"})]})}),l.jsx(z,{checked:u.includeAssets,onChange:w=>D("includeAssets",w),disabled:i,children:l.jsxs("div",{className:"backup-restore-dialog__option-content",children:[l.jsx("span",{className:"backup-restore-dialog__option-title",children:"素材库"}),l.jsx("span",{className:"backup-restore-dialog__option-desc",children:"包含所有本地上传的图片和视频"})]})})]}),i&&l.jsxs("div",{className:"backup-restore-dialog__progress",children:[l.jsx(te,{percentage:j,theme:"line"}),l.jsx("span",{className:"backup-restore-dialog__progress-text",children:x})]}),l.jsxs("div",{className:"backup-restore-dialog__actions",children:[l.jsx("button",{className:"backup-restore-dialog__button backup-restore-dialog__button--cancel",onClick:_,disabled:i,children:"取消"}),l.jsx("button",{className:"backup-restore-dialog__button backup-restore-dialog__button--primary",onClick:S,disabled:i,children:i?"正在备份...":"开始备份"})]})]}),o==="restore"&&l.jsxs("div",{className:"backup-restore-dialog__panel",children:[l.jsx("p",{className:"backup-restore-dialog__description",children:"选择备份文件进行恢复,数据将增量导入(不会覆盖现有内容):"}),l.jsxs("div",{className:"backup-restore-dialog__dropzone",onClick:k,children:[l.jsx(pe,{className:"backup-restore-dialog__dropzone-icon"}),l.jsx("span",{className:"backup-restore-dialog__dropzone-text",children:"点击选择备份文件 (.zip)"}),l.jsx("input",{ref:g,type:"file",accept:".zip",onChange:G,style:{display:"none"}})]}),i&&l.jsxs("div",{className:"backup-restore-dialog__progress",children:[l.jsx(te,{percentage:j,theme:"line"}),l.jsx("span",{className:"backup-restore-dialog__progress-text",children:x})]}),a&&l.jsxs("div",{className:"backup-restore-dialog__result",children:[l.jsx("h4",{className:"backup-restore-dialog__result-title",children:a.success?"导入完成":"导入完成(有错误)"}),l.jsxs("ul",{className:"backup-restore-dialog__result-list",children:[(a.prompts.imported>0||a.prompts.skipped>0)&&l.jsxs("li",{children:["提示词:导入 ",a.prompts.imported," 条,跳过 ",a.prompts.skipped," 条"]}),(a.projects.folders>0||a.projects.boards>0||a.projects.merged>0)&&l.jsxs("li",{children:["项目:导入 ",a.projects.folders," 个文件夹,",a.projects.boards," 个画板",a.projects.merged>0&&`,合并 ${a.projects.merged} 个画板`]}),(a.assets.imported>0||a.assets.skipped>0)&&l.jsxs("li",{children:["素材:导入 ",a.assets.imported," 个,跳过 ",a.assets.skipped," 个"]}),a.tasks&&(a.tasks.imported>0||a.tasks.skipped>0)&&l.jsxs("li",{children:["任务:导入 ",a.tasks.imported," 个,跳过 ",a.tasks.skipped," 个"]})]}),a.errors.length>0&&l.jsxs("div",{className:"backup-restore-dialog__result-errors",children:[l.jsx("strong",{children:"错误信息:"}),l.jsx("ul",{children:a.errors.map((w,y)=>l.jsx("li",{children:w},y))})]})]}),l.jsx("div",{className:"backup-restore-dialog__actions",children:l.jsx("button",{className:"backup-restore-dialog__button backup-restore-dialog__button--cancel",onClick:_,disabled:i,children:a?((M=a.tasks)==null?void 0:M.imported)>0?"完成并刷新":"完成":"取消"})})]})]})})};export{ge as BackupRestoreDialog};
|
|
1
|
+
import{a8 as Z,a9 as V,aa as $,ab as ne,ac as re,ad as K,ae as P,u as F,af as H,$ as Y,c as U,ag as q,ah as Q,ai as X,aj as ee,S as O,U as R,ak as oe,r as I,W as C,a2 as ce,J as l,K as le,L as de,al as z,am as te}from"./index-Ds1UcDjn.js";import{U as pe}from"./upload-Crej215t.js";const me=2,se="aitu-backup";function ae(E){return E.map(n=>n.id?n:{...n,id:`imported-${Date.now()}-${Math.random().toString(36).slice(2,9)}`})}function L(E){return{"image/jpeg":".jpg","image/jpg":".jpg","image/png":".png","image/gif":".gif","image/webp":".webp","image/svg+xml":".svg","video/mp4":".mp4","video/webm":".webm","video/quicktime":".mov"}[E]||""}function ie(E){return E.replace(/[<>:"/\\|?*]/g,"_").replace(/\s+/g," ").trim()||"unnamed"}class ue{async exportToZip(n,e){const t=new Z;e==null||e(5,"正在准备数据...");const s=V.getCurrentBoard(),o={currentBoardId:(s==null?void 0:s.id)||null,currentBoardName:s==null?void 0:s.name,viewport:s==null?void 0:s.viewport},m={signature:se,version:me,createdAt:Date.now(),includes:{prompts:n.includePrompts,projects:n.includeProjects,assets:n.includeAssets},stats:{promptCount:0,videoPromptCount:0,imagePromptCount:0,folderCount:0,boardCount:0,assetCount:0,taskCount:0},workspaceState:o};if(n.includePrompts){e==null||e(10,"正在导出提示词...");const p=await this.collectPromptData();t.file("prompts.json",JSON.stringify(p,null,2)),m.stats.promptCount=p.promptHistory.length,m.stats.videoPromptCount=p.videoPromptHistory.length,m.stats.imagePromptCount=p.imagePromptHistory.length}n.includeProjects&&(e==null||e(25,"正在导出项目..."),await this.exportProjects(t,m,e)),n.includeAssets&&(e==null||e(50,"正在导出素材..."),await this.exportAssets(t,m,e)),e==null||e(80,"正在写入清单..."),t.file("manifest.json",JSON.stringify(m,null,2)),e==null||e(85,"正在压缩文件...");const u=await t.generateAsync({type:"blob",compression:"DEFLATE",compressionOptions:{level:6}},p=>{const i=85+Math.round(p.percent*.14);e==null||e(i,"正在压缩...")});return e==null||e(100,"导出完成"),u}async exportProjects(n,e,t){const s=n.folder("projects");if(!s)return;const[o,m]=await Promise.all([$.loadAllFolders(),$.loadAllBoards()]),u=this.buildFolderPathMap(o);for(const p of o){const i=u.get(p.id)||p.name;s.folder(i)}e.stats.folderCount=o.length;for(let p=0;p<m.length;p++){const i=m[p],b=i.folderId?u.get(i.folderId):null,j=ie(i.name),c=b?`${b}/${j}.drawnix`:`${j}.drawnix`,x={type:ne.drawnix,version:re.drawnix,source:"backup",elements:i.elements||[],viewport:i.viewport||{zoom:1},theme:i.theme,boardMeta:{id:i.id,name:i.name,folderId:i.folderId,order:i.order,createdAt:i.createdAt,updatedAt:i.updatedAt}};if(s.file(c,JSON.stringify(x,null,2)),t&&m.length>0){const f=25+Math.round((p+1)/m.length*20);t(f,`正在导出画板 (${p+1}/${m.length})...`)}}e.stats.boardCount=m.length}buildFolderPathMap(n){const e=new Map,t=new Map;for(const o of n)t.set(o.id,o);const s=o=>{if(e.has(o))return e.get(o);const m=t.get(o);if(!m)return"";const u=ie(m.name);if(m.parentId){const p=s(m.parentId),i=p?`${p}/${u}`:u;return e.set(o,i),i}return e.set(o,u),u};for(const o of n)s(o.id);return e}async exportAssets(n,e,t){var a;const s=n.folder("assets");if(!s)return;const o=new Set;let m=0;const u=K.createInstance({name:P.STORAGE_NAME,storeName:P.STORE_NAME}),p=await u.keys(),i=p.length;for(let r=0;r<p.length;r++){try{const d=await u.getItem(p[r]);if(d){s.file(`${d.id}.meta.json`,JSON.stringify(d,null,2));const h=await F.getCachedBlob(d.url);if(h){const g=L(d.mimeType);s.file(`${d.id}${g}`,h),o.add(d.url),m++}}}catch(d){console.warn(`[BackupRestore] Failed to load asset ${p[r]}:`,d)}if(t&&i>0){const d=50+Math.round((r+1)/i*15);t(d,`正在导出本地素材 (${r+1}/${i})...`)}}const j=(await F.getAllCacheMetadata()).filter(r=>!o.has(r.url)),c=j.length;for(let r=0;r<j.length;r++){const d=j[r];try{const h=((a=d.metadata)==null?void 0:a.taskId)||this.generateIdFromUrl(d.url),g={id:h,url:d.url,type:d.type==="video"?"VIDEO":"IMAGE",mimeType:d.mimeType,size:d.size,source:"AI_GENERATED",createdAt:d.cachedAt,updatedAt:d.lastUsed,metadata:d.metadata};s.file(`${h}.meta.json`,JSON.stringify(g,null,2));const v=await F.getCachedBlob(d.url);if(v){const _=L(d.mimeType);s.file(`${h}${_}`,v),o.add(d.url),m++}}catch(h){console.warn(`[BackupRestore] Failed to export cached media ${d.url}:`,h)}if(t&&c>0){const h=65+Math.round((r+1)/c*10);t(h,`正在导出缓存媒体 (${r+1}/${c})...`)}}e.stats.assetCount=m,t==null||t(75,"正在导出任务数据...");const f=H.getAllTasks().filter(r=>{var d;return r.status===Y.COMPLETED&&(r.type===U.IMAGE||r.type===U.VIDEO)&&((d=r.result)==null?void 0:d.url)});f.length>0&&(n.file("tasks.json",JSON.stringify(f,null,2)),e.stats.taskCount=f.length)}generateIdFromUrl(n){let e=0;for(let t=0;t<n.length;t++){const s=n.charCodeAt(t);e=(e<<5)-e+s,e=e&e}return`cache-${Math.abs(e).toString(36)}`}async importFromZip(n,e){const t={success:!1,prompts:{imported:0,skipped:0},projects:{folders:0,boards:0,merged:0,skipped:0},assets:{imported:0,skipped:0},tasks:{imported:0,skipped:0},errors:[]};try{e==null||e(5,"正在读取文件...");const s=await Z.loadAsync(n);e==null||e(10,"正在验证文件格式...");const o=s.file("manifest.json");if(!o)throw new Error("无效的备份文件:未找到 manifest.json");const m=await o.async("string"),u=JSON.parse(m);if(u.signature!==se)throw new Error("无效的备份文件:签名不匹配");if(u.includes.prompts){e==null||e(20,"正在导入提示词...");const p=s.file("prompts.json");if(p){const i=await p.async("string"),b=JSON.parse(i);t.prompts=await this.importPromptData(b)}}u.includes.projects&&(e==null||e(40,"正在导入项目..."),t.projects=await this.importProjects(s,e)),u.includes.assets&&(e==null||e(60,"正在导入素材..."),t.assets=await this.importAssets(s,e),e==null||e(85,"正在导入任务数据..."),t.tasks=await this.importTasks(s)),(t.projects.folders>0||t.projects.boards>0)&&await V.reload(),u.workspaceState&&(t.workspaceState=u.workspaceState),t.success=t.errors.length===0,e==null||e(100,"导入完成")}catch(s){const o=s instanceof Error?s.message:String(s);t.errors.push(o)}return t}downloadZip(n,e){const t=new Date,s=t.toISOString().split("T")[0],o=t.toTimeString().split(" ")[0].replace(/:/g,""),m=`aitu_backup_${s}_${o}.zip`,u=URL.createObjectURL(n),p=document.createElement("a");p.href=u,p.download=e||m,document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(u)}async collectPromptData(){await q();const n=Q();let e=X(),t=ee();const s=H.getTasksByStatus(Y.COMPLETED),o=s.filter(c=>{var x;return c.type===U.IMAGE&&((x=c.params)==null?void 0:x.prompt)}).map(c=>({id:`task_${c.id}`,content:c.params.prompt.trim(),timestamp:c.completedAt||c.createdAt})).filter(c=>c.content.length>0),m=s.filter(c=>{var x;return c.type===U.VIDEO&&((x=c.params)==null?void 0:x.prompt)}).map(c=>({id:`task_${c.id}`,content:c.params.prompt.trim(),timestamp:c.completedAt||c.createdAt})).filter(c=>c.content.length>0),u=new Set(t.map(c=>c.content)),p=o.filter(c=>!u.has(c.content));t=[...t,...p];const i=new Set(e.map(c=>c.content)),b=m.filter(c=>!i.has(c.content));e=[...e,...b];const j=await O.get(R.PRESET_SETTINGS);return{promptHistory:n,videoPromptHistory:e,imagePromptHistory:t,presetSettings:j||{image:{pinnedPrompts:[],deletedPrompts:[]},video:{pinnedPrompts:[],deletedPrompts:[]}}}}async importPromptData(n){let e=0,t=0;const s=n.promptHistory||[],o=n.videoPromptHistory||[],m=n.imagePromptHistory||[];await q();const u=Q(),p=X(),i=ee(),b=new Set(u.map(k=>k.id)),j=new Set(u.map(k=>k.content)),c=s.filter(k=>b.has(k.id)||j.has(k.content)?(t++,!1):(e++,!0)),x=new Set(p.map(k=>k.id)),f=new Set(p.map(k=>k.content)),a=o.filter(k=>x.has(k.id)||f.has(k.content)?(t++,!1):(e++,!0)),r=new Set(i.map(k=>k.id)),d=new Set(i.map(k=>k.content)),h=m.filter(k=>r.has(k.id)||d.has(k.content)?(t++,!1):(e++,!0)),g=[...u,...c],v=[...p,...a],_=[...i,...h];await O.set(R.PROMPT_HISTORY,g),await O.set(R.VIDEO_PROMPT_HISTORY,v),await O.set(R.IMAGE_PROMPT_HISTORY,_);const S=await O.get(R.PRESET_SETTINGS);if(S&&n.presetSettings){const k={image:{pinnedPrompts:[...new Set([...S.image.pinnedPrompts,...n.presetSettings.image.pinnedPrompts])],deletedPrompts:[...new Set([...S.image.deletedPrompts,...n.presetSettings.image.deletedPrompts])]},video:{pinnedPrompts:[...new Set([...S.video.pinnedPrompts,...n.presetSettings.video.pinnedPrompts])],deletedPrompts:[...new Set([...S.video.deletedPrompts,...n.presetSettings.video.deletedPrompts])]}};await O.set(R.PRESET_SETTINGS,k)}else n.presetSettings&&await O.set(R.PRESET_SETTINGS,n.presetSettings);return await oe(),{imported:e,skipped:t}}async importProjects(n,e){let t=0,s=0,o=0,m=0;const u=await $.loadAllFolders(),p=await $.loadAllBoards(),i=new Set(p.map(f=>f.id)),b=Object.keys(n.files).filter(f=>f.startsWith("projects/")&&f.endsWith(".drawnix")&&!f.includes("/_"));if(b.length===0)return{folders:0,boards:0,merged:0,skipped:0};const j=new Set,c=new Map;for(const f of b){const r=f.replace(/^projects\//,"").split("/");if(r.length>1){let d="";for(let h=0;h<r.length-1;h++)d=d?`${d}/${r[h]}`:r[h],j.add(d)}}const x=Array.from(j).sort((f,a)=>{const r=f.split("/").length,d=a.split("/").length;return r-d||f.localeCompare(a)});for(let f=0;f<x.length;f++){const a=x[f],r=a.split("/"),d=r[r.length-1],h=r.length>1?r.slice(0,-1).join("/"):null,g=h&&c.get(h)||null,v=this.generateId();c.set(a,v);const _=u.find(k=>k.name===d&&k.parentId===g);if(_){c.set(a,_.id),m++;continue}const S={id:v,name:d,parentId:g,order:f,isExpanded:!0,createdAt:Date.now(),updatedAt:Date.now()};await $.saveFolder(S),t++}for(let f=0;f<b.length;f++){const a=b[f];try{const r=n.file(a);if(r){const d=await r.async("string"),h=JSON.parse(d),g=h.boardMeta,_=a.replace(/^projects\//,"").split("/"),S=_.length>1?_.slice(0,-1).join("/"):null,k=S&&(c.get(S)||(g==null?void 0:g.folderId))||null,G=_[_.length-1]||"unnamed.drawnix",D=(g==null?void 0:g.name)||G.replace(".drawnix","");if(g!=null&&g.id&&i.has(g.id)){const w=p.find(y=>y.id===g.id);if(w){const y=new Set((w.elements||[]).map(A=>A.id).filter(A=>!!A)),B=(h.elements||[]).filter(A=>A.id?!y.has(A.id):!0),N=[...w.elements||[],...ae(B)],J={...w,elements:N,viewport:h.viewport||w.viewport,theme:h.theme||w.theme,updatedAt:Date.now()};await $.saveBoard(J),o++;continue}}const M={id:(g==null?void 0:g.id)||this.generateId(),name:D,folderId:k,order:(g==null?void 0:g.order)??f,elements:ae(h.elements||[]),viewport:h.viewport,theme:h.theme,createdAt:(g==null?void 0:g.createdAt)||Date.now(),updatedAt:(g==null?void 0:g.updatedAt)||Date.now()};await $.saveBoard(M),s++}}catch(r){console.warn(`[BackupRestore] Failed to import board ${a}:`,r)}if(e&&b.length>0){const r=40+Math.round((f+1)/b.length*15);e(r,`正在导入画板 (${f+1}/${b.length})...`)}}return{folders:t,boards:s,merged:o,skipped:m}}async importAssets(n,e){var b,j,c;let t=0,s=0;const o=Object.keys(n.files).filter(x=>x.startsWith("assets/")&&x.endsWith(".meta.json"));if(o.length===0)return{imported:0,skipped:0};const m=K.createInstance({name:P.STORAGE_NAME,storeName:P.STORE_NAME}),u=await m.keys(),p=new Set(u),i=new Set(await F.getAllCachedUrls());for(let x=0;x<o.length;x++){const f=o[x],a=f.replace("assets/","").replace(".meta.json","");try{const r=n.file(f);if(!r){s++;continue}const d=await r.async("string"),h=JSON.parse(d),g=h.source==="AI_GENERATED";if(g){if(i.has(h.url)){s++;continue}}else if(p.has(a)){s++;continue}const v=[".jpg",".png",".gif",".webp",".mp4",".webm",".mov",".svg"];let _=null;for(const S of v){const k=n.file(`assets/${a}${S}`);if(k){_=await k.async("blob");break}}if(!_&&h.mimeType){const S=L(h.mimeType);if(S){const k=n.file(`assets/${a}${S}`);k&&(_=await k.async("blob"))}}if(_){const S=h.type==="VIDEO"?"video":"image";await F.cacheMediaFromBlob(h.url,_,S,{taskId:((b=h.metadata)==null?void 0:b.taskId)||a,prompt:(j=h.metadata)==null?void 0:j.prompt,model:(c=h.metadata)==null?void 0:c.model}),g||await m.setItem(a,h),t++}else console.warn(`[BackupRestore] No media file found for asset ${a}, skipping`),s++}catch(r){console.warn(`[BackupRestore] Failed to import asset ${a}:`,r),s++}if(e&&o.length>0){const r=60+Math.round((x+1)/o.length*35);e(r,`正在导入素材 (${x+1}/${o.length})...`)}}return{imported:t,skipped:s}}async importTasks(n){let e=0,t=0;const s=n.file("tasks.json");if(!s)return{imported:0,skipped:0};try{const o=await s.async("string"),m=JSON.parse(o);if(!Array.isArray(m)||m.length===0)return{imported:0,skipped:0};const u=H.getAllTasks(),p=new Set(u.map(b=>b.id)),i=m.filter(b=>p.has(b.id)?(t++,!1):!0);i.length>0&&(await H.restoreTasks(i),e=i.length)}catch(o){console.warn("[BackupRestore] Failed to import tasks:",o)}return{imported:e,skipped:t}}generateId(){return`${Date.now().toString(36)}-${Math.random().toString(36).substring(2,11)}`}}const W=new ue,ge=({open:E,onOpenChange:n,container:e,onSwitchBoard:t,onBeforeImport:s})=>{var M;const[o,m]=I.useState("backup"),[u,p]=I.useState({includePrompts:!0,includeProjects:!0,includeAssets:!0}),[i,b]=I.useState(!1),[j,c]=I.useState(0),[x,f]=I.useState(""),[a,r]=I.useState(null),[d,h]=I.useState(null),g=I.useRef(null),v=I.useCallback(async w=>{if(!w.currentBoardId||!t)return;const y=V.getBoard(w.currentBoardId);if(!y)return;const T=V.getCurrentBoard();if(!T||!T.elements||T.elements.length===0)await t(w.currentBoardId,w.viewport),C.success(`已切换到画板「${y.name}」`);else{const N=ce.confirm({header:"恢复画布状态",body:`备份时正在编辑画板「${w.currentBoardName||y.name}」,是否切换到该画板?`,confirmBtn:"切换",cancelBtn:"取消",onConfirm:async()=>{await t(w.currentBoardId,w.viewport),C.success(`已切换到画板「${y.name}」`),N.destroy()},onCancel:()=>{N.destroy()}})}},[t]),_=I.useCallback(async()=>{if(!i){if(d&&(await v(d),h(null)),a&&a.tasks&&a.tasks.imported>0){window.location.reload();return}n(!1),c(0),f(""),r(null)}},[i,n,a,d,v]),S=I.useCallback(async()=>{if(!u.includePrompts&&!u.includeProjects&&!u.includeAssets){C.warning("请至少选择一项要备份的内容");return}b(!0),c(0),f("正在准备...");try{const w=await W.exportToZip(u,(y,T)=>{c(y),f(T)});W.downloadZip(w),C.success("备份成功!"),_()}catch(w){console.error("[BackupRestore] Export failed:",w),C.error("备份失败,请重试")}finally{b(!1)}},[u,_]),k=I.useCallback(()=>{var w;(w=g.current)==null||w.click()},[]),G=I.useCallback(async w=>{var T,B;const y=(T=w.target.files)==null?void 0:T[0];if(y){if(!y.name.endsWith(".zip")){C.warning("请选择 ZIP 格式的备份文件");return}b(!0),c(0),f("正在保存当前画板..."),r(null);try{s&&await s(),f("正在读取文件...");const N=await W.importFromZip(y,(J,A)=>{c(J),f(A)});r(N),(B=N.workspaceState)!=null&&B.currentBoardId&&h(N.workspaceState),N.success?C.success("导入成功!"):N.errors.length>0&&C.warning("导入完成,但有部分错误")}catch(N){console.error("[BackupRestore] Import failed:",N),C.error("导入失败,请检查文件格式")}finally{b(!1),g.current&&(g.current.value="")}}},[s]),D=I.useCallback((w,y)=>{p(T=>({...T,[w]:y}))},[]);return l.jsx(le,{open:E,onOpenChange:_,children:l.jsxs(de,{className:"backup-restore-dialog",container:e,children:[l.jsx("h2",{className:"backup-restore-dialog__title",children:"备份 / 恢复"}),l.jsxs("div",{className:"backup-restore-dialog__tabs",children:[l.jsx("button",{className:`backup-restore-dialog__tab ${o==="backup"?"backup-restore-dialog__tab--active":""}`,onClick:()=>m("backup"),disabled:i,children:"备份"}),l.jsx("button",{className:`backup-restore-dialog__tab ${o==="restore"?"backup-restore-dialog__tab--active":""}`,onClick:()=>m("restore"),disabled:i,children:"恢复"})]}),o==="backup"&&l.jsxs("div",{className:"backup-restore-dialog__panel",children:[l.jsx("p",{className:"backup-restore-dialog__description",children:"选择要备份的内容,将导出为 ZIP 压缩包:"}),l.jsxs("div",{className:"backup-restore-dialog__options",children:[l.jsx(z,{checked:u.includePrompts,onChange:w=>D("includePrompts",w),disabled:i,children:l.jsxs("div",{className:"backup-restore-dialog__option-content",children:[l.jsx("span",{className:"backup-restore-dialog__option-title",children:"提示词"}),l.jsx("span",{className:"backup-restore-dialog__option-desc",children:"包含图片和视频生成的历史提示词"})]})}),l.jsx(z,{checked:u.includeProjects,onChange:w=>D("includeProjects",w),disabled:i,children:l.jsxs("div",{className:"backup-restore-dialog__option-content",children:[l.jsx("span",{className:"backup-restore-dialog__option-title",children:"项目"}),l.jsx("span",{className:"backup-restore-dialog__option-desc",children:"包含所有文件夹和画板"})]})}),l.jsx(z,{checked:u.includeAssets,onChange:w=>D("includeAssets",w),disabled:i,children:l.jsxs("div",{className:"backup-restore-dialog__option-content",children:[l.jsx("span",{className:"backup-restore-dialog__option-title",children:"素材库"}),l.jsx("span",{className:"backup-restore-dialog__option-desc",children:"包含所有本地上传的图片和视频"})]})})]}),i&&l.jsxs("div",{className:"backup-restore-dialog__progress",children:[l.jsx(te,{percentage:j,theme:"line"}),l.jsx("span",{className:"backup-restore-dialog__progress-text",children:x})]}),l.jsxs("div",{className:"backup-restore-dialog__actions",children:[l.jsx("button",{className:"backup-restore-dialog__button backup-restore-dialog__button--cancel",onClick:_,disabled:i,children:"取消"}),l.jsx("button",{className:"backup-restore-dialog__button backup-restore-dialog__button--primary",onClick:S,disabled:i,children:i?"正在备份...":"开始备份"})]})]}),o==="restore"&&l.jsxs("div",{className:"backup-restore-dialog__panel",children:[l.jsx("p",{className:"backup-restore-dialog__description",children:"选择备份文件进行恢复,数据将增量导入(不会覆盖现有内容):"}),l.jsxs("div",{className:"backup-restore-dialog__dropzone",onClick:k,children:[l.jsx(pe,{className:"backup-restore-dialog__dropzone-icon"}),l.jsx("span",{className:"backup-restore-dialog__dropzone-text",children:"点击选择备份文件 (.zip)"}),l.jsx("input",{ref:g,type:"file",accept:".zip",onChange:G,style:{display:"none"}})]}),i&&l.jsxs("div",{className:"backup-restore-dialog__progress",children:[l.jsx(te,{percentage:j,theme:"line"}),l.jsx("span",{className:"backup-restore-dialog__progress-text",children:x})]}),a&&l.jsxs("div",{className:"backup-restore-dialog__result",children:[l.jsx("h4",{className:"backup-restore-dialog__result-title",children:a.success?"导入完成":"导入完成(有错误)"}),l.jsxs("ul",{className:"backup-restore-dialog__result-list",children:[(a.prompts.imported>0||a.prompts.skipped>0)&&l.jsxs("li",{children:["提示词:导入 ",a.prompts.imported," 条,跳过 ",a.prompts.skipped," 条"]}),(a.projects.folders>0||a.projects.boards>0||a.projects.merged>0)&&l.jsxs("li",{children:["项目:导入 ",a.projects.folders," 个文件夹,",a.projects.boards," 个画板",a.projects.merged>0&&`,合并 ${a.projects.merged} 个画板`]}),(a.assets.imported>0||a.assets.skipped>0)&&l.jsxs("li",{children:["素材:导入 ",a.assets.imported," 个,跳过 ",a.assets.skipped," 个"]}),a.tasks&&(a.tasks.imported>0||a.tasks.skipped>0)&&l.jsxs("li",{children:["任务:导入 ",a.tasks.imported," 个,跳过 ",a.tasks.skipped," 个"]})]}),a.errors.length>0&&l.jsxs("div",{className:"backup-restore-dialog__result-errors",children:[l.jsx("strong",{children:"错误信息:"}),l.jsx("ul",{children:a.errors.map((w,y)=>l.jsx("li",{children:w},y))})]})]}),l.jsx("div",{className:"backup-restore-dialog__actions",children:l.jsx("button",{className:"backup-restore-dialog__button backup-restore-dialog__button--cancel",onClick:_,disabled:i,children:a?((M=a.tasks)==null?void 0:M.imported)>0?"完成并刷新":"完成":"取消"})})]})]})})};export{ge as BackupRestoreDialog};
|