aitu-app 0.5.14
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/.DS_Store +0 -0
- package/README.md +47 -0
- package/_headers +84 -0
- package/_redirects +2 -0
- package/assets/ChatMessagesArea-CkUX81uB.js +251 -0
- package/assets/ChatMessagesArea-Di0Z80Zh.css +1 -0
- package/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/assets/Tableau10-B-NsZVaP.js +1 -0
- package/assets/Tableau10-Dnlau_Wv.js +1 -0
- package/assets/ToolboxDrawer-By1XMh8B.js +87 -0
- package/assets/ToolboxDrawer-fPqvDLQE.css +1 -0
- package/assets/__vite-browser-external-BIHI7g3E.js +1 -0
- package/assets/ai-analyze-Db-iXol6.js +1 -0
- package/assets/arc-BZXVqUcI.js +1 -0
- package/assets/arc-ajYHRRnk.js +1 -0
- package/assets/array-B5oSNiGi.js +1 -0
- package/assets/array-BKyUJesY.js +1 -0
- package/assets/batch-image-generation-Baqb01Lm.js +6 -0
- package/assets/batch-image-generation-CbLMWmjk.css +1 -0
- package/assets/blockDiagram-38ab4fdb-BT3H_WVv.js +118 -0
- package/assets/blockDiagram-38ab4fdb-u0xYP3Lt.js +118 -0
- package/assets/c4Diagram-3d4e48cf-CBvM6zjM.js +10 -0
- package/assets/c4Diagram-3d4e48cf-WOIEVidH.js +10 -0
- package/assets/channel-BP25wTsw.js +1 -0
- package/assets/channel-HzrLNFUg.js +1 -0
- package/assets/classDiagram-70f12bd4-BMutcvFi.js +2 -0
- package/assets/classDiagram-70f12bd4-Cl9U1r5F.js +2 -0
- package/assets/classDiagram-v2-f2320105-C0agtbR4.js +2 -0
- package/assets/classDiagram-v2-f2320105-tCBzATK6.js +2 -0
- package/assets/clone-B69pF7Y_.js +1 -0
- package/assets/clone-oX7o-l4R.js +1 -0
- package/assets/createText-2e5e7dd3-CZ9_fscE.js +5 -0
- package/assets/createText-2e5e7dd3-idrqgJjU.js +7 -0
- package/assets/edges-e0da2a9e-C-RyePMV.js +4 -0
- package/assets/edges-e0da2a9e-DJXAjJSL.js +4 -0
- package/assets/erDiagram-9861fffd-DWJR_3zL.js +51 -0
- package/assets/erDiagram-9861fffd-x2Kcy95-.js +51 -0
- package/assets/flowDb-956e92f1-BgKjOIdz.js +10 -0
- package/assets/flowDb-956e92f1-CF6y18Tn.js +10 -0
- package/assets/flowDiagram-66a62f08-BPPw0wPU.js +4 -0
- package/assets/flowDiagram-66a62f08-CSAllSFf.js +4 -0
- package/assets/flowDiagram-v2-96b9c2cf-B-UGyXRi.js +1 -0
- package/assets/flowDiagram-v2-96b9c2cf-Cm596kxZ.js +1 -0
- package/assets/flowchart-elk-definition-4a651766-9XSRJbsr.js +139 -0
- package/assets/flowchart-elk-definition-4a651766-DWFN9DN3.js +139 -0
- package/assets/ganttDiagram-c361ad54-D9tbz9tQ.js +257 -0
- package/assets/ganttDiagram-c361ad54-ot5pUYpT.js +257 -0
- package/assets/gitGraphDiagram-72cf32ee-BFV3Mt8C.js +70 -0
- package/assets/gitGraphDiagram-72cf32ee-C6qFzgGh.js +70 -0
- package/assets/graph-BxwlF7JS.js +1 -0
- package/assets/graph-D-2Ldvxg.js +1 -0
- package/assets/grid-image-cM9AmYC8.js +1 -0
- package/assets/has-CgdIPiQG.js +1 -0
- package/assets/hasIn-4iY02rGN.js +1 -0
- package/assets/index-3862675e-CVZnpwDN.js +1 -0
- package/assets/index-3862675e-DqdI9cab.js +1 -0
- package/assets/index-B2dvADz8.css +1 -0
- package/assets/index-BicRPzXC.js +1 -0
- package/assets/index-Bs7-jmv6.css +1 -0
- package/assets/index-BwSGXyRr.js +99 -0
- package/assets/index-C1XdOOAn.css +1 -0
- package/assets/index-C4AKKbpQ.css +1 -0
- package/assets/index-CkpXFt8n.js +1 -0
- package/assets/index-CrxF9gFe.js +42 -0
- package/assets/index-DBWqXBIQ.js +93 -0
- package/assets/index-DI_5V2-m.js +3 -0
- package/assets/index-DWUAFoZG.js +2064 -0
- package/assets/index-Dn0YtZ2R.js +3 -0
- package/assets/index-e05Rs4M6.js +12 -0
- package/assets/index.dom-C3-224fz.js +1 -0
- package/assets/infoDiagram-f8f76790-CnrpwoOt.js +7 -0
- package/assets/infoDiagram-f8f76790-FKC1Sy9Y.js +7 -0
- package/assets/init-A0kIFD9x.js +1 -0
- package/assets/init-Gi6I4Gst.js +1 -0
- package/assets/inspiration-board-B_-BBBHt.js +1 -0
- package/assets/isEmpty-Dj2GV0v-.js +1 -0
- package/assets/journeyDiagram-49397b02-B7fP21sU.js +139 -0
- package/assets/journeyDiagram-49397b02-Dp3X9XWq.js +139 -0
- package/assets/katex-BbEIqZs1.js +261 -0
- package/assets/katex-Cu_Erd72.js +261 -0
- package/assets/layout-BD3yCK_X.js +1 -0
- package/assets/layout-DHHYqX7p.js +1 -0
- package/assets/line-B3bNrkzn.js +1 -0
- package/assets/line-B86HLuqu.js +1 -0
- package/assets/linear-DU2Ciymb.js +1 -0
- package/assets/linear-wCAlMhOS.js +1 -0
- package/assets/mermaid.core-DfVvnpgz.js +91 -0
- package/assets/mindmap-definition-fc14e90a-D1sxE3xG.js +425 -0
- package/assets/mindmap-definition-fc14e90a-YuSOJC7P.js +425 -0
- package/assets/ordinal-BRr1uYdk.js +1 -0
- package/assets/ordinal-Cboi1Yqb.js +1 -0
- package/assets/path-CY0bYimO.js +1 -0
- package/assets/path-CbwjOpE9.js +1 -0
- package/assets/photo-wall-splitter-BVU2e0aS.js +1 -0
- package/assets/pick-Cvlwra4g.js +1 -0
- package/assets/pieDiagram-8a3498a8-B6mJUqro.js +35 -0
- package/assets/pieDiagram-8a3498a8-B91bWgo_.js +35 -0
- package/assets/quadrantDiagram-120e2f19-BxS8fQEz.js +7 -0
- package/assets/quadrantDiagram-120e2f19-DwudONqx.js +7 -0
- package/assets/requirementDiagram-deff3bca-DygaMIoy.js +52 -0
- package/assets/requirementDiagram-deff3bca-v9xlgfS8.js +52 -0
- package/assets/sankeyDiagram-04a897e0-BV23dp4l.js +8 -0
- package/assets/sankeyDiagram-04a897e0-BXCiXiyw.js +8 -0
- package/assets/sequenceDiagram-704730f1-CObRpNi4.js +122 -0
- package/assets/sequenceDiagram-704730f1-Ck69A6wI.js +122 -0
- package/assets/settings-dialog-BlCO49C4.js +1 -0
- package/assets/settings-dialog-QUxXj54T.css +1 -0
- package/assets/stateDiagram-587899a1-J_G6I0oo.js +1 -0
- package/assets/stateDiagram-587899a1-z-tKclr3.js +1 -0
- package/assets/stateDiagram-v2-d93cdb3a-DsThtOzP.js +1 -0
- package/assets/stateDiagram-v2-d93cdb3a-XIvq5t8a.js +1 -0
- package/assets/styles-6aaf32cf-1fjuNMUk.js +207 -0
- package/assets/styles-6aaf32cf-DT2rVNfQ.js +207 -0
- package/assets/styles-9a916d00-fLeUSina.js +160 -0
- package/assets/styles-9a916d00-q64Umkis.js +160 -0
- package/assets/styles-c10674c1-BWlxVc3Q.js +116 -0
- package/assets/styles-c10674c1-CtYpjMYU.js +116 -0
- package/assets/svgDrawCommon-08f97a94-C_DhKfny.js +1 -0
- package/assets/svgDrawCommon-08f97a94-DSBqmUv2.js +1 -0
- package/assets/timeline-definition-85554ec2-AKpzwLPN.js +61 -0
- package/assets/timeline-definition-85554ec2-dTkYwoLF.js +61 -0
- package/assets/ttd-dialog-CxiaIUuJ.js +47 -0
- package/assets/ttd-dialog-DCapefb6.css +1 -0
- package/assets/upload-4sxUU7q_.js +1 -0
- package/assets/video-recovery-service-BckHbSyK.js +1 -0
- package/assets/web-vitals-DcvjKPr-.js +1 -0
- package/assets/winbox.bundle.min-CoRPjCs5.js +1 -0
- package/assets/xlsx-CkFp8p6R.js +105 -0
- package/assets/xychartDiagram-e933f94c-DCmvL0ag.js +7 -0
- package/assets/xychartDiagram-e933f94c-aqOiXp_u.js +7 -0
- package/batch-image.html +1616 -0
- package/favicon.ico +0 -0
- package/icons/README.md +55 -0
- package/icons/aitu10.png +0 -0
- package/icons/android-chrome-192x192.png +0 -0
- package/icons/android-chrome-512x512.png +0 -0
- package/icons/apple-touch-icon.png +0 -0
- package/icons/favicon-16x16.png +0 -0
- package/icons/favicon-16x16.svg +539 -0
- package/icons/favicon-32x32.png +0 -0
- package/icons/favicon-32x32.svg +539 -0
- package/icons/favicon-new.svg +539 -0
- package/icons/favicon-new.svg.png +0 -0
- package/icons/icon-192x192.svg +539 -0
- package/icons/icon-512x512.svg +539 -0
- package/icons/icon-96x96.png +0 -0
- package/icons/icon-96x96.svg +539 -0
- package/iframe-test.html +340 -0
- package/index.html +105 -0
- package/init.json +6 -0
- package/logo/cardid.jpg +0 -0
- package/logo/group-qr.png +0 -0
- package/logo/logo_drawnix_h.svg +539 -0
- package/logo/logo_drawnix_h_dark.svg +539 -0
- package/logo/logo_drawnix_new.svg +539 -0
- package/manifest.json +52 -0
- package/package.json +31 -0
- package/product_showcase/aitu-01.png +0 -0
- package/product_showcase/aitu-02.png +0 -0
- package/product_showcase/aitu-03.png +0 -0
- package/product_showcase/aitu-04.png +0 -0
- package/product_showcase/aitu-05.png +0 -0
- package/product_showcase/aitu-06.png +0 -0
- package/product_showcase/case-1.png +0 -0
- package/product_showcase/case-2.png +0 -0
- package/robots.txt +13 -0
- package/sitemap.xml +29 -0
- package/sw-debug/app.js +3069 -0
- package/sw-debug/console-entry.js +80 -0
- package/sw-debug/log-entry.js +452 -0
- package/sw-debug/log-panel.js +309 -0
- package/sw-debug/postmessage-entry.js +117 -0
- package/sw-debug/status-panel.js +125 -0
- package/sw-debug/styles.css +2103 -0
- package/sw-debug/sw-communication.js +208 -0
- package/sw-debug/utils.js +112 -0
- package/sw-debug.html +685 -0
- package/sw.js +58 -0
- package/version.json +10 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{w as ln,c as J}from"./path-CY0bYimO.js";import{D as rn,E as N,F as D,G as an,H as y,I as on,J as z,K as _,L as un,M as t,N as sn,O as tn,P as fn}from"./mermaid.core-DfVvnpgz.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function mn(l){return l.endAngle}function pn(l){return l&&l.padAngle}function dn(l,h,O,E,v,A,K,r){var q=O-l,i=E-h,n=K-v,m=r-A,a=m*q-n*i;if(!(a*a<y))return a=(n*(h-A)-m*(l-v))/a,[l+a*q,h+a*i]}function W(l,h,O,E,v,A,K){var r=l-O,q=h-E,i=(K?A:-A)/z(r*r+q*q),n=i*q,m=-i*r,a=l+n,s=h+m,f=O+n,c=E+m,L=(a+f)/2,o=(s+c)/2,p=f-a,g=c-s,R=p*p+g*g,T=v-A,P=a*c-f*s,F=(g<0?-1:1)*z(tn(0,T*T*R-P*P)),G=(P*g-p*F)/R,H=(-P*p-g*F)/R,w=(P*g+p*F)/R,d=(-P*p+g*F)/R,x=G-L,e=H-o,u=w-L,M=d-o;return x*x+e*e>u*u+M*M&&(G=w,H=d),{cx:G,cy:H,x01:-n,y01:-m,x11:G*(v/T-1),y11:H*(v/T-1)}}function vn(){var l=cn,h=yn,O=J(0),E=null,v=gn,A=mn,K=pn,r=null,q=ln(i);function i(){var n,m,a=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-an,c=A.apply(this,arguments)-an,L=un(c-f),o=c>f;if(r||(r=n=q()),s<a&&(m=s,s=a,a=m),!(s>y))r.moveTo(0,0);else if(L>on-y)r.moveTo(s*N(f),s*D(f)),r.arc(0,0,s,f,c,!o),a>y&&(r.moveTo(a*N(c),a*D(c)),r.arc(0,0,a,c,f,o));else{var p=f,g=c,R=f,T=c,P=L,F=L,G=K.apply(this,arguments)/2,H=G>y&&(E?+E.apply(this,arguments):z(a*a+s*s)),w=_(un(s-a)/2,+O.apply(this,arguments)),d=w,x=w,e,u;if(H>y){var M=sn(H/a*D(G)),B=sn(H/s*D(G));(P-=M*2)>y?(M*=o?1:-1,R+=M,T-=M):(P=0,R=T=(f+c)/2),(F-=B*2)>y?(B*=o?1:-1,p+=B,g-=B):(F=0,p=g=(f+c)/2)}var S=s*N(p),j=s*D(p),C=a*N(T),Q=a*D(T);if(w>y){var U=s*N(g),V=s*D(g),X=a*N(R),Y=a*D(R),I;if(L<rn)if(I=dn(S,j,X,Y,U,V,C,Q)){var Z=S-I[0],$=j-I[1],k=U-I[0],b=V-I[1],nn=1/D(fn((Z*k+$*b)/(z(Z*Z+$*$)*z(k*k+b*b)))/2),en=z(I[0]*I[0]+I[1]*I[1]);d=_(w,(a-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else d=x=0}F>y?x>y?(e=W(X,Y,S,j,s,x,o),u=W(U,V,C,Q,s,x,o),r.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?r.arc(e.cx,e.cy,x,t(e.y01,e.x01),t(u.y01,u.x01),!o):(r.arc(e.cx,e.cy,x,t(e.y01,e.x01),t(e.y11,e.x11),!o),r.arc(0,0,s,t(e.cy+e.y11,e.cx+e.x11),t(u.cy+u.y11,u.cx+u.x11),!o),r.arc(u.cx,u.cy,x,t(u.y11,u.x11),t(u.y01,u.x01),!o))):(r.moveTo(S,j),r.arc(0,0,s,p,g,!o)):r.moveTo(S,j),!(a>y)||!(P>y)?r.lineTo(C,Q):d>y?(e=W(C,Q,U,V,a,-d,o),u=W(S,j,X,Y,a,-d,o),r.lineTo(e.cx+e.x01,e.cy+e.y01),d<w?r.arc(e.cx,e.cy,d,t(e.y01,e.x01),t(u.y01,u.x01),!o):(r.arc(e.cx,e.cy,d,t(e.y01,e.x01),t(e.y11,e.x11),!o),r.arc(0,0,a,t(e.cy+e.y11,e.cx+e.x11),t(u.cy+u.y11,u.cx+u.x11),o),r.arc(u.cx,u.cy,d,t(u.y11,u.x11),t(u.y01,u.x01),!o))):r.arc(0,0,a,T,R,o)}if(r.closePath(),n)return r=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,m=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-rn/2;return[N(m)*n,D(m)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:J(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:J(+n),i):h},i.cornerRadius=function(n){return arguments.length?(O=typeof n=="function"?n:J(+n),i):O},i.padRadius=function(n){return arguments.length?(E=n==null?null:typeof n=="function"?n:J(+n),i):E},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:J(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:J(+n),i):A},i.padAngle=function(n){return arguments.length?(K=typeof n=="function"?n:J(+n),i):K},i.context=function(n){return arguments.length?(r=n??null,i):r},i}export{vn as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{w as ln,c as J}from"./path-CbwjOpE9.js";import{E as rn,F as N,G as E,H as an,I as y,J as on,K as j,L as _,M as un,N as t,O as sn,P as tn,Q as fn}from"./index-BwSGXyRr.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function mn(l){return l.endAngle}function pn(l){return l&&l.padAngle}function dn(l,h,q,I,v,A,K,r){var D=q-l,i=I-h,n=K-v,m=r-A,a=m*D-n*i;if(!(a*a<y))return a=(n*(h-A)-m*(l-v))/a,[l+a*D,h+a*i]}function W(l,h,q,I,v,A,K){var r=l-q,D=h-I,i=(K?A:-A)/j(r*r+D*D),n=i*D,m=-i*r,a=l+n,s=h+m,f=q+n,c=I+m,L=(a+f)/2,o=(s+c)/2,p=f-a,g=c-s,R=p*p+g*g,T=v-A,P=a*c-f*s,F=(g<0?-1:1)*j(tn(0,T*T*R-P*P)),G=(P*g-p*F)/R,H=(-P*p-g*F)/R,w=(P*g+p*F)/R,d=(-P*p+g*F)/R,x=G-L,e=H-o,u=w-L,M=d-o;return x*x+e*e>u*u+M*M&&(G=w,H=d),{cx:G,cy:H,x01:-n,y01:-m,x11:G*(v/T-1),y11:H*(v/T-1)}}function vn(){var l=cn,h=yn,q=J(0),I=null,v=gn,A=mn,K=pn,r=null,D=ln(i);function i(){var n,m,a=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-an,c=A.apply(this,arguments)-an,L=un(c-f),o=c>f;if(r||(r=n=D()),s<a&&(m=s,s=a,a=m),!(s>y))r.moveTo(0,0);else if(L>on-y)r.moveTo(s*N(f),s*E(f)),r.arc(0,0,s,f,c,!o),a>y&&(r.moveTo(a*N(c),a*E(c)),r.arc(0,0,a,c,f,o));else{var p=f,g=c,R=f,T=c,P=L,F=L,G=K.apply(this,arguments)/2,H=G>y&&(I?+I.apply(this,arguments):j(a*a+s*s)),w=_(un(s-a)/2,+q.apply(this,arguments)),d=w,x=w,e,u;if(H>y){var M=sn(H/a*E(G)),z=sn(H/s*E(G));(P-=M*2)>y?(M*=o?1:-1,R+=M,T-=M):(P=0,R=T=(f+c)/2),(F-=z*2)>y?(z*=o?1:-1,p+=z,g-=z):(F=0,p=g=(f+c)/2)}var Q=s*N(p),S=s*E(p),B=a*N(T),C=a*E(T);if(w>y){var U=s*N(g),V=s*E(g),X=a*N(R),Y=a*E(R),O;if(L<rn)if(O=dn(Q,S,X,Y,U,V,B,C)){var Z=Q-O[0],$=S-O[1],k=U-O[0],b=V-O[1],nn=1/E(fn((Z*k+$*b)/(j(Z*Z+$*$)*j(k*k+b*b)))/2),en=j(O[0]*O[0]+O[1]*O[1]);d=_(w,(a-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else d=x=0}F>y?x>y?(e=W(X,Y,Q,S,s,x,o),u=W(U,V,B,C,s,x,o),r.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?r.arc(e.cx,e.cy,x,t(e.y01,e.x01),t(u.y01,u.x01),!o):(r.arc(e.cx,e.cy,x,t(e.y01,e.x01),t(e.y11,e.x11),!o),r.arc(0,0,s,t(e.cy+e.y11,e.cx+e.x11),t(u.cy+u.y11,u.cx+u.x11),!o),r.arc(u.cx,u.cy,x,t(u.y11,u.x11),t(u.y01,u.x01),!o))):(r.moveTo(Q,S),r.arc(0,0,s,p,g,!o)):r.moveTo(Q,S),!(a>y)||!(P>y)?r.lineTo(B,C):d>y?(e=W(B,C,U,V,a,-d,o),u=W(Q,S,X,Y,a,-d,o),r.lineTo(e.cx+e.x01,e.cy+e.y01),d<w?r.arc(e.cx,e.cy,d,t(e.y01,e.x01),t(u.y01,u.x01),!o):(r.arc(e.cx,e.cy,d,t(e.y01,e.x01),t(e.y11,e.x11),!o),r.arc(0,0,a,t(e.cy+e.y11,e.cx+e.x11),t(u.cy+u.y11,u.cx+u.x11),o),r.arc(u.cx,u.cy,d,t(u.y11,u.x11),t(u.y01,u.x01),!o))):r.arc(0,0,a,T,R,o)}if(r.closePath(),n)return r=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,m=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-rn/2;return[N(m)*n,E(m)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:J(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:J(+n),i):h},i.cornerRadius=function(n){return arguments.length?(q=typeof n=="function"?n:J(+n),i):q},i.padRadius=function(n){return arguments.length?(I=n==null?null:typeof n=="function"?n:J(+n),i):I},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:J(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:J(+n),i):A},i.padAngle=function(n){return arguments.length?(K=typeof n=="function"?n:J(+n),i):K},i.context=function(n){return arguments.length?(r=n??null,i):r},i}export{vn as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(r){return typeof r=="object"&&"length"in r?r:Array.from(r)}export{t as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function t(r){return typeof r=="object"&&"length"in r?r:Array.from(r)}export{t as a};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{z as Wt,L as Ht,M as Vt,N as J,r as i,O as ot,P as Yt,n as Be,Q as k,R as xe,S as Zt,U as Je,W as R,X as Qt,Y as qt,m as es,Z as ts,C as a,J as ss,$ as Xe,a0 as as,a1 as ns,H as ls,a2 as rs,a3 as is}from"./index-DWUAFoZG.js";/* empty css */import{S as cs}from"./index-DBWqXBIQ.js";import"./pick-Cvlwra4g.js";import"./hasIn-4iY02rGN.js";const ut=Yt.BATCH_IMAGE_CACHE,Ne=["auto","1x1","2x3","3x2","3x4","4x3","4x5","5x4","9x16","16x9","21x9"],dt={auto:"自动","1x1":"1:1","2x3":"2:3","3x2":"3:2","3x4":"3:4","4x3":"4:3","4x5":"4:5","5x4":"5:4","9x16":"9:16","16x9":"16:9","21x9":"21:9"},v=["prompt","size","images","count","preview"];function os(){const X=[];for(let r=0;r<5;r++)X.push({id:r+1,prompt:"",size:"auto",images:[],count:1,taskIds:[]});return X}const ps=({onSwitchToSingle:X})=>{const{language:r}=Wt(),{createTask:We,tasks:se}=Ht(),{addAsset:P,assets:ht,loadAssets:He}=Vt(),Ve=ht.filter(t=>t.type===J.IMAGE);i.useEffect(()=>{He()},[He]);const[b,S]=i.useState(os),[O,ae]=i.useState(6),[Ye,Ze]=i.useState(!1),[je,Se]=i.useState(!1);i.useEffect(()=>{let t=!0;return ot.get(ut).then(e=>{t&&(e&&e.tasks&&Array.isArray(e.tasks)&&e.tasks.length>0&&(S(e.tasks),e.taskIdCounter&&ae(e.taskIdCounter)),Ze(!0))}).catch(e=>{console.warn("Failed to load batch image cache:",e),t&&Ze(!0)}),()=>{t=!1}},[]);const[C,W]=i.useState(null),[E,B]=i.useState([]),[I,j]=i.useState(null),[x,U]=i.useState(new Set),$=i.useRef([]),M=i.useRef(-1),ne=i.useRef(!1),[H,Qe]=i.useState(!1),[A,qe]=i.useState(!1),[D,et]=i.useState(null),[mt,tt]=i.useState([]),[le,_e]=i.useState(null),[V,ze]=i.useState(!1),[re,Re]=i.useState(null),[gt,Ee]=i.useState(null),[L,pt]=i.useState(1),[ft,De]=i.useState(!1),[_,Te]=i.useState([]),[K,st]=i.useState(1),$e=i.useMemo(()=>_.slice(0,12).map(t=>URL.createObjectURL(t)),[_]);i.useEffect(()=>()=>{$e.forEach(t=>URL.revokeObjectURL(t))},[$e]);const[ie,bt]=i.useState(()=>Be.get().imageModelName||"gemini-2.5-flash-image-vip"),[z,at]=i.useState([]),[ce,Y]=i.useState(0),[Z,Me]=i.useState(null),[kt,oe]=i.useState(!1),[ue,wt]=i.useState(5),[vt,Ae]=i.useState(!1),[Le,Pe]=i.useState(null),de=i.useRef(null),he=i.useRef(null),me=i.useRef(null),ge=i.useRef(null),nt=i.useRef(null),pe=i.useRef(null),Oe=i.useRef(null);i.useEffect(()=>{if(!Ye)return;const t={tasks:b,taskIdCounter:O,timestamp:Date.now()};ot.set(ut,t).catch(e=>{console.warn("Failed to save batch image cache:",e)})},[b,O,Ye]);const lt=i.useCallback(t=>{if(ne.current){ne.current=!1;return}$.current=$.current.slice(0,M.current+1),$.current.push(JSON.parse(JSON.stringify(t))),M.current=$.current.length-1,$.current.length>50&&($.current.shift(),M.current--)},[]);i.useEffect(()=>{b.length>0&<(b)},[b,lt]);const rt=i.useCallback(()=>{if(M.current>0){M.current--,ne.current=!0;const t=JSON.parse(JSON.stringify($.current[M.current]));S(t),k.info(r==="zh"?"已撤销":"Undone")}else k.warning(r==="zh"?"没有可撤销的操作":"Nothing to undo")},[r]),it=i.useCallback(()=>{if(M.current<$.current.length-1){M.current++,ne.current=!0;const t=JSON.parse(JSON.stringify($.current[M.current]));S(t),k.info(r==="zh"?"已重做":"Redone")}else k.warning(r==="zh"?"没有可重做的操作":"Nothing to redo")},[r]),yt=i.useCallback(t=>{S(e=>{const s=[...e];for(let n=0;n<t;n++)s.push({id:O+n,prompt:"",size:"auto",images:[],count:1,taskIds:[]});return s}),ae(e=>e+t)},[O]),Ct=i.useCallback(()=>{if(x.size===0){k.warning(r==="zh"?"请先勾选要删除的行":"Please check rows to delete");return}S(t=>t.filter((e,s)=>!x.has(s))),U(new Set),B([]),W(null)},[x,r]),w=i.useCallback((t,e)=>{W({row:t,col:e}),B([{row:t,col:e}]),j(null)},[]),fe=i.useCallback((t,e)=>{w(t,e),v.includes(e)&&e!=="images"&&j({row:t,col:e})},[w]),y=i.useCallback((t,e,s)=>{S(n=>{const o=[...n];return o[t]&&(o[t][e]=s),o})},[]),Q=i.useCallback((t,e,s)=>{if(t.shiftKey&&C){const n=Math.min(C.row,e),o=Math.max(C.row,e);U(c=>{const h=new Set(c);for(let f=n;f<=o;f++)h.add(f);return h});const m=[];for(let c=n;c<=o;c++)m.push({row:c,col:C.col});B(m),nt.current=e}else t.ctrlKey||t.metaKey?B(n=>n.some(m=>m.row===e&&m.col===s)?n.filter(m=>!(m.row===e&&m.col===s)):[...n,{row:e,col:s}]):(w(e,s),nt.current=e)},[C,w]),be=i.useCallback(t=>{var s;if(!C){k.warning(r==="zh"?"请先选中一个单元格作为填充源":"Please select a cell as fill source");return}const e=(s=b[C.row])==null?void 0:s[t];if(e==null||typeof e=="string"&&e.trim()===""||Array.isArray(e)&&e.length===0){k.warning(r==="zh"?"选中的单元格没有数据":"Selected cell has no data");return}S(n=>n.map(o=>({...o,[t]:t==="images"&&Array.isArray(e)?[...e]:e}))),k.success(r==="zh"?"已填充整列":"Column filled")},[C,b,r]),ke=i.useCallback((t,e)=>{ze(!1),Re(null),qe(!0),et({row:t,col:e}),_e(t)},[]),Ie=i.useCallback((t,e)=>{A||(ze(!0),Re({row:t,col:e}),W({row:t,col:e}),B([{row:t,col:e}]))},[A]),xt=i.useCallback(t=>{if(!A&&!V)return;const s=t.target.closest("tr[data-row-index]");if(!s)return;const n=parseInt(s.dataset.rowIndex||"-1");if(!(n<0)){if(A&&D){_e(n);const o=D.row,m=n,c=Math.min(o,m),h=Math.max(o,m),f=[];for(let d=c;d<=h;d++)d!==o&&f.push(d);tt(f)}if(V&&re){const o=re.col,m=re.row,c=n,h=Math.min(m,c),f=Math.max(m,c),d=[];for(let l=h;l<=f;l++)d.push({row:l,col:o});B(d)}}},[A,D,V,re]),we=i.useCallback(()=>{var t;if(A&&D&&le!==null&&le!==D.row){const e=(t=b[D.row])==null?void 0:t[D.col],s=D.row,n=le,o=Math.min(s,n),m=Math.max(s,n);S(c=>{const h=[...c];for(let f=o;f<=m;f++)f!==s&&h[f]&&(h[f][D.col]=Array.isArray(e)?[...e]:e);return h}),k.success(r==="zh"?`已填充 ${Math.abs(n-s)} 行`:`Filled ${Math.abs(n-s)} rows`)}qe(!1),et(null),_e(null),tt([]),ze(!1),Re(null)},[A,D,le,b,r]),Nt=i.useCallback(t=>{const e=t.target.files;e&&(Array.from(e).forEach(s=>{s.type.startsWith("image/")&&P(s,J.IMAGE,xe.LOCAL,s.name).catch(n=>{console.warn("[BatchImageGeneration] Failed to add asset to library:",n)})}),de.current&&(de.current.value=""))},[P]),jt=i.useCallback(t=>{let e=[];if(x.size>0?e=[...x]:E.length>0?e=[...new Set(E.map(s=>s.row))]:C&&(e=[C.row]),e.length===0){k.warning(r==="zh"?"请先选中要添加图片的行":"Please select a row first");return}S(s=>{const n=[...s];return e.forEach(o=>{n[o]&&!n[o].images.includes(t)&&(n[o]={...n[o],images:[...n[o].images,t]})}),n})},[x,E,C,r]),G=i.useCallback((t,e)=>{S(s=>{const n=[...s];return n[t]&&!n[t].images.includes(e)&&(n[t]={...n[t],images:[...n[t].images,e]}),n})},[]),St=i.useCallback((t,e)=>{S(s=>{const n=[...s];return n[t]&&(n[t]={...n[t],images:n[t].images.filter(o=>o!==e)}),n})},[]),_t=i.useCallback(t=>{const e=t.target.files,s=Oe.current;!e||e.length===0||s===null||(Array.from(e).forEach(n=>{if(!n.type.startsWith("image/"))return;P(n,J.IMAGE,xe.LOCAL,n.name).catch(m=>{console.warn("[BatchImageGeneration] Failed to add asset to library:",m)});const o=new FileReader;o.onload=m=>{var h;const c=(h=m.target)==null?void 0:h.result;G(s,c)},o.readAsDataURL(n)}),ge.current&&(ge.current.value=""),Oe.current=null)},[G,P]),zt=i.useCallback(t=>{var e;Oe.current=t,Qe(!1),(e=ge.current)==null||e.click()},[]),Rt=i.useCallback(t=>{Pe(t),Ae(!0)},[]),Et=i.useCallback(t=>{Le!==null&&(t.url&&G(Le,t.url),Ae(!1),Pe(null))},[Le,G]),Dt=i.useCallback((t,e)=>{t.preventDefault(),t.dataTransfer.dropEffect="copy",Ee(e)},[]),Tt=i.useCallback(t=>{const e=t.relatedTarget;(!e||!t.currentTarget.contains(e))&&Ee(null)},[]),$t=i.useCallback((t,e)=>{t.preventDefault(),Ee(null);const s=t.dataTransfer.getData("text/library-image");if(s){G(e,s),k.success(r==="zh"?`已添加图片到第 ${e+1} 行`:`Added image to row ${e+1}`);return}const n=t.dataTransfer.files;if(!n||n.length===0)return;let o=0;Array.from(n).forEach(m=>{if(!m.type.startsWith("image/"))return;P(m,J.IMAGE,xe.LOCAL,m.name).catch(h=>{console.warn("[BatchImageGeneration] Failed to add asset to library:",h)});const c=new FileReader;c.onload=h=>{var d;const f=(d=h.target)==null?void 0:d.result;G(e,f)},c.readAsDataURL(m),o++}),o>0&&k.success(r==="zh"?`已添加 ${o} 张图片到第 ${e+1} 行`:`Added ${o} images to row ${e+1}`)},[G,r,P]),Mt=i.useCallback((t,e)=>{t.dataTransfer.setData("text/library-image",e),t.dataTransfer.effectAllowed="copy"},[]),At=i.useCallback(t=>{const e=t.target.files;if(!e||e.length===0)return;const s=Array.from(e).filter(o=>o.type.startsWith("image/"));if(s.length===0){k.warning(r==="zh"?"请选择图片文件":"Please select image files");return}Te(s);const n=C?C.row+1:1;st(Math.min(n,b.length)),De(!0),he.current&&(he.current.value="")},[r,C,b.length]),Lt=i.useCallback(async()=>{if(_.length===0)return;const t=Zt(`批量导入(${_.length}张)`),e=L,s=_.length,n=Math.ceil(s/e),o=K-1,m=[];for(const d of _){P(d,J.IMAGE,xe.LOCAL,d.name).catch(u=>{console.warn("[BatchImageGeneration] Failed to add asset to library:",u)});const l=await new Promise((u,g)=>{const p=new FileReader;p.onload=N=>{var T;return u((T=N.target)==null?void 0:T.result)},p.onerror=g,p.readAsDataURL(d)});m.push(l)}S(d=>{const l=[...d];let u=0,g=0;for(let p=0;p<n;p++){const N=o+p,T=[];for(let ee=0;ee<e&&u<s;ee++)T.push(m[u]),u++;N<l.length?l[N]={...l[N],images:[...l[N].images,...T]}:(l.push({id:O+g,prompt:"",size:"auto",images:T,count:1,taskIds:[]}),g++)}return l});const c=Math.min(n,b.length-o),h=Math.max(0,n-c);h>0&&ae(d=>d+h),Te([]),De(!1),t();const f=r==="zh"?`已导入 ${s} 张图片,从第 ${K} 行开始`:`Imported ${s} images starting from row ${K}`;k.success(f)},[_,L,K,O,b.length,r,P]),Ke=i.useCallback(()=>{Te([]),De(!1)},[]),Pt=i.useCallback(async()=>{try{const t=await Je(()=>import("./xlsx-CkFp8p6R.js"),[],import.meta.url),e=[{提示词:"一只可爱的橘猫在阳光下睡觉",尺寸:"1x1",数量:1},{提示词:"未来城市的夜景,霓虹灯闪烁",尺寸:"16x9",数量:2},{提示词:"古风美女,水墨画风格",尺寸:"3x4",数量:1},{提示词:"",尺寸:"1x1",数量:1},{提示词:"",尺寸:"1x1",数量:1}],s=t.utils.book_new(),n=t.utils.json_to_sheet(e);n["!cols"]=[{wch:60},{wch:10},{wch:8}],t.utils.book_append_sheet(s,n,"批量出图模板"),t.writeFile(s,"batch-image-template.xlsx"),k.success(r==="zh"?"模板下载成功,填写后可导入使用":"Template downloaded, fill and import to use")}catch(t){console.error("Excel template download error:",t),k.error(r==="zh"?"下载失败,请稍后重试":"Download failed, please try again")}},[r]),Ot=i.useCallback(async t=>{var s;const e=(s=t.target.files)==null?void 0:s[0];if(e){try{const n=await Je(()=>import("./xlsx-CkFp8p6R.js"),[],import.meta.url),o=new FileReader;o.onload=m=>{var c;try{const h=new Uint8Array((c=m.target)==null?void 0:c.result),f=n.read(h,{type:"array"}),d=f.SheetNames[0],l=f.Sheets[d],u=n.utils.sheet_to_json(l);if(u.length===0){k.warning(r==="zh"?"Excel 文件为空":"Excel file is empty");return}const g=u.map((p,N)=>{const T=p.提示词||p.prompt||p.Prompt||"",ee=p.尺寸||p.size||p.Size||"1x1",Jt=parseInt(String(p.数量||p.count||p.Count||"1"))||1,ct=p.参考图||p.images||p.Images||"",Xt=ct?ct.split(`
|
|
2
|
+
`).map(te=>te.trim()).filter(te=>te.length>0&&!te.startsWith("[")&&!te.endsWith("]")):[];return{id:O+N,prompt:String(T).trim(),size:Ne.includes(ee)?ee:"1x1",images:Xt,count:Math.max(1,Jt),taskIds:[]}});S(p=>[...p,...g]),ae(p=>p+g.length),k.success(r==="zh"?`已导入 ${g.length} 行数据`:`Imported ${g.length} rows`)}catch(h){console.error("Excel import error:",h),k.error(r==="zh"?"导入失败,请检查文件格式":"Import failed, please check file format")}},o.readAsArrayBuffer(e)}catch(n){console.error("Excel library load error:",n),k.error(r==="zh"?"加载 Excel 处理库失败":"Failed to load Excel library")}me.current&&(me.current.value="")}},[O,r]),F=i.useCallback(t=>{if(t.taskIds.length===0)return{status:"idle",tasks:[],completedCount:0,failedCount:0};const e=se.filter(c=>t.taskIds.includes(c.id)),s=e.filter(c=>c.status===R.COMPLETED).length,n=e.filter(c=>c.status===R.FAILED).length,o=e.filter(c=>c.status===R.PENDING||c.status===R.PROCESSING).length;let m="idle";return o>0?m="generating":n>0&&s>0?m="partial":n>0?m="failed":s>0&&(m="completed"),{status:m,tasks:e,completedCount:s,failedCount:n}},[se]),It=i.useCallback(async()=>{try{const t=await Je(()=>import("./xlsx-CkFp8p6R.js"),[],import.meta.url),e=32e3,s=l=>{const g=l.map((p,N)=>p.startsWith("data:")?`[本地图片${N+1}]`:p).join(`
|
|
3
|
+
`);return g.length>e?g.substring(0,e-20)+`
|
|
4
|
+
...[已截断]`:g},n=b.map(l=>{const u=F(l),g=u.tasks.filter(p=>{var N;return p.status===R.COMPLETED&&((N=p.result)==null?void 0:N.url)}).map(p=>p.result.url);return{提示词:l.prompt,尺寸:l.size,参考图:s(l.images),数量:l.count,预览图:s(g),状态:u.status==="idle"?"未生成":u.status==="generating"?"生成中":u.status==="completed"?"已完成":u.status==="failed"?"失败":u.status==="partial"?"部分完成":""}}),o=t.utils.book_new(),m=t.utils.json_to_sheet(n);m["!cols"]=[{wch:60},{wch:10},{wch:80},{wch:8},{wch:80},{wch:12}],t.utils.book_append_sheet(o,m,"批量出图数据");const c=new Date,h=`${c.getFullYear()}${String(c.getMonth()+1).padStart(2,"0")}${String(c.getDate()).padStart(2,"0")}`,f=`${String(c.getHours()).padStart(2,"0")}${String(c.getMinutes()).padStart(2,"0")}`,d=`batch-image-export_${h}_${f}.xlsx`;t.writeFile(o,d),k.success(r==="zh"?`已导出 ${b.length} 行数据`:`Exported ${b.length} rows`)}catch(t){console.error("Excel export error:",t),k.error(r==="zh"?"导出失败,请稍后重试":"Export failed, please try again")}},[b,F,r]),Kt=i.useCallback(()=>{const t=[];if(b.forEach((e,s)=>{const{status:n}=F(e);(n==="failed"||n==="partial")&&t.push(s)}),t.length===0){k.info(r==="zh"?"没有失败的行":"No failed rows");return}U(new Set(t)),k.success(r==="zh"?`已选中 ${t.length} 个失败行`:`Selected ${t.length} failed rows`)},[b,F,r]),Ft=i.useCallback(()=>{const t=new Set;b.forEach((e,s)=>{x.has(s)||t.add(s)}),U(t)},[b,x]),Fe=i.useCallback((t,e=0)=>{at(t),Y(e)},[]),Ue=i.useCallback(()=>{at([]),Y(0)},[]),ve=i.useCallback(()=>{Y(t=>t>0?t-1:z.length-1)},[z.length]),ye=i.useCallback(()=>{Y(t=>t<z.length-1?t+1:0)},[z.length]),Ce=i.useCallback((t,e=!1)=>{U(s=>{const n=new Set(s);if(e&&pe.current!==null){const o=Math.min(pe.current,t),m=Math.max(pe.current,t);for(let c=o;c<=m;c++)n.add(c)}else n.has(t)?n.delete(t):n.add(t);return n}),pe.current=t},[]),Ut=i.useCallback(()=>{x.size===b.length&&b.length>0?U(new Set):U(new Set(b.map((t,e)=>e)))},[b,x.size]),Gt=i.useCallback(async()=>{const t=[...x].sort((s,n)=>s-n);if(t.length===0){k.warning(r==="zh"?"请先勾选要下载的行":"Please check rows to download");return}const e=[];if(t.forEach(s=>{const n=b[s];n&&n.taskIds.forEach((o,m)=>{var h;const c=se.find(f=>f.id===o);(c==null?void 0:c.status)===R.COMPLETED&&((h=c.result)!=null&&h.url)&&e.push({url:c.result.url,filename:`row${s+1}_${m+1}_${n.prompt.slice(0,20).replace(/[^\w\u4e00-\u9fa5]/g,"_")}.png`})})}),e.length===0){k.warning(r==="zh"?"选中的行没有已生成的图片":"No generated images in selected rows");return}try{k.info(r==="zh"?"正在准备下载...":"Preparing download...");const s=new Date,n=`${s.getFullYear()}${String(s.getMonth()+1).padStart(2,"0")}${String(s.getDate()).padStart(2,"0")}`,o=`${String(s.getHours()).padStart(2,"0")}${String(s.getMinutes()).padStart(2,"0")}`,m=`aitu_images_${e.length}pics_${n}_${o}.zip`,c=e.map(h=>({url:h.url,type:"image",filename:h.filename}));await Qt(c,m),k.success(r==="zh"?"下载成功":"Download complete")}catch(s){console.error("Download failed:",s),k.error(r==="zh"?"下载失败":"Download failed")}},[x,b,se,r]),Ge=i.useCallback(async t=>{Se(!0);const e=Be.get();if(!e.apiKey){j(null),W(null);const m=await qt();if(!m){Se(!1),k.warning(r==="zh"?"需要 API Key 才能生成图片":"API Key is required to generate images");return}Be.update({apiKey:m})}const s=Date.now();let n=0,o=0;for(const{task:m,rowIndex:c}of t){const h=m.count||1,f=`batch_${m.id}_${s}`,d=m.images.map((u,g)=>({type:"url",url:u,name:`reference_${g+1}`})),l=[];for(let u=0;u<h;u++){n++;const g={prompt:m.prompt.trim(),aspectRatio:m.size,model:ie||e.imageModelName||"gemini-2.5-flash-image-vip",uploadedImages:d,batchId:f,batchIndex:u+1,batchTotal:h,globalIndex:n,autoInsertToCanvas:!0},p=We(g,es.IMAGE);p&&(o++,l.push(p.id))}l.length>0&&S(u=>{const g=[...u];return g[c]&&(g[c]={...g[c],taskIds:[...g[c].taskIds,...l]}),g})}Se(!1),o>0&&k.success(r==="zh"?`已提交 ${o} 个任务到队列`:`Submitted ${o} tasks to queue`)},[We,r,ie,S,j,W]),Bt=i.useCallback(async()=>{const t=[...x].sort((c,h)=>c-h);if(t.length===0){k.warning(r==="zh"?"请先勾选要生成的行":"Please check rows to generate");return}const e=t.map(c=>({task:b[c],rowIndex:c})).filter(({task:c})=>c&&c.prompt&&c.prompt.trim()!=="");if(e.length===0){k.warning(r==="zh"?"选中的行没有填写提示词":"Selected rows have no prompts");return}const s=e.filter(({task:c})=>F(c).status==="generating"),n=e.filter(({task:c})=>(c.count||1)>=100),o=e.reduce((c,{task:h})=>c+(h.count||1),0),m=o>=100;if(s.length>0||n.length>0||m){const c=[];if(s.length>0){const l=s.map(({rowIndex:u})=>u+1).join("、");c.push(r==="zh"?`第 ${l} 行正在生成中`:`Row ${l} is generating`)}if(n.length>0){const l=n.map(({task:u,rowIndex:g})=>r==="zh"?`第 ${g+1} 行数量为 ${u.count}`:`Row ${g+1} count is ${u.count}`).join("、");c.push(l)}m&&c.push(r==="zh"?`总任务数为 ${o}`:`Total task count is ${o}`);const h=c.join(r==="zh"?";":"; "),f=r==="zh"?`${h},是否继续?`:`${h}. Continue?`,d=ts.confirm({header:r==="zh"?"生成提醒":"Generation Warning",body:f,confirmBtn:r==="zh"?"继续生成":"Continue",cancelBtn:r==="zh"?"取消":"Cancel",theme:"warning",closeBtn:!0,onConfirm:()=>{d.destroy(),Ge(e)},onCancel:()=>{d.destroy()},onClose:()=>{d.destroy()}});return}Ge(e)},[b,x,r,Ge,F]);i.useEffect(()=>{const t=e=>{if(z.length>0){if(e.key==="ArrowLeft"){e.preventDefault(),ve();return}if(e.key==="ArrowRight"){e.preventDefault(),ye();return}if(e.key==="Escape"){e.preventDefault(),Ue();return}return}if(!C||I)return;const{row:s,col:n}=C,o=v.indexOf(n);if(e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&v.includes(n)&&n!=="images"&&n!=="size"){if(e.preventDefault(),n==="count"){const c=parseInt(e.key);isNaN(c)?y(s,n,0):y(s,n,c)}else n==="prompt"&&y(s,n,e.key);j({row:s,col:n}),window.__cellEditSelectAll=!1;return}if((e.ctrlKey||e.metaKey)&&e.key==="z"&&!e.shiftKey){e.preventDefault(),rt();return}if((e.ctrlKey||e.metaKey)&&(e.key==="y"||e.key==="z"&&e.shiftKey)){e.preventDefault(),it();return}if((e.ctrlKey||e.metaKey)&&e.key==="c"){e.preventDefault();const h=[...E].sort((f,d)=>f.row-d.row).map(f=>{var l;const d=(l=b[f.row])==null?void 0:l[f.col];return{row:f.row,col:f.col,value:d}});if(h.length>0){const f=h.map(d=>d.col==="images"?JSON.stringify(d.value):String(d.value??"")).join(`
|
|
5
|
+
`);navigator.clipboard.writeText(f).then(()=>{window.__copiedCells=h})}return}if((e.ctrlKey||e.metaKey)&&e.key==="v"){e.preventDefault();const c=E.length>0?E:[{row:s,col:n}],h=window.__copiedCells;if(h&&h.length>0)if(h.length===1){const f=h[0];c.forEach(d=>{d.col===f.col&&y(d.row,d.col,f.value)})}else h.forEach((f,d)=>{const l=s+d;l<b.length&&y(l,n,f.value)});else navigator.clipboard.readText().then(f=>{const d=f.split(`
|
|
6
|
+
`).filter(l=>l.trim());if(d.length===1||c.length>1){const l=d[0];c.forEach(u=>{if(u.col==="prompt")y(u.row,u.col,l);else if(u.col==="count"){const g=parseInt(l);!isNaN(g)&&g>=1&&y(u.row,u.col,g)}else u.col==="size"&&Ne.includes(l)&&y(u.row,u.col,l)})}else d.forEach((l,u)=>{const g=s+u;if(!(g>=b.length))if(n==="prompt")y(g,n,l);else if(n==="count"){const p=parseInt(l);!isNaN(p)&&p>=1&&y(g,n,p)}else n==="size"&&Ne.includes(l)&&y(g,n,l)})});return}switch(e.key){case"ArrowUp":e.preventDefault(),s>0&&w(s-1,n);break;case"ArrowDown":e.preventDefault(),s<b.length-1&&w(s+1,n);break;case"ArrowLeft":e.preventDefault(),o>0&&w(s,v[o-1]);break;case"ArrowRight":e.preventDefault(),o<v.length-1&&w(s,v[o+1]);break;case"Tab":e.preventDefault(),e.shiftKey?o>0?w(s,v[o-1]):s>0&&w(s-1,v[v.length-1]):o<v.length-1?w(s,v[o+1]):s<b.length-1&&w(s+1,v[0]);break;case"Enter":e.preventDefault(),n!=="images"&&fe(s,n);break;case"Escape":e.preventDefault(),j(null);break;case"Delete":case"Backspace":e.preventDefault(),(E.length>0?E:[{row:s,col:n}]).forEach(h=>{h.col==="prompt"?y(h.row,h.col,""):h.col==="count"?y(h.row,h.col,1):h.col==="images"?y(h.row,h.col,[]):h.col==="size"&&y(h.row,h.col,"auto")});break}};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[C,I,b,E,w,fe,y,rt,it,z,ve,ye,Ue]),i.useEffect(()=>{const t=()=>{(A||V)&&we()};return document.addEventListener("mouseup",t),()=>document.removeEventListener("mouseup",t)},[A,V,we]);const q=(t,e,s)=>{var h,f;const n=(I==null?void 0:I.row)===e&&(I==null?void 0:I.col)===s,o=(C==null?void 0:C.row)===e&&(C==null?void 0:C.col)===s,m=E.some(d=>d.row===e&&d.col===s),c=`excel-cell ${o?"active":""} ${m?"selected":""}`;switch(s){case"prompt":return a.jsxs("div",{className:c,onMouseDown:l=>{l.target.classList.contains("fill-handle")||n||l.button===0&&!l.shiftKey&&Ie(e,s)},onClick:l=>{n||Q(l,e,s)},onDoubleClick:()=>fe(e,s),children:[n?a.jsx("textarea",{autoFocus:!0,value:t.prompt,onChange:l=>y(e,s,l.target.value),onFocus:l=>{const u=l.target.value.length;l.target.setSelectionRange(u,u)},onBlur:()=>j(null),onKeyDown:l=>{if(l.key==="Escape")j(null);else if(l.key==="Enter"&&!l.shiftKey)l.preventDefault(),j(null),e<b.length-1&&w(e+1,s);else if(l.key==="Tab"){l.preventDefault(),j(null);const u=v.indexOf(s);l.shiftKey?u>0?w(e,v[u-1]):e>0&&w(e-1,v[v.length-1]):u<v.length-1?w(e,v[u+1]):e<b.length-1&&w(e+1,v[0])}}}):a.jsx("span",{className:"cell-text",children:t.prompt||""}),o&&a.jsx("div",{className:"fill-handle",onMouseDown:l=>{l.stopPropagation(),ke(e,s)}})]});case"size":return a.jsxs("div",{className:c,onMouseDown:l=>{l.target.classList.contains("fill-handle")||l.button===0&&!l.shiftKey&&Ie(e,s)},onClick:l=>Q(l,e,s),onDoubleClick:()=>{w(e,s),j({row:e,col:s})},children:[n?a.jsx("select",{autoFocus:!0,value:t.size,onChange:l=>{y(e,s,l.target.value),j(null)},onBlur:()=>{setTimeout(()=>j(null),150)},onKeyDown:l=>{l.key==="Escape"&&j(null)},onClick:l=>l.stopPropagation(),children:Ne.map(l=>a.jsx("option",{value:l,children:dt[l]||l},l))}):a.jsx("span",{className:"cell-text",children:dt[t.size]||t.size}),o&&a.jsx("div",{className:"fill-handle",onMouseDown:l=>{l.stopPropagation(),ke(e,s)}})]});case"images":return a.jsxs("div",{className:c,onClick:l=>Q(l,e,s),children:[a.jsxs("div",{className:"image-cell-content",children:[t.images.map((l,u)=>a.jsxs("div",{className:"cell-image-thumb",children:[a.jsx("img",{src:l,alt:""}),a.jsx("button",{className:"remove-btn",onClick:g=>{g.stopPropagation(),St(e,l)},children:"×"})]},u)),a.jsxs("div",{className:"add-image-buttons",children:[a.jsx("button",{className:"add-image-btn",onClick:l=>{l.stopPropagation(),w(e,s),zt(e)},title:r==="zh"?"上传图片":"Upload image","data-track":"batch_row_upload_image_click",children:a.jsx(rs,{size:14})}),a.jsx("button",{className:"add-image-btn",onClick:l=>{l.stopPropagation(),w(e,s),Rt(e)},title:r==="zh"?"从素材库选择":"Select from library","data-track":"batch_row_select_from_library_click",children:a.jsx(is,{size:14})})]})]}),o&&a.jsx("div",{className:"fill-handle",onMouseDown:l=>{l.stopPropagation(),ke(e,s)}})]});case"count":return a.jsxs("div",{className:c,onMouseDown:l=>{l.target.classList.contains("fill-handle")||n||l.button===0&&!l.shiftKey&&Ie(e,s)},onClick:l=>{n||Q(l,e,s)},onDoubleClick:()=>fe(e,s),children:[n?a.jsx("input",{type:"number",autoFocus:!0,min:1,value:t.count===0?"":t.count,onChange:l=>{const u=l.target.value;if(u==="")y(e,s,0);else{const g=Math.max(1,parseInt(u)||1);y(e,s,g)}},onFocus:l=>{const u=l.target,g=u.value.length;setTimeout(()=>u.setSelectionRange(g,g),0)},onBlur:()=>{t.count===0&&y(e,s,1),j(null)},onKeyDown:l=>{if(l.key==="Escape")t.count===0&&y(e,s,1),j(null);else if(l.key==="Enter")l.preventDefault(),t.count===0&&y(e,s,1),j(null),e<b.length-1&&w(e+1,s);else if(l.key==="Tab"){l.preventDefault(),t.count===0&&y(e,s,1),j(null);const u=v.indexOf(s);l.shiftKey?u>0?w(e,v[u-1]):e>0&&w(e-1,v[v.length-1]):u<v.length-1?w(e,v[u+1]):e<b.length-1&&w(e+1,v[0])}}}):a.jsx("span",{className:"cell-text",children:t.count}),o&&a.jsx("div",{className:"fill-handle",onMouseDown:l=>{l.stopPropagation(),ke(e,s)}})]});case"preview":const d=F(t);return a.jsxs("div",{className:`${c} preview-cell preview-${d.status}`,onClick:l=>{d.status==="completed"||d.status==="partial"?Me(e):d.status==="failed"?x.has(e)||Ce(e):Q(l,e,s)},children:[d.status==="idle"&&a.jsx("span",{className:"preview-idle",children:"-"}),(d.status==="generating"||d.status==="completed")&&(()=>{const l=d.tasks.filter(p=>{var N;return p.status===R.COMPLETED&&((N=p.result)==null?void 0:N.url)}).map(p=>p.result.url),u=d.status==="generating",g=d.tasks.filter(p=>p.status===R.PENDING||p.status===R.PROCESSING).length;return l.length===0&&u?a.jsxs("span",{className:"preview-generating",children:[a.jsx("span",{className:"loading-spinner"}),r==="zh"?"生成中...":"Generating..."]}):a.jsxs("div",{className:"preview-images",children:[l.slice(0,u?2:3).map((p,N)=>a.jsx("div",{className:"preview-thumb clickable",onClick:T=>{T.stopPropagation(),Fe(l,N)},title:r==="zh"?"点击放大,左右切换":"Click to enlarge, swipe to navigate",children:a.jsx("img",{src:p,alt:`Result ${N+1}`})},N)),u&&a.jsxs("span",{className:"preview-generating-inline",title:r==="zh"?`还有 ${g} 张生成中`:`${g} more generating`,children:[a.jsx("span",{className:"loading-spinner"}),"+",g]}),!u&&d.completedCount>3&&a.jsxs("span",{className:"preview-more clickable",onClick:p=>{p.stopPropagation(),Me(e)},title:r==="zh"?"查看全部图片":"View all images",children:["+",d.completedCount-3]})]})})(),d.status==="failed"&&((h=d.tasks[0])==null?void 0:h.error)&&a.jsxs("div",{className:"preview-error",children:[a.jsx("span",{className:"preview-error-message",children:d.tasks[0].error.message}),((f=d.tasks[0].error.details)==null?void 0:f.originalError)&&a.jsx(ls,{content:a.jsxs("div",{className:"error-details-tooltip",children:[a.jsx("div",{className:"error-details-title",children:"原始错误信息:"}),a.jsx("div",{className:"error-details-content",children:d.tasks[0].error.details.originalError})]}),theme:"light",placement:"bottom",children:a.jsx("span",{className:"preview-error-details-link",children:"[详情]"})})]}),d.status==="partial"&&(()=>{const l=d.tasks.filter(u=>{var g;return u.status===R.COMPLETED&&((g=u.result)==null?void 0:g.url)}).map(u=>u.result.url);return a.jsxs("div",{className:"preview-partial",children:[a.jsx("div",{className:"preview-images",children:l.slice(0,2).map((u,g)=>a.jsx("div",{className:"preview-thumb clickable",onClick:p=>{p.stopPropagation(),Fe(l,g)},title:r==="zh"?"点击放大,左右切换":"Click to enlarge, swipe to navigate",children:a.jsx("img",{src:u,alt:`Result ${g+1}`})},g))}),a.jsxs("span",{className:"preview-partial-info",children:["⚠️ ",d.completedCount,"/",d.tasks.length]})]})})()]});default:return null}};return a.jsxs("div",{className:"batch-image-generation",children:[a.jsxs("div",{className:"batch-main-content",children:[a.jsxs("div",{className:"batch-toolbar",children:[a.jsx("input",{ref:he,type:"file",accept:"image/*",multiple:!0,onChange:At,style:{display:"none"}}),a.jsx("input",{ref:ge,type:"file",accept:"image/*",multiple:!0,onChange:_t,style:{display:"none"}}),a.jsx("input",{ref:me,type:"file",accept:".xlsx,.xls,.csv",onChange:Ot,style:{display:"none"}}),a.jsxs("div",{className:"toolbar-left",children:[a.jsx("button",{className:"btn btn-secondary",onClick:Pt,"data-track":"batch_download_template_click",children:r==="zh"?"⬇️ 下载模板":"⬇️ Template"}),a.jsx("button",{className:"btn btn-secondary",onClick:()=>{var t;return(t=me.current)==null?void 0:t.click()},"data-track":"batch_import_excel_click",children:r==="zh"?"📋 导入Excel":"📋 Import Excel"}),a.jsx("button",{className:"btn btn-secondary",onClick:()=>{var t;return(t=he.current)==null?void 0:t.click()},"data-track":"batch_import_images_click","data-track-params":JSON.stringify({source:"toolbar"}),children:r==="zh"?"🖼️ 批量导入图片":"🖼️ Batch Import"}),a.jsx("span",{className:"toolbar-divider",children:"|"}),a.jsx("button",{className:"btn btn-secondary",onClick:Kt,"data-track":"batch_select_failed_click",children:r==="zh"?"选择失败行":"Select Failed"}),a.jsx("button",{className:"btn btn-secondary",onClick:Ft,"data-track":"batch_invert_selection_click",children:r==="zh"?"反选":"Invert"}),a.jsx("span",{className:"toolbar-divider",children:"|"}),a.jsx("button",{className:"btn btn-secondary",onClick:Ct,"data-track":"batch_delete_selected_click","data-track-params":JSON.stringify({count:x.size}),children:r==="zh"?"删除选中":"Delete Selected"}),a.jsx("span",{className:"toolbar-divider",children:"|"}),a.jsx("button",{className:"btn btn-secondary",onClick:Gt,"data-track":"batch_download_images_click","data-track-params":JSON.stringify({count:x.size}),children:r==="zh"?"💾 下载选中图片":"💾 Download"})]}),a.jsxs("div",{className:"toolbar-right",children:[a.jsx("div",{className:"model-selector-wrapper","data-track":"batch_model_select",children:a.jsx(cs,{value:ie,onChange:t=>bt(t),options:ss,size:"small",placeholder:r==="zh"?"选择图片模型":"Select Image Model",filterable:!0,creatable:!0,disabled:je})}),X&&a.jsx("button",{className:"btn btn-text",onClick:X,"data-track":"batch_switch_to_single_click",children:r==="zh"?"← 返回单图模式":"← Back to Single"}),(()=>{const t=[...x].filter(s=>{const n=b[s];return n&&n.prompt&&n.prompt.trim()!==""}),e=t.reduce((s,n)=>{const o=b[n];return s+((o==null?void 0:o.count)||1)},0);return t.length>0?a.jsx("span",{className:"task-count-badge",children:r==="zh"?`${t.length} 行 / ${e} 任务`:`${t.length} rows / ${e} tasks`}):null})(),a.jsx("button",{className:"btn btn-primary",onClick:Bt,disabled:je,"data-track":"batch_generate_click","data-track-params":JSON.stringify({selectedRows:x.size,model:ie}),children:je?r==="zh"?"提交中...":"Submitting...":r==="zh"?"生成选中行":"Generate Selected"})]})]}),a.jsxs("div",{className:"excel-table-container",onMouseMove:xt,onMouseUp:we,onMouseLeave:we,children:[a.jsxs("table",{className:"excel-table",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{className:"col-checkbox",children:a.jsx("input",{type:"checkbox",checked:b.length>0&&x.size===b.length,onChange:Ut,title:r==="zh"?"全选/取消全选":"Select All / Deselect All"})}),a.jsx("th",{className:"row-number",children:"#"}),a.jsx("th",{className:"col-prompt",children:a.jsxs("div",{className:"th-content",children:[r==="zh"?"提示词":"Prompt",a.jsx("button",{className:"column-fill-btn",onClick:()=>be("prompt"),"data-track":"batch_fill_column_click","data-track-params":JSON.stringify({column:"prompt"}),children:"⬇"})]})}),a.jsx("th",{className:"col-size",children:a.jsxs("div",{className:"th-content",children:[r==="zh"?"尺寸":"Size",a.jsx("button",{className:"column-fill-btn",onClick:()=>be("size"),"data-track":"batch_fill_column_click","data-track-params":JSON.stringify({column:"size"}),children:"⬇"})]})}),a.jsx("th",{className:"col-images",children:a.jsxs("div",{className:"th-content",children:[r==="zh"?"参考图片":"Ref Images",a.jsx("button",{className:"column-fill-btn",onClick:()=>be("images"),"data-track":"batch_fill_column_click","data-track-params":JSON.stringify({column:"images"}),children:"⬇"})]})}),a.jsx("th",{className:"col-count",children:a.jsxs("div",{className:"th-content",children:[r==="zh"?"数量":"Count",a.jsx("button",{className:"column-fill-btn",onClick:()=>be("count"),"data-track":"batch_fill_column_click","data-track-params":JSON.stringify({column:"count"}),children:"⬇"})]})}),a.jsx("th",{className:"col-preview",children:a.jsx("div",{className:"th-content",children:r==="zh"?"预览":"Preview"})})]})}),a.jsx("tbody",{children:b.map((t,e)=>a.jsxs("tr",{"data-row-index":e,className:`${x.has(e)?"row-selected":""} ${gt===e?"row-drag-over":""} ${mt.includes(e)?"fill-preview":""}`,onDragOver:s=>Dt(s,e),onDragLeave:Tt,onDrop:s=>$t(s,e),children:[a.jsx("td",{className:"col-checkbox",onClick:s=>{s.target.tagName!=="INPUT"&&Ce(e,s.shiftKey)},children:a.jsx("input",{type:"checkbox",checked:x.has(e),onClick:s=>{s.stopPropagation(),Ce(e,s.shiftKey)},onChange:()=>{}})}),a.jsx("td",{className:"row-number",onClick:s=>Ce(e,s.shiftKey),style:{cursor:"pointer"},children:e+1}),a.jsx("td",{children:q(t,e,"prompt")}),a.jsx("td",{children:q(t,e,"size")}),a.jsx("td",{children:q(t,e,"images")}),a.jsx("td",{children:q(t,e,"count")}),a.jsx("td",{children:q(t,e,"preview")})]},t.id))})]}),a.jsxs("div",{className:"add-rows-section",children:[a.jsx("button",{className:"add-rows-btn",onClick:()=>oe(!0),title:r==="zh"?"添加行":"Add Rows","data-track":"batch_add_rows_click",children:a.jsx("span",{className:"add-icon",children:"+"})}),a.jsx("button",{className:"btn btn-secondary export-excel-btn",onClick:It,"data-track":"batch_export_excel_click","data-track-params":JSON.stringify({rowCount:b.length}),children:r==="zh"?"📊 导出Excel":"📊 Export Excel"})]})]}),a.jsx("p",{className:"hint-text",children:r==="zh"?"提示:Enter 编辑/确认 | Tab 移动 | Ctrl+Z 撤销 | Ctrl+Y 重做 | 拖拽图片到行":"Tip: Enter to edit/confirm | Tab to move | Ctrl+Z undo | Ctrl+Y redo | Drag images to rows"})]}),a.jsxs("div",{className:`image-library-sidebar ${H?"collapsed":""}`,children:[a.jsxs("div",{className:"library-header",children:[a.jsx("h3",{children:r==="zh"?"素材库":"Library"}),a.jsx("button",{className:"toggle-btn",onClick:()=>Qe(!H),"data-track":"batch_library_toggle_click","data-track-params":JSON.stringify({collapsed:!H}),children:H?"▶":"◀"})]}),!H&&a.jsxs("div",{className:"library-content",children:[a.jsxs("div",{className:"upload-section",children:[a.jsx("input",{ref:de,type:"file",accept:"image/*",multiple:!0,onChange:Nt,style:{display:"none"}}),a.jsx("button",{className:"upload-btn",onClick:()=>{var t;return(t=de.current)==null?void 0:t.click()},"data-track":"batch_library_upload_click",children:r==="zh"?"📤 上传图片":"📤 Upload"})]}),a.jsx("div",{className:"library-grid",children:Ve.length===0?a.jsx("div",{className:"empty-library",children:r==="zh"?"暂无图片,请上传":"No images, please upload"}):Ve.map(t=>a.jsx("div",{className:"library-image",onClick:()=>jt(t.url),draggable:!0,onDragStart:e=>Mt(e,t.url),title:r==="zh"?"点击添加到选中行,或拖拽到指定行":"Click to add to selected rows, or drag to a specific row","data-track":"batch_library_image_click",children:a.jsx("img",{src:t.url,alt:t.name,draggable:!1})},t.id))})]})]}),ft&&a.jsx("div",{className:"batch-import-modal-overlay",onClick:Ke,children:a.jsxs("div",{className:"batch-import-modal",onClick:t=>t.stopPropagation(),children:[a.jsxs("div",{className:"modal-header",children:[a.jsx("h3",{children:r==="zh"?"批量导入图片":"Batch Import Images"}),a.jsx("button",{className:"close-btn",onClick:Ke,children:"×"})]}),a.jsxs("div",{className:"modal-body",children:[a.jsx("p",{className:"import-info",children:r==="zh"?`已选择 ${_.length} 张图片`:`${_.length} images selected`}),a.jsxs("div",{className:"import-settings-row",children:[a.jsxs("div",{className:"import-setting-item",children:[a.jsx("label",{children:r==="zh"?"从第几行开始:":"Start from row:"}),a.jsx("input",{type:"number",min:1,max:b.length+Math.ceil(_.length/L),value:K,onChange:t=>{const e=Math.max(1,parseInt(t.target.value)||1);st(e)},className:"start-row-input"})]}),a.jsxs("div",{className:"import-setting-item",children:[a.jsx("label",{children:r==="zh"?"每行图片数:":"Images per row:"}),a.jsx("div",{className:"per-row-options",children:[1,2,3,4,5].map(t=>a.jsx("button",{className:`per-row-btn ${L===t?"active":""}`,onClick:()=>pt(t),children:t},t))})]})]}),a.jsx("p",{className:"import-preview",children:r==="zh"?`从第 ${K} 行开始,填充 ${Math.ceil(_.length/L)} 行,每行 ${L} 张图片`:`Starting from row ${K}, filling ${Math.ceil(_.length/L)} rows with ${L} image(s) each`}),a.jsxs("div",{className:"import-preview-grid",children:[$e.map((t,e)=>a.jsx("div",{className:"preview-item",children:a.jsx("img",{src:t,alt:""})},e)),_.length>12&&a.jsxs("div",{className:"preview-more",children:["+",_.length-12]})]})]}),a.jsxs("div",{className:"modal-footer",children:[a.jsx("button",{className:"btn btn-secondary",onClick:Ke,"data-track":"batch_import_modal_cancel_click",children:r==="zh"?"取消":"Cancel"}),a.jsx("button",{className:"btn btn-primary",onClick:Lt,"data-track":"batch_import_modal_confirm_click","data-track-params":JSON.stringify({imageCount:_.length,imagesPerRow:L,startRow:K}),children:r==="zh"?"确认导入":"Import"})]})]})}),a.jsx(Xe,{visible:z.length>0,onClose:Ue,header:z.length>1?`${r==="zh"?"图片预览":"Image Preview"} (${ce+1}/${z.length})`:r==="zh"?"图片预览":"Image Preview",footer:null,width:"80vw",placement:"center",className:"image-preview-dialog",destroyOnClose:!0,children:z.length>0&&a.jsxs("div",{className:"image-preview-content",onTouchStart:t=>{const e=t.touches[0];t.currentTarget._touchStartX=e.clientX},onTouchEnd:t=>{const e=t.currentTarget._touchStartX;if(e===void 0)return;const n=t.changedTouches[0].clientX-e;Math.abs(n)>50&&(n>0?ve():ye()),delete t.currentTarget._touchStartX},children:[z.length>1&&a.jsx("button",{className:"preview-nav-btn preview-nav-prev",onClick:ve,title:r==="zh"?"上一张":"Previous",children:"‹"}),a.jsx("img",{src:z[ce],alt:`Preview ${ce+1}`}),z.length>1&&a.jsx("button",{className:"preview-nav-btn preview-nav-next",onClick:ye,title:r==="zh"?"下一张":"Next",children:"›"}),z.length>1&&a.jsx("div",{className:"preview-indicators",children:z.map((t,e)=>a.jsx("span",{className:`preview-indicator ${e===ce?"active":""}`,onClick:()=>Y(e)},e))})]})}),a.jsx(Xe,{visible:kt,onClose:()=>oe(!1),header:r==="zh"?"添加行":"Add Rows",confirmBtn:{content:r==="zh"?"添加":"Add",onClick:()=>{yt(ue),oe(!1),k.success(r==="zh"?`已添加 ${ue} 行`:`Added ${ue} rows`)}},cancelBtn:{content:r==="zh"?"取消":"Cancel",onClick:()=>oe(!1)},width:360,className:"add-rows-dialog",destroyOnClose:!0,children:a.jsxs("div",{className:"add-rows-content",children:[a.jsx("label",{children:r==="zh"?"添加行数:":"Number of rows:"}),a.jsx("input",{type:"number",min:1,max:100,value:ue,onChange:t=>wt(Math.max(1,Math.min(100,parseInt(t.target.value)||1))),className:"add-rows-input",autoFocus:!0})]})}),a.jsx(Xe,{visible:Z!==null,onClose:()=>Me(null),header:r==="zh"?`第 ${(Z??0)+1} 行生成结果`:`Row ${(Z??0)+1} Results`,footer:null,width:"70vw",className:"row-gallery-dialog",destroyOnClose:!0,children:Z!==null&&(()=>{const t=b[Z];if(!t)return null;const s=F(t).tasks.filter(o=>{var m;return o.status===R.COMPLETED&&((m=o.result)==null?void 0:m.url)}),n=s.map(o=>o.result.url);return a.jsxs("div",{className:"row-gallery-content",children:[a.jsx("div",{className:"gallery-grid",children:s.map((o,m)=>a.jsxs("div",{className:"gallery-item",onClick:()=>Fe(n,m),children:[a.jsx("img",{src:o.result.url,alt:`Result ${m+1}`}),a.jsx("span",{className:"gallery-item-index",children:m+1})]},o.id))}),s.length===0&&a.jsx("div",{className:"gallery-empty",children:r==="zh"?"暂无生成结果":"No results yet"})]})})()}),a.jsx(as,{isOpen:vt,onClose:()=>{Ae(!1),Pe(null)},mode:ns.SELECT,filterType:J.IMAGE,onSelect:Et})]})};export{ps as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.batch-image-generation{display:flex;height:100%;gap:16px;padding:16px;background:#f5f5f5;overflow:hidden}.batch-image-generation .batch-main-content{flex:1;display:flex;flex-direction:column;min-width:0;background:#fff;border-radius:8px;padding:16px;box-shadow:0 1px 3px #0000001a}.batch-image-generation .batch-toolbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px;flex-wrap:wrap;gap:8px}.batch-image-generation .batch-toolbar .toolbar-left,.batch-image-generation .batch-toolbar .toolbar-right{display:flex;gap:8px;align-items:center}.batch-image-generation .btn{padding:8px 16px;border:none;border-radius:6px;font-size:13px;font-weight:500;cursor:pointer;transition:all .2s;white-space:nowrap}.batch-image-generation .btn:disabled{opacity:.5;cursor:not-allowed}.batch-image-generation .btn-primary{background:linear-gradient(135deg,#f39c12,#e67e22);color:#fff}.batch-image-generation .btn-primary:hover:not(:disabled){transform:translateY(-1px);box-shadow:0 4px 12px #f39c124d}.batch-image-generation .btn-secondary{background:#fff;color:#666;border:1px solid #ddd}.batch-image-generation .btn-secondary:hover:not(:disabled){background:#f5f5f5}.batch-image-generation .btn-text{background:none;color:#666;padding:8px 12px}.batch-image-generation .btn-text:hover{color:#f39c12}.batch-image-generation .excel-table-container{flex:1;overflow:auto;border:1px solid #e0e0e0;border-radius:6px}.batch-image-generation .excel-table{width:100%;border-collapse:separate;border-spacing:0;table-layout:fixed}.batch-image-generation .excel-table th,.batch-image-generation .excel-table td{border:1px solid #e0e0e0;padding:0;vertical-align:top;height:1px}.batch-image-generation .excel-table th{background:#f5f5f5;font-weight:600;font-size:13px;color:#666;text-align:center;position:sticky;top:0;z-index:10}.batch-image-generation .excel-table .row-number{width:50px;min-width:50px;text-align:center;background:#f5f5f5;font-weight:600;color:#666;padding:8px;position:sticky;left:0;z-index:5}.batch-image-generation .excel-table th.row-number{z-index:15}.batch-image-generation .excel-table .col-checkbox{width:40px;min-width:40px;text-align:center;vertical-align:middle}.batch-image-generation .excel-table .col-checkbox input[type=checkbox]{width:16px;height:16px;cursor:pointer;accent-color:#F39C12}.batch-image-generation .excel-table td.row-number{vertical-align:middle}.batch-image-generation .excel-table .col-prompt{width:35%;min-width:200px}.batch-image-generation .excel-table .col-size{width:80px;min-width:80px}.batch-image-generation .excel-table .col-images{width:150px;min-width:150px}.batch-image-generation .excel-table .col-count{width:60px;min-width:60px}.batch-image-generation .excel-table .col-preview{width:150px;min-width:150px}.batch-image-generation .excel-table tr.row-selected td{background:#f39c1214}.batch-image-generation .excel-table tr{transition:background .15s}.batch-image-generation .excel-table tr:hover td{background:#f39c1208}.batch-image-generation .excel-table tr.row-drag-over td{background:#f39c1226!important;border-top:2px solid #F39C12;border-bottom:2px solid #F39C12}.batch-image-generation .excel-table tr.row-drag-over td:first-child{border-left:2px solid #F39C12}.batch-image-generation .excel-table tr.fill-preview td{background:#1890ff1a!important}.batch-image-generation .excel-table tr.fill-preview td:last-child{border-right:2px solid #F39C12}.batch-image-generation .excel-table .th-content{display:flex;align-items:center;justify-content:center;gap:4px;padding:8px}.batch-image-generation .excel-table .column-fill-btn{background:linear-gradient(135deg,#f39c12,#e67e22);color:#fff;border:none;border-radius:4px;padding:2px 6px;font-size:11px;cursor:pointer;transition:all .2s}.batch-image-generation .excel-table .column-fill-btn:hover{transform:scale(1.05);box-shadow:0 2px 8px #f39c1266}.batch-image-generation .excel-cell{min-height:40px;height:100%;padding:8px;cursor:cell;position:relative;display:flex;align-items:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;box-sizing:border-box}.batch-image-generation .excel-cell.active{background:#fff;outline:2px solid #F39C12;outline-offset:-2px;z-index:2}.batch-image-generation .excel-cell.selected{background:#f39c121a;outline:2px solid #F39C12;outline-offset:-2px;z-index:1}.batch-image-generation .excel-cell.active.selected{z-index:2}.batch-image-generation .excel-cell .cell-text{word-break:break-word;white-space:pre-wrap;pointer-events:none}.batch-image-generation .excel-cell input,.batch-image-generation .excel-cell textarea,.batch-image-generation .excel-cell select{width:100%;border:none;outline:none;background:transparent;font-size:13px;font-family:inherit;padding:0;resize:none;-webkit-user-select:text;-moz-user-select:text;user-select:text}.batch-image-generation .excel-cell textarea{min-height:60px}.batch-image-generation .excel-cell input[type=number]{text-align:center;-moz-appearance:textfield}.batch-image-generation .excel-cell input[type=number]::-webkit-outer-spin-button,.batch-image-generation .excel-cell input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.batch-image-generation .excel-cell .fill-handle{position:absolute;bottom:-4px;right:-4px;width:10px;height:10px;background:#f39c12;border:2px solid white;cursor:crosshair;z-index:100;display:none;box-shadow:0 1px 3px #0000004d}.batch-image-generation .excel-cell .fill-handle:hover{transform:scale(1.2);background:#e67e22}.batch-image-generation .excel-cell.active .fill-handle{display:block}.batch-image-generation .image-cell-content{display:flex;gap:4px;flex-wrap:wrap;align-items:center;width:100%}.batch-image-generation .cell-image-thumb{width:36px;height:36px;border-radius:4px;overflow:hidden;position:relative;border:1px solid #ddd;flex-shrink:0}.batch-image-generation .cell-image-thumb img{width:100%;height:100%;-o-object-fit:cover;object-fit:cover}.batch-image-generation .cell-image-thumb .remove-btn{position:absolute;top:0;right:0;background:#dc3545e6;color:#fff;border:none;width:16px;height:16px;font-size:10px;line-height:1;cursor:pointer;display:none;padding:0}.batch-image-generation .cell-image-thumb:hover .remove-btn{display:block}.batch-image-generation .add-image-buttons{display:flex;gap:4px;flex-shrink:0}.batch-image-generation .add-image-btn{width:28px;height:28px;border:1px solid #ddd;border-radius:4px;background:#f9f9f9;color:#666;display:flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0;transition:all .15s}.batch-image-generation .add-image-btn:hover{border-color:#f39c12;color:#f39c12;background:#fff}.batch-image-generation .hint-text{font-size:12px;color:#999;margin-top:12px;text-align:center}.batch-image-generation .image-library-sidebar{width:240px;background:#fff;border-radius:8px;box-shadow:0 1px 3px #0000001a;display:flex;flex-direction:column;transition:width .3s;overflow:hidden}.batch-image-generation .image-library-sidebar.collapsed{width:48px}.batch-image-generation .image-library-sidebar.collapsed .library-content,.batch-image-generation .image-library-sidebar.collapsed .library-header h3{display:none}.batch-image-generation .image-library-sidebar .library-header{padding:12px;background:linear-gradient(135deg,#f39c12,#e67e22);color:#fff;display:flex;align-items:center;justify-content:space-between}.batch-image-generation .image-library-sidebar .library-header h3{font-size:14px;font-weight:600;margin:0}.batch-image-generation .image-library-sidebar .library-header .toggle-btn{background:none;border:none;color:#fff;cursor:pointer;font-size:14px;padding:4px}.batch-image-generation .image-library-sidebar .library-content{flex:1;overflow-y:auto;padding:12px;display:flex;flex-direction:column;gap:12px}.batch-image-generation .image-library-sidebar .upload-section{padding-bottom:12px;border-bottom:1px solid #eee}.batch-image-generation .image-library-sidebar .upload-btn{width:100%;padding:8px 12px;background:linear-gradient(135deg,#f39c12,#e67e22);color:#fff;border:none;border-radius:6px;font-size:13px;font-weight:500;cursor:pointer;transition:all .2s}.batch-image-generation .image-library-sidebar .upload-btn:hover{transform:translateY(-1px);box-shadow:0 4px 12px #f39c124d}.batch-image-generation .image-library-sidebar .library-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(60px,1fr));gap:8px}.batch-image-generation .image-library-sidebar .empty-library{text-align:center;padding:20px;color:#999;font-size:12px;grid-column:1/-1}.batch-image-generation .image-library-sidebar .library-image{aspect-ratio:1;border-radius:4px;overflow:hidden;cursor:grab;border:2px solid transparent;transition:all .2s;position:relative}.batch-image-generation .image-library-sidebar .library-image:hover{border-color:#f39c12;transform:scale(1.05)}.batch-image-generation .image-library-sidebar .library-image:active{cursor:grabbing}.batch-image-generation .image-library-sidebar .library-image img{width:100%;height:100%;-o-object-fit:cover;object-fit:cover;pointer-events:none}.batch-image-generation .image-library-sidebar .library-image .delete-btn{position:absolute;top:2px;right:2px;width:18px;height:18px;background:#dc3545e6;color:#fff;border:none;border-radius:50%;font-size:12px;line-height:1;cursor:pointer;display:none;align-items:center;justify-content:center}.batch-image-generation .toolbar-divider{color:#ddd;margin:0 4px}.batch-image-generation .task-count-badge{display:inline-flex;align-items:center;gap:4px;padding:4px 10px;background:#e8f4fd;color:#1890ff;font-size:12px;font-weight:500;border-radius:12px;white-space:nowrap}.batch-image-generation .preview-cell{min-height:50px}.batch-image-generation .preview-cell.preview-idle .preview-idle{color:#999;font-size:14px}.batch-image-generation .preview-cell.preview-generating .preview-generating{display:flex;align-items:center;gap:6px;color:#f39c12;font-size:12px}.batch-image-generation .preview-cell.preview-completed{background:#52c41a0d}.batch-image-generation .preview-cell.preview-failed{background:#ff4d4f0d}.batch-image-generation .preview-cell.preview-partial{background:#faad140d}.batch-image-generation .preview-images{display:flex;gap:4px;flex-wrap:wrap;align-items:center}.batch-image-generation .preview-thumb{width:40px;height:40px;border-radius:4px;overflow:hidden;border:1px solid #ddd;flex-shrink:0}.batch-image-generation .preview-thumb img{width:100%;height:100%;-o-object-fit:cover;object-fit:cover}.batch-image-generation .preview-thumb.clickable{cursor:pointer;transition:transform .2s,box-shadow .2s;position:relative}.batch-image-generation .preview-thumb.clickable:hover{transform:scale(1.15);box-shadow:0 2px 8px #00000040;z-index:10}.batch-image-generation .preview-more{font-size:11px;color:#666;padding:2px 4px;background:#f0f0f0;border-radius:3px}.batch-image-generation .preview-more.clickable{cursor:pointer;transition:all .2s}.batch-image-generation .preview-more.clickable:hover{background:#f39c12;color:#fff}.batch-image-generation .preview-generating-inline{display:inline-flex;align-items:center;gap:4px;font-size:11px;color:#1890ff;padding:2px 6px;background:#1890ff1a;border-radius:3px;white-space:nowrap}.batch-image-generation .preview-generating-inline .loading-spinner{width:12px;height:12px;border:2px solid #1890ff;border-top-color:transparent;border-radius:50%;animation:spin 1s linear infinite}.batch-image-generation .preview-error{display:flex;align-items:center;gap:4px;font-size:12px;flex-wrap:wrap}.batch-image-generation .preview-error .preview-error-message{color:#ff4d4f}.batch-image-generation .preview-error .preview-error-details-link{color:#1890ff;cursor:pointer;text-decoration:underline;font-size:11px}.batch-image-generation .preview-error .preview-error-details-link:hover{color:#40a9ff}.batch-image-generation .error-details-tooltip{max-width:400px;font-size:12px}.batch-image-generation .error-details-tooltip .error-details-title{font-weight:600;margin-bottom:4px;color:#333}.batch-image-generation .error-details-tooltip .error-details-content{color:#666;word-break:break-all;white-space:pre-wrap;max-height:200px;overflow-y:auto}.batch-image-generation .preview-partial{display:flex;flex-direction:column;gap:4px}.batch-image-generation .preview-partial-info{font-size:11px;color:#faad14}.batch-image-generation .loading-spinner{width:14px;height:14px;border:2px solid #f0f0f0;border-top:2px solid #F39C12;border-radius:50%;animation:spin 1s linear infinite;flex-shrink:0}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.batch-image-generation .batch-import-modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:#00000080;display:flex;align-items:center;justify-content:center;z-index:1000}.batch-image-generation .batch-import-modal{background:#fff;border-radius:12px;width:480px;max-width:90vw;max-height:80vh;display:flex;flex-direction:column;box-shadow:0 8px 32px #0003}.batch-image-generation .batch-import-modal .modal-header{padding:16px 20px;border-bottom:1px solid #eee;display:flex;align-items:center;justify-content:space-between}.batch-image-generation .batch-import-modal .modal-header h3{font-size:16px;font-weight:600;color:#333;margin:0}.batch-image-generation .batch-import-modal .modal-header .close-btn{background:none;border:none;font-size:20px;color:#999;cursor:pointer;padding:0;width:28px;height:28px;display:flex;align-items:center;justify-content:center;border-radius:4px}.batch-image-generation .batch-import-modal .modal-header .close-btn:hover{background:#f5f5f5;color:#666}.batch-image-generation .batch-import-modal .modal-body{padding:20px;flex:1;overflow-y:auto}.batch-image-generation .batch-import-modal .import-info{font-size:14px;color:#666;margin:0 0 16px}.batch-image-generation .batch-import-modal .import-settings-row{display:flex;gap:24px;margin-bottom:16px}.batch-image-generation .batch-import-modal .import-setting-item{flex:1}.batch-image-generation .batch-import-modal .import-setting-item label{display:block;font-size:14px;font-weight:500;color:#333;margin-bottom:8px}.batch-image-generation .batch-import-modal .import-setting-item .start-row-input{width:80px;height:40px;padding:0 12px;border:2px solid #ddd;border-radius:8px;font-size:16px;font-weight:600;color:#333;text-align:center;transition:all .2s}.batch-image-generation .batch-import-modal .import-setting-item .start-row-input:focus{outline:none;border-color:#f39c12}.batch-image-generation .batch-import-modal .import-setting-item .start-row-input::-webkit-inner-spin-button,.batch-image-generation .batch-import-modal .import-setting-item .start-row-input::-webkit-outer-spin-button{opacity:1}.batch-image-generation .batch-import-modal .import-setting-item .per-row-options{display:flex;gap:8px}.batch-image-generation .batch-import-modal .import-setting-item .per-row-btn{width:40px;height:40px;border:2px solid #ddd;border-radius:8px;background:#fff;font-size:16px;font-weight:600;color:#666;cursor:pointer;transition:all .2s}.batch-image-generation .batch-import-modal .import-setting-item .per-row-btn:hover{border-color:#f39c12;color:#f39c12}.batch-image-generation .batch-import-modal .import-setting-item .per-row-btn.active{border-color:#f39c12;background:linear-gradient(135deg,#f39c12,#e67e22);color:#fff}.batch-image-generation .batch-import-modal .import-preview{font-size:13px;color:#f39c12;background:#fff8e6;padding:10px 12px;border-radius:6px;margin:0 0 16px}.batch-image-generation .batch-import-modal .import-preview-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.batch-image-generation .batch-import-modal .import-preview-grid .preview-item{aspect-ratio:1;border-radius:6px;overflow:hidden;border:1px solid #eee}.batch-image-generation .batch-import-modal .import-preview-grid .preview-item img{width:100%;height:100%;-o-object-fit:cover;object-fit:cover}.batch-image-generation .batch-import-modal .import-preview-grid .preview-more{aspect-ratio:1;border-radius:6px;background:#f5f5f5;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:500;color:#999}.batch-image-generation .batch-import-modal .modal-footer{padding:16px 20px;border-top:1px solid #eee;display:flex;justify-content:flex-end;gap:12px}.batch-image-generation .model-selector-wrapper{min-width:200px}.batch-image-generation .model-selector-wrapper .t-select{width:100%}.image-preview-dialog.t-dialog{position:fixed!important;top:50%!important;left:50%!important;transform:translate(-50%,-50%)!important}.image-preview-dialog .t-dialog__body{padding:16px;max-height:80vh;overflow:auto}.image-preview-dialog .image-preview-content{display:flex;justify-content:center;align-items:center;width:100%;position:relative;-webkit-user-select:none;-moz-user-select:none;user-select:none}.image-preview-dialog .image-preview-content img{max-width:calc(100% - 100px);max-height:70vh;-o-object-fit:contain;object-fit:contain;border-radius:8px;box-shadow:0 4px 20px #00000026}.image-preview-dialog .image-preview-content .preview-nav-btn{position:absolute;top:50%;transform:translateY(-50%);width:44px;height:44px;border:none;border-radius:50%;background:#00000080;color:#fff;font-size:28px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s;z-index:10}.image-preview-dialog .image-preview-content .preview-nav-btn:hover{background:#000000b3;transform:translateY(-50%) scale(1.1)}.image-preview-dialog .image-preview-content .preview-nav-btn:active{transform:translateY(-50%) scale(.95)}.image-preview-dialog .image-preview-content .preview-nav-prev{left:8px}.image-preview-dialog .image-preview-content .preview-nav-next{right:8px}.image-preview-dialog .image-preview-content .preview-indicators{position:absolute;bottom:12px;left:50%;transform:translate(-50%);display:flex;gap:8px;padding:6px 12px;background:#0006;border-radius:20px}.image-preview-dialog .image-preview-content .preview-indicators .preview-indicator{width:8px;height:8px;border-radius:50%;background:#ffffff80;cursor:pointer;transition:all .2s}.image-preview-dialog .image-preview-content .preview-indicators .preview-indicator:hover{background:#fffc}.image-preview-dialog .image-preview-content .preview-indicators .preview-indicator.active{background:#f39c12;transform:scale(1.2)}.add-rows-section{display:flex;justify-content:center;align-items:center;gap:16px;padding:12px 0;border-top:1px dashed #e0e0e0;margin-top:4px}.add-rows-section .add-rows-btn{width:36px;height:36px;border-radius:50%;border:2px dashed #ccc;background:#fafafa;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s}.add-rows-section .add-rows-btn .add-icon{font-size:20px;font-weight:300;color:#999;line-height:1}.add-rows-section .add-rows-btn:hover{border-color:var(--brand-primary, #F39C12);background:#fff}.add-rows-section .add-rows-btn:hover .add-icon{color:var(--brand-primary, #F39C12)}.add-rows-section .export-excel-btn{padding:6px 12px;font-size:12px}.add-rows-dialog .add-rows-content{display:flex;align-items:center;gap:12px;padding:8px 0}.add-rows-dialog .add-rows-content label{font-size:14px;color:#333;white-space:nowrap}.add-rows-dialog .add-rows-content .add-rows-input{flex:1;height:36px;padding:0 12px;border:1px solid #ddd;border-radius:6px;font-size:14px;outline:none;transition:border-color .2s}.add-rows-dialog .add-rows-content .add-rows-input:focus{border-color:var(--brand-primary, #F39C12)}.row-gallery-dialog.t-dialog{position:fixed!important;top:50%!important;left:50%!important;transform:translate(-50%,-50%)!important}.row-gallery-dialog .t-dialog__body{padding:16px;max-height:70vh;overflow:auto}.row-gallery-dialog .row-gallery-content{width:100%}.row-gallery-dialog .gallery-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:12px}.row-gallery-dialog .gallery-item{position:relative;aspect-ratio:1;border-radius:8px;overflow:hidden;cursor:pointer;border:2px solid transparent;transition:all .2s;background:#f5f5f5}.row-gallery-dialog .gallery-item:hover{border-color:#f39c12;transform:scale(1.02);box-shadow:0 4px 12px #00000026}.row-gallery-dialog .gallery-item img{width:100%;height:100%;-o-object-fit:cover;object-fit:cover}.row-gallery-dialog .gallery-item .gallery-item-index{position:absolute;top:6px;left:6px;background:#0009;color:#fff;font-size:11px;font-weight:600;padding:2px 6px;border-radius:4px}.row-gallery-dialog .gallery-empty{text-align:center;padding:40px;color:#999;font-size:14px}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import{X as se,a7 as ye,d as H,e as Ee,l as S,r as we,k as De,g as he,$ as ve}from"./mermaid.core-DfVvnpgz.js";import{c as Ne}from"./clone-oX7o-l4R.js";import{i as ke,a as Ie,b as Oe,p as Te,c as ge,d as ze}from"./edges-e0da2a9e-C-RyePMV.js";import{G as Ce}from"./graph-D-2Ldvxg.js";import{c as Ae}from"./channel-HzrLNFUg.js";import{o as Re}from"./ordinal-BRr1uYdk.js";import{s as Be}from"./Tableau10-Dnlau_Wv.js";import"./index-DWUAFoZG.js";import"./createText-2e5e7dd3-idrqgJjU.js";import"./line-B86HLuqu.js";import"./array-B5oSNiGi.js";import"./path-CY0bYimO.js";import"./init-A0kIFD9x.js";var le,oe,ee=(function(){var e=function(D,o,s,i){for(s=s||{},i=D.length;i--;s[D[i]]=o);return s},a=[1,7],d=[1,13],c=[1,14],n=[1,15],g=[1,19],l=[1,16],f=[1,17],b=[1,18],p=[8,30],x=[8,21,28,29,30,31,32,40,44,47],y=[1,23],T=[1,24],v=[8,15,16,21,28,29,30,31,32,40,44,47],N=[8,15,16,21,27,28,29,30,31,32,40,44,47],E=[1,49],L={trace:function(){},yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,block:31,NODE_ID:32,nodeShapeNLabel:33,dirList:34,DIR:35,NODE_DSTART:36,NODE_DEND:37,BLOCK_ARROW_START:38,BLOCK_ARROW_END:39,classDef:40,CLASSDEF_ID:41,CLASSDEF_STYLEOPTS:42,DEFAULT:43,class:44,CLASSENTITY_IDS:45,STYLECLASS:46,style:47,STYLE_ENTITY_IDS:48,STYLE_DEFINITION_DATA:49,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"block",32:"NODE_ID",35:"DIR",36:"NODE_DSTART",37:"NODE_DEND",38:"BLOCK_ARROW_START",39:"BLOCK_ARROW_END",40:"classDef",41:"CLASSDEF_ID",42:"CLASSDEF_STYLEOPTS",43:"DEFAULT",44:"class",45:"CLASSENTITY_IDS",46:"STYLECLASS",47:"style",48:"STYLE_ENTITY_IDS",49:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[34,1],[34,2],[33,3],[33,4],[23,3],[23,3],[24,3],[25,3]],performAction:function(o,s,i,u,h,t,m){var r=t.length-1;switch(h){case 4:u.getLogger().debug("Rule: separator (NL) ");break;case 5:u.getLogger().debug("Rule: separator (Space) ");break;case 6:u.getLogger().debug("Rule: separator (EOF) ");break;case 7:u.getLogger().debug("Rule: hierarchy: ",t[r-1]),u.setHierarchy(t[r-1]);break;case 8:u.getLogger().debug("Stop NL ");break;case 9:u.getLogger().debug("Stop EOF ");break;case 10:u.getLogger().debug("Stop NL2 ");break;case 11:u.getLogger().debug("Stop EOF2 ");break;case 12:u.getLogger().debug("Rule: statement: ",t[r]),typeof t[r].length=="number"?this.$=t[r]:this.$=[t[r]];break;case 13:u.getLogger().debug("Rule: statement #2: ",t[r-1]),this.$=[t[r-1]].concat(t[r]);break;case 14:u.getLogger().debug("Rule: link: ",t[r],o),this.$={edgeTypeStr:t[r],label:""};break;case 15:u.getLogger().debug("Rule: LABEL link: ",t[r-3],t[r-1],t[r]),this.$={edgeTypeStr:t[r],label:t[r-1]};break;case 18:const R=parseInt(t[r]),Y=u.generateId();this.$={id:Y,type:"space",label:"",width:R,children:[]};break;case 23:u.getLogger().debug("Rule: (nodeStatement link node) ",t[r-2],t[r-1],t[r]," typestr: ",t[r-1].edgeTypeStr);const F=u.edgeStrToEdgeData(t[r-1].edgeTypeStr);this.$=[{id:t[r-2].id,label:t[r-2].label,type:t[r-2].type,directions:t[r-2].directions},{id:t[r-2].id+"-"+t[r].id,start:t[r-2].id,end:t[r].id,label:t[r-1].label,type:"edge",directions:t[r].directions,arrowTypeEnd:F,arrowTypeStart:"arrow_open"},{id:t[r].id,label:t[r].label,type:u.typeStr2Type(t[r].typeStr),directions:t[r].directions}];break;case 24:u.getLogger().debug("Rule: nodeStatement (abc88 node size) ",t[r-1],t[r]),this.$={id:t[r-1].id,label:t[r-1].label,type:u.typeStr2Type(t[r-1].typeStr),directions:t[r-1].directions,widthInColumns:parseInt(t[r],10)};break;case 25:u.getLogger().debug("Rule: nodeStatement (node) ",t[r]),this.$={id:t[r].id,label:t[r].label,type:u.typeStr2Type(t[r].typeStr),directions:t[r].directions,widthInColumns:1};break;case 26:u.getLogger().debug("APA123",this?this:"na"),u.getLogger().debug("COLUMNS: ",t[r]),this.$={type:"column-setting",columns:t[r]==="auto"?-1:parseInt(t[r])};break;case 27:u.getLogger().debug("Rule: id-block statement : ",t[r-2],t[r-1]),u.generateId(),this.$={...t[r-2],type:"composite",children:t[r-1]};break;case 28:u.getLogger().debug("Rule: blockStatement : ",t[r-2],t[r-1],t[r]);const C=u.generateId();this.$={id:C,type:"composite",label:"",children:t[r-1]};break;case 29:u.getLogger().debug("Rule: node (NODE_ID separator): ",t[r]),this.$={id:t[r]};break;case 30:u.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",t[r-1],t[r]),this.$={id:t[r-1],label:t[r].label,typeStr:t[r].typeStr,directions:t[r].directions};break;case 31:u.getLogger().debug("Rule: dirList: ",t[r]),this.$=[t[r]];break;case 32:u.getLogger().debug("Rule: dirList: ",t[r-1],t[r]),this.$=[t[r-1]].concat(t[r]);break;case 33:u.getLogger().debug("Rule: nodeShapeNLabel: ",t[r-2],t[r-1],t[r]),this.$={typeStr:t[r-2]+t[r],label:t[r-1]};break;case 34:u.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",t[r-3],t[r-2]," #3:",t[r-1],t[r]),this.$={typeStr:t[r-3]+t[r],label:t[r-2],directions:t[r-1]};break;case 35:case 36:this.$={type:"classDef",id:t[r-1].trim(),css:t[r].trim()};break;case 37:this.$={type:"applyClass",id:t[r-1].trim(),styleClass:t[r].trim()};break;case 38:this.$={type:"applyStyles",id:t[r-1].trim(),stylesStr:t[r].trim()};break}},table:[{9:1,10:[1,2]},{1:[3]},{11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:d,29:c,31:n,32:g,40:l,44:f,47:b},{8:[1,20]},e(p,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,21:a,28:d,29:c,31:n,32:g,40:l,44:f,47:b}),e(x,[2,16],{14:22,15:y,16:T}),e(x,[2,17]),e(x,[2,18]),e(x,[2,19]),e(x,[2,20]),e(x,[2,21]),e(x,[2,22]),e(v,[2,25],{27:[1,25]}),e(x,[2,26]),{19:26,26:12,32:g},{11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:d,29:c,31:n,32:g,40:l,44:f,47:b},{41:[1,28],43:[1,29]},{45:[1,30]},{48:[1,31]},e(N,[2,29],{33:32,36:[1,33],38:[1,34]}),{1:[2,7]},e(p,[2,13]),{26:35,32:g},{32:[2,14]},{17:[1,36]},e(v,[2,24]),{11:37,13:4,14:22,15:y,16:T,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:d,29:c,31:n,32:g,40:l,44:f,47:b},{30:[1,38]},{42:[1,39]},{42:[1,40]},{46:[1,41]},{49:[1,42]},e(N,[2,30]),{18:[1,43]},{18:[1,44]},e(v,[2,23]),{18:[1,45]},{30:[1,46]},e(x,[2,28]),e(x,[2,35]),e(x,[2,36]),e(x,[2,37]),e(x,[2,38]),{37:[1,47]},{34:48,35:E},{15:[1,50]},e(x,[2,27]),e(N,[2,33]),{39:[1,51]},{34:52,35:E,39:[2,31]},{32:[2,15]},e(N,[2,34]),{39:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:function(o,s){if(s.recoverable)this.trace(o);else{var i=new Error(o);throw i.hash=s,i}},parse:function(o){var s=this,i=[0],u=[],h=[null],t=[],m=this.table,r="",R=0,Y=0,F=2,C=1,Le=t.slice.call(arguments,1),w=Object.create(this.lexer),K={yy:{}};for(var Z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Z)&&(K.yy[Z]=this.yy[Z]);w.setInput(o,K.yy),K.yy.lexer=w,K.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var J=w.yylloc;t.push(J);var me=w.options&&w.options.ranges;typeof K.yy.parseError=="function"?this.parseError=K.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _e(){var P;return P=u.pop()||w.lex()||C,typeof P!="number"&&(P instanceof Array&&(u=P,P=u.pop()),P=s.symbols_[P]||P),P}for(var I,M,z,Q,W={},X,B,ae,G;;){if(M=i[i.length-1],this.defaultActions[M]?z=this.defaultActions[M]:((I===null||typeof I>"u")&&(I=_e()),z=m[M]&&m[M][I]),typeof z>"u"||!z.length||!z[0]){var $="";G=[];for(X in m[M])this.terminals_[X]&&X>F&&G.push("'"+this.terminals_[X]+"'");w.showPosition?$="Parse error on line "+(R+1)+`:
|
|
2
|
+
`+w.showPosition()+`
|
|
3
|
+
Expecting `+G.join(", ")+", got '"+(this.terminals_[I]||I)+"'":$="Parse error on line "+(R+1)+": Unexpected "+(I==C?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError($,{text:w.match,token:this.terminals_[I]||I,line:w.yylineno,loc:J,expected:G})}if(z[0]instanceof Array&&z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+M+", token: "+I);switch(z[0]){case 1:i.push(I),h.push(w.yytext),t.push(w.yylloc),i.push(z[1]),I=null,Y=w.yyleng,r=w.yytext,R=w.yylineno,J=w.yylloc;break;case 2:if(B=this.productions_[z[1]][1],W.$=h[h.length-B],W._$={first_line:t[t.length-(B||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(B||1)].first_column,last_column:t[t.length-1].last_column},me&&(W._$.range=[t[t.length-(B||1)].range[0],t[t.length-1].range[1]]),Q=this.performAction.apply(W,[r,Y,R,K.yy,z[1],h,t].concat(Le)),typeof Q<"u")return Q;B&&(i=i.slice(0,-1*B*2),h=h.slice(0,-1*B),t=t.slice(0,-1*B)),i.push(this.productions_[z[1]][0]),h.push(W.$),t.push(W._$),ae=m[i[i.length-2]][i[i.length-1]],i.push(ae);break;case 3:return!0}}return!0}},A=(function(){var D={EOF:1,parseError:function(s,i){if(this.yy.parser)this.yy.parser.parseError(s,i);else throw new Error(s)},setInput:function(o,s){return this.yy=s||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 s=o.match(/(?:\r\n?|\n).*/g);return s?(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 s=o.length,i=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var h=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:i?(i.length===u.length?this.yylloc.first_column:0)+u[u.length-i.length].length-i[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[h[0],h[0]+this.yyleng-s]),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
|
+
`+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(),s=new Array(o.length+1).join("-");return o+this.upcomingInput()+`
|
|
5
|
+
`+s+"^"},test_match:function(o,s){var i,u,h;if(this.options.backtrack_lexer&&(h={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(h.yylloc.range=this.yylloc.range.slice(0))),u=o[0].match(/(?:\r\n?|\n).*/g),u&&(this.yylineno+=u.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:u?u[u.length-1].length-u[u.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(o[0].length),this.matched+=o[0],i=this.performAction.call(this,this.yy,this,s,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var t in h)this[t]=h[t];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var o,s,i,u;this._more||(this.yytext="",this.match="");for(var h=this._currentRules(),t=0;t<h.length;t++)if(i=this._input.match(this.rules[h[t]]),i&&(!s||i[0].length>s[0].length)){if(s=i,u=t,this.options.backtrack_lexer){if(o=this.test_match(i,h[t]),o!==!1)return o;if(this._backtrack){s=!1;continue}else return!1}else if(!this.options.flex)break}return s?(o=this.test_match(s,h[u]),o!==!1?o:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var s=this.next();return s||this.lex()},begin:function(s){this.conditionStack.push(s)},popState:function(){var s=this.conditionStack.length-1;return s>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(s){return s=this.conditionStack.length-1-Math.abs(s||0),s>=0?this.conditionStack[s]:"INITIAL"},pushState:function(s){this.begin(s)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(s,i,u,h){switch(u){case 0:return 10;case 1:return s.getLogger().debug("Found space-block"),31;case 2:return s.getLogger().debug("Found nl-block"),31;case 3:return s.getLogger().debug("Found space-block"),29;case 4:s.getLogger().debug(".",i.yytext);break;case 5:s.getLogger().debug("_",i.yytext);break;case 6:return 5;case 7:return i.yytext=-1,28;case 8:return i.yytext=i.yytext.replace(/columns\s+/,""),s.getLogger().debug("COLUMNS (LEX)",i.yytext),28;case 9:this.pushState("md_string");break;case 10:return"MD_STR";case 11:this.popState();break;case 12:this.pushState("string");break;case 13:s.getLogger().debug("LEX: POPPING STR:",i.yytext),this.popState();break;case 14:return s.getLogger().debug("LEX: STR end:",i.yytext),"STR";case 15:return i.yytext=i.yytext.replace(/space\:/,""),s.getLogger().debug("SPACE NUM (LEX)",i.yytext),21;case 16:return i.yytext="1",s.getLogger().debug("COLUMNS (LEX)",i.yytext),21;case 17:return 43;case 18:return"LINKSTYLE";case 19:return"INTERPOLATE";case 20:return this.pushState("CLASSDEF"),40;case 21:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 22:return this.popState(),this.pushState("CLASSDEFID"),41;case 23:return this.popState(),42;case 24:return this.pushState("CLASS"),44;case 25:return this.popState(),this.pushState("CLASS_STYLE"),45;case 26:return this.popState(),46;case 27:return this.pushState("STYLE_STMNT"),47;case 28:return this.popState(),this.pushState("STYLE_DEFINITION"),48;case 29:return this.popState(),49;case 30:return this.pushState("acc_title"),"acc_title";case 31:return this.popState(),"acc_title_value";case 32:return this.pushState("acc_descr"),"acc_descr";case 33:return this.popState(),"acc_descr_value";case 34:this.pushState("acc_descr_multiline");break;case 35:this.popState();break;case 36:return"acc_descr_multiline_value";case 37:return 30;case 38:return this.popState(),s.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),s.getLogger().debug("Lex: (("),"NODE_DEND";case 40:return this.popState(),s.getLogger().debug("Lex: ))"),"NODE_DEND";case 41:return this.popState(),s.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),s.getLogger().debug("Lex: (("),"NODE_DEND";case 43:return this.popState(),s.getLogger().debug("Lex: (-"),"NODE_DEND";case 44:return this.popState(),s.getLogger().debug("Lex: -)"),"NODE_DEND";case 45:return this.popState(),s.getLogger().debug("Lex: (("),"NODE_DEND";case 46:return this.popState(),s.getLogger().debug("Lex: ]]"),"NODE_DEND";case 47:return this.popState(),s.getLogger().debug("Lex: ("),"NODE_DEND";case 48:return this.popState(),s.getLogger().debug("Lex: ])"),"NODE_DEND";case 49:return this.popState(),s.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),s.getLogger().debug("Lex: /]"),"NODE_DEND";case 51:return this.popState(),s.getLogger().debug("Lex: )]"),"NODE_DEND";case 52:return this.popState(),s.getLogger().debug("Lex: )"),"NODE_DEND";case 53:return this.popState(),s.getLogger().debug("Lex: ]>"),"NODE_DEND";case 54:return this.popState(),s.getLogger().debug("Lex: ]"),"NODE_DEND";case 55:return s.getLogger().debug("Lexa: -)"),this.pushState("NODE"),36;case 56:return s.getLogger().debug("Lexa: (-"),this.pushState("NODE"),36;case 57:return s.getLogger().debug("Lexa: ))"),this.pushState("NODE"),36;case 58:return s.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;case 59:return s.getLogger().debug("Lex: ((("),this.pushState("NODE"),36;case 60:return s.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;case 61:return s.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;case 62:return s.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;case 63:return s.getLogger().debug("Lexc: >"),this.pushState("NODE"),36;case 64:return s.getLogger().debug("Lexa: (["),this.pushState("NODE"),36;case 65:return s.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;case 66:return this.pushState("NODE"),36;case 67:return this.pushState("NODE"),36;case 68:return this.pushState("NODE"),36;case 69:return this.pushState("NODE"),36;case 70:return this.pushState("NODE"),36;case 71:return this.pushState("NODE"),36;case 72:return this.pushState("NODE"),36;case 73:return s.getLogger().debug("Lexa: ["),this.pushState("NODE"),36;case 74:return this.pushState("BLOCK_ARROW"),s.getLogger().debug("LEX ARR START"),38;case 75:return s.getLogger().debug("Lex: NODE_ID",i.yytext),32;case 76:return s.getLogger().debug("Lex: EOF",i.yytext),8;case 77:this.pushState("md_string");break;case 78:this.pushState("md_string");break;case 79:return"NODE_DESCR";case 80:this.popState();break;case 81:s.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 82:s.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 83:return s.getLogger().debug("LEX: NODE_DESCR:",i.yytext),"NODE_DESCR";case 84:s.getLogger().debug("LEX POPPING"),this.popState();break;case 85:s.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 86:return i.yytext=i.yytext.replace(/^,\s*/,""),s.getLogger().debug("Lex (right): dir:",i.yytext),"DIR";case 87:return i.yytext=i.yytext.replace(/^,\s*/,""),s.getLogger().debug("Lex (left):",i.yytext),"DIR";case 88:return i.yytext=i.yytext.replace(/^,\s*/,""),s.getLogger().debug("Lex (x):",i.yytext),"DIR";case 89:return i.yytext=i.yytext.replace(/^,\s*/,""),s.getLogger().debug("Lex (y):",i.yytext),"DIR";case 90:return i.yytext=i.yytext.replace(/^,\s*/,""),s.getLogger().debug("Lex (up):",i.yytext),"DIR";case 91:return i.yytext=i.yytext.replace(/^,\s*/,""),s.getLogger().debug("Lex (down):",i.yytext),"DIR";case 92:return i.yytext="]>",s.getLogger().debug("Lex (ARROW_DIR end):",i.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 93:return s.getLogger().debug("Lex: LINK","#"+i.yytext+"#"),15;case 94:return s.getLogger().debug("Lex: LINK",i.yytext),15;case 95:return s.getLogger().debug("Lex: LINK",i.yytext),15;case 96:return s.getLogger().debug("Lex: LINK",i.yytext),15;case 97:return s.getLogger().debug("Lex: START_LINK",i.yytext),this.pushState("LLABEL"),16;case 98:return s.getLogger().debug("Lex: START_LINK",i.yytext),this.pushState("LLABEL"),16;case 99:return s.getLogger().debug("Lex: START_LINK",i.yytext),this.pushState("LLABEL"),16;case 100:this.pushState("md_string");break;case 101:return s.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 102:return this.popState(),s.getLogger().debug("Lex: LINK","#"+i.yytext+"#"),15;case 103:return this.popState(),s.getLogger().debug("Lex: LINK",i.yytext),15;case 104:return this.popState(),s.getLogger().debug("Lex: LINK",i.yytext),15;case 105:return s.getLogger().debug("Lex: COLON",i.yytext),i.yytext=i.yytext.slice(1),27}},rules:[/^(?:block-beta\b)/,/^(?:block\s+)/,/^(?:block\n+)/,/^(?:block:)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[29],inclusive:!1},STYLE_STMNT:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[23],inclusive:!1},CLASSDEF:{rules:[21,22],inclusive:!1},CLASS_STYLE:{rules:[26],inclusive:!1},CLASS:{rules:[25],inclusive:!1},LLABEL:{rules:[100,101,102,103,104],inclusive:!1},ARROW_DIR:{rules:[86,87,88,89,90,91,92],inclusive:!1},BLOCK_ARROW:{rules:[77,82,85],inclusive:!1},NODE:{rules:[38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,78,81],inclusive:!1},md_string:{rules:[10,11,79,80],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[13,14,83,84],inclusive:!1},acc_descr_multiline:{rules:[35,36],inclusive:!1},acc_descr:{rules:[33],inclusive:!1},acc_title:{rules:[31],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,12,15,16,17,18,19,20,24,27,30,32,34,37,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,93,94,95,96,97,98,99,105],inclusive:!0}}};return D})();L.lexer=A;function k(){this.yy={}}return k.prototype=L,L.Parser=k,new k})();ee.parser=ee;const Pe=ee;let O={},ie=[],V={};const ce="color",ue="fill",Fe="bgFill",pe=",",Ke=he();let j={};const Me=e=>De.sanitizeText(e,Ke),Ye=function(e,a=""){j[e]===void 0&&(j[e]={id:e,styles:[],textStyles:[]});const d=j[e];a!=null&&a.split(pe).forEach(c=>{const n=c.replace(/([^;]*);/,"$1").trim();if(c.match(ce)){const l=n.replace(ue,Fe).replace(ce,ue);d.textStyles.push(l)}d.styles.push(n)})},We=function(e,a=""){const d=O[e];a!=null&&(d.styles=a.split(pe))},Ve=function(e,a){e.split(",").forEach(function(d){let c=O[d];if(c===void 0){const n=d.trim();O[n]={id:n,type:"na",children:[]},c=O[n]}c.classes||(c.classes=[]),c.classes.push(a)})},fe=(e,a)=>{const d=e.flat(),c=[];for(const n of d){if(n.label&&(n.label=Me(n.label)),n.type==="classDef"){Ye(n.id,n.css);continue}if(n.type==="applyClass"){Ve(n.id,(n==null?void 0:n.styleClass)||"");continue}if(n.type==="applyStyles"){n!=null&&n.stylesStr&&We(n.id,n==null?void 0:n.stylesStr);continue}if(n.type==="column-setting")a.columns=n.columns||-1;else if(n.type==="edge")V[n.id]?V[n.id]++:V[n.id]=1,n.id=V[n.id]+"-"+n.id,ie.push(n);else{n.label||(n.type==="composite"?n.label="":n.label=n.id);const g=!O[n.id];if(g?O[n.id]=n:(n.type!=="na"&&(O[n.id].type=n.type),n.label!==n.id&&(O[n.id].label=n.label)),n.children&&fe(n.children,n),n.type==="space"){const l=n.width||1;for(let f=0;f<l;f++){const b=Ne(n);b.id=b.id+"-"+f,O[b.id]=b,c.push(b)}}else g&&c.push(n)}}a.children=c};let re=[],U={id:"root",type:"composite",children:[],columns:-1};const je=()=>{S.debug("Clear called"),we(),U={id:"root",type:"composite",children:[],columns:-1},O={root:U},re=[],j={},ie=[],V={}};function Ue(e){switch(S.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return S.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}function Xe(e){switch(S.debug("typeStr2Type",e),e){case"==":return"thick";default:return"normal"}}function Ge(e){switch(e.trim()){case"--x":return"arrow_cross";case"--o":return"arrow_circle";default:return"arrow_point"}}let de=0;const He=()=>(de++,"id-"+Math.random().toString(36).substr(2,12)+"-"+de),qe=e=>{U.children=e,fe(e,U),re=U.children},Ze=e=>{const a=O[e];return a?a.columns?a.columns:a.children?a.children.length:-1:-1},Je=()=>[...Object.values(O)],Qe=()=>re||[],$e=()=>ie,et=e=>O[e],tt=e=>{O[e.id]=e},st=()=>console,it=function(){return j},rt={getConfig:()=>se().block,typeStr2Type:Ue,edgeTypeStr2Type:Xe,edgeStrToEdgeData:Ge,getLogger:st,getBlocksFlat:Je,getBlocks:Qe,getEdges:$e,setHierarchy:qe,getBlock:et,setBlock:tt,getColumns:Ze,getClasses:it,clear:je,generateId:He},nt=rt,q=(e,a)=>{const d=Ae,c=d(e,"r"),n=d(e,"g"),g=d(e,"b");return ye(c,n,g,a)},at=e=>`.label {
|
|
7
|
+
font-family: ${e.fontFamily};
|
|
8
|
+
color: ${e.nodeTextColor||e.textColor};
|
|
9
|
+
}
|
|
10
|
+
.cluster-label text {
|
|
11
|
+
fill: ${e.titleColor};
|
|
12
|
+
}
|
|
13
|
+
.cluster-label span,p {
|
|
14
|
+
color: ${e.titleColor};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
.label text,span,p {
|
|
20
|
+
fill: ${e.nodeTextColor||e.textColor};
|
|
21
|
+
color: ${e.nodeTextColor||e.textColor};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.node rect,
|
|
25
|
+
.node circle,
|
|
26
|
+
.node ellipse,
|
|
27
|
+
.node polygon,
|
|
28
|
+
.node path {
|
|
29
|
+
fill: ${e.mainBkg};
|
|
30
|
+
stroke: ${e.nodeBorder};
|
|
31
|
+
stroke-width: 1px;
|
|
32
|
+
}
|
|
33
|
+
.flowchart-label text {
|
|
34
|
+
text-anchor: middle;
|
|
35
|
+
}
|
|
36
|
+
// .flowchart-label .text-outer-tspan {
|
|
37
|
+
// text-anchor: middle;
|
|
38
|
+
// }
|
|
39
|
+
// .flowchart-label .text-inner-tspan {
|
|
40
|
+
// text-anchor: start;
|
|
41
|
+
// }
|
|
42
|
+
|
|
43
|
+
.node .label {
|
|
44
|
+
text-align: center;
|
|
45
|
+
}
|
|
46
|
+
.node.clickable {
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.arrowheadPath {
|
|
51
|
+
fill: ${e.arrowheadColor};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.edgePath .path {
|
|
55
|
+
stroke: ${e.lineColor};
|
|
56
|
+
stroke-width: 2.0px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.flowchart-link {
|
|
60
|
+
stroke: ${e.lineColor};
|
|
61
|
+
fill: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.edgeLabel {
|
|
65
|
+
background-color: ${e.edgeLabelBackground};
|
|
66
|
+
rect {
|
|
67
|
+
opacity: 0.5;
|
|
68
|
+
background-color: ${e.edgeLabelBackground};
|
|
69
|
+
fill: ${e.edgeLabelBackground};
|
|
70
|
+
}
|
|
71
|
+
text-align: center;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* For html labels only */
|
|
75
|
+
.labelBkg {
|
|
76
|
+
background-color: ${q(e.edgeLabelBackground,.5)};
|
|
77
|
+
// background-color:
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.node .cluster {
|
|
81
|
+
// fill: ${q(e.mainBkg,.5)};
|
|
82
|
+
fill: ${q(e.clusterBkg,.5)};
|
|
83
|
+
stroke: ${q(e.clusterBorder,.2)};
|
|
84
|
+
box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
|
|
85
|
+
stroke-width: 1px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.cluster text {
|
|
89
|
+
fill: ${e.titleColor};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.cluster span,p {
|
|
93
|
+
color: ${e.titleColor};
|
|
94
|
+
}
|
|
95
|
+
/* .cluster div {
|
|
96
|
+
color: ${e.titleColor};
|
|
97
|
+
} */
|
|
98
|
+
|
|
99
|
+
div.mermaidTooltip {
|
|
100
|
+
position: absolute;
|
|
101
|
+
text-align: center;
|
|
102
|
+
max-width: 200px;
|
|
103
|
+
padding: 2px;
|
|
104
|
+
font-family: ${e.fontFamily};
|
|
105
|
+
font-size: 12px;
|
|
106
|
+
background: ${e.tertiaryColor};
|
|
107
|
+
border: 1px solid ${e.border2};
|
|
108
|
+
border-radius: 2px;
|
|
109
|
+
pointer-events: none;
|
|
110
|
+
z-index: 100;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.flowchartTitleText {
|
|
114
|
+
text-anchor: middle;
|
|
115
|
+
font-size: 18px;
|
|
116
|
+
fill: ${e.textColor};
|
|
117
|
+
}
|
|
118
|
+
`,lt=at;function be(e,a,d=!1){var c,n,g;const l=e;let f="default";(((c=l==null?void 0:l.classes)==null?void 0:c.length)||0)>0&&(f=((l==null?void 0:l.classes)||[]).join(" ")),f=f+" flowchart-label";let b=0,p="",x;switch(l.type){case"round":b=5,p="rect";break;case"composite":b=0,p="composite",x=0;break;case"square":p="rect";break;case"diamond":p="question";break;case"hexagon":p="hexagon";break;case"block_arrow":p="block_arrow";break;case"odd":p="rect_left_inv_arrow";break;case"lean_right":p="lean_right";break;case"lean_left":p="lean_left";break;case"trapezoid":p="trapezoid";break;case"inv_trapezoid":p="inv_trapezoid";break;case"rect_left_inv_arrow":p="rect_left_inv_arrow";break;case"circle":p="circle";break;case"ellipse":p="ellipse";break;case"stadium":p="stadium";break;case"subroutine":p="subroutine";break;case"cylinder":p="cylinder";break;case"group":p="rect";break;case"doublecircle":p="doublecircle";break;default:p="rect"}const y=ve((l==null?void 0:l.styles)||[]),T=l.label,v=l.size||{width:0,height:0,x:0,y:0};return{labelStyle:y.labelStyle,shape:p,labelText:T,rx:b,ry:b,class:f,style:y.style,id:l.id,directions:l.directions,width:v.width,height:v.height,x:v.x,y:v.y,positioned:d,intersect:void 0,type:l.type,padding:x??(((g=(n=se())==null?void 0:n.block)==null?void 0:g.padding)||0)}}async function ot(e,a,d){const c=be(a,d,!1);if(c.type==="group")return;const n=await ge(e,c),g=n.node().getBBox(),l=d.getBlock(c.id);l.size={width:g.width,height:g.height,x:0,y:0,node:n},d.setBlock(l),n.remove()}async function ct(e,a,d){const c=be(a,d,!0);d.getBlock(c.id).type!=="space"&&(await ge(e,c),a.intersect=c==null?void 0:c.intersect,ze(c))}async function ne(e,a,d,c){for(const n of a)await c(e,n,d),n.children&&await ne(e,n.children,d,c)}async function ut(e,a,d){await ne(e,a,d,ot)}async function dt(e,a,d){await ne(e,a,d,ct)}async function ht(e,a,d,c,n){const g=new Ce({multigraph:!0,compound:!0});g.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const l of d)l.size&&g.setNode(l.id,{width:l.size.width,height:l.size.height,intersect:l.intersect});for(const l of a)if(l.start&&l.end){const f=c.getBlock(l.start),b=c.getBlock(l.end);if(f!=null&&f.size&&(b!=null&&b.size)){const p=f.size,x=b.size,y=[{x:p.x,y:p.y},{x:p.x+(x.x-p.x)/2,y:p.y+(x.y-p.y)/2},{x:x.x,y:x.y}];await Ie(e,{v:l.start,w:l.end,name:l.id},{...l,arrowTypeEnd:l.arrowTypeEnd,arrowTypeStart:l.arrowTypeStart,points:y,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"},void 0,"block",g,n),l.label&&(await Oe(e,{...l,label:l.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:l.arrowTypeEnd,arrowTypeStart:l.arrowTypeStart}),await Te({...l,x:y[1].x,y:y[1].y},{originalPath:y}))}}}const _=((oe=(le=he())==null?void 0:le.block)==null?void 0:oe.padding)||8;function gt(e,a){if(e===0||!Number.isInteger(e))throw new Error("Columns must be an integer !== 0.");if(a<0||!Number.isInteger(a))throw new Error("Position must be a non-negative integer."+a);if(e<0)return{px:a,py:0};if(e===1)return{px:0,py:a};const d=a%e,c=Math.floor(a/e);return{px:d,py:c}}const pt=e=>{let a=0,d=0;for(const c of e.children){const{width:n,height:g,x:l,y:f}=c.size||{width:0,height:0,x:0,y:0};S.debug("getMaxChildSize abc95 child:",c.id,"width:",n,"height:",g,"x:",l,"y:",f,c.type),c.type!=="space"&&(n>a&&(a=n/(e.widthInColumns||1)),g>d&&(d=g))}return{width:a,height:d}};function te(e,a,d=0,c=0){var n,g,l,f,b,p,x,y,T,v,N;S.debug("setBlockSizes abc95 (start)",e.id,(n=e==null?void 0:e.size)==null?void 0:n.x,"block width =",e==null?void 0:e.size,"sieblingWidth",d),(g=e==null?void 0:e.size)!=null&&g.width||(e.size={width:d,height:c,x:0,y:0});let E=0,L=0;if(((l=e.children)==null?void 0:l.length)>0){for(const h of e.children)te(h,a);const A=pt(e);E=A.width,L=A.height,S.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",E,L);for(const h of e.children)h.size&&(S.debug(`abc95 Setting size of children of ${e.id} id=${h.id} ${E} ${L} ${h.size}`),h.size.width=E*(h.widthInColumns||1)+_*((h.widthInColumns||1)-1),h.size.height=L,h.size.x=0,h.size.y=0,S.debug(`abc95 updating size of ${e.id} children child:${h.id} maxWidth:${E} maxHeight:${L}`));for(const h of e.children)te(h,a,E,L);const k=e.columns||-1;let D=0;for(const h of e.children)D+=h.widthInColumns||1;let o=e.children.length;k>0&&k<D&&(o=k),e.widthInColumns;const s=Math.ceil(D/o);let i=o*(E+_)+_,u=s*(L+_)+_;if(i<d){S.debug(`Detected to small siebling: abc95 ${e.id} sieblingWidth ${d} sieblingHeight ${c} width ${i}`),i=d,u=c;const h=(d-o*_-_)/o,t=(c-s*_-_)/s;S.debug("Size indata abc88",e.id,"childWidth",h,"maxWidth",E),S.debug("Size indata abc88",e.id,"childHeight",t,"maxHeight",L),S.debug("Size indata abc88 xSize",o,"padding",_);for(const m of e.children)m.size&&(m.size.width=h,m.size.height=t,m.size.x=0,m.size.y=0)}if(S.debug(`abc95 (finale calc) ${e.id} xSize ${o} ySize ${s} columns ${k}${e.children.length} width=${Math.max(i,((f=e.size)==null?void 0:f.width)||0)}`),i<(((b=e==null?void 0:e.size)==null?void 0:b.width)||0)){i=((p=e==null?void 0:e.size)==null?void 0:p.width)||0;const h=k>0?Math.min(e.children.length,k):e.children.length;if(h>0){const t=(i-h*_-_)/h;S.debug("abc95 (growing to fit) width",e.id,i,(x=e.size)==null?void 0:x.width,t);for(const m of e.children)m.size&&(m.size.width=t)}}e.size={width:i,height:u,x:0,y:0}}S.debug("setBlockSizes abc94 (done)",e.id,(y=e==null?void 0:e.size)==null?void 0:y.x,(T=e==null?void 0:e.size)==null?void 0:T.width,(v=e==null?void 0:e.size)==null?void 0:v.y,(N=e==null?void 0:e.size)==null?void 0:N.height)}function xe(e,a){var d,c,n,g,l,f,b,p,x,y,T,v,N,E,L,A,k;S.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${(d=e==null?void 0:e.size)==null?void 0:d.x} y: ${(c=e==null?void 0:e.size)==null?void 0:c.y} width: ${(n=e==null?void 0:e.size)==null?void 0:n.width}`);const D=e.columns||-1;if(S.debug("layoutBlocks columns abc95",e.id,"=>",D,e),e.children&&e.children.length>0){const o=((l=(g=e==null?void 0:e.children[0])==null?void 0:g.size)==null?void 0:l.width)||0,s=e.children.length*o+(e.children.length-1)*_;S.debug("widthOfChildren 88",s,"posX");let i=0;S.debug("abc91 block?.size?.x",e.id,(f=e==null?void 0:e.size)==null?void 0:f.x);let u=(b=e==null?void 0:e.size)!=null&&b.x?((p=e==null?void 0:e.size)==null?void 0:p.x)+(-((x=e==null?void 0:e.size)==null?void 0:x.width)/2||0):-_,h=0;for(const t of e.children){const m=e;if(!t.size)continue;const{width:r,height:R}=t.size,{px:Y,py:F}=gt(D,i);if(F!=h&&(h=F,u=(y=e==null?void 0:e.size)!=null&&y.x?((T=e==null?void 0:e.size)==null?void 0:T.x)+(-((v=e==null?void 0:e.size)==null?void 0:v.width)/2||0):-_,S.debug("New row in layout for block",e.id," and child ",t.id,h)),S.debug(`abc89 layout blocks (child) id: ${t.id} Pos: ${i} (px, py) ${Y},${F} (${(N=m==null?void 0:m.size)==null?void 0:N.x},${(E=m==null?void 0:m.size)==null?void 0:E.y}) parent: ${m.id} width: ${r}${_}`),m.size){const C=r/2;t.size.x=u+_+C,S.debug(`abc91 layout blocks (calc) px, pyid:${t.id} startingPos=X${u} new startingPosX${t.size.x} ${C} padding=${_} width=${r} halfWidth=${C} => x:${t.size.x} y:${t.size.y} ${t.widthInColumns} (width * (child?.w || 1)) / 2 ${r*((t==null?void 0:t.widthInColumns)||1)/2}`),u=t.size.x+C,t.size.y=m.size.y-m.size.height/2+F*(R+_)+R/2+_,S.debug(`abc88 layout blocks (calc) px, pyid:${t.id}startingPosX${u}${_}${C}=>x:${t.size.x}y:${t.size.y}${t.widthInColumns}(width * (child?.w || 1)) / 2${r*((t==null?void 0:t.widthInColumns)||1)/2}`)}t.children&&xe(t),i+=(t==null?void 0:t.widthInColumns)||1,S.debug("abc88 columnsPos",t,i)}}S.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${(L=e==null?void 0:e.size)==null?void 0:L.x} y: ${(A=e==null?void 0:e.size)==null?void 0:A.y} width: ${(k=e==null?void 0:e.size)==null?void 0:k.width}`)}function Se(e,{minX:a,minY:d,maxX:c,maxY:n}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!=="root"){const{x:g,y:l,width:f,height:b}=e.size;g-f/2<a&&(a=g-f/2),l-b/2<d&&(d=l-b/2),g+f/2>c&&(c=g+f/2),l+b/2>n&&(n=l+b/2)}if(e.children)for(const g of e.children)({minX:a,minY:d,maxX:c,maxY:n}=Se(g,{minX:a,minY:d,maxX:c,maxY:n}));return{minX:a,minY:d,maxX:c,maxY:n}}function ft(e){const a=e.getBlock("root");if(!a)return;te(a,e,0,0),xe(a),S.debug("getBlocks",JSON.stringify(a,null,2));const{minX:d,minY:c,maxX:n,maxY:g}=Se(a),l=g-c,f=n-d;return{x:d,y:c,width:f,height:l}}const bt=function(e,a){return a.db.getClasses()},xt=async function(e,a,d,c){const{securityLevel:n,block:g}=se(),l=c.db;let f;n==="sandbox"&&(f=H("#i"+a));const b=n==="sandbox"?H(f.nodes()[0].contentDocument.body):H("body"),p=n==="sandbox"?b.select(`[id="${a}"]`):H(`[id="${a}"]`);ke(p,["point","circle","cross"],c.type,a);const y=l.getBlocks(),T=l.getBlocksFlat(),v=l.getEdges(),N=p.insert("g").attr("class","block");await ut(N,y,l);const E=ft(l);if(await dt(N,y,l),await ht(N,v,T,l,a),E){const L=E,A=Math.max(1,Math.round(.125*(L.width/L.height))),k=L.height+A+10,D=L.width+10,{useMaxWidth:o}=g;Ee(p,k,D,!!o),S.debug("Here Bounds",E,L),p.attr("viewBox",`${L.x-5} ${L.y-5} ${L.width+10} ${L.height+10}`)}Re(Be)},St={draw:xt,getClasses:bt},zt={parser:Pe,db:nt,renderer:St,styles:lt};export{zt as diagram};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import{Y as se,a8 as ye,d as H,e as Ee,l as S,r as we,k as De,g as he,a0 as ve}from"./index-BwSGXyRr.js";import{c as Ne}from"./clone-B69pF7Y_.js";import{i as ke,a as Ie,b as Oe,p as Te,c as ge,d as ze}from"./edges-e0da2a9e-DJXAjJSL.js";import{G as Ce}from"./graph-BxwlF7JS.js";import{c as Ae}from"./channel-BP25wTsw.js";import{o as Re}from"./ordinal-Cboi1Yqb.js";import{s as Be}from"./Tableau10-B-NsZVaP.js";import"./index-DWUAFoZG.js";import"./isEmpty-Dj2GV0v-.js";import"./createText-2e5e7dd3-CZ9_fscE.js";import"./index-DI_5V2-m.js";import"./index.dom-C3-224fz.js";import"./line-B3bNrkzn.js";import"./array-BKyUJesY.js";import"./path-CbwjOpE9.js";import"./has-CgdIPiQG.js";import"./hasIn-4iY02rGN.js";import"./init-Gi6I4Gst.js";var oe,le,ee=(function(){var e=function(D,l,s,i){for(s=s||{},i=D.length;i--;s[D[i]]=l);return s},a=[1,7],d=[1,13],c=[1,14],n=[1,15],g=[1,19],o=[1,16],f=[1,17],b=[1,18],p=[8,30],x=[8,21,28,29,30,31,32,40,44,47],y=[1,23],T=[1,24],v=[8,15,16,21,28,29,30,31,32,40,44,47],N=[8,15,16,21,27,28,29,30,31,32,40,44,47],E=[1,49],L={trace:function(){},yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,block:31,NODE_ID:32,nodeShapeNLabel:33,dirList:34,DIR:35,NODE_DSTART:36,NODE_DEND:37,BLOCK_ARROW_START:38,BLOCK_ARROW_END:39,classDef:40,CLASSDEF_ID:41,CLASSDEF_STYLEOPTS:42,DEFAULT:43,class:44,CLASSENTITY_IDS:45,STYLECLASS:46,style:47,STYLE_ENTITY_IDS:48,STYLE_DEFINITION_DATA:49,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"block",32:"NODE_ID",35:"DIR",36:"NODE_DSTART",37:"NODE_DEND",38:"BLOCK_ARROW_START",39:"BLOCK_ARROW_END",40:"classDef",41:"CLASSDEF_ID",42:"CLASSDEF_STYLEOPTS",43:"DEFAULT",44:"class",45:"CLASSENTITY_IDS",46:"STYLECLASS",47:"style",48:"STYLE_ENTITY_IDS",49:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[34,1],[34,2],[33,3],[33,4],[23,3],[23,3],[24,3],[25,3]],performAction:function(l,s,i,u,h,t,m){var r=t.length-1;switch(h){case 4:u.getLogger().debug("Rule: separator (NL) ");break;case 5:u.getLogger().debug("Rule: separator (Space) ");break;case 6:u.getLogger().debug("Rule: separator (EOF) ");break;case 7:u.getLogger().debug("Rule: hierarchy: ",t[r-1]),u.setHierarchy(t[r-1]);break;case 8:u.getLogger().debug("Stop NL ");break;case 9:u.getLogger().debug("Stop EOF ");break;case 10:u.getLogger().debug("Stop NL2 ");break;case 11:u.getLogger().debug("Stop EOF2 ");break;case 12:u.getLogger().debug("Rule: statement: ",t[r]),typeof t[r].length=="number"?this.$=t[r]:this.$=[t[r]];break;case 13:u.getLogger().debug("Rule: statement #2: ",t[r-1]),this.$=[t[r-1]].concat(t[r]);break;case 14:u.getLogger().debug("Rule: link: ",t[r],l),this.$={edgeTypeStr:t[r],label:""};break;case 15:u.getLogger().debug("Rule: LABEL link: ",t[r-3],t[r-1],t[r]),this.$={edgeTypeStr:t[r],label:t[r-1]};break;case 18:const R=parseInt(t[r]),Y=u.generateId();this.$={id:Y,type:"space",label:"",width:R,children:[]};break;case 23:u.getLogger().debug("Rule: (nodeStatement link node) ",t[r-2],t[r-1],t[r]," typestr: ",t[r-1].edgeTypeStr);const F=u.edgeStrToEdgeData(t[r-1].edgeTypeStr);this.$=[{id:t[r-2].id,label:t[r-2].label,type:t[r-2].type,directions:t[r-2].directions},{id:t[r-2].id+"-"+t[r].id,start:t[r-2].id,end:t[r].id,label:t[r-1].label,type:"edge",directions:t[r].directions,arrowTypeEnd:F,arrowTypeStart:"arrow_open"},{id:t[r].id,label:t[r].label,type:u.typeStr2Type(t[r].typeStr),directions:t[r].directions}];break;case 24:u.getLogger().debug("Rule: nodeStatement (abc88 node size) ",t[r-1],t[r]),this.$={id:t[r-1].id,label:t[r-1].label,type:u.typeStr2Type(t[r-1].typeStr),directions:t[r-1].directions,widthInColumns:parseInt(t[r],10)};break;case 25:u.getLogger().debug("Rule: nodeStatement (node) ",t[r]),this.$={id:t[r].id,label:t[r].label,type:u.typeStr2Type(t[r].typeStr),directions:t[r].directions,widthInColumns:1};break;case 26:u.getLogger().debug("APA123",this?this:"na"),u.getLogger().debug("COLUMNS: ",t[r]),this.$={type:"column-setting",columns:t[r]==="auto"?-1:parseInt(t[r])};break;case 27:u.getLogger().debug("Rule: id-block statement : ",t[r-2],t[r-1]),u.generateId(),this.$={...t[r-2],type:"composite",children:t[r-1]};break;case 28:u.getLogger().debug("Rule: blockStatement : ",t[r-2],t[r-1],t[r]);const C=u.generateId();this.$={id:C,type:"composite",label:"",children:t[r-1]};break;case 29:u.getLogger().debug("Rule: node (NODE_ID separator): ",t[r]),this.$={id:t[r]};break;case 30:u.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",t[r-1],t[r]),this.$={id:t[r-1],label:t[r].label,typeStr:t[r].typeStr,directions:t[r].directions};break;case 31:u.getLogger().debug("Rule: dirList: ",t[r]),this.$=[t[r]];break;case 32:u.getLogger().debug("Rule: dirList: ",t[r-1],t[r]),this.$=[t[r-1]].concat(t[r]);break;case 33:u.getLogger().debug("Rule: nodeShapeNLabel: ",t[r-2],t[r-1],t[r]),this.$={typeStr:t[r-2]+t[r],label:t[r-1]};break;case 34:u.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",t[r-3],t[r-2]," #3:",t[r-1],t[r]),this.$={typeStr:t[r-3]+t[r],label:t[r-2],directions:t[r-1]};break;case 35:case 36:this.$={type:"classDef",id:t[r-1].trim(),css:t[r].trim()};break;case 37:this.$={type:"applyClass",id:t[r-1].trim(),styleClass:t[r].trim()};break;case 38:this.$={type:"applyStyles",id:t[r-1].trim(),stylesStr:t[r].trim()};break}},table:[{9:1,10:[1,2]},{1:[3]},{11:3,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:d,29:c,31:n,32:g,40:o,44:f,47:b},{8:[1,20]},e(p,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,21:a,28:d,29:c,31:n,32:g,40:o,44:f,47:b}),e(x,[2,16],{14:22,15:y,16:T}),e(x,[2,17]),e(x,[2,18]),e(x,[2,19]),e(x,[2,20]),e(x,[2,21]),e(x,[2,22]),e(v,[2,25],{27:[1,25]}),e(x,[2,26]),{19:26,26:12,32:g},{11:27,13:4,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:d,29:c,31:n,32:g,40:o,44:f,47:b},{41:[1,28],43:[1,29]},{45:[1,30]},{48:[1,31]},e(N,[2,29],{33:32,36:[1,33],38:[1,34]}),{1:[2,7]},e(p,[2,13]),{26:35,32:g},{32:[2,14]},{17:[1,36]},e(v,[2,24]),{11:37,13:4,14:22,15:y,16:T,19:5,20:6,21:a,22:8,23:9,24:10,25:11,26:12,28:d,29:c,31:n,32:g,40:o,44:f,47:b},{30:[1,38]},{42:[1,39]},{42:[1,40]},{46:[1,41]},{49:[1,42]},e(N,[2,30]),{18:[1,43]},{18:[1,44]},e(v,[2,23]),{18:[1,45]},{30:[1,46]},e(x,[2,28]),e(x,[2,35]),e(x,[2,36]),e(x,[2,37]),e(x,[2,38]),{37:[1,47]},{34:48,35:E},{15:[1,50]},e(x,[2,27]),e(N,[2,33]),{39:[1,51]},{34:52,35:E,39:[2,31]},{32:[2,15]},e(N,[2,34]),{39:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:function(l,s){if(s.recoverable)this.trace(l);else{var i=new Error(l);throw i.hash=s,i}},parse:function(l){var s=this,i=[0],u=[],h=[null],t=[],m=this.table,r="",R=0,Y=0,F=2,C=1,Le=t.slice.call(arguments,1),w=Object.create(this.lexer),K={yy:{}};for(var Z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Z)&&(K.yy[Z]=this.yy[Z]);w.setInput(l,K.yy),K.yy.lexer=w,K.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var J=w.yylloc;t.push(J);var me=w.options&&w.options.ranges;typeof K.yy.parseError=="function"?this.parseError=K.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _e(){var P;return P=u.pop()||w.lex()||C,typeof P!="number"&&(P instanceof Array&&(u=P,P=u.pop()),P=s.symbols_[P]||P),P}for(var I,M,z,Q,W={},X,B,ae,G;;){if(M=i[i.length-1],this.defaultActions[M]?z=this.defaultActions[M]:((I===null||typeof I>"u")&&(I=_e()),z=m[M]&&m[M][I]),typeof z>"u"||!z.length||!z[0]){var $="";G=[];for(X in m[M])this.terminals_[X]&&X>F&&G.push("'"+this.terminals_[X]+"'");w.showPosition?$="Parse error on line "+(R+1)+`:
|
|
2
|
+
`+w.showPosition()+`
|
|
3
|
+
Expecting `+G.join(", ")+", got '"+(this.terminals_[I]||I)+"'":$="Parse error on line "+(R+1)+": Unexpected "+(I==C?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError($,{text:w.match,token:this.terminals_[I]||I,line:w.yylineno,loc:J,expected:G})}if(z[0]instanceof Array&&z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+M+", token: "+I);switch(z[0]){case 1:i.push(I),h.push(w.yytext),t.push(w.yylloc),i.push(z[1]),I=null,Y=w.yyleng,r=w.yytext,R=w.yylineno,J=w.yylloc;break;case 2:if(B=this.productions_[z[1]][1],W.$=h[h.length-B],W._$={first_line:t[t.length-(B||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(B||1)].first_column,last_column:t[t.length-1].last_column},me&&(W._$.range=[t[t.length-(B||1)].range[0],t[t.length-1].range[1]]),Q=this.performAction.apply(W,[r,Y,R,K.yy,z[1],h,t].concat(Le)),typeof Q<"u")return Q;B&&(i=i.slice(0,-1*B*2),h=h.slice(0,-1*B),t=t.slice(0,-1*B)),i.push(this.productions_[z[1]][0]),h.push(W.$),t.push(W._$),ae=m[i[i.length-2]][i[i.length-1]],i.push(ae);break;case 3:return!0}}return!0}},A=(function(){var D={EOF:1,parseError:function(s,i){if(this.yy.parser)this.yy.parser.parseError(s,i);else throw new Error(s)},setInput:function(l,s){return this.yy=s||this.yy||{},this._input=l,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 l=this._input[0];this.yytext+=l,this.yyleng++,this.offset++,this.match+=l,this.matched+=l;var s=l.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),l},unput:function(l){var s=l.length,i=l.split(/(?:\r\n?|\n)/g);this._input=l+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var h=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:i?(i.length===u.length?this.yylloc.first_column:0)+u[u.length-i.length].length-i[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[h[0],h[0]+this.yyleng-s]),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
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(l){this.unput(this.match.slice(l))},pastInput:function(){var l=this.matched.substr(0,this.matched.length-this.match.length);return(l.length>20?"...":"")+l.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var l=this.match;return l.length<20&&(l+=this._input.substr(0,20-l.length)),(l.substr(0,20)+(l.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var l=this.pastInput(),s=new Array(l.length+1).join("-");return l+this.upcomingInput()+`
|
|
5
|
+
`+s+"^"},test_match:function(l,s){var i,u,h;if(this.options.backtrack_lexer&&(h={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(h.yylloc.range=this.yylloc.range.slice(0))),u=l[0].match(/(?:\r\n?|\n).*/g),u&&(this.yylineno+=u.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:u?u[u.length-1].length-u[u.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+l[0].length},this.yytext+=l[0],this.match+=l[0],this.matches=l,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(l[0].length),this.matched+=l[0],i=this.performAction.call(this,this.yy,this,s,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var t in h)this[t]=h[t];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var l,s,i,u;this._more||(this.yytext="",this.match="");for(var h=this._currentRules(),t=0;t<h.length;t++)if(i=this._input.match(this.rules[h[t]]),i&&(!s||i[0].length>s[0].length)){if(s=i,u=t,this.options.backtrack_lexer){if(l=this.test_match(i,h[t]),l!==!1)return l;if(this._backtrack){s=!1;continue}else return!1}else if(!this.options.flex)break}return s?(l=this.test_match(s,h[u]),l!==!1?l:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var s=this.next();return s||this.lex()},begin:function(s){this.conditionStack.push(s)},popState:function(){var s=this.conditionStack.length-1;return s>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(s){return s=this.conditionStack.length-1-Math.abs(s||0),s>=0?this.conditionStack[s]:"INITIAL"},pushState:function(s){this.begin(s)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(s,i,u,h){switch(u){case 0:return 10;case 1:return s.getLogger().debug("Found space-block"),31;case 2:return s.getLogger().debug("Found nl-block"),31;case 3:return s.getLogger().debug("Found space-block"),29;case 4:s.getLogger().debug(".",i.yytext);break;case 5:s.getLogger().debug("_",i.yytext);break;case 6:return 5;case 7:return i.yytext=-1,28;case 8:return i.yytext=i.yytext.replace(/columns\s+/,""),s.getLogger().debug("COLUMNS (LEX)",i.yytext),28;case 9:this.pushState("md_string");break;case 10:return"MD_STR";case 11:this.popState();break;case 12:this.pushState("string");break;case 13:s.getLogger().debug("LEX: POPPING STR:",i.yytext),this.popState();break;case 14:return s.getLogger().debug("LEX: STR end:",i.yytext),"STR";case 15:return i.yytext=i.yytext.replace(/space\:/,""),s.getLogger().debug("SPACE NUM (LEX)",i.yytext),21;case 16:return i.yytext="1",s.getLogger().debug("COLUMNS (LEX)",i.yytext),21;case 17:return 43;case 18:return"LINKSTYLE";case 19:return"INTERPOLATE";case 20:return this.pushState("CLASSDEF"),40;case 21:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 22:return this.popState(),this.pushState("CLASSDEFID"),41;case 23:return this.popState(),42;case 24:return this.pushState("CLASS"),44;case 25:return this.popState(),this.pushState("CLASS_STYLE"),45;case 26:return this.popState(),46;case 27:return this.pushState("STYLE_STMNT"),47;case 28:return this.popState(),this.pushState("STYLE_DEFINITION"),48;case 29:return this.popState(),49;case 30:return this.pushState("acc_title"),"acc_title";case 31:return this.popState(),"acc_title_value";case 32:return this.pushState("acc_descr"),"acc_descr";case 33:return this.popState(),"acc_descr_value";case 34:this.pushState("acc_descr_multiline");break;case 35:this.popState();break;case 36:return"acc_descr_multiline_value";case 37:return 30;case 38:return this.popState(),s.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),s.getLogger().debug("Lex: (("),"NODE_DEND";case 40:return this.popState(),s.getLogger().debug("Lex: ))"),"NODE_DEND";case 41:return this.popState(),s.getLogger().debug("Lex: (("),"NODE_DEND";case 42:return this.popState(),s.getLogger().debug("Lex: (("),"NODE_DEND";case 43:return this.popState(),s.getLogger().debug("Lex: (-"),"NODE_DEND";case 44:return this.popState(),s.getLogger().debug("Lex: -)"),"NODE_DEND";case 45:return this.popState(),s.getLogger().debug("Lex: (("),"NODE_DEND";case 46:return this.popState(),s.getLogger().debug("Lex: ]]"),"NODE_DEND";case 47:return this.popState(),s.getLogger().debug("Lex: ("),"NODE_DEND";case 48:return this.popState(),s.getLogger().debug("Lex: ])"),"NODE_DEND";case 49:return this.popState(),s.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),s.getLogger().debug("Lex: /]"),"NODE_DEND";case 51:return this.popState(),s.getLogger().debug("Lex: )]"),"NODE_DEND";case 52:return this.popState(),s.getLogger().debug("Lex: )"),"NODE_DEND";case 53:return this.popState(),s.getLogger().debug("Lex: ]>"),"NODE_DEND";case 54:return this.popState(),s.getLogger().debug("Lex: ]"),"NODE_DEND";case 55:return s.getLogger().debug("Lexa: -)"),this.pushState("NODE"),36;case 56:return s.getLogger().debug("Lexa: (-"),this.pushState("NODE"),36;case 57:return s.getLogger().debug("Lexa: ))"),this.pushState("NODE"),36;case 58:return s.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;case 59:return s.getLogger().debug("Lex: ((("),this.pushState("NODE"),36;case 60:return s.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;case 61:return s.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;case 62:return s.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;case 63:return s.getLogger().debug("Lexc: >"),this.pushState("NODE"),36;case 64:return s.getLogger().debug("Lexa: (["),this.pushState("NODE"),36;case 65:return s.getLogger().debug("Lexa: )"),this.pushState("NODE"),36;case 66:return this.pushState("NODE"),36;case 67:return this.pushState("NODE"),36;case 68:return this.pushState("NODE"),36;case 69:return this.pushState("NODE"),36;case 70:return this.pushState("NODE"),36;case 71:return this.pushState("NODE"),36;case 72:return this.pushState("NODE"),36;case 73:return s.getLogger().debug("Lexa: ["),this.pushState("NODE"),36;case 74:return this.pushState("BLOCK_ARROW"),s.getLogger().debug("LEX ARR START"),38;case 75:return s.getLogger().debug("Lex: NODE_ID",i.yytext),32;case 76:return s.getLogger().debug("Lex: EOF",i.yytext),8;case 77:this.pushState("md_string");break;case 78:this.pushState("md_string");break;case 79:return"NODE_DESCR";case 80:this.popState();break;case 81:s.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 82:s.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 83:return s.getLogger().debug("LEX: NODE_DESCR:",i.yytext),"NODE_DESCR";case 84:s.getLogger().debug("LEX POPPING"),this.popState();break;case 85:s.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 86:return i.yytext=i.yytext.replace(/^,\s*/,""),s.getLogger().debug("Lex (right): dir:",i.yytext),"DIR";case 87:return i.yytext=i.yytext.replace(/^,\s*/,""),s.getLogger().debug("Lex (left):",i.yytext),"DIR";case 88:return i.yytext=i.yytext.replace(/^,\s*/,""),s.getLogger().debug("Lex (x):",i.yytext),"DIR";case 89:return i.yytext=i.yytext.replace(/^,\s*/,""),s.getLogger().debug("Lex (y):",i.yytext),"DIR";case 90:return i.yytext=i.yytext.replace(/^,\s*/,""),s.getLogger().debug("Lex (up):",i.yytext),"DIR";case 91:return i.yytext=i.yytext.replace(/^,\s*/,""),s.getLogger().debug("Lex (down):",i.yytext),"DIR";case 92:return i.yytext="]>",s.getLogger().debug("Lex (ARROW_DIR end):",i.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 93:return s.getLogger().debug("Lex: LINK","#"+i.yytext+"#"),15;case 94:return s.getLogger().debug("Lex: LINK",i.yytext),15;case 95:return s.getLogger().debug("Lex: LINK",i.yytext),15;case 96:return s.getLogger().debug("Lex: LINK",i.yytext),15;case 97:return s.getLogger().debug("Lex: START_LINK",i.yytext),this.pushState("LLABEL"),16;case 98:return s.getLogger().debug("Lex: START_LINK",i.yytext),this.pushState("LLABEL"),16;case 99:return s.getLogger().debug("Lex: START_LINK",i.yytext),this.pushState("LLABEL"),16;case 100:this.pushState("md_string");break;case 101:return s.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 102:return this.popState(),s.getLogger().debug("Lex: LINK","#"+i.yytext+"#"),15;case 103:return this.popState(),s.getLogger().debug("Lex: LINK",i.yytext),15;case 104:return this.popState(),s.getLogger().debug("Lex: LINK",i.yytext),15;case 105:return s.getLogger().debug("Lex: COLON",i.yytext),i.yytext=i.yytext.slice(1),27}},rules:[/^(?:block-beta\b)/,/^(?:block\s+)/,/^(?:block\n+)/,/^(?:block:)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[29],inclusive:!1},STYLE_STMNT:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[23],inclusive:!1},CLASSDEF:{rules:[21,22],inclusive:!1},CLASS_STYLE:{rules:[26],inclusive:!1},CLASS:{rules:[25],inclusive:!1},LLABEL:{rules:[100,101,102,103,104],inclusive:!1},ARROW_DIR:{rules:[86,87,88,89,90,91,92],inclusive:!1},BLOCK_ARROW:{rules:[77,82,85],inclusive:!1},NODE:{rules:[38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,78,81],inclusive:!1},md_string:{rules:[10,11,79,80],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[13,14,83,84],inclusive:!1},acc_descr_multiline:{rules:[35,36],inclusive:!1},acc_descr:{rules:[33],inclusive:!1},acc_title:{rules:[31],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,12,15,16,17,18,19,20,24,27,30,32,34,37,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,93,94,95,96,97,98,99,105],inclusive:!0}}};return D})();L.lexer=A;function k(){this.yy={}}return k.prototype=L,L.Parser=k,new k})();ee.parser=ee;const Pe=ee;let O={},ie=[],V={};const ce="color",ue="fill",Fe="bgFill",pe=",",Ke=he();let j={};const Me=e=>De.sanitizeText(e,Ke),Ye=function(e,a=""){j[e]===void 0&&(j[e]={id:e,styles:[],textStyles:[]});const d=j[e];a!=null&&a.split(pe).forEach(c=>{const n=c.replace(/([^;]*);/,"$1").trim();if(c.match(ce)){const o=n.replace(ue,Fe).replace(ce,ue);d.textStyles.push(o)}d.styles.push(n)})},We=function(e,a=""){const d=O[e];a!=null&&(d.styles=a.split(pe))},Ve=function(e,a){e.split(",").forEach(function(d){let c=O[d];if(c===void 0){const n=d.trim();O[n]={id:n,type:"na",children:[]},c=O[n]}c.classes||(c.classes=[]),c.classes.push(a)})},fe=(e,a)=>{const d=e.flat(),c=[];for(const n of d){if(n.label&&(n.label=Me(n.label)),n.type==="classDef"){Ye(n.id,n.css);continue}if(n.type==="applyClass"){Ve(n.id,(n==null?void 0:n.styleClass)||"");continue}if(n.type==="applyStyles"){n!=null&&n.stylesStr&&We(n.id,n==null?void 0:n.stylesStr);continue}if(n.type==="column-setting")a.columns=n.columns||-1;else if(n.type==="edge")V[n.id]?V[n.id]++:V[n.id]=1,n.id=V[n.id]+"-"+n.id,ie.push(n);else{n.label||(n.type==="composite"?n.label="":n.label=n.id);const g=!O[n.id];if(g?O[n.id]=n:(n.type!=="na"&&(O[n.id].type=n.type),n.label!==n.id&&(O[n.id].label=n.label)),n.children&&fe(n.children,n),n.type==="space"){const o=n.width||1;for(let f=0;f<o;f++){const b=Ne(n);b.id=b.id+"-"+f,O[b.id]=b,c.push(b)}}else g&&c.push(n)}}a.children=c};let re=[],U={id:"root",type:"composite",children:[],columns:-1};const je=()=>{S.debug("Clear called"),we(),U={id:"root",type:"composite",children:[],columns:-1},O={root:U},re=[],j={},ie=[],V={}};function Ue(e){switch(S.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return S.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}function Xe(e){switch(S.debug("typeStr2Type",e),e){case"==":return"thick";default:return"normal"}}function Ge(e){switch(e.trim()){case"--x":return"arrow_cross";case"--o":return"arrow_circle";default:return"arrow_point"}}let de=0;const He=()=>(de++,"id-"+Math.random().toString(36).substr(2,12)+"-"+de),qe=e=>{U.children=e,fe(e,U),re=U.children},Ze=e=>{const a=O[e];return a?a.columns?a.columns:a.children?a.children.length:-1:-1},Je=()=>[...Object.values(O)],Qe=()=>re||[],$e=()=>ie,et=e=>O[e],tt=e=>{O[e.id]=e},st=()=>console,it=function(){return j},rt={getConfig:()=>se().block,typeStr2Type:Ue,edgeTypeStr2Type:Xe,edgeStrToEdgeData:Ge,getLogger:st,getBlocksFlat:Je,getBlocks:Qe,getEdges:$e,setHierarchy:qe,getBlock:et,setBlock:tt,getColumns:Ze,getClasses:it,clear:je,generateId:He},nt=rt,q=(e,a)=>{const d=Ae,c=d(e,"r"),n=d(e,"g"),g=d(e,"b");return ye(c,n,g,a)},at=e=>`.label {
|
|
7
|
+
font-family: ${e.fontFamily};
|
|
8
|
+
color: ${e.nodeTextColor||e.textColor};
|
|
9
|
+
}
|
|
10
|
+
.cluster-label text {
|
|
11
|
+
fill: ${e.titleColor};
|
|
12
|
+
}
|
|
13
|
+
.cluster-label span,p {
|
|
14
|
+
color: ${e.titleColor};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
.label text,span,p {
|
|
20
|
+
fill: ${e.nodeTextColor||e.textColor};
|
|
21
|
+
color: ${e.nodeTextColor||e.textColor};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.node rect,
|
|
25
|
+
.node circle,
|
|
26
|
+
.node ellipse,
|
|
27
|
+
.node polygon,
|
|
28
|
+
.node path {
|
|
29
|
+
fill: ${e.mainBkg};
|
|
30
|
+
stroke: ${e.nodeBorder};
|
|
31
|
+
stroke-width: 1px;
|
|
32
|
+
}
|
|
33
|
+
.flowchart-label text {
|
|
34
|
+
text-anchor: middle;
|
|
35
|
+
}
|
|
36
|
+
// .flowchart-label .text-outer-tspan {
|
|
37
|
+
// text-anchor: middle;
|
|
38
|
+
// }
|
|
39
|
+
// .flowchart-label .text-inner-tspan {
|
|
40
|
+
// text-anchor: start;
|
|
41
|
+
// }
|
|
42
|
+
|
|
43
|
+
.node .label {
|
|
44
|
+
text-align: center;
|
|
45
|
+
}
|
|
46
|
+
.node.clickable {
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.arrowheadPath {
|
|
51
|
+
fill: ${e.arrowheadColor};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.edgePath .path {
|
|
55
|
+
stroke: ${e.lineColor};
|
|
56
|
+
stroke-width: 2.0px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.flowchart-link {
|
|
60
|
+
stroke: ${e.lineColor};
|
|
61
|
+
fill: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.edgeLabel {
|
|
65
|
+
background-color: ${e.edgeLabelBackground};
|
|
66
|
+
rect {
|
|
67
|
+
opacity: 0.5;
|
|
68
|
+
background-color: ${e.edgeLabelBackground};
|
|
69
|
+
fill: ${e.edgeLabelBackground};
|
|
70
|
+
}
|
|
71
|
+
text-align: center;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* For html labels only */
|
|
75
|
+
.labelBkg {
|
|
76
|
+
background-color: ${q(e.edgeLabelBackground,.5)};
|
|
77
|
+
// background-color:
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.node .cluster {
|
|
81
|
+
// fill: ${q(e.mainBkg,.5)};
|
|
82
|
+
fill: ${q(e.clusterBkg,.5)};
|
|
83
|
+
stroke: ${q(e.clusterBorder,.2)};
|
|
84
|
+
box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
|
|
85
|
+
stroke-width: 1px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.cluster text {
|
|
89
|
+
fill: ${e.titleColor};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.cluster span,p {
|
|
93
|
+
color: ${e.titleColor};
|
|
94
|
+
}
|
|
95
|
+
/* .cluster div {
|
|
96
|
+
color: ${e.titleColor};
|
|
97
|
+
} */
|
|
98
|
+
|
|
99
|
+
div.mermaidTooltip {
|
|
100
|
+
position: absolute;
|
|
101
|
+
text-align: center;
|
|
102
|
+
max-width: 200px;
|
|
103
|
+
padding: 2px;
|
|
104
|
+
font-family: ${e.fontFamily};
|
|
105
|
+
font-size: 12px;
|
|
106
|
+
background: ${e.tertiaryColor};
|
|
107
|
+
border: 1px solid ${e.border2};
|
|
108
|
+
border-radius: 2px;
|
|
109
|
+
pointer-events: none;
|
|
110
|
+
z-index: 100;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.flowchartTitleText {
|
|
114
|
+
text-anchor: middle;
|
|
115
|
+
font-size: 18px;
|
|
116
|
+
fill: ${e.textColor};
|
|
117
|
+
}
|
|
118
|
+
`,ot=at;function be(e,a,d=!1){var c,n,g;const o=e;let f="default";(((c=o==null?void 0:o.classes)==null?void 0:c.length)||0)>0&&(f=((o==null?void 0:o.classes)||[]).join(" ")),f=f+" flowchart-label";let b=0,p="",x;switch(o.type){case"round":b=5,p="rect";break;case"composite":b=0,p="composite",x=0;break;case"square":p="rect";break;case"diamond":p="question";break;case"hexagon":p="hexagon";break;case"block_arrow":p="block_arrow";break;case"odd":p="rect_left_inv_arrow";break;case"lean_right":p="lean_right";break;case"lean_left":p="lean_left";break;case"trapezoid":p="trapezoid";break;case"inv_trapezoid":p="inv_trapezoid";break;case"rect_left_inv_arrow":p="rect_left_inv_arrow";break;case"circle":p="circle";break;case"ellipse":p="ellipse";break;case"stadium":p="stadium";break;case"subroutine":p="subroutine";break;case"cylinder":p="cylinder";break;case"group":p="rect";break;case"doublecircle":p="doublecircle";break;default:p="rect"}const y=ve((o==null?void 0:o.styles)||[]),T=o.label,v=o.size||{width:0,height:0,x:0,y:0};return{labelStyle:y.labelStyle,shape:p,labelText:T,rx:b,ry:b,class:f,style:y.style,id:o.id,directions:o.directions,width:v.width,height:v.height,x:v.x,y:v.y,positioned:d,intersect:void 0,type:o.type,padding:x??(((g=(n=se())==null?void 0:n.block)==null?void 0:g.padding)||0)}}async function lt(e,a,d){const c=be(a,d,!1);if(c.type==="group")return;const n=await ge(e,c),g=n.node().getBBox(),o=d.getBlock(c.id);o.size={width:g.width,height:g.height,x:0,y:0,node:n},d.setBlock(o),n.remove()}async function ct(e,a,d){const c=be(a,d,!0);d.getBlock(c.id).type!=="space"&&(await ge(e,c),a.intersect=c==null?void 0:c.intersect,ze(c))}async function ne(e,a,d,c){for(const n of a)await c(e,n,d),n.children&&await ne(e,n.children,d,c)}async function ut(e,a,d){await ne(e,a,d,lt)}async function dt(e,a,d){await ne(e,a,d,ct)}async function ht(e,a,d,c,n){const g=new Ce({multigraph:!0,compound:!0});g.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const o of d)o.size&&g.setNode(o.id,{width:o.size.width,height:o.size.height,intersect:o.intersect});for(const o of a)if(o.start&&o.end){const f=c.getBlock(o.start),b=c.getBlock(o.end);if(f!=null&&f.size&&(b!=null&&b.size)){const p=f.size,x=b.size,y=[{x:p.x,y:p.y},{x:p.x+(x.x-p.x)/2,y:p.y+(x.y-p.y)/2},{x:x.x,y:x.y}];await Ie(e,{v:o.start,w:o.end,name:o.id},{...o,arrowTypeEnd:o.arrowTypeEnd,arrowTypeStart:o.arrowTypeStart,points:y,classes:"edge-thickness-normal edge-pattern-solid flowchart-link LS-a1 LE-b1"},void 0,"block",g,n),o.label&&(await Oe(e,{...o,label:o.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:o.arrowTypeEnd,arrowTypeStart:o.arrowTypeStart}),await Te({...o,x:y[1].x,y:y[1].y},{originalPath:y}))}}}const _=((le=(oe=he())==null?void 0:oe.block)==null?void 0:le.padding)||8;function gt(e,a){if(e===0||!Number.isInteger(e))throw new Error("Columns must be an integer !== 0.");if(a<0||!Number.isInteger(a))throw new Error("Position must be a non-negative integer."+a);if(e<0)return{px:a,py:0};if(e===1)return{px:0,py:a};const d=a%e,c=Math.floor(a/e);return{px:d,py:c}}const pt=e=>{let a=0,d=0;for(const c of e.children){const{width:n,height:g,x:o,y:f}=c.size||{width:0,height:0,x:0,y:0};S.debug("getMaxChildSize abc95 child:",c.id,"width:",n,"height:",g,"x:",o,"y:",f,c.type),c.type!=="space"&&(n>a&&(a=n/(e.widthInColumns||1)),g>d&&(d=g))}return{width:a,height:d}};function te(e,a,d=0,c=0){var n,g,o,f,b,p,x,y,T,v,N;S.debug("setBlockSizes abc95 (start)",e.id,(n=e==null?void 0:e.size)==null?void 0:n.x,"block width =",e==null?void 0:e.size,"sieblingWidth",d),(g=e==null?void 0:e.size)!=null&&g.width||(e.size={width:d,height:c,x:0,y:0});let E=0,L=0;if(((o=e.children)==null?void 0:o.length)>0){for(const h of e.children)te(h,a);const A=pt(e);E=A.width,L=A.height,S.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",E,L);for(const h of e.children)h.size&&(S.debug(`abc95 Setting size of children of ${e.id} id=${h.id} ${E} ${L} ${h.size}`),h.size.width=E*(h.widthInColumns||1)+_*((h.widthInColumns||1)-1),h.size.height=L,h.size.x=0,h.size.y=0,S.debug(`abc95 updating size of ${e.id} children child:${h.id} maxWidth:${E} maxHeight:${L}`));for(const h of e.children)te(h,a,E,L);const k=e.columns||-1;let D=0;for(const h of e.children)D+=h.widthInColumns||1;let l=e.children.length;k>0&&k<D&&(l=k),e.widthInColumns;const s=Math.ceil(D/l);let i=l*(E+_)+_,u=s*(L+_)+_;if(i<d){S.debug(`Detected to small siebling: abc95 ${e.id} sieblingWidth ${d} sieblingHeight ${c} width ${i}`),i=d,u=c;const h=(d-l*_-_)/l,t=(c-s*_-_)/s;S.debug("Size indata abc88",e.id,"childWidth",h,"maxWidth",E),S.debug("Size indata abc88",e.id,"childHeight",t,"maxHeight",L),S.debug("Size indata abc88 xSize",l,"padding",_);for(const m of e.children)m.size&&(m.size.width=h,m.size.height=t,m.size.x=0,m.size.y=0)}if(S.debug(`abc95 (finale calc) ${e.id} xSize ${l} ySize ${s} columns ${k}${e.children.length} width=${Math.max(i,((f=e.size)==null?void 0:f.width)||0)}`),i<(((b=e==null?void 0:e.size)==null?void 0:b.width)||0)){i=((p=e==null?void 0:e.size)==null?void 0:p.width)||0;const h=k>0?Math.min(e.children.length,k):e.children.length;if(h>0){const t=(i-h*_-_)/h;S.debug("abc95 (growing to fit) width",e.id,i,(x=e.size)==null?void 0:x.width,t);for(const m of e.children)m.size&&(m.size.width=t)}}e.size={width:i,height:u,x:0,y:0}}S.debug("setBlockSizes abc94 (done)",e.id,(y=e==null?void 0:e.size)==null?void 0:y.x,(T=e==null?void 0:e.size)==null?void 0:T.width,(v=e==null?void 0:e.size)==null?void 0:v.y,(N=e==null?void 0:e.size)==null?void 0:N.height)}function xe(e,a){var d,c,n,g,o,f,b,p,x,y,T,v,N,E,L,A,k;S.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${(d=e==null?void 0:e.size)==null?void 0:d.x} y: ${(c=e==null?void 0:e.size)==null?void 0:c.y} width: ${(n=e==null?void 0:e.size)==null?void 0:n.width}`);const D=e.columns||-1;if(S.debug("layoutBlocks columns abc95",e.id,"=>",D,e),e.children&&e.children.length>0){const l=((o=(g=e==null?void 0:e.children[0])==null?void 0:g.size)==null?void 0:o.width)||0,s=e.children.length*l+(e.children.length-1)*_;S.debug("widthOfChildren 88",s,"posX");let i=0;S.debug("abc91 block?.size?.x",e.id,(f=e==null?void 0:e.size)==null?void 0:f.x);let u=(b=e==null?void 0:e.size)!=null&&b.x?((p=e==null?void 0:e.size)==null?void 0:p.x)+(-((x=e==null?void 0:e.size)==null?void 0:x.width)/2||0):-_,h=0;for(const t of e.children){const m=e;if(!t.size)continue;const{width:r,height:R}=t.size,{px:Y,py:F}=gt(D,i);if(F!=h&&(h=F,u=(y=e==null?void 0:e.size)!=null&&y.x?((T=e==null?void 0:e.size)==null?void 0:T.x)+(-((v=e==null?void 0:e.size)==null?void 0:v.width)/2||0):-_,S.debug("New row in layout for block",e.id," and child ",t.id,h)),S.debug(`abc89 layout blocks (child) id: ${t.id} Pos: ${i} (px, py) ${Y},${F} (${(N=m==null?void 0:m.size)==null?void 0:N.x},${(E=m==null?void 0:m.size)==null?void 0:E.y}) parent: ${m.id} width: ${r}${_}`),m.size){const C=r/2;t.size.x=u+_+C,S.debug(`abc91 layout blocks (calc) px, pyid:${t.id} startingPos=X${u} new startingPosX${t.size.x} ${C} padding=${_} width=${r} halfWidth=${C} => x:${t.size.x} y:${t.size.y} ${t.widthInColumns} (width * (child?.w || 1)) / 2 ${r*((t==null?void 0:t.widthInColumns)||1)/2}`),u=t.size.x+C,t.size.y=m.size.y-m.size.height/2+F*(R+_)+R/2+_,S.debug(`abc88 layout blocks (calc) px, pyid:${t.id}startingPosX${u}${_}${C}=>x:${t.size.x}y:${t.size.y}${t.widthInColumns}(width * (child?.w || 1)) / 2${r*((t==null?void 0:t.widthInColumns)||1)/2}`)}t.children&&xe(t),i+=(t==null?void 0:t.widthInColumns)||1,S.debug("abc88 columnsPos",t,i)}}S.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${(L=e==null?void 0:e.size)==null?void 0:L.x} y: ${(A=e==null?void 0:e.size)==null?void 0:A.y} width: ${(k=e==null?void 0:e.size)==null?void 0:k.width}`)}function Se(e,{minX:a,minY:d,maxX:c,maxY:n}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&e.id!=="root"){const{x:g,y:o,width:f,height:b}=e.size;g-f/2<a&&(a=g-f/2),o-b/2<d&&(d=o-b/2),g+f/2>c&&(c=g+f/2),o+b/2>n&&(n=o+b/2)}if(e.children)for(const g of e.children)({minX:a,minY:d,maxX:c,maxY:n}=Se(g,{minX:a,minY:d,maxX:c,maxY:n}));return{minX:a,minY:d,maxX:c,maxY:n}}function ft(e){const a=e.getBlock("root");if(!a)return;te(a,e,0,0),xe(a),S.debug("getBlocks",JSON.stringify(a,null,2));const{minX:d,minY:c,maxX:n,maxY:g}=Se(a),o=g-c,f=n-d;return{x:d,y:c,width:f,height:o}}const bt=function(e,a){return a.db.getClasses()},xt=async function(e,a,d,c){const{securityLevel:n,block:g}=se(),o=c.db;let f;n==="sandbox"&&(f=H("#i"+a));const b=n==="sandbox"?H(f.nodes()[0].contentDocument.body):H("body"),p=n==="sandbox"?b.select(`[id="${a}"]`):H(`[id="${a}"]`);ke(p,["point","circle","cross"],c.type,a);const y=o.getBlocks(),T=o.getBlocksFlat(),v=o.getEdges(),N=p.insert("g").attr("class","block");await ut(N,y,o);const E=ft(o);if(await dt(N,y,o),await ht(N,v,T,o,a),E){const L=E,A=Math.max(1,Math.round(.125*(L.width/L.height))),k=L.height+A+10,D=L.width+10,{useMaxWidth:l}=g;Ee(p,k,D,!!l),S.debug("Here Bounds",E,L),p.attr("viewBox",`${L.x-5} ${L.y-5} ${L.width+10} ${L.height+10}`)}Re(Be)},St={draw:xt,getClasses:bt},Pt={parser:Pe,db:nt,renderer:St,styles:ot};export{Pt as diagram};
|