@kabmo-labs/kabmo 0.53.0 → 0.53.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.html +1 -1
- package/dist/client/index.js +183 -183
- package/dist/client/static/js/{Body-sdq2yhmp.js → Body-3v975hq3.js} +3 -3
- package/dist/client/static/js/{CsvGrid-afz6vr3m.js → CsvGrid-8xcj58sw.js} +1 -1
- package/dist/client/static/js/{DocxView-xwjgt7qq.js → DocxView-fwmfpsg7.js} +1 -1
- package/dist/client/static/js/{DrawioView-7m4e8zcm.js → DrawioView-gdtqj2vv.js} +1 -1
- package/dist/client/static/js/{HtmlPreview-tad0dezn.js → HtmlPreview-g4bp5mgq.js} +1 -1
- package/dist/client/static/js/{ImageView-7bpm4xhb.js → ImageView-5e3vdyc9.js} +1 -1
- package/dist/client/static/js/{LayoutWrapper-ehxhj6t3.js → LayoutWrapper-ssxr6q2d.js} +2 -2
- package/dist/client/static/js/MergeDiffView-6t5t6exc.js +1 -0
- package/dist/client/static/js/{Modal-5qt3v5gn.js → Modal-px8tcv9m.js} +9 -9
- package/dist/client/static/js/{PdfView-hbgnnana.js → PdfView-92rx0s88.js} +1 -1
- package/dist/client/static/js/{SessionsView-rv9jmr2e.js → SessionsView-s3d9nceb.js} +1 -1
- package/dist/client/static/js/{SheetView-55e0a8as.js → SheetView-yeg7gtf9.js} +1 -1
- package/dist/client/static/js/{SvgPreview-10fa6mj1.js → SvgPreview-6evr72fg.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-9w4p3dhe.js → abnfDiagram-O67JEVCF-a6n0cab2.js} +1 -1
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-5x6sb253.js → architectureDiagram-NJMV4G6O-z9k17qfg.js} +2 -2
- package/dist/client/static/js/{astro-m3fcq2sa.js → astro-asmathwv.js} +1 -1
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-2c6y4pkn.js → blockDiagram-BEXU5L5S-63d683v3.js} +2 -2
- package/dist/client/static/js/c-20y64hcp.js +1 -0
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-45rtm401.js → c4Diagram-YGBWAQC7-5bk6kv13.js} +2 -2
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-rksw3aw9.js → classDiagram-v2-NBCMYWYE-s6rmr6vt.js} +2 -2
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-4hxtttt5.js → cose-bilkent-JH36ORCC-wd5v7q2m.js} +1 -1
- package/dist/client/static/js/cpp-ty6n0dg9.js +1 -0
- package/dist/client/static/js/css-ncvxaxt0.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-5dhexpf2.js → cynefinDiagram-VND7K2PF-j71tvbhy.js} +1 -1
- package/dist/client/static/js/{dagre-6A5THRUB-1k3w4qm9.js → dagre-6A5THRUB-q6x3d9xb.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-fw76k272.js → diagram-22UHCM2B-g6e427jm.js} +2 -2
- package/dist/client/static/js/{diagram-3UASUU5V-qnb2gn31.js → diagram-3UASUU5V-rg3nty46.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-cavnxzpf.js → diagram-ATOU4E4O-m82xv6ka.js} +2 -2
- package/dist/client/static/js/{diagram-CDSNMT55-6dxaj054.js → diagram-CDSNMT55-q3aa8sv0.js} +2 -2
- package/dist/client/static/js/{diagram-MLGK6HIB-f16fv9ay.js → diagram-MLGK6HIB-nkyd150x.js} +1 -1
- package/dist/client/static/js/{diagram-MPIPVDR6-zsryj72g.js → diagram-MPIPVDR6-1gchkss2.js} +1 -1
- package/dist/client/static/js/{dockerfile-frznktsa.js → dockerfile-f51g7549.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-1zz5h7sw.js → ebnfDiagram-ZINNZB2B-4dsm3p06.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-25pehy1p.js → elk-276RUBZZ-d8wtwxae.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-ezpjhgzw.js → erDiagram-OPXOYQCR-bq865cmc.js} +2 -2
- package/dist/client/static/js/flowDiagram-KWPJA3E3-z01c78q6.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-n11hq4ag.js → ganttDiagram-FUAMR5RP-ndnqbbzn.js} +1 -1
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-3znkxh7y.js → gitGraphDiagram-X574FWY7-d9y6fnz0.js} +1 -1
- package/dist/client/static/js/{index-acpn178r.js → index-046kc8ft.js} +1 -1
- package/dist/client/static/js/{index-s78f7j47.js → index-049xtm14.js} +1 -1
- package/dist/client/static/js/{index-y79ebmam.js → index-0ccj7j87.js} +1 -1
- package/dist/client/static/js/{index-vjmy9r20.js → index-0fpc1h6v.js} +1 -1
- package/dist/client/static/js/{index-j97qmbbv.js → index-25g1ydkd.js} +1 -1
- package/dist/client/static/js/{index-4nvcwtvr.js → index-25zpywv7.js} +1 -1
- package/dist/client/static/js/{index-1qjxg7mh.js → index-2jtkrmry.js} +1 -1
- package/dist/client/static/js/{index-scmtzcv1.js → index-396g4zz4.js} +2 -2
- package/dist/client/static/js/{index-qrpx4sk1.js → index-3x88t8g9.js} +2 -2
- package/dist/client/static/js/{index-7ag37ghj.js → index-4kchzh9y.js} +8 -8
- package/dist/client/static/js/{index-5z7f6bq4.js → index-4pwk5cjy.js} +1 -1
- package/dist/client/static/js/{index-ht164kw9.js → index-53hrj27y.js} +1 -1
- package/dist/client/static/js/{index-2k6wyyds.js → index-5g21qv2b.js} +4 -4
- package/dist/client/static/js/{index-wvw70pgd.js → index-668fc1df.js} +2 -2
- package/dist/client/static/js/{index-gmea6fjd.js → index-6775m1pa.js} +5 -5
- package/dist/client/static/js/{index-5j0wejvq.js → index-6pxh5p8g.js} +2 -2
- package/dist/client/static/js/{index-4faphth3.js → index-79qddnbx.js} +1 -1
- package/dist/client/static/js/{index-tnhnysj1.js → index-7fkdwm69.js} +1 -1
- package/dist/client/static/js/index-7jr49rd4.js +2 -0
- package/dist/client/static/js/{index-ey0ckd66.js → index-8k568z0z.js} +2 -2
- package/dist/client/static/js/{index-dzp9rwy0.js → index-8w69r0c4.js} +161 -161
- package/dist/client/static/js/{index-m1hd7ska.js → index-9eddntv4.js} +25 -25
- package/dist/client/static/js/{index-zkkttvtx.js → index-bcns8arc.js} +2 -2
- package/dist/client/static/js/{index-8972fxm9.js → index-f7sssx5h.js} +1 -1
- package/dist/client/static/js/{index-1w92sjkm.js → index-g46qcgp8.js} +2 -2
- package/dist/client/static/js/{index-hqc2cazc.js → index-gm9cqsqg.js} +4 -4
- package/dist/client/static/js/{index-02skcm4d.js → index-gr5wd7hv.js} +1 -1
- package/dist/client/static/js/{index-5pbf6dcz.js → index-h9p3748x.js} +3 -3
- package/dist/client/static/js/{index-me7ag6sy.js → index-hav1hhbr.js} +1 -1
- package/dist/client/static/js/{index-58kgkwxt.js → index-hn0brpdf.js} +4 -4
- package/dist/client/static/js/{index-qj6b15r4.js → index-k8ks184k.js} +2 -2
- package/dist/client/static/js/{index-er7pj5k6.js → index-m6eh5g1q.js} +1 -1
- package/dist/client/static/js/{index-kyarw08m.js → index-mnadx740.js} +2 -2
- package/dist/client/static/js/{index-5hqjscys.js → index-mttf7ej7.js} +2 -2
- package/dist/client/static/js/{index-10cxm9ty.js → index-pd4s49n5.js} +2 -2
- package/dist/client/static/js/{index-32gh2645.js → index-pnjnvdvb.js} +1 -1
- package/dist/client/static/js/index-rc8f8gjk.js +1 -0
- package/dist/client/static/js/{index-ej1va073.js → index-rsyqf691.js} +2 -2
- package/dist/client/static/js/{index-e0h6xkpv.js → index-stfccv2r.js} +1 -1
- package/dist/client/static/js/{index-1e7fek0v.js → index-v8fztm3w.js} +1 -1
- package/dist/client/static/js/{index-z9msykm1.js → index-vjk01ja9.js} +1 -1
- package/dist/client/static/js/{index-b039ef9w.js → index-w39c85k3.js} +2 -2
- package/dist/client/static/js/{index-899yw6fh.js → index-x3g8fwkc.js} +2 -2
- package/dist/client/static/js/{index-dkz8d77n.js → index-xakrt0sx.js} +1 -1
- package/dist/client/static/js/{index-dzsjyzht.js → index-xf662xsf.js} +2 -2
- package/dist/client/static/js/{index-9n1cg95f.js → index-z0vvdpkv.js} +1 -1
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-kmv3jtrd.js → infoDiagram-VRGFBTTK-t52bsrem.js} +1 -1
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-5kp6geeh.js → ishikawaDiagram-OU5B5YK6-vysv38pr.js} +1 -1
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-6w5f1ddc.js → journeyDiagram-ZHPQQLJL-7222yn0y.js} +2 -2
- package/dist/client/static/js/json-xha2drny.js +1 -0
- package/dist/client/static/js/{julia-nwh5w343.js → julia-d18zhpyp.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-6esn6xqn.js → kanban-definition-PNTS6WVX-9cg88rcn.js} +2 -2
- package/dist/client/static/js/lua-njwwdj4s.js +1 -0
- package/dist/client/static/js/{mermaid.core-z83pf8ch.js → mermaid.core-3qc3zvgb.js} +7 -7
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-0h1nhw66.js → mindmap-definition-NLK3R4M7-hdbsk349.js} +1 -1
- package/dist/client/static/js/one-dark-pro-3570ra7e.js +1 -0
- package/dist/client/static/js/one-light-3v5yk200.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-xdcpr8my.js → pegDiagram-GJSIUBJH-jtqqcrhq.js} +1 -1
- package/dist/client/static/js/{perl-wb4wtc9x.js → perl-sns2qvmf.js} +1 -1
- package/dist/client/static/js/{php-9g594k9f.js → php-3q6v9eey.js} +1 -1
- package/dist/client/static/js/{pieDiagram-5QR66LMP-0210zd5b.js → pieDiagram-5QR66LMP-2c82jghr.js} +1 -1
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-j0rtvvcm.js → quadrantDiagram-O4NWA36T-vp2hw2a8.js} +1 -1
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-mzxat5g5.js → railroadDiagram-XR7U4H2S-4168nq4f.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-zq5b9ts2.js → requirementDiagram-PLB6GJNP-gwqcyxag.js} +2 -2
- package/dist/client/static/js/{ruby-c4hxsegh.js → ruby-f9k99tfq.js} +1 -1
- package/dist/client/static/js/{rust-vmn352hx.js → rust-6m8myprw.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-06s3r7bv.js → sankeyDiagram-IPEJSGJF-y5fakn56.js} +2 -2
- package/dist/client/static/js/{sass-6yxywx7t.js → sass-2syegq28.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-7s4gz4t5.js → sequenceDiagram-PO4LG4MO-z140kern.js} +3 -3
- package/dist/client/static/js/{sizeCapture-INFHLROL-yensh9k2.js → sizeCapture-INFHLROL-gfez373x.js} +1 -1
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-1q8p06fk.js → stateDiagram-v2-GCMORJYK-1d6h03nr.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-2mfxddzf.js → swimlanes-2SLR337P-75wg3n6d.js} +1 -1
- package/dist/client/static/js/{swimlanesDiagram-TC7HE7FX-k2xf0gby.js → swimlanesDiagram-TC7HE7FX-18fj17m7.js} +1 -1
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-xrk07evk.js → timeline-definition-EJHVYXUP-q750z70f.js} +2 -2
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-ca9h5skn.js → usecaseDiagram-POWQR4AR-9q7tg456.js} +1 -1
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-c0y47znt.js → vennDiagram-UO4OBE2U-010nw1kd.js} +1 -1
- package/dist/client/static/js/{vue-rcdqpz7q.js → vue-e8e3q3hj.js} +1 -1
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-mfk1ck3n.js → wardleyDiagram-VNRHLVJA-7n33n10f.js} +1 -1
- package/dist/client/static/js/xml-8516fzfp.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-6f8xt89k.js → xychartDiagram-PMCCYNJV-7q0n5vvd.js} +2 -2
- package/package.json +1 -1
- package/src/client/hooks/chat/timeline/new-chat-open.ts +5 -3
- package/src/client/hooks/chat/timeline/new-chat.test.ts +18 -2
- package/src/client/hooks/chat/timeline/new-chat.ts +13 -12
- package/src/client/hooks/chat/timeline/scope.test.ts +100 -0
- package/src/client/hooks/chat/timeline/scope.ts +9 -9
- package/src/client/lib/tts/gapless.ts +205 -0
- package/src/client/lib/tts/player.test.ts +83 -64
- package/src/client/lib/tts/player.ts +48 -98
- package/src/server/lib/fs/fs-write-git.test.ts +2 -51
- package/src/server/lib/fs/git-ignore.test.ts +101 -0
- package/src/server/lib/fs/git-ignore.ts +38 -1
- package/src/server/lib/fs/listing.test.ts +19 -0
- package/src/shared/lib/workspace/active-project.test.ts +45 -0
- package/src/shared/lib/workspace/active-project.ts +21 -0
- package/dist/client/static/js/MergeDiffView-28xkyts9.js +0 -1
- package/dist/client/static/js/c-ypdp030b.js +0 -1
- package/dist/client/static/js/cpp-cxwev3gs.js +0 -1
- package/dist/client/static/js/css-6mxcqf8c.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-zh6hmn6g.js +0 -1
- package/dist/client/static/js/index-qva2vqbh.js +0 -2
- package/dist/client/static/js/index-xvh25zer.js +0 -1
- package/dist/client/static/js/json-mb8k0b1n.js +0 -1
- package/dist/client/static/js/lua-nxnqww9z.js +0 -1
- package/dist/client/static/js/one-dark-pro-wsgaqq27.js +0 -1
- package/dist/client/static/js/one-light-w8zdrvyc.js +0 -1
- package/dist/client/static/js/xml-vtrdnrn6.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Xa,fc,sl,Fn,gc,So}from"./index-m1hd7ska.js";function A(r,t){return r==null||t==null?NaN:r<t?-1:r>t?1:r>=t?0:NaN}function H(r,t){return r==null||t==null?NaN:t<r?-1:t>r?1:t>=r?0:NaN}function Jl(r){let t,e,n;if(r.length!==2)t=A,e=(a,m)=>A(r(a),m),n=(a,m)=>r(a)-m;else t=r===A||r===H?r:Pr,e=r,n=r;function i(a,m,o=0,p=a.length){if(o<p){if(t(m,m)!==0)return p;do{let c=o+p>>>1;if(e(a[c],m)<0)o=c+1;else p=c}while(o<p)}return o}function u(a,m,o=0,p=a.length){if(o<p){if(t(m,m)!==0)return p;do{let c=o+p>>>1;if(e(a[c],m)<=0)o=c+1;else p=c}while(o<p)}return o}function f(a,m,o=0,p=a.length){let c=i(a,m,o,p-1);return c>o&&n(a[c-1],m)>-n(a[c],m)?c-1:c}return{left:i,center:f,right:u}}function Pr(){return 0}function J(r){return r===null?NaN:+r}var xr=Jl(A),{right:jr,left:Zr}=xr,Hr=Jl(J).center,yr=jr;var Fr=Math.sqrt(50),zr=Math.sqrt(10),Dr=Math.sqrt(2);function I(r,t,e){let n=(t-r)/Math.max(0,e),i=Math.floor(Math.log10(n)),u=n/Math.pow(10,i),f=u>=Fr?10:u>=zr?5:u>=Dr?2:1,a,m,o;if(i<0){if(o=Math.pow(10,-i)/f,a=Math.round(r*o),m=Math.round(t*o),a/o<r)++a;if(m/o>t)--m;o=-o}else{if(o=Math.pow(10,i)*f,a=Math.round(r/o),m=Math.round(t/o),a*o<r)++a;if(m*o>t)--m}if(m<a&&0.5<=e&&e<2)return I(r,t,e*2);return[a,m,o]}function K(r,t,e){if(t=+t,r=+r,e=+e,!(e>0))return[];if(r===t)return[r];let n=t<r,[i,u,f]=n?I(t,r,e):I(r,t,e);if(!(u>=i))return[];let a=u-i+1,m=Array(a);if(n)if(f<0)for(let o=0;o<a;++o)m[o]=(u-o)/-f;else for(let o=0;o<a;++o)m[o]=(u-o)*f;else if(f<0)for(let o=0;o<a;++o)m[o]=(i+o)/-f;else for(let o=0;o<a;++o)m[o]=(i+o)*f;return m}function T(r,t,e){return t=+t,r=+r,e=+e,I(r,t,e)[2]}function od(r,t,e){t=+t,r=+r,e=+e;let n=t<r,i=n?T(t,r,e):T(r,t,e);return(n?-1:1)*(i<0?1/-i:i)}function Q(r,t){if(!t)t=[];var e=r?Math.min(t.length,r.length):0,n=t.slice(),i;return function(u){for(i=0;i<e;++i)n[i]=r[i]*(1-u)+t[i]*u;return n}}function Mr(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function wr(r,t){var e=t?t.length:0,n=r?Math.min(e,r.length):0,i=Array(n),u=Array(e),f;for(f=0;f<n;++f)i[f]=b(r[f],t[f]);for(;f<e;++f)u[f]=t[f];return function(a){for(f=0;f<n;++f)u[f]=i[f](a);return u}}function W(r,t){var e=new Date;return r=+r,t=+t,function(n){return e.setTime(r*(1-n)+t*n),e}}function _(r,t){var e={},n={},i;if(r===null||typeof r!=="object")r={};if(t===null||typeof t!=="object")t={};for(i in t)if(i in r)e[i]=b(r[i],t[i]);else n[i]=t[i];return function(u){for(i in e)n[i]=e[i](u);return n}}function b(r,t){var e=typeof t,n;return t==null||e==="boolean"?fc(t):(e==="number"?Fn:e==="string"?(n=Xa(t))?(t=n,sl):gc:t instanceof Xa?sl:t instanceof Date?W:Mr(t)?Q:Array.isArray(t)?wr:typeof t.valueOf!=="function"&&typeof t.toString!=="function"||isNaN(t)?_:Fn)(r,t)}function rr(r,t){return r=+r,t=+t,function(e){return Math.round(r*(1-e)+t*e)}}function tr(r){return Math.abs(r=Math.round(r))>=1000000000000000000000?r.toLocaleString("en").replace(/,/g,""):r.toString(10)}function S(r,t){if(!isFinite(r)||r===0)return null;var e=(r=t?r.toExponential(t-1):r.toExponential()).indexOf("e"),n=r.slice(0,e);return[n.length>1?n[0]+n.slice(2):n,+r.slice(e+1)]}function g(r){return r=S(Math.abs(r)),r?r[1]:NaN}function nr(r,t){return function(e,n){var i=e.length,u=[],f=0,a=r[0],m=0;while(i>0&&a>0){if(m+a+1>n)a=Math.max(1,n-m);if(u.push(e.substring(i-=a,i+a)),(m+=a+1)>n)break;a=r[f=(f+1)%r.length]}return u.reverse().join(t)}}function er(r){return function(t){return t.replace(/[0-9]/g,function(e){return r[+e]})}}var Er=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function w(r){if(!(t=Er.exec(r)))throw Error("invalid format: "+r);var t;return new C({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}w.prototype=C.prototype;function C(r){this.fill=r.fill===void 0?" ":r.fill+"",this.align=r.align===void 0?">":r.align+"",this.sign=r.sign===void 0?"-":r.sign+"",this.symbol=r.symbol===void 0?"":r.symbol+"",this.zero=!!r.zero,this.width=r.width===void 0?void 0:+r.width,this.comma=!!r.comma,this.precision=r.precision===void 0?void 0:+r.precision,this.trim=!!r.trim,this.type=r.type===void 0?"":r.type+""}C.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function ir(r){r:for(var t=r.length,e=1,n=-1,i;e<t;++e)switch(r[e]){case".":n=i=e;break;case"0":if(n===0)n=e;i=e;break;default:if(!+r[e])break r;if(n>0)n=0;break}return n>0?r.slice(0,n)+r.slice(i+1):r}var z;function or(r,t){var e=S(r,t);if(!e)return z=void 0,r.toPrecision(t);var n=e[0],i=e[1],u=i-(z=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,f=n.length;return u===f?n:u>f?n+Array(u-f+1).join("0"):u>0?n.slice(0,u)+"."+n.slice(u):"0."+Array(1-u).join("0")+S(r,Math.max(0,t+u-1))[0]}function q(r,t){var e=S(r,t);if(!e)return r+"";var n=e[0],i=e[1];return i<0?"0."+Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+Array(i-n.length+2).join("0")}var fr={"%":(r,t)=>(r*100).toFixed(t),b:(r)=>Math.round(r).toString(2),c:(r)=>r+"",d:tr,e:(r,t)=>r.toExponential(t),f:(r,t)=>r.toFixed(t),g:(r,t)=>r.toPrecision(t),o:(r)=>Math.round(r).toString(8),p:(r,t)=>q(r*100,t),r:q,s:or,X:(r)=>Math.round(r).toString(16).toUpperCase(),x:(r)=>Math.round(r).toString(16)};function V(r){return r}var Nr=Array.prototype.map,kr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ar(r){var t=r.grouping===void 0||r.thousands===void 0?V:nr(Nr.call(r.grouping,Number),r.thousands+""),e=r.currency===void 0?"":r.currency[0]+"",n=r.currency===void 0?"":r.currency[1]+"",i=r.decimal===void 0?".":r.decimal+"",u=r.numerals===void 0?V:er(Nr.call(r.numerals,String)),f=r.percent===void 0?"%":r.percent+"",a=r.minus===void 0?"−":r.minus+"",m=r.nan===void 0?"NaN":r.nan+"";function o(c,d){c=w(c);var M=c.fill,j=c.align,x=c.sign,F=c.symbol,D=c.zero,Y=c.width,Z=c.comma,N=c.precision,pr=c.trim,s=c.type;if(s==="n")Z=!0,s="g";else if(!fr[s])N===void 0&&(N=12),pr=!0,s="g";if(D||M==="0"&&j==="=")D=!0,M="0",j="=";var br=(d&&d.prefix!==void 0?d.prefix:"")+(F==="$"?e:F==="#"&&/[boxX]/.test(s)?"0"+s.toLowerCase():""),Sr=(F==="$"?n:/[%p]/.test(s)?f:"")+(d&&d.suffix!==void 0?d.suffix:""),sr=fr[s],vr=/[defgprs%]/.test(s);N=N===void 0?6:/[gprs]/.test(s)?Math.max(1,Math.min(21,N)):Math.max(0,Math.min(20,N));function hr(l){var k=br,h=Sr,v,gr,E;if(s==="c")h=sr(l)+h,l="";else{l=+l;var L=l<0||1/l<0;if(l=isNaN(l)?m:sr(Math.abs(l),N),pr)l=ir(l);if(L&&+l===0&&x!=="+")L=!1;if(k=(L?x==="("?x:a:x==="-"||x==="("?"":x)+k,h=(s==="s"&&!isNaN(l)&&z!==void 0?kr[8+z/3]:"")+h+(L&&x==="("?")":""),vr){v=-1,gr=l.length;while(++v<gr)if(E=l.charCodeAt(v),48>E||E>57){h=(E===46?i+l.slice(v+1):l.slice(v))+h,l=l.slice(0,v);break}}}if(Z&&!D)l=t(l,1/0);var R=k.length+l.length+h.length,y=R<Y?Array(Y-R+1).join(M):"";if(Z&&D)l=t(y+l,y.length?Y-h.length:1/0),y="";switch(j){case"<":l=k+l+h+y;break;case"=":l=k+y+l+h;break;case"^":l=y.slice(0,R=y.length>>1)+k+l+h+y.slice(R);break;default:l=y+k+l+h;break}return u(l)}return hr.toString=function(){return c+""},hr}function p(c,d){var M=Math.max(-8,Math.min(8,Math.floor(g(d)/3)))*3,j=Math.pow(10,-M),x=o((c=w(c),c.type="f",c),{suffix:kr[8+M/3]});return function(F){return x(j*F)}}return{format:o,formatPrefix:p}}var B,yo,G;ur({thousands:",",grouping:[3],currency:["$",""]});function ur(r){return B=ar(r),yo=B.format,G=B.formatPrefix,B}function O(r){return Math.max(0,-g(Math.abs(r)))}function X(r,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(g(t)/3)))*3-g(Math.abs(r)))}function U(r,t){return r=Math.abs(r),t=Math.abs(t)-r,Math.max(0,g(t)-g(r))+1}function mr(r){return function(){return r}}function cr(r){return+r}var Ar=[0,1];function P(r){return r}function lr(r,t){return(t-=r=+r)?function(e){return(e-r)/t}:mr(isNaN(t)?NaN:0.5)}function Lr(r,t){var e;if(r>t)e=r,r=t,t=e;return function(n){return Math.max(r,Math.min(t,n))}}function Rr(r,t,e){var n=r[0],i=r[1],u=t[0],f=t[1];if(i<n)n=lr(i,n),u=e(f,u);else n=lr(n,i),u=e(u,f);return function(a){return u(n(a))}}function Ir(r,t,e){var n=Math.min(r.length,t.length)-1,i=Array(n),u=Array(n),f=-1;if(r[n]<r[0])r=r.slice().reverse(),t=t.slice().reverse();while(++f<n)i[f]=lr(r[f],r[f+1]),u[f]=e(t[f],t[f+1]);return function(a){var m=yr(r,a,1,n)-1;return u[m](i[m](a))}}function Ep(r,t){return t.domain(r.domain()).range(r.range()).interpolate(r.interpolate()).clamp(r.clamp()).unknown(r.unknown())}function Tr(){var r=Ar,t=Ar,e=b,n,i,u,f=P,a,m,o;function p(){var d=Math.min(r.length,t.length);if(f!==P)f=Lr(r[0],r[d-1]);return a=d>2?Ir:Rr,m=o=null,c}function c(d){return d==null||isNaN(d=+d)?u:(m||(m=a(r.map(n),t,e)))(n(f(d)))}return c.invert=function(d){return f(i((o||(o=a(t,r.map(n),Fn)))(d)))},c.domain=function(d){return arguments.length?(r=Array.from(d,cr),p()):r.slice()},c.range=function(d){return arguments.length?(t=Array.from(d),p()):t.slice()},c.rangeRound=function(d){return t=Array.from(d),e=rr,p()},c.clamp=function(d){return arguments.length?(f=d?!0:P,p()):f!==P},c.interpolate=function(d){return arguments.length?(e=d,p()):e},c.unknown=function(d){return arguments.length?(u=d,c):u},function(d,M){return n=d,i=M,p()}}function id(){return Tr()(P,P)}function dr(r,t,e,n){var i=od(r,t,e),u;switch(n=w(n==null?",f":n),n.type){case"s":{var f=Math.max(Math.abs(r),Math.abs(t));if(n.precision==null&&!isNaN(u=X(i,f)))n.precision=u;return G(n,f)}case"":case"e":case"g":case"p":case"r":{if(n.precision==null&&!isNaN(u=U(i,Math.max(Math.abs(r),Math.abs(t)))))n.precision=u-(n.type==="e");break}case"f":case"%":{if(n.precision==null&&!isNaN(u=O(i)))n.precision=u-(n.type==="%")*2;break}}return yo(n)}function $r(r){var t=r.domain;return r.ticks=function(e){var n=t();return K(n[0],n[n.length-1],e==null?10:e)},r.tickFormat=function(e,n){var i=t();return dr(i[0],i[i.length-1],e==null?10:e,n)},r.nice=function(e){if(e==null)e=10;var n=t(),i=0,u=n.length-1,f=n[i],a=n[u],m,o,p=10;if(a<f)o=f,f=a,a=o,o=i,i=u,u=o;while(p-- >0){if(o=T(f,a,e),o===m)return n[i]=f,n[u]=a,t(n);else if(o>0)f=Math.floor(f/o)*o,a=Math.ceil(a/o)*o;else if(o<0)f=Math.ceil(f*o)/o,a=Math.floor(a*o)/o;else break;m=o}return r},r}function Aa(){var r=id();return r.copy=function(){return Ep(r,Aa())},So.apply(r,arguments),$r(r)}
|
|
2
|
-
export{Jl,od,
|
|
1
|
+
import{Xa,fc,il,Fn,gc,_o}from"./index-9eddntv4.js";function A(r,t){return r==null||t==null?NaN:r<t?-1:r>t?1:r>=t?0:NaN}function H(r,t){return r==null||t==null?NaN:t<r?-1:t>r?1:t>=r?0:NaN}function Jl(r){let t,e,n;if(r.length!==2)t=A,e=(a,m)=>A(r(a),m),n=(a,m)=>r(a)-m;else t=r===A||r===H?r:Pr,e=r,n=r;function i(a,m,o=0,p=a.length){if(o<p){if(t(m,m)!==0)return p;do{let c=o+p>>>1;if(e(a[c],m)<0)o=c+1;else p=c}while(o<p)}return o}function u(a,m,o=0,p=a.length){if(o<p){if(t(m,m)!==0)return p;do{let c=o+p>>>1;if(e(a[c],m)<=0)o=c+1;else p=c}while(o<p)}return o}function f(a,m,o=0,p=a.length){let c=i(a,m,o,p-1);return c>o&&n(a[c-1],m)>-n(a[c],m)?c-1:c}return{left:i,center:f,right:u}}function Pr(){return 0}function J(r){return r===null?NaN:+r}var xr=Jl(A),{right:jr,left:Zr}=xr,Hr=Jl(J).center,yr=jr;var Fr=Math.sqrt(50),zr=Math.sqrt(10),Dr=Math.sqrt(2);function I(r,t,e){let n=(t-r)/Math.max(0,e),i=Math.floor(Math.log10(n)),u=n/Math.pow(10,i),f=u>=Fr?10:u>=zr?5:u>=Dr?2:1,a,m,o;if(i<0){if(o=Math.pow(10,-i)/f,a=Math.round(r*o),m=Math.round(t*o),a/o<r)++a;if(m/o>t)--m;o=-o}else{if(o=Math.pow(10,i)*f,a=Math.round(r/o),m=Math.round(t/o),a*o<r)++a;if(m*o>t)--m}if(m<a&&0.5<=e&&e<2)return I(r,t,e*2);return[a,m,o]}function K(r,t,e){if(t=+t,r=+r,e=+e,!(e>0))return[];if(r===t)return[r];let n=t<r,[i,u,f]=n?I(t,r,e):I(r,t,e);if(!(u>=i))return[];let a=u-i+1,m=Array(a);if(n)if(f<0)for(let o=0;o<a;++o)m[o]=(u-o)/-f;else for(let o=0;o<a;++o)m[o]=(u-o)*f;else if(f<0)for(let o=0;o<a;++o)m[o]=(i+o)/-f;else for(let o=0;o<a;++o)m[o]=(i+o)*f;return m}function T(r,t,e){return t=+t,r=+r,e=+e,I(r,t,e)[2]}function od(r,t,e){t=+t,r=+r,e=+e;let n=t<r,i=n?T(t,r,e):T(r,t,e);return(n?-1:1)*(i<0?1/-i:i)}function Q(r,t){if(!t)t=[];var e=r?Math.min(t.length,r.length):0,n=t.slice(),i;return function(u){for(i=0;i<e;++i)n[i]=r[i]*(1-u)+t[i]*u;return n}}function Mr(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function wr(r,t){var e=t?t.length:0,n=r?Math.min(e,r.length):0,i=Array(n),u=Array(e),f;for(f=0;f<n;++f)i[f]=b(r[f],t[f]);for(;f<e;++f)u[f]=t[f];return function(a){for(f=0;f<n;++f)u[f]=i[f](a);return u}}function W(r,t){var e=new Date;return r=+r,t=+t,function(n){return e.setTime(r*(1-n)+t*n),e}}function _(r,t){var e={},n={},i;if(r===null||typeof r!=="object")r={};if(t===null||typeof t!=="object")t={};for(i in t)if(i in r)e[i]=b(r[i],t[i]);else n[i]=t[i];return function(u){for(i in e)n[i]=e[i](u);return n}}function b(r,t){var e=typeof t,n;return t==null||e==="boolean"?fc(t):(e==="number"?Fn:e==="string"?(n=Xa(t))?(t=n,il):gc:t instanceof Xa?il:t instanceof Date?W:Mr(t)?Q:Array.isArray(t)?wr:typeof t.valueOf!=="function"&&typeof t.toString!=="function"||isNaN(t)?_:Fn)(r,t)}function rr(r,t){return r=+r,t=+t,function(e){return Math.round(r*(1-e)+t*e)}}function tr(r){return Math.abs(r=Math.round(r))>=1000000000000000000000?r.toLocaleString("en").replace(/,/g,""):r.toString(10)}function S(r,t){if(!isFinite(r)||r===0)return null;var e=(r=t?r.toExponential(t-1):r.toExponential()).indexOf("e"),n=r.slice(0,e);return[n.length>1?n[0]+n.slice(2):n,+r.slice(e+1)]}function g(r){return r=S(Math.abs(r)),r?r[1]:NaN}function nr(r,t){return function(e,n){var i=e.length,u=[],f=0,a=r[0],m=0;while(i>0&&a>0){if(m+a+1>n)a=Math.max(1,n-m);if(u.push(e.substring(i-=a,i+a)),(m+=a+1)>n)break;a=r[f=(f+1)%r.length]}return u.reverse().join(t)}}function er(r){return function(t){return t.replace(/[0-9]/g,function(e){return r[+e]})}}var Er=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function w(r){if(!(t=Er.exec(r)))throw Error("invalid format: "+r);var t;return new C({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}w.prototype=C.prototype;function C(r){this.fill=r.fill===void 0?" ":r.fill+"",this.align=r.align===void 0?">":r.align+"",this.sign=r.sign===void 0?"-":r.sign+"",this.symbol=r.symbol===void 0?"":r.symbol+"",this.zero=!!r.zero,this.width=r.width===void 0?void 0:+r.width,this.comma=!!r.comma,this.precision=r.precision===void 0?void 0:+r.precision,this.trim=!!r.trim,this.type=r.type===void 0?"":r.type+""}C.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function ir(r){r:for(var t=r.length,e=1,n=-1,i;e<t;++e)switch(r[e]){case".":n=i=e;break;case"0":if(n===0)n=e;i=e;break;default:if(!+r[e])break r;if(n>0)n=0;break}return n>0?r.slice(0,n)+r.slice(i+1):r}var z;function or(r,t){var e=S(r,t);if(!e)return z=void 0,r.toPrecision(t);var n=e[0],i=e[1],u=i-(z=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,f=n.length;return u===f?n:u>f?n+Array(u-f+1).join("0"):u>0?n.slice(0,u)+"."+n.slice(u):"0."+Array(1-u).join("0")+S(r,Math.max(0,t+u-1))[0]}function q(r,t){var e=S(r,t);if(!e)return r+"";var n=e[0],i=e[1];return i<0?"0."+Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+Array(i-n.length+2).join("0")}var fr={"%":(r,t)=>(r*100).toFixed(t),b:(r)=>Math.round(r).toString(2),c:(r)=>r+"",d:tr,e:(r,t)=>r.toExponential(t),f:(r,t)=>r.toFixed(t),g:(r,t)=>r.toPrecision(t),o:(r)=>Math.round(r).toString(8),p:(r,t)=>q(r*100,t),r:q,s:or,X:(r)=>Math.round(r).toString(16).toUpperCase(),x:(r)=>Math.round(r).toString(16)};function V(r){return r}var Nr=Array.prototype.map,kr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ar(r){var t=r.grouping===void 0||r.thousands===void 0?V:nr(Nr.call(r.grouping,Number),r.thousands+""),e=r.currency===void 0?"":r.currency[0]+"",n=r.currency===void 0?"":r.currency[1]+"",i=r.decimal===void 0?".":r.decimal+"",u=r.numerals===void 0?V:er(Nr.call(r.numerals,String)),f=r.percent===void 0?"%":r.percent+"",a=r.minus===void 0?"−":r.minus+"",m=r.nan===void 0?"NaN":r.nan+"";function o(c,d){c=w(c);var M=c.fill,j=c.align,x=c.sign,F=c.symbol,D=c.zero,Y=c.width,Z=c.comma,N=c.precision,pr=c.trim,s=c.type;if(s==="n")Z=!0,s="g";else if(!fr[s])N===void 0&&(N=12),pr=!0,s="g";if(D||M==="0"&&j==="=")D=!0,M="0",j="=";var br=(d&&d.prefix!==void 0?d.prefix:"")+(F==="$"?e:F==="#"&&/[boxX]/.test(s)?"0"+s.toLowerCase():""),Sr=(F==="$"?n:/[%p]/.test(s)?f:"")+(d&&d.suffix!==void 0?d.suffix:""),sr=fr[s],vr=/[defgprs%]/.test(s);N=N===void 0?6:/[gprs]/.test(s)?Math.max(1,Math.min(21,N)):Math.max(0,Math.min(20,N));function hr(l){var k=br,h=Sr,v,gr,E;if(s==="c")h=sr(l)+h,l="";else{l=+l;var L=l<0||1/l<0;if(l=isNaN(l)?m:sr(Math.abs(l),N),pr)l=ir(l);if(L&&+l===0&&x!=="+")L=!1;if(k=(L?x==="("?x:a:x==="-"||x==="("?"":x)+k,h=(s==="s"&&!isNaN(l)&&z!==void 0?kr[8+z/3]:"")+h+(L&&x==="("?")":""),vr){v=-1,gr=l.length;while(++v<gr)if(E=l.charCodeAt(v),48>E||E>57){h=(E===46?i+l.slice(v+1):l.slice(v))+h,l=l.slice(0,v);break}}}if(Z&&!D)l=t(l,1/0);var R=k.length+l.length+h.length,y=R<Y?Array(Y-R+1).join(M):"";if(Z&&D)l=t(y+l,y.length?Y-h.length:1/0),y="";switch(j){case"<":l=k+l+h+y;break;case"=":l=k+y+l+h;break;case"^":l=y.slice(0,R=y.length>>1)+k+l+h+y.slice(R);break;default:l=y+k+l+h;break}return u(l)}return hr.toString=function(){return c+""},hr}function p(c,d){var M=Math.max(-8,Math.min(8,Math.floor(g(d)/3)))*3,j=Math.pow(10,-M),x=o((c=w(c),c.type="f",c),{suffix:kr[8+M/3]});return function(F){return x(j*F)}}return{format:o,formatPrefix:p}}var B,bo,G;ur({thousands:",",grouping:[3],currency:["$",""]});function ur(r){return B=ar(r),bo=B.format,G=B.formatPrefix,B}function O(r){return Math.max(0,-g(Math.abs(r)))}function X(r,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(g(t)/3)))*3-g(Math.abs(r)))}function U(r,t){return r=Math.abs(r),t=Math.abs(t)-r,Math.max(0,g(t)-g(r))+1}function mr(r){return function(){return r}}function cr(r){return+r}var Ar=[0,1];function P(r){return r}function lr(r,t){return(t-=r=+r)?function(e){return(e-r)/t}:mr(isNaN(t)?NaN:0.5)}function Lr(r,t){var e;if(r>t)e=r,r=t,t=e;return function(n){return Math.max(r,Math.min(t,n))}}function Rr(r,t,e){var n=r[0],i=r[1],u=t[0],f=t[1];if(i<n)n=lr(i,n),u=e(f,u);else n=lr(n,i),u=e(u,f);return function(a){return u(n(a))}}function Ir(r,t,e){var n=Math.min(r.length,t.length)-1,i=Array(n),u=Array(n),f=-1;if(r[n]<r[0])r=r.slice().reverse(),t=t.slice().reverse();while(++f<n)i[f]=lr(r[f],r[f+1]),u[f]=e(t[f],t[f+1]);return function(a){var m=yr(r,a,1,n)-1;return u[m](i[m](a))}}function Ep(r,t){return t.domain(r.domain()).range(r.range()).interpolate(r.interpolate()).clamp(r.clamp()).unknown(r.unknown())}function Tr(){var r=Ar,t=Ar,e=b,n,i,u,f=P,a,m,o;function p(){var d=Math.min(r.length,t.length);if(f!==P)f=Lr(r[0],r[d-1]);return a=d>2?Ir:Rr,m=o=null,c}function c(d){return d==null||isNaN(d=+d)?u:(m||(m=a(r.map(n),t,e)))(n(f(d)))}return c.invert=function(d){return f(i((o||(o=a(t,r.map(n),Fn)))(d)))},c.domain=function(d){return arguments.length?(r=Array.from(d,cr),p()):r.slice()},c.range=function(d){return arguments.length?(t=Array.from(d),p()):t.slice()},c.rangeRound=function(d){return t=Array.from(d),e=rr,p()},c.clamp=function(d){return arguments.length?(f=d?!0:P,p()):f!==P},c.interpolate=function(d){return arguments.length?(e=d,p()):e},c.unknown=function(d){return arguments.length?(u=d,c):u},function(d,M){return n=d,i=M,p()}}function id(){return Tr()(P,P)}function dr(r,t,e,n){var i=od(r,t,e),u;switch(n=w(n==null?",f":n),n.type){case"s":{var f=Math.max(Math.abs(r),Math.abs(t));if(n.precision==null&&!isNaN(u=X(i,f)))n.precision=u;return G(n,f)}case"":case"e":case"g":case"p":case"r":{if(n.precision==null&&!isNaN(u=U(i,Math.max(Math.abs(r),Math.abs(t)))))n.precision=u-(n.type==="e");break}case"f":case"%":{if(n.precision==null&&!isNaN(u=O(i)))n.precision=u-(n.type==="%")*2;break}}return bo(n)}function $r(r){var t=r.domain;return r.ticks=function(e){var n=t();return K(n[0],n[n.length-1],e==null?10:e)},r.tickFormat=function(e,n){var i=t();return dr(i[0],i[i.length-1],e==null?10:e,n)},r.nice=function(e){if(e==null)e=10;var n=t(),i=0,u=n.length-1,f=n[i],a=n[u],m,o,p=10;if(a<f)o=f,f=a,a=o,o=i,i=u,u=o;while(p-- >0){if(o=T(f,a,e),o===m)return n[i]=f,n[u]=a,t(n);else if(o>0)f=Math.floor(f/o)*o,a=Math.ceil(a/o)*o;else if(o<0)f=Math.ceil(f*o)/o,a=Math.floor(a*o)/o;else break;m=o}return r},r}function Aa(){var r=id();return r.copy=function(){return Ep(r,Aa())},_o.apply(r,arguments),$r(r)}
|
|
2
|
+
export{Jl,od,bo,Ep,id,Aa};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t,l,bt,ya,w,M,O,G,z,j,q,H,m,va,
|
|
1
|
+
import{t,l,bt,ya,w,M,O,G,z,j,q,H,m,va,Yi,b,Ar,hr,V,Mn,yt,ct,ut,ar,xc,Pt,Ot,Hn,$t,vt}from"./index-9eddntv4.js";import{Ht}from"./index-8w69r0c4.js";import{Za}from"./index-k8ks184k.js";var h1="flowchart-",d1=class{constructor(){this.vertexCounter=0,this.config=m(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=O,this.setAccDescription=z,this.setDiagramTitle=q,this.getAccTitle=G,this.getAccDescription=j,this.getDiagramTitle=H,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{t(this,"FlowDB")}sanitizeText(e){return w.sanitizeText(e,this.config)}sanitizeNodeLabelType(e){switch(e){case"markdown":case"string":case"text":return e;default:return"markdown"}}setDiagramId(e){this.diagramId=e}lookUpDomId(e){for(let r of this.vertices.values())if(r.id===e)return this.diagramId?`${this.diagramId}-${r.domId}`:r.domId;return this.diagramId?`${this.diagramId}-${e}`:e}addVertex(e,r,a,n,o,f,c={},g){if(!e||e.trim().length===0)return;let d;if(g!==void 0){let T;if(!g.includes(`
|
|
2
2
|
`))T=`{
|
|
3
3
|
`+g+`
|
|
4
4
|
}`;else T=g+`
|
|
@@ -6,7 +6,7 @@ import{t,l,bt,ya,w,M,O,G,z,j,q,H,m,va,Ji,b,Ar,hr,V,Mn,yt,ct,ut,ar,xc,Pt,Ot,Hn,$t
|
|
|
6
6
|
|
|
7
7
|
Initialize mermaid with maxEdges set to a higher number to allow more edges.
|
|
8
8
|
You cannot set this config via configuration inside the diagram as it is a secure config.
|
|
9
|
-
You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e==="object"&&"id"in e&&typeof e.id==="string"}addLink(e,r,a){let n=this.isLinkData(a)?a.id.replace("@",""):void 0;l.info("addLink",e,r,n);for(let o of e)for(let f of r){let c=o===e[e.length-1],g=f===r[0];if(c&&g)this.addSingleLink(o,f,a,n);else this.addSingleLink(o,f,a,void 0)}}updateLinkInterpolate(e,r){e.forEach((a)=>{if(a==="default")this.edges.defaultInterpolate=r;else this.edges[a].interpolate=r})}updateLink(e,r){e.forEach((a)=>{if(typeof a==="number"&&a>=this.edges.length)throw Error(`The index ${a} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);if(a==="default")this.edges.defaultStyle=r;else if(this.edges[a].style=r,(this.edges[a]?.style?.length??0)>0&&!this.edges[a]?.style?.some((n)=>n?.startsWith("fill")))this.edges[a]?.style?.push("fill:none")})}addClass(e,r){let a=r.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach((n)=>{let o=this.classes.get(n);if(o===void 0)o={id:n,styles:[],textStyles:[]},this.classes.set(n,o);if(a!==void 0&&a!==null)a.forEach((f)=>{if(/color/.exec(f)){let c=f.replace("fill","bgFill");o.textStyles.push(c)}o.styles.push(f)})})}setDirection(e){if(this.direction=e.trim(),/.*</.exec(this.direction))this.direction="RL";if(/.*\^/.exec(this.direction))this.direction="BT";if(/.*>/.exec(this.direction))this.direction="LR";if(/.*v/.exec(this.direction))this.direction="TB";if(this.direction==="TD")this.direction="TB"}setClass(e,r){for(let a of e.split(",")){let n=this.vertices.get(a);if(n)n.classes.push(r);let o=this.edges.find((c)=>c.id===a);if(o)o.classes.push(r);let f=this.subGraphLookup.get(a);if(f)f.classes.push(r)}}setTooltip(e,r){if(r===void 0)return;r=this.sanitizeText(r);for(let a of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(a):a,r)}setClickFun(e,r,a){if(m().securityLevel!=="loose")return;if(r===void 0)return;let n=[];if(typeof a==="string"){n=a.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let f=0;f<n.length;f++){let c=n[f].trim();if(c.startsWith('"')&&c.endsWith('"'))c=c.substr(1,c.length-2);n[f]=c}}if(n.length===0)n.push(e);let o=this.vertices.get(e);if(o)o.haveCallback=!0,this.funs.push(()=>{let f=this.lookUpDomId(e),c=document.querySelector(`[id="${f}"]`);if(c!==null)c.addEventListener("click",()=>{V.runFunc(r,...n)},!1)})}setLink(e,r,a){e.split(",").forEach((n)=>{let o=this.vertices.get(n);if(o!==void 0)o.link=V.formatUrl(r,this.config),o.linkTarget=a}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,r,a){e.split(",").forEach((n)=>{this.setClickFun(n,r,a)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach((r)=>{r(e)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){let r=Za();b(e).select("svg").selectAll("g.node").on("mouseover",(o)=>{let f=b(o.currentTarget),c=f.attr("title");if(c===null)return;let g=o.currentTarget?.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(f.attr("title")).style("left",window.scrollX+g.left+(g.right-g.left)/2+"px").style("top",window.scrollY+g.bottom+"px"),r.html(Ht.sanitize(c)),f.classed("hover",!0)}).on("mouseout",(o)=>{r.transition().duration(500).style("opacity",0),b(o.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=m(),M()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,r,a){let n=e.text.trim(),o=a.text;if(e===a&&/\s/.exec(a.text))n=void 0;let c=t((v)=>{let D={boolean:{},number:{},string:{}},T=[],_;return{nodeList:v.filter(function(ie){let h=typeof ie;if(ie.stmt&&ie.stmt==="dir")return _=ie.value,!1;if(ie.trim()==="")return!1;if(h in D)return D[h].hasOwnProperty(ie)?!1:D[h][ie]=!0;else return T.includes(ie)?!1:T.push(ie)}),dir:_}},"uniq")(r.flat()),{nodeList:g,dir:d}=c,R=m().flowchart??{};if(d=d??(R.inheritDir?this.getDirection()??m().direction??void 0:void 0),this.version==="gen-1")for(let v=0;v<g.length;v++)g[v]=this.lookUpDomId(g[v]);n=n??"subGraph"+this.subCount,o=o||"",o=this.sanitizeText(o),this.subCount=this.subCount+1;let F={id:n,nodes:g,title:o.trim(),classes:[],dir:d,labelType:this.sanitizeNodeLabelType(a?.type)};return l.info("Adding",F.id,F.nodes,F.dir),F.nodes=this.makeUniq(F,this.subGraphs).nodes,this.subGraphs.push(F),this.subGraphLookup.set(n,F),n}getPosForId(e){for(let[r,a]of this.subGraphs.entries())if(a.id===e)return r;return-1}indexNodes2(e,r){let a=this.subGraphs[r].nodes;if(this.secCount=this.secCount+1,this.secCount>2000)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=r,this.subGraphs[r].id===e)return{result:!0,count:0};let n=0,o=1;while(n<a.length){let f=this.getPosForId(a[n]);if(f>=0){let c=this.indexNodes2(e,f);if(c.result)return{result:!0,count:o+c.count};else o=o+c.count}n=n+1}return{result:!1,count:o}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){if(this.secCount=-1,this.subGraphs.length>0)this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){if(this.firstGraphFlag)return this.firstGraphFlag=!1,!0;return!1}destructStartLink(e){let r=e.trim(),a="arrow_open";switch(r[0]){case"<":a="arrow_point",r=r.slice(1);break;case"x":a="arrow_cross",r=r.slice(1);break;case"o":a="arrow_circle",r=r.slice(1);break}let n="normal";if(r.includes("="))n="thick";if(r.includes("."))n="dotted";return{type:a,stroke:n}}countChar(e,r){let a=r.length,n=0;for(let o=0;o<a;++o)if(r[o]===e)++n;return n}destructEndLink(e){let r=e.trim(),a=r.slice(0,-1),n="arrow_open";switch(r.slice(-1)){case"x":if(n="arrow_cross",r.startsWith("x"))n="double_"+n,a=a.slice(1);break;case">":if(n="arrow_point",r.startsWith("<"))n="double_"+n,a=a.slice(1);break;case"o":if(n="arrow_circle",r.startsWith("o"))n="double_"+n,a=a.slice(1);break}let o="normal",f=a.length-1;if(a.startsWith("="))o="thick";if(a.startsWith("~"))o="invisible";let c=this.countChar(".",a);if(c)o="dotted",f=c;return{type:n,stroke:o,length:f}}destructLink(e,r){let a=this.destructEndLink(e),n;if(r){if(n=this.destructStartLink(r),n.stroke!==a.stroke)return{type:"INVALID",stroke:"INVALID"};if(n.type==="arrow_open")n.type=a.type;else{if(n.type!==a.type)return{type:"INVALID",stroke:"INVALID"};n.type="double_"+n.type}if(n.type==="double_arrow")n.type="double_arrow_point";return n.length=a.length,n}return a}exists(e,r){for(let a of e)if(a.nodes.includes(r))return!0;return!1}makeUniq(e,r){let a=[];return e.nodes.forEach((n,o)=>{if(!this.exists(r,n))a.push(e.nodes[o])}),{nodes:a}}getTypeFromVertex(e){if(e.img)return"imageSquare";if(e.icon){if(e.form==="circle")return"iconCircle";if(e.form==="square")return"iconSquare";if(e.form==="rounded")return"iconRounded";return"icon"}switch(e.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e.type}}findNode(e,r){return e.find((a)=>a.id===r)}destructEdgeType(e){let r="none",a="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":a=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=e.replace("double_",""),a=r;break}return{arrowTypeStart:r,arrowTypeEnd:a}}addNodeFromVertex(e,r,a,n,o,f){let c=a.get(e.id),g=n.get(e.id)??!1,d=this.findNode(r,e.id);if(d)d.cssStyles=e.styles,d.cssCompiledStyles=this.getCompiledStyles(e.classes),d.cssClasses=e.classes.join(" ");else{let R={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:c,padding:o.flowchart?.padding||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:f,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};if(g)r.push({...R,isGroup:!0,shape:"rect"});else r.push({...R,isGroup:!1,shape:this.getTypeFromVertex(e),minWidth:o.flowchart?.minNodeWidth})}}getCompiledStyles(e){let r=[];for(let a of e){let n=this.classes.get(a);if(n?.styles)r=[...r,...n.styles??[]].map((o)=>o.trim());if(n?.textStyles)r=[...r,...n.textStyles??[]].map((o)=>o.trim())}return r}getData(){let e=m(),r=[],a=[],n=this.getSubGraphs(),o=new Map,f=new Map,c=new Map;for(let h of n)for(let A of h.nodes)if(this.subGraphLookup.has(A))c.set(A,h.id);let g=new Map,d=new Map;for(let h of n){let A=c.get(h.id);if(A!==void 0)d.set(A,[...d.get(A)??[],h.id])}let R=0,F=t((h)=>{g.set(h,R++);for(let A of d.get(h)??[])F(A)},"walk");for(let h of n)if(!c.has(h.id))F(h.id);let v=t((h)=>this.subGraphLookup.get(h)?.metadata?.view==="collapsed","isCollapsed"),D=t((h)=>{let A,ue=new Set,le=h;while(le!==void 0&&!ue.has(le)){if(ue.add(le),v(le))A=le;le=c.get(le)}return A},"outermostCollapsed"),T=new Set,_=new Map;for(let h of n){let A=D(h.id);if(A===void 0)continue;if(h.id!==A)T.add(h.id),_.set(h.id,A);for(let ue of h.nodes){if(ue===A)continue;T.add(ue),_.set(ue,A)}}for(let h=n.length-1;h>=0;h--){let A=n[h];if(T.has(A.id))continue;if(A.nodes.length>0)f.set(A.id,!0);for(let ue of A.nodes)o.set(ue,A.id)}for(let h=n.length-1;h>=0;h--){let A=n[h];if(T.has(A.id))continue;if(A.metadata?.view==="collapsed")r.push({id:A.id,label:A.title,labelStyle:"",labelType:A.labelType,parentId:o.get(A.id),padding:8,cssCompiledStyles:this.getCompiledStyles(A.classes),cssClasses:A.classes.join(" "),shape:"collapsedGroup",dir:A.dir,isGroup:!1,look:e.look,colorIndex:g.get(A.id)});else r.push({id:A.id,label:A.title,labelStyle:"",labelType:A.labelType,parentId:o.get(A.id),padding:8,cssCompiledStyles:this.getCompiledStyles(A.classes),cssClasses:A.classes.join(" "),shape:"rect",dir:A.dir,isGroup:!0,look:e.look,colorIndex:g.get(A.id),metadata:A.metadata})}this.getVertices().forEach((h)=>{if(T.has(h.id))return;this.addNodeFromVertex(h,r,o,f,e,e.look||"classic")});let ie=this.getEdges();return ie.forEach((h,A)=>{let{arrowTypeStart:ue,arrowTypeEnd:le}=this.destructEdgeType(h.type),P=[...ie.defaultStyle??[]],U=_.get(h.start)??h.start,W=_.get(h.end)??h.end;if(U===W&&(_.has(h.start)||_.has(h.end)))return;if(h.style)P.push(...h.style);let Y={id:Mn(U,W,{counter:A,prefix:"L"},h.id),isUserDefinedId:h.isUserDefinedId,start:U,end:W,type:h.type??"normal",label:h.text,labelType:h.labelType,labelpos:"c",thickness:h.stroke,minlen:h.length,classes:h?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:h?.stroke==="invisible"||h?.type==="arrow_open"?"none":ue,arrowTypeEnd:h?.stroke==="invisible"||h?.type==="arrow_open"?"none":le,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(h.classes),labelStyle:P,style:P,pattern:h.stroke,look:e.look,animate:h.animate,animation:h.animation,curve:h.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve};a.push(Y)}),{nodes:r,edges:a,other:{},config:e}}defaultConfig(){return Ji.flowchart}},p1=t(function(e,r){return r.db.getClasses()},"getClasses"),f1=t(async function(e,r,a,n){l.info("REF0:"),l.info("Drawing state diagram (v2)",r);let{securityLevel:o,flowchart:f,layout:c}=m();n.db.setDiagramId(r),l.debug("Before getData: ");let g=n.db.getData();l.debug("Data: ",g);let d=$t(r,o),R=n.db.getDirection();g.type=n.type,g.layoutAlgorithm=Ot(c),g.direction=R,g.nodeSpacing=f?.nodeSpacing||50,g.rankSpacing=f?.rankSpacing||50,g.markers=["point","circle","cross"],g.diagramId=r,l.debug("REF1:",g),await Pt(g,d);let F=g.config.flowchart?.diagramPadding??8;V.insertTitle(d,"flowchartTitleText",f?.titleTopMargin||0,n.db.getDiagramTitle()),vt(d,F,"flowchart",f?.useMaxWidth||!1)},"draw"),b1={getClasses:p1,draw:f1},kt=function(){var e=t(function(Be,p,k,C){for(k=k||{},C=Be.length;C--;k[Be[C]]=p);return k},"o"),r=[1,4],a=[1,3],n=[1,5],o=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],f=[2,2],c=[1,13],g=[1,14],d=[1,15],R=[1,16],F=[1,23],v=[1,25],D=[1,26],T=[1,27],_=[1,50],K=[1,49],ie=[1,29],h=[1,30],A=[1,31],ue=[1,32],le=[1,33],P=[1,45],U=[1,47],W=[1,43],Y=[1,48],Q=[1,44],J=[1,51],Z=[1,46],ee=[1,52],te=[1,53],Qe=[1,34],Je=[1,35],Ze=[1,36],$e=[1,37],et=[1,38],Fe=[1,58],B=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],be=[1,62],ke=[1,61],ge=[1,63],Ie=[8,9,11,75,77,78],gt=[1,79],Re=[1,92],Ne=[1,97],Ge=[1,96],Pe=[1,93],Oe=[1,89],Me=[1,95],Ue=[1,91],We=[1,98],ze=[1,94],je=[1,99],Ke=[1,90],ve=[8,9,10,11,40,75,77,78],re=[8,9,10,11,40,46,75,77,78],ce=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],At=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],Ye=[44,60,89,102,105,106,109,111,114,115,116],mt=[1,122],Ct=[1,123],tt=[1,125],st=[1,124],Dt=[44,60,62,74,89,102,105,106,109,111,114,115,116],Tt=[1,134],Et=[1,148],St=[1,149],xt=[1,150],Ft=[1,151],_t=[1,136],Bt=[1,138],Lt=[1,142],Vt=[1,143],wt=[1,144],It=[1,145],Rt=[1,146],Nt=[1,147],Gt=[1,152],Mt=[1,153],Ut=[1,132],Wt=[1,133],zt=[1,140],jt=[1,135],Kt=[1,139],Yt=[1,137],nt=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],qt=[1,155],Xt=[1,157],N=[8,9,11],he=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],E=[1,177],ae=[1,173],ne=[1,174],S=[1,178],y=[1,175],x=[1,176],He=[77,116,119],L=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],Qt=[10,106],_e=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],Ae=[1,248],me=[1,246],Ce=[1,250],De=[1,244],Te=[1,245],Ee=[1,247],Se=[1,249],ye=[1,251],qe=[1,269],Jt=[8,9,11,106],fe=[8,9,10,11,60,84,105,106,109,110,111,112],ot={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:t(function(p,k,C,u,I,s,Le){var i=s.length-1;switch(I){case 2:this.$=[];break;case 3:if(!Array.isArray(s[i])||s[i].length>0)s[i-1].push(s[i]);this.$=s[i-1];break;case 4:case 183:this.$=s[i];break;case 11:u.setDirection("TB"),this.$="TB";break;case 12:u.setDirection(s[i-1]),this.$=s[i-1];break;case 27:this.$=s[i-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=u.addSubGraph(s[i-6],s[i-1],s[i-4]);break;case 34:this.$=u.addSubGraph(s[i-3],s[i-1],s[i-3]);break;case 35:this.$=u.addSubGraph(void 0,s[i-1],void 0);break;case 37:this.$=s[i].trim(),u.setAccTitle(this.$);break;case 38:case 39:this.$=s[i].trim(),u.setAccDescription(this.$);break;case 43:this.$=s[i-1]+s[i];break;case 44:this.$=s[i];break;case 45:u.addVertex(s[i-1][s[i-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i]),u.addLink(s[i-3].stmt,s[i-1],s[i-2]),this.$={stmt:s[i-1],nodes:s[i-1].concat(s[i-3].nodes)};break;case 46:u.addLink(s[i-2].stmt,s[i],s[i-1]),this.$={stmt:s[i],nodes:s[i].concat(s[i-2].nodes)};break;case 47:u.addLink(s[i-3].stmt,s[i-1],s[i-2]),this.$={stmt:s[i-1],nodes:s[i-1].concat(s[i-3].nodes)};break;case 48:this.$={stmt:s[i-1],nodes:s[i-1]};break;case 49:u.addVertex(s[i-1][s[i-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i]),this.$={stmt:s[i-1],nodes:s[i-1],shapeData:s[i]};break;case 50:this.$={stmt:s[i],nodes:s[i]};break;case 51:this.$=[s[i]];break;case 52:u.addVertex(s[i-5][s[i-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i-4]),this.$=s[i-5].concat(s[i]);break;case 53:this.$=s[i-4].concat(s[i]);break;case 54:this.$=s[i];break;case 55:this.$=s[i-2],u.setClass(s[i-2],s[i]);break;case 56:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"square");break;case 57:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"doublecircle");break;case 58:this.$=s[i-5],u.addVertex(s[i-5],s[i-2],"circle");break;case 59:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"ellipse");break;case 60:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"stadium");break;case 61:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"subroutine");break;case 62:this.$=s[i-7],u.addVertex(s[i-7],s[i-1],"rect",void 0,void 0,void 0,Object.fromEntries([[s[i-5],s[i-3]]]));break;case 63:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"cylinder");break;case 64:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"round");break;case 65:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"diamond");break;case 66:this.$=s[i-5],u.addVertex(s[i-5],s[i-2],"hexagon");break;case 67:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"odd");break;case 68:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"trapezoid");break;case 69:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"inv_trapezoid");break;case 70:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"lean_right");break;case 71:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"lean_left");break;case 72:this.$=s[i],u.addVertex(s[i]);break;case 73:s[i-1].text=s[i],this.$=s[i-1];break;case 74:case 75:s[i-2].text=s[i-1],this.$=s[i-2];break;case 76:this.$=s[i];break;case 77:var X=u.destructLink(s[i],s[i-2]);this.$={type:X.type,stroke:X.stroke,length:X.length,text:s[i-1]};break;case 78:var X=u.destructLink(s[i],s[i-2]);this.$={type:X.type,stroke:X.stroke,length:X.length,text:s[i-1],id:s[i-3]};break;case 79:this.$={text:s[i],type:"text"};break;case 80:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 81:this.$={text:s[i],type:"string"};break;case 82:this.$={text:s[i],type:"markdown"};break;case 83:var X=u.destructLink(s[i]);this.$={type:X.type,stroke:X.stroke,length:X.length};break;case 84:var X=u.destructLink(s[i]);this.$={type:X.type,stroke:X.stroke,length:X.length,id:s[i-1]};break;case 85:this.$=s[i-1];break;case 86:this.$={text:s[i],type:"text"};break;case 87:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 88:this.$={text:s[i],type:"string"};break;case 89:case 104:this.$={text:s[i],type:"markdown"};break;case 101:this.$={text:s[i],type:"text"};break;case 102:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 103:this.$={text:s[i],type:"text"};break;case 105:this.$=s[i-4],u.addClass(s[i-2],s[i]);break;case 106:this.$=s[i-4],u.setClass(s[i-2],s[i]);break;case 107:case 115:this.$=s[i-1],u.setClickEvent(s[i-1],s[i]);break;case 108:case 116:this.$=s[i-3],u.setClickEvent(s[i-3],s[i-2]),u.setTooltip(s[i-3],s[i]);break;case 109:this.$=s[i-2],u.setClickEvent(s[i-2],s[i-1],s[i]);break;case 110:this.$=s[i-4],u.setClickEvent(s[i-4],s[i-3],s[i-2]),u.setTooltip(s[i-4],s[i]);break;case 111:this.$=s[i-2],u.setLink(s[i-2],s[i]);break;case 112:this.$=s[i-4],u.setLink(s[i-4],s[i-2]),u.setTooltip(s[i-4],s[i]);break;case 113:this.$=s[i-4],u.setLink(s[i-4],s[i-2],s[i]);break;case 114:this.$=s[i-6],u.setLink(s[i-6],s[i-4],s[i]),u.setTooltip(s[i-6],s[i-2]);break;case 117:this.$=s[i-1],u.setLink(s[i-1],s[i]);break;case 118:this.$=s[i-3],u.setLink(s[i-3],s[i-2]),u.setTooltip(s[i-3],s[i]);break;case 119:this.$=s[i-3],u.setLink(s[i-3],s[i-2],s[i]);break;case 120:this.$=s[i-5],u.setLink(s[i-5],s[i-4],s[i]),u.setTooltip(s[i-5],s[i-2]);break;case 121:this.$=s[i-4],u.addVertex(s[i-2],void 0,void 0,s[i]);break;case 122:this.$=s[i-4],u.updateLink([s[i-2]],s[i]);break;case 123:this.$=s[i-4],u.updateLink(s[i-2],s[i]);break;case 124:this.$=s[i-8],u.updateLinkInterpolate([s[i-6]],s[i-2]),u.updateLink([s[i-6]],s[i]);break;case 125:this.$=s[i-8],u.updateLinkInterpolate(s[i-6],s[i-2]),u.updateLink(s[i-6],s[i]);break;case 126:this.$=s[i-6],u.updateLinkInterpolate([s[i-4]],s[i]);break;case 127:this.$=s[i-6],u.updateLinkInterpolate(s[i-4],s[i]);break;case 128:case 130:this.$=[s[i]];break;case 129:case 131:s[i-2].push(s[i]),this.$=s[i-2];break;case 133:this.$=s[i-1]+s[i];break;case 181:this.$=s[i];break;case 182:this.$=s[i-1]+""+s[i];break;case 184:this.$=s[i-1]+""+s[i];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:r,10:a,12:n},{1:[3]},e(o,f,{5:6}),{4:7,9:r,10:a,12:n},{4:8,9:r,10:a,12:n},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:c,9:g,10:d,11:R,20:17,22:18,23:19,24:20,25:21,26:22,27:F,33:24,34:v,36:D,38:T,42:28,43:39,44:_,45:40,47:41,60:K,84:ie,85:h,86:A,87:ue,88:le,89:P,102:U,105:W,106:Y,109:Q,111:J,113:42,114:Z,115:ee,116:te,121:Qe,122:Je,123:Ze,124:$e,125:et},e(o,[2,9]),e(o,[2,10]),e(o,[2,11]),{8:[1,55],9:[1,56],10:Fe,15:54,18:57},e(B,[2,3]),e(B,[2,4]),e(B,[2,5]),e(B,[2,6]),e(B,[2,7]),e(B,[2,8]),{8:be,9:ke,11:ge,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:be,9:ke,11:ge,21:68},{8:be,9:ke,11:ge,21:69},{8:be,9:ke,11:ge,21:70},{8:be,9:ke,11:ge,21:71},{8:be,9:ke,11:ge,21:72},{8:be,9:ke,10:[1,73],11:ge,21:74},e(B,[2,36]),{35:[1,75]},{37:[1,76]},e(B,[2,39]),e(Ie,[2,50],{18:77,39:78,10:Fe,40:gt}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:Re,44:Ne,60:Ge,80:[1,87],89:Pe,95:[1,84],97:[1,85],101:86,105:Oe,106:Me,109:Ue,111:We,114:ze,115:je,116:Ke,120:88},e(B,[2,185]),e(B,[2,186]),e(B,[2,187]),e(B,[2,188]),e(B,[2,189]),e(ve,[2,51]),e(ve,[2,54],{46:[1,100]}),e(re,[2,72],{113:113,29:[1,101],44:_,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:K,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:P,102:U,105:W,106:Y,109:Q,111:J,114:Z,115:ee,116:te}),e(ce,[2,181]),e(ce,[2,142]),e(ce,[2,143]),e(ce,[2,144]),e(ce,[2,145]),e(ce,[2,146]),e(ce,[2,147]),e(ce,[2,148]),e(ce,[2,149]),e(ce,[2,150]),e(ce,[2,151]),e(ce,[2,152]),e(o,[2,12]),e(o,[2,18]),e(o,[2,19]),{9:[1,114]},e(At,[2,26],{18:115,10:Fe}),e(B,[2,27]),{42:116,43:39,44:_,45:40,47:41,60:K,89:P,102:U,105:W,106:Y,109:Q,111:J,113:42,114:Z,115:ee,116:te},e(B,[2,40]),e(B,[2,41]),e(B,[2,42]),e(Ye,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:mt,81:Ct,116:tt,119:st},{75:[1,126],77:[1,127]},e(Dt,[2,83]),e(B,[2,28]),e(B,[2,29]),e(B,[2,30]),e(B,[2,31]),e(B,[2,32]),{10:Tt,12:Et,14:St,27:xt,28:128,32:Ft,44:_t,60:Bt,75:Lt,80:[1,130],81:[1,131],83:141,84:Vt,85:wt,86:It,87:Rt,88:Nt,89:Gt,90:Mt,91:129,105:Ut,109:Wt,111:zt,114:jt,115:Kt,116:Yt},e(nt,f,{5:154}),e(B,[2,37]),e(B,[2,38]),e(Ie,[2,48],{44:qt}),e(Ie,[2,49],{18:156,10:Fe,40:Xt}),e(ve,[2,44]),{44:_,47:158,60:K,89:P,102:U,105:W,106:Y,109:Q,111:J,113:42,114:Z,115:ee,116:te},{102:[1,159],103:160,105:[1,161]},{44:_,47:162,60:K,89:P,102:U,105:W,106:Y,109:Q,111:J,113:42,114:Z,115:ee,116:te},{44:_,47:163,60:K,89:P,102:U,105:W,106:Y,109:Q,111:J,113:42,114:Z,115:ee,116:te},e(N,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},e(N,[2,115],{120:168,10:[1,167],14:Re,44:Ne,60:Ge,89:Pe,105:Oe,106:Me,109:Ue,111:We,114:ze,115:je,116:Ke}),e(N,[2,117],{10:[1,169]}),e(he,[2,183]),e(he,[2,170]),e(he,[2,171]),e(he,[2,172]),e(he,[2,173]),e(he,[2,174]),e(he,[2,175]),e(he,[2,176]),e(he,[2,177]),e(he,[2,178]),e(he,[2,179]),e(he,[2,180]),{44:_,47:170,60:K,89:P,102:U,105:W,106:Y,109:Q,111:J,113:42,114:Z,115:ee,116:te},{30:171,67:E,80:ae,81:ne,82:172,116:S,117:y,118:x},{30:179,67:E,80:ae,81:ne,82:172,116:S,117:y,118:x},{30:181,50:[1,180],67:E,80:ae,81:ne,82:172,116:S,117:y,118:x},{30:182,67:E,80:ae,81:ne,82:172,116:S,117:y,118:x},{30:183,67:E,80:ae,81:ne,82:172,116:S,117:y,118:x},{30:184,67:E,80:ae,81:ne,82:172,116:S,117:y,118:x},{109:[1,185]},{30:186,67:E,80:ae,81:ne,82:172,116:S,117:y,118:x},{30:187,65:[1,188],67:E,80:ae,81:ne,82:172,116:S,117:y,118:x},{30:189,67:E,80:ae,81:ne,82:172,116:S,117:y,118:x},{30:190,67:E,80:ae,81:ne,82:172,116:S,117:y,118:x},{30:191,67:E,80:ae,81:ne,82:172,116:S,117:y,118:x},e(ce,[2,182]),e(o,[2,20]),e(At,[2,25]),e(Ie,[2,46],{39:192,18:193,10:Fe,40:gt}),e(Ye,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:E,80:ae,81:ne,82:172,116:S,117:y,118:x},{77:[1,197],79:198,116:tt,119:st},e(He,[2,79]),e(He,[2,81]),e(He,[2,82]),e(He,[2,168]),e(He,[2,169]),{76:199,79:121,80:mt,81:Ct,116:tt,119:st},e(Dt,[2,84]),{8:be,9:ke,10:Tt,11:ge,12:Et,14:St,21:201,27:xt,29:[1,200],32:Ft,44:_t,60:Bt,75:Lt,83:141,84:Vt,85:wt,86:It,87:Rt,88:Nt,89:Gt,90:Mt,91:202,105:Ut,109:Wt,111:zt,114:jt,115:Kt,116:Yt},e(L,[2,101]),e(L,[2,103]),e(L,[2,104]),e(L,[2,157]),e(L,[2,158]),e(L,[2,159]),e(L,[2,160]),e(L,[2,161]),e(L,[2,162]),e(L,[2,163]),e(L,[2,164]),e(L,[2,165]),e(L,[2,166]),e(L,[2,167]),e(L,[2,90]),e(L,[2,91]),e(L,[2,92]),e(L,[2,93]),e(L,[2,94]),e(L,[2,95]),e(L,[2,96]),e(L,[2,97]),e(L,[2,98]),e(L,[2,99]),e(L,[2,100]),{6:11,7:12,8:c,9:g,10:d,11:R,20:17,22:18,23:19,24:20,25:21,26:22,27:F,32:[1,203],33:24,34:v,36:D,38:T,42:28,43:39,44:_,45:40,47:41,60:K,84:ie,85:h,86:A,87:ue,88:le,89:P,102:U,105:W,106:Y,109:Q,111:J,113:42,114:Z,115:ee,116:te,121:Qe,122:Je,123:Ze,124:$e,125:et},{10:Fe,18:204},{44:[1,205]},e(ve,[2,43]),{10:[1,206],44:_,60:K,89:P,102:U,105:W,106:Y,109:Q,111:J,113:113,114:Z,115:ee,116:te},{10:[1,207]},{10:[1,208],106:[1,209]},e(Qt,[2,128]),{10:[1,210],44:_,60:K,89:P,102:U,105:W,106:Y,109:Q,111:J,113:113,114:Z,115:ee,116:te},{10:[1,211],44:_,60:K,89:P,102:U,105:W,106:Y,109:Q,111:J,113:113,114:Z,115:ee,116:te},{80:[1,212]},e(N,[2,109],{10:[1,213]}),e(N,[2,111],{10:[1,214]}),{80:[1,215]},e(he,[2,184]),{80:[1,216],98:[1,217]},e(ve,[2,55],{113:113,44:_,60:K,89:P,102:U,105:W,106:Y,109:Q,111:J,114:Z,115:ee,116:te}),{31:[1,218],67:E,82:219,116:S,117:y,118:x},e(_e,[2,86]),e(_e,[2,88]),e(_e,[2,89]),e(_e,[2,153]),e(_e,[2,154]),e(_e,[2,155]),e(_e,[2,156]),{49:[1,220],67:E,82:219,116:S,117:y,118:x},{30:221,67:E,80:ae,81:ne,82:172,116:S,117:y,118:x},{51:[1,222],67:E,82:219,116:S,117:y,118:x},{53:[1,223],67:E,82:219,116:S,117:y,118:x},{55:[1,224],67:E,82:219,116:S,117:y,118:x},{57:[1,225],67:E,82:219,116:S,117:y,118:x},{60:[1,226]},{64:[1,227],67:E,82:219,116:S,117:y,118:x},{66:[1,228],67:E,82:219,116:S,117:y,118:x},{30:229,67:E,80:ae,81:ne,82:172,116:S,117:y,118:x},{31:[1,230],67:E,82:219,116:S,117:y,118:x},{67:E,69:[1,231],71:[1,232],82:219,116:S,117:y,118:x},{67:E,69:[1,234],71:[1,233],82:219,116:S,117:y,118:x},e(Ie,[2,45],{18:156,10:Fe,40:Xt}),e(Ie,[2,47],{44:qt}),e(Ye,[2,75]),e(Ye,[2,74]),{62:[1,235],67:E,82:219,116:S,117:y,118:x},e(Ye,[2,77]),e(He,[2,80]),{77:[1,236],79:198,116:tt,119:st},{30:237,67:E,80:ae,81:ne,82:172,116:S,117:y,118:x},e(nt,f,{5:238}),e(L,[2,102]),e(B,[2,35]),{43:239,44:_,45:40,47:41,60:K,89:P,102:U,105:W,106:Y,109:Q,111:J,113:42,114:Z,115:ee,116:te},{10:Fe,18:240},{10:Ae,60:me,84:Ce,92:241,105:De,107:242,108:243,109:Te,110:Ee,111:Se,112:ye},{10:Ae,60:me,84:Ce,92:252,104:[1,253],105:De,107:242,108:243,109:Te,110:Ee,111:Se,112:ye},{10:Ae,60:me,84:Ce,92:254,104:[1,255],105:De,107:242,108:243,109:Te,110:Ee,111:Se,112:ye},{105:[1,256]},{10:Ae,60:me,84:Ce,92:257,105:De,107:242,108:243,109:Te,110:Ee,111:Se,112:ye},{44:_,47:258,60:K,89:P,102:U,105:W,106:Y,109:Q,111:J,113:42,114:Z,115:ee,116:te},e(N,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},e(N,[2,116]),e(N,[2,118],{10:[1,262]}),e(N,[2,119]),e(re,[2,56]),e(_e,[2,87]),e(re,[2,57]),{51:[1,263],67:E,82:219,116:S,117:y,118:x},e(re,[2,64]),e(re,[2,59]),e(re,[2,60]),e(re,[2,61]),{109:[1,264]},e(re,[2,63]),e(re,[2,65]),{66:[1,265],67:E,82:219,116:S,117:y,118:x},e(re,[2,67]),e(re,[2,68]),e(re,[2,70]),e(re,[2,69]),e(re,[2,71]),e([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),e(Ye,[2,78]),{31:[1,266],67:E,82:219,116:S,117:y,118:x},{6:11,7:12,8:c,9:g,10:d,11:R,20:17,22:18,23:19,24:20,25:21,26:22,27:F,32:[1,267],33:24,34:v,36:D,38:T,42:28,43:39,44:_,45:40,47:41,60:K,84:ie,85:h,86:A,87:ue,88:le,89:P,102:U,105:W,106:Y,109:Q,111:J,113:42,114:Z,115:ee,116:te,121:Qe,122:Je,123:Ze,124:$e,125:et},e(ve,[2,53]),{43:268,44:_,45:40,47:41,60:K,89:P,102:U,105:W,106:Y,109:Q,111:J,113:42,114:Z,115:ee,116:te},e(N,[2,121],{106:qe}),e(Jt,[2,130],{108:270,10:Ae,60:me,84:Ce,105:De,109:Te,110:Ee,111:Se,112:ye}),e(fe,[2,132]),e(fe,[2,134]),e(fe,[2,135]),e(fe,[2,136]),e(fe,[2,137]),e(fe,[2,138]),e(fe,[2,139]),e(fe,[2,140]),e(fe,[2,141]),e(N,[2,122],{106:qe}),{10:[1,271]},e(N,[2,123],{106:qe}),{10:[1,272]},e(Qt,[2,129]),e(N,[2,105],{106:qe}),e(N,[2,106],{113:113,44:_,60:K,89:P,102:U,105:W,106:Y,109:Q,111:J,114:Z,115:ee,116:te}),e(N,[2,110]),e(N,[2,112],{10:[1,273]}),e(N,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:be,9:ke,11:ge,21:278},e(B,[2,34]),e(ve,[2,52]),{10:Ae,60:me,84:Ce,105:De,107:279,108:243,109:Te,110:Ee,111:Se,112:ye},e(fe,[2,133]),{14:Re,44:Ne,60:Ge,89:Pe,101:280,105:Oe,106:Me,109:Ue,111:We,114:ze,115:je,116:Ke,120:88},{14:Re,44:Ne,60:Ge,89:Pe,101:281,105:Oe,106:Me,109:Ue,111:We,114:ze,115:je,116:Ke,120:88},{98:[1,282]},e(N,[2,120]),e(re,[2,58]),{30:283,67:E,80:ae,81:ne,82:172,116:S,117:y,118:x},e(re,[2,66]),e(nt,f,{5:284}),e(Jt,[2,131],{108:270,10:Ae,60:me,84:Ce,105:De,109:Te,110:Ee,111:Se,112:ye}),e(N,[2,126],{120:168,10:[1,285],14:Re,44:Ne,60:Ge,89:Pe,105:Oe,106:Me,109:Ue,111:We,114:ze,115:je,116:Ke}),e(N,[2,127],{120:168,10:[1,286],14:Re,44:Ne,60:Ge,89:Pe,105:Oe,106:Me,109:Ue,111:We,114:ze,115:je,116:Ke}),e(N,[2,114]),{31:[1,287],67:E,82:219,116:S,117:y,118:x},{6:11,7:12,8:c,9:g,10:d,11:R,20:17,22:18,23:19,24:20,25:21,26:22,27:F,32:[1,288],33:24,34:v,36:D,38:T,42:28,43:39,44:_,45:40,47:41,60:K,84:ie,85:h,86:A,87:ue,88:le,89:P,102:U,105:W,106:Y,109:Q,111:J,113:42,114:Z,115:ee,116:te,121:Qe,122:Je,123:Ze,124:$e,125:et},{10:Ae,60:me,84:Ce,92:289,105:De,107:242,108:243,109:Te,110:Ee,111:Se,112:ye},{10:Ae,60:me,84:Ce,92:290,105:De,107:242,108:243,109:Te,110:Ee,111:Se,112:ye},e(re,[2,62]),e(B,[2,33]),e(N,[2,124],{106:qe}),e(N,[2,125],{106:qe})],defaultActions:{},parseError:t(function(p,k){if(k.recoverable)this.trace(p);else{var C=Error(p);throw C.hash=k,C}},"parseError"),parse:t(function(p){var k=this,C=[0],u=[],I=[null],s=[],Le=this.table,i="",X=0,Zt=0,e1=0,u1=2,t1=1,o1=s.slice.call(arguments,1),se=Object.create(this.lexer),Ve={yy:{}};for(var lt in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,lt))Ve.yy[lt]=this.yy[lt];if(se.setInput(p,Ve.yy),Ve.yy.lexer=se,Ve.yy.parser=this,typeof se.yylloc>"u")se.yylloc={};var ht=se.yylloc;s.push(ht);var l1=se.options&&se.options.ranges;if(typeof Ve.yy.parseError==="function")this.parseError=Ve.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function c1(pe){C.length=C.length-2*pe,I.length=I.length-pe,s.length=s.length-pe}t(c1,"popStack");function s1(){var pe=u.pop()||se.lex()||t1;if(typeof pe!=="number"){if(pe instanceof Array)u=pe,pe=u.pop();pe=k.symbols_[pe]||pe}return pe}t(s1,"lex");var oe,dt,we,de,C1,pt,Xe={},rt,xe,i1,at;while(!0){if(we=C[C.length-1],this.defaultActions[we])de=this.defaultActions[we];else{if(oe===null||typeof oe>"u")oe=s1();de=Le[we]&&Le[we][oe]}if(typeof de>"u"||!de.length||!de[0]){var ft="";at=[];for(rt in Le[we])if(this.terminals_[rt]&&rt>u1)at.push("'"+this.terminals_[rt]+"'");if(se.showPosition)ft="Parse error on line "+(X+1)+`:
|
|
9
|
+
You have to call mermaid.initialize.`)}isLinkData(e){return e!==null&&typeof e==="object"&&"id"in e&&typeof e.id==="string"}addLink(e,r,a){let n=this.isLinkData(a)?a.id.replace("@",""):void 0;l.info("addLink",e,r,n);for(let o of e)for(let f of r){let c=o===e[e.length-1],g=f===r[0];if(c&&g)this.addSingleLink(o,f,a,n);else this.addSingleLink(o,f,a,void 0)}}updateLinkInterpolate(e,r){e.forEach((a)=>{if(a==="default")this.edges.defaultInterpolate=r;else this.edges[a].interpolate=r})}updateLink(e,r){e.forEach((a)=>{if(typeof a==="number"&&a>=this.edges.length)throw Error(`The index ${a} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);if(a==="default")this.edges.defaultStyle=r;else if(this.edges[a].style=r,(this.edges[a]?.style?.length??0)>0&&!this.edges[a]?.style?.some((n)=>n?.startsWith("fill")))this.edges[a]?.style?.push("fill:none")})}addClass(e,r){let a=r.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");e.split(",").forEach((n)=>{let o=this.classes.get(n);if(o===void 0)o={id:n,styles:[],textStyles:[]},this.classes.set(n,o);if(a!==void 0&&a!==null)a.forEach((f)=>{if(/color/.exec(f)){let c=f.replace("fill","bgFill");o.textStyles.push(c)}o.styles.push(f)})})}setDirection(e){if(this.direction=e.trim(),/.*</.exec(this.direction))this.direction="RL";if(/.*\^/.exec(this.direction))this.direction="BT";if(/.*>/.exec(this.direction))this.direction="LR";if(/.*v/.exec(this.direction))this.direction="TB";if(this.direction==="TD")this.direction="TB"}setClass(e,r){for(let a of e.split(",")){let n=this.vertices.get(a);if(n)n.classes.push(r);let o=this.edges.find((c)=>c.id===a);if(o)o.classes.push(r);let f=this.subGraphLookup.get(a);if(f)f.classes.push(r)}}setTooltip(e,r){if(r===void 0)return;r=this.sanitizeText(r);for(let a of e.split(","))this.tooltips.set(this.version==="gen-1"?this.lookUpDomId(a):a,r)}setClickFun(e,r,a){if(m().securityLevel!=="loose")return;if(r===void 0)return;let n=[];if(typeof a==="string"){n=a.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let f=0;f<n.length;f++){let c=n[f].trim();if(c.startsWith('"')&&c.endsWith('"'))c=c.substr(1,c.length-2);n[f]=c}}if(n.length===0)n.push(e);let o=this.vertices.get(e);if(o)o.haveCallback=!0,this.funs.push(()=>{let f=this.lookUpDomId(e),c=document.querySelector(`[id="${f}"]`);if(c!==null)c.addEventListener("click",()=>{V.runFunc(r,...n)},!1)})}setLink(e,r,a){e.split(",").forEach((n)=>{let o=this.vertices.get(n);if(o!==void 0)o.link=V.formatUrl(r,this.config),o.linkTarget=a}),this.setClass(e,"clickable")}getTooltip(e){return this.tooltips.get(e)}setClickEvent(e,r,a){e.split(",").forEach((n)=>{this.setClickFun(n,r,a)}),this.setClass(e,"clickable")}bindFunctions(e){this.funs.forEach((r)=>{r(e)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}getClasses(){return this.classes}setupToolTips(e){let r=Za();b(e).select("svg").selectAll("g.node").on("mouseover",(o)=>{let f=b(o.currentTarget),c=f.attr("title");if(c===null)return;let g=o.currentTarget?.getBoundingClientRect();r.transition().duration(200).style("opacity",".9"),r.text(f.attr("title")).style("left",window.scrollX+g.left+(g.right-g.left)/2+"px").style("top",window.scrollY+g.bottom+"px"),r.html(Ht.sanitize(c)),f.classed("hover",!0)}).on("mouseout",(o)=>{r.transition().duration(500).style("opacity",0),b(o.currentTarget).classed("hover",!1)})}clear(e="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.diagramId="",this.subGraphs=[],this.subGraphLookup=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=e,this.config=m(),M()}setGen(e){this.version=e||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(e,r,a){let n=e.text.trim(),o=a.text;if(e===a&&/\s/.exec(a.text))n=void 0;let c=t((v)=>{let D={boolean:{},number:{},string:{}},T=[],_;return{nodeList:v.filter(function(ie){let h=typeof ie;if(ie.stmt&&ie.stmt==="dir")return _=ie.value,!1;if(ie.trim()==="")return!1;if(h in D)return D[h].hasOwnProperty(ie)?!1:D[h][ie]=!0;else return T.includes(ie)?!1:T.push(ie)}),dir:_}},"uniq")(r.flat()),{nodeList:g,dir:d}=c,R=m().flowchart??{};if(d=d??(R.inheritDir?this.getDirection()??m().direction??void 0:void 0),this.version==="gen-1")for(let v=0;v<g.length;v++)g[v]=this.lookUpDomId(g[v]);n=n??"subGraph"+this.subCount,o=o||"",o=this.sanitizeText(o),this.subCount=this.subCount+1;let F={id:n,nodes:g,title:o.trim(),classes:[],dir:d,labelType:this.sanitizeNodeLabelType(a?.type)};return l.info("Adding",F.id,F.nodes,F.dir),F.nodes=this.makeUniq(F,this.subGraphs).nodes,this.subGraphs.push(F),this.subGraphLookup.set(n,F),n}getPosForId(e){for(let[r,a]of this.subGraphs.entries())if(a.id===e)return r;return-1}indexNodes2(e,r){let a=this.subGraphs[r].nodes;if(this.secCount=this.secCount+1,this.secCount>2000)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=r,this.subGraphs[r].id===e)return{result:!0,count:0};let n=0,o=1;while(n<a.length){let f=this.getPosForId(a[n]);if(f>=0){let c=this.indexNodes2(e,f);if(c.result)return{result:!0,count:o+c.count};else o=o+c.count}n=n+1}return{result:!1,count:o}}getDepthFirstPos(e){return this.posCrossRef[e]}indexNodes(){if(this.secCount=-1,this.subGraphs.length>0)this.indexNodes2("none",this.subGraphs.length-1)}getSubGraphs(){return this.subGraphs}firstGraph(){if(this.firstGraphFlag)return this.firstGraphFlag=!1,!0;return!1}destructStartLink(e){let r=e.trim(),a="arrow_open";switch(r[0]){case"<":a="arrow_point",r=r.slice(1);break;case"x":a="arrow_cross",r=r.slice(1);break;case"o":a="arrow_circle",r=r.slice(1);break}let n="normal";if(r.includes("="))n="thick";if(r.includes("."))n="dotted";return{type:a,stroke:n}}countChar(e,r){let a=r.length,n=0;for(let o=0;o<a;++o)if(r[o]===e)++n;return n}destructEndLink(e){let r=e.trim(),a=r.slice(0,-1),n="arrow_open";switch(r.slice(-1)){case"x":if(n="arrow_cross",r.startsWith("x"))n="double_"+n,a=a.slice(1);break;case">":if(n="arrow_point",r.startsWith("<"))n="double_"+n,a=a.slice(1);break;case"o":if(n="arrow_circle",r.startsWith("o"))n="double_"+n,a=a.slice(1);break}let o="normal",f=a.length-1;if(a.startsWith("="))o="thick";if(a.startsWith("~"))o="invisible";let c=this.countChar(".",a);if(c)o="dotted",f=c;return{type:n,stroke:o,length:f}}destructLink(e,r){let a=this.destructEndLink(e),n;if(r){if(n=this.destructStartLink(r),n.stroke!==a.stroke)return{type:"INVALID",stroke:"INVALID"};if(n.type==="arrow_open")n.type=a.type;else{if(n.type!==a.type)return{type:"INVALID",stroke:"INVALID"};n.type="double_"+n.type}if(n.type==="double_arrow")n.type="double_arrow_point";return n.length=a.length,n}return a}exists(e,r){for(let a of e)if(a.nodes.includes(r))return!0;return!1}makeUniq(e,r){let a=[];return e.nodes.forEach((n,o)=>{if(!this.exists(r,n))a.push(e.nodes[o])}),{nodes:a}}getTypeFromVertex(e){if(e.img)return"imageSquare";if(e.icon){if(e.form==="circle")return"iconCircle";if(e.form==="square")return"iconSquare";if(e.form==="rounded")return"iconRounded";return"icon"}switch(e.type){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e.type}}findNode(e,r){return e.find((a)=>a.id===r)}destructEdgeType(e){let r="none",a="arrow_point";switch(e){case"arrow_point":case"arrow_circle":case"arrow_cross":a=e;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":r=e.replace("double_",""),a=r;break}return{arrowTypeStart:r,arrowTypeEnd:a}}addNodeFromVertex(e,r,a,n,o,f){let c=a.get(e.id),g=n.get(e.id)??!1,d=this.findNode(r,e.id);if(d)d.cssStyles=e.styles,d.cssCompiledStyles=this.getCompiledStyles(e.classes),d.cssClasses=e.classes.join(" ");else{let R={id:e.id,label:e.text,labelType:e.labelType,labelStyle:"",parentId:c,padding:o.flowchart?.padding||8,cssStyles:e.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...e.classes]),cssClasses:"default "+e.classes.join(" "),dir:e.dir,domId:e.domId,look:f,link:e.link,linkTarget:e.linkTarget,tooltip:this.getTooltip(e.id),icon:e.icon,pos:e.pos,img:e.img,assetWidth:e.assetWidth,assetHeight:e.assetHeight,constraint:e.constraint};if(g)r.push({...R,isGroup:!0,shape:"rect"});else r.push({...R,isGroup:!1,shape:this.getTypeFromVertex(e),minWidth:o.flowchart?.minNodeWidth})}}getCompiledStyles(e){let r=[];for(let a of e){let n=this.classes.get(a);if(n?.styles)r=[...r,...n.styles??[]].map((o)=>o.trim());if(n?.textStyles)r=[...r,...n.textStyles??[]].map((o)=>o.trim())}return r}getData(){let e=m(),r=[],a=[],n=this.getSubGraphs(),o=new Map,f=new Map,c=new Map;for(let h of n)for(let A of h.nodes)if(this.subGraphLookup.has(A))c.set(A,h.id);let g=new Map,d=new Map;for(let h of n){let A=c.get(h.id);if(A!==void 0)d.set(A,[...d.get(A)??[],h.id])}let R=0,F=t((h)=>{g.set(h,R++);for(let A of d.get(h)??[])F(A)},"walk");for(let h of n)if(!c.has(h.id))F(h.id);let v=t((h)=>this.subGraphLookup.get(h)?.metadata?.view==="collapsed","isCollapsed"),D=t((h)=>{let A,ue=new Set,le=h;while(le!==void 0&&!ue.has(le)){if(ue.add(le),v(le))A=le;le=c.get(le)}return A},"outermostCollapsed"),T=new Set,_=new Map;for(let h of n){let A=D(h.id);if(A===void 0)continue;if(h.id!==A)T.add(h.id),_.set(h.id,A);for(let ue of h.nodes){if(ue===A)continue;T.add(ue),_.set(ue,A)}}for(let h=n.length-1;h>=0;h--){let A=n[h];if(T.has(A.id))continue;if(A.nodes.length>0)f.set(A.id,!0);for(let ue of A.nodes)o.set(ue,A.id)}for(let h=n.length-1;h>=0;h--){let A=n[h];if(T.has(A.id))continue;if(A.metadata?.view==="collapsed")r.push({id:A.id,label:A.title,labelStyle:"",labelType:A.labelType,parentId:o.get(A.id),padding:8,cssCompiledStyles:this.getCompiledStyles(A.classes),cssClasses:A.classes.join(" "),shape:"collapsedGroup",dir:A.dir,isGroup:!1,look:e.look,colorIndex:g.get(A.id)});else r.push({id:A.id,label:A.title,labelStyle:"",labelType:A.labelType,parentId:o.get(A.id),padding:8,cssCompiledStyles:this.getCompiledStyles(A.classes),cssClasses:A.classes.join(" "),shape:"rect",dir:A.dir,isGroup:!0,look:e.look,colorIndex:g.get(A.id),metadata:A.metadata})}this.getVertices().forEach((h)=>{if(T.has(h.id))return;this.addNodeFromVertex(h,r,o,f,e,e.look||"classic")});let ie=this.getEdges();return ie.forEach((h,A)=>{let{arrowTypeStart:ue,arrowTypeEnd:le}=this.destructEdgeType(h.type),P=[...ie.defaultStyle??[]],U=_.get(h.start)??h.start,W=_.get(h.end)??h.end;if(U===W&&(_.has(h.start)||_.has(h.end)))return;if(h.style)P.push(...h.style);let Y={id:Mn(U,W,{counter:A,prefix:"L"},h.id),isUserDefinedId:h.isUserDefinedId,start:U,end:W,type:h.type??"normal",label:h.text,labelType:h.labelType,labelpos:"c",thickness:h.stroke,minlen:h.length,classes:h?.stroke==="invisible"?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:h?.stroke==="invisible"||h?.type==="arrow_open"?"none":ue,arrowTypeEnd:h?.stroke==="invisible"||h?.type==="arrow_open"?"none":le,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(h.classes),labelStyle:P,style:P,pattern:h.stroke,look:e.look,animate:h.animate,animation:h.animation,curve:h.interpolate||this.edges.defaultInterpolate||e.flowchart?.curve};a.push(Y)}),{nodes:r,edges:a,other:{},config:e}}defaultConfig(){return Yi.flowchart}},p1=t(function(e,r){return r.db.getClasses()},"getClasses"),f1=t(async function(e,r,a,n){l.info("REF0:"),l.info("Drawing state diagram (v2)",r);let{securityLevel:o,flowchart:f,layout:c}=m();n.db.setDiagramId(r),l.debug("Before getData: ");let g=n.db.getData();l.debug("Data: ",g);let d=$t(r,o),R=n.db.getDirection();g.type=n.type,g.layoutAlgorithm=Ot(c),g.direction=R,g.nodeSpacing=f?.nodeSpacing||50,g.rankSpacing=f?.rankSpacing||50,g.markers=["point","circle","cross"],g.diagramId=r,l.debug("REF1:",g),await Pt(g,d);let F=g.config.flowchart?.diagramPadding??8;V.insertTitle(d,"flowchartTitleText",f?.titleTopMargin||0,n.db.getDiagramTitle()),vt(d,F,"flowchart",f?.useMaxWidth||!1)},"draw"),b1={getClasses:p1,draw:f1},kt=function(){var e=t(function(Be,p,k,C){for(k=k||{},C=Be.length;C--;k[Be[C]]=p);return k},"o"),r=[1,4],a=[1,3],n=[1,5],o=[1,8,9,10,11,27,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],f=[2,2],c=[1,13],g=[1,14],d=[1,15],R=[1,16],F=[1,23],v=[1,25],D=[1,26],T=[1,27],_=[1,50],K=[1,49],ie=[1,29],h=[1,30],A=[1,31],ue=[1,32],le=[1,33],P=[1,45],U=[1,47],W=[1,43],Y=[1,48],Q=[1,44],J=[1,51],Z=[1,46],ee=[1,52],te=[1,53],Qe=[1,34],Je=[1,35],Ze=[1,36],$e=[1,37],et=[1,38],Fe=[1,58],B=[1,8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],be=[1,62],ke=[1,61],ge=[1,63],Ie=[8,9,11,75,77,78],gt=[1,79],Re=[1,92],Ne=[1,97],Ge=[1,96],Pe=[1,93],Oe=[1,89],Me=[1,95],Ue=[1,91],We=[1,98],ze=[1,94],je=[1,99],Ke=[1,90],ve=[8,9,10,11,40,75,77,78],re=[8,9,10,11,40,46,75,77,78],ce=[8,9,10,11,29,40,44,46,48,50,52,54,56,58,60,63,65,67,68,70,75,77,78,89,102,105,106,109,111,114,115,116],At=[8,9,11,44,60,75,77,78,89,102,105,106,109,111,114,115,116],Ye=[44,60,89,102,105,106,109,111,114,115,116],mt=[1,122],Ct=[1,123],tt=[1,125],st=[1,124],Dt=[44,60,62,74,89,102,105,106,109,111,114,115,116],Tt=[1,134],Et=[1,148],St=[1,149],xt=[1,150],Ft=[1,151],_t=[1,136],Bt=[1,138],Lt=[1,142],Vt=[1,143],wt=[1,144],It=[1,145],Rt=[1,146],Nt=[1,147],Gt=[1,152],Mt=[1,153],Ut=[1,132],Wt=[1,133],zt=[1,140],jt=[1,135],Kt=[1,139],Yt=[1,137],nt=[8,9,10,11,27,32,34,36,38,44,60,84,85,86,87,88,89,102,105,106,109,111,114,115,116,121,122,123,124,125],qt=[1,155],Xt=[1,157],N=[8,9,11],he=[8,9,10,11,14,44,60,89,105,106,109,111,114,115,116],E=[1,177],ae=[1,173],ne=[1,174],S=[1,178],y=[1,175],x=[1,176],He=[77,116,119],L=[8,9,10,11,12,14,27,29,32,44,60,75,84,85,86,87,88,89,90,105,109,111,114,115,116],Qt=[10,106],_e=[31,49,51,53,55,57,62,64,66,67,69,71,116,117,118],Ae=[1,248],me=[1,246],Ce=[1,250],De=[1,244],Te=[1,245],Ee=[1,247],Se=[1,249],ye=[1,251],qe=[1,269],Jt=[8,9,11,106],fe=[8,9,10,11,60,84,105,106,109,110,111,112],ot={trace:t(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,SEMI:8,NEWLINE:9,SPACE:10,EOF:11,GRAPH:12,NODIR:13,DIR:14,FirstStmtSeparator:15,ending:16,endToken:17,spaceList:18,spaceListNewline:19,vertexStatement:20,separator:21,styleStatement:22,linkStyleStatement:23,classDefStatement:24,classStatement:25,clickStatement:26,subgraph:27,textNoTags:28,SQS:29,text:30,SQE:31,end:32,direction:33,acc_title:34,acc_title_value:35,acc_descr:36,acc_descr_value:37,acc_descr_multiline_value:38,shapeData:39,SHAPE_DATA:40,link:41,node:42,styledVertex:43,AMP:44,vertex:45,STYLE_SEPARATOR:46,idString:47,DOUBLECIRCLESTART:48,DOUBLECIRCLEEND:49,PS:50,PE:51,"(-":52,"-)":53,STADIUMSTART:54,STADIUMEND:55,SUBROUTINESTART:56,SUBROUTINEEND:57,VERTEX_WITH_PROPS_START:58,"NODE_STRING[field]":59,COLON:60,"NODE_STRING[value]":61,PIPE:62,CYLINDERSTART:63,CYLINDEREND:64,DIAMOND_START:65,DIAMOND_STOP:66,TAGEND:67,TRAPSTART:68,TRAPEND:69,INVTRAPSTART:70,INVTRAPEND:71,linkStatement:72,arrowText:73,TESTSTR:74,START_LINK:75,edgeText:76,LINK:77,LINK_ID:78,edgeTextToken:79,STR:80,MD_STR:81,textToken:82,keywords:83,STYLE:84,LINKSTYLE:85,CLASSDEF:86,CLASS:87,CLICK:88,DOWN:89,UP:90,textNoTagsToken:91,stylesOpt:92,"idString[vertex]":93,"idString[class]":94,CALLBACKNAME:95,CALLBACKARGS:96,HREF:97,LINK_TARGET:98,"STR[link]":99,"STR[tooltip]":100,alphaNum:101,DEFAULT:102,numList:103,INTERPOLATE:104,NUM:105,COMMA:106,style:107,styleComponent:108,NODE_STRING:109,UNIT:110,BRKT:111,PCT:112,idStringToken:113,MINUS:114,MULT:115,UNICODE_TEXT:116,TEXT:117,TAGSTART:118,EDGE_TEXT:119,alphaNumToken:120,direction_tb:121,direction_bt:122,direction_rl:123,direction_lr:124,direction_td:125,$accept:0,$end:1},terminals_:{2:"error",8:"SEMI",9:"NEWLINE",10:"SPACE",11:"EOF",12:"GRAPH",13:"NODIR",14:"DIR",27:"subgraph",29:"SQS",31:"SQE",32:"end",34:"acc_title",35:"acc_title_value",36:"acc_descr",37:"acc_descr_value",38:"acc_descr_multiline_value",40:"SHAPE_DATA",44:"AMP",46:"STYLE_SEPARATOR",48:"DOUBLECIRCLESTART",49:"DOUBLECIRCLEEND",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"VERTEX_WITH_PROPS_START",59:"NODE_STRING[field]",60:"COLON",61:"NODE_STRING[value]",62:"PIPE",63:"CYLINDERSTART",64:"CYLINDEREND",65:"DIAMOND_START",66:"DIAMOND_STOP",67:"TAGEND",68:"TRAPSTART",69:"TRAPEND",70:"INVTRAPSTART",71:"INVTRAPEND",74:"TESTSTR",75:"START_LINK",77:"LINK",78:"LINK_ID",80:"STR",81:"MD_STR",84:"STYLE",85:"LINKSTYLE",86:"CLASSDEF",87:"CLASS",88:"CLICK",89:"DOWN",90:"UP",93:"idString[vertex]",94:"idString[class]",95:"CALLBACKNAME",96:"CALLBACKARGS",97:"HREF",98:"LINK_TARGET",99:"STR[link]",100:"STR[tooltip]",102:"DEFAULT",104:"INTERPOLATE",105:"NUM",106:"COMMA",109:"NODE_STRING",110:"UNIT",111:"BRKT",112:"PCT",114:"MINUS",115:"MULT",116:"UNICODE_TEXT",117:"TEXT",118:"TAGSTART",119:"EDGE_TEXT",121:"direction_tb",122:"direction_bt",123:"direction_rl",124:"direction_lr",125:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,3],[16,2],[16,1],[17,1],[17,1],[17,1],[15,1],[15,1],[15,2],[19,2],[19,2],[19,1],[19,1],[18,2],[18,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,6],[7,4],[7,1],[7,2],[7,2],[7,1],[21,1],[21,1],[21,1],[39,2],[39,1],[20,4],[20,3],[20,4],[20,2],[20,2],[20,1],[42,1],[42,6],[42,5],[43,1],[43,3],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,8],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[41,2],[41,3],[41,3],[41,1],[41,3],[41,4],[76,1],[76,2],[76,1],[76,1],[72,1],[72,2],[73,3],[30,1],[30,2],[30,1],[30,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[83,1],[28,1],[28,2],[28,1],[28,1],[24,5],[25,5],[26,2],[26,4],[26,3],[26,5],[26,3],[26,5],[26,5],[26,7],[26,2],[26,4],[26,2],[26,4],[26,4],[26,6],[22,5],[23,5],[23,5],[23,9],[23,9],[23,7],[23,7],[103,1],[103,3],[92,1],[92,3],[107,1],[107,2],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[113,1],[82,1],[82,1],[82,1],[82,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[91,1],[79,1],[79,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[47,1],[47,2],[101,1],[101,2],[33,1],[33,1],[33,1],[33,1],[33,1]],performAction:t(function(p,k,C,u,I,s,Le){var i=s.length-1;switch(I){case 2:this.$=[];break;case 3:if(!Array.isArray(s[i])||s[i].length>0)s[i-1].push(s[i]);this.$=s[i-1];break;case 4:case 183:this.$=s[i];break;case 11:u.setDirection("TB"),this.$="TB";break;case 12:u.setDirection(s[i-1]),this.$=s[i-1];break;case 27:this.$=s[i-1].nodes;break;case 28:case 29:case 30:case 31:case 32:this.$=[];break;case 33:this.$=u.addSubGraph(s[i-6],s[i-1],s[i-4]);break;case 34:this.$=u.addSubGraph(s[i-3],s[i-1],s[i-3]);break;case 35:this.$=u.addSubGraph(void 0,s[i-1],void 0);break;case 37:this.$=s[i].trim(),u.setAccTitle(this.$);break;case 38:case 39:this.$=s[i].trim(),u.setAccDescription(this.$);break;case 43:this.$=s[i-1]+s[i];break;case 44:this.$=s[i];break;case 45:u.addVertex(s[i-1][s[i-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i]),u.addLink(s[i-3].stmt,s[i-1],s[i-2]),this.$={stmt:s[i-1],nodes:s[i-1].concat(s[i-3].nodes)};break;case 46:u.addLink(s[i-2].stmt,s[i],s[i-1]),this.$={stmt:s[i],nodes:s[i].concat(s[i-2].nodes)};break;case 47:u.addLink(s[i-3].stmt,s[i-1],s[i-2]),this.$={stmt:s[i-1],nodes:s[i-1].concat(s[i-3].nodes)};break;case 48:this.$={stmt:s[i-1],nodes:s[i-1]};break;case 49:u.addVertex(s[i-1][s[i-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i]),this.$={stmt:s[i-1],nodes:s[i-1],shapeData:s[i]};break;case 50:this.$={stmt:s[i],nodes:s[i]};break;case 51:this.$=[s[i]];break;case 52:u.addVertex(s[i-5][s[i-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,s[i-4]),this.$=s[i-5].concat(s[i]);break;case 53:this.$=s[i-4].concat(s[i]);break;case 54:this.$=s[i];break;case 55:this.$=s[i-2],u.setClass(s[i-2],s[i]);break;case 56:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"square");break;case 57:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"doublecircle");break;case 58:this.$=s[i-5],u.addVertex(s[i-5],s[i-2],"circle");break;case 59:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"ellipse");break;case 60:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"stadium");break;case 61:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"subroutine");break;case 62:this.$=s[i-7],u.addVertex(s[i-7],s[i-1],"rect",void 0,void 0,void 0,Object.fromEntries([[s[i-5],s[i-3]]]));break;case 63:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"cylinder");break;case 64:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"round");break;case 65:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"diamond");break;case 66:this.$=s[i-5],u.addVertex(s[i-5],s[i-2],"hexagon");break;case 67:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"odd");break;case 68:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"trapezoid");break;case 69:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"inv_trapezoid");break;case 70:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"lean_right");break;case 71:this.$=s[i-3],u.addVertex(s[i-3],s[i-1],"lean_left");break;case 72:this.$=s[i],u.addVertex(s[i]);break;case 73:s[i-1].text=s[i],this.$=s[i-1];break;case 74:case 75:s[i-2].text=s[i-1],this.$=s[i-2];break;case 76:this.$=s[i];break;case 77:var X=u.destructLink(s[i],s[i-2]);this.$={type:X.type,stroke:X.stroke,length:X.length,text:s[i-1]};break;case 78:var X=u.destructLink(s[i],s[i-2]);this.$={type:X.type,stroke:X.stroke,length:X.length,text:s[i-1],id:s[i-3]};break;case 79:this.$={text:s[i],type:"text"};break;case 80:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 81:this.$={text:s[i],type:"string"};break;case 82:this.$={text:s[i],type:"markdown"};break;case 83:var X=u.destructLink(s[i]);this.$={type:X.type,stroke:X.stroke,length:X.length};break;case 84:var X=u.destructLink(s[i]);this.$={type:X.type,stroke:X.stroke,length:X.length,id:s[i-1]};break;case 85:this.$=s[i-1];break;case 86:this.$={text:s[i],type:"text"};break;case 87:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 88:this.$={text:s[i],type:"string"};break;case 89:case 104:this.$={text:s[i],type:"markdown"};break;case 101:this.$={text:s[i],type:"text"};break;case 102:this.$={text:s[i-1].text+""+s[i],type:s[i-1].type};break;case 103:this.$={text:s[i],type:"text"};break;case 105:this.$=s[i-4],u.addClass(s[i-2],s[i]);break;case 106:this.$=s[i-4],u.setClass(s[i-2],s[i]);break;case 107:case 115:this.$=s[i-1],u.setClickEvent(s[i-1],s[i]);break;case 108:case 116:this.$=s[i-3],u.setClickEvent(s[i-3],s[i-2]),u.setTooltip(s[i-3],s[i]);break;case 109:this.$=s[i-2],u.setClickEvent(s[i-2],s[i-1],s[i]);break;case 110:this.$=s[i-4],u.setClickEvent(s[i-4],s[i-3],s[i-2]),u.setTooltip(s[i-4],s[i]);break;case 111:this.$=s[i-2],u.setLink(s[i-2],s[i]);break;case 112:this.$=s[i-4],u.setLink(s[i-4],s[i-2]),u.setTooltip(s[i-4],s[i]);break;case 113:this.$=s[i-4],u.setLink(s[i-4],s[i-2],s[i]);break;case 114:this.$=s[i-6],u.setLink(s[i-6],s[i-4],s[i]),u.setTooltip(s[i-6],s[i-2]);break;case 117:this.$=s[i-1],u.setLink(s[i-1],s[i]);break;case 118:this.$=s[i-3],u.setLink(s[i-3],s[i-2]),u.setTooltip(s[i-3],s[i]);break;case 119:this.$=s[i-3],u.setLink(s[i-3],s[i-2],s[i]);break;case 120:this.$=s[i-5],u.setLink(s[i-5],s[i-4],s[i]),u.setTooltip(s[i-5],s[i-2]);break;case 121:this.$=s[i-4],u.addVertex(s[i-2],void 0,void 0,s[i]);break;case 122:this.$=s[i-4],u.updateLink([s[i-2]],s[i]);break;case 123:this.$=s[i-4],u.updateLink(s[i-2],s[i]);break;case 124:this.$=s[i-8],u.updateLinkInterpolate([s[i-6]],s[i-2]),u.updateLink([s[i-6]],s[i]);break;case 125:this.$=s[i-8],u.updateLinkInterpolate(s[i-6],s[i-2]),u.updateLink(s[i-6],s[i]);break;case 126:this.$=s[i-6],u.updateLinkInterpolate([s[i-4]],s[i]);break;case 127:this.$=s[i-6],u.updateLinkInterpolate(s[i-4],s[i]);break;case 128:case 130:this.$=[s[i]];break;case 129:case 131:s[i-2].push(s[i]),this.$=s[i-2];break;case 133:this.$=s[i-1]+s[i];break;case 181:this.$=s[i];break;case 182:this.$=s[i-1]+""+s[i];break;case 184:this.$=s[i-1]+""+s[i];break;case 185:this.$={stmt:"dir",value:"TB"};break;case 186:this.$={stmt:"dir",value:"BT"};break;case 187:this.$={stmt:"dir",value:"RL"};break;case 188:this.$={stmt:"dir",value:"LR"};break;case 189:this.$={stmt:"dir",value:"TD"};break}},"anonymous"),table:[{3:1,4:2,9:r,10:a,12:n},{1:[3]},e(o,f,{5:6}),{4:7,9:r,10:a,12:n},{4:8,9:r,10:a,12:n},{13:[1,9],14:[1,10]},{1:[2,1],6:11,7:12,8:c,9:g,10:d,11:R,20:17,22:18,23:19,24:20,25:21,26:22,27:F,33:24,34:v,36:D,38:T,42:28,43:39,44:_,45:40,47:41,60:K,84:ie,85:h,86:A,87:ue,88:le,89:P,102:U,105:W,106:Y,109:Q,111:J,113:42,114:Z,115:ee,116:te,121:Qe,122:Je,123:Ze,124:$e,125:et},e(o,[2,9]),e(o,[2,10]),e(o,[2,11]),{8:[1,55],9:[1,56],10:Fe,15:54,18:57},e(B,[2,3]),e(B,[2,4]),e(B,[2,5]),e(B,[2,6]),e(B,[2,7]),e(B,[2,8]),{8:be,9:ke,11:ge,21:59,41:60,72:64,75:[1,65],77:[1,67],78:[1,66]},{8:be,9:ke,11:ge,21:68},{8:be,9:ke,11:ge,21:69},{8:be,9:ke,11:ge,21:70},{8:be,9:ke,11:ge,21:71},{8:be,9:ke,11:ge,21:72},{8:be,9:ke,10:[1,73],11:ge,21:74},e(B,[2,36]),{35:[1,75]},{37:[1,76]},e(B,[2,39]),e(Ie,[2,50],{18:77,39:78,10:Fe,40:gt}),{10:[1,80]},{10:[1,81]},{10:[1,82]},{10:[1,83]},{14:Re,44:Ne,60:Ge,80:[1,87],89:Pe,95:[1,84],97:[1,85],101:86,105:Oe,106:Me,109:Ue,111:We,114:ze,115:je,116:Ke,120:88},e(B,[2,185]),e(B,[2,186]),e(B,[2,187]),e(B,[2,188]),e(B,[2,189]),e(ve,[2,51]),e(ve,[2,54],{46:[1,100]}),e(re,[2,72],{113:113,29:[1,101],44:_,48:[1,102],50:[1,103],52:[1,104],54:[1,105],56:[1,106],58:[1,107],60:K,63:[1,108],65:[1,109],67:[1,110],68:[1,111],70:[1,112],89:P,102:U,105:W,106:Y,109:Q,111:J,114:Z,115:ee,116:te}),e(ce,[2,181]),e(ce,[2,142]),e(ce,[2,143]),e(ce,[2,144]),e(ce,[2,145]),e(ce,[2,146]),e(ce,[2,147]),e(ce,[2,148]),e(ce,[2,149]),e(ce,[2,150]),e(ce,[2,151]),e(ce,[2,152]),e(o,[2,12]),e(o,[2,18]),e(o,[2,19]),{9:[1,114]},e(At,[2,26],{18:115,10:Fe}),e(B,[2,27]),{42:116,43:39,44:_,45:40,47:41,60:K,89:P,102:U,105:W,106:Y,109:Q,111:J,113:42,114:Z,115:ee,116:te},e(B,[2,40]),e(B,[2,41]),e(B,[2,42]),e(Ye,[2,76],{73:117,62:[1,119],74:[1,118]}),{76:120,79:121,80:mt,81:Ct,116:tt,119:st},{75:[1,126],77:[1,127]},e(Dt,[2,83]),e(B,[2,28]),e(B,[2,29]),e(B,[2,30]),e(B,[2,31]),e(B,[2,32]),{10:Tt,12:Et,14:St,27:xt,28:128,32:Ft,44:_t,60:Bt,75:Lt,80:[1,130],81:[1,131],83:141,84:Vt,85:wt,86:It,87:Rt,88:Nt,89:Gt,90:Mt,91:129,105:Ut,109:Wt,111:zt,114:jt,115:Kt,116:Yt},e(nt,f,{5:154}),e(B,[2,37]),e(B,[2,38]),e(Ie,[2,48],{44:qt}),e(Ie,[2,49],{18:156,10:Fe,40:Xt}),e(ve,[2,44]),{44:_,47:158,60:K,89:P,102:U,105:W,106:Y,109:Q,111:J,113:42,114:Z,115:ee,116:te},{102:[1,159],103:160,105:[1,161]},{44:_,47:162,60:K,89:P,102:U,105:W,106:Y,109:Q,111:J,113:42,114:Z,115:ee,116:te},{44:_,47:163,60:K,89:P,102:U,105:W,106:Y,109:Q,111:J,113:42,114:Z,115:ee,116:te},e(N,[2,107],{10:[1,164],96:[1,165]}),{80:[1,166]},e(N,[2,115],{120:168,10:[1,167],14:Re,44:Ne,60:Ge,89:Pe,105:Oe,106:Me,109:Ue,111:We,114:ze,115:je,116:Ke}),e(N,[2,117],{10:[1,169]}),e(he,[2,183]),e(he,[2,170]),e(he,[2,171]),e(he,[2,172]),e(he,[2,173]),e(he,[2,174]),e(he,[2,175]),e(he,[2,176]),e(he,[2,177]),e(he,[2,178]),e(he,[2,179]),e(he,[2,180]),{44:_,47:170,60:K,89:P,102:U,105:W,106:Y,109:Q,111:J,113:42,114:Z,115:ee,116:te},{30:171,67:E,80:ae,81:ne,82:172,116:S,117:y,118:x},{30:179,67:E,80:ae,81:ne,82:172,116:S,117:y,118:x},{30:181,50:[1,180],67:E,80:ae,81:ne,82:172,116:S,117:y,118:x},{30:182,67:E,80:ae,81:ne,82:172,116:S,117:y,118:x},{30:183,67:E,80:ae,81:ne,82:172,116:S,117:y,118:x},{30:184,67:E,80:ae,81:ne,82:172,116:S,117:y,118:x},{109:[1,185]},{30:186,67:E,80:ae,81:ne,82:172,116:S,117:y,118:x},{30:187,65:[1,188],67:E,80:ae,81:ne,82:172,116:S,117:y,118:x},{30:189,67:E,80:ae,81:ne,82:172,116:S,117:y,118:x},{30:190,67:E,80:ae,81:ne,82:172,116:S,117:y,118:x},{30:191,67:E,80:ae,81:ne,82:172,116:S,117:y,118:x},e(ce,[2,182]),e(o,[2,20]),e(At,[2,25]),e(Ie,[2,46],{39:192,18:193,10:Fe,40:gt}),e(Ye,[2,73],{10:[1,194]}),{10:[1,195]},{30:196,67:E,80:ae,81:ne,82:172,116:S,117:y,118:x},{77:[1,197],79:198,116:tt,119:st},e(He,[2,79]),e(He,[2,81]),e(He,[2,82]),e(He,[2,168]),e(He,[2,169]),{76:199,79:121,80:mt,81:Ct,116:tt,119:st},e(Dt,[2,84]),{8:be,9:ke,10:Tt,11:ge,12:Et,14:St,21:201,27:xt,29:[1,200],32:Ft,44:_t,60:Bt,75:Lt,83:141,84:Vt,85:wt,86:It,87:Rt,88:Nt,89:Gt,90:Mt,91:202,105:Ut,109:Wt,111:zt,114:jt,115:Kt,116:Yt},e(L,[2,101]),e(L,[2,103]),e(L,[2,104]),e(L,[2,157]),e(L,[2,158]),e(L,[2,159]),e(L,[2,160]),e(L,[2,161]),e(L,[2,162]),e(L,[2,163]),e(L,[2,164]),e(L,[2,165]),e(L,[2,166]),e(L,[2,167]),e(L,[2,90]),e(L,[2,91]),e(L,[2,92]),e(L,[2,93]),e(L,[2,94]),e(L,[2,95]),e(L,[2,96]),e(L,[2,97]),e(L,[2,98]),e(L,[2,99]),e(L,[2,100]),{6:11,7:12,8:c,9:g,10:d,11:R,20:17,22:18,23:19,24:20,25:21,26:22,27:F,32:[1,203],33:24,34:v,36:D,38:T,42:28,43:39,44:_,45:40,47:41,60:K,84:ie,85:h,86:A,87:ue,88:le,89:P,102:U,105:W,106:Y,109:Q,111:J,113:42,114:Z,115:ee,116:te,121:Qe,122:Je,123:Ze,124:$e,125:et},{10:Fe,18:204},{44:[1,205]},e(ve,[2,43]),{10:[1,206],44:_,60:K,89:P,102:U,105:W,106:Y,109:Q,111:J,113:113,114:Z,115:ee,116:te},{10:[1,207]},{10:[1,208],106:[1,209]},e(Qt,[2,128]),{10:[1,210],44:_,60:K,89:P,102:U,105:W,106:Y,109:Q,111:J,113:113,114:Z,115:ee,116:te},{10:[1,211],44:_,60:K,89:P,102:U,105:W,106:Y,109:Q,111:J,113:113,114:Z,115:ee,116:te},{80:[1,212]},e(N,[2,109],{10:[1,213]}),e(N,[2,111],{10:[1,214]}),{80:[1,215]},e(he,[2,184]),{80:[1,216],98:[1,217]},e(ve,[2,55],{113:113,44:_,60:K,89:P,102:U,105:W,106:Y,109:Q,111:J,114:Z,115:ee,116:te}),{31:[1,218],67:E,82:219,116:S,117:y,118:x},e(_e,[2,86]),e(_e,[2,88]),e(_e,[2,89]),e(_e,[2,153]),e(_e,[2,154]),e(_e,[2,155]),e(_e,[2,156]),{49:[1,220],67:E,82:219,116:S,117:y,118:x},{30:221,67:E,80:ae,81:ne,82:172,116:S,117:y,118:x},{51:[1,222],67:E,82:219,116:S,117:y,118:x},{53:[1,223],67:E,82:219,116:S,117:y,118:x},{55:[1,224],67:E,82:219,116:S,117:y,118:x},{57:[1,225],67:E,82:219,116:S,117:y,118:x},{60:[1,226]},{64:[1,227],67:E,82:219,116:S,117:y,118:x},{66:[1,228],67:E,82:219,116:S,117:y,118:x},{30:229,67:E,80:ae,81:ne,82:172,116:S,117:y,118:x},{31:[1,230],67:E,82:219,116:S,117:y,118:x},{67:E,69:[1,231],71:[1,232],82:219,116:S,117:y,118:x},{67:E,69:[1,234],71:[1,233],82:219,116:S,117:y,118:x},e(Ie,[2,45],{18:156,10:Fe,40:Xt}),e(Ie,[2,47],{44:qt}),e(Ye,[2,75]),e(Ye,[2,74]),{62:[1,235],67:E,82:219,116:S,117:y,118:x},e(Ye,[2,77]),e(He,[2,80]),{77:[1,236],79:198,116:tt,119:st},{30:237,67:E,80:ae,81:ne,82:172,116:S,117:y,118:x},e(nt,f,{5:238}),e(L,[2,102]),e(B,[2,35]),{43:239,44:_,45:40,47:41,60:K,89:P,102:U,105:W,106:Y,109:Q,111:J,113:42,114:Z,115:ee,116:te},{10:Fe,18:240},{10:Ae,60:me,84:Ce,92:241,105:De,107:242,108:243,109:Te,110:Ee,111:Se,112:ye},{10:Ae,60:me,84:Ce,92:252,104:[1,253],105:De,107:242,108:243,109:Te,110:Ee,111:Se,112:ye},{10:Ae,60:me,84:Ce,92:254,104:[1,255],105:De,107:242,108:243,109:Te,110:Ee,111:Se,112:ye},{105:[1,256]},{10:Ae,60:me,84:Ce,92:257,105:De,107:242,108:243,109:Te,110:Ee,111:Se,112:ye},{44:_,47:258,60:K,89:P,102:U,105:W,106:Y,109:Q,111:J,113:42,114:Z,115:ee,116:te},e(N,[2,108]),{80:[1,259]},{80:[1,260],98:[1,261]},e(N,[2,116]),e(N,[2,118],{10:[1,262]}),e(N,[2,119]),e(re,[2,56]),e(_e,[2,87]),e(re,[2,57]),{51:[1,263],67:E,82:219,116:S,117:y,118:x},e(re,[2,64]),e(re,[2,59]),e(re,[2,60]),e(re,[2,61]),{109:[1,264]},e(re,[2,63]),e(re,[2,65]),{66:[1,265],67:E,82:219,116:S,117:y,118:x},e(re,[2,67]),e(re,[2,68]),e(re,[2,70]),e(re,[2,69]),e(re,[2,71]),e([10,44,60,89,102,105,106,109,111,114,115,116],[2,85]),e(Ye,[2,78]),{31:[1,266],67:E,82:219,116:S,117:y,118:x},{6:11,7:12,8:c,9:g,10:d,11:R,20:17,22:18,23:19,24:20,25:21,26:22,27:F,32:[1,267],33:24,34:v,36:D,38:T,42:28,43:39,44:_,45:40,47:41,60:K,84:ie,85:h,86:A,87:ue,88:le,89:P,102:U,105:W,106:Y,109:Q,111:J,113:42,114:Z,115:ee,116:te,121:Qe,122:Je,123:Ze,124:$e,125:et},e(ve,[2,53]),{43:268,44:_,45:40,47:41,60:K,89:P,102:U,105:W,106:Y,109:Q,111:J,113:42,114:Z,115:ee,116:te},e(N,[2,121],{106:qe}),e(Jt,[2,130],{108:270,10:Ae,60:me,84:Ce,105:De,109:Te,110:Ee,111:Se,112:ye}),e(fe,[2,132]),e(fe,[2,134]),e(fe,[2,135]),e(fe,[2,136]),e(fe,[2,137]),e(fe,[2,138]),e(fe,[2,139]),e(fe,[2,140]),e(fe,[2,141]),e(N,[2,122],{106:qe}),{10:[1,271]},e(N,[2,123],{106:qe}),{10:[1,272]},e(Qt,[2,129]),e(N,[2,105],{106:qe}),e(N,[2,106],{113:113,44:_,60:K,89:P,102:U,105:W,106:Y,109:Q,111:J,114:Z,115:ee,116:te}),e(N,[2,110]),e(N,[2,112],{10:[1,273]}),e(N,[2,113]),{98:[1,274]},{51:[1,275]},{62:[1,276]},{66:[1,277]},{8:be,9:ke,11:ge,21:278},e(B,[2,34]),e(ve,[2,52]),{10:Ae,60:me,84:Ce,105:De,107:279,108:243,109:Te,110:Ee,111:Se,112:ye},e(fe,[2,133]),{14:Re,44:Ne,60:Ge,89:Pe,101:280,105:Oe,106:Me,109:Ue,111:We,114:ze,115:je,116:Ke,120:88},{14:Re,44:Ne,60:Ge,89:Pe,101:281,105:Oe,106:Me,109:Ue,111:We,114:ze,115:je,116:Ke,120:88},{98:[1,282]},e(N,[2,120]),e(re,[2,58]),{30:283,67:E,80:ae,81:ne,82:172,116:S,117:y,118:x},e(re,[2,66]),e(nt,f,{5:284}),e(Jt,[2,131],{108:270,10:Ae,60:me,84:Ce,105:De,109:Te,110:Ee,111:Se,112:ye}),e(N,[2,126],{120:168,10:[1,285],14:Re,44:Ne,60:Ge,89:Pe,105:Oe,106:Me,109:Ue,111:We,114:ze,115:je,116:Ke}),e(N,[2,127],{120:168,10:[1,286],14:Re,44:Ne,60:Ge,89:Pe,105:Oe,106:Me,109:Ue,111:We,114:ze,115:je,116:Ke}),e(N,[2,114]),{31:[1,287],67:E,82:219,116:S,117:y,118:x},{6:11,7:12,8:c,9:g,10:d,11:R,20:17,22:18,23:19,24:20,25:21,26:22,27:F,32:[1,288],33:24,34:v,36:D,38:T,42:28,43:39,44:_,45:40,47:41,60:K,84:ie,85:h,86:A,87:ue,88:le,89:P,102:U,105:W,106:Y,109:Q,111:J,113:42,114:Z,115:ee,116:te,121:Qe,122:Je,123:Ze,124:$e,125:et},{10:Ae,60:me,84:Ce,92:289,105:De,107:242,108:243,109:Te,110:Ee,111:Se,112:ye},{10:Ae,60:me,84:Ce,92:290,105:De,107:242,108:243,109:Te,110:Ee,111:Se,112:ye},e(re,[2,62]),e(B,[2,33]),e(N,[2,124],{106:qe}),e(N,[2,125],{106:qe})],defaultActions:{},parseError:t(function(p,k){if(k.recoverable)this.trace(p);else{var C=Error(p);throw C.hash=k,C}},"parseError"),parse:t(function(p){var k=this,C=[0],u=[],I=[null],s=[],Le=this.table,i="",X=0,Zt=0,e1=0,u1=2,t1=1,o1=s.slice.call(arguments,1),se=Object.create(this.lexer),Ve={yy:{}};for(var lt in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,lt))Ve.yy[lt]=this.yy[lt];if(se.setInput(p,Ve.yy),Ve.yy.lexer=se,Ve.yy.parser=this,typeof se.yylloc>"u")se.yylloc={};var ht=se.yylloc;s.push(ht);var l1=se.options&&se.options.ranges;if(typeof Ve.yy.parseError==="function")this.parseError=Ve.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function c1(pe){C.length=C.length-2*pe,I.length=I.length-pe,s.length=s.length-pe}t(c1,"popStack");function s1(){var pe=u.pop()||se.lex()||t1;if(typeof pe!=="number"){if(pe instanceof Array)u=pe,pe=u.pop();pe=k.symbols_[pe]||pe}return pe}t(s1,"lex");var oe,dt,we,de,C1,pt,Xe={},rt,xe,i1,at;while(!0){if(we=C[C.length-1],this.defaultActions[we])de=this.defaultActions[we];else{if(oe===null||typeof oe>"u")oe=s1();de=Le[we]&&Le[we][oe]}if(typeof de>"u"||!de.length||!de[0]){var ft="";at=[];for(rt in Le[we])if(this.terminals_[rt]&&rt>u1)at.push("'"+this.terminals_[rt]+"'");if(se.showPosition)ft="Parse error on line "+(X+1)+`:
|
|
10
10
|
`+se.showPosition()+`
|
|
11
11
|
Expecting `+at.join(", ")+", got '"+(this.terminals_[oe]||oe)+"'";else ft="Parse error on line "+(X+1)+": Unexpected "+(oe==t1?"end of input":"'"+(this.terminals_[oe]||oe)+"'");this.parseError(ft,{text:se.match,token:this.terminals_[oe]||oe,line:se.yylineno,loc:ht,expected:at})}if(de[0]instanceof Array&&de.length>1)throw Error("Parse Error: multiple actions possible at state: "+we+", token: "+oe);switch(de[0]){case 1:if(C.push(oe),I.push(se.yytext),s.push(se.yylloc),C.push(de[1]),oe=null,!dt){if(Zt=se.yyleng,i=se.yytext,X=se.yylineno,ht=se.yylloc,e1>0)e1--}else oe=dt,dt=null;break;case 2:if(xe=this.productions_[de[1]][1],Xe.$=I[I.length-xe],Xe._$={first_line:s[s.length-(xe||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(xe||1)].first_column,last_column:s[s.length-1].last_column},l1)Xe._$.range=[s[s.length-(xe||1)].range[0],s[s.length-1].range[1]];if(pt=this.performAction.apply(Xe,[i,Zt,X,Ve.yy,de[1],I,s].concat(o1)),typeof pt<"u")return pt;if(xe)C=C.slice(0,-1*xe*2),I=I.slice(0,-1*xe),s=s.slice(0,-1*xe);C.push(this.productions_[de[1]][0]),I.push(Xe.$),s.push(Xe._$),i1=Le[C[C.length-2]][C[C.length-1]],C.push(i1);break;case 3:return!0}}return!0},"parse")},n1=function(){var Be={EOF:1,parseError:t(function(k,C){if(this.yy.parser)this.yy.parser.parseError(k,C);else throw Error(k)},"parseError"),setInput:t(function(p,k){if(this.yy=k||this.yy||{},this._input=p,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];return this.offset=0,this},"setInput"),input:t(function(){var p=this._input[0];this.yytext+=p,this.yyleng++,this.offset++,this.match+=p,this.matched+=p;var k=p.match(/(?:\r\n?|\n).*/g);if(k)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),p},"input"),unput:t(function(p){var k=p.length,C=p.split(/(?:\r\n?|\n)/g);this._input=p+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-k),this.offset-=k;var u=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),C.length-1)this.yylineno-=C.length-1;var I=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:C?(C.length===u.length?this.yylloc.first_column:0)+u[u.length-C.length].length-C[0].length:this.yylloc.first_column-k},this.options.ranges)this.yylloc.range=[I[0],I[0]+this.yyleng-k];return this.yyleng=this.yytext.length,this},"unput"),more:t(function(){return this._more=!0,this},"more"),reject:t(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).
|
|
12
12
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:t(function(p){this.unput(this.match.slice(p))},"less"),pastInput:t(function(){var p=this.matched.substr(0,this.matched.length-this.match.length);return(p.length>20?"...":"")+p.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:t(function(){var p=this.match;if(p.length<20)p+=this._input.substr(0,20-p.length);return(p.substr(0,20)+(p.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:t(function(){var p=this.pastInput(),k=Array(p.length+1).join("-");return p+this.upcomingInput()+`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n,o,K,i,ie,e,s,_e}from"./index-
|
|
2
|
-
export{Wa,Ka,
|
|
1
|
+
import{n,o,K,i,ie,e,s,_e}from"./index-8w69r0c4.js";var _={name:"zoom-in",size:24,node:[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]},Wa=s(_);var M={name:"zoom-out",size:24,node:[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]},Ka=s(M);function O({widths:r,pinned:a,available:c}){if(!(c>0)||r.length===0)return r.map(()=>!0);if(r.reduce((d,u)=>d+u,0)+4*(r.length-1)<=c)return r.map(()=>!0);let m=r.map(()=>!1),v=0,f=0;r.forEach((d,u)=>{if(!a[u])return;v+=d+(f>0?4:0),f+=1,m[u]=!0});let t=c-v-30-4;return r.forEach((d,u)=>{if(a[u])return;let x=d+(f>0?4:0);if(x>t)return;t-=x,f+=1,m[u]=!0}),m}function R(r){return r.some((a)=>!a)}function ai({clusters:r,className:a="",available:c}){let b=i(null),[m,v]=n(null),[f,t]=n(0),[d,u]=n(0),x=c??f,y=r.map((l)=>`${l.id}:${l.pinned?1:0}`).join("|"),h=m?.signature===y,g=h?m.widths:[],k=r.map((l)=>l.pinned===!0),w=c===0?r.map(()=>!1):g.length>0?O({widths:g,pinned:k,available:x}):r.map(()=>!0);K(()=>{let l=b.current;if(!l)return;if(!h){let p=[...l.querySelectorAll("[data-toolbar-cluster]")];if(p.length===r.length){let T=p.map((E)=>E.getBoundingClientRect().width);if(T.some((E)=>E>0))v({signature:y,widths:T})}}if(c===void 0)t(l.clientWidth)},[c,h,y,r.length,d]),o(()=>{let l=b.current;if(!l||typeof ResizeObserver>"u")return;let p=new ResizeObserver(()=>{t(l.clientWidth),u((T)=>T+1)});return p.observe(l),()=>p.disconnect()},[]);let L=r.filter((l,p)=>!w[p]).flatMap((l)=>l.actions);return e("div",{ref:b,style:c===void 0?void 0:{maxWidth:`${c}px`},className:`flex ${c===void 0?"flex-1":"flex-none"} min-w-0 flex-nowrap items-center justify-end gap-x-1 overflow-hidden ${a}`,children:[r.map((l,p)=>w[p]?e("div",{"data-toolbar-cluster":"",className:"flex items-center flex-shrink-0",children:l.children},l.id):null),R(w)&&e(A,{actions:L})]})}function A({actions:r}){let[a,c]=n(!1),[b,m]=n(null),v=i(null),f=i(null);return o(()=>{if(!a)return;let t=(d)=>{let u=d.target;if(v.current?.contains(u)||f.current?.contains(u))return;c(!1)};return document.addEventListener("mousedown",t),document.addEventListener("touchstart",t),()=>{document.removeEventListener("mousedown",t),document.removeEventListener("touchstart",t)}},[a]),o(()=>{if(!a)return;let t=(d)=>{if(d.key==="Escape")c(!1)};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[a]),K(()=>{if(!a)return;let t=v.current?.firstElementChild,d=f.current;if(!t||!d)return;let u=t.getBoundingClientRect(),{width:x,height:y}=d.getBoundingClientRect(),h=8,g=u.bottom+4,k=g+y+h<=window.innerHeight?g:Math.max(h,u.top-y-4),w=Math.max(h,Math.min(u.right-x,window.innerWidth-x-h));m({top:k,left:w})},[a,r.length]),e("div",{className:"relative flex-shrink-0",ref:v,children:[e("button",{type:"button",title:"More actions","aria-label":"More actions","aria-haspopup":"menu","aria-expanded":a,onClick:()=>{m(null),c(!a)},className:`flex items-center justify-center p-1.5 rounded transition-colors cursor-pointer ${a?"bg-ink/10 text-ink":"text-ink/50 hover:text-ink hover:bg-ink/5"}`,children:e(_e,{size:14})}),a&&ie(e("div",{ref:f,role:"menu",style:{top:b?.top??0,left:b?.left??0,visibility:b?"visible":"hidden"},className:"glass-popover fixed z-[80] w-52 bg-paper border border-ink/15 rounded-lg shadow-lg py-1 text-xs",children:r.map((t)=>e("button",{type:"button",role:"menuitem",disabled:t.disabled,"aria-pressed":t.active,onClick:()=>{c(!1),t.onSelect()},className:`w-full text-left flex items-center gap-2 px-3 py-1.5 transition-colors disabled:cursor-default disabled:opacity-40 ${t.active?"bg-ink/5 text-ink font-medium":"text-ink/75 hover:bg-ink/5 hover:text-ink"}`,children:[e(t.icon,{size:13,className:"flex-shrink-0"}),e("span",{className:"truncate",children:t.label})]},t.label))}),document.body)]})}
|
|
2
|
+
export{Wa,Ka,ai};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n,o,i,a,e,s,re,Cn,p,I,yr,Xe,Ue,Ke,Fr,er,la,
|
|
1
|
+
import{n,o,i,a,e,s,re,Cn,p,I,yr,Xe,Ue,Ke,Fr,er,la,ls,h,He,T,Rc}from"./index-8w69r0c4.js";import{rd}from"./index-79qddnbx.js";import"./index-pd4s49n5.js";var te={name:"mouse-pointer-click",size:24,node:[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]]},U=s(te);var ne={name:"move-vertical",size:24,node:[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"m8 18 4 4 4-4",key:"bh5tu3"}],["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}]]},D=s(ne);var oe={live:"Live","agent-offline":"Agent offline","browser-offline":"Browser offline","no-tab":"Tanpa tab"};function j({url:t,status:r,zoomLevel:d=100,onIncludeInChat:c,onReconnect:l,onOpenExternal:u,onZoomIn:m,onZoomOut:b,onResetZoom:k}){return e(rd,{url:t??"",statusDotClass:r==="live"?"bg-success animate-pulse":"bg-ink/25",statusLabel:oe[r],zoomLevel:d,onZoomIn:m,onZoomOut:b,onResetZoom:k,onIncludeInChat:c,onOpenExternal:u,onReconnect:l,openExternalLabel:"Buka di jendela baru",openExternalTitle:t?"Open in new window":"No URL loaded",children:e("div",{className:"flex-1 min-w-0 flex items-center bg-canvas border border-ink/15 rounded-md px-2 py-0.5",children:[e(Ue,{size:12,className:"text-ink/40 mr-1.5 flex-shrink-0"}),e("span",{className:"w-full truncate text-ink/80 font-mono text-[11px]",title:t??"",children:t||"No page open yet"})]})})}var se=[["RAM","~93 MB → ~259 MB untuk satu tab"],["Disk","~346 MB untuk Chrome for Testing bila belum terpasang"],["Idle","Tab Chromium terus melukis; omp membekukannya saat turn selesai"],["Deteksi","Halaman bisa melihat otomasi (navigator.webdriver, CDP)"]];function Z({saving:t,onUseChromium:r}){return e("button",{type:"button",onClick:r,disabled:t,className:"inline-flex items-center gap-1.5 rounded-md border border-ink/15 bg-ink/5 px-2.5 py-1 text-[11px] font-medium text-ink transition-colors hover:bg-ink/10 disabled:cursor-not-allowed disabled:opacity-60",children:[t&&e(p,{size:11,className:"animate-spin"}),t?"Mengaktifkan…":"Pakai Chromium"]})}function _({saving:t,error:r,onUseChromium:d,variant:c}){if(c==="strip")return e("div",{className:"flex items-center justify-between gap-2 border-b border-ink/10 bg-ink/[0.03] px-2.5 py-1.5 flex-shrink-0",children:[e("span",{className:"min-w-0 truncate text-[11px] text-ink/70",children:"Agen memakai WebKit — tab baru tidak akan muncul di panel ini."}),e(Z,{saving:t,onUseChromium:d})]});return e("div",{className:"flex-1 flex flex-col items-center justify-center overflow-y-auto p-6 text-center select-none my-auto",children:[e("div",{className:"w-12 h-12 rounded-xl bg-ink/5 border border-ink/10 flex items-center justify-center text-ink/40 mb-3",children:e(I,{size:24})}),e("h3",{className:"text-sm font-semibold text-ink mb-1",children:"Agen memakai WebKit — panel ini tidak bisa memantulkannya"}),e("p",{className:"text-xs text-ink/60 max-w-sm",children:"WebKit milik omp tidak punya CDP dan tidak mengekspos aliran frame, jadi tab yang dijalankannya tidak bisa ditampilkan di sini. Panel ini hanya bisa memantulkan Chromium."}),e("div",{className:"mt-4 w-full max-w-sm rounded-lg border border-ink/10 bg-paper text-left",children:[e("div",{className:"border-b border-ink/10 px-3 py-1.5 text-[10px] uppercase tracking-wider text-ink/50",children:"Biaya pindah ke Chromium"}),e("dl",{className:"divide-y divide-ink/5",children:se.map(([l,u])=>e("div",{className:"flex gap-2 px-3 py-1.5",children:[e("dt",{className:"w-14 flex-shrink-0 text-[11px] font-medium text-ink/70",children:l}),e("dd",{className:"text-[11px] text-ink/60",children:u})]},l))})]}),e("div",{className:"mt-3 flex flex-col items-center gap-1.5",children:[e(Z,{saving:t,onUseChromium:d}),e("p",{className:"text-[10.5px] text-ink/45 max-w-sm",children:"Berlaku untuk tab yang dibuka berikutnya; sesi tidak perlu di-restart. Tab WebKit yang sudah terbuka tetap tidak terlihat."}),r&&e("p",{role:"alert",className:"text-[11px] text-error max-w-sm",children:r})]})]})}var ae={open:Ue,navigate:Ue,loaded:re,click:U,type:la,press:Xe,submit:er,wait:Ke,screenshot:yr,scroll:D,upload:ls,close:Cn,error:Cn};function F({actions:t}){if(t.length===0)return null;return e("div",{className:"absolute bottom-3 left-3 z-20 flex flex-col gap-1.5 pointer-events-none max-w-[320px]",children:t.map((r)=>{let d=ae[r.kind],c=r.kind==="error";return e("div",{className:`flex items-center gap-2 rounded-md border px-2.5 py-1.5 text-[11px] shadow-sm backdrop-blur-sm ${c?"border-error/30 bg-error/10 text-error":"border-ink/15 bg-paper/95 text-ink"}`,children:[e(d,{size:12,className:`flex-shrink-0 ${c?"text-error":"text-ink/60"}`}),e("span",{className:"truncate",children:r.label})]},r.id)})})}function ie(t){return t.title||t.url||t.targetId}function H({tabs:t,targetId:r,closing:d,onSelectTarget:c,onCloseTarget:l}){let u=i(null);return o(()=>{u.current?.scrollIntoView({block:"nearest",inline:"nearest"})},[r,t.length]),e("div",{className:"px-2 py-1 border-b border-ink/10 bg-paper flex items-center gap-1 overflow-x-auto flex-shrink-0",children:t.map((m)=>{let b=m.targetId===r,k=ie(m);return e("div",{ref:b?u:void 0,className:`group flex items-center rounded border transition-colors flex-shrink-0 ${b?"bg-ink text-canvas border-ink":"bg-paper text-ink/70 border-ink/15 hover:border-ink/35 hover:text-ink"}`,children:[e("button",{type:"button",onClick:()=>c(b?"":m.targetId),className:"pl-2 pr-1 py-0.5 text-[11px] font-mono max-w-[220px] truncate cursor-pointer",title:`${k}
|
|
2
2
|
${m.url}`,"aria-pressed":b,children:k}),e("button",{type:"button",onClick:()=>l(m.targetId),disabled:d===m.targetId,className:`mr-0.5 p-1 rounded hover:bg-error hover:text-paper transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed ${b?"text-on-ink-muted":"text-ink/40 opacity-0 group-hover:opacity-100 focus-visible:opacity-100"}`,"aria-label":`Tutup tab ${k}`,title:`Tutup tab ${k}`,children:e(h,{size:11})})]},m.targetId)})})}function le(t){let r=atob(t),d=new Uint8Array(r.length);for(let c=0;c<r.length;c++)d[c]=r.charCodeAt(c);return d}function ce(t,r){return new Blob([le(t)],{type:r})}async function K(t,r,d){let c=t.getContext("2d");if(!c)return!1;if(typeof createImageBitmap!=="function")return!1;let l;try{l=await createImageBitmap(ce(r,d))}catch{return!1}try{if(t.width!==l.width||t.height!==l.height)t.width=l.width,t.height=l.height;return c.drawImage(l,0,0),!0}finally{l.close()}}var ue={"agent-offline":{title:"The agent is not running",body:"Start this session so the agent can drive the browser."},"browser-offline":{title:"No browser is open",body:"Ask the agent to open a page; the live view appears here."},"no-tab":{title:"Browser is open, with no tab yet",body:"This session has not opened a tab in the shared browser."}};function J({status:t,url:r,tabs:d,targetId:c,frame:l,actions:u,onSelectTarget:m,onCloseTarget:b,closingTarget:k,zoomLevel:N}){let B=t==="live",R=B?null:ue[t],g=i(null),[f,w]=n(!1);return o(()=>{let A=g.current;if(!A||!l)return;let y=!1;return K(A,l.data,l.mimeType).then((S)=>{if(S&&!y)w(!0)}),()=>{y=!0}},[l]),o(()=>{if(!B)w(!1)},[B]),e("div",{className:"flex-1 flex flex-col min-h-0 bg-canvas/60 relative overflow-hidden",children:[e(F,{actions:u}),B&&d.length>0&&e(H,{tabs:d,targetId:c,closing:k,onSelectTarget:m,onCloseTarget:b}),e("div",{className:"flex-1 flex items-center justify-center p-2 min-h-0 overflow-auto",children:B?e("div",{className:"relative flex flex-col bg-paper w-full h-full transition-all duration-200",style:{zoom:N!==100?`${N}%`:void 0,transformOrigin:"top center"},children:[e("canvas",{ref:g,"aria-label":r||"Live browser view",className:`w-full h-full object-contain bg-paper ${f?"":"hidden"}`}),!f&&e("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-center p-6 select-none",children:[e(p,{size:20,className:"animate-spin text-ink/40 mb-2"}),e("p",{className:"text-xs text-ink/60",children:"Menunggu frame pertama dari browser…"})]})]}):e("div",{className:"flex-1 flex flex-col items-center justify-center p-6 text-center select-none my-auto",children:[e("div",{className:"w-12 h-12 rounded-xl bg-ink/5 border border-ink/10 flex items-center justify-center text-ink/40 mb-3",children:t==="agent-offline"?e(Fr,{size:24}):e(Ue,{size:24})}),e("h3",{className:"text-sm font-semibold text-ink mb-1",children:R?.title}),e("p",{className:"text-xs text-ink/60 max-w-sm",children:R?.body})]})})]})}function W(t){if(typeof t!=="object"||t===null||!("error"in t))return null;return typeof t.error==="string"?t.error:null}function X(){let[t,r]=n(null),[d,c]=n(!0),[l,u]=n(!1),[m,b]=n(null),[k,N]=n(0);o(()=>{let g=!1;return c(!0),fetch("/api/browser/engine").then((f)=>f.json()).then((f)=>{if(g)return;let w=W(f);if(w){b(w);return}r(f),b(null)}).catch((f)=>{if(!g)b(f instanceof Error?f.message:String(f))}).finally(()=>{if(!g)c(!1)}),()=>{g=!0}},[k]);let B=a(()=>N((g)=>g+1),[]),R=a(async()=>{u(!0),b(null);try{let g=await fetch("/api/browser/engine",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({webkit:!1})}),f=await g.json().catch(()=>null),w=W(f)??(g.ok?null:`The write answered ${g.status}`);if(w)return b(w),!1;return r(f),!0}catch(g){return b(g instanceof Error?g.message:String(g)),!1}finally{u(!1)}},[]);return{state:t,loading:d,saving:l,error:m,refresh:B,useChromium:R}}var G={status:"agent-offline",tabs:[]},Y=5000,de=4000,me=500,pe=3,q=16;function Q(t=!0){let{sessionId:r,ready:d}=He(),[c,l]=n(G),[u,m]=n(null),[b,k]=n([]),[N,B]=n(""),[R,g]=n(0),f=i(null),w=i(null),A=i(void 0),y=i(0),S=i([]),O=a((E)=>{B(E.trim())},[]),V=a(()=>{g((E)=>E+1)},[]);return o(()=>{let E=setInterval(()=>{k((L)=>{let M=Date.now(),P=L.filter((x)=>x.expiresAt>M),C=S.current.shift();if(!C)return P.length===L.length?L:P;return[...P.slice(-(pe-1)),{...C,expiresAt:M+de}]})},me);return()=>clearInterval(E)},[]),o(()=>{l(G),m(null),B(""),S.current=[],k([])},[r]),o(()=>{if(!d||!r||!t)return;let E=!1,L=()=>{if(E)return;let P=N?`?target=${encodeURIComponent(N)}`:"",C=new EventSource(`/api/browser/${encodeURIComponent(r)}/stream${P}`);f.current=C,C.addEventListener("open",()=>{y.current=0}),C.addEventListener("state",(x)=>{try{let v=JSON.parse(x.data);if(A.current=v.targetId,l(v),v.status!=="live")m(null)}catch{}}),C.addEventListener("frame",(x)=>{try{let v=JSON.parse(x.data),z=A.current;if(z&&v.targetId&&v.targetId!==z)return;if(!z&&v.targetId)A.current=v.targetId;m({data:v.data,mimeType:v.mimeType})}catch{}}),C.addEventListener("action",(x)=>{try{let v=JSON.parse(x.data);if(typeof v?.label!=="string"||!v.label)return;if(S.current.push(v),S.current.length>q)S.current.splice(0,S.current.length-q)}catch{}}),C.addEventListener("error",()=>{if(C.readyState===EventSource.CLOSED)M()})},M=()=>{if(E||w.current)return;let P=Math.min(y.current+1,Y/1000);y.current=P,w.current=setTimeout(()=>{w.current=null,f.current?.close(),f.current=null,L()},Math.min(P*1000,Y))};return L(),()=>{if(E=!0,w.current)clearTimeout(w.current),w.current=null;f.current?.close(),f.current=null}},[d,r,N,R,t]),{status:c.status,url:c.url,title:c.title,tabs:c.tabs,targetId:c.targetId,frame:u,actions:b,sessionId:r,selectTarget:O,reconnect:V}}function fe(t){return typeof t==="string"&&t?t:null}function ee(t){let[r,d]=n(null);return{closeTab:a(async(l)=>{if(!t||!l)return{ok:!1,next:null,error:"No tab to close"};d(l);try{let u=await fetch(`/api/browser/${encodeURIComponent(t)}/tabs/close`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({targetId:l})}),m=await u.json().catch(()=>({}));if(!u.ok)return{ok:!1,next:null,error:typeof m.error==="string"&&m.error?m.error:`Close failed (${u.status})`};return{ok:!0,next:fe(m.next)}}catch(u){return{ok:!1,next:null,error:u instanceof Error?u.message:String(u)}}finally{d(null)}},[t]),closing:r}}function it({className:t="",active:r=!0}){let[d,c]=T("browser.zoomLevel",100),{status:l,url:u,title:m,tabs:b,targetId:k,frame:N,actions:B,sessionId:R,selectTarget:g,reconnect:f}=Q(r),{closeTab:w,closing:A}=ee(R),y=X(),[S,O]=n(null),V=y.state?.effective==="webkit"&&!y.state.mock,E=V&&(l==="browser-offline"||l==="no-tab"),L=a(()=>{y.useChromium().then((x)=>{if(x)f()})},[y.useChromium,f]),M=()=>{if(!u)return;let x=u.startsWith("/")&&typeof window<"u"?`${window.location.origin}${u}`:u;window.open(x,"_blank","noopener,noreferrer")},P=a(()=>{if(!u)return;Rc({url:u,title:m})},[u,m]),C=a((x)=>{if(A===x)return;w(x).then((v)=>{if(!v.ok){O(v.error??"The tab could not be closed");return}O(null),g(v.next??"")})},[w,A,g]);return e("div",{className:`flex flex-col h-full w-full bg-paper text-ink overflow-hidden select-none ${t}`,children:[e(j,{url:u,status:l,zoomLevel:d,onIncludeInChat:P,onReconnect:f,onOpenExternal:M,onZoomIn:()=>c((x)=>Math.min(200,x+10)),onZoomOut:()=>c((x)=>Math.max(50,x-10)),onResetZoom:()=>c(100)}),S&&e("div",{role:"alert",className:"px-2.5 py-1 border-b border-error/30 bg-error/5 text-[11px] text-error flex items-center justify-between gap-2 flex-shrink-0",children:[e("span",{className:"truncate",title:S,children:S}),e("button",{type:"button",onClick:()=>O(null),className:"text-[10px] uppercase tracking-wide text-error/80 hover:text-error cursor-pointer flex-shrink-0",children:"Tutup"})]}),V&&l==="live"&&y.state&&e(_,{saving:y.saving,error:y.error,onUseChromium:L,variant:"strip"}),E&&y.state?e(_,{saving:y.saving,error:y.error,onUseChromium:L,variant:"body"}):e(J,{status:l,url:u,tabs:b,targetId:k,frame:N,actions:B,onSelectTarget:g,onCloseTarget:C,closingTarget:A,zoomLevel:d})]})}export{it as BrowserPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{zn,Ao,fp,Pi,ri,Xs,Ku,el,dg,Vu,gp,Ap,hp,bp,NA,tl,Yu,QA,Ju,Er,RA}from"./index-6775m1pa.js";import"./index-4kchzh9y.js";export{el as IndentContext,RA as StreamLanguage,Ju as bracketMatching,tl as codeFolding,hp as foldAll,gp as foldCode,Yu as foldGutter,NA as foldKeymap,Vu as foldService,ri as getIndentUnit,Ku as getIndentation,QA as highlightingFor,dg as indentOnInput,fp as indentService,Xs as indentString,Pi as indentUnit,Ao as language,Er as matchBrackets,zn as syntaxTree,bp as unfoldAll,Ap as unfoldCode};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Wg}from"./index-0prwdwyb.js";var e=Object.freeze(JSON.parse('{"displayName":"XML","name":"xml","patterns":[{"begin":"(<\\\\?)\\\\s*([-0-9A-Z_a-z]+)","captures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"entity.name.tag.xml"}},"end":"(\\\\?>)","name":"meta.tag.preprocessor.xml","patterns":[{"match":" ([-A-Za-z]+)","name":"entity.other.attribute-name.xml"},{"include":"#doublequotedString"},{"include":"#singlequotedString"}]},{"begin":"(<!)(DOCTYPE)\\\\s+([:A-Z_a-z][-.0-:A-Z_a-z]*)","captures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"keyword.other.doctype.xml"},"3":{"name":"variable.language.documentroot.xml"}},"end":"\\\\s*(>)","name":"meta.tag.sgml.doctype.xml","patterns":[{"include":"#internalSubset"}]},{"include":"#comments"},{"begin":"(<)((?:([-0-9A-Z_a-z]+)(:))?([-0-:A-Z_a-z]+))(?=(\\\\s[^>]*)?></\\\\2>)","beginCaptures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"entity.name.tag.xml"},"3":{"name":"entity.name.tag.namespace.xml"},"4":{"name":"punctuation.separator.namespace.xml"},"5":{"name":"entity.name.tag.localname.xml"}},"end":"(>)(</)((?:([-0-9A-Z_a-z]+)(:))?([-0-:A-Z_a-z]+))(>)","endCaptures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"punctuation.definition.tag.xml"},"3":{"name":"entity.name.tag.xml"},"4":{"name":"entity.name.tag.namespace.xml"},"5":{"name":"punctuation.separator.namespace.xml"},"6":{"name":"entity.name.tag.localname.xml"},"7":{"name":"punctuation.definition.tag.xml"}},"name":"meta.tag.no-content.xml","patterns":[{"include":"#tagStuff"}]},{"begin":"(</?)(?:([-.\\\\w]+)((:)))?([-.:\\\\w]+)","captures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"entity.name.tag.namespace.xml"},"3":{"name":"entity.name.tag.xml"},"4":{"name":"punctuation.separator.namespace.xml"},"5":{"name":"entity.name.tag.localname.xml"}},"end":"(/?>)","name":"meta.tag.xml","patterns":[{"include":"#tagStuff"}]},{"include":"#entity"},{"include":"#bare-ampersand"},{"begin":"<%@","beginCaptures":{"0":{"name":"punctuation.section.embedded.begin.xml"}},"end":"%>","endCaptures":{"0":{"name":"punctuation.section.embedded.end.xml"}},"name":"source.java-props.embedded.xml","patterns":[{"match":"page|include|taglib","name":"keyword.other.page-props.xml"}]},{"begin":"<%[!=]?(?!--)","beginCaptures":{"0":{"name":"punctuation.section.embedded.begin.xml"}},"end":"(?!--)%>","endCaptures":{"0":{"name":"punctuation.section.embedded.end.xml"}},"name":"source.java.embedded.xml","patterns":[{"include":"source.java"}]},{"begin":"<!\\\\[CDATA\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.xml"}},"end":"]]>","endCaptures":{"0":{"name":"punctuation.definition.string.end.xml"}},"name":"string.unquoted.cdata.xml"}],"repository":{"EntityDecl":{"begin":"(<!)(ENTITY)\\\\s+(%\\\\s+)?([:A-Z_a-z][-.0-:A-Z_a-z]*)(\\\\s+(?:SYSTEM|PUBLIC)\\\\s+)?","captures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"keyword.other.entity.xml"},"3":{"name":"punctuation.definition.entity.xml"},"4":{"name":"variable.language.entity.xml"},"5":{"name":"keyword.other.entitytype.xml"}},"end":"(>)","patterns":[{"include":"#doublequotedString"},{"include":"#singlequotedString"}]},"bare-ampersand":{"match":"&","name":"invalid.illegal.bad-ampersand.xml"},"comments":{"patterns":[{"begin":"<%--","captures":{"0":{"name":"punctuation.definition.comment.xml"},"end":"--%>","name":"comment.block.xml"}},{"begin":"<!--","captures":{"0":{"name":"punctuation.definition.comment.xml"}},"end":"-->","name":"comment.block.xml","patterns":[{"begin":"--(?!>)","captures":{"0":{"name":"invalid.illegal.bad-comments-or-CDATA.xml"}}}]}]},"doublequotedString":{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.xml"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.xml"}},"name":"string.quoted.double.xml","patterns":[{"include":"#entity"},{"include":"#bare-ampersand"}]},"entity":{"captures":{"1":{"name":"punctuation.definition.constant.xml"},"3":{"name":"punctuation.definition.constant.xml"}},"match":"(&)([:A-Z_a-z][-.0-:A-Z_a-z]*|#[0-9]+|#x\\\\h+)(;)","name":"constant.character.entity.xml"},"internalSubset":{"begin":"(\\\\[)","captures":{"1":{"name":"punctuation.definition.constant.xml"}},"end":"(])","name":"meta.internalsubset.xml","patterns":[{"include":"#EntityDecl"},{"include":"#parameterEntity"},{"include":"#comments"}]},"parameterEntity":{"captures":{"1":{"name":"punctuation.definition.constant.xml"},"3":{"name":"punctuation.definition.constant.xml"}},"match":"(%)([:A-Z_a-z][-.0-:A-Z_a-z]*)(;)","name":"constant.character.parameter-entity.xml"},"singlequotedString":{"begin":"\'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.xml"}},"end":"\'","endCaptures":{"0":{"name":"punctuation.definition.string.end.xml"}},"name":"string.quoted.single.xml","patterns":[{"include":"#entity"},{"include":"#bare-ampersand"}]},"tagStuff":{"patterns":[{"captures":{"1":{"name":"entity.other.attribute-name.namespace.xml"},"2":{"name":"entity.other.attribute-name.xml"},"3":{"name":"punctuation.separator.namespace.xml"},"4":{"name":"entity.other.attribute-name.localname.xml"}},"match":"(?:^|\\\\s+)(?:([-.\\\\w]+)((:)))?([-.:\\\\w]+)\\\\s*="},{"include":"#doublequotedString"},{"include":"#singlequotedString"}]}},"scopeName":"text.xml","embeddedLangs":["java"]}')),
|
|
2
|
-
export{
|
|
1
|
+
import{Wg}from"./index-0prwdwyb.js";var e=Object.freeze(JSON.parse('{"displayName":"XML","name":"xml","patterns":[{"begin":"(<\\\\?)\\\\s*([-0-9A-Z_a-z]+)","captures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"entity.name.tag.xml"}},"end":"(\\\\?>)","name":"meta.tag.preprocessor.xml","patterns":[{"match":" ([-A-Za-z]+)","name":"entity.other.attribute-name.xml"},{"include":"#doublequotedString"},{"include":"#singlequotedString"}]},{"begin":"(<!)(DOCTYPE)\\\\s+([:A-Z_a-z][-.0-:A-Z_a-z]*)","captures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"keyword.other.doctype.xml"},"3":{"name":"variable.language.documentroot.xml"}},"end":"\\\\s*(>)","name":"meta.tag.sgml.doctype.xml","patterns":[{"include":"#internalSubset"}]},{"include":"#comments"},{"begin":"(<)((?:([-0-9A-Z_a-z]+)(:))?([-0-:A-Z_a-z]+))(?=(\\\\s[^>]*)?></\\\\2>)","beginCaptures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"entity.name.tag.xml"},"3":{"name":"entity.name.tag.namespace.xml"},"4":{"name":"punctuation.separator.namespace.xml"},"5":{"name":"entity.name.tag.localname.xml"}},"end":"(>)(</)((?:([-0-9A-Z_a-z]+)(:))?([-0-:A-Z_a-z]+))(>)","endCaptures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"punctuation.definition.tag.xml"},"3":{"name":"entity.name.tag.xml"},"4":{"name":"entity.name.tag.namespace.xml"},"5":{"name":"punctuation.separator.namespace.xml"},"6":{"name":"entity.name.tag.localname.xml"},"7":{"name":"punctuation.definition.tag.xml"}},"name":"meta.tag.no-content.xml","patterns":[{"include":"#tagStuff"}]},{"begin":"(</?)(?:([-.\\\\w]+)((:)))?([-.:\\\\w]+)","captures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"entity.name.tag.namespace.xml"},"3":{"name":"entity.name.tag.xml"},"4":{"name":"punctuation.separator.namespace.xml"},"5":{"name":"entity.name.tag.localname.xml"}},"end":"(/?>)","name":"meta.tag.xml","patterns":[{"include":"#tagStuff"}]},{"include":"#entity"},{"include":"#bare-ampersand"},{"begin":"<%@","beginCaptures":{"0":{"name":"punctuation.section.embedded.begin.xml"}},"end":"%>","endCaptures":{"0":{"name":"punctuation.section.embedded.end.xml"}},"name":"source.java-props.embedded.xml","patterns":[{"match":"page|include|taglib","name":"keyword.other.page-props.xml"}]},{"begin":"<%[!=]?(?!--)","beginCaptures":{"0":{"name":"punctuation.section.embedded.begin.xml"}},"end":"(?!--)%>","endCaptures":{"0":{"name":"punctuation.section.embedded.end.xml"}},"name":"source.java.embedded.xml","patterns":[{"include":"source.java"}]},{"begin":"<!\\\\[CDATA\\\\[","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.xml"}},"end":"]]>","endCaptures":{"0":{"name":"punctuation.definition.string.end.xml"}},"name":"string.unquoted.cdata.xml"}],"repository":{"EntityDecl":{"begin":"(<!)(ENTITY)\\\\s+(%\\\\s+)?([:A-Z_a-z][-.0-:A-Z_a-z]*)(\\\\s+(?:SYSTEM|PUBLIC)\\\\s+)?","captures":{"1":{"name":"punctuation.definition.tag.xml"},"2":{"name":"keyword.other.entity.xml"},"3":{"name":"punctuation.definition.entity.xml"},"4":{"name":"variable.language.entity.xml"},"5":{"name":"keyword.other.entitytype.xml"}},"end":"(>)","patterns":[{"include":"#doublequotedString"},{"include":"#singlequotedString"}]},"bare-ampersand":{"match":"&","name":"invalid.illegal.bad-ampersand.xml"},"comments":{"patterns":[{"begin":"<%--","captures":{"0":{"name":"punctuation.definition.comment.xml"},"end":"--%>","name":"comment.block.xml"}},{"begin":"<!--","captures":{"0":{"name":"punctuation.definition.comment.xml"}},"end":"-->","name":"comment.block.xml","patterns":[{"begin":"--(?!>)","captures":{"0":{"name":"invalid.illegal.bad-comments-or-CDATA.xml"}}}]}]},"doublequotedString":{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.xml"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.xml"}},"name":"string.quoted.double.xml","patterns":[{"include":"#entity"},{"include":"#bare-ampersand"}]},"entity":{"captures":{"1":{"name":"punctuation.definition.constant.xml"},"3":{"name":"punctuation.definition.constant.xml"}},"match":"(&)([:A-Z_a-z][-.0-:A-Z_a-z]*|#[0-9]+|#x\\\\h+)(;)","name":"constant.character.entity.xml"},"internalSubset":{"begin":"(\\\\[)","captures":{"1":{"name":"punctuation.definition.constant.xml"}},"end":"(])","name":"meta.internalsubset.xml","patterns":[{"include":"#EntityDecl"},{"include":"#parameterEntity"},{"include":"#comments"}]},"parameterEntity":{"captures":{"1":{"name":"punctuation.definition.constant.xml"},"3":{"name":"punctuation.definition.constant.xml"}},"match":"(%)([:A-Z_a-z][-.0-:A-Z_a-z]*)(;)","name":"constant.character.parameter-entity.xml"},"singlequotedString":{"begin":"\'","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.xml"}},"end":"\'","endCaptures":{"0":{"name":"punctuation.definition.string.end.xml"}},"name":"string.quoted.single.xml","patterns":[{"include":"#entity"},{"include":"#bare-ampersand"}]},"tagStuff":{"patterns":[{"captures":{"1":{"name":"entity.other.attribute-name.namespace.xml"},"2":{"name":"entity.other.attribute-name.xml"},"3":{"name":"punctuation.separator.namespace.xml"},"4":{"name":"entity.other.attribute-name.localname.xml"}},"match":"(?:^|\\\\s+)(?:([-.\\\\w]+)((:)))?([-.:\\\\w]+)\\\\s*="},{"include":"#doublequotedString"},{"include":"#singlequotedString"}]}},"scopeName":"text.xml","embeddedLangs":["java"]}')),mi=[...Wg,e];
|
|
2
|
+
export{mi};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n,o,K,i,a,ze,Me,Se,ie,e,s,p,I,E,Xe,yi,ir,h,sr,He,we,T,tt,Ci,he,X,mt,$o,Go,N0,H0,Of,Zo,Qi,eg,hA}from"./index-dzp9rwy0.js";import"./index-me7ag6sy.js";import{Fi}from"./index-1w92sjkm.js";import"./index-7ag37ghj.js";import{wA,xu,Ms,wu,Cu,Eu,Bu,Iu,_u,Su,Tu,Du}from"./index-hqc2cazc.js";var vt={name:"panel-right-close",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]},be=s(vt);var z=new Set,ae=new Set,ge=new Set;function ve(){ge=new Set(z);for(let t of[...ae])t()}function xe(t){let r=new Set(t);if(r.size===z.size){let l=!0;for(let d of r)if(!z.has(d)){l=!1;break}if(l)return}z.clear();for(let l of r)z.add(l);ve()}function ye(t){let r=new Set(t),l=!1;for(let d of[...z])if(!r.has(d))z.delete(d),l=!0;if(l)ve()}function Ce(t){return z.has(t)}function ke(){return z.size>0}function ht(t){return ae.add(t),()=>{ae.delete(t)}}var xt=ht;function Ee(){return ze(xt,()=>ge)}function Te({x:t,y:r,rows:l,onAction:d,onClose:u}){let x=i(null),[m,c]=n({left:t,top:r});return K(()=>{let b=x.current;if(!b)return;let{width:k,height:g}=b.getBoundingClientRect();c({left:Math.min(t,Math.max(0,window.innerWidth-k-8)),top:Math.min(r,Math.max(0,window.innerHeight-g-8))})},[t,r,l.length]),ie(e("div",{className:"fixed inset-0 z-[70]",onClick:u,onContextMenu:(b)=>{b.preventDefault(),u()},children:e("div",{ref:x,role:"menu","aria-label":"Tab actions",className:"glass-popover absolute w-52 bg-paper border border-ink/15 rounded-md shadow-xl py-1 text-xs text-ink",style:{left:`${m.left}px`,top:`${m.top}px`},onClick:(b)=>b.stopPropagation(),children:l.map((b)=>e("button",{type:"button",role:"menuitem",onClick:()=>{d(b.action),u()},className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 transition-colors cursor-pointer",children:b.label},b.action))})}),document.body)}var ee={rightFileId:null,fraction:0.5};function ne(t,r,l){if(t===null)return!1;if(t===r)return!1;return l.includes(t)}function Ne(t,r){for(let l=r.length-1;l>=0;l-=1){let d=r[l];if(d!==t)return d}return null}function Pe(t,r){if(t.rightFileId===null)return t;if(t.rightFileId!==r)return t;return{...t,rightFileId:null}}function Y(t){if(!Number.isFinite(t))return ee.fraction;return Math.max(0.2,Math.min(0.8,t))}function De(t,r){if(typeof t!=="object"||t===null)return ee;let l=t,d=typeof l.fraction==="number"?Y(l.fraction):ee.fraction,u=typeof l.rightFileId==="string"||typeof l.rightFileId==="number"?l.rightFileId:null;if(u===null||!r.includes(u))return{rightFileId:null,fraction:d};return{rightFileId:u,fraction:d}}function Re({tab:t,openedFiles:r,dirtyIds:l,reopenable:d,activeFileId:u,splitRightFileId:x}){let m=r.filter((g)=>g.id!==t.id),c=r.filter((g)=>!l.has(g.id)),b=r.map((g)=>g.id);return[{action:"split-right",label:"Split right",enabled:ne(t.id,u,b)},{action:"unsplit",label:"Unsplit",enabled:x!==null},{action:"close",label:"Close",enabled:!0},{action:"close-others",label:"Close others",enabled:m.length>0},{action:"close-all",label:"Close all",enabled:r.length>0},{action:"close-saved",label:"Close saved",enabled:c.some((g)=>g.id!==t.id)},{action:"copy-path",label:"Copy path",enabled:Boolean(t.path)},{action:"reveal-in-files",label:"Reveal in Files",enabled:Boolean(t.path)&&!t.isDiff},{action:"reopen-closed",label:"Reopen closed tab",enabled:d>0}].filter((g)=>g.enabled)}function Z({onHide:t}){let r=Zo("toggleEditorPanel","Hide Editor Panel");return e("button",{type:"button",onClick:t,className:"p-1.5 mx-1 rounded transition-colors cursor-pointer text-ink/60 hover:bg-ink/10 hover:text-ink flex-shrink-0",title:r,"aria-label":r,children:e(be,{size:14})})}function Ie({openedFiles:t,activeFileId:r,onSelectFile:l,onCloseFile:d,missingIds:u,onCopyPath:x,onRevealInFiles:m,onReopenClosed:c,reopenableCount:b,onSplitTo:k,onUnsplit:g,splitRightFileId:y=null,onHide:R}){let M=Ee(),P=i(null),L=i(null),[D,O]=n(5),[A,F]=n(!1),[f,Q]=n(null);he(L,()=>F(!1)),o(()=>{let v=new ResizeObserver((w)=>{for(let S of w){let q=S.contentRect.width,H=Math.max(1,Math.floor((q-60)/150));O(H)}});if(P.current)v.observe(P.current);return()=>v.disconnect()},[]);let U=Ne(r,t.map((v)=>v.id)),j=[],G=[];if(t.length<=D)j=t;else{let v=t.findIndex((S)=>S.id===r),w=new Set;if(v!==-1&&r!==null)w.add(r);for(let S=t.length-1;S>=0;S--){if(w.size>=D)break;w.add(t[S].id)}j=t.filter((S)=>w.has(S.id)),G=t.filter((S)=>!w.has(S.id))}return e("div",{className:`${Ci.desktop} flex bg-ink/10 w-full relative border-b border-ink/10`,ref:P,children:[e("div",{className:"flex overflow-hidden",children:j.map((v)=>{let w=v.id===r,S=Boolean(v.isDiff),q=S?sr(v.diffStatus||"M",v.diffStaged):null,H=Boolean(u?.has(v.id));return e("div",{onClick:()=>l(v.id),onContextMenu:(_)=>{_.preventDefault(),Q({tab:v,x:_.clientX,y:_.clientY})},className:`flex items-center space-x-1.5 px-3 py-1.5 cursor-pointer border-r border-ink/10 min-w-[120px] max-w-[210px] group ${w?"bg-paper border-t-2 border-t-ink text-ink":"bg-transparent border-t-2 border-t-transparent text-ink/60 hover:bg-paper/50"}`,title:H?`${v.path} — file no longer exists`:v.path,children:[S?e(yi,{size:14,className:w?"text-info flex-shrink-0":"text-info/70 flex-shrink-0"}):e(mt,{name:v.name,size:14,className:`flex-shrink-0${w||H?"":" opacity-60"}${H?" text-error":""}`}),e("span",{className:`text-xs font-mono truncate flex-1${H?" text-error line-through":""}`,children:v.name}),q&&e("span",{className:`px-1 text-[10px] font-mono font-bold rounded ${q.badgeBgClass}`,children:q.charStatus}),e(Oe,{dirty:M.has(v.id),active:w,label:`Close ${v.name}`,onClose:()=>d(v.id)})]},v.id)})}),f?e(Te,{x:f.x,y:f.y,rows:Re({tab:f.tab,openedFiles:t,dirtyIds:M,reopenable:b?.()??0,activeFileId:r,splitRightFileId:y}),onAction:(v)=>{let w=f.tab;switch(v){case"close":d(w.id);return;case"close-others":for(let S of[...t].reverse())if(S.id!==w.id)d(S.id);l(w.id);return;case"close-all":for(let S of[...t].reverse())d(S.id);return;case"close-saved":for(let S of[...t].reverse())if(!M.has(S.id))d(S.id);return;case"copy-path":x?.(w);return;case"reveal-in-files":m?.(w);return;case"reopen-closed":c?.();return;case"split-right":k?.(w.id);return;case"unsplit":g?.();return}},onClose:()=>Q(null)}):null,e("div",{className:"ml-auto flex items-center",children:[e("button",{type:"button",onClick:()=>y!==null?g?.():k?.(U),disabled:y===null&&U===null,"aria-pressed":y!==null,"aria-label":"Split editor",title:y!==null?"Close the split pane (the tab stays open)":U===null?"Open another file to split the editor":"Split the editor and show the newest other file",className:`p-1.5 mx-1 rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-default ${y!==null?"bg-ink/10 text-ink":"text-ink/60 hover:bg-ink/10"}`,children:e(ir,{size:14})}),R&&e(Z,{onHide:R})]}),G.length>0&&e("div",{className:"relative flex items-center bg-ink/10",ref:L,children:[e("button",{className:`p-1.5 mx-1 rounded hover:bg-ink/10 text-ink/60 ${A?"bg-ink/10 text-ink":""}`,onClick:()=>F(!A),title:"More open files",children:e(E,{size:14})}),A&&e("div",{className:"glass-popover absolute right-0 top-full mt-1 w-52 bg-paper border border-ink/10 rounded shadow-lg z-50 py-1",children:[e("div",{className:"px-3 py-1 text-[10px] uppercase font-mono text-ink/40 border-b border-ink/10 mb-1",children:"Older Tabs"}),G.map((v)=>{let w=Boolean(u?.has(v.id));return e("div",{onClick:()=>{l(v.id),F(!1)},className:"flex items-center space-x-2 px-3 py-1.5 hover:bg-ink/5 cursor-pointer group",children:[v.isDiff?e(yi,{size:14,className:"text-info/80"}):e(mt,{name:v.name,size:14,className:w?"text-error":"opacity-60"}),e("span",{className:`text-xs font-mono truncate flex-1 ${w?"text-error line-through":"text-ink/80"}`,children:v.name}),e(Oe,{dirty:M.has(v.id),active:!1,label:`Close ${v.name}`,onClose:()=>{if(d(v.id),G.length===1)F(!1)}})]},v.id)})]})]})]})}function Oe({dirty:t,active:r,label:l,onClose:d}){return e("div",{role:"button",tabIndex:-1,"aria-label":l,title:t?`${l} — unsaved changes`:l,className:`p-0.5 rounded hover:bg-ink/10 touch-visible ${r||t?"opacity-100":"opacity-0 group-hover:opacity-100"}`,onClick:(u)=>{u.stopPropagation(),d()},children:t?e("span",{className:"block w-2 h-2 rounded-full bg-current mx-0.5","data-tab-dirty":"","aria-hidden":"true"}):e(h,{size:12})})}function Ae({pluginId:t,Component:r,sessionId:l,className:d="",onHide:u}){return e("div",{className:`flex flex-col h-full bg-canvas ${d}`,children:[u&&e("div",{className:"flex justify-end flex-shrink-0 border-b border-ink/10",children:e(Z,{onHide:u})}),e(tt,{pluginId:t,children:e(r,{sessionId:l,workspacePath:null})})]})}function Fe({className:t="",onHide:r}){return e("div",{className:`relative flex flex-col h-full bg-canvas items-center justify-center text-muted ${t}`,children:[r&&e("div",{className:"absolute top-0 right-0 flex items-center",children:e(Z,{onHide:r})}),e(mt,{name:"placeholder.txt",size:48,className:"mb-4 opacity-20"}),e("p",{className:"font-mono text-sm",children:"Select a file to open"})]})}function Le({searchReveal:t,revealMatch:r}){let l=i(r);l.current=r;let d=i(null);o(()=>{if(!t||d.current===t.request)return;d.current=t.request,l.current({query:t.request.query,options:t.request.options,line:t.request.line})},[t])}function Be({openedFiles:t,dirtyKeys:r,activeFile:l,previewReady:d,setPreviewMode:u,sessionId:x}){o(()=>{let m=new Set(t.filter((c)=>!c.isDiff&&c.content===void 0).map((c)=>c.id));xe([...r].filter((c)=>m.has(c)))},[r,t]),o(()=>{if(!d)return;let m=l?.id;if(!l||m===void 0||m===null)return;if(!xu(Ms(l.name)))return;let c=we(x,"editor.previewMode");if(c&&c[m]!==void 0)return;u((b)=>b[m]===void 0?{...b,[m]:!0}:b)},[d,l])}function Ke({activeFile:t,externalChange:r,conflict:l,onReload:d,onKeepMine:u}){if(!t)return null;if(l)return e(Su,{diskMtimeMs:l.diskMtimeMs,fileName:t.name,onReload:d,onKeepMine:u});if(r)return e(_u,{fileName:t.name,onReload:d,onKeepMine:u});return null}async function $e(t){let r=t.name.trim();if(!r)return{status:"failed",reason:"Enter a file name."};let l=new FormData;if(l.append("actionType","saveAs"),l.append("path",t.parent),l.append("name",r),l.append("content",t.content),l.append("eol",t.eol),t.root)l.append("root",t.root);if(t.repo&&t.repo!==".")l.append("repo",t.repo);try{let d=await fetch("/api/fs/action",{method:"POST",body:l}),u=await d.json().catch(()=>null),x=typeof u?.error==="string"?u.error:null;if(d.status===409)return{status:"exists",reason:x??`${r} already exists.`};if(d.ok&&u?.success&&typeof u.path==="string")return{status:"written",path:u.path};return{status:"failed",reason:x??"The file could not be written."}}catch{return{status:"failed",reason:"The file could not be written."}}}function Ue(t){let r=t.lastIndexOf(".");if(r<=0)return`${t} copy`;return`${t.slice(0,r)} copy${t.slice(r)}`}function Ge(t){let r=t.trim();if(!r)return!1;if(r==="."||r==="..")return!1;return!r.includes("/")&&!r.includes("\\")}function yt(t){let r=t.lastIndexOf("/");return r===-1?"":t.slice(0,r)}function qe({fileName:t,filePath:r,content:l,eol:d,root:u,repo:x,onSaved:m,onClose:c}){let[b,k]=n(()=>yt(r)),[g,y]=n(()=>Ue(t)),[R,M]=n(!1),[P,L]=n(null),D=i(null);o(()=>{D.current?.focus(),D.current?.select()},[]);let O=Ge(g),A=async()=>{if(!O||R)return;M(!0),L(null);let f=await $e({parent:b,name:g,content:l,eol:d,root:u,repo:x});if(M(!1),f.status==="written"){m({path:f.path});return}L(f.reason)},F=(f)=>{if(f.key==="Enter"){f.preventDefault(),A();return}if(f.key==="Escape")f.preventDefault(),c()};return e(X,{onClose:c,maxWidthClass:"max-w-md",header:e("span",{className:"text-sm font-semibold text-ink",children:"Save as"}),footer:e("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-ink/10",children:[e("button",{type:"button",onClick:c,className:"px-3 py-1.5 rounded border border-ink/20 text-ink/80 hover:bg-ink/5 transition-colors cursor-pointer",children:"Cancel"}),e("button",{type:"button",onClick:()=>void A(),disabled:!O||R,className:"flex items-center gap-1.5 px-3 py-1.5 rounded bg-ink text-paper disabled:opacity-40 disabled:cursor-default cursor-pointer",children:[R?e(p,{size:12,className:"animate-spin"}):e(Xe,{size:12}),"Save"]})]}),children:e("div",{className:"px-4 py-3 space-y-2 text-xs",children:[e("label",{className:"block",children:[e("span",{className:"block text-[10px] uppercase tracking-wide text-ink/50 mb-1",children:"Folder"}),e("input",{value:b,onInput:(f)=>k(f.target.value),onKeyDown:F,placeholder:"(workspace root)","aria-label":"Destination folder",className:"w-full bg-paper border border-ink/20 rounded px-2 py-1 font-mono text-ink outline-none focus:border-ink/40"})]}),e("label",{className:"block",children:[e("span",{className:"block text-[10px] uppercase tracking-wide text-ink/50 mb-1",children:"Name"}),e("input",{ref:D,value:g,onInput:(f)=>y(f.target.value),onKeyDown:F,"aria-label":"File name","aria-invalid":!O,className:`w-full bg-paper border rounded px-2 py-1 font-mono text-ink outline-none ${O?"border-ink/20 focus:border-ink/40":"border-error text-error"}`})]}),!O?e("div",{className:"text-[10px] text-error font-mono",children:"Enter a file name without a path separator"}):null,P?e("div",{className:"text-[10px] text-error font-mono",children:P}):null,e("div",{className:"text-[10px] text-ink/40",children:"The original file stays where it is, and its tab stays open."})]})})}function _e(){o(()=>{let t=(r)=>{if(!ke())return;r.preventDefault(),r.returnValue=""};return window.addEventListener("beforeunload",t),()=>window.removeEventListener("beforeunload",t)},[])}function We({fileName:t,onAnswer:r}){return e(X,{onClose:()=>r("cancel"),header:e("div",{className:"flex items-center gap-2",children:[e(I,{size:15,className:"text-warning"}),e("span",{className:"text-sm font-semibold text-ink",children:"Unsaved changes"})]}),footer:e("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-ink/10",children:[e("button",{type:"button",onClick:()=>r("cancel"),className:"px-3 py-1.5 rounded border border-ink/20 text-ink/80 hover:bg-ink/5 transition-colors cursor-pointer",children:"Cancel"}),e("button",{type:"button",onClick:()=>r("discard"),className:"px-3 py-1.5 rounded border border-error/40 text-error hover:bg-error/10 transition-colors cursor-pointer",children:"Discard"}),e("button",{type:"button",onClick:()=>r("save"),className:"px-3 py-1.5 rounded bg-ink text-paper hover:bg-ink/90 transition-colors cursor-pointer",children:"Save & close"})]}),children:e("div",{className:"px-4 py-3 text-xs text-ink/80",children:[e("span",{className:"font-mono text-ink",children:t})," has changes that are not on disk.",e("div",{className:"mt-1 text-ink/50",children:"Discarding them cannot be undone."})]})})}function Ve({closeGuard:t,activeFile:r,saveMissingConfirm:l,onCancelSaveMissing:d,onConfirmSaveMissing:u}){if(t.pending)return e(We,{fileName:t.pending.name,onAnswer:t.answer});if(l&&r)return e(Tu,{fileName:r.name,filePath:r.path,onClose:d,onConfirm:u});return null}function Je({className:t="",isMaximized:r,onKeyDownCapture:l,onFocusCapture:d,asSplitPane:u,tabs:x,activeFile:m,editor:c,externalChange:b,conflict:k,onReload:g,onKeepMine:y,body:R,saveAsOpen:M,onSaveAsClose:P,onSavedAs:L,closeGuard:D}){let O=r?"fixed inset-0 z-50 flex flex-col bg-canvas":`flex flex-col h-full bg-canvas ${t}`;return e("div",{className:O,onKeyDownCapture:l,onFocusCapture:d,children:[u?null:x,e(Ke,{activeFile:m,externalChange:b,conflict:k,onReload:g,onKeepMine:y}),R,M&&m?e(qe,{fileName:m.name,filePath:m.path,content:c.content,eol:c.eol,root:m.root,repo:m.repo,onSaved:({path:A})=>L(A),onClose:P}):null,e(Ve,{closeGuard:D,activeFile:m,saveMissingConfirm:c.saveMissingConfirm,onCancelSaveMissing:c.cancelSaveMissing,onConfirmSaveMissing:c.confirmSaveMissing})]})}function Ye({fileName:t,onClose:r,children:l}){return e("div",{className:"flex flex-col h-full min-w-0","data-split-pane":"",children:[e("div",{className:"flex items-center justify-between gap-2 px-3 py-1 border-b border-ink/10 bg-canvas flex-shrink-0",children:[e("span",{className:"text-[11px] font-mono text-ink/60 truncate",title:t,children:t}),e("button",{type:"button",onClick:r,className:"p-0.5 rounded hover:bg-ink/10 text-ink/50 hover:text-ink transition-colors cursor-pointer flex-shrink-0",title:"Close this pane (the tab stays open)","aria-label":"Close split pane",children:e(h,{size:12})})]}),e("div",{className:"flex-1 min-h-0",children:l})]})}function Ze({fraction:t,onFraction:r,rightPaneName:l,onClosePane:d,rightPane:u,children:x}){let m=i(null),c=i(null),b=Of(c),k=(g)=>{let y=g.currentTarget,R=m.current;if(!y||!R)return;y.setPointerCapture(g.pointerId);let M=(L)=>{let D=R.getBoundingClientRect();if(D.width===0)return;r(Y((L.clientX-D.left)/D.width))},P=()=>{y.releasePointerCapture(g.pointerId),y.removeEventListener("pointermove",M),y.removeEventListener("pointerup",P)};y.addEventListener("pointermove",M),y.addEventListener("pointerup",P)};return e("div",{ref:m,className:"flex w-full h-full","data-split-column":"",children:[e("div",{className:"flex flex-col min-w-0 h-full",style:{width:`${Math.round(Y(t)*100)}%`},children:x}),e("div",{ref:c,className:`w-[3px] flex-shrink-0 cursor-col-resize transition-colors active:bg-ink/40 ${b?"bg-ink/40":"bg-ink/10"}`,role:"separator","aria-orientation":"vertical","aria-label":"Resize split panes",onPointerDown:k}),e("div",{className:"flex-1 min-w-0 h-full",children:e(Ye,{fileName:l,onClose:d,children:u})})]})}function Qe({openedFiles:t,activeFileId:r,enabled:l}){let[d,u]=T("editor.split",ee),x=t.map((y)=>y.id),m=Pe(De(d,x),r),c=l&&m.rightFileId!==null?t.find((y)=>y.id===m.rightFileId)??null:null,b=a((y)=>{if(y!==null&&!ne(y,r,x))return;u({...m,rightFileId:y})},[m,u,r,x]),k=a(()=>u({...m,rightFileId:null}),[m,u]),g=a((y)=>u({...m,fraction:Y(y)}),[m,u]);return{rightFile:c,fraction:m.fraction,splitTo:b,close:k,setFraction:g}}function je({find:t,runCommand:r,reopenClosed:l}){let d=i(t);d.current=t;let u=i(r);u.current=r;let x=i(l);return x.current=l,{onKeyDownCapture:a((c)=>{let b=d.current;if(c.key==="Escape"){if(!b.open)return;c.preventDefault(),c.stopPropagation(),b.close();return}if((c.metaKey||c.ctrlKey)&&c.shiftKey&&c.code==="KeyT"){if(x.current?.())c.preventDefault(),c.stopPropagation();return}let k=N0(Qi,c);if(!k||!eg(k))return;c.preventDefault(),c.stopPropagation(),u.current(k)},[])}}function et(t){let r=i(t);r.current=t;let l=i(null);if(!l.current)l.current={saveNow:()=>r.current.saveNow(),runCommand:(u)=>r.current.runCommand(u)};return o(()=>{let u=l.current;if(!u)return;return hA(u)},[]),{onFocusCapture:a(()=>{if(l.current)hA(l.current)},[])}}function nt({openedFiles:t,activeFileId:r,onSelectFile:l,onCloseFile:d,saveNow:u}){let[x,m]=n(null);_e();let c=a((k)=>{let g=t.find((y)=>y.id===k);if(g&&Ce(k)){m(g);return}d(k)},[t,d]),b=a((k)=>{let g=x;if(!g)return;if(k==="cancel"){m(null);return}if(k==="save"){if(g.id!==r)l(g.id);u()}m(null),d(g.id)},[x,r,l,u,d]);return{requestClose:c,pending:x,answer:b}}function ot(){let[t,r]=n(0),[l,d]=n(!1),u=a(()=>r((x)=>x+1),[]);return{goToLineRequest:t,openGoToLine:u,saveAsOpen:l,setSaveAsOpen:d}}var Ct=Se(()=>import("./Body-sdq2yhmp.js").then((t)=>({default:t.EditorBody})));function rt(t){return e(Me,{fallback:e("div",{className:"h-full w-full"}),children:e(Ct,{...t})})}function kt({className:t="",openedFiles:r,activeFileId:l,onSelectFile:d,onCloseFile:u,onConvertDiffToEditor:x,refreshKey:m=0,onFileSaved:c,onOpenPath:b,onReopenClosed:k,reopenableCount:g,onCopyPath:y,onRevealInFiles:R,rootPath:M=null,repoPath:P=null,activeEditorPanelKey:L=null,forcedActiveFileId:D=null,asSplitPane:O=!1,onHidePanel:A}){let F=O?D:l,f=r.find((C)=>C.id===F),[Q,U,j]=T("editor.previewMode",{}),G=Du(String(F??"")),[v,w]=T("editor.zoomLevel",$o),[S,q]=n(!1),[H,_]=T("editor.wordWrap",!0),J=ot(),{sessionId:le}=He(),B=Qe({openedFiles:r,activeFileId:F,enabled:!O}),W=i(null),it=Go(),st=Fi(),de=wu(r,m),ue=Boolean(f&&de.has(f.id)),N=Cu(f??null,{reportSaveError:!0,onFileSaved:c,missing:ue}),at=wA({path:f?.path??"",content:N.content,language:N.language}),lt=N.diskChange,pe=nt({openedFiles:r,activeFileId:F,onSelectFile:d,onCloseFile:u,saveNow:N.saveNow}),te=Eu({text:N.content,documentKey:`${f?.id??""}\x00${N.language}`,readSelection:()=>W.current?.getSelection()??null,select:(C,V,se=!0)=>W.current?.select(C,V,se),reveal:(C)=>W.current?.revealOffset(C),applyDocument:(C,V,se)=>W.current?.applyDocument(C,V,se),toggleWordWrap:()=>_((C)=>!C)}),ce=Bu(f?.path??null,N.content,N.loaded&&!N.loadError);Le({searchReveal:ce,revealMatch:te.revealMatch}),Iu({file:f,editor:N,surfaceRef:W,isPreview:f?Q[f.id]===!0:!1,exitPreview:()=>{let C=f?.id;if(C===void 0||C===null)return;U((V)=>({...V,[C]:!1}))}}),o(()=>{if(m>0)N.reset()},[m]),o(()=>{N.retain(r.map((C)=>C.id)),ye(r.map((C)=>C.id))},[r]),Be({openedFiles:r,dirtyKeys:N.dirtyKeys,activeFile:f,previewReady:j,setPreviewMode:U,sessionId:le});let dt=()=>{if(!f)return;U((C)=>({...C,[f.id]:!C[f.id]}))},oe=(C)=>{if(eg(C)){te.runCommand(C);return}if(C==="toggleWordWrap"){_((V)=>!V);return}if(C==="goToLine"){J.openGoToLine();return}W.current?.runCommand(C)},ut=je({find:te,runCommand:oe,reopenClosed:k}),pt=et({saveNow:N.saveNow,runCommand:oe}),re=H0(L);if(re)return e(Ae,{pluginId:re.pluginId,Component:re.Component,sessionId:le,className:t,onHide:A});if(r.length===0)return e(Fe,{className:t,onHide:A});let ct=N.viewerKind,me=f?Q[f.id]:!1,ft={activeFile:f,editor:N,find:te,surfaceRef:W,pluginFileView:at,wordWrap:H,setWordWrap:_,viewerKind:ct,isPreview:Boolean(me),isReviewing:Boolean(me)&&G.active,onToggleReview:G.toggle,isMaximized:S,setIsMaximized:q,zoomLevel:v,setZoomLevel:w,goToLineRequest:J.goToLineRequest,onSaveAs:()=>J.setSaveAsOpen(!0),onOpenPath:b,rootPath:M,repoPath:P,runCommand:oe,editorFontFamily:it,editorTheme:st,togglePreview:dt,revealActive:Boolean(ce),missing:ue,onConvertDiffToEditor:x,onFileSaved:c},bt=(C)=>({openedFiles:r,activeFileId:l,onSelectFile:d,onCloseFile:u,onConvertDiffToEditor:x,refreshKey:m,onFileSaved:c,onOpenPath:b,rootPath:M,repoPath:P,forcedActiveFileId:C,asSplitPane:!0}),gt=e(Ie,{openedFiles:r,activeFileId:l,onSelectFile:d,onCloseFile:pe.requestClose,missingIds:de,onCopyPath:y,onRevealInFiles:R,onReopenClosed:k,reopenableCount:g,onSplitTo:B.splitTo,onUnsplit:B.close,splitRightFileId:B.rightFile?.id??null,onHide:A}),fe=e(Je,{className:t,isMaximized:S,onKeyDownCapture:ut.onKeyDownCapture,onFocusCapture:pt.onFocusCapture,asSplitPane:O,tabs:gt,activeFile:f,editor:N,externalChange:lt,conflict:N.conflict,onReload:N.resolveConflictByReload,onKeepMine:N.keepMineAgainstDisk,body:e(rt,{...ft}),saveAsOpen:J.saveAsOpen,onSaveAsClose:()=>J.setSaveAsOpen(!1),onSavedAs:(C)=>{J.setSaveAsOpen(!1),b?.(C)},closeGuard:pe});if(!B.rightFile)return fe;return e(Ze,{fraction:B.fraction,onFraction:B.setFraction,rightPaneName:B.rightFile.name,onClosePane:B.close,rightPane:e(kt,{...bt(B.rightFile.id)}),children:fe})}export{kt as Editor};
|
|
1
|
+
import{n,o,K,i,a,ze,Me,Se,ie,e,s,p,I,E,Xe,bi,ir,h,sr,He,we,T,tt,wi,he,X,mt,Oo,Uo,N0,H0,Of,Jo,Ni,eg,hA}from"./index-8w69r0c4.js";import"./index-hav1hhbr.js";import{Li}from"./index-g46qcgp8.js";import"./index-4kchzh9y.js";import{wA,xu,Fs,wu,Cu,Eu,Bu,Iu,_u,Su,Tu,Du}from"./index-gm9cqsqg.js";var vt={name:"panel-right-close",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]]},be=s(vt);var z=new Set,ae=new Set,ge=new Set;function ve(){ge=new Set(z);for(let t of[...ae])t()}function xe(t){let r=new Set(t);if(r.size===z.size){let l=!0;for(let d of r)if(!z.has(d)){l=!1;break}if(l)return}z.clear();for(let l of r)z.add(l);ve()}function ye(t){let r=new Set(t),l=!1;for(let d of[...z])if(!r.has(d))z.delete(d),l=!0;if(l)ve()}function Ce(t){return z.has(t)}function ke(){return z.size>0}function ht(t){return ae.add(t),()=>{ae.delete(t)}}var xt=ht;function Ee(){return ze(xt,()=>ge)}function Te({x:t,y:r,rows:l,onAction:d,onClose:u}){let x=i(null),[m,c]=n({left:t,top:r});return K(()=>{let b=x.current;if(!b)return;let{width:k,height:g}=b.getBoundingClientRect();c({left:Math.min(t,Math.max(0,window.innerWidth-k-8)),top:Math.min(r,Math.max(0,window.innerHeight-g-8))})},[t,r,l.length]),ie(e("div",{className:"fixed inset-0 z-[70]",onClick:u,onContextMenu:(b)=>{b.preventDefault(),u()},children:e("div",{ref:x,role:"menu","aria-label":"Tab actions",className:"glass-popover absolute w-52 bg-paper border border-ink/15 rounded-md shadow-xl py-1 text-xs text-ink",style:{left:`${m.left}px`,top:`${m.top}px`},onClick:(b)=>b.stopPropagation(),children:l.map((b)=>e("button",{type:"button",role:"menuitem",onClick:()=>{d(b.action),u()},className:"w-full text-left px-3 py-1.5 hover:bg-ink/5 transition-colors cursor-pointer",children:b.label},b.action))})}),document.body)}var ee={rightFileId:null,fraction:0.5};function ne(t,r,l){if(t===null)return!1;if(t===r)return!1;return l.includes(t)}function Ne(t,r){for(let l=r.length-1;l>=0;l-=1){let d=r[l];if(d!==t)return d}return null}function Pe(t,r){if(t.rightFileId===null)return t;if(t.rightFileId!==r)return t;return{...t,rightFileId:null}}function Y(t){if(!Number.isFinite(t))return ee.fraction;return Math.max(0.2,Math.min(0.8,t))}function De(t,r){if(typeof t!=="object"||t===null)return ee;let l=t,d=typeof l.fraction==="number"?Y(l.fraction):ee.fraction,u=typeof l.rightFileId==="string"||typeof l.rightFileId==="number"?l.rightFileId:null;if(u===null||!r.includes(u))return{rightFileId:null,fraction:d};return{rightFileId:u,fraction:d}}function Re({tab:t,openedFiles:r,dirtyIds:l,reopenable:d,activeFileId:u,splitRightFileId:x}){let m=r.filter((g)=>g.id!==t.id),c=r.filter((g)=>!l.has(g.id)),b=r.map((g)=>g.id);return[{action:"split-right",label:"Split right",enabled:ne(t.id,u,b)},{action:"unsplit",label:"Unsplit",enabled:x!==null},{action:"close",label:"Close",enabled:!0},{action:"close-others",label:"Close others",enabled:m.length>0},{action:"close-all",label:"Close all",enabled:r.length>0},{action:"close-saved",label:"Close saved",enabled:c.some((g)=>g.id!==t.id)},{action:"copy-path",label:"Copy path",enabled:Boolean(t.path)},{action:"reveal-in-files",label:"Reveal in Files",enabled:Boolean(t.path)&&!t.isDiff},{action:"reopen-closed",label:"Reopen closed tab",enabled:d>0}].filter((g)=>g.enabled)}function Z({onHide:t}){let r=Jo("toggleEditorPanel","Hide Editor Panel");return e("button",{type:"button",onClick:t,className:"p-1.5 mx-1 rounded transition-colors cursor-pointer text-ink/60 hover:bg-ink/10 hover:text-ink flex-shrink-0",title:r,"aria-label":r,children:e(be,{size:14})})}function Ie({openedFiles:t,activeFileId:r,onSelectFile:l,onCloseFile:d,missingIds:u,onCopyPath:x,onRevealInFiles:m,onReopenClosed:c,reopenableCount:b,onSplitTo:k,onUnsplit:g,splitRightFileId:y=null,onHide:R}){let M=Ee(),P=i(null),L=i(null),[D,O]=n(5),[A,F]=n(!1),[f,Q]=n(null);he(L,()=>F(!1)),o(()=>{let v=new ResizeObserver((w)=>{for(let S of w){let q=S.contentRect.width,H=Math.max(1,Math.floor((q-60)/150));O(H)}});if(P.current)v.observe(P.current);return()=>v.disconnect()},[]);let U=Ne(r,t.map((v)=>v.id)),j=[],G=[];if(t.length<=D)j=t;else{let v=t.findIndex((S)=>S.id===r),w=new Set;if(v!==-1&&r!==null)w.add(r);for(let S=t.length-1;S>=0;S--){if(w.size>=D)break;w.add(t[S].id)}j=t.filter((S)=>w.has(S.id)),G=t.filter((S)=>!w.has(S.id))}return e("div",{className:`${wi.desktop} flex bg-ink/10 w-full relative border-b border-ink/10`,ref:P,children:[e("div",{className:"flex overflow-hidden",children:j.map((v)=>{let w=v.id===r,S=Boolean(v.isDiff),q=S?sr(v.diffStatus||"M",v.diffStaged):null,H=Boolean(u?.has(v.id));return e("div",{onClick:()=>l(v.id),onContextMenu:(_)=>{_.preventDefault(),Q({tab:v,x:_.clientX,y:_.clientY})},className:`flex items-center space-x-1.5 px-3 py-1.5 cursor-pointer border-r border-ink/10 min-w-[120px] max-w-[210px] group ${w?"bg-paper border-t-2 border-t-ink text-ink":"bg-transparent border-t-2 border-t-transparent text-ink/60 hover:bg-paper/50"}`,title:H?`${v.path} — file no longer exists`:v.path,children:[S?e(bi,{size:14,className:w?"text-info flex-shrink-0":"text-info/70 flex-shrink-0"}):e(mt,{name:v.name,size:14,className:`flex-shrink-0${w||H?"":" opacity-60"}${H?" text-error":""}`}),e("span",{className:`text-xs font-mono truncate flex-1${H?" text-error line-through":""}`,children:v.name}),q&&e("span",{className:`px-1 text-[10px] font-mono font-bold rounded ${q.badgeBgClass}`,children:q.charStatus}),e(Oe,{dirty:M.has(v.id),active:w,label:`Close ${v.name}`,onClose:()=>d(v.id)})]},v.id)})}),f?e(Te,{x:f.x,y:f.y,rows:Re({tab:f.tab,openedFiles:t,dirtyIds:M,reopenable:b?.()??0,activeFileId:r,splitRightFileId:y}),onAction:(v)=>{let w=f.tab;switch(v){case"close":d(w.id);return;case"close-others":for(let S of[...t].reverse())if(S.id!==w.id)d(S.id);l(w.id);return;case"close-all":for(let S of[...t].reverse())d(S.id);return;case"close-saved":for(let S of[...t].reverse())if(!M.has(S.id))d(S.id);return;case"copy-path":x?.(w);return;case"reveal-in-files":m?.(w);return;case"reopen-closed":c?.();return;case"split-right":k?.(w.id);return;case"unsplit":g?.();return}},onClose:()=>Q(null)}):null,e("div",{className:"ml-auto flex items-center",children:[e("button",{type:"button",onClick:()=>y!==null?g?.():k?.(U),disabled:y===null&&U===null,"aria-pressed":y!==null,"aria-label":"Split editor",title:y!==null?"Close the split pane (the tab stays open)":U===null?"Open another file to split the editor":"Split the editor and show the newest other file",className:`p-1.5 mx-1 rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-default ${y!==null?"bg-ink/10 text-ink":"text-ink/60 hover:bg-ink/10"}`,children:e(ir,{size:14})}),R&&e(Z,{onHide:R})]}),G.length>0&&e("div",{className:"relative flex items-center bg-ink/10",ref:L,children:[e("button",{className:`p-1.5 mx-1 rounded hover:bg-ink/10 text-ink/60 ${A?"bg-ink/10 text-ink":""}`,onClick:()=>F(!A),title:"More open files",children:e(E,{size:14})}),A&&e("div",{className:"glass-popover absolute right-0 top-full mt-1 w-52 bg-paper border border-ink/10 rounded shadow-lg z-50 py-1",children:[e("div",{className:"px-3 py-1 text-[10px] uppercase font-mono text-ink/40 border-b border-ink/10 mb-1",children:"Older Tabs"}),G.map((v)=>{let w=Boolean(u?.has(v.id));return e("div",{onClick:()=>{l(v.id),F(!1)},className:"flex items-center space-x-2 px-3 py-1.5 hover:bg-ink/5 cursor-pointer group",children:[v.isDiff?e(bi,{size:14,className:"text-info/80"}):e(mt,{name:v.name,size:14,className:w?"text-error":"opacity-60"}),e("span",{className:`text-xs font-mono truncate flex-1 ${w?"text-error line-through":"text-ink/80"}`,children:v.name}),e(Oe,{dirty:M.has(v.id),active:!1,label:`Close ${v.name}`,onClose:()=>{if(d(v.id),G.length===1)F(!1)}})]},v.id)})]})]})]})}function Oe({dirty:t,active:r,label:l,onClose:d}){return e("div",{role:"button",tabIndex:-1,"aria-label":l,title:t?`${l} — unsaved changes`:l,className:`p-0.5 rounded hover:bg-ink/10 touch-visible ${r||t?"opacity-100":"opacity-0 group-hover:opacity-100"}`,onClick:(u)=>{u.stopPropagation(),d()},children:t?e("span",{className:"block w-2 h-2 rounded-full bg-current mx-0.5","data-tab-dirty":"","aria-hidden":"true"}):e(h,{size:12})})}function Ae({pluginId:t,Component:r,sessionId:l,className:d="",onHide:u}){return e("div",{className:`flex flex-col h-full bg-canvas ${d}`,children:[u&&e("div",{className:"flex justify-end flex-shrink-0 border-b border-ink/10",children:e(Z,{onHide:u})}),e(tt,{pluginId:t,children:e(r,{sessionId:l,workspacePath:null})})]})}function Fe({className:t="",onHide:r}){return e("div",{className:`relative flex flex-col h-full bg-canvas items-center justify-center text-muted ${t}`,children:[r&&e("div",{className:"absolute top-0 right-0 flex items-center",children:e(Z,{onHide:r})}),e(mt,{name:"placeholder.txt",size:48,className:"mb-4 opacity-20"}),e("p",{className:"font-mono text-sm",children:"Select a file to open"})]})}function Le({searchReveal:t,revealMatch:r}){let l=i(r);l.current=r;let d=i(null);o(()=>{if(!t||d.current===t.request)return;d.current=t.request,l.current({query:t.request.query,options:t.request.options,line:t.request.line})},[t])}function Be({openedFiles:t,dirtyKeys:r,activeFile:l,previewReady:d,setPreviewMode:u,sessionId:x}){o(()=>{let m=new Set(t.filter((c)=>!c.isDiff&&c.content===void 0).map((c)=>c.id));xe([...r].filter((c)=>m.has(c)))},[r,t]),o(()=>{if(!d)return;let m=l?.id;if(!l||m===void 0||m===null)return;if(!xu(Fs(l.name)))return;let c=we(x,"editor.previewMode");if(c&&c[m]!==void 0)return;u((b)=>b[m]===void 0?{...b,[m]:!0}:b)},[d,l])}function Ke({activeFile:t,externalChange:r,conflict:l,onReload:d,onKeepMine:u}){if(!t)return null;if(l)return e(Su,{diskMtimeMs:l.diskMtimeMs,fileName:t.name,onReload:d,onKeepMine:u});if(r)return e(_u,{fileName:t.name,onReload:d,onKeepMine:u});return null}async function $e(t){let r=t.name.trim();if(!r)return{status:"failed",reason:"Enter a file name."};let l=new FormData;if(l.append("actionType","saveAs"),l.append("path",t.parent),l.append("name",r),l.append("content",t.content),l.append("eol",t.eol),t.root)l.append("root",t.root);if(t.repo&&t.repo!==".")l.append("repo",t.repo);try{let d=await fetch("/api/fs/action",{method:"POST",body:l}),u=await d.json().catch(()=>null),x=typeof u?.error==="string"?u.error:null;if(d.status===409)return{status:"exists",reason:x??`${r} already exists.`};if(d.ok&&u?.success&&typeof u.path==="string")return{status:"written",path:u.path};return{status:"failed",reason:x??"The file could not be written."}}catch{return{status:"failed",reason:"The file could not be written."}}}function Ue(t){let r=t.lastIndexOf(".");if(r<=0)return`${t} copy`;return`${t.slice(0,r)} copy${t.slice(r)}`}function Ge(t){let r=t.trim();if(!r)return!1;if(r==="."||r==="..")return!1;return!r.includes("/")&&!r.includes("\\")}function yt(t){let r=t.lastIndexOf("/");return r===-1?"":t.slice(0,r)}function qe({fileName:t,filePath:r,content:l,eol:d,root:u,repo:x,onSaved:m,onClose:c}){let[b,k]=n(()=>yt(r)),[g,y]=n(()=>Ue(t)),[R,M]=n(!1),[P,L]=n(null),D=i(null);o(()=>{D.current?.focus(),D.current?.select()},[]);let O=Ge(g),A=async()=>{if(!O||R)return;M(!0),L(null);let f=await $e({parent:b,name:g,content:l,eol:d,root:u,repo:x});if(M(!1),f.status==="written"){m({path:f.path});return}L(f.reason)},F=(f)=>{if(f.key==="Enter"){f.preventDefault(),A();return}if(f.key==="Escape")f.preventDefault(),c()};return e(X,{onClose:c,maxWidthClass:"max-w-md",header:e("span",{className:"text-sm font-semibold text-ink",children:"Save as"}),footer:e("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-ink/10",children:[e("button",{type:"button",onClick:c,className:"px-3 py-1.5 rounded border border-ink/20 text-ink/80 hover:bg-ink/5 transition-colors cursor-pointer",children:"Cancel"}),e("button",{type:"button",onClick:()=>void A(),disabled:!O||R,className:"flex items-center gap-1.5 px-3 py-1.5 rounded bg-ink text-paper disabled:opacity-40 disabled:cursor-default cursor-pointer",children:[R?e(p,{size:12,className:"animate-spin"}):e(Xe,{size:12}),"Save"]})]}),children:e("div",{className:"px-4 py-3 space-y-2 text-xs",children:[e("label",{className:"block",children:[e("span",{className:"block text-[10px] uppercase tracking-wide text-ink/50 mb-1",children:"Folder"}),e("input",{value:b,onInput:(f)=>k(f.target.value),onKeyDown:F,placeholder:"(workspace root)","aria-label":"Destination folder",className:"w-full bg-paper border border-ink/20 rounded px-2 py-1 font-mono text-ink outline-none focus:border-ink/40"})]}),e("label",{className:"block",children:[e("span",{className:"block text-[10px] uppercase tracking-wide text-ink/50 mb-1",children:"Name"}),e("input",{ref:D,value:g,onInput:(f)=>y(f.target.value),onKeyDown:F,"aria-label":"File name","aria-invalid":!O,className:`w-full bg-paper border rounded px-2 py-1 font-mono text-ink outline-none ${O?"border-ink/20 focus:border-ink/40":"border-error text-error"}`})]}),!O?e("div",{className:"text-[10px] text-error font-mono",children:"Enter a file name without a path separator"}):null,P?e("div",{className:"text-[10px] text-error font-mono",children:P}):null,e("div",{className:"text-[10px] text-ink/40",children:"The original file stays where it is, and its tab stays open."})]})})}function _e(){o(()=>{let t=(r)=>{if(!ke())return;r.preventDefault(),r.returnValue=""};return window.addEventListener("beforeunload",t),()=>window.removeEventListener("beforeunload",t)},[])}function We({fileName:t,onAnswer:r}){return e(X,{onClose:()=>r("cancel"),header:e("div",{className:"flex items-center gap-2",children:[e(I,{size:15,className:"text-warning"}),e("span",{className:"text-sm font-semibold text-ink",children:"Unsaved changes"})]}),footer:e("div",{className:"flex items-center justify-end gap-2 px-4 py-3 border-t border-ink/10",children:[e("button",{type:"button",onClick:()=>r("cancel"),className:"px-3 py-1.5 rounded border border-ink/20 text-ink/80 hover:bg-ink/5 transition-colors cursor-pointer",children:"Cancel"}),e("button",{type:"button",onClick:()=>r("discard"),className:"px-3 py-1.5 rounded border border-error/40 text-error hover:bg-error/10 transition-colors cursor-pointer",children:"Discard"}),e("button",{type:"button",onClick:()=>r("save"),className:"px-3 py-1.5 rounded bg-ink text-paper hover:bg-ink/90 transition-colors cursor-pointer",children:"Save & close"})]}),children:e("div",{className:"px-4 py-3 text-xs text-ink/80",children:[e("span",{className:"font-mono text-ink",children:t})," has changes that are not on disk.",e("div",{className:"mt-1 text-ink/50",children:"Discarding them cannot be undone."})]})})}function Ve({closeGuard:t,activeFile:r,saveMissingConfirm:l,onCancelSaveMissing:d,onConfirmSaveMissing:u}){if(t.pending)return e(We,{fileName:t.pending.name,onAnswer:t.answer});if(l&&r)return e(Tu,{fileName:r.name,filePath:r.path,onClose:d,onConfirm:u});return null}function Je({className:t="",isMaximized:r,onKeyDownCapture:l,onFocusCapture:d,asSplitPane:u,tabs:x,activeFile:m,editor:c,externalChange:b,conflict:k,onReload:g,onKeepMine:y,body:R,saveAsOpen:M,onSaveAsClose:P,onSavedAs:L,closeGuard:D}){let O=r?"fixed inset-0 z-50 flex flex-col bg-canvas":`flex flex-col h-full bg-canvas ${t}`;return e("div",{className:O,onKeyDownCapture:l,onFocusCapture:d,children:[u?null:x,e(Ke,{activeFile:m,externalChange:b,conflict:k,onReload:g,onKeepMine:y}),R,M&&m?e(qe,{fileName:m.name,filePath:m.path,content:c.content,eol:c.eol,root:m.root,repo:m.repo,onSaved:({path:A})=>L(A),onClose:P}):null,e(Ve,{closeGuard:D,activeFile:m,saveMissingConfirm:c.saveMissingConfirm,onCancelSaveMissing:c.cancelSaveMissing,onConfirmSaveMissing:c.confirmSaveMissing})]})}function Ye({fileName:t,onClose:r,children:l}){return e("div",{className:"flex flex-col h-full min-w-0","data-split-pane":"",children:[e("div",{className:"flex items-center justify-between gap-2 px-3 py-1 border-b border-ink/10 bg-canvas flex-shrink-0",children:[e("span",{className:"text-[11px] font-mono text-ink/60 truncate",title:t,children:t}),e("button",{type:"button",onClick:r,className:"p-0.5 rounded hover:bg-ink/10 text-ink/50 hover:text-ink transition-colors cursor-pointer flex-shrink-0",title:"Close this pane (the tab stays open)","aria-label":"Close split pane",children:e(h,{size:12})})]}),e("div",{className:"flex-1 min-h-0",children:l})]})}function Ze({fraction:t,onFraction:r,rightPaneName:l,onClosePane:d,rightPane:u,children:x}){let m=i(null),c=i(null),b=Of(c),k=(g)=>{let y=g.currentTarget,R=m.current;if(!y||!R)return;y.setPointerCapture(g.pointerId);let M=(L)=>{let D=R.getBoundingClientRect();if(D.width===0)return;r(Y((L.clientX-D.left)/D.width))},P=()=>{y.releasePointerCapture(g.pointerId),y.removeEventListener("pointermove",M),y.removeEventListener("pointerup",P)};y.addEventListener("pointermove",M),y.addEventListener("pointerup",P)};return e("div",{ref:m,className:"flex w-full h-full","data-split-column":"",children:[e("div",{className:"flex flex-col min-w-0 h-full",style:{width:`${Math.round(Y(t)*100)}%`},children:x}),e("div",{ref:c,className:`w-[3px] flex-shrink-0 cursor-col-resize transition-colors active:bg-ink/40 ${b?"bg-ink/40":"bg-ink/10"}`,role:"separator","aria-orientation":"vertical","aria-label":"Resize split panes",onPointerDown:k}),e("div",{className:"flex-1 min-w-0 h-full",children:e(Ye,{fileName:l,onClose:d,children:u})})]})}function Qe({openedFiles:t,activeFileId:r,enabled:l}){let[d,u]=T("editor.split",ee),x=t.map((y)=>y.id),m=Pe(De(d,x),r),c=l&&m.rightFileId!==null?t.find((y)=>y.id===m.rightFileId)??null:null,b=a((y)=>{if(y!==null&&!ne(y,r,x))return;u({...m,rightFileId:y})},[m,u,r,x]),k=a(()=>u({...m,rightFileId:null}),[m,u]),g=a((y)=>u({...m,fraction:Y(y)}),[m,u]);return{rightFile:c,fraction:m.fraction,splitTo:b,close:k,setFraction:g}}function je({find:t,runCommand:r,reopenClosed:l}){let d=i(t);d.current=t;let u=i(r);u.current=r;let x=i(l);return x.current=l,{onKeyDownCapture:a((c)=>{let b=d.current;if(c.key==="Escape"){if(!b.open)return;c.preventDefault(),c.stopPropagation(),b.close();return}if((c.metaKey||c.ctrlKey)&&c.shiftKey&&c.code==="KeyT"){if(x.current?.())c.preventDefault(),c.stopPropagation();return}let k=N0(Ni,c);if(!k||!eg(k))return;c.preventDefault(),c.stopPropagation(),u.current(k)},[])}}function et(t){let r=i(t);r.current=t;let l=i(null);if(!l.current)l.current={saveNow:()=>r.current.saveNow(),runCommand:(u)=>r.current.runCommand(u)};return o(()=>{let u=l.current;if(!u)return;return hA(u)},[]),{onFocusCapture:a(()=>{if(l.current)hA(l.current)},[])}}function nt({openedFiles:t,activeFileId:r,onSelectFile:l,onCloseFile:d,saveNow:u}){let[x,m]=n(null);_e();let c=a((k)=>{let g=t.find((y)=>y.id===k);if(g&&Ce(k)){m(g);return}d(k)},[t,d]),b=a((k)=>{let g=x;if(!g)return;if(k==="cancel"){m(null);return}if(k==="save"){if(g.id!==r)l(g.id);u()}m(null),d(g.id)},[x,r,l,u,d]);return{requestClose:c,pending:x,answer:b}}function ot(){let[t,r]=n(0),[l,d]=n(!1),u=a(()=>r((x)=>x+1),[]);return{goToLineRequest:t,openGoToLine:u,saveAsOpen:l,setSaveAsOpen:d}}var Ct=Se(()=>import("./Body-3v975hq3.js").then((t)=>({default:t.EditorBody})));function rt(t){return e(Me,{fallback:e("div",{className:"h-full w-full"}),children:e(Ct,{...t})})}function kt({className:t="",openedFiles:r,activeFileId:l,onSelectFile:d,onCloseFile:u,onConvertDiffToEditor:x,refreshKey:m=0,onFileSaved:c,onOpenPath:b,onReopenClosed:k,reopenableCount:g,onCopyPath:y,onRevealInFiles:R,rootPath:M=null,repoPath:P=null,activeEditorPanelKey:L=null,forcedActiveFileId:D=null,asSplitPane:O=!1,onHidePanel:A}){let F=O?D:l,f=r.find((C)=>C.id===F),[Q,U,j]=T("editor.previewMode",{}),G=Du(String(F??"")),[v,w]=T("editor.zoomLevel",Oo),[S,q]=n(!1),[H,_]=T("editor.wordWrap",!0),J=ot(),{sessionId:le}=He(),B=Qe({openedFiles:r,activeFileId:F,enabled:!O}),W=i(null),it=Uo(),st=Li(),de=wu(r,m),ue=Boolean(f&&de.has(f.id)),N=Cu(f??null,{reportSaveError:!0,onFileSaved:c,missing:ue}),at=wA({path:f?.path??"",content:N.content,language:N.language}),lt=N.diskChange,pe=nt({openedFiles:r,activeFileId:F,onSelectFile:d,onCloseFile:u,saveNow:N.saveNow}),te=Eu({text:N.content,documentKey:`${f?.id??""}\x00${N.language}`,readSelection:()=>W.current?.getSelection()??null,select:(C,V,se=!0)=>W.current?.select(C,V,se),reveal:(C)=>W.current?.revealOffset(C),applyDocument:(C,V,se)=>W.current?.applyDocument(C,V,se),toggleWordWrap:()=>_((C)=>!C)}),ce=Bu(f?.path??null,N.content,N.loaded&&!N.loadError);Le({searchReveal:ce,revealMatch:te.revealMatch}),Iu({file:f,editor:N,surfaceRef:W,isPreview:f?Q[f.id]===!0:!1,exitPreview:()=>{let C=f?.id;if(C===void 0||C===null)return;U((V)=>({...V,[C]:!1}))}}),o(()=>{if(m>0)N.reset()},[m]),o(()=>{N.retain(r.map((C)=>C.id)),ye(r.map((C)=>C.id))},[r]),Be({openedFiles:r,dirtyKeys:N.dirtyKeys,activeFile:f,previewReady:j,setPreviewMode:U,sessionId:le});let dt=()=>{if(!f)return;U((C)=>({...C,[f.id]:!C[f.id]}))},oe=(C)=>{if(eg(C)){te.runCommand(C);return}if(C==="toggleWordWrap"){_((V)=>!V);return}if(C==="goToLine"){J.openGoToLine();return}W.current?.runCommand(C)},ut=je({find:te,runCommand:oe,reopenClosed:k}),pt=et({saveNow:N.saveNow,runCommand:oe}),re=H0(L);if(re)return e(Ae,{pluginId:re.pluginId,Component:re.Component,sessionId:le,className:t,onHide:A});if(r.length===0)return e(Fe,{className:t,onHide:A});let ct=N.viewerKind,me=f?Q[f.id]:!1,ft={activeFile:f,editor:N,find:te,surfaceRef:W,pluginFileView:at,wordWrap:H,setWordWrap:_,viewerKind:ct,isPreview:Boolean(me),isReviewing:Boolean(me)&&G.active,onToggleReview:G.toggle,isMaximized:S,setIsMaximized:q,zoomLevel:v,setZoomLevel:w,goToLineRequest:J.goToLineRequest,onSaveAs:()=>J.setSaveAsOpen(!0),onOpenPath:b,rootPath:M,repoPath:P,runCommand:oe,editorFontFamily:it,editorTheme:st,togglePreview:dt,revealActive:Boolean(ce),missing:ue,onConvertDiffToEditor:x,onFileSaved:c},bt=(C)=>({openedFiles:r,activeFileId:l,onSelectFile:d,onCloseFile:u,onConvertDiffToEditor:x,refreshKey:m,onFileSaved:c,onOpenPath:b,rootPath:M,repoPath:P,forcedActiveFileId:C,asSplitPane:!0}),gt=e(Ie,{openedFiles:r,activeFileId:l,onSelectFile:d,onCloseFile:pe.requestClose,missingIds:de,onCopyPath:y,onRevealInFiles:R,onReopenClosed:k,reopenableCount:g,onSplitTo:B.splitTo,onUnsplit:B.close,splitRightFileId:B.rightFile?.id??null,onHide:A}),fe=e(Je,{className:t,isMaximized:S,onKeyDownCapture:ut.onKeyDownCapture,onFocusCapture:pt.onFocusCapture,asSplitPane:O,tabs:gt,activeFile:f,editor:N,externalChange:lt,conflict:N.conflict,onReload:N.resolveConflictByReload,onKeepMine:N.keepMineAgainstDisk,body:e(rt,{...ft}),saveAsOpen:J.saveAsOpen,onSaveAsClose:()=>J.setSaveAsOpen(!1),onSavedAs:(C)=>{J.setSaveAsOpen(!1),b?.(C)},closeGuard:pe});if(!B.rightFile)return fe;return e(Ze,{fraction:B.fraction,onFraction:B.setFraction,rightPaneName:B.rightFile.name,onClosePane:B.close,rightPane:e(kt,{...bt(B.rightFile.id)}),children:fe})}export{kt as Editor};
|