@ucap-llm/ai-ui 1.2.1 → 1.2.3
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/{_basePickBy-DVub8pVB.mjs → _basePickBy-XXdFQ-es.mjs} +2 -2
- package/ai-ui.es.js +1 -1
- package/ai-ui.umd.js +3 -3
- package/{arc-CCDbKYp6.mjs → arc-CV-Jnm-A.mjs} +1 -1
- package/{architecture-4AB2E3PP-D8PM5LRK.mjs → architecture-4AB2E3PP-CQEvC-D-.mjs} +1 -1
- package/{architectureDiagram-IEHRJDOE-D5HQK6L5.mjs → architectureDiagram-IEHRJDOE-COvBnkW6.mjs} +4 -4
- package/{blockDiagram-JOT3LUYC-CmrpUaYI.mjs → blockDiagram-JOT3LUYC-CQyAuML6.mjs} +4 -4
- package/{c4Diagram-VJAJSXHY-BjZL_crC.mjs → c4Diagram-VJAJSXHY-Ctunn2DJ.mjs} +2 -2
- package/{channel-Bh4diBfh.mjs → channel-BnbbjKsj.mjs} +1 -1
- package/{chunk-4BMEZGHF-CIvj4a46.mjs → chunk-4BMEZGHF-BDcVrWHU.mjs} +1 -1
- package/{chunk-A2AXSNBT-DYG667q2.mjs → chunk-A2AXSNBT-DjVP7MHU.mjs} +2 -2
- package/{chunk-AEK57VVT-C6fcSqEA.mjs → chunk-AEK57VVT-CDSYZ7L7.mjs} +2 -2
- package/{chunk-D6G4REZN-CZwG2unh.mjs → chunk-D6G4REZN-TpqMjWxy.mjs} +1 -1
- package/{chunk-RZ5BOZE2-CTSiXaEg.mjs → chunk-RZ5BOZE2-DYf1-BPZ.mjs} +1 -1
- package/{chunk-XZIHB7SX-B0Cp7Bx3.mjs → chunk-XZIHB7SX-DRtMILa6.mjs} +1 -1
- package/{classDiagram-GIVACNV2-kPuYn5l1.mjs → classDiagram-GIVACNV2-CTVGv4Pa.mjs} +2 -2
- package/{classDiagram-v2-COTLJTTW-kPuYn5l1.mjs → classDiagram-v2-COTLJTTW-CTVGv4Pa.mjs} +2 -2
- package/{clone-4iVol4g3.mjs → clone-Qk5c52g9.mjs} +1 -1
- package/{dagre-OKDRZEBW-5olgCJ2N.mjs → dagre-OKDRZEBW-B7_7waVP.mjs} +6 -6
- package/{diagram-SSKATNLV-Bea11Zl7.mjs → diagram-SSKATNLV-DFcq3wKJ.mjs} +3 -3
- package/{diagram-VNBRO52H-C_EMllPO.mjs → diagram-VNBRO52H-BR5C3a11.mjs} +3 -3
- package/{erDiagram-Q7BY3M3F-DKg39-YS.mjs → erDiagram-Q7BY3M3F-CF15uvIu.mjs} +3 -3
- package/{flowDiagram-4HSFHLVR-Bb3_SlL2.mjs → flowDiagram-4HSFHLVR-CUwb0yE5.mjs} +3 -3
- package/{ganttDiagram-APWFNJXF-iagNkc3a.mjs → ganttDiagram-APWFNJXF-CM-8jtc3.mjs} +2 -2
- package/{gitGraph-O2Q2CXLX-CYOGgfXQ.mjs → gitGraph-O2Q2CXLX-oWt7iYsE.mjs} +1 -1
- package/{gitGraphDiagram-7IBYFJ6S-BFpXPEHM.mjs → gitGraphDiagram-7IBYFJ6S-2QNhQXOw.mjs} +4 -4
- package/{graph-D0ZgyuAv.mjs → graph-CAmyFTHR.mjs} +2 -2
- package/{index-Bk0Mljr7.mjs → index-CLNfD8Ic.mjs} +8403 -8403
- package/info-4N47QTOZ-BeFS13oQ.mjs +5 -0
- package/{infoDiagram-PH2N3AL5-DH8Cm6Id.mjs → infoDiagram-PH2N3AL5-DlFWmlGG.mjs} +2 -2
- package/{journeyDiagram-U35MCT3I-VUdrFrjA.mjs → journeyDiagram-U35MCT3I-9H2lYPBj.mjs} +3 -3
- package/{kanban-definition-NDS4AKOZ-D6UIzT3e.mjs → kanban-definition-NDS4AKOZ-BN7Vnqrw.mjs} +1 -1
- package/{layout-CH1mq7n9.mjs → layout-BNOU9MMU.mjs} +4 -4
- package/{linear-JxItMR1_.mjs → linear-BR3NS_lx.mjs} +1 -1
- package/{mermaid-parser.core-B_8ezrFw.mjs → mermaid-parser.core-DvCKtD9V.mjs} +10 -10
- package/{mindmap-definition-ALO5MXBD-CQaQplpr.mjs → mindmap-definition-ALO5MXBD-BFDTo51a.mjs} +1 -1
- package/package.json +1 -1
- package/{packet-KVYON367-CG8zw97_.mjs → packet-KVYON367-CYcX9RqS.mjs} +1 -1
- package/pie-R6RNRRYF-CWdYNK5l.mjs +5 -0
- package/{pieDiagram-IB7DONF6-BmNqvzrG.mjs → pieDiagram-IB7DONF6-BD1ONfZI.mjs} +4 -4
- package/{quadrantDiagram-7GDLP6J5-CIinPpUj.mjs → quadrantDiagram-7GDLP6J5-DFUdeWAK.mjs} +2 -2
- package/{radar-MK3ICKWK-B2ZHSFqJ.mjs → radar-MK3ICKWK-DQ80YsPw.mjs} +1 -1
- package/{reduce-Ciy6DeQO.mjs → reduce-BtOlZKXO.mjs} +1 -1
- package/{requirementDiagram-KVF5MWMF-C9qMcgJw.mjs → requirementDiagram-KVF5MWMF-fblVjlG4.mjs} +2 -2
- package/{sankeyDiagram-QLVOVGJD-jp3cEjyL.mjs → sankeyDiagram-QLVOVGJD-CUIL1KSq.mjs} +1 -1
- package/{sequenceDiagram-X6HHIX6F-Coi9hKRd.mjs → sequenceDiagram-X6HHIX6F-Dj5qoX4Y.mjs} +3 -3
- package/{stateDiagram-DGXRK772-CFBaWVAL.mjs → stateDiagram-DGXRK772-CcSobOfq.mjs} +4 -4
- package/{stateDiagram-v2-YXO3MK2T-BpejB8wp.mjs → stateDiagram-v2-YXO3MK2T-C5PtGj-Y.mjs} +2 -2
- package/style.css +1 -1
- package/{timeline-definition-BDJGKUSR-B29ZJOie.mjs → timeline-definition-BDJGKUSR-oErQdlxm.mjs} +2 -2
- package/{xychartDiagram-VJFVF3MP-Dpy-5BDP.mjs → xychartDiagram-VJFVF3MP-C3YpBb4y.mjs} +2 -2
- package/info-4N47QTOZ-C--jmkDF.mjs +0 -5
- package/pie-R6RNRRYF-BgSv5llh.mjs +0 -5
package/ai-ui.umd.js
CHANGED
|
@@ -960,8 +960,8 @@ echarts.use([`+O+"]);":"Unknown series "+w))}return}if(h==="tooltip"){if(_){proc
|
|
|
960
960
|
`,"Illegal config:",d,`.
|
|
961
961
|
`)),ti(n));var y=p?wVe(p):null;p&&!y&&(process.env.NODE_ENV!=="production"&&(n=Bu("Invalid parser name "+p+`.
|
|
962
962
|
`,"Illegal config:",d,`.
|
|
963
|
-
`)),ti(n)),a.push({dimIdx:v.index,parser:y,comparator:new OVe(f,g)})});var o=e.sourceFormat;o!==Xs&&o!==z1&&(process.env.NODE_ENV!=="production"&&(n='sourceFormat "'+o+'" is not supported yet'),ti(n));for(var s=[],l=0,u=e.count();l<u;l++)s.push(e.getRawDataItem(l));return s.sort(function(d,h){for(var f=0;f<a.length;f++){var p=a[f],g=e.retrieveValueFromItem(d,p.dimIdx),m=e.retrieveValueFromItem(h,p.dimIdx);p.parser&&(g=p.parser(g),m=p.parser(m));var T=p.comparator.evaluate(g,m);if(T!==0)return T}return 0}),{data:s}}};function xTr(t){t.registerTransform(bTr),t.registerTransform(QTr)}var ETr=function(t){Ye(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataset",r}return e.prototype.init=function(r,n,i){t.prototype.init.call(this,r,n,i),this._sourceManager=new kVe(this),PVe(this)},e.prototype.mergeOption=function(r,n){t.prototype.mergeOption.call(this,r,n),PVe(this)},e.prototype.optionUpdated=function(){this._sourceManager.dirty()},e.prototype.getSourceManager=function(){return this._sourceManager},e.type="dataset",e.defaultOption={seriesLayoutBy:Ed},e}(yn),STr=function(t){Ye(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataset",r}return e.type="dataset",e}(ia);function CTr(t){t.registerComponentModel(ETr),t.registerComponentView(STr)}var ih=$3.CMD;function Xy(t,e){return Math.abs(t-e)<1e-5}function Rle(t){var e=t.data,r=t.len(),n=[],i,a=0,o=0,s=0,l=0;function u(R,M){i&&i.length>2&&n.push(i),i=[R,M]}function d(R,M,D,P){Xy(R,D)&&Xy(M,P)||i.push(R,M,D,P,D,P)}function h(R,M,D,P,B,k){var V=Math.abs(M-R),H=Math.tan(V/4)*4/3,$=M<R?-1:1,G=Math.cos(R),U=Math.sin(R),Y=Math.cos(M),ne=Math.sin(M),te=G*B+D,ee=U*k+P,ie=Y*B+D,j=ne*k+P,X=B*H*$,Z=k*H*$;i.push(te-X*U,ee+Z*G,ie+X*ne,j-Z*Y,ie,j)}for(var f,p,g,m,T=0;T<r;){var v=e[T++],y=T===1;switch(y&&(a=e[T],o=e[T+1],s=a,l=o,(v===ih.L||v===ih.C||v===ih.Q)&&(i=[s,l])),v){case ih.M:a=s=e[T++],o=l=e[T++],u(s,l);break;case ih.L:f=e[T++],p=e[T++],d(a,o,f,p),a=f,o=p;break;case ih.C:i.push(e[T++],e[T++],e[T++],e[T++],a=e[T++],o=e[T++]);break;case ih.Q:f=e[T++],p=e[T++],g=e[T++],m=e[T++],i.push(a+2/3*(f-a),o+2/3*(p-o),g+2/3*(f-g),m+2/3*(p-m),g,m),a=g,o=m;break;case ih.A:var _=e[T++],Q=e[T++],b=e[T++],x=e[T++],E=e[T++],S=e[T++]+E;T+=1;var C=!e[T++];f=Math.cos(E)*b+_,p=Math.sin(E)*x+Q,y?(s=f,l=p,u(s,l)):d(a,o,f,p),a=Math.cos(S)*b+_,o=Math.sin(S)*x+Q;for(var L=(C?-1:1)*Math.PI/2,w=E;C?w>S:w<S;w+=L){var O=C?Math.max(w+L,S):Math.min(w+L,S);h(w,O,_,Q,b,x)}break;case ih.R:s=a=e[T++],l=o=e[T++],f=s+e[T++],p=l+e[T++],u(f,l),d(f,l,f,p),d(f,p,s,p),d(s,p,s,l),d(s,l,f,l);break;case ih.Z:i&&d(a,o,s,l),a=s,o=l;break}}return i&&i.length>2&&n.push(i),n}function Dle(t,e,r,n,i,a,o,s,l,u){if(Xy(t,r)&&Xy(e,n)&&Xy(i,o)&&Xy(a,s)){l.push(o,s);return}var d=2/u,h=d*d,f=o-t,p=s-e,g=Math.sqrt(f*f+p*p);f/=g,p/=g;var m=r-t,T=n-e,v=i-o,y=a-s,_=m*m+T*T,Q=v*v+y*y;if(_<h&&Q<h){l.push(o,s);return}var b=f*m+p*T,x=-f*v-p*y,E=_-b*b,S=Q-x*x;if(E<h&&b>=0&&S<h&&x>=0){l.push(o,s);return}var C=[],L=[];v5(t,r,i,o,.5,C),v5(e,n,a,s,.5,L),Dle(C[0],L[0],C[1],L[1],C[2],L[2],C[3],L[3],l,u),Dle(C[4],L[4],C[5],L[5],C[6],L[6],C[7],L[7],l,u)}function LTr(t,e){var r=Rle(t),n=[];e=e||1;for(var i=0;i<r.length;i++){var a=r[i],o=[],s=a[0],l=a[1];o.push(s,l);for(var u=2;u<a.length;){var d=a[u++],h=a[u++],f=a[u++],p=a[u++],g=a[u++],m=a[u++];Dle(s,l,d,h,f,p,g,m,o,e),s=g,l=m}n.push(o)}return n}function UKe(t,e,r){var n=t[e],i=t[1-e],a=Math.abs(n/i),o=Math.ceil(Math.sqrt(a*r)),s=Math.floor(r/o);s===0&&(s=1,o=r);for(var l=[],u=0;u<o;u++)l.push(s);var d=o*s,h=r-d;if(h>0)for(var u=0;u<h;u++)l[u%o]+=1;return l}function zKe(t,e,r){for(var n=t.r0,i=t.r,a=t.startAngle,o=t.endAngle,s=Math.abs(o-a),l=s*i,u=i-n,d=l>Math.abs(u),h=UKe([l,u],d?0:1,e),f=(d?s:u)/h.length,p=0;p<h.length;p++)for(var g=(d?u:s)/h[p],m=0;m<h[p];m++){var T={};d?(T.startAngle=a+f*p,T.endAngle=a+f*(p+1),T.r0=n+g*m,T.r=n+g*(m+1)):(T.startAngle=a+g*m,T.endAngle=a+g*(m+1),T.r0=n+f*p,T.r=n+f*(p+1)),T.clockwise=t.clockwise,T.cx=t.cx,T.cy=t.cy,r.push(T)}}function wTr(t,e,r){for(var n=t.width,i=t.height,a=n>i,o=UKe([n,i],a?0:1,e),s=a?"width":"height",l=a?"height":"width",u=a?"x":"y",d=a?"y":"x",h=t[s]/o.length,f=0;f<o.length;f++)for(var p=t[l]/o[f],g=0;g<o[f];g++){var m={};m[u]=f*h,m[d]=g*p,m[s]=h,m[l]=p,m.x+=t.x,m.y+=t.y,r.push(m)}}function GKe(t,e,r,n){return t*n-r*e}function ATr(t,e,r,n,i,a,o,s){var l=r-t,u=n-e,d=o-i,h=s-a,f=GKe(d,h,l,u);if(Math.abs(f)<1e-6)return null;var p=t-i,g=e-a,m=GKe(p,g,d,h)/f;return m<0||m>1?null:new xr(m*l+t,m*u+e)}function OTr(t,e,r){var n=new xr;xr.sub(n,r,e),n.normalize();var i=new xr;xr.sub(i,t,e);var a=i.dot(n);return a}function Ky(t,e){var r=t[t.length-1];r&&r[0]===e[0]&&r[1]===e[1]||t.push(e)}function MTr(t,e,r){for(var n=t.length,i=[],a=0;a<n;a++){var o=t[a],s=t[(a+1)%n],l=ATr(o[0],o[1],s[0],s[1],e.x,e.y,r.x,r.y);l&&i.push({projPt:OTr(l,e,r),pt:l,idx:a})}if(i.length<2)return[{points:t},{points:t}];i.sort(function(T,v){return T.projPt-v.projPt});var u=i[0],d=i[i.length-1];if(d.idx<u.idx){var h=u;u=d,d=h}for(var f=[u.pt.x,u.pt.y],p=[d.pt.x,d.pt.y],g=[f],m=[p],a=u.idx+1;a<=d.idx;a++)Ky(g,t[a].slice());Ky(g,p),Ky(g,f);for(var a=d.idx+1;a<=u.idx+n;a++)Ky(m,t[a%n].slice());return Ky(m,f),Ky(m,p),[{points:g},{points:m}]}function qKe(t){var e=t.points,r=[],n=[];Pk(e,r,n);var i=new Cr(r[0],r[1],n[0]-r[0],n[1]-r[1]),a=i.width,o=i.height,s=i.x,l=i.y,u=new xr,d=new xr;return a>o?(u.x=d.x=s+a/2,u.y=l,d.y=l+o):(u.y=d.y=l+o/2,u.x=s,d.x=s+a),MTr(e,u,d)}function QH(t,e,r,n){if(r===1)n.push(e);else{var i=Math.floor(r/2),a=t(e);QH(t,a[0],i,n),QH(t,a[1],r-i,n)}return n}function RTr(t,e){for(var r=[],n=0;n<e;n++)r.push(Lne(t));return r}function DTr(t,e){e.setStyle(t.style),e.z=t.z,e.z2=t.z2,e.zlevel=t.zlevel}function NTr(t){for(var e=[],r=0;r<t.length;)e.push([t[r++],t[r++]]);return e}function ITr(t,e){var r=[],n=t.shape,i;switch(t.type){case"rect":wTr(n,e,r),i=dn;break;case"sector":zKe(n,e,r),i=eu;break;case"circle":zKe({r0:0,r:n.r,startAngle:0,endAngle:Math.PI*2,cx:n.cx,cy:n.cy},e,r),i=eu;break;default:var a=t.getComputedTransform(),o=a?Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1],a[2]*a[2]+a[3]*a[3])):1,s=bt(LTr(t.getUpdatedPathProxy(),o),function(v){return NTr(v)}),l=s.length;if(l===0)QH(qKe,{points:s[0]},e,r);else if(l===e)for(var u=0;u<l;u++)r.push({points:s[u]});else{var d=0,h=bt(s,function(v){var y=[],_=[];Pk(v,y,_);var Q=(_[1]-y[1])*(_[0]-y[0]);return d+=Q,{poly:v,area:Q}});h.sort(function(v,y){return y.area-v.area});for(var f=e,u=0;u<l;u++){var p=h[u];if(f<=0)break;var g=u===l-1?f:Math.ceil(p.area/d*e);g<0||(QH(qKe,{points:p.poly},g,r),f-=g)}}i=tu;break}if(!i)return RTr(t,e);for(var m=[],u=0;u<r.length;u++){var T=new i;T.setShape(r[u]),DTr(t,T),m.push(T)}return m}function kTr(t,e){var r=t.length,n=e.length;if(r===n)return[t,e];for(var i=[],a=[],o=r<n?t:e,s=Math.min(r,n),l=Math.abs(n-r)/6,u=(s-2)/6,d=Math.ceil(l/u)+1,h=[o[0],o[1]],f=l,p=2;p<s;){var g=o[p-2],m=o[p-1],T=o[p++],v=o[p++],y=o[p++],_=o[p++],Q=o[p++],b=o[p++];if(f<=0){h.push(T,v,y,_,Q,b);continue}for(var x=Math.min(f,d-1)+1,E=1;E<=x;E++){var S=E/x;v5(g,T,y,Q,S,i),v5(m,v,_,b,S,a),g=i[3],m=a[3],h.push(i[1],a[1],i[2],a[2],g,m),T=i[5],v=a[5],y=i[6],_=a[6]}f-=x-1}return o===t?[h,e]:[t,h]}function WKe(t,e){for(var r=t.length,n=t[r-2],i=t[r-1],a=[],o=0;o<e.length;)a[o++]=n,a[o++]=i;return a}function PTr(t,e){for(var r,n,i,a=[],o=[],s=0;s<Math.max(t.length,e.length);s++){var l=t[s],u=e[s],d=void 0,h=void 0;l?u?(r=kTr(l,u),d=r[0],h=r[1],n=d,i=h):(h=WKe(i||l,l),d=l):(d=WKe(n||u,u),h=u),a.push(d),o.push(h)}return[a,o]}function YKe(t){for(var e=0,r=0,n=0,i=t.length,a=0,o=i-2;a<i;o=a,a+=2){var s=t[o],l=t[o+1],u=t[a],d=t[a+1],h=s*d-u*l;e+=h,r+=(s+u)*h,n+=(l+d)*h}return e===0?[t[0]||0,t[1]||0]:[r/e/3,n/e/3,e]}function BTr(t,e,r,n){for(var i=(t.length-2)/6,a=1/0,o=0,s=t.length,l=s-2,u=0;u<i;u++){for(var d=u*6,h=0,f=0;f<s;f+=2){var p=f===0?d:(d+f-2)%l+2,g=t[p]-r[0],m=t[p+1]-r[1],T=e[f]-n[0],v=e[f+1]-n[1],y=T-g,_=v-m;h+=y*y+_*_}h<a&&(a=h,o=u)}return o}function HTr(t){for(var e=[],r=t.length,n=0;n<r;n+=2)e[n]=t[r-n-2],e[n+1]=t[r-n-1];return e}function FTr(t,e,r,n){for(var i=[],a,o=0;o<t.length;o++){var s=t[o],l=e[o],u=YKe(s),d=YKe(l);a==null&&(a=u[2]<0!=d[2]<0);var h=[],f=[],p=0,g=1/0,m=[],T=s.length;a&&(s=HTr(s));for(var v=BTr(s,l,u,d)*6,y=T-2,_=0;_<y;_+=2){var Q=(v+_)%y+2;h[_+2]=s[Q]-u[0],h[_+3]=s[Q+1]-u[1]}h[0]=s[v]-u[0],h[1]=s[v+1]-u[1];for(var b=n/r,x=-n/2;x<=n/2;x+=b){for(var E=Math.sin(x),S=Math.cos(x),C=0,_=0;_<s.length;_+=2){var L=h[_],w=h[_+1],O=l[_]-d[0],R=l[_+1]-d[1],M=O*S-R*E,D=O*E+R*S;m[_]=M,m[_+1]=D;var P=M-L,B=D-w;C+=P*P+B*B}if(C<g){g=C,p=x;for(var k=0;k<m.length;k++)f[k]=m[k]}}i.push({from:h,to:f,fromCp:u,toCp:d,rotation:-p})}return i}function xH(t){return t.__isCombineMorphing}var jKe="__mOriginal_";function EH(t,e,r){var n=jKe+e,i=t[n]||t[e];t[n]||(t[n]=t[e]);var a=r.replace,o=r.after,s=r.before;t[e]=function(){var l=arguments,u;return s&&s.apply(this,l),a?u=a.apply(this,l):u=i.apply(this,l),o&&o.apply(this,l),u}}function ww(t,e){var r=jKe+e;t[r]&&(t[e]=t[r],t[r]=null)}function XKe(t,e){for(var r=0;r<t.length;r++)for(var n=t[r],i=0;i<n.length;){var a=n[i],o=n[i+1];n[i++]=e[0]*a+e[2]*o+e[4],n[i++]=e[1]*a+e[3]*o+e[5]}}function KKe(t,e){var r=t.getUpdatedPathProxy(),n=e.getUpdatedPathProxy(),i=PTr(Rle(r),Rle(n)),a=i[0],o=i[1],s=t.getComputedTransform(),l=e.getComputedTransform();function u(){this.transform=null}s&&XKe(a,s),l&&XKe(o,l),EH(e,"updateTransform",{replace:u}),e.transform=null;var d=FTr(a,o,10,Math.PI),h=[];EH(e,"buildPath",{replace:function(f){for(var p=e.__morphT,g=1-p,m=[],T=0;T<d.length;T++){var v=d[T],y=v.from,_=v.to,Q=v.rotation*p,b=v.fromCp,x=v.toCp,E=Math.sin(Q),S=Math.cos(Q);JI(m,b,x,p);for(var C=0;C<y.length;C+=2){var L=y[C],w=y[C+1],O=_[C],R=_[C+1],M=L*g+O*p,D=w*g+R*p;h[C]=M*S-D*E+m[0],h[C+1]=M*E+D*S+m[1]}var P=h[0],B=h[1];f.moveTo(P,B);for(var C=2;C<y.length;){var O=h[C++],R=h[C++],k=h[C++],V=h[C++],H=h[C++],$=h[C++];P===O&&B===R&&k===H&&V===$?f.lineTo(H,$):f.bezierCurveTo(O,R,k,V,H,$),P=H,B=$}}}})}function Nle(t,e,r){if(!t||!e)return e;var n=r.done,i=r.during;KKe(t,e),e.__morphT=0;function a(){ww(e,"buildPath"),ww(e,"updateTransform"),e.__morphT=-1,e.createPathProxy(),e.dirtyShape()}return e.animateTo({__morphT:1},Sr({during:function(o){e.dirtyShape(),i&&i(o)},done:function(){a(),n&&n()}},r)),e}function VTr(t,e,r,n,i,a){var o=16;t=i===r?0:Math.round(32767*(t-r)/(i-r)),e=a===n?0:Math.round(32767*(e-n)/(a-n));for(var s=0,l,u=(1<<o)/2;u>0;u/=2){var d=0,h=0;(t&u)>0&&(d=1),(e&u)>0&&(h=1),s+=u*u*(3*d^h),h===0&&(d===1&&(t=u-1-t,e=u-1-e),l=t,t=e,e=l)}return s}function SH(t){var e=1/0,r=1/0,n=-1/0,i=-1/0,a=bt(t,function(s){var l=s.getBoundingRect(),u=s.getComputedTransform(),d=l.x+l.width/2+(u?u[4]:0),h=l.y+l.height/2+(u?u[5]:0);return e=Math.min(d,e),r=Math.min(h,r),n=Math.max(d,n),i=Math.max(h,i),[d,h]}),o=bt(a,function(s,l){return{cp:s,z:VTr(s[0],s[1],e,r,n,i),path:t[l]}});return o.sort(function(s,l){return s.z-l.z}).map(function(s){return s.path})}function ZKe(t){return ITr(t.path,t.count)}function Ile(){return{fromIndividuals:[],toIndividuals:[],count:0}}function $Tr(t,e,r){var n=[];function i(b){for(var x=0;x<b.length;x++){var E=b[x];xH(E)?i(E.childrenRef()):E instanceof vn&&n.push(E)}}i(t);var a=n.length;if(!a)return Ile();var o=r.dividePath||ZKe,s=o({path:e,count:a});if(s.length!==a)return console.error("Invalid morphing: unmatched splitted path"),Ile();n=SH(n),s=SH(s);for(var l=r.done,u=r.during,d=r.individualDelay,h=new Q4,f=0;f<a;f++){var p=n[f],g=s[f];g.parent=e,g.copyTransform(h),d||KKe(p,g)}e.__isCombineMorphing=!0,e.childrenRef=function(){return s};function m(b){for(var x=0;x<s.length;x++)s[x].addSelfToZr(b)}EH(e,"addSelfToZr",{after:function(b){m(b)}}),EH(e,"removeSelfFromZr",{after:function(b){for(var x=0;x<s.length;x++)s[x].removeSelfFromZr(b)}});function T(){e.__isCombineMorphing=!1,e.__morphT=-1,e.childrenRef=null,ww(e,"addSelfToZr"),ww(e,"removeSelfFromZr")}var v=s.length;if(d)for(var y=v,_=function(){y--,y===0&&(T(),l&&l())},f=0;f<v;f++){var Q=d?Sr({delay:(r.delay||0)+d(f,v,n[f],s[f]),done:_},r):r;Nle(n[f],s[f],Q)}else e.__morphT=0,e.animateTo({__morphT:1},Sr({during:function(b){for(var x=0;x<v;x++){var E=s[x];E.__morphT=e.__morphT,E.dirtyShape()}u&&u(b)},done:function(){T();for(var b=0;b<t.length;b++)ww(t[b],"updateTransform");l&&l()}},r));return e.__zr&&m(e.__zr),{fromIndividuals:n,toIndividuals:s,count:v}}function UTr(t,e,r){var n=e.length,i=[],a=r.dividePath||ZKe;function o(p){for(var g=0;g<p.length;g++){var m=p[g];xH(m)?o(m.childrenRef()):m instanceof vn&&i.push(m)}}if(xH(t)){o(t.childrenRef());var s=i.length;if(s<n)for(var l=0,u=s;u<n;u++)i.push(Lne(i[l++%s]));i.length=n}else{i=a({path:t,count:n});for(var d=t.getComputedTransform(),u=0;u<i.length;u++)i[u].setLocalTransform(d);if(i.length!==n)return console.error("Invalid morphing: unmatched splitted path"),Ile()}i=SH(i),e=SH(e);for(var h=r.individualDelay,u=0;u<n;u++){var f=h?Sr({delay:(r.delay||0)+h(u,n,i[u],e[u])},r):r;Nle(i[u],e[u],f)}return{fromIndividuals:i,toIndividuals:e,count:e.length}}function JKe(t){return yt(t[0])}function eZe(t,e){for(var r=[],n=t.length,i=0;i<n;i++)r.push({one:t[i],many:[]});for(var i=0;i<e.length;i++){var a=e[i].length,o=void 0;for(o=0;o<a;o++)r[o%n].many.push(e[i][o])}for(var s=0,i=n-1;i>=0;i--)if(!r[i].many.length){var l=r[s].many;if(l.length<=1)if(s)s=0;else return r;var a=l.length,u=Math.ceil(a/2);r[i].many=l.slice(u,a),r[s].many=l.slice(0,u),s++}return r}var zTr={clone:function(t){for(var e=[],r=1-Math.pow(1-t.path.style.opacity,1/t.count),n=0;n<t.count;n++){var i=Lne(t.path);i.setStyle("opacity",r),e.push(i)}return e},split:null};function kle(t,e,r,n,i,a){if(!t.length||!e.length)return;var o=J9("update",n,i);if(!(o&&o.duration>0))return;var s=n.getModel("universalTransition").get("delay"),l=Object.assign({setToFinal:!0},o),u,d;JKe(t)&&(u=t,d=e),JKe(e)&&(u=e,d=t);function h(v,y,_,Q,b){var x=v.many,E=v.one;if(x.length===1&&!b){var S=y?x[0]:E,C=y?E:x[0];if(xH(S))h({many:[S],one:C},!0,_,Q,!0);else{var L=s?Sr({delay:s(_,Q)},l):l;Nle(S,C,L),a(S,C,S,C,L)}}else for(var w=Sr({dividePath:zTr[r],individualDelay:s&&function(B,k,V,H){return s(B+_,Q)}},l),O=y?$Tr(x,E,w):UTr(E,x,w),R=O.fromIndividuals,M=O.toIndividuals,D=R.length,P=0;P<D;P++){var L=s?Sr({delay:s(P,D)},l):l;a(R[P],M[P],y?x[P]:v.one,y?v.one:x[P],L)}}for(var f=u?u===t:t.length>e.length,p=u?eZe(d,u):eZe(f?e:t,[f?t:e]),g=0,m=0;m<p.length;m++)g+=p[m].many.length;for(var T=0,m=0;m<p.length;m++)h(p[m],f,T,g),T+=p[m].many.length}function _8(t){if(!t)return[];if(yt(t)){for(var e=[],r=0;r<t.length;r++)e.push(_8(t[r]));return e}var n=[];return t.traverse(function(i){i instanceof vn&&!i.disableMorphing&&!i.invisible&&!i.ignore&&n.push(i)}),n}var tZe=1e4,GTr=0,rZe=1,nZe=2,qTr=fn();function WTr(t,e){for(var r=t.dimensions,n=0;n<r.length;n++){var i=t.getDimensionInfo(r[n]);if(i&&i.otherDims[e]===0)return r[n]}}function YTr(t,e,r){var n=t.getDimensionInfo(r),i=n&&n.ordinalMeta;if(n){var a=t.get(n.name,e);return i&&i.categories[a]||a+""}}function iZe(t,e,r,n){var i=n?"itemChildGroupId":"itemGroupId",a=WTr(t,i);if(a){var o=YTr(t,e,a);return o}var s=t.getRawDataItem(e),l=n?"childGroupId":"groupId";if(s&&s[l])return s[l]+"";if(!n)return r||t.getId(e)}function aZe(t){var e=[];return ue(t,function(r){var n=r.data,i=r.dataGroupId;if(n.count()>tZe){process.env.NODE_ENV!=="production"&&_a("Universal transition is disabled on large data > 10k.");return}for(var a=n.getIndices(),o=0;o<a.length;o++)e.push({data:n,groupId:iZe(n,o,i,!1),childGroupId:iZe(n,o,i,!0),divide:r.divide,dataIndex:o})}),e}function Ple(t,e,r){t.traverse(function(n){n instanceof vn&&na(n,{style:{opacity:0}},e,{dataIndex:r,isFrom:!0})})}function Ble(t){if(t.parent){var e=t.getComputedTransform();t.setLocalTransform(e),t.parent.remove(t)}}function Zy(t){t.stopAnimation(),t.isGroup&&t.traverse(function(e){e.stopAnimation()})}function jTr(t,e,r){var n=J9("update",r,e);n&&t.traverse(function(i){if(i instanceof $2){var a=Esr(i);a&&i.animateFrom({style:a},n)}})}function XTr(t,e){var r=t.length;if(r!==e.length)return!1;for(var n=0;n<r;n++){var i=t[n],a=e[n];if(i.data.getId(i.dataIndex)!==a.data.getId(a.dataIndex))return!1}return!0}function oZe(t,e,r){var n=aZe(t),i=aZe(e);function a(_,Q,b,x,E){(b||_)&&Q.animateFrom({style:b&&b!==_?gt(gt({},b.style),_.style):_.style},E)}var o=!1,s=GTr,l=ur(),u=ur();n.forEach(function(_){_.groupId&&l.set(_.groupId,!0),_.childGroupId&&u.set(_.childGroupId,!0)});for(var d=0;d<i.length;d++){var h=i[d].groupId;if(u.get(h)){s=rZe;break}var f=i[d].childGroupId;if(f&&l.get(f)){s=nZe;break}}function p(_,Q){return function(b){var x=b.data,E=b.dataIndex;return Q?x.getId(E):_?s===rZe?b.childGroupId:b.groupId:s===nZe?b.childGroupId:b.groupId}}var g=XTr(n,i),m={};if(!g)for(var d=0;d<i.length;d++){var T=i[d],v=T.data.getItemGraphicEl(T.dataIndex);v&&(m[v.id]=!0)}function y(_,Q){var b=n[Q],x=i[_],E=x.data.hostModel,S=b.data.getItemGraphicEl(b.dataIndex),C=x.data.getItemGraphicEl(x.dataIndex);if(S===C){C&&jTr(C,x.dataIndex,E);return}S&&m[S.id]||C&&(Zy(C),S?(Zy(S),Ble(S),o=!0,kle(_8(S),_8(C),x.divide,E,_,a)):Ple(C,E,_))}new I4(n,i,p(!0,g),p(!1,g),null,"multiple").update(y).updateManyToOne(function(_,Q){var b=i[_],x=b.data,E=x.hostModel,S=x.getItemGraphicEl(b.dataIndex),C=li(bt(Q,function(L){return n[L].data.getItemGraphicEl(n[L].dataIndex)}),function(L){return L&&L!==S&&!m[L.id]});S&&(Zy(S),C.length?(ue(C,function(L){Zy(L),Ble(L)}),o=!0,kle(_8(C),_8(S),b.divide,E,_,a)):Ple(S,E,b.dataIndex))}).updateOneToMany(function(_,Q){var b=n[Q],x=b.data.getItemGraphicEl(b.dataIndex);if(!(x&&m[x.id])){var E=li(bt(_,function(C){return i[C].data.getItemGraphicEl(i[C].dataIndex)}),function(C){return C&&C!==x}),S=i[_[0]].data.hostModel;E.length&&(ue(E,function(C){return Zy(C)}),x?(Zy(x),Ble(x),o=!0,kle(_8(x),_8(E),b.divide,S,_[0],a)):ue(E,function(C){return Ple(C,S,_[0])}))}}).updateManyToMany(function(_,Q){new I4(Q,_,function(b){return n[b].data.getId(n[b].dataIndex)},function(b){return i[b].data.getId(i[b].dataIndex)}).update(function(b,x){y(_[b],Q[x])}).execute()}).execute(),o&&ue(e,function(_){var Q=_.data,b=Q.hostModel,x=b&&r.getViewOfSeriesModel(b),E=J9("update",b,0);x&&b.isAnimationEnabled()&&E&&E.duration>0&&x.group.traverse(function(S){S instanceof vn&&!S.animators.length&&S.animateFrom({style:{opacity:0}},E)})})}function sZe(t){var e=t.getModel("universalTransition").get("seriesKey");return e||t.id}function lZe(t){return yt(t)?t.sort().join(","):t}function K5(t){if(t.hostModel)return t.hostModel.getModel("universalTransition").get("divideShape")}function KTr(t,e){var r=ur(),n=ur(),i=ur();ue(t.oldSeries,function(o,s){var l=t.oldDataGroupIds[s],u=t.oldData[s],d=sZe(o),h=lZe(d);n.set(h,{dataGroupId:l,data:u}),yt(d)&&ue(d,function(f){i.set(f,{key:h,dataGroupId:l,data:u})})});function a(o){r.get(o)&&_a("Duplicated seriesKey in universalTransition "+o)}return ue(e.updatedSeries,function(o){if(o.isUniversalTransitionEnabled()&&o.isAnimationEnabled()){var s=o.get("dataGroupId"),l=o.getData(),u=sZe(o),d=lZe(u),h=n.get(d);if(h)process.env.NODE_ENV!=="production"&&a(d),r.set(d,{oldSeries:[{dataGroupId:h.dataGroupId,divide:K5(h.data),data:h.data}],newSeries:[{dataGroupId:s,divide:K5(l),data:l}]});else if(yt(u)){process.env.NODE_ENV!=="production"&&a(d);var f=[];ue(u,function(m){var T=n.get(m);T.data&&f.push({dataGroupId:T.dataGroupId,divide:K5(T.data),data:T.data})}),f.length&&r.set(d,{oldSeries:f,newSeries:[{dataGroupId:s,data:l,divide:K5(l)}]})}else{var p=i.get(u);if(p){var g=r.get(p.key);g||(g={oldSeries:[{dataGroupId:p.dataGroupId,data:p.data,divide:K5(p.data)}],newSeries:[]},r.set(p.key,g)),g.newSeries.push({dataGroupId:s,data:l,divide:K5(l)})}}}}),r}function uZe(t,e){for(var r=0;r<t.length;r++){var n=e.seriesIndex!=null&&e.seriesIndex===t[r].seriesIndex||e.seriesId!=null&&e.seriesId===t[r].id;if(n)return r}}function ZTr(t,e,r,n){var i=[],a=[];ue(Ri(t.from),function(o){var s=uZe(e.oldSeries,o);s>=0&&i.push({dataGroupId:e.oldDataGroupIds[s],data:e.oldData[s],divide:K5(e.oldData[s]),groupIdDim:o.dimension})}),ue(Ri(t.to),function(o){var s=uZe(r.updatedSeries,o);if(s>=0){var l=r.updatedSeries[s].getData();a.push({dataGroupId:e.oldDataGroupIds[s],data:l,divide:K5(l),groupIdDim:o.dimension})}}),i.length>0&&a.length>0&&oZe(i,a,n)}function JTr(t){t.registerUpdateLifecycle("series:beforeupdate",function(e,r,n){ue(Ri(n.seriesTransition),function(i){ue(Ri(i.to),function(a){for(var o=n.updatedSeries,s=0;s<o.length;s++)(a.seriesIndex!=null&&a.seriesIndex===o[s].seriesIndex||a.seriesId!=null&&a.seriesId===o[s].id)&&(o[s][CP]=!0)})})}),t.registerUpdateLifecycle("series:transition",function(e,r,n){var i=qTr(r);if(i.oldSeries&&n.updatedSeries&&n.optionChanged){var a=n.seriesTransition;if(a)ue(Ri(a),function(p){ZTr(p,i,n,r)});else{var o=KTr(i,n);ue(o.keys(),function(p){var g=o.get(p);oZe(g.oldSeries,g.newSeries,r)})}ue(n.updatedSeries,function(p){p[CP]&&(p[CP]=!1)})}for(var s=e.getSeries(),l=i.oldSeries=[],u=i.oldDataGroupIds=[],d=i.oldData=[],h=0;h<s.length;h++){var f=s[h].getData();f.count()<tZe&&(l.push(s[h]),u.push(s[h].get("dataGroupId")),d.push(f))}})}var evr=function(){function t(){this.breaks=[],this._elapsedExtent=[1/0,-1/0]}return t.prototype.setBreaks=function(e){this.breaks=e.breaks},t.prototype.update=function(e){rvr(this,e);var r=this._elapsedExtent;r[0]=this.elapse(e[0]),r[1]=this.elapse(e[1])},t.prototype.hasBreaks=function(){return!!this.breaks.length},t.prototype.calcNiceTickMultiple=function(e,r){for(var n=0;n<this.breaks.length;n++){var i=this.breaks[n];if(i.vmin<e&&e<i.vmax){var a=r(e,i.vmax);return process.env.NODE_ENV!=="production"&&nr(a>=0&&Math.round(a)===a),a}}return 0},t.prototype.getExtentSpan=function(){return this._elapsedExtent[1]-this._elapsedExtent[0]},t.prototype.normalize=function(e){var r=this._elapsedExtent[1]-this._elapsedExtent[0];return r===0?.5:(this.elapse(e)-this._elapsedExtent[0])/r},t.prototype.scale=function(e){return this.unelapse(e*(this._elapsedExtent[1]-this._elapsedExtent[0])+this._elapsedExtent[0])},t.prototype.elapse=function(e){for(var r=cZe,n=dZe,i=!0,a=0;a<this.breaks.length;a++){var o=this.breaks[a];if(e<=o.vmax){e>o.vmin?r+=o.vmin-n+(e-o.vmin)/(o.vmax-o.vmin)*o.gapReal:r+=e-n,n=o.vmax,i=!1;break}r+=o.vmin-n+o.gapReal,n=o.vmax}return i&&(r+=e-n),r},t.prototype.unelapse=function(e){for(var r=cZe,n=dZe,i=!0,a=0,o=0;o<this.breaks.length;o++){var s=this.breaks[o],l=r+s.vmin-n,u=l+s.gapReal;if(e<=u){e>l?a=s.vmin+(e-l)/(u-l)*(s.vmax-s.vmin):a=n+e-r,n=s.vmax,i=!1;break}r=u,n=s.vmax}return i&&(a=n+e-r),a},t}();function tvr(){return new evr}var cZe=0,dZe=0;function rvr(t,e){var r=0,n={tpAbs:{span:0,val:0},tpPrct:{span:0,val:0}},i=function(){return{has:!1,span:NaN,inExtFrac:NaN,val:NaN}},a={S:{tpAbs:i(),tpPrct:i()},E:{tpAbs:i(),tpPrct:i()}};ue(t.breaks,function(s){var l=s.gapParsed;l.type==="tpPrct"&&(r+=l.val);var u=Hle(s,e);if(u){var d=u.vmin!==s.vmin,h=u.vmax!==s.vmax,f=u.vmax-u.vmin;if(!(d&&h))if(d||h){var p=d?"S":"E";a[p][l.type].has=!0,a[p][l.type].span=f,a[p][l.type].inExtFrac=f/(s.vmax-s.vmin),a[p][l.type].val=l.val}else n[l.type].span+=f,n[l.type].val+=l.val}});var o=r*(0+(e[1]-e[0])+(n.tpAbs.val-n.tpAbs.span)+(a.S.tpAbs.has?(a.S.tpAbs.val-a.S.tpAbs.span)*a.S.tpAbs.inExtFrac:0)+(a.E.tpAbs.has?(a.E.tpAbs.val-a.E.tpAbs.span)*a.E.tpAbs.inExtFrac:0)-n.tpPrct.span-(a.S.tpPrct.has?a.S.tpPrct.span*a.S.tpPrct.inExtFrac:0)-(a.E.tpPrct.has?a.E.tpPrct.span*a.E.tpPrct.inExtFrac:0))/(1-n.tpPrct.val-(a.S.tpPrct.has?a.S.tpPrct.val*a.S.tpPrct.inExtFrac:0)-(a.E.tpPrct.has?a.E.tpPrct.val*a.E.tpPrct.inExtFrac:0));ue(t.breaks,function(s){var l=s.gapParsed;l.type==="tpPrct"&&(s.gapReal=r!==0?Math.max(o,0)*l.val/r:0),l.type==="tpAbs"&&(s.gapReal=l.val),s.gapReal==null&&(s.gapReal=0)})}function nvr(t,e,r,n,i,a){t!=="no"&&ue(r,function(o){var s=Hle(o,a);if(s)for(var l=e.length-1;l>=0;l--){var u=e[l],d=n(u),h=i*3/4;d>s.vmin-h&&d<s.vmax+h&&(t!=="preserve_extent_bound"||d!==a[0]&&d!==a[1])&&e.splice(l,1)}})}function ivr(t,e,r,n){ue(e,function(i){var a=Hle(i,r);a&&(t.push({value:a.vmin,break:{type:"vmin",parsedBreak:a},time:n?n(a):void 0}),t.push({value:a.vmax,break:{type:"vmax",parsedBreak:a},time:n?n(a):void 0}))}),e.length&&t.sort(function(i,a){return i.value-a.value})}function Hle(t,e){var r=Math.max(t.vmin,e[0]),n=Math.min(t.vmax,e[1]);return r<n||r===n&&r>e[0]&&r<e[1]?{vmin:r,vmax:n,breakOption:t.breakOption,gapParsed:t.gapParsed,gapReal:t.gapReal}:null}function Fle(t,e,r){var n=[];if(!t)return{breaks:n};function i(o,s){return o>=0&&o<1-1e-5?!0:(process.env.NODE_ENV!=="production"&&kn(s+" must be >= 0 and < 1, rather than "+o+" ."),!1)}ue(t,function(o){if(!o||o.start==null||o.end==null){process.env.NODE_ENV!=="production"&&kn("The input axis breaks start/end should not be empty.");return}if(!o.isExpanded){var s={breakOption:br(o),vmin:e(o.start),vmax:e(o.end),gapParsed:{type:"tpAbs",val:0},gapReal:null};if(o.gap!=null){var l=!1;if(zt(o.gap)){var u=k2(o.gap);if(u.match(/%$/)){var d=parseFloat(u)/100;i(d,"Percent gap")||(d=0),s.gapParsed.type="tpPrct",s.gapParsed.val=d,l=!0}}if(!l){var h=e(o.gap);(!isFinite(h)||h<0)&&(process.env.NODE_ENV!=="production"&&kn("Axis breaks gap must positive finite rather than ("+o.gap+")."),h=0),s.gapParsed.type="tpAbs",s.gapParsed.val=h}}if(s.vmin===s.vmax&&(s.gapParsed.type="tpAbs",s.gapParsed.val=0),r&&r.noNegative&&ue(["vmin","vmax"],function(p){s[p]<0&&(process.env.NODE_ENV!=="production"&&kn("Axis break."+p+" must not be negative."),s[p]=0)}),s.vmin>s.vmax){var f=s.vmax;s.vmax=s.vmin,s.vmin=f}n.push(s)}}),n.sort(function(o,s){return o.vmin-s.vmin});var a=-1/0;return ue(n,function(o,s){a>o.vmin&&(process.env.NODE_ENV!=="production"&&kn("Axis breaks must not overlap."),n[s]=null),a=o.vmax}),{breaks:n.filter(function(o){return!!o})}}function Vle(t,e){return $le(e)===$le(t)}function $le(t){return t.start+"_\0_"+t.end}function avr(t,e,r){var n=[];ue(t,function(a,o){var s=e(a);s&&s.type==="vmin"&&n.push([o])}),ue(t,function(a,o){var s=e(a);if(s&&s.type==="vmax"){var l=rm(n,function(u){return Vle(e(t[u[0]]).parsedBreak.breakOption,s.parsedBreak.breakOption)});l&&l.push(o)}});var i=[];return ue(n,function(a){a.length===2&&i.push(r?a:[t[a[0]],t[a[1]]])}),i}function ovr(t,e,r,n){var i,a;if(t.break){var o=t.break.parsedBreak,s=rm(r,function(h){return Vle(h.breakOption,t.break.parsedBreak.breakOption)}),l=n(Math.pow(e,o.vmin),s.vmin),u=n(Math.pow(e,o.vmax),s.vmax),d={type:o.gapParsed.type,val:o.gapParsed.type==="tpAbs"?Co(Math.pow(e,o.vmin+o.gapParsed.val))-l:o.gapParsed.val};i={type:t.break.type,parsedBreak:{breakOption:o.breakOption,vmin:l,vmax:u,gapParsed:d,gapReal:o.gapReal}},a=s[t.break.type]}return{brkRoundingCriterion:a,vBreak:i}}function svr(t,e,r){var n={noNegative:!0},i=Fle(t,r,n),a=Fle(t,r,n),o=Math.log(e);return a.breaks=bt(a.breaks,function(s){var l=Math.log(s.vmin)/o,u=Math.log(s.vmax)/o,d={type:s.gapParsed.type,val:s.gapParsed.type==="tpAbs"?Math.log(s.vmin+s.gapParsed.val)/o-l:s.gapParsed.val};return{vmin:l,vmax:u,gapParsed:d,gapReal:s.gapReal,breakOption:s.breakOption}}),{parsedOriginal:i,parsedLogged:a}}var lvr={vmin:"start",vmax:"end"};function uvr(t,e){return e&&(t=t||{},t.break={type:lvr[e.type],start:e.parsedBreak.vmin,end:e.parsedBreak.vmax}),t}function cvr(){Wsr({createScaleBreakContext:tvr,pruneTicksByBreak:nvr,addBreaksToTicks:ivr,parseAxisBreakOption:Fle,identifyAxisBreak:Vle,serializeAxisBreakIdentifier:$le,retrieveAxisBreakPairs:avr,getTicksLogTransformBreak:ovr,logarithmicParseBreaksFromOption:svr,makeAxisLabelFormatterParamBreak:uvr})}var hZe=fn();function dvr(t,e){var r=rm(t,function(n){return Oo().identifyAxisBreak(n.parsedBreak.breakOption,e.breakOption)});return r||t.push(r={zigzagRandomList:[],parsedBreak:e,shouldRemove:!1}),r}function hvr(t){ue(t,function(e){return e.shouldRemove=!0})}function fvr(t){for(var e=t.length-1;e>=0;e--)t[e].shouldRemove&&t.splice(e,1)}function pvr(t,e,r,n,i){var a=r.axis;if(a.scale.isBlank()||!Oo())return;var o=Oo().retrieveAxisBreakPairs(a.scale.getTicks({breakTicks:"only_break"}),function(C){return C.break},!1);if(!o.length)return;var s=r.getModel("breakArea"),l=s.get("zigzagAmplitude"),u=s.get("zigzagMinSpan"),d=s.get("zigzagMaxSpan");u=Math.max(2,u||0),d=Math.max(u,d||0);var h=s.get("expandOnClick"),f=s.get("zigzagZ"),p=s.getModel("itemStyle"),g=p.getItemStyle(),m=g.stroke,T=g.lineWidth,v=g.lineDash,y=g.fill,_=new Tr({ignoreModelZ:!0}),Q=a.isHorizontal(),b=hZe(e).visualList||(hZe(e).visualList=[]);hvr(b);for(var x=function(C){var L=o[C][0].break.parsedBreak,w=[];w[0]=a.toGlobalCoord(a.dataToCoord(L.vmin,!0)),w[1]=a.toGlobalCoord(a.dataToCoord(L.vmax,!0)),w[1]<w[0]&&w.reverse();var O=dvr(b,L);O.shouldRemove=!1;var R=new Tr;S(O.zigzagRandomList,R,w[0],w[1],Q,L),h&&R.on("click",function(){var M={type:TB,breaks:[{start:L.breakOption.start,end:L.breakOption.end}]};M[a.dim+"AxisIndex"]=r.componentIndex,i.dispatchAction(M)}),R.silent=!h,_.add(R)},E=0;E<o.length;E++)x(E);t.add(_),fvr(b);function S(C,L,w,O,R,M){var D={stroke:m,lineWidth:T,lineDash:v,fill:"none"},P=R?0:1,B=1-P,k=n[Pr[B]]+n[Ao[B]];function V(ae){var le=[],oe=[];le[P]=oe[P]=ae,le[B]=n[Pr[B]],oe[B]=k;var Ce={x1:le[0],y1:le[1],x2:oe[0],y2:oe[1]};return Fk(Ce,Ce,{lineWidth:1}),le[0]=Ce.x1,le[1]=Ce.y1,le[P]}w=V(w),O=V(O);for(var H=[],$=[],G=!0,U=n[Pr[B]],Y=0;;Y++){var ne=U===n[Pr[B]],te=U>=k;te&&(U=k);var ee=[],ie=[];ee[P]=w,ie[P]=O,!ne&&!te&&(ee[P]+=G?-l:l,ie[P]-=G?l:-l),ee[B]=U,ie[B]=U,H.push(ee),$.push(ie);var j=void 0;if(Y<C.length?j=C[Y]:(j=Math.random(),C.push(j)),U+=j*(d-u)+u,G=!G,te)break}var X=Oo().serializeAxisBreakIdentifier(M.breakOption);if(L.add(new yl({anid:"break_a_"+X,shape:{points:H},style:D,z:f})),M.gapReal!==0){L.add(new yl({anid:"break_b_"+X,shape:{points:$},style:D,z:f}));var Z=$.slice();Z.reverse();var K=H.concat(Z);L.add(new tu({anid:"break_c_"+X,shape:{points:K},style:{fill:y,opacity:g.opacity},z:f}))}}}function gvr(t,e,r,n){var i=t.axis,a=r.transform;nr(n.style);var o=i.getExtent();i.inverse&&(o=o.slice(),o.reverse());var s=Oo().retrieveAxisBreakPairs(i.scale.getTicks({breakTicks:"only_break"}),function(T){return T.break},!1),l=bt(s,function(T){var v=T[0].break.parsedBreak,y=[i.dataToCoord(v.vmin,!0),i.dataToCoord(v.vmax,!0)];return y[0]>y[1]&&y.reverse(),{coordPair:y,brkId:Oo().serializeAxisBreakIdentifier(v.breakOption)}});l.sort(function(T,v){return T.coordPair[0]-v.coordPair[0]});for(var u=o[0],d=null,h=0;h<l.length;h++){var f=l[h],p=Math.max(f.coordPair[0],o[0]),g=Math.min(f.coordPair[1],o[1]);u<=p&&m(u,p,d,f),u=g,d=f}u<=o[1]&&m(u,o[1],d,null);function m(T,v,y,_){function Q(w,O){a&&(lo(w,w,a),lo(O,O,a))}function b(w,O){var R={x1:w[0],y1:w[1],x2:O[0],y2:O[1]};Fk(R,R,n.style),w[0]=R.x1,w[1]=R.y1,O[0]=R.x2,O[1]=R.y2}var x=[T,0],E=[v,0],S=[T,5],C=[v,5];Q(x,S),b(x,S),Q(E,C),b(E,C),b(x,E);var L=new wo(gt({shape:{x1:x[0],y1:x[1],x2:E[0],y2:E[1]}},n));e.add(L),L.anid="breakLine_"+(y?y.brkId:"\0")+"_\0_"+(_?_.brkId:"\0")}}function mvr(t,e,r){if(rm(r,function(y){return!y}))return;var n=new xr;if(!aB(r[0],r[1],n,{direction:-(t?e+Math.PI:e),touchThreshold:0,bidirectional:!1}))return;var i=qs();g5(i,i,-e);var a=bt(r,function(y){return y.transform?w3(qs(),i,y.transform):i});function o(y){var _=r[0].localRect,Q=new xr(_[Ao[y]]*a[0][0],_[Ao[y]]*a[0][1]);return Math.abs(Q.y)<1e-5}var s=.5;if(o(0)||o(1)){var l=bt(r,function(y,_){var Q=y.localRect.clone();return Q.applyTransform(a[_]),Q}),u=new xr;u.copy(r[0].label).add(r[1].label).scale(.5),u.transform(i);var d=n.clone().transform(i),h=l[0].x+l[1].x+(d.x>=0?l[0].width:l[1].width),f=(h+d.x)/2-u.x,p=Math.min(f,f-d.x),g=Math.max(f,f-d.x),m=g<0?g:p>0?p:0;s=(f-m)/d.x}var T=new xr,v=new xr;xr.scale(T,n,-s),xr.scale(v,n,1-s),pae(r[0],T),pae(r[1],v)}function Tvr(t,e){var r={breaks:[]};return ue(e.breaks,function(n){if(n){var i=rm(t.get("breaks",!0),function(s){return Oo().identifyAxisBreak(s,n)});if(!i){process.env.NODE_ENV!=="production"&&_a("Can not find axis break by start: "+n.start+", end: "+n.end);return}var a=e.type,o={isExpanded:!!i.isExpanded};i.isExpanded=a===TB?!0:a===QGe?!1:a===xGe?!i.isExpanded:i.isExpanded,r.breaks.push({start:i.start,end:i.end,isExpanded:!!i.isExpanded,old:o})}}),r}function vvr(){pdr({adjustBreakLabelPair:mvr,buildAxisBreakLine:gvr,rectCoordBuildBreakAxis:pvr,updateModelAxisBreak:Tvr})}function yvr(t){_dr(t),cvr(),vvr()}function _vr(){Vdr(bvr)}function bvr(t,e){ue(t,function(r){if(!r.model.get(["axisLabel","inside"])){var n=Qvr(r);if(n){var i=r.isHorizontal()?"height":"width",a=r.model.get(["axisLabel","margin"]);e[i]-=n[i]+a,r.position==="top"?e.y+=n.height+a:r.position==="left"&&(e.x+=n.width+a)}}})}function Qvr(t){var e=t.model,r=t.scale;if(!e.get(["axisLabel","show"])||r.isBlank())return;var n,i,a=r.getExtent();r instanceof xy?i=r.count():(n=r.getTicks(),i=n.length);var o=t.getLabelModel(),s=Sy(t),l,u=1;i>40&&(u=Math.ceil(i/40));for(var d=0;d<i;d+=u){var h=n?n[d]:{value:a[0]+d},f=s(h,d),p=o.getTextRect(f),g=m(p,o.get("rotate")||0);l?l.union(g):l=g}return l;function m(T,v){var y=v*Math.PI/180,_=T.width,Q=T.height,b=_*Math.abs(Math.cos(y))+Math.abs(Q*Math.sin(y)),x=_*Math.abs(Math.sin(y))+Math.abs(Q*Math.cos(y)),E=new Cr(T.x,T.y,b,x);return E}}rn([h0r]),rn([s0r]),rn([R0r,W0r,ndr,o3r,T3r,ohr,Dhr,mfr,Pfr,zfr,Xfr,i4r,K4r,b6r,R6r,Y6r,Z6r,l5r,g5r,C5r,R5r,$5r,Spr]),rn(zpr),rn(ggr),rn(Mqe),rn(Lgr),rn(rYe),rn(Mgr),rn(Kgr),rn(o7r),rn(q7r),rn(dmr),rn(Tw),rn(Lmr),rn(Omr),rn(Fmr),rn(Ymr),rn(e8r),rn(o8r),rn(m8r),rn(I8r),rn(mKe),rn(vKe),rn(tTr),rn(NKe),rn(kKe),rn(aTr),rn(cTr),rn(xTr),rn(CTr),rn(JTr),rn(L2r),rn(yvr),rn(_vr),rn(s3r);const xvr=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,Evr=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,Svr=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function Cvr(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){Lvr(t);return}return e}function Lvr(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function wvr(t,e={}){if(typeof t!="string")return t;if(t[0]==='"'&&t[t.length-1]==='"'&&t.indexOf("\\")===-1)return t.slice(1,-1);const r=t.trim();if(r.length<=9)switch(r.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!Svr.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(xvr.test(t)||Evr.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,Cvr)}return JSON.parse(t)}catch(n){if(e.strict)throw n;return t}}const Avr={class:"echarts-content"},Ovr={class:"echartsWrap"},Mvr={key:0,class:"echartsContent",ref:"echartsContent"},Rvr=oa({__name:"EchartsParser",props:{code:{type:String,required:!0}},setup(t){const e=Dh.PRESENTED_IMAGE_SIMPLE,r=[{value:1,label:"\u56FE\u8868"},{value:2,label:"\u6E90\u7801"}],n=I.ref(r[0].value),i=I.useTemplateRef("echartsContent"),a=I.ref(!1);let o=!1,s=null;const{stop:l}=pPe(i,()=>{s.resize()});I.onMounted(()=>{s=zcr(i.value)}),I.onUnmounted(()=>{l()}),dPe(()=>t.code,d=>{const h=wvr(d);if(typeof h=="string")o||(o=!0,s.showLoading());else{o=!1,s.hideLoading();try{s.setOption(h)}catch(f){a.value=!0,console.error("\u51FA\u9519\u5566\u554A",f)}}},{immediate:!0,debounce:50,maxWait:100});const u=async()=>{try{await dI(t.code),ma.success("\u590D\u5236\u6210\u529F!")}catch(d){ma.error(d)}};return(d,h)=>{const f=Z7e,p=Jc,g=k6,m=Dh;return I.openBlock(),I.createElementBlock("div",Avr,[I.createVNode(Dte,null,{title:I.withCtx(()=>[I.createVNode(f,{value:n.value,"onUpdate:value":h[0]||(h[0]=T=>n.value=T),options:r},null,8,["value"])]),actions:I.withCtx(()=>[I.createVNode(g,null,{title:I.withCtx(()=>h[1]||(h[1]=[I.createTextVNode("\u590D\u5236")])),default:I.withCtx(()=>[I.createVNode(p,{type:"text",size:"small",onClick:u},{default:I.withCtx(()=>[I.createVNode(I.unref(ox))]),_:1})]),_:1})]),_:1}),I.withDirectives(I.createElementVNode("div",Ovr,[a.value?(I.openBlock(),I.createBlock(m,{key:1,description:"\u6E32\u67D3\u5931\u8D25",image:I.unref(e)},null,8,["image"])):(I.openBlock(),I.createElementBlock("div",Mvr,null,512))],512),[[I.vShow,n.value===1]]),I.withDirectives(I.createElementVNode("pre",{class:"code-wrapper"},I.toDisplayString(t.code),513),[[I.vShow,n.value===2]])])}}},[["__scopeId","data-v-dfbed27b"]]),Dvr={__name:"FenceParser",props:{node:{type:Object,default:()=>null}},setup(t){const e=I.ref(""),r=I.ref("");return I.watch(()=>t.node,()=>{t.node&&SE(t.node,n=>{var i,a,o;n.type==="text"?e.value=n.value:n.type==="element"&&n.tagName==="code"&&(r.value=((o=(a=(i=n.properties)==null?void 0:i.className)==null?void 0:a[0])==null?void 0:o.replace("language-",""))||"")})},{immediate:!0}),(n,i)=>r.value==="mermaid"?(I.openBlock(),I.createBlock(Dnr,{key:0,code:e.value},null,8,["code"])):r.value==="echarts"?(I.openBlock(),I.createBlock(Rvr,{key:1,code:e.value},null,8,["code"])):(I.openBlock(),I.createBlock(fnr,{key:2,code:e.value,lang:r.value},null,8,["code","lang"]))}},Nvr={class:"markdown-body"},CH=Object.assign({name:"AiMdParser"},{__name:"MdParser",props:I.mergeDefaults({content:String},{content:""}),setup(t){function e(d){const h=[];let f=0;return d=d.replace(/\$\$([\s\S]*?)\$\$/g,p=>{const g=`__PROTECTED_MATH_BLOCK_${f}__`;return h[f]=p,f++,g}),d=d.replace(/\$([^\$\n]+?)\$/g,(p,g)=>{if(/[\u4e00-\u9fa5。,、“”‘’;:?!【】()《》]/.test(g))return p;const m=`__PROTECTED_INLINE_MATH_${f}__`;return h[f]=p,f++,m}),d=d.replace(/```[\s\S]*?```/g,p=>{const g=`__PROTECTED_CODE_BLOCK_${f}__`;return h[f]=p,f++,g}),d=d.replace(/`([^`]+)`/g,p=>{const g=`__PROTECTED_INLINE_CODE_${f}__`;return h[f]=p,f++,g}),{markdown:d,protectedRegions:h}}function r(d,h){let f=d;return h.forEach((p,g)=>{let m="INLINE_CODE";p.startsWith("```")?m="CODE_BLOCK":p.startsWith("$$")?m="MATH_BLOCK":p.startsWith("$")&&(m="INLINE_MATH");const T=`__PROTECTED_${m}_${g}__`;f=f.split(T).join(p)}),f}function n(d){return d.replace(/\\n/g,`
|
|
964
|
-
`).replace(/\\r/g,"\r").replace(/\\t/g," ").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\v/g,"\v").replace(/\$/g,"\\$")}function i(d){const{markdown:h,protectedRegions:f}=e(d),p=n(h);return r(p,f)}const a=/(?:https?:\/\/|www\.)?(?:\d{1,3}(?:\.\d{1,3}){3}|\w[-\w.]+(?:\.[a-zA-Z]{2,}))(?:\:\d+)?(?:\/[^\s\)\[\]\}\u4e00-\u9fa5。()"'“”‘’}]*)?(?:\?[^\s\)\[\]\}\u4e00-\u9fa5。()"'“”‘’}]*)?(?:#[^\s\)\[\]\}\u4e00-\u9fa5。()"'“”‘’}]*)?/g;function o(d){const h=[];return d.replace(/<[^>]+>/gi,g=>(h.push(g),`__PROTECTED_PLACEHOLDER_${h.length-1}__`)).replace(a,g=>` ${g} `).replace(/__PROTECTED_PLACEHOLDER_(\d+)__/g,(g,m)=>h[m])}const s=d=>Lxt(i,o)(d),l=I.computed(()=>s(t.content)),u={singleTilde:!1};return(d,h)=>{const f=Eg;return I.openBlock(),I.createElementBlock("div",Nvr,[I.createVNode(Rte,{markdown:l.value,remarkPlugins:[[I.unref(AWt),u],I.unref(zWt),I.unref(RWt),I.unref(UWt)],rehypePlugins:[I.unref(EKt),I.unref(WKt),I.unref(Dtr)]},{a:I.withCtx(({node:p})=>{var g;return[I.createElementVNode("a",I.mergeProps(p.properties,{target:"_blank",rel:"noopener noreferrer"}),I.toDisplayString((g=p.children[0])==null?void 0:g.value),17)]}),pre:I.withCtx(({node:p})=>[I.createVNode(Dvr,{node:p},null,8,["node"])]),img:I.withCtx(({node:p})=>[I.createVNode(f,I.mergeProps(p.properties,{previewMask:!1,style:{cursor:"pointer"}}),null,16)]),_:1},8,["markdown","remarkPlugins","rehypePlugins"])])}}}),Ivr={key:0,class:"ai-chat-record-avatar"},kvr={class:"ai-chat-record-wrap"},Pvr={class:"ai-chat-record-head"},Bvr={key:0,class:"ai-chat-record-time"},Hvr={class:"ai-chat-record-body"},Fvr={key:0,class:"ai-chat-record-loading-wrap"},Vvr={key:1,class:"ai-chat-record-content"},$vr={class:"ai-chat-record-content-before"},Uvr={class:"ai-chat-record-content-inner"},zvr={class:"ai-chat-record-content-after"},Gvr={key:0,class:"character-count"},qvr={key:0,class:"ai-chat-record-foot"},Wvr={class:"foot-actions"},Yvr={key:0,class:"copy-tooltip-inner"},jvr={key:1,class:"copy-tooltip-inner copy-tooltip-inner--error"},fZe=oa(Object.assign({name:"AiChatRecord"},{__name:"ChatRecord",props:{status:{type:String,default:"done"},loadingMessage:{type:String,default:"AI\u7EC4\u7EC7\u8BED\u8A00\u4E2D"},pos:{type:String,default:"l"},fullWidth:{type:Boolean,default:!1},avatar:{type:String,default:""},showAvatar:{type:Boolean,default:!0},content:{type:String,default:""},time:{type:String},showTime:{type:Boolean,default:!0},timeFormat:{type:String,default:"yyyy/MM/dd hh:mm:ss"},showCharacterCount:{type:Boolean,default:!0},showFoot:{type:Boolean,default:!0},actions:{type:Array,default:()=>["copy","regenerate"]},copyTipType:{type:String,default:"tooltip"}},emits:["regenerate"],setup(t,{expose:e,emit:r}){const n={Loading:"loading",Generating:"generating",Done:"done"},i=t,a=r,o=I.ref(),s=I.ref(!0),l=I.ref(!1),u=I.computed(()=>HLe(i.time,i.timeFormat)),d=I.computed(()=>{var f,p;if(i.status==="done"){let g=(p=(f=o.value)==null?void 0:f.querySelector(".ai-chat-record-content-inner"))==null?void 0:p.innerText;return(g==null?void 0:g.length)??0}else return 0});function h(){var g;let f=(g=o.value)==null?void 0:g.querySelector(".ai-chat-record-content-inner");if(!f)return;function p(){i.copyTipType==="message"?s.value?ma.success("\u590D\u5236\u6210\u529F"):ma.error("\u590D\u5236\u5931\u8D25"):(l.value=!0,setTimeout(()=>{l.value=!1},1e3))}FLe(f).then(()=>{s.value=!0,p()}).catch(()=>{s.value=!1,p()})}return e({statusEnum:n}),(f,p)=>{const g=_v,m=k6;return I.openBlock(),I.createElementBlock("div",{ref_key:"elRef",ref:o,class:I.normalizeClass(["ai-chat-record",{"ai-chat-record--r":t.pos==="r","ai-chat-record--full-width":t.fullWidth,"ai-chat-record--show-time":t.showTime}])},[t.showAvatar?(I.openBlock(),I.createElementBlock("div",Ivr,[I.renderSlot(f.$slots,"avatar",{},()=>[I.createVNode(g,{size:40,src:t.avatar},{icon:I.withCtx(()=>p[1]||(p[1]=[])),_:1},8,["src"])],!0)])):I.createCommentVNode("",!0),I.createElementVNode("div",kvr,[I.createElementVNode("div",Pvr,[I.renderSlot(f.$slots,"head",{},()=>[t.showTime?(I.openBlock(),I.createElementBlock("div",Bvr,[I.renderSlot(f.$slots,"time",{time:u.value},()=>[I.createTextVNode(I.toDisplayString(u.value),1)],!0)])):I.createCommentVNode("",!0),I.renderSlot(f.$slots,"headRight",{},void 0,!0)],!0)]),I.createElementVNode("div",Hvr,[t.status===n.Loading?(I.openBlock(),I.createElementBlock("div",Fvr,[I.renderSlot(f.$slots,"loading",{},()=>[I.createVNode(zUt,{theme:t.pos==="r"?"light":"",message:t.loadingMessage},null,8,["theme","message"])],!0)])):(I.openBlock(),I.createElementBlock("div",Vvr,[I.createElementVNode("div",$vr,[I.renderSlot(f.$slots,"contentBefore",{},void 0,!0)]),I.createElementVNode("div",Uvr,[I.renderSlot(f.$slots,"content",{},()=>[I.createVNode(CH,{content:t.content},null,8,["content"])],!0)]),I.createElementVNode("div",zvr,[I.renderSlot(f.$slots,"contentAfter",{},void 0,!0)]),t.showCharacterCount&&t.status===n.Done?(I.openBlock(),I.createElementBlock("div",Gvr,[I.renderSlot(f.$slots,"characterCountBefore",{},void 0,!0),I.renderSlot(f.$slots,"characterCount",{},()=>[I.withDirectives(I.createElementVNode("span",null,"\u5171"+I.toDisplayString(d.value)+"\u4E2A\u5B57\u7B26",513),[[I.vShow,d.value]])],!0),I.renderSlot(f.$slots,"characterCountAfter",{},void 0,!0)])):I.createCommentVNode("",!0)]))]),t.showFoot?(I.openBlock(),I.createElementBlock("div",qvr,[I.renderSlot(f.$slots,"foot",{},()=>[I.createElementVNode("div",Wvr,[I.renderSlot(f.$slots,"actionsBefore",{},void 0,!0),I.renderSlot(f.$slots,"actions",{},()=>[I.createVNode(m,{overlayClassName:"copy-tooltip",open:l.value,color:"#fff"},{title:I.withCtx(()=>[s.value?(I.openBlock(),I.createElementBlock("span",Yvr,[I.createVNode(I.unref(bg),{class:"copy-tooltip-icon"}),p[2]||(p[2]=I.createTextVNode(" \u590D\u5236\u6210\u529F "))])):(I.openBlock(),I.createElementBlock("span",jvr,[I.createVNode(I.unref(xR),{class:"copy-tooltip-icon"}),p[3]||(p[3]=I.createTextVNode(" \u590D\u5236\u5931\u8D25 "))]))]),default:I.withCtx(()=>[I.createVNode(m,{title:"\u590D\u5236"},{default:I.withCtx(()=>[t.status===n.Done&&t.actions.includes("copy")?(I.openBlock(),I.createElementBlock("button",{key:0,class:"action",onClick:h},p[4]||(p[4]=[I.createElementVNode("i",{class:"action-icon ai-icon ai-icon-copy"},null,-1)]))):I.createCommentVNode("",!0)]),_:1})]),_:1},8,["open"]),I.createVNode(m,{title:"\u91CD\u65B0\u751F\u6210"},{default:I.withCtx(()=>[t.status===n.Done&&t.actions.includes("regenerate")?(I.openBlock(),I.createElementBlock("button",{key:0,class:"action",onClick:p[0]||(p[0]=T=>a("regenerate"))},p[5]||(p[5]=[I.createElementVNode("i",{class:"action-icon ai-icon ai-icon-shuaxin"},null,-1)]))):I.createCommentVNode("",!0)]),_:1})],!0),I.renderSlot(f.$slots,"actionsAfter",{},void 0,!0)])],!0)])):I.createCommentVNode("",!0),I.renderSlot(f.$slots,"bottom",{},void 0,!0)])],2)}}}),[["__scopeId","data-v-9c9dad67"]]);var pZe=11;function Xvr(t,e){var r=e.attributes,n,i,a,o,s;if(!(e.nodeType===pZe||t.nodeType===pZe)){for(var l=r.length-1;l>=0;l--)n=r[l],i=n.name,a=n.namespaceURI,o=n.value,a?(i=n.localName||i,s=t.getAttributeNS(a,i),s!==o&&(n.prefix==="xmlns"&&(i=n.name),t.setAttributeNS(a,i,o))):(s=t.getAttribute(i),s!==o&&t.setAttribute(i,o));for(var u=t.attributes,d=u.length-1;d>=0;d--)n=u[d],i=n.name,a=n.namespaceURI,a?(i=n.localName||i,e.hasAttributeNS(a,i)||t.removeAttributeNS(a,i)):e.hasAttribute(i)||t.removeAttribute(i)}}var LH,Kvr="http://www.w3.org/1999/xhtml",Lc=typeof document>"u"?void 0:document,Zvr=!!Lc&&"content"in Lc.createElement("template"),Jvr=!!Lc&&Lc.createRange&&"createContextualFragment"in Lc.createRange();function e9r(t){var e=Lc.createElement("template");return e.innerHTML=t,e.content.childNodes[0]}function t9r(t){LH||(LH=Lc.createRange(),LH.selectNode(Lc.body));var e=LH.createContextualFragment(t);return e.childNodes[0]}function r9r(t){var e=Lc.createElement("body");return e.innerHTML=t,e.childNodes[0]}function n9r(t){return t=t.trim(),Zvr?e9r(t):Jvr?t9r(t):r9r(t)}function wH(t,e){var r=t.nodeName,n=e.nodeName,i,a;return r===n?!0:(i=r.charCodeAt(0),a=n.charCodeAt(0),i<=90&&a>=97?r===n.toUpperCase():a<=90&&i>=97?n===r.toUpperCase():!1)}function i9r(t,e){return!e||e===Kvr?Lc.createElement(t):Lc.createElementNS(e,t)}function a9r(t,e){for(var r=t.firstChild;r;){var n=r.nextSibling;e.appendChild(r),r=n}return e}function Ule(t,e,r){t[r]!==e[r]&&(t[r]=e[r],t[r]?t.setAttribute(r,""):t.removeAttribute(r))}var gZe={OPTION:function(t,e){var r=t.parentNode;if(r){var n=r.nodeName.toUpperCase();n==="OPTGROUP"&&(r=r.parentNode,n=r&&r.nodeName.toUpperCase()),n==="SELECT"&&!r.hasAttribute("multiple")&&(t.hasAttribute("selected")&&!e.selected&&(t.setAttribute("selected","selected"),t.removeAttribute("selected")),r.selectedIndex=-1)}Ule(t,e,"selected")},INPUT:function(t,e){Ule(t,e,"checked"),Ule(t,e,"disabled"),t.value!==e.value&&(t.value=e.value),e.hasAttribute("value")||t.removeAttribute("value")},TEXTAREA:function(t,e){var r=e.value;t.value!==r&&(t.value=r);var n=t.firstChild;if(n){var i=n.nodeValue;if(i==r||!r&&i==t.placeholder)return;n.nodeValue=r}},SELECT:function(t,e){if(!e.hasAttribute("multiple")){for(var r=-1,n=0,i=t.firstChild,a,o;i;)if(o=i.nodeName&&i.nodeName.toUpperCase(),o==="OPTGROUP")a=i,i=a.firstChild;else{if(o==="OPTION"){if(i.hasAttribute("selected")){r=n;break}n++}i=i.nextSibling,!i&&a&&(i=a.nextSibling,a=null)}t.selectedIndex=r}}},Aw=1,mZe=11,TZe=3,vZe=8;function Z5(){}function o9r(t){if(t)return t.getAttribute&&t.getAttribute("id")||t.id}function s9r(t){return function(r,n,i){if(i||(i={}),typeof n=="string")if(r.nodeName==="#document"||r.nodeName==="HTML"||r.nodeName==="BODY"){var a=n;n=Lc.createElement("html"),n.innerHTML=a}else n=n9r(n);else n.nodeType===mZe&&(n=n.firstElementChild);var o=i.getNodeKey||o9r,s=i.onBeforeNodeAdded||Z5,l=i.onNodeAdded||Z5,u=i.onBeforeElUpdated||Z5,d=i.onElUpdated||Z5,h=i.onBeforeNodeDiscarded||Z5,f=i.onNodeDiscarded||Z5,p=i.onBeforeElChildrenUpdated||Z5,g=i.skipFromChildren||Z5,m=i.addChild||function(B,k){return B.appendChild(k)},T=i.childrenOnly===!0,v=Object.create(null),y=[];function _(B){y.push(B)}function Q(B,k){if(B.nodeType===Aw)for(var V=B.firstChild;V;){var H=void 0;k&&(H=o(V))?_(H):(f(V),V.firstChild&&Q(V,k)),V=V.nextSibling}}function b(B,k,V){h(B)!==!1&&(k&&k.removeChild(B),f(B),Q(B,V))}function x(B){if(B.nodeType===Aw||B.nodeType===mZe)for(var k=B.firstChild;k;){var V=o(k);V&&(v[V]=k),x(k),k=k.nextSibling}}x(r);function E(B){l(B);for(var k=B.firstChild;k;){var V=k.nextSibling,H=o(k);if(H){var $=v[H];$&&wH(k,$)?(k.parentNode.replaceChild($,k),C($,k)):E(k)}else E(k);k=V}}function S(B,k,V){for(;k;){var H=k.nextSibling;(V=o(k))?_(V):b(k,B,!0),k=H}}function C(B,k,V){var H=o(k);if(H&&delete v[H],!V){var $=u(B,k);if($===!1||($ instanceof HTMLElement&&(B=$,x(B)),t(B,k),d(B),p(B,k)===!1))return}B.nodeName!=="TEXTAREA"?L(B,k):gZe.TEXTAREA(B,k)}function L(B,k){var V=g(B,k),H=k.firstChild,$=B.firstChild,G,U,Y,ne,te;e:for(;H;){for(ne=H.nextSibling,G=o(H);!V&&$;){if(Y=$.nextSibling,H.isSameNode&&H.isSameNode($)){H=ne,$=Y;continue e}U=o($);var ee=$.nodeType,ie=void 0;if(ee===H.nodeType&&(ee===Aw?(G?G!==U&&((te=v[G])?Y===te?ie=!1:(B.insertBefore(te,$),U?_(U):b($,B,!0),$=te,U=o($)):ie=!1):U&&(ie=!1),ie=ie!==!1&&wH($,H),ie&&C($,H)):(ee===TZe||ee==vZe)&&(ie=!0,$.nodeValue!==H.nodeValue&&($.nodeValue=H.nodeValue))),ie){H=ne,$=Y;continue e}U?_(U):b($,B,!0),$=Y}if(G&&(te=v[G])&&wH(te,H))V||m(B,te),C(te,H);else{var j=s(H);j!==!1&&(j&&(H=j),H.actualize&&(H=H.actualize(B.ownerDocument||Lc)),m(B,H),E(H))}H=ne,$=Y}S(B,$,U);var X=gZe[B.nodeName];X&&X(B,k)}var w=r,O=w.nodeType,R=n.nodeType;if(!T){if(O===Aw)R===Aw?wH(r,n)||(f(r),w=a9r(r,i9r(n.nodeName,n.namespaceURI))):w=n;else if(O===TZe||O===vZe){if(R===O)return w.nodeValue!==n.nodeValue&&(w.nodeValue=n.nodeValue),w;w=n}}if(w===n)f(r);else{if(n.isSameNode&&n.isSameNode(w))return;if(C(w,n,T),y)for(var M=0,D=y.length;M<D;M++){var P=v[y[M]];P&&b(P,P.parentNode,!1)}}return!T&&w!==r&&r.parentNode&&(w.actualize&&(w=w.actualize(r.ownerDocument||Lc)),r.parentNode.replaceChild(w,r)),w}}var l9r=s9r(Xvr);const u9r={key:1,class:"ai-content-parser-inner"},yZe=Object.assign({name:"AiContentParser"},{__name:"ContentParser",props:{type:{type:String,default:"text"},content:String,stream:{type:Boolean,default:!1},streamDone:{type:Boolean,default:!1}},setup(t){const e=t,r=I.ref(null),n=I.ref("");return I.onMounted(()=>{I.watch(()=>e.content,()=>{if(n.value=e.type==="markdown"?VLe.parse(e.content):e.content,e.type==="markdown"||e.type==="html"){const i=document.createElement("div");i.innerHTML=n.value,i.classList.add("ai-content-parser-inner"),l9r(r.value,i)}},{immediate:!0})}),(i,a)=>(I.openBlock(),I.createElementBlock("div",{class:I.normalizeClass(["ai-content-parser",`ai-content-parser--${t.type}`])},[t.type==="html"||t.type==="markdown"?(I.openBlock(),I.createElementBlock("div",{key:0,ref_key:"contentRef",ref:r,class:"ai-content-parser-inner"},null,512)):(I.openBlock(),I.createElementBlock("div",u9r,I.toDisplayString(n.value),1))],2))}}),c9r={class:"ai-think-parser"},d9r={class:"ai-think-parser-content"},_Ze=oa(Object.assign({name:"AiThinkParser"},{__name:"ThinkParser",setup(t){return(e,r)=>(I.openBlock(),I.createElementBlock("div",c9r,[I.createElementVNode("div",d9r,[I.renderSlot(e.$slots,"content",{},()=>[I.createVNode(CH,I.normalizeProps(I.guardReactiveProps(e.$attrs)),null,16)],!0)])]))}}),[["__scopeId","data-v-70d4677e"]]);function Ql(t){this.content=t}Ql.prototype={constructor:Ql,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,r){var n=r&&r!=t?this.remove(r):this,i=n.find(t),a=n.content.slice();return i==-1?a.push(r||t,e):(a[i+1]=e,r&&(a[i]=r)),new Ql(a)},remove:function(t){var e=this.find(t);if(e==-1)return this;var r=this.content.slice();return r.splice(e,2),new Ql(r)},addToStart:function(t,e){return new Ql([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var r=this.remove(t).content.slice();return r.push(t,e),new Ql(r)},addBefore:function(t,e,r){var n=this.remove(e),i=n.content.slice(),a=n.find(t);return i.splice(a==-1?i.length:a,0,e,r),new Ql(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Ql.from(t),t.size?new Ql(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Ql.from(t),t.size?new Ql(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Ql.from(t);for(var r=0;r<t.content.length;r+=2)e=e.remove(t.content[r]);return e},toObject:function(){var t={};return this.forEach(function(e,r){t[e]=r}),t},get size(){return this.content.length>>1}},Ql.from=function(t){if(t instanceof Ql)return t;var e=[];if(t)for(var r in t)e.push(r,t[r]);return new Ql(e)};function bZe(t,e,r){for(let n=0;;n++){if(n==t.childCount||n==e.childCount)return t.childCount==e.childCount?null:r;let i=t.child(n),a=e.child(n);if(i==a){r+=i.nodeSize;continue}if(!i.sameMarkup(a))return r;if(i.isText&&i.text!=a.text){for(let o=0;i.text[o]==a.text[o];o++)r++;return r}if(i.content.size||a.content.size){let o=bZe(i.content,a.content,r+1);if(o!=null)return o}r+=i.nodeSize}}function QZe(t,e,r,n){for(let i=t.childCount,a=e.childCount;;){if(i==0||a==0)return i==a?null:{a:r,b:n};let o=t.child(--i),s=e.child(--a),l=o.nodeSize;if(o==s){r-=l,n-=l;continue}if(!o.sameMarkup(s))return{a:r,b:n};if(o.isText&&o.text!=s.text){let u=0,d=Math.min(o.text.length,s.text.length);for(;u<d&&o.text[o.text.length-u-1]==s.text[s.text.length-u-1];)u++,r--,n--;return{a:r,b:n}}if(o.content.size||s.content.size){let u=QZe(o.content,s.content,r-1,n-1);if(u)return u}r-=l,n-=l}}class Gt{constructor(e,r){if(this.content=e,this.size=r||0,r==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,r,n,i=0,a){for(let o=0,s=0;s<r;o++){let l=this.content[o],u=s+l.nodeSize;if(u>e&&n(l,i+s,a||null,o)!==!1&&l.content.size){let d=s+1;l.nodesBetween(Math.max(0,e-d),Math.min(l.content.size,r-d),n,i+d)}s=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,r,n,i){let a="",o=!0;return this.nodesBetween(e,r,(s,l)=>{let u=s.isText?s.text.slice(Math.max(e,l)-l,r-l):s.isLeaf?i?typeof i=="function"?i(s):i:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&u||s.isTextblock)&&n&&(o?o=!1:a+=n),a+=u},0),a}append(e){if(!e.size)return this;if(!this.size)return e;let r=this.lastChild,n=e.firstChild,i=this.content.slice(),a=0;for(r.isText&&r.sameMarkup(n)&&(i[i.length-1]=r.withText(r.text+n.text),a=1);a<e.content.length;a++)i.push(e.content[a]);return new Gt(i,this.size+e.size)}cut(e,r=this.size){if(e==0&&r==this.size)return this;let n=[],i=0;if(r>e)for(let a=0,o=0;o<r;a++){let s=this.content[a],l=o+s.nodeSize;l>e&&((o<e||l>r)&&(s.isText?s=s.cut(Math.max(0,e-o),Math.min(s.text.length,r-o)):s=s.cut(Math.max(0,e-o-1),Math.min(s.content.size,r-o-1))),n.push(s),i+=s.nodeSize),o=l}return new Gt(n,i)}cutByIndex(e,r){return e==r?Gt.empty:e==0&&r==this.content.length?this:new Gt(this.content.slice(e,r))}replaceChild(e,r){let n=this.content[e];if(n==r)return this;let i=this.content.slice(),a=this.size+r.nodeSize-n.nodeSize;return i[e]=r,new Gt(i,a)}addToStart(e){return new Gt([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Gt(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let r=0;r<this.content.length;r++)if(!this.content[r].eq(e.content[r]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let r=this.content[e];if(!r)throw new RangeError("Index "+e+" out of range for "+this);return r}maybeChild(e){return this.content[e]||null}forEach(e){for(let r=0,n=0;r<this.content.length;r++){let i=this.content[r];e(i,n,r),n+=i.nodeSize}}findDiffStart(e,r=0){return bZe(this,e,r)}findDiffEnd(e,r=this.size,n=e.size){return QZe(this,e,r,n)}findIndex(e){if(e==0)return AH(0,e);if(e==this.size)return AH(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,n=0;;r++){let i=this.child(r),a=n+i.nodeSize;if(a>=e)return a==e?AH(r+1,a):AH(r,n);n=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,r){if(!r)return Gt.empty;if(!Array.isArray(r))throw new RangeError("Invalid input for Fragment.fromJSON");return new Gt(r.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Gt.empty;let r,n=0;for(let i=0;i<e.length;i++){let a=e[i];n+=a.nodeSize,i&&a.isText&&e[i-1].sameMarkup(a)?(r||(r=e.slice(0,i)),r[r.length-1]=a.withText(r[r.length-1].text+a.text)):r&&r.push(a)}return new Gt(r||e,n)}static from(e){if(!e)return Gt.empty;if(e instanceof Gt)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Gt([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Gt.empty=new Gt([],0);const zle={index:0,offset:0};function AH(t,e){return zle.index=t,zle.offset=e,zle}function OH(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let r=Array.isArray(t);if(Array.isArray(e)!=r)return!1;if(r){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!OH(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!OH(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}let ha=class sfe{constructor(e,r){this.type=e,this.attrs=r}addToSet(e){let r,n=!1;for(let i=0;i<e.length;i++){let a=e[i];if(this.eq(a))return e;if(this.type.excludes(a.type))r||(r=e.slice(0,i));else{if(a.type.excludes(this.type))return e;!n&&a.type.rank>this.type.rank&&(r||(r=e.slice(0,i)),r.push(this),n=!0),r&&r.push(a)}}return r||(r=e.slice()),n||r.push(this),r}removeFromSet(e){for(let r=0;r<e.length;r++)if(this.eq(e[r]))return e.slice(0,r).concat(e.slice(r+1));return e}isInSet(e){for(let r=0;r<e.length;r++)if(this.eq(e[r]))return!0;return!1}eq(e){return this==e||this.type==e.type&&OH(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let r in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[r.type];if(!n)throw new RangeError(`There is no mark type ${r.type} in this schema`);let i=n.create(r.attrs);return n.checkAttrs(i.attrs),i}static sameSet(e,r){if(e==r)return!0;if(e.length!=r.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(r[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return sfe.none;if(e instanceof sfe)return[e];let r=e.slice();return r.sort((n,i)=>n.type.rank-i.type.rank),r}};ha.none=[];class MH extends Error{}class Lr{constructor(e,r,n){this.content=e,this.openStart=r,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,r){let n=EZe(this.content,e+this.openStart,r);return n&&new Lr(n,this.openStart,this.openEnd)}removeBetween(e,r){return new Lr(xZe(this.content,e+this.openStart,r+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,r){if(!r)return Lr.empty;let n=r.openStart||0,i=r.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Lr(Gt.fromJSON(e,r.content),n,i)}static maxOpen(e,r=!0){let n=0,i=0;for(let a=e.firstChild;a&&!a.isLeaf&&(r||!a.type.spec.isolating);a=a.firstChild)n++;for(let a=e.lastChild;a&&!a.isLeaf&&(r||!a.type.spec.isolating);a=a.lastChild)i++;return new Lr(e,n,i)}}Lr.empty=new Lr(Gt.empty,0,0);function xZe(t,e,r){let{index:n,offset:i}=t.findIndex(e),a=t.maybeChild(n),{index:o,offset:s}=t.findIndex(r);if(i==e||a.isText){if(s!=r&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(r))}if(n!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(n,a.copy(xZe(a.content,e-i-1,r-i-1)))}function EZe(t,e,r,n){let{index:i,offset:a}=t.findIndex(e),o=t.maybeChild(i);if(a==e||o.isText)return t.cut(0,e).append(r).append(t.cut(e));let s=EZe(o.content,e-a-1,r);return s&&t.replaceChild(i,o.copy(s))}function h9r(t,e,r){if(r.openStart>t.depth)throw new MH("Inserted content deeper than insertion position");if(t.depth-r.openStart!=e.depth-r.openEnd)throw new MH("Inconsistent open depths");return SZe(t,e,r,0)}function SZe(t,e,r,n){let i=t.index(n),a=t.node(n);if(i==e.index(n)&&n<t.depth-r.openStart){let o=SZe(t,e,r,n+1);return a.copy(a.content.replaceChild(i,o))}else if(r.content.size)if(!r.openStart&&!r.openEnd&&t.depth==n&&e.depth==n){let o=t.parent,s=o.content;return Q8(o,s.cut(0,t.parentOffset).append(r.content).append(s.cut(e.parentOffset)))}else{let{start:o,end:s}=f9r(r,t);return Q8(a,LZe(t,o,s,e,n))}else return Q8(a,RH(t,e,n))}function CZe(t,e){if(!e.type.compatibleContent(t.type))throw new MH("Cannot join "+e.type.name+" onto "+t.type.name)}function Gle(t,e,r){let n=t.node(r);return CZe(n,e.node(r)),n}function b8(t,e){let r=e.length-1;r>=0&&t.isText&&t.sameMarkup(e[r])?e[r]=t.withText(e[r].text+t.text):e.push(t)}function Ow(t,e,r,n){let i=(e||t).node(r),a=0,o=e?e.index(r):i.childCount;t&&(a=t.index(r),t.depth>r?a++:t.textOffset&&(b8(t.nodeAfter,n),a++));for(let s=a;s<o;s++)b8(i.child(s),n);e&&e.depth==r&&e.textOffset&&b8(e.nodeBefore,n)}function Q8(t,e){return t.type.checkContent(e),t.copy(e)}function LZe(t,e,r,n,i){let a=t.depth>i&&Gle(t,e,i+1),o=n.depth>i&&Gle(r,n,i+1),s=[];return Ow(null,t,i,s),a&&o&&e.index(i)==r.index(i)?(CZe(a,o),b8(Q8(a,LZe(t,e,r,n,i+1)),s)):(a&&b8(Q8(a,RH(t,e,i+1)),s),Ow(e,r,i,s),o&&b8(Q8(o,RH(r,n,i+1)),s)),Ow(n,null,i,s),new Gt(s)}function RH(t,e,r){let n=[];if(Ow(null,t,r,n),t.depth>r){let i=Gle(t,e,r+1);b8(Q8(i,RH(t,e,r+1)),n)}return Ow(e,null,r,n),new Gt(n)}function f9r(t,e){let r=e.depth-t.openStart,i=e.node(r).copy(t.content);for(let a=r-1;a>=0;a--)i=e.node(a).copy(Gt.from(i));return{start:i.resolveNoCache(t.openStart+r),end:i.resolveNoCache(i.content.size-t.openEnd-r)}}class Mw{constructor(e,r,n){this.pos=e,this.path=r,this.parentOffset=n,this.depth=r.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,r=this.index(this.depth);if(r==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(r);return n?e.child(r).cut(n):i}get nodeBefore(){let e=this.index(this.depth),r=this.pos-this.path[this.path.length-1];return r?this.parent.child(e).cut(0,r):e==0?null:this.parent.child(e-1)}posAtIndex(e,r){r=this.resolveDepth(r);let n=this.path[r*3],i=r==0?0:this.path[r*3-1]+1;for(let a=0;a<e;a++)i+=n.child(a).nodeSize;return i}marks(){let e=this.parent,r=this.index();if(e.content.size==0)return ha.none;if(this.textOffset)return e.child(r).marks;let n=e.maybeChild(r-1),i=e.maybeChild(r);if(!n){let s=n;n=i,i=s}let a=n.marks;for(var o=0;o<a.length;o++)a[o].type.spec.inclusive===!1&&(!i||!a[o].isInSet(i.marks))&&(a=a[o--].removeFromSet(a));return a}marksAcross(e){let r=this.parent.maybeChild(this.index());if(!r||!r.isInline)return null;let n=r.marks,i=e.parent.maybeChild(e.index());for(var a=0;a<n.length;a++)n[a].type.spec.inclusive===!1&&(!i||!n[a].isInSet(i.marks))&&(n=n[a--].removeFromSet(n));return n}sharedDepth(e){for(let r=this.depth;r>0;r--)if(this.start(r)<=e&&this.end(r)>=e)return r;return 0}blockRange(e=this,r){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!r||r(this.node(n))))return new DH(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let r=1;r<=this.depth;r++)e+=(e?"/":"")+this.node(r).type.name+"_"+this.index(r-1);return e+":"+this.parentOffset}static resolve(e,r){if(!(r>=0&&r<=e.content.size))throw new RangeError("Position "+r+" out of range");let n=[],i=0,a=r;for(let o=e;;){let{index:s,offset:l}=o.content.findIndex(a),u=a-l;if(n.push(o,s,i+l),!u||(o=o.child(s),o.isText))break;a=u-1,i+=l+1}return new Mw(r,n,a)}static resolveCached(e,r){let n=wZe.get(e);if(n)for(let a=0;a<n.elts.length;a++){let o=n.elts[a];if(o.pos==r)return o}else wZe.set(e,n=new p9r);let i=n.elts[n.i]=Mw.resolve(e,r);return n.i=(n.i+1)%g9r,i}}class p9r{constructor(){this.elts=[],this.i=0}}const g9r=12,wZe=new WeakMap;class DH{constructor(e,r,n){this.$from=e,this.$to=r,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const m9r=Object.create(null);class Od{constructor(e,r,n,i=ha.none){this.type=e,this.attrs=r,this.marks=i,this.content=n||Gt.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,r,n,i=0){this.content.nodesBetween(e,r,n,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,r,n,i){return this.content.textBetween(e,r,n,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,r,n){return this.type==e&&OH(this.attrs,r||e.defaultAttrs||m9r)&&ha.sameSet(this.marks,n||ha.none)}copy(e=null){return e==this.content?this:new Od(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Od(this.type,this.attrs,this.content,e)}cut(e,r=this.content.size){return e==0&&r==this.content.size?this:this.copy(this.content.cut(e,r))}slice(e,r=this.content.size,n=!1){if(e==r)return Lr.empty;let i=this.resolve(e),a=this.resolve(r),o=n?0:i.sharedDepth(r),s=i.start(o),u=i.node(o).content.cut(i.pos-s,a.pos-s);return new Lr(u,i.depth-o,a.depth-o)}replace(e,r,n){return h9r(this.resolve(e),this.resolve(r),n)}nodeAt(e){for(let r=this;;){let{index:n,offset:i}=r.content.findIndex(e);if(r=r.maybeChild(n),!r)return null;if(i==e||r.isText)return r;e-=i+1}}childAfter(e){let{index:r,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(r),index:r,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:r,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(r),index:r,offset:n};let i=this.content.child(r-1);return{node:i,index:r-1,offset:n-i.nodeSize}}resolve(e){return Mw.resolveCached(this,e)}resolveNoCache(e){return Mw.resolve(this,e)}rangeHasMark(e,r,n){let i=!1;return r>e&&this.nodesBetween(e,r,a=>(n.isInSet(a.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),AZe(this.marks,e)}contentMatchAt(e){let r=this.type.contentMatch.matchFragment(this.content,0,e);if(!r)throw new Error("Called contentMatchAt on a node with invalid content");return r}canReplace(e,r,n=Gt.empty,i=0,a=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,i,a),s=o&&o.matchFragment(this.content,r);if(!s||!s.validEnd)return!1;for(let l=i;l<a;l++)if(!this.type.allowsMarks(n.child(l).marks))return!1;return!0}canReplaceWith(e,r,n,i){if(i&&!this.type.allowsMarks(i))return!1;let a=this.contentMatchAt(e).matchType(n),o=a&&a.matchFragment(this.content,r);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=ha.none;for(let r=0;r<this.marks.length;r++){let n=this.marks[r];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!ha.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(r=>r.type.name)}`);this.content.forEach(r=>r.check())}toJSON(){let e={type:this.type.name};for(let r in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(r=>r.toJSON())),e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Node.fromJSON");let n;if(r.marks){if(!Array.isArray(r.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=r.marks.map(e.markFromJSON)}if(r.type=="text"){if(typeof r.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(r.text,n)}let i=Gt.fromJSON(e,r.content),a=e.nodeType(r.type).create(r.attrs,i,n);return a.type.checkAttrs(a.attrs),a}}Od.prototype.text=void 0;class NH extends Od{constructor(e,r,n,i){if(super(e,r,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):AZe(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,r){return this.text.slice(e,r)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new NH(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new NH(this.type,this.attrs,e,this.marks)}cut(e=0,r=this.text.length){return e==0&&r==this.text.length?this:this.withText(this.text.slice(e,r))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function AZe(t,e){for(let r=t.length-1;r>=0;r--)e=t[r].type.name+"("+e+")";return e}class x8{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,r){let n=new T9r(e,r);if(n.next==null)return x8.empty;let i=OZe(n);n.next&&n.err("Unexpected trailing text");let a=E9r(x9r(i));return S9r(a,n),a}matchType(e){for(let r=0;r<this.next.length;r++)if(this.next[r].type==e)return this.next[r].next;return null}matchFragment(e,r=0,n=e.childCount){let i=this;for(let a=r;i&&a<n;a++)i=i.matchType(e.child(a).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:r}=this.next[e];if(!(r.isText||r.hasRequiredAttrs()))return r}return null}compatible(e){for(let r=0;r<this.next.length;r++)for(let n=0;n<e.next.length;n++)if(this.next[r].type==e.next[n].type)return!0;return!1}fillBefore(e,r=!1,n=0){let i=[this];function a(o,s){let l=o.matchFragment(e,n);if(l&&(!r||l.validEnd))return Gt.from(s.map(u=>u.createAndFill()));for(let u=0;u<o.next.length;u++){let{type:d,next:h}=o.next[u];if(!(d.isText||d.hasRequiredAttrs())&&i.indexOf(h)==-1){i.push(h);let f=a(h,s.concat(d));if(f)return f}}return null}return a(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let r=this.computeWrapping(e);return this.wrapCache.push(e,r),r}computeWrapping(e){let r=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let i=n.shift(),a=i.match;if(a.matchType(e)){let o=[];for(let s=i;s.type;s=s.via)o.push(s.type);return o.reverse()}for(let o=0;o<a.next.length;o++){let{type:s,next:l}=a.next[o];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in r)&&(!i.type||l.validEnd)&&(n.push({match:s.contentMatch,type:s,via:i}),r[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function r(n){e.push(n);for(let i=0;i<n.next.length;i++)e.indexOf(n.next[i].next)==-1&&r(n.next[i].next)}return r(this),e.map((n,i)=>{let a=i+(n.validEnd?"*":" ")+" ";for(let o=0;o<n.next.length;o++)a+=(o?", ":"")+n.next[o].type.name+"->"+e.indexOf(n.next[o].next);return a}).join(`
|
|
963
|
+
`)),ti(n)),a.push({dimIdx:v.index,parser:y,comparator:new OVe(f,g)})});var o=e.sourceFormat;o!==Xs&&o!==z1&&(process.env.NODE_ENV!=="production"&&(n='sourceFormat "'+o+'" is not supported yet'),ti(n));for(var s=[],l=0,u=e.count();l<u;l++)s.push(e.getRawDataItem(l));return s.sort(function(d,h){for(var f=0;f<a.length;f++){var p=a[f],g=e.retrieveValueFromItem(d,p.dimIdx),m=e.retrieveValueFromItem(h,p.dimIdx);p.parser&&(g=p.parser(g),m=p.parser(m));var T=p.comparator.evaluate(g,m);if(T!==0)return T}return 0}),{data:s}}};function xTr(t){t.registerTransform(bTr),t.registerTransform(QTr)}var ETr=function(t){Ye(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataset",r}return e.prototype.init=function(r,n,i){t.prototype.init.call(this,r,n,i),this._sourceManager=new kVe(this),PVe(this)},e.prototype.mergeOption=function(r,n){t.prototype.mergeOption.call(this,r,n),PVe(this)},e.prototype.optionUpdated=function(){this._sourceManager.dirty()},e.prototype.getSourceManager=function(){return this._sourceManager},e.type="dataset",e.defaultOption={seriesLayoutBy:Ed},e}(yn),STr=function(t){Ye(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataset",r}return e.type="dataset",e}(ia);function CTr(t){t.registerComponentModel(ETr),t.registerComponentView(STr)}var ih=$3.CMD;function Xy(t,e){return Math.abs(t-e)<1e-5}function Rle(t){var e=t.data,r=t.len(),n=[],i,a=0,o=0,s=0,l=0;function u(R,M){i&&i.length>2&&n.push(i),i=[R,M]}function d(R,M,D,P){Xy(R,D)&&Xy(M,P)||i.push(R,M,D,P,D,P)}function h(R,M,D,P,B,k){var V=Math.abs(M-R),H=Math.tan(V/4)*4/3,$=M<R?-1:1,G=Math.cos(R),U=Math.sin(R),Y=Math.cos(M),ne=Math.sin(M),te=G*B+D,ee=U*k+P,ie=Y*B+D,j=ne*k+P,X=B*H*$,Z=k*H*$;i.push(te-X*U,ee+Z*G,ie+X*ne,j-Z*Y,ie,j)}for(var f,p,g,m,T=0;T<r;){var v=e[T++],y=T===1;switch(y&&(a=e[T],o=e[T+1],s=a,l=o,(v===ih.L||v===ih.C||v===ih.Q)&&(i=[s,l])),v){case ih.M:a=s=e[T++],o=l=e[T++],u(s,l);break;case ih.L:f=e[T++],p=e[T++],d(a,o,f,p),a=f,o=p;break;case ih.C:i.push(e[T++],e[T++],e[T++],e[T++],a=e[T++],o=e[T++]);break;case ih.Q:f=e[T++],p=e[T++],g=e[T++],m=e[T++],i.push(a+2/3*(f-a),o+2/3*(p-o),g+2/3*(f-g),m+2/3*(p-m),g,m),a=g,o=m;break;case ih.A:var _=e[T++],Q=e[T++],b=e[T++],x=e[T++],E=e[T++],S=e[T++]+E;T+=1;var C=!e[T++];f=Math.cos(E)*b+_,p=Math.sin(E)*x+Q,y?(s=f,l=p,u(s,l)):d(a,o,f,p),a=Math.cos(S)*b+_,o=Math.sin(S)*x+Q;for(var L=(C?-1:1)*Math.PI/2,w=E;C?w>S:w<S;w+=L){var O=C?Math.max(w+L,S):Math.min(w+L,S);h(w,O,_,Q,b,x)}break;case ih.R:s=a=e[T++],l=o=e[T++],f=s+e[T++],p=l+e[T++],u(f,l),d(f,l,f,p),d(f,p,s,p),d(s,p,s,l),d(s,l,f,l);break;case ih.Z:i&&d(a,o,s,l),a=s,o=l;break}}return i&&i.length>2&&n.push(i),n}function Dle(t,e,r,n,i,a,o,s,l,u){if(Xy(t,r)&&Xy(e,n)&&Xy(i,o)&&Xy(a,s)){l.push(o,s);return}var d=2/u,h=d*d,f=o-t,p=s-e,g=Math.sqrt(f*f+p*p);f/=g,p/=g;var m=r-t,T=n-e,v=i-o,y=a-s,_=m*m+T*T,Q=v*v+y*y;if(_<h&&Q<h){l.push(o,s);return}var b=f*m+p*T,x=-f*v-p*y,E=_-b*b,S=Q-x*x;if(E<h&&b>=0&&S<h&&x>=0){l.push(o,s);return}var C=[],L=[];v5(t,r,i,o,.5,C),v5(e,n,a,s,.5,L),Dle(C[0],L[0],C[1],L[1],C[2],L[2],C[3],L[3],l,u),Dle(C[4],L[4],C[5],L[5],C[6],L[6],C[7],L[7],l,u)}function LTr(t,e){var r=Rle(t),n=[];e=e||1;for(var i=0;i<r.length;i++){var a=r[i],o=[],s=a[0],l=a[1];o.push(s,l);for(var u=2;u<a.length;){var d=a[u++],h=a[u++],f=a[u++],p=a[u++],g=a[u++],m=a[u++];Dle(s,l,d,h,f,p,g,m,o,e),s=g,l=m}n.push(o)}return n}function UKe(t,e,r){var n=t[e],i=t[1-e],a=Math.abs(n/i),o=Math.ceil(Math.sqrt(a*r)),s=Math.floor(r/o);s===0&&(s=1,o=r);for(var l=[],u=0;u<o;u++)l.push(s);var d=o*s,h=r-d;if(h>0)for(var u=0;u<h;u++)l[u%o]+=1;return l}function zKe(t,e,r){for(var n=t.r0,i=t.r,a=t.startAngle,o=t.endAngle,s=Math.abs(o-a),l=s*i,u=i-n,d=l>Math.abs(u),h=UKe([l,u],d?0:1,e),f=(d?s:u)/h.length,p=0;p<h.length;p++)for(var g=(d?u:s)/h[p],m=0;m<h[p];m++){var T={};d?(T.startAngle=a+f*p,T.endAngle=a+f*(p+1),T.r0=n+g*m,T.r=n+g*(m+1)):(T.startAngle=a+g*m,T.endAngle=a+g*(m+1),T.r0=n+f*p,T.r=n+f*(p+1)),T.clockwise=t.clockwise,T.cx=t.cx,T.cy=t.cy,r.push(T)}}function wTr(t,e,r){for(var n=t.width,i=t.height,a=n>i,o=UKe([n,i],a?0:1,e),s=a?"width":"height",l=a?"height":"width",u=a?"x":"y",d=a?"y":"x",h=t[s]/o.length,f=0;f<o.length;f++)for(var p=t[l]/o[f],g=0;g<o[f];g++){var m={};m[u]=f*h,m[d]=g*p,m[s]=h,m[l]=p,m.x+=t.x,m.y+=t.y,r.push(m)}}function GKe(t,e,r,n){return t*n-r*e}function ATr(t,e,r,n,i,a,o,s){var l=r-t,u=n-e,d=o-i,h=s-a,f=GKe(d,h,l,u);if(Math.abs(f)<1e-6)return null;var p=t-i,g=e-a,m=GKe(p,g,d,h)/f;return m<0||m>1?null:new xr(m*l+t,m*u+e)}function OTr(t,e,r){var n=new xr;xr.sub(n,r,e),n.normalize();var i=new xr;xr.sub(i,t,e);var a=i.dot(n);return a}function Ky(t,e){var r=t[t.length-1];r&&r[0]===e[0]&&r[1]===e[1]||t.push(e)}function MTr(t,e,r){for(var n=t.length,i=[],a=0;a<n;a++){var o=t[a],s=t[(a+1)%n],l=ATr(o[0],o[1],s[0],s[1],e.x,e.y,r.x,r.y);l&&i.push({projPt:OTr(l,e,r),pt:l,idx:a})}if(i.length<2)return[{points:t},{points:t}];i.sort(function(T,v){return T.projPt-v.projPt});var u=i[0],d=i[i.length-1];if(d.idx<u.idx){var h=u;u=d,d=h}for(var f=[u.pt.x,u.pt.y],p=[d.pt.x,d.pt.y],g=[f],m=[p],a=u.idx+1;a<=d.idx;a++)Ky(g,t[a].slice());Ky(g,p),Ky(g,f);for(var a=d.idx+1;a<=u.idx+n;a++)Ky(m,t[a%n].slice());return Ky(m,f),Ky(m,p),[{points:g},{points:m}]}function qKe(t){var e=t.points,r=[],n=[];Pk(e,r,n);var i=new Cr(r[0],r[1],n[0]-r[0],n[1]-r[1]),a=i.width,o=i.height,s=i.x,l=i.y,u=new xr,d=new xr;return a>o?(u.x=d.x=s+a/2,u.y=l,d.y=l+o):(u.y=d.y=l+o/2,u.x=s,d.x=s+a),MTr(e,u,d)}function QH(t,e,r,n){if(r===1)n.push(e);else{var i=Math.floor(r/2),a=t(e);QH(t,a[0],i,n),QH(t,a[1],r-i,n)}return n}function RTr(t,e){for(var r=[],n=0;n<e;n++)r.push(Lne(t));return r}function DTr(t,e){e.setStyle(t.style),e.z=t.z,e.z2=t.z2,e.zlevel=t.zlevel}function NTr(t){for(var e=[],r=0;r<t.length;)e.push([t[r++],t[r++]]);return e}function ITr(t,e){var r=[],n=t.shape,i;switch(t.type){case"rect":wTr(n,e,r),i=dn;break;case"sector":zKe(n,e,r),i=eu;break;case"circle":zKe({r0:0,r:n.r,startAngle:0,endAngle:Math.PI*2,cx:n.cx,cy:n.cy},e,r),i=eu;break;default:var a=t.getComputedTransform(),o=a?Math.sqrt(Math.max(a[0]*a[0]+a[1]*a[1],a[2]*a[2]+a[3]*a[3])):1,s=bt(LTr(t.getUpdatedPathProxy(),o),function(v){return NTr(v)}),l=s.length;if(l===0)QH(qKe,{points:s[0]},e,r);else if(l===e)for(var u=0;u<l;u++)r.push({points:s[u]});else{var d=0,h=bt(s,function(v){var y=[],_=[];Pk(v,y,_);var Q=(_[1]-y[1])*(_[0]-y[0]);return d+=Q,{poly:v,area:Q}});h.sort(function(v,y){return y.area-v.area});for(var f=e,u=0;u<l;u++){var p=h[u];if(f<=0)break;var g=u===l-1?f:Math.ceil(p.area/d*e);g<0||(QH(qKe,{points:p.poly},g,r),f-=g)}}i=tu;break}if(!i)return RTr(t,e);for(var m=[],u=0;u<r.length;u++){var T=new i;T.setShape(r[u]),DTr(t,T),m.push(T)}return m}function kTr(t,e){var r=t.length,n=e.length;if(r===n)return[t,e];for(var i=[],a=[],o=r<n?t:e,s=Math.min(r,n),l=Math.abs(n-r)/6,u=(s-2)/6,d=Math.ceil(l/u)+1,h=[o[0],o[1]],f=l,p=2;p<s;){var g=o[p-2],m=o[p-1],T=o[p++],v=o[p++],y=o[p++],_=o[p++],Q=o[p++],b=o[p++];if(f<=0){h.push(T,v,y,_,Q,b);continue}for(var x=Math.min(f,d-1)+1,E=1;E<=x;E++){var S=E/x;v5(g,T,y,Q,S,i),v5(m,v,_,b,S,a),g=i[3],m=a[3],h.push(i[1],a[1],i[2],a[2],g,m),T=i[5],v=a[5],y=i[6],_=a[6]}f-=x-1}return o===t?[h,e]:[t,h]}function WKe(t,e){for(var r=t.length,n=t[r-2],i=t[r-1],a=[],o=0;o<e.length;)a[o++]=n,a[o++]=i;return a}function PTr(t,e){for(var r,n,i,a=[],o=[],s=0;s<Math.max(t.length,e.length);s++){var l=t[s],u=e[s],d=void 0,h=void 0;l?u?(r=kTr(l,u),d=r[0],h=r[1],n=d,i=h):(h=WKe(i||l,l),d=l):(d=WKe(n||u,u),h=u),a.push(d),o.push(h)}return[a,o]}function YKe(t){for(var e=0,r=0,n=0,i=t.length,a=0,o=i-2;a<i;o=a,a+=2){var s=t[o],l=t[o+1],u=t[a],d=t[a+1],h=s*d-u*l;e+=h,r+=(s+u)*h,n+=(l+d)*h}return e===0?[t[0]||0,t[1]||0]:[r/e/3,n/e/3,e]}function BTr(t,e,r,n){for(var i=(t.length-2)/6,a=1/0,o=0,s=t.length,l=s-2,u=0;u<i;u++){for(var d=u*6,h=0,f=0;f<s;f+=2){var p=f===0?d:(d+f-2)%l+2,g=t[p]-r[0],m=t[p+1]-r[1],T=e[f]-n[0],v=e[f+1]-n[1],y=T-g,_=v-m;h+=y*y+_*_}h<a&&(a=h,o=u)}return o}function HTr(t){for(var e=[],r=t.length,n=0;n<r;n+=2)e[n]=t[r-n-2],e[n+1]=t[r-n-1];return e}function FTr(t,e,r,n){for(var i=[],a,o=0;o<t.length;o++){var s=t[o],l=e[o],u=YKe(s),d=YKe(l);a==null&&(a=u[2]<0!=d[2]<0);var h=[],f=[],p=0,g=1/0,m=[],T=s.length;a&&(s=HTr(s));for(var v=BTr(s,l,u,d)*6,y=T-2,_=0;_<y;_+=2){var Q=(v+_)%y+2;h[_+2]=s[Q]-u[0],h[_+3]=s[Q+1]-u[1]}h[0]=s[v]-u[0],h[1]=s[v+1]-u[1];for(var b=n/r,x=-n/2;x<=n/2;x+=b){for(var E=Math.sin(x),S=Math.cos(x),C=0,_=0;_<s.length;_+=2){var L=h[_],w=h[_+1],O=l[_]-d[0],R=l[_+1]-d[1],M=O*S-R*E,D=O*E+R*S;m[_]=M,m[_+1]=D;var P=M-L,B=D-w;C+=P*P+B*B}if(C<g){g=C,p=x;for(var k=0;k<m.length;k++)f[k]=m[k]}}i.push({from:h,to:f,fromCp:u,toCp:d,rotation:-p})}return i}function xH(t){return t.__isCombineMorphing}var jKe="__mOriginal_";function EH(t,e,r){var n=jKe+e,i=t[n]||t[e];t[n]||(t[n]=t[e]);var a=r.replace,o=r.after,s=r.before;t[e]=function(){var l=arguments,u;return s&&s.apply(this,l),a?u=a.apply(this,l):u=i.apply(this,l),o&&o.apply(this,l),u}}function ww(t,e){var r=jKe+e;t[r]&&(t[e]=t[r],t[r]=null)}function XKe(t,e){for(var r=0;r<t.length;r++)for(var n=t[r],i=0;i<n.length;){var a=n[i],o=n[i+1];n[i++]=e[0]*a+e[2]*o+e[4],n[i++]=e[1]*a+e[3]*o+e[5]}}function KKe(t,e){var r=t.getUpdatedPathProxy(),n=e.getUpdatedPathProxy(),i=PTr(Rle(r),Rle(n)),a=i[0],o=i[1],s=t.getComputedTransform(),l=e.getComputedTransform();function u(){this.transform=null}s&&XKe(a,s),l&&XKe(o,l),EH(e,"updateTransform",{replace:u}),e.transform=null;var d=FTr(a,o,10,Math.PI),h=[];EH(e,"buildPath",{replace:function(f){for(var p=e.__morphT,g=1-p,m=[],T=0;T<d.length;T++){var v=d[T],y=v.from,_=v.to,Q=v.rotation*p,b=v.fromCp,x=v.toCp,E=Math.sin(Q),S=Math.cos(Q);JI(m,b,x,p);for(var C=0;C<y.length;C+=2){var L=y[C],w=y[C+1],O=_[C],R=_[C+1],M=L*g+O*p,D=w*g+R*p;h[C]=M*S-D*E+m[0],h[C+1]=M*E+D*S+m[1]}var P=h[0],B=h[1];f.moveTo(P,B);for(var C=2;C<y.length;){var O=h[C++],R=h[C++],k=h[C++],V=h[C++],H=h[C++],$=h[C++];P===O&&B===R&&k===H&&V===$?f.lineTo(H,$):f.bezierCurveTo(O,R,k,V,H,$),P=H,B=$}}}})}function Nle(t,e,r){if(!t||!e)return e;var n=r.done,i=r.during;KKe(t,e),e.__morphT=0;function a(){ww(e,"buildPath"),ww(e,"updateTransform"),e.__morphT=-1,e.createPathProxy(),e.dirtyShape()}return e.animateTo({__morphT:1},Sr({during:function(o){e.dirtyShape(),i&&i(o)},done:function(){a(),n&&n()}},r)),e}function VTr(t,e,r,n,i,a){var o=16;t=i===r?0:Math.round(32767*(t-r)/(i-r)),e=a===n?0:Math.round(32767*(e-n)/(a-n));for(var s=0,l,u=(1<<o)/2;u>0;u/=2){var d=0,h=0;(t&u)>0&&(d=1),(e&u)>0&&(h=1),s+=u*u*(3*d^h),h===0&&(d===1&&(t=u-1-t,e=u-1-e),l=t,t=e,e=l)}return s}function SH(t){var e=1/0,r=1/0,n=-1/0,i=-1/0,a=bt(t,function(s){var l=s.getBoundingRect(),u=s.getComputedTransform(),d=l.x+l.width/2+(u?u[4]:0),h=l.y+l.height/2+(u?u[5]:0);return e=Math.min(d,e),r=Math.min(h,r),n=Math.max(d,n),i=Math.max(h,i),[d,h]}),o=bt(a,function(s,l){return{cp:s,z:VTr(s[0],s[1],e,r,n,i),path:t[l]}});return o.sort(function(s,l){return s.z-l.z}).map(function(s){return s.path})}function ZKe(t){return ITr(t.path,t.count)}function Ile(){return{fromIndividuals:[],toIndividuals:[],count:0}}function $Tr(t,e,r){var n=[];function i(b){for(var x=0;x<b.length;x++){var E=b[x];xH(E)?i(E.childrenRef()):E instanceof vn&&n.push(E)}}i(t);var a=n.length;if(!a)return Ile();var o=r.dividePath||ZKe,s=o({path:e,count:a});if(s.length!==a)return console.error("Invalid morphing: unmatched splitted path"),Ile();n=SH(n),s=SH(s);for(var l=r.done,u=r.during,d=r.individualDelay,h=new Q4,f=0;f<a;f++){var p=n[f],g=s[f];g.parent=e,g.copyTransform(h),d||KKe(p,g)}e.__isCombineMorphing=!0,e.childrenRef=function(){return s};function m(b){for(var x=0;x<s.length;x++)s[x].addSelfToZr(b)}EH(e,"addSelfToZr",{after:function(b){m(b)}}),EH(e,"removeSelfFromZr",{after:function(b){for(var x=0;x<s.length;x++)s[x].removeSelfFromZr(b)}});function T(){e.__isCombineMorphing=!1,e.__morphT=-1,e.childrenRef=null,ww(e,"addSelfToZr"),ww(e,"removeSelfFromZr")}var v=s.length;if(d)for(var y=v,_=function(){y--,y===0&&(T(),l&&l())},f=0;f<v;f++){var Q=d?Sr({delay:(r.delay||0)+d(f,v,n[f],s[f]),done:_},r):r;Nle(n[f],s[f],Q)}else e.__morphT=0,e.animateTo({__morphT:1},Sr({during:function(b){for(var x=0;x<v;x++){var E=s[x];E.__morphT=e.__morphT,E.dirtyShape()}u&&u(b)},done:function(){T();for(var b=0;b<t.length;b++)ww(t[b],"updateTransform");l&&l()}},r));return e.__zr&&m(e.__zr),{fromIndividuals:n,toIndividuals:s,count:v}}function UTr(t,e,r){var n=e.length,i=[],a=r.dividePath||ZKe;function o(p){for(var g=0;g<p.length;g++){var m=p[g];xH(m)?o(m.childrenRef()):m instanceof vn&&i.push(m)}}if(xH(t)){o(t.childrenRef());var s=i.length;if(s<n)for(var l=0,u=s;u<n;u++)i.push(Lne(i[l++%s]));i.length=n}else{i=a({path:t,count:n});for(var d=t.getComputedTransform(),u=0;u<i.length;u++)i[u].setLocalTransform(d);if(i.length!==n)return console.error("Invalid morphing: unmatched splitted path"),Ile()}i=SH(i),e=SH(e);for(var h=r.individualDelay,u=0;u<n;u++){var f=h?Sr({delay:(r.delay||0)+h(u,n,i[u],e[u])},r):r;Nle(i[u],e[u],f)}return{fromIndividuals:i,toIndividuals:e,count:e.length}}function JKe(t){return yt(t[0])}function eZe(t,e){for(var r=[],n=t.length,i=0;i<n;i++)r.push({one:t[i],many:[]});for(var i=0;i<e.length;i++){var a=e[i].length,o=void 0;for(o=0;o<a;o++)r[o%n].many.push(e[i][o])}for(var s=0,i=n-1;i>=0;i--)if(!r[i].many.length){var l=r[s].many;if(l.length<=1)if(s)s=0;else return r;var a=l.length,u=Math.ceil(a/2);r[i].many=l.slice(u,a),r[s].many=l.slice(0,u),s++}return r}var zTr={clone:function(t){for(var e=[],r=1-Math.pow(1-t.path.style.opacity,1/t.count),n=0;n<t.count;n++){var i=Lne(t.path);i.setStyle("opacity",r),e.push(i)}return e},split:null};function kle(t,e,r,n,i,a){if(!t.length||!e.length)return;var o=J9("update",n,i);if(!(o&&o.duration>0))return;var s=n.getModel("universalTransition").get("delay"),l=Object.assign({setToFinal:!0},o),u,d;JKe(t)&&(u=t,d=e),JKe(e)&&(u=e,d=t);function h(v,y,_,Q,b){var x=v.many,E=v.one;if(x.length===1&&!b){var S=y?x[0]:E,C=y?E:x[0];if(xH(S))h({many:[S],one:C},!0,_,Q,!0);else{var L=s?Sr({delay:s(_,Q)},l):l;Nle(S,C,L),a(S,C,S,C,L)}}else for(var w=Sr({dividePath:zTr[r],individualDelay:s&&function(B,k,V,H){return s(B+_,Q)}},l),O=y?$Tr(x,E,w):UTr(E,x,w),R=O.fromIndividuals,M=O.toIndividuals,D=R.length,P=0;P<D;P++){var L=s?Sr({delay:s(P,D)},l):l;a(R[P],M[P],y?x[P]:v.one,y?v.one:x[P],L)}}for(var f=u?u===t:t.length>e.length,p=u?eZe(d,u):eZe(f?e:t,[f?t:e]),g=0,m=0;m<p.length;m++)g+=p[m].many.length;for(var T=0,m=0;m<p.length;m++)h(p[m],f,T,g),T+=p[m].many.length}function _8(t){if(!t)return[];if(yt(t)){for(var e=[],r=0;r<t.length;r++)e.push(_8(t[r]));return e}var n=[];return t.traverse(function(i){i instanceof vn&&!i.disableMorphing&&!i.invisible&&!i.ignore&&n.push(i)}),n}var tZe=1e4,GTr=0,rZe=1,nZe=2,qTr=fn();function WTr(t,e){for(var r=t.dimensions,n=0;n<r.length;n++){var i=t.getDimensionInfo(r[n]);if(i&&i.otherDims[e]===0)return r[n]}}function YTr(t,e,r){var n=t.getDimensionInfo(r),i=n&&n.ordinalMeta;if(n){var a=t.get(n.name,e);return i&&i.categories[a]||a+""}}function iZe(t,e,r,n){var i=n?"itemChildGroupId":"itemGroupId",a=WTr(t,i);if(a){var o=YTr(t,e,a);return o}var s=t.getRawDataItem(e),l=n?"childGroupId":"groupId";if(s&&s[l])return s[l]+"";if(!n)return r||t.getId(e)}function aZe(t){var e=[];return ue(t,function(r){var n=r.data,i=r.dataGroupId;if(n.count()>tZe){process.env.NODE_ENV!=="production"&&_a("Universal transition is disabled on large data > 10k.");return}for(var a=n.getIndices(),o=0;o<a.length;o++)e.push({data:n,groupId:iZe(n,o,i,!1),childGroupId:iZe(n,o,i,!0),divide:r.divide,dataIndex:o})}),e}function Ple(t,e,r){t.traverse(function(n){n instanceof vn&&na(n,{style:{opacity:0}},e,{dataIndex:r,isFrom:!0})})}function Ble(t){if(t.parent){var e=t.getComputedTransform();t.setLocalTransform(e),t.parent.remove(t)}}function Zy(t){t.stopAnimation(),t.isGroup&&t.traverse(function(e){e.stopAnimation()})}function jTr(t,e,r){var n=J9("update",r,e);n&&t.traverse(function(i){if(i instanceof $2){var a=Esr(i);a&&i.animateFrom({style:a},n)}})}function XTr(t,e){var r=t.length;if(r!==e.length)return!1;for(var n=0;n<r;n++){var i=t[n],a=e[n];if(i.data.getId(i.dataIndex)!==a.data.getId(a.dataIndex))return!1}return!0}function oZe(t,e,r){var n=aZe(t),i=aZe(e);function a(_,Q,b,x,E){(b||_)&&Q.animateFrom({style:b&&b!==_?gt(gt({},b.style),_.style):_.style},E)}var o=!1,s=GTr,l=ur(),u=ur();n.forEach(function(_){_.groupId&&l.set(_.groupId,!0),_.childGroupId&&u.set(_.childGroupId,!0)});for(var d=0;d<i.length;d++){var h=i[d].groupId;if(u.get(h)){s=rZe;break}var f=i[d].childGroupId;if(f&&l.get(f)){s=nZe;break}}function p(_,Q){return function(b){var x=b.data,E=b.dataIndex;return Q?x.getId(E):_?s===rZe?b.childGroupId:b.groupId:s===nZe?b.childGroupId:b.groupId}}var g=XTr(n,i),m={};if(!g)for(var d=0;d<i.length;d++){var T=i[d],v=T.data.getItemGraphicEl(T.dataIndex);v&&(m[v.id]=!0)}function y(_,Q){var b=n[Q],x=i[_],E=x.data.hostModel,S=b.data.getItemGraphicEl(b.dataIndex),C=x.data.getItemGraphicEl(x.dataIndex);if(S===C){C&&jTr(C,x.dataIndex,E);return}S&&m[S.id]||C&&(Zy(C),S?(Zy(S),Ble(S),o=!0,kle(_8(S),_8(C),x.divide,E,_,a)):Ple(C,E,_))}new I4(n,i,p(!0,g),p(!1,g),null,"multiple").update(y).updateManyToOne(function(_,Q){var b=i[_],x=b.data,E=x.hostModel,S=x.getItemGraphicEl(b.dataIndex),C=li(bt(Q,function(L){return n[L].data.getItemGraphicEl(n[L].dataIndex)}),function(L){return L&&L!==S&&!m[L.id]});S&&(Zy(S),C.length?(ue(C,function(L){Zy(L),Ble(L)}),o=!0,kle(_8(C),_8(S),b.divide,E,_,a)):Ple(S,E,b.dataIndex))}).updateOneToMany(function(_,Q){var b=n[Q],x=b.data.getItemGraphicEl(b.dataIndex);if(!(x&&m[x.id])){var E=li(bt(_,function(C){return i[C].data.getItemGraphicEl(i[C].dataIndex)}),function(C){return C&&C!==x}),S=i[_[0]].data.hostModel;E.length&&(ue(E,function(C){return Zy(C)}),x?(Zy(x),Ble(x),o=!0,kle(_8(x),_8(E),b.divide,S,_[0],a)):ue(E,function(C){return Ple(C,S,_[0])}))}}).updateManyToMany(function(_,Q){new I4(Q,_,function(b){return n[b].data.getId(n[b].dataIndex)},function(b){return i[b].data.getId(i[b].dataIndex)}).update(function(b,x){y(_[b],Q[x])}).execute()}).execute(),o&&ue(e,function(_){var Q=_.data,b=Q.hostModel,x=b&&r.getViewOfSeriesModel(b),E=J9("update",b,0);x&&b.isAnimationEnabled()&&E&&E.duration>0&&x.group.traverse(function(S){S instanceof vn&&!S.animators.length&&S.animateFrom({style:{opacity:0}},E)})})}function sZe(t){var e=t.getModel("universalTransition").get("seriesKey");return e||t.id}function lZe(t){return yt(t)?t.sort().join(","):t}function K5(t){if(t.hostModel)return t.hostModel.getModel("universalTransition").get("divideShape")}function KTr(t,e){var r=ur(),n=ur(),i=ur();ue(t.oldSeries,function(o,s){var l=t.oldDataGroupIds[s],u=t.oldData[s],d=sZe(o),h=lZe(d);n.set(h,{dataGroupId:l,data:u}),yt(d)&&ue(d,function(f){i.set(f,{key:h,dataGroupId:l,data:u})})});function a(o){r.get(o)&&_a("Duplicated seriesKey in universalTransition "+o)}return ue(e.updatedSeries,function(o){if(o.isUniversalTransitionEnabled()&&o.isAnimationEnabled()){var s=o.get("dataGroupId"),l=o.getData(),u=sZe(o),d=lZe(u),h=n.get(d);if(h)process.env.NODE_ENV!=="production"&&a(d),r.set(d,{oldSeries:[{dataGroupId:h.dataGroupId,divide:K5(h.data),data:h.data}],newSeries:[{dataGroupId:s,divide:K5(l),data:l}]});else if(yt(u)){process.env.NODE_ENV!=="production"&&a(d);var f=[];ue(u,function(m){var T=n.get(m);T.data&&f.push({dataGroupId:T.dataGroupId,divide:K5(T.data),data:T.data})}),f.length&&r.set(d,{oldSeries:f,newSeries:[{dataGroupId:s,data:l,divide:K5(l)}]})}else{var p=i.get(u);if(p){var g=r.get(p.key);g||(g={oldSeries:[{dataGroupId:p.dataGroupId,data:p.data,divide:K5(p.data)}],newSeries:[]},r.set(p.key,g)),g.newSeries.push({dataGroupId:s,data:l,divide:K5(l)})}}}}),r}function uZe(t,e){for(var r=0;r<t.length;r++){var n=e.seriesIndex!=null&&e.seriesIndex===t[r].seriesIndex||e.seriesId!=null&&e.seriesId===t[r].id;if(n)return r}}function ZTr(t,e,r,n){var i=[],a=[];ue(Ri(t.from),function(o){var s=uZe(e.oldSeries,o);s>=0&&i.push({dataGroupId:e.oldDataGroupIds[s],data:e.oldData[s],divide:K5(e.oldData[s]),groupIdDim:o.dimension})}),ue(Ri(t.to),function(o){var s=uZe(r.updatedSeries,o);if(s>=0){var l=r.updatedSeries[s].getData();a.push({dataGroupId:e.oldDataGroupIds[s],data:l,divide:K5(l),groupIdDim:o.dimension})}}),i.length>0&&a.length>0&&oZe(i,a,n)}function JTr(t){t.registerUpdateLifecycle("series:beforeupdate",function(e,r,n){ue(Ri(n.seriesTransition),function(i){ue(Ri(i.to),function(a){for(var o=n.updatedSeries,s=0;s<o.length;s++)(a.seriesIndex!=null&&a.seriesIndex===o[s].seriesIndex||a.seriesId!=null&&a.seriesId===o[s].id)&&(o[s][CP]=!0)})})}),t.registerUpdateLifecycle("series:transition",function(e,r,n){var i=qTr(r);if(i.oldSeries&&n.updatedSeries&&n.optionChanged){var a=n.seriesTransition;if(a)ue(Ri(a),function(p){ZTr(p,i,n,r)});else{var o=KTr(i,n);ue(o.keys(),function(p){var g=o.get(p);oZe(g.oldSeries,g.newSeries,r)})}ue(n.updatedSeries,function(p){p[CP]&&(p[CP]=!1)})}for(var s=e.getSeries(),l=i.oldSeries=[],u=i.oldDataGroupIds=[],d=i.oldData=[],h=0;h<s.length;h++){var f=s[h].getData();f.count()<tZe&&(l.push(s[h]),u.push(s[h].get("dataGroupId")),d.push(f))}})}var evr=function(){function t(){this.breaks=[],this._elapsedExtent=[1/0,-1/0]}return t.prototype.setBreaks=function(e){this.breaks=e.breaks},t.prototype.update=function(e){rvr(this,e);var r=this._elapsedExtent;r[0]=this.elapse(e[0]),r[1]=this.elapse(e[1])},t.prototype.hasBreaks=function(){return!!this.breaks.length},t.prototype.calcNiceTickMultiple=function(e,r){for(var n=0;n<this.breaks.length;n++){var i=this.breaks[n];if(i.vmin<e&&e<i.vmax){var a=r(e,i.vmax);return process.env.NODE_ENV!=="production"&&nr(a>=0&&Math.round(a)===a),a}}return 0},t.prototype.getExtentSpan=function(){return this._elapsedExtent[1]-this._elapsedExtent[0]},t.prototype.normalize=function(e){var r=this._elapsedExtent[1]-this._elapsedExtent[0];return r===0?.5:(this.elapse(e)-this._elapsedExtent[0])/r},t.prototype.scale=function(e){return this.unelapse(e*(this._elapsedExtent[1]-this._elapsedExtent[0])+this._elapsedExtent[0])},t.prototype.elapse=function(e){for(var r=cZe,n=dZe,i=!0,a=0;a<this.breaks.length;a++){var o=this.breaks[a];if(e<=o.vmax){e>o.vmin?r+=o.vmin-n+(e-o.vmin)/(o.vmax-o.vmin)*o.gapReal:r+=e-n,n=o.vmax,i=!1;break}r+=o.vmin-n+o.gapReal,n=o.vmax}return i&&(r+=e-n),r},t.prototype.unelapse=function(e){for(var r=cZe,n=dZe,i=!0,a=0,o=0;o<this.breaks.length;o++){var s=this.breaks[o],l=r+s.vmin-n,u=l+s.gapReal;if(e<=u){e>l?a=s.vmin+(e-l)/(u-l)*(s.vmax-s.vmin):a=n+e-r,n=s.vmax,i=!1;break}r=u,n=s.vmax}return i&&(a=n+e-r),a},t}();function tvr(){return new evr}var cZe=0,dZe=0;function rvr(t,e){var r=0,n={tpAbs:{span:0,val:0},tpPrct:{span:0,val:0}},i=function(){return{has:!1,span:NaN,inExtFrac:NaN,val:NaN}},a={S:{tpAbs:i(),tpPrct:i()},E:{tpAbs:i(),tpPrct:i()}};ue(t.breaks,function(s){var l=s.gapParsed;l.type==="tpPrct"&&(r+=l.val);var u=Hle(s,e);if(u){var d=u.vmin!==s.vmin,h=u.vmax!==s.vmax,f=u.vmax-u.vmin;if(!(d&&h))if(d||h){var p=d?"S":"E";a[p][l.type].has=!0,a[p][l.type].span=f,a[p][l.type].inExtFrac=f/(s.vmax-s.vmin),a[p][l.type].val=l.val}else n[l.type].span+=f,n[l.type].val+=l.val}});var o=r*(0+(e[1]-e[0])+(n.tpAbs.val-n.tpAbs.span)+(a.S.tpAbs.has?(a.S.tpAbs.val-a.S.tpAbs.span)*a.S.tpAbs.inExtFrac:0)+(a.E.tpAbs.has?(a.E.tpAbs.val-a.E.tpAbs.span)*a.E.tpAbs.inExtFrac:0)-n.tpPrct.span-(a.S.tpPrct.has?a.S.tpPrct.span*a.S.tpPrct.inExtFrac:0)-(a.E.tpPrct.has?a.E.tpPrct.span*a.E.tpPrct.inExtFrac:0))/(1-n.tpPrct.val-(a.S.tpPrct.has?a.S.tpPrct.val*a.S.tpPrct.inExtFrac:0)-(a.E.tpPrct.has?a.E.tpPrct.val*a.E.tpPrct.inExtFrac:0));ue(t.breaks,function(s){var l=s.gapParsed;l.type==="tpPrct"&&(s.gapReal=r!==0?Math.max(o,0)*l.val/r:0),l.type==="tpAbs"&&(s.gapReal=l.val),s.gapReal==null&&(s.gapReal=0)})}function nvr(t,e,r,n,i,a){t!=="no"&&ue(r,function(o){var s=Hle(o,a);if(s)for(var l=e.length-1;l>=0;l--){var u=e[l],d=n(u),h=i*3/4;d>s.vmin-h&&d<s.vmax+h&&(t!=="preserve_extent_bound"||d!==a[0]&&d!==a[1])&&e.splice(l,1)}})}function ivr(t,e,r,n){ue(e,function(i){var a=Hle(i,r);a&&(t.push({value:a.vmin,break:{type:"vmin",parsedBreak:a},time:n?n(a):void 0}),t.push({value:a.vmax,break:{type:"vmax",parsedBreak:a},time:n?n(a):void 0}))}),e.length&&t.sort(function(i,a){return i.value-a.value})}function Hle(t,e){var r=Math.max(t.vmin,e[0]),n=Math.min(t.vmax,e[1]);return r<n||r===n&&r>e[0]&&r<e[1]?{vmin:r,vmax:n,breakOption:t.breakOption,gapParsed:t.gapParsed,gapReal:t.gapReal}:null}function Fle(t,e,r){var n=[];if(!t)return{breaks:n};function i(o,s){return o>=0&&o<1-1e-5?!0:(process.env.NODE_ENV!=="production"&&kn(s+" must be >= 0 and < 1, rather than "+o+" ."),!1)}ue(t,function(o){if(!o||o.start==null||o.end==null){process.env.NODE_ENV!=="production"&&kn("The input axis breaks start/end should not be empty.");return}if(!o.isExpanded){var s={breakOption:br(o),vmin:e(o.start),vmax:e(o.end),gapParsed:{type:"tpAbs",val:0},gapReal:null};if(o.gap!=null){var l=!1;if(zt(o.gap)){var u=k2(o.gap);if(u.match(/%$/)){var d=parseFloat(u)/100;i(d,"Percent gap")||(d=0),s.gapParsed.type="tpPrct",s.gapParsed.val=d,l=!0}}if(!l){var h=e(o.gap);(!isFinite(h)||h<0)&&(process.env.NODE_ENV!=="production"&&kn("Axis breaks gap must positive finite rather than ("+o.gap+")."),h=0),s.gapParsed.type="tpAbs",s.gapParsed.val=h}}if(s.vmin===s.vmax&&(s.gapParsed.type="tpAbs",s.gapParsed.val=0),r&&r.noNegative&&ue(["vmin","vmax"],function(p){s[p]<0&&(process.env.NODE_ENV!=="production"&&kn("Axis break."+p+" must not be negative."),s[p]=0)}),s.vmin>s.vmax){var f=s.vmax;s.vmax=s.vmin,s.vmin=f}n.push(s)}}),n.sort(function(o,s){return o.vmin-s.vmin});var a=-1/0;return ue(n,function(o,s){a>o.vmin&&(process.env.NODE_ENV!=="production"&&kn("Axis breaks must not overlap."),n[s]=null),a=o.vmax}),{breaks:n.filter(function(o){return!!o})}}function Vle(t,e){return $le(e)===$le(t)}function $le(t){return t.start+"_\0_"+t.end}function avr(t,e,r){var n=[];ue(t,function(a,o){var s=e(a);s&&s.type==="vmin"&&n.push([o])}),ue(t,function(a,o){var s=e(a);if(s&&s.type==="vmax"){var l=rm(n,function(u){return Vle(e(t[u[0]]).parsedBreak.breakOption,s.parsedBreak.breakOption)});l&&l.push(o)}});var i=[];return ue(n,function(a){a.length===2&&i.push(r?a:[t[a[0]],t[a[1]]])}),i}function ovr(t,e,r,n){var i,a;if(t.break){var o=t.break.parsedBreak,s=rm(r,function(h){return Vle(h.breakOption,t.break.parsedBreak.breakOption)}),l=n(Math.pow(e,o.vmin),s.vmin),u=n(Math.pow(e,o.vmax),s.vmax),d={type:o.gapParsed.type,val:o.gapParsed.type==="tpAbs"?Co(Math.pow(e,o.vmin+o.gapParsed.val))-l:o.gapParsed.val};i={type:t.break.type,parsedBreak:{breakOption:o.breakOption,vmin:l,vmax:u,gapParsed:d,gapReal:o.gapReal}},a=s[t.break.type]}return{brkRoundingCriterion:a,vBreak:i}}function svr(t,e,r){var n={noNegative:!0},i=Fle(t,r,n),a=Fle(t,r,n),o=Math.log(e);return a.breaks=bt(a.breaks,function(s){var l=Math.log(s.vmin)/o,u=Math.log(s.vmax)/o,d={type:s.gapParsed.type,val:s.gapParsed.type==="tpAbs"?Math.log(s.vmin+s.gapParsed.val)/o-l:s.gapParsed.val};return{vmin:l,vmax:u,gapParsed:d,gapReal:s.gapReal,breakOption:s.breakOption}}),{parsedOriginal:i,parsedLogged:a}}var lvr={vmin:"start",vmax:"end"};function uvr(t,e){return e&&(t=t||{},t.break={type:lvr[e.type],start:e.parsedBreak.vmin,end:e.parsedBreak.vmax}),t}function cvr(){Wsr({createScaleBreakContext:tvr,pruneTicksByBreak:nvr,addBreaksToTicks:ivr,parseAxisBreakOption:Fle,identifyAxisBreak:Vle,serializeAxisBreakIdentifier:$le,retrieveAxisBreakPairs:avr,getTicksLogTransformBreak:ovr,logarithmicParseBreaksFromOption:svr,makeAxisLabelFormatterParamBreak:uvr})}var hZe=fn();function dvr(t,e){var r=rm(t,function(n){return Oo().identifyAxisBreak(n.parsedBreak.breakOption,e.breakOption)});return r||t.push(r={zigzagRandomList:[],parsedBreak:e,shouldRemove:!1}),r}function hvr(t){ue(t,function(e){return e.shouldRemove=!0})}function fvr(t){for(var e=t.length-1;e>=0;e--)t[e].shouldRemove&&t.splice(e,1)}function pvr(t,e,r,n,i){var a=r.axis;if(a.scale.isBlank()||!Oo())return;var o=Oo().retrieveAxisBreakPairs(a.scale.getTicks({breakTicks:"only_break"}),function(C){return C.break},!1);if(!o.length)return;var s=r.getModel("breakArea"),l=s.get("zigzagAmplitude"),u=s.get("zigzagMinSpan"),d=s.get("zigzagMaxSpan");u=Math.max(2,u||0),d=Math.max(u,d||0);var h=s.get("expandOnClick"),f=s.get("zigzagZ"),p=s.getModel("itemStyle"),g=p.getItemStyle(),m=g.stroke,T=g.lineWidth,v=g.lineDash,y=g.fill,_=new Tr({ignoreModelZ:!0}),Q=a.isHorizontal(),b=hZe(e).visualList||(hZe(e).visualList=[]);hvr(b);for(var x=function(C){var L=o[C][0].break.parsedBreak,w=[];w[0]=a.toGlobalCoord(a.dataToCoord(L.vmin,!0)),w[1]=a.toGlobalCoord(a.dataToCoord(L.vmax,!0)),w[1]<w[0]&&w.reverse();var O=dvr(b,L);O.shouldRemove=!1;var R=new Tr;S(O.zigzagRandomList,R,w[0],w[1],Q,L),h&&R.on("click",function(){var M={type:TB,breaks:[{start:L.breakOption.start,end:L.breakOption.end}]};M[a.dim+"AxisIndex"]=r.componentIndex,i.dispatchAction(M)}),R.silent=!h,_.add(R)},E=0;E<o.length;E++)x(E);t.add(_),fvr(b);function S(C,L,w,O,R,M){var D={stroke:m,lineWidth:T,lineDash:v,fill:"none"},P=R?0:1,B=1-P,k=n[Pr[B]]+n[Ao[B]];function V(ae){var le=[],oe=[];le[P]=oe[P]=ae,le[B]=n[Pr[B]],oe[B]=k;var Ce={x1:le[0],y1:le[1],x2:oe[0],y2:oe[1]};return Fk(Ce,Ce,{lineWidth:1}),le[0]=Ce.x1,le[1]=Ce.y1,le[P]}w=V(w),O=V(O);for(var H=[],$=[],G=!0,U=n[Pr[B]],Y=0;;Y++){var ne=U===n[Pr[B]],te=U>=k;te&&(U=k);var ee=[],ie=[];ee[P]=w,ie[P]=O,!ne&&!te&&(ee[P]+=G?-l:l,ie[P]-=G?l:-l),ee[B]=U,ie[B]=U,H.push(ee),$.push(ie);var j=void 0;if(Y<C.length?j=C[Y]:(j=Math.random(),C.push(j)),U+=j*(d-u)+u,G=!G,te)break}var X=Oo().serializeAxisBreakIdentifier(M.breakOption);if(L.add(new yl({anid:"break_a_"+X,shape:{points:H},style:D,z:f})),M.gapReal!==0){L.add(new yl({anid:"break_b_"+X,shape:{points:$},style:D,z:f}));var Z=$.slice();Z.reverse();var K=H.concat(Z);L.add(new tu({anid:"break_c_"+X,shape:{points:K},style:{fill:y,opacity:g.opacity},z:f}))}}}function gvr(t,e,r,n){var i=t.axis,a=r.transform;nr(n.style);var o=i.getExtent();i.inverse&&(o=o.slice(),o.reverse());var s=Oo().retrieveAxisBreakPairs(i.scale.getTicks({breakTicks:"only_break"}),function(T){return T.break},!1),l=bt(s,function(T){var v=T[0].break.parsedBreak,y=[i.dataToCoord(v.vmin,!0),i.dataToCoord(v.vmax,!0)];return y[0]>y[1]&&y.reverse(),{coordPair:y,brkId:Oo().serializeAxisBreakIdentifier(v.breakOption)}});l.sort(function(T,v){return T.coordPair[0]-v.coordPair[0]});for(var u=o[0],d=null,h=0;h<l.length;h++){var f=l[h],p=Math.max(f.coordPair[0],o[0]),g=Math.min(f.coordPair[1],o[1]);u<=p&&m(u,p,d,f),u=g,d=f}u<=o[1]&&m(u,o[1],d,null);function m(T,v,y,_){function Q(w,O){a&&(lo(w,w,a),lo(O,O,a))}function b(w,O){var R={x1:w[0],y1:w[1],x2:O[0],y2:O[1]};Fk(R,R,n.style),w[0]=R.x1,w[1]=R.y1,O[0]=R.x2,O[1]=R.y2}var x=[T,0],E=[v,0],S=[T,5],C=[v,5];Q(x,S),b(x,S),Q(E,C),b(E,C),b(x,E);var L=new wo(gt({shape:{x1:x[0],y1:x[1],x2:E[0],y2:E[1]}},n));e.add(L),L.anid="breakLine_"+(y?y.brkId:"\0")+"_\0_"+(_?_.brkId:"\0")}}function mvr(t,e,r){if(rm(r,function(y){return!y}))return;var n=new xr;if(!aB(r[0],r[1],n,{direction:-(t?e+Math.PI:e),touchThreshold:0,bidirectional:!1}))return;var i=qs();g5(i,i,-e);var a=bt(r,function(y){return y.transform?w3(qs(),i,y.transform):i});function o(y){var _=r[0].localRect,Q=new xr(_[Ao[y]]*a[0][0],_[Ao[y]]*a[0][1]);return Math.abs(Q.y)<1e-5}var s=.5;if(o(0)||o(1)){var l=bt(r,function(y,_){var Q=y.localRect.clone();return Q.applyTransform(a[_]),Q}),u=new xr;u.copy(r[0].label).add(r[1].label).scale(.5),u.transform(i);var d=n.clone().transform(i),h=l[0].x+l[1].x+(d.x>=0?l[0].width:l[1].width),f=(h+d.x)/2-u.x,p=Math.min(f,f-d.x),g=Math.max(f,f-d.x),m=g<0?g:p>0?p:0;s=(f-m)/d.x}var T=new xr,v=new xr;xr.scale(T,n,-s),xr.scale(v,n,1-s),pae(r[0],T),pae(r[1],v)}function Tvr(t,e){var r={breaks:[]};return ue(e.breaks,function(n){if(n){var i=rm(t.get("breaks",!0),function(s){return Oo().identifyAxisBreak(s,n)});if(!i){process.env.NODE_ENV!=="production"&&_a("Can not find axis break by start: "+n.start+", end: "+n.end);return}var a=e.type,o={isExpanded:!!i.isExpanded};i.isExpanded=a===TB?!0:a===QGe?!1:a===xGe?!i.isExpanded:i.isExpanded,r.breaks.push({start:i.start,end:i.end,isExpanded:!!i.isExpanded,old:o})}}),r}function vvr(){pdr({adjustBreakLabelPair:mvr,buildAxisBreakLine:gvr,rectCoordBuildBreakAxis:pvr,updateModelAxisBreak:Tvr})}function yvr(t){_dr(t),cvr(),vvr()}function _vr(){Vdr(bvr)}function bvr(t,e){ue(t,function(r){if(!r.model.get(["axisLabel","inside"])){var n=Qvr(r);if(n){var i=r.isHorizontal()?"height":"width",a=r.model.get(["axisLabel","margin"]);e[i]-=n[i]+a,r.position==="top"?e.y+=n.height+a:r.position==="left"&&(e.x+=n.width+a)}}})}function Qvr(t){var e=t.model,r=t.scale;if(!e.get(["axisLabel","show"])||r.isBlank())return;var n,i,a=r.getExtent();r instanceof xy?i=r.count():(n=r.getTicks(),i=n.length);var o=t.getLabelModel(),s=Sy(t),l,u=1;i>40&&(u=Math.ceil(i/40));for(var d=0;d<i;d+=u){var h=n?n[d]:{value:a[0]+d},f=s(h,d),p=o.getTextRect(f),g=m(p,o.get("rotate")||0);l?l.union(g):l=g}return l;function m(T,v){var y=v*Math.PI/180,_=T.width,Q=T.height,b=_*Math.abs(Math.cos(y))+Math.abs(Q*Math.sin(y)),x=_*Math.abs(Math.sin(y))+Math.abs(Q*Math.cos(y)),E=new Cr(T.x,T.y,b,x);return E}}rn([h0r]),rn([s0r]),rn([R0r,W0r,ndr,o3r,T3r,ohr,Dhr,mfr,Pfr,zfr,Xfr,i4r,K4r,b6r,R6r,Y6r,Z6r,l5r,g5r,C5r,R5r,$5r,Spr]),rn(zpr),rn(ggr),rn(Mqe),rn(Lgr),rn(rYe),rn(Mgr),rn(Kgr),rn(o7r),rn(q7r),rn(dmr),rn(Tw),rn(Lmr),rn(Omr),rn(Fmr),rn(Ymr),rn(e8r),rn(o8r),rn(m8r),rn(I8r),rn(mKe),rn(vKe),rn(tTr),rn(NKe),rn(kKe),rn(aTr),rn(cTr),rn(xTr),rn(CTr),rn(JTr),rn(L2r),rn(yvr),rn(_vr),rn(s3r);const xvr=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,Evr=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,Svr=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function Cvr(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){Lvr(t);return}return e}function Lvr(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function wvr(t,e={}){if(typeof t!="string")return t;if(t[0]==='"'&&t[t.length-1]==='"'&&t.indexOf("\\")===-1)return t.slice(1,-1);const r=t.trim();if(r.length<=9)switch(r.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!Svr.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(xvr.test(t)||Evr.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,Cvr)}return JSON.parse(t)}catch(n){if(e.strict)throw n;return t}}const Avr={class:"echarts-content"},Ovr={class:"echartsWrap"},Mvr={key:0,class:"echartsContent",ref:"echartsContent"},Rvr=oa({__name:"EchartsParser",props:{code:{type:String,required:!0}},setup(t){const e=Dh.PRESENTED_IMAGE_SIMPLE,r=[{value:1,label:"\u56FE\u8868"},{value:2,label:"\u6E90\u7801"}],n=I.ref(r[0].value),i=I.useTemplateRef("echartsContent"),a=I.ref(!1);let o=!1,s=null;const{stop:l}=pPe(i,()=>{s.resize()});I.onMounted(()=>{s=zcr(i.value)}),I.onUnmounted(()=>{l()}),dPe(()=>t.code,d=>{const h=wvr(d);if(typeof h=="string")o||(o=!0,s.showLoading());else{o=!1,s.hideLoading();try{s.setOption(h)}catch(f){a.value=!0,console.error("\u51FA\u9519\u5566\u554A",f)}}},{immediate:!0,debounce:50,maxWait:100});const u=async()=>{try{await dI(t.code),ma.success("\u590D\u5236\u6210\u529F!")}catch(d){ma.error(d)}};return(d,h)=>{const f=Z7e,p=Jc,g=k6,m=Dh;return I.openBlock(),I.createElementBlock("div",Avr,[I.createVNode(Dte,null,{title:I.withCtx(()=>[I.createVNode(f,{value:n.value,"onUpdate:value":h[0]||(h[0]=T=>n.value=T),options:r},null,8,["value"])]),actions:I.withCtx(()=>[I.createVNode(g,null,{title:I.withCtx(()=>h[1]||(h[1]=[I.createTextVNode("\u590D\u5236")])),default:I.withCtx(()=>[I.createVNode(p,{type:"text",size:"small",onClick:u},{default:I.withCtx(()=>[I.createVNode(I.unref(ox))]),_:1})]),_:1})]),_:1}),I.withDirectives(I.createElementVNode("div",Ovr,[a.value?(I.openBlock(),I.createBlock(m,{key:1,description:"\u6E32\u67D3\u5931\u8D25",image:I.unref(e)},null,8,["image"])):(I.openBlock(),I.createElementBlock("div",Mvr,null,512))],512),[[I.vShow,n.value===1]]),I.withDirectives(I.createElementVNode("pre",{class:"code-wrapper"},I.toDisplayString(t.code),513),[[I.vShow,n.value===2]])])}}},[["__scopeId","data-v-8911aac2"]]),Dvr={__name:"FenceParser",props:{node:{type:Object,default:()=>null}},setup(t){const e=I.ref(""),r=I.ref("");return I.watch(()=>t.node,()=>{t.node&&SE(t.node,n=>{var i,a,o;n.type==="text"?e.value=n.value:n.type==="element"&&n.tagName==="code"&&(r.value=((o=(a=(i=n.properties)==null?void 0:i.className)==null?void 0:a[0])==null?void 0:o.replace("language-",""))||"")})},{immediate:!0}),(n,i)=>r.value==="mermaid"?(I.openBlock(),I.createBlock(Dnr,{key:0,code:e.value},null,8,["code"])):r.value==="echarts"?(I.openBlock(),I.createBlock(Rvr,{key:1,code:e.value},null,8,["code"])):(I.openBlock(),I.createBlock(fnr,{key:2,code:e.value,lang:r.value},null,8,["code","lang"]))}},Nvr={class:"markdown-body"},CH=Object.assign({name:"AiMdParser"},{__name:"MdParser",props:I.mergeDefaults({content:String},{content:""}),setup(t){function e(d){const h=[];let f=0;return d=d.replace(/\$\$([\s\S]*?)\$\$/g,p=>{const g=`__PROTECTED_MATH_BLOCK_${f}__`;return h[f]=p,f++,g}),d=d.replace(/\$([^\$\n]+?)\$/g,(p,g)=>{if(/[\u4e00-\u9fa5。,、“”‘’;:?!【】()《》]/.test(g))return p;const m=`__PROTECTED_INLINE_MATH_${f}__`;return h[f]=p,f++,m}),d=d.replace(/```[\s\S]*?```/g,p=>{const g=`__PROTECTED_CODE_BLOCK_${f}__`;return h[f]=p,f++,g}),d=d.replace(/`([^`]+)`/g,p=>{const g=`__PROTECTED_INLINE_CODE_${f}__`;return h[f]=p,f++,g}),{markdown:d,protectedRegions:h}}function r(d,h){let f=d;return h.forEach((p,g)=>{let m="INLINE_CODE";p.startsWith("```")?m="CODE_BLOCK":p.startsWith("$$")?m="MATH_BLOCK":p.startsWith("$")&&(m="INLINE_MATH");const T=`__PROTECTED_${m}_${g}__`;f=f.split(T).join(p)}),f}function n(d){return d.replace(/\\n/g,`
|
|
964
|
+
`).replace(/\\r/g,"\r").replace(/\\t/g," ").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\v/g,"\v").replace(/\$/g,"\\$")}function i(d){const{markdown:h,protectedRegions:f}=e(d),p=n(h);return r(p,f)}const a=/(?:https?:\/\/|www\.)?(?:\d{1,3}(?:\.\d{1,3}){3}|\w[-\w.]+(?:\.[a-zA-Z]{2,}))(?:\:\d+)?(?:\/[^\s\)\[\]\}\u4e00-\u9fa5。()"'“”‘’}]*)?(?:\?[^\s\)\[\]\}\u4e00-\u9fa5。()"'“”‘’}]*)?(?:#[^\s\)\[\]\}\u4e00-\u9fa5。()"'“”‘’}]*)?/g;function o(d){const h=[];return d.replace(/<[^>]+>/gi,g=>(h.push(g),`__PROTECTED_PLACEHOLDER_${h.length-1}__`)).replace(a,g=>` ${g} `).replace(/__PROTECTED_PLACEHOLDER_(\d+)__/g,(g,m)=>h[m])}const s=d=>Lxt(i,o)(d),l=I.computed(()=>s(t.content)),u={singleTilde:!1};return(d,h)=>{const f=Eg;return I.openBlock(),I.createElementBlock("div",Nvr,[I.createVNode(Rte,{markdown:l.value,remarkPlugins:[[I.unref(AWt),u],I.unref(zWt),I.unref(RWt),I.unref(UWt)],rehypePlugins:[I.unref(EKt),I.unref(WKt),I.unref(Dtr)]},{a:I.withCtx(({node:p})=>{var g,m;return[p.properties.href.startsWith("#")?(I.openBlock(),I.createElementBlock("a",I.normalizeProps(I.mergeProps({key:0},p.properties)),I.toDisplayString((g=p.children[0])==null?void 0:g.value),17)):(I.openBlock(),I.createElementBlock("a",I.mergeProps({key:1},p.properties,{target:"_blank",rel:"noopener noreferrer"}),I.toDisplayString((m=p.children[0])==null?void 0:m.value),17))]}),pre:I.withCtx(({node:p})=>[I.createVNode(Dvr,{node:p},null,8,["node"])]),img:I.withCtx(({node:p})=>[I.createVNode(f,I.mergeProps(p.properties,{previewMask:!1,style:{cursor:"pointer"}}),null,16)]),_:1},8,["markdown","remarkPlugins","rehypePlugins"])])}}}),Ivr={key:0,class:"ai-chat-record-avatar"},kvr={class:"ai-chat-record-wrap"},Pvr={class:"ai-chat-record-head"},Bvr={key:0,class:"ai-chat-record-time"},Hvr={class:"ai-chat-record-body"},Fvr={key:0,class:"ai-chat-record-loading-wrap"},Vvr={key:1,class:"ai-chat-record-content"},$vr={class:"ai-chat-record-content-before"},Uvr={class:"ai-chat-record-content-inner"},zvr={class:"ai-chat-record-content-after"},Gvr={key:0,class:"character-count"},qvr={key:0,class:"ai-chat-record-foot"},Wvr={class:"foot-actions"},Yvr={key:0,class:"copy-tooltip-inner"},jvr={key:1,class:"copy-tooltip-inner copy-tooltip-inner--error"},fZe=oa(Object.assign({name:"AiChatRecord"},{__name:"ChatRecord",props:{status:{type:String,default:"done"},loadingMessage:{type:String,default:"AI\u7EC4\u7EC7\u8BED\u8A00\u4E2D"},pos:{type:String,default:"l"},fullWidth:{type:Boolean,default:!1},avatar:{type:String,default:""},showAvatar:{type:Boolean,default:!0},content:{type:String,default:""},time:{type:String},showTime:{type:Boolean,default:!0},timeFormat:{type:String,default:"yyyy/MM/dd hh:mm:ss"},showCharacterCount:{type:Boolean,default:!0},showFoot:{type:Boolean,default:!0},actions:{type:Array,default:()=>["copy","regenerate"]},copyTipType:{type:String,default:"tooltip"}},emits:["regenerate"],setup(t,{expose:e,emit:r}){const n={Loading:"loading",Generating:"generating",Done:"done"},i=t,a=r,o=I.ref(),s=I.ref(!0),l=I.ref(!1),u=I.computed(()=>HLe(i.time,i.timeFormat)),d=I.computed(()=>{var f,p;if(i.status==="done"){let g=(p=(f=o.value)==null?void 0:f.querySelector(".ai-chat-record-content-inner"))==null?void 0:p.innerText;return(g==null?void 0:g.length)??0}else return 0});function h(){var g;let f=(g=o.value)==null?void 0:g.querySelector(".ai-chat-record-content-inner");if(!f)return;function p(){i.copyTipType==="message"?s.value?ma.success("\u590D\u5236\u6210\u529F"):ma.error("\u590D\u5236\u5931\u8D25"):(l.value=!0,setTimeout(()=>{l.value=!1},1e3))}FLe(f).then(()=>{s.value=!0,p()}).catch(()=>{s.value=!1,p()})}return e({statusEnum:n}),(f,p)=>{const g=_v,m=k6;return I.openBlock(),I.createElementBlock("div",{ref_key:"elRef",ref:o,class:I.normalizeClass(["ai-chat-record",{"ai-chat-record--r":t.pos==="r","ai-chat-record--full-width":t.fullWidth,"ai-chat-record--show-time":t.showTime}])},[t.showAvatar?(I.openBlock(),I.createElementBlock("div",Ivr,[I.renderSlot(f.$slots,"avatar",{},()=>[I.createVNode(g,{size:40,src:t.avatar},{icon:I.withCtx(()=>p[1]||(p[1]=[])),_:1},8,["src"])],!0)])):I.createCommentVNode("",!0),I.createElementVNode("div",kvr,[I.createElementVNode("div",Pvr,[I.renderSlot(f.$slots,"head",{},()=>[t.showTime?(I.openBlock(),I.createElementBlock("div",Bvr,[I.renderSlot(f.$slots,"time",{time:u.value},()=>[I.createTextVNode(I.toDisplayString(u.value),1)],!0)])):I.createCommentVNode("",!0),I.renderSlot(f.$slots,"headRight",{},void 0,!0)],!0)]),I.createElementVNode("div",Hvr,[t.status===n.Loading?(I.openBlock(),I.createElementBlock("div",Fvr,[I.renderSlot(f.$slots,"loading",{},()=>[I.createVNode(zUt,{theme:t.pos==="r"?"light":"",message:t.loadingMessage},null,8,["theme","message"])],!0)])):(I.openBlock(),I.createElementBlock("div",Vvr,[I.createElementVNode("div",$vr,[I.renderSlot(f.$slots,"contentBefore",{},void 0,!0)]),I.createElementVNode("div",Uvr,[I.renderSlot(f.$slots,"content",{},()=>[I.createVNode(CH,{content:t.content},null,8,["content"])],!0)]),I.createElementVNode("div",zvr,[I.renderSlot(f.$slots,"contentAfter",{},void 0,!0)]),t.showCharacterCount&&t.status===n.Done?(I.openBlock(),I.createElementBlock("div",Gvr,[I.renderSlot(f.$slots,"characterCountBefore",{},void 0,!0),I.renderSlot(f.$slots,"characterCount",{},()=>[I.withDirectives(I.createElementVNode("span",null,"\u5171"+I.toDisplayString(d.value)+"\u4E2A\u5B57\u7B26",513),[[I.vShow,d.value]])],!0),I.renderSlot(f.$slots,"characterCountAfter",{},void 0,!0)])):I.createCommentVNode("",!0)]))]),t.showFoot?(I.openBlock(),I.createElementBlock("div",qvr,[I.renderSlot(f.$slots,"foot",{},()=>[I.createElementVNode("div",Wvr,[I.renderSlot(f.$slots,"actionsBefore",{},void 0,!0),I.renderSlot(f.$slots,"actions",{},()=>[I.createVNode(m,{overlayClassName:"copy-tooltip",open:l.value,color:"#fff"},{title:I.withCtx(()=>[s.value?(I.openBlock(),I.createElementBlock("span",Yvr,[I.createVNode(I.unref(bg),{class:"copy-tooltip-icon"}),p[2]||(p[2]=I.createTextVNode(" \u590D\u5236\u6210\u529F "))])):(I.openBlock(),I.createElementBlock("span",jvr,[I.createVNode(I.unref(xR),{class:"copy-tooltip-icon"}),p[3]||(p[3]=I.createTextVNode(" \u590D\u5236\u5931\u8D25 "))]))]),default:I.withCtx(()=>[I.createVNode(m,{title:"\u590D\u5236"},{default:I.withCtx(()=>[t.status===n.Done&&t.actions.includes("copy")?(I.openBlock(),I.createElementBlock("button",{key:0,class:"action",onClick:h},p[4]||(p[4]=[I.createElementVNode("i",{class:"action-icon ai-icon ai-icon-copy"},null,-1)]))):I.createCommentVNode("",!0)]),_:1})]),_:1},8,["open"]),I.createVNode(m,{title:"\u91CD\u65B0\u751F\u6210"},{default:I.withCtx(()=>[t.status===n.Done&&t.actions.includes("regenerate")?(I.openBlock(),I.createElementBlock("button",{key:0,class:"action",onClick:p[0]||(p[0]=T=>a("regenerate"))},p[5]||(p[5]=[I.createElementVNode("i",{class:"action-icon ai-icon ai-icon-shuaxin"},null,-1)]))):I.createCommentVNode("",!0)]),_:1})],!0),I.renderSlot(f.$slots,"actionsAfter",{},void 0,!0)])],!0)])):I.createCommentVNode("",!0),I.renderSlot(f.$slots,"bottom",{},void 0,!0)])],2)}}}),[["__scopeId","data-v-9c9dad67"]]);var pZe=11;function Xvr(t,e){var r=e.attributes,n,i,a,o,s;if(!(e.nodeType===pZe||t.nodeType===pZe)){for(var l=r.length-1;l>=0;l--)n=r[l],i=n.name,a=n.namespaceURI,o=n.value,a?(i=n.localName||i,s=t.getAttributeNS(a,i),s!==o&&(n.prefix==="xmlns"&&(i=n.name),t.setAttributeNS(a,i,o))):(s=t.getAttribute(i),s!==o&&t.setAttribute(i,o));for(var u=t.attributes,d=u.length-1;d>=0;d--)n=u[d],i=n.name,a=n.namespaceURI,a?(i=n.localName||i,e.hasAttributeNS(a,i)||t.removeAttributeNS(a,i)):e.hasAttribute(i)||t.removeAttribute(i)}}var LH,Kvr="http://www.w3.org/1999/xhtml",Lc=typeof document>"u"?void 0:document,Zvr=!!Lc&&"content"in Lc.createElement("template"),Jvr=!!Lc&&Lc.createRange&&"createContextualFragment"in Lc.createRange();function e9r(t){var e=Lc.createElement("template");return e.innerHTML=t,e.content.childNodes[0]}function t9r(t){LH||(LH=Lc.createRange(),LH.selectNode(Lc.body));var e=LH.createContextualFragment(t);return e.childNodes[0]}function r9r(t){var e=Lc.createElement("body");return e.innerHTML=t,e.childNodes[0]}function n9r(t){return t=t.trim(),Zvr?e9r(t):Jvr?t9r(t):r9r(t)}function wH(t,e){var r=t.nodeName,n=e.nodeName,i,a;return r===n?!0:(i=r.charCodeAt(0),a=n.charCodeAt(0),i<=90&&a>=97?r===n.toUpperCase():a<=90&&i>=97?n===r.toUpperCase():!1)}function i9r(t,e){return!e||e===Kvr?Lc.createElement(t):Lc.createElementNS(e,t)}function a9r(t,e){for(var r=t.firstChild;r;){var n=r.nextSibling;e.appendChild(r),r=n}return e}function Ule(t,e,r){t[r]!==e[r]&&(t[r]=e[r],t[r]?t.setAttribute(r,""):t.removeAttribute(r))}var gZe={OPTION:function(t,e){var r=t.parentNode;if(r){var n=r.nodeName.toUpperCase();n==="OPTGROUP"&&(r=r.parentNode,n=r&&r.nodeName.toUpperCase()),n==="SELECT"&&!r.hasAttribute("multiple")&&(t.hasAttribute("selected")&&!e.selected&&(t.setAttribute("selected","selected"),t.removeAttribute("selected")),r.selectedIndex=-1)}Ule(t,e,"selected")},INPUT:function(t,e){Ule(t,e,"checked"),Ule(t,e,"disabled"),t.value!==e.value&&(t.value=e.value),e.hasAttribute("value")||t.removeAttribute("value")},TEXTAREA:function(t,e){var r=e.value;t.value!==r&&(t.value=r);var n=t.firstChild;if(n){var i=n.nodeValue;if(i==r||!r&&i==t.placeholder)return;n.nodeValue=r}},SELECT:function(t,e){if(!e.hasAttribute("multiple")){for(var r=-1,n=0,i=t.firstChild,a,o;i;)if(o=i.nodeName&&i.nodeName.toUpperCase(),o==="OPTGROUP")a=i,i=a.firstChild;else{if(o==="OPTION"){if(i.hasAttribute("selected")){r=n;break}n++}i=i.nextSibling,!i&&a&&(i=a.nextSibling,a=null)}t.selectedIndex=r}}},Aw=1,mZe=11,TZe=3,vZe=8;function Z5(){}function o9r(t){if(t)return t.getAttribute&&t.getAttribute("id")||t.id}function s9r(t){return function(r,n,i){if(i||(i={}),typeof n=="string")if(r.nodeName==="#document"||r.nodeName==="HTML"||r.nodeName==="BODY"){var a=n;n=Lc.createElement("html"),n.innerHTML=a}else n=n9r(n);else n.nodeType===mZe&&(n=n.firstElementChild);var o=i.getNodeKey||o9r,s=i.onBeforeNodeAdded||Z5,l=i.onNodeAdded||Z5,u=i.onBeforeElUpdated||Z5,d=i.onElUpdated||Z5,h=i.onBeforeNodeDiscarded||Z5,f=i.onNodeDiscarded||Z5,p=i.onBeforeElChildrenUpdated||Z5,g=i.skipFromChildren||Z5,m=i.addChild||function(B,k){return B.appendChild(k)},T=i.childrenOnly===!0,v=Object.create(null),y=[];function _(B){y.push(B)}function Q(B,k){if(B.nodeType===Aw)for(var V=B.firstChild;V;){var H=void 0;k&&(H=o(V))?_(H):(f(V),V.firstChild&&Q(V,k)),V=V.nextSibling}}function b(B,k,V){h(B)!==!1&&(k&&k.removeChild(B),f(B),Q(B,V))}function x(B){if(B.nodeType===Aw||B.nodeType===mZe)for(var k=B.firstChild;k;){var V=o(k);V&&(v[V]=k),x(k),k=k.nextSibling}}x(r);function E(B){l(B);for(var k=B.firstChild;k;){var V=k.nextSibling,H=o(k);if(H){var $=v[H];$&&wH(k,$)?(k.parentNode.replaceChild($,k),C($,k)):E(k)}else E(k);k=V}}function S(B,k,V){for(;k;){var H=k.nextSibling;(V=o(k))?_(V):b(k,B,!0),k=H}}function C(B,k,V){var H=o(k);if(H&&delete v[H],!V){var $=u(B,k);if($===!1||($ instanceof HTMLElement&&(B=$,x(B)),t(B,k),d(B),p(B,k)===!1))return}B.nodeName!=="TEXTAREA"?L(B,k):gZe.TEXTAREA(B,k)}function L(B,k){var V=g(B,k),H=k.firstChild,$=B.firstChild,G,U,Y,ne,te;e:for(;H;){for(ne=H.nextSibling,G=o(H);!V&&$;){if(Y=$.nextSibling,H.isSameNode&&H.isSameNode($)){H=ne,$=Y;continue e}U=o($);var ee=$.nodeType,ie=void 0;if(ee===H.nodeType&&(ee===Aw?(G?G!==U&&((te=v[G])?Y===te?ie=!1:(B.insertBefore(te,$),U?_(U):b($,B,!0),$=te,U=o($)):ie=!1):U&&(ie=!1),ie=ie!==!1&&wH($,H),ie&&C($,H)):(ee===TZe||ee==vZe)&&(ie=!0,$.nodeValue!==H.nodeValue&&($.nodeValue=H.nodeValue))),ie){H=ne,$=Y;continue e}U?_(U):b($,B,!0),$=Y}if(G&&(te=v[G])&&wH(te,H))V||m(B,te),C(te,H);else{var j=s(H);j!==!1&&(j&&(H=j),H.actualize&&(H=H.actualize(B.ownerDocument||Lc)),m(B,H),E(H))}H=ne,$=Y}S(B,$,U);var X=gZe[B.nodeName];X&&X(B,k)}var w=r,O=w.nodeType,R=n.nodeType;if(!T){if(O===Aw)R===Aw?wH(r,n)||(f(r),w=a9r(r,i9r(n.nodeName,n.namespaceURI))):w=n;else if(O===TZe||O===vZe){if(R===O)return w.nodeValue!==n.nodeValue&&(w.nodeValue=n.nodeValue),w;w=n}}if(w===n)f(r);else{if(n.isSameNode&&n.isSameNode(w))return;if(C(w,n,T),y)for(var M=0,D=y.length;M<D;M++){var P=v[y[M]];P&&b(P,P.parentNode,!1)}}return!T&&w!==r&&r.parentNode&&(w.actualize&&(w=w.actualize(r.ownerDocument||Lc)),r.parentNode.replaceChild(w,r)),w}}var l9r=s9r(Xvr);const u9r={key:1,class:"ai-content-parser-inner"},yZe=Object.assign({name:"AiContentParser"},{__name:"ContentParser",props:{type:{type:String,default:"text"},content:String,stream:{type:Boolean,default:!1},streamDone:{type:Boolean,default:!1}},setup(t){const e=t,r=I.ref(null),n=I.ref("");return I.onMounted(()=>{I.watch(()=>e.content,()=>{if(n.value=e.type==="markdown"?VLe.parse(e.content):e.content,e.type==="markdown"||e.type==="html"){const i=document.createElement("div");i.innerHTML=n.value,i.classList.add("ai-content-parser-inner"),l9r(r.value,i)}},{immediate:!0})}),(i,a)=>(I.openBlock(),I.createElementBlock("div",{class:I.normalizeClass(["ai-content-parser",`ai-content-parser--${t.type}`])},[t.type==="html"||t.type==="markdown"?(I.openBlock(),I.createElementBlock("div",{key:0,ref_key:"contentRef",ref:r,class:"ai-content-parser-inner"},null,512)):(I.openBlock(),I.createElementBlock("div",u9r,I.toDisplayString(n.value),1))],2))}}),c9r={class:"ai-think-parser"},d9r={class:"ai-think-parser-content"},_Ze=oa(Object.assign({name:"AiThinkParser"},{__name:"ThinkParser",setup(t){return(e,r)=>(I.openBlock(),I.createElementBlock("div",c9r,[I.createElementVNode("div",d9r,[I.renderSlot(e.$slots,"content",{},()=>[I.createVNode(CH,I.normalizeProps(I.guardReactiveProps(e.$attrs)),null,16)],!0)])]))}}),[["__scopeId","data-v-70d4677e"]]);function Ql(t){this.content=t}Ql.prototype={constructor:Ql,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,r){var n=r&&r!=t?this.remove(r):this,i=n.find(t),a=n.content.slice();return i==-1?a.push(r||t,e):(a[i+1]=e,r&&(a[i]=r)),new Ql(a)},remove:function(t){var e=this.find(t);if(e==-1)return this;var r=this.content.slice();return r.splice(e,2),new Ql(r)},addToStart:function(t,e){return new Ql([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var r=this.remove(t).content.slice();return r.push(t,e),new Ql(r)},addBefore:function(t,e,r){var n=this.remove(e),i=n.content.slice(),a=n.find(t);return i.splice(a==-1?i.length:a,0,e,r),new Ql(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Ql.from(t),t.size?new Ql(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Ql.from(t),t.size?new Ql(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Ql.from(t);for(var r=0;r<t.content.length;r+=2)e=e.remove(t.content[r]);return e},toObject:function(){var t={};return this.forEach(function(e,r){t[e]=r}),t},get size(){return this.content.length>>1}},Ql.from=function(t){if(t instanceof Ql)return t;var e=[];if(t)for(var r in t)e.push(r,t[r]);return new Ql(e)};function bZe(t,e,r){for(let n=0;;n++){if(n==t.childCount||n==e.childCount)return t.childCount==e.childCount?null:r;let i=t.child(n),a=e.child(n);if(i==a){r+=i.nodeSize;continue}if(!i.sameMarkup(a))return r;if(i.isText&&i.text!=a.text){for(let o=0;i.text[o]==a.text[o];o++)r++;return r}if(i.content.size||a.content.size){let o=bZe(i.content,a.content,r+1);if(o!=null)return o}r+=i.nodeSize}}function QZe(t,e,r,n){for(let i=t.childCount,a=e.childCount;;){if(i==0||a==0)return i==a?null:{a:r,b:n};let o=t.child(--i),s=e.child(--a),l=o.nodeSize;if(o==s){r-=l,n-=l;continue}if(!o.sameMarkup(s))return{a:r,b:n};if(o.isText&&o.text!=s.text){let u=0,d=Math.min(o.text.length,s.text.length);for(;u<d&&o.text[o.text.length-u-1]==s.text[s.text.length-u-1];)u++,r--,n--;return{a:r,b:n}}if(o.content.size||s.content.size){let u=QZe(o.content,s.content,r-1,n-1);if(u)return u}r-=l,n-=l}}class Gt{constructor(e,r){if(this.content=e,this.size=r||0,r==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,r,n,i=0,a){for(let o=0,s=0;s<r;o++){let l=this.content[o],u=s+l.nodeSize;if(u>e&&n(l,i+s,a||null,o)!==!1&&l.content.size){let d=s+1;l.nodesBetween(Math.max(0,e-d),Math.min(l.content.size,r-d),n,i+d)}s=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,r,n,i){let a="",o=!0;return this.nodesBetween(e,r,(s,l)=>{let u=s.isText?s.text.slice(Math.max(e,l)-l,r-l):s.isLeaf?i?typeof i=="function"?i(s):i:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&u||s.isTextblock)&&n&&(o?o=!1:a+=n),a+=u},0),a}append(e){if(!e.size)return this;if(!this.size)return e;let r=this.lastChild,n=e.firstChild,i=this.content.slice(),a=0;for(r.isText&&r.sameMarkup(n)&&(i[i.length-1]=r.withText(r.text+n.text),a=1);a<e.content.length;a++)i.push(e.content[a]);return new Gt(i,this.size+e.size)}cut(e,r=this.size){if(e==0&&r==this.size)return this;let n=[],i=0;if(r>e)for(let a=0,o=0;o<r;a++){let s=this.content[a],l=o+s.nodeSize;l>e&&((o<e||l>r)&&(s.isText?s=s.cut(Math.max(0,e-o),Math.min(s.text.length,r-o)):s=s.cut(Math.max(0,e-o-1),Math.min(s.content.size,r-o-1))),n.push(s),i+=s.nodeSize),o=l}return new Gt(n,i)}cutByIndex(e,r){return e==r?Gt.empty:e==0&&r==this.content.length?this:new Gt(this.content.slice(e,r))}replaceChild(e,r){let n=this.content[e];if(n==r)return this;let i=this.content.slice(),a=this.size+r.nodeSize-n.nodeSize;return i[e]=r,new Gt(i,a)}addToStart(e){return new Gt([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Gt(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let r=0;r<this.content.length;r++)if(!this.content[r].eq(e.content[r]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let r=this.content[e];if(!r)throw new RangeError("Index "+e+" out of range for "+this);return r}maybeChild(e){return this.content[e]||null}forEach(e){for(let r=0,n=0;r<this.content.length;r++){let i=this.content[r];e(i,n,r),n+=i.nodeSize}}findDiffStart(e,r=0){return bZe(this,e,r)}findDiffEnd(e,r=this.size,n=e.size){return QZe(this,e,r,n)}findIndex(e){if(e==0)return AH(0,e);if(e==this.size)return AH(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,n=0;;r++){let i=this.child(r),a=n+i.nodeSize;if(a>=e)return a==e?AH(r+1,a):AH(r,n);n=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,r){if(!r)return Gt.empty;if(!Array.isArray(r))throw new RangeError("Invalid input for Fragment.fromJSON");return new Gt(r.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Gt.empty;let r,n=0;for(let i=0;i<e.length;i++){let a=e[i];n+=a.nodeSize,i&&a.isText&&e[i-1].sameMarkup(a)?(r||(r=e.slice(0,i)),r[r.length-1]=a.withText(r[r.length-1].text+a.text)):r&&r.push(a)}return new Gt(r||e,n)}static from(e){if(!e)return Gt.empty;if(e instanceof Gt)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Gt([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Gt.empty=new Gt([],0);const zle={index:0,offset:0};function AH(t,e){return zle.index=t,zle.offset=e,zle}function OH(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let r=Array.isArray(t);if(Array.isArray(e)!=r)return!1;if(r){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!OH(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!OH(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}let ha=class sfe{constructor(e,r){this.type=e,this.attrs=r}addToSet(e){let r,n=!1;for(let i=0;i<e.length;i++){let a=e[i];if(this.eq(a))return e;if(this.type.excludes(a.type))r||(r=e.slice(0,i));else{if(a.type.excludes(this.type))return e;!n&&a.type.rank>this.type.rank&&(r||(r=e.slice(0,i)),r.push(this),n=!0),r&&r.push(a)}}return r||(r=e.slice()),n||r.push(this),r}removeFromSet(e){for(let r=0;r<e.length;r++)if(this.eq(e[r]))return e.slice(0,r).concat(e.slice(r+1));return e}isInSet(e){for(let r=0;r<e.length;r++)if(this.eq(e[r]))return!0;return!1}eq(e){return this==e||this.type==e.type&&OH(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let r in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[r.type];if(!n)throw new RangeError(`There is no mark type ${r.type} in this schema`);let i=n.create(r.attrs);return n.checkAttrs(i.attrs),i}static sameSet(e,r){if(e==r)return!0;if(e.length!=r.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(r[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return sfe.none;if(e instanceof sfe)return[e];let r=e.slice();return r.sort((n,i)=>n.type.rank-i.type.rank),r}};ha.none=[];class MH extends Error{}class Lr{constructor(e,r,n){this.content=e,this.openStart=r,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,r){let n=EZe(this.content,e+this.openStart,r);return n&&new Lr(n,this.openStart,this.openEnd)}removeBetween(e,r){return new Lr(xZe(this.content,e+this.openStart,r+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,r){if(!r)return Lr.empty;let n=r.openStart||0,i=r.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Lr(Gt.fromJSON(e,r.content),n,i)}static maxOpen(e,r=!0){let n=0,i=0;for(let a=e.firstChild;a&&!a.isLeaf&&(r||!a.type.spec.isolating);a=a.firstChild)n++;for(let a=e.lastChild;a&&!a.isLeaf&&(r||!a.type.spec.isolating);a=a.lastChild)i++;return new Lr(e,n,i)}}Lr.empty=new Lr(Gt.empty,0,0);function xZe(t,e,r){let{index:n,offset:i}=t.findIndex(e),a=t.maybeChild(n),{index:o,offset:s}=t.findIndex(r);if(i==e||a.isText){if(s!=r&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(r))}if(n!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(n,a.copy(xZe(a.content,e-i-1,r-i-1)))}function EZe(t,e,r,n){let{index:i,offset:a}=t.findIndex(e),o=t.maybeChild(i);if(a==e||o.isText)return t.cut(0,e).append(r).append(t.cut(e));let s=EZe(o.content,e-a-1,r);return s&&t.replaceChild(i,o.copy(s))}function h9r(t,e,r){if(r.openStart>t.depth)throw new MH("Inserted content deeper than insertion position");if(t.depth-r.openStart!=e.depth-r.openEnd)throw new MH("Inconsistent open depths");return SZe(t,e,r,0)}function SZe(t,e,r,n){let i=t.index(n),a=t.node(n);if(i==e.index(n)&&n<t.depth-r.openStart){let o=SZe(t,e,r,n+1);return a.copy(a.content.replaceChild(i,o))}else if(r.content.size)if(!r.openStart&&!r.openEnd&&t.depth==n&&e.depth==n){let o=t.parent,s=o.content;return Q8(o,s.cut(0,t.parentOffset).append(r.content).append(s.cut(e.parentOffset)))}else{let{start:o,end:s}=f9r(r,t);return Q8(a,LZe(t,o,s,e,n))}else return Q8(a,RH(t,e,n))}function CZe(t,e){if(!e.type.compatibleContent(t.type))throw new MH("Cannot join "+e.type.name+" onto "+t.type.name)}function Gle(t,e,r){let n=t.node(r);return CZe(n,e.node(r)),n}function b8(t,e){let r=e.length-1;r>=0&&t.isText&&t.sameMarkup(e[r])?e[r]=t.withText(e[r].text+t.text):e.push(t)}function Ow(t,e,r,n){let i=(e||t).node(r),a=0,o=e?e.index(r):i.childCount;t&&(a=t.index(r),t.depth>r?a++:t.textOffset&&(b8(t.nodeAfter,n),a++));for(let s=a;s<o;s++)b8(i.child(s),n);e&&e.depth==r&&e.textOffset&&b8(e.nodeBefore,n)}function Q8(t,e){return t.type.checkContent(e),t.copy(e)}function LZe(t,e,r,n,i){let a=t.depth>i&&Gle(t,e,i+1),o=n.depth>i&&Gle(r,n,i+1),s=[];return Ow(null,t,i,s),a&&o&&e.index(i)==r.index(i)?(CZe(a,o),b8(Q8(a,LZe(t,e,r,n,i+1)),s)):(a&&b8(Q8(a,RH(t,e,i+1)),s),Ow(e,r,i,s),o&&b8(Q8(o,RH(r,n,i+1)),s)),Ow(n,null,i,s),new Gt(s)}function RH(t,e,r){let n=[];if(Ow(null,t,r,n),t.depth>r){let i=Gle(t,e,r+1);b8(Q8(i,RH(t,e,r+1)),n)}return Ow(e,null,r,n),new Gt(n)}function f9r(t,e){let r=e.depth-t.openStart,i=e.node(r).copy(t.content);for(let a=r-1;a>=0;a--)i=e.node(a).copy(Gt.from(i));return{start:i.resolveNoCache(t.openStart+r),end:i.resolveNoCache(i.content.size-t.openEnd-r)}}class Mw{constructor(e,r,n){this.pos=e,this.path=r,this.parentOffset=n,this.depth=r.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,r=this.index(this.depth);if(r==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(r);return n?e.child(r).cut(n):i}get nodeBefore(){let e=this.index(this.depth),r=this.pos-this.path[this.path.length-1];return r?this.parent.child(e).cut(0,r):e==0?null:this.parent.child(e-1)}posAtIndex(e,r){r=this.resolveDepth(r);let n=this.path[r*3],i=r==0?0:this.path[r*3-1]+1;for(let a=0;a<e;a++)i+=n.child(a).nodeSize;return i}marks(){let e=this.parent,r=this.index();if(e.content.size==0)return ha.none;if(this.textOffset)return e.child(r).marks;let n=e.maybeChild(r-1),i=e.maybeChild(r);if(!n){let s=n;n=i,i=s}let a=n.marks;for(var o=0;o<a.length;o++)a[o].type.spec.inclusive===!1&&(!i||!a[o].isInSet(i.marks))&&(a=a[o--].removeFromSet(a));return a}marksAcross(e){let r=this.parent.maybeChild(this.index());if(!r||!r.isInline)return null;let n=r.marks,i=e.parent.maybeChild(e.index());for(var a=0;a<n.length;a++)n[a].type.spec.inclusive===!1&&(!i||!n[a].isInSet(i.marks))&&(n=n[a--].removeFromSet(n));return n}sharedDepth(e){for(let r=this.depth;r>0;r--)if(this.start(r)<=e&&this.end(r)>=e)return r;return 0}blockRange(e=this,r){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!r||r(this.node(n))))return new DH(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let r=1;r<=this.depth;r++)e+=(e?"/":"")+this.node(r).type.name+"_"+this.index(r-1);return e+":"+this.parentOffset}static resolve(e,r){if(!(r>=0&&r<=e.content.size))throw new RangeError("Position "+r+" out of range");let n=[],i=0,a=r;for(let o=e;;){let{index:s,offset:l}=o.content.findIndex(a),u=a-l;if(n.push(o,s,i+l),!u||(o=o.child(s),o.isText))break;a=u-1,i+=l+1}return new Mw(r,n,a)}static resolveCached(e,r){let n=wZe.get(e);if(n)for(let a=0;a<n.elts.length;a++){let o=n.elts[a];if(o.pos==r)return o}else wZe.set(e,n=new p9r);let i=n.elts[n.i]=Mw.resolve(e,r);return n.i=(n.i+1)%g9r,i}}class p9r{constructor(){this.elts=[],this.i=0}}const g9r=12,wZe=new WeakMap;class DH{constructor(e,r,n){this.$from=e,this.$to=r,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const m9r=Object.create(null);class Od{constructor(e,r,n,i=ha.none){this.type=e,this.attrs=r,this.marks=i,this.content=n||Gt.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,r,n,i=0){this.content.nodesBetween(e,r,n,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,r,n,i){return this.content.textBetween(e,r,n,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,r,n){return this.type==e&&OH(this.attrs,r||e.defaultAttrs||m9r)&&ha.sameSet(this.marks,n||ha.none)}copy(e=null){return e==this.content?this:new Od(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Od(this.type,this.attrs,this.content,e)}cut(e,r=this.content.size){return e==0&&r==this.content.size?this:this.copy(this.content.cut(e,r))}slice(e,r=this.content.size,n=!1){if(e==r)return Lr.empty;let i=this.resolve(e),a=this.resolve(r),o=n?0:i.sharedDepth(r),s=i.start(o),u=i.node(o).content.cut(i.pos-s,a.pos-s);return new Lr(u,i.depth-o,a.depth-o)}replace(e,r,n){return h9r(this.resolve(e),this.resolve(r),n)}nodeAt(e){for(let r=this;;){let{index:n,offset:i}=r.content.findIndex(e);if(r=r.maybeChild(n),!r)return null;if(i==e||r.isText)return r;e-=i+1}}childAfter(e){let{index:r,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(r),index:r,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:r,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(r),index:r,offset:n};let i=this.content.child(r-1);return{node:i,index:r-1,offset:n-i.nodeSize}}resolve(e){return Mw.resolveCached(this,e)}resolveNoCache(e){return Mw.resolve(this,e)}rangeHasMark(e,r,n){let i=!1;return r>e&&this.nodesBetween(e,r,a=>(n.isInSet(a.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),AZe(this.marks,e)}contentMatchAt(e){let r=this.type.contentMatch.matchFragment(this.content,0,e);if(!r)throw new Error("Called contentMatchAt on a node with invalid content");return r}canReplace(e,r,n=Gt.empty,i=0,a=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,i,a),s=o&&o.matchFragment(this.content,r);if(!s||!s.validEnd)return!1;for(let l=i;l<a;l++)if(!this.type.allowsMarks(n.child(l).marks))return!1;return!0}canReplaceWith(e,r,n,i){if(i&&!this.type.allowsMarks(i))return!1;let a=this.contentMatchAt(e).matchType(n),o=a&&a.matchFragment(this.content,r);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=ha.none;for(let r=0;r<this.marks.length;r++){let n=this.marks[r];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!ha.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(r=>r.type.name)}`);this.content.forEach(r=>r.check())}toJSON(){let e={type:this.type.name};for(let r in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(r=>r.toJSON())),e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Node.fromJSON");let n;if(r.marks){if(!Array.isArray(r.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=r.marks.map(e.markFromJSON)}if(r.type=="text"){if(typeof r.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(r.text,n)}let i=Gt.fromJSON(e,r.content),a=e.nodeType(r.type).create(r.attrs,i,n);return a.type.checkAttrs(a.attrs),a}}Od.prototype.text=void 0;class NH extends Od{constructor(e,r,n,i){if(super(e,r,null,i),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):AZe(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,r){return this.text.slice(e,r)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new NH(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new NH(this.type,this.attrs,e,this.marks)}cut(e=0,r=this.text.length){return e==0&&r==this.text.length?this:this.withText(this.text.slice(e,r))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function AZe(t,e){for(let r=t.length-1;r>=0;r--)e=t[r].type.name+"("+e+")";return e}class x8{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,r){let n=new T9r(e,r);if(n.next==null)return x8.empty;let i=OZe(n);n.next&&n.err("Unexpected trailing text");let a=E9r(x9r(i));return S9r(a,n),a}matchType(e){for(let r=0;r<this.next.length;r++)if(this.next[r].type==e)return this.next[r].next;return null}matchFragment(e,r=0,n=e.childCount){let i=this;for(let a=r;i&&a<n;a++)i=i.matchType(e.child(a).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:r}=this.next[e];if(!(r.isText||r.hasRequiredAttrs()))return r}return null}compatible(e){for(let r=0;r<this.next.length;r++)for(let n=0;n<e.next.length;n++)if(this.next[r].type==e.next[n].type)return!0;return!1}fillBefore(e,r=!1,n=0){let i=[this];function a(o,s){let l=o.matchFragment(e,n);if(l&&(!r||l.validEnd))return Gt.from(s.map(u=>u.createAndFill()));for(let u=0;u<o.next.length;u++){let{type:d,next:h}=o.next[u];if(!(d.isText||d.hasRequiredAttrs())&&i.indexOf(h)==-1){i.push(h);let f=a(h,s.concat(d));if(f)return f}}return null}return a(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let r=this.computeWrapping(e);return this.wrapCache.push(e,r),r}computeWrapping(e){let r=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let i=n.shift(),a=i.match;if(a.matchType(e)){let o=[];for(let s=i;s.type;s=s.via)o.push(s.type);return o.reverse()}for(let o=0;o<a.next.length;o++){let{type:s,next:l}=a.next[o];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in r)&&(!i.type||l.validEnd)&&(n.push({match:s.contentMatch,type:s,via:i}),r[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function r(n){e.push(n);for(let i=0;i<n.next.length;i++)e.indexOf(n.next[i].next)==-1&&r(n.next[i].next)}return r(this),e.map((n,i)=>{let a=i+(n.validEnd?"*":" ")+" ";for(let o=0;o<n.next.length;o++)a+=(o?", ":"")+n.next[o].type.name+"->"+e.indexOf(n.next[o].next);return a}).join(`
|
|
965
965
|
`)}}x8.empty=new x8(!0);class T9r{constructor(e,r){this.string=e,this.nodeTypes=r,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function OZe(t){let e=[];do e.push(v9r(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function v9r(t){let e=[];do e.push(y9r(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function y9r(t){let e=Q9r(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=_9r(t,e);else break;return e}function MZe(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function _9r(t,e){let r=MZe(t),n=r;return t.eat(",")&&(t.next!="}"?n=MZe(t):n=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:r,max:n,expr:e}}function b9r(t,e){let r=t.nodeTypes,n=r[e];if(n)return[n];let i=[];for(let a in r){let o=r[a];o.isInGroup(e)&&i.push(o)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function Q9r(t){if(t.eat("(")){let e=OZe(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=b9r(t,t.next).map(r=>(t.inline==null?t.inline=r.isInline:t.inline!=r.isInline&&t.err("Mixing inline and block content"),{type:"name",value:r}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function x9r(t){let e=[[]];return i(a(t,0),r()),e;function r(){return e.push([])-1}function n(o,s,l){let u={term:l,to:s};return e[o].push(u),u}function i(o,s){o.forEach(l=>l.to=s)}function a(o,s){if(o.type=="choice")return o.exprs.reduce((l,u)=>l.concat(a(u,s)),[]);if(o.type=="seq")for(let l=0;;l++){let u=a(o.exprs[l],s);if(l==o.exprs.length-1)return u;i(u,s=r())}else if(o.type=="star"){let l=r();return n(s,l),i(a(o.expr,l),l),[n(l)]}else if(o.type=="plus"){let l=r();return i(a(o.expr,s),l),i(a(o.expr,l),l),[n(l)]}else{if(o.type=="opt")return[n(s)].concat(a(o.expr,s));if(o.type=="range"){let l=s;for(let u=0;u<o.min;u++){let d=r();i(a(o.expr,l),d),l=d}if(o.max==-1)i(a(o.expr,l),l);else for(let u=o.min;u<o.max;u++){let d=r();n(l,d),i(a(o.expr,l),d),l=d}return[n(l)]}else{if(o.type=="name")return[n(s,void 0,o.value)];throw new Error("Unknown expr type")}}}}function RZe(t,e){return e-t}function DZe(t,e){let r=[];return n(e),r.sort(RZe);function n(i){let a=t[i];if(a.length==1&&!a[0].term)return n(a[0].to);r.push(i);for(let o=0;o<a.length;o++){let{term:s,to:l}=a[o];!s&&r.indexOf(l)==-1&&n(l)}}}function E9r(t){let e=Object.create(null);return r(DZe(t,0));function r(n){let i=[];n.forEach(o=>{t[o].forEach(({term:s,to:l})=>{if(!s)return;let u;for(let d=0;d<i.length;d++)i[d][0]==s&&(u=i[d][1]);DZe(t,l).forEach(d=>{u||i.push([s,u=[]]),u.indexOf(d)==-1&&u.push(d)})})});let a=e[n.join(",")]=new x8(n.indexOf(t.length-1)>-1);for(let o=0;o<i.length;o++){let s=i[o][1].sort(RZe);a.next.push({type:i[o][0],next:e[s.join(",")]||r(s)})}return a}}function S9r(t,e){for(let r=0,n=[t];r<n.length;r++){let i=n[r],a=!i.validEnd,o=[];for(let s=0;s<i.next.length;s++){let{type:l,next:u}=i.next[s];o.push(l.name),a&&!(l.isText||l.hasRequiredAttrs())&&(a=!1),n.indexOf(u)==-1&&n.push(u)}a&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function NZe(t){let e=Object.create(null);for(let r in t){let n=t[r];if(!n.hasDefault)return null;e[r]=n.default}return e}function IZe(t,e){let r=Object.create(null);for(let n in t){let i=e&&e[n];if(i===void 0){let a=t[n];if(a.hasDefault)i=a.default;else throw new RangeError("No value supplied for attribute "+n)}r[n]=i}return r}function kZe(t,e,r,n){for(let i in e)if(!(i in t))throw new RangeError(`Unsupported attribute ${i} for ${r} of type ${i}`);for(let i in t){let a=t[i];a.validate&&a.validate(e[i])}}function PZe(t,e){let r=Object.create(null);if(e)for(let n in e)r[n]=new L9r(t,n,e[n]);return r}let BZe=class jht{constructor(e,r,n){this.name=e,this.schema=r,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=PZe(e,n.attrs),this.defaultAttrs=NZe(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==x8.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:IZe(this.attrs,e)}create(e=null,r,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Od(this,this.computeAttrs(e),Gt.from(r),ha.setFrom(n))}createChecked(e=null,r,n){return r=Gt.from(r),this.checkContent(r),new Od(this,this.computeAttrs(e),r,ha.setFrom(n))}createAndFill(e=null,r,n){if(e=this.computeAttrs(e),r=Gt.from(r),r.size){let o=this.contentMatch.fillBefore(r);if(!o)return null;r=o.append(r)}let i=this.contentMatch.matchFragment(r),a=i&&i.fillBefore(Gt.empty,!0);return a?new Od(this,e,r.append(a),ha.setFrom(n)):null}validContent(e){let r=this.contentMatch.matchFragment(e);if(!r||!r.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){kZe(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let r=0;r<e.length;r++)if(!this.allowsMarkType(e[r].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let r;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?r&&r.push(e[n]):r||(r=e.slice(0,n));return r?r.length?r:ha.none:e}static compile(e,r){let n=Object.create(null);e.forEach((a,o)=>n[a]=new jht(a,r,o));let i=r.spec.topNode||"doc";if(!n[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let a in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};function C9r(t,e,r){let n=r.split("|");return i=>{let a=i===null?"null":typeof i;if(n.indexOf(a)<0)throw new RangeError(`Expected value of type ${n} for attribute ${e} on type ${t}, got ${a}`)}}class L9r{constructor(e,r,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?C9r(e,r,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class IH{constructor(e,r,n,i){this.name=e,this.rank=r,this.schema=n,this.spec=i,this.attrs=PZe(e,i.attrs),this.excluded=null;let a=NZe(this.attrs);this.instance=a?new ha(this,a):null}create(e=null){return!e&&this.instance?this.instance:new ha(this,IZe(this.attrs,e))}static compile(e,r){let n=Object.create(null),i=0;return e.forEach((a,o)=>n[a]=new IH(a,i++,r,o)),n}removeFromSet(e){for(var r=0;r<e.length;r++)e[r].type==this&&(e=e.slice(0,r).concat(e.slice(r+1)),r--);return e}isInSet(e){for(let r=0;r<e.length;r++)if(e[r].type==this)return e[r]}checkAttrs(e){kZe(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class HZe{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let r=this.spec={};for(let i in e)r[i]=e[i];r.nodes=Ql.from(e.nodes),r.marks=Ql.from(e.marks||{}),this.nodes=BZe.compile(this.spec.nodes,this),this.marks=IH.compile(this.spec.marks,this);let n=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let a=this.nodes[i],o=a.spec.content||"",s=a.spec.marks;if(a.contentMatch=n[o]||(n[o]=x8.parse(o,this.nodes)),a.inlineContent=a.contentMatch.inlineContent,a.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!a.isInline||!a.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=a}a.markSet=s=="_"?null:s?FZe(this,s.split(" ")):s==""||!a.inlineContent?[]:null}for(let i in this.marks){let a=this.marks[i],o=a.spec.excludes;a.excluded=o==null?[a]:o==""?[]:FZe(this,o.split(" "))}this.nodeFromJSON=i=>Od.fromJSON(this,i),this.markFromJSON=i=>ha.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,r=null,n,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof BZe){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(r,n,i)}text(e,r){let n=this.nodes.text;return new NH(n,n.defaultAttrs,e,ha.setFrom(r))}mark(e,r){return typeof e=="string"&&(e=this.marks[e]),e.create(r)}nodeType(e){let r=this.nodes[e];if(!r)throw new RangeError("Unknown node type: "+e);return r}}function FZe(t,e){let r=[];for(let n=0;n<e.length;n++){let i=e[n],a=t.marks[i],o=a;if(a)r.push(a);else for(let s in t.marks){let l=t.marks[s];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&r.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return r}function w9r(t){return t.tag!=null}function A9r(t){return t.style!=null}let Rw=class lfe{constructor(e,r){this.schema=e,this.rules=r,this.tags=[],this.styles=[];let n=this.matchedStyles=[];r.forEach(i=>{if(w9r(i))this.tags.push(i);else if(A9r(i)){let a=/[^=]*/.exec(i.style)[0];n.indexOf(a)<0&&n.push(a),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let a=e.nodes[i.node];return a.contentMatch.matchType(a)})}parse(e,r={}){let n=new zZe(this,r,!1);return n.addAll(e,ha.none,r.from,r.to),n.finish()}parseSlice(e,r={}){let n=new zZe(this,r,!0);return n.addAll(e,ha.none,r.from,r.to),Lr.maxOpen(n.finish())}matchTag(e,r,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){let a=this.tags[i];if(R9r(e,a.tag)&&(a.namespace===void 0||e.namespaceURI==a.namespace)&&(!a.context||r.matchesContext(a.context))){if(a.getAttrs){let o=a.getAttrs(e);if(o===!1)continue;a.attrs=o||void 0}return a}}}matchStyle(e,r,n,i){for(let a=i?this.styles.indexOf(i)+1:0;a<this.styles.length;a++){let o=this.styles[a],s=o.style;if(!(s.indexOf(e)!=0||o.context&&!n.matchesContext(o.context)||s.length>e.length&&(s.charCodeAt(e.length)!=61||s.slice(e.length+1)!=r))){if(o.getAttrs){let l=o.getAttrs(r);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let r=[];function n(i){let a=i.priority==null?50:i.priority,o=0;for(;o<r.length;o++){let s=r[o];if((s.priority==null?50:s.priority)<a)break}r.splice(o,0,i)}for(let i in e.marks){let a=e.marks[i].spec.parseDOM;a&&a.forEach(o=>{n(o=GZe(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let a=e.nodes[i].spec.parseDOM;a&&a.forEach(o=>{n(o=GZe(o)),o.node||o.ignore||o.mark||(o.node=i)})}return r}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new lfe(e,lfe.schemaRules(e)))}};const VZe={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},O9r={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},$Ze={ol:!0,ul:!0},Dw=1,qle=2,Nw=4;function UZe(t,e,r){return e!=null?(e?Dw:0)|(e==="full"?qle:0):t&&t.whitespace=="pre"?Dw|qle:r&~Nw}class kH{constructor(e,r,n,i,a,o){this.type=e,this.attrs=r,this.marks=n,this.solid=i,this.options=o,this.content=[],this.activeMarks=ha.none,this.match=a||(o&Nw?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let r=this.type.contentMatch.fillBefore(Gt.from(e));if(r)this.match=this.type.contentMatch.matchFragment(r);else{let n=this.type.contentMatch,i;return(i=n.findWrapping(e.type))?(this.match=n,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Dw)){let n=this.content[this.content.length-1],i;if(n&&n.isText&&(i=/[ \t\r\n\u000c]+$/.exec(n.text))){let a=n;n.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=a.withText(a.text.slice(0,a.text.length-i[0].length))}}let r=Gt.from(this.content);return!e&&this.match&&(r=r.append(this.match.fillBefore(Gt.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!VZe.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class zZe{constructor(e,r,n){this.parser=e,this.options=r,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let i=r.topNode,a,o=UZe(null,r.preserveWhitespace,0)|(n?Nw:0);i?a=new kH(i.type,i.attrs,ha.none,!0,r.topMatch||i.type.contentMatch,o):n?a=new kH(null,null,ha.none,!0,null,o):a=new kH(e.schema.topNodeType,null,ha.none,!0,null,o),this.nodes=[a],this.find=r.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,r){e.nodeType==3?this.addTextNode(e,r):e.nodeType==1&&this.addElement(e,r)}addTextNode(e,r){let n=e.nodeValue,i=this.top,a=i.options&qle?"full":this.localPreserveWS||(i.options&Dw)>0;if(a==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(a)a!=="full"?n=n.replace(/\r?\n|\r/g," "):n=n.replace(/\r\n?/g,`
|
|
966
966
|
`);else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let o=i.content[i.content.length-1],s=e.previousSibling;(!o||s&&s.nodeName=="BR"||o.isText&&/[ \t\r\n\u000c]$/.test(o.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n),r,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,r,n){let i=this.localPreserveWS,a=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),s;$Ze.hasOwnProperty(o)&&this.parser.normalizeLists&&M9r(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(s=this.parser.matchTag(e,this,n));e:if(l?l.ignore:O9r.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,r);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let u,d=this.needsBlock;if(VZe.hasOwnProperty(o))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),u=!0,a.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,r);break e}let h=l&&l.skip?r:this.readStyles(e,r);h&&this.addAll(e,h),u&&this.sync(a),this.needsBlock=d}else{let u=this.readStyles(e,r);u&&this.addElementByRule(e,l,u,l.consuming===!1?s:void 0)}this.localPreserveWS=i}leafFallback(e,r){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
967
967
|
`),r)}ignoreFallback(e,r){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),r,!0)}readStyles(e,r){let n=e.style;if(n&&n.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let a=this.parser.matchedStyles[i],o=n.getPropertyValue(a);if(o)for(let s=void 0;;){let l=this.parser.matchStyle(a,o,this,s);if(!l)break;if(l.ignore)return null;if(l.clearMark?r=r.filter(u=>!l.clearMark(u)):r=r.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)s=l;else break}}return r}addElementByRule(e,r,n,i){let a,o;if(r.node)if(o=this.parser.schema.nodes[r.node],o.isLeaf)this.insertNode(o.create(r.attrs),n,e.nodeName=="BR")||this.leafFallback(e,n);else{let l=this.enter(o,r.attrs||null,n,r.preserveWhitespace);l&&(a=!0,n=l)}else{let l=this.parser.schema.marks[r.mark];n=n.concat(l.create(r.attrs))}let s=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,n,i);else if(r.getContent)this.findInside(e),r.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,n,!1));else{let l=e;typeof r.contentElement=="string"?l=e.querySelector(r.contentElement):typeof r.contentElement=="function"?l=r.contentElement(e):r.contentElement&&(l=r.contentElement),this.findAround(e,l,!0),this.addAll(l,n),this.findAround(e,l,!1)}a&&this.sync(s)&&this.open--}addAll(e,r,n,i){let a=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=i==null?null:e.childNodes[i];o!=s;o=o.nextSibling,++a)this.findAtPoint(e,a),this.addDOM(o,r);this.findAtPoint(e,a)}findPlace(e,r,n){let i,a;for(let o=this.open,s=0;o>=0;o--){let l=this.nodes[o],u=l.findWrapping(e);if(u&&(!i||i.length>u.length+s)&&(i=u,a=l,!u.length))break;if(l.solid){if(n)break;s+=2}}if(!i)return null;this.sync(a);for(let o=0;o<i.length;o++)r=this.enterInner(i[o],null,r,!1);return r}insertNode(e,r,n){if(e.isInline&&this.needsBlock&&!this.top.type){let a=this.textblockFromContext();a&&(r=this.enterInner(a,null,r))}let i=this.findPlace(e,r,n);if(i){this.closeExtra();let a=this.top;a.match&&(a.match=a.match.matchType(e.type));let o=ha.none;for(let s of i.concat(e.marks))(a.type?a.type.allowsMarkType(s.type):qZe(s.type,e.type))&&(o=s.addToSet(o));return a.content.push(e.mark(o)),!0}return!1}enter(e,r,n,i){let a=this.findPlace(e.create(r),n,!1);return a&&(a=this.enterInner(e,r,n,!0,i)),a}enterInner(e,r,n,i=!1,a){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let s=UZe(e,a,o.options);o.options&Nw&&o.content.length==0&&(s|=Nw);let l=ha.none;return n=n.filter(u=>(o.type?o.type.allowsMarkType(u.type):qZe(u.type,e))?(l=u.addToSet(l),!1):!0),this.nodes.push(new kH(e,r,l,i,null,s)),this.open++,n}closeExtra(e=!1){let r=this.nodes.length-1;if(r>this.open){for(;r>this.open;r--)this.nodes[r-1].content.push(this.nodes[r].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let r=this.open;r>=0;r--){if(this.nodes[r]==e)return this.open=r,!0;this.localPreserveWS&&(this.nodes[r].options|=Dw)}return!1}get currentPos(){this.closeExtra();let e=0;for(let r=this.open;r>=0;r--){let n=this.nodes[r].content;for(let i=n.length-1;i>=0;i--)e+=n[i].nodeSize;r&&e++}return e}findAtPoint(e,r){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==r&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&(this.find[r].pos=this.currentPos)}findAround(e,r,n){if(e!=r&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&r.compareDocumentPosition(this.find[i].node)&(n?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&(this.find[r].pos=this.currentPos-(e.nodeValue.length-this.find[r].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let r=e.split("/"),n=this.options.context,i=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),a=-(n?n.depth+1:0)+(i?0:1),o=(s,l)=>{for(;s>=0;s--){let u=r[s];if(u==""){if(s==r.length-1||s==0)continue;for(;l>=a;l--)if(o(s-1,l))return!0;return!1}else{let d=l>0||l==0&&i?this.nodes[l].type:n&&l>=a?n.node(l-a).type:null;if(!d||d.name!=u&&!d.isInGroup(u))return!1;l--}}return!0};return o(r.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let r=e.depth;r>=0;r--){let n=e.node(r).contentMatchAt(e.indexAfter(r)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let r in this.parser.schema.nodes){let n=this.parser.schema.nodes[r];if(n.isTextblock&&n.defaultAttrs)return n}}}function M9r(t){for(let e=t.firstChild,r=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&$Ze.hasOwnProperty(n)&&r?(r.appendChild(e),e=r):n=="li"?r=e:n&&(r=null)}}function R9r(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function GZe(t){let e={};for(let r in t)e[r]=t[r];return e}function qZe(t,e){let r=e.schema.nodes;for(let n in r){let i=r[n];if(!i.allowsMarkType(t))continue;let a=[],o=s=>{a.push(s);for(let l=0;l<s.edgeCount;l++){let{type:u,next:d}=s.edge(l);if(u==e||a.indexOf(d)<0&&o(d))return!0}};if(o(i.contentMatch))return!0}}class E8{constructor(e,r){this.nodes=e,this.marks=r}serializeFragment(e,r={},n){n||(n=Wle(r).createDocumentFragment());let i=n,a=[];return e.forEach(o=>{if(a.length||o.marks.length){let s=0,l=0;for(;s<a.length&&l<o.marks.length;){let u=o.marks[l];if(!this.marks[u.type.name]){l++;continue}if(!u.eq(a[s][0])||u.type.spec.spanning===!1)break;s++,l++}for(;s<a.length;)i=a.pop()[1];for(;l<o.marks.length;){let u=o.marks[l++],d=this.serializeMark(u,o.isInline,r);d&&(a.push([u,i]),i.appendChild(d.dom),i=d.contentDOM||d.dom)}}i.appendChild(this.serializeNodeInner(o,r))}),n}serializeNodeInner(e,r){let{dom:n,contentDOM:i}=PH(Wle(r),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,r,i)}return n}serializeNode(e,r={}){let n=this.serializeNodeInner(e,r);for(let i=e.marks.length-1;i>=0;i--){let a=this.serializeMark(e.marks[i],e.isInline,r);a&&((a.contentDOM||a.dom).appendChild(n),n=a.dom)}return n}serializeMark(e,r,n={}){let i=this.marks[e.type.name];return i&&PH(Wle(n),i(e,r),null,e.attrs)}static renderSpec(e,r,n=null,i){return PH(e,r,n,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new E8(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let r=WZe(e.nodes);return r.text||(r.text=n=>n.text),r}static marksFromSchema(e){return WZe(e.marks)}}function WZe(t){let e={};for(let r in t){let n=t[r].spec.toDOM;n&&(e[r]=n)}return e}function Wle(t){return t.document||window.document}const YZe=new WeakMap;function D9r(t){let e=YZe.get(t);return e===void 0&&YZe.set(t,e=N9r(t)),e}function N9r(t){let e=null;function r(n){if(n&&typeof n=="object")if(Array.isArray(n))if(typeof n[0]=="string")e||(e=[]),e.push(n);else for(let i=0;i<n.length;i++)r(n[i]);else for(let i in n)r(n[i])}return r(t),e}function PH(t,e,r,n){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],a;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(n&&(a=D9r(n))&&a.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let s,l=r?t.createElementNS(r,i):t.createElement(i),u=e[1],d=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){d=2;for(let h in u)if(u[h]!=null){let f=h.indexOf(" ");f>0?l.setAttributeNS(h.slice(0,f),h.slice(f+1),u[h]):h=="style"&&l.style?l.style.cssText=u[h]:l.setAttribute(h,u[h])}}for(let h=d;h<e.length;h++){let f=e[h];if(f===0){if(h<e.length-1||h>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:p,contentDOM:g}=PH(t,f,r,n);if(l.appendChild(p),g){if(s)throw new RangeError("Multiple content holes");s=g}}}return{dom:l,contentDOM:s}}const jZe=65535,XZe=Math.pow(2,16);function I9r(t,e){return t+e*XZe}function KZe(t){return t&jZe}function k9r(t){return(t-(t&jZe))/XZe}const ZZe=1,JZe=2,BH=4,eJe=8;class Yle{constructor(e,r,n){this.pos=e,this.delInfo=r,this.recover=n}get deleted(){return(this.delInfo&eJe)>0}get deletedBefore(){return(this.delInfo&(ZZe|BH))>0}get deletedAfter(){return(this.delInfo&(JZe|BH))>0}get deletedAcross(){return(this.delInfo&BH)>0}}class q1{constructor(e,r=!1){if(this.ranges=e,this.inverted=r,!e.length&&q1.empty)return q1.empty}recover(e){let r=0,n=KZe(e);if(!this.inverted)for(let i=0;i<n;i++)r+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[n*3]+r+k9r(e)}mapResult(e,r=1){return this._map(e,r,!1)}map(e,r=1){return this._map(e,r,!0)}_map(e,r,n){let i=0,a=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?i:0);if(l>e)break;let u=this.ranges[s+a],d=this.ranges[s+o],h=l+u;if(e<=h){let f=u?e==l?-1:e==h?1:r:r,p=l+i+(f<0?0:d);if(n)return p;let g=e==(r<0?l:h)?null:I9r(s/3,e-l),m=e==l?JZe:e==h?ZZe:BH;return(r<0?e!=l:e!=h)&&(m|=eJe),new Yle(p,m,g)}i+=d-u}return n?e+i:new Yle(e+i,0,null)}touches(e,r){let n=0,i=KZe(r),a=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?n:0);if(l>e)break;let u=this.ranges[s+a],d=l+u;if(e<=d&&s==i*3)return!0;n+=this.ranges[s+o]-u}return!1}forEach(e){let r=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,a=0;i<this.ranges.length;i+=3){let o=this.ranges[i],s=o-(this.inverted?a:0),l=o+(this.inverted?0:a),u=this.ranges[i+r],d=this.ranges[i+n];e(s,s+u,l,l+d),a+=d-u}}invert(){return new q1(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?q1.empty:new q1(e<0?[0,-e,0]:[0,0,e])}}q1.empty=new q1([]);class Iw{constructor(e,r,n=0,i=e?e.length:0){this.mirror=r,this.from=n,this.to=i,this._maps=e||[],this.ownData=!(e||r)}get maps(){return this._maps}slice(e=0,r=this.maps.length){return new Iw(this._maps,this.mirror,e,r)}appendMap(e,r){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),r!=null&&this.setMirror(this._maps.length-1,r)}appendMapping(e){for(let r=0,n=this._maps.length;r<e._maps.length;r++){let i=e.getMirror(r);this.appendMap(e._maps[r],i!=null&&i<r?n+i:void 0)}}getMirror(e){if(this.mirror){for(let r=0;r<this.mirror.length;r++)if(this.mirror[r]==e)return this.mirror[r+(r%2?-1:1)]}}setMirror(e,r){this.mirror||(this.mirror=[]),this.mirror.push(e,r)}appendMappingInverted(e){for(let r=e.maps.length-1,n=this._maps.length+e._maps.length;r>=0;r--){let i=e.getMirror(r);this.appendMap(e._maps[r].invert(),i!=null&&i>r?n-i-1:void 0)}}invert(){let e=new Iw;return e.appendMappingInverted(this),e}map(e,r=1){if(this.mirror)return this._map(e,r,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,r);return e}mapResult(e,r=1){return this._map(e,r,!1)}_map(e,r,n){let i=0;for(let a=this.from;a<this.to;a++){let o=this._maps[a],s=o.mapResult(e,r);if(s.recover!=null){let l=this.getMirror(a);if(l!=null&&l>a&&l<this.to){a=l,e=this._maps[l].recover(s.recover);continue}}i|=s.delInfo,e=s.pos}return n?e:new Yle(e,i,null)}}const jle=Object.create(null);class nu{getMap(){return q1.empty}merge(e){return null}static fromJSON(e,r){if(!r||!r.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=jle[r.stepType];if(!n)throw new RangeError(`No step type ${r.stepType} defined`);return n.fromJSON(e,r)}static jsonID(e,r){if(e in jle)throw new RangeError("Duplicate use of step JSON ID "+e);return jle[e]=r,r.prototype.jsonID=e,r}}class Ko{constructor(e,r){this.doc=e,this.failed=r}static ok(e){return new Ko(e,null)}static fail(e){return new Ko(null,e)}static fromReplace(e,r,n,i){try{return Ko.ok(e.replace(r,n,i))}catch(a){if(a instanceof MH)return Ko.fail(a.message);throw a}}}function Xle(t,e,r){let n=[];for(let i=0;i<t.childCount;i++){let a=t.child(i);a.content.size&&(a=a.copy(Xle(a.content,e,a))),a.isInline&&(a=e(a,r,i)),n.push(a)}return Gt.fromArray(n)}class J5 extends nu{constructor(e,r,n){super(),this.from=e,this.to=r,this.mark=n}apply(e){let r=e.slice(this.from,this.to),n=e.resolve(this.from),i=n.node(n.sharedDepth(this.to)),a=new Lr(Xle(r.content,(o,s)=>!o.isAtom||!s.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),r.openStart,r.openEnd);return Ko.fromReplace(e,this.from,this.to,a)}invert(){return new Md(this.from,this.to,this.mark)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new J5(r.pos,n.pos,this.mark)}merge(e){return e instanceof J5&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new J5(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new J5(r.from,r.to,e.markFromJSON(r.mark))}}nu.jsonID("addMark",J5);class Md extends nu{constructor(e,r,n){super(),this.from=e,this.to=r,this.mark=n}apply(e){let r=e.slice(this.from,this.to),n=new Lr(Xle(r.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),r.openStart,r.openEnd);return Ko.fromReplace(e,this.from,this.to,n)}invert(){return new J5(this.from,this.to,this.mark)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new Md(r.pos,n.pos,this.mark)}merge(e){return e instanceof Md&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Md(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Md(r.from,r.to,e.markFromJSON(r.mark))}}nu.jsonID("removeMark",Md);class ep extends nu{constructor(e,r){super(),this.pos=e,this.mark=r}apply(e){let r=e.nodeAt(this.pos);if(!r)return Ko.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.addToSet(r.marks));return Ko.fromReplace(e,this.pos,this.pos+1,new Lr(Gt.from(n),0,r.isLeaf?0:1))}invert(e){let r=e.nodeAt(this.pos);if(r){let n=this.mark.addToSet(r.marks);if(n.length==r.marks.length){for(let i=0;i<r.marks.length;i++)if(!r.marks[i].isInSet(n))return new ep(this.pos,r.marks[i]);return new ep(this.pos,this.mark)}}return new S8(this.pos,this.mark)}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new ep(r.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new ep(r.pos,e.markFromJSON(r.mark))}}nu.jsonID("addNodeMark",ep);class S8 extends nu{constructor(e,r){super(),this.pos=e,this.mark=r}apply(e){let r=e.nodeAt(this.pos);if(!r)return Ko.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.removeFromSet(r.marks));return Ko.fromReplace(e,this.pos,this.pos+1,new Lr(Gt.from(n),0,r.isLeaf?0:1))}invert(e){let r=e.nodeAt(this.pos);return!r||!this.mark.isInSet(r.marks)?this:new ep(this.pos,this.mark)}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new S8(r.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new S8(r.pos,e.markFromJSON(r.mark))}}nu.jsonID("removeNodeMark",S8);class Zs extends nu{constructor(e,r,n,i=!1){super(),this.from=e,this.to=r,this.slice=n,this.structure=i}apply(e){return this.structure&&Kle(e,this.from,this.to)?Ko.fail("Structure replace would overwrite content"):Ko.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new q1([this.from,this.to-this.from,this.slice.size])}invert(e){return new Zs(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deletedAcross&&n.deletedAcross?null:new Zs(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Zs)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let r=this.slice.size+e.slice.size==0?Lr.empty:new Lr(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Zs(this.from,this.to+(e.to-e.from),r,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let r=this.slice.size+e.slice.size==0?Lr.empty:new Lr(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Zs(e.from,this.to,r,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Zs(r.from,r.to,Lr.fromJSON(e,r.slice),!!r.structure)}}nu.jsonID("replace",Zs);class Js extends nu{constructor(e,r,n,i,a,o,s=!1){super(),this.from=e,this.to=r,this.gapFrom=n,this.gapTo=i,this.slice=a,this.insert=o,this.structure=s}apply(e){if(this.structure&&(Kle(e,this.from,this.gapFrom)||Kle(e,this.gapTo,this.to)))return Ko.fail("Structure gap-replace would overwrite content");let r=e.slice(this.gapFrom,this.gapTo);if(r.openStart||r.openEnd)return Ko.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,r.content);return n?Ko.fromReplace(e,this.from,this.to,n):Ko.fail("Content does not fit in gap")}getMap(){return new q1([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let r=this.gapTo-this.gapFrom;return new Js(this.from,this.from+this.slice.size+r,this.from+this.insert,this.from+this.insert+r,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),i=this.from==this.gapFrom?r.pos:e.map(this.gapFrom,-1),a=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return r.deletedAcross&&n.deletedAcross||i<r.pos||a>n.pos?null:new Js(r.pos,n.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number"||typeof r.gapFrom!="number"||typeof r.gapTo!="number"||typeof r.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Js(r.from,r.to,r.gapFrom,r.gapTo,Lr.fromJSON(e,r.slice),r.insert,!!r.structure)}}nu.jsonID("replaceAround",Js);function Kle(t,e,r){let n=t.resolve(e),i=r-e,a=n.depth;for(;i>0&&a>0&&n.indexAfter(a)==n.node(a).childCount;)a--,i--;if(i>0){let o=n.node(a).maybeChild(n.indexAfter(a));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function P9r(t,e,r,n){let i=[],a=[],o,s;t.doc.nodesBetween(e,r,(l,u,d)=>{if(!l.isInline)return;let h=l.marks;if(!n.isInSet(h)&&d.type.allowsMarkType(n.type)){let f=Math.max(u,e),p=Math.min(u+l.nodeSize,r),g=n.addToSet(h);for(let m=0;m<h.length;m++)h[m].isInSet(g)||(o&&o.to==f&&o.mark.eq(h[m])?o.to=p:i.push(o=new Md(f,p,h[m])));s&&s.to==f?s.to=p:a.push(s=new J5(f,p,n))}}),i.forEach(l=>t.step(l)),a.forEach(l=>t.step(l))}function B9r(t,e,r,n){let i=[],a=0;t.doc.nodesBetween(e,r,(o,s)=>{if(!o.isInline)return;a++;let l=null;if(n instanceof IH){let u=o.marks,d;for(;d=n.isInSet(u);)(l||(l=[])).push(d),u=d.removeFromSet(u)}else n?n.isInSet(o.marks)&&(l=[n]):l=o.marks;if(l&&l.length){let u=Math.min(s+o.nodeSize,r);for(let d=0;d<l.length;d++){let h=l[d],f;for(let p=0;p<i.length;p++){let g=i[p];g.step==a-1&&h.eq(i[p].style)&&(f=g)}f?(f.to=u,f.step=a):i.push({style:h,from:Math.max(s,e),to:u,step:a})}}}),i.forEach(o=>t.step(new Md(o.from,o.to,o.style)))}function Zle(t,e,r,n=r.contentMatch,i=!0){let a=t.doc.nodeAt(e),o=[],s=e+1;for(let l=0;l<a.childCount;l++){let u=a.child(l),d=s+u.nodeSize,h=n.matchType(u.type);if(!h)o.push(new Zs(s,d,Lr.empty));else{n=h;for(let f=0;f<u.marks.length;f++)r.allowsMarkType(u.marks[f].type)||t.step(new Md(s,d,u.marks[f]));if(i&&u.isText&&r.whitespace!="pre"){let f,p=/\r?\n|\r/g,g;for(;f=p.exec(u.text);)g||(g=new Lr(Gt.from(r.schema.text(" ",r.allowedMarks(u.marks))),0,0)),o.push(new Zs(s+f.index,s+f.index+f[0].length,g))}}s=d}if(!n.validEnd){let l=n.fillBefore(Gt.empty,!0);t.replace(s,s,new Lr(l,0,0))}for(let l=o.length-1;l>=0;l--)t.step(o[l])}function H9r(t,e,r){return(e==0||t.canReplace(e,t.childCount))&&(r==t.childCount||t.canReplace(0,r))}function Jy(t){let r=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth;;--n){let i=t.$from.node(n),a=t.$from.index(n),o=t.$to.indexAfter(n);if(n<t.depth&&i.canReplace(a,o,r))return n;if(n==0||i.type.spec.isolating||!H9r(i,a,o))break}return null}function F9r(t,e,r){let{$from:n,$to:i,depth:a}=e,o=n.before(a+1),s=i.after(a+1),l=o,u=s,d=Gt.empty,h=0;for(let g=a,m=!1;g>r;g--)m||n.index(g)>0?(m=!0,d=Gt.from(n.node(g).copy(d)),h++):l--;let f=Gt.empty,p=0;for(let g=a,m=!1;g>r;g--)m||i.after(g+1)<i.end(g)?(m=!0,f=Gt.from(i.node(g).copy(f)),p++):u++;t.step(new Js(l,u,o,s,new Lr(d.append(f),h,p),d.size-h,!0))}function tJe(t,e,r=null,n=t){let i=V9r(t,e),a=i&&$9r(n,e);return a?i.map(rJe).concat({type:e,attrs:r}).concat(a.map(rJe)):null}function rJe(t){return{type:t,attrs:null}}function V9r(t,e){let{parent:r,startIndex:n,endIndex:i}=t,a=r.contentMatchAt(n).findWrapping(e);if(!a)return null;let o=a.length?a[0]:e;return r.canReplaceWith(n,i,o)?a:null}function $9r(t,e){let{parent:r,startIndex:n,endIndex:i}=t,a=r.child(n),o=e.contentMatch.findWrapping(a.type);if(!o)return null;let l=(o.length?o[o.length-1]:e).contentMatch;for(let u=n;l&&u<i;u++)l=l.matchType(r.child(u).type);return!l||!l.validEnd?null:o}function U9r(t,e,r){let n=Gt.empty;for(let o=r.length-1;o>=0;o--){if(n.size){let s=r[o].type.contentMatch.matchFragment(n);if(!s||!s.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=Gt.from(r[o].type.create(r[o].attrs,n))}let i=e.start,a=e.end;t.step(new Js(i,a,i,a,new Lr(n,0,0),r.length,!0))}function z9r(t,e,r,n,i){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let a=t.steps.length;t.doc.nodesBetween(e,r,(o,s)=>{let l=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(n,l)&&G9r(t.doc,t.mapping.slice(a).map(s),n)){let u=null;if(n.schema.linebreakReplacement){let p=n.whitespace=="pre",g=!!n.contentMatch.matchType(n.schema.linebreakReplacement);p&&!g?u=!1:!p&&g&&(u=!0)}u===!1&&iJe(t,o,s,a),Zle(t,t.mapping.slice(a).map(s,1),n,void 0,u===null);let d=t.mapping.slice(a),h=d.map(s,1),f=d.map(s+o.nodeSize,1);return t.step(new Js(h,f,h+1,f-1,new Lr(Gt.from(n.create(l,null,o.marks)),0,0),1,!0)),u===!0&&nJe(t,o,s,a),!1}})}function nJe(t,e,r,n){e.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let l=t.mapping.slice(n).map(r+1+a+o.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function iJe(t,e,r,n){e.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let o=t.mapping.slice(n).map(r+1+a);t.replaceWith(o,o+1,e.type.schema.text(`
|
|
@@ -1055,7 +1055,7 @@ img.ProseMirror-separator {
|
|
|
1055
1055
|
* @license MIT
|
|
1056
1056
|
*
|
|
1057
1057
|
*/var $xr=mF.exports,Ftt;function Uxr(){return Ftt||(Ftt=1,function(t,e){(function(r,n){t.exports=n()})($xr,function(){return function(r){var n={};function i(a){if(n[a])return n[a].exports;var o=n[a]={i:a,l:!1,exports:{}};return r[a].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=r,i.c=n,i.d=function(a,o,s){i.o(a,o)||Object.defineProperty(a,o,{enumerable:!0,get:s})},i.r=function(a){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},i.t=function(a,o){if(1&o&&(a=i(a)),8&o||4&o&&typeof a=="object"&&a&&a.__esModule)return a;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:a}),2&o&&typeof a!="string")for(var l in a)i.d(s,l,(function(u){return a[u]}).bind(null,l));return s},i.n=function(a){var o=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(o,"a",o),o},i.o=function(a,o){return Object.prototype.hasOwnProperty.call(a,o)},i.p="",i(i.s=1)}([function(r,n,i){function a(o,s,l){for(var u=0;u<l.length;u++)o.setUint8(s+u,l.charCodeAt(u))}Object.defineProperty(n,"__esModule",{value:!0}),n.compress=function(o,s,l){for(var u=s/l,d=Math.max(u,1),h=o.left,f=o.right,p=Math.floor((h.length+f.length)/u),g=new Float32Array(p),m=0,T=0;m<p;){var v=Math.floor(T);g[m]=h[v],m++,f.length&&(g[m]=f[v],m++),T+=d}return g},n.encodePCM=function(o,s,l){l===void 0&&(l=!0);var u=0,d=o.length*(s/8),h=new ArrayBuffer(d),f=new DataView(h);if(s===8)for(var p=0;p<o.length;p++,u++){var g=(m=Math.max(-1,Math.min(1,o[p])))<0?128*m:127*m;g=+g+128,f.setInt8(u,g)}else for(p=0;p<o.length;p++,u+=2){var m=Math.max(-1,Math.min(1,o[p]));f.setInt16(u,m<0?32768*m:32767*m,l)}return f},n.encodeWAV=function(o,s,l,u,d,h){h===void 0&&(h=!0);var f=l>s?s:l,p=d,g=new ArrayBuffer(44+o.byteLength),m=new DataView(g),T=u,v=0;a(m,v,"RIFF"),v+=4,m.setUint32(v,36+o.byteLength,h),a(m,v+=4,"WAVE"),a(m,v+=4,"fmt "),v+=4,m.setUint32(v,16,h),v+=4,m.setUint16(v,1,h),v+=2,m.setUint16(v,T,h),v+=2,m.setUint32(v,f,h),v+=4,m.setUint32(v,T*f*(p/8),h),v+=4,m.setUint16(v,T*(p/8),h),v+=2,m.setUint16(v,p,h),a(m,v+=2,"data"),v+=4,m.setUint32(v,o.byteLength,h),v+=4;for(var y=0;y<o.byteLength;)m.setUint8(v,o.getUint8(y)),v++,y++;return m}},function(r,n,i){var a,o=this&&this.__extends||(a=function(h,f){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,g){p.__proto__=g}||function(p,g){for(var m in g)g.hasOwnProperty(m)&&(p[m]=g[m])})(h,f)},function(h,f){function p(){this.constructor=h}a(h,f),h.prototype=f===null?Object.create(f):(p.prototype=f.prototype,new p)});Object.defineProperty(n,"__esModule",{value:!0});var s=i(2),l=i(0),u=i(3),d=function(h){function f(p){p===void 0&&(p={});var g=h.call(this,p)||this;return g.isrecording=!1,g.ispause=!1,g.isplaying=!1,g}return o(f,h),f.prototype.setOption=function(p){p===void 0&&(p={}),this.setNewOption(p)},f.prototype.start=function(){return this.isrecording?Promise.reject():(this.isrecording=!0,this.startRecord())},f.prototype.pause=function(){this.isrecording&&!this.ispause&&(this.ispause=!0,this.pauseRecord())},f.prototype.resume=function(){this.isrecording&&this.ispause&&(this.ispause=!1,this.resumeRecord())},f.prototype.stop=function(){this.isrecording&&(this.isrecording=!1,this.ispause=!1,this.stopRecord())},f.prototype.play=function(){this.stop(),this.isplaying=!0,this.onplay&&this.onplay(),u.default.addPlayEnd(this.onplayend);var p=this.getWAV();p.byteLength>44&&u.default.play(p.buffer)},f.prototype.getPlayTime=function(){return u.default.getPlayTime()},f.prototype.pausePlay=function(){!this.isrecording&&this.isplaying&&(this.isplaying=!1,this.onpauseplay&&this.onpauseplay(),u.default.pausePlay())},f.prototype.resumePlay=function(){this.isrecording||this.isplaying||(this.isplaying=!0,this.onresumeplay&&this.onresumeplay(),u.default.resumePlay())},f.prototype.stopPlay=function(){this.isrecording||(this.isplaying=!1,this.onstopplay&&this.onstopplay(),u.default.stopPlay())},f.prototype.destroy=function(){return u.default.destroyPlay(),this.destroyRecord()},f.prototype.getRecordAnalyseData=function(){return this.getAnalyseData()},f.prototype.getPlayAnalyseData=function(){return u.default.getAnalyseData()},f.prototype.getPCM=function(){this.stop();var p=this.getData();return p=l.compress(p,this.inputSampleRate,this.outputSampleRate),l.encodePCM(p,this.oututSampleBits,this.littleEdian)},f.prototype.getPCMBlob=function(){return new Blob([this.getPCM()])},f.prototype.downloadPCM=function(p){p===void 0&&(p="recorder");var g=this.getPCMBlob();s.downloadPCM(g,p)},f.prototype.getWAV=function(){var p=this.getPCM();return l.encodeWAV(p,this.inputSampleRate,this.outputSampleRate,this.config.numChannels,this.oututSampleBits,this.littleEdian)},f.prototype.getWAVBlob=function(){return new Blob([this.getWAV()],{type:"audio/wav"})},f.prototype.downloadWAV=function(p){p===void 0&&(p="recorder");var g=this.getWAVBlob();s.downloadWAV(g,p)},f.prototype.download=function(p,g,m){s.download(p,g,m)},f.prototype.getChannelData=function(){var p=this.getPCM(),g=p.byteLength,m=this.littleEdian,T={left:null,right:null};if(this.config.numChannels===2){var v=new DataView(new ArrayBuffer(g/2)),y=new DataView(new ArrayBuffer(g/2));if(this.config.sampleBits===16)for(var _=0;_<g/2;_+=2)v.setInt16(_,p.getInt16(2*_,m),m),y.setInt16(_,p.getInt16(2*_+2,m),m);else for(_=0;_<g/2;_+=2)v.setInt8(_,p.getInt8(2*_)),y.setInt8(_,p.getInt8(2*_+1));T.left=v,T.right=y}else T.left=p;return T},f}(i(5).default);n.default=d},function(r,n,i){function a(o,s,l){var u=document.createElement("a");u.href=window.URL.createObjectURL(o),u.download=s+"."+l,u.click()}Object.defineProperty(n,"__esModule",{value:!0}),n.downloadWAV=function(o,s){s===void 0&&(s="recorder"),a(o,s,"wav")},n.downloadPCM=function(o,s){s===void 0&&(s="recorder"),a(o,s,"pcm")},n.download=function(o,s,l){return a(o,s,l)}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(4),o=null,s=0,l=0,u=null,d=null,h=null,f=!1,p=0,g=function(){};function m(){return f=!1,u.decodeAudioData(h.slice(0),function(y){(o=u.createBufferSource()).onended=function(){f||(p=u.currentTime-l+s,g())},o.buffer=y,o.connect(d),d.connect(u.destination),o.start(0,s),l=u.currentTime},function(y){a.throwError(y)})}function T(){o&&(o.stop(),o=null)}var v=function(){function y(){}return y.play=function(_){return u||(u=new(window.AudioContext||window.webkitAudioContext),(d=u.createAnalyser()).fftSize=2048),this.stopPlay(),h=_,p=0,m()},y.pausePlay=function(){T(),s+=u.currentTime-l,f=!0},y.resumePlay=function(){return m()},y.stopPlay=function(){s=0,h=null,T()},y.destroyPlay=function(){this.stopPlay()},y.getAnalyseData=function(){var _=new Uint8Array(d.frequencyBinCount);return d.getByteTimeDomainData(_),_},y.addPlayEnd=function(_){_===void 0&&(_=function(){}),g=_},y.getPlayTime=function(){var _=f?s:u.currentTime-l+s;return p||_},y}();n.default=v},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.throwError=function(a){throw new Error(a)}},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i(0),o=function(){function s(l){l===void 0&&(l={}),this.size=0,this.lBuffer=[],this.rBuffer=[],this.tempPCM=[],this.inputSampleBits=16,this.fileSize=0,this.duration=0,this.needRecord=!0;var u,d=new(window.AudioContext||window.webkitAudioContext);this.inputSampleRate=d.sampleRate,this.setNewOption(l),this.littleEdian=(u=new ArrayBuffer(2),new DataView(u).setInt16(0,256,!0),new Int16Array(u)[0]===256),s.initUserMedia()}return s.prototype.setNewOption=function(l){l===void 0&&(l={}),this.config={sampleBits:~[8,16].indexOf(l.sampleBits)?l.sampleBits:16,sampleRate:~[8e3,11025,16e3,22050,24e3,44100,48e3].indexOf(l.sampleRate)?l.sampleRate:this.inputSampleRate,numChannels:~[1,2].indexOf(l.numChannels)?l.numChannels:1},this.outputSampleRate=this.config.sampleRate,this.oututSampleBits=this.config.sampleBits},s.prototype.startRecord=function(){var l=this;return this.context&&this.destroyRecord(),this.initRecorder(),navigator.mediaDevices.getUserMedia({audio:!0}).then(function(u){l.audioInput=l.context.createMediaStreamSource(u),l.stream=u}).then(function(){l.audioInput.connect(l.analyser),l.analyser.connect(l.recorder),l.recorder.connect(l.context.destination)})},s.prototype.pauseRecord=function(){this.needRecord=!1},s.prototype.resumeRecord=function(){this.needRecord=!0},s.prototype.stopRecord=function(){this.audioInput&&this.audioInput.disconnect(),this.source&&this.source.stop(),this.recorder.disconnect(),this.analyser.disconnect(),this.needRecord=!0},s.prototype.destroyRecord=function(){return this.clearRecordStatus(),this.stopStream(),this.closeAudioContext()},s.prototype.getAnalyseData=function(){var l=new Uint8Array(this.analyser.frequencyBinCount);return this.analyser.getByteTimeDomainData(l),l},s.prototype.getData=function(){return this.flat()},s.prototype.clearRecordStatus=function(){this.lBuffer.length=0,this.rBuffer.length=0,this.size=0,this.fileSize=0,this.PCM=null,this.audioInput=null,this.duration=0},s.prototype.flat=function(){var l=null,u=new Float32Array(0);this.config.numChannels===1?l=new Float32Array(this.size):(l=new Float32Array(this.size/2),u=new Float32Array(this.size/2));for(var d=0,h=0;h<this.lBuffer.length;h++)l.set(this.lBuffer[h],d),d+=this.lBuffer[h].length;for(d=0,h=0;h<this.rBuffer.length;h++)u.set(this.rBuffer[h],d),d+=this.rBuffer[h].length;return{left:l,right:u}},s.prototype.initRecorder=function(){var l=this;this.clearRecordStatus(),this.context=new(window.AudioContext||window.webkitAudioContext),this.analyser=this.context.createAnalyser(),this.analyser.fftSize=2048;var u=this.context.createScriptProcessor||this.context.createJavaScriptNode;this.recorder=u.apply(this.context,[4096,this.config.numChannels,this.config.numChannels]),this.recorder.onaudioprocess=function(d){if(l.needRecord){var h,f=d.inputBuffer.getChannelData(0),p=null;l.lBuffer.push(new Float32Array(f)),l.size+=f.length,l.config.numChannels===2&&(p=d.inputBuffer.getChannelData(1),l.rBuffer.push(new Float32Array(p)),l.size+=p.length),l.fileSize=Math.floor(l.size/Math.max(l.inputSampleRate/l.outputSampleRate,1))*(l.oututSampleBits/8),h=100*Math.max.apply(Math,f),l.duration+=4096/l.inputSampleRate,l.onprocess&&l.onprocess(l.duration),l.onprogress&&l.onprogress({duration:l.duration,fileSize:l.fileSize,vol:h})}}},s.prototype.stopStream=function(){this.stream&&this.stream.getTracks&&(this.stream.getTracks().forEach(function(l){return l.stop()}),this.stream=null)},s.prototype.closeAudioContext=function(){return this.context&&this.context.close&&this.context.state!=="closed"?this.context.close():new Promise(function(l){l()})},s.initUserMedia=function(){navigator.mediaDevices===void 0&&(navigator.mediaDevices={}),navigator.mediaDevices.getUserMedia===void 0&&(navigator.mediaDevices.getUserMedia=function(l){var u=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia;return u?new Promise(function(d,h){u.call(navigator,l,d,h)}):Promise.reject(new Error("\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 getUserMedia !"))})},s.prototype.transformIntoPCM=function(l,u){var d=new Float32Array(l),h=new Float32Array(u),f=a.compress({left:d,right:h},this.inputSampleRate,this.outputSampleRate);return a.encodePCM(f,this.oututSampleBits,this.littleEdian)},s.getPermission=function(){return this.initUserMedia(),navigator.mediaDevices.getUserMedia({audio:!0}).then(function(l){l&&l.getTracks().forEach(function(u){return u.stop()})})},s}();n.default=o}]).default})}(mF)),mF.exports}var Xue,Vtt;function zxr(){return Vtt||(Vtt=1,Xue=Uxr()),Xue}var Gxr=zxr();const qxr=$h(Gxr);function Wxr(t,e,r){let n=e/r,i=Math.max(n,1),a=t.left,o=t.right,s=Math.floor((a.length+o.length)/n),l=new Float32Array(s),u=0,d=0;for(;u<s;){let h=Math.floor(d);l[u]=a[h],u++,o.length&&(l[u]=o[h],u++),d+=i}return l}function Yxr(t,e,r=!0){let n=0,i=t.length*(e/8),a=new ArrayBuffer(i),o=new DataView(a);if(e===8)for(let s=0;s<t.length;s++,n++){let l=Math.max(-1,Math.min(1,t[s])),u=l<0?l*128:l*127;u=+u+128,o.setInt8(n,u)}else for(let s=0;s<t.length;s++,n+=2){let l=Math.max(-1,Math.min(1,t[s]));o.setInt16(n,l<0?l*32768:l*32767,r)}return o}class $tt extends qxr{constructor(e={}){super(e)}getPCM(){let e=this.getData();return e=Wxr(e,this.inputSampleRate,this.outputSampleRate),Yxr(e,this.oututSampleBits,this.littleEdian)}getPCMBlob(){return new Blob([this.getPCM()],{type:"audio/pcm"})}}const jxr=oa({__name:"VoiceWave",props:{size:{type:Number,default:16},total:{type:Number,default:41}},setup(t){return(e,r)=>(I.openBlock(),I.createElementBlock("div",{class:"voice-wave",style:I.normalizeStyle({"font-size":`${t.size}px`})},[(I.openBlock(!0),I.createElementBlock(I.Fragment,null,I.renderList(t.total,n=>(I.openBlock(),I.createElementBlock("span",{key:n}))),128))],4))}},[["__scopeId","data-v-58535a55"]]),Xxr={__name:"AudioButton",props:I.mergeDefaults({audioConfig:Object,audioLoading:Boolean},{audioConfig:()=>({}),audioLoading:!1}),emits:["onAudioLoaded"],setup(t,{emit:e}){const r={maxTime:6e4,timeSlice:0,needPCM:!1,sampleBits:16,sampleRate:16e3,numChannels:1},n=e,i=I.ref(!1);let a=null;const o=new AbortController,s=o.signal,l=I.computed(()=>({...r,...t.audioConfig})),u=async()=>{var T;if(!((T=navigator==null?void 0:navigator.mediaDevices)!=null&&T.getUserMedia)){ma.warning("\u62B1\u6B49\uFF0C\u60A8\u7684\u8BBE\u5907\u4E0D\u652F\u6301\u5F55\u97F3\u529F\u80FD");return}try{await $tt.getPermission()}catch(v){ma.warning("\u62B1\u6B49\uFF0C\u8BF7\u6C42\u9EA6\u514B\u98CE\u6743\u9650\u5931\u8D25\uFF0C\u65E0\u6CD5\u4F7F\u7528\u5F55\u97F3\u529F\u80FD"),console.error("\u9EA6\u514B\u98CE\u6743\u9650\u8BF7\u6C42\u5931\u8D25:",v);return}const{sampleBits:p,sampleRate:g,numChannels:m}=l.value;a=new $tt({sampleBits:p,sampleRate:g,numChannels:m}),a.onprogress=wxt(v=>{if(Math.floor(v.duration)*1e3>=l.value.maxTime)return d(),!1;l.value.timeSlice!==0&&h(!1)},l.value.timeSlice,{signal:s}),a.start(),i.value=!0},d=()=>{a&&(a.stop(),h(!0),f())},h=p=>{a&&(l.value.needPCM?n("onAudioLoaded",{blob:a.getPCMBlob(),stop:p}):n("onAudioLoaded",{blob:a.getWAVBlob(),stop:p}))},f=()=>{a&&(a.destroy(),a=null),o.abort(),i.value=!1};return(p,g)=>{const m=Jc,T=k6;return I.openBlock(),I.createBlock(T,null,{title:I.withCtx(()=>[I.createTextVNode(I.toDisplayString(i.value?"\u70B9\u51FB\u505C\u6B62":"\u8BED\u97F3\u5F55\u5165"),1)]),default:I.withCtx(()=>[i.value?(I.openBlock(),I.createBlock(m,{key:1,type:"text",onClick:d},{default:I.withCtx(()=>[I.createVNode(jxr,{total:5,size:18})]),_:1})):(I.openBlock(),I.createBlock(m,{key:0,loading:t.audioLoading,type:"text",onClick:u},{icon:I.withCtx(()=>[I.createVNode(I.unref(Yq))]),_:1},8,["loading"]))]),_:1})}}},Kxr=({command:t,value:e})=>({type:"doc",content:e.split(`
|
|
1058
|
-
`).reduce((i,a)=>{if(a.trim(),a.length===0)return i;const s=(a.split(/(\{{.*?\}})/)||[]).reduce((l,u)=>{if(!u)return l;if(u.startsWith("{{")&&u.endsWith("}}")){const d=u.slice(2,-2);d&&l.push({type:"inputNode",attrs:{value:d},content:[{type:"text",text:"\uFEFF"},{type:"text",text:d}]})}else l.push({type:"text",text:u});return l},[]);return t&&s.unshift({type:"commandNode",attrs:{value:t},content:[{type:"text",text:t}]}),i.push({type:"paragraph",content:s}),i},[])}),Zxr={class:"sender"},Jxr={key:0,class:"sender-header"},eEr={class:"sender-content"},tEr={class:"sender-footer"},rEr={class:"sender-footer_left"},nEr={key:0},iEr={key:1,class:"sender-footer_left-count"},aEr={class:"sender-footer_right"},TF=1.7,Utt=oa(Object.assign({name:"AiSender"},{__name:"Sender",props:I.mergeDefaults({placeholder:String,maxLength:Number,loading:Boolean,rows:Number,autoSize:[Boolean,Object],showAudio:Boolean,audioLoading:Boolean,audioConfig:Object},{placeholder:"\u8BF7\u8F93\u5165\u60A8\u7684\u95EE\u9898\uFF0Center\u53D1\u9001\uFF0Cshift+enter\u6362\u884C",maxLength:0,loading:!1,rows:2,autoSize:!1,showAudio:!1,audioLoading:!1,audioConfig:()=>({})}),emits:["onSend","onStop","onClear","onAudioLoaded"],setup(t,{expose:e,emit:r}){I.useCssVars(T=>({"791fe32f":s.value.minHeight,"4b14ccc1":s.value.maxHeight}));const n=r,i=I.ref(""),a=I.ref(""),o=I.computed(()=>{var T;return((T=l.value)==null?void 0:T.storage.characterCount.characters())||0}),s=I.computed(()=>t.autoSize?typeof t.autoSize=="boolean"?{minHeight:"auto",maxHeight:"auto"}:{minHeight:`${t.autoSize.minRows*TF+1}em`,maxHeight:`${t.autoSize.maxRows*TF+1}em`}:{minHeight:`${t.rows*TF+1}em`,maxHeight:`${t.rows*TF+1}em`}),l=axr({extensions:[Oxr,Rxr,Nxr,Lxr.configure({placeholder:t.placeholder}),wxr,Cxr.configure({limit:t.maxLength?t.maxLength:null}),kxr,Bxr,Hxr.configure({onKeySend:()=>{d()}})],onUpdate:()=>{const T=l.value.getText();l.value.isEmpty&&(a.value=""),i.value=T.slice(a.value.length)}}),u=T=>{var y,_;a.value=T.command||"";const v=Kxr(T);(y=l.value)==null||y.commands.clearContent(),(_=l.value)==null||_.chain().focus().setContent(v).run()},d=()=>{t.loading?ma.warning("\u56DE\u7B54\u8F93\u51FA\u4E2D\uFF0C\u8BF7\u7A0D\u540E\u64CD\u4F5C\u6216\u70B9\u51FB\u505C\u6B62\u56DE\u7B54"):i.value.trim()&&(n("onSend",i.value.trim()),h())},h=()=>{var T;a.value="",(T=l.value)==null||T.commands.clearContent()},f=()=>{d()},p=()=>{n("onStop")},g=()=>{n("onClear"),h()},m=T=>{n("onAudioLoaded",T)};return e({insert:u,reset:h}),(T,v)=>{const y=Jc,_=k6;return I.openBlock(),I.createElementBlock("div",Zxr,[T.$slots.header?(I.openBlock(),I.createElementBlock("div",Jxr,[I.renderSlot(T.$slots,"header",{},void 0,!0)])):I.createCommentVNode("",!0),I.createElementVNode("div",eEr,[I.createVNode(I.unref(ixr),{editor:I.unref(l)},null,8,["editor"])]),I.createElementVNode("div",tEr,[I.createElementVNode("div",rEr,[T.$slots.extra?(I.openBlock(),I.createElementBlock("div",nEr,[I.renderSlot(T.$slots,"extra",{},void 0,!0)])):I.createCommentVNode("",!0),t.maxLength?(I.openBlock(),I.createElementBlock("span",iEr,I.toDisplayString(o.value)+"/"+I.toDisplayString(t.maxLength),1)):I.createCommentVNode("",!0)]),I.createElementVNode("div",aEr,[I.createVNode(_,null,{title:I.withCtx(()=>v[0]||(v[0]=[I.createTextVNode("\u6E05\u9664")])),default:I.withCtx(()=>[I.createVNode(y,{onClick:g,type:"text"},{icon:I.withCtx(()=>[I.createVNode(I.unref(jq))]),_:1})]),_:1}),t.showAudio?(I.openBlock(),I.createBlock(Xxr,{key:0,audioLoading:t.audioLoading,audioConfig:t.audioConfig,onOnAudioLoaded:m},null,8,["audioLoading","audioConfig"])):I.createCommentVNode("",!0),t.loading?(I.openBlock(),I.createBlock(y,{key:2,type:"primary",shape:"round",onClick:p},{icon:I.withCtx(()=>[I.createVNode(gF,{name:"ai-icon-tingzhi",class:"btn-icon"})]),default:I.withCtx(()=>[v[2]||(v[2]=I.createTextVNode(" \u505C\u6B62 "))]),_:1,__:[2]})):(I.openBlock(),I.createBlock(y,{key:1,type:"primary",shape:"round",disabled:!i.value.trim(),onClick:f},{icon:I.withCtx(()=>[I.createVNode(gF,{name:"ai-icon-fasong",class:"btn-icon"})]),default:I.withCtx(()=>[v[1]||(v[1]=I.createTextVNode(" \u53D1\u9001 "))]),_:1,__:[1]},8,["disabled"]))])])])}}}),[["__scopeId","data-v-94f2aaa4"]]),oEr=(t,e={bottom:50,top:50,left:0,right:0})=>{const r=()=>{n.bottom&&u({behavior:"instant"})},{arrivedState:n,measure:i}=wnr(t,{offset:e}),{stop:a}=Lnr(t,r,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),{stop:o}=pPe(t,r),s=I.computed(()=>A9(t));let l=null;const u=({behavior:d="smooth"}={})=>{s.value&&(l=setTimeout(()=>{try{s.value.scrollTo({top:s.value.scrollHeight,behavior:d})}catch{s.value.scrollTop=s.value.scrollHeight}},0))};return I.onMounted(()=>{I.nextTick(()=>{u({behavior:"instant"})})}),I.onUnmounted(()=>{a(),o(),clearTimeout(l)}),{scrollToBottom:u,arrivedState:n,measure:i}};window._iconfont_svg_string_4730060='<svg><symbol id="ai-icon-clear" viewBox="0 0 1024 1024"><path d="M975.36 455.85c0.512-53.247-42.496-96.767-95.744-97.28h-227.84V166.06c0.512-65.536-52.736-119.296-118.272-119.808H501.76c-65.536 0.512-118.784 54.272-118.272 119.808V358.57H151.04c-53.76 0.512-96.256 44.544-95.744 98.304 0.512 41.984 28.16 78.848 68.096 91.648v339.456c-0.512 43.008 34.304 77.824 77.312 78.336h635.392c43.008-0.512 77.312-35.328 77.312-78.336V546.475c37.376-14.336 61.952-50.688 61.952-90.624zM442.88 166.06c0-32.768 26.112-59.392 58.88-59.392h31.744c32.768 0.512 58.88 27.136 58.88 59.392V358.57H442.88V166.059z m393.216 739.84h-97.792V782.507c0.512-16.384-12.288-30.208-28.672-30.72-16.384-0.512-30.208 12.288-30.72 28.672v125.44h-130.56V782.507c0-16.384-13.312-29.696-29.696-29.696s-29.696 13.312-29.696 29.696v123.392H358.4V782.507c0-16.384-13.312-29.696-29.696-29.696s-29.696 13.312-29.696 29.696v123.392h-98.304c-9.728 0-17.92-8.192-17.92-17.92V553.13h671.232v334.848c0 9.728-8.192 17.92-17.92 17.92z m43.52-413.184H151.04c-20.48 0-36.864-16.896-36.864-37.376s16.384-36.864 36.864-36.864h728.576c20.48 0 36.864 16.896 36.864 37.376s-16.384 36.864-36.864 36.864z" ></path></symbol><symbol id="ai-icon-fasong" viewBox="0 0 1024 1024"><path d="M894.208 160.3584s85.2992-33.2288 78.1824 47.5136c-2.3552 33.28-23.7056 149.6064-40.2944 275.456l-56.832 372.7872s-4.7104 54.6304-47.36 64.1024c-42.5984 9.5232-106.5472-33.2288-118.3744-42.752-9.472-7.1168-177.664-113.9712-236.8512-166.1952-16.5888-14.2336-35.5328-42.752 2.4064-75.9808l248.6272-237.4656c28.416-28.4672 56.832-94.976-61.5424-14.2336l-331.5712 225.5872s-37.888 23.7568-108.9536 2.3552l-153.9072-47.4624s-56.832-35.6352 40.2432-71.2704c236.8512-111.616 528.128-225.5872 786.2272-332.4416z" ></path></symbol><symbol id="ai-icon-tingzhi" viewBox="0 0 1024 1024"><path d="M512 0a512 512 0 1 1 0 1024A512 512 0 0 1 512 0z m0 73.142857a438.857143 438.857143 0 1 0 0 877.714286A438.857143 438.857143 0 0 0 512 73.142857z" ></path><path d="M292.571429 292.571429m73.142857 0l292.571428 0q73.142857 0 73.142857 73.142857l0 292.571428q0 73.142857-73.142857 73.142857l-292.571428 0q-73.142857 0-73.142857-73.142857l0-292.571428q0-73.142857 73.142857-73.142857Z" ></path></symbol><symbol id="ai-icon-more" viewBox="0 0 1024 1024"><path d="M576 832a64 64 0 1 1-128 0 64 64 0 0 1 128 0zM512 256a64 64 0 1 0 0-128 64 64 0 0 0 0 128z m0 320a64 64 0 1 0 0-128 64 64 0 0 0 0 128z" fill="#515151" fill-opacity=".9" ></path></symbol><symbol id="ai-icon-top" viewBox="0 0 1024 1024"><path d="M842.42 131.29H180.55c-18.2 0-33.1-14.89-33.1-33.09 0-18.2 14.89-33.1 33.1-33.1h661.88c18.2 0 33.09 14.89 33.09 33.1-0.01 18.2-14.9 33.09-33.1 33.09zM511.49 958.64c-18.2 0-33.1-14.89-33.1-33.09V263.67c0-18.2 14.89-33.1 33.1-33.1 18.2 0 33.09 14.89 33.09 33.1v661.88c0 18.19-14.9 33.09-33.09 33.09z m330.93-364.03c-8.28 0-16.55-3.31-23.17-9.93L511.49 276.9 203.71 584.68c-13.24 13.23-33.09 13.23-46.33 0-13.24-13.24-13.24-33.1 0-46.34L488.32 207.4c13.24-13.23 33.1-13.23 46.33 0l330.94 330.94c13.24 13.24 13.24 33.1 0 46.34-6.62 6.61-14.9 9.93-23.17 9.93z" fill="#515151" ></path></symbol><symbol id="ai-icon-edit" viewBox="0 0 1024 1024"><path d="M82.26816 720.45909333a109.22666667 109.22666667 0 0 1 18.73237334-71.76192l365.90933333-533.13536a109.22666667 109.22666667 0 0 1 151.82506667-28.28970666l144.12458666 98.85013333a109.22666667 109.22666667 0 0 1 28.23509334 151.93429333l-365.90933334 533.13536a109.22666667 109.22666667 0 0 1-60.23850666 43.25376l-131.61813334 37.41013334a109.22666667 109.22666667 0 0 1-138.60864-95.13642667l-12.45184-136.26026667z m643.50890667-480.26965333l-144.12458667-98.85013333a43.69066667 43.69066667 0 0 0-60.73002666 11.30496L433.70496 279.67488l216.15957334 148.32981333 87.21749333-127.03061333a43.69066667 43.69066667 0 0 0-11.30496-60.78464z m-113.0496 241.88245333L396.67712 333.74208l-241.60938666 352.03754667a43.69066667 43.69066667 0 0 0-7.48202667 28.72661333l12.45184 136.26026667a43.69066667 43.69066667 0 0 0 55.43253333 38.01088l131.61813334-37.35552a43.69066667 43.69066667 0 0 0 24.13909333-17.31242667l241.60938667-352.03754667zM534.41194667 877.41781333a32.768 32.768 0 1 0 0 65.536h393.216a32.768 32.768 0 1 0 0-65.536h-393.216z" fill="#515151" ></path></symbol><symbol id="ai-icon-search" viewBox="0 0 1024 1024"><path d="M475.59111111 75.09333333a400.49777778 400.49777778 0 0 1 307.80074667 656.81635556l157.2864 157.2864c12.23338667 11.94211555 10.55857778 33.35054222-3.64088889 47.91409778-14.56355555 14.19946667-35.97198222 15.80145778-47.84128 3.56807111l-157.2864-157.2864A400.49777778 400.49777778 0 1 1 475.59111111 75.09333333z m0 72.0896c-207.89475555 0-327.82563555 167.48088889-327.82563556 328.40817778s119.56679111 329.13635555 327.68 329.13635556c208.04039111 0 327.68-168.20906667 327.68-329.13635556 0-160.92728889-119.63960889-328.40817778-327.53436444-328.40817778z" fill="#515151" ></path></symbol><symbol id="ai-icon-shuaxin" viewBox="0 0 1024 1024"><path d="M512 894.08c-210.72 0-382.08-171.36-382.08-382.08 0-8.16 0.48-16.32 0.96-24.48l67.2 4.32c-0.48 6.72-0.48 13.44-0.48 20.16 0 173.76 141.12 314.88 314.88 314.88 81.12 0 157.92-30.72 216.48-86.4l46.08 48.96C703.52 857.12 610.4 894.08 512 894.08zM894.08 512h-67.2c0-11.04-0.48-22.08-1.92-33.12-16.8-160.8-151.2-281.76-313.44-281.76-63.36 0-123.84 18.72-176.16 53.76L298.4 195.2c62.88-42.72 136.8-65.28 213.6-65.28 196.32 0 360 146.88 380.16 342.24 1.44 12.96 1.92 26.4 1.92 39.84z" fill="#515151" ></path><path d="M163.52 304.64L58.4 492.8c-2.88 4.8 0.96 11.04 6.24 11.04H274.4c5.76 0 9.12-5.76 6.24-11.04L176 304.64c-2.88-5.28-10.08-5.28-12.48 0zM848 665.6L742.88 477.44c-2.88-4.8 0.96-11.04 6.24-11.04h209.76c5.76 0 9.12 5.76 6.24 11.04L860.48 665.6c-2.4 4.8-9.6 4.8-12.48 0zM285.44 221.6a33.6 33.6 0 1 0 67.2 0 33.6 33.6 0 1 0-67.2 0zM715.04 767.84a33.6 33.6 0 1 0 67.2 0 33.6 33.6 0 1 0-67.2 0z" fill="#515151" ></path></symbol><symbol id="ai-icon-shoucang" viewBox="0 0 1024 1024"><path d="M323.20853333 943.60462187c-38.30897813 23.80231147-88.40533333 11.4915552-111.67288853-27.2611552a82.48888853 82.48888853 0 0 1-9.55733333-61.2579552l49.5843552-211.456a14.01742187 14.01742187 0 0 0-4.28942187-13.7216l-162.304-141.42577814c-33.7123552-29.35466667-37.6035552-80.6912-8.7836448-114.9155552a80.72533333 80.72533333 0 0 1 55.18222187-28.53546666L344.3712 327.68c4.64213333-0.3868448 8.79502187-3.44746667 10.69511147-8.10097813l82.0679104-200.71537707c17.1008-41.81333333 64.65991147-61.78133333 106.15466666-44.22542293a81.39662187 81.39662187 0 0 1 43.55413334 44.22542293l82.06791146 200.704c1.90008853 4.66488853 6.05297813 7.73688853 10.69511147 8.1123552l213.02613333 17.36248853c44.6691552 3.64088853 77.7443552 43.15591147 74.20586667 88.0184896a82.06791147 82.06791147 0 0 1-27.81866667 55.4439104l-162.304 141.42577814c-3.77742187 3.28817813-5.48408853 8.61297813-4.28942293 13.71022186l49.58435627 211.456c10.2627552 43.7475552-16.384 87.82506667-59.8812448 98.37226667a80.3043552 80.3043552 0 0 1-61.3603552-9.8531552l-182.3744-113.32266667a12.04906667 12.04906667 0 0 0-12.81137814 0l-182.38577813 113.32266667zM554.43911147 772.3008l182.3744 113.32266667c2.79893333 1.72942187 6.09848853 2.26417813 9.22737706 1.50186666 6.8380448-1.6611552 11.264-8.9884448 9.5232-16.45226666l-49.5843552-211.456a82.28408853 82.28408853 0 0 1 25.89582187-80.78222187L894.1795552 437.0204448c2.65102187-2.30968853 4.3235552-5.66613333 4.61937813-9.32977813 0.60302187-7.61173333-4.7900448-14.0515552-11.70773333-14.60906667l-213.02613333-17.37386667a81.05528853 81.05528853 0 0 1-68.33493334-50.31253333l-82.06791146-200.704a13.1299552 13.1299552 0 0 0-6.97457707-7.1907552c-6.29191147-2.6624-13.57368853 0.39822187-16.34986667 7.1907552l-82.0792896 200.704a81.05528853 81.05528853 0 0 1-68.33493333 50.31253333l-213.0147552 17.37386667a12.45866667 12.45866667 0 0 0-8.51057813 4.46008853 14.1084448 14.1084448 0 0 0 1.42222293 19.47875627l162.304 141.42577707a82.28408853 82.28408853 0 0 1 25.89582187 80.78222293l-49.5843552 211.44462187a14.22222187 14.22222187 0 0 0 1.61564373 10.53582186c3.72053333 6.17813333 11.2867552 8.03271147 17.13493333 4.4032l182.38577814-113.31128853a80.31573333 80.31573333 0 0 1 84.8668448 0z" fill="#515151" ></path></symbol><symbol id="ai-icon-delete" viewBox="0 0 1024 1024"><path d="M832 224v704H192v-704h640z m-64 64H256v576h512v-576z" fill="#515151" ></path><path d="M64 224h896v64H64zM320 96h384v64H320zM384 416h64v320H384zM576 416h64v320H576z" fill="#515151" ></path></symbol><symbol id="ai-icon-copy" viewBox="0 0 1024 1024"><path d="M667.25 250.25h-471.75c-57.75 0-105 47.25-105 105v471.75c0 57.75 47.25 105 105 105h471.75c57.75 0 105-47.25 105-105V355.25c-0.75-58.5-47.25-105-105-105z m52.5 576c0 29.25-23.25 52.5-52.5 52.5h-471.75c-29.25 0-52.5-23.25-52.5-52.5v-471.75c0-29.25 23.25-52.5 52.5-52.5h471.75c29.25 0 52.5 23.25 52.5 52.5v471.75z" fill="#515151" ></path><path d="M248 437h366.75v52.5h-366.75zM248 564.5h366.75v52.5h-366.75zM248 691.25h209.25v52.5h-209.25z" fill="#515151" ></path><path d="M824 92.75h-471.75c-57.75 0-105 47.25-105 105h52.5c0-29.25 23.25-52.5 52.5-52.5h471.75c29.25 0 52.5 23.25 52.5 52.5v471.75c0 29.25-23.25 52.5-52.5 52.5v52.5c57.75 0 105-47.25 105-105V197.75c0-58.5-47.25-105-105-105z" fill="#515151" ></path></symbol></svg>',(t=>{var e=(r=(r=document.getElementsByTagName("script"))[r.length-1]).getAttribute("data-injectcss"),r=r.getAttribute("data-disable-injectsvg");if(!r){var n,i,a,o,s,l=function(h,f){f.parentNode.insertBefore(h,f)};if(e&&!t.__iconfont__svg__cssinject__){t.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch(h){console&&console.log(h)}}n=function(){var h,f=document.createElement("div");f.innerHTML=t._iconfont_svg_string_4730060,(f=f.getElementsByTagName("svg")[0])&&(f.setAttribute("aria-hidden","true"),f.style.position="absolute",f.style.width=0,f.style.height=0,f.style.overflow="hidden",f=f,(h=document.body).firstChild?l(f,h.firstChild):h.appendChild(f))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(n,0):(i=function(){document.removeEventListener("DOMContentLoaded",i,!1),n()},document.addEventListener("DOMContentLoaded",i,!1)):document.attachEvent&&(a=n,o=t.document,s=!1,d(),o.onreadystatechange=function(){o.readyState=="complete"&&(o.onreadystatechange=null,u())})}function u(){s||(s=!0,a())}function d(){try{o.documentElement.doScroll("left")}catch{return void setTimeout(d,50)}u()}})(window);const sEr=[ufe,rme,nme,ime,fZe,yZe,CH,_Ze,Utt,Rte,gF],ztt=(t,e={})=>{sEr.forEach(r=>{t.component(r.name,r)})};typeof window<"u"&&window.Vue&&ztt(window.Vue);const lEr={install:ztt};var uEr="\0",k8="\0",Gtt="";class Oc{constructor(e={}){this._isDirected=Object.prototype.hasOwnProperty.call(e,"directed")?e.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(e,"multigraph")?e.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(e,"compound")?e.compound:!1,this._label=void 0,this._defaultNodeLabelFn=hv(void 0),this._defaultEdgeLabelFn=hv(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[k8]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return p2(e)||(e=hv(e)),this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return is(this._nodes)}sources(){var e=this;return io(this.nodes(),function(r){return xi(e._in[r])})}sinks(){var e=this;return io(this.nodes(),function(r){return xi(e._out[r])})}setNodes(e,r){var n=arguments,i=this;return lt(e,function(a){n.length>1?i.setNode(a,r):i.setNode(a)}),this}setNode(e,r){return Object.prototype.hasOwnProperty.call(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=r),this):(this._nodes[e]=arguments.length>1?r:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=k8,this._children[e]={},this._children[k8][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var r=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],lt(this.children(e),n=>{this.setParent(n)}),delete this._children[e]),lt(is(this._in[e]),r),delete this._in[e],delete this._preds[e],lt(is(this._out[e]),r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(Ni(r))r=k8;else{r+="";for(var n=r;!Ni(n);n=this.parent(n))if(n===e)throw new Error("Setting "+r+" as parent of "+e+" would create a cycle");this.setNode(r)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=r,this._children[r][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var r=this._parent[e];if(r!==k8)return r}}children(e){if(Ni(e)&&(e=k8),this._isCompound){var r=this._children[e];if(r)return is(r)}else{if(e===k8)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return is(r)}successors(e){var r=this._sucs[e];if(r)return is(r)}neighbors(e){var r=this.predecessors(e);if(r)return qvt(r,this.successors(e))}isLeaf(e){var r;return this.isDirected()?r=this.successors(e):r=this.neighbors(e),r.length===0}filterNodes(e){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var n=this;lt(this._nodes,function(o,s){e(s)&&r.setNode(s,o)}),lt(this._edgeObjs,function(o){r.hasNode(o.v)&&r.hasNode(o.w)&&r.setEdge(o,n.edge(o))});var i={};function a(o){var s=n.parent(o);return s===void 0||r.hasNode(s)?(i[o]=s,s):s in i?i[s]:a(s)}return this._isCompound&<(r.nodes(),function(o){r.setParent(o,a(o))}),r}setDefaultEdgeLabel(e){return p2(e)||(e=hv(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return Ji(this._edgeObjs)}setPath(e,r){var n=this,i=arguments;return Vo(e,function(a,o){return i.length>1?n.setEdge(a,o,r):n.setEdge(a,o),o}),this}setEdge(){var e,r,n,i,a=!1,o=arguments[0];typeof o=="object"&&o!==null&&"v"in o?(e=o.v,r=o.w,n=o.name,arguments.length===2&&(i=arguments[1],a=!0)):(e=o,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),e=""+e,r=""+r,Ni(n)||(n=""+n);var s=eA(this._isDirected,e,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,s))return a&&(this._edgeLabels[s]=i),this;if(!Ni(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(r),this._edgeLabels[s]=a?i:this._defaultEdgeLabelFn(e,r,n);var l=cEr(this._isDirected,e,r,n);return e=l.v,r=l.w,Object.freeze(l),this._edgeObjs[s]=l,qtt(this._preds[r],e),qtt(this._sucs[e],r),this._in[r][s]=l,this._out[e][s]=l,this._edgeCount++,this}edge(e,r,n){var i=arguments.length===1?Kue(this._isDirected,arguments[0]):eA(this._isDirected,e,r,n);return this._edgeLabels[i]}hasEdge(e,r,n){var i=arguments.length===1?Kue(this._isDirected,arguments[0]):eA(this._isDirected,e,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(e,r,n){var i=arguments.length===1?Kue(this._isDirected,arguments[0]):eA(this._isDirected,e,r,n),a=this._edgeObjs[i];return a&&(e=a.v,r=a.w,delete this._edgeLabels[i],delete this._edgeObjs[i],Wtt(this._preds[r],e),Wtt(this._sucs[e],r),delete this._in[r][i],delete this._out[e][i],this._edgeCount--),this}inEdges(e,r){var n=this._in[e];if(n){var i=Ji(n);return r?io(i,function(a){return a.v===r}):i}}outEdges(e,r){var n=this._out[e];if(n){var i=Ji(n);return r?io(i,function(a){return a.w===r}):i}}nodeEdges(e,r){var n=this.inEdges(e,r);if(n)return n.concat(this.outEdges(e,r))}}Oc.prototype._nodeCount=0,Oc.prototype._edgeCount=0;function qtt(t,e){t[e]?t[e]++:t[e]=1}function Wtt(t,e){--t[e]||delete t[e]}function eA(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var o=i;i=a,a=o}return i+Gtt+a+Gtt+(Ni(n)?uEr:n)}function cEr(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var o=i;i=a,a=o}var s={v:i,w:a};return n&&(s.name=n),s}function Kue(t,e){return eA(t,e.v,e.w,e.name)}class dEr{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,r=e._prev;if(r!==e)return Ytt(r),r}enqueue(e){var r=this._sentinel;e._prev&&e._next&&Ytt(e),e._next=r._next,r._next._prev=e,r._next=e,e._prev=r}toString(){for(var e=[],r=this._sentinel,n=r._prev;n!==r;)e.push(JSON.stringify(n,hEr)),n=n._prev;return"["+e.join(", ")+"]"}}function Ytt(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function hEr(t,e){if(t!=="_next"&&t!=="_prev")return e}var fEr=hv(1);function pEr(t,e){if(t.nodeCount()<=1)return[];var r=mEr(t,e||fEr),n=gEr(r.graph,r.buckets,r.zeroIdx);return ks(or(n,function(i){return t.outEdges(i.v,i.w)}))}function gEr(t,e,r){for(var n=[],i=e[e.length-1],a=e[0],o;t.nodeCount();){for(;o=a.dequeue();)Zue(t,e,r,o);for(;o=i.dequeue();)Zue(t,e,r,o);if(t.nodeCount()){for(var s=e.length-2;s>0;--s)if(o=e[s].dequeue(),o){n=n.concat(Zue(t,e,r,o,!0));break}}}return n}function Zue(t,e,r,n,i){var a=i?[]:void 0;return lt(t.inEdges(n.v),function(o){var s=t.edge(o),l=t.node(o.v);i&&a.push({v:o.v,w:o.w}),l.out-=s,Jue(e,r,l)}),lt(t.outEdges(n.v),function(o){var s=t.edge(o),l=o.w,u=t.node(l);u.in-=s,Jue(e,r,u)}),t.removeNode(n.v),a}function mEr(t,e){var r=new Oc,n=0,i=0;lt(t.nodes(),function(s){r.setNode(s,{v:s,in:0,out:0})}),lt(t.edges(),function(s){var l=r.edge(s.v,s.w)||0,u=e(s),d=l+u;r.setEdge(s.v,s.w,d),i=Math.max(i,r.node(s.v).out+=u),n=Math.max(n,r.node(s.w).in+=u)});var a=mv(i+n+3).map(function(){return new dEr}),o=n+1;return lt(r.nodes(),function(s){Jue(a,o,r.node(s))}),{graph:r,buckets:a,zeroIdx:o}}function Jue(t,e,r){r.out?r.in?t[r.out-r.in+e].enqueue(r):t[t.length-1].enqueue(r):t[0].enqueue(r)}function TEr(t){var e=t.graph().acyclicer==="greedy"?pEr(t,r(t)):vEr(t);lt(e,function(n){var i=t.edge(n);t.removeEdge(n),i.forwardName=n.name,i.reversed=!0,t.setEdge(n.w,n.v,i,lq("rev"))});function r(n){return function(i){return n.edge(i).weight}}}function vEr(t){var e=[],r={},n={};function i(a){Object.prototype.hasOwnProperty.call(n,a)||(n[a]=!0,r[a]=!0,lt(t.outEdges(a),function(o){Object.prototype.hasOwnProperty.call(r,o.w)?e.push(o):i(o.w)}),delete r[a])}return lt(t.nodes(),i),e}function yEr(t){lt(t.edges(),function(e){var r=t.edge(e);if(r.reversed){t.removeEdge(e);var n=r.forwardName;delete r.reversed,delete r.forwardName,t.setEdge(e.w,e.v,r,n)}})}function d_(t,e,r,n){var i;do i=lq(n);while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function _Er(t){var e=new Oc().setGraph(t.graph());return lt(t.nodes(),function(r){e.setNode(r,t.node(r))}),lt(t.edges(),function(r){var n=e.edge(r.v,r.w)||{weight:0,minlen:1},i=t.edge(r);e.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),e}function jtt(t){var e=new Oc({multigraph:t.isMultigraph()}).setGraph(t.graph());return lt(t.nodes(),function(r){t.children(r).length||e.setNode(r,t.node(r))}),lt(t.edges(),function(r){e.setEdge(r,t.edge(r))}),e}function Xtt(t,e){var r=t.x,n=t.y,i=e.x-r,a=e.y-n,o=t.width/2,s=t.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var l,u;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),l=s*i/a,u=s):(i<0&&(o=-o),l=o,u=o*a/i),{x:r+l,y:n+u}}function vF(t){var e=or(mv(Ztt(t)+1),function(){return[]});return lt(t.nodes(),function(r){var n=t.node(r),i=n.rank;Ni(i)||(e[i][n.order]=r)}),e}function bEr(t){var e=gv(or(t.nodes(),function(r){return t.node(r).rank}));lt(t.nodes(),function(r){var n=t.node(r);on(n,"rank")&&(n.rank-=e)})}function QEr(t){var e=gv(or(t.nodes(),function(a){return t.node(a).rank})),r=[];lt(t.nodes(),function(a){var o=t.node(a).rank-e;r[o]||(r[o]=[]),r[o].push(a)});var n=0,i=t.graph().nodeRankFactor;lt(r,function(a,o){Ni(a)&&o%i!==0?--n:n&<(a,function(s){t.node(s).rank+=n})})}function Ktt(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),d_(t,"border",i,e)}function Ztt(t){return _g(or(t.nodes(),function(e){var r=t.node(e).rank;if(!Ni(r))return r}))}function xEr(t,e){var r={lhs:[],rhs:[]};return lt(t,function(n){e(n)?r.lhs.push(n):r.rhs.push(n)}),r}function EEr(t,e){return e()}function SEr(t){function e(r){var n=t.children(r),i=t.node(r);if(n.length&<(n,e),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;a<o;++a)Jtt(t,"borderLeft","_bl",r,i,a),Jtt(t,"borderRight","_br",r,i,a)}}lt(t.children(),e)}function Jtt(t,e,r,n,i,a){var o={width:0,height:0,rank:a,borderType:e},s=i[e][a-1],l=d_(t,"border",o,r);i[e][a]=l,t.setParent(l,n),s&&t.setEdge(s,l,{weight:1})}function CEr(t){var e=t.graph().rankdir.toLowerCase();(e==="lr"||e==="rl")&&ert(t)}function LEr(t){var e=t.graph().rankdir.toLowerCase();(e==="bt"||e==="rl")&&wEr(t),(e==="lr"||e==="rl")&&(AEr(t),ert(t))}function ert(t){lt(t.nodes(),function(e){trt(t.node(e))}),lt(t.edges(),function(e){trt(t.edge(e))})}function trt(t){var e=t.width;t.width=t.height,t.height=e}function wEr(t){lt(t.nodes(),function(e){ece(t.node(e))}),lt(t.edges(),function(e){var r=t.edge(e);lt(r.points,ece),Object.prototype.hasOwnProperty.call(r,"y")&&ece(r)})}function ece(t){t.y=-t.y}function AEr(t){lt(t.nodes(),function(e){tce(t.node(e))}),lt(t.edges(),function(e){var r=t.edge(e);lt(r.points,tce),Object.prototype.hasOwnProperty.call(r,"x")&&tce(r)})}function tce(t){var e=t.x;t.x=t.y,t.y=e}function OEr(t){t.graph().dummyChains=[],lt(t.edges(),function(e){MEr(t,e)})}function MEr(t,e){var r=e.v,n=t.node(r).rank,i=e.w,a=t.node(i).rank,o=e.name,s=t.edge(e),l=s.labelRank;if(a!==n+1){t.removeEdge(e);var u=void 0,d,h;for(h=0,++n;n<a;++h,++n)s.points=[],u={width:0,height:0,edgeLabel:s,edgeObj:e,rank:n},d=d_(t,"edge",u,"_d"),n===l&&(u.width=s.width,u.height=s.height,u.dummy="edge-label",u.labelpos=s.labelpos),t.setEdge(r,d,{weight:s.weight},o),h===0&&t.graph().dummyChains.push(d),r=d;t.setEdge(r,i,{weight:s.weight},o)}}function REr(t){lt(t.graph().dummyChains,function(e){var r=t.node(e),n=r.edgeLabel,i;for(t.setEdge(r.edgeObj,n);r.dummy;)i=t.successors(e)[0],t.removeNode(e),n.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(n.x=r.x,n.y=r.y,n.width=r.width,n.height=r.height),e=i,r=t.node(e)})}function rce(t){var e={};function r(n){var i=t.node(n);if(Object.prototype.hasOwnProperty.call(e,n))return i.rank;e[n]=!0;var a=gv(or(t.outEdges(n),function(o){return r(o.w)-t.edge(o).minlen}));return(a===Number.POSITIVE_INFINITY||a===void 0||a===null)&&(a=0),i.rank=a}lt(t.sources(),r)}function tA(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}function rrt(t){var e=new Oc({directed:!1}),r=t.nodes()[0],n=t.nodeCount();e.setNode(r,{});for(var i,a;DEr(e,t)<n;)i=NEr(e,t),a=e.hasNode(i.v)?tA(t,i):-tA(t,i),IEr(e,t,a);return e}function DEr(t,e){function r(n){lt(e.nodeEdges(n),function(i){var a=i.v,o=n===a?i.w:a;!t.hasNode(o)&&!tA(e,i)&&(t.setNode(o,{}),t.setEdge(n,o,{}),r(o))})}return lt(t.nodes(),r),t.nodeCount()}function NEr(t,e){return oq(e.edges(),function(r){if(t.hasNode(r.v)!==t.hasNode(r.w))return tA(e,r)})}function IEr(t,e,r){lt(t.nodes(),function(n){e.node(n).rank+=r})}function kEr(){}kEr.prototype=new Error;function nrt(t,e,r){ai(e)||(e=[e]);var n=(t.isDirected()?t.successors:t.neighbors).bind(t),i=[],a={};return lt(e,function(o){if(!t.hasNode(o))throw new Error("Graph does not have node: "+o);irt(t,o,r==="post",a,n,i)}),i}function irt(t,e,r,n,i,a){Object.prototype.hasOwnProperty.call(n,e)||(n[e]=!0,r||a.push(e),lt(i(e),function(o){irt(t,o,r,n,i,a)}),r&&a.push(e))}function PEr(t,e){return nrt(t,e,"post")}function BEr(t,e){return nrt(t,e,"pre")}P8.initLowLimValues=ice,P8.initCutValues=nce,P8.calcCutValue=art,P8.leaveEdge=srt,P8.enterEdge=lrt,P8.exchangeEdges=urt;function P8(t){t=_Er(t),rce(t);var e=rrt(t);ice(e),nce(e,t);for(var r,n;r=srt(e);)n=lrt(e,t,r),urt(e,t,r,n)}function nce(t,e){var r=PEr(t,t.nodes());r=r.slice(0,r.length-1),lt(r,function(n){HEr(t,e,n)})}function HEr(t,e,r){var n=t.node(r),i=n.parent;t.edge(r,i).cutvalue=art(t,e,r)}function art(t,e,r){var n=t.node(r),i=n.parent,a=!0,o=e.edge(r,i),s=0;return o||(a=!1,o=e.edge(i,r)),s=o.weight,lt(e.nodeEdges(r),function(l){var u=l.v===r,d=u?l.w:l.v;if(d!==i){var h=u===a,f=e.edge(l).weight;if(s+=h?f:-f,VEr(t,r,d)){var p=t.edge(r,d).cutvalue;s+=h?-p:p}}}),s}function ice(t,e){arguments.length<2&&(e=t.nodes()[0]),ort(t,{},1,e)}function ort(t,e,r,n,i){var a=r,o=t.node(n);return e[n]=!0,lt(t.neighbors(n),function(s){Object.prototype.hasOwnProperty.call(e,s)||(r=ort(t,e,r,s,n))}),o.low=a,o.lim=r++,i?o.parent=i:delete o.parent,r}function srt(t){return Ph(t.edges(),function(e){return t.edge(e).cutvalue<0})}function lrt(t,e,r){var n=r.v,i=r.w;e.hasEdge(n,i)||(n=r.w,i=r.v);var a=t.node(n),o=t.node(i),s=a,l=!1;a.lim>o.lim&&(s=o,l=!0);var u=io(e.edges(),function(d){return l===crt(t,t.node(d.v),s)&&l!==crt(t,t.node(d.w),s)});return oq(u,function(d){return tA(e,d)})}function urt(t,e,r,n){var i=r.v,a=r.w;t.removeEdge(i,a),t.setEdge(n.v,n.w,{}),ice(t),nce(t,e),FEr(t,e)}function FEr(t,e){var r=Ph(t.nodes(),function(i){return!e.node(i).parent}),n=BEr(t,r);n=n.slice(1),lt(n,function(i){var a=t.node(i).parent,o=e.edge(i,a),s=!1;o||(o=e.edge(a,i),s=!0),e.node(i).rank=e.node(a).rank+(s?o.minlen:-o.minlen)})}function VEr(t,e,r){return t.hasEdge(e,r)}function crt(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}function $Er(t){switch(t.graph().ranker){case"network-simplex":drt(t);break;case"tight-tree":zEr(t);break;case"longest-path":UEr(t);break;default:drt(t)}}var UEr=rce;function zEr(t){rce(t),rrt(t)}function drt(t){P8(t)}function GEr(t){var e=d_(t,"root",{},"_root"),r=qEr(t),n=_g(Ji(r))-1,i=2*n+1;t.graph().nestingRoot=e,lt(t.edges(),function(o){t.edge(o).minlen*=i});var a=WEr(t)+1;lt(t.children(),function(o){hrt(t,e,i,a,n,r,o)}),t.graph().nodeRankFactor=i}function hrt(t,e,r,n,i,a,o){var s=t.children(o);if(!s.length){o!==e&&t.setEdge(e,o,{weight:0,minlen:r});return}var l=Ktt(t,"_bt"),u=Ktt(t,"_bb"),d=t.node(o);t.setParent(l,o),d.borderTop=l,t.setParent(u,o),d.borderBottom=u,lt(s,function(h){hrt(t,e,r,n,i,a,h);var f=t.node(h),p=f.borderTop?f.borderTop:h,g=f.borderBottom?f.borderBottom:h,m=f.borderTop?n:2*n,T=p!==g?1:i-a[o]+1;t.setEdge(l,p,{weight:m,minlen:T,nestingEdge:!0}),t.setEdge(g,u,{weight:m,minlen:T,nestingEdge:!0})}),t.parent(o)||t.setEdge(e,l,{weight:0,minlen:i+a[o]})}function qEr(t){var e={};function r(n,i){var a=t.children(n);a&&a.length&<(a,function(o){r(o,i+1)}),e[n]=i}return lt(t.children(),function(n){r(n,1)}),e}function WEr(t){return Vo(t.edges(),function(e,r){return e+t.edge(r).weight},0)}function YEr(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,lt(t.edges(),function(r){var n=t.edge(r);n.nestingEdge&&t.removeEdge(r)})}function jEr(t,e,r){var n={},i;lt(r,function(a){for(var o=t.parent(a),s,l;o;){if(s=t.parent(o),s?(l=n[s],n[s]=o):(l=i,i=o),l&&l!==o){e.setEdge(l,o);return}o=s}})}function XEr(t,e,r){var n=KEr(t),i=new Oc({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(a){return t.node(a)});return lt(t.nodes(),function(a){var o=t.node(a),s=t.parent(a);(o.rank===e||o.minRank<=e&&e<=o.maxRank)&&(i.setNode(a),i.setParent(a,s||n),lt(t[r](a),function(l){var u=l.v===a?l.w:l.v,d=i.edge(u,a),h=Ni(d)?0:d.weight;i.setEdge(u,a,{weight:t.edge(l).weight+h})}),Object.prototype.hasOwnProperty.call(o,"minRank")&&i.setNode(a,{borderLeft:o.borderLeft[e],borderRight:o.borderRight[e]}))}),i}function KEr(t){for(var e;t.hasNode(e=lq("_root")););return e}function ZEr(t,e){for(var r=0,n=1;n<e.length;++n)r+=JEr(t,e[n-1],e[n]);return r}function JEr(t,e,r){for(var n=Xvt(r,or(r,function(u,d){return d})),i=ks(or(e,function(u){return JQ(or(t.outEdges(u),function(d){return{pos:n[d.w],weight:t.edge(d).weight}}),"pos")})),a=1;a<r.length;)a<<=1;var o=2*a-1;a-=1;var s=or(new Array(o),function(){return 0}),l=0;return lt(i.forEach(function(u){var d=u.pos+a;s[d]+=u.weight;for(var h=0;d>0;)d%2&&(h+=s[d+1]),d=d-1>>1,s[d]+=u.weight;l+=u.weight*h})),l}function eSr(t){var e={},r=io(t.nodes(),function(s){return!t.children(s).length}),n=_g(or(r,function(s){return t.node(s).rank})),i=or(mv(n+1),function(){return[]});function a(s){if(!on(e,s)){e[s]=!0;var l=t.node(s);i[l.rank].push(s),lt(t.successors(s),a)}}var o=JQ(r,function(s){return t.node(s).rank});return lt(o,a),i}function tSr(t,e){return or(e,function(r){var n=t.inEdges(r);if(n.length){var i=Vo(n,function(a,o){var s=t.edge(o),l=t.node(o.v);return{sum:a.sum+s.weight*l.order,weight:a.weight+s.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function rSr(t,e){var r={};lt(t,function(i,a){var o=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};Ni(i.barycenter)||(o.barycenter=i.barycenter,o.weight=i.weight)}),lt(e.edges(),function(i){var a=r[i.v],o=r[i.w];!Ni(a)&&!Ni(o)&&(o.indegree++,a.out.push(r[i.w]))});var n=io(r,function(i){return!i.indegree});return nSr(n)}function nSr(t){var e=[];function r(a){return function(o){o.merged||(Ni(o.barycenter)||Ni(a.barycenter)||o.barycenter>=a.barycenter)&&iSr(a,o)}}function n(a){return function(o){o.in.push(a),--o.indegree===0&&t.push(o)}}for(;t.length;){var i=t.pop();e.push(i),lt(i.in.reverse(),r(i)),lt(i.out,n(i))}return or(io(e,function(a){return!a.merged}),function(a){return vR(a,["vs","i","barycenter","weight"])})}function iSr(t,e){var r=0,n=0;t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=r/n,t.weight=n,t.i=Math.min(e.i,t.i),e.merged=!0}function aSr(t,e){var r=xEr(t,function(d){return Object.prototype.hasOwnProperty.call(d,"barycenter")}),n=r.lhs,i=JQ(r.rhs,function(d){return-d.i}),a=[],o=0,s=0,l=0;n.sort(oSr(!!e)),l=frt(a,i,l),lt(n,function(d){l+=d.vs.length,a.push(d.vs),o+=d.barycenter*d.weight,s+=d.weight,l=frt(a,i,l)});var u={vs:ks(a)};return s&&(u.barycenter=o/s,u.weight=s),u}function frt(t,e,r){for(var n;e.length&&(n=a3(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function oSr(t){return function(e,r){return e.barycenter<r.barycenter?-1:e.barycenter>r.barycenter?1:t?r.i-e.i:e.i-r.i}}function prt(t,e,r,n){var i=t.children(e),a=t.node(e),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,l={};o&&(i=io(i,function(g){return g!==o&&g!==s}));var u=tSr(t,i);lt(u,function(g){if(t.children(g.v).length){var m=prt(t,g.v,r,n);l[g.v]=m,Object.prototype.hasOwnProperty.call(m,"barycenter")&&lSr(g,m)}});var d=rSr(u,r);sSr(d,l);var h=aSr(d,n);if(o&&(h.vs=ks([o,h.vs,s]),t.predecessors(o).length)){var f=t.node(t.predecessors(o)[0]),p=t.node(t.predecessors(s)[0]);Object.prototype.hasOwnProperty.call(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+f.order+p.order)/(h.weight+2),h.weight+=2}return h}function sSr(t,e){lt(t,function(r){r.vs=ks(r.vs.map(function(n){return e[n]?e[n].vs:n}))})}function lSr(t,e){Ni(t.barycenter)?(t.barycenter=e.barycenter,t.weight=e.weight):(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight)}function uSr(t){var e=Ztt(t),r=grt(t,mv(1,e+1),"inEdges"),n=grt(t,mv(e-1,-1,-1),"outEdges"),i=eSr(t);mrt(t,i);for(var a=Number.POSITIVE_INFINITY,o,s=0,l=0;l<4;++s,++l){cSr(s%2?r:n,s%4>=2),i=vF(t);var u=ZEr(t,i);u<a&&(l=0,o=ITt(i),a=u)}mrt(t,o)}function grt(t,e,r){return or(e,function(n){return XEr(t,n,r)})}function cSr(t,e){var r=new Oc;lt(t,function(n){var i=n.graph().root,a=prt(n,i,r,e);lt(a.vs,function(o,s){n.node(o).order=s}),jEr(n,r,a.vs)})}function mrt(t,e){lt(e,function(r){lt(r,function(n,i){t.node(n).order=i})})}function dSr(t){var e=fSr(t);lt(t.graph().dummyChains,function(r){for(var n=t.node(r),i=n.edgeObj,a=hSr(t,e,i.v,i.w),o=a.path,s=a.lca,l=0,u=o[l],d=!0;r!==i.w;){if(n=t.node(r),d){for(;(u=o[l])!==s&&t.node(u).maxRank<n.rank;)l++;u===s&&(d=!1)}if(!d){for(;l<o.length-1&&t.node(u=o[l+1]).minRank<=n.rank;)l++;u=o[l]}t.setParent(r,u),r=t.successors(r)[0]}})}function hSr(t,e,r,n){var i=[],a=[],o=Math.min(e[r].low,e[n].low),s=Math.max(e[r].lim,e[n].lim),l,u;l=r;do l=t.parent(l),i.push(l);while(l&&(e[l].low>o||s>e[l].lim));for(u=l,l=n;(l=t.parent(l))!==u;)a.push(l);return{path:i.concat(a.reverse()),lca:u}}function fSr(t){var e={},r=0;function n(i){var a=r;lt(t.children(i),n),e[i]={low:a,lim:r++}}return lt(t.children(),n),e}function pSr(t,e){var r={};function n(i,a){var o=0,s=0,l=i.length,u=a3(a);return lt(a,function(d,h){var f=mSr(t,d),p=f?t.node(f).order:l;(f||d===u)&&(lt(a.slice(s,h+1),function(g){lt(t.predecessors(g),function(m){var T=t.node(m),v=T.order;(v<o||p<v)&&!(T.dummy&&t.node(g).dummy)&&Trt(r,m,g)})}),s=h+1,o=p)}),a}return Vo(e,n),r}function gSr(t,e){var r={};function n(a,o,s,l,u){var d;lt(mv(o,s),function(h){d=a[h],t.node(d).dummy&<(t.predecessors(d),function(f){var p=t.node(f);p.dummy&&(p.order<l||p.order>u)&&Trt(r,f,d)})})}function i(a,o){var s=-1,l,u=0;return lt(o,function(d,h){if(t.node(d).dummy==="border"){var f=t.predecessors(d);f.length&&(l=t.node(f[0]).order,n(o,u,h,s,l),u=h,s=l)}n(o,u,o.length,l,a.length)}),o}return Vo(e,i),r}function mSr(t,e){if(t.node(e).dummy)return Ph(t.predecessors(e),function(r){return t.node(r).dummy})}function Trt(t,e,r){if(e>r){var n=e;e=r,r=n}var i=t[e];i||(t[e]=i={}),i[r]=!0}function TSr(t,e,r){if(e>r){var n=e;e=r,r=n}return!!t[e]&&Object.prototype.hasOwnProperty.call(t[e],r)}function vSr(t,e,r,n){var i={},a={},o={};return lt(e,function(s){lt(s,function(l,u){i[l]=l,a[l]=l,o[l]=u})}),lt(e,function(s){var l=-1;lt(s,function(u){var d=n(u);if(d.length){d=JQ(d,function(m){return o[m]});for(var h=(d.length-1)/2,f=Math.floor(h),p=Math.ceil(h);f<=p;++f){var g=d[f];a[u]===u&&l<o[g]&&!TSr(r,u,g)&&(a[g]=u,a[u]=i[u]=i[g],l=o[g])}}})}),{root:i,align:a}}function ySr(t,e,r,n,i){var a={},o=_Sr(t,e,r,i),s=i?"borderLeft":"borderRight";function l(h,f){for(var p=o.nodes(),g=p.pop(),m={};g;)m[g]?h(g):(m[g]=!0,p.push(g),p=p.concat(f(g))),g=p.pop()}function u(h){a[h]=o.inEdges(h).reduce(function(f,p){return Math.max(f,a[p.v]+o.edge(p))},0)}function d(h){var f=o.outEdges(h).reduce(function(g,m){return Math.min(g,a[m.w]-o.edge(m))},Number.POSITIVE_INFINITY),p=t.node(h);f!==Number.POSITIVE_INFINITY&&p.borderType!==s&&(a[h]=Math.max(a[h],f))}return l(u,o.predecessors.bind(o)),l(d,o.successors.bind(o)),lt(n,function(h){a[h]=a[r[h]]}),a}function _Sr(t,e,r,n){var i=new Oc,a=t.graph(),o=SSr(a.nodesep,a.edgesep,n);return lt(e,function(s){var l;lt(s,function(u){var d=r[u];if(i.setNode(d),l){var h=r[l],f=i.edge(h,d);i.setEdge(h,d,Math.max(o(t,u,l),f||0))}l=u})}),i}function bSr(t,e){return oq(Ji(e),function(r){var n=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return uvt(r,function(a,o){var s=CSr(t,o)/2;n=Math.max(a+s,n),i=Math.min(a-s,i)}),n-i})}function QSr(t,e){var r=Ji(e),n=gv(r),i=_g(r);lt(["u","d"],function(a){lt(["l","r"],function(o){var s=a+o,l=t[s],u;if(l!==e){var d=Ji(l);u=o==="l"?n-gv(d):i-_g(d),u&&(t[s]=mR(l,function(h){return h+u}))}})})}function xSr(t,e){return mR(t.ul,function(r,n){if(e)return t[e.toLowerCase()][n];var i=JQ(or(t,n));return(i[1]+i[2])/2})}function ESr(t){var e=vF(t),r=TR(pSr(t,e),gSr(t,e)),n={},i;lt(["u","d"],function(o){i=o==="u"?e:Ji(e).reverse(),lt(["l","r"],function(s){s==="r"&&(i=or(i,function(h){return Ji(h).reverse()}));var l=(o==="u"?t.predecessors:t.successors).bind(t),u=vSr(t,i,r,l),d=ySr(t,i,u.root,u.align,s==="r");s==="r"&&(d=mR(d,function(h){return-h})),n[o+s]=d})});var a=bSr(t,n);return QSr(n,a),xSr(n,t.graph().align)}function SSr(t,e,r){return function(n,i,a){var o=n.node(i),s=n.node(a),l=0,u;if(l+=o.width/2,Object.prototype.hasOwnProperty.call(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":u=-o.width/2;break;case"r":u=o.width/2;break}if(u&&(l+=r?u:-u),u=0,l+=(o.dummy?e:t)/2,l+=(s.dummy?e:t)/2,l+=s.width/2,Object.prototype.hasOwnProperty.call(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":u=s.width/2;break;case"r":u=-s.width/2;break}return u&&(l+=r?u:-u),u=0,l}}function CSr(t,e){return t.node(e).width}function LSr(t){t=jtt(t),wSr(t),cvt(ESr(t),function(e,r){t.node(r).x=e})}function wSr(t){var e=vF(t),r=t.graph().ranksep,n=0;lt(e,function(i){var a=_g(or(i,function(o){return t.node(o).height}));lt(i,function(o){t.node(o).y=n+a/2}),n+=a+r})}function vrt(t,e){var r=EEr;r("layout",()=>{var n=r(" buildLayoutGraph",()=>HSr(t));r(" runLayout",()=>ASr(n,r)),r(" updateInputGraph",()=>OSr(t,n))})}function ASr(t,e){e(" makeSpaceForEdgeLabels",()=>FSr(t)),e(" removeSelfEdges",()=>jSr(t)),e(" acyclic",()=>TEr(t)),e(" nestingGraph.run",()=>GEr(t)),e(" rank",()=>$Er(jtt(t))),e(" injectEdgeLabelProxies",()=>VSr(t)),e(" removeEmptyRanks",()=>QEr(t)),e(" nestingGraph.cleanup",()=>YEr(t)),e(" normalizeRanks",()=>bEr(t)),e(" assignRankMinMax",()=>$Sr(t)),e(" removeEdgeLabelProxies",()=>USr(t)),e(" normalize.run",()=>OEr(t)),e(" parentDummyChains",()=>dSr(t)),e(" addBorderSegments",()=>SEr(t)),e(" order",()=>uSr(t)),e(" insertSelfEdges",()=>XSr(t)),e(" adjustCoordinateSystem",()=>CEr(t)),e(" position",()=>LSr(t)),e(" positionSelfEdges",()=>KSr(t)),e(" removeBorderNodes",()=>YSr(t)),e(" normalize.undo",()=>REr(t)),e(" fixupEdgeLabelCoords",()=>qSr(t)),e(" undoCoordinateSystem",()=>LEr(t)),e(" translateGraph",()=>zSr(t)),e(" assignNodeIntersects",()=>GSr(t)),e(" reversePoints",()=>WSr(t)),e(" acyclic.undo",()=>yEr(t))}function OSr(t,e){lt(t.nodes(),function(r){var n=t.node(r),i=e.node(r);n&&(n.x=i.x,n.y=i.y,e.children(r).length&&(n.width=i.width,n.height=i.height))}),lt(t.edges(),function(r){var n=t.edge(r),i=e.edge(r);n.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(n.x=i.x,n.y=i.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}var MSr=["nodesep","edgesep","ranksep","marginx","marginy"],RSr={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},DSr=["acyclicer","ranker","rankdir","align"],NSr=["width","height"],ISr={width:0,height:0},kSr=["minlen","weight","width","height","labeloffset"],PSr={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},BSr=["labelpos"];function HSr(t){var e=new Oc({multigraph:!0,compound:!0}),r=oce(t.graph());return e.setGraph(TR({},RSr,ace(r,MSr),vR(r,DSr))),lt(t.nodes(),function(n){var i=oce(t.node(n));e.setNode(n,fR(ace(i,NSr),ISr)),e.setParent(n,t.parent(n))}),lt(t.edges(),function(n){var i=oce(t.edge(n));e.setEdge(n,TR({},PSr,ace(i,kSr),vR(i,BSr)))}),e}function FSr(t){var e=t.graph();e.ranksep/=2,lt(t.edges(),function(r){var n=t.edge(r);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function VSr(t){lt(t.edges(),function(e){var r=t.edge(e);if(r.width&&r.height){var n=t.node(e.v),i=t.node(e.w),a={rank:(i.rank-n.rank)/2+n.rank,e};d_(t,"edge-proxy",a,"_ep")}})}function $Sr(t){var e=0;lt(t.nodes(),function(r){var n=t.node(r);n.borderTop&&(n.minRank=t.node(n.borderTop).rank,n.maxRank=t.node(n.borderBottom).rank,e=_g(e,n.maxRank))}),t.graph().maxRank=e}function USr(t){lt(t.nodes(),function(e){var r=t.node(e);r.dummy==="edge-proxy"&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}function zSr(t){var e=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,i=0,a=t.graph(),o=a.marginx||0,s=a.marginy||0;function l(u){var d=u.x,h=u.y,f=u.width,p=u.height;e=Math.min(e,d-f/2),r=Math.max(r,d+f/2),n=Math.min(n,h-p/2),i=Math.max(i,h+p/2)}lt(t.nodes(),function(u){l(t.node(u))}),lt(t.edges(),function(u){var d=t.edge(u);Object.prototype.hasOwnProperty.call(d,"x")&&l(d)}),e-=o,n-=s,lt(t.nodes(),function(u){var d=t.node(u);d.x-=e,d.y-=n}),lt(t.edges(),function(u){var d=t.edge(u);lt(d.points,function(h){h.x-=e,h.y-=n}),Object.prototype.hasOwnProperty.call(d,"x")&&(d.x-=e),Object.prototype.hasOwnProperty.call(d,"y")&&(d.y-=n)}),a.width=r-e+o,a.height=i-n+s}function GSr(t){lt(t.edges(),function(e){var r=t.edge(e),n=t.node(e.v),i=t.node(e.w),a,o;r.points?(a=r.points[0],o=r.points[r.points.length-1]):(r.points=[],a=i,o=n),r.points.unshift(Xtt(n,a)),r.points.push(Xtt(i,o))})}function qSr(t){lt(t.edges(),function(e){var r=t.edge(e);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function WSr(t){lt(t.edges(),function(e){var r=t.edge(e);r.reversed&&r.points.reverse()})}function YSr(t){lt(t.nodes(),function(e){if(t.children(e).length){var r=t.node(e),n=t.node(r.borderTop),i=t.node(r.borderBottom),a=t.node(a3(r.borderLeft)),o=t.node(a3(r.borderRight));r.width=Math.abs(o.x-a.x),r.height=Math.abs(i.y-n.y),r.x=a.x+r.width/2,r.y=n.y+r.height/2}}),lt(t.nodes(),function(e){t.node(e).dummy==="border"&&t.removeNode(e)})}function jSr(t){lt(t.edges(),function(e){if(e.v===e.w){var r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}})}function XSr(t){var e=vF(t);lt(e,function(r){var n=0;lt(r,function(i,a){var o=t.node(i);o.order=a+n,lt(o.selfEdges,function(s){d_(t,"selfedge",{width:s.label.width,height:s.label.height,rank:o.rank,order:a+ ++n,e:s.e,label:s.label},"_se")}),delete o.selfEdges})})}function KSr(t){lt(t.nodes(),function(e){var r=t.node(e);if(r.dummy==="selfedge"){var n=t.node(r.e.v),i=n.x+n.width/2,a=n.y,o=r.x-i,s=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],r.label.x=r.x,r.label.y=r.y}})}function ace(t,e){return mR(vR(t,e),Number)}function oce(t){var e={};return lt(t,function(r,n){e[n.toLowerCase()]=r}),e}function lh(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:ZSr(t),edges:JSr(t)};return Ni(t.graph())||(e.value=ss(t.graph())),e}function ZSr(t){return or(t.nodes(),function(e){var r=t.node(e),n=t.parent(e),i={v:e};return Ni(r)||(i.value=r),Ni(n)||(i.parent=n),i})}function JSr(t){return or(t.edges(),function(e){var r=t.edge(e),n={v:e.v,w:e.w};return Ni(e.name)||(n.name=e.name),Ni(r)||(n.value=r),n})}var jn=new Map,B8=new Map,yrt=new Map,eCr=N(()=>{B8.clear(),yrt.clear(),jn.clear()},"clear"),yF=N((t,e)=>{const r=B8.get(e)||[];return Te.trace("In isDescendant",e," ",t," = ",r.includes(t)),r.includes(t)},"isDescendant"),tCr=N((t,e)=>{const r=B8.get(e)||[];return Te.info("Descendants of ",e," is ",r),Te.info("Edge is ",t),t.v===e||t.w===e?!1:r?r.includes(t.v)||yF(t.v,e)||yF(t.w,e)||r.includes(t.w):(Te.debug("Tilt, ",e,",not in descendants"),!1)},"edgeInCluster"),_rt=N((t,e,r,n)=>{Te.warn("Copying children of ",t,"root",n,"data",e.node(t),n);const i=e.children(t)||[];t!==n&&i.push(t),Te.warn("Copying (nodes) clusterId",t,"nodes",i),i.forEach(a=>{if(e.children(a).length>0)_rt(a,e,r,n);else{const o=e.node(a);Te.info("cp ",a," to ",n," with parent ",t),r.setNode(a,o),n!==e.parent(a)&&(Te.warn("Setting parent",a,e.parent(a)),r.setParent(a,e.parent(a))),t!==n&&a!==t?(Te.debug("Setting parent",a,t),r.setParent(a,t)):(Te.info("In copy ",t,"root",n,"data",e.node(t),n),Te.debug("Not Setting parent for node=",a,"cluster!==rootId",t!==n,"node!==clusterId",a!==t));const s=e.edges(a);Te.debug("Copying Edges",s),s.forEach(l=>{Te.info("Edge",l);const u=e.edge(l.v,l.w,l.name);Te.info("Edge data",u,n);try{tCr(l,n)?(Te.info("Copying as ",l.v,l.w,u,l.name),r.setEdge(l.v,l.w,u,l.name),Te.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]))):Te.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",n," clusterId:",t)}catch(d){Te.error(d)}})}Te.debug("Removing node",a),e.removeNode(a)})},"copy"),brt=N((t,e)=>{const r=e.children(t);let n=[...r];for(const i of r)yrt.set(i,t),n=[...n,...brt(i,e)];return n},"extractDescendants"),rCr=N((t,e,r)=>{const n=t.edges().filter(l=>l.v===e||l.w===e),i=t.edges().filter(l=>l.v===r||l.w===r),a=n.map(l=>({v:l.v===e?r:l.v,w:l.w===e?e:l.w})),o=i.map(l=>({v:l.v,w:l.w}));return a.filter(l=>o.some(u=>l.v===u.v&&l.w===u.w))},"findCommonEdges"),rA=N((t,e,r)=>{const n=e.children(t);if(Te.trace("Searching children of id ",t,n),n.length<1)return t;let i;for(const a of n){const o=rA(a,e,r),s=rCr(e,r,o);if(o)if(s.length>0)i=o;else return o}return i},"findNonClusterChild"),Qrt=N(t=>!jn.has(t)||!jn.get(t).externalConnections?t:jn.has(t)?jn.get(t).id:t,"getAnchorId"),nCr=N((t,e)=>{if(!t||e>10){Te.debug("Opting out, no graph ");return}else Te.debug("Opting in, graph ");t.nodes().forEach(function(r){t.children(r).length>0&&(Te.warn("Cluster identified",r," Replacement id in edges: ",rA(r,t,r)),B8.set(r,brt(r,t)),jn.set(r,{id:rA(r,t,r),clusterData:t.node(r)}))}),t.nodes().forEach(function(r){const n=t.children(r),i=t.edges();n.length>0?(Te.debug("Cluster identified",r,B8),i.forEach(a=>{const o=yF(a.v,r),s=yF(a.w,r);o^s&&(Te.warn("Edge: ",a," leaves cluster ",r),Te.warn("Descendants of XXX ",r,": ",B8.get(r)),jn.get(r).externalConnections=!0)})):Te.debug("Not a cluster ",r,B8)});for(let r of jn.keys()){const n=jn.get(r).id,i=t.parent(n);i!==r&&jn.has(i)&&!jn.get(i).externalConnections&&(jn.get(r).id=i)}t.edges().forEach(function(r){const n=t.edge(r);Te.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(r)),Te.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(t.edge(r)));let i=r.v,a=r.w;if(Te.warn("Fix XXX",jn,"ids:",r.v,r.w,"Translating: ",jn.get(r.v)," --- ",jn.get(r.w)),jn.get(r.v)||jn.get(r.w)){if(Te.warn("Fixing and trying - removing XXX",r.v,r.w,r.name),i=Qrt(r.v),a=Qrt(r.w),t.removeEdge(r.v,r.w,r.name),i!==r.v){const o=t.parent(i);jn.get(o).externalConnections=!0,n.fromCluster=r.v}if(a!==r.w){const o=t.parent(a);jn.get(o).externalConnections=!0,n.toCluster=r.w}Te.warn("Fix Replacing with XXX",i,a,r.name),t.setEdge(i,a,n,r.name)}}),Te.warn("Adjusted Graph",lh(t)),xrt(t,0),Te.trace(jn)},"adjustClustersAndEdges"),xrt=N((t,e)=>{var i,a;if(Te.warn("extractor - ",e,lh(t),t.children("D")),e>10){Te.error("Bailing out");return}let r=t.nodes(),n=!1;for(const o of r){const s=t.children(o);n=n||s.length>0}if(!n){Te.debug("Done, no node has children",t.nodes());return}Te.debug("Nodes = ",r,e);for(const o of r)if(Te.debug("Extracting node",o,jn,jn.has(o)&&!jn.get(o).externalConnections,!t.parent(o),t.node(o),t.children("D")," Depth ",e),!jn.has(o))Te.debug("Not a cluster",o,e);else if(!jn.get(o).externalConnections&&t.children(o)&&t.children(o).length>0){Te.warn("Cluster without external connections, without a parent and with children",o,e);let l=t.graph().rankdir==="TB"?"LR":"TB";(a=(i=jn.get(o))==null?void 0:i.clusterData)!=null&&a.dir&&(l=jn.get(o).clusterData.dir,Te.warn("Fixing dir",jn.get(o).clusterData.dir,l));const u=new Oc({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});Te.warn("Old graph before copy",lh(t)),_rt(o,t,u,o),t.setNode(o,{clusterNode:!0,id:o,clusterData:jn.get(o).clusterData,label:jn.get(o).label,graph:u}),Te.warn("New graph after copy node: (",o,")",lh(u)),Te.debug("Old graph after copy",lh(t))}else Te.warn("Cluster ** ",o," **not meeting the criteria !externalConnections:",!jn.get(o).externalConnections," no parent: ",!t.parent(o)," children ",t.children(o)&&t.children(o).length>0,t.children("D"),e),Te.debug(jn);r=t.nodes(),Te.warn("New list of nodes",r);for(const o of r){const s=t.node(o);Te.warn(" Now next level",o,s),s!=null&&s.clusterNode&&xrt(s.graph,e+1)}},"extractor"),Ert=N((t,e)=>{if(e.length===0)return[];let r=Object.assign([],e);return e.forEach(n=>{const i=t.children(n),a=Ert(t,i);r=[...r,...a]}),r},"sorter"),iCr=N(t=>Ert(t,t.children()),"sortNodesByHierarchy"),Srt=N(async(t,e,r,n,i,a)=>{Te.warn("Graph in recursive render:XAX",lh(e),i);const o=e.graph().rankdir;Te.trace("Dir in recursive render - dir:",o);const s=t.insert("g").attr("class","root");e.nodes()?Te.info("Recursive render XXX",e.nodes()):Te.info("No nodes found for",e),e.edges().length>0&&Te.info("Recursive edges",e.edge(e.edges()[0]));const l=s.insert("g").attr("class","clusters"),u=s.insert("g").attr("class","edgePaths"),d=s.insert("g").attr("class","edgeLabels"),h=s.insert("g").attr("class","nodes");await Promise.all(e.nodes().map(async function(m){const T=e.node(m);if(i!==void 0){const v=JSON.parse(JSON.stringify(i.clusterData));Te.trace(`Setting data for parent cluster XXX
|
|
1058
|
+
`).reduce((i,a)=>{if(a.trim(),a.length===0)return i;const s=(a.split(/(\{{.*?\}})/)||[]).reduce((l,u)=>{if(!u)return l;if(u.startsWith("{{")&&u.endsWith("}}")){const d=u.slice(2,-2);d&&l.push({type:"inputNode",attrs:{value:d},content:[{type:"text",text:"\uFEFF"},{type:"text",text:d}]})}else l.push({type:"text",text:u});return l},[]);return t&&s.unshift({type:"commandNode",attrs:{value:t},content:[{type:"text",text:t}]}),i.push({type:"paragraph",content:s}),i},[])}),Zxr={class:"sender"},Jxr={key:0,class:"sender-header"},eEr={class:"sender-content"},tEr={class:"sender-footer"},rEr={class:"sender-footer_left"},nEr={key:0},iEr={key:1,class:"sender-footer_left-count"},aEr={class:"sender-footer_right"},TF=1.7,Utt=oa(Object.assign({name:"AiSender"},{__name:"Sender",props:I.mergeDefaults({placeholder:String,maxLength:Number,loading:Boolean,rows:Number,autoSize:[Boolean,Object],showAudio:Boolean,audioLoading:Boolean,audioConfig:Object},{placeholder:"\u8BF7\u8F93\u5165\u60A8\u7684\u95EE\u9898\uFF0Center\u53D1\u9001\uFF0Cshift+enter\u6362\u884C",maxLength:0,loading:!1,rows:2,autoSize:!1,showAudio:!1,audioLoading:!1,audioConfig:()=>({})}),emits:["onSend","onStop","onClear","onAudioLoaded"],setup(t,{expose:e,emit:r}){I.useCssVars(T=>({"467db649":s.value.minHeight,"18729fdb":s.value.maxHeight}));const n=r,i=I.ref(""),a=I.ref(""),o=I.computed(()=>{var T;return((T=l.value)==null?void 0:T.storage.characterCount.characters())||0}),s=I.computed(()=>t.autoSize?typeof t.autoSize=="boolean"?{minHeight:"auto",maxHeight:"auto"}:{minHeight:`${t.autoSize.minRows*TF+1}em`,maxHeight:`${t.autoSize.maxRows*TF+1}em`}:{minHeight:`${t.rows*TF+1}em`,maxHeight:`${t.rows*TF+1}em`}),l=axr({extensions:[Oxr,Rxr,Nxr,Lxr.configure({placeholder:t.placeholder}),wxr,Cxr.configure({limit:t.maxLength?t.maxLength:null}),kxr,Bxr,Hxr.configure({onKeySend:()=>{d()}})],onUpdate:()=>{const T=l.value.getText();l.value.isEmpty&&(a.value=""),i.value=T.slice(a.value.length)}}),u=T=>{var y,_;a.value=T.command||"";const v=Kxr(T);(y=l.value)==null||y.commands.clearContent(),(_=l.value)==null||_.chain().setContent(v).run()},d=()=>{t.loading?ma.warning("\u56DE\u7B54\u8F93\u51FA\u4E2D\uFF0C\u8BF7\u7A0D\u540E\u64CD\u4F5C\u6216\u70B9\u51FB\u505C\u6B62\u56DE\u7B54"):i.value.trim()&&(n("onSend",i.value.trim()),h())},h=()=>{var T;a.value="",(T=l.value)==null||T.commands.clearContent()},f=()=>{d()},p=()=>{n("onStop")},g=()=>{n("onClear"),h()},m=T=>{n("onAudioLoaded",T)};return e({insert:u,reset:h}),(T,v)=>{const y=Jc,_=k6;return I.openBlock(),I.createElementBlock("div",Zxr,[T.$slots.header?(I.openBlock(),I.createElementBlock("div",Jxr,[I.renderSlot(T.$slots,"header",{},void 0,!0)])):I.createCommentVNode("",!0),I.createElementVNode("div",eEr,[I.createVNode(I.unref(ixr),{editor:I.unref(l)},null,8,["editor"])]),I.createElementVNode("div",tEr,[I.createElementVNode("div",rEr,[T.$slots.extra?(I.openBlock(),I.createElementBlock("div",nEr,[I.renderSlot(T.$slots,"extra",{},void 0,!0)])):I.createCommentVNode("",!0),t.maxLength?(I.openBlock(),I.createElementBlock("span",iEr,I.toDisplayString(o.value)+"/"+I.toDisplayString(t.maxLength),1)):I.createCommentVNode("",!0)]),I.createElementVNode("div",aEr,[I.createVNode(_,null,{title:I.withCtx(()=>v[0]||(v[0]=[I.createTextVNode("\u6E05\u9664")])),default:I.withCtx(()=>[I.createVNode(y,{onClick:g,type:"text"},{icon:I.withCtx(()=>[I.createVNode(I.unref(jq))]),_:1})]),_:1}),t.showAudio?(I.openBlock(),I.createBlock(Xxr,{key:0,audioLoading:t.audioLoading,audioConfig:t.audioConfig,onOnAudioLoaded:m},null,8,["audioLoading","audioConfig"])):I.createCommentVNode("",!0),t.loading?(I.openBlock(),I.createBlock(y,{key:2,type:"primary",shape:"round",onClick:p},{icon:I.withCtx(()=>[I.createVNode(gF,{name:"ai-icon-tingzhi",class:"btn-icon"})]),default:I.withCtx(()=>[v[2]||(v[2]=I.createTextVNode(" \u505C\u6B62 "))]),_:1,__:[2]})):(I.openBlock(),I.createBlock(y,{key:1,type:"primary",shape:"round",disabled:!i.value.trim(),onClick:f},{icon:I.withCtx(()=>[I.createVNode(gF,{name:"ai-icon-fasong",class:"btn-icon"})]),default:I.withCtx(()=>[v[1]||(v[1]=I.createTextVNode(" \u53D1\u9001 "))]),_:1,__:[1]},8,["disabled"]))])])])}}}),[["__scopeId","data-v-fef4abc5"]]),oEr=(t,e={bottom:50,top:50,left:0,right:0})=>{const r=()=>{n.bottom&&u({behavior:"instant"})},{arrivedState:n,measure:i}=wnr(t,{offset:e}),{stop:a}=Lnr(t,r,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),{stop:o}=pPe(t,r),s=I.computed(()=>A9(t));let l=null;const u=({behavior:d="smooth"}={})=>{s.value&&(l=setTimeout(()=>{try{s.value.scrollTo({top:s.value.scrollHeight,behavior:d})}catch{s.value.scrollTop=s.value.scrollHeight}},0))};return I.onMounted(()=>{I.nextTick(()=>{u({behavior:"instant"})})}),I.onUnmounted(()=>{a(),o(),clearTimeout(l)}),{scrollToBottom:u,arrivedState:n,measure:i}};window._iconfont_svg_string_4730060='<svg><symbol id="ai-icon-clear" viewBox="0 0 1024 1024"><path d="M975.36 455.85c0.512-53.247-42.496-96.767-95.744-97.28h-227.84V166.06c0.512-65.536-52.736-119.296-118.272-119.808H501.76c-65.536 0.512-118.784 54.272-118.272 119.808V358.57H151.04c-53.76 0.512-96.256 44.544-95.744 98.304 0.512 41.984 28.16 78.848 68.096 91.648v339.456c-0.512 43.008 34.304 77.824 77.312 78.336h635.392c43.008-0.512 77.312-35.328 77.312-78.336V546.475c37.376-14.336 61.952-50.688 61.952-90.624zM442.88 166.06c0-32.768 26.112-59.392 58.88-59.392h31.744c32.768 0.512 58.88 27.136 58.88 59.392V358.57H442.88V166.059z m393.216 739.84h-97.792V782.507c0.512-16.384-12.288-30.208-28.672-30.72-16.384-0.512-30.208 12.288-30.72 28.672v125.44h-130.56V782.507c0-16.384-13.312-29.696-29.696-29.696s-29.696 13.312-29.696 29.696v123.392H358.4V782.507c0-16.384-13.312-29.696-29.696-29.696s-29.696 13.312-29.696 29.696v123.392h-98.304c-9.728 0-17.92-8.192-17.92-17.92V553.13h671.232v334.848c0 9.728-8.192 17.92-17.92 17.92z m43.52-413.184H151.04c-20.48 0-36.864-16.896-36.864-37.376s16.384-36.864 36.864-36.864h728.576c20.48 0 36.864 16.896 36.864 37.376s-16.384 36.864-36.864 36.864z" ></path></symbol><symbol id="ai-icon-fasong" viewBox="0 0 1024 1024"><path d="M894.208 160.3584s85.2992-33.2288 78.1824 47.5136c-2.3552 33.28-23.7056 149.6064-40.2944 275.456l-56.832 372.7872s-4.7104 54.6304-47.36 64.1024c-42.5984 9.5232-106.5472-33.2288-118.3744-42.752-9.472-7.1168-177.664-113.9712-236.8512-166.1952-16.5888-14.2336-35.5328-42.752 2.4064-75.9808l248.6272-237.4656c28.416-28.4672 56.832-94.976-61.5424-14.2336l-331.5712 225.5872s-37.888 23.7568-108.9536 2.3552l-153.9072-47.4624s-56.832-35.6352 40.2432-71.2704c236.8512-111.616 528.128-225.5872 786.2272-332.4416z" ></path></symbol><symbol id="ai-icon-tingzhi" viewBox="0 0 1024 1024"><path d="M512 0a512 512 0 1 1 0 1024A512 512 0 0 1 512 0z m0 73.142857a438.857143 438.857143 0 1 0 0 877.714286A438.857143 438.857143 0 0 0 512 73.142857z" ></path><path d="M292.571429 292.571429m73.142857 0l292.571428 0q73.142857 0 73.142857 73.142857l0 292.571428q0 73.142857-73.142857 73.142857l-292.571428 0q-73.142857 0-73.142857-73.142857l0-292.571428q0-73.142857 73.142857-73.142857Z" ></path></symbol><symbol id="ai-icon-more" viewBox="0 0 1024 1024"><path d="M576 832a64 64 0 1 1-128 0 64 64 0 0 1 128 0zM512 256a64 64 0 1 0 0-128 64 64 0 0 0 0 128z m0 320a64 64 0 1 0 0-128 64 64 0 0 0 0 128z" fill="#515151" fill-opacity=".9" ></path></symbol><symbol id="ai-icon-top" viewBox="0 0 1024 1024"><path d="M842.42 131.29H180.55c-18.2 0-33.1-14.89-33.1-33.09 0-18.2 14.89-33.1 33.1-33.1h661.88c18.2 0 33.09 14.89 33.09 33.1-0.01 18.2-14.9 33.09-33.1 33.09zM511.49 958.64c-18.2 0-33.1-14.89-33.1-33.09V263.67c0-18.2 14.89-33.1 33.1-33.1 18.2 0 33.09 14.89 33.09 33.1v661.88c0 18.19-14.9 33.09-33.09 33.09z m330.93-364.03c-8.28 0-16.55-3.31-23.17-9.93L511.49 276.9 203.71 584.68c-13.24 13.23-33.09 13.23-46.33 0-13.24-13.24-13.24-33.1 0-46.34L488.32 207.4c13.24-13.23 33.1-13.23 46.33 0l330.94 330.94c13.24 13.24 13.24 33.1 0 46.34-6.62 6.61-14.9 9.93-23.17 9.93z" fill="#515151" ></path></symbol><symbol id="ai-icon-edit" viewBox="0 0 1024 1024"><path d="M82.26816 720.45909333a109.22666667 109.22666667 0 0 1 18.73237334-71.76192l365.90933333-533.13536a109.22666667 109.22666667 0 0 1 151.82506667-28.28970666l144.12458666 98.85013333a109.22666667 109.22666667 0 0 1 28.23509334 151.93429333l-365.90933334 533.13536a109.22666667 109.22666667 0 0 1-60.23850666 43.25376l-131.61813334 37.41013334a109.22666667 109.22666667 0 0 1-138.60864-95.13642667l-12.45184-136.26026667z m643.50890667-480.26965333l-144.12458667-98.85013333a43.69066667 43.69066667 0 0 0-60.73002666 11.30496L433.70496 279.67488l216.15957334 148.32981333 87.21749333-127.03061333a43.69066667 43.69066667 0 0 0-11.30496-60.78464z m-113.0496 241.88245333L396.67712 333.74208l-241.60938666 352.03754667a43.69066667 43.69066667 0 0 0-7.48202667 28.72661333l12.45184 136.26026667a43.69066667 43.69066667 0 0 0 55.43253333 38.01088l131.61813334-37.35552a43.69066667 43.69066667 0 0 0 24.13909333-17.31242667l241.60938667-352.03754667zM534.41194667 877.41781333a32.768 32.768 0 1 0 0 65.536h393.216a32.768 32.768 0 1 0 0-65.536h-393.216z" fill="#515151" ></path></symbol><symbol id="ai-icon-search" viewBox="0 0 1024 1024"><path d="M475.59111111 75.09333333a400.49777778 400.49777778 0 0 1 307.80074667 656.81635556l157.2864 157.2864c12.23338667 11.94211555 10.55857778 33.35054222-3.64088889 47.91409778-14.56355555 14.19946667-35.97198222 15.80145778-47.84128 3.56807111l-157.2864-157.2864A400.49777778 400.49777778 0 1 1 475.59111111 75.09333333z m0 72.0896c-207.89475555 0-327.82563555 167.48088889-327.82563556 328.40817778s119.56679111 329.13635555 327.68 329.13635556c208.04039111 0 327.68-168.20906667 327.68-329.13635556 0-160.92728889-119.63960889-328.40817778-327.53436444-328.40817778z" fill="#515151" ></path></symbol><symbol id="ai-icon-shuaxin" viewBox="0 0 1024 1024"><path d="M512 894.08c-210.72 0-382.08-171.36-382.08-382.08 0-8.16 0.48-16.32 0.96-24.48l67.2 4.32c-0.48 6.72-0.48 13.44-0.48 20.16 0 173.76 141.12 314.88 314.88 314.88 81.12 0 157.92-30.72 216.48-86.4l46.08 48.96C703.52 857.12 610.4 894.08 512 894.08zM894.08 512h-67.2c0-11.04-0.48-22.08-1.92-33.12-16.8-160.8-151.2-281.76-313.44-281.76-63.36 0-123.84 18.72-176.16 53.76L298.4 195.2c62.88-42.72 136.8-65.28 213.6-65.28 196.32 0 360 146.88 380.16 342.24 1.44 12.96 1.92 26.4 1.92 39.84z" fill="#515151" ></path><path d="M163.52 304.64L58.4 492.8c-2.88 4.8 0.96 11.04 6.24 11.04H274.4c5.76 0 9.12-5.76 6.24-11.04L176 304.64c-2.88-5.28-10.08-5.28-12.48 0zM848 665.6L742.88 477.44c-2.88-4.8 0.96-11.04 6.24-11.04h209.76c5.76 0 9.12 5.76 6.24 11.04L860.48 665.6c-2.4 4.8-9.6 4.8-12.48 0zM285.44 221.6a33.6 33.6 0 1 0 67.2 0 33.6 33.6 0 1 0-67.2 0zM715.04 767.84a33.6 33.6 0 1 0 67.2 0 33.6 33.6 0 1 0-67.2 0z" fill="#515151" ></path></symbol><symbol id="ai-icon-shoucang" viewBox="0 0 1024 1024"><path d="M323.20853333 943.60462187c-38.30897813 23.80231147-88.40533333 11.4915552-111.67288853-27.2611552a82.48888853 82.48888853 0 0 1-9.55733333-61.2579552l49.5843552-211.456a14.01742187 14.01742187 0 0 0-4.28942187-13.7216l-162.304-141.42577814c-33.7123552-29.35466667-37.6035552-80.6912-8.7836448-114.9155552a80.72533333 80.72533333 0 0 1 55.18222187-28.53546666L344.3712 327.68c4.64213333-0.3868448 8.79502187-3.44746667 10.69511147-8.10097813l82.0679104-200.71537707c17.1008-41.81333333 64.65991147-61.78133333 106.15466666-44.22542293a81.39662187 81.39662187 0 0 1 43.55413334 44.22542293l82.06791146 200.704c1.90008853 4.66488853 6.05297813 7.73688853 10.69511147 8.1123552l213.02613333 17.36248853c44.6691552 3.64088853 77.7443552 43.15591147 74.20586667 88.0184896a82.06791147 82.06791147 0 0 1-27.81866667 55.4439104l-162.304 141.42577814c-3.77742187 3.28817813-5.48408853 8.61297813-4.28942293 13.71022186l49.58435627 211.456c10.2627552 43.7475552-16.384 87.82506667-59.8812448 98.37226667a80.3043552 80.3043552 0 0 1-61.3603552-9.8531552l-182.3744-113.32266667a12.04906667 12.04906667 0 0 0-12.81137814 0l-182.38577813 113.32266667zM554.43911147 772.3008l182.3744 113.32266667c2.79893333 1.72942187 6.09848853 2.26417813 9.22737706 1.50186666 6.8380448-1.6611552 11.264-8.9884448 9.5232-16.45226666l-49.5843552-211.456a82.28408853 82.28408853 0 0 1 25.89582187-80.78222187L894.1795552 437.0204448c2.65102187-2.30968853 4.3235552-5.66613333 4.61937813-9.32977813 0.60302187-7.61173333-4.7900448-14.0515552-11.70773333-14.60906667l-213.02613333-17.37386667a81.05528853 81.05528853 0 0 1-68.33493334-50.31253333l-82.06791146-200.704a13.1299552 13.1299552 0 0 0-6.97457707-7.1907552c-6.29191147-2.6624-13.57368853 0.39822187-16.34986667 7.1907552l-82.0792896 200.704a81.05528853 81.05528853 0 0 1-68.33493333 50.31253333l-213.0147552 17.37386667a12.45866667 12.45866667 0 0 0-8.51057813 4.46008853 14.1084448 14.1084448 0 0 0 1.42222293 19.47875627l162.304 141.42577707a82.28408853 82.28408853 0 0 1 25.89582187 80.78222293l-49.5843552 211.44462187a14.22222187 14.22222187 0 0 0 1.61564373 10.53582186c3.72053333 6.17813333 11.2867552 8.03271147 17.13493333 4.4032l182.38577814-113.31128853a80.31573333 80.31573333 0 0 1 84.8668448 0z" fill="#515151" ></path></symbol><symbol id="ai-icon-delete" viewBox="0 0 1024 1024"><path d="M832 224v704H192v-704h640z m-64 64H256v576h512v-576z" fill="#515151" ></path><path d="M64 224h896v64H64zM320 96h384v64H320zM384 416h64v320H384zM576 416h64v320H576z" fill="#515151" ></path></symbol><symbol id="ai-icon-copy" viewBox="0 0 1024 1024"><path d="M667.25 250.25h-471.75c-57.75 0-105 47.25-105 105v471.75c0 57.75 47.25 105 105 105h471.75c57.75 0 105-47.25 105-105V355.25c-0.75-58.5-47.25-105-105-105z m52.5 576c0 29.25-23.25 52.5-52.5 52.5h-471.75c-29.25 0-52.5-23.25-52.5-52.5v-471.75c0-29.25 23.25-52.5 52.5-52.5h471.75c29.25 0 52.5 23.25 52.5 52.5v471.75z" fill="#515151" ></path><path d="M248 437h366.75v52.5h-366.75zM248 564.5h366.75v52.5h-366.75zM248 691.25h209.25v52.5h-209.25z" fill="#515151" ></path><path d="M824 92.75h-471.75c-57.75 0-105 47.25-105 105h52.5c0-29.25 23.25-52.5 52.5-52.5h471.75c29.25 0 52.5 23.25 52.5 52.5v471.75c0 29.25-23.25 52.5-52.5 52.5v52.5c57.75 0 105-47.25 105-105V197.75c0-58.5-47.25-105-105-105z" fill="#515151" ></path></symbol></svg>',(t=>{var e=(r=(r=document.getElementsByTagName("script"))[r.length-1]).getAttribute("data-injectcss"),r=r.getAttribute("data-disable-injectsvg");if(!r){var n,i,a,o,s,l=function(h,f){f.parentNode.insertBefore(h,f)};if(e&&!t.__iconfont__svg__cssinject__){t.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch(h){console&&console.log(h)}}n=function(){var h,f=document.createElement("div");f.innerHTML=t._iconfont_svg_string_4730060,(f=f.getElementsByTagName("svg")[0])&&(f.setAttribute("aria-hidden","true"),f.style.position="absolute",f.style.width=0,f.style.height=0,f.style.overflow="hidden",f=f,(h=document.body).firstChild?l(f,h.firstChild):h.appendChild(f))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(n,0):(i=function(){document.removeEventListener("DOMContentLoaded",i,!1),n()},document.addEventListener("DOMContentLoaded",i,!1)):document.attachEvent&&(a=n,o=t.document,s=!1,d(),o.onreadystatechange=function(){o.readyState=="complete"&&(o.onreadystatechange=null,u())})}function u(){s||(s=!0,a())}function d(){try{o.documentElement.doScroll("left")}catch{return void setTimeout(d,50)}u()}})(window);const sEr=[ufe,rme,nme,ime,fZe,yZe,CH,_Ze,Utt,Rte,gF],ztt=(t,e={})=>{sEr.forEach(r=>{t.component(r.name,r)})};typeof window<"u"&&window.Vue&&ztt(window.Vue);const lEr={install:ztt};var uEr="\0",k8="\0",Gtt="";class Oc{constructor(e={}){this._isDirected=Object.prototype.hasOwnProperty.call(e,"directed")?e.directed:!0,this._isMultigraph=Object.prototype.hasOwnProperty.call(e,"multigraph")?e.multigraph:!1,this._isCompound=Object.prototype.hasOwnProperty.call(e,"compound")?e.compound:!1,this._label=void 0,this._defaultNodeLabelFn=hv(void 0),this._defaultEdgeLabelFn=hv(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[k8]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return p2(e)||(e=hv(e)),this._defaultNodeLabelFn=e,this}nodeCount(){return this._nodeCount}nodes(){return is(this._nodes)}sources(){var e=this;return io(this.nodes(),function(r){return xi(e._in[r])})}sinks(){var e=this;return io(this.nodes(),function(r){return xi(e._out[r])})}setNodes(e,r){var n=arguments,i=this;return lt(e,function(a){n.length>1?i.setNode(a,r):i.setNode(a)}),this}setNode(e,r){return Object.prototype.hasOwnProperty.call(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=r),this):(this._nodes[e]=arguments.length>1?r:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=k8,this._children[e]={},this._children[k8][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return Object.prototype.hasOwnProperty.call(this._nodes,e)}removeNode(e){if(Object.prototype.hasOwnProperty.call(this._nodes,e)){var r=n=>this.removeEdge(this._edgeObjs[n]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],lt(this.children(e),n=>{this.setParent(n)}),delete this._children[e]),lt(is(this._in[e]),r),delete this._in[e],delete this._preds[e],lt(is(this._out[e]),r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,r){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(Ni(r))r=k8;else{r+="";for(var n=r;!Ni(n);n=this.parent(n))if(n===e)throw new Error("Setting "+r+" as parent of "+e+" would create a cycle");this.setNode(r)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=r,this._children[r][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var r=this._parent[e];if(r!==k8)return r}}children(e){if(Ni(e)&&(e=k8),this._isCompound){var r=this._children[e];if(r)return is(r)}else{if(e===k8)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var r=this._preds[e];if(r)return is(r)}successors(e){var r=this._sucs[e];if(r)return is(r)}neighbors(e){var r=this.predecessors(e);if(r)return qvt(r,this.successors(e))}isLeaf(e){var r;return this.isDirected()?r=this.successors(e):r=this.neighbors(e),r.length===0}filterNodes(e){var r=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});r.setGraph(this.graph());var n=this;lt(this._nodes,function(o,s){e(s)&&r.setNode(s,o)}),lt(this._edgeObjs,function(o){r.hasNode(o.v)&&r.hasNode(o.w)&&r.setEdge(o,n.edge(o))});var i={};function a(o){var s=n.parent(o);return s===void 0||r.hasNode(s)?(i[o]=s,s):s in i?i[s]:a(s)}return this._isCompound&<(r.nodes(),function(o){r.setParent(o,a(o))}),r}setDefaultEdgeLabel(e){return p2(e)||(e=hv(e)),this._defaultEdgeLabelFn=e,this}edgeCount(){return this._edgeCount}edges(){return Ji(this._edgeObjs)}setPath(e,r){var n=this,i=arguments;return Vo(e,function(a,o){return i.length>1?n.setEdge(a,o,r):n.setEdge(a,o),o}),this}setEdge(){var e,r,n,i,a=!1,o=arguments[0];typeof o=="object"&&o!==null&&"v"in o?(e=o.v,r=o.w,n=o.name,arguments.length===2&&(i=arguments[1],a=!0)):(e=o,r=arguments[1],n=arguments[3],arguments.length>2&&(i=arguments[2],a=!0)),e=""+e,r=""+r,Ni(n)||(n=""+n);var s=eA(this._isDirected,e,r,n);if(Object.prototype.hasOwnProperty.call(this._edgeLabels,s))return a&&(this._edgeLabels[s]=i),this;if(!Ni(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(r),this._edgeLabels[s]=a?i:this._defaultEdgeLabelFn(e,r,n);var l=cEr(this._isDirected,e,r,n);return e=l.v,r=l.w,Object.freeze(l),this._edgeObjs[s]=l,qtt(this._preds[r],e),qtt(this._sucs[e],r),this._in[r][s]=l,this._out[e][s]=l,this._edgeCount++,this}edge(e,r,n){var i=arguments.length===1?Kue(this._isDirected,arguments[0]):eA(this._isDirected,e,r,n);return this._edgeLabels[i]}hasEdge(e,r,n){var i=arguments.length===1?Kue(this._isDirected,arguments[0]):eA(this._isDirected,e,r,n);return Object.prototype.hasOwnProperty.call(this._edgeLabels,i)}removeEdge(e,r,n){var i=arguments.length===1?Kue(this._isDirected,arguments[0]):eA(this._isDirected,e,r,n),a=this._edgeObjs[i];return a&&(e=a.v,r=a.w,delete this._edgeLabels[i],delete this._edgeObjs[i],Wtt(this._preds[r],e),Wtt(this._sucs[e],r),delete this._in[r][i],delete this._out[e][i],this._edgeCount--),this}inEdges(e,r){var n=this._in[e];if(n){var i=Ji(n);return r?io(i,function(a){return a.v===r}):i}}outEdges(e,r){var n=this._out[e];if(n){var i=Ji(n);return r?io(i,function(a){return a.w===r}):i}}nodeEdges(e,r){var n=this.inEdges(e,r);if(n)return n.concat(this.outEdges(e,r))}}Oc.prototype._nodeCount=0,Oc.prototype._edgeCount=0;function qtt(t,e){t[e]?t[e]++:t[e]=1}function Wtt(t,e){--t[e]||delete t[e]}function eA(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var o=i;i=a,a=o}return i+Gtt+a+Gtt+(Ni(n)?uEr:n)}function cEr(t,e,r,n){var i=""+e,a=""+r;if(!t&&i>a){var o=i;i=a,a=o}var s={v:i,w:a};return n&&(s.name=n),s}function Kue(t,e){return eA(t,e.v,e.w,e.name)}class dEr{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,r=e._prev;if(r!==e)return Ytt(r),r}enqueue(e){var r=this._sentinel;e._prev&&e._next&&Ytt(e),e._next=r._next,r._next._prev=e,r._next=e,e._prev=r}toString(){for(var e=[],r=this._sentinel,n=r._prev;n!==r;)e.push(JSON.stringify(n,hEr)),n=n._prev;return"["+e.join(", ")+"]"}}function Ytt(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function hEr(t,e){if(t!=="_next"&&t!=="_prev")return e}var fEr=hv(1);function pEr(t,e){if(t.nodeCount()<=1)return[];var r=mEr(t,e||fEr),n=gEr(r.graph,r.buckets,r.zeroIdx);return ks(or(n,function(i){return t.outEdges(i.v,i.w)}))}function gEr(t,e,r){for(var n=[],i=e[e.length-1],a=e[0],o;t.nodeCount();){for(;o=a.dequeue();)Zue(t,e,r,o);for(;o=i.dequeue();)Zue(t,e,r,o);if(t.nodeCount()){for(var s=e.length-2;s>0;--s)if(o=e[s].dequeue(),o){n=n.concat(Zue(t,e,r,o,!0));break}}}return n}function Zue(t,e,r,n,i){var a=i?[]:void 0;return lt(t.inEdges(n.v),function(o){var s=t.edge(o),l=t.node(o.v);i&&a.push({v:o.v,w:o.w}),l.out-=s,Jue(e,r,l)}),lt(t.outEdges(n.v),function(o){var s=t.edge(o),l=o.w,u=t.node(l);u.in-=s,Jue(e,r,u)}),t.removeNode(n.v),a}function mEr(t,e){var r=new Oc,n=0,i=0;lt(t.nodes(),function(s){r.setNode(s,{v:s,in:0,out:0})}),lt(t.edges(),function(s){var l=r.edge(s.v,s.w)||0,u=e(s),d=l+u;r.setEdge(s.v,s.w,d),i=Math.max(i,r.node(s.v).out+=u),n=Math.max(n,r.node(s.w).in+=u)});var a=mv(i+n+3).map(function(){return new dEr}),o=n+1;return lt(r.nodes(),function(s){Jue(a,o,r.node(s))}),{graph:r,buckets:a,zeroIdx:o}}function Jue(t,e,r){r.out?r.in?t[r.out-r.in+e].enqueue(r):t[t.length-1].enqueue(r):t[0].enqueue(r)}function TEr(t){var e=t.graph().acyclicer==="greedy"?pEr(t,r(t)):vEr(t);lt(e,function(n){var i=t.edge(n);t.removeEdge(n),i.forwardName=n.name,i.reversed=!0,t.setEdge(n.w,n.v,i,lq("rev"))});function r(n){return function(i){return n.edge(i).weight}}}function vEr(t){var e=[],r={},n={};function i(a){Object.prototype.hasOwnProperty.call(n,a)||(n[a]=!0,r[a]=!0,lt(t.outEdges(a),function(o){Object.prototype.hasOwnProperty.call(r,o.w)?e.push(o):i(o.w)}),delete r[a])}return lt(t.nodes(),i),e}function yEr(t){lt(t.edges(),function(e){var r=t.edge(e);if(r.reversed){t.removeEdge(e);var n=r.forwardName;delete r.reversed,delete r.forwardName,t.setEdge(e.w,e.v,r,n)}})}function d_(t,e,r,n){var i;do i=lq(n);while(t.hasNode(i));return r.dummy=e,t.setNode(i,r),i}function _Er(t){var e=new Oc().setGraph(t.graph());return lt(t.nodes(),function(r){e.setNode(r,t.node(r))}),lt(t.edges(),function(r){var n=e.edge(r.v,r.w)||{weight:0,minlen:1},i=t.edge(r);e.setEdge(r.v,r.w,{weight:n.weight+i.weight,minlen:Math.max(n.minlen,i.minlen)})}),e}function jtt(t){var e=new Oc({multigraph:t.isMultigraph()}).setGraph(t.graph());return lt(t.nodes(),function(r){t.children(r).length||e.setNode(r,t.node(r))}),lt(t.edges(),function(r){e.setEdge(r,t.edge(r))}),e}function Xtt(t,e){var r=t.x,n=t.y,i=e.x-r,a=e.y-n,o=t.width/2,s=t.height/2;if(!i&&!a)throw new Error("Not possible to find intersection inside of the rectangle");var l,u;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),l=s*i/a,u=s):(i<0&&(o=-o),l=o,u=o*a/i),{x:r+l,y:n+u}}function vF(t){var e=or(mv(Ztt(t)+1),function(){return[]});return lt(t.nodes(),function(r){var n=t.node(r),i=n.rank;Ni(i)||(e[i][n.order]=r)}),e}function bEr(t){var e=gv(or(t.nodes(),function(r){return t.node(r).rank}));lt(t.nodes(),function(r){var n=t.node(r);on(n,"rank")&&(n.rank-=e)})}function QEr(t){var e=gv(or(t.nodes(),function(a){return t.node(a).rank})),r=[];lt(t.nodes(),function(a){var o=t.node(a).rank-e;r[o]||(r[o]=[]),r[o].push(a)});var n=0,i=t.graph().nodeRankFactor;lt(r,function(a,o){Ni(a)&&o%i!==0?--n:n&<(a,function(s){t.node(s).rank+=n})})}function Ktt(t,e,r,n){var i={width:0,height:0};return arguments.length>=4&&(i.rank=r,i.order=n),d_(t,"border",i,e)}function Ztt(t){return _g(or(t.nodes(),function(e){var r=t.node(e).rank;if(!Ni(r))return r}))}function xEr(t,e){var r={lhs:[],rhs:[]};return lt(t,function(n){e(n)?r.lhs.push(n):r.rhs.push(n)}),r}function EEr(t,e){return e()}function SEr(t){function e(r){var n=t.children(r),i=t.node(r);if(n.length&<(n,e),Object.prototype.hasOwnProperty.call(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;a<o;++a)Jtt(t,"borderLeft","_bl",r,i,a),Jtt(t,"borderRight","_br",r,i,a)}}lt(t.children(),e)}function Jtt(t,e,r,n,i,a){var o={width:0,height:0,rank:a,borderType:e},s=i[e][a-1],l=d_(t,"border",o,r);i[e][a]=l,t.setParent(l,n),s&&t.setEdge(s,l,{weight:1})}function CEr(t){var e=t.graph().rankdir.toLowerCase();(e==="lr"||e==="rl")&&ert(t)}function LEr(t){var e=t.graph().rankdir.toLowerCase();(e==="bt"||e==="rl")&&wEr(t),(e==="lr"||e==="rl")&&(AEr(t),ert(t))}function ert(t){lt(t.nodes(),function(e){trt(t.node(e))}),lt(t.edges(),function(e){trt(t.edge(e))})}function trt(t){var e=t.width;t.width=t.height,t.height=e}function wEr(t){lt(t.nodes(),function(e){ece(t.node(e))}),lt(t.edges(),function(e){var r=t.edge(e);lt(r.points,ece),Object.prototype.hasOwnProperty.call(r,"y")&&ece(r)})}function ece(t){t.y=-t.y}function AEr(t){lt(t.nodes(),function(e){tce(t.node(e))}),lt(t.edges(),function(e){var r=t.edge(e);lt(r.points,tce),Object.prototype.hasOwnProperty.call(r,"x")&&tce(r)})}function tce(t){var e=t.x;t.x=t.y,t.y=e}function OEr(t){t.graph().dummyChains=[],lt(t.edges(),function(e){MEr(t,e)})}function MEr(t,e){var r=e.v,n=t.node(r).rank,i=e.w,a=t.node(i).rank,o=e.name,s=t.edge(e),l=s.labelRank;if(a!==n+1){t.removeEdge(e);var u=void 0,d,h;for(h=0,++n;n<a;++h,++n)s.points=[],u={width:0,height:0,edgeLabel:s,edgeObj:e,rank:n},d=d_(t,"edge",u,"_d"),n===l&&(u.width=s.width,u.height=s.height,u.dummy="edge-label",u.labelpos=s.labelpos),t.setEdge(r,d,{weight:s.weight},o),h===0&&t.graph().dummyChains.push(d),r=d;t.setEdge(r,i,{weight:s.weight},o)}}function REr(t){lt(t.graph().dummyChains,function(e){var r=t.node(e),n=r.edgeLabel,i;for(t.setEdge(r.edgeObj,n);r.dummy;)i=t.successors(e)[0],t.removeNode(e),n.points.push({x:r.x,y:r.y}),r.dummy==="edge-label"&&(n.x=r.x,n.y=r.y,n.width=r.width,n.height=r.height),e=i,r=t.node(e)})}function rce(t){var e={};function r(n){var i=t.node(n);if(Object.prototype.hasOwnProperty.call(e,n))return i.rank;e[n]=!0;var a=gv(or(t.outEdges(n),function(o){return r(o.w)-t.edge(o).minlen}));return(a===Number.POSITIVE_INFINITY||a===void 0||a===null)&&(a=0),i.rank=a}lt(t.sources(),r)}function tA(t,e){return t.node(e.w).rank-t.node(e.v).rank-t.edge(e).minlen}function rrt(t){var e=new Oc({directed:!1}),r=t.nodes()[0],n=t.nodeCount();e.setNode(r,{});for(var i,a;DEr(e,t)<n;)i=NEr(e,t),a=e.hasNode(i.v)?tA(t,i):-tA(t,i),IEr(e,t,a);return e}function DEr(t,e){function r(n){lt(e.nodeEdges(n),function(i){var a=i.v,o=n===a?i.w:a;!t.hasNode(o)&&!tA(e,i)&&(t.setNode(o,{}),t.setEdge(n,o,{}),r(o))})}return lt(t.nodes(),r),t.nodeCount()}function NEr(t,e){return oq(e.edges(),function(r){if(t.hasNode(r.v)!==t.hasNode(r.w))return tA(e,r)})}function IEr(t,e,r){lt(t.nodes(),function(n){e.node(n).rank+=r})}function kEr(){}kEr.prototype=new Error;function nrt(t,e,r){ai(e)||(e=[e]);var n=(t.isDirected()?t.successors:t.neighbors).bind(t),i=[],a={};return lt(e,function(o){if(!t.hasNode(o))throw new Error("Graph does not have node: "+o);irt(t,o,r==="post",a,n,i)}),i}function irt(t,e,r,n,i,a){Object.prototype.hasOwnProperty.call(n,e)||(n[e]=!0,r||a.push(e),lt(i(e),function(o){irt(t,o,r,n,i,a)}),r&&a.push(e))}function PEr(t,e){return nrt(t,e,"post")}function BEr(t,e){return nrt(t,e,"pre")}P8.initLowLimValues=ice,P8.initCutValues=nce,P8.calcCutValue=art,P8.leaveEdge=srt,P8.enterEdge=lrt,P8.exchangeEdges=urt;function P8(t){t=_Er(t),rce(t);var e=rrt(t);ice(e),nce(e,t);for(var r,n;r=srt(e);)n=lrt(e,t,r),urt(e,t,r,n)}function nce(t,e){var r=PEr(t,t.nodes());r=r.slice(0,r.length-1),lt(r,function(n){HEr(t,e,n)})}function HEr(t,e,r){var n=t.node(r),i=n.parent;t.edge(r,i).cutvalue=art(t,e,r)}function art(t,e,r){var n=t.node(r),i=n.parent,a=!0,o=e.edge(r,i),s=0;return o||(a=!1,o=e.edge(i,r)),s=o.weight,lt(e.nodeEdges(r),function(l){var u=l.v===r,d=u?l.w:l.v;if(d!==i){var h=u===a,f=e.edge(l).weight;if(s+=h?f:-f,VEr(t,r,d)){var p=t.edge(r,d).cutvalue;s+=h?-p:p}}}),s}function ice(t,e){arguments.length<2&&(e=t.nodes()[0]),ort(t,{},1,e)}function ort(t,e,r,n,i){var a=r,o=t.node(n);return e[n]=!0,lt(t.neighbors(n),function(s){Object.prototype.hasOwnProperty.call(e,s)||(r=ort(t,e,r,s,n))}),o.low=a,o.lim=r++,i?o.parent=i:delete o.parent,r}function srt(t){return Ph(t.edges(),function(e){return t.edge(e).cutvalue<0})}function lrt(t,e,r){var n=r.v,i=r.w;e.hasEdge(n,i)||(n=r.w,i=r.v);var a=t.node(n),o=t.node(i),s=a,l=!1;a.lim>o.lim&&(s=o,l=!0);var u=io(e.edges(),function(d){return l===crt(t,t.node(d.v),s)&&l!==crt(t,t.node(d.w),s)});return oq(u,function(d){return tA(e,d)})}function urt(t,e,r,n){var i=r.v,a=r.w;t.removeEdge(i,a),t.setEdge(n.v,n.w,{}),ice(t),nce(t,e),FEr(t,e)}function FEr(t,e){var r=Ph(t.nodes(),function(i){return!e.node(i).parent}),n=BEr(t,r);n=n.slice(1),lt(n,function(i){var a=t.node(i).parent,o=e.edge(i,a),s=!1;o||(o=e.edge(a,i),s=!0),e.node(i).rank=e.node(a).rank+(s?o.minlen:-o.minlen)})}function VEr(t,e,r){return t.hasEdge(e,r)}function crt(t,e,r){return r.low<=e.lim&&e.lim<=r.lim}function $Er(t){switch(t.graph().ranker){case"network-simplex":drt(t);break;case"tight-tree":zEr(t);break;case"longest-path":UEr(t);break;default:drt(t)}}var UEr=rce;function zEr(t){rce(t),rrt(t)}function drt(t){P8(t)}function GEr(t){var e=d_(t,"root",{},"_root"),r=qEr(t),n=_g(Ji(r))-1,i=2*n+1;t.graph().nestingRoot=e,lt(t.edges(),function(o){t.edge(o).minlen*=i});var a=WEr(t)+1;lt(t.children(),function(o){hrt(t,e,i,a,n,r,o)}),t.graph().nodeRankFactor=i}function hrt(t,e,r,n,i,a,o){var s=t.children(o);if(!s.length){o!==e&&t.setEdge(e,o,{weight:0,minlen:r});return}var l=Ktt(t,"_bt"),u=Ktt(t,"_bb"),d=t.node(o);t.setParent(l,o),d.borderTop=l,t.setParent(u,o),d.borderBottom=u,lt(s,function(h){hrt(t,e,r,n,i,a,h);var f=t.node(h),p=f.borderTop?f.borderTop:h,g=f.borderBottom?f.borderBottom:h,m=f.borderTop?n:2*n,T=p!==g?1:i-a[o]+1;t.setEdge(l,p,{weight:m,minlen:T,nestingEdge:!0}),t.setEdge(g,u,{weight:m,minlen:T,nestingEdge:!0})}),t.parent(o)||t.setEdge(e,l,{weight:0,minlen:i+a[o]})}function qEr(t){var e={};function r(n,i){var a=t.children(n);a&&a.length&<(a,function(o){r(o,i+1)}),e[n]=i}return lt(t.children(),function(n){r(n,1)}),e}function WEr(t){return Vo(t.edges(),function(e,r){return e+t.edge(r).weight},0)}function YEr(t){var e=t.graph();t.removeNode(e.nestingRoot),delete e.nestingRoot,lt(t.edges(),function(r){var n=t.edge(r);n.nestingEdge&&t.removeEdge(r)})}function jEr(t,e,r){var n={},i;lt(r,function(a){for(var o=t.parent(a),s,l;o;){if(s=t.parent(o),s?(l=n[s],n[s]=o):(l=i,i=o),l&&l!==o){e.setEdge(l,o);return}o=s}})}function XEr(t,e,r){var n=KEr(t),i=new Oc({compound:!0}).setGraph({root:n}).setDefaultNodeLabel(function(a){return t.node(a)});return lt(t.nodes(),function(a){var o=t.node(a),s=t.parent(a);(o.rank===e||o.minRank<=e&&e<=o.maxRank)&&(i.setNode(a),i.setParent(a,s||n),lt(t[r](a),function(l){var u=l.v===a?l.w:l.v,d=i.edge(u,a),h=Ni(d)?0:d.weight;i.setEdge(u,a,{weight:t.edge(l).weight+h})}),Object.prototype.hasOwnProperty.call(o,"minRank")&&i.setNode(a,{borderLeft:o.borderLeft[e],borderRight:o.borderRight[e]}))}),i}function KEr(t){for(var e;t.hasNode(e=lq("_root")););return e}function ZEr(t,e){for(var r=0,n=1;n<e.length;++n)r+=JEr(t,e[n-1],e[n]);return r}function JEr(t,e,r){for(var n=Xvt(r,or(r,function(u,d){return d})),i=ks(or(e,function(u){return JQ(or(t.outEdges(u),function(d){return{pos:n[d.w],weight:t.edge(d).weight}}),"pos")})),a=1;a<r.length;)a<<=1;var o=2*a-1;a-=1;var s=or(new Array(o),function(){return 0}),l=0;return lt(i.forEach(function(u){var d=u.pos+a;s[d]+=u.weight;for(var h=0;d>0;)d%2&&(h+=s[d+1]),d=d-1>>1,s[d]+=u.weight;l+=u.weight*h})),l}function eSr(t){var e={},r=io(t.nodes(),function(s){return!t.children(s).length}),n=_g(or(r,function(s){return t.node(s).rank})),i=or(mv(n+1),function(){return[]});function a(s){if(!on(e,s)){e[s]=!0;var l=t.node(s);i[l.rank].push(s),lt(t.successors(s),a)}}var o=JQ(r,function(s){return t.node(s).rank});return lt(o,a),i}function tSr(t,e){return or(e,function(r){var n=t.inEdges(r);if(n.length){var i=Vo(n,function(a,o){var s=t.edge(o),l=t.node(o.v);return{sum:a.sum+s.weight*l.order,weight:a.weight+s.weight}},{sum:0,weight:0});return{v:r,barycenter:i.sum/i.weight,weight:i.weight}}else return{v:r}})}function rSr(t,e){var r={};lt(t,function(i,a){var o=r[i.v]={indegree:0,in:[],out:[],vs:[i.v],i:a};Ni(i.barycenter)||(o.barycenter=i.barycenter,o.weight=i.weight)}),lt(e.edges(),function(i){var a=r[i.v],o=r[i.w];!Ni(a)&&!Ni(o)&&(o.indegree++,a.out.push(r[i.w]))});var n=io(r,function(i){return!i.indegree});return nSr(n)}function nSr(t){var e=[];function r(a){return function(o){o.merged||(Ni(o.barycenter)||Ni(a.barycenter)||o.barycenter>=a.barycenter)&&iSr(a,o)}}function n(a){return function(o){o.in.push(a),--o.indegree===0&&t.push(o)}}for(;t.length;){var i=t.pop();e.push(i),lt(i.in.reverse(),r(i)),lt(i.out,n(i))}return or(io(e,function(a){return!a.merged}),function(a){return vR(a,["vs","i","barycenter","weight"])})}function iSr(t,e){var r=0,n=0;t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.vs=e.vs.concat(t.vs),t.barycenter=r/n,t.weight=n,t.i=Math.min(e.i,t.i),e.merged=!0}function aSr(t,e){var r=xEr(t,function(d){return Object.prototype.hasOwnProperty.call(d,"barycenter")}),n=r.lhs,i=JQ(r.rhs,function(d){return-d.i}),a=[],o=0,s=0,l=0;n.sort(oSr(!!e)),l=frt(a,i,l),lt(n,function(d){l+=d.vs.length,a.push(d.vs),o+=d.barycenter*d.weight,s+=d.weight,l=frt(a,i,l)});var u={vs:ks(a)};return s&&(u.barycenter=o/s,u.weight=s),u}function frt(t,e,r){for(var n;e.length&&(n=a3(e)).i<=r;)e.pop(),t.push(n.vs),r++;return r}function oSr(t){return function(e,r){return e.barycenter<r.barycenter?-1:e.barycenter>r.barycenter?1:t?r.i-e.i:e.i-r.i}}function prt(t,e,r,n){var i=t.children(e),a=t.node(e),o=a?a.borderLeft:void 0,s=a?a.borderRight:void 0,l={};o&&(i=io(i,function(g){return g!==o&&g!==s}));var u=tSr(t,i);lt(u,function(g){if(t.children(g.v).length){var m=prt(t,g.v,r,n);l[g.v]=m,Object.prototype.hasOwnProperty.call(m,"barycenter")&&lSr(g,m)}});var d=rSr(u,r);sSr(d,l);var h=aSr(d,n);if(o&&(h.vs=ks([o,h.vs,s]),t.predecessors(o).length)){var f=t.node(t.predecessors(o)[0]),p=t.node(t.predecessors(s)[0]);Object.prototype.hasOwnProperty.call(h,"barycenter")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+f.order+p.order)/(h.weight+2),h.weight+=2}return h}function sSr(t,e){lt(t,function(r){r.vs=ks(r.vs.map(function(n){return e[n]?e[n].vs:n}))})}function lSr(t,e){Ni(t.barycenter)?(t.barycenter=e.barycenter,t.weight=e.weight):(t.barycenter=(t.barycenter*t.weight+e.barycenter*e.weight)/(t.weight+e.weight),t.weight+=e.weight)}function uSr(t){var e=Ztt(t),r=grt(t,mv(1,e+1),"inEdges"),n=grt(t,mv(e-1,-1,-1),"outEdges"),i=eSr(t);mrt(t,i);for(var a=Number.POSITIVE_INFINITY,o,s=0,l=0;l<4;++s,++l){cSr(s%2?r:n,s%4>=2),i=vF(t);var u=ZEr(t,i);u<a&&(l=0,o=ITt(i),a=u)}mrt(t,o)}function grt(t,e,r){return or(e,function(n){return XEr(t,n,r)})}function cSr(t,e){var r=new Oc;lt(t,function(n){var i=n.graph().root,a=prt(n,i,r,e);lt(a.vs,function(o,s){n.node(o).order=s}),jEr(n,r,a.vs)})}function mrt(t,e){lt(e,function(r){lt(r,function(n,i){t.node(n).order=i})})}function dSr(t){var e=fSr(t);lt(t.graph().dummyChains,function(r){for(var n=t.node(r),i=n.edgeObj,a=hSr(t,e,i.v,i.w),o=a.path,s=a.lca,l=0,u=o[l],d=!0;r!==i.w;){if(n=t.node(r),d){for(;(u=o[l])!==s&&t.node(u).maxRank<n.rank;)l++;u===s&&(d=!1)}if(!d){for(;l<o.length-1&&t.node(u=o[l+1]).minRank<=n.rank;)l++;u=o[l]}t.setParent(r,u),r=t.successors(r)[0]}})}function hSr(t,e,r,n){var i=[],a=[],o=Math.min(e[r].low,e[n].low),s=Math.max(e[r].lim,e[n].lim),l,u;l=r;do l=t.parent(l),i.push(l);while(l&&(e[l].low>o||s>e[l].lim));for(u=l,l=n;(l=t.parent(l))!==u;)a.push(l);return{path:i.concat(a.reverse()),lca:u}}function fSr(t){var e={},r=0;function n(i){var a=r;lt(t.children(i),n),e[i]={low:a,lim:r++}}return lt(t.children(),n),e}function pSr(t,e){var r={};function n(i,a){var o=0,s=0,l=i.length,u=a3(a);return lt(a,function(d,h){var f=mSr(t,d),p=f?t.node(f).order:l;(f||d===u)&&(lt(a.slice(s,h+1),function(g){lt(t.predecessors(g),function(m){var T=t.node(m),v=T.order;(v<o||p<v)&&!(T.dummy&&t.node(g).dummy)&&Trt(r,m,g)})}),s=h+1,o=p)}),a}return Vo(e,n),r}function gSr(t,e){var r={};function n(a,o,s,l,u){var d;lt(mv(o,s),function(h){d=a[h],t.node(d).dummy&<(t.predecessors(d),function(f){var p=t.node(f);p.dummy&&(p.order<l||p.order>u)&&Trt(r,f,d)})})}function i(a,o){var s=-1,l,u=0;return lt(o,function(d,h){if(t.node(d).dummy==="border"){var f=t.predecessors(d);f.length&&(l=t.node(f[0]).order,n(o,u,h,s,l),u=h,s=l)}n(o,u,o.length,l,a.length)}),o}return Vo(e,i),r}function mSr(t,e){if(t.node(e).dummy)return Ph(t.predecessors(e),function(r){return t.node(r).dummy})}function Trt(t,e,r){if(e>r){var n=e;e=r,r=n}var i=t[e];i||(t[e]=i={}),i[r]=!0}function TSr(t,e,r){if(e>r){var n=e;e=r,r=n}return!!t[e]&&Object.prototype.hasOwnProperty.call(t[e],r)}function vSr(t,e,r,n){var i={},a={},o={};return lt(e,function(s){lt(s,function(l,u){i[l]=l,a[l]=l,o[l]=u})}),lt(e,function(s){var l=-1;lt(s,function(u){var d=n(u);if(d.length){d=JQ(d,function(m){return o[m]});for(var h=(d.length-1)/2,f=Math.floor(h),p=Math.ceil(h);f<=p;++f){var g=d[f];a[u]===u&&l<o[g]&&!TSr(r,u,g)&&(a[g]=u,a[u]=i[u]=i[g],l=o[g])}}})}),{root:i,align:a}}function ySr(t,e,r,n,i){var a={},o=_Sr(t,e,r,i),s=i?"borderLeft":"borderRight";function l(h,f){for(var p=o.nodes(),g=p.pop(),m={};g;)m[g]?h(g):(m[g]=!0,p.push(g),p=p.concat(f(g))),g=p.pop()}function u(h){a[h]=o.inEdges(h).reduce(function(f,p){return Math.max(f,a[p.v]+o.edge(p))},0)}function d(h){var f=o.outEdges(h).reduce(function(g,m){return Math.min(g,a[m.w]-o.edge(m))},Number.POSITIVE_INFINITY),p=t.node(h);f!==Number.POSITIVE_INFINITY&&p.borderType!==s&&(a[h]=Math.max(a[h],f))}return l(u,o.predecessors.bind(o)),l(d,o.successors.bind(o)),lt(n,function(h){a[h]=a[r[h]]}),a}function _Sr(t,e,r,n){var i=new Oc,a=t.graph(),o=SSr(a.nodesep,a.edgesep,n);return lt(e,function(s){var l;lt(s,function(u){var d=r[u];if(i.setNode(d),l){var h=r[l],f=i.edge(h,d);i.setEdge(h,d,Math.max(o(t,u,l),f||0))}l=u})}),i}function bSr(t,e){return oq(Ji(e),function(r){var n=Number.NEGATIVE_INFINITY,i=Number.POSITIVE_INFINITY;return uvt(r,function(a,o){var s=CSr(t,o)/2;n=Math.max(a+s,n),i=Math.min(a-s,i)}),n-i})}function QSr(t,e){var r=Ji(e),n=gv(r),i=_g(r);lt(["u","d"],function(a){lt(["l","r"],function(o){var s=a+o,l=t[s],u;if(l!==e){var d=Ji(l);u=o==="l"?n-gv(d):i-_g(d),u&&(t[s]=mR(l,function(h){return h+u}))}})})}function xSr(t,e){return mR(t.ul,function(r,n){if(e)return t[e.toLowerCase()][n];var i=JQ(or(t,n));return(i[1]+i[2])/2})}function ESr(t){var e=vF(t),r=TR(pSr(t,e),gSr(t,e)),n={},i;lt(["u","d"],function(o){i=o==="u"?e:Ji(e).reverse(),lt(["l","r"],function(s){s==="r"&&(i=or(i,function(h){return Ji(h).reverse()}));var l=(o==="u"?t.predecessors:t.successors).bind(t),u=vSr(t,i,r,l),d=ySr(t,i,u.root,u.align,s==="r");s==="r"&&(d=mR(d,function(h){return-h})),n[o+s]=d})});var a=bSr(t,n);return QSr(n,a),xSr(n,t.graph().align)}function SSr(t,e,r){return function(n,i,a){var o=n.node(i),s=n.node(a),l=0,u;if(l+=o.width/2,Object.prototype.hasOwnProperty.call(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":u=-o.width/2;break;case"r":u=o.width/2;break}if(u&&(l+=r?u:-u),u=0,l+=(o.dummy?e:t)/2,l+=(s.dummy?e:t)/2,l+=s.width/2,Object.prototype.hasOwnProperty.call(s,"labelpos"))switch(s.labelpos.toLowerCase()){case"l":u=s.width/2;break;case"r":u=-s.width/2;break}return u&&(l+=r?u:-u),u=0,l}}function CSr(t,e){return t.node(e).width}function LSr(t){t=jtt(t),wSr(t),cvt(ESr(t),function(e,r){t.node(r).x=e})}function wSr(t){var e=vF(t),r=t.graph().ranksep,n=0;lt(e,function(i){var a=_g(or(i,function(o){return t.node(o).height}));lt(i,function(o){t.node(o).y=n+a/2}),n+=a+r})}function vrt(t,e){var r=EEr;r("layout",()=>{var n=r(" buildLayoutGraph",()=>HSr(t));r(" runLayout",()=>ASr(n,r)),r(" updateInputGraph",()=>OSr(t,n))})}function ASr(t,e){e(" makeSpaceForEdgeLabels",()=>FSr(t)),e(" removeSelfEdges",()=>jSr(t)),e(" acyclic",()=>TEr(t)),e(" nestingGraph.run",()=>GEr(t)),e(" rank",()=>$Er(jtt(t))),e(" injectEdgeLabelProxies",()=>VSr(t)),e(" removeEmptyRanks",()=>QEr(t)),e(" nestingGraph.cleanup",()=>YEr(t)),e(" normalizeRanks",()=>bEr(t)),e(" assignRankMinMax",()=>$Sr(t)),e(" removeEdgeLabelProxies",()=>USr(t)),e(" normalize.run",()=>OEr(t)),e(" parentDummyChains",()=>dSr(t)),e(" addBorderSegments",()=>SEr(t)),e(" order",()=>uSr(t)),e(" insertSelfEdges",()=>XSr(t)),e(" adjustCoordinateSystem",()=>CEr(t)),e(" position",()=>LSr(t)),e(" positionSelfEdges",()=>KSr(t)),e(" removeBorderNodes",()=>YSr(t)),e(" normalize.undo",()=>REr(t)),e(" fixupEdgeLabelCoords",()=>qSr(t)),e(" undoCoordinateSystem",()=>LEr(t)),e(" translateGraph",()=>zSr(t)),e(" assignNodeIntersects",()=>GSr(t)),e(" reversePoints",()=>WSr(t)),e(" acyclic.undo",()=>yEr(t))}function OSr(t,e){lt(t.nodes(),function(r){var n=t.node(r),i=e.node(r);n&&(n.x=i.x,n.y=i.y,e.children(r).length&&(n.width=i.width,n.height=i.height))}),lt(t.edges(),function(r){var n=t.edge(r),i=e.edge(r);n.points=i.points,Object.prototype.hasOwnProperty.call(i,"x")&&(n.x=i.x,n.y=i.y)}),t.graph().width=e.graph().width,t.graph().height=e.graph().height}var MSr=["nodesep","edgesep","ranksep","marginx","marginy"],RSr={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},DSr=["acyclicer","ranker","rankdir","align"],NSr=["width","height"],ISr={width:0,height:0},kSr=["minlen","weight","width","height","labeloffset"],PSr={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},BSr=["labelpos"];function HSr(t){var e=new Oc({multigraph:!0,compound:!0}),r=oce(t.graph());return e.setGraph(TR({},RSr,ace(r,MSr),vR(r,DSr))),lt(t.nodes(),function(n){var i=oce(t.node(n));e.setNode(n,fR(ace(i,NSr),ISr)),e.setParent(n,t.parent(n))}),lt(t.edges(),function(n){var i=oce(t.edge(n));e.setEdge(n,TR({},PSr,ace(i,kSr),vR(i,BSr)))}),e}function FSr(t){var e=t.graph();e.ranksep/=2,lt(t.edges(),function(r){var n=t.edge(r);n.minlen*=2,n.labelpos.toLowerCase()!=="c"&&(e.rankdir==="TB"||e.rankdir==="BT"?n.width+=n.labeloffset:n.height+=n.labeloffset)})}function VSr(t){lt(t.edges(),function(e){var r=t.edge(e);if(r.width&&r.height){var n=t.node(e.v),i=t.node(e.w),a={rank:(i.rank-n.rank)/2+n.rank,e};d_(t,"edge-proxy",a,"_ep")}})}function $Sr(t){var e=0;lt(t.nodes(),function(r){var n=t.node(r);n.borderTop&&(n.minRank=t.node(n.borderTop).rank,n.maxRank=t.node(n.borderBottom).rank,e=_g(e,n.maxRank))}),t.graph().maxRank=e}function USr(t){lt(t.nodes(),function(e){var r=t.node(e);r.dummy==="edge-proxy"&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}function zSr(t){var e=Number.POSITIVE_INFINITY,r=0,n=Number.POSITIVE_INFINITY,i=0,a=t.graph(),o=a.marginx||0,s=a.marginy||0;function l(u){var d=u.x,h=u.y,f=u.width,p=u.height;e=Math.min(e,d-f/2),r=Math.max(r,d+f/2),n=Math.min(n,h-p/2),i=Math.max(i,h+p/2)}lt(t.nodes(),function(u){l(t.node(u))}),lt(t.edges(),function(u){var d=t.edge(u);Object.prototype.hasOwnProperty.call(d,"x")&&l(d)}),e-=o,n-=s,lt(t.nodes(),function(u){var d=t.node(u);d.x-=e,d.y-=n}),lt(t.edges(),function(u){var d=t.edge(u);lt(d.points,function(h){h.x-=e,h.y-=n}),Object.prototype.hasOwnProperty.call(d,"x")&&(d.x-=e),Object.prototype.hasOwnProperty.call(d,"y")&&(d.y-=n)}),a.width=r-e+o,a.height=i-n+s}function GSr(t){lt(t.edges(),function(e){var r=t.edge(e),n=t.node(e.v),i=t.node(e.w),a,o;r.points?(a=r.points[0],o=r.points[r.points.length-1]):(r.points=[],a=i,o=n),r.points.unshift(Xtt(n,a)),r.points.push(Xtt(i,o))})}function qSr(t){lt(t.edges(),function(e){var r=t.edge(e);if(Object.prototype.hasOwnProperty.call(r,"x"))switch((r.labelpos==="l"||r.labelpos==="r")&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset;break}})}function WSr(t){lt(t.edges(),function(e){var r=t.edge(e);r.reversed&&r.points.reverse()})}function YSr(t){lt(t.nodes(),function(e){if(t.children(e).length){var r=t.node(e),n=t.node(r.borderTop),i=t.node(r.borderBottom),a=t.node(a3(r.borderLeft)),o=t.node(a3(r.borderRight));r.width=Math.abs(o.x-a.x),r.height=Math.abs(i.y-n.y),r.x=a.x+r.width/2,r.y=n.y+r.height/2}}),lt(t.nodes(),function(e){t.node(e).dummy==="border"&&t.removeNode(e)})}function jSr(t){lt(t.edges(),function(e){if(e.v===e.w){var r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e,label:t.edge(e)}),t.removeEdge(e)}})}function XSr(t){var e=vF(t);lt(e,function(r){var n=0;lt(r,function(i,a){var o=t.node(i);o.order=a+n,lt(o.selfEdges,function(s){d_(t,"selfedge",{width:s.label.width,height:s.label.height,rank:o.rank,order:a+ ++n,e:s.e,label:s.label},"_se")}),delete o.selfEdges})})}function KSr(t){lt(t.nodes(),function(e){var r=t.node(e);if(r.dummy==="selfedge"){var n=t.node(r.e.v),i=n.x+n.width/2,a=n.y,o=r.x-i,s=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],r.label.x=r.x,r.label.y=r.y}})}function ace(t,e){return mR(vR(t,e),Number)}function oce(t){var e={};return lt(t,function(r,n){e[n.toLowerCase()]=r}),e}function lh(t){var e={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:ZSr(t),edges:JSr(t)};return Ni(t.graph())||(e.value=ss(t.graph())),e}function ZSr(t){return or(t.nodes(),function(e){var r=t.node(e),n=t.parent(e),i={v:e};return Ni(r)||(i.value=r),Ni(n)||(i.parent=n),i})}function JSr(t){return or(t.edges(),function(e){var r=t.edge(e),n={v:e.v,w:e.w};return Ni(e.name)||(n.name=e.name),Ni(r)||(n.value=r),n})}var jn=new Map,B8=new Map,yrt=new Map,eCr=N(()=>{B8.clear(),yrt.clear(),jn.clear()},"clear"),yF=N((t,e)=>{const r=B8.get(e)||[];return Te.trace("In isDescendant",e," ",t," = ",r.includes(t)),r.includes(t)},"isDescendant"),tCr=N((t,e)=>{const r=B8.get(e)||[];return Te.info("Descendants of ",e," is ",r),Te.info("Edge is ",t),t.v===e||t.w===e?!1:r?r.includes(t.v)||yF(t.v,e)||yF(t.w,e)||r.includes(t.w):(Te.debug("Tilt, ",e,",not in descendants"),!1)},"edgeInCluster"),_rt=N((t,e,r,n)=>{Te.warn("Copying children of ",t,"root",n,"data",e.node(t),n);const i=e.children(t)||[];t!==n&&i.push(t),Te.warn("Copying (nodes) clusterId",t,"nodes",i),i.forEach(a=>{if(e.children(a).length>0)_rt(a,e,r,n);else{const o=e.node(a);Te.info("cp ",a," to ",n," with parent ",t),r.setNode(a,o),n!==e.parent(a)&&(Te.warn("Setting parent",a,e.parent(a)),r.setParent(a,e.parent(a))),t!==n&&a!==t?(Te.debug("Setting parent",a,t),r.setParent(a,t)):(Te.info("In copy ",t,"root",n,"data",e.node(t),n),Te.debug("Not Setting parent for node=",a,"cluster!==rootId",t!==n,"node!==clusterId",a!==t));const s=e.edges(a);Te.debug("Copying Edges",s),s.forEach(l=>{Te.info("Edge",l);const u=e.edge(l.v,l.w,l.name);Te.info("Edge data",u,n);try{tCr(l,n)?(Te.info("Copying as ",l.v,l.w,u,l.name),r.setEdge(l.v,l.w,u,l.name),Te.info("newGraph edges ",r.edges(),r.edge(r.edges()[0]))):Te.info("Skipping copy of edge ",l.v,"-->",l.w," rootId: ",n," clusterId:",t)}catch(d){Te.error(d)}})}Te.debug("Removing node",a),e.removeNode(a)})},"copy"),brt=N((t,e)=>{const r=e.children(t);let n=[...r];for(const i of r)yrt.set(i,t),n=[...n,...brt(i,e)];return n},"extractDescendants"),rCr=N((t,e,r)=>{const n=t.edges().filter(l=>l.v===e||l.w===e),i=t.edges().filter(l=>l.v===r||l.w===r),a=n.map(l=>({v:l.v===e?r:l.v,w:l.w===e?e:l.w})),o=i.map(l=>({v:l.v,w:l.w}));return a.filter(l=>o.some(u=>l.v===u.v&&l.w===u.w))},"findCommonEdges"),rA=N((t,e,r)=>{const n=e.children(t);if(Te.trace("Searching children of id ",t,n),n.length<1)return t;let i;for(const a of n){const o=rA(a,e,r),s=rCr(e,r,o);if(o)if(s.length>0)i=o;else return o}return i},"findNonClusterChild"),Qrt=N(t=>!jn.has(t)||!jn.get(t).externalConnections?t:jn.has(t)?jn.get(t).id:t,"getAnchorId"),nCr=N((t,e)=>{if(!t||e>10){Te.debug("Opting out, no graph ");return}else Te.debug("Opting in, graph ");t.nodes().forEach(function(r){t.children(r).length>0&&(Te.warn("Cluster identified",r," Replacement id in edges: ",rA(r,t,r)),B8.set(r,brt(r,t)),jn.set(r,{id:rA(r,t,r),clusterData:t.node(r)}))}),t.nodes().forEach(function(r){const n=t.children(r),i=t.edges();n.length>0?(Te.debug("Cluster identified",r,B8),i.forEach(a=>{const o=yF(a.v,r),s=yF(a.w,r);o^s&&(Te.warn("Edge: ",a," leaves cluster ",r),Te.warn("Descendants of XXX ",r,": ",B8.get(r)),jn.get(r).externalConnections=!0)})):Te.debug("Not a cluster ",r,B8)});for(let r of jn.keys()){const n=jn.get(r).id,i=t.parent(n);i!==r&&jn.has(i)&&!jn.get(i).externalConnections&&(jn.get(r).id=i)}t.edges().forEach(function(r){const n=t.edge(r);Te.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(r)),Te.warn("Edge "+r.v+" -> "+r.w+": "+JSON.stringify(t.edge(r)));let i=r.v,a=r.w;if(Te.warn("Fix XXX",jn,"ids:",r.v,r.w,"Translating: ",jn.get(r.v)," --- ",jn.get(r.w)),jn.get(r.v)||jn.get(r.w)){if(Te.warn("Fixing and trying - removing XXX",r.v,r.w,r.name),i=Qrt(r.v),a=Qrt(r.w),t.removeEdge(r.v,r.w,r.name),i!==r.v){const o=t.parent(i);jn.get(o).externalConnections=!0,n.fromCluster=r.v}if(a!==r.w){const o=t.parent(a);jn.get(o).externalConnections=!0,n.toCluster=r.w}Te.warn("Fix Replacing with XXX",i,a,r.name),t.setEdge(i,a,n,r.name)}}),Te.warn("Adjusted Graph",lh(t)),xrt(t,0),Te.trace(jn)},"adjustClustersAndEdges"),xrt=N((t,e)=>{var i,a;if(Te.warn("extractor - ",e,lh(t),t.children("D")),e>10){Te.error("Bailing out");return}let r=t.nodes(),n=!1;for(const o of r){const s=t.children(o);n=n||s.length>0}if(!n){Te.debug("Done, no node has children",t.nodes());return}Te.debug("Nodes = ",r,e);for(const o of r)if(Te.debug("Extracting node",o,jn,jn.has(o)&&!jn.get(o).externalConnections,!t.parent(o),t.node(o),t.children("D")," Depth ",e),!jn.has(o))Te.debug("Not a cluster",o,e);else if(!jn.get(o).externalConnections&&t.children(o)&&t.children(o).length>0){Te.warn("Cluster without external connections, without a parent and with children",o,e);let l=t.graph().rankdir==="TB"?"LR":"TB";(a=(i=jn.get(o))==null?void 0:i.clusterData)!=null&&a.dir&&(l=jn.get(o).clusterData.dir,Te.warn("Fixing dir",jn.get(o).clusterData.dir,l));const u=new Oc({multigraph:!0,compound:!0}).setGraph({rankdir:l,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});Te.warn("Old graph before copy",lh(t)),_rt(o,t,u,o),t.setNode(o,{clusterNode:!0,id:o,clusterData:jn.get(o).clusterData,label:jn.get(o).label,graph:u}),Te.warn("New graph after copy node: (",o,")",lh(u)),Te.debug("Old graph after copy",lh(t))}else Te.warn("Cluster ** ",o," **not meeting the criteria !externalConnections:",!jn.get(o).externalConnections," no parent: ",!t.parent(o)," children ",t.children(o)&&t.children(o).length>0,t.children("D"),e),Te.debug(jn);r=t.nodes(),Te.warn("New list of nodes",r);for(const o of r){const s=t.node(o);Te.warn(" Now next level",o,s),s!=null&&s.clusterNode&&xrt(s.graph,e+1)}},"extractor"),Ert=N((t,e)=>{if(e.length===0)return[];let r=Object.assign([],e);return e.forEach(n=>{const i=t.children(n),a=Ert(t,i);r=[...r,...a]}),r},"sorter"),iCr=N(t=>Ert(t,t.children()),"sortNodesByHierarchy"),Srt=N(async(t,e,r,n,i,a)=>{Te.warn("Graph in recursive render:XAX",lh(e),i);const o=e.graph().rankdir;Te.trace("Dir in recursive render - dir:",o);const s=t.insert("g").attr("class","root");e.nodes()?Te.info("Recursive render XXX",e.nodes()):Te.info("No nodes found for",e),e.edges().length>0&&Te.info("Recursive edges",e.edge(e.edges()[0]));const l=s.insert("g").attr("class","clusters"),u=s.insert("g").attr("class","edgePaths"),d=s.insert("g").attr("class","edgeLabels"),h=s.insert("g").attr("class","nodes");await Promise.all(e.nodes().map(async function(m){const T=e.node(m);if(i!==void 0){const v=JSON.parse(JSON.stringify(i.clusterData));Te.trace(`Setting data for parent cluster XXX
|
|
1059
1059
|
Node.id = `,m,`
|
|
1060
1060
|
data=`,v.height,`
|
|
1061
1061
|
Parent cluster`,i.height),e.setNode(i.id,v),e.parent(m)||(Te.trace("Setting parent",m,i.id),e.setParent(m,i.id,v))}if(Te.info("(Insert) Node XXX"+m+": "+JSON.stringify(e.node(m))),T!=null&&T.clusterNode){Te.info("Cluster identified XBX",m,T.width,e.node(m));const{ranksep:v,nodesep:y}=e.graph();T.graph.setGraph({...T.graph.graph(),ranksep:v+25,nodesep:y});const _=await Srt(h,T.graph,r,n,e.node(m),a),Q=_.elem;zr(T,Q),T.diff=_.diff||0,Te.info("New compound node after recursive render XAX",m,"width",T.width,"height",T.height),yFt(Q,T)}else e.children(m).length>0?(Te.trace("Cluster - the non recursive path XBX",m,T.id,T,T.width,"Graph:",e),Te.trace(rA(T.id,e)),jn.set(T.id,{id:rA(T.id,e),node:T})):(Te.trace("Node - the non recursive path XAX",m,h,e.node(m),o),await aI(h,e.node(m),{config:a,dir:o}))})),await N(async()=>{const m=e.edges().map(async function(T){const v=e.edge(T.v,T.w,T.name);Te.info("Edge "+T.v+" -> "+T.w+": "+JSON.stringify(T)),Te.info("Edge "+T.v+" -> "+T.w+": ",T," ",JSON.stringify(e.edge(T))),Te.info("Fix",jn,"ids:",T.v,T.w,"Translating: ",jn.get(T.v),jn.get(T.w)),await FCe(d,v)});await Promise.all(m)},"processEdges")(),Te.info("Graph before layout:",JSON.stringify(lh(e))),Te.info("############################################# XXX"),Te.info("### Layout ### XXX"),Te.info("############################################# XXX"),vrt(e),Te.info("Graph after layout:",JSON.stringify(lh(e)));let p=0,{subGraphTitleTotalMargin:g}=Hx(a);return await Promise.all(iCr(e).map(async function(m){var v;const T=e.node(m);if(Te.info("Position XBX => "+m+": ("+T.x,","+T.y,") width: ",T.width," height: ",T.height),T!=null&&T.clusterNode)T.y+=g,Te.info("A tainted cluster node XBX1",m,T.id,T.width,T.height,T.x,T.y,e.parent(m)),jn.get(T.id).node=T,GJ(T);else if(e.children(m).length>0){Te.info("A pure cluster node XBX1",m,T.id,T.x,T.y,T.width,T.height,e.parent(m)),T.height+=g,e.node(T.parentId);const y=(T==null?void 0:T.padding)/2||0,_=((v=T==null?void 0:T.labelBBox)==null?void 0:v.height)||0,Q=_-y||0;Te.debug("OffsetY",Q,"labelHeight",_,"halfPadding",y),await VJ(l,T),jn.get(T.id).node=T}else{const y=e.node(T.parentId);T.y+=g/2,Te.info("A regular node XBX1 - using the padding",T.id,"parent",T.parentId,T.width,T.height,T.x,T.y,"offsetY",T.offsetY,"parent",y,y==null?void 0:y.offsetY,T),GJ(T)}})),e.edges().forEach(function(m){const T=e.edge(m);Te.info("Edge "+m.v+" -> "+m.w+": "+JSON.stringify(T),T),T.points.forEach(Q=>Q.y+=g/2);const v=e.node(m.v);var y=e.node(m.w);const _=GCe(u,T,jn,r,v,y,n);VCe(T,_)}),e.nodes().forEach(function(m){const T=e.node(m);Te.info(m,T.type,T.diff),T.isGroup&&(p=T.diff)}),Te.warn("Returning from recursive render XAX",s,p),{elem:s,diff:p}},"recursiveRender"),aCr=N(async(t,e)=>{var a,o,s,l,u,d;const r=new Oc({multigraph:!0,compound:!0}).setGraph({rankdir:t.direction,nodesep:((a=t.config)==null?void 0:a.nodeSpacing)||((s=(o=t.config)==null?void 0:o.flowchart)==null?void 0:s.nodeSpacing)||t.nodeSpacing,ranksep:((l=t.config)==null?void 0:l.rankSpacing)||((d=(u=t.config)==null?void 0:u.flowchart)==null?void 0:d.rankSpacing)||t.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),n=e.select("g");qCe(n,t.markers,t.type,t.diagramId),_Ft(),xFt(),eFt(),eCr(),t.nodes.forEach(h=>{r.setNode(h.id,{...h}),h.parentId&&r.setParent(h.id,h.parentId)}),Te.debug("Edges:",t.edges),t.edges.forEach(h=>{if(h.start===h.end){const f=h.start,p=f+"---"+f+"---1",g=f+"---"+f+"---2",m=r.node(f);r.setNode(p,{domId:p,id:p,parentId:m.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),r.setParent(p,m.parentId),r.setNode(g,{domId:g,id:g,parentId:m.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),r.setParent(g,m.parentId);const T=structuredClone(h),v=structuredClone(h),y=structuredClone(h);T.label="",T.arrowTypeEnd="none",T.id=f+"-cyclic-special-1",v.arrowTypeStart="none",v.arrowTypeEnd="none",v.id=f+"-cyclic-special-mid",y.label="",m.isGroup&&(T.fromCluster=f,y.toCluster=f),y.id=f+"-cyclic-special-2",y.arrowTypeStart="none",r.setEdge(f,p,T,f+"-cyclic-special-0"),r.setEdge(p,g,v,f+"-cyclic-special-1"),r.setEdge(g,f,y,f+"-cyc<lic-special-2")}else r.setEdge(h.start,h.end,{...h},h.id)}),Te.warn("Graph at first:",JSON.stringify(lh(r))),nCr(r),Te.warn("Graph after XAX:",JSON.stringify(lh(r)));const i=ze();await Srt(n,r,t.type,t.diagramId,void 0,i)},"render");const oCr=Object.freeze(Object.defineProperty({__proto__:null,render:aCr},Symbol.toStringTag,{value:"Module"}));var _F=N((t,e)=>{const r=t.append("rect");if(r.attr("x",e.x),r.attr("y",e.y),r.attr("fill",e.fill),r.attr("stroke",e.stroke),r.attr("width",e.width),r.attr("height",e.height),e.name&&r.attr("name",e.name),e.rx&&r.attr("rx",e.rx),e.ry&&r.attr("ry",e.ry),e.attrs!==void 0)for(const n in e.attrs)r.attr(n,e.attrs[n]);return e.class&&r.attr("class",e.class),r},"drawRect"),Crt=N((t,e)=>{const r={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"};_F(t,r).lower()},"drawBackgroundRect"),sCr=N((t,e)=>{const r=e.text.replace(Bv," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class&&n.attr("class",e.class);const i=n.append("tspan");return i.attr("x",e.x+e.textMargin*2),i.text(r),n},"drawText"),lCr=N((t,e,r,n)=>{const i=t.append("image");i.attr("x",e),i.attr("y",r);const a=Bg.sanitizeUrl(n);i.attr("xlink:href",a)},"drawImage"),uCr=N((t,e,r,n)=>{const i=t.append("use");i.attr("x",e),i.attr("y",r);const a=Bg.sanitizeUrl(n);i.attr("xlink:href",`#${a}`)},"drawEmbeddedImage"),H8=N(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),sce=N(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),bF=function(){var t=N(function(at,qe,it,Qe){for(it=it||{},Qe=at.length;Qe--;it[at[Qe]]=qe);return it},"o"),e=[1,24],r=[1,25],n=[1,26],i=[1,27],a=[1,28],o=[1,63],s=[1,64],l=[1,65],u=[1,66],d=[1,67],h=[1,68],f=[1,69],p=[1,29],g=[1,30],m=[1,31],T=[1,32],v=[1,33],y=[1,34],_=[1,35],Q=[1,36],b=[1,37],x=[1,38],E=[1,39],S=[1,40],C=[1,41],L=[1,42],w=[1,43],O=[1,44],R=[1,45],M=[1,46],D=[1,47],P=[1,48],B=[1,50],k=[1,51],V=[1,52],H=[1,53],$=[1,54],G=[1,55],U=[1,56],Y=[1,57],ne=[1,58],te=[1,59],ee=[1,60],ie=[14,42],j=[14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],X=[12,14,34,36,37,38,39,40,41,42,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Z=[1,82],K=[1,83],ae=[1,84],le=[1,85],oe=[12,14,42],Ce=[12,14,33,42],fe=[12,14,33,42,76,77,79,80],ce=[12,33],ke=[34,36,37,38,39,40,41,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74],Ee={trace:N(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,direction:5,direction_tb:6,direction_bt:7,direction_rl:8,direction_lr:9,graphConfig:10,C4_CONTEXT:11,NEWLINE:12,statements:13,EOF:14,C4_CONTAINER:15,C4_COMPONENT:16,C4_DYNAMIC:17,C4_DEPLOYMENT:18,otherStatements:19,diagramStatements:20,otherStatement:21,title:22,accDescription:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,boundaryStatement:29,boundaryStartStatement:30,boundaryStopStatement:31,boundaryStart:32,LBRACE:33,ENTERPRISE_BOUNDARY:34,attributes:35,SYSTEM_BOUNDARY:36,BOUNDARY:37,CONTAINER_BOUNDARY:38,NODE:39,NODE_L:40,NODE_R:41,RBRACE:42,diagramStatement:43,PERSON:44,PERSON_EXT:45,SYSTEM:46,SYSTEM_DB:47,SYSTEM_QUEUE:48,SYSTEM_EXT:49,SYSTEM_EXT_DB:50,SYSTEM_EXT_QUEUE:51,CONTAINER:52,CONTAINER_DB:53,CONTAINER_QUEUE:54,CONTAINER_EXT:55,CONTAINER_EXT_DB:56,CONTAINER_EXT_QUEUE:57,COMPONENT:58,COMPONENT_DB:59,COMPONENT_QUEUE:60,COMPONENT_EXT:61,COMPONENT_EXT_DB:62,COMPONENT_EXT_QUEUE:63,REL:64,BIREL:65,REL_U:66,REL_D:67,REL_L:68,REL_R:69,REL_B:70,REL_INDEX:71,UPDATE_EL_STYLE:72,UPDATE_REL_STYLE:73,UPDATE_LAYOUT_CONFIG:74,attribute:75,STR:76,STR_KEY:77,STR_VALUE:78,ATTRIBUTE:79,ATTRIBUTE_EMPTY:80,$accept:0,$end:1},terminals_:{2:"error",6:"direction_tb",7:"direction_bt",8:"direction_rl",9:"direction_lr",11:"C4_CONTEXT",12:"NEWLINE",14:"EOF",15:"C4_CONTAINER",16:"C4_COMPONENT",17:"C4_DYNAMIC",18:"C4_DEPLOYMENT",22:"title",23:"accDescription",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"LBRACE",34:"ENTERPRISE_BOUNDARY",36:"SYSTEM_BOUNDARY",37:"BOUNDARY",38:"CONTAINER_BOUNDARY",39:"NODE",40:"NODE_L",41:"NODE_R",42:"RBRACE",44:"PERSON",45:"PERSON_EXT",46:"SYSTEM",47:"SYSTEM_DB",48:"SYSTEM_QUEUE",49:"SYSTEM_EXT",50:"SYSTEM_EXT_DB",51:"SYSTEM_EXT_QUEUE",52:"CONTAINER",53:"CONTAINER_DB",54:"CONTAINER_QUEUE",55:"CONTAINER_EXT",56:"CONTAINER_EXT_DB",57:"CONTAINER_EXT_QUEUE",58:"COMPONENT",59:"COMPONENT_DB",60:"COMPONENT_QUEUE",61:"COMPONENT_EXT",62:"COMPONENT_EXT_DB",63:"COMPONENT_EXT_QUEUE",64:"REL",65:"BIREL",66:"REL_U",67:"REL_D",68:"REL_L",69:"REL_R",70:"REL_B",71:"REL_INDEX",72:"UPDATE_EL_STYLE",73:"UPDATE_REL_STYLE",74:"UPDATE_LAYOUT_CONFIG",76:"STR",77:"STR_KEY",78:"STR_VALUE",79:"ATTRIBUTE",80:"ATTRIBUTE_EMPTY"},productions_:[0,[3,1],[3,1],[5,1],[5,1],[5,1],[5,1],[4,1],[10,4],[10,4],[10,4],[10,4],[10,4],[13,1],[13,1],[13,2],[19,1],[19,2],[19,3],[21,1],[21,1],[21,2],[21,2],[21,1],[29,3],[30,3],[30,3],[30,4],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[32,2],[31,1],[20,1],[20,2],[20,3],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,1],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[43,2],[35,1],[35,2],[75,1],[75,2],[75,1],[75,1]],performAction:N(function(qe,it,Qe,De,je,Se,Ke){var de=Se.length-1;switch(je){case 3:De.setDirection("TB");break;case 4:De.setDirection("BT");break;case 5:De.setDirection("RL");break;case 6:De.setDirection("LR");break;case 8:case 9:case 10:case 11:case 12:De.setC4Type(Se[de-3]);break;case 19:De.setTitle(Se[de].substring(6)),this.$=Se[de].substring(6);break;case 20:De.setAccDescription(Se[de].substring(15)),this.$=Se[de].substring(15);break;case 21:this.$=Se[de].trim(),De.setTitle(this.$);break;case 22:case 23:this.$=Se[de].trim(),De.setAccDescription(this.$);break;case 28:Se[de].splice(2,0,"ENTERPRISE"),De.addPersonOrSystemBoundary(...Se[de]),this.$=Se[de];break;case 29:Se[de].splice(2,0,"SYSTEM"),De.addPersonOrSystemBoundary(...Se[de]),this.$=Se[de];break;case 30:De.addPersonOrSystemBoundary(...Se[de]),this.$=Se[de];break;case 31:Se[de].splice(2,0,"CONTAINER"),De.addContainerBoundary(...Se[de]),this.$=Se[de];break;case 32:De.addDeploymentNode("node",...Se[de]),this.$=Se[de];break;case 33:De.addDeploymentNode("nodeL",...Se[de]),this.$=Se[de];break;case 34:De.addDeploymentNode("nodeR",...Se[de]),this.$=Se[de];break;case 35:De.popBoundaryParseStack();break;case 39:De.addPersonOrSystem("person",...Se[de]),this.$=Se[de];break;case 40:De.addPersonOrSystem("external_person",...Se[de]),this.$=Se[de];break;case 41:De.addPersonOrSystem("system",...Se[de]),this.$=Se[de];break;case 42:De.addPersonOrSystem("system_db",...Se[de]),this.$=Se[de];break;case 43:De.addPersonOrSystem("system_queue",...Se[de]),this.$=Se[de];break;case 44:De.addPersonOrSystem("external_system",...Se[de]),this.$=Se[de];break;case 45:De.addPersonOrSystem("external_system_db",...Se[de]),this.$=Se[de];break;case 46:De.addPersonOrSystem("external_system_queue",...Se[de]),this.$=Se[de];break;case 47:De.addContainer("container",...Se[de]),this.$=Se[de];break;case 48:De.addContainer("container_db",...Se[de]),this.$=Se[de];break;case 49:De.addContainer("container_queue",...Se[de]),this.$=Se[de];break;case 50:De.addContainer("external_container",...Se[de]),this.$=Se[de];break;case 51:De.addContainer("external_container_db",...Se[de]),this.$=Se[de];break;case 52:De.addContainer("external_container_queue",...Se[de]),this.$=Se[de];break;case 53:De.addComponent("component",...Se[de]),this.$=Se[de];break;case 54:De.addComponent("component_db",...Se[de]),this.$=Se[de];break;case 55:De.addComponent("component_queue",...Se[de]),this.$=Se[de];break;case 56:De.addComponent("external_component",...Se[de]),this.$=Se[de];break;case 57:De.addComponent("external_component_db",...Se[de]),this.$=Se[de];break;case 58:De.addComponent("external_component_queue",...Se[de]),this.$=Se[de];break;case 60:De.addRel("rel",...Se[de]),this.$=Se[de];break;case 61:De.addRel("birel",...Se[de]),this.$=Se[de];break;case 62:De.addRel("rel_u",...Se[de]),this.$=Se[de];break;case 63:De.addRel("rel_d",...Se[de]),this.$=Se[de];break;case 64:De.addRel("rel_l",...Se[de]),this.$=Se[de];break;case 65:De.addRel("rel_r",...Se[de]),this.$=Se[de];break;case 66:De.addRel("rel_b",...Se[de]),this.$=Se[de];break;case 67:Se[de].splice(0,1),De.addRel("rel",...Se[de]),this.$=Se[de];break;case 68:De.updateElStyle("update_el_style",...Se[de]),this.$=Se[de];break;case 69:De.updateRelStyle("update_rel_style",...Se[de]),this.$=Se[de];break;case 70:De.updateLayoutConfig("update_layout_config",...Se[de]),this.$=Se[de];break;case 71:this.$=[Se[de]];break;case 72:Se[de].unshift(Se[de-1]),this.$=Se[de];break;case 73:case 75:this.$=Se[de].trim();break;case 74:let be={};be[Se[de-1].trim()]=Se[de].trim(),this.$=be;break;case 76:this.$="";break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],7:[1,6],8:[1,7],9:[1,8],10:4,11:[1,9],15:[1,10],16:[1,11],17:[1,12],18:[1,13]},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,7]},{1:[2,3]},{1:[2,4]},{1:[2,5]},{1:[2,6]},{12:[1,14]},{12:[1,15]},{12:[1,16]},{12:[1,17]},{12:[1,18]},{13:19,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:d,40:h,41:f,43:23,44:p,45:g,46:m,47:T,48:v,49:y,50:_,51:Q,52:b,53:x,54:E,55:S,56:C,57:L,58:w,59:O,60:R,61:M,62:D,63:P,64:B,65:k,66:V,67:H,68:$,69:G,70:U,71:Y,72:ne,73:te,74:ee},{13:70,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:d,40:h,41:f,43:23,44:p,45:g,46:m,47:T,48:v,49:y,50:_,51:Q,52:b,53:x,54:E,55:S,56:C,57:L,58:w,59:O,60:R,61:M,62:D,63:P,64:B,65:k,66:V,67:H,68:$,69:G,70:U,71:Y,72:ne,73:te,74:ee},{13:71,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:d,40:h,41:f,43:23,44:p,45:g,46:m,47:T,48:v,49:y,50:_,51:Q,52:b,53:x,54:E,55:S,56:C,57:L,58:w,59:O,60:R,61:M,62:D,63:P,64:B,65:k,66:V,67:H,68:$,69:G,70:U,71:Y,72:ne,73:te,74:ee},{13:72,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:d,40:h,41:f,43:23,44:p,45:g,46:m,47:T,48:v,49:y,50:_,51:Q,52:b,53:x,54:E,55:S,56:C,57:L,58:w,59:O,60:R,61:M,62:D,63:P,64:B,65:k,66:V,67:H,68:$,69:G,70:U,71:Y,72:ne,73:te,74:ee},{13:73,19:20,20:21,21:22,22:e,23:r,24:n,26:i,28:a,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:d,40:h,41:f,43:23,44:p,45:g,46:m,47:T,48:v,49:y,50:_,51:Q,52:b,53:x,54:E,55:S,56:C,57:L,58:w,59:O,60:R,61:M,62:D,63:P,64:B,65:k,66:V,67:H,68:$,69:G,70:U,71:Y,72:ne,73:te,74:ee},{14:[1,74]},t(ie,[2,13],{43:23,29:49,30:61,32:62,20:75,34:o,36:s,37:l,38:u,39:d,40:h,41:f,44:p,45:g,46:m,47:T,48:v,49:y,50:_,51:Q,52:b,53:x,54:E,55:S,56:C,57:L,58:w,59:O,60:R,61:M,62:D,63:P,64:B,65:k,66:V,67:H,68:$,69:G,70:U,71:Y,72:ne,73:te,74:ee}),t(ie,[2,14]),t(j,[2,16],{12:[1,76]}),t(ie,[2,36],{12:[1,77]}),t(X,[2,19]),t(X,[2,20]),{25:[1,78]},{27:[1,79]},t(X,[2,23]),{35:80,75:81,76:Z,77:K,79:ae,80:le},{35:86,75:81,76:Z,77:K,79:ae,80:le},{35:87,75:81,76:Z,77:K,79:ae,80:le},{35:88,75:81,76:Z,77:K,79:ae,80:le},{35:89,75:81,76:Z,77:K,79:ae,80:le},{35:90,75:81,76:Z,77:K,79:ae,80:le},{35:91,75:81,76:Z,77:K,79:ae,80:le},{35:92,75:81,76:Z,77:K,79:ae,80:le},{35:93,75:81,76:Z,77:K,79:ae,80:le},{35:94,75:81,76:Z,77:K,79:ae,80:le},{35:95,75:81,76:Z,77:K,79:ae,80:le},{35:96,75:81,76:Z,77:K,79:ae,80:le},{35:97,75:81,76:Z,77:K,79:ae,80:le},{35:98,75:81,76:Z,77:K,79:ae,80:le},{35:99,75:81,76:Z,77:K,79:ae,80:le},{35:100,75:81,76:Z,77:K,79:ae,80:le},{35:101,75:81,76:Z,77:K,79:ae,80:le},{35:102,75:81,76:Z,77:K,79:ae,80:le},{35:103,75:81,76:Z,77:K,79:ae,80:le},{35:104,75:81,76:Z,77:K,79:ae,80:le},t(oe,[2,59]),{35:105,75:81,76:Z,77:K,79:ae,80:le},{35:106,75:81,76:Z,77:K,79:ae,80:le},{35:107,75:81,76:Z,77:K,79:ae,80:le},{35:108,75:81,76:Z,77:K,79:ae,80:le},{35:109,75:81,76:Z,77:K,79:ae,80:le},{35:110,75:81,76:Z,77:K,79:ae,80:le},{35:111,75:81,76:Z,77:K,79:ae,80:le},{35:112,75:81,76:Z,77:K,79:ae,80:le},{35:113,75:81,76:Z,77:K,79:ae,80:le},{35:114,75:81,76:Z,77:K,79:ae,80:le},{35:115,75:81,76:Z,77:K,79:ae,80:le},{20:116,29:49,30:61,32:62,34:o,36:s,37:l,38:u,39:d,40:h,41:f,43:23,44:p,45:g,46:m,47:T,48:v,49:y,50:_,51:Q,52:b,53:x,54:E,55:S,56:C,57:L,58:w,59:O,60:R,61:M,62:D,63:P,64:B,65:k,66:V,67:H,68:$,69:G,70:U,71:Y,72:ne,73:te,74:ee},{12:[1,118],33:[1,117]},{35:119,75:81,76:Z,77:K,79:ae,80:le},{35:120,75:81,76:Z,77:K,79:ae,80:le},{35:121,75:81,76:Z,77:K,79:ae,80:le},{35:122,75:81,76:Z,77:K,79:ae,80:le},{35:123,75:81,76:Z,77:K,79:ae,80:le},{35:124,75:81,76:Z,77:K,79:ae,80:le},{35:125,75:81,76:Z,77:K,79:ae,80:le},{14:[1,126]},{14:[1,127]},{14:[1,128]},{14:[1,129]},{1:[2,8]},t(ie,[2,15]),t(j,[2,17],{21:22,19:130,22:e,23:r,24:n,26:i,28:a}),t(ie,[2,37],{19:20,20:21,21:22,43:23,29:49,30:61,32:62,13:131,22:e,23:r,24:n,26:i,28:a,34:o,36:s,37:l,38:u,39:d,40:h,41:f,44:p,45:g,46:m,47:T,48:v,49:y,50:_,51:Q,52:b,53:x,54:E,55:S,56:C,57:L,58:w,59:O,60:R,61:M,62:D,63:P,64:B,65:k,66:V,67:H,68:$,69:G,70:U,71:Y,72:ne,73:te,74:ee}),t(X,[2,21]),t(X,[2,22]),t(oe,[2,39]),t(Ce,[2,71],{75:81,35:132,76:Z,77:K,79:ae,80:le}),t(fe,[2,73]),{78:[1,133]},t(fe,[2,75]),t(fe,[2,76]),t(oe,[2,40]),t(oe,[2,41]),t(oe,[2,42]),t(oe,[2,43]),t(oe,[2,44]),t(oe,[2,45]),t(oe,[2,46]),t(oe,[2,47]),t(oe,[2,48]),t(oe,[2,49]),t(oe,[2,50]),t(oe,[2,51]),t(oe,[2,52]),t(oe,[2,53]),t(oe,[2,54]),t(oe,[2,55]),t(oe,[2,56]),t(oe,[2,57]),t(oe,[2,58]),t(oe,[2,60]),t(oe,[2,61]),t(oe,[2,62]),t(oe,[2,63]),t(oe,[2,64]),t(oe,[2,65]),t(oe,[2,66]),t(oe,[2,67]),t(oe,[2,68]),t(oe,[2,69]),t(oe,[2,70]),{31:134,42:[1,135]},{12:[1,136]},{33:[1,137]},t(ce,[2,28]),t(ce,[2,29]),t(ce,[2,30]),t(ce,[2,31]),t(ce,[2,32]),t(ce,[2,33]),t(ce,[2,34]),{1:[2,9]},{1:[2,10]},{1:[2,11]},{1:[2,12]},t(j,[2,18]),t(ie,[2,38]),t(Ce,[2,72]),t(fe,[2,74]),t(oe,[2,24]),t(oe,[2,35]),t(ke,[2,25]),t(ke,[2,26],{12:[1,138]}),t(ke,[2,27])],defaultActions:{2:[2,1],3:[2,2],4:[2,7],5:[2,3],6:[2,4],7:[2,5],8:[2,6],74:[2,8],126:[2,9],127:[2,10],128:[2,11],129:[2,12]},parseError:N(function(qe,it){if(it.recoverable)this.trace(qe);else{var Qe=new Error(qe);throw Qe.hash=it,Qe}},"parseError"),parse:N(function(qe){var it=this,Qe=[0],De=[],je=[null],Se=[],Ke=this.table,de="",be=0,W=0,ve=2,me=1,Le=Se.slice.call(arguments,1),we=Object.create(this.lexer),Be={yy:{}};for(var Ue in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ue)&&(Be.yy[Ue]=this.yy[Ue]);we.setInput(qe,Be.yy),Be.yy.lexer=we,Be.yy.parser=this,typeof we.yylloc>"u"&&(we.yylloc={});var Ie=we.yylloc;Se.push(Ie);var mt=we.options&&we.options.ranges;typeof Be.yy.parseError=="function"?this.parseError=Be.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function At(Pt){Qe.length=Qe.length-2*Pt,je.length=je.length-Pt,Se.length=Se.length-Pt}N(At,"popStack");function Qt(){var Pt;return Pt=De.pop()||we.lex()||me,typeof Pt!="number"&&(Pt instanceof Array&&(De=Pt,Pt=De.pop()),Pt=it.symbols_[Pt]||Pt),Pt}N(Qt,"lex");for(var xe,Ge,Ve,ht,kt={},Mt,tt,vt,st;;){if(Ge=Qe[Qe.length-1],this.defaultActions[Ge]?Ve=this.defaultActions[Ge]:((xe===null||typeof xe>"u")&&(xe=Qt()),Ve=Ke[Ge]&&Ke[Ge][xe]),typeof Ve>"u"||!Ve.length||!Ve[0]){var St="";st=[];for(Mt in Ke[Ge])this.terminals_[Mt]&&Mt>ve&&st.push("'"+this.terminals_[Mt]+"'");we.showPosition?St="Parse error on line "+(be+1)+`:
|