var mH=Object.defineProperty;var gH=(r,e,t)=>e in r?mH(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var Rt=(r,e,t)=>gH(r,typeof e!="symbol"?e+"":e,t);import{g as yH,c as bH}from"./_commonjsHelpers-NT8qMgGI.js";import{A as so,a3 as rr,bv as Ke,a as ae,g as Y,b as Z,Q as Sa,av as _H,au as $x,af as oi,aa as zl,bw as lo,bx as Nr,by as BS,bz as zS,m as Nt,bA as Ta,bB as p3,bC as v3,ad as xH,bD as xu,r as te,c as de,o as zi,e as H,ac as Ca,bE as wH,B as m3,E as ag,b4 as Ss,aF as SH,bF as FS,bG as g3,aN as TH,p as Je,i as $e,w as _e,aX as wu,d as Ie,j as ct,bi as VS,bH as r0,bI as n0,bJ as y3,bK as Vu,bL as CH,bg as i0,k as Di,t as qt,h as At,aW as Bh,bM as AH,n as kt,v as MH,aV as b3,aw as vt,bN as _3,f as kH,aQ as cp,_ as DH,ae as og,ai as EH,bO as MM,aU as Hx,bP as bm,aA as x3,bQ as w3,b5 as Ac,bR as LH,aS as kM}from"./index-BUdRbiwj.js";var Mn="top",di="bottom",pi="right",kn="left",$S="auto",fp=[Mn,di,pi,kn],$c="start",md="end",IH="clippingParents",S3="viewport",Rf="popper",PH="reference",DM=fp.reduce(function(r,e){return r.concat([e+"-"+$c,e+"-"+md])},[]),T3=[].concat(fp,[$S]).reduce(function(r,e){return r.concat([e,e+"-"+$c,e+"-"+md])},[]),RH="beforeRead",OH="read",jH="afterRead",NH="beforeMain",BH="main",zH="afterMain",FH="beforeWrite",VH="write",$H="afterWrite",HH=[RH,OH,jH,NH,BH,zH,FH,VH,$H];function Aa(r){return r?(r.nodeName||"").toLowerCase():null}function $n(r){if(r==null)return window;if(r.toString()!=="[object Window]"){var e=r.ownerDocument;return e&&e.defaultView||window}return r}function su(r){var e=$n(r).Element;return r instanceof e||r instanceof Element}function fi(r){var e=$n(r).HTMLElement;return r instanceof e||r instanceof HTMLElement}function HS(r){if(typeof ShadowRoot>"u")return!1;var e=$n(r).ShadowRoot;return r instanceof e||r instanceof ShadowRoot}function GH(r){var e=r.state;Object.keys(e.elements).forEach(function(t){var n=e.styles[t]||{},i=e.attributes[t]||{},a=e.elements[t];!fi(a)||!Aa(a)||(Object.assign(a.style,n),Object.keys(i).forEach(function(o){var s=i[o];s===!1?a.removeAttribute(o):a.setAttribute(o,s===!0?"":s)}))})}function WH(r){var e=r.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(n){var i=e.elements[n],a=e.attributes[n]||{},o=Object.keys(e.styles.hasOwnProperty(n)?e.styles[n]:t[n]),s=o.reduce(function(l,u){return l[u]="",l},{});!fi(i)||!Aa(i)||(Object.assign(i.style,s),Object.keys(a).forEach(function(l){i.removeAttribute(l)}))})}}const C3={name:"applyStyles",enabled:!0,phase:"write",fn:GH,effect:WH,requires:["computeStyles"]};function ya(r){return r.split("-")[0]}var Fl=Math.max,sg=Math.min,Hc=Math.round;function Gx(){var r=navigator.userAgentData;return r!=null&&r.brands&&Array.isArray(r.brands)?r.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function A3(){return!/^((?!chrome|android).)*safari/i.test(Gx())}function Gc(r,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var n=r.getBoundingClientRect(),i=1,a=1;e&&fi(r)&&(i=r.offsetWidth>0&&Hc(n.width)/r.offsetWidth||1,a=r.offsetHeight>0&&Hc(n.height)/r.offsetHeight||1);var o=su(r)?$n(r):window,s=o.visualViewport,l=!A3()&&t,u=(n.left+(l&&s?s.offsetLeft:0))/i,c=(n.top+(l&&s?s.offsetTop:0))/a,f=n.width/i,h=n.height/a;return{width:f,height:h,top:c,right:u+f,bottom:c+h,left:u,x:u,y:c}}function GS(r){var e=Gc(r),t=r.offsetWidth,n=r.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:r.offsetLeft,y:r.offsetTop,width:t,height:n}}function M3(r,e){var t=e.getRootNode&&e.getRootNode();if(r.contains(e))return!0;if(t&&HS(t)){var n=e;do{if(n&&r.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function mo(r){return $n(r).getComputedStyle(r)}function UH(r){return["table","td","th"].indexOf(Aa(r))>=0}function Os(r){return((su(r)?r.ownerDocument:r.document)||window.document).documentElement}function a0(r){return Aa(r)==="html"?r:r.assignedSlot||r.parentNode||(HS(r)?r.host:null)||Os(r)}function EM(r){return!fi(r)||mo(r).position==="fixed"?null:r.offsetParent}function YH(r){var e=/firefox/i.test(Gx()),t=/Trident/i.test(Gx());if(t&&fi(r)){var n=mo(r);if(n.position==="fixed")return null}var i=a0(r);for(HS(i)&&(i=i.host);fi(i)&&["html","body"].indexOf(Aa(i))<0;){var a=mo(i);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||e&&a.willChange==="filter"||e&&a.filter&&a.filter!=="none")return i;i=i.parentNode}return null}function hp(r){for(var e=$n(r),t=EM(r);t&&UH(t)&&mo(t).position==="static";)t=EM(t);return t&&(Aa(t)==="html"||Aa(t)==="body"&&mo(t).position==="static")?e:t||YH(r)||e}function WS(r){return["top","bottom"].indexOf(r)>=0?"x":"y"}function zh(r,e,t){return Fl(r,sg(e,t))}function qH(r,e,t){var n=zh(r,e,t);return n>t?t:n}function k3(){return{top:0,right:0,bottom:0,left:0}}function D3(r){return Object.assign({},k3(),r)}function E3(r,e){return e.reduce(function(t,n){return t[n]=r,t},{})}var XH=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,D3(typeof e!="number"?e:E3(e,fp))};function KH(r){var e,t=r.state,n=r.name,i=r.options,a=t.elements.arrow,o=t.modifiersData.popperOffsets,s=ya(t.placement),l=WS(s),u=[kn,pi].indexOf(s)>=0,c=u?"height":"width";if(!(!a||!o)){var f=XH(i.padding,t),h=GS(a),d=l==="y"?Mn:kn,p=l==="y"?di:pi,v=t.rects.reference[c]+t.rects.reference[l]-o[l]-t.rects.popper[c],m=o[l]-t.rects.reference[l],g=hp(a),y=g?l==="y"?g.clientHeight||0:g.clientWidth||0:0,b=v/2-m/2,_=f[d],x=y-h[c]-f[p],w=y/2-h[c]/2+b,S=zh(_,w,x),T=l;t.modifiersData[n]=(e={},e[T]=S,e.centerOffset=S-w,e)}}function ZH(r){var e=r.state,t=r.options,n=t.element,i=n===void 0?"[data-popper-arrow]":n;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||M3(e.elements.popper,i)&&(e.elements.arrow=i))}const JH={name:"arrow",enabled:!0,phase:"main",fn:KH,effect:ZH,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Wc(r){return r.split("-")[1]}var QH={top:"auto",right:"auto",bottom:"auto",left:"auto"};function e7(r,e){var t=r.x,n=r.y,i=e.devicePixelRatio||1;return{x:Hc(t*i)/i||0,y:Hc(n*i)/i||0}}function LM(r){var e,t=r.popper,n=r.popperRect,i=r.placement,a=r.variation,o=r.offsets,s=r.position,l=r.gpuAcceleration,u=r.adaptive,c=r.roundOffsets,f=r.isFixed,h=o.x,d=h===void 0?0:h,p=o.y,v=p===void 0?0:p,m=typeof c=="function"?c({x:d,y:v}):{x:d,y:v};d=m.x,v=m.y;var g=o.hasOwnProperty("x"),y=o.hasOwnProperty("y"),b=kn,_=Mn,x=window;if(u){var w=hp(t),S="clientHeight",T="clientWidth";if(w===$n(t)&&(w=Os(t),mo(w).position!=="static"&&s==="absolute"&&(S="scrollHeight",T="scrollWidth")),w=w,i===Mn||(i===kn||i===pi)&&a===md){_=di;var C=f&&w===x&&x.visualViewport?x.visualViewport.height:w[S];v-=C-n.height,v*=l?1:-1}if(i===kn||(i===Mn||i===di)&&a===md){b=pi;var A=f&&w===x&&x.visualViewport?x.visualViewport.width:w[T];d-=A-n.width,d*=l?1:-1}}var M=Object.assign({position:s},u&&QH),D=c===!0?e7({x:d,y:v},$n(t)):{x:d,y:v};if(d=D.x,v=D.y,l){var E;return Object.assign({},M,(E={},E[_]=y?"0":"",E[b]=g?"0":"",E.transform=(x.devicePixelRatio||1)<=1?"translate("+d+"px, "+v+"px)":"translate3d("+d+"px, "+v+"px, 0)",E))}return Object.assign({},M,(e={},e[_]=y?v+"px":"",e[b]=g?d+"px":"",e.transform="",e))}function t7(r){var e=r.state,t=r.options,n=t.gpuAcceleration,i=n===void 0?!0:n,a=t.adaptive,o=a===void 0?!0:a,s=t.roundOffsets,l=s===void 0?!0:s,u={placement:ya(e.placement),variation:Wc(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,LM(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,LM(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const r7={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:t7,data:{}};var Hp={passive:!0};function n7(r){var e=r.state,t=r.instance,n=r.options,i=n.scroll,a=i===void 0?!0:i,o=n.resize,s=o===void 0?!0:o,l=$n(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return a&&u.forEach(function(c){c.addEventListener("scroll",t.update,Hp)}),s&&l.addEventListener("resize",t.update,Hp),function(){a&&u.forEach(function(c){c.removeEventListener("scroll",t.update,Hp)}),s&&l.removeEventListener("resize",t.update,Hp)}}const i7={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:n7,data:{}};var a7={left:"right",right:"left",bottom:"top",top:"bottom"};function _m(r){return r.replace(/left|right|bottom|top/g,function(e){return a7[e]})}var o7={start:"end",end:"start"};function IM(r){return r.replace(/start|end/g,function(e){return o7[e]})}function US(r){var e=$n(r),t=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:t,scrollTop:n}}function YS(r){return Gc(Os(r)).left+US(r).scrollLeft}function s7(r,e){var t=$n(r),n=Os(r),i=t.visualViewport,a=n.clientWidth,o=n.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;var u=A3();(u||!u&&e==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:a,height:o,x:s+YS(r),y:l}}function l7(r){var e,t=Os(r),n=US(r),i=(e=r.ownerDocument)==null?void 0:e.body,a=Fl(t.scrollWidth,t.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=Fl(t.scrollHeight,t.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-n.scrollLeft+YS(r),l=-n.scrollTop;return mo(i||t).direction==="rtl"&&(s+=Fl(t.clientWidth,i?i.clientWidth:0)-a),{width:a,height:o,x:s,y:l}}function qS(r){var e=mo(r),t=e.overflow,n=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+i+n)}function L3(r){return["html","body","#document"].indexOf(Aa(r))>=0?r.ownerDocument.body:fi(r)&&qS(r)?r:L3(a0(r))}function Fh(r,e){var t;e===void 0&&(e=[]);var n=L3(r),i=n===((t=r.ownerDocument)==null?void 0:t.body),a=$n(n),o=i?[a].concat(a.visualViewport||[],qS(n)?n:[]):n,s=e.concat(o);return i?s:s.concat(Fh(a0(o)))}function Wx(r){return Object.assign({},r,{left:r.x,top:r.y,right:r.x+r.width,bottom:r.y+r.height})}function u7(r,e){var t=Gc(r,!1,e==="fixed");return t.top=t.top+r.clientTop,t.left=t.left+r.clientLeft,t.bottom=t.top+r.clientHeight,t.right=t.left+r.clientWidth,t.width=r.clientWidth,t.height=r.clientHeight,t.x=t.left,t.y=t.top,t}function PM(r,e,t){return e===S3?Wx(s7(r,t)):su(e)?u7(e,t):Wx(l7(Os(r)))}function c7(r){var e=Fh(a0(r)),t=["absolute","fixed"].indexOf(mo(r).position)>=0,n=t&&fi(r)?hp(r):r;return su(n)?e.filter(function(i){return su(i)&&M3(i,n)&&Aa(i)!=="body"}):[]}function f7(r,e,t,n){var i=e==="clippingParents"?c7(r):[].concat(e),a=[].concat(i,[t]),o=a[0],s=a.reduce(function(l,u){var c=PM(r,u,n);return l.top=Fl(c.top,l.top),l.right=sg(c.right,l.right),l.bottom=sg(c.bottom,l.bottom),l.left=Fl(c.left,l.left),l},PM(r,o,n));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function I3(r){var e=r.reference,t=r.element,n=r.placement,i=n?ya(n):null,a=n?Wc(n):null,o=e.x+e.width/2-t.width/2,s=e.y+e.height/2-t.height/2,l;switch(i){case Mn:l={x:o,y:e.y-t.height};break;case di:l={x:o,y:e.y+e.height};break;case pi:l={x:e.x+e.width,y:s};break;case kn:l={x:e.x-t.width,y:s};break;default:l={x:e.x,y:e.y}}var u=i?WS(i):null;if(u!=null){var c=u==="y"?"height":"width";switch(a){case $c:l[u]=l[u]-(e[c]/2-t[c]/2);break;case md:l[u]=l[u]+(e[c]/2-t[c]/2);break}}return l}function gd(r,e){e===void 0&&(e={});var t=e,n=t.placement,i=n===void 0?r.placement:n,a=t.strategy,o=a===void 0?r.strategy:a,s=t.boundary,l=s===void 0?IH:s,u=t.rootBoundary,c=u===void 0?S3:u,f=t.elementContext,h=f===void 0?Rf:f,d=t.altBoundary,p=d===void 0?!1:d,v=t.padding,m=v===void 0?0:v,g=D3(typeof m!="number"?m:E3(m,fp)),y=h===Rf?PH:Rf,b=r.rects.popper,_=r.elements[p?y:h],x=f7(su(_)?_:_.contextElement||Os(r.elements.popper),l,c,o),w=Gc(r.elements.reference),S=I3({reference:w,element:b,placement:i}),T=Wx(Object.assign({},b,S)),C=h===Rf?T:w,A={top:x.top-C.top+g.top,bottom:C.bottom-x.bottom+g.bottom,left:x.left-C.left+g.left,right:C.right-x.right+g.right},M=r.modifiersData.offset;if(h===Rf&&M){var D=M[i];Object.keys(A).forEach(function(E){var L=[pi,di].indexOf(E)>=0?1:-1,I=[Mn,di].indexOf(E)>=0?"y":"x";A[E]+=D[I]*L})}return A}function h7(r,e){e===void 0&&(e={});var t=e,n=t.placement,i=t.boundary,a=t.rootBoundary,o=t.padding,s=t.flipVariations,l=t.allowedAutoPlacements,u=l===void 0?T3:l,c=Wc(n),f=c?s?DM:DM.filter(function(p){return Wc(p)===c}):fp,h=f.filter(function(p){return u.indexOf(p)>=0});h.length===0&&(h=f);var d=h.reduce(function(p,v){return p[v]=gd(r,{placement:v,boundary:i,rootBoundary:a,padding:o})[ya(v)],p},{});return Object.keys(d).sort(function(p,v){return d[p]-d[v]})}function d7(r){if(ya(r)===$S)return[];var e=_m(r);return[IM(r),e,IM(e)]}function p7(r){var e=r.state,t=r.options,n=r.name;if(!e.modifiersData[n]._skip){for(var i=t.mainAxis,a=i===void 0?!0:i,o=t.altAxis,s=o===void 0?!0:o,l=t.fallbackPlacements,u=t.padding,c=t.boundary,f=t.rootBoundary,h=t.altBoundary,d=t.flipVariations,p=d===void 0?!0:d,v=t.allowedAutoPlacements,m=e.options.placement,g=ya(m),y=g===m,b=l||(y||!p?[_m(m)]:d7(m)),_=[m].concat(b).reduce(function(J,U){return J.concat(ya(U)===$S?h7(e,{placement:U,boundary:c,rootBoundary:f,padding:u,flipVariations:p,allowedAutoPlacements:v}):U)},[]),x=e.rects.reference,w=e.rects.popper,S=new Map,T=!0,C=_[0],A=0;A<_.length;A++){var M=_[A],D=ya(M),E=Wc(M)===$c,L=[Mn,di].indexOf(D)>=0,I=L?"width":"height",R=gd(e,{placement:M,boundary:c,rootBoundary:f,altBoundary:h,padding:u}),P=L?E?pi:kn:E?di:Mn;x[I]>w[I]&&(P=_m(P));var O=_m(P),j=[];if(a&&j.push(R[D]<=0),s&&j.push(R[P]<=0,R[O]<=0),j.every(function(J){return J})){C=M,T=!1;break}S.set(M,j)}if(T)for(var F=p?3:1,N=function(U){var we=_.find(function(Ye){var ge=S.get(Ye);if(ge)return ge.slice(0,U).every(function(le){return le})});if(we)return C=we,"break"},B=F;B>0;B--){var $=N(B);if($==="break")break}e.placement!==C&&(e.modifiersData[n]._skip=!0,e.placement=C,e.reset=!0)}}const v7={name:"flip",enabled:!0,phase:"main",fn:p7,requiresIfExists:["offset"],data:{_skip:!1}};function RM(r,e,t){return t===void 0&&(t={x:0,y:0}),{top:r.top-e.height-t.y,right:r.right-e.width+t.x,bottom:r.bottom-e.height+t.y,left:r.left-e.width-t.x}}function OM(r){return[Mn,pi,di,kn].some(function(e){return r[e]>=0})}function m7(r){var e=r.state,t=r.name,n=e.rects.reference,i=e.rects.popper,a=e.modifiersData.preventOverflow,o=gd(e,{elementContext:"reference"}),s=gd(e,{altBoundary:!0}),l=RM(o,n),u=RM(s,i,a),c=OM(l),f=OM(u);e.modifiersData[t]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":f})}const g7={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:m7};function y7(r,e,t){var n=ya(r),i=[kn,Mn].indexOf(n)>=0?-1:1,a=typeof t=="function"?t(Object.assign({},e,{placement:r})):t,o=a[0],s=a[1];return o=o||0,s=(s||0)*i,[kn,pi].indexOf(n)>=0?{x:s,y:o}:{x:o,y:s}}function b7(r){var e=r.state,t=r.options,n=r.name,i=t.offset,a=i===void 0?[0,0]:i,o=T3.reduce(function(c,f){return c[f]=y7(f,e.rects,a),c},{}),s=o[e.placement],l=s.x,u=s.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=u),e.modifiersData[n]=o}const _7={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:b7};function x7(r){var e=r.state,t=r.name;e.modifiersData[t]=I3({reference:e.rects.reference,element:e.rects.popper,placement:e.placement})}const w7={name:"popperOffsets",enabled:!0,phase:"read",fn:x7,data:{}};function S7(r){return r==="x"?"y":"x"}function T7(r){var e=r.state,t=r.options,n=r.name,i=t.mainAxis,a=i===void 0?!0:i,o=t.altAxis,s=o===void 0?!1:o,l=t.boundary,u=t.rootBoundary,c=t.altBoundary,f=t.padding,h=t.tether,d=h===void 0?!0:h,p=t.tetherOffset,v=p===void 0?0:p,m=gd(e,{boundary:l,rootBoundary:u,padding:f,altBoundary:c}),g=ya(e.placement),y=Wc(e.placement),b=!y,_=WS(g),x=S7(_),w=e.modifiersData.popperOffsets,S=e.rects.reference,T=e.rects.popper,C=typeof v=="function"?v(Object.assign({},e.rects,{placement:e.placement})):v,A=typeof C=="number"?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),M=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,D={x:0,y:0};if(w){if(a){var E,L=_==="y"?Mn:kn,I=_==="y"?di:pi,R=_==="y"?"height":"width",P=w[_],O=P+m[L],j=P-m[I],F=d?-T[R]/2:0,N=y===$c?S[R]:T[R],B=y===$c?-T[R]:-S[R],$=e.elements.arrow,J=d&&$?GS($):{width:0,height:0},U=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:k3(),we=U[L],Ye=U[I],ge=zh(0,S[R],J[R]),le=b?S[R]/2-F-ge-we-A.mainAxis:N-ge-we-A.mainAxis,be=b?-S[R]/2+F+ge+Ye+A.mainAxis:B+ge+Ye+A.mainAxis,re=e.elements.arrow&&hp(e.elements.arrow),G=re?_==="y"?re.clientTop||0:re.clientLeft||0:0,ee=(E=M==null?void 0:M[_])!=null?E:0,Q=P+le-ee-G,me=P+be-ee,he=zh(d?sg(O,Q):O,P,d?Fl(j,me):j);w[_]=he,D[_]=he-P}if(s){var Se,Fe=_==="x"?Mn:kn,xe=_==="x"?di:pi,rt=w[x],at=x==="y"?"height":"width",ht=rt+m[Fe],fr=rt-m[xe],yr=[Mn,kn].indexOf(g)!==-1,en=(Se=M==null?void 0:M[x])!=null?Se:0,tn=yr?ht:rt-S[at]-T[at]-en+A.altAxis,pe=yr?rt+S[at]+T[at]-en-A.altAxis:fr,De=d&&yr?qH(tn,rt,pe):zh(d?tn:ht,rt,d?pe:fr);w[x]=De,D[x]=De-rt}e.modifiersData[n]=D}}const C7={name:"preventOverflow",enabled:!0,phase:"main",fn:T7,requiresIfExists:["offset"]};function A7(r){return{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}}function M7(r){return r===$n(r)||!fi(r)?US(r):A7(r)}function k7(r){var e=r.getBoundingClientRect(),t=Hc(e.width)/r.offsetWidth||1,n=Hc(e.height)/r.offsetHeight||1;return t!==1||n!==1}function D7(r,e,t){t===void 0&&(t=!1);var n=fi(e),i=fi(e)&&k7(e),a=Os(e),o=Gc(r,i,t),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!t)&&((Aa(e)!=="body"||qS(a))&&(s=M7(e)),fi(e)?(l=Gc(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):a&&(l.x=YS(a))),{x:o.left+s.scrollLeft-l.x,y:o.top+s.scrollTop-l.y,width:o.width,height:o.height}}function E7(r){var e=new Map,t=new Set,n=[];r.forEach(function(a){e.set(a.name,a)});function i(a){t.add(a.name);var o=[].concat(a.requires||[],a.requiresIfExists||[]);o.forEach(function(s){if(!t.has(s)){var l=e.get(s);l&&i(l)}}),n.push(a)}return r.forEach(function(a){t.has(a.name)||i(a)}),n}function L7(r){var e=E7(r);return HH.reduce(function(t,n){return t.concat(e.filter(function(i){return i.phase===n}))},[])}function I7(r){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(r())})})),e}}function P7(r){var e=r.reduce(function(t,n){var i=t[n.name];return t[n.name]=i?Object.assign({},i,n,{options:Object.assign({},i.options,n.options),data:Object.assign({},i.data,n.data)}):n,t},{});return Object.keys(e).map(function(t){return e[t]})}var jM={placement:"bottom",modifiers:[],strategy:"absolute"};function NM(){for(var r=arguments.length,e=new Array(r),t=0;t',airplay:'',"alert-circle":'',"alert-octagon":'',"alert-triangle":'',"align-center":'',"align-justify":'',"align-left":'',"align-right":'',anchor:'',aperture:'',archive:'',"arrow-down-circle":'',"arrow-down-left":'',"arrow-down-right":'',"arrow-down":'',"arrow-left-circle":'',"arrow-left":'',"arrow-right-circle":'',"arrow-right":'',"arrow-up-circle":'',"arrow-up-left":'',"arrow-up-right":'',"arrow-up":'',"at-sign":'',award:'',"bar-chart-2":'',"bar-chart":'',"battery-charging":'',battery:'',"bell-off":'',bell:'',bluetooth:'',bold:'',"book-open":'',book:'',bookmark:'',box:'',briefcase:'',calendar:'',"camera-off":'',camera:'',cast:'',"check-circle":'',"check-square":'',check:'',"chevron-down":'',"chevron-left":'',"chevron-right":'',"chevron-up":'',"chevrons-down":'',"chevrons-left":'',"chevrons-right":'',"chevrons-up":'',chrome:'',circle:'',clipboard:'',clock:'',"cloud-drizzle":'',"cloud-lightning":'',"cloud-off":'',"cloud-rain":'',"cloud-snow":'',cloud:'',code:'',codepen:'',codesandbox:'',coffee:'',columns:'',command:'',compass:'',copy:'',"corner-down-left":'',"corner-down-right":'',"corner-left-down":'',"corner-left-up":'',"corner-right-down":'',"corner-right-up":'',"corner-up-left":'',"corner-up-right":'',cpu:'',"credit-card":'',crop:'',crosshair:'',database:'',delete:'',disc:'',"divide-circle":'',"divide-square":'',divide:'',"dollar-sign":'',"download-cloud":'',download:'',dribbble:'',droplet:'',"edit-2":'',"edit-3":'',edit:'',"external-link":'',"eye-off":'',eye:'',facebook:'',"fast-forward":'',feather:'',figma:'',"file-minus":'',"file-plus":'',"file-text":'',file:'',film:'',filter:'',flag:'',"folder-minus":'',"folder-plus":'',folder:'',framer:'',frown:'',gift:'',"git-branch":'',"git-commit":'',"git-merge":'',"git-pull-request":'',github:'',gitlab:'',globe:'',grid:'',"hard-drive":'',hash:'',headphones:'',heart:'',"help-circle":'',hexagon:'',home:'',image:'',inbox:'',info:'',instagram:'',italic:'',key:'',layers:'',layout:'',"life-buoy":'',"link-2":'',link:'',linkedin:'',list:'',loader:'',lock:'',"log-in":'',"log-out":'',mail:'',"map-pin":'',map:'',"maximize-2":'',maximize:'',meh:'',menu:'',"message-circle":'',"message-square":'',"mic-off":'',mic:'',"minimize-2":'',minimize:'',"minus-circle":'',"minus-square":'',minus:'',monitor:'',moon:'',"more-horizontal":'',"more-vertical":'',"mouse-pointer":'',move:'',music:'',"navigation-2":'',navigation:'',octagon:'',package:'',paperclip:'',"pause-circle":'',pause:'',"pen-tool":'',percent:'',"phone-call":'',"phone-forwarded":'',"phone-incoming":'',"phone-missed":'',"phone-off":'',"phone-outgoing":'',phone:'',"pie-chart":'',"play-circle":'',play:'',"plus-circle":'',"plus-square":'',plus:'',pocket:'',power:'',printer:'',radio:'',"refresh-ccw":'',"refresh-cw":'',repeat:'',rewind:'',"rotate-ccw":'',"rotate-cw":'',rss:'',save:'',scissors:'',search:'',send:'',server:'',settings:'',"share-2":'',share:'',"shield-off":'',shield:'',"shopping-bag":'',"shopping-cart":'',shuffle:'',sidebar:'',"skip-back":'',"skip-forward":'',slack:'',slash:'',sliders:'',smartphone:'',smile:'',speaker:'',square:'',star:'',"stop-circle":'',sun:'',sunrise:'',sunset:'',table:'',tablet:'',tag:'',target:'',terminal:'',thermometer:'',"thumbs-down":'',"thumbs-up":'',"toggle-left":'',"toggle-right":'',tool:'',"trash-2":'',trash:'',trello:'',"trending-down":'',"trending-up":'',triangle:'',truck:'',tv:'',twitch:'',twitter:'',type:'',umbrella:'',underline:'',unlock:'',"upload-cloud":'',upload:'',"user-check":'',"user-minus":'',"user-plus":'',"user-x":'',user:'',users:'',"video-off":'',video:'',voicemail:'',"volume-1":'',"volume-2":'',"volume-x":'',volume:'',watch:'',"wifi-off":'',wifi:'',wind:'',"x-circle":'',"x-octagon":'',"x-square":'',x:'',youtube:'',"zap-off":'',zap:'',"zoom-in":'',"zoom-out":''}},"./node_modules/classnames/dedupe.js":function(t,n,i){var a,o;/*! Copyright (c) 2016 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */(function(){var s=function(){function l(){}l.prototype=Object.create(null);function u(g,y){for(var b=y.length,_=0;_1?arguments[1]:void 0,y=g!==void 0,b=0,_=f(p),x,w,S,T;if(y&&(g=a(g,m>2?arguments[2]:void 0,2)),_!=null&&!(v==Array&&l(_)))for(T=_.call(p),w=new v;!(S=T.next()).done;b++)c(w,b,y?s(T,g,[S.value,b],!0):S.value);else for(x=u(p.length),w=new v(x);x>b;b++)c(w,b,y?g(p[b],b):p[b]);return w.length=b,w}},"./node_modules/core-js/internals/array-includes.js":function(t,n,i){var a=i("./node_modules/core-js/internals/to-indexed-object.js"),o=i("./node_modules/core-js/internals/to-length.js"),s=i("./node_modules/core-js/internals/to-absolute-index.js");t.exports=function(l){return function(u,c,f){var h=a(u),d=o(h.length),p=s(f,d),v;if(l&&c!=c){for(;d>p;)if(v=h[p++],v!=v)return!0}else for(;d>p;p++)if((l||p in h)&&h[p]===c)return l||p||0;return!l&&-1}}},"./node_modules/core-js/internals/bind-context.js":function(t,n,i){var a=i("./node_modules/core-js/internals/a-function.js");t.exports=function(o,s,l){if(a(o),s===void 0)return o;switch(l){case 0:return function(){return o.call(s)};case 1:return function(u){return o.call(s,u)};case 2:return function(u,c){return o.call(s,u,c)};case 3:return function(u,c,f){return o.call(s,u,c,f)}}return function(){return o.apply(s,arguments)}}},"./node_modules/core-js/internals/call-with-safe-iteration-closing.js":function(t,n,i){var a=i("./node_modules/core-js/internals/an-object.js");t.exports=function(o,s,l,u){try{return u?s(a(l)[0],l[1]):s(l)}catch(f){var c=o.return;throw c!==void 0&&a(c.call(o)),f}}},"./node_modules/core-js/internals/check-correctness-of-iteration.js":function(t,n,i){var a=i("./node_modules/core-js/internals/well-known-symbol.js"),o=a("iterator"),s=!1;try{var l=0,u={next:function(){return{done:!!l++}},return:function(){s=!0}};u[o]=function(){return this},Array.from(u,function(){throw 2})}catch{}t.exports=function(c,f){if(!f&&!s)return!1;var h=!1;try{var d={};d[o]=function(){return{next:function(){return{done:h=!0}}}},c(d)}catch{}return h}},"./node_modules/core-js/internals/classof-raw.js":function(t,n){var i={}.toString;t.exports=function(a){return i.call(a).slice(8,-1)}},"./node_modules/core-js/internals/classof.js":function(t,n,i){var a=i("./node_modules/core-js/internals/classof-raw.js"),o=i("./node_modules/core-js/internals/well-known-symbol.js"),s=o("toStringTag"),l=a(function(){return arguments}())=="Arguments",u=function(c,f){try{return c[f]}catch{}};t.exports=function(c){var f,h,d;return c===void 0?"Undefined":c===null?"Null":typeof(h=u(f=Object(c),s))=="string"?h:l?a(f):(d=a(f))=="Object"&&typeof f.callee=="function"?"Arguments":d}},"./node_modules/core-js/internals/copy-constructor-properties.js":function(t,n,i){var a=i("./node_modules/core-js/internals/has.js"),o=i("./node_modules/core-js/internals/own-keys.js"),s=i("./node_modules/core-js/internals/object-get-own-property-descriptor.js"),l=i("./node_modules/core-js/internals/object-define-property.js");t.exports=function(u,c){for(var f=o(c),h=l.f,d=s.f,p=0;p",x="java"+b+":",w;for(m.style.display="none",u.appendChild(m),m.src=String(x),w=m.contentWindow.document,w.open(),w.write(y+b+_+"document.F=Object"+y+"/"+b+_),w.close(),v=w.F;g--;)delete v[d][s[g]];return v()};t.exports=Object.create||function(g,y){var b;return g!==null?(p[d]=a(g),b=new p,p[d]=null,b[h]=g):b=v(),y===void 0?b:o(b,y)},l[h]=!0},"./node_modules/core-js/internals/object-define-properties.js":function(t,n,i){var a=i("./node_modules/core-js/internals/descriptors.js"),o=i("./node_modules/core-js/internals/object-define-property.js"),s=i("./node_modules/core-js/internals/an-object.js"),l=i("./node_modules/core-js/internals/object-keys.js");t.exports=a?Object.defineProperties:function(c,f){s(c);for(var h=l(f),d=h.length,p=0,v;d>p;)o.f(c,v=h[p++],f[v]);return c}},"./node_modules/core-js/internals/object-define-property.js":function(t,n,i){var a=i("./node_modules/core-js/internals/descriptors.js"),o=i("./node_modules/core-js/internals/ie8-dom-define.js"),s=i("./node_modules/core-js/internals/an-object.js"),l=i("./node_modules/core-js/internals/to-primitive.js"),u=Object.defineProperty;n.f=a?u:function(f,h,d){if(s(f),h=l(h,!0),s(d),o)try{return u(f,h,d)}catch{}if("get"in d||"set"in d)throw TypeError("Accessors not supported");return"value"in d&&(f[h]=d.value),f}},"./node_modules/core-js/internals/object-get-own-property-descriptor.js":function(t,n,i){var a=i("./node_modules/core-js/internals/descriptors.js"),o=i("./node_modules/core-js/internals/object-property-is-enumerable.js"),s=i("./node_modules/core-js/internals/create-property-descriptor.js"),l=i("./node_modules/core-js/internals/to-indexed-object.js"),u=i("./node_modules/core-js/internals/to-primitive.js"),c=i("./node_modules/core-js/internals/has.js"),f=i("./node_modules/core-js/internals/ie8-dom-define.js"),h=Object.getOwnPropertyDescriptor;n.f=a?h:function(p,v){if(p=l(p),v=u(v,!0),f)try{return h(p,v)}catch{}if(c(p,v))return s(!o.f.call(p,v),p[v])}},"./node_modules/core-js/internals/object-get-own-property-names.js":function(t,n,i){var a=i("./node_modules/core-js/internals/object-keys-internal.js"),o=i("./node_modules/core-js/internals/enum-bug-keys.js"),s=o.concat("length","prototype");n.f=Object.getOwnPropertyNames||function(u){return a(u,s)}},"./node_modules/core-js/internals/object-get-own-property-symbols.js":function(t,n){n.f=Object.getOwnPropertySymbols},"./node_modules/core-js/internals/object-get-prototype-of.js":function(t,n,i){var a=i("./node_modules/core-js/internals/has.js"),o=i("./node_modules/core-js/internals/to-object.js"),s=i("./node_modules/core-js/internals/shared-key.js"),l=i("./node_modules/core-js/internals/correct-prototype-getter.js"),u=s("IE_PROTO"),c=Object.prototype;t.exports=l?Object.getPrototypeOf:function(f){return f=o(f),a(f,u)?f[u]:typeof f.constructor=="function"&&f instanceof f.constructor?f.constructor.prototype:f instanceof Object?c:null}},"./node_modules/core-js/internals/object-keys-internal.js":function(t,n,i){var a=i("./node_modules/core-js/internals/has.js"),o=i("./node_modules/core-js/internals/to-indexed-object.js"),s=i("./node_modules/core-js/internals/array-includes.js"),l=i("./node_modules/core-js/internals/hidden-keys.js"),u=s(!1);t.exports=function(c,f){var h=o(c),d=0,p=[],v;for(v in h)!a(l,v)&&a(h,v)&&p.push(v);for(;f.length>d;)a(h,v=f[d++])&&(~u(p,v)||p.push(v));return p}},"./node_modules/core-js/internals/object-keys.js":function(t,n,i){var a=i("./node_modules/core-js/internals/object-keys-internal.js"),o=i("./node_modules/core-js/internals/enum-bug-keys.js");t.exports=Object.keys||function(l){return a(l,o)}},"./node_modules/core-js/internals/object-property-is-enumerable.js":function(t,n,i){var a={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,s=o&&!a.call({1:2},1);n.f=s?function(u){var c=o(this,u);return!!c&&c.enumerable}:a},"./node_modules/core-js/internals/object-set-prototype-of.js":function(t,n,i){var a=i("./node_modules/core-js/internals/validate-set-prototype-of-arguments.js");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var o=!1,s={},l;try{l=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,l.call(s,[]),o=s instanceof Array}catch{}return function(c,f){return a(c,f),o?l.call(c,f):c.__proto__=f,c}}():void 0)},"./node_modules/core-js/internals/own-keys.js":function(t,n,i){var a=i("./node_modules/core-js/internals/global.js"),o=i("./node_modules/core-js/internals/object-get-own-property-names.js"),s=i("./node_modules/core-js/internals/object-get-own-property-symbols.js"),l=i("./node_modules/core-js/internals/an-object.js"),u=a.Reflect;t.exports=u&&u.ownKeys||function(f){var h=o.f(l(f)),d=s.f;return d?h.concat(d(f)):h}},"./node_modules/core-js/internals/path.js":function(t,n,i){t.exports=i("./node_modules/core-js/internals/global.js")},"./node_modules/core-js/internals/redefine.js":function(t,n,i){var a=i("./node_modules/core-js/internals/global.js"),o=i("./node_modules/core-js/internals/shared.js"),s=i("./node_modules/core-js/internals/hide.js"),l=i("./node_modules/core-js/internals/has.js"),u=i("./node_modules/core-js/internals/set-global.js"),c=i("./node_modules/core-js/internals/function-to-string.js"),f=i("./node_modules/core-js/internals/internal-state.js"),h=f.get,d=f.enforce,p=String(c).split("toString");o("inspectSource",function(v){return c.call(v)}),(t.exports=function(v,m,g,y){var b=y?!!y.unsafe:!1,_=y?!!y.enumerable:!1,x=y?!!y.noTargetGet:!1;if(typeof g=="function"&&(typeof m=="string"&&!l(g,"name")&&s(g,"name",m),d(g).source=p.join(typeof m=="string"?m:"")),v===a){_?v[m]=g:u(m,g);return}else b?!x&&v[m]&&(_=!0):delete v[m];_?v[m]=g:s(v,m,g)})(Function.prototype,"toString",function(){return typeof this=="function"&&h(this).source||c.call(this)})},"./node_modules/core-js/internals/require-object-coercible.js":function(t,n){t.exports=function(i){if(i==null)throw TypeError("Can't call method on "+i);return i}},"./node_modules/core-js/internals/set-global.js":function(t,n,i){var a=i("./node_modules/core-js/internals/global.js"),o=i("./node_modules/core-js/internals/hide.js");t.exports=function(s,l){try{o(a,s,l)}catch{a[s]=l}return l}},"./node_modules/core-js/internals/set-to-string-tag.js":function(t,n,i){var a=i("./node_modules/core-js/internals/object-define-property.js").f,o=i("./node_modules/core-js/internals/has.js"),s=i("./node_modules/core-js/internals/well-known-symbol.js"),l=s("toStringTag");t.exports=function(u,c,f){u&&!o(u=f?u:u.prototype,l)&&a(u,l,{configurable:!0,value:c})}},"./node_modules/core-js/internals/shared-key.js":function(t,n,i){var a=i("./node_modules/core-js/internals/shared.js"),o=i("./node_modules/core-js/internals/uid.js"),s=a("keys");t.exports=function(l){return s[l]||(s[l]=o(l))}},"./node_modules/core-js/internals/shared.js":function(t,n,i){var a=i("./node_modules/core-js/internals/global.js"),o=i("./node_modules/core-js/internals/set-global.js"),s=i("./node_modules/core-js/internals/is-pure.js"),l="__core-js_shared__",u=a[l]||o(l,{});(t.exports=function(c,f){return u[c]||(u[c]=f!==void 0?f:{})})("versions",[]).push({version:"3.1.3",mode:s?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},"./node_modules/core-js/internals/string-at.js":function(t,n,i){var a=i("./node_modules/core-js/internals/to-integer.js"),o=i("./node_modules/core-js/internals/require-object-coercible.js");t.exports=function(s,l,u){var c=String(o(s)),f=a(l),h=c.length,d,p;return f<0||f>=h?u?"":void 0:(d=c.charCodeAt(f),d<55296||d>56319||f+1===h||(p=c.charCodeAt(f+1))<56320||p>57343?u?c.charAt(f):d:u?c.slice(f,f+2):(d-55296<<10)+(p-56320)+65536)}},"./node_modules/core-js/internals/to-absolute-index.js":function(t,n,i){var a=i("./node_modules/core-js/internals/to-integer.js"),o=Math.max,s=Math.min;t.exports=function(l,u){var c=a(l);return c<0?o(c+u,0):s(c,u)}},"./node_modules/core-js/internals/to-indexed-object.js":function(t,n,i){var a=i("./node_modules/core-js/internals/indexed-object.js"),o=i("./node_modules/core-js/internals/require-object-coercible.js");t.exports=function(s){return a(o(s))}},"./node_modules/core-js/internals/to-integer.js":function(t,n){var i=Math.ceil,a=Math.floor;t.exports=function(o){return isNaN(o=+o)?0:(o>0?a:i)(o)}},"./node_modules/core-js/internals/to-length.js":function(t,n,i){var a=i("./node_modules/core-js/internals/to-integer.js"),o=Math.min;t.exports=function(s){return s>0?o(a(s),9007199254740991):0}},"./node_modules/core-js/internals/to-object.js":function(t,n,i){var a=i("./node_modules/core-js/internals/require-object-coercible.js");t.exports=function(o){return Object(a(o))}},"./node_modules/core-js/internals/to-primitive.js":function(t,n,i){var a=i("./node_modules/core-js/internals/is-object.js");t.exports=function(o,s){if(!a(o))return o;var l,u;if(s&&typeof(l=o.toString)=="function"&&!a(u=l.call(o))||typeof(l=o.valueOf)=="function"&&!a(u=l.call(o))||!s&&typeof(l=o.toString)=="function"&&!a(u=l.call(o)))return u;throw TypeError("Can't convert object to primitive value")}},"./node_modules/core-js/internals/uid.js":function(t,n){var i=0,a=Math.random();t.exports=function(o){return"Symbol(".concat(o===void 0?"":o,")_",(++i+a).toString(36))}},"./node_modules/core-js/internals/validate-set-prototype-of-arguments.js":function(t,n,i){var a=i("./node_modules/core-js/internals/is-object.js"),o=i("./node_modules/core-js/internals/an-object.js");t.exports=function(s,l){if(o(s),!a(l)&&l!==null)throw TypeError("Can't set "+String(l)+" as a prototype")}},"./node_modules/core-js/internals/well-known-symbol.js":function(t,n,i){var a=i("./node_modules/core-js/internals/global.js"),o=i("./node_modules/core-js/internals/shared.js"),s=i("./node_modules/core-js/internals/uid.js"),l=i("./node_modules/core-js/internals/native-symbol.js"),u=a.Symbol,c=o("wks");t.exports=function(f){return c[f]||(c[f]=l&&u[f]||(l?u:s)("Symbol."+f))}},"./node_modules/core-js/modules/es.array.from.js":function(t,n,i){var a=i("./node_modules/core-js/internals/export.js"),o=i("./node_modules/core-js/internals/array-from.js"),s=i("./node_modules/core-js/internals/check-correctness-of-iteration.js"),l=!s(function(u){Array.from(u)});a({target:"Array",stat:!0,forced:l},{from:o})},"./node_modules/core-js/modules/es.string.iterator.js":function(t,n,i){var a=i("./node_modules/core-js/internals/string-at.js"),o=i("./node_modules/core-js/internals/internal-state.js"),s=i("./node_modules/core-js/internals/define-iterator.js"),l="String Iterator",u=o.set,c=o.getterFor(l);s(String,"String",function(f){u(this,{type:l,string:String(f),index:0})},function(){var h=c(this),d=h.string,p=h.index,v;return p>=d.length?{value:void 0,done:!0}:(v=a(d,p,!0),h.index+=v.length,{value:v,done:!1})})},"./node_modules/webpack/buildin/global.js":function(t,n){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch{typeof window=="object"&&(i=window)}t.exports=i},"./src/default-attrs.json":function(t){t.exports={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"}},"./src/icon.js":function(t,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=Object.assign||function(v){for(var m=1;m2&&arguments[2]!==void 0?arguments[2]:[];h(this,v),this.name=m,this.contents=g,this.tags=y,this.attrs=a({},c.default,{class:"feather feather-"+m})}return o(v,[{key:"toSvg",value:function(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},y=a({},this.attrs,g,{class:(0,l.default)(this.attrs.class,g.class)});return""+this.contents+""}},{key:"toString",value:function(){return this.contents}}]),v}();function p(v){return Object.keys(v).map(function(m){return m+'="'+v[m]+'"'}).join(" ")}n.default=d},"./src/icons.js":function(t,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i("./src/icon.js"),o=f(a),s=i("./dist/icons.json"),l=f(s),u=i("./src/tags.json"),c=f(u);function f(h){return h&&h.__esModule?h:{default:h}}n.default=Object.keys(l.default).map(function(h){return new o.default(h,l.default[h],c.default[h])}).reduce(function(h,d){return h[d.name]=d,h},{})},"./src/index.js":function(t,n,i){var a=i("./src/icons.js"),o=f(a),s=i("./src/to-svg.js"),l=f(s),u=i("./src/replace.js"),c=f(u);function f(h){return h&&h.__esModule?h:{default:h}}t.exports={icons:o.default,toSvg:l.default,replace:c.default}},"./src/replace.js":function(t,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=Object.assign||function(p){for(var v=1;v0&&arguments[0]!==void 0?arguments[0]:{};if(typeof document>"u")throw new Error("`feather.replace()` only works in a browser environment.");var v=document.querySelectorAll("[data-feather]");Array.from(v).forEach(function(m){return h(m,p)})}function h(p){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m=d(p),g=m["data-feather"];if(delete m["data-feather"],u.default[g]===void 0){console.warn("feather: '"+g+"' is not a valid icon");return}var y=u.default[g].toSvg(a({},v,m,{class:(0,s.default)(v.class,m.class)})),b=new DOMParser().parseFromString(y,"image/svg+xml"),_=b.querySelector("svg");p.parentNode.replaceChild(_,p)}function d(p){return Array.from(p.attributes).reduce(function(v,m){return v[m.name]=m.value,v},{})}n.default=f},"./src/tags.json":function(t){t.exports={activity:["pulse","health","action","motion"],airplay:["stream","cast","mirroring"],"alert-circle":["warning","alert","danger"],"alert-octagon":["warning","alert","danger"],"alert-triangle":["warning","alert","danger"],"align-center":["text alignment","center"],"align-justify":["text alignment","justified"],"align-left":["text alignment","left"],"align-right":["text alignment","right"],anchor:[],archive:["index","box"],"at-sign":["mention","at","email","message"],award:["achievement","badge"],aperture:["camera","photo"],"bar-chart":["statistics","diagram","graph"],"bar-chart-2":["statistics","diagram","graph"],battery:["power","electricity"],"battery-charging":["power","electricity"],bell:["alarm","notification","sound"],"bell-off":["alarm","notification","silent"],bluetooth:["wireless"],"book-open":["read","library"],book:["read","dictionary","booklet","magazine","library"],bookmark:["read","clip","marker","tag"],box:["cube"],briefcase:["work","bag","baggage","folder"],calendar:["date"],camera:["photo"],cast:["chromecast","airplay"],"chevron-down":["expand"],"chevron-up":["collapse"],circle:["off","zero","record"],clipboard:["copy"],clock:["time","watch","alarm"],"cloud-drizzle":["weather","shower"],"cloud-lightning":["weather","bolt"],"cloud-rain":["weather"],"cloud-snow":["weather","blizzard"],cloud:["weather"],codepen:["logo"],codesandbox:["logo"],code:["source","programming"],coffee:["drink","cup","mug","tea","cafe","hot","beverage"],columns:["layout"],command:["keyboard","cmd","terminal","prompt"],compass:["navigation","safari","travel","direction"],copy:["clone","duplicate"],"corner-down-left":["arrow","return"],"corner-down-right":["arrow"],"corner-left-down":["arrow"],"corner-left-up":["arrow"],"corner-right-down":["arrow"],"corner-right-up":["arrow"],"corner-up-left":["arrow"],"corner-up-right":["arrow"],cpu:["processor","technology"],"credit-card":["purchase","payment","cc"],crop:["photo","image"],crosshair:["aim","target"],database:["storage","memory"],delete:["remove"],disc:["album","cd","dvd","music"],"dollar-sign":["currency","money","payment"],droplet:["water"],edit:["pencil","change"],"edit-2":["pencil","change"],"edit-3":["pencil","change"],eye:["view","watch"],"eye-off":["view","watch","hide","hidden"],"external-link":["outbound"],facebook:["logo","social"],"fast-forward":["music"],figma:["logo","design","tool"],"file-minus":["delete","remove","erase"],"file-plus":["add","create","new"],"file-text":["data","txt","pdf"],film:["movie","video"],filter:["funnel","hopper"],flag:["report"],"folder-minus":["directory"],"folder-plus":["directory"],folder:["directory"],framer:["logo","design","tool"],frown:["emoji","face","bad","sad","emotion"],gift:["present","box","birthday","party"],"git-branch":["code","version control"],"git-commit":["code","version control"],"git-merge":["code","version control"],"git-pull-request":["code","version control"],github:["logo","version control"],gitlab:["logo","version control"],globe:["world","browser","language","translate"],"hard-drive":["computer","server","memory","data"],hash:["hashtag","number","pound"],headphones:["music","audio","sound"],heart:["like","love","emotion"],"help-circle":["question mark"],hexagon:["shape","node.js","logo"],home:["house","living"],image:["picture"],inbox:["email"],instagram:["logo","camera"],key:["password","login","authentication","secure"],layers:["stack"],layout:["window","webpage"],"life-buoy":["help","life ring","support"],link:["chain","url"],"link-2":["chain","url"],linkedin:["logo","social media"],list:["options"],lock:["security","password","secure"],"log-in":["sign in","arrow","enter"],"log-out":["sign out","arrow","exit"],mail:["email","message"],"map-pin":["location","navigation","travel","marker"],map:["location","navigation","travel"],maximize:["fullscreen"],"maximize-2":["fullscreen","arrows","expand"],meh:["emoji","face","neutral","emotion"],menu:["bars","navigation","hamburger"],"message-circle":["comment","chat"],"message-square":["comment","chat"],"mic-off":["record","sound","mute"],mic:["record","sound","listen"],minimize:["exit fullscreen","close"],"minimize-2":["exit fullscreen","arrows","close"],minus:["subtract"],monitor:["tv","screen","display"],moon:["dark","night"],"more-horizontal":["ellipsis"],"more-vertical":["ellipsis"],"mouse-pointer":["arrow","cursor"],move:["arrows"],music:["note"],navigation:["location","travel"],"navigation-2":["location","travel"],octagon:["stop"],package:["box","container"],paperclip:["attachment"],pause:["music","stop"],"pause-circle":["music","audio","stop"],"pen-tool":["vector","drawing"],percent:["discount"],"phone-call":["ring"],"phone-forwarded":["call"],"phone-incoming":["call"],"phone-missed":["call"],"phone-off":["call","mute"],"phone-outgoing":["call"],phone:["call"],play:["music","start"],"pie-chart":["statistics","diagram"],"play-circle":["music","start"],plus:["add","new"],"plus-circle":["add","new"],"plus-square":["add","new"],pocket:["logo","save"],power:["on","off"],printer:["fax","office","device"],radio:["signal"],"refresh-cw":["synchronise","arrows"],"refresh-ccw":["arrows"],repeat:["loop","arrows"],rewind:["music"],"rotate-ccw":["arrow"],"rotate-cw":["arrow"],rss:["feed","subscribe"],save:["floppy disk"],scissors:["cut"],search:["find","magnifier","magnifying glass"],send:["message","mail","email","paper airplane","paper aeroplane"],settings:["cog","edit","gear","preferences"],"share-2":["network","connections"],shield:["security","secure"],"shield-off":["security","insecure"],"shopping-bag":["ecommerce","cart","purchase","store"],"shopping-cart":["ecommerce","cart","purchase","store"],shuffle:["music"],"skip-back":["music"],"skip-forward":["music"],slack:["logo"],slash:["ban","no"],sliders:["settings","controls"],smartphone:["cellphone","device"],smile:["emoji","face","happy","good","emotion"],speaker:["audio","music"],star:["bookmark","favorite","like"],"stop-circle":["media","music"],sun:["brightness","weather","light"],sunrise:["weather","time","morning","day"],sunset:["weather","time","evening","night"],tablet:["device"],tag:["label"],target:["logo","bullseye"],terminal:["code","command line","prompt"],thermometer:["temperature","celsius","fahrenheit","weather"],"thumbs-down":["dislike","bad","emotion"],"thumbs-up":["like","good","emotion"],"toggle-left":["on","off","switch"],"toggle-right":["on","off","switch"],tool:["settings","spanner"],trash:["garbage","delete","remove","bin"],"trash-2":["garbage","delete","remove","bin"],triangle:["delta"],truck:["delivery","van","shipping","transport","lorry"],tv:["television","stream"],twitch:["logo"],twitter:["logo","social"],type:["text"],umbrella:["rain","weather"],unlock:["security"],"user-check":["followed","subscribed"],"user-minus":["delete","remove","unfollow","unsubscribe"],"user-plus":["new","add","create","follow","subscribe"],"user-x":["delete","remove","unfollow","unsubscribe","unavailable"],user:["person","account"],users:["group"],"video-off":["camera","movie","film"],video:["camera","movie","film"],voicemail:["phone"],volume:["music","sound","mute"],"volume-1":["music","sound"],"volume-2":["music","sound"],"volume-x":["music","sound","mute"],watch:["clock","time"],"wifi-off":["disabled"],wifi:["connection","signal","wireless"],wind:["weather","air"],"x-circle":["cancel","close","delete","remove","times","clear"],"x-octagon":["delete","stop","alert","warning","times","clear"],"x-square":["cancel","close","delete","remove","times","clear"],x:["cancel","close","delete","remove","times","clear"],youtube:["logo","video","play"],"zap-off":["flash","camera","lightning"],zap:["flash","camera","lightning"],"zoom-in":["magnifying glass"],"zoom-out":["magnifying glass"]}},"./src/to-svg.js":function(t,n,i){Object.defineProperty(n,"__esModule",{value:!0});var a=i("./src/icons.js"),o=s(a);function s(u){return u&&u.__esModule?u:{default:u}}function l(u){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(console.warn("feather.toSvg() is deprecated. Please use feather.icons[name].toSvg() instead."),!u)throw new Error("The required `key` (icon name) parameter is missing.");if(!o.default[u])throw new Error("No icon matching '"+u+"'. See the complete list of icons at https://feathericons.com");return o.default[u].toSvg(c)}n.default=l},0:function(t,n,i){i("./node_modules/core-js/es/array/from.js"),t.exports=i("./src/index.js")}})})})(P3);var N7=P3.exports;const Ux=yH(N7),BM=Object.keys(Ux.icons),xm={props:{name:{type:String,required:!0,validator(r){const e=BM.includes(r);return e||(console.groupCollapsed("[frappe-ui] name property for feather-icon must be one of "),console.dir(BM),console.groupEnd()),e}},color:{type:String,default:null},strokeWidth:{type:Number,default:1.5}},render(){let r=Ux.icons[this.name];return r||(r=Ux.icons.circle),so("svg",rr(r.attrs,{fill:"none",stroke:"currentColor",color:this.color,"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":this.strokeWidth,width:null,height:null,class:[r.attrs.class,"shrink-0"],innerHTML:r.contents},this.$attrs))}},R3=Ke({__name:"LoadingIndicator",props:{scale:{required:!1,default:100}},setup(r){return(e,t)=>(Y(),ae("svg",{class:"max-w-xs animate-spin",xmlns:"http://www.w3.org/2000/svg",fill:"none",style:Sa(`scale: ${r.scale}%;`),viewBox:"0 0 24 24"},t[0]||(t[0]=[Z("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),Z("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)]),4))}});function cf(r,e){const t=typeof r=="string"&&!e?`${r}Context`:e,n=Symbol(t);return[o=>{const s=_H(n,o);if(s||s===null)return s;throw new Error(`Injection \`${n.toString()}\` not found. Component must be used within ${Array.isArray(r)?`one of the following components: ${r.join(", ")}`:`\`${r}\``}`)},o=>($x(n,o),o)]}function ms(){let r=document.activeElement;if(r==null)return null;for(;r!=null&&r.shadowRoot!=null&&r.shadowRoot.activeElement!=null;)r=r.shadowRoot.activeElement;return r}function O3(r,e,t){const n=t.originalEvent.target,i=new CustomEvent(r,{bubbles:!1,cancelable:!0,detail:t});e&&n.addEventListener(r,e,{once:!0}),n.dispatchEvent(i)}function XS(r){return r?r.flatMap(e=>e.type===oi?XS(e.children):[e]):[]}const[B7,sAe]=cf("ConfigProvider");function z7(r,e){var t;const n=zl();return Ta(()=>{n.value=r()},{...e,flush:(t=void 0)!=null?t:"sync"}),lo(n)}function dp(r){return BS()?(zS(r),!0):!1}function F7(){const r=new Set,e=a=>{r.delete(a)};return{on:a=>{r.add(a);const o=()=>e(a);return dp(o),{off:o}},off:e,trigger:(...a)=>Promise.all(Array.from(r).map(o=>o(...a))),clear:()=>{r.clear()}}}function V7(r){let e=!1,t;const n=v3(!0);return(...i)=>(e||(t=n.run(()=>r(...i)),e=!0),t)}function $7(r){let e=0,t,n;const i=()=>{e-=1,n&&e<=0&&(n.stop(),t=void 0,n=void 0)};return(...a)=>(e+=1,n||(n=v3(!0),t=n.run(()=>r(...a))),dp(i),t)}const js=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const H7=r=>typeof r<"u",G7=Object.prototype.toString,W7=r=>G7.call(r)==="[object Object]",zM=U7();function U7(){var r,e;return js&&((r=window==null?void 0:window.navigator)==null?void 0:r.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((e=window==null?void 0:window.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function Y7(r){return xu()}function T1(r){return Array.isArray(r)?r:[r]}function q7(r,e=1e4){return p3((t,n)=>{let i=Nr(r),a;const o=()=>setTimeout(()=>{i=Nr(r),n()},Nr(e));return dp(()=>{clearTimeout(a)}),{get(){return t(),i},set(s){i=s,n(),clearTimeout(a),a=o()}}})}function X7(r,e){Y7()&&xH(r,e)}function j3(r,e,t={}){const{immediate:n=!0,immediateCallback:i=!1}=t,a=zl(!1);let o=null;function s(){o&&(clearTimeout(o),o=null)}function l(){a.value=!1,s()}function u(...c){i&&r(),s(),a.value=!0,o=setTimeout(()=>{a.value=!1,o=null,r(...c)},Nr(e))}return n&&(a.value=!0,js&&u()),dp(l),{isPending:lo(a),start:u,stop:l}}function K7(r,e,t){return Nt(r,e,{...t,immediate:!0})}const KS=js?window:void 0;function pp(r){var e;const t=Nr(r);return(e=t==null?void 0:t.$el)!=null?e:t}function lg(...r){const e=[],t=()=>{e.forEach(s=>s()),e.length=0},n=(s,l,u,c)=>(s.addEventListener(l,u,c),()=>s.removeEventListener(l,u,c)),i=de(()=>{const s=T1(Nr(r[0])).filter(l=>l!=null);return s.every(l=>typeof l!="string")?s:void 0}),a=K7(()=>{var s,l;return[(l=(s=i.value)==null?void 0:s.map(u=>pp(u)))!=null?l:[KS].filter(u=>u!=null),T1(Nr(i.value?r[1]:r[0])),T1(H(i.value?r[2]:r[1])),Nr(i.value?r[3]:r[2])]},([s,l,u,c])=>{if(t(),!(s!=null&&s.length)||!(l!=null&&l.length)||!(u!=null&&u.length))return;const f=W7(c)?{...c}:c;e.push(...s.flatMap(h=>l.flatMap(d=>u.map(p=>n(h,d,p,f)))))},{flush:"post"}),o=()=>{a(),t()};return dp(t),o}function Z7(){const r=zl(!1),e=xu();return e&&zi(()=>{r.value=!0},e),r}function J7(r){return typeof r=="function"?r:typeof r=="string"?e=>e.key===r:Array.isArray(r)?e=>r.includes(e.key):()=>!0}function Q7(...r){let e,t,n={};r.length===3?(e=r[0],t=r[1],n=r[2]):r.length===2?typeof r[1]=="object"?(e=!0,t=r[0],n=r[1]):(e=r[0],t=r[1]):(e=!0,t=r[0]);const{target:i=KS,eventName:a="keydown",passive:o=!1,dedupe:s=!1}=n,l=J7(e);return lg(i,a,c=>{c.repeat&&Nr(s)||l(c)&&t(c)},o)}function e9(r){return JSON.parse(JSON.stringify(r))}function N3(r,e,t,n={}){var i,a,o;const{clone:s=!1,passive:l=!1,eventName:u,deep:c=!1,defaultValue:f,shouldEmit:h}=n,d=xu(),p=t||(d==null?void 0:d.emit)||((i=d==null?void 0:d.$emit)==null?void 0:i.bind(d))||((o=(a=d==null?void 0:d.proxy)==null?void 0:a.$emit)==null?void 0:o.bind(d==null?void 0:d.proxy));let v=u;v=v||`update:${e.toString()}`;const m=b=>s?typeof s=="function"?s(b):e9(b):b,g=()=>H7(r[e])?m(r[e]):f,y=b=>{h?h(b)&&p(v,b):p(v,b)};if(l){const b=g(),_=te(b);let x=!1;return Nt(()=>r[e],w=>{x||(x=!0,_.value=m(w),Ca(()=>x=!1))}),Nt(_,w=>{!x&&(w!==r[e]||c)&&y(w)},{deep:c}),_}else return de({get(){return g()},set(b){y(b)}})}function C1(r){if(r===null||typeof r!="object")return!1;const e=Object.getPrototypeOf(r);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in r?!1:Symbol.toStringTag in r?Object.prototype.toString.call(r)==="[object Module]":!0}function Yx(r,e,t=".",n){if(!C1(e))return Yx(r,{},t,n);const i=Object.assign({},e);for(const a in r){if(a==="__proto__"||a==="constructor")continue;const o=r[a];o!=null&&(n&&n(i,a,o,t)||(Array.isArray(o)&&Array.isArray(i[a])?i[a]=[...o,...i[a]]:C1(o)&&C1(i[a])?i[a]=Yx(o,i[a],(t?`${t}.`:"")+a.toString(),n):i[a]=o))}return i}function t9(r){return(...e)=>e.reduce((t,n)=>Yx(t,n,"",r),{})}const r9=t9(),n9=$7(()=>{const r=te(new Map),e=te(),t=de(()=>{for(const o of r.value.values())if(o)return!0;return!1}),n=B7({scrollBody:te(!0)});let i=null;const a=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.documentElement.style.removeProperty("--scrollbar-width"),document.body.style.overflow=e.value??"",zM&&(i==null||i()),e.value=void 0};return Nt(t,(o,s)=>{var f;if(!js)return;if(!o){s&&a();return}e.value===void 0&&(e.value=document.body.style.overflow);const l=window.innerWidth-document.documentElement.clientWidth,u={padding:l,margin:0},c=(f=n.scrollBody)!=null&&f.value?typeof n.scrollBody.value=="object"?r9({padding:n.scrollBody.value.padding===!0?l:n.scrollBody.value.padding,margin:n.scrollBody.value.margin===!0?l:n.scrollBody.value.margin},u):u:{padding:0,margin:0};l>0&&(document.body.style.paddingRight=typeof c.padding=="number"?`${c.padding}px`:String(c.padding),document.body.style.marginRight=typeof c.margin=="number"?`${c.margin}px`:String(c.margin),document.documentElement.style.setProperty("--scrollbar-width",`${l}px`),document.body.style.overflow="hidden"),zM&&(i=lg(document,"touchmove",h=>a9(h),{passive:!1})),Ca(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})},{immediate:!0,flush:"sync"}),r});function i9(r){const e=Math.random().toString(36).substring(2,7),t=n9();t.value.set(e,r);const n=de({get:()=>t.value.get(e)??!1,set:i=>t.value.set(e,i)});return X7(()=>{t.value.delete(e)}),n}function B3(r){const e=window.getComputedStyle(r);if(e.overflowX==="scroll"||e.overflowY==="scroll"||e.overflowX==="auto"&&r.clientWidth1?!0:(e.preventDefault&&e.cancelable&&e.preventDefault(),!1)}function o0(r){const e=xu(),t=e==null?void 0:e.type.emits,n={};return t!=null&&t.length||console.warn(`No emitted event found. Please check component: ${e==null?void 0:e.type.__name}`),t==null||t.forEach(i=>{n[wH(m3(i))]=(...a)=>r(i,...a)}),n}function nr(){const r=xu(),e=te(),t=de(()=>{var o,s;return["#text","#comment"].includes((o=e.value)==null?void 0:o.$el.nodeName)?(s=e.value)==null?void 0:s.$el.nextElementSibling:pp(e)}),n=Object.assign({},r.exposed),i={};for(const o in r.props)Object.defineProperty(i,o,{enumerable:!0,configurable:!0,get:()=>r.props[o]});if(Object.keys(n).length>0)for(const o in n)Object.defineProperty(i,o,{enumerable:!0,configurable:!0,get:()=>n[o]});Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>r.vnode.el}),r.exposed=i;function a(o){e.value=o,o&&(Object.defineProperty(i,"$el",{enumerable:!0,configurable:!0,get:()=>o instanceof Element?o:o.$el}),r.exposed=i)}return{forwardRef:a,currentRef:e,currentElement:t}}function z3(r){const e=xu(),t=Object.keys((e==null?void 0:e.type.props)??{}).reduce((i,a)=>{const o=(e==null?void 0:e.type.props[a]).default;return o!==void 0&&(i[a]=o),i},{}),n=ag(r);return de(()=>{const i={},a=(e==null?void 0:e.vnode.props)??{};return Object.keys(a).forEach(o=>{i[m3(o)]=a[o]}),Object.keys({...t,...i}).reduce((o,s)=>(n.value[s]!==void 0&&(o[s]=n.value[s]),o),{})})}function o9(r,e){const t=z3(r),n=e?o0(e):{};return de(()=>({...t.value,...n}))}function s9(r,e){const t=q7(!1,300),n=te(null),i=F7();function a(){n.value=null,t.value=!1}function o(s,l){const u=s.currentTarget,c={x:s.clientX,y:s.clientY},f=l9(c,u.getBoundingClientRect()),h=u9(c,f),d=c9(l.getBoundingClientRect()),p=h9([...h,...d]);n.value=p,t.value=!0}return Ta(s=>{if(r.value&&e.value){const l=c=>o(c,e.value),u=c=>o(c,r.value);r.value.addEventListener("pointerleave",l),e.value.addEventListener("pointerleave",u),s(()=>{var c,f;(c=r.value)==null||c.removeEventListener("pointerleave",l),(f=e.value)==null||f.removeEventListener("pointerleave",u)})}}),Ta(s=>{var l;if(n.value){const u=c=>{var m,g;if(!n.value||!(c.target instanceof HTMLElement))return;const f=c.target,h={x:c.clientX,y:c.clientY},d=((m=r.value)==null?void 0:m.contains(f))||((g=e.value)==null?void 0:g.contains(f)),p=!f9(h,n.value),v=!!f.closest("[data-grace-area-trigger]");d?a():(p||v)&&(a(),i.trigger())};(l=r.value)==null||l.ownerDocument.addEventListener("pointermove",u),s(()=>{var c;return(c=r.value)==null?void 0:c.ownerDocument.removeEventListener("pointermove",u)})}}),{isPointerInTransit:t,onPointerExit:i.on}}function l9(r,e){const t=Math.abs(e.top-r.y),n=Math.abs(e.bottom-r.y),i=Math.abs(e.right-r.x),a=Math.abs(e.left-r.x);switch(Math.min(t,n,i,a)){case a:return"left";case i:return"right";case t:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function u9(r,e,t=5){const n=[];switch(e){case"top":n.push({x:r.x-t,y:r.y+t},{x:r.x+t,y:r.y+t});break;case"bottom":n.push({x:r.x-t,y:r.y-t},{x:r.x+t,y:r.y-t});break;case"left":n.push({x:r.x+t,y:r.y-t},{x:r.x+t,y:r.y+t});break;case"right":n.push({x:r.x-t,y:r.y-t},{x:r.x-t,y:r.y+t});break}return n}function c9(r){const{top:e,right:t,bottom:n,left:i}=r;return[{x:i,y:e},{x:t,y:e},{x:t,y:n},{x:i,y:n}]}function f9(r,e){const{x:t,y:n}=r;let i=!1;for(let a=0,o=e.length-1;an!=c>n&&t<(u-s)*(n-l)/(c-l)+s&&(i=!i)}return i}function h9(r){const e=r.slice();return e.sort((t,n)=>t.xn.x?1:t.yn.y?1:0),d9(e)}function d9(r){if(r.length<=1)return r.slice();const e=[];for(let n=0;n=2;){const a=e[e.length-1],o=e[e.length-2];if((a.x-o.x)*(i.y-o.y)>=(a.y-o.y)*(i.x-o.x))e.pop();else break}e.push(i)}e.pop();const t=[];for(let n=r.length-1;n>=0;n--){const i=r[n];for(;t.length>=2;){const a=t[t.length-1],o=t[t.length-2];if((a.x-o.x)*(i.y-o.y)>=(a.y-o.y)*(i.x-o.x))t.pop();else break}t.push(i)}return t.pop(),e.length===1&&t.length===1&&e[0].x===t[0].x&&e[0].y===t[0].y?e:e.concat(t)}var p9=function(r){if(typeof document>"u")return null;var e=Array.isArray(r)?r[0]:r;return e.ownerDocument.body},$u=new WeakMap,Gp=new WeakMap,Wp={},A1=0,F3=function(r){return r&&(r.host||F3(r.parentNode))},v9=function(r,e){return e.map(function(t){if(r.contains(t))return t;var n=F3(t);return n&&r.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",r,". Doing nothing"),null)}).filter(function(t){return!!t})},m9=function(r,e,t,n){var i=v9(e,Array.isArray(r)?r:[r]);Wp[t]||(Wp[t]=new WeakMap);var a=Wp[t],o=[],s=new Set,l=new Set(i),u=function(f){!f||s.has(f)||(s.add(f),u(f.parentNode))};i.forEach(u);var c=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(h){if(s.has(h))c(h);else try{var d=h.getAttribute(n),p=d!==null&&d!=="false",v=($u.get(h)||0)+1,m=(a.get(h)||0)+1;$u.set(h,v),a.set(h,m),o.push(h),v===1&&p&&Gp.set(h,!0),m===1&&h.setAttribute(t,"true"),p||h.setAttribute(n,"true")}catch(g){console.error("aria-hidden: cannot operate on ",h,g)}})};return c(e),s.clear(),A1++,function(){o.forEach(function(f){var h=$u.get(f)-1,d=a.get(f)-1;$u.set(f,h),a.set(f,d),h||(Gp.has(f)||f.removeAttribute(n),Gp.delete(f)),d||f.removeAttribute(t)}),A1--,A1||($u=new WeakMap,$u=new WeakMap,Gp=new WeakMap,Wp={})}},g9=function(r,e,t){t===void 0&&(t="data-aria-hidden");var n=Array.from(Array.isArray(r)?r:[r]),i=p9(r);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live], script"))),m9(n,i,t,"aria-hidden")):function(){return null}};function y9(r){let e;Nt(()=>pp(r),t=>{t?e=g9(t):e&&e()}),Ss(()=>{e&&e()})}function qx(r,e="reka"){var t;return`${e}-${(t=SH)==null?void 0:t()}`}function b9(r){const e=te(),t=de(()=>{var i;return((i=e.value)==null?void 0:i.width)??0}),n=de(()=>{var i;return((i=e.value)==null?void 0:i.height)??0});return zi(()=>{const i=pp(r);if(i){e.value={width:i.offsetWidth,height:i.offsetHeight};const a=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const s=o[0];let l,u;if("borderBoxSize"in s){const c=s.borderBoxSize,f=Array.isArray(c)?c[0]:c;l=f.inlineSize,u=f.blockSize}else l=i.offsetWidth,u=i.offsetHeight;e.value={width:l,height:u}});return a.observe(i,{box:"border-box"}),()=>a.unobserve(i)}else e.value=void 0}),{width:t,height:n}}function _9(r,e){const t=te(r);function n(a){return e[t.value][a]??t.value}return{state:t,dispatch:a=>{t.value=n(a)}}}function x9(r,e){var m;const t=te({}),n=te("none"),i=te(r),a=r.value?"mounted":"unmounted";let o;const s=((m=e.value)==null?void 0:m.ownerDocument.defaultView)??KS,{state:l,dispatch:u}=_9(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),c=g=>{var y;if(js){const b=new CustomEvent(g,{bubbles:!1,cancelable:!1});(y=e.value)==null||y.dispatchEvent(b)}};Nt(r,async(g,y)=>{var _;const b=y!==g;if(await Ca(),b){const x=n.value,w=Up(e.value);g?(u("MOUNT"),c("enter"),w==="none"&&c("after-enter")):w==="none"||w==="undefined"||((_=t.value)==null?void 0:_.display)==="none"?(u("UNMOUNT"),c("leave"),c("after-leave")):y&&x!==w?(u("ANIMATION_OUT"),c("leave")):(u("UNMOUNT"),c("after-leave"))}},{immediate:!0});const f=g=>{const y=Up(e.value),b=y.includes(g.animationName),_=l.value==="mounted"?"enter":"leave";if(g.target===e.value&&b&&(c(`after-${_}`),u("ANIMATION_END"),!i.value)){const x=e.value.style.animationFillMode;e.value.style.animationFillMode="forwards",o=s==null?void 0:s.setTimeout(()=>{var w;((w=e.value)==null?void 0:w.style.animationFillMode)==="forwards"&&(e.value.style.animationFillMode=x)})}g.target===e.value&&y==="none"&&u("ANIMATION_END")},h=g=>{g.target===e.value&&(n.value=Up(e.value))},d=Nt(e,(g,y)=>{g?(t.value=getComputedStyle(g),g.addEventListener("animationstart",h),g.addEventListener("animationcancel",f),g.addEventListener("animationend",f)):(u("ANIMATION_END"),o!==void 0&&(s==null||s.clearTimeout(o)),y==null||y.removeEventListener("animationstart",h),y==null||y.removeEventListener("animationcancel",f),y==null||y.removeEventListener("animationend",f))},{immediate:!0}),p=Nt(l,()=>{const g=Up(e.value);n.value=l.value==="mounted"?g:"none"});return Ss(()=>{d(),p()}),{isPresent:de(()=>["mounted","unmountSuspended"].includes(l.value))}}function Up(r){return r&&getComputedStyle(r).animationName||"none"}var ZS=Ke({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(r,{slots:e,expose:t}){var u;const{present:n,forceMount:i}=FS(r),a=te(),{isPresent:o}=x9(n,a);t({present:o});let s=e.default({present:o.value});s=XS(s||[]);const l=xu();if(s&&(s==null?void 0:s.length)>1){const c=(u=l==null?void 0:l.parent)!=null&&u.type.name?`<${l.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${c}\` for \`Presence\` component.`,"","Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.","You can apply a few solutions:",["Provide a single child element so that `presence` directive attach correctly.","Ensure the first child is an actual element instead of a raw text node or comment node."].map(f=>` - ${f}`).join(` `)].join(` `))}return()=>i.value||n.value||o.value?so(e.default({present:o.value})[0],{ref:c=>{const f=pp(c);return typeof(f==null?void 0:f.hasAttribute)>"u"||(f!=null&&f.hasAttribute("data-reka-popper-content-wrapper")?a.value=f.firstElementChild:a.value=f),f}}):null}});const w9=Ke({name:"PrimitiveSlot",inheritAttrs:!1,setup(r,{attrs:e,slots:t}){return()=>{var l;if(!t.default)return null;const n=XS(t.default()),i=n.findIndex(u=>u.type!==g3);if(i===-1)return n;const a=n[i];(l=a.props)==null||delete l.ref;const o=a.props?rr(e,a.props):e,s=TH({...a,props:{}},o);return n.length===1?s:(n[i]=s,n)}}}),S9=["area","img","input"],Fi=Ke({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(r,{attrs:e,slots:t}){const n=r.asChild?"template":r.as;return typeof n=="string"&&S9.includes(n)?()=>so(n,e):n!=="template"?()=>so(r.as,e,{default:t.default}):()=>so(w9,e,{default:t.default})}}),[ko,T9]=cf("DialogRoot");var C9=Ke({inheritAttrs:!1,__name:"DialogRoot",props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1,default:!1},modal:{type:Boolean,required:!1,default:!0}},emits:["update:open"],setup(r,{emit:e}){const t=r,i=N3(t,"open",e,{defaultValue:t.defaultOpen,passive:t.open===void 0}),a=te(),o=te(),{modal:s}=FS(t);return T9({open:i,modal:s,openModal:()=>{i.value=!0},onOpenChange:l=>{i.value=l},onOpenToggle:()=>{i.value=!i.value},contentId:"",titleId:"",descriptionId:"",triggerElement:a,contentElement:o}),(l,u)=>Je(l.$slots,"default",{open:H(i),close:()=>i.value=!1})}}),A9=C9,M9=Ke({__name:"DialogClose",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(r){const e=r;nr();const t=ko();return(n,i)=>(Y(),$e(H(Fi),rr(e,{type:n.as==="button"?"button":void 0,onClick:i[0]||(i[0]=a=>H(t).onOpenChange(!1))}),{default:_e(()=>[Je(n.$slots,"default")]),_:3},16,["type"]))}}),k9=M9;const D9="dismissableLayer.pointerDownOutside",E9="dismissableLayer.focusOutside";function V3(r,e){const t=e.closest("[data-dismissable-layer]"),n=r.dataset.dismissableLayer===""?r:r.querySelector("[data-dismissable-layer]"),i=Array.from(r.ownerDocument.querySelectorAll("[data-dismissable-layer]"));return!!(t&&(n===t||i.indexOf(n){});return Ta(s=>{if(!js||!Nr(t))return;const l=async c=>{const f=c.target;if(!(!(e!=null&&e.value)||!f)){if(V3(e.value,f)){i.value=!1;return}if(c.target&&!i.value){let h=function(){O3(D9,r,d)};const d={originalEvent:c};c.pointerType==="touch"?(n.removeEventListener("click",a.value),a.value=h,n.addEventListener("click",a.value,{once:!0})):h()}else n.removeEventListener("click",a.value);i.value=!1}},u=window.setTimeout(()=>{n.addEventListener("pointerdown",l)},0);s(()=>{window.clearTimeout(u),n.removeEventListener("pointerdown",l),n.removeEventListener("click",a.value)})}),{onPointerDownCapture:()=>{Nr(t)&&(i.value=!0)}}}function I9(r,e,t=!0){var a;const n=((a=e==null?void 0:e.value)==null?void 0:a.ownerDocument)??(globalThis==null?void 0:globalThis.document),i=te(!1);return Ta(o=>{if(!js||!Nr(t))return;const s=async l=>{if(!(e!=null&&e.value))return;await Ca(),await Ca();const u=l.target;!e.value||!u||V3(e.value,u)||l.target&&!i.value&&O3(E9,r,{originalEvent:l})};n.addEventListener("focusin",s),o(()=>n.removeEventListener("focusin",s))}),{onFocusCapture:()=>{Nr(t)&&(i.value=!0)},onBlurCapture:()=>{Nr(t)&&(i.value=!1)}}}const Ga=wu({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set});var P9=Ke({__name:"DismissableLayer",props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","dismiss"],setup(r,{emit:e}){const t=r,n=e,{forwardRef:i,currentElement:a}=nr(),o=de(()=>{var p;return((p=a.value)==null?void 0:p.ownerDocument)??globalThis.document}),s=de(()=>Ga.layersRoot),l=de(()=>a.value?Array.from(s.value).indexOf(a.value):-1),u=de(()=>Ga.layersWithOutsidePointerEventsDisabled.size>0),c=de(()=>{const p=Array.from(s.value),[v]=[...Ga.layersWithOutsidePointerEventsDisabled].slice(-1),m=p.indexOf(v);return l.value>=m}),f=L9(async p=>{const v=[...Ga.branches].some(m=>m==null?void 0:m.contains(p.target));!c.value||v||(n("pointerDownOutside",p),n("interactOutside",p),await Ca(),p.defaultPrevented||n("dismiss"))},a),h=I9(p=>{[...Ga.branches].some(m=>m==null?void 0:m.contains(p.target))||(n("focusOutside",p),n("interactOutside",p),p.defaultPrevented||n("dismiss"))},a);Q7("Escape",p=>{l.value===s.value.size-1&&(n("escapeKeyDown",p),p.defaultPrevented||n("dismiss"))});let d;return Ta(p=>{a.value&&(t.disableOutsidePointerEvents&&(Ga.layersWithOutsidePointerEventsDisabled.size===0&&(d=o.value.body.style.pointerEvents,o.value.body.style.pointerEvents="none"),Ga.layersWithOutsidePointerEventsDisabled.add(a.value)),s.value.add(a.value),p(()=>{t.disableOutsidePointerEvents&&Ga.layersWithOutsidePointerEventsDisabled.size===1&&(o.value.body.style.pointerEvents=d)}))}),Ta(p=>{p(()=>{a.value&&(s.value.delete(a.value),Ga.layersWithOutsidePointerEventsDisabled.delete(a.value))})}),(p,v)=>(Y(),$e(H(Fi),{ref:H(i),"as-child":p.asChild,as:p.as,"data-dismissable-layer":"",style:Sa({pointerEvents:u.value?c.value?"auto":"none":void 0}),onFocusCapture:H(h).onFocusCapture,onBlurCapture:H(h).onBlurCapture,onPointerdownCapture:H(f).onPointerDownCapture},{default:_e(()=>[Je(p.$slots,"default")]),_:3},8,["as-child","as","style","onFocusCapture","onBlurCapture","onPointerdownCapture"]))}}),$3=P9;const R9=V7(()=>te([]));function O9(){const r=R9();return{add(e){const t=r.value[0];e!==t&&(t==null||t.pause()),r.value=FM(r.value,e),r.value.unshift(e)},remove(e){var t;r.value=FM(r.value,e),(t=r.value[0])==null||t.resume()}}}function FM(r,e){const t=[...r],n=t.indexOf(e);return n!==-1&&t.splice(n,1),t}function j9(r){return r.filter(e=>e.tagName!=="A")}const M1="focusScope.autoFocusOnMount",k1="focusScope.autoFocusOnUnmount",VM={bubbles:!1,cancelable:!0};function N9(r,{select:e=!1}={}){const t=ms();for(const n of r)if(Uo(n,{select:e}),ms()!==t)return!0}function B9(r){const e=H3(r),t=$M(e,r),n=$M(e.reverse(),r);return[t,n]}function H3(r){const e=[],t=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e}function $M(r,e){for(const t of r)if(!z9(t,{upTo:e}))return t}function z9(r,{upTo:e}){if(getComputedStyle(r).visibility==="hidden")return!0;for(;r;){if(e!==void 0&&r===e)return!1;if(getComputedStyle(r).display==="none")return!0;r=r.parentElement}return!1}function F9(r){return r instanceof HTMLInputElement&&"select"in r}function Uo(r,{select:e=!1}={}){if(r&&r.focus){const t=ms();r.focus({preventScroll:!0}),r!==t&&F9(r)&&e&&r.select()}}var V9=Ke({__name:"FocusScope",props:{loop:{type:Boolean,required:!1,default:!1},trapped:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["mountAutoFocus","unmountAutoFocus"],setup(r,{emit:e}){const t=r,n=e,{currentRef:i,currentElement:a}=nr(),o=te(null),s=O9(),l=wu({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});Ta(c=>{if(!js)return;const f=a.value;if(!t.trapped)return;function h(m){if(l.paused||!f)return;const g=m.target;f.contains(g)?o.value=g:Uo(o.value,{select:!0})}function d(m){if(l.paused||!f)return;const g=m.relatedTarget;g!==null&&(f.contains(g)||Uo(o.value,{select:!0}))}function p(m){f.contains(o.value)||Uo(f)}document.addEventListener("focusin",h),document.addEventListener("focusout",d);const v=new MutationObserver(p);f&&v.observe(f,{childList:!0,subtree:!0}),c(()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",d),v.disconnect()})}),Ta(async c=>{const f=a.value;if(await Ca(),!f)return;s.add(l);const h=ms();if(!f.contains(h)){const p=new CustomEvent(M1,VM);f.addEventListener(M1,v=>n("mountAutoFocus",v)),f.dispatchEvent(p),p.defaultPrevented||(N9(j9(H3(f)),{select:!0}),ms()===h&&Uo(f))}c(()=>{f.removeEventListener(M1,m=>n("mountAutoFocus",m));const p=new CustomEvent(k1,VM),v=m=>{n("unmountAutoFocus",m)};f.addEventListener(k1,v),f.dispatchEvent(p),setTimeout(()=>{p.defaultPrevented||Uo(h??document.body,{select:!0}),f.removeEventListener(k1,v),s.remove(l)},0)})});function u(c){if(!t.loop&&!t.trapped||l.paused)return;const f=c.key==="Tab"&&!c.altKey&&!c.ctrlKey&&!c.metaKey,h=ms();if(f&&h){const d=c.currentTarget,[p,v]=B9(d);p&&v?!c.shiftKey&&h===v?(c.preventDefault(),t.loop&&Uo(p,{select:!0})):c.shiftKey&&h===p&&(c.preventDefault(),t.loop&&Uo(v,{select:!0})):h===d&&c.preventDefault()}}return(c,f)=>(Y(),$e(H(Fi),{ref_key:"currentRef",ref:i,tabindex:"-1","as-child":c.asChild,as:c.as,onKeydown:u},{default:_e(()=>[Je(c.$slots,"default")]),_:3},8,["as-child","as"]))}}),$9=V9;function H9(r){return r?"open":"closed"}var G9=Ke({__name:"DialogContentImpl",props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(r,{emit:e}){const t=r,n=e,i=ko(),{forwardRef:a,currentElement:o}=nr();return i.titleId||(i.titleId=qx(void 0,"reka-dialog-title")),i.descriptionId||(i.descriptionId=qx(void 0,"reka-dialog-description")),zi(()=>{i.contentElement=o,ms()!==document.body&&(i.triggerElement.value=ms())}),(s,l)=>(Y(),$e(H($9),{"as-child":"",loop:"",trapped:t.trapFocus,onMountAutoFocus:l[5]||(l[5]=u=>n("openAutoFocus",u)),onUnmountAutoFocus:l[6]||(l[6]=u=>n("closeAutoFocus",u))},{default:_e(()=>[Ie(H($3),rr({id:H(i).contentId,ref:H(a),as:s.as,"as-child":s.asChild,"disable-outside-pointer-events":s.disableOutsidePointerEvents,role:"dialog","aria-describedby":H(i).descriptionId,"aria-labelledby":H(i).titleId,"data-state":H(H9)(H(i).open.value)},s.$attrs,{onDismiss:l[0]||(l[0]=u=>H(i).onOpenChange(!1)),onEscapeKeyDown:l[1]||(l[1]=u=>n("escapeKeyDown",u)),onFocusOutside:l[2]||(l[2]=u=>n("focusOutside",u)),onInteractOutside:l[3]||(l[3]=u=>n("interactOutside",u)),onPointerDownOutside:l[4]||(l[4]=u=>n("pointerDownOutside",u))}),{default:_e(()=>[Je(s.$slots,"default")]),_:3},16,["id","as","as-child","disable-outside-pointer-events","aria-describedby","aria-labelledby","data-state"])]),_:3},8,["trapped"]))}}),G3=G9,W9=Ke({__name:"DialogContentModal",props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(r,{emit:e}){const t=r,n=e,i=ko(),a=o0(n),{forwardRef:o,currentElement:s}=nr();return y9(s),(l,u)=>(Y(),$e(G3,rr({...t,...H(a)},{ref:H(o),"trap-focus":H(i).open.value,"disable-outside-pointer-events":!0,onCloseAutoFocus:u[0]||(u[0]=c=>{var f;c.defaultPrevented||(c.preventDefault(),(f=H(i).triggerElement.value)==null||f.focus())}),onPointerDownOutside:u[1]||(u[1]=c=>{const f=c.detail.originalEvent,h=f.button===0&&f.ctrlKey===!0;(f.button===2||h)&&c.preventDefault()}),onFocusOutside:u[2]||(u[2]=c=>{c.preventDefault()})}),{default:_e(()=>[Je(l.$slots,"default")]),_:3},16,["trap-focus"]))}}),U9=W9,Y9=Ke({__name:"DialogContentNonModal",props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(r,{emit:e}){const t=r,i=o0(e);nr();const a=ko(),o=te(!1),s=te(!1);return(l,u)=>(Y(),$e(G3,rr({...t,...H(i)},{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:u[0]||(u[0]=c=>{var f;c.defaultPrevented||(o.value||(f=H(a).triggerElement.value)==null||f.focus(),c.preventDefault()),o.value=!1,s.value=!1}),onInteractOutside:u[1]||(u[1]=c=>{var d;c.defaultPrevented||(o.value=!0,c.detail.originalEvent.type==="pointerdown"&&(s.value=!0));const f=c.target;((d=H(a).triggerElement.value)==null?void 0:d.contains(f))&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&s.value&&c.preventDefault()})}),{default:_e(()=>[Je(l.$slots,"default")]),_:3},16))}}),q9=Y9,X9=Ke({__name:"DialogContent",props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(r,{emit:e}){const t=r,n=e,i=ko(),a=o0(n),{forwardRef:o}=nr();return(s,l)=>(Y(),$e(H(ZS),{present:s.forceMount||H(i).open.value},{default:_e(()=>[H(i).modal.value?(Y(),$e(U9,rr({key:0,ref:H(o)},{...t,...H(a),...s.$attrs}),{default:_e(()=>[Je(s.$slots,"default")]),_:3},16)):(Y(),$e(q9,rr({key:1,ref:H(o)},{...t,...H(a),...s.$attrs}),{default:_e(()=>[Je(s.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),K9=X9,Z9=Ke({__name:"DialogDescription",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"p"}},setup(r){const e=r;nr();const t=ko();return(n,i)=>(Y(),$e(H(Fi),rr(e,{id:H(t).descriptionId}),{default:_e(()=>[Je(n.$slots,"default")]),_:3},16,["id"]))}}),W3=Z9,J9=Ke({__name:"DialogOverlayImpl",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r){const e=ko();return i9(!0),nr(),(t,n)=>(Y(),$e(H(Fi),{as:t.as,"as-child":t.asChild,"data-state":H(e).open.value?"open":"closed",style:{"pointer-events":"auto"}},{default:_e(()=>[Je(t.$slots,"default")]),_:3},8,["as","as-child","data-state"]))}}),Q9=J9,eG=Ke({__name:"DialogOverlay",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r){const e=ko(),{forwardRef:t}=nr();return(n,i)=>{var a;return(a=H(e))!=null&&a.modal.value?(Y(),$e(H(ZS),{key:0,present:n.forceMount||H(e).open.value},{default:_e(()=>[Ie(Q9,rr(n.$attrs,{ref:H(t),as:n.as,"as-child":n.asChild}),{default:_e(()=>[Je(n.$slots,"default")]),_:3},16,["as","as-child"])]),_:3},8,["present"])):ct("v-if",!0)}}}),tG=eG,rG=Ke({__name:"Teleport",props:{to:{type:null,required:!1,default:"body"},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(r){const e=Z7();return(t,n)=>H(e)||t.forceMount?(Y(),$e(VS,{key:0,to:t.to,disabled:t.disabled,defer:t.defer},[Je(t.$slots,"default")],8,["to","disabled","defer"])):ct("v-if",!0)}}),U3=rG,nG=Ke({__name:"DialogPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(r){const e=r;return(t,n)=>(Y(),$e(H(U3),r0(n0(e)),{default:_e(()=>[Je(t.$slots,"default")]),_:3},16))}}),iG=nG,aG=Ke({__name:"DialogTitle",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"h2"}},setup(r){const e=r,t=ko();return nr(),(n,i)=>(Y(),$e(H(Fi),rr(e,{id:H(t).titleId}),{default:_e(()=>[Je(n.$slots,"default")]),_:3},16,["id"]))}}),Y3=aG,oG=Ke({__name:"VisuallyHidden",props:{feature:{type:String,required:!1,default:"focusable"},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(r){return(e,t)=>(Y(),$e(H(Fi),{as:e.as,"as-child":e.asChild,"aria-hidden":e.feature==="focusable"?"true":void 0,"data-hidden":e.feature==="fully-hidden"?"":void 0,tabindex:e.feature==="fully-hidden"?"-1":void 0,style:{position:"absolute",border:0,width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",wordWrap:"normal"}},{default:_e(()=>[Je(e.$slots,"default")]),_:3},8,["as","as-child","aria-hidden","data-hidden","tabindex"]))}}),sG=oG;const[q3,lG]=cf("PopperRoot");var uG=Ke({inheritAttrs:!1,__name:"PopperRoot",setup(r){const e=te();return lG({anchor:e,onAnchorChange:t=>e.value=t}),(t,n)=>Je(t.$slots,"default")}}),cG=uG,fG=Ke({__name:"PopperAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r){const e=r,{forwardRef:t,currentElement:n}=nr(),i=q3();return y3(()=>{i.onAnchorChange(e.reference??n.value)}),(a,o)=>(Y(),$e(H(Fi),{ref:H(t),as:a.as,"as-child":a.asChild},{default:_e(()=>[Je(a.$slots,"default")]),_:3},8,["as","as-child"]))}}),hG=fG;const dG={key:0,d:"M0 0L6 6L12 0"},pG={key:1,d:"M0 0L4.58579 4.58579C5.36683 5.36683 6.63316 5.36684 7.41421 4.58579L12 0"};var vG=Ke({__name:"Arrow",props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},rounded:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"svg"}},setup(r){const e=r;return nr(),(t,n)=>(Y(),$e(H(Fi),rr(e,{width:t.width,height:t.height,viewBox:t.asChild?void 0:"0 0 12 6",preserveAspectRatio:t.asChild?void 0:"none"}),{default:_e(()=>[Je(t.$slots,"default",{},()=>[t.rounded?(Y(),ae("path",pG)):(Y(),ae("path",dG))])]),_:3},16,["width","height","viewBox","preserveAspectRatio"]))}}),mG=vG;function gG(r){return r!==null}function yG(r){return{name:"transformOrigin",options:r,fn(e){var m,g,y;const{placement:t,rects:n,middlewareData:i}=e,o=((m=i.arrow)==null?void 0:m.centerOffset)!==0,s=o?0:r.arrowWidth,l=o?0:r.arrowHeight,[u,c]=Xx(t),f={start:"0%",center:"50%",end:"100%"}[c],h=(((g=i.arrow)==null?void 0:g.x)??0)+s/2,d=(((y=i.arrow)==null?void 0:y.y)??0)+l/2;let p="",v="";return u==="bottom"?(p=o?f:`${h}px`,v=`${-l}px`):u==="top"?(p=o?f:`${h}px`,v=`${n.floating.height+l}px`):u==="right"?(p=`${-l}px`,v=o?f:`${d}px`):u==="left"&&(p=`${n.floating.width+l}px`,v=o?f:`${d}px`),{data:{x:p,y:v}}}}}function Xx(r){const[e,t="center"]=r.split("-");return[e,t]}const bG=["top","right","bottom","left"],Ts=Math.min,In=Math.max,ug=Math.round,Yp=Math.floor,ba=r=>({x:r,y:r}),_G={left:"right",right:"left",bottom:"top",top:"bottom"},xG={start:"end",end:"start"};function Kx(r,e,t){return In(r,Ts(e,t))}function go(r,e){return typeof r=="function"?r(e):r}function yo(r){return r.split("-")[0]}function ff(r){return r.split("-")[1]}function JS(r){return r==="x"?"y":"x"}function QS(r){return r==="y"?"height":"width"}const wG=new Set(["top","bottom"]);function fa(r){return wG.has(yo(r))?"y":"x"}function eT(r){return JS(fa(r))}function SG(r,e,t){t===void 0&&(t=!1);const n=ff(r),i=eT(r),a=QS(i);let o=i==="x"?n===(t?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(o=cg(o)),[o,cg(o)]}function TG(r){const e=cg(r);return[Zx(r),e,Zx(e)]}function Zx(r){return r.replace(/start|end/g,e=>xG[e])}const HM=["left","right"],GM=["right","left"],CG=["top","bottom"],AG=["bottom","top"];function MG(r,e,t){switch(r){case"top":case"bottom":return t?e?GM:HM:e?HM:GM;case"left":case"right":return e?CG:AG;default:return[]}}function kG(r,e,t,n){const i=ff(r);let a=MG(yo(r),t==="start",n);return i&&(a=a.map(o=>o+"-"+i),e&&(a=a.concat(a.map(Zx)))),a}function cg(r){return r.replace(/left|right|bottom|top/g,e=>_G[e])}function DG(r){return{top:0,right:0,bottom:0,left:0,...r}}function X3(r){return typeof r!="number"?DG(r):{top:r,right:r,bottom:r,left:r}}function fg(r){const{x:e,y:t,width:n,height:i}=r;return{width:n,height:i,top:t,left:e,right:e+n,bottom:t+i,x:e,y:t}}function WM(r,e,t){let{reference:n,floating:i}=r;const a=fa(e),o=eT(e),s=QS(o),l=yo(e),u=a==="y",c=n.x+n.width/2-i.width/2,f=n.y+n.height/2-i.height/2,h=n[s]/2-i[s]/2;let d;switch(l){case"top":d={x:c,y:n.y-i.height};break;case"bottom":d={x:c,y:n.y+n.height};break;case"right":d={x:n.x+n.width,y:f};break;case"left":d={x:n.x-i.width,y:f};break;default:d={x:n.x,y:n.y}}switch(ff(e)){case"start":d[o]-=h*(t&&u?-1:1);break;case"end":d[o]+=h*(t&&u?-1:1);break}return d}const EG=async(r,e,t)=>{const{placement:n="bottom",strategy:i="absolute",middleware:a=[],platform:o}=t,s=a.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:r,floating:e,strategy:i}),{x:c,y:f}=WM(u,n,l),h=n,d={},p=0;for(let v=0;v({name:"arrow",options:r,async fn(e){const{x:t,y:n,placement:i,rects:a,platform:o,elements:s,middlewareData:l}=e,{element:u,padding:c=0}=go(r,e)||{};if(u==null)return{};const f=X3(c),h={x:t,y:n},d=eT(i),p=QS(d),v=await o.getDimensions(u),m=d==="y",g=m?"top":"left",y=m?"bottom":"right",b=m?"clientHeight":"clientWidth",_=a.reference[p]+a.reference[d]-h[d]-a.floating[p],x=h[d]-a.reference[d],w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let S=w?w[b]:0;(!S||!await(o.isElement==null?void 0:o.isElement(w)))&&(S=s.floating[b]||a.floating[p]);const T=_/2-x/2,C=S/2-v[p]/2-1,A=Ts(f[g],C),M=Ts(f[y],C),D=A,E=S-v[p]-M,L=S/2-v[p]/2+T,I=Kx(D,L,E),R=!l.arrow&&ff(i)!=null&&L!==I&&a.reference[p]/2-(LL<=0)){var M,D;const L=(((M=a.flip)==null?void 0:M.index)||0)+1,I=S[L];if(I&&(!(f==="alignment"?y!==fa(I):!1)||A.every(O=>fa(O.placement)===y?O.overflows[0]>0:!0)))return{data:{index:L,overflows:A},reset:{placement:I}};let R=(D=A.filter(P=>P.overflows[0]<=0).sort((P,O)=>P.overflows[1]-O.overflows[1])[0])==null?void 0:D.placement;if(!R)switch(d){case"bestFit":{var E;const P=(E=A.filter(O=>{if(w){const j=fa(O.placement);return j===y||j==="y"}return!0}).map(O=>[O.placement,O.overflows.filter(j=>j>0).reduce((j,F)=>j+F,0)]).sort((O,j)=>O[1]-j[1])[0])==null?void 0:E[0];P&&(R=P);break}case"initialPlacement":R=s;break}if(i!==R)return{reset:{placement:R}}}return{}}}};function UM(r,e){return{top:r.top-e.height,right:r.right-e.width,bottom:r.bottom-e.height,left:r.left-e.width}}function YM(r){return bG.some(e=>r[e]>=0)}const PG=function(r){return r===void 0&&(r={}),{name:"hide",options:r,async fn(e){const{rects:t}=e,{strategy:n="referenceHidden",...i}=go(r,e);switch(n){case"referenceHidden":{const a=await yd(e,{...i,elementContext:"reference"}),o=UM(a,t.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:YM(o)}}}case"escaped":{const a=await yd(e,{...i,altBoundary:!0}),o=UM(a,t.floating);return{data:{escapedOffsets:o,escaped:YM(o)}}}default:return{}}}}},K3=new Set(["left","top"]);async function RG(r,e){const{placement:t,platform:n,elements:i}=r,a=await(n.isRTL==null?void 0:n.isRTL(i.floating)),o=yo(t),s=ff(t),l=fa(t)==="y",u=K3.has(o)?-1:1,c=a&&l?-1:1,f=go(e,r);let{mainAxis:h,crossAxis:d,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&typeof p=="number"&&(d=s==="end"?p*-1:p),l?{x:d*c,y:h*u}:{x:h*u,y:d*c}}const OG=function(r){return r===void 0&&(r=0),{name:"offset",options:r,async fn(e){var t,n;const{x:i,y:a,placement:o,middlewareData:s}=e,l=await RG(e,r);return o===((t=s.offset)==null?void 0:t.placement)&&(n=s.arrow)!=null&&n.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:o}}}}},jG=function(r){return r===void 0&&(r={}),{name:"shift",options:r,async fn(e){const{x:t,y:n,placement:i}=e,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:m=>{let{x:g,y}=m;return{x:g,y}}},...l}=go(r,e),u={x:t,y:n},c=await yd(e,l),f=fa(yo(i)),h=JS(f);let d=u[h],p=u[f];if(a){const m=h==="y"?"top":"left",g=h==="y"?"bottom":"right",y=d+c[m],b=d-c[g];d=Kx(y,d,b)}if(o){const m=f==="y"?"top":"left",g=f==="y"?"bottom":"right",y=p+c[m],b=p-c[g];p=Kx(y,p,b)}const v=s.fn({...e,[h]:d,[f]:p});return{...v,data:{x:v.x-t,y:v.y-n,enabled:{[h]:a,[f]:o}}}}}},NG=function(r){return r===void 0&&(r={}),{options:r,fn(e){const{x:t,y:n,placement:i,rects:a,middlewareData:o}=e,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=go(r,e),c={x:t,y:n},f=fa(i),h=JS(f);let d=c[h],p=c[f];const v=go(s,e),m=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const b=h==="y"?"height":"width",_=a.reference[h]-a.floating[b]+m.mainAxis,x=a.reference[h]+a.reference[b]-m.mainAxis;d<_?d=_:d>x&&(d=x)}if(u){var g,y;const b=h==="y"?"width":"height",_=K3.has(yo(i)),x=a.reference[f]-a.floating[b]+(_&&((g=o.offset)==null?void 0:g[f])||0)+(_?0:m.crossAxis),w=a.reference[f]+a.reference[b]+(_?0:((y=o.offset)==null?void 0:y[f])||0)-(_?m.crossAxis:0);pw&&(p=w)}return{[h]:d,[f]:p}}}},BG=function(r){return r===void 0&&(r={}),{name:"size",options:r,async fn(e){var t,n;const{placement:i,rects:a,platform:o,elements:s}=e,{apply:l=()=>{},...u}=go(r,e),c=await yd(e,u),f=yo(i),h=ff(i),d=fa(i)==="y",{width:p,height:v}=a.floating;let m,g;f==="top"||f==="bottom"?(m=f,g=h===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(g=f,m=h==="end"?"top":"bottom");const y=v-c.top-c.bottom,b=p-c.left-c.right,_=Ts(v-c[m],y),x=Ts(p-c[g],b),w=!e.middlewareData.shift;let S=_,T=x;if((t=e.middlewareData.shift)!=null&&t.enabled.x&&(T=b),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(S=y),w&&!h){const A=In(c.left,0),M=In(c.right,0),D=In(c.top,0),E=In(c.bottom,0);d?T=p-2*(A!==0||M!==0?A+M:In(c.left,c.right)):S=v-2*(D!==0||E!==0?D+E:In(c.top,c.bottom))}await l({...e,availableWidth:T,availableHeight:S});const C=await o.getDimensions(s.floating);return p!==C.width||v!==C.height?{reset:{rects:!0}}:{}}}};function s0(){return typeof window<"u"}function Su(r){return tT(r)?(r.nodeName||"").toLowerCase():"#document"}function Nn(r){var e;return(r==null||(e=r.ownerDocument)==null?void 0:e.defaultView)||window}function ja(r){var e;return(e=(tT(r)?r.ownerDocument:r.document)||window.document)==null?void 0:e.documentElement}function tT(r){return s0()?r instanceof Node||r instanceof Nn(r).Node:!1}function Oi(r){return s0()?r instanceof Element||r instanceof Nn(r).Element:!1}function Ma(r){return s0()?r instanceof HTMLElement||r instanceof Nn(r).HTMLElement:!1}function qM(r){return!s0()||typeof ShadowRoot>"u"?!1:r instanceof ShadowRoot||r instanceof Nn(r).ShadowRoot}const zG=new Set(["inline","contents"]);function vp(r){const{overflow:e,overflowX:t,overflowY:n,display:i}=ji(r);return/auto|scroll|overlay|hidden|clip/.test(e+n+t)&&!zG.has(i)}const FG=new Set(["table","td","th"]);function VG(r){return FG.has(Su(r))}const $G=[":popover-open",":modal"];function l0(r){return $G.some(e=>{try{return r.matches(e)}catch{return!1}})}const HG=["transform","translate","scale","rotate","perspective"],GG=["transform","translate","scale","rotate","perspective","filter"],WG=["paint","layout","strict","content"];function rT(r){const e=nT(),t=Oi(r)?ji(r):r;return HG.some(n=>t[n]?t[n]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||GG.some(n=>(t.willChange||"").includes(n))||WG.some(n=>(t.contain||"").includes(n))}function UG(r){let e=Cs(r);for(;Ma(e)&&!Uc(e);){if(rT(e))return e;if(l0(e))return null;e=Cs(e)}return null}function nT(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const YG=new Set(["html","body","#document"]);function Uc(r){return YG.has(Su(r))}function ji(r){return Nn(r).getComputedStyle(r)}function u0(r){return Oi(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:{scrollLeft:r.scrollX,scrollTop:r.scrollY}}function Cs(r){if(Su(r)==="html")return r;const e=r.assignedSlot||r.parentNode||qM(r)&&r.host||ja(r);return qM(e)?e.host:e}function Z3(r){const e=Cs(r);return Uc(e)?r.ownerDocument?r.ownerDocument.body:r.body:Ma(e)&&vp(e)?e:Z3(e)}function bd(r,e,t){var n;e===void 0&&(e=[]),t===void 0&&(t=!0);const i=Z3(r),a=i===((n=r.ownerDocument)==null?void 0:n.body),o=Nn(i);if(a){const s=Jx(o);return e.concat(o,o.visualViewport||[],vp(i)?i:[],s&&t?bd(s):[])}return e.concat(i,bd(i,[],t))}function Jx(r){return r.parent&&Object.getPrototypeOf(r.parent)?r.frameElement:null}function J3(r){const e=ji(r);let t=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=Ma(r),a=i?r.offsetWidth:t,o=i?r.offsetHeight:n,s=ug(t)!==a||ug(n)!==o;return s&&(t=a,n=o),{width:t,height:n,$:s}}function iT(r){return Oi(r)?r:r.contextElement}function Ic(r){const e=iT(r);if(!Ma(e))return ba(1);const t=e.getBoundingClientRect(),{width:n,height:i,$:a}=J3(e);let o=(a?ug(t.width):t.width)/n,s=(a?ug(t.height):t.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const qG=ba(0);function Q3(r){const e=Nn(r);return!nT()||!e.visualViewport?qG:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function XG(r,e,t){return e===void 0&&(e=!1),!t||e&&t!==Nn(r)?!1:e}function lu(r,e,t,n){e===void 0&&(e=!1),t===void 0&&(t=!1);const i=r.getBoundingClientRect(),a=iT(r);let o=ba(1);e&&(n?Oi(n)&&(o=Ic(n)):o=Ic(r));const s=XG(a,t,n)?Q3(a):ba(0);let l=(i.left+s.x)/o.x,u=(i.top+s.y)/o.y,c=i.width/o.x,f=i.height/o.y;if(a){const h=Nn(a),d=n&&Oi(n)?Nn(n):n;let p=h,v=Jx(p);for(;v&&n&&d!==p;){const m=Ic(v),g=v.getBoundingClientRect(),y=ji(v),b=g.left+(v.clientLeft+parseFloat(y.paddingLeft))*m.x,_=g.top+(v.clientTop+parseFloat(y.paddingTop))*m.y;l*=m.x,u*=m.y,c*=m.x,f*=m.y,l+=b,u+=_,p=Nn(v),v=Jx(p)}}return fg({width:c,height:f,x:l,y:u})}function aT(r,e){const t=u0(r).scrollLeft;return e?e.left+t:lu(ja(r)).left+t}function eN(r,e,t){t===void 0&&(t=!1);const n=r.getBoundingClientRect(),i=n.left+e.scrollLeft-(t?0:aT(r,n)),a=n.top+e.scrollTop;return{x:i,y:a}}function KG(r){let{elements:e,rect:t,offsetParent:n,strategy:i}=r;const a=i==="fixed",o=ja(n),s=e?l0(e.floating):!1;if(n===o||s&&a)return t;let l={scrollLeft:0,scrollTop:0},u=ba(1);const c=ba(0),f=Ma(n);if((f||!f&&!a)&&((Su(n)!=="body"||vp(o))&&(l=u0(n)),Ma(n))){const d=lu(n);u=Ic(n),c.x=d.x+n.clientLeft,c.y=d.y+n.clientTop}const h=o&&!f&&!a?eN(o,l,!0):ba(0);return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:t.y*u.y-l.scrollTop*u.y+c.y+h.y}}function ZG(r){return Array.from(r.getClientRects())}function JG(r){const e=ja(r),t=u0(r),n=r.ownerDocument.body,i=In(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),a=In(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-t.scrollLeft+aT(r);const s=-t.scrollTop;return ji(n).direction==="rtl"&&(o+=In(e.clientWidth,n.clientWidth)-i),{width:i,height:a,x:o,y:s}}function QG(r,e){const t=Nn(r),n=ja(r),i=t.visualViewport;let a=n.clientWidth,o=n.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;const u=nT();(!u||u&&e==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:a,height:o,x:s,y:l}}const eW=new Set(["absolute","fixed"]);function tW(r,e){const t=lu(r,!0,e==="fixed"),n=t.top+r.clientTop,i=t.left+r.clientLeft,a=Ma(r)?Ic(r):ba(1),o=r.clientWidth*a.x,s=r.clientHeight*a.y,l=i*a.x,u=n*a.y;return{width:o,height:s,x:l,y:u}}function XM(r,e,t){let n;if(e==="viewport")n=QG(r,t);else if(e==="document")n=JG(ja(r));else if(Oi(e))n=tW(e,t);else{const i=Q3(r);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return fg(n)}function tN(r,e){const t=Cs(r);return t===e||!Oi(t)||Uc(t)?!1:ji(t).position==="fixed"||tN(t,e)}function rW(r,e){const t=e.get(r);if(t)return t;let n=bd(r,[],!1).filter(s=>Oi(s)&&Su(s)!=="body"),i=null;const a=ji(r).position==="fixed";let o=a?Cs(r):r;for(;Oi(o)&&!Uc(o);){const s=ji(o),l=rT(o);!l&&s.position==="fixed"&&(i=null),(a?!l&&!i:!l&&s.position==="static"&&!!i&&eW.has(i.position)||vp(o)&&!l&&tN(r,o))?n=n.filter(c=>c!==o):i=s,o=Cs(o)}return e.set(r,n),n}function nW(r){let{element:e,boundary:t,rootBoundary:n,strategy:i}=r;const o=[...t==="clippingAncestors"?l0(e)?[]:rW(e,this._c):[].concat(t),n],s=o[0],l=o.reduce((u,c)=>{const f=XM(e,c,i);return u.top=In(f.top,u.top),u.right=Ts(f.right,u.right),u.bottom=Ts(f.bottom,u.bottom),u.left=In(f.left,u.left),u},XM(e,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function iW(r){const{width:e,height:t}=J3(r);return{width:e,height:t}}function aW(r,e,t){const n=Ma(e),i=ja(e),a=t==="fixed",o=lu(r,!0,a,e);let s={scrollLeft:0,scrollTop:0};const l=ba(0);function u(){l.x=aT(i)}if(n||!n&&!a)if((Su(e)!=="body"||vp(i))&&(s=u0(e)),n){const d=lu(e,!0,a,e);l.x=d.x+e.clientLeft,l.y=d.y+e.clientTop}else i&&u();a&&!n&&i&&u();const c=i&&!n&&!a?eN(i,s):ba(0),f=o.left+s.scrollLeft-l.x-c.x,h=o.top+s.scrollTop-l.y-c.y;return{x:f,y:h,width:o.width,height:o.height}}function D1(r){return ji(r).position==="static"}function KM(r,e){if(!Ma(r)||ji(r).position==="fixed")return null;if(e)return e(r);let t=r.offsetParent;return ja(r)===t&&(t=t.ownerDocument.body),t}function rN(r,e){const t=Nn(r);if(l0(r))return t;if(!Ma(r)){let i=Cs(r);for(;i&&!Uc(i);){if(Oi(i)&&!D1(i))return i;i=Cs(i)}return t}let n=KM(r,e);for(;n&&VG(n)&&D1(n);)n=KM(n,e);return n&&Uc(n)&&D1(n)&&!rT(n)?t:n||UG(r)||t}const oW=async function(r){const e=this.getOffsetParent||rN,t=this.getDimensions,n=await t(r.floating);return{reference:aW(r.reference,await e(r.floating),r.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function sW(r){return ji(r).direction==="rtl"}const lW={convertOffsetParentRelativeRectToViewportRelativeRect:KG,getDocumentElement:ja,getClippingRect:nW,getOffsetParent:rN,getElementRects:oW,getClientRects:ZG,getDimensions:iW,getScale:Ic,isElement:Oi,isRTL:sW};function nN(r,e){return r.x===e.x&&r.y===e.y&&r.width===e.width&&r.height===e.height}function uW(r,e){let t=null,n;const i=ja(r);function a(){var s;clearTimeout(n),(s=t)==null||s.disconnect(),t=null}function o(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();const u=r.getBoundingClientRect(),{left:c,top:f,width:h,height:d}=u;if(s||e(),!h||!d)return;const p=Yp(f),v=Yp(i.clientWidth-(c+h)),m=Yp(i.clientHeight-(f+d)),g=Yp(c),b={rootMargin:-p+"px "+-v+"px "+-m+"px "+-g+"px",threshold:In(0,Ts(1,l))||1};let _=!0;function x(w){const S=w[0].intersectionRatio;if(S!==l){if(!_)return o();S?o(!1,S):n=setTimeout(()=>{o(!1,1e-7)},1e3)}S===1&&!nN(u,r.getBoundingClientRect())&&o(),_=!1}try{t=new IntersectionObserver(x,{...b,root:i.ownerDocument})}catch{t=new IntersectionObserver(x,b)}t.observe(r)}return o(!0),a}function cW(r,e,t,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,u=iT(r),c=i||a?[...u?bd(u):[],...bd(e)]:[];c.forEach(g=>{i&&g.addEventListener("scroll",t,{passive:!0}),a&&g.addEventListener("resize",t)});const f=u&&s?uW(u,t):null;let h=-1,d=null;o&&(d=new ResizeObserver(g=>{let[y]=g;y&&y.target===u&&d&&(d.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var b;(b=d)==null||b.observe(e)})),t()}),u&&!l&&d.observe(u),d.observe(e));let p,v=l?lu(r):null;l&&m();function m(){const g=lu(r);v&&!nN(v,g)&&t(),v=g,p=requestAnimationFrame(m)}return t(),()=>{var g;c.forEach(y=>{i&&y.removeEventListener("scroll",t),a&&y.removeEventListener("resize",t)}),f==null||f(),(g=d)==null||g.disconnect(),d=null,l&&cancelAnimationFrame(p)}}const fW=OG,hW=jG,ZM=IG,dW=BG,pW=PG,vW=LG,mW=NG,gW=(r,e,t)=>{const n=new Map,i={platform:lW,...t},a={...i.platform,_c:n};return EG(r,e,{...i,platform:a})};function yW(r){return r!=null&&typeof r=="object"&&"$el"in r}function Qx(r){if(yW(r)){const e=r.$el;return tT(e)&&Su(e)==="#comment"?null:e}return r}function mc(r){return typeof r=="function"?r():H(r)}function bW(r){return{name:"arrow",options:r,fn(e){const t=Qx(mc(r.element));return t==null?{}:vW({element:t,padding:r.padding}).fn(e)}}}function iN(r){return typeof window>"u"?1:(r.ownerDocument.defaultView||window).devicePixelRatio||1}function JM(r,e){const t=iN(r);return Math.round(e*t)/t}function _W(r,e,t){t===void 0&&(t={});const n=t.whileElementsMounted,i=de(()=>{var S;return(S=mc(t.open))!=null?S:!0}),a=de(()=>mc(t.middleware)),o=de(()=>{var S;return(S=mc(t.placement))!=null?S:"bottom"}),s=de(()=>{var S;return(S=mc(t.strategy))!=null?S:"absolute"}),l=de(()=>{var S;return(S=mc(t.transform))!=null?S:!0}),u=de(()=>Qx(r.value)),c=de(()=>Qx(e.value)),f=te(0),h=te(0),d=te(s.value),p=te(o.value),v=zl({}),m=te(!1),g=de(()=>{const S={position:d.value,left:"0",top:"0"};if(!c.value)return S;const T=JM(c.value,f.value),C=JM(c.value,h.value);return l.value?{...S,transform:"translate("+T+"px, "+C+"px)",...iN(c.value)>=1.5&&{willChange:"transform"}}:{position:d.value,left:T+"px",top:C+"px"}});let y;function b(){if(u.value==null||c.value==null)return;const S=i.value;gW(u.value,c.value,{middleware:a.value,placement:o.value,strategy:s.value}).then(T=>{f.value=T.x,h.value=T.y,d.value=T.strategy,p.value=T.placement,v.value=T.middlewareData,m.value=S!==!1})}function _(){typeof y=="function"&&(y(),y=void 0)}function x(){if(_(),n===void 0){b();return}if(u.value!=null&&c.value!=null){y=n(u.value,c.value,b);return}}function w(){i.value||(m.value=!1)}return Nt([a,o,s,i],b,{flush:"sync"}),Nt([u,c],x,{flush:"sync"}),Nt(i,w,{flush:"sync"}),BS()&&zS(_),{x:Vu(f),y:Vu(h),strategy:Vu(d),placement:Vu(p),middlewareData:Vu(v),isPositioned:Vu(m),floatingStyles:g,update:b}}const xW={side:"bottom",sideOffset:0,sideFlip:!0,align:"center",alignOffset:0,alignFlip:!0,arrowPadding:0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:"partial",hideWhenDetached:!1,positionStrategy:"fixed",updatePositionStrategy:"optimized",prioritizePosition:!1},[wW,SW]=cf("PopperContent");var TW=Ke({inheritAttrs:!1,__name:"PopperContent",props:CH({side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...xW}),emits:["placed"],setup(r,{emit:e}){const t=r,n=e,i=q3(),{forwardRef:a,currentElement:o}=nr(),s=te(),l=te(),{width:u,height:c}=b9(l),f=de(()=>t.side+(t.align!=="center"?`-${t.align}`:"")),h=de(()=>typeof t.collisionPadding=="number"?t.collisionPadding:{top:0,right:0,bottom:0,left:0,...t.collisionPadding}),d=de(()=>Array.isArray(t.collisionBoundary)?t.collisionBoundary:[t.collisionBoundary]),p=de(()=>({padding:h.value,boundary:d.value.filter(gG),altBoundary:d.value.length>0})),v=de(()=>({mainAxis:t.sideFlip,crossAxis:t.alignFlip})),m=z7(()=>[fW({mainAxis:t.sideOffset+c.value,alignmentAxis:t.alignOffset}),t.prioritizePosition&&t.avoidCollisions&&ZM({...p.value,...v.value}),t.avoidCollisions&&hW({mainAxis:!0,crossAxis:!!t.prioritizePosition,limiter:t.sticky==="partial"?mW():void 0,...p.value}),!t.prioritizePosition&&t.avoidCollisions&&ZM({...p.value,...v.value}),dW({...p.value,apply:({elements:D,rects:E,availableWidth:L,availableHeight:I})=>{const{width:R,height:P}=E.reference,O=D.floating.style;O.setProperty("--reka-popper-available-width",`${L}px`),O.setProperty("--reka-popper-available-height",`${I}px`),O.setProperty("--reka-popper-anchor-width",`${R}px`),O.setProperty("--reka-popper-anchor-height",`${P}px`)}}),l.value&&bW({element:l.value,padding:t.arrowPadding}),yG({arrowWidth:u.value,arrowHeight:c.value}),t.hideWhenDetached&&pW({strategy:"referenceHidden",...p.value})]),g=de(()=>t.reference??i.anchor.value),{floatingStyles:y,placement:b,isPositioned:_,middlewareData:x}=_W(g,s,{strategy:t.positionStrategy,placement:f,whileElementsMounted:(...D)=>cW(...D,{layoutShift:!t.disableUpdateOnLayoutShift,animationFrame:t.updatePositionStrategy==="always"}),middleware:m}),w=de(()=>Xx(b.value)[0]),S=de(()=>Xx(b.value)[1]);y3(()=>{_.value&&n("placed")});const T=de(()=>{var D;return((D=x.value.arrow)==null?void 0:D.centerOffset)!==0}),C=te("");Ta(()=>{o.value&&(C.value=window.getComputedStyle(o.value).zIndex)});const A=de(()=>{var D;return((D=x.value.arrow)==null?void 0:D.x)??0}),M=de(()=>{var D;return((D=x.value.arrow)==null?void 0:D.y)??0});return SW({placedSide:w,onArrowChange:D=>l.value=D,arrowX:A,arrowY:M,shouldHideArrow:T}),(D,E)=>{var L,I,R;return Y(),ae("div",{ref_key:"floatingRef",ref:s,"data-reka-popper-content-wrapper":"",style:Sa({...H(y),transform:H(_)?H(y).transform:"translate(0, -200%)",minWidth:"max-content",zIndex:C.value,"--reka-popper-transform-origin":[(L=H(x).transformOrigin)==null?void 0:L.x,(I=H(x).transformOrigin)==null?void 0:I.y].join(" "),...((R=H(x).hide)==null?void 0:R.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}})},[Ie(H(Fi),rr({ref:H(a)},D.$attrs,{"as-child":t.asChild,as:D.as,"data-side":w.value,"data-align":S.value,style:{animation:H(_)?void 0:"none"}}),{default:_e(()=>[Je(D.$slots,"default")]),_:3},16,["as-child","as","data-side","data-align","style"])],4)}}}),CW=TW;const AW={top:"bottom",right:"left",bottom:"top",left:"right"};var MW=Ke({inheritAttrs:!1,__name:"PopperArrow",props:{width:{type:Number,required:!1},height:{type:Number,required:!1},rounded:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"svg"}},setup(r){const{forwardRef:e}=nr(),t=wW(),n=de(()=>AW[t.placedSide.value]);return(i,a)=>{var o,s,l,u;return Y(),ae("span",{ref:c=>{H(t).onArrowChange(c)},style:Sa({position:"absolute",left:(o=H(t).arrowX)!=null&&o.value?`${(s=H(t).arrowX)==null?void 0:s.value}px`:void 0,top:(l=H(t).arrowY)!=null&&l.value?`${(u=H(t).arrowY)==null?void 0:u.value}px`:void 0,[n.value]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[H(t).placedSide.value],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[H(t).placedSide.value],visibility:H(t).shouldHideArrow.value?"hidden":void 0})},[Ie(mG,rr(i.$attrs,{ref:H(e),style:{display:"block"},as:i.as,"as-child":i.asChild,rounded:i.rounded,width:i.width,height:i.height}),{default:_e(()=>[Je(i.$slots,"default")]),_:3},16,["as","as-child","rounded","width","height"])],4)}}}),kW=MW,DW=Ke({__name:"TooltipArrow",props:{width:{type:Number,required:!1,default:10},height:{type:Number,required:!1,default:5},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"svg"}},setup(r){const e=r;return nr(),(t,n)=>(Y(),$e(H(kW),r0(n0(e)),{default:_e(()=>[Je(t.$slots,"default")]),_:3},16))}}),EW=DW;const[oT,LW]=cf("TooltipProvider");var IW=Ke({inheritAttrs:!1,__name:"TooltipProvider",props:{delayDuration:{type:Number,required:!1,default:700},skipDelayDuration:{type:Number,required:!1,default:300},disableHoverableContent:{type:Boolean,required:!1,default:!1},disableClosingTrigger:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:!1}},setup(r){const e=r,{delayDuration:t,skipDelayDuration:n,disableHoverableContent:i,disableClosingTrigger:a,ignoreNonKeyboardFocus:o,disabled:s}=FS(e);nr();const l=te(!0),u=te(!1),{start:c,stop:f}=j3(()=>{l.value=!0},n,{immediate:!1});return LW({isOpenDelayed:l,delayDuration:t,onOpen(){f(),l.value=!1},onClose(){c()},isPointerInTransitRef:u,disableHoverableContent:i,disableClosingTrigger:a,disabled:s,ignoreNonKeyboardFocus:o}),(h,d)=>Je(h.$slots,"default")}}),PW=IW;const aN="tooltip.open",[c0,RW]=cf("TooltipRoot");var OW=Ke({__name:"TooltipRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},delayDuration:{type:Number,required:!1,default:void 0},disableHoverableContent:{type:Boolean,required:!1,default:void 0},disableClosingTrigger:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},ignoreNonKeyboardFocus:{type:Boolean,required:!1,default:void 0}},emits:["update:open"],setup(r,{emit:e}){const t=r,n=e;nr();const i=oT(),a=de(()=>t.disableHoverableContent??i.disableHoverableContent.value),o=de(()=>t.disableClosingTrigger??i.disableClosingTrigger.value),s=de(()=>t.disabled??i.disabled.value),l=de(()=>t.delayDuration??i.delayDuration.value),u=de(()=>t.ignoreNonKeyboardFocus??i.ignoreNonKeyboardFocus.value),c=N3(t,"open",n,{defaultValue:t.defaultOpen,passive:t.open===void 0});Nt(c,b=>{i.onClose&&(b?(i.onOpen(),document.dispatchEvent(new CustomEvent(aN))):i.onClose())});const f=te(!1),h=te(),d=de(()=>c.value?f.value?"delayed-open":"instant-open":"closed"),{start:p,stop:v}=j3(()=>{f.value=!0,c.value=!0},l,{immediate:!1});function m(){v(),f.value=!1,c.value=!0}function g(){v(),c.value=!1}function y(){p()}return RW({contentId:"",open:c,stateAttribute:d,trigger:h,onTriggerChange(b){h.value=b},onTriggerEnter(){i.isOpenDelayed.value?y():m()},onTriggerLeave(){a.value?g():v()},onOpen:m,onClose:g,disableHoverableContent:a,disableClosingTrigger:o,disabled:s,ignoreNonKeyboardFocus:u}),(b,_)=>(Y(),$e(H(cG),null,{default:_e(()=>[Je(b.$slots,"default",{open:H(c)})]),_:3}))}}),jW=OW,NW=Ke({__name:"TooltipContentImpl",props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1,default:"top"},sideOffset:{type:Number,required:!1,default:0},align:{type:null,required:!1,default:"center"},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1,default:!0},collisionBoundary:{type:null,required:!1,default:()=>[]},collisionPadding:{type:[Number,Object],required:!1,default:0},arrowPadding:{type:Number,required:!1,default:0},sticky:{type:String,required:!1,default:"partial"},hideWhenDetached:{type:Boolean,required:!1,default:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(r,{emit:e}){const t=r,n=e,i=c0(),{forwardRef:a}=nr(),o=i0(),s=de(()=>{var c;return(c=o.default)==null?void 0:c.call(o,{})}),l=de(()=>{var h;if(t.ariaLabel)return t.ariaLabel;let c="";function f(d){typeof d.children=="string"&&d.type!==g3?c+=d.children:Array.isArray(d.children)&&d.children.forEach(p=>f(p))}return(h=s.value)==null||h.forEach(d=>f(d)),c}),u=de(()=>{const{ariaLabel:c,...f}=t;return f});return zi(()=>{lg(window,"scroll",c=>{const f=c.target;f!=null&&f.contains(i.trigger.value)&&i.onClose()}),lg(window,aN,i.onClose)}),(c,f)=>(Y(),$e(H($3),{"as-child":"","disable-outside-pointer-events":!1,onEscapeKeyDown:f[0]||(f[0]=h=>n("escapeKeyDown",h)),onPointerDownOutside:f[1]||(f[1]=h=>{var d;H(i).disableClosingTrigger.value&&((d=H(i).trigger.value)!=null&&d.contains(h.target))&&h.preventDefault(),n("pointerDownOutside",h)}),onFocusOutside:f[2]||(f[2]=At(()=>{},["prevent"])),onDismiss:f[3]||(f[3]=h=>H(i).onClose())},{default:_e(()=>[Ie(H(CW),rr({ref:H(a),"data-state":H(i).stateAttribute.value},{...c.$attrs,...u.value},{style:{"--reka-tooltip-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-tooltip-content-available-width":"var(--reka-popper-available-width)","--reka-tooltip-content-available-height":"var(--reka-popper-available-height)","--reka-tooltip-trigger-width":"var(--reka-popper-anchor-width)","--reka-tooltip-trigger-height":"var(--reka-popper-anchor-height)"}}),{default:_e(()=>[Je(c.$slots,"default"),Ie(H(sG),{id:H(i).contentId,role:"tooltip"},{default:_e(()=>[Di(qt(l.value),1)]),_:1},8,["id"])]),_:3},16,["data-state"])]),_:3}))}}),oN=NW,BW=Ke({__name:"TooltipContentHoverable",props:{ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},setup(r){const t=z3(r),{forwardRef:n,currentElement:i}=nr(),{trigger:a,onClose:o}=c0(),s=oT(),{isPointerInTransit:l,onPointerExit:u}=s9(a,i);return s.isPointerInTransitRef=l,u(()=>{o()}),(c,f)=>(Y(),$e(oN,rr({ref:H(n)},H(t)),{default:_e(()=>[Je(c.$slots,"default")]),_:3},16))}}),zW=BW,FW=Ke({__name:"TooltipContent",props:{forceMount:{type:Boolean,required:!1},ariaLabel:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},side:{type:null,required:!1,default:"top"},sideOffset:{type:Number,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1}},emits:["escapeKeyDown","pointerDownOutside"],setup(r,{emit:e}){const t=r,n=e,i=c0(),a=o9(t,n),{forwardRef:o}=nr();return(s,l)=>(Y(),$e(H(ZS),{present:s.forceMount||H(i).open.value},{default:_e(()=>[(Y(),$e(Bh(H(i).disableHoverableContent.value?oN:zW),rr({ref:H(o)},H(a)),{default:_e(()=>[Je(s.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),VW=FW,$W=Ke({__name:"TooltipPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(r){const e=r;return(t,n)=>(Y(),$e(H(U3),r0(n0(e)),{default:_e(()=>[Je(t.$slots,"default")]),_:3},16))}}),HW=$W,GW=Ke({__name:"TooltipTrigger",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(r){const e=r,t=c0(),n=oT();t.contentId||(t.contentId=qx(void 0,"reka-tooltip-content"));const{forwardRef:i,currentElement:a}=nr(),o=te(!1),s=te(!1),l=de(()=>t.disabled.value?{}:{click:v,focus:d,pointermove:f,pointerleave:h,pointerdown:c,blur:p});zi(()=>{t.onTriggerChange(a.value)});function u(){setTimeout(()=>{o.value=!1},1)}function c(){t.open&&!t.disableClosingTrigger.value&&t.onClose(),o.value=!0,document.addEventListener("pointerup",u,{once:!0})}function f(m){m.pointerType!=="touch"&&!s.value&&!n.isPointerInTransitRef.value&&(t.onTriggerEnter(),s.value=!0)}function h(){t.onTriggerLeave(),s.value=!1}function d(m){var g,y;o.value||t.ignoreNonKeyboardFocus.value&&!((y=(g=m.target).matches)!=null&&y.call(g,":focus-visible"))||t.onOpen()}function p(){t.onClose()}function v(){t.disableClosingTrigger.value||t.onClose()}return(m,g)=>(Y(),$e(H(hG),{"as-child":"",reference:m.reference},{default:_e(()=>[Ie(H(Fi),rr({ref:H(i),"aria-describedby":H(t).open.value?H(t).contentId:void 0,"data-state":H(t).stateAttribute.value,as:m.as,"as-child":e.asChild,"data-grace-area-trigger":""},AH(l.value)),{default:_e(()=>[Je(m.$slots,"default")]),_:3},16,["aria-describedby","data-state","as","as-child"])]),_:3},8,["reference"]))}}),WW=GW;const UW={class:"rounded bg-surface-gray-7 px-2 py-1 text-xs text-ink-white shadow-xl"},Ci=Ke({inheritAttrs:!1,__name:"Tooltip",props:{text:{default:""},hoverDelay:{default:.5},placement:{default:"top"},arrowClass:{default:"fill-surface-gray-7"},disabled:{type:Boolean,default:!1}},setup(r){const e=r,t=de(()=>e.hoverDelay*1e3);return(n,i)=>n.disabled?Je(n.$slots,"default",{key:0}):(Y(),$e(H(PW),{key:1,delayDuration:t.value},{default:_e(()=>[Ie(H(jW),null,{default:_e(()=>[Ie(H(WW),{"as-child":""},{default:_e(()=>[Je(n.$slots,"default")]),_:3}),Ie(H(HW),null,{default:_e(()=>[e.text||n.$slots.body?(Y(),$e(H(VW),{key:0,side:e.placement,"side-offset":4,class:"z-[100]"},{default:_e(()=>[Je(n.$slots,"body",{},()=>[Z("div",UW,[Z("div",null,qt(e.text),1)])]),Ie(H(EW),{class:kt(e.arrowClass),width:8,height:4},null,8,["class"])]),_:3},8,["side"])):ct("",!0)]),_:3})]),_:3})]),_:3},8,["delayDuration"]))}}),YW=["disabled","ariaLabel"],ui=Ke({__name:"Button",props:{theme:{default:"gray"},size:{default:"sm"},variant:{default:"subtle"},label:{},icon:{},iconLeft:{},iconRight:{},tooltip:{},loading:{type:Boolean,default:!1},loadingText:{},disabled:{type:Boolean,default:!1},route:{},link:{}},setup(r){const e=r,t=i0(),n=MH(),i=de(()=>{let c={gray:"text-ink-white bg-surface-gray-7 hover:bg-surface-gray-6 active:bg-surface-gray-5",blue:"text-ink-white bg-blue-500 hover:bg-surface-blue-3 active:bg-blue-700",green:"text-ink-white bg-surface-green-3 hover:bg-green-700 active:bg-green-800",red:"text-ink-white bg-surface-red-5 hover:bg-surface-red-6 active:bg-surface-red-7"}[e.theme],f={gray:"text-ink-gray-8 bg-surface-gray-2 hover:bg-surface-gray-3 active:bg-surface-gray-4",blue:"text-ink-blue-3 bg-surface-blue-2 hover:bg-blue-200 active:bg-blue-300",green:"text-green-800 bg-surface-green-2 hover:bg-green-200 active:bg-green-300",red:"text-red-700 bg-surface-red-2 hover:bg-surface-red-3 active:bg-surface-red-4"}[e.theme],h={gray:"text-ink-gray-8 bg-surface-white bg-surface-white border border-outline-gray-2 hover:border-outline-gray-3 active:border-outline-gray-3 active:bg-surface-gray-4",blue:"text-ink-blue-3 bg-surface-white border border-outline-blue-1 hover:border-blue-400 active:border-blue-400 active:bg-blue-300",green:"text-green-800 bg-surface-white border border-outline-green-2 hover:border-green-500 active:border-green-500 active:bg-green-300",red:"text-red-700 bg-surface-white border border-outline-red-1 hover:border-outline-red-2 active:border-outline-red-2 active:bg-surface-red-3"}[e.theme],d={gray:"text-ink-gray-8 bg-transparent hover:bg-surface-gray-3 active:bg-surface-gray-4",blue:"text-ink-blue-3 bg-transparent hover:bg-blue-200 active:bg-blue-300",green:"text-green-800 bg-transparent hover:bg-green-200 active:bg-green-300",red:"text-red-700 bg-transparent hover:bg-surface-red-3 active:bg-surface-red-4"}[e.theme],p={gray:"focus-visible:ring focus-visible:ring-outline-gray-3",blue:"focus-visible:ring focus-visible:ring-blue-400",green:"focus-visible:ring focus-visible:ring-outline-green-2",red:"focus-visible:ring focus-visible:ring-outline-red-2"}[e.theme],v={subtle:f,solid:c,outline:h,ghost:d}[e.variant],m=`${e.theme}-${e.variant}`,y={"gray-solid":"bg-surface-gray-2 text-ink-gray-4","gray-subtle":"bg-surface-gray-2 text-ink-gray-4","gray-outline":"bg-surface-gray-2 text-ink-gray-4 border border-outline-gray-2","gray-ghost":"text-ink-gray-4","blue-solid":"bg-blue-300 text-ink-white","blue-subtle":"bg-surface-blue-2 text-ink-blue-link","blue-outline":"bg-surface-blue-2 text-ink-blue-link border border-outline-blue-1","blue-ghost":"text-ink-blue-link","green-solid":"bg-surface-green-2 text-ink-green-2","green-subtle":"bg-surface-green-2 text-ink-green-2","green-outline":"bg-surface-green-2 text-ink-green-2 border border-outline-green-2","green-ghost":"text-ink-green-2","red-solid":"bg-surface-red-2 text-ink-red-2","red-subtle":"bg-surface-red-2 text-ink-red-2","red-outline":"bg-surface-red-2 text-ink-red-2 border border-outline-red-1","red-ghost":"text-ink-red-2"}[m],b={sm:"h-7 text-base px-2 rounded",md:"h-8 text-base font-medium px-2.5 rounded",lg:"h-10 text-lg font-medium px-3 rounded-md",xl:"h-11.5 text-xl font-medium px-3.5 rounded-lg","2xl":"h-13 text-2xl font-medium px-3.5 rounded-xl"}[e.size];return l.value&&(b={sm:"h-7 w-7 rounded",md:"h-8 w-8 rounded",lg:"h-10 w-10 rounded-md",xl:"h-11.5 w-11.5 rounded-lg","2xl":"h-13 w-13 rounded-xl"}[e.size]),["inline-flex items-center justify-center gap-2 transition-colors focus:outline-none",o.value?y:v,p,b]}),a=de(()=>({sm:"h-4",md:"h-4.5",lg:"h-5",xl:"h-6","2xl":"h-6"})[e.size]),o=de(()=>e.disabled||e.loading),s=de(()=>l.value?e.label:null),l=de(()=>e.icon||t.icon),u=()=>{if(e.route)return n.push(e.route);if(e.link)return window.open(e.link,"_blank")};return(c,f)=>{var h;return Y(),$e(Ci,{text:c.tooltip,disabled:!((h=c.tooltip)!=null&&h.length)},{default:_e(()=>[Z("button",rr(c.$attrs,{class:i.value,onClick:u,disabled:o.value,ariaLabel:s.value}),[c.loading?(Y(),$e(R3,{key:0,class:kt({"h-3 w-3":c.size=="sm","h-[13.5px] w-[13.5px]":c.size=="md","h-[15px] w-[15px]":c.size=="lg","h-4.5 w-4.5":c.size=="xl"||c.size=="2xl"})},null,8,["class"])):c.$slots.prefix||c.iconLeft?Je(c.$slots,"prefix",{key:1},()=>[c.iconLeft&&typeof c.iconLeft=="string"?(Y(),$e(xm,{key:0,name:c.iconLeft,class:kt(a.value),"aria-hidden":"true"},null,8,["name","class"])):c.iconLeft?(Y(),$e(Bh(c.iconLeft),{key:1,class:kt(a.value)},null,8,["class"])):ct("",!0)]):ct("",!0),c.loading&&c.loadingText?(Y(),ae(oi,{key:2},[Di(qt(c.loadingText),1)],64)):l.value&&!c.loading?(Y(),ae(oi,{key:3},[c.icon&&typeof c.icon=="string"?(Y(),$e(xm,{key:0,name:c.icon,class:kt(a.value),"aria-label":c.label},null,8,["name","class","aria-label"])):c.icon?(Y(),$e(Bh(c.icon),{key:1,class:kt(a.value)},null,8,["class"])):c.$slots.icon?Je(c.$slots,"icon",{key:2}):ct("",!0)],64)):(Y(),ae("span",{key:4,class:kt([{"sr-only":l.value},"truncate"])},[Je(c.$slots,"default",{},()=>[Di(qt(c.label),1)])],2)),Je(c.$slots,"suffix",{},()=>[c.iconRight&&typeof c.iconRight=="string"?(Y(),$e(xm,{key:0,name:c.iconRight,class:kt(a.value),"aria-hidden":"true"},null,8,["name","class"])):c.iconRight?(Y(),$e(Bh(c.iconRight),{key:1,class:kt(a.value)},null,8,["class"])):ct("",!0)])],16,YW)]),_:3},8,["text","disabled"])}}});function sN(r){return BS()?(zS(r),!0):!1}function E1(){const r=new Set,e=i=>{r.delete(i)};return{on:i=>{r.add(i);const a=()=>e(i);return sN(a),{off:a}},off:e,trigger:(...i)=>Promise.all(Array.from(r).map(a=>a(...i)))}}function la(r){return typeof r=="function"?r():H(r)}const lN=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const qW=()=>{};function QM(r,e=!1,t="Timeout"){return new Promise((n,i)=>{setTimeout(e?()=>i(t):n,r)})}function XW(r,...e){return e.some(t=>t in r)}function L1(...r){if(r.length!==1)return ag(...r);const e=r[0];return typeof e=="function"?lo(p3(()=>({get:e,set:qW}))):te(e)}function ew(r,e=!1){function t(f,{flush:h="sync",deep:d=!1,timeout:p,throwOnTimeout:v}={}){let m=null;const y=[new Promise(b=>{m=Nt(r,_=>{f(_)!==e&&(m==null||m(),b(_))},{flush:h,deep:d,immediate:!0})})];return p!=null&&y.push(QM(p,v).then(()=>la(r)).finally(()=>m==null?void 0:m())),Promise.race(y)}function n(f,h){if(!b3(f))return t(_=>_===f,h);const{flush:d="sync",deep:p=!1,timeout:v,throwOnTimeout:m}=h??{};let g=null;const b=[new Promise(_=>{g=Nt([r,f],([x,w])=>{e!==(x===w)&&(g==null||g(),_(x))},{flush:d,deep:p,immediate:!0})})];return v!=null&&b.push(QM(v,m).then(()=>la(r)).finally(()=>(g==null||g(),la(r)))),Promise.race(b)}function i(f){return t(h=>!!h,f)}function a(f){return n(null,f)}function o(f){return n(void 0,f)}function s(f){return t(Number.isNaN,f)}function l(f,h){return t(d=>{const p=Array.from(d);return p.includes(f)||p.includes(la(f))},h)}function u(f){return c(1,f)}function c(f=1,h){let d=-1;return t(()=>(d+=1,d>=f),h)}return Array.isArray(la(r))?{toMatch:t,toContains:l,changed:u,changedTimes:c,get not(){return ew(r,!e)}}:{toMatch:t,toBe:n,toBeTruthy:i,toBeNull:a,toBeNaN:s,toBeUndefined:o,changed:u,changedTimes:c,get not(){return ew(r,!e)}}}function KW(r){return ew(r)}function ZW(r,e,t={}){const{immediate:n=!0}=t,i=te(!1);let a=null;function o(){a&&(clearTimeout(a),a=null)}function s(){i.value=!1,o()}function l(...u){o(),i.value=!0,a=setTimeout(()=>{i.value=!1,a=null,r(...u)},la(e))}return n&&(i.value=!0,lN&&l()),sN(s),{isPending:lo(i),start:l,stop:s}}const JW=lN?window:void 0,QW={json:"application/json",text:"text/plain"};function hg(r){return r&&XW(r,"immediate","refetch","initialData","timeout","beforeFetch","afterFetch","onFetchError","fetch","updateDataOnError")}const eU=/^(?:[a-z][a-z\d+\-.]*:)?\/\//i;function tU(r){return eU.test(r)}function Vh(r){return typeof Headers<"u"&&r instanceof Headers?Object.fromEntries(r.entries()):r}function Hu(r,...e){return r==="overwrite"?async t=>{const n=e[e.length-1];return n?{...t,...await n(t)}:t}:async t=>{for(const n of e)n&&(t={...t,...await n(t)});return t}}function rU(r={}){const e=r.combination||"chain",t=r.options||{},n=r.fetchOptions||{};function i(a,...o){const s=de(()=>{const c=la(r.baseUrl),f=la(a);return c&&!tU(f)?iU(c,f):f});let l=t,u=n;return o.length>0&&(hg(o[0])?l={...l,...o[0],beforeFetch:Hu(e,t.beforeFetch,o[0].beforeFetch),afterFetch:Hu(e,t.afterFetch,o[0].afterFetch),onFetchError:Hu(e,t.onFetchError,o[0].onFetchError)}:u={...u,...o[0],headers:{...Vh(u.headers)||{},...Vh(o[0].headers)||{}}}),o.length>1&&hg(o[1])&&(l={...l,...o[1],beforeFetch:Hu(e,t.beforeFetch,o[1].beforeFetch),afterFetch:Hu(e,t.afterFetch,o[1].afterFetch),onFetchError:Hu(e,t.onFetchError,o[1].onFetchError)}),nU(s,u,l)}return i}function nU(r,...e){var t;const n=typeof AbortController=="function";let i={},a={immediate:!0,refetch:!1,timeout:0,updateDataOnError:!1};const o={method:"GET",type:"text",payload:void 0};e.length>0&&(hg(e[0])?a={...a,...e[0]}:i=e[0]),e.length>1&&hg(e[1])&&(a={...a,...e[1]});const{fetch:s=(t=JW)==null?void 0:t.fetch,initialData:l,timeout:u}=a,c=E1(),f=E1(),h=E1(),d=te(!1),p=te(!1),v=te(!1),m=te(null),g=zl(null),y=zl(null),b=zl(l||null),_=de(()=>n&&p.value);let x,w;const S=()=>{n&&(x==null||x.abort(),x=new AbortController,x.signal.onabort=()=>v.value=!0,i={...i,signal:x.signal})},T=R=>{p.value=R,d.value=!R};u&&(w=ZW(S,u,{immediate:!1}));let C=0;const A=async(R=!1)=>{var P,O;S(),T(!0),y.value=null,m.value=null,v.value=!1,C+=1;const j=C,F={method:o.method,headers:{}};if(o.payload){const J=Vh(F.headers),U=la(o.payload);!o.payloadType&&U&&Object.getPrototypeOf(U)===Object.prototype&&!(U instanceof FormData)&&(o.payloadType="json"),o.payloadType&&(J["Content-Type"]=(P=QW[o.payloadType])!=null?P:o.payloadType),F.body=o.payloadType==="json"?JSON.stringify(U):U}let N=!1;const B={url:la(r),options:{...F,...i},cancel:()=>{N=!0}};if(a.beforeFetch&&Object.assign(B,await a.beforeFetch(B)),N||!s)return T(!1),Promise.resolve(null);let $=null;return w&&w.start(),s(B.url,{...F,...B.options,headers:{...Vh(F.headers),...Vh((O=B.options)==null?void 0:O.headers)}}).then(async J=>{if(g.value=J,m.value=J.status,$=await J.clone()[o.type](),!J.ok)throw b.value=l||null,new Error(J.statusText);return a.afterFetch&&({data:$}=await a.afterFetch({data:$,response:J})),b.value=$,c.trigger(J),J}).catch(async J=>{let U=J.message||J.name;if(a.onFetchError&&({error:U,data:$}=await a.onFetchError({data:$,error:J,response:g.value})),y.value=U,a.updateDataOnError&&(b.value=$),f.trigger(J),R)throw J;return null}).finally(()=>{j===C&&T(!1),w&&w.stop(),h.trigger(null)})},M=L1(a.refetch);Nt([M,L1(r)],([R])=>R&&A(),{deep:!0});const D={isFinished:lo(d),isFetching:lo(p),statusCode:m,response:g,error:y,data:b,canAbort:_,aborted:v,abort:S,execute:A,onFetchResponse:c.on,onFetchError:f.on,onFetchFinally:h.on,get:E("GET"),put:E("PUT"),post:E("POST"),delete:E("DELETE"),patch:E("PATCH"),head:E("HEAD"),options:E("OPTIONS"),json:I("json"),text:I("text"),blob:I("blob"),arrayBuffer:I("arrayBuffer"),formData:I("formData")};function E(R){return(P,O)=>{if(!p.value)return o.method=R,o.payload=P,o.payloadType=O,b3(o.payload)&&Nt([M,L1(o.payload)],([j])=>j&&A(),{deep:!0}),{...D,then(j,F){return L().then(j,F)}}}}function L(){return new Promise((R,P)=>{KW(d).toBe(!0).then(()=>R(D)).catch(O=>P(O))})}function I(R){return()=>{if(!p.value)return o.type=R,{...D,then(P,O){return L().then(P,O)}}}}return a.immediate&&Promise.resolve().then(()=>A()),{...D,then(R,P){return L().then(R,P)}}}function iU(r,e){return!r.endsWith("/")&&!e.startsWith("/")?`${r}/${e}`:`${r}${e}`}const aU={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function oU(r,e){return Y(),ae("svg",aU,e[0]||(e[0]=[Z("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 6L9 17l-5-5"},null,-1)]))}const sU=vt({name:"lucide-check",render:oU}),lU={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function uU(r,e){return Y(),ae("svg",lU,e[0]||(e[0]=[Z("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m6 9l6 6l6-6"},null,-1)]))}vt({name:"lucide-chevron-down",render:uU});function cU(r,e,t){var n;return function(){var i=this,a=arguments,o=function(){n=void 0,r.apply(i,a)};clearTimeout(n),n=window.setTimeout(o,e)}}const fU=["type","placeholder","disabled","id","value","required"],hU=Ke({inheritAttrs:!1,__name:"TextInput",props:{type:{default:"text"},size:{default:"sm"},variant:{default:"subtle"},placeholder:{},disabled:{type:Boolean},id:{},modelValue:{},debounce:{},required:{type:Boolean}},emits:["update:modelValue"],setup(r,{expose:e,emit:t}){const n=r,i=t,a=i0(),o=_3(),s=de(()=>Object.fromEntries(Object.entries(o).filter(([v])=>v!=="class"&&v!=="style"))),l=te(null);e({el:l});const u=de(()=>n.disabled?"text-ink-gray-5":"text-ink-gray-8"),c=de(()=>{let v={sm:"text-base rounded h-7",md:"text-base rounded h-8",lg:"text-lg rounded-md h-10",xl:"text-xl rounded-md h-10"}[n.size],m={sm:["py-1.5",a.prefix?"pl-8":"pl-2",a.suffix?"pr-8":"pr-2"],md:["py-1.5",a.prefix?"pl-9":"pl-2.5",a.suffix?"pr-9":"pr-2.5"],lg:["py-1.5",a.prefix?"pl-10":"pl-3",a.suffix?"pr-10":"pr-3"],xl:["py-1.5",a.prefix?"pl-10":"pl-3",a.suffix?"pr-10":"pr-3"]}[n.size],g=n.disabled?"disabled":n.variant,y={subtle:"border border-[--surface-gray-2] bg-surface-gray-2 placeholder-ink-gray-4 hover:border-outline-gray-modals hover:bg-surface-gray-3 focus:bg-surface-white focus:border-outline-gray-4 focus:shadow-sm focus:ring-0 focus-visible:ring-2 focus-visible:ring-outline-gray-3",outline:"border border-outline-gray-2 bg-surface-white placeholder-ink-gray-4 hover:border-outline-gray-3 hover:shadow-sm focus:bg-surface-white focus:border-outline-gray-4 focus:shadow-sm focus:ring-0 focus-visible:ring-2 focus-visible:ring-outline-gray-3",disabled:["border bg-surface-gray-1 placeholder-ink-gray-3",n.variant==="outline"?"border-outline-gray-2":"border-transparent"]}[g];return[v,m,y,u.value,"transition-colors w-full dark:[color-scheme:dark]"]});let f=de(()=>({sm:"pl-2",md:"pl-2.5",lg:"pl-3",xl:"pl-3"})[n.size]),h=de(()=>({sm:"pr-2",md:"pr-2.5",lg:"pr-3",xl:"pr-3"})[n.size]),d=v=>{i("update:modelValue",v)};n.debounce&&(d=cU(d,n.debounce));let p=v=>{d(v.target.value)};return(v,m)=>(Y(),ae("div",{class:kt(["relative flex items-center",H(o).class]),style:Sa(H(o).style)},[v.$slots.prefix?(Y(),ae("div",{key:0,class:kt(["absolute inset-y-0 left-0 flex items-center",u.value,H(f)])},[Je(v.$slots,"prefix")],2)):ct("",!0),Z("input",rr({ref_key:"inputRef",ref:l,type:v.type,placeholder:v.placeholder,class:c.value,disabled:v.disabled,id:v.id,value:v.modelValue,required:v.required,onInput:m[0]||(m[0]=(...g)=>H(p)&&H(p)(...g)),onChange:m[1]||(m[1]=(...g)=>H(p)&&H(p)(...g))},s.value),null,16,fU),v.$slots.suffix?(Y(),ae("div",{key:1,class:kt(["absolute inset-y-0 right-0 flex items-center",u.value,H(h)])},[Je(v.$slots,"suffix")],2)):ct("",!0)],6))}});var uN=60,cN=uN*60,fN=cN*24,dU=fN*7,bo=1e3,Vl=uN*bo,_d=cN*bo,xd=fN*bo,hN=dU*bo,f0="millisecond",Ml="second",ha="minute",kl="hour",to="day",wm="week",ti="month",dN="quarter",ro="year",Mc="date",sT="YYYY-MM-DDTHH:mm:ssZ",ek="Invalid Date",pU=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,pN=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g;const vU={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}};var tw=function(e,t,n){var i=String(e);return!i||i.length>=t?e:""+Array(t+1-i.length).join(n)+e},mU=function(e){var t=-e.utcOffset(),n=Math.abs(t),i=Math.floor(n/60),a=n%60;return(t<=0?"+":"-")+tw(i,2,"0")+":"+tw(a,2,"0")},gU=function r(e,t){if(e.date()1)return r(o[0])}else{var s=e.name;$l[s]=e,i=s}return!n&&i&&($h=i),i||!n&&$h},Vt=function(e,t){if(lT(e))return e.clone();var n=typeof t=="object"?t:{};return n.date=e,n.args=arguments,new h0(n)},wU=function(e,t){return Vt(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})},Pt=xU;Pt.l=dg;Pt.i=lT;Pt.w=wU;var SU=function(e){var t=e.date,n=e.utc;if(t===null)return new Date(NaN);if(Pt.u(t))return new Date;if(t instanceof Date)return new Date(t);if(typeof t=="string"&&!/Z$/i.test(t)){var i=t.match(pU);if(i){var a=i[2]-1||0,o=(i[7]||"0").substring(0,3);return n?new Date(Date.UTC(i[1],a,i[3]||1,i[4]||0,i[5]||0,i[6]||0,o)):new Date(i[1],a,i[3]||1,i[4]||0,i[5]||0,i[6]||0,o)}}return new Date(t)},h0=function(){function r(t){this.$L=dg(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[vN]=!0}var e=r.prototype;return e.parse=function(n){this.$d=SU(n),this.init()},e.init=function(){var n=this.$d;this.$y=n.getFullYear(),this.$M=n.getMonth(),this.$D=n.getDate(),this.$W=n.getDay(),this.$H=n.getHours(),this.$m=n.getMinutes(),this.$s=n.getSeconds(),this.$ms=n.getMilliseconds()},e.$utils=function(){return Pt},e.isValid=function(){return this.$d.toString()!==ek},e.isSame=function(n,i){var a=Vt(n);return this.startOf(i)<=a&&a<=this.endOf(i)},e.isAfter=function(n,i){return Vt(n)0,_<=b.r||!b.r){_<=1&&y>0&&(b=d[y-1]);var x=h[b.l];f&&(_=f(""+_)),typeof x=="string"?m=x.replace("%d",_):m=x(_,l,b.l,g);break}}if(l)return m;var w=g?h.future:h.past;return typeof w=="function"?w(m):w.replace("%s",m)};function a(s,l,u,c){return n.fromToBase(s,l,u,c)}n.to=function(s,l){return a(s,l,this,!0)},n.from=function(s,l){return a(s,l,this)};var o=function(l){return l.$u?t.utc():t()};n.toNow=function(s){return this.to(o(this),s)},n.fromNow=function(s){return this.from(o(this),s)}};var CU=function(e){return e.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(t,n,i){return n||i.slice(1)})},gN={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},AU=function(e,t){return e.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(n,i,a){var o=a&&a.toUpperCase();return i||t[a]||gN[a]||CU(t[o])})};const MU=function(r,e,t){var n=e.prototype,i=n.format;t.en.formats=gN,n.format=function(a){a===void 0&&(a=sT);var o=this.$locale(),s=o.formats,l=s===void 0?{}:s,u=AU(a,l);return i.call(this,u)}},kU=function(r,e,t){t.updateLocale=function(n,i){var a=t.Ls,o=a[n];if(o){var s=i?Object.keys(i):[];return s.forEach(function(l){o[l]=i[l]}),o}}},DU=function(r,e,t){var n=e.prototype;n.isToday=function(){var i="YYYY-MM-DD",a=t();return this.format(i)===a.format(i)}};var pg=xd*365,rw=pg/12,EU=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,Of={years:pg,months:rw,days:xd,hours:_d,minutes:Vl,seconds:bo,milliseconds:1,weeks:hN},Sm=function(e){return e instanceof _N},yN,ra,xh=function(e,t,n){return new _N(e,n,t.$l)},jf=function(e){return ra.p(e)+"s"},bN=function(e){return e<0},Hs=function(e){return bN(e)?Math.ceil(e):Math.floor(e)},LU=function(e){return Math.abs(e)},Gu=function(e,t){return e?bN(e)?{negative:!0,format:""+LU(e)+t}:{negative:!1,format:""+e+t}:{negative:!1,format:""}},_N=function(){function r(t,n,i){var a=this;if(this.$d={},this.$l=i,t===void 0&&(this.$ms=0,this.parseFromMilliseconds()),n)return xh(t*Of[jf(n)],this);if(typeof t=="number")return this.$ms=t,this.parseFromMilliseconds(),this;if(typeof t=="object")return Object.keys(t).forEach(function(u){a.$d[jf(u)]=t[u]}),this.calMilliseconds(),this;if(typeof t=="string"){var o=t.match(EU);if(o){var s=o.slice(2),l=s.map(function(u){return u!=null?Number(u):0});return this.$d.years=l[0],this.$d.months=l[1],this.$d.weeks=l[2],this.$d.days=l[3],this.$d.hours=l[4],this.$d.minutes=l[5],this.$d.seconds=l[6],this.calMilliseconds(),this}}return this}var e=r.prototype;return e.calMilliseconds=function(){var n=this;this.$ms=Object.keys(this.$d).reduce(function(i,a){return i+(n.$d[a]||0)*Of[a]},0)},e.parseFromMilliseconds=function(){var n=this.$ms;this.$d.years=Hs(n/pg),n%=pg,this.$d.months=Hs(n/rw),n%=rw,this.$d.days=Hs(n/xd),n%=xd,this.$d.hours=Hs(n/_d),n%=_d,this.$d.minutes=Hs(n/Vl),n%=Vl,this.$d.seconds=Hs(n/bo),n%=bo,this.$d.milliseconds=n},e.toISOString=function(){var n=Gu(this.$d.years,"Y"),i=Gu(this.$d.months,"M"),a=+this.$d.days||0;this.$d.weeks&&(a+=this.$d.weeks*7);var o=Gu(a,"D"),s=Gu(this.$d.hours,"H"),l=Gu(this.$d.minutes,"M"),u=this.$d.seconds||0;this.$d.milliseconds&&(u+=this.$d.milliseconds/1e3,u=Math.round(u*1e3)/1e3);var c=Gu(u,"S"),f=n.negative||i.negative||o.negative||s.negative||l.negative||c.negative,h=s.format||l.format||c.format?"T":"",d=f?"-":"",p=d+"P"+n.format+i.format+o.format+h+s.format+l.format+c.format;return p==="P"||p==="-P"?"P0D":p},e.toJSON=function(){return this.toISOString()},e.format=function(n){var i=n||"YYYY-MM-DDTHH:mm:ss",a={Y:this.$d.years,YY:ra.s(this.$d.years,2,"0"),YYYY:ra.s(this.$d.years,4,"0"),M:this.$d.months,MM:ra.s(this.$d.months,2,"0"),D:this.$d.days,DD:ra.s(this.$d.days,2,"0"),H:this.$d.hours,HH:ra.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:ra.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:ra.s(this.$d.seconds,2,"0"),SSS:ra.s(this.$d.milliseconds,3,"0")};return i.replace(pN,function(o,s){return s||String(a[o])})},e.as=function(n){return this.$ms/Of[jf(n)]},e.get=function(n){var i=this.$ms,a=jf(n);return a==="milliseconds"?i%=1e3:a==="weeks"?i=Hs(i/Of[a]):i=this.$d[a],i||0},e.add=function(n,i,a){var o;return i?o=n*Of[jf(i)]:Sm(n)?o=n.$ms:o=xh(n,this).$ms,xh(this.$ms+o*(a?-1:1),this)},e.subtract=function(n,i){return this.add(n,i,!0)},e.locale=function(n){var i=this.clone();return i.$l=n,i},e.clone=function(){return xh(this.$ms,this)},e.humanize=function(n){return yN().add(this.$ms,"ms").locale(this.$l).fromNow(!n)},e.valueOf=function(){return this.asMilliseconds()},e.milliseconds=function(){return this.get("milliseconds")},e.asMilliseconds=function(){return this.as("milliseconds")},e.seconds=function(){return this.get("seconds")},e.asSeconds=function(){return this.as("seconds")},e.minutes=function(){return this.get("minutes")},e.asMinutes=function(){return this.as("minutes")},e.hours=function(){return this.get("hours")},e.asHours=function(){return this.as("hours")},e.days=function(){return this.get("days")},e.asDays=function(){return this.as("days")},e.weeks=function(){return this.get("weeks")},e.asWeeks=function(){return this.as("weeks")},e.months=function(){return this.get("months")},e.asMonths=function(){return this.as("months")},e.years=function(){return this.get("years")},e.asYears=function(){return this.as("years")},r}(),tk=function(e,t,n){return e.add(t.years()*n,"y").add(t.months()*n,"M").add(t.days()*n,"d").add(t.hours()*n,"h").add(t.minutes()*n,"m").add(t.seconds()*n,"s").add(t.milliseconds()*n,"ms")};const IU=function(r,e,t){yN=t,ra=t().$utils(),t.duration=function(a,o){var s=t.locale();return xh(a,{$l:s},o)},t.isDuration=Sm;var n=e.prototype.add,i=e.prototype.subtract;e.prototype.add=function(a,o){return Sm(a)?tk(this,a,1):n.bind(this)(a,o)},e.prototype.subtract=function(a,o){return Sm(a)?tk(this,a,-1):i.bind(this)(a,o)}};var PU=/[+-]\d\d(?::?\d\d)?/g,RU=/([+-]|\d\d)/g;function OU(r){r===void 0&&(r="");var e=r.match(PU);if(!e)return null;var t=(""+e[0]).match(RU)||["-",0,0],n=t[0],i=t[1],a=t[2],o=+i*60+ +a;return o===0?0:n==="+"?o:-o}const jU=function(r,e,t){var n=e.prototype;t.utc=function(f){var h={date:f,utc:!0,args:arguments};return new e(h)},n.utc=function(f){var h=t(this.toDate(),{locale:this.$L,utc:!0});return f?h.add(this.utcOffset(),ha):h},n.local=function(){return t(this.toDate(),{locale:this.$L,utc:!1})};var i=n.parse;n.parse=function(f){f.utc&&(this.$u=!0),this.$utils().u(f.$offset)||(this.$offset=f.$offset),i.call(this,f)};var a=n.init;n.init=function(){if(this.$u){var f=this.$d;this.$y=f.getUTCFullYear(),this.$M=f.getUTCMonth(),this.$D=f.getUTCDate(),this.$W=f.getUTCDay(),this.$H=f.getUTCHours(),this.$m=f.getUTCMinutes(),this.$s=f.getUTCSeconds(),this.$ms=f.getUTCMilliseconds()}else a.call(this)};var o=n.utcOffset;n.utcOffset=function(f,h){var d=this.$utils(),p=d.u;if(p(f))return this.$u?0:p(this.$offset)?o.call(this):this.$offset;if(typeof f=="string"&&(f=OU(f),f===null))return this;var v=Math.abs(f)<=16?f*60:f,m=this;if(h)return m.$offset=v,m.$u=f===0,m;if(f!==0){var g=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();m=this.local().add(v+g,ha),m.$offset=v,m.$x.$localOffset=g}else m=this.utc();return m};var s=n.format,l="YYYY-MM-DDTHH:mm:ss[Z]";n.format=function(f){var h=f||(this.$u?l:"");return s.call(this,h)},n.valueOf=function(){var f=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-f*Vl},n.isUTC=function(){return!!this.$u},n.toISOString=function(){return this.toDate().toISOString()},n.toString=function(){return this.toDate().toUTCString()};var u=n.toDate;n.toDate=function(f){return f==="s"&&this.$offset?t(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():u.call(this)};var c=n.diff;n.diff=function(f,h,d){if(f&&this.$u===f.$u)return c.call(this,f,h,d);var p=this.local(),v=t(f).local();return c.call(p,v,h,d)}};var NU={year:0,month:1,day:2,hour:3,minute:4,second:5},rk={},BU=function(e,t){t===void 0&&(t={});var n=t.timeZoneName||"short",i=e+"|"+n,a=rk[i];return a||(a=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:n}),rk[i]=a),a};const zU=function(r,e,t){var n,i=function(c,f,h){h===void 0&&(h={});var d=new Date(c),p=BU(f,h);return p.formatToParts(d)},a=function(c,f){for(var h=i(c,f),d=[],p=0;p=0&&(d[y]=parseInt(g,10))}var b=d[3],_=b===24?0:b,x=d[0]+"-"+d[1]+"-"+d[2]+" "+_+":"+d[4]+":"+d[5]+":000",w=t.utc(x).valueOf(),S=+c,T=S%1e3;return S-=T,(w-S)/6e4},o=function(c,f,h){var d=c-f*60*1e3,p=a(d,h);if(f===p)return[d,f];d-=(p-f)*60*1e3;var v=a(d,h);return p===v?[d,p]:[c-Math.min(p,v)*60*1e3,Math.max(p,v)]},s=e.prototype;s.tz=function(u,c){u===void 0&&(u=n);var f=this.utcOffset(),h=this.toDate(),d=h.toLocaleString("en-US",{timeZone:u}),p=Math.round((h-new Date(d))/1e3/60),v=-Math.round(h.getTimezoneOffset()/15)*15-p,m=!Number(v),g;if(m)g=this.utcOffset(0,c);else if(g=t(d,{locale:this.$L}).$set(f0,this.$ms).utcOffset(v,!0),c){var y=g.utcOffset();g=g.add(f-y,ha)}return g.$x.$timezone=u,g},s.offsetName=function(u){var c=this.$x.$timezone||t.tz.guess(),f=i(this.valueOf(),c,{timeZoneName:u}).find(function(h){return h.type.toLowerCase()==="timezonename"});return f&&f.value};var l=s.startOf;s.startOf=function(u,c){if(!this.$x||!this.$x.$timezone)return l.call(this,u,c);var f=t(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L}),h=l.call(f,u,c);return h.tz(this.$x.$timezone,!0)},t.tz=function(u,c,f){var h=f&&c,d=f||c||n,p=a(+t(),d);if(typeof u!="string")return t(u).tz(d);var v=t.utc(u,h).valueOf(),m=o(v,p,d),g=m[0],y=m[1],b=t(g).utcOffset(y);return b.$x.$timezone=d,b},t.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},t.tz.setDefault=function(u){n=u}},FU=function(r,e){var t=e.prototype,n=t.format;t.format=function(i){var a=this,o=this.$locale();if(!this.isValid())return n.bind(this)(i);var s=this.$utils(),l=i||sT,u=l.replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,function(c){switch(c){case"Q":return Math.ceil((a.$M+1)/3);case"Do":return o.ordinal(a.$D);case"gggg":return a.weekYear();case"GGGG":return a.isoWeekYear();case"wo":return o.ordinal(a.week(),"W");case"w":case"ww":return s.s(a.week(),c==="w"?1:2,"0");case"W":case"WW":return s.s(a.isoWeek(),c==="W"?1:2,"0");case"k":case"kk":return s.s(String(a.$H===0?24:a.$H),c==="k"?1:2,"0");case"X":return Math.floor(a.$d.getTime()/1e3);case"x":return a.$d.getTime();case"z":return"["+a.offsetName()+"]";case"zzz":return"["+a.offsetName("long")+"]";default:return c}});return n.bind(this)(u)}};Vt.extend(kU);Vt.extend(TU);Vt.extend(MU);Vt.extend(DU);Vt.extend(IU);Vt.extend(jU);Vt.extend(zU);Vt.extend(FU);const VU={class:"bg-surface-modal px-4 pb-6 pt-5 sm:px-6"},$U={class:"flex"},HU={class:"w-full flex-1"},GU={class:"mb-6 flex items-center justify-between"},WU={class:"flex items-center space-x-2"},UU={class:"text-2xl font-semibold leading-6 text-ink-gray-9"},YU={class:"text-p-base text-ink-gray-7"},qU={key:0,class:"px-4 pb-7 pt-4 sm:px-6"},XU={class:"space-y-2"},KU=Ke({__name:"Dialog",props:{modelValue:{type:Boolean},options:{default:()=>({})},disableOutsideClickToClose:{type:Boolean,default:!1}},emits:["update:modelValue","close","after-leave"],setup(r,{emit:e}){const t=r,n=e,i=de(()=>{let h=t.options.actions;return h!=null&&h.length?h.map(d=>{let p=wu({...d,loading:!1,onClick:d.onClick?async()=>{p.loading=!0;try{if(d.onClick){let v=()=>{console.warn("Value passed to onClick is a context object. Please use context.close() instead of context() to close the dialog."),s()};v.close=s,await d.onClick(v)}}finally{p.loading=!1}}:s});return p}):[]}),a=de({get(){return t.modelValue},set(h){n("update:modelValue",h),h||n("close")}});function o(h){a.value=h}function s(){a.value=!1}const l=de(()=>{var d;if(!((d=t.options)!=null&&d.icon))return null;let h=t.options.icon;return typeof h=="string"&&(h={name:h}),h}),u=de(()=>{var p;const h=((p=t.options)==null?void 0:p.position)||"center";return{center:"justify-center",top:"pt-[20vh]"}[h]}),c=de(()=>{var p;const h=(p=l.value)==null?void 0:p.appearance;return h?{warning:"bg-surface-amber-2",info:"bg-surface-blue-2",danger:"bg-surface-red-2",success:"bg-surface-green-2"}[h]:"bg-surface-gray-2"}),f=de(()=>{var p;const h=(p=l.value)==null?void 0:p.appearance;return h?{warning:"text-ink-amber-3",info:"text-ink-blue-3",danger:"text-ink-red-4",success:"text-ink-green-3"}[h]:"text-ink-gray-5"});return(h,d)=>{const p=kH("LucideX");return Y(),$e(H(A9),{open:a.value,"onUpdate:open":[d[3]||(d[3]=v=>a.value=v),o]},{default:_e(()=>[Ie(H(iG),null,{default:_e(()=>[Ie(H(tG),{class:"fixed inset-0 bg-black-overlay-200 backdrop-filter backdrop-blur-[12px] overflow-y-auto dialog-overlay","data-dialog":h.options.title,onAfterLeave:d[2]||(d[2]=v=>h.$emit("after-leave"))},{default:_e(()=>[Z("div",{class:kt(["flex min-h-screen flex-col items-center px-4 py-4 text-center",u.value])},[Ie(H(K9),{class:kt(["my-8 inline-block w-full transform overflow-hidden rounded-xl bg-surface-modal text-left align-middle shadow-xl dialog-content",{"max-w-7xl":h.options.size==="7xl","max-w-6xl":h.options.size==="6xl","max-w-5xl":h.options.size==="5xl","max-w-4xl":h.options.size==="4xl","max-w-3xl":h.options.size==="3xl","max-w-2xl":h.options.size==="2xl","max-w-xl":h.options.size==="xl","max-w-lg":h.options.size==="lg"||!h.options.size,"max-w-md":h.options.size==="md","max-w-sm":h.options.size==="sm","max-w-xs":h.options.size==="xs"}]),onEscapeKeyDown:d[0]||(d[0]=v=>s()),onInteractOutside:d[1]||(d[1]=v=>{t.disableOutsideClickToClose&&v.preventDefault()})},{default:_e(()=>[Je(h.$slots,"body",{},()=>[Je(h.$slots,"body-main",{},()=>[Z("div",VU,[Z("div",$U,[Z("div",HU,[Je(h.$slots,"body-header",{},()=>[Z("div",GU,[Z("div",WU,[l.value?(Y(),ae("div",{key:0,class:kt(["flex h-7 w-7 flex-shrink-0 items-center justify-center rounded-full",c.value])},[Ie(xm,{name:l.value.name,class:kt(["h-4 w-4",f.value]),"aria-hidden":"true"},null,8,["name","class"])],2)):ct("",!0),Ie(H(Y3),{as:"header"},{default:_e(()=>[Je(h.$slots,"body-title",{},()=>[Z("h3",UU,qt(h.options.title||"Untitled"),1)],!0)]),_:3})]),Ie(H(k9),{"as-child":""},{default:_e(()=>[Ie(H(ui),{variant:"ghost",onClick:s},{icon:_e(()=>[Ie(p,{class:"h-4 w-4 text-ink-gray-9"})]),_:1})]),_:1})])],!0),Je(h.$slots,"body-content",{},()=>[h.options.message?(Y(),$e(H(W3),{key:0,"as-child":""},{default:_e(()=>[Z("p",YU,qt(h.options.message),1)]),_:1})):ct("",!0)],!0)])])])],!0),i.value.length||h.$slots.actions?(Y(),ae("div",qU,[Je(h.$slots,"actions",r0(n0({close:s})),()=>[Z("div",XU,[(Y(!0),ae(oi,null,cp(i.value,v=>(Y(),$e(H(ui),rr({class:"w-full",key:v.label,disabled:v.disabled},{ref_for:!0},v),{default:_e(()=>[Di(qt(v.label),1)]),_:2},1040,["disabled"]))),128))])],!0)])):ct("",!0)],!0)]),_:3},8,["class"])],2)]),_:3},8,["data-dialog"])]),_:3})]),_:3},8,["open"])}}}),xN=DH(KU,[["__scopeId","data-v-7e147ead"]]),wN=xN;wN.Title=Y3;wN.Description=W3;te([]);const ZU=["innerHTML"],JU=Ke({__name:"ErrorMessage",props:{message:{}},setup(r){const e=r,t=de(()=>e.message?e.message instanceof Error?e.message.messages||e.message.message:e.message:"");return(n,i)=>n.message?(Y(),ae("div",{key:0,class:"whitespace-pre-line text-sm text-ink-red-4",role:"alert",innerHTML:t.value},null,8,ZU)):ct("",!0)}}),QU={class:"relative flex items-center"},eY=["disabled","id","value"],tY=["value","disabled","selected"],SN=Ke({inheritAttrs:!1,__name:"Select",props:{size:{default:"sm"},variant:{default:"subtle"},placeholder:{},disabled:{type:Boolean},id:{},modelValue:{},options:{}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e;i0();const i=_3();function a(h){n("update:modelValue",h.target.value)}const o=de(()=>{var h;return((h=t.options)==null?void 0:h.map(d=>typeof d=="string"?{label:d,value:d}:d).filter(Boolean))||[]}),s=de(()=>t.disabled?"text-ink-gray-4":"text-ink-gray-8"),l=de(()=>({sm:"text-base",md:"text-base",lg:"text-lg",xl:"text-xl"})[t.size]),u=de(()=>({sm:"pl-2 pr-5",md:"pl-2.5 pr-5.5",lg:"pl-3 pr-6",xl:"pl-3 pr-6"})[t.size]),c=de(()=>{let h={sm:"rounded h-7",md:"rounded h-8",lg:"rounded-md h-10",xl:"rounded-md h-10"}[t.size],d=t.disabled?"disabled":t.variant,p={subtle:"border border-[--surface-gray-2] bg-surface-gray-2 hover:border-outline-gray-modals hover:bg-surface-gray-3 focus:border-outline-gray-4 focus:ring-0 focus-visible:ring-2 focus-visible:ring-outline-gray-3",outline:"border border-outline-gray-2 bg-surface-white hover:border-outline-gray-3 focus:border-outline-gray-4 focus:ring-0 focus-visible:ring-2 focus-visible:ring-outline-gray-3",ghost:"bg-transparent border-transparent hover:bg-surface-gray-3 focus:bg-surface-gray-3 focus:border-outline-gray-4 focus:ring-0 focus-visible:ring-2 focus-visible:ring-outline-gray-3",disabled:["border",t.variant!=="ghost"?"bg-surface-gray-1":"",t.variant==="outline"?"border-outline-gray-2":"border-transparent"]}[d];return[h,l.value,u.value,p,s.value,"transition-colors w-full py-0 truncate"]});let f=de(()=>({sm:"pl-2",md:"pl-2.5",lg:"pl-3",xl:"pl-3"})[t.size]);return(h,d)=>(Y(),ae("div",QU,[h.$slots.prefix?(Y(),ae("div",{key:0,class:kt(["absolute inset-y-0 left-0 flex items-center",s.value,H(f)])},[Je(h.$slots,"prefix")],2)):ct("",!0),h.placeholder?og((Y(),ae("div",{key:1,class:kt(["pointer-events-none absolute text-ink-gray-4 truncate w-full",[l.value,u.value]])},qt(h.placeholder),3)),[[EH,!h.modelValue]]):ct("",!0),Z("select",rr({class:c.value,disabled:h.disabled,id:h.id,value:h.modelValue,onChange:a},H(i)),[(Y(!0),ae(oi,null,cp(o.value,p=>(Y(),ae("option",{key:p.value,value:p.value,disabled:p.disabled||!1,selected:h.modelValue===p.value},qt(p.label),9,tY))),128))],16,eY)]))}}),rY={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function nY(r,e){return Y(),ae("svg",rY,e[0]||(e[0]=[Z("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[Z("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 19.876 0a1 1 0 0 1 0 .696a10.75 10.75 0 0 1-19.876 0"}),Z("circle",{cx:"12",cy:"12",r:"3"})],-1)]))}vt({name:"lucide-eye",render:nY});const iY={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function aY(r,e){return Y(),ae("svg",iY,e[0]||(e[0]=[Z("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[Z("path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575a1 1 0 0 1 0 .696a10.8 10.8 0 0 1-1.444 2.49m-6.41-.679a3 3 0 0 1-4.242-4.242"}),Z("path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151a1 1 0 0 1 0-.696a10.75 10.75 0 0 1 4.446-5.143M2 2l20 20"})],-1)]))}vt({name:"lucide-eye-off",render:aY});const oY={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function sY(r,e){return Y(),ae("svg",oY,e[0]||(e[0]=[Z("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3"},null,-1)]))}vt({name:"lucide-command",render:sY});const lY={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function uY(r,e){return Y(),ae("svg",lY,e[0]||(e[0]=[Z("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 13a1 1 0 0 0-1-1H5.061a1 1 0 0 1-.75-1.811l6.836-6.835a1.207 1.207 0 0 1 1.707 0l6.835 6.835a1 1 0 0 1-.75 1.811H16a1 1 0 0 0-1 1v6a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1z"},null,-1)]))}vt({name:"lucide-arrow-big-up",render:uY});const cY={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fY(r,e){return Y(),ae("svg",cY,e[0]||(e[0]=[Z("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 3h6l6 18h6M14 3h7"},null,-1)]))}vt({name:"lucide-option",render:fY});function Pr(r){this.content=r}Pr.prototype={constructor:Pr,find:function(r){for(var e=0;e>1}};Pr.from=function(r){if(r instanceof Pr)return r;var e=[];if(r)for(var t in r)e.push(t,r[t]);return new Pr(e)};function TN(r,e,t){for(let n=0;;n++){if(n==r.childCount||n==e.childCount)return r.childCount==e.childCount?null:t;let i=r.child(n),a=e.child(n);if(i==a){t+=i.nodeSize;continue}if(!i.sameMarkup(a))return t;if(i.isText&&i.text!=a.text){for(let o=0;i.text[o]==a.text[o];o++)t++;return t}if(i.content.size||a.content.size){let o=TN(i.content,a.content,t+1);if(o!=null)return o}t+=i.nodeSize}}function CN(r,e,t,n){for(let i=r.childCount,a=e.childCount;;){if(i==0||a==0)return i==a?null:{a:t,b:n};let o=r.child(--i),s=e.child(--a),l=o.nodeSize;if(o==s){t-=l,n-=l;continue}if(!o.sameMarkup(s))return{a:t,b:n};if(o.isText&&o.text!=s.text){let u=0,c=Math.min(o.text.length,s.text.length);for(;ue&&n(l,i+s,a||null,o)!==!1&&l.content.size){let c=s+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,t-c),n,i+c)}s=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,i){let a="",o=!0;return this.nodesBetween(e,t,(s,l)=>{let u=s.isText?s.text.slice(Math.max(e,l)-l,t-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 t=this.lastChild,n=e.firstChild,i=this.content.slice(),a=0;for(t.isText&&t.sameMarkup(n)&&(i[i.length-1]=t.withText(t.text+n.text),a=1);ae)for(let a=0,o=0;oe&&((ot)&&(s.isText?s=s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s=s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),n.push(s),i+=s.nodeSize),o=l}return new ne(n,i)}cutByIndex(e,t){return e==t?ne.empty:e==0&&t==this.content.length?this:new ne(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let i=this.content.slice(),a=this.size+t.nodeSize-n.nodeSize;return i[e]=t,new ne(i,a)}addToStart(e){return new ne([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new ne(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let i=this.child(t),a=n+i.nodeSize;if(a>=e)return a==e?qp(t+1,a):qp(t,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,t){if(!t)return ne.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new ne(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return ne.empty;let t,n=0;for(let i=0;ithis.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(a)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;tn.type.rank-i.type.rank),t}};Wt.none=[];class mg extends Error{}class ye{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=MN(this.content,e+this.openStart,t);return n&&new ye(n,this.openStart,this.openEnd)}removeBetween(e,t){return new ye(AN(this.content,e+this.openStart,t+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,t){if(!t)return ye.empty;let n=t.openStart||0,i=t.openEnd||0;if(typeof n!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ye(ne.fromJSON(e,t.content),n,i)}static maxOpen(e,t=!0){let n=0,i=0;for(let a=e.firstChild;a&&!a.isLeaf&&(t||!a.type.spec.isolating);a=a.firstChild)n++;for(let a=e.lastChild;a&&!a.isLeaf&&(t||!a.type.spec.isolating);a=a.lastChild)i++;return new ye(e,n,i)}}ye.empty=new ye(ne.empty,0,0);function AN(r,e,t){let{index:n,offset:i}=r.findIndex(e),a=r.maybeChild(n),{index:o,offset:s}=r.findIndex(t);if(i==e||a.isText){if(s!=t&&!r.child(o).isText)throw new RangeError("Removing non-flat range");return r.cut(0,e).append(r.cut(t))}if(n!=o)throw new RangeError("Removing non-flat range");return r.replaceChild(n,a.copy(AN(a.content,e-i-1,t-i-1)))}function MN(r,e,t,n){let{index:i,offset:a}=r.findIndex(e),o=r.maybeChild(i);if(a==e||o.isText)return r.cut(0,e).append(t).append(r.cut(e));let s=MN(o.content,e-a-1,t);return s&&r.replaceChild(i,o.copy(s))}function hY(r,e,t){if(t.openStart>r.depth)throw new mg("Inserted content deeper than insertion position");if(r.depth-t.openStart!=e.depth-t.openEnd)throw new mg("Inconsistent open depths");return kN(r,e,t,0)}function kN(r,e,t,n){let i=r.index(n),a=r.node(n);if(i==e.index(n)&&n=0&&r.isText&&r.sameMarkup(e[t])?e[t]=r.withText(e[t].text+r.text):e.push(r)}function Hh(r,e,t,n){let i=(e||r).node(t),a=0,o=e?e.index(t):i.childCount;r&&(a=r.index(t),r.depth>t?a++:r.textOffset&&(Hl(r.nodeAfter,n),a++));for(let s=a;si&&iw(r,e,i+1),o=n.depth>i&&iw(t,n,i+1),s=[];return Hh(null,r,i,s),a&&o&&e.index(i)==t.index(i)?(DN(a,o),Hl(Gl(a,EN(r,e,t,n,i+1)),s)):(a&&Hl(Gl(a,gg(r,e,i+1)),s),Hh(e,t,i,s),o&&Hl(Gl(o,gg(t,n,i+1)),s)),Hh(n,null,i,s),new ne(s)}function gg(r,e,t){let n=[];if(Hh(null,r,t,n),r.depth>t){let i=iw(r,e,t+1);Hl(Gl(i,gg(r,e,t+1)),n)}return Hh(e,null,t,n),new ne(n)}function dY(r,e){let t=e.depth-r.openStart,i=e.node(t).copy(r.content);for(let a=t-1;a>=0;a--)i=e.node(a).copy(ne.from(i));return{start:i.resolveNoCache(r.openStart+t),end:i.resolveNoCache(i.content.size-r.openEnd-t)}}class wd{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.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,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],i=e.child(t);return n?e.child(t).cut(n):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let a=0;a0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new yg(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=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],i=0,a=t;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 wd(t,n,a)}static resolveCached(e,t){let n=nk.get(e);if(n)for(let a=0;ae&&this.nodesBetween(e,t,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()+")"),LN(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=ne.empty,i=0,a=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,i,a),s=o&&o.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let l=i;lt.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t 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(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let i=ne.fromJSON(e,t.content),a=e.nodeType(t.type).create(t.attrs,i,n);return a.type.checkAttrs(a.attrs),a}};Wl.prototype.text=void 0;class bg extends Wl{constructor(e,t,n,i){if(super(e,t,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):LN(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new bg(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new bg(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function LN(r,e){for(let t=r.length-1;t>=0;t--)e=r[t].type.name+"("+e+")";return e}class uu{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new gY(e,t);if(n.next==null)return uu.empty;let i=IN(n);n.next&&n.err("Unexpected trailing text");let a=TY(SY(i));return CY(a,n),a}matchType(e){for(let t=0;tu.createAndFill()));for(let u=0;u=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let i=0;i{let a=i+(n.validEnd?"*":" ")+" ";for(let o=0;o"+e.indexOf(n.next[o].next);return a}).join(` `)}}uu.empty=new uu(!0);class gY{constructor(e,t){this.string=e,this.nodeTypes=t,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 IN(r){let e=[];do e.push(yY(r));while(r.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function yY(r){let e=[];do e.push(bY(r));while(r.next&&r.next!=")"&&r.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function bY(r){let e=wY(r);for(;;)if(r.eat("+"))e={type:"plus",expr:e};else if(r.eat("*"))e={type:"star",expr:e};else if(r.eat("?"))e={type:"opt",expr:e};else if(r.eat("{"))e=_Y(r,e);else break;return e}function ik(r){/\D/.test(r.next)&&r.err("Expected number, got '"+r.next+"'");let e=Number(r.next);return r.pos++,e}function _Y(r,e){let t=ik(r),n=t;return r.eat(",")&&(r.next!="}"?n=ik(r):n=-1),r.eat("}")||r.err("Unclosed braced range"),{type:"range",min:t,max:n,expr:e}}function xY(r,e){let t=r.nodeTypes,n=t[e];if(n)return[n];let i=[];for(let a in t){let o=t[a];o.isInGroup(e)&&i.push(o)}return i.length==0&&r.err("No node type or group '"+e+"' found"),i}function wY(r){if(r.eat("(")){let e=IN(r);return r.eat(")")||r.err("Missing closing paren"),e}else if(/\W/.test(r.next))r.err("Unexpected token '"+r.next+"'");else{let e=xY(r,r.next).map(t=>(r.inline==null?r.inline=t.isInline:r.inline!=t.isInline&&r.err("Mixing inline and block content"),{type:"name",value:t}));return r.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function SY(r){let e=[[]];return i(a(r,0),t()),e;function t(){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=t())}else if(o.type=="star"){let l=t();return n(s,l),i(a(o.expr,l),l),[n(l)]}else if(o.type=="plus"){let l=t();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{r[o].forEach(({term:s,to:l})=>{if(!s)return;let u;for(let c=0;c{u||i.push([s,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let a=e[n.join(",")]=new uu(n.indexOf(r.length-1)>-1);for(let o=0;o-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:ON(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Wl(this,this.computeAttrs(e),ne.from(t),Wt.setFrom(n))}createChecked(e=null,t,n){return t=ne.from(t),this.checkContent(t),new Wl(this,this.computeAttrs(e),t,Wt.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=ne.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let i=this.contentMatch.matchFragment(t),a=i&&i.fillBefore(ne.empty,!0);return a?new Wl(this,e,t.append(a),Wt.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let n=0;n-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;tn[a]=new BN(a,t,o));let i=t.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 AY(r,e,t){let n=t.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 ${r}, got ${a}`)}}class MY{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?AY(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class d0{constructor(e,t,n,i){this.name=e,this.rank=t,this.schema=n,this.spec=i,this.attrs=NN(e,i.attrs),this.excluded=null;let a=RN(this.attrs);this.instance=a?new Wt(this,a):null}create(e=null){return!e&&this.instance?this.instance:new Wt(this,ON(this.attrs,e))}static compile(e,t){let n=Object.create(null),i=0;return e.forEach((a,o)=>n[a]=new d0(a,i++,t,o)),n}removeFromSet(e){for(var t=0;t-1}}class kY{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=Pr.from(e.nodes),t.marks=Pr.from(e.marks||{}),this.nodes=ok.compile(this.spec.nodes,this),this.marks=d0.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]=uu.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?sk(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==""?[]:sk(this,o.split(" "))}this.nodeFromJSON=i=>Wl.fromJSON(this,i),this.markFromJSON=i=>Wt.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof ok){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(t,n,i)}text(e,t){let n=this.nodes.text;return new bg(n,n.defaultAttrs,e,Wt.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function sk(r,e){let t=[];for(let n=0;n-1)&&t.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return t}function DY(r){return r.tag!=null}function EY(r){return r.style!=null}let Gh=class ow{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(i=>{if(DY(i))this.tags.push(i);else if(EY(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,t={}){let n=new uk(this,t,!1);return n.addAll(e,Wt.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new uk(this,t,!0);return n.addAll(e,Wt.none,t.from,t.to),ye.maxOpen(n.finish())}matchTag(e,t,n){for(let i=n?this.tags.indexOf(n)+1:0;ie.length&&(s.charCodeAt(e.length)!=61||s.slice(e.length+1)!=t))){if(o.getAttrs){let l=o.getAttrs(t);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let t=[];function n(i){let a=i.priority==null?50:i.priority,o=0;for(;o{n(o=ck(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=ck(o)),o.node||o.ignore||o.mark||(o.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new ow(e,ow.schemaRules(e)))}};const zN={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},LY={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},FN={ol:!0,ul:!0},Sd=1,sw=2,Wh=4;function lk(r,e,t){return e!=null?(e?Sd:0)|(e==="full"?sw:0):r&&r.whitespace=="pre"?Sd|sw:t&~Wh}class Xp{constructor(e,t,n,i,a,o){this.type=e,this.attrs=t,this.marks=n,this.solid=i,this.options=o,this.content=[],this.activeMarks=Wt.none,this.match=a||(o&Wh?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(ne.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);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&Sd)){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 t=ne.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(ne.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!zN.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class uk{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let i=t.topNode,a,o=lk(null,t.preserveWhitespace,0)|(n?Wh:0);i?a=new Xp(i.type,i.attrs,Wt.none,!0,t.topMatch||i.type.contentMatch,o):n?a=new Xp(null,null,Wt.none,!0,null,o):a=new Xp(e.schema.topNodeType,null,Wt.none,!0,null,o),this.nodes=[a],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,i=this.top,a=i.options&sw?"full":this.localPreserveWS||(i.options&Sd)>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,` `);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),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,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;FN.hasOwnProperty(o)&&this.parser.normalizeLists&&IY(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(s=this.parser.matchTag(e,this,n));e:if(l?l.ignore:LY.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);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,c=this.needsBlock;if(zN.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,t);break e}let f=l&&l.skip?t:this.readStyles(e,t);f&&this.addAll(e,f),u&&this.sync(a),this.needsBlock=c}else{let u=this.readStyles(e,t);u&&this.addElementByRule(e,l,u,l.consuming===!1?s:void 0)}this.localPreserveWS=i}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` `),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let i=0;i!l.clearMark(u)):t=t.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)s=l;else break}}return t}addElementByRule(e,t,n,i){let a,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),n,e.nodeName=="BR")||this.leafFallback(e,n);else{let l=this.enter(o,t.attrs||null,n,t.preserveWhitespace);l&&(a=!0,n=l)}else{let l=this.parser.schema.marks[t.mark];n=n.concat(l.create(t.attrs))}let s=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,n,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,n,!1));else{let l=e;typeof t.contentElement=="string"?l=e.querySelector(t.contentElement):typeof t.contentElement=="function"?l=t.contentElement(e):t.contentElement&&(l=t.contentElement),this.findAround(e,l,!0),this.addAll(l,n),this.findAround(e,l,!1)}a&&this.sync(s)&&this.open--}addAll(e,t,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,t);this.findAtPoint(e,a)}findPlace(e,t,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(o.type?o.type.allowsMarkType(u.type):fk(u.type,e))?(l=u.addToSet(l),!1):!0),this.nodes.push(new Xp(e,t,l,i,null,s)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].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 t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=Sd)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let i=n.length-1;i>=0;i--)e+=n[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=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=t[s];if(u==""){if(s==t.length-1||s==0)continue;for(;l>=a;l--)if(o(s-1,l))return!0;return!1}else{let c=l>0||l==0&&i?this.nodes[l].type:n&&l>=a?n.node(l-a).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;l--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let n=this.parser.schema.nodes[t];if(n.isTextblock&&n.defaultAttrs)return n}}}function IY(r){for(let e=r.firstChild,t=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&FN.hasOwnProperty(n)&&t?(t.appendChild(e),e=t):n=="li"?t=e:n&&(t=null)}}function PY(r,e){return(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,e)}function ck(r){let e={};for(let t in r)e[t]=r[t];return e}function fk(r,e){let t=e.schema.nodes;for(let n in t){let i=t[n];if(!i.allowsMarkType(r))continue;let a=[],o=s=>{a.push(s);for(let l=0;l{if(a.length||o.marks.length){let s=0,l=0;for(;s=0;i--){let a=this.serializeMark(e.marks[i],e.isInline,t);a&&((a.contentDOM||a.dom).appendChild(n),n=a.dom)}return n}serializeMark(e,t,n={}){let i=this.marks[e.type.name];return i&&Tm(P1(n),i(e,t),null,e.attrs)}static renderSpec(e,t,n=null,i){return Tm(e,t,n,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new p0(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=hk(e.nodes);return t.text||(t.text=n=>n.text),t}static marksFromSchema(e){return hk(e.marks)}}function hk(r){let e={};for(let t in r){let n=r[t].spec.toDOM;n&&(e[t]=n)}return e}function P1(r){return r.document||window.document}const dk=new WeakMap;function RY(r){let e=dk.get(r);return e===void 0&&dk.set(r,e=OY(r)),e}function OY(r){let e=null;function t(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-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&&(t=i.slice(0,o),i=i.slice(o+1));let s,l=t?r.createElementNS(t,i):r.createElement(i),u=e[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let f in u)if(u[f]!=null){let h=f.indexOf(" ");h>0?l.setAttributeNS(f.slice(0,h),f.slice(h+1),u[f]):f=="style"&&l.style?l.style.cssText=u[f]:l.setAttribute(f,u[f])}}for(let f=c;fc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:d,contentDOM:p}=Tm(r,h,t,n);if(l.appendChild(d),p){if(s)throw new RangeError("Multiple content holes");s=p}}}return{dom:l,contentDOM:s}}const VN=65535,$N=Math.pow(2,16);function jY(r,e){return r+e*$N}function pk(r){return r&VN}function NY(r){return(r-(r&VN))/$N}const HN=1,GN=2,Cm=4,WN=8;class lw{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&WN)>0}get deletedBefore(){return(this.delInfo&(HN|Cm))>0}get deletedAfter(){return(this.delInfo&(GN|Cm))>0}get deletedAcross(){return(this.delInfo&Cm)>0}}class Pn{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Pn.empty)return Pn.empty}recover(e){let t=0,n=pk(e);if(!this.inverted)for(let i=0;ie)break;let u=this.ranges[s+a],c=this.ranges[s+o],f=l+u;if(e<=f){let h=u?e==l?-1:e==f?1:t:t,d=l+i+(h<0?0:c);if(n)return d;let p=e==(t<0?l:f)?null:jY(s/3,e-l),v=e==l?GN:e==f?HN:Cm;return(t<0?e!=l:e!=f)&&(v|=WN),new lw(d,v,p)}i+=c-u}return n?e+i:new lw(e+i,0,null)}touches(e,t){let n=0,i=pk(t),a=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;se)break;let u=this.ranges[s+a],c=l+u;if(e<=c&&s==i*3)return!0;n+=this.ranges[s+o]-u}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,a=0;i=0;t--){let i=e.getMirror(t);this.appendMap(e._maps[t].invert(),i!=null&&i>t?n-i-1:void 0)}}invert(){let e=new Td;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;na&&l!o.isAtom||!s.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),t.openStart,t.openEnd);return dr.fromReplace(e,this.from,this.to,a)}invert(){return new da(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new rs(t.pos,n.pos,this.mark)}merge(e){return e instanceof rs&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new rs(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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new rs(t.from,t.to,e.markFromJSON(t.mark))}}Qr.jsonID("addMark",rs);class da extends Qr{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new ye(uT(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return dr.fromReplace(e,this.from,this.to,n)}invert(){return new rs(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new da(t.pos,n.pos,this.mark)}merge(e){return e instanceof da&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new da(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,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new da(t.from,t.to,e.markFromJSON(t.mark))}}Qr.jsonID("removeMark",da);class ns extends Qr{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return dr.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return dr.fromReplace(e,this.pos,this.pos+1,new ye(ne.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let n=this.mark.addToSet(t.marks);if(n.length==t.marks.length){for(let i=0;in.pos?null:new Dr(t.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,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Dr(t.from,t.to,t.gapFrom,t.gapTo,ye.fromJSON(e,t.slice),t.insert,!!t.structure)}}Qr.jsonID("replaceAround",Dr);function uw(r,e,t){let n=r.resolve(e),i=t-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 BY(r,e,t,n){let i=[],a=[],o,s;r.doc.nodesBetween(e,t,(l,u,c)=>{if(!l.isInline)return;let f=l.marks;if(!n.isInSet(f)&&c.type.allowsMarkType(n.type)){let h=Math.max(u,e),d=Math.min(u+l.nodeSize,t),p=n.addToSet(f);for(let v=0;vr.step(l)),a.forEach(l=>r.step(l))}function zY(r,e,t,n){let i=[],a=0;r.doc.nodesBetween(e,t,(o,s)=>{if(!o.isInline)return;a++;let l=null;if(n instanceof d0){let u=o.marks,c;for(;c=n.isInSet(u);)(l||(l=[])).push(c),u=c.removeFromSet(u)}else n?n.isInSet(o.marks)&&(l=[n]):l=o.marks;if(l&&l.length){let u=Math.min(s+o.nodeSize,t);for(let c=0;cr.step(new da(o.from,o.to,o.style)))}function cT(r,e,t,n=t.contentMatch,i=!0){let a=r.doc.nodeAt(e),o=[],s=e+1;for(let l=0;l=0;l--)r.step(o[l])}function FY(r,e,t){return(e==0||r.canReplace(e,r.childCount))&&(t==r.childCount||r.canReplace(0,t))}function hf(r){let t=r.parent.content.cutByIndex(r.startIndex,r.endIndex);for(let n=r.depth;;--n){let i=r.$from.node(n),a=r.$from.index(n),o=r.$to.indexAfter(n);if(nt;p--)v||n.index(p)>0?(v=!0,c=ne.from(n.node(p).copy(c)),f++):l--;let h=ne.empty,d=0;for(let p=a,v=!1;p>t;p--)v||i.after(p+1)=0;o--){if(n.size){let s=t[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=ne.from(t[o].type.create(t[o].attrs,n))}let i=e.start,a=e.end;r.step(new Dr(i,a,i,a,new ye(n,0,0),t.length,!0))}function WY(r,e,t,n,i){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let a=r.steps.length;r.doc.nodesBetween(e,t,(o,s)=>{let l=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(n,l)&&UY(r.doc,r.mapping.slice(a).map(s),n)){let u=null;if(n.schema.linebreakReplacement){let d=n.whitespace=="pre",p=!!n.contentMatch.matchType(n.schema.linebreakReplacement);d&&!p?u=!1:!d&&p&&(u=!0)}u===!1&&YN(r,o,s,a),cT(r,r.mapping.slice(a).map(s,1),n,void 0,u===null);let c=r.mapping.slice(a),f=c.map(s,1),h=c.map(s+o.nodeSize,1);return r.step(new Dr(f,h,f+1,h-1,new ye(ne.from(n.create(l,null,o.marks)),0,0),1,!0)),u===!0&&UN(r,o,s,a),!1}})}function UN(r,e,t,n){e.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let l=r.mapping.slice(n).map(t+1+a+o.index);r.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function YN(r,e,t,n){e.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let o=r.mapping.slice(n).map(t+1+a);r.replaceWith(o,o+1,e.type.schema.text(` `))}})}function UY(r,e,t){let n=r.resolve(e),i=n.index();return n.parent.canReplaceWith(i,i+1,t)}function YY(r,e,t,n,i){let a=r.doc.nodeAt(e);if(!a)throw new RangeError("No node at given position");t||(t=a.type);let o=t.create(n,null,i||a.marks);if(a.isLeaf)return r.replaceWith(e,e+a.nodeSize,o);if(!t.validContent(a.content))throw new RangeError("Invalid content for node type "+t.name);r.step(new Dr(e,e+a.nodeSize,e+1,e+a.nodeSize-1,new ye(ne.from(o),0,0),1,!0))}function uo(r,e,t=1,n){let i=r.resolve(e),a=i.depth-t,o=n&&n[n.length-1]||i.parent;if(a<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let u=i.depth-1,c=t-2;u>a;u--,c--){let f=i.node(u),h=i.index(u);if(f.type.spec.isolating)return!1;let d=f.content.cutByIndex(h,f.childCount),p=n&&n[c+1];p&&(d=d.replaceChild(0,p.type.create(p.attrs)));let v=n&&n[c]||f;if(!f.canReplace(h+1,f.childCount)||!v.type.validContent(d))return!1}let s=i.indexAfter(a),l=n&&n[0];return i.node(a).canReplaceWith(s,s,l?l.type:i.node(a+1).type)}function qY(r,e,t=1,n){let i=r.doc.resolve(e),a=ne.empty,o=ne.empty;for(let s=i.depth,l=i.depth-t,u=t-1;s>l;s--,u--){a=ne.from(i.node(s).copy(a));let c=n&&n[u];o=ne.from(c?c.type.create(c.attrs,o):i.node(s).copy(o))}r.step(new Mr(e,e,new ye(a.append(o),t,t),!0))}function Ns(r,e){let t=r.resolve(e),n=t.index();return qN(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(n,n+1)}function XY(r,e){e.content.size||r.type.compatibleContent(e.type);let t=r.contentMatchAt(r.childCount),{linebreakReplacement:n}=r.type.schema;for(let i=0;i0?(a=n.node(i+1),s++,o=n.node(i).maybeChild(s)):(a=n.node(i).maybeChild(s-1),o=n.node(i+1)),a&&!a.isTextblock&&qN(a,o)&&n.node(i).canReplace(s,s+1))return e;if(i==0)break;e=t<0?n.before(i):n.after(i)}}function KY(r,e,t){let n=null,{linebreakReplacement:i}=r.doc.type.schema,a=r.doc.resolve(e-t),o=a.node().type;if(i&&o.inlineContent){let c=o.whitespace=="pre",f=!!o.contentMatch.matchType(i);c&&!f?n=!1:!c&&f&&(n=!0)}let s=r.steps.length;if(n===!1){let c=r.doc.resolve(e+t);YN(r,c.node(),c.before(),s)}o.inlineContent&&cT(r,e+t-1,o,a.node().contentMatchAt(a.index()),n==null);let l=r.mapping.slice(s),u=l.map(e-t);if(r.step(new Mr(u,l.map(e+t,-1),ye.empty,!0)),n===!0){let c=r.doc.resolve(u);UN(r,c.node(),c.before(),r.steps.length)}return r}function ZY(r,e,t){let n=r.resolve(e);if(n.parent.canReplaceWith(n.index(),n.index(),t))return e;if(n.parentOffset==0)for(let i=n.depth-1;i>=0;i--){let a=n.index(i);if(n.node(i).canReplaceWith(a,a,t))return n.before(i+1);if(a>0)return null}if(n.parentOffset==n.parent.content.size)for(let i=n.depth-1;i>=0;i--){let a=n.indexAfter(i);if(n.node(i).canReplaceWith(a,a,t))return n.after(i+1);if(a=0;o--){let s=o==n.depth?0:n.pos<=(n.start(o+1)+n.end(o+1))/2?-1:1,l=n.index(o)+(s>0?1:0),u=n.node(o),c=!1;if(a==1)c=u.canReplace(l,l,i);else{let f=u.contentMatchAt(l).findWrapping(i.firstChild.type);c=f&&u.canReplaceWith(l,l,f[0])}if(c)return s==0?n.pos:s<0?n.before(o+1):n.after(o+1)}return null}function m0(r,e,t=e,n=ye.empty){if(e==t&&!n.size)return null;let i=r.resolve(e),a=r.resolve(t);return KN(i,a,n)?new Mr(e,t,n):new JY(i,a,n).fit()}function KN(r,e,t){return!t.openStart&&!t.openEnd&&r.start()==e.start()&&r.parent.canReplace(r.index(),e.index(),t.content)}class JY{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=ne.empty;for(let i=0;i<=e.depth;i++){let a=e.node(i);this.frontier.push({type:a.type,match:a.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=ne.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,i=this.close(e<0?this.$to:n.doc.resolve(e));if(!i)return null;let a=this.placed,o=n.depth,s=i.depth;for(;o&&s&&a.childCount==1;)a=a.firstChild.content,o--,s--;let l=new ye(a,o,s);return e>-1?new Dr(n.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||n.pos!=this.$to.pos?new Mr(n.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,i=this.unplaced.openEnd;n1&&(i=0),a.type.spec.isolating&&i<=n){e=n;break}t=a.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let i,a=null;n?(a=O1(this.unplaced.content,n-1).firstChild,i=a.content):i=this.unplaced.content;let o=i.firstChild;for(let s=this.depth;s>=0;s--){let{type:l,match:u}=this.frontier[s],c,f=null;if(t==1&&(o?u.matchType(o.type)||(f=u.fillBefore(ne.from(o),!1)):a&&l.compatibleContent(a.type)))return{sliceDepth:n,frontierDepth:s,parent:a,inject:f};if(t==2&&o&&(c=u.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:s,parent:a,wrap:c};if(a&&u.matchType(a.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=O1(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new ye(e,t+1,Math.max(n,i.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,i=O1(e,t);if(i.childCount<=1&&t>0){let a=e.size-t<=t+i.size;this.unplaced=new ye(wh(e,t-1,1),t-1,a?t-1:n)}else this.unplaced=new ye(wh(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:i,wrap:a}){for(;this.depth>t;)this.closeFrontierNode();if(a)for(let v=0;v1||l==0||v.content.size)&&(f=m,c.push(ZN(v.mark(h.allowedMarks(v.marks)),u==1?l:0,u==s.childCount?d:-1)))}let p=u==s.childCount;p||(d=-1),this.placed=Sh(this.placed,t,ne.from(c)),this.frontier[t].match=f,p&&d<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let v=0,m=s;v1&&i==this.$to.end(--n);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:i}=this.frontier[t],a=t=0;s--){let{match:l,type:u}=this.frontier[s],c=j1(e,s,u,l,!0);if(!c||c.childCount)continue e}return{depth:t,fit:o,move:a?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Sh(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let i=e.node(n),a=i.type.contentMatch.fillBefore(i.content,!0,e.index(n));this.openFrontierNode(i.type,i.attrs,a)}return e}openFrontierNode(e,t=null,n){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Sh(this.placed,this.depth,ne.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(ne.empty,!0);t.childCount&&(this.placed=Sh(this.placed,this.frontier.length,t))}}function wh(r,e,t){return e==0?r.cutByIndex(t,r.childCount):r.replaceChild(0,r.firstChild.copy(wh(r.firstChild.content,e-1,t)))}function Sh(r,e,t){return e==0?r.append(t):r.replaceChild(r.childCount-1,r.lastChild.copy(Sh(r.lastChild.content,e-1,t)))}function O1(r,e){for(let t=0;t1&&(n=n.replaceChild(0,ZN(n.firstChild,e-1,n.childCount==1?t-1:0))),e>0&&(n=r.type.contentMatch.fillBefore(n).append(n),t<=0&&(n=n.append(r.type.contentMatch.matchFragment(n).fillBefore(ne.empty,!0)))),r.copy(n)}function j1(r,e,t,n,i){let a=r.node(e),o=i?r.indexAfter(e):r.index(e);if(o==a.childCount&&!t.compatibleContent(a.type))return null;let s=n.fillBefore(a.content,!0,o);return s&&!QY(t,a.content,o)?s:null}function QY(r,e,t){for(let n=t;n0;h--,d--){let p=i.node(h).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;o.indexOf(h)>-1?s=h:i.before(h)==d&&o.splice(1,0,-h)}let l=o.indexOf(s),u=[],c=n.openStart;for(let h=n.content,d=0;;d++){let p=h.firstChild;if(u.push(p),d==n.openStart)break;h=p.content}for(let h=c-1;h>=0;h--){let d=u[h],p=eq(d.type);if(p&&!d.sameMarkup(i.node(Math.abs(s)-1)))c=h;else if(p||!d.type.isTextblock)break}for(let h=n.openStart;h>=0;h--){let d=(h+c+1)%(n.openStart+1),p=u[d];if(p)for(let v=0;v=0&&(r.replace(e,t,n),!(r.steps.length>f));h--){let d=o[h];d<0||(e=i.before(d),t=a.after(d))}}function JN(r,e,t,n,i){if(en){let a=i.contentMatchAt(0),o=a.fillBefore(r).append(r);r=o.append(a.matchFragment(o).fillBefore(ne.empty,!0))}return r}function rq(r,e,t,n){if(!n.isInline&&e==t&&r.doc.resolve(e).parent.content.size){let i=ZY(r.doc,e,n.type);i!=null&&(e=t=i)}r.replaceRange(e,t,new ye(ne.from(n),0,0))}function nq(r,e,t){let n=r.doc.resolve(e),i=r.doc.resolve(t),a=QN(n,i);for(let o=0;o0&&(l||n.node(s-1).canReplace(n.index(s-1),i.indexAfter(s-1))))return r.delete(n.before(s),i.after(s))}for(let o=1;o<=n.depth&&o<=i.depth;o++)if(e-n.start(o)==n.depth-o&&t>n.end(o)&&i.end(o)-t!=i.depth-o&&n.start(o-1)==i.start(o-1)&&n.node(o-1).canReplace(n.index(o-1),i.index(o-1)))return r.delete(n.before(o),t);r.delete(e,t)}function QN(r,e){let t=[],n=Math.min(r.depth,e.depth);for(let i=n;i>=0;i--){let a=r.start(i);if(ae.pos+(e.depth-i)||r.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(a==e.start(i)||i==r.depth&&i==e.depth&&r.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==a-1)&&t.push(i)}return t}class Pc extends Qr{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return dr.fail("No node at attribute step's position");let n=Object.create(null);for(let a in t.attrs)n[a]=t.attrs[a];n[this.attr]=this.value;let i=t.type.create(n,null,t.marks);return dr.fromReplace(e,this.pos,this.pos+1,new ye(ne.from(i),0,t.isLeaf?0:1))}getMap(){return Pn.empty}invert(e){return new Pc(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Pc(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Pc(t.pos,t.attr,t.value)}}Qr.jsonID("attr",Pc);class Cd extends Qr{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return dr.ok(n)}getMap(){return Pn.empty}invert(e){return new Cd(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Cd(t.attr,t.value)}}Qr.jsonID("docAttr",Cd);let Yc=class extends Error{};Yc=function r(e){let t=Error.call(this,e);return t.__proto__=r.prototype,t};Yc.prototype=Object.create(Error.prototype);Yc.prototype.constructor=Yc;Yc.prototype.name="TransformError";class e5{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Td}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Yc(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=ye.empty){let i=m0(this.doc,e,t,n);return i&&this.step(i),this}replaceWith(e,t,n){return this.replace(e,t,new ye(ne.from(n),0,0))}delete(e,t){return this.replace(e,t,ye.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return tq(this,e,t,n),this}replaceRangeWith(e,t,n){return rq(this,e,t,n),this}deleteRange(e,t){return nq(this,e,t),this}lift(e,t){return VY(this,e,t),this}join(e,t=1){return KY(this,e,t),this}wrap(e,t){return GY(this,e,t),this}setBlockType(e,t=e,n,i=null){return WY(this,e,t,n,i),this}setNodeMarkup(e,t,n=null,i){return YY(this,e,t,n,i),this}setNodeAttribute(e,t,n){return this.step(new Pc(e,t,n)),this}setDocAttribute(e,t){return this.step(new Cd(e,t)),this}addNodeMark(e,t){return this.step(new ns(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(t instanceof Wt)t.isInSet(n.marks)&&this.step(new cu(e,t));else{let i=n.marks,a,o=[];for(;a=t.isInSet(i);)o.push(new cu(e,a)),i=a.removeFromSet(i);for(let s=o.length-1;s>=0;s--)this.step(o[s])}return this}split(e,t=1,n){return qY(this,e,t,n),this}addMark(e,t,n){return BY(this,e,t,n),this}removeMark(e,t,n){return zY(this,e,t,n),this}clearIncompatible(e,t,n){return cT(this,e,t,n),this}}const N1=Object.create(null);class qe{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new t5(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t=0;a--){let o=t<0?gc(e.node(0),e.node(a),e.before(a+1),e.index(a),t,n):gc(e.node(0),e.node(a),e.after(a+1),e.index(a)+1,t,n);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Bn(e.node(0))}static atStart(e){return gc(e,e,0,0,1)||new Bn(e)}static atEnd(e){return gc(e,e,e.content.size,e.childCount,-1)||new Bn(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=N1[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in N1)throw new RangeError("Duplicate use of selection JSON ID "+e);return N1[e]=t,t.prototype.jsonID=e,t}getBookmark(){return We.between(this.$anchor,this.$head).getBookmark()}}qe.prototype.visible=!0;class t5{constructor(e,t){this.$from=e,this.$to=t}}let mk=!1;function gk(r){!mk&&!r.parent.inlineContent&&(mk=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+r.parent.type.name+")"))}class We extends qe{constructor(e,t=e){gk(e),gk(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return qe.near(n);let i=e.resolve(t.map(this.anchor));return new We(i.parent.inlineContent?i:n,n)}replace(e,t=ye.empty){if(super.replace(e,t),t==ye.empty){let n=this.$from.marksAcross(this.$to);n&&e.ensureMarks(n)}}eq(e){return e instanceof We&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new g0(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new We(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let i=e.resolve(t);return new this(i,n==t?i:e.resolve(n))}static between(e,t,n){let i=e.pos-t.pos;if((!n||i)&&(n=i>=0?1:-1),!t.parent.inlineContent){let a=qe.findFrom(t,n,!0)||qe.findFrom(t,-n,!0);if(a)t=a.$head;else return qe.near(t,n)}return e.parent.inlineContent||(i==0?e=t:(e=(qe.findFrom(e,-n,!0)||qe.findFrom(e,n,!0)).$anchor,e.pos0?0:1);i>0?o=0;o+=i){let s=e.child(o);if(s.isAtom){if(!a&&Ne.isSelectable(s))return Ne.create(r,t-(i<0?s.nodeSize:0))}else{let l=gc(r,s,t+i,i<0?s.childCount:0,i,a);if(l)return l}t+=s.nodeSize*i}return null}function yk(r,e,t){let n=r.steps.length-1;if(n{o==null&&(o=c)}),r.setSelection(qe.near(r.doc.resolve(o),t))}function bk(r,e){return!e||!r?r:r.bind(e)}class Kp{constructor(e,t,n){this.name=e,this.init=bk(t.init,n),this.apply=bk(t.apply,n)}}new Kp("doc",{init(r){return r.doc||r.schema.topNodeType.createAndFill()},apply(r){return r.doc}}),new Kp("selection",{init(r,e){return r.selection||qe.atStart(e.doc)},apply(r){return r.selection}}),new Kp("storedMarks",{init(r){return r.storedMarks||null},apply(r,e,t,n){return n.selection.$cursor?r.storedMarks:null}}),new Kp("scrollToSelection",{init(){return 0},apply(r,e){return r.scrolledIntoView?e+1:e}});function r5(r,e,t){for(let n in r){let i=r[n];i instanceof Function?i=i.bind(e):n=="handleDOMEvents"&&(i=r5(i,e,{})),t[n]=i}return t}class Ut{constructor(e){this.spec=e,this.props={},e.props&&r5(e.props,this,this.props),this.key=e.key?e.key.key:n5("plugin")}getState(e){return e[this.key]}}const B1=Object.create(null);function n5(r){return r in B1?r+"$"+ ++B1[r]:(B1[r]=0,r+"$")}class jt{constructor(e="key"){this.key=n5(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Tu=function(r){for(var e=0;;e++)if(r=r.previousSibling,!r)return e},i5=function(r,e,t,n){return t&&(_k(r,e,t,n,-1)||_k(r,e,t,n,1))},aq=/^(img|br|input|textarea|hr)$/i;function _k(r,e,t,n,i){for(var a;;){if(r==t&&e==n)return!0;if(e==(i<0?0:_g(r))){let o=r.parentNode;if(!o||o.nodeType!=1||dT(r)||aq.test(r.nodeName)||r.contentEditable=="false")return!1;e=Tu(r)+(i<0?0:1),r=o}else if(r.nodeType==1){let o=r.childNodes[e+(i<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((a=o.pmViewDesc)===null||a===void 0)&&a.ignoreForSelection)e+=i;else return!1;else r=o,e=i<0?_g(r):0}else return!1}}function _g(r){return r.nodeType==3?r.nodeValue.length:r.childNodes.length}function oq(r,e,t){for(let n=e==0,i=e==_g(r);n||i;){if(r==t)return!0;let a=Tu(r);if(r=r.parentNode,!r)return!1;n=n&&a==0,i=i&&a==_g(r)}}function dT(r){let e;for(let t=r;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==r||e.contentDOM==r)}const a5=function(r){return r.focusNode&&i5(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)};function o5(r,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=r,t.key=t.code=e,t}const ka=typeof navigator<"u"?navigator:null,xk=typeof document<"u"?document:null,Bs=ka&&ka.userAgent||"",cw=/Edge\/(\d+)/.exec(Bs),s5=/MSIE \d/.exec(Bs),fw=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Bs),mp=!!(s5||fw||cw),l5=s5?document.documentMode:fw?+fw[1]:cw?+cw[1]:0,y0=!mp&&/gecko\/(\d+)/i.test(Bs);y0&&+(/Firefox\/(\d+)/.exec(Bs)||[0,0])[1];const hw=!mp&&/Chrome\/(\d+)/.exec(Bs),zs=!!hw,u5=hw?+hw[1]:0,Cu=!mp&&!!ka&&/Apple Computer/.test(ka.vendor),pT=Cu&&(/Mobile\/\w+/.test(Bs)||!!ka&&ka.maxTouchPoints>2),ri=pT||(ka?/Mac/.test(ka.platform):!1),sq=ka?/Win/.test(ka.platform):!1,gp=/Android \d/.test(Bs),vT=!!xk&&"webkitFontSmoothing"in xk.documentElement.style,lq=vT?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function uq(r,e=null){let t=r.domSelectionRange(),n=r.state.doc;if(!t.focusNode)return null;let i=r.docView.nearestDesc(t.focusNode),a=i&&i.size==0,o=r.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(o<0)return null;let s=n.resolve(o),l,u;if(a5(t)){for(l=o;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&Ne.isSelectable(f)&&i.parent&&!(f.isInline&&oq(t.focusNode,t.focusOffset,i.dom))){let h=i.posBefore;u=new Ne(o==h?s:n.resolve(h))}}else{if(t instanceof r.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let f=o,h=o;for(let d=0;d{(t.anchorNode!=n||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",r.input.hideSelectionGuard),setTimeout(()=>{(!c5(r)||r.state.selection.visible)&&r.dom.classList.remove("ProseMirror-hideselection")},20))})}function fq(r){let e=r.domSelection(),t=document.createRange();if(!e)return;let n=r.cursorWrapper.dom,i=n.nodeName=="IMG";i?t.setStart(n.parentNode,Tu(n)+1):t.setStart(n,0),t.collapse(!0),e.removeAllRanges(),e.addRange(t),!i&&!r.state.selection.visible&&mp&&l5<=11&&(n.disabled=!0,n.disabled=!1)}function hq(r,e){if(e instanceof Ne){let t=r.docView.descAt(e.from);t!=r.lastSelectedViewDesc&&(Ck(r),t&&t.selectNode(),r.lastSelectedViewDesc=t)}else Ck(r)}function Ck(r){r.lastSelectedViewDesc&&(r.lastSelectedViewDesc.parent&&r.lastSelectedViewDesc.deselectNode(),r.lastSelectedViewDesc=void 0)}function f5(r,e,t,n){return r.someProp("createSelectionBetween",i=>i(r,e,t))||We.between(e,t,n)}function dq(r){let e=r.domSelectionRange();if(!e.anchorNode)return!1;try{return r.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(r.editable||r.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function dw(r,e){let{$anchor:t,$head:n}=r.selection,i=e>0?t.max(n):t.min(n),a=i.parent.inlineContent?i.depth?r.doc.resolve(e>0?i.after():i.before()):null:i;return a&&qe.findFrom(a,e)}function Xo(r,e){return r.dispatch(r.state.tr.setSelection(e).scrollIntoView()),!0}function Ak(r,e,t){let n=r.state.selection;if(n instanceof We)if(t.indexOf("s")>-1){let{$head:i}=n,a=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!a||a.isText||!a.isLeaf)return!1;let o=r.state.doc.resolve(i.pos+a.nodeSize*(e<0?-1:1));return Xo(r,new We(n.$anchor,o))}else if(n.empty){if(r.endOfTextblock(e>0?"forward":"backward")){let i=dw(r.state,e);return i&&i instanceof Ne?Xo(r,i):!1}else if(!(ri&&t.indexOf("m")>-1)){let i=n.$head,a=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,o;if(!a||a.isText)return!1;let s=e<0?i.pos-a.nodeSize:i.pos;return a.isAtom||(o=r.docView.descAt(s))&&!o.contentDOM?Ne.isSelectable(a)?Xo(r,new Ne(e<0?r.state.doc.resolve(i.pos-a.nodeSize):i)):vT?Xo(r,new We(r.state.doc.resolve(e<0?s:s+a.nodeSize))):!1:!1}}else return!1;else{if(n instanceof Ne&&n.node.isInline)return Xo(r,new We(e>0?n.$to:n.$from));{let i=dw(r.state,e);return i?Xo(r,i):!1}}}function xg(r){return r.nodeType==3?r.nodeValue.length:r.childNodes.length}function Uh(r,e){let t=r.pmViewDesc;return t&&t.size==0&&(e<0||r.nextSibling||r.nodeName!="BR")}function Wu(r,e){return e<0?pq(r):vq(r)}function pq(r){let e=r.domSelectionRange(),t=e.focusNode,n=e.focusOffset;if(!t)return;let i,a,o=!1;for(y0&&t.nodeType==1&&n0){if(t.nodeType!=1)break;{let s=t.childNodes[n-1];if(Uh(s,-1))i=t,a=--n;else if(s.nodeType==3)t=s,n=t.nodeValue.length;else break}}else{if(h5(t))break;{let s=t.previousSibling;for(;s&&Uh(s,-1);)i=t.parentNode,a=Tu(s),s=s.previousSibling;if(s)t=s,n=xg(t);else{if(t=t.parentNode,t==r.dom)break;n=0}}}o?pw(r,t,n):i&&pw(r,i,a)}function vq(r){let e=r.domSelectionRange(),t=e.focusNode,n=e.focusOffset;if(!t)return;let i=xg(t),a,o;for(;;)if(n{r.state==i&&mT(r)},50)}function Mk(r,e){let t=r.state.doc.resolve(e);if(!(zs||sq)&&t.parent.inlineContent){let i=r.coordsAtPos(e);if(e>t.start()){let a=r.coordsAtPos(e-1),o=(a.top+a.bottom)/2;if(o>i.top&&o1)return a.lefti.top&&o1)return a.left>i.left?"ltr":"rtl"}}return getComputedStyle(r.dom).direction=="rtl"?"rtl":"ltr"}function kk(r,e,t){let n=r.state.selection;if(n instanceof We&&!n.empty||t.indexOf("s")>-1||ri&&t.indexOf("m")>-1)return!1;let{$from:i,$to:a}=n;if(!i.parent.inlineContent||r.endOfTextblock(e<0?"up":"down")){let o=dw(r.state,e);if(o&&o instanceof Ne)return Xo(r,o)}if(!i.parent.inlineContent){let o=e<0?i:a,s=n instanceof Bn?qe.near(o,e):qe.findFrom(o,e);return s?Xo(r,s):!1}return!1}function Dk(r,e){if(!(r.state.selection instanceof We))return!0;let{$head:t,$anchor:n,empty:i}=r.state.selection;if(!t.sameParent(n))return!0;if(!i)return!1;if(r.endOfTextblock(e>0?"forward":"backward"))return!0;let a=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(a&&!a.isText){let o=r.state.tr;return e<0?o.delete(t.pos-a.nodeSize,t.pos):o.delete(t.pos,t.pos+a.nodeSize),r.dispatch(o),!0}return!1}function Ek(r,e,t){r.domObserver.stop(),e.contentEditable=t,r.domObserver.start()}function yq(r){if(!Cu||r.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=r.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let n=e.firstChild;Ek(r,n,"true"),setTimeout(()=>Ek(r,n,"false"),20)}return!1}function bq(r){let e="";return r.ctrlKey&&(e+="c"),r.metaKey&&(e+="m"),r.altKey&&(e+="a"),r.shiftKey&&(e+="s"),e}function _q(r,e){let t=e.keyCode,n=bq(e);if(t==8||ri&&t==72&&n=="c")return Dk(r,-1)||Wu(r,-1);if(t==46&&!e.shiftKey||ri&&t==68&&n=="c")return Dk(r,1)||Wu(r,1);if(t==13||t==27)return!0;if(t==37||ri&&t==66&&n=="c"){let i=t==37?Mk(r,r.state.selection.from)=="ltr"?-1:1:-1;return Ak(r,i,n)||Wu(r,i)}else if(t==39||ri&&t==70&&n=="c"){let i=t==39?Mk(r,r.state.selection.from)=="ltr"?1:-1:1;return Ak(r,i,n)||Wu(r,i)}else{if(t==38||ri&&t==80&&n=="c")return kk(r,-1,n)||Wu(r,-1);if(t==40||ri&&t==78&&n=="c")return yq(r)||kk(r,1,n)||Wu(r,1);if(n==(ri?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function d5(r,e){r.someProp("transformCopied",d=>{e=d(e,r)});let t=[],{content:n,openStart:i,openEnd:a}=e;for(;i>1&&a>1&&n.childCount==1&&n.firstChild.childCount==1;){i--,a--;let d=n.firstChild;t.push(d.type.name,d.attrs!=d.type.defaultAttrs?d.attrs:null),n=d.content}let o=r.someProp("clipboardSerializer")||p0.fromSchema(r.state.schema),s=b5(),l=s.createElement("div");l.appendChild(o.serializeFragment(n,{document:s}));let u=l.firstChild,c,f=0;for(;u&&u.nodeType==1&&(c=y5[u.nodeName.toLowerCase()]);){for(let d=c.length-1;d>=0;d--){let p=s.createElement(c[d]);for(;l.firstChild;)p.appendChild(l.firstChild);l.appendChild(p),f++}u=l.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${i} ${a}${f?` -${f}`:""} ${JSON.stringify(t)}`);let h=r.someProp("clipboardTextSerializer",d=>d(e,r))||e.content.textBetween(0,e.content.size,` `);return{dom:l,text:h,slice:e}}function p5(r,e,t,n,i){let a=i.parent.type.spec.code,o,s;if(!t&&!e)return null;let l=e&&(n||a||!t);if(l){if(r.someProp("transformPastedText",h=>{e=h(e,a||n,r)}),a)return e?new ye(ne.from(r.state.schema.text(e.replace(/\r\n?/g,` `))),0,0):ye.empty;let f=r.someProp("clipboardTextParser",h=>h(e,i,n,r));if(f)s=f;else{let h=i.marks(),{schema:d}=r.state,p=p0.fromSchema(d);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(v=>{let m=o.appendChild(document.createElement("p"));v&&m.appendChild(p.serializeNode(d.text(v,h)))})}}else r.someProp("transformPastedHTML",f=>{t=f(t,r)}),o=Tq(t),vT&&Cq(o);let u=o&&o.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let f=+c[3];f>0;f--){let h=o.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;o=h}if(s||(s=(r.someProp("clipboardParser")||r.someProp("domParser")||Gh.fromSchema(r.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||c),context:i,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!xq.test(h.parentNode.nodeName)?{ignore:!0}:null}})),c)s=Aq(Lk(s,+c[1],+c[2]),c[4]);else if(s=ye.maxOpen(wq(s.content,i),!0),s.openStart||s.openEnd){let f=0,h=0;for(let d=s.content.firstChild;f{s=f(s,r)}),s}const xq=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function wq(r,e){if(r.childCount<2)return r;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),a,o=[];if(r.forEach(s=>{if(!o)return;let l=i.findWrapping(s.type),u;if(!l)return o=null;if(u=o.length&&a.length&&m5(l,a,s,o[o.length-1],0))o[o.length-1]=u;else{o.length&&(o[o.length-1]=g5(o[o.length-1],a.length));let c=v5(s,l);o.push(c),i=i.matchType(c.type),a=l}}),o)return ne.from(o)}return r}function v5(r,e,t=0){for(let n=e.length-1;n>=t;n--)r=e[n].create(null,ne.from(r));return r}function m5(r,e,t,n,i){if(i1&&(a=0),i=t&&(s=e<0?o.contentMatchAt(0).fillBefore(s,a<=i).append(s):s.append(o.contentMatchAt(o.childCount).fillBefore(ne.empty,!0))),r.replaceChild(e<0?0:r.childCount-1,o.copy(s))}function Lk(r,e,t){return et})),F1.createHTML(r)):r}function Tq(r){let e=/^(\s*]*>)*/.exec(r);e&&(r=r.slice(e[0].length));let t=b5().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(r),i;if((i=n&&y5[n[1].toLowerCase()])&&(r=i.map(a=>"<"+a+">").join("")+r+i.map(a=>"").reverse().join("")),t.innerHTML=Sq(r),i)for(let a=0;a=0;s-=2){let l=t.nodes[n[s]];if(!l||l.hasRequiredAttrs())break;i=ne.from(l.create(n[s+1],i)),a++,o++}return new ye(i,a,o)}const Vi={},Hn={};function is(r,e){r.input.lastSelectionOrigin=e,r.input.lastSelectionTime=Date.now()}Hn.keydown=(r,e)=>{let t=e;if(r.input.shiftKey=t.keyCode==16||t.shiftKey,!x5(r,t)&&(r.input.lastKeyCode=t.keyCode,r.input.lastKeyCodeTime=Date.now(),!(gp&&zs&&t.keyCode==13)))if(t.keyCode!=229&&r.domObserver.forceFlush(),pT&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let n=Date.now();r.input.lastIOSEnter=n,r.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{r.input.lastIOSEnter==n&&(r.someProp("handleKeyDown",i=>i(r,o5(13,"Enter"))),r.input.lastIOSEnter=0)},200)}else r.someProp("handleKeyDown",n=>n(r,t))||_q(r,t)?t.preventDefault():is(r,"key")};Hn.keyup=(r,e)=>{e.keyCode==16&&(r.input.shiftKey=!1)};Hn.keypress=(r,e)=>{let t=e;if(x5(r,t)||!t.charCode||t.ctrlKey&&!t.altKey||ri&&t.metaKey)return;if(r.someProp("handleKeyPress",i=>i(r,t))){t.preventDefault();return}let n=r.state.selection;if(!(n instanceof We)||!n.$from.sameParent(n.$to)){let i=String.fromCharCode(t.charCode),a=()=>r.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!r.someProp("handleTextInput",o=>o(r,n.$from.pos,n.$to.pos,i,a))&&r.dispatch(a()),t.preventDefault()}};function b0(r){return{left:r.clientX,top:r.clientY}}function Mq(r,e){let t=e.x-r.clientX,n=e.y-r.clientY;return t*t+n*n<100}function gT(r,e,t,n,i){if(n==-1)return!1;let a=r.state.doc.resolve(n);for(let o=a.depth+1;o>0;o--)if(r.someProp(e,s=>o>a.depth?s(r,t,a.nodeAfter,a.before(o),i,!0):s(r,t,a.node(o),a.before(o),i,!1)))return!0;return!1}function Rc(r,e,t){if(r.focused||r.focus(),r.state.selection.eq(e))return;let n=r.state.tr.setSelection(e);n.setMeta("pointer",!0),r.dispatch(n)}function kq(r,e){if(e==-1)return!1;let t=r.state.doc.resolve(e),n=t.nodeAfter;return n&&n.isAtom&&Ne.isSelectable(n)?(Rc(r,new Ne(t)),!0):!1}function Dq(r,e){if(e==-1)return!1;let t=r.state.selection,n,i;t instanceof Ne&&(n=t.node);let a=r.state.doc.resolve(e);for(let o=a.depth+1;o>0;o--){let s=o>a.depth?a.nodeAfter:a.node(o);if(Ne.isSelectable(s)){n&&t.$from.depth>0&&o>=t.$from.depth&&a.before(t.$from.depth+1)==t.$from.pos?i=a.before(t.$from.depth):i=a.before(o);break}}return i!=null?(Rc(r,Ne.create(r.state.doc,i)),!0):!1}function Eq(r,e,t,n,i){return gT(r,"handleClickOn",e,t,n)||r.someProp("handleClick",a=>a(r,e,n))||(i?Dq(r,t):kq(r,t))}function Lq(r,e,t,n){return gT(r,"handleDoubleClickOn",e,t,n)||r.someProp("handleDoubleClick",i=>i(r,e,n))}function Iq(r,e,t,n){return gT(r,"handleTripleClickOn",e,t,n)||r.someProp("handleTripleClick",i=>i(r,e,n))||Pq(r,t,n)}function Pq(r,e,t){if(t.button!=0)return!1;let n=r.state.doc;if(e==-1)return n.inlineContent?(Rc(r,We.create(n,0,n.content.size)),!0):!1;let i=n.resolve(e);for(let a=i.depth+1;a>0;a--){let o=a>i.depth?i.nodeAfter:i.node(a),s=i.before(a);if(o.inlineContent)Rc(r,We.create(n,s+1,s+1+o.content.size));else if(Ne.isSelectable(o))Rc(r,Ne.create(n,s));else continue;return!0}}function yT(r){return wg(r)}const _5=ri?"metaKey":"ctrlKey";Vi.mousedown=(r,e)=>{let t=e;r.input.shiftKey=t.shiftKey;let n=yT(r),i=Date.now(),a="singleClick";i-r.input.lastClick.time<500&&Mq(t,r.input.lastClick)&&!t[_5]&&r.input.lastClick.button==t.button&&(r.input.lastClick.type=="singleClick"?a="doubleClick":r.input.lastClick.type=="doubleClick"&&(a="tripleClick")),r.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:a,button:t.button};let o=r.posAtCoords(b0(t));o&&(a=="singleClick"?(r.input.mouseDown&&r.input.mouseDown.done(),r.input.mouseDown=new Rq(r,o,t,!!n)):(a=="doubleClick"?Lq:Iq)(r,o.pos,o.inside,t)?t.preventDefault():is(r,"pointer"))};class Rq{constructor(e,t,n,i){this.view=e,this.pos=t,this.event=n,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[_5],this.allowDefault=n.shiftKey;let a,o;if(t.inside>-1)a=e.state.doc.nodeAt(t.inside),o=t.inside;else{let c=e.state.doc.resolve(t.pos);a=c.parent,o=c.depth?c.before():0}const s=i?null:n.target,l=s?e.docView.nearestDesc(s,!0):null;this.target=l&&l.dom.nodeType==1?l.dom:null;let{selection:u}=e.state;(n.button==0&&a.type.spec.draggable&&a.type.spec.selectable!==!1||u instanceof Ne&&u.from<=o&&u.to>o)&&(this.mightDrag={node:a,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&y0&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),is(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>mT(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(b0(e))),this.updateAllowDefault(e),this.allowDefault||!t?is(this.view,"pointer"):Eq(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Cu&&this.mightDrag&&!this.mightDrag.node.isAtom||zs&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Rc(this.view,qe.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):is(this.view,"pointer")}move(e){this.updateAllowDefault(e),is(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}Vi.touchstart=r=>{r.input.lastTouch=Date.now(),yT(r),is(r,"pointer")};Vi.touchmove=r=>{r.input.lastTouch=Date.now(),is(r,"pointer")};Vi.contextmenu=r=>yT(r);function x5(r,e){return r.composing?!0:Cu&&Math.abs(e.timeStamp-r.input.compositionEndedAt)<500?(r.input.compositionEndedAt=-2e8,!0):!1}const Oq=gp?5e3:-1;Hn.compositionstart=Hn.compositionupdate=r=>{if(!r.composing){r.domObserver.flush();let{state:e}=r,t=e.selection.$to;if(e.selection instanceof We&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)))r.markCursor=r.state.storedMarks||t.marks(),wg(r,!0),r.markCursor=null;else if(wg(r,!e.selection.empty),y0&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let n=r.domSelectionRange();for(let i=n.focusNode,a=n.focusOffset;i&&i.nodeType==1&&a!=0;){let o=a<0?i.lastChild:i.childNodes[a-1];if(!o)break;if(o.nodeType==3){let s=r.domSelection();s&&s.collapse(o,o.nodeValue.length);break}else i=o,a=-1}}r.input.composing=!0}w5(r,Oq)};Hn.compositionend=(r,e)=>{r.composing&&(r.input.composing=!1,r.input.compositionEndedAt=e.timeStamp,r.input.compositionPendingChanges=r.domObserver.pendingRecords().length?r.input.compositionID:0,r.input.compositionNode=null,r.input.compositionPendingChanges&&Promise.resolve().then(()=>r.domObserver.flush()),r.input.compositionID++,w5(r,20))};function w5(r,e){clearTimeout(r.input.composingTimeout),e>-1&&(r.input.composingTimeout=setTimeout(()=>wg(r),e))}function jq(r){for(r.composing&&(r.input.composing=!1,r.input.compositionEndedAt=Nq());r.input.compositionNodes.length>0;)r.input.compositionNodes.pop().markParentsDirty()}function Nq(){let r=document.createEvent("Event");return r.initEvent("event",!0,!0),r.timeStamp}function wg(r,e=!1){if(!(gp&&r.domObserver.flushingSoon>=0)){if(r.domObserver.forceFlush(),jq(r),e||r.docView&&r.docView.dirty){let t=uq(r),n=r.state.selection;return t&&!t.eq(n)?r.dispatch(r.state.tr.setSelection(t)):(r.markCursor||e)&&!n.$from.node(n.$from.sharedDepth(n.to)).inlineContent?r.dispatch(r.state.tr.deleteSelection()):r.updateState(r.state),!0}return!1}}function Bq(r,e){if(!r.dom.parentNode)return;let t=r.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),i=document.createRange();i.selectNodeContents(e),r.dom.blur(),n.removeAllRanges(),n.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),r.focus()},50)}const Ad=mp&&l5<15||pT&&lq<604;Vi.copy=Hn.cut=(r,e)=>{let t=e,n=r.state.selection,i=t.type=="cut";if(n.empty)return;let a=Ad?null:t.clipboardData,o=n.content(),{dom:s,text:l}=d5(r,o);a?(t.preventDefault(),a.clearData(),a.setData("text/html",s.innerHTML),a.setData("text/plain",l)):Bq(r,s),i&&r.dispatch(r.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function zq(r){return r.openStart==0&&r.openEnd==0&&r.content.childCount==1?r.content.firstChild:null}function Fq(r,e){if(!r.dom.parentNode)return;let t=r.input.shiftKey||r.state.selection.$from.parent.type.spec.code,n=r.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let i=r.input.shiftKey&&r.input.lastKeyCode!=45;setTimeout(()=>{r.focus(),n.parentNode&&n.parentNode.removeChild(n),t?mw(r,n.value,null,i,e):mw(r,n.textContent,n.innerHTML,i,e)},50)}function mw(r,e,t,n,i){let a=p5(r,e,t,n,r.state.selection.$from);if(r.someProp("handlePaste",l=>l(r,i,a||ye.empty)))return!0;if(!a)return!1;let o=zq(a),s=o?r.state.tr.replaceSelectionWith(o,n):r.state.tr.replaceSelection(a);return r.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function S5(r){let e=r.getData("text/plain")||r.getData("Text");if(e)return e;let t=r.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}Hn.paste=(r,e)=>{let t=e;if(r.composing&&!gp)return;let n=Ad?null:t.clipboardData,i=r.input.shiftKey&&r.input.lastKeyCode!=45;n&&mw(r,S5(n),n.getData("text/html"),i,t)?t.preventDefault():Fq(r,t)};class Vq{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}const $q=ri?"altKey":"ctrlKey";function T5(r,e){let t=r.someProp("dragCopies",n=>!n(e));return t??!e[$q]}Vi.dragstart=(r,e)=>{let t=e,n=r.input.mouseDown;if(n&&n.done(),!t.dataTransfer)return;let i=r.state.selection,a=i.empty?null:r.posAtCoords(b0(t)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof Ne?i.to-1:i.to))){if(n&&n.mightDrag)o=Ne.create(r.state.doc,n.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let f=r.docView.nearestDesc(t.target,!0);f&&f.node.type.spec.draggable&&f!=r.docView&&(o=Ne.create(r.state.doc,f.posBefore))}}let s=(o||r.state.selection).content(),{dom:l,text:u,slice:c}=d5(r,s);(!t.dataTransfer.files.length||!zs||u5>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(Ad?"Text":"text/html",l.innerHTML),t.dataTransfer.effectAllowed="copyMove",Ad||t.dataTransfer.setData("text/plain",u),r.dragging=new Vq(c,T5(r,t),o)};Vi.dragend=r=>{let e=r.dragging;window.setTimeout(()=>{r.dragging==e&&(r.dragging=null)},50)};Hn.dragover=Hn.dragenter=(r,e)=>e.preventDefault();Hn.drop=(r,e)=>{let t=e,n=r.dragging;if(r.dragging=null,!t.dataTransfer)return;let i=r.posAtCoords(b0(t));if(!i)return;let a=r.state.doc.resolve(i.pos),o=n&&n.slice;o?r.someProp("transformPasted",p=>{o=p(o,r)}):o=p5(r,S5(t.dataTransfer),Ad?null:t.dataTransfer.getData("text/html"),!1,a);let s=!!(n&&T5(r,t));if(r.someProp("handleDrop",p=>p(r,t,o||ye.empty,s))){t.preventDefault();return}if(!o)return;t.preventDefault();let l=o?XN(r.state.doc,a.pos,o):a.pos;l==null&&(l=a.pos);let u=r.state.tr;if(s){let{node:p}=n;p?p.replace(u):u.deleteSelection()}let c=u.mapping.map(l),f=o.openStart==0&&o.openEnd==0&&o.content.childCount==1,h=u.doc;if(f?u.replaceRangeWith(c,c,o.content.firstChild):u.replaceRange(c,c,o),u.doc.eq(h))return;let d=u.doc.resolve(c);if(f&&Ne.isSelectable(o.content.firstChild)&&d.nodeAfter&&d.nodeAfter.sameMarkup(o.content.firstChild))u.setSelection(new Ne(d));else{let p=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach((v,m,g,y)=>p=y),u.setSelection(f5(r,d,u.doc.resolve(p)))}r.focus(),r.dispatch(u.setMeta("uiEvent","drop"))};Vi.focus=r=>{r.input.lastFocus=Date.now(),r.focused||(r.domObserver.stop(),r.dom.classList.add("ProseMirror-focused"),r.domObserver.start(),r.focused=!0,setTimeout(()=>{r.docView&&r.hasFocus()&&!r.domObserver.currentSelection.eq(r.domSelectionRange())&&mT(r)},20))};Vi.blur=(r,e)=>{let t=e;r.focused&&(r.domObserver.stop(),r.dom.classList.remove("ProseMirror-focused"),r.domObserver.start(),t.relatedTarget&&r.dom.contains(t.relatedTarget)&&r.domObserver.currentSelection.clear(),r.focused=!1)};Vi.beforeinput=(r,e)=>{if(zs&&gp&&e.inputType=="deleteContentBackward"){r.domObserver.flushSoon();let{domChangeCount:n}=r.input;setTimeout(()=>{if(r.input.domChangeCount!=n||(r.dom.blur(),r.focus(),r.someProp("handleKeyDown",a=>a(r,o5(8,"Backspace")))))return;let{$cursor:i}=r.state.selection;i&&i.pos>0&&r.dispatch(r.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let r in Hn)Vi[r]=Hn[r];function Md(r,e){if(r==e)return!0;for(let t in r)if(r[t]!==e[t])return!1;for(let t in e)if(!(t in r))return!1;return!0}class Sg{constructor(e,t){this.toDOM=e,this.spec=t||Ul,this.side=this.spec.side||0}map(e,t,n,i){let{pos:a,deleted:o}=e.mapResult(t.from+i,this.side<0?-1:1);return o?null:new Xr(a-n,a-n,this)}valid(){return!0}eq(e){return this==e||e instanceof Sg&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Md(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class gs{constructor(e,t){this.attrs=e,this.spec=t||Ul}map(e,t,n,i){let a=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-n;return a>=o?null:new Xr(a,o,this)}valid(e,t){return t.from=e&&(!a||a(s.spec))&&n.push(s.copy(s.from+i,s.to+i))}for(let o=0;oe){let s=this.children[o]+1;this.children[o+2].findInner(e-s,t-s,n,i+s,a)}}map(e,t,n){return this==an||e.maps.length==0?this:this.mapInner(e,t,0,0,n||Ul)}mapInner(e,t,n,i,a){let o;for(let s=0;s{let u=l+n,c;if(c=A5(t,s,u)){for(i||(i=this.children.slice());as&&f.to=e){this.children[s]==e&&(n=this.children[s+2]);break}let a=e+1,o=a+t.content.size;for(let s=0;sa&&l.type instanceof gs){let u=Math.max(a,l.from)-a,c=Math.min(o,l.to)-a;ui.map(e,t,Ul));return wl.from(n)}forChild(e,t){if(t.isLeaf)return Gt.empty;let n=[];for(let i=0;it instanceof Gt)?e:e.reduce((t,n)=>t.concat(n instanceof Gt?n:n.members),[]))}}forEachSet(e){for(let t=0;t{let m=v-p-(d-h);for(let g=0;gy+c-f)continue;let b=s[g]+c-f;d>=b?s[g+1]=h<=b?-2:-1:h>=c&&m&&(s[g]+=m,s[g+1]+=m)}f+=m}),c=t.maps[u].map(c,-1)}let l=!1;for(let u=0;u=n.content.size){l=!0;continue}let h=t.map(r[u+1]+a,-1),d=h-i,{index:p,offset:v}=n.content.findIndex(f),m=n.maybeChild(p);if(m&&v==f&&v+m.nodeSize==d){let g=s[u+2].mapInner(t,m,c+1,r[u]+a+1,o);g!=an?(s[u]=f,s[u+1]=d,s[u+2]=g):(s[u+1]=-2,l=!0)}else l=!0}if(l){let u=Gq(s,r,e,t,i,a,o),c=Tg(u,n,0,o);e=c.local;for(let f=0;ft&&o.to{let u=A5(r,s,l+t);if(u){a=!0;let c=Tg(u,s,t+l+1,n);c!=an&&i.push(l,l+s.nodeSize,c)}});let o=C5(a?M5(r):r,-t).sort(Yl);for(let s=0;s0;)e++;r.splice(e,0,t)}var As={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Cg={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Wq=typeof navigator<"u"&&/Mac/.test(navigator.platform),Uq=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Or=0;Or<10;Or++)As[48+Or]=As[96+Or]=String(Or);for(var Or=1;Or<=24;Or++)As[Or+111]="F"+Or;for(var Or=65;Or<=90;Or++)As[Or]=String.fromCharCode(Or+32),Cg[Or]=String.fromCharCode(Or);for(var V1 in As)Cg.hasOwnProperty(V1)||(Cg[V1]=As[V1]);function Yq(r){var e=Wq&&r.metaKey&&r.shiftKey&&!r.ctrlKey&&!r.altKey||Uq&&r.shiftKey&&r.key&&r.key.length==1||r.key=="Unidentified",t=!e&&r.key||(r.shiftKey?Cg:As)[r.keyCode]||r.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const qq=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Xq=typeof navigator<"u"&&/Win/.test(navigator.platform);function Kq(r){let e=r.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let n,i,a,o;for(let s=0;sr.selection.empty?!1:(e&&e(r.tr.deleteSelection().scrollIntoView()),!0);function D5(r,e){let{$cursor:t}=r.selection;return!t||(e?!e.endOfTextblock("backward",r):t.parentOffset>0)?null:t}const E5=(r,e,t)=>{let n=D5(r,t);if(!n)return!1;let i=wT(n);if(!i){let o=n.blockRange(),s=o&&hf(o);return s==null?!1:(e&&e(r.tr.lift(o,s).scrollIntoView()),!0)}let a=i.nodeBefore;if(z5(r,i,e,-1))return!0;if(n.parent.content.size==0&&(qc(a,"end")||Ne.isSelectable(a)))for(let o=n.depth;;o--){let s=m0(r.doc,n.before(o),n.after(o),ye.empty);if(s&&s.slice.size1)break}return a.isAtom&&i.depth==n.depth-1?(e&&e(r.tr.delete(i.pos-a.nodeSize,i.pos).scrollIntoView()),!0):!1},Jq=(r,e,t)=>{let n=D5(r,t);if(!n)return!1;let i=wT(n);return i?L5(r,i,e):!1},Qq=(r,e,t)=>{let n=P5(r,t);if(!n)return!1;let i=ST(n);return i?L5(r,i,e):!1};function L5(r,e,t){let n=e.nodeBefore,i=n,a=e.pos-1;for(;!i.isTextblock;a--){if(i.type.spec.isolating)return!1;let c=i.lastChild;if(!c)return!1;i=c}let o=e.nodeAfter,s=o,l=e.pos+1;for(;!s.isTextblock;l++){if(s.type.spec.isolating)return!1;let c=s.firstChild;if(!c)return!1;s=c}let u=m0(r.doc,a,l,ye.empty);if(!u||u.from!=a||u instanceof Mr&&u.slice.size>=l-a)return!1;if(t){let c=r.tr.step(u);c.setSelection(We.create(c.doc,a)),t(c.scrollIntoView())}return!0}function qc(r,e,t=!1){for(let n=r;n;n=e=="start"?n.firstChild:n.lastChild){if(n.isTextblock)return!0;if(t&&n.childCount!=1)return!1}return!1}const I5=(r,e,t)=>{let{$head:n,empty:i}=r.selection,a=n;if(!i)return!1;if(n.parent.isTextblock){if(t?!t.endOfTextblock("backward",r):n.parentOffset>0)return!1;a=wT(n)}let o=a&&a.nodeBefore;return!o||!Ne.isSelectable(o)?!1:(e&&e(r.tr.setSelection(Ne.create(r.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function wT(r){if(!r.parent.type.spec.isolating)for(let e=r.depth-1;e>=0;e--){if(r.index(e)>0)return r.doc.resolve(r.before(e+1));if(r.node(e).type.spec.isolating)break}return null}function P5(r,e){let{$cursor:t}=r.selection;return!t||(e?!e.endOfTextblock("forward",r):t.parentOffset{let n=P5(r,t);if(!n)return!1;let i=ST(n);if(!i)return!1;let a=i.nodeAfter;if(z5(r,i,e,1))return!0;if(n.parent.content.size==0&&(qc(a,"start")||Ne.isSelectable(a))){let o=m0(r.doc,n.before(),n.after(),ye.empty);if(o&&o.slice.size{let{$head:n,empty:i}=r.selection,a=n;if(!i)return!1;if(n.parent.isTextblock){if(t?!t.endOfTextblock("forward",r):n.parentOffset=0;e--){let t=r.node(e);if(r.index(e)+1{let t=r.selection,n=t instanceof Ne,i;if(n){if(t.node.isTextblock||!Ns(r.doc,t.from))return!1;i=t.from}else if(i=v0(r.doc,t.from,-1),i==null)return!1;if(e){let a=r.tr.join(i);n&&a.setSelection(Ne.create(a.doc,i-r.doc.resolve(i).nodeBefore.nodeSize)),e(a.scrollIntoView())}return!0},tX=(r,e)=>{let t=r.selection,n;if(t instanceof Ne){if(t.node.isTextblock||!Ns(r.doc,t.to))return!1;n=t.to}else if(n=v0(r.doc,t.to,1),n==null)return!1;return e&&e(r.tr.join(n).scrollIntoView()),!0},rX=(r,e)=>{let{$from:t,$to:n}=r.selection,i=t.blockRange(n),a=i&&hf(i);return a==null?!1:(e&&e(r.tr.lift(i,a).scrollIntoView()),!0)},j5=(r,e)=>{let{$head:t,$anchor:n}=r.selection;return!t.parent.type.spec.code||!t.sameParent(n)?!1:(e&&e(r.tr.insertText(` `).scrollIntoView()),!0)};function TT(r){for(let e=0;e{let{$head:t,$anchor:n}=r.selection;if(!t.parent.type.spec.code||!t.sameParent(n))return!1;let i=t.node(-1),a=t.indexAfter(-1),o=TT(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(e){let s=t.after(),l=r.tr.replaceWith(s,s,o.createAndFill());l.setSelection(qe.near(l.doc.resolve(s),1)),e(l.scrollIntoView())}return!0},N5=(r,e)=>{let t=r.selection,{$from:n,$to:i}=t;if(t instanceof Bn||n.parent.inlineContent||i.parent.inlineContent)return!1;let a=TT(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(e){let o=(!n.parentOffset&&i.index(){let{$cursor:t}=r.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let a=t.before();if(uo(r.doc,a))return e&&e(r.tr.split(a).scrollIntoView()),!0}let n=t.blockRange(),i=n&&hf(n);return i==null?!1:(e&&e(r.tr.lift(n,i).scrollIntoView()),!0)};function iX(r){return(e,t)=>{let{$from:n,$to:i}=e.selection;if(e.selection instanceof Ne&&e.selection.node.isBlock)return!n.parentOffset||!uo(e.doc,n.pos)?!1:(t&&t(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.depth)return!1;let a=[],o,s,l=!1,u=!1;for(let d=n.depth;;d--)if(n.node(d).isBlock){l=n.end(d)==n.pos+(n.depth-d),u=n.start(d)==n.pos-(n.depth-d),s=TT(n.node(d-1).contentMatchAt(n.indexAfter(d-1))),a.unshift(l&&s?{type:s}:null),o=d;break}else{if(d==1)return!1;a.unshift(null)}let c=e.tr;(e.selection instanceof We||e.selection instanceof Bn)&&c.deleteSelection();let f=c.mapping.map(n.pos),h=uo(c.doc,f,a.length,a);if(h||(a[0]=s?{type:s}:null,h=uo(c.doc,f,a.length,a)),!h)return!1;if(c.split(f,a.length,a),!l&&u&&n.node(o).type!=s){let d=c.mapping.map(n.before(o)),p=c.doc.resolve(d);s&&n.node(o-1).canReplaceWith(p.index(),p.index()+1,s)&&c.setNodeMarkup(c.mapping.map(n.before(o)),s)}return t&&t(c.scrollIntoView()),!0}}const aX=iX(),oX=(r,e)=>{let{$from:t,to:n}=r.selection,i,a=t.sharedDepth(n);return a==0?!1:(i=t.before(a),e&&e(r.tr.setSelection(Ne.create(r.doc,i))),!0)};function sX(r,e,t){let n=e.nodeBefore,i=e.nodeAfter,a=e.index();return!n||!i||!n.type.compatibleContent(i.type)?!1:!n.content.size&&e.parent.canReplace(a-1,a)?(t&&t(r.tr.delete(e.pos-n.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(a,a+1)||!(i.isTextblock||Ns(r.doc,e.pos))?!1:(t&&t(r.tr.join(e.pos).scrollIntoView()),!0)}function z5(r,e,t,n){let i=e.nodeBefore,a=e.nodeAfter,o,s,l=i.type.spec.isolating||a.type.spec.isolating;if(!l&&sX(r,e,t))return!0;let u=!l&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(o=(s=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&s.matchType(o[0]||a.type).validEnd){if(t){let d=e.pos+a.nodeSize,p=ne.empty;for(let g=o.length-1;g>=0;g--)p=ne.from(o[g].create(null,p));p=ne.from(i.copy(p));let v=r.tr.step(new Dr(e.pos-1,d,e.pos,d,new ye(p,1,0),o.length,!0)),m=v.doc.resolve(d+2*o.length);m.nodeAfter&&m.nodeAfter.type==i.type&&Ns(v.doc,m.pos)&&v.join(m.pos),t(v.scrollIntoView())}return!0}let c=a.type.spec.isolating||n>0&&l?null:qe.findFrom(e,1),f=c&&c.$from.blockRange(c.$to),h=f&&hf(f);if(h!=null&&h>=e.depth)return t&&t(r.tr.lift(f,h).scrollIntoView()),!0;if(u&&qc(a,"start",!0)&&qc(i,"end")){let d=i,p=[];for(;p.push(d),!d.isTextblock;)d=d.lastChild;let v=a,m=1;for(;!v.isTextblock;v=v.firstChild)m++;if(d.canReplace(d.childCount,d.childCount,v.content)){if(t){let g=ne.empty;for(let b=p.length-1;b>=0;b--)g=ne.from(p[b].copy(g));let y=r.tr.step(new Dr(e.pos-p.length,e.pos+a.nodeSize,e.pos+m,e.pos+a.nodeSize-m,new ye(g,p.length,0),0,!0));t(y.scrollIntoView())}return!0}}return!1}function F5(r){return function(e,t){let n=e.selection,i=r<0?n.$from:n.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(t&&t(e.tr.setSelection(We.create(e.doc,r<0?i.start(a):i.end(a)))),!0):!1}}const lX=F5(-1),uX=F5(1);function cX(r,e=null){return function(t,n){let{$from:i,$to:a}=t.selection,o=i.blockRange(a),s=o&&fT(o,r,e);return s?(n&&n(t.tr.wrap(o,s).scrollIntoView()),!0):!1}}function Rk(r,e=null){return function(t,n){let i=!1;for(let a=0;a{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(r,e)))if(l.type==r)i=!0;else{let c=t.doc.resolve(u),f=c.index();i=c.parent.canReplaceWith(f,f+1,r)}})}if(!i)return!1;if(n){let a=t.tr;for(let o=0;o=2&&e.$from.node(e.depth-1).type.compatibleContent(t)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let l=o.resolve(e.start-2);a=new yg(l,l,e.depth),e.endIndex=0;c--)a=ne.from(t[c].type.create(t[c].attrs,a));r.step(new Dr(e.start-(n?2:0),e.end,e.start,e.end,new ye(a,0,0),t.length,!0));let o=0;for(let c=0;co.childCount>0&&o.firstChild.type==r);return a?t?n.node(a.depth-1).type==r?vX(e,t,r,a):mX(e,t,a):!0:!1}}function vX(r,e,t,n){let i=r.tr,a=n.end,o=n.$to.end(n.depth);av;p--)d-=i.child(p).nodeSize,n.delete(d-1,d+1);let a=n.doc.resolve(t.start),o=a.nodeAfter;if(n.mapping.map(t.end)!=t.start+a.nodeAfter.nodeSize)return!1;let s=t.startIndex==0,l=t.endIndex==i.childCount,u=a.node(-1),c=a.index(-1);if(!u.canReplace(c+(s?0:1),c+1,o.content.append(l?ne.empty:ne.from(i))))return!1;let f=a.pos,h=f+o.nodeSize;return n.step(new Dr(f-(s?1:0),h+(l?1:0),f+1,h-1,new ye((s?ne.empty:ne.from(i.copy(ne.empty))).append(l?ne.empty:ne.from(i.copy(ne.empty))),s?0:1,l?0:1),s?0:1)),e(n.scrollIntoView()),!0}function gX(r){return function(e,t){let{$from:n,$to:i}=e.selection,a=n.blockRange(i,u=>u.childCount>0&&u.firstChild.type==r);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let s=a.parent,l=s.child(o-1);if(l.type!=r)return!1;if(t){let u=l.lastChild&&l.lastChild.type==s.type,c=ne.from(u?r.create():null),f=new ye(ne.from(r.create(null,ne.from(s.type.create(null,c)))),u?3:1,0),h=a.start,d=a.end;t(e.tr.step(new Dr(h-(u?3:1),d,h,d,f,1,!0)).scrollIntoView())}return!0}}function V5(r){const{state:e,transaction:t}=r;let{selection:n}=t,{doc:i}=t,{storedMarks:a}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return a},get selection(){return n},get doc(){return i},get tr(){return n=t.selection,i=t.doc,a=t.storedMarks,t}}}class yX{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:n}=this,{view:i}=t,{tr:a}=n,o=this.buildProps(a);return Object.fromEntries(Object.entries(e).map(([s,l])=>[s,(...c)=>{const f=l(...c)(o);return!a.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(a),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:i,state:a}=this,{view:o}=i,s=[],l=!!e,u=e||a.tr,c=()=>(!l&&t&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(u),s.every(h=>h===!0)),f={...Object.fromEntries(Object.entries(n).map(([h,d])=>[h,(...v)=>{const m=this.buildProps(u,t),g=d(...v)(m);return s.push(g),f}])),run:c};return f}createCan(e){const{rawCommands:t,state:n}=this,i=!1,a=e||n.tr,o=this.buildProps(a,i);return{...Object.fromEntries(Object.entries(t).map(([l,u])=>[l,(...c)=>u(...c)({...o,dispatch:void 0})])),chain:()=>this.createChain(a,i)}}buildProps(e,t=!0){const{rawCommands:n,editor:i,state:a}=this,{view:o}=i,s={tr:e,editor:i,view:o,state:V5({state:a,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([l,u])=>[l,(...c)=>u(...c)(s)]))}};return s}}function jr(r,e,t){return r.config[e]===void 0&&r.parent?jr(r.parent,e,t):typeof r.config[e]=="function"?r.config[e].bind({...t,parent:r.parent?jr(r.parent,e,t):null}):r.config[e]}function bX(r){const e=r.filter(i=>i.type==="extension"),t=r.filter(i=>i.type==="node"),n=r.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:n}}function zr(r,e){if(typeof r=="string"){if(!e.nodes[r])throw Error(`There is no node type named '${r}'. Maybe you forgot to add the extension?`);return e.nodes[r]}return r}function Lt(...r){return r.filter(e=>!!e).reduce((e,t)=>{const n={...e};return Object.entries(t).forEach(([i,a])=>{if(!n[i]){n[i]=a;return}if(i==="class"){const s=a?String(a).split(" "):[],l=n[i]?n[i].split(" "):[],u=s.filter(c=>!l.includes(c));n[i]=[...l,...u].join(" ")}else if(i==="style"){const s=a?a.split(";").map(c=>c.trim()).filter(Boolean):[],l=n[i]?n[i].split(";").map(c=>c.trim()).filter(Boolean):[],u=new Map;l.forEach(c=>{const[f,h]=c.split(":").map(d=>d.trim());u.set(f,h)}),s.forEach(c=>{const[f,h]=c.split(":").map(d=>d.trim());u.set(f,h)}),n[i]=Array.from(u.entries()).map(([c,f])=>`${c}: ${f}`).join("; ")}else n[i]=a}),n},{})}function _X(r){return typeof r=="function"}function pr(r,e=void 0,...t){return _X(r)?e?r.bind(e)(...t):r(...t):r}function xX(r){return Object.prototype.toString.call(r)==="[object RegExp]"}class yp{constructor(e){this.find=e.find,this.handler=e.handler}}function wX(r){return Object.prototype.toString.call(r).slice(8,-1)}function Zp(r){return wX(r)!=="Object"?!1:r.constructor===Object&&Object.getPrototypeOf(r)===Object.prototype}function _0(r,e){const t={...r};return Zp(r)&&Zp(e)&&Object.keys(e).forEach(n=>{Zp(e[n])&&Zp(r[n])?t[n]=_0(r[n],e[n]):t[n]=e[n]}),t}class Da{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=pr(jr(this,"addOptions",{name:this.name}))),this.storage=pr(jr(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Da(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>_0(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new Da(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=pr(jr(t,"addOptions",{name:t.name})),t.storage=pr(jr(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){const{tr:n}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const o=i.marks();if(!!!o.find(u=>(u==null?void 0:u.type.name)===t.name))return!1;const l=o.find(u=>(u==null?void 0:u.type.name)===t.name);return l&&n.removeStoredMark(l),n.insertText(" ",i.pos),e.view.dispatch(n),!0}return!1}}class SX{constructor(e){this.find=e.find,this.handler=e.handler}}class Kt{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=pr(jr(this,"addOptions",{name:this.name}))),this.storage=pr(jr(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Kt(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>_0(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new Kt({...this.config,...e});return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=pr(jr(t,"addOptions",{name:t.name})),t.storage=pr(jr(t,"addStorage",{name:t.name,options:t.options})),t}}function TX(r,e,t){const{from:n,to:i}=e,{blockSeparator:a=` `,textSerializers:o={}}=t||{};let s="";return r.nodesBetween(n,i,(l,u,c,f)=>{var h;l.isBlock&&u>n&&(s+=a);const d=o==null?void 0:o[l.type.name];if(d)return c&&(s+=d({node:l,pos:u,parent:c,index:f,range:e})),!1;l.isText&&(s+=(h=l==null?void 0:l.text)===null||h===void 0?void 0:h.slice(Math.max(n,u)-u,i-u))}),s}function CX(r){return Object.fromEntries(Object.entries(r.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}Kt.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Ut({key:new jt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:r}=this,{state:e,schema:t}=r,{doc:n,selection:i}=e,{ranges:a}=i,o=Math.min(...a.map(c=>c.$from.pos)),s=Math.max(...a.map(c=>c.$to.pos)),l=CX(t);return TX(n,{from:o,to:s},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}});const AX=()=>({editor:r,view:e})=>(requestAnimationFrame(()=>{var t;r.isDestroyed||(e.dom.blur(),(t=window==null?void 0:window.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),MX=(r=!1)=>({commands:e})=>e.setContent("",r),kX=()=>({state:r,tr:e,dispatch:t})=>{const{selection:n}=e,{ranges:i}=n;return t&&i.forEach(({$from:a,$to:o})=>{r.doc.nodesBetween(a.pos,o.pos,(s,l)=>{if(s.type.isText)return;const{doc:u,mapping:c}=e,f=u.resolve(c.map(l)),h=u.resolve(c.map(l+s.nodeSize)),d=f.blockRange(h);if(!d)return;const p=hf(d);if(s.type.isTextblock){const{defaultType:v}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(d.start,v)}(p||p===0)&&e.lift(d,p)})}),!0},DX=r=>e=>r(e),EX=()=>({state:r,dispatch:e})=>N5(r,e),LX=(r,e)=>({editor:t,tr:n})=>{const{state:i}=t,a=i.doc.slice(r.from,r.to);n.deleteRange(r.from,r.to);const o=n.mapping.map(e);return n.insert(o,a.content),n.setSelection(new We(n.doc.resolve(Math.max(o-1,0)))),!0},IX=()=>({tr:r,dispatch:e})=>{const{selection:t}=r,n=t.$anchor.node();if(n.content.size>0)return!1;const i=r.selection.$anchor;for(let a=i.depth;a>0;a-=1)if(i.node(a).type===n.type){if(e){const s=i.before(a),l=i.after(a);r.delete(s,l).scrollIntoView()}return!0}return!1},PX=r=>({tr:e,state:t,dispatch:n})=>{const i=zr(r,t.schema),a=e.selection.$anchor;for(let o=a.depth;o>0;o-=1)if(a.node(o).type===i){if(n){const l=a.before(o),u=a.after(o);e.delete(l,u).scrollIntoView()}return!0}return!1},RX=r=>({tr:e,dispatch:t})=>{const{from:n,to:i}=r;return t&&e.delete(n,i),!0},OX=()=>({state:r,dispatch:e})=>xT(r,e),jX=()=>({commands:r})=>r.keyboardShortcut("Enter"),NX=()=>({state:r,dispatch:e})=>nX(r,e);function Ag(r,e,t={strict:!0}){const n=Object.keys(e);return n.length?n.every(i=>t.strict?e[i]===r[i]:xX(e[i])?e[i].test(r[i]):e[i]===r[i]):!0}function $5(r,e,t={}){return r.find(n=>n.type===e&&Ag(Object.fromEntries(Object.keys(t).map(i=>[i,n.attrs[i]])),t))}function Ok(r,e,t={}){return!!$5(r,e,t)}function x0(r,e,t){var n;if(!r||!e)return;let i=r.parent.childAfter(r.parentOffset);if((!i.node||!i.node.marks.some(c=>c.type===e))&&(i=r.parent.childBefore(r.parentOffset)),!i.node||!i.node.marks.some(c=>c.type===e)||(t=t||((n=i.node.marks[0])===null||n===void 0?void 0:n.attrs),!$5([...i.node.marks],e,t)))return;let o=i.index,s=r.start()+i.offset,l=o+1,u=s+i.node.nodeSize;for(;o>0&&Ok([...r.parent.child(o-1).marks],e,t);)o-=1,s-=r.parent.child(o).nodeSize;for(;l({tr:t,state:n,dispatch:i})=>{const a=Fs(r,n.schema),{doc:o,selection:s}=t,{$from:l,from:u,to:c}=s;if(i){const f=x0(l,a,e);if(f&&f.from<=u&&f.to>=c){const h=We.create(o,f.from,f.to);t.setSelection(h)}}return!0},zX=r=>e=>{const t=typeof r=="function"?r(e):r;for(let n=0;n({editor:t,view:n,tr:i,dispatch:a})=>{e={scrollIntoView:!0,...e};const o=()=>{(w0()||G5())&&n.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(n.focus(),e!=null&&e.scrollIntoView&&t.commands.scrollIntoView())})};if(n.hasFocus()&&r===null||r===!1)return!0;if(a&&r===null&&!H5(t.state.selection))return o(),!0;const s=FX(i.doc,r)||t.state.selection,l=t.state.selection.eq(s);return a&&(l||i.setSelection(s),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},$X=(r,e)=>t=>r.every((n,i)=>e(n,{...t,index:i})),HX=(r,e)=>({tr:t,commands:n})=>n.insertContentAt({from:t.selection.from,to:t.selection.to},r,e),W5=r=>{const e=r.childNodes;for(let t=e.length-1;t>=0;t-=1){const n=e[t];n.nodeType===3&&n.nodeValue&&/^(\n\s\s|\n)$/.test(n.nodeValue)?r.removeChild(n):n.nodeType===1&&W5(n)}return r};function Jp(r){const e=`${r}`,t=new window.DOMParser().parseFromString(e,"text/html").body;return W5(t)}function kd(r,e,t){if(r instanceof Wl||r instanceof ne)return r;t={slice:!0,parseOptions:{},...t};const n=typeof r=="object"&&r!==null,i=typeof r=="string";if(n)try{if(Array.isArray(r)&&r.length>0)return ne.fromArray(r.map(s=>e.nodeFromJSON(s)));const o=e.nodeFromJSON(r);return t.errorOnInvalidContent&&o.check(),o}catch(a){if(t.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:a});return console.warn("[tiptap warn]: Invalid content.","Passed value:",r,"Error:",a),kd("",e,t)}if(i){if(t.errorOnInvalidContent){let o=!1,s="";const l=new kY({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:u=>(o=!0,s=typeof u=="string"?u:u.outerHTML,null)}]}})});if(t.slice?Gh.fromSchema(l).parseSlice(Jp(r),t.parseOptions):Gh.fromSchema(l).parse(Jp(r),t.parseOptions),t.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${s}`)})}const a=Gh.fromSchema(e);return t.slice?a.parseSlice(Jp(r),t.parseOptions).content:a.parse(Jp(r),t.parseOptions)}return kd("",e,t)}function GX(r,e,t){const n=r.steps.length-1;if(n{o===0&&(o=c)}),r.setSelection(qe.near(r.doc.resolve(o),t))}const WX=r=>!("type"in r),UX=(r,e,t)=>({tr:n,dispatch:i,editor:a})=>{var o;if(i){t={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...t};let s;const l=m=>{a.emit("contentError",{editor:a,error:m,disableCollaboration:()=>{a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:"full",...t.parseOptions};if(!t.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{kd(e,a.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(m){l(m)}try{s=kd(e,a.schema,{parseOptions:u,errorOnInvalidContent:(o=t.errorOnInvalidContent)!==null&&o!==void 0?o:a.options.enableContentCheck})}catch(m){return l(m),!1}let{from:c,to:f}=typeof r=="number"?{from:r,to:r}:{from:r.from,to:r.to},h=!0,d=!0;if((WX(s)?s:[s]).forEach(m=>{m.check(),h=h?m.isText&&m.marks.length===0:!1,d=d?m.isBlock:!1}),c===f&&d){const{parent:m}=n.doc.resolve(c);m.isTextblock&&!m.type.spec.code&&!m.childCount&&(c-=1,f+=1)}let v;if(h){if(Array.isArray(e))v=e.map(m=>m.text||"").join("");else if(e instanceof ne){let m="";e.forEach(g=>{g.text&&(m+=g.text)}),v=m}else typeof e=="object"&&e&&e.text?v=e.text:v=e;n.insertText(v,c,f)}else v=s,n.replaceWith(c,f,v);t.updateSelection&&GX(n,n.steps.length-1,-1),t.applyInputRules&&n.setMeta("applyInputRules",{from:c,text:v}),t.applyPasteRules&&n.setMeta("applyPasteRules",{from:c,text:v})}return!0},YX=()=>({state:r,dispatch:e})=>eX(r,e),qX=()=>({state:r,dispatch:e})=>tX(r,e),XX=()=>({state:r,dispatch:e})=>E5(r,e),KX=()=>({state:r,dispatch:e})=>R5(r,e),ZX=()=>({state:r,dispatch:e,tr:t})=>{try{const n=v0(r.doc,r.selection.$from.pos,-1);return n==null?!1:(t.join(n,2),e&&e(t),!0)}catch{return!1}},JX=()=>({state:r,dispatch:e,tr:t})=>{try{const n=v0(r.doc,r.selection.$from.pos,1);return n==null?!1:(t.join(n,2),e&&e(t),!0)}catch{return!1}},QX=()=>({state:r,dispatch:e})=>Jq(r,e),eK=()=>({state:r,dispatch:e})=>Qq(r,e);function U5(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function tK(r){const e=r.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let n,i,a,o;for(let s=0;s({editor:e,view:t,tr:n,dispatch:i})=>{const a=tK(r).split(/-(?!$)/),o=a.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),s=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:a.includes("Alt"),ctrlKey:a.includes("Ctrl"),metaKey:a.includes("Meta"),shiftKey:a.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{t.someProp("handleKeyDown",u=>u(t,s))});return l==null||l.steps.forEach(u=>{const c=u.map(n.mapping);c&&i&&n.maybeStep(c)}),!0};function AT(r,e,t={}){const{from:n,to:i,empty:a}=r.selection,o=e?zr(e,r.schema):null,s=[];r.doc.nodesBetween(n,i,(f,h)=>{if(f.isText)return;const d=Math.max(n,h),p=Math.min(i,h+f.nodeSize);s.push({node:f,from:d,to:p})});const l=i-n,u=s.filter(f=>o?o.name===f.node.type.name:!0).filter(f=>Ag(f.node.attrs,t,{strict:!1}));return a?!!u.length:u.reduce((f,h)=>f+h.to-h.from,0)>=l}const nK=(r,e={})=>({state:t,dispatch:n})=>{const i=zr(r,t.schema);return AT(t,i,e)?rX(t,n):!1},iK=()=>({state:r,dispatch:e})=>B5(r,e),aK=r=>({state:e,dispatch:t})=>{const n=zr(r,e.schema);return pX(n)(e,t)},oK=()=>({state:r,dispatch:e})=>j5(r,e);function MT(r,e){return e.nodes[r]?"node":e.marks[r]?"mark":null}function jk(r,e){const t=typeof e=="string"?[e]:e;return Object.keys(r).reduce((n,i)=>(t.includes(i)||(n[i]=r[i]),n),{})}const sK=(r,e)=>({tr:t,state:n,dispatch:i})=>{let a=null,o=null;const s=MT(typeof r=="string"?r:r.name,n.schema);return s?(s==="node"&&(a=zr(r,n.schema)),s==="mark"&&(o=Fs(r,n.schema)),i&&t.selection.ranges.forEach(l=>{n.doc.nodesBetween(l.$from.pos,l.$to.pos,(u,c)=>{a&&a===u.type&&t.setNodeMarkup(c,void 0,jk(u.attrs,e)),o&&u.marks.length&&u.marks.forEach(f=>{o===f.type&&t.addMark(c,c+u.nodeSize,o.create(jk(f.attrs,e)))})})}),!0):!1},lK=()=>({tr:r,dispatch:e})=>(e&&r.scrollIntoView(),!0),uK=()=>({tr:r,dispatch:e})=>{if(e){const t=new Bn(r.doc);r.setSelection(t)}return!0},cK=()=>({state:r,dispatch:e})=>I5(r,e),fK=()=>({state:r,dispatch:e})=>O5(r,e),hK=()=>({state:r,dispatch:e})=>oX(r,e),dK=()=>({state:r,dispatch:e})=>uX(r,e),pK=()=>({state:r,dispatch:e})=>lX(r,e);function vK(r,e,t={},n={}){return kd(r,e,{slice:!1,parseOptions:t,errorOnInvalidContent:n.errorOnInvalidContent})}const mK=(r,e=!1,t={},n={})=>({editor:i,tr:a,dispatch:o,commands:s})=>{var l,u;const{doc:c}=a;if(t.preserveWhitespace!=="full"){const f=vK(r,i.schema,t,{errorOnInvalidContent:(l=n.errorOnInvalidContent)!==null&&l!==void 0?l:i.options.enableContentCheck});return o&&a.replaceWith(0,c.content.size,f).setMeta("preventUpdate",!e),!0}return o&&a.setMeta("preventUpdate",!e),s.insertContentAt({from:0,to:c.content.size},r,{parseOptions:t,errorOnInvalidContent:(u=n.errorOnInvalidContent)!==null&&u!==void 0?u:i.options.enableContentCheck})};function Y5(r,e){const t=Fs(e,r.schema),{from:n,to:i,empty:a}=r.selection,o=[];a?(r.storedMarks&&o.push(...r.storedMarks),o.push(...r.selection.$head.marks())):r.doc.nodesBetween(n,i,l=>{o.push(...l.marks)});const s=o.find(l=>l.type.name===t.name);return s?{...s.attrs}:{}}function gK(r,e){const t=new e5(r);return e.forEach(n=>{n.steps.forEach(i=>{t.step(i)})}),t}function yK(r){for(let e=0;e{e(n)&&t.push({node:n,pos:i})}),t}function bK(r,e,t){const n=[];return r.nodesBetween(e.from,e.to,(i,a)=>{t(i)&&n.push({node:i,pos:a})}),n}function q5(r,e){for(let t=r.depth;t>0;t-=1){const n=r.node(t);if(e(n))return{pos:t>0?r.before(t):0,start:r.start(t),depth:t,node:n}}}function kT(r){return e=>q5(e.$from,r)}function _K(r,e){const t=zr(e,r.schema),{from:n,to:i}=r.selection,a=[];r.doc.nodesBetween(n,i,s=>{a.push(s)});const o=a.reverse().find(s=>s.type.name===t.name);return o?{...o.attrs}:{}}function xK(r,e){const t=MT(typeof e=="string"?e:e.name,r.schema);return t==="node"?_K(r,e):t==="mark"?Y5(r,e):{}}function wK(r,e=JSON.stringify){const t={};return r.filter(n=>{const i=e(n);return Object.prototype.hasOwnProperty.call(t,i)?!1:t[i]=!0})}function SK(r){const e=wK(r);return e.length===1?e:e.filter((t,n)=>!e.filter((a,o)=>o!==n).some(a=>t.oldRange.from>=a.oldRange.from&&t.oldRange.to<=a.oldRange.to&&t.newRange.from>=a.newRange.from&&t.newRange.to<=a.newRange.to))}function TK(r){const{mapping:e,steps:t}=r,n=[];return e.maps.forEach((i,a)=>{const o=[];if(i.ranges.length)i.forEach((s,l)=>{o.push({from:s,to:l})});else{const{from:s,to:l}=t[a];if(s===void 0||l===void 0)return;o.push({from:s,to:l})}o.forEach(({from:s,to:l})=>{const u=e.slice(a).map(s,-1),c=e.slice(a).map(l),f=e.invert().map(u,-1),h=e.invert().map(c);n.push({oldRange:{from:f,to:h},newRange:{from:u,to:c}})})}),SK(n)}function DT(r,e,t){const n=[];return r===e?t.resolve(r).marks().forEach(i=>{const a=t.resolve(r),o=x0(a,i.type);o&&n.push({mark:i,...o})}):t.nodesBetween(r,e,(i,a)=>{!i||(i==null?void 0:i.nodeSize)===void 0||n.push(...i.marks.map(o=>({from:a,to:a+i.nodeSize,mark:o})))}),n}function Am(r,e,t){return Object.fromEntries(Object.entries(t).filter(([n])=>{const i=r.find(a=>a.type===e&&a.name===n);return i?i.attribute.keepOnSplit:!1}))}function CK(r,e,t={}){const{empty:n,ranges:i}=r.selection,a=e?Fs(e,r.schema):null;if(n)return!!(r.storedMarks||r.selection.$from.marks()).filter(f=>a?a.name===f.type.name:!0).find(f=>Ag(f.attrs,t,{strict:!1}));let o=0;const s=[];if(i.forEach(({$from:f,$to:h})=>{const d=f.pos,p=h.pos;r.doc.nodesBetween(d,p,(v,m)=>{if(!v.isText&&!v.marks.length)return;const g=Math.max(d,m),y=Math.min(p,m+v.nodeSize),b=y-g;o+=b,s.push(...v.marks.map(_=>({mark:_,from:g,to:y})))})}),o===0)return!1;const l=s.filter(f=>a?a.name===f.mark.type.name:!0).filter(f=>Ag(f.mark.attrs,t,{strict:!1})).reduce((f,h)=>f+h.to-h.from,0),u=s.filter(f=>a?f.mark.type!==a&&f.mark.type.excludes(a):!0).reduce((f,h)=>f+h.to-h.from,0);return(l>0?l+u:l)>=o}function Nk(r,e){const{nodeExtensions:t}=bX(e),n=t.find(o=>o.name===r);if(!n)return!1;const i={name:n.name,options:n.options,storage:n.storage},a=pr(jr(n,"group",i));return typeof a!="string"?!1:a.split(" ").includes("list")}function ET(r,{checkChildren:e=!0,ignoreWhitespace:t=!1}={}){var n;if(t){if(r.type.name==="hardBreak")return!0;if(r.isText)return/^\s*$/m.test((n=r.text)!==null&&n!==void 0?n:"")}if(r.isText)return!r.text;if(r.isAtom||r.isLeaf)return!1;if(r.content.childCount===0)return!0;if(e){let i=!0;return r.content.forEach(a=>{i!==!1&&(ET(a,{ignoreWhitespace:t,checkChildren:e})||(i=!1))}),i}return!1}function AK(r){return r instanceof Ne}function MK(r,e,t){var n;const{selection:i}=e;let a=null;if(H5(i)&&(a=i.$cursor),a){const s=(n=r.storedMarks)!==null&&n!==void 0?n:a.marks();return!!t.isInSet(s)||!s.some(l=>l.type.excludes(t))}const{ranges:o}=i;return o.some(({$from:s,$to:l})=>{let u=s.depth===0?r.doc.inlineContent&&r.doc.type.allowsMarkType(t):!1;return r.doc.nodesBetween(s.pos,l.pos,(c,f,h)=>{if(u)return!1;if(c.isInline){const d=!h||h.type.allowsMarkType(t),p=!!t.isInSet(c.marks)||!c.marks.some(v=>v.type.excludes(t));u=d&&p}return!u}),u})}const kK=(r,e={})=>({tr:t,state:n,dispatch:i})=>{const{selection:a}=t,{empty:o,ranges:s}=a,l=Fs(r,n.schema);if(i)if(o){const u=Y5(n,l);t.addStoredMark(l.create({...u,...e}))}else s.forEach(u=>{const c=u.$from.pos,f=u.$to.pos;n.doc.nodesBetween(c,f,(h,d)=>{const p=Math.max(d,c),v=Math.min(d+h.nodeSize,f);h.marks.find(g=>g.type===l)?h.marks.forEach(g=>{l===g.type&&t.addMark(p,v,l.create({...g.attrs,...e}))}):t.addMark(p,v,l.create(e))})});return MK(n,t,l)},DK=(r,e)=>({tr:t})=>(t.setMeta(r,e),!0),EK=(r,e={})=>({state:t,dispatch:n,chain:i})=>{const a=zr(r,t.schema);let o;return t.selection.$anchor.sameParent(t.selection.$head)&&(o=t.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:s})=>Rk(a,{...o,...e})(t)?!0:s.clearNodes()).command(({state:s})=>Rk(a,{...o,...e})(s,n)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},LK=r=>({tr:e,dispatch:t})=>{if(t){const{doc:n}=e,i=Dl(r,0,n.content.size),a=Ne.create(n,i);e.setSelection(a)}return!0},IK=r=>({tr:e,dispatch:t})=>{if(t){const{doc:n}=e,{from:i,to:a}=typeof r=="number"?{from:r,to:r}:r,o=We.atStart(n).from,s=We.atEnd(n).to,l=Dl(i,o,s),u=Dl(a,o,s),c=We.create(n,l,u);e.setSelection(c)}return!0},PK=r=>({state:e,dispatch:t})=>{const n=zr(r,e.schema);return gX(n)(e,t)};function Bk(r,e){const t=r.storedMarks||r.selection.$to.parentOffset&&r.selection.$from.marks();if(t){const n=t.filter(i=>e==null?void 0:e.includes(i.type.name));r.tr.ensureMarks(n)}}const RK=({keepMarks:r=!0}={})=>({tr:e,state:t,dispatch:n,editor:i})=>{const{selection:a,doc:o}=e,{$from:s,$to:l}=a,u=i.extensionManager.attributes,c=Am(u,s.node().type.name,s.node().attrs);if(a instanceof Ne&&a.node.isBlock)return!s.parentOffset||!uo(o,s.pos)?!1:(n&&(r&&Bk(t,i.extensionManager.splittableMarks),e.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;const f=l.parentOffset===l.parent.content.size,h=s.depth===0?void 0:yK(s.node(-1).contentMatchAt(s.indexAfter(-1)));let d=f&&h?[{type:h,attrs:c}]:void 0,p=uo(e.doc,e.mapping.map(s.pos),1,d);if(!d&&!p&&uo(e.doc,e.mapping.map(s.pos),1,h?[{type:h}]:void 0)&&(p=!0,d=h?[{type:h,attrs:c}]:void 0),n){if(p&&(a instanceof We&&e.deleteSelection(),e.split(e.mapping.map(s.pos),1,d),h&&!f&&!s.parentOffset&&s.parent.type!==h)){const v=e.mapping.map(s.before()),m=e.doc.resolve(v);s.node(-1).canReplaceWith(m.index(),m.index()+1,h)&&e.setNodeMarkup(e.mapping.map(s.before()),h)}r&&Bk(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return p},OK=(r,e={})=>({tr:t,state:n,dispatch:i,editor:a})=>{var o;const s=zr(r,n.schema),{$from:l,$to:u}=n.selection,c=n.selection.node;if(c&&c.isBlock||l.depth<2||!l.sameParent(u))return!1;const f=l.node(-1);if(f.type!==s)return!1;const h=a.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==s||l.index(-2)!==l.node(-2).childCount-1)return!1;if(i){let g=ne.empty;const y=l.index(-1)?1:l.index(-2)?2:3;for(let T=l.depth-y;T>=l.depth-3;T-=1)g=ne.from(l.node(T).copy(g));const b=l.indexAfter(-1){if(S>-1)return!1;T.isTextblock&&T.content.size===0&&(S=C+1)}),S>-1&&t.setSelection(We.near(t.doc.resolve(S))),t.scrollIntoView()}return!0}const d=u.pos===l.end()?f.contentMatchAt(0).defaultType:null,p={...Am(h,f.type.name,f.attrs),...e},v={...Am(h,l.node().type.name,l.node().attrs),...e};t.delete(l.pos,u.pos);const m=d?[{type:s,attrs:p},{type:d,attrs:v}]:[{type:s,attrs:p}];if(!uo(t.doc,l.pos,2))return!1;if(i){const{selection:g,storedMarks:y}=n,{splittableMarks:b}=a.extensionManager,_=y||g.$to.parentOffset&&g.$from.marks();if(t.split(l.pos,2,m).scrollIntoView(),!_||!i)return!0;const x=_.filter(w=>b.includes(w.type.name));t.ensureMarks(x)}return!0},H1=(r,e)=>{const t=kT(o=>o.type===e)(r.selection);if(!t)return!0;const n=r.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(n===void 0)return!0;const i=r.doc.nodeAt(n);return t.node.type===(i==null?void 0:i.type)&&Ns(r.doc,t.pos)&&r.join(t.pos),!0},G1=(r,e)=>{const t=kT(o=>o.type===e)(r.selection);if(!t)return!0;const n=r.doc.resolve(t.start).after(t.depth);if(n===void 0)return!0;const i=r.doc.nodeAt(n);return t.node.type===(i==null?void 0:i.type)&&Ns(r.doc,n)&&r.join(n),!0},jK=(r,e,t,n={})=>({editor:i,tr:a,state:o,dispatch:s,chain:l,commands:u,can:c})=>{const{extensions:f,splittableMarks:h}=i.extensionManager,d=zr(r,o.schema),p=zr(e,o.schema),{selection:v,storedMarks:m}=o,{$from:g,$to:y}=v,b=g.blockRange(y),_=m||v.$to.parentOffset&&v.$from.marks();if(!b)return!1;const x=kT(w=>Nk(w.type.name,f))(v);if(b.depth>=1&&x&&b.depth-x.depth<=1){if(x.node.type===d)return u.liftListItem(p);if(Nk(x.node.type.name,f)&&d.validContent(x.node.content)&&s)return l().command(()=>(a.setNodeMarkup(x.pos,d),!0)).command(()=>H1(a,d)).command(()=>G1(a,d)).run()}return!t||!_||!s?l().command(()=>c().wrapInList(d,n)?!0:u.clearNodes()).wrapInList(d,n).command(()=>H1(a,d)).command(()=>G1(a,d)).run():l().command(()=>{const w=c().wrapInList(d,n),S=_.filter(T=>h.includes(T.type.name));return a.ensureMarks(S),w?!0:u.clearNodes()}).wrapInList(d,n).command(()=>H1(a,d)).command(()=>G1(a,d)).run()},NK=(r,e={},t={})=>({state:n,commands:i})=>{const{extendEmptyMarkRange:a=!1}=t,o=Fs(r,n.schema);return CK(n,o,e)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,e)},BK=(r,e,t={})=>({state:n,commands:i})=>{const a=zr(r,n.schema),o=zr(e,n.schema),s=AT(n,a,t);let l;return n.selection.$anchor.sameParent(n.selection.$head)&&(l=n.selection.$anchor.parent.attrs),s?i.setNode(o,l):i.setNode(a,{...l,...t})},zK=(r,e={})=>({state:t,commands:n})=>{const i=zr(r,t.schema);return AT(t,i,e)?n.lift(i):n.wrapIn(i,e)},FK=()=>({state:r,dispatch:e})=>{const t=r.plugins;for(let n=0;n=0;l-=1)o.step(s.steps[l].invert(s.docs[l]));if(a.text){const l=o.doc.resolve(a.from).marks();o.replaceWith(a.from,a.to,r.schema.text(a.text,l))}else o.delete(a.from,a.to)}return!0}}return!1},VK=()=>({tr:r,dispatch:e})=>{const{selection:t}=r,{empty:n,ranges:i}=t;return n||e&&i.forEach(a=>{r.removeMark(a.$from.pos,a.$to.pos)}),!0},$K=(r,e={})=>({tr:t,state:n,dispatch:i})=>{var a;const{extendEmptyMarkRange:o=!1}=e,{selection:s}=t,l=Fs(r,n.schema),{$from:u,empty:c,ranges:f}=s;if(!i)return!0;if(c&&o){let{from:h,to:d}=s;const p=(a=u.marks().find(m=>m.type===l))===null||a===void 0?void 0:a.attrs,v=x0(u,l,p);v&&(h=v.from,d=v.to),t.removeMark(h,d,l)}else f.forEach(h=>{t.removeMark(h.$from.pos,h.$to.pos,l)});return t.removeStoredMark(l),!0},HK=(r,e={})=>({tr:t,state:n,dispatch:i})=>{let a=null,o=null;const s=MT(typeof r=="string"?r:r.name,n.schema);return s?(s==="node"&&(a=zr(r,n.schema)),s==="mark"&&(o=Fs(r,n.schema)),i&&t.selection.ranges.forEach(l=>{const u=l.$from.pos,c=l.$to.pos;let f,h,d,p;t.selection.empty?n.doc.nodesBetween(u,c,(v,m)=>{a&&a===v.type&&(d=Math.max(m,u),p=Math.min(m+v.nodeSize,c),f=m,h=v)}):n.doc.nodesBetween(u,c,(v,m)=>{m=u&&m<=c&&(a&&a===v.type&&t.setNodeMarkup(m,void 0,{...v.attrs,...e}),o&&v.marks.length&&v.marks.forEach(g=>{if(o===g.type){const y=Math.max(m,u),b=Math.min(m+v.nodeSize,c);t.addMark(y,b,o.create({...g.attrs,...e}))}}))}),h&&(f!==void 0&&t.setNodeMarkup(f,void 0,{...h.attrs,...e}),o&&h.marks.length&&h.marks.forEach(v=>{o===v.type&&t.addMark(d,p,o.create({...v.attrs,...e}))}))}),!0):!1},GK=(r,e={})=>({state:t,dispatch:n})=>{const i=zr(r,t.schema);return cX(i,e)(t,n)},WK=(r,e={})=>({state:t,dispatch:n})=>{const i=zr(r,t.schema);return fX(i,e)(t,n)};var UK=Object.freeze({__proto__:null,blur:AX,clearContent:MX,clearNodes:kX,command:DX,createParagraphNear:EX,cut:LX,deleteCurrentNode:IX,deleteNode:PX,deleteRange:RX,deleteSelection:OX,enter:jX,exitCode:NX,extendMarkRange:BX,first:zX,focus:VX,forEach:$X,insertContent:HX,insertContentAt:UX,joinBackward:XX,joinDown:qX,joinForward:KX,joinItemBackward:ZX,joinItemForward:JX,joinTextblockBackward:QX,joinTextblockForward:eK,joinUp:YX,keyboardShortcut:rK,lift:nK,liftEmptyBlock:iK,liftListItem:aK,newlineInCode:oK,resetAttributes:sK,scrollIntoView:lK,selectAll:uK,selectNodeBackward:cK,selectNodeForward:fK,selectParentNode:hK,selectTextblockEnd:dK,selectTextblockStart:pK,setContent:mK,setMark:kK,setMeta:DK,setNode:EK,setNodeSelection:LK,setTextSelection:IK,sinkListItem:PK,splitBlock:RK,splitListItem:OK,toggleList:jK,toggleMark:NK,toggleNode:BK,toggleWrap:zK,undoInputRule:FK,unsetAllMarks:VK,unsetMark:$K,updateAttributes:HK,wrapIn:GK,wrapInList:WK});Kt.create({name:"commands",addCommands(){return{...UK}}});Kt.create({name:"drop",addProseMirrorPlugins(){return[new Ut({key:new jt("tiptapDrop"),props:{handleDrop:(r,e,t,n)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:t,moved:n})}}})]}});Kt.create({name:"editable",addProseMirrorPlugins(){return[new Ut({key:new jt("editable"),props:{editable:()=>this.editor.options.editable}})]}});const YK=new jt("focusEvents");Kt.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:r}=this;return[new Ut({key:YK,props:{handleDOMEvents:{focus:(e,t)=>{r.isFocused=!0;const n=r.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(n),!1},blur:(e,t)=>{r.isFocused=!1;const n=r.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(n),!1}}}})]}});Kt.create({name:"keymap",addKeyboardShortcuts(){const r=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:s})=>{const{selection:l,doc:u}=s,{empty:c,$anchor:f}=l,{pos:h,parent:d}=f,p=f.parent.isTextblock&&h>0?s.doc.resolve(h-1):f,v=p.parent.type.spec.isolating,m=f.pos-f.parentOffset,g=v&&p.parent.childCount===1?m===f.pos:qe.atStart(u).from===h;return!c||!d.type.isTextblock||d.textContent.length||!g||g&&f.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:r,"Mod-Backspace":r,"Shift-Backspace":r,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...n},a={...n,"Ctrl-h":r,"Alt-Backspace":r,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return w0()||U5()?a:i},addProseMirrorPlugins(){return[new Ut({key:new jt("clearDocument"),appendTransaction:(r,e,t)=>{if(r.some(v=>v.getMeta("composition")))return;const n=r.some(v=>v.docChanged)&&!e.doc.eq(t.doc),i=r.some(v=>v.getMeta("preventClearDocument"));if(!n||i)return;const{empty:a,from:o,to:s}=e.selection,l=qe.atStart(e.doc).from,u=qe.atEnd(e.doc).to;if(a||!(o===l&&s===u)||!ET(t.doc))return;const h=t.tr,d=V5({state:t,transaction:h}),{commands:p}=new yX({editor:this.editor,state:d});if(p.clearNodes(),!!h.steps.length)return h}})]}});Kt.create({name:"paste",addProseMirrorPlugins(){return[new Ut({key:new jt("tiptapPaste"),props:{handlePaste:(r,e,t)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:t})}}})]}});Kt.create({name:"tabindex",addProseMirrorPlugins(){return[new Ut({key:new jt("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});function Xc(r){return new yp({find:r.find,handler:({state:e,range:t,match:n})=>{const i=pr(r.getAttributes,void 0,n);if(i===!1||i===null)return null;const{tr:a}=e,o=n[n.length-1],s=n[0];if(o){const l=s.search(/\S/),u=t.from+s.indexOf(o),c=u+o.length;if(DT(t.from,t.to,e.doc).filter(d=>d.mark.type.excluded.find(v=>v===r.type&&v!==d.mark.type)).filter(d=>d.to>u).length)return null;ct.from&&a.delete(t.from+l,u);const h=t.from+l+o.length;a.addMark(t.from+l,h,r.type.create(i||{})),a.removeStoredMark(r.type)}}})}function X5(r){return new yp({find:r.find,handler:({state:e,range:t,match:n})=>{const i=pr(r.getAttributes,void 0,n)||{},{tr:a}=e,o=t.from;let s=t.to;const l=r.type.create(i);if(n[1]){const u=n[0].lastIndexOf(n[1]);let c=o+u;c>s?c=s:s=c+n[1].length;const f=n[0][n[0].length-1];a.insertText(f,o+n[0].length-1),a.replaceWith(c,s,l)}else if(n[0]){const u=r.type.isInline?o:o-1;a.insert(u,r.type.create(i)).delete(a.mapping.map(o),a.mapping.map(s))}a.scrollIntoView()}})}function Mg(r){return new yp({find:r.find,handler:({state:e,range:t,match:n})=>{const i=e.doc.resolve(t.from),a=pr(r.getAttributes,void 0,n)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),r.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,r.type,a)}})}function ir(r){return new yp({find:r.find,handler:({state:e,range:t,match:n})=>{let i=r.replace,a=t.from;const o=t.to;if(n[1]){const s=n[0].lastIndexOf(n[1]);i+=n[0].slice(s+n[1].length),a+=s;const l=a-o;l>0&&(i=n[0].slice(s-l,s)+i,a=o)}e.tr.insertText(i,a,o)}})}function Kc(r){return new yp({find:r.find,handler:({state:e,range:t,match:n,chain:i})=>{const a=pr(r.getAttributes,void 0,n)||{},o=e.tr.delete(t.from,t.to),l=o.doc.resolve(t.from).blockRange(),u=l&&fT(l,r.type,a);if(!u)return null;if(o.wrap(l,u),r.keepMarks&&r.editor){const{selection:f,storedMarks:h}=e,{splittableMarks:d}=r.editor.extensionManager,p=h||f.$to.parentOffset&&f.$from.marks();if(p){const v=p.filter(m=>d.includes(m.type.name));o.ensureMarks(v)}}if(r.keepAttributes){const f=r.type.name==="bulletList"||r.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,a).run()}const c=o.doc.resolve(t.from-1).nodeBefore;c&&c.type===r.type&&Ns(o.doc,t.from-1)&&(!r.joinPredicate||r.joinPredicate(n,c))&&o.join(t.from-1)}})}let ar=class yw{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=pr(jr(this,"addOptions",{name:this.name}))),this.storage=pr(jr(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new yw(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>_0(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new yw(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=pr(jr(t,"addOptions",{name:t.name})),t.storage=pr(jr(t,"addStorage",{name:t.name,options:t.options})),t}};class qK{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.innerDecorations=t.innerDecorations,this.view=t.view,this.HTMLAttributes=t.HTMLAttributes,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,n,i,a,o,s,l;const{view:u}=this.editor,c=e.target,f=c.nodeType===3?(t=c.parentElement)===null||t===void 0?void 0:t.closest("[data-drag-handle]"):c.closest("[data-drag-handle]");if(!this.dom||!((n=this.contentDOM)===null||n===void 0)&&n.contains(c)||!f)return;let h=0,d=0;if(this.dom!==f){const y=this.dom.getBoundingClientRect(),b=f.getBoundingClientRect(),_=(i=e.offsetX)!==null&&i!==void 0?i:(a=e.nativeEvent)===null||a===void 0?void 0:a.offsetX,x=(o=e.offsetY)!==null&&o!==void 0?o:(s=e.nativeEvent)===null||s===void 0?void 0:s.offsetY;h=b.x-y.x+_,d=b.y-y.y+x}const p=this.dom.cloneNode(!0);(l=e.dataTransfer)===null||l===void 0||l.setDragImage(p,h,d);const v=this.getPos();if(typeof v!="number")return;const m=Ne.create(u.state.doc,v),g=u.state.tr.setSelection(m);u.dispatch(g)}stopEvent(e){var t;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:e});const n=e.target;if(!(this.dom.contains(n)&&!(!((t=this.contentDOM)===null||t===void 0)&&t.contains(n))))return!1;const a=e.type.startsWith("drag"),o=e.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!o&&!a)return!0;const{isEditable:l}=this.editor,{isDragging:u}=this,c=!!this.node.type.spec.draggable,f=Ne.isSelectable(this.node),h=e.type==="copy",d=e.type==="paste",p=e.type==="cut",v=e.type==="mousedown";if(!c&&f&&a&&e.target===this.dom&&e.preventDefault(),c&&a&&!u&&e.target===this.dom)return e.preventDefault(),!1;if(c&&l&&!u&&v){const m=n.closest("[data-drag-handle]");m&&(this.dom===m||this.dom.contains(m))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(u||o||h||d||p||v&&f)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type==="selection"||this.dom.contains(e.target)&&e.type==="childList"&&(w0()||G5())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(n=>n.isContentEditable)?!1:this.contentDOM===e.target&&e.type==="attributes"?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:t})=>{const n=this.getPos();return typeof n!="number"?!1:(t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0)})}deleteNode(){const e=this.getPos();if(typeof e!="number")return;const t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}}function fu(r){return new SX({find:r.find,handler:({state:e,range:t,match:n,pasteEvent:i})=>{const a=pr(r.getAttributes,void 0,n,i);if(a===!1||a===null)return null;const{tr:o}=e,s=n[n.length-1],l=n[0];let u=t.to;if(s){const c=l.search(/\S/),f=t.from+l.indexOf(s),h=f+s.length;if(DT(t.from,t.to,e.doc).filter(p=>p.mark.type.excluded.find(m=>m===r.type&&m!==p.mark.type)).filter(p=>p.to>f).length)return null;ht.from&&o.delete(t.from+c,f),u=t.from+c+s.length,o.addMark(t.from+c,u,r.type.create(a||{})),o.removeStoredMark(r.type)}}})}function XK(r,e){const{selection:t}=r,{$from:n}=t;if(t instanceof Ne){const a=n.index();return n.parent.canReplaceWith(a,a+1,e)}let i=n.depth;for(;i>=0;){const a=n.index(i);if(n.node(i).contentMatchAt(a).matchType(e))return!0;i-=1}return!1}function KK(r){return r.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var ZK="tippy-box",K5="tippy-content",JK="tippy-backdrop",Z5="tippy-arrow",J5="tippy-svg-arrow",vl={passive:!0,capture:!0},Q5=function(){return document.body};function W1(r,e,t){if(Array.isArray(r)){var n=r[e];return n??(Array.isArray(t)?t[e]:t)}return r}function LT(r,e){var t={}.toString.call(r);return t.indexOf("[object")===0&&t.indexOf(e+"]")>-1}function e4(r,e){return typeof r=="function"?r.apply(void 0,e):r}function zk(r,e){if(e===0)return r;var t;return function(n){clearTimeout(t),t=setTimeout(function(){r(n)},e)}}function QK(r){return r.split(/\s+/).filter(Boolean)}function bc(r){return[].concat(r)}function Fk(r,e){r.indexOf(e)===-1&&r.push(e)}function eZ(r){return r.filter(function(e,t){return r.indexOf(e)===t})}function tZ(r){return r.split("-")[0]}function kg(r){return[].slice.call(r)}function Vk(r){return Object.keys(r).reduce(function(e,t){return r[t]!==void 0&&(e[t]=r[t]),e},{})}function Yh(){return document.createElement("div")}function S0(r){return["Element","Fragment"].some(function(e){return LT(r,e)})}function rZ(r){return LT(r,"NodeList")}function nZ(r){return LT(r,"MouseEvent")}function iZ(r){return!!(r&&r._tippy&&r._tippy.reference===r)}function aZ(r){return S0(r)?[r]:rZ(r)?kg(r):Array.isArray(r)?r:kg(document.querySelectorAll(r))}function U1(r,e){r.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function $k(r,e){r.forEach(function(t){t&&t.setAttribute("data-state",e)})}function oZ(r){var e,t=bc(r),n=t[0];return n!=null&&(e=n.ownerDocument)!=null&&e.body?n.ownerDocument:document}function sZ(r,e){var t=e.clientX,n=e.clientY;return r.every(function(i){var a=i.popperRect,o=i.popperState,s=i.props,l=s.interactiveBorder,u=tZ(o.placement),c=o.modifiersData.offset;if(!c)return!0;var f=u==="bottom"?c.top.y:0,h=u==="top"?c.bottom.y:0,d=u==="right"?c.left.x:0,p=u==="left"?c.right.x:0,v=a.top-n+f>l,m=n-a.bottom-h>l,g=a.left-t+d>l,y=t-a.right-p>l;return v||m||g||y})}function Y1(r,e,t){var n=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){r[n](i,t)})}function Hk(r,e){for(var t=e;t;){var n;if(r.contains(t))return!0;t=t.getRootNode==null||(n=t.getRootNode())==null?void 0:n.host}return!1}var sa={isTouch:!1},Gk=0;function lZ(){sa.isTouch||(sa.isTouch=!0,window.performance&&document.addEventListener("mousemove",t4))}function t4(){var r=performance.now();r-Gk<20&&(sa.isTouch=!1,document.removeEventListener("mousemove",t4)),Gk=r}function uZ(){var r=document.activeElement;if(iZ(r)){var e=r._tippy;r.blur&&!e.state.isVisible&&r.blur()}}function cZ(){document.addEventListener("touchstart",lZ,vl),window.addEventListener("blur",uZ)}var fZ=typeof window<"u"&&typeof document<"u",hZ=fZ?!!window.msCrypto:!1,dZ={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},pZ={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Ei=Object.assign({appendTo:Q5,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},dZ,pZ),vZ=Object.keys(Ei),mZ=function(e){var t=Object.keys(e);t.forEach(function(n){Ei[n]=e[n]})};function r4(r){var e=r.plugins||[],t=e.reduce(function(n,i){var a=i.name,o=i.defaultValue;if(a){var s;n[a]=r[a]!==void 0?r[a]:(s=Ei[a])!=null?s:o}return n},{});return Object.assign({},r,t)}function gZ(r,e){var t=e?Object.keys(r4(Object.assign({},Ei,{plugins:e}))):vZ,n=t.reduce(function(i,a){var o=(r.getAttribute("data-tippy-"+a)||"").trim();if(!o)return i;if(a==="content")i[a]=o;else try{i[a]=JSON.parse(o)}catch{i[a]=o}return i},{});return n}function Wk(r,e){var t=Object.assign({},e,{content:e4(e.content,[r])},e.ignoreAttributes?{}:gZ(r,e.plugins));return t.aria=Object.assign({},Ei.aria,t.aria),t.aria={expanded:t.aria.expanded==="auto"?e.interactive:t.aria.expanded,content:t.aria.content==="auto"?e.interactive?null:"describedby":t.aria.content},t}var yZ=function(){return"innerHTML"};function bw(r,e){r[yZ()]=e}function Uk(r){var e=Yh();return r===!0?e.className=Z5:(e.className=J5,S0(r)?e.appendChild(r):bw(e,r)),e}function Yk(r,e){S0(e.content)?(bw(r,""),r.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?bw(r,e.content):r.textContent=e.content)}function _w(r){var e=r.firstElementChild,t=kg(e.children);return{box:e,content:t.find(function(n){return n.classList.contains(K5)}),arrow:t.find(function(n){return n.classList.contains(Z5)||n.classList.contains(J5)}),backdrop:t.find(function(n){return n.classList.contains(JK)})}}function n4(r){var e=Yh(),t=Yh();t.className=ZK,t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1");var n=Yh();n.className=K5,n.setAttribute("data-state","hidden"),Yk(n,r.props),e.appendChild(t),t.appendChild(n),i(r.props,r.props);function i(a,o){var s=_w(e),l=s.box,u=s.content,c=s.arrow;o.theme?l.setAttribute("data-theme",o.theme):l.removeAttribute("data-theme"),typeof o.animation=="string"?l.setAttribute("data-animation",o.animation):l.removeAttribute("data-animation"),o.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof o.maxWidth=="number"?o.maxWidth+"px":o.maxWidth,o.role?l.setAttribute("role",o.role):l.removeAttribute("role"),(a.content!==o.content||a.allowHTML!==o.allowHTML)&&Yk(u,r.props),o.arrow?c?a.arrow!==o.arrow&&(l.removeChild(c),l.appendChild(Uk(o.arrow))):l.appendChild(Uk(o.arrow)):c&&l.removeChild(c)}return{popper:e,onUpdate:i}}n4.$$tippy=!0;var bZ=1,Qp=[],q1=[];function _Z(r,e){var t=Wk(r,Object.assign({},Ei,r4(Vk(e)))),n,i,a,o=!1,s=!1,l=!1,u=!1,c,f,h,d=[],p=zk(Q,t.interactiveDebounce),v,m=bZ++,g=null,y=eZ(t.plugins),b={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},_={id:m,reference:r,popper:Yh(),popperInstance:g,props:t,state:b,plugins:y,clearDelayTimeouts:tn,setProps:pe,setContent:De,show:tt,hide:mt,hideWithInteractivity:or,enable:yr,disable:en,unmount:$r,destroy:Io};if(!t.render)return _;var x=t.render(_),w=x.popper,S=x.onUpdate;w.setAttribute("data-tippy-root",""),w.id="tippy-"+_.id,_.popper=w,r._tippy=_,w._tippy=_;var T=y.map(function(X){return X.fn(_)}),C=r.hasAttribute("aria-expanded");return re(),F(),P(),O("onCreate",[_]),t.showOnCreate&&ht(),w.addEventListener("mouseenter",function(){_.props.interactive&&_.state.isVisible&&_.clearDelayTimeouts()}),w.addEventListener("mouseleave",function(){_.props.interactive&&_.props.trigger.indexOf("mouseenter")>=0&&L().addEventListener("mousemove",p)}),_;function A(){var X=_.props.touch;return Array.isArray(X)?X:[X,0]}function M(){return A()[0]==="hold"}function D(){var X;return!!((X=_.props.render)!=null&&X.$$tippy)}function E(){return v||r}function L(){var X=E().parentNode;return X?oZ(X):document}function I(){return _w(w)}function R(X){return _.state.isMounted&&!_.state.isVisible||sa.isTouch||c&&c.type==="focus"?0:W1(_.props.delay,X?0:1,Ei.delay)}function P(X){X===void 0&&(X=!1),w.style.pointerEvents=_.props.interactive&&!X?"":"none",w.style.zIndex=""+_.props.zIndex}function O(X,Ae,Ge){if(Ge===void 0&&(Ge=!0),T.forEach(function(gt){gt[X]&>[X].apply(gt,Ae)}),Ge){var xt;(xt=_.props)[X].apply(xt,Ae)}}function j(){var X=_.props.aria;if(X.content){var Ae="aria-"+X.content,Ge=w.id,xt=bc(_.props.triggerTarget||r);xt.forEach(function(gt){var hr=gt.getAttribute(Ae);if(_.state.isVisible)gt.setAttribute(Ae,hr?hr+" "+Ge:Ge);else{var Ir=hr&&hr.replace(Ge,"").trim();Ir?gt.setAttribute(Ae,Ir):gt.removeAttribute(Ae)}})}}function F(){if(!(C||!_.props.aria.expanded)){var X=bc(_.props.triggerTarget||r);X.forEach(function(Ae){_.props.interactive?Ae.setAttribute("aria-expanded",_.state.isVisible&&Ae===E()?"true":"false"):Ae.removeAttribute("aria-expanded")})}}function N(){L().removeEventListener("mousemove",p),Qp=Qp.filter(function(X){return X!==p})}function B(X){if(!(sa.isTouch&&(l||X.type==="mousedown"))){var Ae=X.composedPath&&X.composedPath()[0]||X.target;if(!(_.props.interactive&&Hk(w,Ae))){if(bc(_.props.triggerTarget||r).some(function(Ge){return Hk(Ge,Ae)})){if(sa.isTouch||_.state.isVisible&&_.props.trigger.indexOf("click")>=0)return}else O("onClickOutside",[_,X]);_.props.hideOnClick===!0&&(_.clearDelayTimeouts(),_.hide(),s=!0,setTimeout(function(){s=!1}),_.state.isMounted||we())}}}function $(){l=!0}function J(){l=!1}function U(){var X=L();X.addEventListener("mousedown",B,!0),X.addEventListener("touchend",B,vl),X.addEventListener("touchstart",J,vl),X.addEventListener("touchmove",$,vl)}function we(){var X=L();X.removeEventListener("mousedown",B,!0),X.removeEventListener("touchend",B,vl),X.removeEventListener("touchstart",J,vl),X.removeEventListener("touchmove",$,vl)}function Ye(X,Ae){le(X,function(){!_.state.isVisible&&w.parentNode&&w.parentNode.contains(w)&&Ae()})}function ge(X,Ae){le(X,Ae)}function le(X,Ae){var Ge=I().box;function xt(gt){gt.target===Ge&&(Y1(Ge,"remove",xt),Ae())}if(X===0)return Ae();Y1(Ge,"remove",f),Y1(Ge,"add",xt),f=xt}function be(X,Ae,Ge){Ge===void 0&&(Ge=!1);var xt=bc(_.props.triggerTarget||r);xt.forEach(function(gt){gt.addEventListener(X,Ae,Ge),d.push({node:gt,eventType:X,handler:Ae,options:Ge})})}function re(){M()&&(be("touchstart",ee,{passive:!0}),be("touchend",me,{passive:!0})),QK(_.props.trigger).forEach(function(X){if(X!=="manual")switch(be(X,ee),X){case"mouseenter":be("mouseleave",me);break;case"focus":be(hZ?"focusout":"blur",he);break;case"focusin":be("focusout",he);break}})}function G(){d.forEach(function(X){var Ae=X.node,Ge=X.eventType,xt=X.handler,gt=X.options;Ae.removeEventListener(Ge,xt,gt)}),d=[]}function ee(X){var Ae,Ge=!1;if(!(!_.state.isEnabled||Se(X)||s)){var xt=((Ae=c)==null?void 0:Ae.type)==="focus";c=X,v=X.currentTarget,F(),!_.state.isVisible&&nZ(X)&&Qp.forEach(function(gt){return gt(X)}),X.type==="click"&&(_.props.trigger.indexOf("mouseenter")<0||o)&&_.props.hideOnClick!==!1&&_.state.isVisible?Ge=!0:ht(X),X.type==="click"&&(o=!Ge),Ge&&!xt&&fr(X)}}function Q(X){var Ae=X.target,Ge=E().contains(Ae)||w.contains(Ae);if(!(X.type==="mousemove"&&Ge)){var xt=at().concat(w).map(function(gt){var hr,Ir=gt._tippy,Po=(hr=Ir.popperInstance)==null?void 0:hr.state;return Po?{popperRect:gt.getBoundingClientRect(),popperState:Po,props:t}:null}).filter(Boolean);sZ(xt,X)&&(N(),fr(X))}}function me(X){var Ae=Se(X)||_.props.trigger.indexOf("click")>=0&&o;if(!Ae){if(_.props.interactive){_.hideWithInteractivity(X);return}fr(X)}}function he(X){_.props.trigger.indexOf("focusin")<0&&X.target!==E()||_.props.interactive&&X.relatedTarget&&w.contains(X.relatedTarget)||fr(X)}function Se(X){return sa.isTouch?M()!==X.type.indexOf("touch")>=0:!1}function Fe(){xe();var X=_.props,Ae=X.popperOptions,Ge=X.placement,xt=X.offset,gt=X.getReferenceClientRect,hr=X.moveTransition,Ir=D()?_w(w).arrow:null,Po=gt?{getBoundingClientRect:gt,contextElement:gt.contextElement||E()}:r,Ro={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Yt){var En=Yt.state;if(D()){var x1=I(),zu=x1.box;["placement","reference-hidden","escaped"].forEach(function(Oo){Oo==="placement"?zu.setAttribute("data-placement",En.placement):En.attributes.popper["data-popper-"+Oo]?zu.setAttribute("data-"+Oo,""):zu.removeAttribute("data-"+Oo)}),En.attributes.popper={}}}},Va=[{name:"offset",options:{offset:xt}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!hr}},Ro];D()&&Ir&&Va.push({name:"arrow",options:{element:Ir,padding:3}}),Va.push.apply(Va,(Ae==null?void 0:Ae.modifiers)||[]),_.popperInstance=j7(Po,w,Object.assign({},Ae,{placement:Ge,onFirstUpdate:h,modifiers:Va}))}function xe(){_.popperInstance&&(_.popperInstance.destroy(),_.popperInstance=null)}function rt(){var X=_.props.appendTo,Ae,Ge=E();_.props.interactive&&X===Q5||X==="parent"?Ae=Ge.parentNode:Ae=e4(X,[Ge]),Ae.contains(w)||Ae.appendChild(w),_.state.isMounted=!0,Fe()}function at(){return kg(w.querySelectorAll("[data-tippy-root]"))}function ht(X){_.clearDelayTimeouts(),X&&O("onTrigger",[_,X]),U();var Ae=R(!0),Ge=A(),xt=Ge[0],gt=Ge[1];sa.isTouch&&xt==="hold"&>&&(Ae=gt),Ae?n=setTimeout(function(){_.show()},Ae):_.show()}function fr(X){if(_.clearDelayTimeouts(),O("onUntrigger",[_,X]),!_.state.isVisible){we();return}if(!(_.props.trigger.indexOf("mouseenter")>=0&&_.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(X.type)>=0&&o)){var Ae=R(!1);Ae?i=setTimeout(function(){_.state.isVisible&&_.hide()},Ae):a=requestAnimationFrame(function(){_.hide()})}}function yr(){_.state.isEnabled=!0}function en(){_.hide(),_.state.isEnabled=!1}function tn(){clearTimeout(n),clearTimeout(i),cancelAnimationFrame(a)}function pe(X){if(!_.state.isDestroyed){O("onBeforeUpdate",[_,X]),G();var Ae=_.props,Ge=Wk(r,Object.assign({},Ae,Vk(X),{ignoreAttributes:!0}));_.props=Ge,re(),Ae.interactiveDebounce!==Ge.interactiveDebounce&&(N(),p=zk(Q,Ge.interactiveDebounce)),Ae.triggerTarget&&!Ge.triggerTarget?bc(Ae.triggerTarget).forEach(function(xt){xt.removeAttribute("aria-expanded")}):Ge.triggerTarget&&r.removeAttribute("aria-expanded"),F(),P(),S&&S(Ae,Ge),_.popperInstance&&(Fe(),at().forEach(function(xt){requestAnimationFrame(xt._tippy.popperInstance.forceUpdate)})),O("onAfterUpdate",[_,X])}}function De(X){_.setProps({content:X})}function tt(){var X=_.state.isVisible,Ae=_.state.isDestroyed,Ge=!_.state.isEnabled,xt=sa.isTouch&&!_.props.touch,gt=W1(_.props.duration,0,Ei.duration);if(!(X||Ae||Ge||xt)&&!E().hasAttribute("disabled")&&(O("onShow",[_],!1),_.props.onShow(_)!==!1)){if(_.state.isVisible=!0,D()&&(w.style.visibility="visible"),P(),U(),_.state.isMounted||(w.style.transition="none"),D()){var hr=I(),Ir=hr.box,Po=hr.content;U1([Ir,Po],0)}h=function(){var Va;if(!(!_.state.isVisible||u)){if(u=!0,w.offsetHeight,w.style.transition=_.props.moveTransition,D()&&_.props.animation){var If=I(),Yt=If.box,En=If.content;U1([Yt,En],gt),$k([Yt,En],"visible")}j(),F(),Fk(q1,_),(Va=_.popperInstance)==null||Va.forceUpdate(),O("onMount",[_]),_.props.animation&&D()&&ge(gt,function(){_.state.isShown=!0,O("onShown",[_])})}},rt()}}function mt(){var X=!_.state.isVisible,Ae=_.state.isDestroyed,Ge=!_.state.isEnabled,xt=W1(_.props.duration,1,Ei.duration);if(!(X||Ae||Ge)&&(O("onHide",[_],!1),_.props.onHide(_)!==!1)){if(_.state.isVisible=!1,_.state.isShown=!1,u=!1,o=!1,D()&&(w.style.visibility="hidden"),N(),we(),P(!0),D()){var gt=I(),hr=gt.box,Ir=gt.content;_.props.animation&&(U1([hr,Ir],xt),$k([hr,Ir],"hidden"))}j(),F(),_.props.animation?D()&&Ye(xt,_.unmount):_.unmount()}}function or(X){L().addEventListener("mousemove",p),Fk(Qp,p),p(X)}function $r(){_.state.isVisible&&_.hide(),_.state.isMounted&&(xe(),at().forEach(function(X){X._tippy.unmount()}),w.parentNode&&w.parentNode.removeChild(w),q1=q1.filter(function(X){return X!==_}),_.state.isMounted=!1,O("onHidden",[_]))}function Io(){_.state.isDestroyed||(_.clearDelayTimeouts(),_.unmount(),G(),delete r._tippy,_.state.isDestroyed=!0,O("onDestroy",[_]))}}function df(r,e){e===void 0&&(e={});var t=Ei.plugins.concat(e.plugins||[]);cZ();var n=Object.assign({},e,{plugins:t}),i=aZ(r),a=i.reduce(function(o,s){var l=s&&_Z(s,n);return l&&o.push(l),o},[]);return S0(r)?a[0]:a}df.defaultProps=Ei;df.setDefaultProps=mZ;df.currentInput=sa;Object.assign({},C3,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}});df.setDefaultProps({render:n4});const i4=Ke({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var r,e;return so(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(e=(r=this.$slots).default)===null||e===void 0?void 0:e.call(r))}});class a4{constructor(e,{props:t={},editor:n}){this.editor=n,this.component=vt(e),this.el=document.createElement("div"),this.props=wu(t),this.renderedComponent=this.renderComponent()}get element(){return this.renderedComponent.el}get ref(){var e,t,n,i;return!((t=(e=this.renderedComponent.vNode)===null||e===void 0?void 0:e.component)===null||t===void 0)&&t.exposed?this.renderedComponent.vNode.component.exposed:(i=(n=this.renderedComponent.vNode)===null||n===void 0?void 0:n.component)===null||i===void 0?void 0:i.proxy}renderComponent(){let e=so(this.component,this.props);return this.editor.appContext&&(e.appContext=this.editor.appContext),typeof document<"u"&&this.el&&MM(e,this.el),{vNode:e,destroy:()=>{this.el&&MM(null,this.el),this.el=null,e=null},el:this.el?this.el.firstElementChild:null}}updateProps(e={}){Object.entries(e).forEach(([t,n])=>{this.props[t]=n}),this.renderComponent()}destroy(){this.renderedComponent.destroy()}}const xZ={editor:{type:Object,required:!0},node:{type:Object,required:!0},decorations:{type:Object,required:!0},selected:{type:Boolean,required:!0},extension:{type:Object,required:!0},getPos:{type:Function,required:!0},updateAttributes:{type:Function,required:!0},deleteNode:{type:Function,required:!0},view:{type:Object,required:!0},innerDecorations:{type:Object,required:!0},HTMLAttributes:{type:Object,required:!0}};class wZ extends qK{mount(){const e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extension,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(i={})=>this.updateAttributes(i),deleteNode:()=>this.deleteNode()},t=this.onDragStart.bind(this);this.decorationClasses=te(this.getDecorationClasses());const n=Ke({extends:{...this.component},props:Object.keys(e),template:this.component.template,setup:i=>{var a,o;return $x("onDragStart",t),$x("decorationClasses",this.decorationClasses),(o=(a=this.component).setup)===null||o===void 0?void 0:o.call(a,i,{expose:()=>{}})},__scopeId:this.component.__scopeId,__cssModules:this.component.__cssModules,__name:this.component.__name,__file:this.component.__file});this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.renderer=new a4(n,{editor:this.editor,props:e})}get dom(){if(!this.renderer.element||!this.renderer.element.hasAttribute("data-node-view-wrapper"))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.dom.querySelector("[data-node-view-content]")}handleSelectionUpdate(){const{from:e,to:t}=this.editor.state.selection,n=this.getPos();if(typeof n=="number")if(e<=n&&t>=n+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}}update(e,t,n){const i=a=>{this.decorationClasses.value=this.getDecorationClasses(),this.renderer.updateProps(a)};if(typeof this.options.update=="function"){const a=this.node,o=this.decorations,s=this.innerDecorations;return this.node=e,this.decorations=t,this.innerDecorations=n,this.options.update({oldNode:a,oldDecorations:o,newNode:e,newDecorations:t,oldInnerDecorations:s,innerDecorations:n,updateProps:()=>i({node:e,decorations:t,innerDecorations:n})})}return e.type!==this.node.type?!1:(e===this.node&&this.decorations===t&&this.innerDecorations===n||(this.node=e,this.decorations=t,this.innerDecorations=n,i({node:e,decorations:t,innerDecorations:n})),!0)}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element&&this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element&&this.renderer.element.classList.remove("ProseMirror-selectednode")}getDecorationClasses(){return this.decorations.map(e=>e.type.attrs.class).flat().join(" ")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate)}}function IT(r,e){return t=>{if(!t.editor.contentComponent)return{};const n=typeof r=="function"&&"__vccOpts"in r?r.__vccOpts:r;return new wZ(n,t,e)}}const SZ=/^\s*>\s$/,TZ=ar.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:r}){return["blockquote",Lt(this.options.HTMLAttributes,r),0]},addCommands(){return{setBlockquote:()=>({commands:r})=>r.wrapIn(this.name),toggleBlockquote:()=>({commands:r})=>r.toggleWrap(this.name),unsetBlockquote:()=>({commands:r})=>r.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Kc({find:SZ,type:this.type})]}}),CZ=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,AZ=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,MZ=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,kZ=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,DZ=Da.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:r=>r.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:r=>r.type.name===this.name},{style:"font-weight",getAttrs:r=>/^(bold(er)?|[5-9]\d{2,})$/.test(r)&&null}]},renderHTML({HTMLAttributes:r}){return["strong",Lt(this.options.HTMLAttributes,r),0]},addCommands(){return{setBold:()=>({commands:r})=>r.setMark(this.name),toggleBold:()=>({commands:r})=>r.toggleMark(this.name),unsetBold:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Xc({find:CZ,type:this.type}),Xc({find:MZ,type:this.type})]},addPasteRules(){return[fu({find:AZ,type:this.type}),fu({find:kZ,type:this.type})]}}),EZ="listItem",qk="textStyle",Xk=/^\s*([-+*])\s$/,LZ=ar.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:r}){return["ul",Lt(this.options.HTMLAttributes,r),0]},addCommands(){return{toggleBulletList:()=>({commands:r,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(EZ,this.editor.getAttributes(qk)).run():r.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let r=Kc({find:Xk,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(r=Kc({find:Xk,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(qk),editor:this.editor})),[r]}}),IZ=/(^|[^`])`([^`]+)`(?!`)/,PZ=/(^|[^`])`([^`]+)`(?!`)/g,RZ=Da.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:r}){return["code",Lt(this.options.HTMLAttributes,r),0]},addCommands(){return{setCode:()=>({commands:r})=>r.setMark(this.name),toggleCode:()=>({commands:r})=>r.toggleMark(this.name),unsetCode:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Xc({find:IZ,type:this.type})]},addPasteRules(){return[fu({find:PZ,type:this.type})]}}),OZ=/^```([a-z]+)?[\s\n]$/,jZ=/^~~~([a-z]+)?[\s\n]$/,o4=ar.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:r=>{var e;const{languageClassPrefix:t}=this.options,a=[...((e=r.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(o=>o.startsWith(t)).map(o=>o.replace(t,""))[0];return a||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:r,HTMLAttributes:e}){return["pre",Lt(this.options.HTMLAttributes,e),["code",{class:r.attrs.language?this.options.languageClassPrefix+r.attrs.language:null},0]]},addCommands(){return{setCodeBlock:r=>({commands:e})=>e.setNode(this.name,r),toggleCodeBlock:r=>({commands:e})=>e.toggleNode(this.name,"paragraph",r)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:r,$anchor:e}=this.editor.state.selection,t=e.pos===1;return!r||e.parent.type.name!==this.name?!1:t||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:r})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=r,{selection:t}=e,{$from:n,empty:i}=t;if(!i||n.parent.type!==this.type)return!1;const a=n.parentOffset===n.parent.nodeSize-2,o=n.parent.textContent.endsWith(` `);return!a||!o?!1:r.chain().command(({tr:s})=>(s.delete(n.pos-2,n.pos),!0)).exitCode().run()},ArrowDown:({editor:r})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=r,{selection:t,doc:n}=e,{$from:i,empty:a}=t;if(!a||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const s=i.after();return s===void 0?!1:n.nodeAt(s)?r.commands.command(({tr:u})=>(u.setSelection(qe.near(n.resolve(s))),!0)):r.commands.exitCode()}}},addInputRules(){return[Mg({find:OZ,type:this.type,getAttributes:r=>({language:r[1]})}),Mg({find:jZ,type:this.type,getAttributes:r=>({language:r[1]})})]},addProseMirrorPlugins(){return[new Ut({key:new jt("codeBlockVSCodeHandler"),props:{handlePaste:(r,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const t=e.clipboardData.getData("text/plain"),n=e.clipboardData.getData("vscode-editor-data"),i=n?JSON.parse(n):void 0,a=i==null?void 0:i.mode;if(!t||!a)return!1;const{tr:o,schema:s}=r.state,l=s.text(t.replace(/\r\n?/g,` `));return o.replaceSelectionWith(this.type.create({language:a},l)),o.selection.$from.parent.type!==this.type&&o.setSelection(We.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),r.dispatch(o),!0}}})]}}),NZ=ar.create({name:"doc",topNode:!0,content:"block+"});function BZ(r={}){return new Ut({view(e){return new zZ(e,r)}})}class zZ{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(n=t.width)!==null&&n!==void 0?n:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let a=o=>{this[i](o)};return e.dom.addEventListener(i,a),{name:i,handler:a}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,i=this.editorView.dom,a=i.getBoundingClientRect(),o=a.width/i.offsetWidth,s=a.height/i.offsetHeight;if(t){let f=e.nodeBefore,h=e.nodeAfter;if(f||h){let d=this.editorView.nodeDOM(this.cursorPos-(f?f.nodeSize:0));if(d){let p=d.getBoundingClientRect(),v=f?p.bottom:p.top;f&&h&&(v=(v+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let m=this.width/2*s;n={left:p.left,right:p.right,top:v-m,bottom:v+m}}}}if(!n){let f=this.editorView.coordsAtPos(this.cursorPos),h=this.width/2*o;n={left:f.left-h,right:f.left+h,top:f.top,bottom:f.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let u,c;if(!l||l==document.body&&getComputedStyle(l).position=="static")u=-pageXOffset,c=-pageYOffset;else{let f=l.getBoundingClientRect(),h=f.width/l.offsetWidth,d=f.height/l.offsetHeight;u=f.left-l.scrollLeft*h,c=f.top-l.scrollTop*d}this.element.style.left=(n.left-u)/o+"px",this.element.style.top=(n.top-c)/s+"px",this.element.style.width=(n.right-n.left)/o+"px",this.element.style.height=(n.bottom-n.top)/s+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=n&&n.type.spec.disableDropCursor,a=typeof i=="function"?i(this.editorView,t,e):i;if(t&&!a){let o=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let s=XN(this.editorView.state.doc,o,this.editorView.dragging.slice);s!=null&&(o=s)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}const FZ=Kt.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[BZ(this.options)]}});class Qt extends qe{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return Qt.valid(n)?new Qt(n):qe.near(n)}content(){return ye.empty}eq(e){return e instanceof Qt&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Qt(e.resolve(t.pos))}getBookmark(){return new PT(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!VZ(e)||!$Z(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&Qt.valid(e))return e;let i=e.pos,a=null;for(let o=e.depth;;o--){let s=e.node(o);if(t>0?e.indexAfter(o)0){a=s.child(t>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;i+=t;let l=e.doc.resolve(i);if(Qt.valid(l))return l}for(;;){let o=t>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!Ne.isSelectable(a)){e=e.doc.resolve(i+a.nodeSize*t),n=!1;continue e}break}a=o,i+=t;let s=e.doc.resolve(i);if(Qt.valid(s))return s}return null}}}Qt.prototype.visible=!1;Qt.findFrom=Qt.findGapCursorFrom;qe.jsonID("gapcursor",Qt);class PT{constructor(e){this.pos=e}map(e){return new PT(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Qt.valid(t)?new Qt(t):qe.near(t)}}function VZ(r){for(let e=r.depth;e>=0;e--){let t=r.index(e),n=r.node(e);if(t==0){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(t-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function $Z(r){for(let e=r.depth;e>=0;e--){let t=r.indexAfter(e),n=r.node(e);if(t==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let i=n.child(t);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function HZ(){return new Ut({props:{decorations:YZ,createSelectionBetween(r,e,t){return e.pos==t.pos&&Qt.valid(t)?new Qt(t):null},handleClick:WZ,handleKeyDown:GZ,handleDOMEvents:{beforeinput:UZ}}})}const GZ=k5({ArrowLeft:ev("horiz",-1),ArrowRight:ev("horiz",1),ArrowUp:ev("vert",-1),ArrowDown:ev("vert",1)});function ev(r,e){const t=r=="vert"?e>0?"down":"up":e>0?"right":"left";return function(n,i,a){let o=n.selection,s=e>0?o.$to:o.$from,l=o.empty;if(o instanceof We){if(!a.endOfTextblock(t)||s.depth==0)return!1;l=!1,s=n.doc.resolve(e>0?s.after():s.before())}let u=Qt.findGapCursorFrom(s,e,l);return u?(i&&i(n.tr.setSelection(new Qt(u))),!0):!1}}function WZ(r,e,t){if(!r||!r.editable)return!1;let n=r.state.doc.resolve(e);if(!Qt.valid(n))return!1;let i=r.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&Ne.isSelectable(r.state.doc.nodeAt(i.inside))?!1:(r.dispatch(r.state.tr.setSelection(new Qt(n))),!0)}function UZ(r,e){if(e.inputType!="insertCompositionText"||!(r.state.selection instanceof Qt))return!1;let{$from:t}=r.state.selection,n=t.parent.contentMatchAt(t.index()).findWrapping(r.state.schema.nodes.text);if(!n)return!1;let i=ne.empty;for(let o=n.length-1;o>=0;o--)i=ne.from(n[o].createAndFill(null,i));let a=r.state.tr.replace(t.pos,t.pos,new ye(i,0,0));return a.setSelection(We.near(a.doc.resolve(t.pos+1))),r.dispatch(a),!1}function YZ(r){if(!(r.selection instanceof Qt))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Gt.create(r.doc,[Xr.widget(r.selection.head,e,{key:"gapcursor"})])}const qZ=Kt.create({name:"gapCursor",addProseMirrorPlugins(){return[HZ()]},extendNodeSchema(r){var e;const t={name:r.name,options:r.options,storage:r.storage};return{allowGapCursor:(e=pr(jr(r,"allowGapCursor",t)))!==null&&e!==void 0?e:null}}}),XZ=ar.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:r}){return["br",Lt(this.options.HTMLAttributes,r)]},renderText(){return` `},addCommands(){return{setHardBreak:()=>({commands:r,chain:e,state:t,editor:n})=>r.first([()=>r.exitCode(),()=>r.command(()=>{const{selection:i,storedMarks:a}=t;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:s}=n.extensionManager,l=a||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:c})=>{if(c&&l&&o){const f=l.filter(h=>s.includes(h.type.name));u.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),s4=ar.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(r=>({tag:`h${r}`,attrs:{level:r}}))},renderHTML({node:r,HTMLAttributes:e}){return[`h${this.options.levels.includes(r.attrs.level)?r.attrs.level:this.options.levels[0]}`,Lt(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:r=>({commands:e})=>this.options.levels.includes(r.level)?e.setNode(this.name,r):!1,toggleHeading:r=>({commands:e})=>this.options.levels.includes(r.level)?e.toggleNode(this.name,"paragraph",r):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((r,e)=>({...r,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(r=>Mg({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${r}})\\s$`),type:this.type,getAttributes:{level:r}}))}});var Dg=200,Er=function(){};Er.prototype.append=function(e){return e.length?(e=Er.from(e),!this.length&&e||e.length=t?Er.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};Er.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};Er.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)};Er.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var i=[];return this.forEach(function(a,o){return i.push(e(a,o))},t,n),i};Er.from=function(e){return e instanceof Er?e:e&&e.length?new l4(e):Er.empty};var l4=function(r){function e(n){r.call(this),this.values=n}r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,a){return i==0&&a==this.length?this:new e(this.values.slice(i,a))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,a,o,s){for(var l=a;l=o;l--)if(i(this.values[l],s+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Dg)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Dg)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(Er);Er.empty=new l4([]);var KZ=function(r){function e(t,n){r.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return ns&&this.right.forEachInner(n,Math.max(i-s,0),Math.min(this.length,a)-s,o+s)===!1)return!1},e.prototype.forEachInvertedInner=function(n,i,a,o){var s=this.left.length;if(i>s&&this.right.forEachInvertedInner(n,i-s,Math.max(a,s)-s,o+s)===!1||a=a?this.right.slice(n-a,i-a):this.left.slice(n,a).append(this.right.slice(0,i-a))},e.prototype.leafAppend=function(n){var i=this.right.leafAppend(n);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(n){var i=this.left.leafPrepend(n);if(i)return new e(i,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e}(Er);const ZZ=500;class ki{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let i,a;t&&(i=this.remapping(n,this.items.length),a=i.maps.length);let o=e.tr,s,l,u=[],c=[];return this.items.forEach((f,h)=>{if(!f.step){i||(i=this.remapping(n,h+1),a=i.maps.length),a--,c.push(f);return}if(i){c.push(new na(f.map));let d=f.step.map(i.slice(a)),p;d&&o.maybeStep(d).doc&&(p=o.mapping.maps[o.mapping.maps.length-1],u.push(new na(p,void 0,void 0,u.length+c.length))),a--,p&&i.appendMap(p,a)}else o.maybeStep(f.step);if(f.selection)return s=i?f.selection.map(i.slice(a)):f.selection,l=new ki(this.items.slice(0,n).append(c.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:s}}addTransform(e,t,n,i){let a=[],o=this.eventCount,s=this.items,l=!i&&s.length?s.get(s.length-1):null;for(let c=0;cQZ&&(s=JZ(s,u),o-=u),new ki(s.append(a),o)}remapping(e,t){let n=new Td;return this.items.forEach((i,a)=>{let o=i.mirrorOffset!=null&&a-i.mirrorOffset>=e?n.maps.length-i.mirrorOffset:void 0;n.appendMap(i.map,o)},e,t),n}addMaps(e){return this.eventCount==0?this:new ki(this.items.append(e.map(t=>new na(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],i=Math.max(0,this.items.length-t),a=e.mapping,o=e.steps.length,s=this.eventCount;this.items.forEach(h=>{h.selection&&s--},i);let l=t;this.items.forEach(h=>{let d=a.getMirror(--l);if(d==null)return;o=Math.min(o,d);let p=a.maps[d];if(h.step){let v=e.steps[d].invert(e.docs[d]),m=h.selection&&h.selection.map(a.slice(l+1,d));m&&s++,n.push(new na(p,v,m))}else n.push(new na(p))},i);let u=[];for(let h=t;hZZ&&(f=f.compress(this.items.length-n.length)),f}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,i=[],a=0;return this.items.forEach((o,s)=>{if(s>=e)i.push(o),o.selection&&a++;else if(o.step){let l=o.step.map(t.slice(n)),u=l&&l.getMap();if(n--,u&&t.appendMap(u,n),l){let c=o.selection&&o.selection.map(t.slice(n));c&&a++;let f=new na(u.invert(),l,c),h,d=i.length-1;(h=i.length&&i[d].merge(f))?i[d]=h:i.push(f)}}else o.map&&n--},this.items.length,0),new ki(Er.from(i.reverse()),a)}}ki.empty=new ki(Er.empty,0);function JZ(r,e){let t;return r.forEach((n,i)=>{if(n.selection&&e--==0)return t=i,!1}),r.slice(t)}class na{constructor(e,t,n,i){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new na(t.getMap().invert(),t,this.selection)}}}class Ko{constructor(e,t,n,i,a){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=i,this.prevComposition=a}}const QZ=20;function eJ(r,e,t,n){let i=t.getMeta(ql),a;if(i)return i.historyState;t.getMeta(nJ)&&(r=new Ko(r.done,r.undone,null,0,-1));let o=t.getMeta("appendedTransaction");if(t.steps.length==0)return r;if(o&&o.getMeta(ql))return o.getMeta(ql).redo?new Ko(r.done.addTransform(t,void 0,n,Mm(e)),r.undone,Kk(t.mapping.maps),r.prevTime,r.prevComposition):new Ko(r.done,r.undone.addTransform(t,void 0,n,Mm(e)),null,r.prevTime,r.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let s=t.getMeta("composition"),l=r.prevTime==0||!o&&r.prevComposition!=s&&(r.prevTime<(t.time||0)-n.newGroupDelay||!tJ(t,r.prevRanges)),u=o?X1(r.prevRanges,t.mapping):Kk(t.mapping.maps);return new Ko(r.done.addTransform(t,l?e.selection.getBookmark():void 0,n,Mm(e)),ki.empty,u,t.time,s??r.prevComposition)}else return(a=t.getMeta("rebased"))?new Ko(r.done.rebased(t,a),r.undone.rebased(t,a),X1(r.prevRanges,t.mapping),r.prevTime,r.prevComposition):new Ko(r.done.addMaps(t.mapping.maps),r.undone.addMaps(t.mapping.maps),X1(r.prevRanges,t.mapping),r.prevTime,r.prevComposition)}function tJ(r,e){if(!e)return!1;if(!r.docChanged)return!0;let t=!1;return r.mapping.maps[0].forEach((n,i)=>{for(let a=0;a=e[a]&&(t=!0)}),t}function Kk(r){let e=[];for(let t=r.length-1;t>=0&&e.length==0;t--)r[t].forEach((n,i,a,o)=>e.push(a,o));return e}function X1(r,e){if(!r)return null;let t=[];for(let n=0;n{let i=ql.getState(t);if(!i||(r?i.undone:i.done).eventCount==0)return!1;if(n){let a=rJ(i,t,r);a&&n(e?a.scrollIntoView():a)}return!0}}const c4=u4(!1,!0),f4=u4(!0,!0),aJ=Kt.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:r,dispatch:e})=>c4(r,e),redo:()=>({state:r,dispatch:e})=>f4(r,e)}},addProseMirrorPlugins(){return[iJ(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),oJ=ar.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:r}){return["hr",Lt(this.options.HTMLAttributes,r)]},addCommands(){return{setHorizontalRule:()=>({chain:r,state:e})=>{if(!XK(e,e.schema.nodes[this.name]))return!1;const{selection:t}=e,{$from:n,$to:i}=t,a=r();return n.parentOffset===0?a.insertContentAt({from:Math.max(n.pos-1,0),to:i.pos},{type:this.name}):AK(t)?a.insertContentAt(i.pos,{type:this.name}):a.insertContent({type:this.name}),a.command(({tr:o,dispatch:s})=>{var l;if(s){const{$to:u}=o.selection,c=u.end();if(u.nodeAfter)u.nodeAfter.isTextblock?o.setSelection(We.create(o.doc,u.pos+1)):u.nodeAfter.isBlock?o.setSelection(Ne.create(o.doc,u.pos)):o.setSelection(We.create(o.doc,u.pos));else{const f=(l=u.parent.type.contentMatch.defaultType)===null||l===void 0?void 0:l.create();f&&(o.insert(c,f),o.setSelection(We.create(o.doc,c+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[X5({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),sJ=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,lJ=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,uJ=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,cJ=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,fJ=Da.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:r=>r.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:r=>r.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:r}){return["em",Lt(this.options.HTMLAttributes,r),0]},addCommands(){return{setItalic:()=>({commands:r})=>r.setMark(this.name),toggleItalic:()=>({commands:r})=>r.toggleMark(this.name),unsetItalic:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Xc({find:sJ,type:this.type}),Xc({find:uJ,type:this.type})]},addPasteRules(){return[fu({find:lJ,type:this.type}),fu({find:cJ,type:this.type})]}}),hJ=ar.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:r}){return["li",Lt(this.options.HTMLAttributes,r),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),dJ="listItem",Jk="textStyle",Qk=/^(\d+)\.\s$/,pJ=ar.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:r=>r.hasAttribute("start")?parseInt(r.getAttribute("start")||"",10):1},type:{default:null,parseHTML:r=>r.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:r}){const{start:e,...t}=r;return e===1?["ol",Lt(this.options.HTMLAttributes,t),0]:["ol",Lt(this.options.HTMLAttributes,r),0]},addCommands(){return{toggleOrderedList:()=>({commands:r,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(dJ,this.editor.getAttributes(Jk)).run():r.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let r=Kc({find:Qk,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(r=Kc({find:Qk,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Jk)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[r]}}),vJ=ar.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:r}){return["p",Lt(this.options.HTMLAttributes,r),0]},addCommands(){return{setParagraph:()=>({commands:r})=>r.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),mJ=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,gJ=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,yJ=Da.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:r=>r.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:r}){return["s",Lt(this.options.HTMLAttributes,r),0]},addCommands(){return{setStrike:()=>({commands:r})=>r.setMark(this.name),toggleStrike:()=>({commands:r})=>r.toggleMark(this.name),unsetStrike:()=>({commands:r})=>r.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Xc({find:mJ,type:this.type})]},addPasteRules(){return[fu({find:gJ,type:this.type})]}}),bJ=ar.create({name:"text",group:"inline"});Kt.create({name:"starterKit",addExtensions(){const r=[];return this.options.bold!==!1&&r.push(DZ.configure(this.options.bold)),this.options.blockquote!==!1&&r.push(TZ.configure(this.options.blockquote)),this.options.bulletList!==!1&&r.push(LZ.configure(this.options.bulletList)),this.options.code!==!1&&r.push(RZ.configure(this.options.code)),this.options.codeBlock!==!1&&r.push(o4.configure(this.options.codeBlock)),this.options.document!==!1&&r.push(NZ.configure(this.options.document)),this.options.dropcursor!==!1&&r.push(FZ.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&r.push(qZ.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&r.push(XZ.configure(this.options.hardBreak)),this.options.heading!==!1&&r.push(s4.configure(this.options.heading)),this.options.history!==!1&&r.push(aJ.configure(this.options.history)),this.options.horizontalRule!==!1&&r.push(oJ.configure(this.options.horizontalRule)),this.options.italic!==!1&&r.push(fJ.configure(this.options.italic)),this.options.listItem!==!1&&r.push(hJ.configure(this.options.listItem)),this.options.orderedList!==!1&&r.push(pJ.configure(this.options.orderedList)),this.options.paragraph!==!1&&r.push(vJ.configure(this.options.paragraph)),this.options.strike!==!1&&r.push(yJ.configure(this.options.strike)),this.options.text!==!1&&r.push(bJ.configure(this.options.text)),r}});Kt.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Ut({key:new jt("placeholder"),props:{decorations:({doc:r,selection:e})=>{const t=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:n}=e,i=[];if(!t)return null;const a=this.editor.isEmpty;return r.descendants((o,s)=>{const l=n>=s&&n<=s+o.nodeSize,u=!o.isLeaf&&ET(o);if((l||!this.options.showOnlyCurrent)&&u){const c=[this.options.emptyNodeClass];a&&c.push(this.options.emptyEditorClass);const f=Xr.node(s,s+o.nodeSize,{class:c.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:o,pos:s,hasAnchor:l}):this.options.placeholder});i.push(f)}return this.options.includeChildren}),Gt.create(r,i)}}})]}});Kt.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:null}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:r=>{const e=r.style.textAlign;return this.options.alignments.includes(e)?e:this.options.defaultAlignment},renderHTML:r=>r.textAlign?{style:`text-align: ${r.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:r=>({commands:e})=>this.options.alignments.includes(r)?this.options.types.map(t=>e.updateAttributes(t,{textAlign:r})).every(t=>t):!1,unsetTextAlign:()=>({commands:r})=>this.options.types.map(e=>r.resetAttributes(e,"textAlign")).every(e=>e),toggleTextAlign:r=>({editor:e,commands:t})=>this.options.alignments.includes(r)?e.isActive({textAlign:r})?t.unsetTextAlign():t.setTextAlign(r):!1}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}});var xw,ww;if(typeof WeakMap<"u"){let r=new WeakMap;xw=e=>r.get(e),ww=(e,t)=>(r.set(e,t),t)}else{const r=[];let t=0;xw=n=>{for(let i=0;i(t==10&&(t=0),r[t++]=n,r[t++]=i)}var er=class{constructor(r,e,t,n){this.width=r,this.height=e,this.map=t,this.problems=n}findCell(r){for(let e=0;e=t){(a||(a=[])).push({type:"overlong_rowspan",pos:c,n:g-b});break}const _=i+b*e;for(let x=0;xn&&(a+=u.attrs.colspan)}}for(let o=0;o1&&(t=!0)}e==-1?e=a:e!=a&&(e=Math.max(e,a))}return e}function wJ(r,e,t){r.problems||(r.problems=[]);const n={};for(let i=0;i0;e--)if(r.node(e).type.spec.tableRole=="row")return r.node(0).resolve(r.before(e+1));return null}function TJ(r){for(let e=r.depth;e>0;e--){const t=r.node(e).type.spec.tableRole;if(t==="cell"||t==="header_cell")return r.node(e)}return null}function $i(r){const e=r.selection.$head;for(let t=e.depth;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return!0;return!1}function T0(r){const e=r.selection;if("$anchorCell"in e&&e.$anchorCell)return e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell;if("node"in e&&e.node&&e.node.type.spec.tableRole=="cell")return e.$anchor;const t=pf(e.$head)||CJ(e.$head);if(t)return t;throw new RangeError(`No cell found around position ${e.head}`)}function CJ(r){for(let e=r.nodeAfter,t=r.pos;e;e=e.firstChild,t++){const n=e.type.spec.tableRole;if(n=="cell"||n=="header_cell")return r.doc.resolve(t)}for(let e=r.nodeBefore,t=r.pos;e;e=e.lastChild,t--){const n=e.type.spec.tableRole;if(n=="cell"||n=="header_cell")return r.doc.resolve(t-e.nodeSize)}}function Sw(r){return r.parent.type.spec.tableRole=="row"&&!!r.nodeAfter}function AJ(r){return r.node(0).resolve(r.pos+r.nodeAfter.nodeSize)}function RT(r,e){return r.depth==e.depth&&r.pos>=e.start(-1)&&r.pos<=e.end(-1)}function h4(r,e,t){const n=r.node(-1),i=er.get(n),a=r.start(-1),o=i.nextCell(r.pos-a,e,t);return o==null?null:r.node(0).resolve(a+o)}function hu(r,e,t=1){const n={...r,colspan:r.colspan-t};return n.colwidth&&(n.colwidth=n.colwidth.slice(),n.colwidth.splice(e,t),n.colwidth.some(i=>i>0)||(n.colwidth=null)),n}function d4(r,e,t=1){const n={...r,colspan:r.colspan+t};if(n.colwidth){n.colwidth=n.colwidth.slice();for(let i=0;ic!=t.pos-a);l.unshift(t.pos-a);const u=l.map(c=>{const f=n.nodeAt(c);if(!f)throw RangeError(`No cell with offset ${c} found`);const h=a+c+1;return new t5(s.resolve(h),s.resolve(h+f.content.size))});super(u[0].$from,u[0].$to,u),this.$anchorCell=e,this.$headCell=t}map(e,t){const n=e.resolve(t.map(this.$anchorCell.pos)),i=e.resolve(t.map(this.$headCell.pos));if(Sw(n)&&Sw(i)&&RT(n,i)){const a=this.$anchorCell.node(-1)!=n.node(-1);return a&&this.isRowSelection()?Ka.rowSelection(n,i):a&&this.isColSelection()?Ka.colSelection(n,i):new Ka(n,i)}return We.between(n,i)}content(){const e=this.$anchorCell.node(-1),t=er.get(e),n=this.$anchorCell.start(-1),i=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),a={},o=[];for(let l=i.top;l0||m>0){let g=p.attrs;if(v>0&&(g=hu(g,0,v)),m>0&&(g=hu(g,g.colspan-m,m)),d.lefti.bottom){const g={...p.attrs,rowspan:Math.min(d.bottom,i.bottom)-Math.max(d.top,i.top)};d.top0)return!1;const n=e+this.$anchorCell.nodeAfter.attrs.rowspan,i=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,i)==this.$headCell.node(-1).childCount}static colSelection(e,t=e){const n=e.node(-1),i=er.get(n),a=e.start(-1),o=i.findCell(e.pos-a),s=i.findCell(t.pos-a),l=e.node(0);return o.top<=s.top?(o.top>0&&(e=l.resolve(a+i.map[o.left])),s.bottom0&&(t=l.resolve(a+i.map[s.left])),o.bottom0)return!1;const o=i+this.$anchorCell.nodeAfter.attrs.colspan,s=a+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,s)==t.width}eq(e){return e instanceof Ka&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,t=e){const n=e.node(-1),i=er.get(n),a=e.start(-1),o=i.findCell(e.pos-a),s=i.findCell(t.pos-a),l=e.node(0);return o.left<=s.left?(o.left>0&&(e=l.resolve(a+i.map[o.top*i.width])),s.right0&&(t=l.resolve(a+i.map[s.top*i.width])),o.right{e.push(Xr.node(n,n+t.nodeSize,{class:"selectedCell"}))}),Gt.create(r.doc,e)}function EJ({$from:r,$to:e}){if(r.pos==e.pos||r.pos=0&&!(r.after(i+1)=0&&!(e.before(a+1)>e.start(a));a--,n--);return t==n&&/row|table/.test(r.node(i).type.spec.tableRole)}function LJ({$from:r,$to:e}){let t,n;for(let i=r.depth;i>0;i--){const a=r.node(i);if(a.type.spec.tableRole==="cell"||a.type.spec.tableRole==="header_cell"){t=a;break}}for(let i=e.depth;i>0;i--){const a=e.node(i);if(a.type.spec.tableRole==="cell"||a.type.spec.tableRole==="header_cell"){n=a;break}}return t!==n&&e.parentOffset===0}function IJ(r,e,t){const n=(e||r).selection,i=(e||r).doc;let a,o;if(n instanceof Ne&&(o=n.node.type.spec.tableRole)){if(o=="cell"||o=="header_cell")a=Bt.create(i,n.from);else if(o=="row"){const s=i.resolve(n.from+1);a=Bt.rowSelection(s,s)}else if(!t){const s=er.get(n.node),l=n.from+1,u=l+s.map[s.width*s.height-1];a=Bt.create(i,l+1,u)}}else n instanceof We&&EJ(n)?a=We.create(i,n.from):n instanceof We&&LJ(n)&&(a=We.create(i,n.$from.start(),n.$from.end()));return a&&(e||(e=r.tr)).setSelection(a),e}var PJ=new jt("fix-tables");function v4(r,e,t,n){const i=r.childCount,a=e.childCount;e:for(let o=0,s=0;o{i.type.spec.tableRole=="table"&&(t=RJ(r,i,a,t))};return e?e.doc!=r.doc&&v4(e.doc,r.doc,0,n):r.doc.descendants(n),t}function RJ(r,e,t,n){const i=er.get(e);if(!i.problems)return n;n||(n=r.tr);const a=[];for(let l=0;l0){let d="cell";c.firstChild&&(d=c.firstChild.type.spec.tableRole);const p=[];for(let m=0;m0?-1:0;MJ(e,n,i+a)&&(a=i==0||i==e.width?null:0);for(let o=0;o0&&i0&&e.map[s-1]==l||i0?-1:0;zJ(e,n,i+l)&&(l=i==0||i==e.height?null:0);for(let u=0,c=e.width*i;u0&&i0&&f==e.map[c-e.width]){const h=t.nodeAt(f).attrs;r.setNodeMarkup(r.mapping.slice(s).map(f+n),null,{...h,rowspan:h.rowspan-1}),u+=h.colspan-1}else if(i0&&t[a]==t[a-1]||n.right0&&t[i]==t[i-r]||n.bottomt[n.type.spec.tableRole])(r,e)}function WJ(r){return(e,t)=>{var n;const i=e.selection;let a,o;if(i instanceof Bt){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;a=i.$anchorCell.nodeAfter,o=i.$anchorCell.pos}else{if(a=TJ(i.$from),!a)return!1;o=(n=pf(i.$from))==null?void 0:n.pos}if(a==null||o==null||a.attrs.colspan==1&&a.attrs.rowspan==1)return!1;if(t){let s=a.attrs;const l=[],u=s.colwidth;s.rowspan>1&&(s={...s,rowspan:1}),s.colspan>1&&(s={...s,colspan:1});const c=Na(e),f=e.tr;for(let d=0;d{o.attrs[r]!==e&&a.setNodeMarkup(s,null,{...o.attrs,[r]:e})}):a.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[r]:e}),n(a)}return!0}}function YJ(r){return function(e,t){if(!$i(e))return!1;if(t){const n=Kr(e.schema),i=Na(e),a=e.tr,o=i.map.cellsInRect(r=="column"?{left:i.left,top:0,right:i.right,bottom:i.map.height}:r=="row"?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=o.map(l=>i.table.nodeAt(l));for(let l=0;l{const p=d+a.tableStart,v=o.doc.nodeAt(p);v&&o.setNodeMarkup(p,h,v.attrs)}),n(o)}return!0}}Dd("row",{useDeprecatedLogic:!0});Dd("column",{useDeprecatedLogic:!0});var qJ=Dd("cell",{useDeprecatedLogic:!0});function XJ(r,e){if(e<0){const t=r.nodeBefore;if(t)return r.pos-t.nodeSize;for(let n=r.index(-1)-1,i=r.before();n>=0;n--){const a=r.node(-1).child(n),o=a.lastChild;if(o)return i-1-o.nodeSize;i-=a.nodeSize}}else{if(r.index()0;n--)if(t.node(n).type.spec.tableRole=="table")return e&&e(r.tr.delete(t.before(n),t.after(n)).scrollIntoView()),!0;return!1}function tv(r,e){const t=r.selection;if(!(t instanceof Bt))return!1;if(e){const n=r.tr,i=Kr(r.schema).cell.createAndFill().content;t.forEachCell((a,o)=>{a.content.eq(i)||n.replace(n.mapping.map(o+1),n.mapping.map(o+a.nodeSize-1),new ye(i,0,0))}),n.docChanged&&e(n)}return!0}function ZJ(r){if(!r.size)return null;let{content:e,openStart:t,openEnd:n}=r;for(;e.childCount==1&&(t>0&&n>0||e.child(0).type.spec.tableRole=="table");)t--,n--,e=e.child(0).content;const i=e.child(0),a=i.type.spec.tableRole,o=i.type.schema,s=[];if(a=="row")for(let l=0;l=0;o--){const{rowspan:s,colspan:l}=a.child(o).attrs;for(let u=i;u=e.length&&e.push(ne.empty),t[i]n&&(h=h.type.createChecked(hu(h.attrs,h.attrs.colspan,c+h.attrs.colspan-n),h.content)),u.push(h),c+=h.attrs.colspan;for(let d=1;di&&(f=f.type.create({...f.attrs,rowspan:Math.max(1,i-f.attrs.rowspan)},f.content)),l.push(f)}a.push(ne.from(l))}t=a,e=i}return{width:r,height:e,rows:t}}function eQ(r,e,t,n,i,a,o){const s=r.doc.type.schema,l=Kr(s);let u,c;if(i>e.width)for(let f=0,h=0;fe.height){const f=[];for(let p=0,v=(e.height-1)*e.width;p=e.width?!1:t.nodeAt(e.map[v+p]).type==l.header_cell;f.push(m?c||(c=l.header_cell.createAndFill()):u||(u=l.cell.createAndFill()))}const h=l.row.create(null,ne.from(f)),d=[];for(let p=e.height;p{if(!i)return!1;const a=t.selection;if(a instanceof Bt)return km(t,n,qe.near(a.$headCell,e));if(r!="horiz"&&!a.empty)return!1;const o=b4(i,r,e);if(o==null)return!1;if(r=="horiz")return km(t,n,qe.near(t.doc.resolve(a.head+e),e));{const s=t.doc.resolve(o),l=h4(s,r,e);let u;return l?u=qe.near(l,1):e<0?u=qe.near(t.doc.resolve(s.before(-1)),-1):u=qe.near(t.doc.resolve(s.after(-1)),1),km(t,n,u)}}}function nv(r,e){return(t,n,i)=>{if(!i)return!1;const a=t.selection;let o;if(a instanceof Bt)o=a;else{const l=b4(i,r,e);if(l==null)return!1;o=new Bt(t.doc.resolve(l))}const s=h4(o.$headCell,r,e);return s?km(t,n,new Bt(o.$anchorCell,s)):!1}}function rQ(r,e){const t=r.state.doc,n=pf(t.resolve(e));return n?(r.dispatch(r.state.tr.setSelection(new Bt(n))),!0):!1}function nQ(r,e,t){if(!$i(r.state))return!1;let n=ZJ(t);const i=r.state.selection;if(i instanceof Bt){n||(n={width:1,height:1,rows:[ne.from(Tw(Kr(r.state.schema).cell,t))]});const a=i.$anchorCell.node(-1),o=i.$anchorCell.start(-1),s=er.get(a).rectBetween(i.$anchorCell.pos-o,i.$headCell.pos-o);return n=QJ(n,s.right-s.left,s.bottom-s.top),sD(r.state,r.dispatch,o,s,n),!0}else if(n){const a=T0(r.state),o=a.start(-1);return sD(r.state,r.dispatch,o,er.get(a.node(-1)).findCell(a.pos-o),n),!0}else return!1}function iQ(r,e){var t;if(e.ctrlKey||e.metaKey)return;const n=lD(r,e.target);let i;if(e.shiftKey&&r.state.selection instanceof Bt)a(r.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&n&&(i=pf(r.state.selection.$anchor))!=null&&((t=Z1(r,e))==null?void 0:t.pos)!=i.pos)a(i,e),e.preventDefault();else if(!n)return;function a(l,u){let c=Z1(r,u);const f=es.getState(r.state)==null;if(!c||!RT(l,c))if(f)c=l;else return;const h=new Bt(l,c);if(f||!r.state.selection.eq(h)){const d=r.state.tr.setSelection(h);f&&d.setMeta(es,l.pos),r.dispatch(d)}}function o(){r.root.removeEventListener("mouseup",o),r.root.removeEventListener("dragstart",o),r.root.removeEventListener("mousemove",s),es.getState(r.state)!=null&&r.dispatch(r.state.tr.setMeta(es,-1))}function s(l){const u=l,c=es.getState(r.state);let f;if(c!=null)f=r.state.doc.resolve(c);else if(lD(r,u.target)!=n&&(f=Z1(r,e),!f))return o();f&&a(f,u)}r.root.addEventListener("mouseup",o),r.root.addEventListener("dragstart",o),r.root.addEventListener("mousemove",s)}function b4(r,e,t){if(!(r.state.selection instanceof We))return null;const{$head:n}=r.state.selection;for(let i=n.depth-1;i>=0;i--){const a=n.node(i);if((t<0?n.index(i):n.indexAfter(i))!=(t<0?0:a.childCount))return null;if(a.type.spec.tableRole=="cell"||a.type.spec.tableRole=="header_cell"){const s=n.before(i),l=e=="vert"?t>0?"down":"up":t>0?"right":"left";return r.endOfTextblock(l)?s:null}}return null}function lD(r,e){for(;e&&e!=r.dom;e=e.parentNode)if(e.nodeName=="TD"||e.nodeName=="TH")return e;return null}function Z1(r,e){const t=r.posAtCoords({left:e.clientX,top:e.clientY});return t&&t?pf(r.state.doc.resolve(t.pos)):null}var aQ=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${t}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Cw(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,Cw(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function Cw(r,e,t,n,i,a){var o;let s=0,l=!0,u=e.firstChild;const c=r.firstChild;if(c){for(let f=0,h=0;fnew n(h,t,d)),new sQ(-1,!1)},apply(o,s){return s.apply(o)}},props:{attributes:o=>{const s=Rn.getState(o);return s&&s.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(o,s)=>{lQ(o,s,r,i)},mouseleave:o=>{uQ(o)},mousedown:(o,s)=>{cQ(o,s,e,t)}},decorations:o=>{const s=Rn.getState(o);if(s&&s.activeHandle>-1)return vQ(o,s.activeHandle)},nodeViews:{}}});return a}var sQ=class Dm{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(e){const t=this,n=e.getMeta(Rn);if(n&&n.setHandle!=null)return new Dm(n.setHandle,!1);if(n&&n.setDragging!==void 0)return new Dm(t.activeHandle,n.setDragging);if(t.activeHandle>-1&&e.docChanged){let i=e.mapping.map(t.activeHandle,-1);return Sw(e.doc.resolve(i))||(i=-1),new Dm(i,t.dragging)}return t}};function lQ(r,e,t,n){if(!r.editable)return;const i=Rn.getState(r.state);if(i&&!i.dragging){const a=hQ(e.target);let o=-1;if(a){const{left:s,right:l}=a.getBoundingClientRect();e.clientX-s<=t?o=uD(r,e,"left",t):l-e.clientX<=t&&(o=uD(r,e,"right",t))}if(o!=i.activeHandle){if(!n&&o!==-1){const s=r.state.doc.resolve(o),l=s.node(-1),u=er.get(l),c=s.start(-1);if(u.colCount(s.pos-c)+s.nodeAfter.attrs.colspan-1==u.width-1)return}_4(r,o)}}}function uQ(r){if(!r.editable)return;const e=Rn.getState(r.state);e&&e.activeHandle>-1&&!e.dragging&&_4(r,-1)}function cQ(r,e,t,n){var i;if(!r.editable)return!1;const a=(i=r.dom.ownerDocument.defaultView)!=null?i:window,o=Rn.getState(r.state);if(!o||o.activeHandle==-1||o.dragging)return!1;const s=r.state.doc.nodeAt(o.activeHandle),l=fQ(r,o.activeHandle,s.attrs);r.dispatch(r.state.tr.setMeta(Rn,{setDragging:{startX:e.clientX,startWidth:l}}));function u(f){a.removeEventListener("mouseup",u),a.removeEventListener("mousemove",c);const h=Rn.getState(r.state);h!=null&&h.dragging&&(dQ(r,h.activeHandle,cD(h.dragging,f,t)),r.dispatch(r.state.tr.setMeta(Rn,{setDragging:null})))}function c(f){if(!f.which)return u(f);const h=Rn.getState(r.state);if(h&&h.dragging){const d=cD(h.dragging,f,t);fD(r,h.activeHandle,d,n)}}return fD(r,o.activeHandle,l,n),a.addEventListener("mouseup",u),a.addEventListener("mousemove",c),e.preventDefault(),!0}function fQ(r,e,{colspan:t,colwidth:n}){const i=n&&n[n.length-1];if(i)return i;const a=r.domAtPos(e);let s=a.node.childNodes[a.offset].offsetWidth,l=t;if(n)for(let u=0;u{const n=r.nodes[t];n.spec.tableRole&&(e[n.spec.tableRole]=n)}),r.cached.tableNodeTypes=e,e}function _Q(r,e,t,n,i){const a=bQ(r),o=[],s=[];for(let u=0;u{const{selection:e}=r.state;if(!xQ(e))return!1;let t=0;const n=q5(e.ranges[0].$from,a=>a.type.name==="table");return n==null||n.node.descendants(a=>{if(a.type.name==="table")return!1;["tableCell","tableHeader"].includes(a.type.name)&&(t+=1)}),t===e.ranges.length?(r.commands.deleteTable(),!0):!1};ar.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,View:gQ,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:r,HTMLAttributes:e}){const{colgroup:t,tableWidth:n,tableMinWidth:i}=yQ(r,this.options.cellMinWidth);return["table",Lt(this.options.HTMLAttributes,e,{style:n?`width: ${n}`:`min-width: ${i}`}),t,["tbody",0]]},addCommands(){return{insertTable:({rows:r=3,cols:e=3,withHeaderRow:t=!0}={})=>({tr:n,dispatch:i,editor:a})=>{const o=_Q(a.schema,r,e,t);if(i){const s=n.selection.from+1;n.replaceSelectionWith(o).scrollIntoView().setSelection(We.near(n.doc.resolve(s)))}return!0},addColumnBefore:()=>({state:r,dispatch:e})=>OJ(r,e),addColumnAfter:()=>({state:r,dispatch:e})=>jJ(r,e),deleteColumn:()=>({state:r,dispatch:e})=>BJ(r,e),addRowBefore:()=>({state:r,dispatch:e})=>FJ(r,e),addRowAfter:()=>({state:r,dispatch:e})=>VJ(r,e),deleteRow:()=>({state:r,dispatch:e})=>HJ(r,e),deleteTable:()=>({state:r,dispatch:e})=>KJ(r,e),mergeCells:()=>({state:r,dispatch:e})=>tD(r,e),splitCell:()=>({state:r,dispatch:e})=>rD(r,e),toggleHeaderColumn:()=>({state:r,dispatch:e})=>Dd("column")(r,e),toggleHeaderRow:()=>({state:r,dispatch:e})=>Dd("row")(r,e),toggleHeaderCell:()=>({state:r,dispatch:e})=>qJ(r,e),mergeOrSplit:()=>({state:r,dispatch:e})=>tD(r,e)?!0:rD(r,e),setCellAttribute:(r,e)=>({state:t,dispatch:n})=>UJ(r,e)(t,n),goToNextCell:()=>({state:r,dispatch:e})=>iD(1)(r,e),goToPreviousCell:()=>({state:r,dispatch:e})=>iD(-1)(r,e),fixTables:()=>({state:r,dispatch:e})=>(e&&m4(r),!0),setCellSelection:r=>({tr:e,dispatch:t})=>{if(t){const n=Bt.create(e.doc,r.anchorCell,r.headCell);e.setSelection(n)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:iv,"Mod-Backspace":iv,Delete:iv,"Mod-Delete":iv}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[oQ({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],mQ({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(r){const e={name:r.name,options:r.options,storage:r.storage};return{tableRole:pr(jr(r,"tableRole",e))}}});ar.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:r=>{const e=r.getAttribute("colwidth");return e?e.split(",").map(n=>parseInt(n,10)):null}}}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td"}]},renderHTML({HTMLAttributes:r}){return["td",Lt(this.options.HTMLAttributes,r),0]}});ar.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:r=>{const e=r.getAttribute("colwidth");return e?e.split(",").map(n=>parseInt(n,10)):null}}}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th"}]},renderHTML({HTMLAttributes:r}){return["th",Lt(this.options.HTMLAttributes,r),0]}});ar.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:r}){return["tr",Lt(this.options.HTMLAttributes,r),0]}});const wQ={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function SQ(r,e){return Y(),ae("svg",wQ,e[0]||(e[0]=[Z("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 13v6h-6m-8-8V5h6M5 5l14 14"},null,-1)]))}const TQ=vt({name:"lucide-move-diagonal-2",render:SQ}),CQ={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function AQ(r,e){return Y(),ae("svg",CQ,e[0]||(e[0]=[Z("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12H3m14 6H3M21 6H3"},null,-1)]))}const MQ=vt({name:"lucide-align-left",render:AQ}),kQ={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function DQ(r,e){return Y(),ae("svg",kQ,e[0]||(e[0]=[Z("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 12H7m12 6H5M21 6H3"},null,-1)]))}const EQ=vt({name:"lucide-align-center",render:DQ}),LQ={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function IQ(r,e){return Y(),ae("svg",LQ,e[0]||(e[0]=[Z("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 12H9m12 6H7M21 6H3"},null,-1)]))}const PQ=vt({name:"lucide-align-right",render:IQ}),RQ={class:"relative"},OQ=["src","alt","width","height"],jQ={class:"absolute bottom-2 right-2 flex items-center gap-2"},NQ={key:0,class:"flex divide-x divide-outline-gray-5 rounded bg-black/65"},BQ={key:1,class:"inset-0 absolute flex items-center justify-center z-10"},zQ={class:"bg-gray-900/80 p-2 inset-0 leading-none rounded-sm flex flex-col items-center justify-center gap-2"},FQ={class:"flex items-center gap-2"},VQ=["disabled"],$Q={key:1,class:"w-full py-1.5"},HQ=Ke({__name:"ImageNodeView",props:xZ,setup(r){const e=r,t=te(null),n=te(null),i=te(!1),a=te(0),o=te(0),s=te(1);function l(){e.editor.commands.setNodeSelection(e.getPos())}const u=te(e.node.attrs.alt||""),c=te(!1);zi(()=>{if(c.value=e.editor.isEditable,t.value){const x=e.node.attrs.width||t.value.naturalWidth,w=e.node.attrs.height||t.value.naturalHeight;x&&w&&(s.value=w/x)}}),e.editor.on("update",()=>{c.value=e.editor.isEditable});function f(x){const w=x.target.value;u.value=w,e.updateAttributes({alt:w})}function h(x){x.key==="Enter"?(x.preventDefault(),p()):(x.key==="Escape"||x.key==="ArrowDown")&&(x.preventDefault(),v()),x.key==="ArrowUp"&&(x.preventDefault(),m())}function d(x){e.editor.commands.focus(),e.editor.chain().setTextSelection(x).scrollIntoView().run()}function p(){const x=e.getPos();e.editor.commands.focus(),e.editor.chain().setTextSelection(x+1).createParagraphNear().scrollIntoView().run()}function v(){const x=e.getPos();d(x+1)}function m(){const x=e.getPos();d(x-1)}function g(x){var T,C,A;if(!c.value)return;l(),i.value=!0,a.value=x.clientX,o.value=((T=t.value)==null?void 0:T.offsetWidth)||e.node.attrs.width||0;const w=e.node.attrs.width||((C=t.value)==null?void 0:C.naturalWidth),S=e.node.attrs.height||((A=t.value)==null?void 0:A.naturalHeight);w&&S?s.value=S/w:s.value=1,window.addEventListener("mousemove",y),window.addEventListener("mouseup",b),document.body.style.cursor="ew-resize"}function y(x){if(!i.value||!t.value||!n.value)return;const S=e.editor.view.dom.clientWidth,T=x.clientX-a.value;let C=o.value+T;C=Math.max(50,Math.min(C,S));const A=C*s.value;t.value.style.width=`${C}px`,t.value.style.height=`${A}px`,n.value.style.width=`${C}px`}function b(){if(i.value&&(i.value=!1,window.removeEventListener("mousemove",y),window.removeEventListener("mouseup",b),document.body.style.cursor="",t.value&&n.value)){const x=t.value.offsetWidth,w=t.value.offsetHeight;e.updateAttributes({width:x,height:w}),t.value.style.width="",t.value.style.height="",n.value.style.width=""}}function _(x){e.editor.commands.setImageAlign(x)}return(x,w)=>(Y(),$e(H(i4),null,{default:_e(()=>[Z("div",{ref_key:"containerRef",ref:n,class:kt(["relative overflow-hidden not-prose my-6 rounded-[2px] block max-w-full",[{"ring-2 ring-outline-gray-3 ring-offset-2":x.selected},x.node.attrs.align==="center"?"mx-auto":"",x.node.attrs.align==="right"?"ml-auto mr-0":"",x.node.attrs.align==="left"?"mr-auto ml-0":""]]),style:Sa({width:x.node.attrs.width?`${x.node.attrs.width}px`:"auto"})},[Z("div",RQ,[x.node.attrs.src?(Y(),ae("img",{key:0,ref_key:"imageRef",ref:t,class:"rounded-[2px]",src:x.node.attrs.src,alt:x.node.attrs.alt||"",width:x.node.attrs.width,height:x.node.attrs.height,onClick:At(l,["stop"])},null,8,OQ)):ct("",!0),Z("div",jQ,[x.selected&&c.value?(Y(),ae("div",NQ,[Z("button",{onClick:w[0]||(w[0]=At(S=>_("left"),["stop"])),class:kt(["px-1.5 py-1 hover:text-ink-white",x.node.attrs.align==="left"?"text-ink-white":"text-ink-gray-4"])},[Ie(H(MQ),{class:"size-4"})],2),Z("button",{onClick:w[1]||(w[1]=At(S=>_("center"),["stop"])),class:kt(["px-1.5 py-1 hover:text-ink-white",x.node.attrs.align==="center"?"text-ink-white":"text-ink-gray-4"])},[Ie(H(EQ),{class:"size-4"})],2),Z("button",{onClick:w[2]||(w[2]=At(S=>_("right"),["stop"])),class:kt(["px-1.5 py-1 hover:text-ink-white",x.node.attrs.align==="right"?"text-ink-white":"text-ink-gray-4"])},[Ie(H(PQ),{class:"size-4"})],2)])):ct("",!0),x.selected&&c.value?(Y(),ae("button",{key:1,class:"cursor-nw-resize bg-black/65 rounded p-1",onMousedown:At(g,["prevent"])},[Ie(H(TQ),{class:"text-white size-4"})],32)):ct("",!0)]),x.node.attrs.loading?(Y(),ae("div",BQ,[Z("div",zQ,[Z("div",FQ,[Ie(R3,{class:"text-gray-100 size-4"}),w[4]||(w[4]=Z("span",{class:"text-gray-100"},"Uploading...",-1))])])])):ct("",!0)]),(c.value||x.node.attrs.alt)&&!x.node.attrs.error?og((Y(),ae("input",{key:0,"onUpdate:modelValue":w[3]||(w[3]=S=>u.value=S),class:"w-full text-center bg-transparent text-sm text-ink-gray-6 h-7 border-none focus:ring-0 placeholder-ink-gray-4",placeholder:"Add caption",disabled:!c.value,onChange:f,onKeydown:h},null,40,VQ)),[[Hx,u.value]]):ct("",!0),x.node.attrs.error?(Y(),ae("div",$Q,[Ie(H(JU),{message:`Upload Failed: ${x.node.attrs.error}`},null,8,["message"])])):ct("",!0)],6)]),_:1}))}}),GQ=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/;ar.create({name:"image",group:"block",draggable:!0,selectable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null},loading:{default:!1,parseHTML:()=>!1},align:{default:"left",parseHTML:r=>{const e=(r.getAttribute("data-align")||r.getAttribute("align")||"left").toLowerCase();return["left","center","right"].includes(e)?e:"left"},renderHTML:r=>({"data-align":r.align||"left"})},uploadId:{default:null,parseHTML:()=>null},error:{default:null,parseHTML:()=>null}}},parseHTML(){return[{tag:"img[src]",getAttrs:r=>{if(typeof r=="string")return{};const e=r;return{src:e.getAttribute("src"),alt:e.getAttribute("alt"),title:e.getAttribute("title"),width:e.getAttribute("width"),height:e.getAttribute("height")}}}]},renderHTML({HTMLAttributes:r}){return["img",Lt(this.options.HTMLAttributes||{},r)]},addNodeView(){return IT(HQ)},addOptions(){return{uploadFunction:null,HTMLAttributes:{}}},addCommands(){return{setImageAlign:r=>({commands:e})=>e.updateAttributes(this.name,{align:r}),setImage:r=>({commands:e,editor:t})=>{const n=e.insertContent({type:this.name,attrs:r});return n&&r.src&&YQ(t.view,r.src,(i,a)=>{pD(r.src,t.view,a)}),n},uploadImage:r=>({editor:e})=>w4(r,e.view,null,this.options),selectAndUploadImage:()=>({editor:r})=>{const e=document.createElement("input");return e.type="file",e.accept="image/*",e.onchange=t=>{const n=t.target;if(n.files&&n.files.length){const i=n.files[0];r.commands.uploadImage(i)}},e.click(),!0}}},addInputRules(){return[X5({find:GQ,type:this.type,getAttributes:r=>{const[,,e,t,n]=r;return{src:t,alt:e,title:n}}})]},addProseMirrorPlugins(){const r=this;return[new Ut({props:{handleDOMEvents:{drop:(e,t)=>{var s,l;if(!((l=(s=t.dataTransfer)==null?void 0:s.files)==null?void 0:l.length)||!r.options.uploadFunction)return!1;const i=Array.from(t.dataTransfer.files).filter(u=>/image/i.test(u.type));if(i.length===0)return!1;t.preventDefault();const a=e.posAtCoords({left:t.clientX,top:t.clientY});let o=null;if(a){o=a.pos;const u=e.state.tr.setSelection(qe.near(e.state.doc.resolve(o)));e.dispatch(u)}return Mw(i,e,o,r.options),!0},handlePaste:(e,t)=>{var a;if(!r.options.uploadFunction)return!1;const n=(a=t.clipboardData)==null?void 0:a.items;if(!n||n.length===0)return!1;const i=[];for(let o=0;oa.docChanged)&&n.doc.descendants((a,o)=>{a.type.name==="image"&&a.attrs.src&&(!a.attrs.width||!a.attrs.height)&&!a.attrs.loading&&i.push({node:a,pos:o})}),i.length===0||i.forEach(({node:a,pos:o})=>{const s=r.editor;s&&pD(a.attrs.src,s.view,o)}),null}})]}});function WQ(r,e){if(!e)return null;let t=null;return r.state.doc.descendants((n,i)=>{if(n.type.name==="image"&&n.attrs.uploadId===e)return t=i+n.nodeSize,!1}),t}function x4(r,e,t,n,i,a,o=!1){if(!n.uploadFunction)return console.error("uploadFunction option is not provided"),!1;const s=`upload-${Date.now()}-${Math.random().toString(36).substring(2,9)}`;return qTe(r).then(l=>{const u=e.state.schema.nodes.image.create({loading:!0,uploadId:s,src:l}),c=e.state.tr;if(t!=null)c.insert(t,u);else if(i==="replace")c.replaceSelectionWith(u);else{const f=e.state.selection.from;c.insert(f,u)}if(e.dispatch(c),o){const f=u.nodeSize||1;setTimeout(()=>{try{let h=null;if(e.state.doc.descendants((d,p)=>{if(d.type.name==="image"&&d.attrs.uploadId===s)return h=p,!1}),h!==null){const d=h+f,p=e.state.tr.setSelection(qe.near(e.state.doc.resolve(d)));e.dispatch(p)}}catch(h){console.error("Error moving cursor:",h)}},10)}return n.uploadFunction(r)}).then(l=>S4(l.file_url).then(u=>({...l,width:u.width,height:u.height})).catch(()=>l)).then(l=>{const u=e.state.tr;e.state.doc.descendants((c,f)=>{if(c.type.name==="image"&&c.attrs.uploadId===s)return u.setNodeMarkup(f,void 0,{...c.attrs,src:l.file_url,width:l.width||c.attrs.width,height:l.height||c.attrs.height,loading:!1}),!1}),e.dispatch(u),a&&a(s)}).catch(l=>{console.error("Image upload failed:",l);try{const u=e.state.tr;e.state.doc.descendants((c,f)=>{if(c.type.name==="image"&&c.attrs.uploadId===s)return u.setNodeMarkup(f,void 0,{...c.attrs,loading:!1,error:l.message||"Failed to upload image"}),!1}),e.dispatch(u)}catch(u){console.error("Error updating failed node:",u)}a&&a(s)}),!0}function UQ(r,e,t,n,i){return x4(r,e,t,n,"insert",i,!0)}function w4(r,e,t,n){return x4(r,e,t,n,"replace")}function YQ(r,e,t){r.state.doc.descendants((n,i)=>{if(n.type.name==="image"&&n.attrs.src===e)return t(n,i),!1})}function pD(r,e,t){S4(r).then(n=>{const i=e.state.doc.nodeAt(t);if(!i||i.type.name!=="image")return;const a=i.attrs;if(a.width==null||a.height==null){const o=e.state.tr.setNodeMarkup(t,void 0,{...a,width:a.width??n.width,height:a.height??n.height});e.dispatch(o)}}).catch(n=>{})}function S4(r){return new Promise((e,t)=>{const n=new Image;n.onload=()=>e({width:n.naturalWidth,height:n.naturalHeight}),n.onerror=t,n.src=r})}function Mw(r,e,t,n){if(r.length===1){w4(r[0],e,t,n);return}let i=[...r],a=null;const o=()=>{if(i.length===0)return;const s=i.shift();if(!s)return;const l=a?WQ(e,a):t;UQ(s,e,l,n,u=>{a=u,setTimeout(o,100)})};o()}function qQ(r){const{targetRef:e,zoomLevel:t=te(100),onSwipeLeft:n,onSwipeRight:i,onDoubleTap:a,onTap:o,onPanStart:s,onPanMove:l,onPanAnimate:u,onPanEnd:c,onPinchStart:f,onPinchMove:h,onPinchEnd:d,doubleTapDelay:p=300,minSwipeDistance:v=50,maxVerticalSwipeDistance:m=75,maxTapDuration:g=200,maxTapMovement:y=10,panThreshold:b=5,inertiaDamping:_=.94,inertiaVelocityThreshold:x=.5}=r,w=te(!1),S=te(!1),T=te(!1),C=te({x:0,y:0}),A=te(0),M=te(0),D=te(0),E=te(null),L=te(0),I=te({x:0,y:0}),R=te({x:0,y:0}),P=te(null),O=()=>{P.value!==null&&(cancelAnimationFrame(P.value),P.value=null),T.value=!1,R.value={x:0,y:0}},j=B=>{O(),B.preventDefault(),w.value=!1,S.value=!1,E.value=B.touches;const $=performance.now(),J=$-A.value;if(J0&&B.touches.length===1&&a){a(B),A.value=0,M.value=0;return}if(M.value=$,B.touches.length===1){A.value=$;const U=B.touches[0];C.value={x:U.clientX,y:U.clientY},L.value=$,I.value={...C.value},R.value={x:0,y:0},s&&s(B)}else if(B.touches.length===2){A.value=0;const U=B.touches[0],we=B.touches[1];D.value=Math.hypot(we.clientX-U.clientX,we.clientY-U.clientY),S.value=!0,f&&f(B)}else A.value=0,M.value=0},F=B=>{if(!E.value)return;B.preventDefault();const $=performance.now(),J=$-L.value;if(B.touches.length===2&&E.value.length===2){w.value=!1,S.value=!0;const U=B.touches[0],we=B.touches[1],Ye=Math.hypot(we.clientX-U.clientX,we.clientY-U.clientY);if(D.value>0&&h){const ge=Ye/D.value;h(ge,B)}R.value={x:0,y:0}}else if(B.touches.length===1&&E.value.length===1&&!S.value){const U=B.touches[0].clientX,we=B.touches[0].clientY,Ye=U-I.value.x,ge=we-I.value.y;J>1?R.value={x:Ye/J,y:ge/J}:R.value={x:0,y:0},L.value=$,I.value={x:U,y:we};const le=U-C.value.x,be=we-C.value.y;if(!w.value&&t.value>100&&(Math.abs(le)>b||Math.abs(be)>b)&&(w.value=!0,C.value={x:U,y:we}),w.value&&l){const re=t.value/100,G=le/re,ee=be/re;l(G,ee,B)}}},N=B=>{var ge;const $=B.touches.length,J=performance.now(),U=w.value,we=S.value,Ye={...R.value};if(U&&E.value&&$x&&u&&t.value>100){T.value=!0;let be=performance.now(),re={...Ye};const G=ee=>{if(!T.value)return;const Q=Math.max(1,ee-be);be=ee;const me=t.value/100,he=re.x*Q/me,Se=re.y*Q/me;u(he,Se);const Fe=Math.pow(Math.min(.999,_),Q/16.67);re.x*=Fe,re.y*=Fe,Math.hypot(re.x,re.y)<.01||t.value<=100?O():P.value=requestAnimationFrame(G)};P.value=requestAnimationFrame(G)}else R.value={x:0,y:0};else U||(R.value={x:0,y:0});if(we&&$<2&&(S.value=!1,D.value=0,d&&d(B)),$===0&&B.changedTouches.length===1&&M.value>0&&((ge=E.value)==null?void 0:ge.length)===1){const le=B.changedTouches[0],be=le.clientX-C.value.x,re=le.clientY-C.value.y,G=J-M.value;!U&&t.value<=100&&Math.abs(be)>v&&Math.abs(re)0&&i&&i():!U&&G{$&&($.removeEventListener("touchstart",j),$.removeEventListener("touchmove",F),$.removeEventListener("touchend",N),$.removeEventListener("touchcancel",N),O()),B&&(B.addEventListener("touchstart",j,{passive:!1}),B.addEventListener("touchmove",F,{passive:!1}),B.addEventListener("touchend",N,{passive:!0}),B.addEventListener("touchcancel",N,{passive:!0}))},{immediate:!0}),{isPanning:lo(w),isPinching:lo(S),isAnimatingPan:lo(T)}}function XQ({initialIndex:r,imageCount:e,onNavigate:t}){const n=te(r.value);Nt(r,o=>{n.value=o,t==null||t()});function i(){e.value>0&&(n.value=(n.value+1)%e.value,t==null||t())}function a(){e.value>0&&(n.value=(n.value-1+e.value)%e.value,t==null||t())}return{currentIndex:n,nextImage:i,previousImage:a}}function KQ({containerRef:r,isEnabled:e}){const t=te(100),n=te({x:0,y:0}),i=te(!1),a=te({x:0,y:0}),o=te({x:0,y:0}),s=90,l=110;Nt(t,(p,v)=>{p<=100&&v>100&&(n.value={x:0,y:0})});function u(){t.value=Math.min(t.value+25,300)}function c(){const p=Math.max(t.value-25,25);t.value>100&&p<100?t.value=100:t.value=p}function f(){t.value=100,n.value={x:0,y:0},i.value=!1,o.value={x:0,y:0}}function h(p){if(t.value<=100)return;p.preventDefault(),i.value=!0,a.value={x:p.clientX,y:p.clientY},o.value={...n.value};const v=g=>{if(!i.value)return;const y=g.clientX-a.value.x,b=g.clientY-a.value.y,_=t.value/100;n.value={x:o.value.x+y/_,y:o.value.y+b/_}},m=()=>{i.value&&(i.value=!1,document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",m))};document.addEventListener("mousemove",v),document.addEventListener("mouseup",m)}function d(p){var v;if(e.value&&(v=r.value)!=null&&v.contains(p.target)){p.preventDefault();let m=p.ctrlKey?.5:.2;const g=-p.deltaY*m,y=t.value,b=Math.round(y+g);let _=Math.max(25,Math.min(300,b));(y>100&&_<100||y<100&&_>100)&&Math.abs(100-_){const p=r.value;p&&p.addEventListener("wheel",d,{passive:!1,capture:!0})}),Ss(()=>{const p=r.value;p&&p.removeEventListener("wheel",d,{capture:!0}),i.value&&(i.value=!1)}),{zoomLevel:t,panPosition:n,isMousePanning:i,initialPanPositionOnGestureStart:o,zoomIn:u,zoomOut:c,resetZoom:f,handlePanStart:h,snapThresholdLower:s,snapThresholdUpper:l}}const ZQ={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function JQ(r,e){return Y(),ae("svg",ZQ,e[0]||(e[0]=[Z("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[Z("path",{d:"M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),Z("path",{d:"m7 10l5 5l5-5"})],-1)]))}const QQ=vt({name:"lucide-download",render:JQ}),eee={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tee(r,e){return Y(),ae("svg",eee,e[0]||(e[0]=[Z("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3M3 16v3a2 2 0 0 0 2 2h3m8 0h3a2 2 0 0 0 2-2v-3"},null,-1)]))}const ree=vt({name:"lucide-maximize",render:tee}),nee={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function iee(r,e){return Y(),ae("svg",nee,e[0]||(e[0]=[Z("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3M3 16h3a2 2 0 0 1 2 2v3m8 0v-3a2 2 0 0 1 2-2h3"},null,-1)]))}const aee=vt({name:"lucide-minimize",render:iee}),oee={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function see(r,e){return Y(),ae("svg",oee,e[0]||(e[0]=[Z("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m15 18l-6-6l6-6"},null,-1)]))}const lee=vt({name:"lucide-chevron-left",render:see}),uee={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function cee(r,e){return Y(),ae("svg",uee,e[0]||(e[0]=[Z("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 18l6-6l-6-6"},null,-1)]))}const fee=vt({name:"lucide-chevron-right",render:cee}),hee={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function dee(r,e){return Y(),ae("svg",hee,e[0]||(e[0]=[Z("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14m-7-7v14"},null,-1)]))}const pee=vt({name:"lucide-plus",render:dee}),vee={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function mee(r,e){return Y(),ae("svg",vee,e[0]||(e[0]=[Z("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14"},null,-1)]))}const T4=vt({name:"lucide-minus",render:mee}),gee={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function yee(r,e){return Y(),ae("svg",gee,e[0]||(e[0]=[Z("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"},null,-1)]))}const C0=vt({name:"lucide-x",render:yee}),bee={class:"relative z-10 flex flex-col items-center"},_ee=["src","alt"],xee={class:"bg-black/65 rounded flex items-center"},wee={class:"px-2 text-sm tabular-nums text-gray-400 select-none"},See={class:"bg-black/65 rounded flex items-center"},Tee={class:"bg-black/65 rounded flex items-center"},Cee={class:"bg-black/65 rounded flex items-center"},Aee=3e3,C4=Ke({__name:"ImageViewerModal",props:{show:{type:Boolean},images:{},initialIndex:{}},emits:["update:show"],setup(r,{emit:e}){const t=r,n=e,i=bm("imageContainer"),a=bm("backdropElement"),o=bm("controlsBar"),s=te(0),l=te(!1),u=te(100),c=te(!0),f=te(null),{zoomLevel:h,panPosition:d,isMousePanning:p,initialPanPositionOnGestureStart:v,zoomIn:m,zoomOut:g,resetZoom:y,handlePanStart:b,snapThresholdLower:_,snapThresholdUpper:x}=KQ({containerRef:i,isEnabled:ag(t,"show")}),{currentIndex:w,nextImage:S,previousImage:T}=XQ({initialIndex:ag(t,"initialIndex"),imageCount:de(()=>t.images.length),onNavigate:y}),C=de(()=>t.images[w.value]),{isPanning:A,isPinching:M,isAnimatingPan:D}=qQ({targetRef:i,zoomLevel:h,panThreshold:10,onSwipeLeft:()=>{h.value<=100&&S()},onSwipeRight:()=>{h.value<=100&&T()},onDoubleTap:N=>{var B;(B=o.value)!=null&&B.contains(N.target)||(h.value>100?y():(h.value=200,d.value={x:0,y:0}))},onTap:N=>{N.target===a.value&&R()},onPanStart:()=>{h.value<=100||(v.value={...d.value})},onPanMove:(N,B)=>{h.value<=100||(d.value={x:v.value.x+N,y:v.value.y+B})},onPanAnimate:(N,B)=>{d.value={x:d.value.x+N,y:d.value.y+B}},onPinchStart:()=>{u.value=h.value,v.value={...d.value}},onPinchMove:N=>{const B=u.value*N;let $=Math.max(25,Math.min(300,Math.round(B)));$>_&&${h.value<100&&y(),v.value={x:0,y:0}}}),E=de(()=>p.value||A.value);function L(){c.value=!0,f.value&&clearTimeout(f.value),f.value=setTimeout(()=>{!E.value&&!M.value?c.value=!1:L()},Aee)}function I(){(!M.value||!c.value)&&L()}function R(){n("update:show",!1),y(),f.value&&(clearTimeout(f.value),f.value=null)}function P(){var J;const N=C.value,B=document.createElement("a");B.href=N.src;const $=((J=N.alt)==null?void 0:J.replace(/[^a-z0-9]/gi,"_").toLowerCase())||N.src.split("/").pop()||"download";B.download=$.includes(".")?$:`${$}.jpg`,document.body.appendChild(B),B.click(),document.body.removeChild(B)}function O(){const N=i.value;l.value?document.exitFullscreen&&(document.exitFullscreen(),l.value=!1):N!=null&&N.requestFullscreen&&(N.requestFullscreen(),l.value=!0)}function j(){l.value=!!document.fullscreenElement}function F(N){if(t.show)switch(I(),N.key){case"ArrowLeft":E.value||T(),N.preventDefault();break;case"ArrowRight":E.value||S(),N.preventDefault();break;case"+":case"=":m(),N.preventDefault();break;case"-":g(),N.preventDefault();break;case"Escape":R(),N.preventDefault();break;case"f":case"F":O(),N.preventDefault();break}}return Nt(()=>t.show,N=>{N?(c.value=!0,y(),L()):(f.value&&(clearTimeout(f.value),f.value=null),l.value&&document.exitFullscreen&&document.exitFullscreen())}),Nt(o,N=>{if(N){const B=()=>{s.value=N.offsetHeight},$=new ResizeObserver(B);$.observe(N),B(),Ss(()=>$.disconnect())}else s.value=0}),zi(()=>{document.addEventListener("fullscreenchange",j),document.addEventListener("keydown",F)}),Ss(()=>{document.removeEventListener("fullscreenchange",j),document.removeEventListener("keydown",F),f.value&&clearTimeout(f.value),l.value&&document.exitFullscreen&&document.exitFullscreen()}),(N,B)=>(Y(),$e(VS,{to:"body"},[Ie(x3,{"enter-active-class":"transition-opacity duration-150 ease-in-out","leave-active-class":"transition-opacity duration-150 ease-in-out","enter-from-class":"opacity-0","leave-to-class":"opacity-0",appear:""},{default:_e(()=>[t.show?(Y(),ae("div",{key:0,class:"fixed top-0 left-0 w-full h-full bg-black sm:bg-black/90 z-[50] flex flex-col justify-center items-center overflow-hidden touch-none",ref_key:"imageContainer",ref:i,onMousemove:I,onTouchstart:I,onTouchmove:I},[Z("div",{class:"absolute inset-0 z-0",ref_key:"backdropElement",ref:a,onClick:R},null,512),Z("div",bee,[Z("img",{src:C.value.src,alt:C.value.alt||"Image preview",class:"max-w-screen max-h-screen object-contain block",style:Sa({transform:`scale(${H(h)/100}) translate(${H(d).x}px, ${H(d).y}px)`,cursor:H(h)>100?H(p)?"grabbing":"grab":"default",transition:E.value||H(M)||H(D)?"none":"transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)"}),onMousedown:B[0]||(B[0]=(...$)=>H(b)&&H(b)(...$)),draggable:"false"},null,44,_ee)]),C.value.alt?(Y(),ae("div",{key:0,class:kt(["absolute bottom-4 p-2 text-center rounded-sm text-white text-sm bg-black/65 z-10 transition-opacity duration-300 ease-in-out",{"opacity-0 pointer-events-none":!c.value}])},qt(C.value.alt),3)):ct("",!0),Z("div",{ref_key:"controlsBar",ref:o,class:kt(["absolute top-4 flex items-center space-x-3 p-2 text-white z-20 transition-opacity duration-300 ease-in-out",{"opacity-0 pointer-events-none":!c.value}]),onTouchstart:B[6]||(B[6]=At(()=>{},["stop"])),onTouchmove:B[7]||(B[7]=At(()=>{},["stop"])),onTouchend:B[8]||(B[8]=At(()=>{},["stop"])),onMousedown:B[9]||(B[9]=At(()=>{},["stop"])),onWheel:B[10]||(B[10]=At(()=>{},["stop"]))},[Z("div",xee,[Ie(Ci,{text:"Previous image"},{default:_e(()=>[Z("button",{class:"p-2 hover:bg-gray-900 rounded-l focus:outline-none",onClick:B[1]||(B[1]=At((...$)=>H(T)&&H(T)(...$),["stop"]))},[Ie(H(lee),{class:"size-4"})])]),_:1}),Z("span",wee,qt(H(w)+1)+"/"+qt(t.images.length),1),Ie(Ci,{text:"Next image"},{default:_e(()=>[Z("button",{class:"p-2 hover:bg-gray-900 rounded-r focus:outline-none",onClick:B[2]||(B[2]=At((...$)=>H(S)&&H(S)(...$),["stop"]))},[Ie(H(fee),{class:"size-4"})])]),_:1})]),Z("div",See,[Ie(Ci,{text:"Zoom out"},{default:_e(()=>[Z("button",{class:"p-2 hover:bg-gray-900 rounded-l focus:outline-none",onClick:B[3]||(B[3]=At((...$)=>H(g)&&H(g)(...$),["stop"]))},[Ie(H(T4),{class:"size-4"})])]),_:1}),Ie(Ci,{text:"Reset zoom"},{default:_e(()=>[Z("button",{class:"p-2 hover:bg-gray-900 text-sm text-gray-400 focus:outline-none",onClick:B[4]||(B[4]=At((...$)=>H(y)&&H(y)(...$),["stop"]))},qt(H(h))+"% ",1)]),_:1}),Ie(Ci,{text:"Zoom in"},{default:_e(()=>[Z("button",{class:"p-2 hover:bg-gray-900 rounded-r focus:outline-none",onClick:B[5]||(B[5]=At((...$)=>H(m)&&H(m)(...$),["stop"]))},[Ie(H(pee),{class:"size-4"})])]),_:1})]),Z("div",Tee,[Ie(Ci,{text:"Download image"},{default:_e(()=>[Z("button",{class:"p-2 hover:bg-gray-900 rounded-l focus:outline-none",onClick:At(P,["stop"])},[Ie(H(QQ),{class:"size-4"})])]),_:1}),Ie(Ci,{text:l.value?"Exit fullscreen":"Enter fullscreen"},{default:_e(()=>[Z("button",{class:"p-2 hover:bg-gray-900 rounded-r focus:outline-none hidden sm:block",onClick:At(O,["stop"])},[l.value?(Y(),$e(H(aee),{key:1,class:"size-4"})):(Y(),$e(H(ree),{key:0,class:"size-4"}))])]),_:1},8,["text"])]),Z("div",Cee,[Ie(Ci,{text:"Close"},{default:_e(()=>[Z("button",{class:"p-2 hover:bg-gray-900 rounded focus:outline-none",onClick:At(R,["stop"])},[Ie(H(C0),{class:"size-4"})])]),_:1})])],34)],544)):ct("",!0)]),_:1})]))}});Kt.create({name:"imageViewer",onBeforeCreate(){if(!document.querySelector("style[data-image-viewer-style]")){const r=document.createElement("style");r.textContent=` .ProseMirror:not(.ProseMirror-focused) img { cursor: pointer; } `,r.setAttribute("data-image-viewer-style","true"),document.head.appendChild(r)}},onDestroy(){const r=document.querySelector("style[data-image-viewer-style]");r&&document.head.removeChild(r)},addCommands(){return{openImageViewer:r=>({editor:e})=>{const t=[];e.state.doc.descendants(i=>(i.type.name==="image"&&t.push({src:i.attrs.src,alt:i.attrs.alt||null}),!0));const n=t.findIndex(i=>i.src===r);return Mee(t,n),!0}}},addProseMirrorPlugins(){const r=this;return[new Ut({key:new jt("imageViewer"),props:{handleClick(e,t,n){if(r.editor.isEditable)return!1;const{state:i}=e,a=i.doc.nodeAt(t);if((a==null?void 0:a.type.name)==="image"){n.preventDefault();const o=a.attrs.src;return r.editor.commands.openImageViewer(o),!0}if(n.target instanceof HTMLImageElement){let o=!1;if(i.doc.descendants((s,l)=>{if(s.type.name==="image"&&!o){const u=e.nodeDOM(l);if(u&&(u===n.target||u.contains(n.target)))return n.preventDefault(),r.editor.commands.openImageViewer(s.attrs.src),o=!0,!1}return!0}),o)return!0}return!1}}})]}});function Mee(r,e){const t=document.createElement("div");document.body.appendChild(t);const n=w3({render(){return so(C4,{show:!0,images:r,initialIndex:e,"onUpdate:show":i=>{i||setTimeout(()=>{n.unmount(),t.remove()},0)}})}});n.mount(t)}ar.create({name:"video",group:"block",selectable:!0,draggable:!0,atom:!0,addOptions(){return{uploadFunction:null,HTMLAttributes:{}}},addAttributes(){return{src:{default:null}}},parseHTML(){return[{tag:"video"}]},renderHTML({HTMLAttributes:r}){return["video",Lt(this.options.HTMLAttributes,r,{controls:""})]},addCommands(){return{setVideo:r=>({commands:e})=>e.insertContent({type:this.name,attrs:r}),uploadVideo:r=>({editor:e})=>{const t=e.state.selection.from;return kee(r,e.view,t,this.options)},selectAndUploadVideo:()=>({editor:r})=>{if(!this.options.uploadFunction)return console.error("uploadFunction option is not provided for videos."),!1;const e=document.createElement("input");return e.type="file",e.accept="video/*",e.onchange=t=>{const n=t.target;if(n.files&&n.files.length){const i=n.files[0];r.commands.uploadVideo(i)}},e.click(),!0}}},addNodeView(){return({editor:r,node:e})=>{const t=document.createElement("div");t.className="relative aspect-w-16 aspect-h-9"+(r.isEditable?" cursor-pointer":"");const n=document.createElement("video");if(n.src=e.attrs.src,n.setAttribute("controls",""),r.isEditable){let i=document.createElement("div");i.className="absolute top-0 right-0 text-xs m-2 bg-surface-gray-6 text-ink-white px-2 py-1 rounded-md",i.innerHTML="Video",t.append(i)}return t.append(n),{dom:t}}}});function kee(r,e,t,n){return n.uploadFunction?(n.uploadFunction(r).then(i=>{const{schema:a}=e.state,o=a.nodes.video.create({src:i.file_url}),s=e.state.tr;t!=null?s.insert(t,o):s.replaceSelectionWith(o),e.dispatch(s)}).catch(i=>{console.error("Video upload failed:",i)}),!0):(console.error("uploadFunction option is not provided for videos."),!1)}const Dee="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Eee="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",kw="numeric",Dw="ascii",Ew="alpha",qh="asciinumeric",Th="alphanumeric",Lw="domain",A4="emoji",Lee="scheme",Iee="slashscheme",J1="whitespace";function Pee(r,e){return r in e||(e[r]=[]),e[r]}function El(r,e,t){e[kw]&&(e[qh]=!0,e[Th]=!0),e[Dw]&&(e[qh]=!0,e[Ew]=!0),e[qh]&&(e[Th]=!0),e[Ew]&&(e[Th]=!0),e[Th]&&(e[Lw]=!0),e[A4]&&(e[Lw]=!0);for(const n in e){const i=Pee(n,t);i.indexOf(r)<0&&i.push(r)}}function Ree(r,e){const t={};for(const n in e)e[n].indexOf(r)>=0&&(t[n]=!0);return t}function Sn(r=null){this.j={},this.jr=[],this.jd=null,this.t=r}Sn.groups={};Sn.prototype={accepts(){return!!this.t},go(r){const e=this,t=e.j[r];if(t)return t;for(let n=0;nr.ta(e,t,n,i),Zt=(r,e,t,n,i)=>r.tr(e,t,n,i),vD=(r,e,t,n,i)=>r.ts(e,t,n,i),oe=(r,e,t,n,i)=>r.tt(e,t,n,i),Za="WORD",Iw="UWORD",M4="ASCIINUMERICAL",k4="ALPHANUMERICAL",Ed="LOCALHOST",Pw="TLD",Rw="UTLD",Em="SCHEME",_c="SLASH_SCHEME",OT="NUM",Ow="WS",jT="NL",Xh="OPENBRACE",Kh="CLOSEBRACE",Eg="OPENBRACKET",Lg="CLOSEBRACKET",Ig="OPENPAREN",Pg="CLOSEPAREN",Rg="OPENANGLEBRACKET",Og="CLOSEANGLEBRACKET",jg="FULLWIDTHLEFTPAREN",Ng="FULLWIDTHRIGHTPAREN",Bg="LEFTCORNERBRACKET",zg="RIGHTCORNERBRACKET",Fg="LEFTWHITECORNERBRACKET",Vg="RIGHTWHITECORNERBRACKET",$g="FULLWIDTHLESSTHAN",Hg="FULLWIDTHGREATERTHAN",Gg="AMPERSAND",Wg="APOSTROPHE",Ug="ASTERISK",Zo="AT",Yg="BACKSLASH",qg="BACKTICK",Xg="CARET",ts="COLON",NT="COMMA",Kg="DOLLAR",ia="DOT",Zg="EQUALS",BT="EXCLAMATION",Kn="HYPHEN",Zh="PERCENT",Jg="PIPE",Qg="PLUS",ey="POUND",Jh="QUERY",zT="QUOTE",D4="FULLWIDTHMIDDLEDOT",FT="SEMI",aa="SLASH",Qh="TILDE",ty="UNDERSCORE",E4="EMOJI",ry="SYM";var L4=Object.freeze({__proto__:null,ALPHANUMERICAL:k4,AMPERSAND:Gg,APOSTROPHE:Wg,ASCIINUMERICAL:M4,ASTERISK:Ug,AT:Zo,BACKSLASH:Yg,BACKTICK:qg,CARET:Xg,CLOSEANGLEBRACKET:Og,CLOSEBRACE:Kh,CLOSEBRACKET:Lg,CLOSEPAREN:Pg,COLON:ts,COMMA:NT,DOLLAR:Kg,DOT:ia,EMOJI:E4,EQUALS:Zg,EXCLAMATION:BT,FULLWIDTHGREATERTHAN:Hg,FULLWIDTHLEFTPAREN:jg,FULLWIDTHLESSTHAN:$g,FULLWIDTHMIDDLEDOT:D4,FULLWIDTHRIGHTPAREN:Ng,HYPHEN:Kn,LEFTCORNERBRACKET:Bg,LEFTWHITECORNERBRACKET:Fg,LOCALHOST:Ed,NL:jT,NUM:OT,OPENANGLEBRACKET:Rg,OPENBRACE:Xh,OPENBRACKET:Eg,OPENPAREN:Ig,PERCENT:Zh,PIPE:Jg,PLUS:Qg,POUND:ey,QUERY:Jh,QUOTE:zT,RIGHTCORNERBRACKET:zg,RIGHTWHITECORNERBRACKET:Vg,SCHEME:Em,SEMI:FT,SLASH:aa,SLASH_SCHEME:_c,SYM:ry,TILDE:Qh,TLD:Pw,UNDERSCORE:ty,UTLD:Rw,UWORD:Iw,WORD:Za,WS:Ow});const Wa=/[a-z]/,Nf=new RegExp("\\p{L}","u"),Q1=new RegExp("\\p{Emoji}","u"),Ua=/\d/,eb=/\s/,mD="\r",tb=` `,Oee="️",jee="‍",rb="";let av=null,ov=null;function Nee(r=[]){const e={};Sn.groups=e;const t=new Sn;av==null&&(av=gD(Dee)),ov==null&&(ov=gD(Eee)),oe(t,"'",Wg),oe(t,"{",Xh),oe(t,"}",Kh),oe(t,"[",Eg),oe(t,"]",Lg),oe(t,"(",Ig),oe(t,")",Pg),oe(t,"<",Rg),oe(t,">",Og),oe(t,"(",jg),oe(t,")",Ng),oe(t,"「",Bg),oe(t,"」",zg),oe(t,"『",Fg),oe(t,"』",Vg),oe(t,"<",$g),oe(t,">",Hg),oe(t,"&",Gg),oe(t,"*",Ug),oe(t,"@",Zo),oe(t,"`",qg),oe(t,"^",Xg),oe(t,":",ts),oe(t,",",NT),oe(t,"$",Kg),oe(t,".",ia),oe(t,"=",Zg),oe(t,"!",BT),oe(t,"-",Kn),oe(t,"%",Zh),oe(t,"|",Jg),oe(t,"+",Qg),oe(t,"#",ey),oe(t,"?",Jh),oe(t,'"',zT),oe(t,"/",aa),oe(t,";",FT),oe(t,"~",Qh),oe(t,"_",ty),oe(t,"\\",Yg),oe(t,"・",D4);const n=Zt(t,Ua,OT,{[kw]:!0});Zt(n,Ua,n);const i=Zt(n,Wa,M4,{[qh]:!0}),a=Zt(n,Nf,k4,{[Th]:!0}),o=Zt(t,Wa,Za,{[Dw]:!0});Zt(o,Ua,i),Zt(o,Wa,o),Zt(i,Ua,i),Zt(i,Wa,i);const s=Zt(t,Nf,Iw,{[Ew]:!0});Zt(s,Wa),Zt(s,Ua,a),Zt(s,Nf,s),Zt(a,Ua,a),Zt(a,Wa),Zt(a,Nf,a);const l=oe(t,tb,jT,{[J1]:!0}),u=oe(t,mD,Ow,{[J1]:!0}),c=Zt(t,eb,Ow,{[J1]:!0});oe(t,rb,c),oe(u,tb,l),oe(u,rb,c),Zt(u,eb,c),oe(c,mD),oe(c,tb),Zt(c,eb,c),oe(c,rb,c);const f=Zt(t,Q1,E4,{[A4]:!0});oe(f,"#"),Zt(f,Q1,f),oe(f,Oee,f);const h=oe(f,jee);oe(h,"#"),Zt(h,Q1,f);const d=[[Wa,o],[Ua,i]],p=[[Wa,null],[Nf,s],[Ua,a]];for(let v=0;vv[0]>m[0]?1:-1);for(let v=0;v=0?y[Lw]=!0:Wa.test(m)?Ua.test(m)?y[qh]=!0:y[Dw]=!0:y[kw]=!0,vD(t,m,m,y)}return vD(t,"localhost",Ed,{ascii:!0}),t.jd=new Sn(ry),{start:t,tokens:Object.assign({groups:e},L4)}}function I4(r,e){const t=Bee(e.replace(/[A-Z]/g,s=>s.toLowerCase())),n=t.length,i=[];let a=0,o=0;for(;o=0&&(f+=t[o].length,h++),u+=t[o].length,a+=t[o].length,o++;a-=f,o-=h,u-=f,i.push({t:c.t,v:e.slice(a-u,a),s:a-u,e:a})}return i}function Bee(r){const e=[],t=r.length;let n=0;for(;n56319||n+1===t||(a=r.charCodeAt(n+1))<56320||a>57343?r[n]:r.slice(n,n+2);e.push(o),n+=o.length}return e}function jo(r,e,t,n,i){let a;const o=e.length;for(let s=0;s=0;)a++;if(a>0){e.push(t.join(""));for(let o=parseInt(r.substring(n,n+a),10);o>0;o--)t.pop();n+=a}else t.push(r[n]),n++}return e}const Ld={defaultProtocol:"http",events:null,format:yD,formatHref:yD,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function VT(r,e=null){let t=Object.assign({},Ld);r&&(t=Object.assign(t,r instanceof VT?r.o:r));const n=t.ignoreTags,i=[];for(let a=0;at?n.substring(0,t)+"…":n},toFormattedHref(r){return r.get("formatHref",this.toHref(r.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(r=Ld.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(r),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(r){return{type:this.t,value:this.toFormattedString(r),isLink:this.isLink,href:this.toFormattedHref(r),start:this.startIndex(),end:this.endIndex()}},validate(r){return r.get("validate",this.toString(),this)},render(r){const e=this,t=this.toHref(r.get("defaultProtocol")),n=r.get("formatHref",t,this),i=r.get("tagName",t,e),a=this.toFormattedString(r),o={},s=r.get("className",t,e),l=r.get("target",t,e),u=r.get("rel",t,e),c=r.getObj("attributes",t,e),f=r.getObj("events",t,e);return o.href=n,s&&(o.class=s),l&&(o.target=l),u&&(o.rel=u),c&&Object.assign(o,c),{tagName:i,attributes:o,content:a,eventListeners:f}}};function A0(r,e){class t extends P4{constructor(i,a){super(i,a),this.t=r}}for(const n in e)t.prototype[n]=e[n];return t.t=r,t}const bD=A0("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),_D=A0("text"),zee=A0("nl"),sv=A0("url",{isLink:!0,toHref(r=Ld.defaultProtocol){return this.hasProtocol()?this.v:`${r}://${this.v}`},hasProtocol(){const r=this.tk;return r.length>=2&&r[0].t!==Ed&&r[1].t===ts}}),Gn=r=>new Sn(r);function Fee({groups:r}){const e=r.domain.concat([Gg,Ug,Zo,Yg,qg,Xg,Kg,Zg,Kn,OT,Zh,Jg,Qg,ey,aa,ry,Qh,ty]),t=[Wg,ts,NT,ia,BT,Zh,Jh,zT,FT,Rg,Og,Xh,Kh,Lg,Eg,Ig,Pg,jg,Ng,Bg,zg,Fg,Vg,$g,Hg],n=[Gg,Wg,Ug,Yg,qg,Xg,Kg,Zg,Kn,Xh,Kh,Zh,Jg,Qg,ey,Jh,aa,ry,Qh,ty],i=Gn(),a=oe(i,Qh);st(a,n,a),st(a,r.domain,a);const o=Gn(),s=Gn(),l=Gn();st(i,r.domain,o),st(i,r.scheme,s),st(i,r.slashscheme,l),st(o,n,a),st(o,r.domain,o);const u=oe(o,Zo);oe(a,Zo,u),oe(s,Zo,u),oe(l,Zo,u);const c=oe(a,ia);st(c,n,a),st(c,r.domain,a);const f=Gn();st(u,r.domain,f),st(f,r.domain,f);const h=oe(f,ia);st(h,r.domain,f);const d=Gn(bD);st(h,r.tld,d),st(h,r.utld,d),oe(u,Ed,d);const p=oe(f,Kn);oe(p,Kn,p),st(p,r.domain,f),st(d,r.domain,f),oe(d,ia,h),oe(d,Kn,p);const v=oe(d,ts);st(v,r.numeric,bD);const m=oe(o,Kn),g=oe(o,ia);oe(m,Kn,m),st(m,r.domain,o),st(g,n,a),st(g,r.domain,o);const y=Gn(sv);st(g,r.tld,y),st(g,r.utld,y),st(y,r.domain,o),st(y,n,a),oe(y,ia,g),oe(y,Kn,m),oe(y,Zo,u);const b=oe(y,ts),_=Gn(sv);st(b,r.numeric,_);const x=Gn(sv),w=Gn();st(x,e,x),st(x,t,w),st(w,e,x),st(w,t,w),oe(y,aa,x),oe(_,aa,x);const S=oe(s,ts),T=oe(l,ts),C=oe(T,aa),A=oe(C,aa);st(s,r.domain,o),oe(s,ia,g),oe(s,Kn,m),st(l,r.domain,o),oe(l,ia,g),oe(l,Kn,m),st(S,r.domain,x),oe(S,aa,x),oe(S,Jh,x),st(A,r.domain,x),st(A,e,x),oe(A,aa,x);const M=[[Xh,Kh],[Eg,Lg],[Ig,Pg],[Rg,Og],[jg,Ng],[Bg,zg],[Fg,Vg],[$g,Hg]];for(let D=0;D=0&&h++,i++,c++;if(h<0)i-=c,i0&&(a.push(nb(_D,e,o)),o=[]),i-=h,c-=h;const d=f.t,p=t.slice(i-c,i);a.push(nb(d,e,p))}}return o.length>0&&a.push(nb(_D,e,o)),a}function nb(r,e,t){const n=t[0].s,i=t[t.length-1].e,a=e.slice(n,i);return new r(a,t)}const $ee=typeof console<"u"&&console&&console.warn||(()=>{}),Hee="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Ft={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Gee(){return Sn.groups={},Ft.scanner=null,Ft.parser=null,Ft.tokenQueue=[],Ft.pluginQueue=[],Ft.customSchemes=[],Ft.initialized=!1,Ft}function xD(r,e=!1){if(Ft.initialized&&$ee(`linkifyjs: already initialized - will not register custom scheme "${r}" ${Hee}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(r))throw new Error(`linkifyjs: incorrect scheme format. 1. Must only contain digits, lowercase ASCII letters or "-" 2. Cannot start or end with "-" 3. "-" cannot repeat`);Ft.customSchemes.push([r,e])}function Wee(){Ft.scanner=Nee(Ft.customSchemes);for(let r=0;r{const i=e.some(u=>u.docChanged)&&!t.doc.eq(n.doc),a=e.some(u=>u.getMeta("preventAutolink"));if(!i||a)return;const{tr:o}=n,s=gK(t.doc,[...e]);if(TK(s).forEach(({newRange:u})=>{const c=bK(n.doc,u,d=>d.isTextblock);let f,h;if(c.length>1)f=c[0],h=n.doc.textBetween(f.pos,f.pos+f.node.nodeSize,void 0," ");else if(c.length){const d=n.doc.textBetween(u.from,u.to," "," ");if(!Yee.test(d))return;f=c[0],h=n.doc.textBetween(f.pos,u.to,void 0," ")}if(f&&h){const d=h.split(Uee).filter(Boolean);if(d.length<=0)return!1;const p=d[d.length-1],v=f.pos+h.lastIndexOf(p);if(!p)return!1;const m=$T(p).map(g=>g.toObject(r.defaultProtocol));if(!Xee(m))return!1;m.filter(g=>g.isLink).map(g=>({...g,from:v+g.start+1,to:v+g.end+1})).filter(g=>n.schema.marks.code?!n.doc.rangeHasMark(g.from,g.to,n.schema.marks.code):!0).filter(g=>r.validate(g.value)).filter(g=>r.shouldAutoLink(g.value)).forEach(g=>{DT(g.from,g.to,n.doc).some(y=>y.mark.type===r.type)||o.addMark(g.from,g.to,r.type.create({href:g.href}))})}}),!!o.steps.length)return o}})}function Zee(r){return new Ut({key:new jt("handleClickLink"),props:{handleClick:(e,t,n)=>{var i,a;if(n.button!==0||!e.editable)return!1;let o=n.target;const s=[];for(;o.nodeName!=="DIV";)s.push(o),o=o.parentNode;if(!s.find(h=>h.nodeName==="A"))return!1;const l=xK(e.state,r.type.name),u=n.target,c=(i=u==null?void 0:u.href)!==null&&i!==void 0?i:l.href,f=(a=u==null?void 0:u.target)!==null&&a!==void 0?a:l.target;return u&&c?(window.open(c,f),!0):!1}}})}function Jee(r){return new Ut({key:new jt("handlePasteLink"),props:{handlePaste:(e,t,n)=>{const{state:i}=e,{selection:a}=i,{empty:o}=a;if(o)return!1;let s="";n.content.forEach(u=>{s+=u.textContent});const l=R4(s,{defaultProtocol:r.defaultProtocol}).find(u=>u.isLink&&u.value===s);return!s||!l?!1:r.editor.commands.setMark(r.type,{href:l.href})}}})}function Gs(r,e){const t=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(n=>{const i=typeof n=="string"?n:n.scheme;i&&t.push(i)}),!r||r.replace(qee,"").match(new RegExp(`^(?:(?:${t.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const Qee=Da.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(r=>{if(typeof r=="string"){xD(r);return}xD(r.scheme,r.optionalSlashes)})},onDestroy(){Gee()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(r,e)=>!!Gs(r,e.protocols),validate:r=>!!r,shouldAutoLink:r=>!!r}},addAttributes(){return{href:{default:null,parseHTML(r){return r.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:r=>{const e=r.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!Gs(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:r}){return this.options.isAllowedUri(r.href,{defaultValidate:e=>!!Gs(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Lt(this.options.HTMLAttributes,r),0]:["a",Lt(this.options.HTMLAttributes,{...r,href:""}),0]},addCommands(){return{setLink:r=>({chain:e})=>{const{href:t}=r;return this.options.isAllowedUri(t,{defaultValidate:n=>!!Gs(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,r).setMeta("preventAutolink",!0).run():!1},toggleLink:r=>({chain:e})=>{const{href:t}=r;return this.options.isAllowedUri(t,{defaultValidate:n=>!!Gs(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,r,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:r})=>r().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[fu({find:r=>{const e=[];if(r){const{protocols:t,defaultProtocol:n}=this.options,i=R4(r).filter(a=>a.isLink&&this.options.isAllowedUri(a.value,{defaultValidate:o=>!!Gs(o,t),protocols:t,defaultProtocol:n}));i.length&&i.forEach(a=>e.push({text:a.value,data:{href:a.href},index:a.start}))}return e},type:this.type,getAttributes:r=>{var e;return{href:(e=r.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const r=[],{protocols:e,defaultProtocol:t}=this.options;return this.options.autolink&&r.push(Kee({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:n=>this.options.isAllowedUri(n,{defaultValidate:i=>!!Gs(i,e),protocols:e,defaultProtocol:t}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&r.push(Zee({type:this.type})),this.options.linkOnPaste&&r.push(Jee({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),r}});function O4(r){return!!(r===""||/^(https?:\/\/|mailto:|tel:|\/\/)[^\s]+$/i.test(r)||/^([./#][^\s]*)$/i.test(r)||/^[\w\-]([\w\-./#?=&%]*)$/i.test(r))}const ete={class:"p-2 flex min-w-72 items-center gap-2 bg-surface-white shadow-xl rounded-lg"},tte={class:"shrink-0 flex items-center gap-2"},rte=Ke({__name:"EditLink",props:{href:{}},emits:["updateHref","close"],setup(r,{emit:e}){const t=r,n=e,i=te(t.href),a=bm("input"),o=()=>{(i.value===""||O4(i.value))&&n("updateHref",i.value)};return zi(async()=>{var s;await Ca(),(s=a.value)!=null&&s.el&&(a.value.el.focus(),a.value.el.select())}),(s,l)=>(Y(),ae("div",ete,[Ie(hU,{ref_key:"input",ref:a,type:"text",class:"w-full",placeholder:"https://example.com",modelValue:i.value,"onUpdate:modelValue":l[0]||(l[0]=u=>i.value=u),onKeydown:[Ac(o,["enter"]),l[1]||(l[1]=Ac(u=>s.$emit("close"),["esc"]))]},null,8,["modelValue"]),Z("div",tte,[Ie(Ci,{text:"Submit",placement:"top"},{default:_e(()=>[Ie(ui,{label:"Submit",onClick:o},{icon:_e(()=>[Ie(H(sU),{class:"size-4"})]),_:1})]),_:1}),Ie(Ci,{text:"Remove link",placement:"top"},{default:_e(()=>[Ie(ui,{label:"Remove link",onClick:l[2]||(l[2]=u=>s.$emit("updateHref",""))},{icon:_e(()=>[Ie(H(C0),{class:"size-4"})]),_:1})]),_:1})])]))}});function nte(r){return new Ut({key:new jt("handlePasteLink"),props:{handlePaste:(e,t,n)=>{const{state:i}=e,{selection:a}=i,{empty:o}=a;if(o)return!1;let s="";if(n.content.forEach(u=>{s+=u.textContent}),!s)return!1;let l=O4(s)?s:null;return l?r.editor.chain().setTextSelection({from:a.from,to:a.to}).setLink({href:l}).setTextSelection(a.to).command(({tr:u})=>(u.setStoredMarks([]),!0)).run():!1}}})}Qee.extend({addOptions(){var r;return{...(r=this.parent)==null?void 0:r.call(this),openOnClick:!1,autolink:!0,defaultProtocol:"https",linkOnPaste:!1}},addCommands(){var r;return{...(r=this.parent)==null?void 0:r.call(this),openLinkEditor:()=>({editor:e})=>{const{state:t}=e,{from:n,to:i}=t.selection,{doc:a}=t;let o,s,l=!1;if(n===i){const d=t.selection.$from,p=x0(d,this.type);if(p)o=p,s=a.resolve(p.from).marks().find(v=>v.type===this.type),e.chain().setTextSelection({from:p.from,to:p.to}).run(),l=!0;else return!1}else o={from:n,to:i},s=a.resolve(n).marks().find(d=>d.type===this.type);if(!o)return!1;const u=(s==null?void 0:s.attrs.href)||"",c=o.from,f=o.to,h=()=>{ite(u,e.view.dom).then(d=>{if(d===null)return;let p=e.chain().focus(null,{scrollIntoView:!1});if(d===""){p.setTextSelection({from:c,to:f}).unsetLink().command(({tr:g})=>(g.setStoredMarks([]),!0)).run();return}p=p.setTextSelection({from:c,to:f}).setLink({href:d}).setTextSelection(f).command(({tr:g})=>(g.setStoredMarks([]),!0));const v=f,m=v{})};return l?requestAnimationFrame(h):h(),!0}}},addKeyboardShortcuts(){return{"Mod-k":()=>this.editor.commands.openLinkEditor()}},addProseMirrorPlugins(){var e;let r=((e=this.parent)==null?void 0:e.call(this))||[];return r.push(nte({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),r.push(ate({editor:this.editor,type:this.type})),r}});function ite(r,e){return new Promise((t,n)=>{const i=document.createElement("div");document.body.appendChild(i);let a;const o=window.getSelection();if(o&&o.rangeCount>0){const d=o.getRangeAt(0),p=d.getBoundingClientRect(),v=d.collapsed;a={getBoundingClientRect:()=>({width:0,height:p.height,top:p.top,right:v?p.left:p.right,bottom:p.bottom,left:p.left,x:p.left,y:p.top,toJSON:()=>{}})}}else a={getBoundingClientRect:()=>e.getBoundingClientRect()};let s=null,l=null,u=!1,c=!1;const f=(d,p)=>{c||(c=!0,d==="resolve"?t(p):n(p))},h=()=>{u||(u=!0,f("reject","Link editing cancelled or destroyed"),requestAnimationFrame(()=>{l==null||l.destroy(),s==null||s.unmount(),i==null||i.remove(),s=null,l=null}))};if(s=w3({render(){return so(rte,{href:r,onClose:()=>{f("reject","Link editing cancelled"),h()},onUpdateHref:d=>{f("resolve",d),h()}})}}),s.mount(i),l=df(e,{getReferenceClientRect:()=>a.getBoundingClientRect(),content:i,trigger:"manual",interactive:!0,appendTo:document.body,placement:"top",arrow:!1,theme:"link-editor",maxWidth:"none",onHidden(){h()},hideOnClick:!0,interactiveDebounce:75}),!l){i.remove(),f("reject","Failed to initialize link editor tooltip");return}l.show()})}function ate(r){return new Ut({key:new jt("clearLinkMarkOnBoundary"),appendTransaction:(e,t,n)=>{if(!r.editor.isEditable)return null;const{tr:i,doc:a,selection:o,storedMarks:s}=n,{$from:l,empty:u}=o;if(!u||!s||s.length===0)return null;const c=r.type;return!s.some(p=>p.type===c)||l.marks().some(p=>p.type===c)?null:i.setStoredMarks([])}})}const ote=r=>ir({find:/--$/,replace:r??"—"}),ste=r=>ir({find:/\.\.\.$/,replace:r??"…"}),lte=r=>ir({find:/(?:^|[\s{[(<'"\u2018\u201C])(")$/,replace:r??"“"}),ute=r=>ir({find:/"$/,replace:r??"”"}),cte=r=>ir({find:/(?:^|[\s{[(<'"\u2018\u201C])(')$/,replace:r??"‘"}),fte=r=>ir({find:/'$/,replace:r??"’"}),hte=r=>ir({find:/<-$/,replace:r??"←"}),dte=r=>ir({find:/->$/,replace:r??"→"}),pte=r=>ir({find:/\(c\)$/,replace:r??"©"}),vte=r=>ir({find:/\(tm\)$/,replace:r??"™"}),mte=r=>ir({find:/\(sm\)$/,replace:r??"℠"}),gte=r=>ir({find:/\(r\)$/,replace:r??"®"}),yte=r=>ir({find:/(?:^|\s)(1\/2)\s$/,replace:r??"½"}),bte=r=>ir({find:/\+\/-$/,replace:r??"±"}),_te=r=>ir({find:/!=$/,replace:r??"≠"}),xte=r=>ir({find:/<<$/,replace:r??"«"}),wte=r=>ir({find:/>>$/,replace:r??"»"}),Ste=r=>ir({find:/\d+\s?([*x])\s?\d+$/,replace:r??"×"}),Tte=r=>ir({find:/\^2$/,replace:r??"²"}),Cte=r=>ir({find:/\^3$/,replace:r??"³"}),Ate=r=>ir({find:/(?:^|\s)(1\/4)\s$/,replace:r??"¼"}),Mte=r=>ir({find:/(?:^|\s)(3\/4)\s$/,replace:r??"¾"});Kt.create({name:"typography",addOptions(){return{closeDoubleQuote:"”",closeSingleQuote:"’",copyright:"©",ellipsis:"…",emDash:"—",laquo:"«",leftArrow:"←",multiplication:"×",notEqual:"≠",oneHalf:"½",oneQuarter:"¼",openDoubleQuote:"“",openSingleQuote:"‘",plusMinus:"±",raquo:"»",registeredTrademark:"®",rightArrow:"→",servicemark:"℠",superscriptThree:"³",superscriptTwo:"²",threeQuarters:"¾",trademark:"™"}},addInputRules(){const r=[];return this.options.emDash!==!1&&r.push(ote(this.options.emDash)),this.options.ellipsis!==!1&&r.push(ste(this.options.ellipsis)),this.options.openDoubleQuote!==!1&&r.push(lte(this.options.openDoubleQuote)),this.options.closeDoubleQuote!==!1&&r.push(ute(this.options.closeDoubleQuote)),this.options.openSingleQuote!==!1&&r.push(cte(this.options.openSingleQuote)),this.options.closeSingleQuote!==!1&&r.push(fte(this.options.closeSingleQuote)),this.options.leftArrow!==!1&&r.push(hte(this.options.leftArrow)),this.options.rightArrow!==!1&&r.push(dte(this.options.rightArrow)),this.options.copyright!==!1&&r.push(pte(this.options.copyright)),this.options.trademark!==!1&&r.push(vte(this.options.trademark)),this.options.servicemark!==!1&&r.push(mte(this.options.servicemark)),this.options.registeredTrademark!==!1&&r.push(gte(this.options.registeredTrademark)),this.options.oneHalf!==!1&&r.push(yte(this.options.oneHalf)),this.options.plusMinus!==!1&&r.push(bte(this.options.plusMinus)),this.options.notEqual!==!1&&r.push(_te(this.options.notEqual)),this.options.laquo!==!1&&r.push(xte(this.options.laquo)),this.options.raquo!==!1&&r.push(wte(this.options.raquo)),this.options.multiplication!==!1&&r.push(Ste(this.options.multiplication)),this.options.superscriptTwo!==!1&&r.push(Tte(this.options.superscriptTwo)),this.options.superscriptThree!==!1&&r.push(Cte(this.options.superscriptThree)),this.options.oneQuarter!==!1&&r.push(Ate(this.options.oneQuarter)),this.options.threeQuarters!==!1&&r.push(Mte(this.options.threeQuarters)),r}});const kte=r=>{if(!r.children.length)return;const e=r.querySelectorAll("span");e&&e.forEach(t=>{var n,i;const a=t.getAttribute("style"),o=(i=(n=t.parentElement)===null||n===void 0?void 0:n.closest("span"))===null||i===void 0?void 0:i.getAttribute("style");t.setAttribute("style",`${o};${a}`)})};Da.create({name:"textStyle",priority:101,addOptions(){return{HTMLAttributes:{},mergeNestedSpanStyles:!1}},parseHTML(){return[{tag:"span",getAttrs:r=>r.hasAttribute("style")?(this.options.mergeNestedSpanStyles&&kte(r),{}):!1}]},renderHTML({HTMLAttributes:r}){return["span",Lt(this.options.HTMLAttributes,r),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:r})=>{const{selection:e}=r;return r.doc.nodesBetween(e.from,e.to,(t,n)=>{if(t.isTextblock)return!0;t.marks.filter(i=>i.type===this.type).some(i=>Object.values(i.attrs).some(a=>!!a))||r.removeMark(n,n+t.nodeSize,this.type)}),!0}}}});const Dte=/^\s*(\[([( |x])?\])\s$/;ar.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:r=>{const e=r.getAttribute("data-checked");return e===""||e==="true"},renderHTML:r=>({"data-checked":r.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:r,HTMLAttributes:e}){return["li",Lt(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:r.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const r={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...r,Tab:()=>this.editor.commands.sinkListItem(this.name)}:r},addNodeView(){return({node:r,HTMLAttributes:e,getPos:t,editor:n})=>{const i=document.createElement("li"),a=document.createElement("label"),o=document.createElement("span"),s=document.createElement("input"),l=document.createElement("div"),u=()=>{var c,f;s.ariaLabel=((f=(c=this.options.a11y)===null||c===void 0?void 0:c.checkboxLabel)===null||f===void 0?void 0:f.call(c,r,s.checked))||`Task item checkbox for ${r.textContent||"empty task item"}`};return u(),a.contentEditable="false",s.type="checkbox",s.addEventListener("mousedown",c=>c.preventDefault()),s.addEventListener("change",c=>{if(!n.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}const{checked:f}=c.target;n.isEditable&&typeof t=="function"&&n.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:h})=>{const d=t();if(typeof d!="number")return!1;const p=h.doc.nodeAt(d);return h.setNodeMarkup(d,void 0,{...p==null?void 0:p.attrs,checked:f}),!0}).run(),!n.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(r,f)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([c,f])=>{i.setAttribute(c,f)}),i.dataset.checked=r.attrs.checked,s.checked=r.attrs.checked,a.append(s,o),i.append(a,l),Object.entries(e).forEach(([c,f])=>{i.setAttribute(c,f)}),{dom:i,contentDOM:l,update:c=>c.type!==this.type?!1:(i.dataset.checked=c.attrs.checked,s.checked=c.attrs.checked,u(),!0)}}},addInputRules(){return[Kc({find:Dte,type:this.type,getAttributes:r=>({checked:r[r.length-1]==="x"})})]}});ar.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:r}){return["ul",Lt(this.options.HTMLAttributes,r,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:r})=>r.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});const j4={black:"#000000",red:"#dc2626",blue:"#1579D0",green:"#16a34a",yellow:"#ca8a04",orange:"#ea580c",purple:"#9333ea",pink:"#db2777",gray:"#6b7280",indigo:"#4f46e5",teal:"#0d9488",cyan:"#06b6d4"},N4={red:"#fecaca",blue:"#bfdbfe",green:"#bbf7d0",yellow:"#fef08a",orange:"#fed7aa",purple:"#e9d5ff",pink:"#fbcfe8",gray:"#e5e7eb",indigo:"#c7d2fe",teal:"#99f6e4",cyan:"#a5f3fc"},B4={"#1F272E":"gray","#ca8a04":"yellow","#ea580c":"orange","#dc2626":"red","#16a34a":"green","#1579D0":"blue","#9333ea":"purple","#db2777":"pink"},z4={"#fef9c3":"yellow","#ffedd5":"orange","#fee2e2":"red","#dcfce7":"green","#D3E9FC":"blue","#f3e8ff":"purple","#fce7f3":"pink"};function jw(r,e,t,n){if(n&&r.startsWith("#")&&n[r])return n[r];let i=0,a=0,o=0;if(r.startsWith("#")){const u=r.substring(1);u.length===6&&(i=parseInt(u.substring(0,2),16),a=parseInt(u.substring(2,4),16),o=parseInt(u.substring(4,6),16))}else if(r.startsWith("rgb")){const u=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i.exec(r);u&&(i=parseInt(u[1],10),a=parseInt(u[2],10),o=parseInt(u[3],10))}if(isNaN(i)||isNaN(a)||isNaN(o))return null;let s=null,l=1/0;for(const u of e){const c=t[u];if(!c)continue;const f=c.startsWith("#")?c.substring(1):c;if(f.length!==6)continue;const h=parseInt(f.substring(0,2),16),d=parseInt(f.substring(2,4),16),p=parseInt(f.substring(4,6),16),v=Math.sqrt(Math.pow(i-h,2)+Math.pow(a-d,2)+Math.pow(o-p,2));v{const e=r.getAttribute("style");if(e){const t=e.match(/color:\s*var\(--prose-color-(\w+)\)/);if(t&&this.options.colors.includes(t[1]))return t[1];const n=Ete(e,this.options.colors);if(n)return n}return null},renderHTML:r=>!r.color||!this.options.colors.includes(r.color)?{}:{style:`color: var(--prose-color-${r.color})`}}}}]},addCommands(){return{setColorByName:r=>({chain:e,state:t,editor:n})=>{if(!this.options.colors.includes(r))return console.warn(`Color "${r}" is not in the allowed colors list`),!1;const{to:i,empty:a}=t.selection;let o=e().setMark("textStyle",{color:r});return a||(o=o.setTextSelection(i).command(({tr:s})=>(s.setStoredMarks([]),!0))),o.focus().run()},unsetColor:()=>({chain:r})=>r().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}});Da.create({name:"namedHighlight",addOptions(){return{HTMLAttributes:{},multicolor:!0,colors:["yellow","blue","green","red","orange","purple","pink","gray","teal","cyan"]}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:r=>{const e=r.getAttribute("style");if(e){const n=e.match(/background-color:\s*var\(--prose-highlight-(\w+)\)/);if(n&&this.options.colors.includes(n[1]))return n[1]}const t=r.getAttribute("data-color");if(t){const n=jw(t,this.options.colors,N4,z4);if(n)return n}if(e){const n=Lte(e,this.options.colors);if(n)return n}return null},renderHTML:r=>!r.color||!this.options.colors.includes(r.color)?{}:{style:`background-color: var(--prose-highlight-${r.color})`}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:r}){return["mark",Lt(this.options.HTMLAttributes,r),0]},addCommands(){return{setHighlightByName:r=>({chain:e,commands:t,editor:n,state:i})=>{if(!this.options.colors.includes(r))return console.warn(`Highlight color "${r}" is not in the allowed colors list`),!1;const{from:a,to:o,empty:s}=i.selection;let l=e();return this.options.multicolor?l=l.setMark(this.name,{color:r}):l=l.setMark(this.name),s||(l=l.setTextSelection(o).command(({tr:u})=>(u.setStoredMarks([]),!0))),l.focus().run()},toggleHighlightByName:r=>({chain:e,commands:t,editor:n,state:i})=>{if(!this.options.colors.includes(r))return console.warn(`Highlight color "${r}" is not in the allowed colors list`),!1;const{to:a,empty:o}=i.selection,s=this.options.multicolor?{color:r}:void 0,l=n.isActive(this.name,s);let u=e().toggleMark(this.name,s);return!o&&!l&&(u=u.setTextSelection(a).command(({tr:c})=>(c.setStoredMarks([]),!0))),u.focus().run()},unsetHighlight:()=>({commands:r})=>r.unsetMark(this.name)}}});function Ite(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function V4(r){return r instanceof Map?r.clear=r.delete=r.set=function(){throw new Error("map is read-only")}:r instanceof Set&&(r.add=r.clear=r.delete=function(){throw new Error("set is read-only")}),Object.freeze(r),Object.getOwnPropertyNames(r).forEach(e=>{const t=r[e],n=typeof t;(n==="object"||n==="function")&&!Object.isFrozen(t)&&V4(t)}),r}class wD{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function $4(r){return r.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function as(r,...e){const t=Object.create(null);for(const n in r)t[n]=r[n];return e.forEach(function(n){for(const i in n)t[i]=n[i]}),t}const Pte="",SD=r=>!!r.scope,Rte=(r,{prefix:e})=>{if(r.startsWith("language:"))return r.replace("language:","language-");if(r.includes(".")){const t=r.split(".");return[`${e}${t.shift()}`,...t.map((n,i)=>`${n}${"_".repeat(i+1)}`)].join(" ")}return`${e}${r}`};class Ote{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=$4(e)}openNode(e){if(!SD(e))return;const t=Rte(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){SD(e)&&(this.buffer+=Pte)}value(){return this.buffer}span(e){this.buffer+=``}}const TD=(r={})=>{const e={children:[]};return Object.assign(e,r),e};class GT{constructor(){this.rootNode=TD(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t=TD({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t=="string"?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(n=>this._walk(e,n)),e.closeNode(t)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(t=>typeof t=="string")?e.children=[e.children.join("")]:e.children.forEach(t=>{GT._collapse(t)}))}}class jte extends GT{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){const n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new Ote(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Id(r){return r?typeof r=="string"?r:r.source:null}function H4(r){return Au("(?=",r,")")}function Nte(r){return Au("(?:",r,")*")}function Bte(r){return Au("(?:",r,")?")}function Au(...r){return r.map(t=>Id(t)).join("")}function zte(r){const e=r[r.length-1];return typeof e=="object"&&e.constructor===Object?(r.splice(r.length-1,1),e):{}}function WT(...r){return"("+(zte(r).capture?"":"?:")+r.map(n=>Id(n)).join("|")+")"}function G4(r){return new RegExp(r.toString()+"|").exec("").length-1}function Fte(r,e){const t=r&&r.exec(e);return t&&t.index===0}const Vte=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function UT(r,{joinWith:e}){let t=0;return r.map(n=>{t+=1;const i=t;let a=Id(n),o="";for(;a.length>0;){const s=Vte.exec(a);if(!s){o+=a;break}o+=a.substring(0,s.index),a=a.substring(s.index+s[0].length),s[0][0]==="\\"&&s[1]?o+="\\"+String(Number(s[1])+i):(o+=s[0],s[0]==="("&&t++)}return o}).map(n=>`(${n})`).join(e)}const $te=/\b\B/,W4="[a-zA-Z]\\w*",YT="[a-zA-Z_]\\w*",U4="\\b\\d+(\\.\\d+)?",Y4="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",q4="\\b(0b[01]+)",Hte="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Gte=(r={})=>{const e=/^#![ ]*\//;return r.binary&&(r.begin=Au(e,/.*\b/,r.binary,/\b.*/)),as({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(t,n)=>{t.index!==0&&n.ignoreMatch()}},r)},Pd={begin:"\\\\[\\s\\S]",relevance:0},Wte={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Pd]},Ute={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Pd]},Yte={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},M0=function(r,e,t={}){const n=as({scope:"comment",begin:r,end:e,contains:[]},t);n.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const i=WT("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return n.contains.push({begin:Au(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},qte=M0("//","$"),Xte=M0("/\\*","\\*/"),Kte=M0("#","$"),Zte={scope:"number",begin:U4,relevance:0},Jte={scope:"number",begin:Y4,relevance:0},Qte={scope:"number",begin:q4,relevance:0},ere={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Pd,{begin:/\[/,end:/\]/,relevance:0,contains:[Pd]}]},tre={scope:"title",begin:W4,relevance:0},rre={scope:"title",begin:YT,relevance:0},nre={begin:"\\.\\s*"+YT,relevance:0},ire=function(r){return Object.assign(r,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})};var lv=Object.freeze({__proto__:null,APOS_STRING_MODE:Wte,BACKSLASH_ESCAPE:Pd,BINARY_NUMBER_MODE:Qte,BINARY_NUMBER_RE:q4,COMMENT:M0,C_BLOCK_COMMENT_MODE:Xte,C_LINE_COMMENT_MODE:qte,C_NUMBER_MODE:Jte,C_NUMBER_RE:Y4,END_SAME_AS_BEGIN:ire,HASH_COMMENT_MODE:Kte,IDENT_RE:W4,MATCH_NOTHING_RE:$te,METHOD_GUARD:nre,NUMBER_MODE:Zte,NUMBER_RE:U4,PHRASAL_WORDS_MODE:Yte,QUOTE_STRING_MODE:Ute,REGEXP_MODE:ere,RE_STARTERS_RE:Hte,SHEBANG:Gte,TITLE_MODE:tre,UNDERSCORE_IDENT_RE:YT,UNDERSCORE_TITLE_MODE:rre});function are(r,e){r.input[r.index-1]==="."&&e.ignoreMatch()}function ore(r,e){r.className!==void 0&&(r.scope=r.className,delete r.className)}function sre(r,e){e&&r.beginKeywords&&(r.begin="\\b("+r.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",r.__beforeBegin=are,r.keywords=r.keywords||r.beginKeywords,delete r.beginKeywords,r.relevance===void 0&&(r.relevance=0))}function lre(r,e){Array.isArray(r.illegal)&&(r.illegal=WT(...r.illegal))}function ure(r,e){if(r.match){if(r.begin||r.end)throw new Error("begin & end are not supported with match");r.begin=r.match,delete r.match}}function cre(r,e){r.relevance===void 0&&(r.relevance=1)}const fre=(r,e)=>{if(!r.beforeMatch)return;if(r.starts)throw new Error("beforeMatch cannot be used with starts");const t=Object.assign({},r);Object.keys(r).forEach(n=>{delete r[n]}),r.keywords=t.keywords,r.begin=Au(t.beforeMatch,H4(t.begin)),r.starts={relevance:0,contains:[Object.assign(t,{endsParent:!0})]},r.relevance=0,delete t.beforeMatch},hre=["of","and","for","in","not","or","if","then","parent","list","value"],dre="keyword";function X4(r,e,t=dre){const n=Object.create(null);return typeof r=="string"?i(t,r.split(" ")):Array.isArray(r)?i(t,r):Object.keys(r).forEach(function(a){Object.assign(n,X4(r[a],e,a))}),n;function i(a,o){e&&(o=o.map(s=>s.toLowerCase())),o.forEach(function(s){const l=s.split("|");n[l[0]]=[a,pre(l[0],l[1])]})}}function pre(r,e){return e?Number(e):vre(r)?0:1}function vre(r){return hre.includes(r.toLowerCase())}const CD={},Xl=r=>{console.error(r)},AD=(r,...e)=>{console.log(`WARN: ${r}`,...e)},Uu=(r,e)=>{CD[`${r}/${e}`]||(console.log(`Deprecated as of ${r}. ${e}`),CD[`${r}/${e}`]=!0)},ny=new Error;function K4(r,e,{key:t}){let n=0;const i=r[t],a={},o={};for(let s=1;s<=e.length;s++)o[s+n]=i[s],a[s+n]=!0,n+=G4(e[s-1]);r[t]=o,r[t]._emit=a,r[t]._multi=!0}function mre(r){if(Array.isArray(r.begin)){if(r.skip||r.excludeBegin||r.returnBegin)throw Xl("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ny;if(typeof r.beginScope!="object"||r.beginScope===null)throw Xl("beginScope must be object"),ny;K4(r,r.begin,{key:"beginScope"}),r.begin=UT(r.begin,{joinWith:""})}}function gre(r){if(Array.isArray(r.end)){if(r.skip||r.excludeEnd||r.returnEnd)throw Xl("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ny;if(typeof r.endScope!="object"||r.endScope===null)throw Xl("endScope must be object"),ny;K4(r,r.end,{key:"endScope"}),r.end=UT(r.end,{joinWith:""})}}function yre(r){r.scope&&typeof r.scope=="object"&&r.scope!==null&&(r.beginScope=r.scope,delete r.scope)}function bre(r){yre(r),typeof r.beginScope=="string"&&(r.beginScope={_wrap:r.beginScope}),typeof r.endScope=="string"&&(r.endScope={_wrap:r.endScope}),mre(r),gre(r)}function _re(r){function e(o,s){return new RegExp(Id(o),"m"+(r.case_insensitive?"i":"")+(r.unicodeRegex?"u":"")+(s?"g":""))}class t{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(s,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,s]),this.matchAt+=G4(s)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const s=this.regexes.map(l=>l[1]);this.matcherRe=e(UT(s,{joinWith:"|"}),!0),this.lastIndex=0}exec(s){this.matcherRe.lastIndex=this.lastIndex;const l=this.matcherRe.exec(s);if(!l)return null;const u=l.findIndex((f,h)=>h>0&&f!==void 0),c=this.matchIndexes[u];return l.splice(0,u),Object.assign(l,c)}}class n{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(s){if(this.multiRegexes[s])return this.multiRegexes[s];const l=new t;return this.rules.slice(s).forEach(([u,c])=>l.addRule(u,c)),l.compile(),this.multiRegexes[s]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(s,l){this.rules.push([s,l]),l.type==="begin"&&this.count++}exec(s){const l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let u=l.exec(s);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const c=this.getMatcher(0);c.lastIndex=this.lastIndex+1,u=c.exec(s)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function i(o){const s=new n;return o.contains.forEach(l=>s.addRule(l.begin,{rule:l,type:"begin"})),o.terminatorEnd&&s.addRule(o.terminatorEnd,{type:"end"}),o.illegal&&s.addRule(o.illegal,{type:"illegal"}),s}function a(o,s){const l=o;if(o.isCompiled)return l;[ore,ure,bre,fre].forEach(c=>c(o,s)),r.compilerExtensions.forEach(c=>c(o,s)),o.__beforeBegin=null,[sre,lre,cre].forEach(c=>c(o,s)),o.isCompiled=!0;let u=null;return typeof o.keywords=="object"&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),u=o.keywords.$pattern,delete o.keywords.$pattern),u=u||/\w+/,o.keywords&&(o.keywords=X4(o.keywords,r.case_insensitive)),l.keywordPatternRe=e(u,!0),s&&(o.begin||(o.begin=/\B|\b/),l.beginRe=e(l.begin),!o.end&&!o.endsWithParent&&(o.end=/\B|\b/),o.end&&(l.endRe=e(l.end)),l.terminatorEnd=Id(l.end)||"",o.endsWithParent&&s.terminatorEnd&&(l.terminatorEnd+=(o.end?"|":"")+s.terminatorEnd)),o.illegal&&(l.illegalRe=e(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(c){return xre(c==="self"?o:c)})),o.contains.forEach(function(c){a(c,l)}),o.starts&&a(o.starts,s),l.matcher=i(l),l}if(r.compilerExtensions||(r.compilerExtensions=[]),r.contains&&r.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return r.classNameAliases=as(r.classNameAliases||{}),a(r)}function Z4(r){return r?r.endsWithParent||Z4(r.starts):!1}function xre(r){return r.variants&&!r.cachedVariants&&(r.cachedVariants=r.variants.map(function(e){return as(r,{variants:null},e)})),r.cachedVariants?r.cachedVariants:Z4(r)?as(r,{starts:r.starts?as(r.starts):null}):Object.isFrozen(r)?as(r):r}var wre="11.10.0";class Sre extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}const ib=$4,MD=as,kD=Symbol("nomatch"),Tre=7,J4=function(r){const e=Object.create(null),t=Object.create(null),n=[];let i=!0;const a="Could not find the language '{}', did you forget to load/include a language module?",o={disableAutodetect:!0,name:"Plain text",contains:[]};let s={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:jte};function l(P){return s.noHighlightRe.test(P)}function u(P){let O=P.className+" ";O+=P.parentNode?P.parentNode.className:"";const j=s.languageDetectRe.exec(O);if(j){const F=C(j[1]);return F||(AD(a.replace("{}",j[1])),AD("Falling back to no-highlight mode for this block.",P)),F?j[1]:"no-highlight"}return O.split(/\s+/).find(F=>l(F)||C(F))}function c(P,O,j){let F="",N="";typeof O=="object"?(F=P,j=O.ignoreIllegals,N=O.language):(Uu("10.7.0","highlight(lang, code, ...args) has been deprecated."),Uu("10.7.0",`Please use highlight(code, options) instead. https://github.com/highlightjs/highlight.js/issues/2277`),N=P,F=O),j===void 0&&(j=!0);const B={code:F,language:N};I("before:highlight",B);const $=B.result?B.result:f(B.language,B.code,j);return $.code=B.code,I("after:highlight",$),$}function f(P,O,j,F){const N=Object.create(null);function B(pe,De){return pe.keywords[De]}function $(){if(!xe.keywords){at.addText(ht);return}let pe=0;xe.keywordPatternRe.lastIndex=0;let De=xe.keywordPatternRe.exec(ht),tt="";for(;De;){tt+=ht.substring(pe,De.index);const mt=he.case_insensitive?De[0].toLowerCase():De[0],or=B(xe,mt);if(or){const[$r,Io]=or;if(at.addText(tt),tt="",N[mt]=(N[mt]||0)+1,N[mt]<=Tre&&(fr+=Io),$r.startsWith("_"))tt+=De[0];else{const X=he.classNameAliases[$r]||$r;we(De[0],X)}}else tt+=De[0];pe=xe.keywordPatternRe.lastIndex,De=xe.keywordPatternRe.exec(ht)}tt+=ht.substring(pe),at.addText(tt)}function J(){if(ht==="")return;let pe=null;if(typeof xe.subLanguage=="string"){if(!e[xe.subLanguage]){at.addText(ht);return}pe=f(xe.subLanguage,ht,!0,rt[xe.subLanguage]),rt[xe.subLanguage]=pe._top}else pe=d(ht,xe.subLanguage.length?xe.subLanguage:null);xe.relevance>0&&(fr+=pe.relevance),at.__addSublanguage(pe._emitter,pe.language)}function U(){xe.subLanguage!=null?J():$(),ht=""}function we(pe,De){pe!==""&&(at.startScope(De),at.addText(pe),at.endScope())}function Ye(pe,De){let tt=1;const mt=De.length-1;for(;tt<=mt;){if(!pe._emit[tt]){tt++;continue}const or=he.classNameAliases[pe[tt]]||pe[tt],$r=De[tt];or?we($r,or):(ht=$r,$(),ht=""),tt++}}function ge(pe,De){return pe.scope&&typeof pe.scope=="string"&&at.openNode(he.classNameAliases[pe.scope]||pe.scope),pe.beginScope&&(pe.beginScope._wrap?(we(ht,he.classNameAliases[pe.beginScope._wrap]||pe.beginScope._wrap),ht=""):pe.beginScope._multi&&(Ye(pe.beginScope,De),ht="")),xe=Object.create(pe,{parent:{value:xe}}),xe}function le(pe,De,tt){let mt=Fte(pe.endRe,tt);if(mt){if(pe["on:end"]){const or=new wD(pe);pe["on:end"](De,or),or.isMatchIgnored&&(mt=!1)}if(mt){for(;pe.endsParent&&pe.parent;)pe=pe.parent;return pe}}if(pe.endsWithParent)return le(pe.parent,De,tt)}function be(pe){return xe.matcher.regexIndex===0?(ht+=pe[0],1):(tn=!0,0)}function re(pe){const De=pe[0],tt=pe.rule,mt=new wD(tt),or=[tt.__beforeBegin,tt["on:begin"]];for(const $r of or)if($r&&($r(pe,mt),mt.isMatchIgnored))return be(De);return tt.skip?ht+=De:(tt.excludeBegin&&(ht+=De),U(),!tt.returnBegin&&!tt.excludeBegin&&(ht=De)),ge(tt,pe),tt.returnBegin?0:De.length}function G(pe){const De=pe[0],tt=O.substring(pe.index),mt=le(xe,pe,tt);if(!mt)return kD;const or=xe;xe.endScope&&xe.endScope._wrap?(U(),we(De,xe.endScope._wrap)):xe.endScope&&xe.endScope._multi?(U(),Ye(xe.endScope,pe)):or.skip?ht+=De:(or.returnEnd||or.excludeEnd||(ht+=De),U(),or.excludeEnd&&(ht=De));do xe.scope&&at.closeNode(),!xe.skip&&!xe.subLanguage&&(fr+=xe.relevance),xe=xe.parent;while(xe!==mt.parent);return mt.starts&&ge(mt.starts,pe),or.returnEnd?0:De.length}function ee(){const pe=[];for(let De=xe;De!==he;De=De.parent)De.scope&&pe.unshift(De.scope);pe.forEach(De=>at.openNode(De))}let Q={};function me(pe,De){const tt=De&&De[0];if(ht+=pe,tt==null)return U(),0;if(Q.type==="begin"&&De.type==="end"&&Q.index===De.index&&tt===""){if(ht+=O.slice(De.index,De.index+1),!i){const mt=new Error(`0 width match regex (${P})`);throw mt.languageName=P,mt.badRule=Q.rule,mt}return 1}if(Q=De,De.type==="begin")return re(De);if(De.type==="illegal"&&!j){const mt=new Error('Illegal lexeme "'+tt+'" for mode "'+(xe.scope||"")+'"');throw mt.mode=xe,mt}else if(De.type==="end"){const mt=G(De);if(mt!==kD)return mt}if(De.type==="illegal"&&tt==="")return 1;if(en>1e5&&en>De.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ht+=tt,tt.length}const he=C(P);if(!he)throw Xl(a.replace("{}",P)),new Error('Unknown language: "'+P+'"');const Se=_re(he);let Fe="",xe=F||Se;const rt={},at=new s.__emitter(s);ee();let ht="",fr=0,yr=0,en=0,tn=!1;try{if(he.__emitTokens)he.__emitTokens(O,at);else{for(xe.matcher.considerAll();;){en++,tn?tn=!1:xe.matcher.considerAll(),xe.matcher.lastIndex=yr;const pe=xe.matcher.exec(O);if(!pe)break;const De=O.substring(yr,pe.index),tt=me(De,pe);yr=pe.index+tt}me(O.substring(yr))}return at.finalize(),Fe=at.toHTML(),{language:P,value:Fe,relevance:fr,illegal:!1,_emitter:at,_top:xe}}catch(pe){if(pe.message&&pe.message.includes("Illegal"))return{language:P,value:ib(O),illegal:!0,relevance:0,_illegalBy:{message:pe.message,index:yr,context:O.slice(yr-100,yr+100),mode:pe.mode,resultSoFar:Fe},_emitter:at};if(i)return{language:P,value:ib(O),illegal:!1,relevance:0,errorRaised:pe,_emitter:at,_top:xe};throw pe}}function h(P){const O={value:ib(P),illegal:!1,relevance:0,_top:o,_emitter:new s.__emitter(s)};return O._emitter.addText(P),O}function d(P,O){O=O||s.languages||Object.keys(e);const j=h(P),F=O.filter(C).filter(M).map(U=>f(U,P,!1));F.unshift(j);const N=F.sort((U,we)=>{if(U.relevance!==we.relevance)return we.relevance-U.relevance;if(U.language&&we.language){if(C(U.language).supersetOf===we.language)return 1;if(C(we.language).supersetOf===U.language)return-1}return 0}),[B,$]=N,J=B;return J.secondBest=$,J}function p(P,O,j){const F=O&&t[O]||j;P.classList.add("hljs"),P.classList.add(`language-${F}`)}function v(P){let O=null;const j=u(P);if(l(j))return;if(I("before:highlightElement",{el:P,language:j}),P.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",P);return}if(P.children.length>0&&(s.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(P)),s.throwUnescapedHTML))throw new Sre("One of your code blocks includes unescaped HTML.",P.innerHTML);O=P;const F=O.textContent,N=j?c(F,{language:j,ignoreIllegals:!0}):d(F);P.innerHTML=N.value,P.dataset.highlighted="yes",p(P,j,N.language),P.result={language:N.language,re:N.relevance,relevance:N.relevance},N.secondBest&&(P.secondBest={language:N.secondBest.language,relevance:N.secondBest.relevance}),I("after:highlightElement",{el:P,result:N,text:F})}function m(P){s=MD(s,P)}const g=()=>{_(),Uu("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function y(){_(),Uu("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let b=!1;function _(){if(document.readyState==="loading"){b=!0;return}document.querySelectorAll(s.cssSelector).forEach(v)}function x(){b&&_()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",x,!1);function w(P,O){let j=null;try{j=O(r)}catch(F){if(Xl("Language definition for '{}' could not be registered.".replace("{}",P)),i)Xl(F);else throw F;j=o}j.name||(j.name=P),e[P]=j,j.rawDefinition=O.bind(null,r),j.aliases&&A(j.aliases,{languageName:P})}function S(P){delete e[P];for(const O of Object.keys(t))t[O]===P&&delete t[O]}function T(){return Object.keys(e)}function C(P){return P=(P||"").toLowerCase(),e[P]||e[t[P]]}function A(P,{languageName:O}){typeof P=="string"&&(P=[P]),P.forEach(j=>{t[j.toLowerCase()]=O})}function M(P){const O=C(P);return O&&!O.disableAutodetect}function D(P){P["before:highlightBlock"]&&!P["before:highlightElement"]&&(P["before:highlightElement"]=O=>{P["before:highlightBlock"](Object.assign({block:O.el},O))}),P["after:highlightBlock"]&&!P["after:highlightElement"]&&(P["after:highlightElement"]=O=>{P["after:highlightBlock"](Object.assign({block:O.el},O))})}function E(P){D(P),n.push(P)}function L(P){const O=n.indexOf(P);O!==-1&&n.splice(O,1)}function I(P,O){const j=P;n.forEach(function(F){F[j]&&F[j](O)})}function R(P){return Uu("10.7.0","highlightBlock will be removed entirely in v12.0"),Uu("10.7.0","Please use highlightElement now."),v(P)}Object.assign(r,{highlight:c,highlightAuto:d,highlightAll:_,highlightElement:v,highlightBlock:R,configure:m,initHighlighting:g,initHighlightingOnLoad:y,registerLanguage:w,unregisterLanguage:S,listLanguages:T,getLanguage:C,registerAliases:A,autoDetection:M,inherit:MD,addPlugin:E,removePlugin:L}),r.debugMode=function(){i=!1},r.safeMode=function(){i=!0},r.versionString=wre,r.regex={concat:Au,lookahead:H4,either:WT,optional:Bte,anyNumberOfTimes:Nte};for(const P in lv)typeof lv[P]=="object"&&V4(lv[P]);return Object.assign(r,lv),r},Zc=J4({});Zc.newInstance=()=>J4({});var Cre=Zc;Zc.HighlightJS=Zc;Zc.default=Zc;var Are=Ite(Cre);function Q4(r,e=[]){return r.map(t=>{const n=[...e,...t.properties?t.properties.className:[]];return t.children?Q4(t.children,n):{text:t.value,classes:n}}).flat()}function DD(r){return r.value||r.children||[]}function Mre(r){return!!Are.getLanguage(r)}function ED({doc:r,name:e,lowlight:t,defaultLanguage:n}){const i=[];return gw(r,a=>a.type.name===e).forEach(a=>{var o;let s=a.pos+1;const l=a.node.attrs.language||n,u=t.listLanguages(),c=l&&(u.includes(l)||Mre(l)||!((o=t.registered)===null||o===void 0)&&o.call(t,l))?DD(t.highlight(l,a.node.textContent)):DD(t.highlightAuto(a.node.textContent));Q4(c).forEach(f=>{const h=s+f.text.length;if(f.classes.length){const d=Xr.inline(s,h,{class:f.classes.join(" ")});i.push(d)}s=h})}),Gt.create(r,i)}function kre(r){return typeof r=="function"}function Dre({name:r,lowlight:e,defaultLanguage:t}){if(!["highlight","highlightAuto","listLanguages"].every(i=>kre(e[i])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");const n=new Ut({key:new jt("lowlight"),state:{init:(i,{doc:a})=>ED({doc:a,name:r,lowlight:e,defaultLanguage:t}),apply:(i,a,o,s)=>{const l=o.selection.$head.parent.type.name,u=s.selection.$head.parent.type.name,c=gw(o.doc,h=>h.type.name===r),f=gw(s.doc,h=>h.type.name===r);return i.docChanged&&([l,u].includes(r)||f.length!==c.length||i.steps.some(h=>h.from!==void 0&&h.to!==void 0&&c.some(d=>d.pos>=h.from&&d.pos+d.node.nodeSize<=h.to)))?ED({doc:i.doc,name:r,lowlight:e,defaultLanguage:t}):a.map(i.mapping,i.doc)}},props:{decorations(i){return n.getState(i)}}});return n}o4.extend({addOptions(){var r;return{...(r=this.parent)===null||r===void 0?void 0:r.call(this),lowlight:{},languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},addProseMirrorPlugins(){var r;return[...((r=this.parent)===null||r===void 0?void 0:r.call(this))||[],Dre({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}});function Ere(r){var e;const{char:t,allowSpaces:n,allowToIncludeChar:i,allowedPrefixes:a,startOfLine:o,$position:s}=r,l=n&&!i,u=KK(t),c=new RegExp(`\\s${u}$`),f=o?"^":"",h=i?"":u,d=l?new RegExp(`${f}${u}.*?(?=\\s${h}|$)`,"gm"):new RegExp(`${f}(?:^)?${u}[^\\s${h}]*`,"gm"),p=((e=s.nodeBefore)===null||e===void 0?void 0:e.isText)&&s.nodeBefore.text;if(!p)return null;const v=s.pos-p.length,m=Array.from(p.matchAll(d)).pop();if(!m||m.input===void 0||m.index===void 0)return null;const g=m.input.slice(Math.max(0,m.index-1),m.index),y=new RegExp(`^[${a==null?void 0:a.join("")}\0]?$`).test(g);if(a!==null&&!y)return null;const b=v+m.index;let _=b+m[0].length;return l&&c.test(p.slice(_-1,_+1))&&(m[0]+=" ",_+=1),b=s.pos?{range:{from:b,to:_},query:m[0].slice(t.length),text:m[0]}:null}const Lre=new jt("suggestion");function Ire({pluginKey:r=Lre,editor:e,char:t="@",allowSpaces:n=!1,allowToIncludeChar:i=!1,allowedPrefixes:a=[" "],startOfLine:o=!1,decorationTag:s="span",decorationClass:l="suggestion",decorationContent:u="",decorationEmptyClass:c="is-empty",command:f=()=>null,items:h=()=>[],render:d=()=>({}),allow:p=()=>!0,findSuggestionMatch:v=Ere}){let m;const g=d==null?void 0:d(),y=new Ut({key:r,view(){return{update:async(b,_)=>{var x,w,S,T,C,A,M;const D=(x=this.key)===null||x===void 0?void 0:x.getState(_),E=(w=this.key)===null||w===void 0?void 0:w.getState(b.state),L=D.active&&E.active&&D.range.from!==E.range.from,I=!D.active&&E.active,R=D.active&&!E.active,P=!I&&!R&&D.query!==E.query,O=I||L&&P,j=P||L,F=R||L&&P;if(!O&&!j&&!F)return;const N=F&&!O?D:E,B=b.dom.querySelector(`[data-decoration-id="${N.decorationId}"]`);m={editor:e,range:N.range,query:N.query,text:N.text,items:[],command:$=>f({editor:e,range:N.range,props:$}),decorationNode:B,clientRect:B?()=>{var $;const{decorationId:J}=($=this.key)===null||$===void 0?void 0:$.getState(e.state),U=b.dom.querySelector(`[data-decoration-id="${J}"]`);return(U==null?void 0:U.getBoundingClientRect())||null}:null},O&&((S=g==null?void 0:g.onBeforeStart)===null||S===void 0||S.call(g,m)),j&&((T=g==null?void 0:g.onBeforeUpdate)===null||T===void 0||T.call(g,m)),(j||O)&&(m.items=await h({editor:e,query:N.query})),F&&((C=g==null?void 0:g.onExit)===null||C===void 0||C.call(g,m)),j&&((A=g==null?void 0:g.onUpdate)===null||A===void 0||A.call(g,m)),O&&((M=g==null?void 0:g.onStart)===null||M===void 0||M.call(g,m))},destroy:()=>{var b;m&&((b=g==null?void 0:g.onExit)===null||b===void 0||b.call(g,m))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(b,_,x,w){const{isEditable:S}=e,{composing:T}=e.view,{selection:C}=b,{empty:A,from:M}=C,D={..._};if(D.composing=T,S&&(A||e.view.composing)){(M<_.range.from||M>_.range.to)&&!T&&!_.composing&&(D.active=!1);const E=v({char:t,allowSpaces:n,allowToIncludeChar:i,allowedPrefixes:a,startOfLine:o,$position:C.$from}),L=`id_${Math.floor(Math.random()*4294967295)}`;E&&p({editor:e,state:w,range:E.range,isActive:_.active})?(D.active=!0,D.decorationId=_.decorationId?_.decorationId:L,D.range=E.range,D.query=E.query,D.text=E.text):D.active=!1}else D.active=!1;return D.active||(D.decorationId=null,D.range={from:0,to:0},D.query=null,D.text=null),D}},props:{handleKeyDown(b,_){var x;const{active:w,range:S}=y.getState(b.state);return w&&((x=g==null?void 0:g.onKeyDown)===null||x===void 0?void 0:x.call(g,{view:b,event:_,range:S}))||!1},decorations(b){const{active:_,range:x,decorationId:w,query:S}=y.getState(b);if(!_)return null;const T=!(S!=null&&S.length),C=[l];return T&&C.push(c),Gt.create(b.doc,[Xr.inline(x.from,x.to,{nodeName:s,class:C.join(" "),"data-decoration-id":w,"data-decoration-content":u})])}}});return y}function k0(r){return Kt.create({name:r.name,addOptions(){return{...r.addOptions?r.addOptions.call(this):{},suggestion:{char:r.char,pluginKey:r.pluginKey,items:r.items,command:r.command,allowSpaces:r.allowSpaces,startOfLine:r.startOfLine,decorationTag:r.decorationTag||"span",decorationClass:r.decorationClass||"suggestion",render:()=>{let t,n;return{onStart:i=>{if(t=new a4(r.component,{editor:i.editor,props:i}),!i.clientRect||!t.element)return;const a={getReferenceClientRect:i.clientRect,appendTo:()=>document.body,content:t.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start"};n=df("body",{...a,...r.tippyOptions})},onUpdate(i){t==null||t.updateProps(i),i.clientRect&&n&&n[0]&&n[0].setProps({getReferenceClientRect:i.clientRect})},onKeyDown(i){return i.event.key==="Escape"?(n&&n[0]&&n[0].hide(),!0):t&&t.ref&&typeof t.ref.onKeyDown=="function"?t.ref.onKeyDown(i):!1},onExit(){n&&n[0]&&n[0].destroy(),t&&t.destroy(),n=null,t=null}}}}}},addProseMirrorPlugins(){return[Ire({editor:this.editor,...this.options.suggestion})]}})}const Pre=["onClick","onMouseover"],Rre={key:0,class:"px-3 py-1.5 text-sm text-ink-gray-5"},D0=Ke({__name:"SuggestionList",props:{items:{type:Array,required:!0},command:{type:Function,required:!0},containerClass:{type:String,default:""},itemClass:{type:String,default:""},showNoResults:{type:Boolean,default:!1}},setup(r,{expose:e}){const t=r,n=te(0),i=te(null),a=te([]);LH(()=>{a.value=[]});const o=()=>{Ca(()=>{const h=a.value[n.value];h&&h.scrollIntoView({block:"nearest"})})},s=h=>{const d=t.items[h];d&&t.command(d)},l=({event:h})=>t.items.length?h.key==="ArrowUp"?(u(),!0):h.key==="ArrowDown"?(c(),!0):h.key==="Enter"?(f(),!0):!1:!1,u=()=>{n.value=(n.value+t.items.length-1)%t.items.length,o()},c=()=>{n.value=(n.value+1)%t.items.length,o()},f=()=>{s(n.value)};return Nt(()=>t.items,()=>{n.value=0}),e({onKeyDown:l}),(h,d)=>r.items.length?(Y(),ae("div",{key:0,ref_key:"container",ref:i,class:kt(["relative max-h-[300px] min-w-40 overflow-y-auto rounded-lg bg-surface-white p-1 text-base shadow-lg",r.containerClass])},[(Y(!0),ae(oi,null,cp(r.items,(p,v)=>(Y(),ae("button",{key:v,ref_for:!0,ref:m=>{m&&(a.value[v]=m)},class:kt(["flex w-full items-center whitespace-nowrap rounded-md px-2 py-1.5 text-sm text-ink-gray-9",v===n.value?"bg-surface-gray-2":"",r.itemClass]),onClick:m=>s(v),onMouseover:m=>n.value=v},[Je(h.$slots,"default",{item:p,index:v},()=>[Z("span",null,qt(p.display||p.title||p.name),1)])],42,Pre))),128)),!r.items.length&&r.showNoResults?(Y(),ae("div",Rre," No results ")):ct("",!0)],2)):ct("",!0)}});function Ore(r){const e={name:"mention",group:"inline",inline:!0,selectable:!0,atom:!0,addOptions(){return{component:void 0}},addAttributes(){return{id:{default:null,parseHTML:t=>t.getAttribute("data-id"),renderHTML:t=>t.id?{"data-id":t.id}:{}},label:{default:null,parseHTML:t=>t.getAttribute("data-label"),renderHTML:t=>t.label?{"data-label":t.label}:{}}}},parseHTML(){return[{tag:'span.mention[data-type="mention"]',getAttrs:t=>{const n=t;return{id:n.getAttribute("data-id"),label:n.getAttribute("data-label")}}}]},renderHTML({HTMLAttributes:t}){return["span",Lt(t,{class:"mention","data-type":"mention"}),`@${t["data-label"]||t.id||""}`]}};return r&&(e.addNodeView=()=>IT(r)),ar.create(e)}const jre=k0({name:"mentionSuggestion",char:"@",pluginKey:new jt("mentionSuggestion"),component:D0,addOptions(){return{mentions:[]}},items:({query:r,editor:e})=>{const{mentions:t}=e.extensionManager.extensions.find(a=>a.name==="mentionSuggestion").options;return Nr(t).filter(a=>a.label.toLowerCase().startsWith(r.toLowerCase())).slice(0,10).map(a=>({...a,display:a.label}))},command:({editor:r,range:e,props:t})=>{const n={id:t.id||t.value,label:t.label};r.chain().focus().insertContentAt(e,[{type:"mention",attrs:n},{type:"text",text:" "}]).run()},tippyOptions:{placement:"bottom-start",offset:[0,8]},allowSpaces:!1,decorationTag:"span",decorationClass:"mention-suggestion-active"});Kt.create({name:"mentionExtension",addOptions(){return{mentions:[],component:void 0}},addExtensions(){return[Ore(this.options.component),jre.configure({mentions:this.options.mentions})]}});const Nre={class:"mr-2"},Bre=Ke({__name:"EmojiList",props:{items:{type:Array,required:!0},editor:{type:Object,required:!0},range:{type:Object,required:!0},command:{type:Function,required:!0}},setup(r,{expose:e}){const t=r,n=te(null),i=o=>{o&&t.command(o)};return e({onKeyDown:({event:o})=>{var s;return((s=n.value)==null?void 0:s.onKeyDown({event:o}))??!1}}),(o,s)=>(Y(),$e(D0,{ref_key:"suggestionList",ref:n,items:r.items,command:l=>i(l),"item-class":"py-2"},{default:_e(({item:l})=>[Z("span",Nre,qt(l.emoji),1),Z("span",null,qt(l.name),1)]),_:1},8,["items","command"]))}}),zre=[{name:"grinning",emoji:"😀"},{name:"grimacing",emoji:"😬"},{name:"grin",emoji:"😁"},{name:"joy",emoji:"😂"},{name:"rofl",emoji:"🤣"},{name:"smiley",emoji:"😃"},{name:"smile",emoji:"😄"},{name:"sweat_smile",emoji:"😅"},{name:"laughing",emoji:"😆"},{name:"innocent",emoji:"😇"},{name:"wink",emoji:"😉"},{name:"blush",emoji:"😊"},{name:"slightly_smiling_face",emoji:"🙂"},{name:"upside_down_face",emoji:"🙃"},{name:"relaxed",emoji:"☺"},{name:"yum",emoji:"😋"},{name:"relieved",emoji:"😌"},{name:"heart_eyes",emoji:"😍"},{name:"kissing_heart",emoji:"😘"},{name:"kissing",emoji:"😗"},{name:"kissing_smiling_eyes",emoji:"😙"},{name:"kissing_closed_eyes",emoji:"😚"},{name:"stuck_out_tongue_winking_eye",emoji:"😜"},{name:"stuck_out_tongue_closed_eyes",emoji:"😝"},{name:"stuck_out_tongue",emoji:"😛"},{name:"money_mouth_face",emoji:"🤑"},{name:"nerd_face",emoji:"🤓"},{name:"sunglasses",emoji:"😎"},{name:"clown_face",emoji:"🤡"},{name:"cowboy_hat_face",emoji:"🤠"},{name:"hugs",emoji:"🤗"},{name:"smirk",emoji:"😏"},{name:"no_mouth",emoji:"😶"},{name:"neutral_face",emoji:"😐"},{name:"expressionless",emoji:"😑"},{name:"unamused",emoji:"😒"},{name:"roll_eyes",emoji:"🙄"},{name:"thinking",emoji:"🤔"},{name:"lying_face",emoji:"🤥"},{name:"flushed",emoji:"😳"},{name:"disappointed",emoji:"😞"},{name:"worried",emoji:"😟"},{name:"angry",emoji:"😠"},{name:"rage",emoji:"😡"},{name:"pensive",emoji:"😔"},{name:"confused",emoji:"😕"},{name:"slightly_frowning_face",emoji:"🙁"},{name:"frowning_face",emoji:"☹"},{name:"persevere",emoji:"😣"},{name:"confounded",emoji:"😖"},{name:"tired_face",emoji:"😫"},{name:"weary",emoji:"😩"},{name:"triumph",emoji:"😤"},{name:"open_mouth",emoji:"😮"},{name:"scream",emoji:"😱"},{name:"fearful",emoji:"😨"},{name:"cold_sweat",emoji:"😰"},{name:"hushed",emoji:"😯"},{name:"frowning_with_open_mouth",emoji:"😦"},{name:"anguished",emoji:"😧"},{name:"cry",emoji:"😢"},{name:"disappointed_relieved",emoji:"😥"},{name:"drooling_face",emoji:"🤤"},{name:"sleepy",emoji:"😪"},{name:"sweat",emoji:"😓"},{name:"sob",emoji:"😭"},{name:"dizzy_face",emoji:"😵"},{name:"astonished",emoji:"😲"},{name:"zipper_mouth_face",emoji:"🤐"},{name:"nauseated_face",emoji:"🤢"},{name:"sneezing_face",emoji:"🤧"},{name:"mask",emoji:"😷"},{name:"face_with_thermometer",emoji:"🤒"},{name:"face_with_head_bandage",emoji:"🤕"},{name:"sleeping",emoji:"😴"},{name:"zzz",emoji:"💤"},{name:"poop",emoji:"💩"},{name:"smiling_imp",emoji:"😈"},{name:"imp",emoji:"👿"},{name:"japanese_ogre",emoji:"👹"},{name:"japanese_goblin",emoji:"👺"},{name:"skull",emoji:"💀"},{name:"ghost",emoji:"👻"},{name:"alien",emoji:"👽"},{name:"robot",emoji:"🤖"},{name:"smiley_cat",emoji:"😺"},{name:"smile_cat",emoji:"😸"},{name:"joy_cat",emoji:"😹"},{name:"heart_eyes_cat",emoji:"😻"},{name:"smirk_cat",emoji:"😼"},{name:"kissing_cat",emoji:"😽"},{name:"scream_cat",emoji:"🙀"},{name:"crying_cat_face",emoji:"😿"},{name:"pouting_cat",emoji:"😾"},{name:"raised_hands",emoji:"🙌"},{name:"clap",emoji:"👏"},{name:"wave",emoji:"👋"},{name:"call_me_hand",emoji:"🤙"},{name:"+1",emoji:"👍"},{name:"-1",emoji:"👎"},{name:"facepunch",emoji:"👊"},{name:"fist",emoji:"✊"},{name:"fist_left",emoji:"🤛"},{name:"fist_right",emoji:"🤜"},{name:"v",emoji:"✌"},{name:"ok_hand",emoji:"👌"},{name:"raised_hand",emoji:"✋"},{name:"raised_back_of_hand",emoji:"🤚"},{name:"open_hands",emoji:"👐"},{name:"muscle",emoji:"💪"},{name:"pray",emoji:"🙏"},{name:"handshake",emoji:"🤝"},{name:"point_up",emoji:"☝"},{name:"point_up_2",emoji:"👆"},{name:"point_down",emoji:"👇"},{name:"point_left",emoji:"👈"},{name:"point_right",emoji:"👉"},{name:"fu",emoji:"🖕"},{name:"raised_hand_with_fingers_splayed",emoji:"🖐"},{name:"metal",emoji:"🤘"},{name:"crossed_fingers",emoji:"🤞"},{name:"vulcan_salute",emoji:"🖖"},{name:"writing_hand",emoji:"✍"},{name:"selfie",emoji:"🤳"},{name:"nail_care",emoji:"💅"},{name:"lips",emoji:"👄"},{name:"tongue",emoji:"👅"},{name:"ear",emoji:"👂"},{name:"nose",emoji:"👃"},{name:"eye",emoji:"👁"},{name:"eyes",emoji:"👀"},{name:"bust_in_silhouette",emoji:"👤"},{name:"busts_in_silhouette",emoji:"👥"},{name:"speaking_head",emoji:"🗣"},{name:"baby",emoji:"👶"},{name:"boy",emoji:"👦"},{name:"girl",emoji:"👧"},{name:"man",emoji:"👨"},{name:"woman",emoji:"👩"},{name:"blonde_woman",emoji:"👱‍♀️"},{name:"blonde_man",emoji:"👱"},{name:"older_man",emoji:"👴"},{name:"older_woman",emoji:"👵"},{name:"man_with_gua_pi_mao",emoji:"👲"},{name:"woman_with_turban",emoji:"👳‍♀️"},{name:"man_with_turban",emoji:"👳"},{name:"policewoman",emoji:"👮‍♀️"},{name:"policeman",emoji:"👮"},{name:"construction_worker_woman",emoji:"👷‍♀️"},{name:"construction_worker_man",emoji:"👷"},{name:"guardswoman",emoji:"💂‍♀️"},{name:"guardsman",emoji:"💂"},{name:"female_detective",emoji:"🕵️‍♀"},{name:"male_detective",emoji:"🕵"},{name:"woman_health_worker",emoji:"👩‍⚕️"},{name:"man_health_worker",emoji:"👨‍⚕️"},{name:"woman_farmer",emoji:"👩‍🌾"},{name:"man_farmer",emoji:"👨‍🌾"},{name:"woman_cook",emoji:"👩‍🍳"},{name:"man_cook",emoji:"👨‍🍳"},{name:"woman_student",emoji:"👩‍🎓"},{name:"man_student",emoji:"👨‍🎓"},{name:"woman_singer",emoji:"👩‍🎤"},{name:"man_singer",emoji:"👨‍🎤"},{name:"woman_teacher",emoji:"👩‍🏫"},{name:"man_teacher",emoji:"👨‍🏫"},{name:"woman_factory_worker",emoji:"👩‍🏭"},{name:"man_factory_worker",emoji:"👨‍🏭"},{name:"woman_technologist",emoji:"👩‍💻"},{name:"man_technologist",emoji:"👨‍💻"},{name:"woman_office_worker",emoji:"👩‍💼"},{name:"man_office_worker",emoji:"👨‍💼"},{name:"woman_mechanic",emoji:"👩‍🔧"},{name:"man_mechanic",emoji:"👨‍🔧"},{name:"woman_scientist",emoji:"👩‍🔬"},{name:"man_scientist",emoji:"👨‍🔬"},{name:"woman_artist",emoji:"👩‍🎨"},{name:"man_artist",emoji:"👨‍🎨"},{name:"woman_firefighter",emoji:"👩‍🚒"},{name:"man_firefighter",emoji:"👨‍🚒"},{name:"woman_pilot",emoji:"👩‍✈️"},{name:"man_pilot",emoji:"👨‍✈️"},{name:"woman_astronaut",emoji:"👩‍🚀"},{name:"man_astronaut",emoji:"👨‍🚀"},{name:"woman_judge",emoji:"👩‍⚖️"},{name:"man_judge",emoji:"👨‍⚖️"},{name:"mrs_claus",emoji:"🤶"},{name:"santa",emoji:"🎅"},{name:"angel",emoji:"👼"},{name:"pregnant_woman",emoji:"🤰"},{name:"princess",emoji:"👸"},{name:"prince",emoji:"🤴"},{name:"bride_with_veil",emoji:"👰"},{name:"person_in_tuxedo",emoji:"🤵"},{name:"running_woman",emoji:"🏃‍♀️"},{name:"running_man",emoji:"🏃"},{name:"walking_woman",emoji:"🚶‍♀️"},{name:"walking_man",emoji:"🚶"},{name:"dancer",emoji:"💃"},{name:"man_dancing",emoji:"🕺"},{name:"dancing_women",emoji:"👯"},{name:"dancing_men",emoji:"👯‍♂"},{name:"couple",emoji:"👫"},{name:"two_men_holding_hands",emoji:"👬"},{name:"two_women_holding_hands",emoji:"👭"},{name:"bowing_woman",emoji:"🙇‍♀️"},{name:"bowing_man",emoji:"🙇"},{name:"man_facepalming",emoji:"🤦‍♂️"},{name:"woman_facepalming",emoji:"🤦‍♀️"},{name:"woman_shrugging",emoji:"🤷‍♀️"},{name:"man_shrugging",emoji:"🤷‍♂️"},{name:"tipping_hand_woman",emoji:"💁‍♀️"},{name:"tipping_hand_man",emoji:"💁‍♂️"},{name:"no_good_woman",emoji:"🙅‍♀️"},{name:"no_good_man",emoji:"🙅‍♂️"},{name:"ok_woman",emoji:"🙆‍♀️"},{name:"ok_man",emoji:"🙆‍♂️"},{name:"raising_hand_woman",emoji:"🙋‍♀️"},{name:"raising_hand_man",emoji:"🙋‍♂️"},{name:"pouting_woman",emoji:"🙎‍♀️"},{name:"pouting_man",emoji:"🙎‍♂️"},{name:"frowning_woman",emoji:"🙍‍♀️"},{name:"frowning_man",emoji:"🙍‍♂️"},{name:"haircut_woman",emoji:"💇‍♀️"},{name:"haircut_man",emoji:"💇‍♂️"},{name:"massage_woman",emoji:"💆‍♀️"},{name:"massage_man",emoji:"💆‍♂️"},{name:"couple_with_heart",emoji:"💑"},{name:"couple_with_heart_woman_woman",emoji:"👩‍❤️‍👩"},{name:"couple_with_heart_man_man",emoji:"👨‍❤️‍👨"},{name:"couplekiss_man_woman",emoji:"💏"},{name:"couplekiss_woman_woman",emoji:"👩‍❤️‍💋‍👩"},{name:"couplekiss_man_man",emoji:"👨‍❤️‍💋‍👨"},{name:"family",emoji:"👪"},{name:"family_man_woman_girl",emoji:"👨‍👩‍👧"},{name:"family_man_woman_girl_boy",emoji:"👨‍👩‍👧‍👦"},{name:"family_man_woman_boy_boy",emoji:"👨‍👩‍👦‍👦"},{name:"family_man_woman_girl_girl",emoji:"👨‍👩‍👧‍👧"},{name:"family_woman_woman_boy",emoji:"👩‍👩‍👦"},{name:"family_woman_woman_girl",emoji:"👩‍👩‍👧"},{name:"family_woman_woman_girl_boy",emoji:"👩‍👩‍👧‍👦"},{name:"family_woman_woman_boy_boy",emoji:"👩‍👩‍👦‍👦"},{name:"family_woman_woman_girl_girl",emoji:"👩‍👩‍👧‍👧"},{name:"family_man_man_boy",emoji:"👨‍👨‍👦"},{name:"family_man_man_girl",emoji:"👨‍👨‍👧"},{name:"family_man_man_girl_boy",emoji:"👨‍👨‍👧‍👦"},{name:"family_man_man_boy_boy",emoji:"👨‍👨‍👦‍👦"},{name:"family_man_man_girl_girl",emoji:"👨‍👨‍👧‍👧"},{name:"family_woman_boy",emoji:"👩‍👦"},{name:"family_woman_girl",emoji:"👩‍👧"},{name:"family_woman_girl_boy",emoji:"👩‍👧‍👦"},{name:"family_woman_boy_boy",emoji:"👩‍👦‍👦"},{name:"family_woman_girl_girl",emoji:"👩‍👧‍👧"},{name:"family_man_boy",emoji:"👨‍👦"},{name:"family_man_girl",emoji:"👨‍👧"},{name:"family_man_girl_boy",emoji:"👨‍👧‍👦"},{name:"family_man_boy_boy",emoji:"👨‍👦‍👦"},{name:"family_man_girl_girl",emoji:"👨‍👧‍👧"},{name:"womans_clothes",emoji:"👚"},{name:"tshirt",emoji:"👕"},{name:"jeans",emoji:"👖"},{name:"necktie",emoji:"👔"},{name:"dress",emoji:"👗"},{name:"bikini",emoji:"👙"},{name:"kimono",emoji:"👘"},{name:"lipstick",emoji:"💄"},{name:"kiss",emoji:"💋"},{name:"footprints",emoji:"👣"},{name:"high_heel",emoji:"👠"},{name:"sandal",emoji:"👡"},{name:"boot",emoji:"👢"},{name:"mans_shoe",emoji:"👞"},{name:"athletic_shoe",emoji:"👟"},{name:"womans_hat",emoji:"👒"},{name:"tophat",emoji:"🎩"},{name:"rescue_worker_helmet",emoji:"⛑"},{name:"mortar_board",emoji:"🎓"},{name:"crown",emoji:"👑"},{name:"school_satchel",emoji:"🎒"},{name:"pouch",emoji:"👝"},{name:"purse",emoji:"👛"},{name:"handbag",emoji:"👜"},{name:"briefcase",emoji:"💼"},{name:"eyeglasses",emoji:"👓"},{name:"dark_sunglasses",emoji:"🕶"},{name:"ring",emoji:"💍"},{name:"closed_umbrella",emoji:"🌂"},{name:"dog",emoji:"🐶"},{name:"cat",emoji:"🐱"},{name:"mouse",emoji:"🐭"},{name:"hamster",emoji:"🐹"},{name:"rabbit",emoji:"🐰"},{name:"fox_face",emoji:"🦊"},{name:"bear",emoji:"🐻"},{name:"panda_face",emoji:"🐼"},{name:"koala",emoji:"🐨"},{name:"tiger",emoji:"🐯"},{name:"lion",emoji:"🦁"},{name:"cow",emoji:"🐮"},{name:"pig",emoji:"🐷"},{name:"pig_nose",emoji:"🐽"},{name:"frog",emoji:"🐸"},{name:"squid",emoji:"🦑"},{name:"octopus",emoji:"🐙"},{name:"shrimp",emoji:"🦐"},{name:"monkey_face",emoji:"🐵"},{name:"gorilla",emoji:"🦍"},{name:"see_no_evil",emoji:"🙈"},{name:"hear_no_evil",emoji:"🙉"},{name:"speak_no_evil",emoji:"🙊"},{name:"monkey",emoji:"🐒"},{name:"chicken",emoji:"🐔"},{name:"penguin",emoji:"🐧"},{name:"bird",emoji:"🐦"},{name:"baby_chick",emoji:"🐤"},{name:"hatching_chick",emoji:"🐣"},{name:"hatched_chick",emoji:"🐥"},{name:"duck",emoji:"🦆"},{name:"eagle",emoji:"🦅"},{name:"owl",emoji:"🦉"},{name:"bat",emoji:"🦇"},{name:"wolf",emoji:"🐺"},{name:"boar",emoji:"🐗"},{name:"horse",emoji:"🐴"},{name:"unicorn",emoji:"🦄"},{name:"honeybee",emoji:"🐝"},{name:"bug",emoji:"🐛"},{name:"butterfly",emoji:"🦋"},{name:"snail",emoji:"🐌"},{name:"lady_beetle",emoji:"🐞"},{name:"ant",emoji:"🐜"},{name:"spider",emoji:"🕷"},{name:"scorpion",emoji:"🦂"},{name:"crab",emoji:"🦀"},{name:"snake",emoji:"🐍"},{name:"lizard",emoji:"🦎"},{name:"turtle",emoji:"🐢"},{name:"tropical_fish",emoji:"🐠"},{name:"fish",emoji:"🐟"},{name:"blowfish",emoji:"🐡"},{name:"dolphin",emoji:"🐬"},{name:"shark",emoji:"🦈"},{name:"whale",emoji:"🐳"},{name:"whale2",emoji:"🐋"},{name:"crocodile",emoji:"🐊"},{name:"leopard",emoji:"🐆"},{name:"tiger2",emoji:"🐅"},{name:"water_buffalo",emoji:"🐃"},{name:"ox",emoji:"🐂"},{name:"cow2",emoji:"🐄"},{name:"deer",emoji:"🦌"},{name:"dromedary_camel",emoji:"🐪"},{name:"camel",emoji:"🐫"},{name:"elephant",emoji:"🐘"},{name:"rhinoceros",emoji:"🦏"},{name:"goat",emoji:"🐐"},{name:"ram",emoji:"🐏"},{name:"sheep",emoji:"🐑"},{name:"racehorse",emoji:"🐎"},{name:"pig2",emoji:"🐖"},{name:"rat",emoji:"🐀"},{name:"mouse2",emoji:"🐁"},{name:"rooster",emoji:"🐓"},{name:"turkey",emoji:"🦃"},{name:"dove",emoji:"🕊"},{name:"dog2",emoji:"🐕"},{name:"poodle",emoji:"🐩"},{name:"cat2",emoji:"🐈"},{name:"rabbit2",emoji:"🐇"},{name:"chipmunk",emoji:"🐿"},{name:"paw_prints",emoji:"🐾"},{name:"dragon",emoji:"🐉"},{name:"dragon_face",emoji:"🐲"},{name:"cactus",emoji:"🌵"},{name:"christmas_tree",emoji:"🎄"},{name:"evergreen_tree",emoji:"🌲"},{name:"deciduous_tree",emoji:"🌳"},{name:"palm_tree",emoji:"🌴"},{name:"seedling",emoji:"🌱"},{name:"herb",emoji:"🌿"},{name:"shamrock",emoji:"☘"},{name:"four_leaf_clover",emoji:"🍀"},{name:"bamboo",emoji:"🎍"},{name:"tanabata_tree",emoji:"🎋"},{name:"leaves",emoji:"🍃"},{name:"fallen_leaf",emoji:"🍂"},{name:"maple_leaf",emoji:"🍁"},{name:"ear_of_rice",emoji:"🌾"},{name:"hibiscus",emoji:"🌺"},{name:"sunflower",emoji:"🌻"},{name:"rose",emoji:"🌹"},{name:"wilted_flower",emoji:"🥀"},{name:"tulip",emoji:"🌷"},{name:"blossom",emoji:"🌼"},{name:"cherry_blossom",emoji:"🌸"},{name:"bouquet",emoji:"💐"},{name:"mushroom",emoji:"🍄"},{name:"chestnut",emoji:"🌰"},{name:"jack_o_lantern",emoji:"🎃"},{name:"shell",emoji:"🐚"},{name:"spider_web",emoji:"🕸"},{name:"earth_americas",emoji:"🌎"},{name:"earth_africa",emoji:"🌍"},{name:"earth_asia",emoji:"🌏"},{name:"full_moon",emoji:"🌕"},{name:"waning_gibbous_moon",emoji:"🌖"},{name:"last_quarter_moon",emoji:"🌗"},{name:"waning_crescent_moon",emoji:"🌘"},{name:"new_moon",emoji:"🌑"},{name:"waxing_crescent_moon",emoji:"🌒"},{name:"first_quarter_moon",emoji:"🌓"},{name:"waxing_gibbous_moon",emoji:"🌔"},{name:"new_moon_with_face",emoji:"🌚"},{name:"full_moon_with_face",emoji:"🌝"},{name:"first_quarter_moon_with_face",emoji:"🌛"},{name:"last_quarter_moon_with_face",emoji:"🌜"},{name:"sun_with_face",emoji:"🌞"},{name:"crescent_moon",emoji:"🌙"},{name:"star",emoji:"⭐"},{name:"star2",emoji:"🌟"},{name:"dizzy",emoji:"💫"},{name:"sparkles",emoji:"✨"},{name:"comet",emoji:"☄"},{name:"sunny",emoji:"☀"},{name:"sun_behind_small_cloud",emoji:"🌤"},{name:"partly_sunny",emoji:"⛅"},{name:"sun_behind_large_cloud",emoji:"🌥"},{name:"sun_behind_rain_cloud",emoji:"🌦"},{name:"cloud",emoji:"☁"},{name:"cloud_with_rain",emoji:"🌧"},{name:"cloud_with_lightning_and_rain",emoji:"⛈"},{name:"cloud_with_lightning",emoji:"🌩"},{name:"zap",emoji:"⚡"},{name:"fire",emoji:"🔥"},{name:"boom",emoji:"💥"},{name:"snowflake",emoji:"❄"},{name:"cloud_with_snow",emoji:"🌨"},{name:"snowman",emoji:"⛄"},{name:"snowman_with_snow",emoji:"☃"},{name:"wind_face",emoji:"🌬"},{name:"dash",emoji:"💨"},{name:"tornado",emoji:"🌪"},{name:"fog",emoji:"🌫"},{name:"open_umbrella",emoji:"☂"},{name:"umbrella",emoji:"☔"},{name:"droplet",emoji:"💧"},{name:"sweat_drops",emoji:"💦"},{name:"ocean",emoji:"🌊"},{name:"green_apple",emoji:"🍏"},{name:"apple",emoji:"🍎"},{name:"pear",emoji:"🍐"},{name:"tangerine",emoji:"🍊"},{name:"lemon",emoji:"🍋"},{name:"banana",emoji:"🍌"},{name:"watermelon",emoji:"🍉"},{name:"grapes",emoji:"🍇"},{name:"strawberry",emoji:"🍓"},{name:"melon",emoji:"🍈"},{name:"cherries",emoji:"🍒"},{name:"peach",emoji:"🍑"},{name:"pineapple",emoji:"🍍"},{name:"kiwi_fruit",emoji:"🥝"},{name:"avocado",emoji:"🥑"},{name:"tomato",emoji:"🍅"},{name:"eggplant",emoji:"🍆"},{name:"cucumber",emoji:"🥒"},{name:"carrot",emoji:"🥕"},{name:"hot_pepper",emoji:"🌶"},{name:"potato",emoji:"🥔"},{name:"corn",emoji:"🌽"},{name:"sweet_potato",emoji:"🍠"},{name:"peanuts",emoji:"🥜"},{name:"honey_pot",emoji:"🍯"},{name:"croissant",emoji:"🥐"},{name:"bread",emoji:"🍞"},{name:"baguette_bread",emoji:"🥖"},{name:"cheese",emoji:"🧀"},{name:"egg",emoji:"🥚"},{name:"bacon",emoji:"🥓"},{name:"pancakes",emoji:"🥞"},{name:"poultry_leg",emoji:"🍗"},{name:"meat_on_bone",emoji:"🍖"},{name:"fried_shrimp",emoji:"🍤"},{name:"fried_egg",emoji:"🍳"},{name:"hamburger",emoji:"🍔"},{name:"fries",emoji:"🍟"},{name:"stuffed_flatbread",emoji:"🥙"},{name:"hotdog",emoji:"🌭"},{name:"pizza",emoji:"🍕"},{name:"spaghetti",emoji:"🍝"},{name:"taco",emoji:"🌮"},{name:"burrito",emoji:"🌯"},{name:"green_salad",emoji:"🥗"},{name:"shallow_pan_of_food",emoji:"🥘"},{name:"ramen",emoji:"🍜"},{name:"stew",emoji:"🍲"},{name:"fish_cake",emoji:"🍥"},{name:"sushi",emoji:"🍣"},{name:"bento",emoji:"🍱"},{name:"curry",emoji:"🍛"},{name:"rice_ball",emoji:"🍙"},{name:"rice",emoji:"🍚"},{name:"rice_cracker",emoji:"🍘"},{name:"oden",emoji:"🍢"},{name:"dango",emoji:"🍡"},{name:"shaved_ice",emoji:"🍧"},{name:"ice_cream",emoji:"🍨"},{name:"icecream",emoji:"🍦"},{name:"cake",emoji:"🍰"},{name:"birthday",emoji:"🎂"},{name:"custard",emoji:"🍮"},{name:"candy",emoji:"🍬"},{name:"lollipop",emoji:"🍭"},{name:"chocolate_bar",emoji:"🍫"},{name:"popcorn",emoji:"🍿"},{name:"doughnut",emoji:"🍩"},{name:"cookie",emoji:"🍪"},{name:"milk_glass",emoji:"🥛"},{name:"beer",emoji:"🍺"},{name:"beers",emoji:"🍻"},{name:"clinking_glasses",emoji:"🥂"},{name:"wine_glass",emoji:"🍷"},{name:"tumbler_glass",emoji:"🥃"},{name:"cocktail",emoji:"🍸"},{name:"tropical_drink",emoji:"🍹"},{name:"champagne",emoji:"🍾"},{name:"sake",emoji:"🍶"},{name:"tea",emoji:"🍵"},{name:"coffee",emoji:"☕"},{name:"baby_bottle",emoji:"🍼"},{name:"spoon",emoji:"🥄"},{name:"fork_and_knife",emoji:"🍴"},{name:"plate_with_cutlery",emoji:"🍽"},{name:"soccer",emoji:"⚽"},{name:"basketball",emoji:"🏀"},{name:"football",emoji:"🏈"},{name:"baseball",emoji:"⚾"},{name:"tennis",emoji:"🎾"},{name:"volleyball",emoji:"🏐"},{name:"rugby_football",emoji:"🏉"},{name:"8ball",emoji:"🎱"},{name:"golf",emoji:"⛳"},{name:"golfing_woman",emoji:"🏌️‍♀"},{name:"golfing_man",emoji:"🏌"},{name:"ping_pong",emoji:"🏓"},{name:"badminton",emoji:"🏸"},{name:"goal_net",emoji:"🥅"},{name:"ice_hockey",emoji:"🏒"},{name:"field_hockey",emoji:"🏑"},{name:"cricket_bat_and_ball",emoji:"🏏"},{name:"ski",emoji:"🎿"},{name:"skier",emoji:"⛷"},{name:"snowboarder",emoji:"🏂"},{name:"person_fencing",emoji:"🤺"},{name:"women_wrestling",emoji:"🤼‍♀"},{name:"men_wrestling",emoji:"🤼‍♂"},{name:"woman_cartwheeling",emoji:"🤸‍♀️"},{name:"man_cartwheeling",emoji:"🤸‍♂️"},{name:"woman_playing_handball",emoji:"🤾‍♀️"},{name:"man_playing_handball",emoji:"🤾‍♂️"},{name:"ice_skate",emoji:"⛸"},{name:"bow_and_arrow",emoji:"🏹"},{name:"fishing_pole_and_fish",emoji:"🎣"},{name:"boxing_glove",emoji:"🥊"},{name:"martial_arts_uniform",emoji:"🥋"},{name:"rowing_woman",emoji:"🚣‍♀️"},{name:"rowing_man",emoji:"🚣"},{name:"swimming_woman",emoji:"🏊‍♀️"},{name:"swimming_man",emoji:"🏊"},{name:"woman_playing_water_polo",emoji:"🤽‍♀️"},{name:"man_playing_water_polo",emoji:"🤽‍♂️"},{name:"surfing_woman",emoji:"🏄‍♀️"},{name:"surfing_man",emoji:"🏄"},{name:"bath",emoji:"🛀"},{name:"basketball_woman",emoji:"⛹️‍♀"},{name:"basketball_man",emoji:"⛹"},{name:"weight_lifting_woman",emoji:"🏋️‍♀"},{name:"weight_lifting_man",emoji:"🏋"},{name:"biking_woman",emoji:"🚴‍♀️"},{name:"biking_man",emoji:"🚴"},{name:"mountain_biking_woman",emoji:"🚵‍♀️"},{name:"mountain_biking_man",emoji:"🚵"},{name:"horse_racing",emoji:"🏇"},{name:"business_suit_levitating",emoji:"🕴"},{name:"trophy",emoji:"🏆"},{name:"running_shirt_with_sash",emoji:"🎽"},{name:"medal_sports",emoji:"🏅"},{name:"medal_military",emoji:"🎖"},{name:"1st_place_medal",emoji:"🥇"},{name:"2nd_place_medal",emoji:"🥈"},{name:"3rd_place_medal",emoji:"🥉"},{name:"reminder_ribbon",emoji:"🎗"},{name:"rosette",emoji:"🏵"},{name:"ticket",emoji:"🎫"},{name:"tickets",emoji:"🎟"},{name:"performing_arts",emoji:"🎭"},{name:"art",emoji:"🎨"},{name:"circus_tent",emoji:"🎪"},{name:"woman_juggling",emoji:"🤹‍♀️"},{name:"man_juggling",emoji:"🤹‍♂️"},{name:"microphone",emoji:"🎤"},{name:"headphones",emoji:"🎧"},{name:"musical_score",emoji:"🎼"},{name:"musical_keyboard",emoji:"🎹"},{name:"drum",emoji:"🥁"},{name:"saxophone",emoji:"🎷"},{name:"trumpet",emoji:"🎺"},{name:"guitar",emoji:"🎸"},{name:"violin",emoji:"🎻"},{name:"clapper",emoji:"🎬"},{name:"video_game",emoji:"🎮"},{name:"space_invader",emoji:"👾"},{name:"dart",emoji:"🎯"},{name:"game_die",emoji:"🎲"},{name:"slot_machine",emoji:"🎰"},{name:"bowling",emoji:"🎳"},{name:"red_car",emoji:"🚗"},{name:"taxi",emoji:"🚕"},{name:"blue_car",emoji:"🚙"},{name:"bus",emoji:"🚌"},{name:"trolleybus",emoji:"🚎"},{name:"racing_car",emoji:"🏎"},{name:"police_car",emoji:"🚓"},{name:"ambulance",emoji:"🚑"},{name:"fire_engine",emoji:"🚒"},{name:"minibus",emoji:"🚐"},{name:"truck",emoji:"🚚"},{name:"articulated_lorry",emoji:"🚛"},{name:"tractor",emoji:"🚜"},{name:"kick_scooter",emoji:"🛴"},{name:"motorcycle",emoji:"🏍"},{name:"bike",emoji:"🚲"},{name:"motor_scooter",emoji:"🛵"},{name:"rotating_light",emoji:"🚨"},{name:"oncoming_police_car",emoji:"🚔"},{name:"oncoming_bus",emoji:"🚍"},{name:"oncoming_automobile",emoji:"🚘"},{name:"oncoming_taxi",emoji:"🚖"},{name:"aerial_tramway",emoji:"🚡"},{name:"mountain_cableway",emoji:"🚠"},{name:"suspension_railway",emoji:"🚟"},{name:"railway_car",emoji:"🚃"},{name:"train",emoji:"🚋"},{name:"monorail",emoji:"🚝"},{name:"bullettrain_side",emoji:"🚄"},{name:"bullettrain_front",emoji:"🚅"},{name:"light_rail",emoji:"🚈"},{name:"mountain_railway",emoji:"🚞"},{name:"steam_locomotive",emoji:"🚂"},{name:"train2",emoji:"🚆"},{name:"metro",emoji:"🚇"},{name:"tram",emoji:"🚊"},{name:"station",emoji:"🚉"},{name:"helicopter",emoji:"🚁"},{name:"small_airplane",emoji:"🛩"},{name:"airplane",emoji:"✈"},{name:"flight_departure",emoji:"🛫"},{name:"flight_arrival",emoji:"🛬"},{name:"sailboat",emoji:"⛵"},{name:"motor_boat",emoji:"🛥"},{name:"speedboat",emoji:"🚤"},{name:"ferry",emoji:"⛴"},{name:"passenger_ship",emoji:"🛳"},{name:"rocket",emoji:"🚀"},{name:"artificial_satellite",emoji:"🛰"},{name:"seat",emoji:"💺"},{name:"canoe",emoji:"🛶"},{name:"anchor",emoji:"⚓"},{name:"construction",emoji:"🚧"},{name:"fuelpump",emoji:"⛽"},{name:"busstop",emoji:"🚏"},{name:"vertical_traffic_light",emoji:"🚦"},{name:"traffic_light",emoji:"🚥"},{name:"checkered_flag",emoji:"🏁"},{name:"ship",emoji:"🚢"},{name:"ferris_wheel",emoji:"🎡"},{name:"roller_coaster",emoji:"🎢"},{name:"carousel_horse",emoji:"🎠"},{name:"building_construction",emoji:"🏗"},{name:"foggy",emoji:"🌁"},{name:"tokyo_tower",emoji:"🗼"},{name:"factory",emoji:"🏭"},{name:"fountain",emoji:"⛲"},{name:"rice_scene",emoji:"🎑"},{name:"mountain",emoji:"⛰"},{name:"mountain_snow",emoji:"🏔"},{name:"mount_fuji",emoji:"🗻"},{name:"volcano",emoji:"🌋"},{name:"japan",emoji:"🗾"},{name:"camping",emoji:"🏕"},{name:"tent",emoji:"⛺"},{name:"national_park",emoji:"🏞"},{name:"motorway",emoji:"🛣"},{name:"railway_track",emoji:"🛤"},{name:"sunrise",emoji:"🌅"},{name:"sunrise_over_mountains",emoji:"🌄"},{name:"desert",emoji:"🏜"},{name:"beach_umbrella",emoji:"🏖"},{name:"desert_island",emoji:"🏝"},{name:"city_sunrise",emoji:"🌇"},{name:"city_sunset",emoji:"🌆"},{name:"cityscape",emoji:"🏙"},{name:"night_with_stars",emoji:"🌃"},{name:"bridge_at_night",emoji:"🌉"},{name:"milky_way",emoji:"🌌"},{name:"stars",emoji:"🌠"},{name:"sparkler",emoji:"🎇"},{name:"fireworks",emoji:"🎆"},{name:"rainbow",emoji:"🌈"},{name:"houses",emoji:"🏘"},{name:"european_castle",emoji:"🏰"},{name:"japanese_castle",emoji:"🏯"},{name:"stadium",emoji:"🏟"},{name:"statue_of_liberty",emoji:"🗽"},{name:"house",emoji:"🏠"},{name:"house_with_garden",emoji:"🏡"},{name:"derelict_house",emoji:"🏚"},{name:"office",emoji:"🏢"},{name:"department_store",emoji:"🏬"},{name:"post_office",emoji:"🏣"},{name:"european_post_office",emoji:"🏤"},{name:"hospital",emoji:"🏥"},{name:"bank",emoji:"🏦"},{name:"hotel",emoji:"🏨"},{name:"convenience_store",emoji:"🏪"},{name:"school",emoji:"🏫"},{name:"love_hotel",emoji:"🏩"},{name:"wedding",emoji:"💒"},{name:"classical_building",emoji:"🏛"},{name:"church",emoji:"⛪"},{name:"mosque",emoji:"🕌"},{name:"synagogue",emoji:"🕍"},{name:"kaaba",emoji:"🕋"},{name:"shinto_shrine",emoji:"⛩"},{name:"watch",emoji:"⌚"},{name:"iphone",emoji:"📱"},{name:"calling",emoji:"📲"},{name:"computer",emoji:"💻"},{name:"keyboard",emoji:"⌨"},{name:"desktop_computer",emoji:"🖥"},{name:"printer",emoji:"🖨"},{name:"computer_mouse",emoji:"🖱"},{name:"trackball",emoji:"🖲"},{name:"joystick",emoji:"🕹"},{name:"clamp",emoji:"🗜"},{name:"minidisc",emoji:"💽"},{name:"floppy_disk",emoji:"💾"},{name:"cd",emoji:"💿"},{name:"dvd",emoji:"📀"},{name:"vhs",emoji:"📼"},{name:"camera",emoji:"📷"},{name:"camera_flash",emoji:"📸"},{name:"video_camera",emoji:"📹"},{name:"movie_camera",emoji:"🎥"},{name:"film_projector",emoji:"📽"},{name:"film_strip",emoji:"🎞"},{name:"telephone_receiver",emoji:"📞"},{name:"phone",emoji:"☎"},{name:"pager",emoji:"📟"},{name:"fax",emoji:"📠"},{name:"tv",emoji:"📺"},{name:"radio",emoji:"📻"},{name:"studio_microphone",emoji:"🎙"},{name:"level_slider",emoji:"🎚"},{name:"control_knobs",emoji:"🎛"},{name:"stopwatch",emoji:"⏱"},{name:"timer_clock",emoji:"⏲"},{name:"alarm_clock",emoji:"⏰"},{name:"mantelpiece_clock",emoji:"🕰"},{name:"hourglass_flowing_sand",emoji:"⏳"},{name:"hourglass",emoji:"⌛"},{name:"satellite",emoji:"📡"},{name:"battery",emoji:"🔋"},{name:"electric_plug",emoji:"🔌"},{name:"bulb",emoji:"💡"},{name:"flashlight",emoji:"🔦"},{name:"candle",emoji:"🕯"},{name:"wastebasket",emoji:"🗑"},{name:"oil_drum",emoji:"🛢"},{name:"money_with_wings",emoji:"💸"},{name:"dollar",emoji:"💵"},{name:"yen",emoji:"💴"},{name:"euro",emoji:"💶"},{name:"pound",emoji:"💷"},{name:"moneybag",emoji:"💰"},{name:"credit_card",emoji:"💳"},{name:"gem",emoji:"💎"},{name:"balance_scale",emoji:"⚖"},{name:"wrench",emoji:"🔧"},{name:"hammer",emoji:"🔨"},{name:"hammer_and_pick",emoji:"⚒"},{name:"hammer_and_wrench",emoji:"🛠"},{name:"pick",emoji:"⛏"},{name:"nut_and_bolt",emoji:"🔩"},{name:"gear",emoji:"⚙"},{name:"chains",emoji:"⛓"},{name:"gun",emoji:"🔫"},{name:"bomb",emoji:"💣"},{name:"hocho",emoji:"🔪"},{name:"dagger",emoji:"🗡"},{name:"crossed_swords",emoji:"⚔"},{name:"shield",emoji:"🛡"},{name:"smoking",emoji:"🚬"},{name:"skull_and_crossbones",emoji:"☠"},{name:"coffin",emoji:"⚰"},{name:"funeral_urn",emoji:"⚱"},{name:"amphora",emoji:"🏺"},{name:"crystal_ball",emoji:"🔮"},{name:"prayer_beads",emoji:"📿"},{name:"barber",emoji:"💈"},{name:"alembic",emoji:"⚗"},{name:"telescope",emoji:"🔭"},{name:"microscope",emoji:"🔬"},{name:"hole",emoji:"🕳"},{name:"pill",emoji:"💊"},{name:"syringe",emoji:"💉"},{name:"thermometer",emoji:"🌡"},{name:"label",emoji:"🏷"},{name:"bookmark",emoji:"🔖"},{name:"toilet",emoji:"🚽"},{name:"shower",emoji:"🚿"},{name:"bathtub",emoji:"🛁"},{name:"key",emoji:"🔑"},{name:"old_key",emoji:"🗝"},{name:"couch_and_lamp",emoji:"🛋"},{name:"sleeping_bed",emoji:"🛌"},{name:"bed",emoji:"🛏"},{name:"door",emoji:"🚪"},{name:"bellhop_bell",emoji:"🛎"},{name:"framed_picture",emoji:"🖼"},{name:"world_map",emoji:"🗺"},{name:"parasol_on_ground",emoji:"⛱"},{name:"moyai",emoji:"🗿"},{name:"shopping",emoji:"🛍"},{name:"shopping_cart",emoji:"🛒"},{name:"balloon",emoji:"🎈"},{name:"flags",emoji:"🎏"},{name:"ribbon",emoji:"🎀"},{name:"gift",emoji:"🎁"},{name:"confetti_ball",emoji:"🎊"},{name:"tada",emoji:"🎉"},{name:"dolls",emoji:"🎎"},{name:"wind_chime",emoji:"🎐"},{name:"crossed_flags",emoji:"🎌"},{name:"izakaya_lantern",emoji:"🏮"},{name:"email",emoji:"✉"},{name:"envelope_with_arrow",emoji:"📩"},{name:"incoming_envelope",emoji:"📨"},{name:"e-mail",emoji:"📧"},{name:"love_letter",emoji:"💌"},{name:"postbox",emoji:"📮"},{name:"mailbox_closed",emoji:"📪"},{name:"mailbox",emoji:"📫"},{name:"mailbox_with_mail",emoji:"📬"},{name:"mailbox_with_no_mail",emoji:"📭"},{name:"package",emoji:"📦"},{name:"postal_horn",emoji:"📯"},{name:"inbox_tray",emoji:"📥"},{name:"outbox_tray",emoji:"📤"},{name:"scroll",emoji:"📜"},{name:"page_with_curl",emoji:"📃"},{name:"bookmark_tabs",emoji:"📑"},{name:"bar_chart",emoji:"📊"},{name:"chart_with_upwards_trend",emoji:"📈"},{name:"chart_with_downwards_trend",emoji:"📉"},{name:"page_facing_up",emoji:"📄"},{name:"date",emoji:"📅"},{name:"calendar",emoji:"📆"},{name:"spiral_calendar",emoji:"🗓"},{name:"card_index",emoji:"📇"},{name:"card_file_box",emoji:"🗃"},{name:"ballot_box",emoji:"🗳"},{name:"file_cabinet",emoji:"🗄"},{name:"clipboard",emoji:"📋"},{name:"spiral_notepad",emoji:"🗒"},{name:"file_folder",emoji:"📁"},{name:"open_file_folder",emoji:"📂"},{name:"card_index_dividers",emoji:"🗂"},{name:"newspaper_roll",emoji:"🗞"},{name:"newspaper",emoji:"📰"},{name:"notebook",emoji:"📓"},{name:"closed_book",emoji:"📕"},{name:"green_book",emoji:"📗"},{name:"blue_book",emoji:"📘"},{name:"orange_book",emoji:"📙"},{name:"notebook_with_decorative_cover",emoji:"📔"},{name:"ledger",emoji:"📒"},{name:"books",emoji:"📚"},{name:"open_book",emoji:"📖"},{name:"link",emoji:"🔗"},{name:"paperclip",emoji:"📎"},{name:"paperclips",emoji:"🖇"},{name:"scissors",emoji:"✂"},{name:"triangular_ruler",emoji:"📐"},{name:"straight_ruler",emoji:"📏"},{name:"pushpin",emoji:"📌"},{name:"round_pushpin",emoji:"📍"},{name:"triangular_flag_on_post",emoji:"🚩"},{name:"white_flag",emoji:"🏳"},{name:"black_flag",emoji:"🏴"},{name:"rainbow_flag",emoji:"🏳️‍🌈"},{name:"closed_lock_with_key",emoji:"🔐"},{name:"lock",emoji:"🔒"},{name:"unlock",emoji:"🔓"},{name:"lock_with_ink_pen",emoji:"🔏"},{name:"pen",emoji:"🖊"},{name:"fountain_pen",emoji:"🖋"},{name:"black_nib",emoji:"✒"},{name:"memo",emoji:"📝"},{name:"pencil2",emoji:"✏"},{name:"crayon",emoji:"🖍"},{name:"paintbrush",emoji:"🖌"},{name:"mag",emoji:"🔍"},{name:"mag_right",emoji:"🔎"},{name:"heart",emoji:"❤"},{name:"yellow_heart",emoji:"💛"},{name:"green_heart",emoji:"💚"},{name:"blue_heart",emoji:"💙"},{name:"purple_heart",emoji:"💜"},{name:"black_heart",emoji:"🖤"},{name:"broken_heart",emoji:"💔"},{name:"heavy_heart_exclamation",emoji:"❣"},{name:"two_hearts",emoji:"💕"},{name:"revolving_hearts",emoji:"💞"},{name:"heartbeat",emoji:"💓"},{name:"heartpulse",emoji:"💗"},{name:"sparkling_heart",emoji:"💖"},{name:"cupid",emoji:"💘"},{name:"gift_heart",emoji:"💝"},{name:"heart_decoration",emoji:"💟"},{name:"peace_symbol",emoji:"☮"},{name:"latin_cross",emoji:"✝"},{name:"star_and_crescent",emoji:"☪"},{name:"om",emoji:"🕉"},{name:"wheel_of_dharma",emoji:"☸"},{name:"star_of_david",emoji:"✡"},{name:"six_pointed_star",emoji:"🔯"},{name:"menorah",emoji:"🕎"},{name:"yin_yang",emoji:"☯"},{name:"orthodox_cross",emoji:"☦"},{name:"place_of_worship",emoji:"🛐"},{name:"ophiuchus",emoji:"⛎"},{name:"aries",emoji:"♈"},{name:"taurus",emoji:"♉"},{name:"gemini",emoji:"♊"},{name:"cancer",emoji:"♋"},{name:"leo",emoji:"♌"},{name:"virgo",emoji:"♍"},{name:"libra",emoji:"♎"},{name:"scorpius",emoji:"♏"},{name:"sagittarius",emoji:"♐"},{name:"capricorn",emoji:"♑"},{name:"aquarius",emoji:"♒"},{name:"pisces",emoji:"♓"},{name:"id",emoji:"🆔"},{name:"atom_symbol",emoji:"⚛"},{name:"u7a7a",emoji:"🈳"},{name:"u5272",emoji:"🈹"},{name:"radioactive",emoji:"☢"},{name:"biohazard",emoji:"☣"},{name:"mobile_phone_off",emoji:"📴"},{name:"vibration_mode",emoji:"📳"},{name:"u6709",emoji:"🈶"},{name:"u7121",emoji:"🈚"},{name:"u7533",emoji:"🈸"},{name:"u55b6",emoji:"🈺"},{name:"u6708",emoji:"🈷"},{name:"eight_pointed_black_star",emoji:"✴"},{name:"vs",emoji:"🆚"},{name:"accept",emoji:"🉑"},{name:"white_flower",emoji:"💮"},{name:"ideograph_advantage",emoji:"🉐"},{name:"secret",emoji:"㊙"},{name:"congratulations",emoji:"㊗"},{name:"u5408",emoji:"🈴"},{name:"u6e80",emoji:"🈵"},{name:"u7981",emoji:"🈲"},{name:"a",emoji:"🅰"},{name:"b",emoji:"🅱"},{name:"ab",emoji:"🆎"},{name:"cl",emoji:"🆑"},{name:"o2",emoji:"🅾"},{name:"sos",emoji:"🆘"},{name:"no_entry",emoji:"⛔"},{name:"name_badge",emoji:"📛"},{name:"no_entry_sign",emoji:"🚫"},{name:"x",emoji:"❌"},{name:"o",emoji:"⭕"},{name:"stop_sign",emoji:"🛑"},{name:"anger",emoji:"💢"},{name:"hotsprings",emoji:"♨"},{name:"no_pedestrians",emoji:"🚷"},{name:"do_not_litter",emoji:"🚯"},{name:"no_bicycles",emoji:"🚳"},{name:"non-potable_water",emoji:"🚱"},{name:"underage",emoji:"🔞"},{name:"no_mobile_phones",emoji:"📵"},{name:"exclamation",emoji:"❗"},{name:"grey_exclamation",emoji:"❕"},{name:"question",emoji:"❓"},{name:"grey_question",emoji:"❔"},{name:"bangbang",emoji:"‼"},{name:"interrobang",emoji:"⁉"},{name:"100",emoji:"💯"},{name:"low_brightness",emoji:"🔅"},{name:"high_brightness",emoji:"🔆"},{name:"trident",emoji:"🔱"},{name:"fleur_de_lis",emoji:"⚜"},{name:"part_alternation_mark",emoji:"〽"},{name:"warning",emoji:"⚠"},{name:"children_crossing",emoji:"🚸"},{name:"beginner",emoji:"🔰"},{name:"recycle",emoji:"♻"},{name:"u6307",emoji:"🈯"},{name:"chart",emoji:"💹"},{name:"sparkle",emoji:"❇"},{name:"eight_spoked_asterisk",emoji:"✳"},{name:"negative_squared_cross_mark",emoji:"❎"},{name:"white_check_mark",emoji:"✅"},{name:"diamond_shape_with_a_dot_inside",emoji:"💠"},{name:"cyclone",emoji:"🌀"},{name:"loop",emoji:"➿"},{name:"globe_with_meridians",emoji:"🌐"},{name:"m",emoji:"Ⓜ"},{name:"atm",emoji:"🏧"},{name:"sa",emoji:"🈂"},{name:"passport_control",emoji:"🛂"},{name:"customs",emoji:"🛃"},{name:"baggage_claim",emoji:"🛄"},{name:"left_luggage",emoji:"🛅"},{name:"wheelchair",emoji:"♿"},{name:"no_smoking",emoji:"🚭"},{name:"wc",emoji:"🚾"},{name:"parking",emoji:"🅿"},{name:"potable_water",emoji:"🚰"},{name:"mens",emoji:"🚹"},{name:"womens",emoji:"🚺"},{name:"baby_symbol",emoji:"🚼"},{name:"restroom",emoji:"🚻"},{name:"put_litter_in_its_place",emoji:"🚮"},{name:"cinema",emoji:"🎦"},{name:"signal_strength",emoji:"📶"},{name:"koko",emoji:"🈁"},{name:"ng",emoji:"🆖"},{name:"ok",emoji:"🆗"},{name:"up",emoji:"🆙"},{name:"cool",emoji:"🆒"},{name:"new",emoji:"🆕"},{name:"free",emoji:"🆓"},{name:"zero",emoji:"0️⃣"},{name:"one",emoji:"1️⃣"},{name:"two",emoji:"2️⃣"},{name:"three",emoji:"3️⃣"},{name:"four",emoji:"4️⃣"},{name:"five",emoji:"5️⃣"},{name:"six",emoji:"6️⃣"},{name:"seven",emoji:"7️⃣"},{name:"eight",emoji:"8️⃣"},{name:"nine",emoji:"9️⃣"},{name:"keycap_ten",emoji:"🔟"},{name:"asterisk",emoji:"*️⃣"},{name:"1234",emoji:"🔢"},{name:"arrow_forward",emoji:"▶"},{name:"pause_button",emoji:"⏸"},{name:"next_track_button",emoji:"⏭"},{name:"stop_button",emoji:"⏹"},{name:"record_button",emoji:"⏺"},{name:"play_or_pause_button",emoji:"⏯"},{name:"previous_track_button",emoji:"⏮"},{name:"fast_forward",emoji:"⏩"},{name:"rewind",emoji:"⏪"},{name:"twisted_rightwards_arrows",emoji:"🔀"},{name:"repeat",emoji:"🔁"},{name:"repeat_one",emoji:"🔂"},{name:"arrow_backward",emoji:"◀"},{name:"arrow_up_small",emoji:"🔼"},{name:"arrow_down_small",emoji:"🔽"},{name:"arrow_double_up",emoji:"⏫"},{name:"arrow_double_down",emoji:"⏬"},{name:"arrow_right",emoji:"➡"},{name:"arrow_left",emoji:"⬅"},{name:"arrow_up",emoji:"⬆"},{name:"arrow_down",emoji:"⬇"},{name:"arrow_upper_right",emoji:"↗"},{name:"arrow_lower_right",emoji:"↘"},{name:"arrow_lower_left",emoji:"↙"},{name:"arrow_upper_left",emoji:"↖"},{name:"arrow_up_down",emoji:"↕"},{name:"left_right_arrow",emoji:"↔"},{name:"arrows_counterclockwise",emoji:"🔄"},{name:"arrow_right_hook",emoji:"↪"},{name:"leftwards_arrow_with_hook",emoji:"↩"},{name:"arrow_heading_up",emoji:"⤴"},{name:"arrow_heading_down",emoji:"⤵"},{name:"hash",emoji:"#️⃣"},{name:"information_source",emoji:"ℹ"},{name:"abc",emoji:"🔤"},{name:"abcd",emoji:"🔡"},{name:"capital_abcd",emoji:"🔠"},{name:"symbols",emoji:"🔣"},{name:"musical_note",emoji:"🎵"},{name:"notes",emoji:"🎶"},{name:"wavy_dash",emoji:"〰"},{name:"curly_loop",emoji:"➰"},{name:"heavy_check_mark",emoji:"✔"},{name:"arrows_clockwise",emoji:"🔃"},{name:"heavy_plus_sign",emoji:"➕"},{name:"heavy_minus_sign",emoji:"➖"},{name:"heavy_division_sign",emoji:"➗"},{name:"heavy_multiplication_x",emoji:"✖"},{name:"heavy_dollar_sign",emoji:"💲"},{name:"currency_exchange",emoji:"💱"},{name:"copyright",emoji:"©"},{name:"registered",emoji:"®"},{name:"tm",emoji:"™"},{name:"end",emoji:"🔚"},{name:"back",emoji:"🔙"},{name:"on",emoji:"🔛"},{name:"top",emoji:"🔝"},{name:"soon",emoji:"🔜"},{name:"ballot_box_with_check",emoji:"☑"},{name:"radio_button",emoji:"🔘"},{name:"white_circle",emoji:"⚪"},{name:"black_circle",emoji:"⚫"},{name:"red_circle",emoji:"🔴"},{name:"large_blue_circle",emoji:"🔵"},{name:"small_orange_diamond",emoji:"🔸"},{name:"small_blue_diamond",emoji:"🔹"},{name:"large_orange_diamond",emoji:"🔶"},{name:"large_blue_diamond",emoji:"🔷"},{name:"small_red_triangle",emoji:"🔺"},{name:"black_small_square",emoji:"▪"},{name:"white_small_square",emoji:"▫"},{name:"black_large_square",emoji:"⬛"},{name:"white_large_square",emoji:"⬜"},{name:"small_red_triangle_down",emoji:"🔻"},{name:"black_medium_square",emoji:"◼"},{name:"white_medium_square",emoji:"◻"},{name:"black_medium_small_square",emoji:"◾"},{name:"white_medium_small_square",emoji:"◽"},{name:"black_square_button",emoji:"🔲"},{name:"white_square_button",emoji:"🔳"},{name:"speaker",emoji:"🔈"},{name:"sound",emoji:"🔉"},{name:"loud_sound",emoji:"🔊"},{name:"mute",emoji:"🔇"},{name:"mega",emoji:"📣"},{name:"loudspeaker",emoji:"📢"},{name:"bell",emoji:"🔔"},{name:"no_bell",emoji:"🔕"},{name:"black_joker",emoji:"🃏"},{name:"mahjong",emoji:"🀄"},{name:"spades",emoji:"♠"},{name:"clubs",emoji:"♣"},{name:"hearts",emoji:"♥"},{name:"diamonds",emoji:"♦"},{name:"flower_playing_cards",emoji:"🎴"},{name:"thought_balloon",emoji:"💭"},{name:"right_anger_bubble",emoji:"🗯"},{name:"speech_balloon",emoji:"💬"},{name:"left_speech_bubble",emoji:"🗨"},{name:"clock1",emoji:"🕐"},{name:"clock2",emoji:"🕑"},{name:"clock3",emoji:"🕒"},{name:"clock4",emoji:"🕓"},{name:"clock5",emoji:"🕔"},{name:"clock6",emoji:"🕕"},{name:"clock7",emoji:"🕖"},{name:"clock8",emoji:"🕗"},{name:"clock9",emoji:"🕘"},{name:"clock10",emoji:"🕙"},{name:"clock11",emoji:"🕚"},{name:"clock12",emoji:"🕛"},{name:"clock130",emoji:"🕜"},{name:"clock230",emoji:"🕝"},{name:"clock330",emoji:"🕞"},{name:"clock430",emoji:"🕟"},{name:"clock530",emoji:"🕠"},{name:"clock630",emoji:"🕡"},{name:"clock730",emoji:"🕢"},{name:"clock830",emoji:"🕣"},{name:"clock930",emoji:"🕤"},{name:"clock1030",emoji:"🕥"},{name:"clock1130",emoji:"🕦"},{name:"clock1230",emoji:"🕧"},{name:"afghanistan",emoji:"🇦🇫"},{name:"aland_islands",emoji:"🇦🇽"},{name:"albania",emoji:"🇦🇱"},{name:"algeria",emoji:"🇩🇿"},{name:"american_samoa",emoji:"🇦🇸"},{name:"andorra",emoji:"🇦🇩"},{name:"angola",emoji:"🇦🇴"},{name:"anguilla",emoji:"🇦🇮"},{name:"antarctica",emoji:"🇦🇶"},{name:"antigua_barbuda",emoji:"🇦🇬"},{name:"argentina",emoji:"🇦🇷"},{name:"armenia",emoji:"🇦🇲"},{name:"aruba",emoji:"🇦🇼"},{name:"australia",emoji:"🇦🇺"},{name:"austria",emoji:"🇦🇹"},{name:"azerbaijan",emoji:"🇦🇿"},{name:"bahamas",emoji:"🇧🇸"},{name:"bahrain",emoji:"🇧🇭"},{name:"bangladesh",emoji:"🇧🇩"},{name:"barbados",emoji:"🇧🇧"},{name:"belarus",emoji:"🇧🇾"},{name:"belgium",emoji:"🇧🇪"},{name:"belize",emoji:"🇧🇿"},{name:"benin",emoji:"🇧🇯"},{name:"bermuda",emoji:"🇧🇲"},{name:"bhutan",emoji:"🇧🇹"},{name:"bolivia",emoji:"🇧🇴"},{name:"caribbean_netherlands",emoji:"🇧🇶"},{name:"bosnia_herzegovina",emoji:"🇧🇦"},{name:"botswana",emoji:"🇧🇼"},{name:"brazil",emoji:"🇧🇷"},{name:"british_indian_ocean_territory",emoji:"🇮🇴"},{name:"british_virgin_islands",emoji:"🇻🇬"},{name:"brunei",emoji:"🇧🇳"},{name:"bulgaria",emoji:"🇧🇬"},{name:"burkina_faso",emoji:"🇧🇫"},{name:"burundi",emoji:"🇧🇮"},{name:"cape_verde",emoji:"🇨🇻"},{name:"cambodia",emoji:"🇰🇭"},{name:"cameroon",emoji:"🇨🇲"},{name:"canada",emoji:"🇨🇦"},{name:"canary_islands",emoji:"🇮🇨"},{name:"cayman_islands",emoji:"🇰🇾"},{name:"central_african_republic",emoji:"🇨🇫"},{name:"chad",emoji:"🇹🇩"},{name:"chile",emoji:"🇨🇱"},{name:"cn",emoji:"🇨🇳"},{name:"christmas_island",emoji:"🇨🇽"},{name:"cocos_islands",emoji:"🇨🇨"},{name:"colombia",emoji:"🇨🇴"},{name:"comoros",emoji:"🇰🇲"},{name:"congo_brazzaville",emoji:"🇨🇬"},{name:"congo_kinshasa",emoji:"🇨🇩"},{name:"cook_islands",emoji:"🇨🇰"},{name:"costa_rica",emoji:"🇨🇷"},{name:"croatia",emoji:"🇭🇷"},{name:"cuba",emoji:"🇨🇺"},{name:"curacao",emoji:"🇨🇼"},{name:"cyprus",emoji:"🇨🇾"},{name:"czech_republic",emoji:"🇨🇿"},{name:"denmark",emoji:"🇩🇰"},{name:"djibouti",emoji:"🇩🇯"},{name:"dominica",emoji:"🇩🇲"},{name:"dominican_republic",emoji:"🇩🇴"},{name:"ecuador",emoji:"🇪🇨"},{name:"egypt",emoji:"🇪🇬"},{name:"el_salvador",emoji:"🇸🇻"},{name:"equatorial_guinea",emoji:"🇬🇶"},{name:"eritrea",emoji:"🇪🇷"},{name:"estonia",emoji:"🇪🇪"},{name:"ethiopia",emoji:"🇪🇹"},{name:"eu",emoji:"🇪🇺"},{name:"falkland_islands",emoji:"🇫🇰"},{name:"faroe_islands",emoji:"🇫🇴"},{name:"fiji",emoji:"🇫🇯"},{name:"finland",emoji:"🇫🇮"},{name:"fr",emoji:"🇫🇷"},{name:"french_guiana",emoji:"🇬🇫"},{name:"french_polynesia",emoji:"🇵🇫"},{name:"french_southern_territories",emoji:"🇹🇫"},{name:"gabon",emoji:"🇬🇦"},{name:"gambia",emoji:"🇬🇲"},{name:"georgia",emoji:"🇬🇪"},{name:"de",emoji:"🇩🇪"},{name:"ghana",emoji:"🇬🇭"},{name:"gibraltar",emoji:"🇬🇮"},{name:"greece",emoji:"🇬🇷"},{name:"greenland",emoji:"🇬🇱"},{name:"grenada",emoji:"🇬🇩"},{name:"guadeloupe",emoji:"🇬🇵"},{name:"guam",emoji:"🇬🇺"},{name:"guatemala",emoji:"🇬🇹"},{name:"guernsey",emoji:"🇬🇬"},{name:"guinea",emoji:"🇬🇳"},{name:"guinea_bissau",emoji:"🇬🇼"},{name:"guyana",emoji:"🇬🇾"},{name:"haiti",emoji:"🇭🇹"},{name:"honduras",emoji:"🇭🇳"},{name:"hong_kong",emoji:"🇭🇰"},{name:"hungary",emoji:"🇭🇺"},{name:"iceland",emoji:"🇮🇸"},{name:"india",emoji:"🇮🇳"},{name:"indonesia",emoji:"🇮🇩"},{name:"iran",emoji:"🇮🇷"},{name:"iraq",emoji:"🇮🇶"},{name:"ireland",emoji:"🇮🇪"},{name:"isle_of_man",emoji:"🇮🇲"},{name:"israel",emoji:"🇮🇱"},{name:"it",emoji:"🇮🇹"},{name:"cote_divoire",emoji:"🇨🇮"},{name:"jamaica",emoji:"🇯🇲"},{name:"jp",emoji:"🇯🇵"},{name:"jersey",emoji:"🇯🇪"},{name:"jordan",emoji:"🇯🇴"},{name:"kazakhstan",emoji:"🇰🇿"},{name:"kenya",emoji:"🇰🇪"},{name:"kiribati",emoji:"🇰🇮"},{name:"kosovo",emoji:"🇽🇰"},{name:"kuwait",emoji:"🇰🇼"},{name:"kyrgyzstan",emoji:"🇰🇬"},{name:"laos",emoji:"🇱🇦"},{name:"latvia",emoji:"🇱🇻"},{name:"lebanon",emoji:"🇱🇧"},{name:"lesotho",emoji:"🇱🇸"},{name:"liberia",emoji:"🇱🇷"},{name:"libya",emoji:"🇱🇾"},{name:"liechtenstein",emoji:"🇱🇮"},{name:"lithuania",emoji:"🇱🇹"},{name:"luxembourg",emoji:"🇱🇺"},{name:"macau",emoji:"🇲🇴"},{name:"macedonia",emoji:"🇲🇰"},{name:"madagascar",emoji:"🇲🇬"},{name:"malawi",emoji:"🇲🇼"},{name:"malaysia",emoji:"🇲🇾"},{name:"maldives",emoji:"🇲🇻"},{name:"mali",emoji:"🇲🇱"},{name:"malta",emoji:"🇲🇹"},{name:"marshall_islands",emoji:"🇲🇭"},{name:"martinique",emoji:"🇲🇶"},{name:"mauritania",emoji:"🇲🇷"},{name:"mauritius",emoji:"🇲🇺"},{name:"mayotte",emoji:"🇾🇹"},{name:"mexico",emoji:"🇲🇽"},{name:"micronesia",emoji:"🇫🇲"},{name:"moldova",emoji:"🇲🇩"},{name:"monaco",emoji:"🇲🇨"},{name:"mongolia",emoji:"🇲🇳"},{name:"montenegro",emoji:"🇲🇪"},{name:"montserrat",emoji:"🇲🇸"},{name:"morocco",emoji:"🇲🇦"},{name:"mozambique",emoji:"🇲🇿"},{name:"myanmar",emoji:"🇲🇲"},{name:"namibia",emoji:"🇳🇦"},{name:"nauru",emoji:"🇳🇷"},{name:"nepal",emoji:"🇳🇵"},{name:"netherlands",emoji:"🇳🇱"},{name:"new_caledonia",emoji:"🇳🇨"},{name:"new_zealand",emoji:"🇳🇿"},{name:"nicaragua",emoji:"🇳🇮"},{name:"niger",emoji:"🇳🇪"},{name:"nigeria",emoji:"🇳🇬"},{name:"niue",emoji:"🇳🇺"},{name:"norfolk_island",emoji:"🇳🇫"},{name:"northern_mariana_islands",emoji:"🇲🇵"},{name:"north_korea",emoji:"🇰🇵"},{name:"norway",emoji:"🇳🇴"},{name:"oman",emoji:"🇴🇲"},{name:"pakistan",emoji:"🇵🇰"},{name:"palau",emoji:"🇵🇼"},{name:"palestinian_territories",emoji:"🇵🇸"},{name:"panama",emoji:"🇵🇦"},{name:"papua_new_guinea",emoji:"🇵🇬"},{name:"paraguay",emoji:"🇵🇾"},{name:"peru",emoji:"🇵🇪"},{name:"philippines",emoji:"🇵🇭"},{name:"pitcairn_islands",emoji:"🇵🇳"},{name:"poland",emoji:"🇵🇱"},{name:"portugal",emoji:"🇵🇹"},{name:"puerto_rico",emoji:"🇵🇷"},{name:"qatar",emoji:"🇶🇦"},{name:"reunion",emoji:"🇷🇪"},{name:"romania",emoji:"🇷🇴"},{name:"ru",emoji:"🇷🇺"},{name:"rwanda",emoji:"🇷🇼"},{name:"st_barthelemy",emoji:"🇧🇱"},{name:"st_helena",emoji:"🇸🇭"},{name:"st_kitts_nevis",emoji:"🇰🇳"},{name:"st_lucia",emoji:"🇱🇨"},{name:"st_pierre_miquelon",emoji:"🇵🇲"},{name:"st_vincent_grenadines",emoji:"🇻🇨"},{name:"samoa",emoji:"🇼🇸"},{name:"san_marino",emoji:"🇸🇲"},{name:"sao_tome_principe",emoji:"🇸🇹"},{name:"saudi_arabia",emoji:"🇸🇦"},{name:"senegal",emoji:"🇸🇳"},{name:"serbia",emoji:"🇷🇸"},{name:"seychelles",emoji:"🇸🇨"},{name:"sierra_leone",emoji:"🇸🇱"},{name:"singapore",emoji:"🇸🇬"},{name:"sint_maarten",emoji:"🇸🇽"},{name:"slovakia",emoji:"🇸🇰"},{name:"slovenia",emoji:"🇸🇮"},{name:"solomon_islands",emoji:"🇸🇧"},{name:"somalia",emoji:"🇸🇴"},{name:"south_africa",emoji:"🇿🇦"},{name:"south_georgia_south_sandwich_islands",emoji:"🇬🇸"},{name:"kr",emoji:"🇰🇷"},{name:"south_sudan",emoji:"🇸🇸"},{name:"es",emoji:"🇪🇸"},{name:"sri_lanka",emoji:"🇱🇰"},{name:"sudan",emoji:"🇸🇩"},{name:"suriname",emoji:"🇸🇷"},{name:"swaziland",emoji:"🇸🇿"},{name:"sweden",emoji:"🇸🇪"},{name:"switzerland",emoji:"🇨🇭"},{name:"syria",emoji:"🇸🇾"},{name:"taiwan",emoji:"🇹🇼"},{name:"tajikistan",emoji:"🇹🇯"},{name:"tanzania",emoji:"🇹🇿"},{name:"thailand",emoji:"🇹🇭"},{name:"timor_leste",emoji:"🇹🇱"},{name:"togo",emoji:"🇹🇬"},{name:"tokelau",emoji:"🇹🇰"},{name:"tonga",emoji:"🇹🇴"},{name:"trinidad_tobago",emoji:"🇹🇹"},{name:"tunisia",emoji:"🇹🇳"},{name:"tr",emoji:"🇹🇷"},{name:"turkmenistan",emoji:"🇹🇲"},{name:"turks_caicos_islands",emoji:"🇹🇨"},{name:"tuvalu",emoji:"🇹🇻"},{name:"uganda",emoji:"🇺🇬"},{name:"ukraine",emoji:"🇺🇦"},{name:"united_arab_emirates",emoji:"🇦🇪"},{name:"uk",emoji:"🇬🇧"},{name:"us",emoji:"🇺🇸"},{name:"us_virgin_islands",emoji:"🇻🇮"},{name:"uruguay",emoji:"🇺🇾"},{name:"uzbekistan",emoji:"🇺🇿"},{name:"vanuatu",emoji:"🇻🇺"},{name:"vatican_city",emoji:"🇻🇦"},{name:"venezuela",emoji:"🇻🇪"},{name:"vietnam",emoji:"🇻🇳"},{name:"wallis_futuna",emoji:"🇼🇫"},{name:"western_sahara",emoji:"🇪🇭"},{name:"yemen",emoji:"🇾🇪"},{name:"zambia",emoji:"🇿🇲"},{name:"zimbabwe",emoji:"🇿🇼"},{name:"star_struck",emoji:"🤩"},{name:"face_with_raised_eyebrow",emoji:"🤨"},{name:"exploding_head",emoji:"🤯"},{name:"crazy_face",emoji:"🤪"},{name:"face_with_symbols_over_mouth",emoji:"🤬"},{name:"face_vomiting",emoji:"🤮"},{name:"shushing_face",emoji:"🤫"},{name:"face_with_hand_over_mouth",emoji:"🤭"},{name:"face_with_monocle",emoji:"🧐"},{name:"child",emoji:"🧒"},{name:"adult",emoji:"🧑"},{name:"older_adult",emoji:"🧓"},{name:"woman_with_headscarf",emoji:"🧕"},{name:"bearded_person",emoji:"🧔"},{name:"breast_feeding",emoji:"🤱"},{name:"mage",emoji:"🧙"},{name:"woman_mage",emoji:"🧙‍♀️"},{name:"fairy",emoji:"🧚"},{name:"vampire",emoji:"🧛"},{name:"merperson",emoji:"🧜"},{name:"merman",emoji:"🧜‍♂️"},{name:"elf",emoji:"🧝"},{name:"genie",emoji:"🧞"},{name:"woman_genie",emoji:"🧞‍♀"},{name:"zombie",emoji:"🧟"},{name:"woman_zombie",emoji:"🧟‍♀"},{name:"person_in_steamy_room",emoji:"🧖"},{name:"woman_in_steamy_room",emoji:"🧖‍♀️"},{name:"person_climbing",emoji:"🧗"},{name:"woman_climbing",emoji:"🧗‍♀️"},{name:"person_in_lotus_position",emoji:"🧘"},{name:"woman_in_lotus_position",emoji:"🧘‍♀️"},{name:"love_you_gesture",emoji:"🤟"},{name:"palms_up_together",emoji:"🤲"},{name:"brain",emoji:"🧠"},{name:"orange_heart",emoji:"🧡"},{name:"scarf",emoji:"🧣"},{name:"gloves",emoji:"🧤"},{name:"coat",emoji:"🧥"},{name:"socks",emoji:"🧦"},{name:"billed_cap",emoji:"🧢"},{name:"zebra",emoji:"🦓"},{name:"giraffe",emoji:"🦒"},{name:"hedgehog",emoji:"🦔"},{name:"sauropod",emoji:"🦕"},{name:"t_rex",emoji:"🦖"},{name:"cricket",emoji:"🦗"},{name:"coconut",emoji:"🥥"},{name:"broccoli",emoji:"🥦"},{name:"pretzel",emoji:"🥨"},{name:"cut_of_meat",emoji:"🥩"},{name:"sandwich",emoji:"🥪"},{name:"bowl_with_spoon",emoji:"🥣"},{name:"canned_food",emoji:"🥫"},{name:"dumpling",emoji:"🥟"},{name:"fortune_cookie",emoji:"🥠"},{name:"takeout_box",emoji:"🥡"},{name:"pie",emoji:"🥧"},{name:"cup_with_straw",emoji:"🥤"},{name:"chopsticks",emoji:"🥢"},{name:"flying_saucer",emoji:"🛸"},{name:"sled",emoji:"🛷"},{name:"curling_stone",emoji:"🥌"},{name:"svalbard_and_jan_mayen",emoji:"🇸🇯"},{name:"st_martin",emoji:"🇲🇫"},{name:"us_outlying_islands",emoji:"🇺🇲"},{name:"tristan_da_cunha",emoji:"🇹🇦"},{name:"heard_and_mc_donald_islands",emoji:"🇭🇲"},{name:"ceuta_and_melilla",emoji:"🇪🇦"},{name:"diego_garcia",emoji:"🇩🇬"},{name:"ascension_island",emoji:"🇦🇨"},{name:"bouvet_island",emoji:"🇧🇻"},{name:"clipperton_island",emoji:"🇨🇵"},{name:"united_nations",emoji:"🇺🇳"},{name:"smiling_face_with_three_hearts",emoji:"🥰"},{name:"hot_face",emoji:"🥵"},{name:"cold_face",emoji:"🥶"},{name:"partying_face",emoji:"🥳"},{name:"woozy_face",emoji:"🥴"},{name:"pleading_face",emoji:"🥺"},{name:"man_red_haired",emoji:"👨‍🦰"},{name:"man_curly_haired",emoji:"👨‍🦱"},{name:"man_white_haired",emoji:"👨‍🦳"},{name:"man_bald",emoji:"👨‍🦲"},{name:"woman_red_haired",emoji:"👩‍🦰"},{name:"woman_curly_haired",emoji:"👩‍🦱"},{name:"woman_white_haired",emoji:"👩‍🦳"},{name:"woman_bald",emoji:"👩‍🦲"},{name:"superhero",emoji:"🦸"},{name:"man_superhero",emoji:"🦸‍♂️"},{name:"woman_superhero",emoji:"🦸‍♀️"},{name:"supervillain",emoji:"🦹"},{name:"woman_supervillain",emoji:"🦹‍♀️"},{name:"man_supervillain",emoji:"🦹‍♂️"},{name:"leg",emoji:"🦵"},{name:"foot",emoji:"🦶"},{name:"bone",emoji:"🦴"},{name:"tooth",emoji:"🦷"},{name:"goggles",emoji:"🥽"},{name:"lab_coat",emoji:"🥼"},{name:"hiking_boot",emoji:"🥾"},{name:"flat_shoe",emoji:"🥿"},{name:"raccoon",emoji:"🦝"},{name:"llama",emoji:"🦙"},{name:"hippopotamus",emoji:"🦛"},{name:"kangaroo",emoji:"🦘"},{name:"badger",emoji:"🦡"},{name:"swan",emoji:"🦢"},{name:"peacock",emoji:"🦚"},{name:"parrot",emoji:"🦜"},{name:"lobster",emoji:"🦞"},{name:"mosquito",emoji:"🦟"},{name:"microbe",emoji:"🦠"},{name:"mango",emoji:"🥭"},{name:"leafy_green",emoji:"🥬"},{name:"bagel",emoji:"🥯"},{name:"salt",emoji:"🧂"},{name:"moon_cake",emoji:"🥮"},{name:"cupcake",emoji:"🧁"},{name:"compass",emoji:"🧭"},{name:"brick",emoji:"🧱"},{name:"skateboard",emoji:"🛹"},{name:"luggage",emoji:"🧳"},{name:"firecracker",emoji:"🧨"},{name:"red_gift_envelope",emoji:"🧧"},{name:"softball",emoji:"🥎"},{name:"flying_disc",emoji:"🥏"},{name:"lacrosse",emoji:"🥍"},{name:"nazar_amulet",emoji:"🧿"},{name:"jigsaw",emoji:"🧩"},{name:"teddy_bear",emoji:"🧸"},{name:"chess_pawn",emoji:"♟"},{name:"thread",emoji:"🧵"},{name:"yarn",emoji:"🧶"},{name:"abacus",emoji:"🧮"},{name:"receipt",emoji:"🧾"},{name:"toolbox",emoji:"🧰"},{name:"magnet",emoji:"🧲"},{name:"test_tube",emoji:"🧪"},{name:"petri_dish",emoji:"🧫"},{name:"dna",emoji:"🧬"},{name:"lotion_bottle",emoji:"🧴"},{name:"safety_pin",emoji:"🧷"},{name:"broom",emoji:"🧹"},{name:"basket",emoji:"🧺"},{name:"roll_of_toilet_paper",emoji:"🧻"},{name:"soap",emoji:"🧼"},{name:"sponge",emoji:"🧽"},{name:"fire_extinguisher",emoji:"🧯"},{name:"infinity",emoji:"♾"},{name:"pirate_flag",emoji:"🏴‍☠"},{name:"waffle",emoji:"🧇"},{name:"otter",emoji:"🦦"},{name:"sloth",emoji:"🦥"},{name:"ice_cube",emoji:"🧊"},{name:"ringer_planet",emoji:"🪐"},{name:"flamingo",emoji:"🦩"},{name:"yawning_face",emoji:"🥱"},{name:"pinching_hand",emoji:"🤏"},{name:"service_dog",emoji:"🐕‍🦺"},{name:"orangutan",emoji:"🦧"},{name:"auto_rickshaw",emoji:"🛺"},{name:"parachute",emoji:"🪂"},{name:"yo-yo",emoji:"🪀"},{name:"kite",emoji:"🪁"},{name:"brown_square",emoji:"🟫"},{name:"purple_square",emoji:"🟪"},{name:"blue_square",emoji:"🟦"},{name:"green_square",emoji:"🟩"},{name:"yellow_square",emoji:"🟨"},{name:"orange_square",emoji:"🟧"},{name:"red_square",emoji:"🟥"},{name:"brown_circle",emoji:"🟤"},{name:"purple_circle",emoji:"🟣"},{name:"green_circle",emoji:"🟢"},{name:"yellow_circle",emoji:"🟡"},{name:"orange_circle",emoji:"🟠"},{name:"razor",emoji:"🪒"},{name:"chair",emoji:"🪑"},{name:"stethoscope",emoji:"🩺"},{name:"adhesive_bandage",emoji:"🩹"},{name:"drop_of_blood",emoji:"🩸"},{name:"probing_cane",emoji:"🦯"},{name:"axe",emoji:"🪓"},{name:"diya_lamp",emoji:"🪔"},{name:"banjo",emoji:"🪕"},{name:"ballet_shoes",emoji:"🩰"},{name:"shorts",emoji:"🩳"},{name:"briefs",emoji:"🩲"},{name:"one_piece_swimsuit",emoji:"🩱"},{name:"sari",emoji:"🥻"},{name:"safety_vest",emoji:"🦺"},{name:"diving_mask",emoji:"🤿"},{name:"motorized_wheelchair",emoji:"🦼"},{name:"manual_wheelchair",emoji:"🦽"},{name:"hindu_temple",emoji:"🛕"},{name:"maté",emoji:"🧉"},{name:"beverage_box",emoji:"🧃"},{name:"oyster",emoji:"🦪"},{name:"butter",emoji:"🧈"},{name:"falafel",emoji:"🧆"},{name:"onion",emoji:"🧅"},{name:"garlic",emoji:"🧄"},{name:"skunk",emoji:"🦨"},{name:"guide_dog",emoji:"🦮"},{name:"people_holding_hands",emoji:"🧑‍🤝‍🧑"},{name:"woman_in_manual_wheelchair",emoji:"👩‍🦽"},{name:"man_in_manual_wheelchair",emoji:"👨‍🦽"},{name:"woman_in_motorized_wheelchair",emoji:"👩‍🦼"},{name:"man_in_motorized_wheelchair",emoji:"👨‍🦼"},{name:"woman_with_probing_cane",emoji:"👩‍🦯"},{name:"man_with_probing_cane",emoji:"👨‍🦯"},{name:"woman_kneeling",emoji:"🧎‍♀️"},{name:"man_kneeling",emoji:"🧎‍♂️"},{name:"man_standing",emoji:"🧍‍♂️"},{name:"woman_standing",emoji:"🧍‍♀️"},{name:"deaf_woman",emoji:"🧏‍♀️"},{name:"deaf_man",emoji:"🧏‍♂️"},{name:"hear_with_hearing_aid",emoji:"🦻"},{name:"mechanical_leg",emoji:"🦿"},{name:"mechanical_arm",emoji:"🦾"},{name:"white_heart",emoji:"🤍"},{name:"brown_heart",emoji:"🤎"},{name:"transgender_flag",emoji:"🏳️‍⚧"},{name:"smiling_face_with_tear",emoji:"🥲"},{name:"disguised_face",emoji:"🥸"},{name:"pinched_fingers",emoji:"🤌"},{name:"anatomical_heart",emoji:"🫀"},{name:"lungs",emoji:"🫁"},{name:"ninja",emoji:"🥷"},{name:"mx_claus",emoji:"🧑‍🎄"},{name:"people_hugging",emoji:"🫂"},{name:"black_cat",emoji:"🐈‍⬛"},{name:"bison",emoji:"🦬"},{name:"mammoth",emoji:"🦣"},{name:"beaver",emoji:"🦫"},{name:"dodo",emoji:"🦤"},{name:"feather",emoji:"🪶"},{name:"seal",emoji:"🦭"},{name:"beetle",emoji:"🪲"},{name:"cockroach",emoji:"🪳"},{name:"fly",emoji:"🪰"},{name:"worm",emoji:"🪱"},{name:"potted_plant",emoji:"🪴"},{name:"blueberries",emoji:"🫐"},{name:"olive",emoji:"🫒"},{name:"bell_pepper",emoji:"🫑"},{name:"flatbread",emoji:"🫓"},{name:"tamale",emoji:"🫔"},{name:"fondue",emoji:"🫕"},{name:"teapot",emoji:"🫖"},{name:"bubble_tea",emoji:"🧋"},{name:"rock",emoji:"🪨"},{name:"wood",emoji:"🪵"},{name:"hut",emoji:"🛖"},{name:"pickup_truck",emoji:"🛻"},{name:"roller_skate",emoji:"🛼"},{name:"magic_wand",emoji:"🪄"},{name:"piñata",emoji:"🪅"},{name:"nesting_dolls",emoji:"🪆"},{name:"sewing_needle",emoji:"🪡"},{name:"knot",emoji:"🪢"},{name:"thong_sandal",emoji:"🩴"},{name:"military_helmet",emoji:"🪖"},{name:"accordion",emoji:"🪗"},{name:"long_drum",emoji:"🪘"},{name:"coin",emoji:"🪙"},{name:"boomerang",emoji:"🪃"},{name:"carpentry_saw",emoji:"🪚"},{name:"screwdriver",emoji:"🪛"},{name:"hook",emoji:"🪝"},{name:"ladder",emoji:"🪜"},{name:"mirror",emoji:"🪞"},{name:"window",emoji:"🪟"},{name:"plunger",emoji:"🪠"},{name:"mouse_trap",emoji:"🪤"},{name:"bucket",emoji:"🪣"},{name:"toothbrush",emoji:"🪥"},{name:"headstone",emoji:"🪦"},{name:"placard",emoji:"🪧"},{name:"transgender_symbol",emoji:"⚧"},{name:"man_feeding_baby",emoji:"👨‍🍼"},{name:"person_feeding_baby",emoji:"🧑‍🍼"},{name:"polar_bear",emoji:"🐻‍❄"},{name:"melting_face",emoji:"🫠"},{name:"smiling_face",emoji:"☺"},{name:"face_with_open_eyes_and_hand_over_mouth",emoji:"🫢"},{name:"face_with_peeking_eye",emoji:"🫣"},{name:"saluting_face",emoji:"🫡"},{name:"dotted_line_face",emoji:"🫥"},{name:"face_in_clouds",emoji:"😶‍🌫"},{name:"face_exhaling",emoji:"😮‍💨"},{name:"face_with_spiral_eyes",emoji:"😵‍💫"},{name:"face_with_diagonal_mouth",emoji:"🫤"},{name:"frowning_face",emoji:"☹"},{name:"face_holding_back_tears",emoji:"🥹"},{name:"heart_on_fire",emoji:"❤️‍🔥"},{name:"mending_heart",emoji:"❤️‍🩹"},{name:"eye_in_speech_bubble",emoji:"👁️‍🗨"},{name:"rightwards_hand",emoji:"🫱"},{name:"leftwards_hand",emoji:"🫲"},{name:"palm_down_hand",emoji:"🫳"},{name:"palm_up_hand",emoji:"🫴"},{name:"hand_with_index_finger_and_thumb_crossed",emoji:"🫰"},{name:"index_pointing_at_the_viewer",emoji:"🫵"},{name:"heart_hands",emoji:"🫶"},{name:"biting_lip",emoji:"🫦"},{name:"man_beard",emoji:"🧔‍♂"},{name:"woman_beard",emoji:"🧔‍♀"},{name:"person_red_hair",emoji:"🧑‍🦰"},{name:"person_curly_hair",emoji:"🧑‍🦱"},{name:"person_white_hair",emoji:"🧑‍🦳"},{name:"person_bald",emoji:"🧑‍🦲"},{name:"man_blond_hair",emoji:"👱‍♂️"},{name:"person_frowning",emoji:"🙍"},{name:"person_pouting",emoji:"🙎"},{name:"person_gesturing_no",emoji:"🙅"},{name:"person_gesturing_ok",emoji:"🙆"},{name:"person_tipping_hand",emoji:"💁"},{name:"person_raising_hand",emoji:"🙋"},{name:"deaf_person",emoji:"🧏"},{name:"man_bowing",emoji:"🙇‍♂️"},{name:"person_facepalming",emoji:"🤦"},{name:"person_shrugging",emoji:"🤷"},{name:"health_worker",emoji:"🧑‍⚕️"},{name:"student",emoji:"🧑‍🎓"},{name:"teacher",emoji:"🧑‍🏫"},{name:"judge",emoji:"🧑‍⚖️"},{name:"farmer",emoji:"🧑‍🌾"},{name:"cook",emoji:"🧑‍🍳"},{name:"mechanic",emoji:"🧑‍🔧"},{name:"factory_worker",emoji:"🧑‍🏭"},{name:"office_worker",emoji:"🧑‍💼"},{name:"scientist",emoji:"🧑‍🔬"},{name:"technologist",emoji:"🧑‍💻"},{name:"singer",emoji:"🧑‍🎤"},{name:"artist",emoji:"🧑‍🎨"},{name:"pilot",emoji:"🧑‍✈️"},{name:"astronaut",emoji:"🧑‍🚀"},{name:"firefighter",emoji:"🧑‍🚒"},{name:"man_police_officer",emoji:"👮‍♂️"},{name:"man_detective",emoji:"🕵️‍♂️"},{name:"man_guard",emoji:"💂‍♂️"},{name:"man_construction_worker",emoji:"👷‍♂️"},{name:"person_with_crown",emoji:"🫅"},{name:"man_wearing_turban",emoji:"👳‍♂️"},{name:"man_in_tuxedo",emoji:"🤵‍♂️"},{name:"woman_in_tuxedo",emoji:"🤵‍♀️"},{name:"man_with_veil",emoji:"👰‍♂️"},{name:"woman_with_veil",emoji:"👰‍♀️"},{name:"pregnant_man",emoji:"🫃"},{name:"pregnant_person",emoji:"🫄"},{name:"woman_feeding_baby",emoji:"👩‍🍼"},{name:"man_mage",emoji:"🧙‍♂️"},{name:"man_fairy",emoji:"🧚‍♂️"},{name:"woman_fairy",emoji:"🧚‍♀️"},{name:"man_vampire",emoji:"🧛‍♂️"},{name:"woman_vampire",emoji:"🧛‍♀️"},{name:"mermaid",emoji:"🧜‍♀️"},{name:"man_elf",emoji:"🧝‍♂️"},{name:"woman_elf",emoji:"🧝‍♀️"},{name:"man_genie",emoji:"🧞‍♂"},{name:"man_zombie",emoji:"🧟‍♂"},{name:"troll",emoji:"🧌"},{name:"person_getting_massage",emoji:"💆"},{name:"person_getting_haircut",emoji:"💇"},{name:"man_walking",emoji:"🚶‍♂️"},{name:"person_standing",emoji:"🧍"},{name:"person_kneeling",emoji:"🧎"},{name:"person_with_white_cane",emoji:"🧑‍🦯"},{name:"person_in_motorized_wheelchair",emoji:"🧑‍🦼"},{name:"person_in_manual_wheelchair",emoji:"🧑‍🦽"},{name:"man_running",emoji:"🏃‍♂️"},{name:"women_with_bunny_ears",emoji:"👯‍♀"},{name:"man_in_steamy_room",emoji:"🧖‍♂️"},{name:"man_climbing",emoji:"🧗‍♂️"},{name:"man_golfing",emoji:"🏌️‍♂️"},{name:"man_surfing",emoji:"🏄‍♂️"},{name:"man_rowing_boat",emoji:"🚣‍♂️"},{name:"man_swimming",emoji:"🏊‍♂️"},{name:"man_bouncing_ball",emoji:"⛹️‍♂️"},{name:"man_lifting_weights",emoji:"🏋️‍♂️"},{name:"man_biking",emoji:"🚴‍♂️"},{name:"man_mountain_biking",emoji:"🚵‍♂️"},{name:"person_cartwheeling",emoji:"🤸"},{name:"people_wrestling",emoji:"🤼"},{name:"person_playing_water_polo",emoji:"🤽"},{name:"person_playing_handball",emoji:"🤾"},{name:"person_juggling",emoji:"🤹"},{name:"man_in_lotus_position",emoji:"🧘‍♂️"},{name:"kiss_woman_man",emoji:"👩‍❤️‍💋‍👨"},{name:"couple_with_heart_woman_man",emoji:"👩‍❤️‍👨"},{name:"family_man_woman_boy",emoji:"👨‍👩‍👦"},{name:"red_hair",emoji:"🦰"},{name:"curly_hair",emoji:"🦱"},{name:"white_hair",emoji:"🦳"},{name:"bald",emoji:"🦲"},{name:"coral",emoji:"🪸"},{name:"lotus",emoji:"🪷"},{name:"empty_nest",emoji:"🪹"},{name:"nest_with_eggs",emoji:"🪺"},{name:"beans",emoji:"🫘"},{name:"pouring_liquid",emoji:"🫗"},{name:"jar",emoji:"🫙"},{name:"playground_slide",emoji:"🛝"},{name:"wheel",emoji:"🛞"},{name:"ring_buoy",emoji:"🛟"},{name:"hamsa",emoji:"🪬"},{name:"mirror_ball",emoji:"🪩"},{name:"low_battery",emoji:"🪫"},{name:"crutch",emoji:"🩼"},{name:"xray",emoji:"🩻"},{name:"elevator",emoji:"🛗"},{name:"bubbles",emoji:"🫧"},{name:"identification_card",emoji:"🪪"},{name:"eject_button",emoji:"⏏"},{name:"female_sign",emoji:"♀"},{name:"male_sign",emoji:"♂"},{name:"heavy_equals_sign",emoji:"🟰"},{name:"medical_symbol",emoji:"⚕"},{name:"england",emoji:"🏴󠁧󠁢󠁥󠁮󠁧󠁿"},{name:"scotland",emoji:"🏴󠁧󠁢󠁳󠁣󠁴󠁿"},{name:"wales",emoji:"🏴󠁧󠁢󠁷󠁬󠁳󠁿"}],Fre=zre;k0({name:"emoji",char:":",pluginKey:new jt("emojiSuggestion"),items:({query:r})=>Fre.filter(e=>e.name.toLowerCase().includes(r.toLowerCase())).sort((e,t)=>{const n=e.name.toLowerCase(),i=t.name.toLowerCase(),a=r.toLowerCase();return n===a&&i!==a?-1:i===a&&n!==a?1:n.startsWith(a)&&!i.startsWith(a)?-1:i.startsWith(a)&&!n.startsWith(a)?1:n.length-i.length}).slice(0,5),command:({editor:r,range:e,props:t})=>{t&&t.emoji?r.chain().focus().deleteRange(e).insertContent(t.emoji).run():console.error("Emoji command execution error: emoji property not found on selected item or item is invalid.",t)},component:Bre});const Vre={key:1,class:"mr-2 h-4 w-4"},$re=Ke({__name:"SlashCommandsList",props:{items:{type:Array,required:!0},editor:{type:Object,required:!0},range:{type:Object,required:!0},command:{type:Function,required:!0},query:String},setup(r,{expose:e}){const t=r,n=te(null),i=o=>{o&&t.command(o)};return e({onKeyDown:({event:o})=>{var s;return((s=n.value)==null?void 0:s.onKeyDown({event:o}))??!1}}),(o,s)=>(Y(),$e(D0,{ref_key:"suggestionList",ref:n,items:t.items,command:l=>i(l),"container-class":"min-w-48","item-class":"h-7","show-no-results":!0},{default:_e(({item:l})=>[l.icon?(Y(),$e(Bh(l.icon),{key:0,class:"mr-2 h-4 w-4"})):(Y(),ae("div",Vre)),Z("span",null,qt(l.title),1)]),_:1},8,["items","command"]))}}),Hre={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Gre(r,e){return Y(),ae("svg",Hre,e[0]||(e[0]=[Z("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 12h8m-8 6V6m8 12V6m9 12h-4c0-4 4-3 4-6c0-1.5-2-2.5-4-1"},null,-1)]))}const Wre=vt({name:"lucide-heading-2",render:Gre}),Ure={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Yre(r,e){return Y(),ae("svg",Ure,e[0]||(e[0]=[Z("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 12h8m-8 6V6m8 12V6m5.5 4.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2m-2 3.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2"},null,-1)]))}const qre=vt({name:"lucide-heading-3",render:Yre}),Xre={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Kre(r,e){return Y(),ae("svg",Xre,e[0]||(e[0]=[Z("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 12h.01M3 18h.01M3 6h.01M8 12h13M8 18h13M8 6h13"},null,-1)]))}const Zre=vt({name:"lucide-list",render:Kre}),Jre={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Qre(r,e){return Y(),ae("svg",Jre,e[0]||(e[0]=[Z("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 12h11m-11 6h11M10 6h11M4 10h2M4 6h1v4m1 8H4c0-1 2-2 2-3s-1-1.5-2-1"},null,-1)]))}const ene=vt({name:"lucide-list-ordered",render:Qre}),tne={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function rne(r,e){return Y(),ae("svg",tne,e[0]||(e[0]=[Z("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m3 17l2 2l4-4M3 7l2 2l4-4m4 1h8m-8 6h8m-8 6h8"},null,-1)]))}const nne=vt({name:"lucide-list-checks",render:rne}),ine={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ane(r,e){return Y(),ae("svg",ine,e[0]||(e[0]=[Z("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m16 18l6-6l-6-6M8 6l-6 6l6 6"},null,-1)]))}const one=vt({name:"lucide-code",render:ane}),sne={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function lne(r,e){return Y(),ae("svg",sne,e[0]||(e[0]=[Z("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1a6 6 0 0 0 6-6V5a2 2 0 0 0-2-2zM5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1a6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z"},null,-1)]))}const une=vt({name:"lucide-quote",render:lne}),cne={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fne(r,e){return Y(),ae("svg",cne,e[0]||(e[0]=[Z("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[Z("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),Z("circle",{cx:"9",cy:"9",r:"2"}),Z("path",{d:"m21 15l-3.086-3.086a2 2 0 0 0-2.828 0L6 21"})],-1)]))}const hne=vt({name:"lucide-image",render:fne}),dne={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function pne(r,e){return Y(),ae("svg",dne,e[0]||(e[0]=[Z("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[Z("path",{d:"m16 13l5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5"}),Z("rect",{width:"14",height:"12",x:"2",y:"6",rx:"2"})],-1)]))}const vne=vt({name:"lucide-video",render:pne}),mne={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function gne(r,e){return Y(),ae("svg",mne,e[0]||(e[0]=[Z("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[Z("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),Z("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})],-1)]))}const yne=vt({name:"lucide-link",render:gne}),bne={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function _ne(r,e){return Y(),ae("svg",bne,e[0]||(e[0]=[Z("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18"},null,-1)]))}const xne=vt({name:"lucide-table-2",render:_ne}),wne=new jt("slashCommandSuggestion"),Sne=()=>[{title:"Heading 2",icon:Wre,command:({editor:r,range:e})=>{r.chain().focus().deleteRange(e).setNode("heading",{level:2}).run()}},{title:"Heading 3",icon:qre,command:({editor:r,range:e})=>{r.chain().focus().deleteRange(e).setNode("heading",{level:3}).run()}},{title:"Bullet List",icon:Zre,command:({editor:r,range:e})=>{r.chain().focus().deleteRange(e).toggleBulletList().run()}},{title:"Numbered List",icon:ene,command:({editor:r,range:e})=>{r.chain().focus().deleteRange(e).toggleOrderedList().run()}},{title:"Task List",icon:nne,command:({editor:r,range:e})=>{r.chain().focus().deleteRange(e).toggleTaskList().run()}},{title:"Code Block",icon:one,command:({editor:r,range:e})=>{r.chain().focus().deleteRange(e).toggleCodeBlock().run()}},{title:"Blockquote",icon:une,command:({editor:r,range:e})=>{r.chain().focus().deleteRange(e).toggleBlockquote().run()}},{title:"Image",icon:hne,command:({editor:r,range:e})=>{r.chain().focus().deleteRange(e).selectAndUploadImage().run()}},{title:"Video",icon:vne,command:({editor:r,range:e})=>{r.chain().focus().deleteRange(e).selectAndUploadVideo().run()}},{title:"Link",icon:yne,command:({editor:r,range:e})=>{r.chain().focus().deleteRange(e).setLink({href:""}).run()}},{title:"Horizontal Rule",icon:T4,command:({editor:r,range:e})=>{r.chain().focus().deleteRange(e).setHorizontalRule().run()}},{title:"Table",icon:xne,command:({editor:r,range:e})=>{r.chain().focus().deleteRange(e).insertTable({rows:3,cols:3,withHeaderRow:!0}).run()}}];k0({name:"slashCommands",char:"/",pluginKey:wne,items:({query:r})=>Sne().filter(t=>t.title.toLowerCase().startsWith(r.toLowerCase())),command:({editor:r,range:e,props:t})=>{t&&typeof t.command=="function"?t.command({editor:r,range:e}):console.error("Slash command execution error: command function not found on selected item or item is invalid.",t)},component:$re});function qT(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Mu=qT();function eB(r){Mu=r}var ed={exec:()=>null};function Ct(r,e=""){let t=typeof r=="string"?r:r.source;const n={replace:(i,a)=>{let o=typeof a=="string"?a:a.source;return o=o.replace(cn.caret,"$1"),t=t.replace(i,o),n},getRegex:()=>new RegExp(t,e)};return n}var cn={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:r=>new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}#`),htmlBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}<(?:[a-z].*>|!--)`,"i")},Tne=/^(?:[ \t]*(?:\n|$))+/,Cne=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ane=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,bp=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Mne=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,XT=/(?:[*+-]|\d{1,9}[.)])/,tB=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,rB=Ct(tB).replace(/bull/g,XT).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),kne=Ct(tB).replace(/bull/g,XT).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),KT=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Dne=/^[^\n]+/,ZT=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Ene=Ct(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ZT).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Lne=Ct(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,XT).getRegex(),E0="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",JT=/|$))/,Ine=Ct("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",JT).replace("tag",E0).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),nB=Ct(KT).replace("hr",bp).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",E0).getRegex(),Pne=Ct(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",nB).getRegex(),QT={blockquote:Pne,code:Cne,def:Ene,fences:Ane,heading:Mne,hr:bp,html:Ine,lheading:rB,list:Lne,newline:Tne,paragraph:nB,table:ed,text:Dne},LD=Ct("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",bp).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",E0).getRegex(),Rne={...QT,lheading:kne,table:LD,paragraph:Ct(KT).replace("hr",bp).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",LD).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",E0).getRegex()},One={...QT,html:Ct(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",JT).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ed,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ct(KT).replace("hr",bp).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",rB).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},jne=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Nne=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,iB=/^( {2,}|\\)\n(?!\s*$)/,Bne=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g,sB=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Hne=Ct(sB,"u").replace(/punct/g,L0).getRegex(),Gne=Ct(sB,"u").replace(/punct/g,oB).getRegex(),lB="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Wne=Ct(lB,"gu").replace(/notPunctSpace/g,aB).replace(/punctSpace/g,eC).replace(/punct/g,L0).getRegex(),Une=Ct(lB,"gu").replace(/notPunctSpace/g,Vne).replace(/punctSpace/g,Fne).replace(/punct/g,oB).getRegex(),Yne=Ct("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,aB).replace(/punctSpace/g,eC).replace(/punct/g,L0).getRegex(),qne=Ct(/\\(punct)/,"gu").replace(/punct/g,L0).getRegex(),Xne=Ct(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Kne=Ct(JT).replace("(?:-->|$)","-->").getRegex(),Zne=Ct("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",Kne).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),iy=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Jne=Ct(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",iy).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),uB=Ct(/^!?\[(label)\]\[(ref)\]/).replace("label",iy).replace("ref",ZT).getRegex(),cB=Ct(/^!?\[(ref)\](?:\[\])?/).replace("ref",ZT).getRegex(),Qne=Ct("reflink|nolink(?!\\()","g").replace("reflink",uB).replace("nolink",cB).getRegex(),tC={_backpedal:ed,anyPunctuation:qne,autolink:Xne,blockSkip:$ne,br:iB,code:Nne,del:ed,emStrongLDelim:Hne,emStrongRDelimAst:Wne,emStrongRDelimUnd:Yne,escape:jne,link:Jne,nolink:cB,punctuation:zne,reflink:uB,reflinkSearch:Qne,tag:Zne,text:Bne,url:ed},eie={...tC,link:Ct(/^!?\[(label)\]\((.*?)\)/).replace("label",iy).getRegex(),reflink:Ct(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",iy).getRegex()},Nw={...tC,emStrongRDelimAst:Une,emStrongLDelim:Gne,url:Ct(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},ID=r=>rie[r];function Ji(r,e){if(e){if(cn.escapeTest.test(r))return r.replace(cn.escapeReplace,ID)}else if(cn.escapeTestNoEncode.test(r))return r.replace(cn.escapeReplaceNoEncode,ID);return r}function PD(r){try{r=encodeURI(r).replace(cn.percentDecode,"%")}catch{return null}return r}function RD(r,e){var a;const t=r.replace(cn.findPipe,(o,s,l)=>{let u=!1,c=s;for(;--c>=0&&l[c]==="\\";)u=!u;return u?"|":" |"}),n=t.split(cn.splitPipe);let i=0;if(n[0].trim()||n.shift(),n.length>0&&!((a=n.at(-1))!=null&&a.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length0?-2:-1}function OD(r,e,t,n,i){const a=e.href,o=e.title||null,s=r[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;const l={type:r[0].charAt(0)==="!"?"image":"link",raw:t,href:a,title:o,text:s,tokens:n.inlineTokens(s)};return n.state.inLink=!1,l}function iie(r,e,t){const n=r.match(t.other.indentCodeCompensation);if(n===null)return e;const i=n[1];return e.split(` `).map(a=>{const o=a.match(t.other.beginningSpace);if(o===null)return a;const[s]=o;return s.length>=i.length?a.slice(i.length):a}).join(` `)}var ay=class{constructor(r){Rt(this,"options");Rt(this,"rules");Rt(this,"lexer");this.options=r||Mu}space(r){const e=this.rules.block.newline.exec(r);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(r){const e=this.rules.block.code.exec(r);if(e){const t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:zf(t,` `)}}}fences(r){const e=this.rules.block.fences.exec(r);if(e){const t=e[0],n=iie(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:n}}}heading(r){const e=this.rules.block.heading.exec(r);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){const n=zf(t,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(t=n.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(r){const e=this.rules.block.hr.exec(r);if(e)return{type:"hr",raw:zf(e[0],` `)}}blockquote(r){const e=this.rules.block.blockquote.exec(r);if(e){let t=zf(e[0],` `).split(` `),n="",i="";const a=[];for(;t.length>0;){let o=!1;const s=[];let l;for(l=0;l1,i={type:"list",raw:"",ordered:n,start:n?+t.slice(0,-1):"",loose:!1,items:[]};t=n?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=n?t:"[*+-]");const a=this.rules.other.listItemRegex(t);let o=!1;for(;r;){let l=!1,u="",c="";if(!(e=a.exec(r))||this.rules.block.hr.test(r))break;u=e[0],r=r.substring(u.length);let f=e[2].split(` `,1)[0].replace(this.rules.other.listReplaceTabs,g=>" ".repeat(3*g.length)),h=r.split(` `,1)[0],d=!f.trim(),p=0;if(this.options.pedantic?(p=2,c=f.trimStart()):d?p=e[1].length+1:(p=e[2].search(this.rules.other.nonSpaceChar),p=p>4?1:p,c=f.slice(p),p+=e[1].length),d&&this.rules.other.blankLine.test(h)&&(u+=h+` `,r=r.substring(h.length+1),l=!0),!l){const g=this.rules.other.nextBulletRegex(p),y=this.rules.other.hrRegex(p),b=this.rules.other.fencesBeginRegex(p),_=this.rules.other.headingBeginRegex(p),x=this.rules.other.htmlBeginRegex(p);for(;r;){const w=r.split(` `,1)[0];let S;if(h=w,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),S=h):S=h.replace(this.rules.other.tabCharGlobal," "),b.test(h)||_.test(h)||x.test(h)||g.test(h)||y.test(h))break;if(S.search(this.rules.other.nonSpaceChar)>=p||!h.trim())c+=` `+S.slice(p);else{if(d||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||b.test(f)||_.test(f)||y.test(f))break;c+=` `+h}!d&&!h.trim()&&(d=!0),u+=w+` `,r=r.substring(w.length+1),f=S.slice(p)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(o=!0));let v=null,m;this.options.gfm&&(v=this.rules.other.listIsTask.exec(c),v&&(m=v[0]!=="[ ] ",c=c.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:u,task:!!v,checked:m,loose:!1,text:c,tokens:[]}),i.raw+=u}const s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let l=0;lf.type==="space"),c=u.length>0&&u.some(f=>this.rules.other.anyLine.test(f.raw));i.loose=c}if(i.loose)for(let l=0;l({text:l,tokens:this.lexer.inline(l),header:!1,align:a.align[u]})));return a}}lheading(r){const e=this.rules.block.lheading.exec(r);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(r){const e=this.rules.block.paragraph.exec(r);if(e){const t=e[1].charAt(e[1].length-1)===` `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(r){const e=this.rules.block.text.exec(r);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(r){const e=this.rules.inline.escape.exec(r);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(r){const e=this.rules.inline.tag.exec(r);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(r){const e=this.rules.inline.link.exec(r);if(e){const t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;const a=zf(t.slice(0,-1),"\\");if((t.length-a.length)%2===0)return}else{const a=nie(e[2],"()");if(a===-2)return;if(a>-1){const s=(e[0].indexOf("!")===0?5:4)+e[1].length+a;e[2]=e[2].substring(0,a),e[0]=e[0].substring(0,s).trim(),e[3]=""}}let n=e[2],i="";if(this.options.pedantic){const a=this.rules.other.pedanticHrefTitle.exec(n);a&&(n=a[1],i=a[3])}else i=e[3]?e[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?n=n.slice(1):n=n.slice(1,-1)),OD(e,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(r,e){let t;if((t=this.rules.inline.reflink.exec(r))||(t=this.rules.inline.nolink.exec(r))){const n=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[n.toLowerCase()];if(!i){const a=t[0].charAt(0);return{type:"text",raw:a,text:a}}return OD(t,i,t[0],this.lexer,this.rules)}}emStrong(r,e,t=""){let n=this.rules.inline.emStrongLDelim.exec(r);if(!n||n[3]&&t.match(this.rules.other.unicodeAlphaNumeric))return;if(!(n[1]||n[2]||"")||!t||this.rules.inline.punctuation.exec(t)){const a=[...n[0]].length-1;let o,s,l=a,u=0;const c=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,e=e.slice(-1*r.length+a);(n=c.exec(e))!=null;){if(o=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!o)continue;if(s=[...o].length,n[3]||n[4]){l+=s;continue}else if((n[5]||n[6])&&a%3&&!((a+s)%3)){u+=s;continue}if(l-=s,l>0)continue;s=Math.min(s,s+l+u);const f=[...n[0]][0].length,h=r.slice(0,a+n.index+f+s);if(Math.min(a,s)%2){const p=h.slice(1,-1);return{type:"em",raw:h,text:p,tokens:this.lexer.inlineTokens(p)}}const d=h.slice(2,-2);return{type:"strong",raw:h,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(r){const e=this.rules.inline.code.exec(r);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," ");const n=this.rules.other.nonSpaceChar.test(t),i=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return n&&i&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(r){const e=this.rules.inline.br.exec(r);if(e)return{type:"br",raw:e[0]}}del(r){const e=this.rules.inline.del.exec(r);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(r){const e=this.rules.inline.autolink.exec(r);if(e){let t,n;return e[2]==="@"?(t=e[1],n="mailto:"+t):(t=e[1],n=t),{type:"link",raw:e[0],text:t,href:n,tokens:[{type:"text",raw:t,text:t}]}}}url(r){var t;let e;if(e=this.rules.inline.url.exec(r)){let n,i;if(e[2]==="@")n=e[0],i="mailto:"+n;else{let a;do a=e[0],e[0]=((t=this.rules.inline._backpedal.exec(e[0]))==null?void 0:t[0])??"";while(a!==e[0]);n=e[0],e[1]==="www."?i="http://"+e[0]:i=e[0]}return{type:"link",raw:e[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(r){const e=this.rules.inline.text.exec(r);if(e){const t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},no=class Bw{constructor(e){Rt(this,"tokens");Rt(this,"options");Rt(this,"state");Rt(this,"tokenizer");Rt(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Mu,this.options.tokenizer=this.options.tokenizer||new ay,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={other:cn,block:uv.normal,inline:Bf.normal};this.options.pedantic?(t.block=uv.pedantic,t.inline=Bf.pedantic):this.options.gfm&&(t.block=uv.gfm,this.options.breaks?t.inline=Bf.breaks:t.inline=Bf.gfm),this.tokenizer.rules=t}static get rules(){return{block:uv,inline:Bf}}static lex(e,t){return new Bw(t).lex(e)}static lexInline(e,t){return new Bw(t).inlineTokens(e)}lex(e){e=e.replace(cn.carriageReturn,` `),this.blockTokens(e,this.tokens);for(let t=0;t(s=u.call({lexer:this},e,t))?(e=e.substring(s.raw.length),t.push(s),!0):!1))continue;if(s=this.tokenizer.space(e)){e=e.substring(s.raw.length);const u=t.at(-1);s.raw.length===1&&u!==void 0?u.raw+=` `:t.push(s);continue}if(s=this.tokenizer.code(e)){e=e.substring(s.raw.length);const u=t.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=` `+s.raw,u.text+=` `+s.text,this.inlineQueue.at(-1).src=u.text):t.push(s);continue}if(s=this.tokenizer.fences(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.heading(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.hr(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.blockquote(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.list(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.html(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.def(e)){e=e.substring(s.raw.length);const u=t.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=` `+s.raw,u.text+=` `+s.raw,this.inlineQueue.at(-1).src=u.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title});continue}if(s=this.tokenizer.table(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.lheading(e)){e=e.substring(s.raw.length),t.push(s);continue}let l=e;if((o=this.options.extensions)!=null&&o.startBlock){let u=1/0;const c=e.slice(1);let f;this.options.extensions.startBlock.forEach(h=>{f=h.call({lexer:this},c),typeof f=="number"&&f>=0&&(u=Math.min(u,f))}),u<1/0&&u>=0&&(l=e.substring(0,u+1))}if(this.state.top&&(s=this.tokenizer.paragraph(l))){const u=t.at(-1);n&&(u==null?void 0:u.type)==="paragraph"?(u.raw+=` `+s.raw,u.text+=` `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):t.push(s),n=l.length!==e.length,e=e.substring(s.raw.length);continue}if(s=this.tokenizer.text(e)){e=e.substring(s.raw.length);const u=t.at(-1);(u==null?void 0:u.type)==="text"?(u.raw+=` `+s.raw,u.text+=` `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):t.push(s);continue}if(e){const u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var s,l,u;let n=e,i=null;if(this.tokens.links){const c=Object.keys(this.tokens.links);if(c.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)c.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let a=!1,o="";for(;e;){a||(o=""),a=!1;let c;if((l=(s=this.options.extensions)==null?void 0:s.inline)!=null&&l.some(h=>(c=h.call({lexer:this},e,t))?(e=e.substring(c.raw.length),t.push(c),!0):!1))continue;if(c=this.tokenizer.escape(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.tag(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.link(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(c.raw.length);const h=t.at(-1);c.type==="text"&&(h==null?void 0:h.type)==="text"?(h.raw+=c.raw,h.text+=c.text):t.push(c);continue}if(c=this.tokenizer.emStrong(e,n,o)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.codespan(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.br(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.del(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.autolink(e)){e=e.substring(c.raw.length),t.push(c);continue}if(!this.state.inLink&&(c=this.tokenizer.url(e))){e=e.substring(c.raw.length),t.push(c);continue}let f=e;if((u=this.options.extensions)!=null&&u.startInline){let h=1/0;const d=e.slice(1);let p;this.options.extensions.startInline.forEach(v=>{p=v.call({lexer:this},d),typeof p=="number"&&p>=0&&(h=Math.min(h,p))}),h<1/0&&h>=0&&(f=e.substring(0,h+1))}if(c=this.tokenizer.inlineText(f)){e=e.substring(c.raw.length),c.raw.slice(-1)!=="_"&&(o=c.raw.slice(-1)),a=!0;const h=t.at(-1);(h==null?void 0:h.type)==="text"?(h.raw+=c.raw,h.text+=c.text):t.push(c);continue}if(e){const h="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return t}},oy=class{constructor(r){Rt(this,"options");Rt(this,"parser");this.options=r||Mu}space(r){return""}code({text:r,lang:e,escaped:t}){var a;const n=(a=(e||"").match(cn.notSpaceStart))==null?void 0:a[0],i=r.replace(cn.endingNewline,"")+` `;return n?'
'+(t?i:Ji(i,!0))+`
`:"
"+(t?i:Ji(i,!0))+`
`}blockquote({tokens:r}){return`
${this.parser.parse(r)}
`}html({text:r}){return r}heading({tokens:r,depth:e}){return`${this.parser.parseInline(r)} `}hr(r){return`
`}list(r){const e=r.ordered,t=r.start;let n="";for(let o=0;o `+n+" `}listitem(r){var t;let e="";if(r.task){const n=this.checkbox({checked:!!r.checked});r.loose?((t=r.tokens[0])==null?void 0:t.type)==="paragraph"?(r.tokens[0].text=n+" "+r.tokens[0].text,r.tokens[0].tokens&&r.tokens[0].tokens.length>0&&r.tokens[0].tokens[0].type==="text"&&(r.tokens[0].tokens[0].text=n+" "+Ji(r.tokens[0].tokens[0].text),r.tokens[0].tokens[0].escaped=!0)):r.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):e+=n+" "}return e+=this.parser.parse(r.tokens,!!r.loose),`
  • ${e}
  • `}checkbox({checked:r}){return"'}paragraph({tokens:r}){return`

    ${this.parser.parseInline(r)}

    `}table(r){let e="",t="";for(let i=0;i${n}`),` `+e+` `+n+`
    `}tablerow({text:r}){return` ${r} `}tablecell(r){const e=this.parser.parseInline(r.tokens),t=r.header?"th":"td";return(r.align?`<${t} align="${r.align}">`:`<${t}>`)+e+` `}strong({tokens:r}){return`${this.parser.parseInline(r)}`}em({tokens:r}){return`${this.parser.parseInline(r)}`}codespan({text:r}){return`${Ji(r,!0)}`}br(r){return"
    "}del({tokens:r}){return`${this.parser.parseInline(r)}`}link({href:r,title:e,tokens:t}){const n=this.parser.parseInline(t),i=PD(r);if(i===null)return n;r=i;let a='
    ",a}image({href:r,title:e,text:t,tokens:n}){n&&(t=this.parser.parseInline(n,this.parser.textRenderer));const i=PD(r);if(i===null)return Ji(t);r=i;let a=`${t}{const l=o[s].flat(1/0);t=t.concat(this.walkTokens(l,e))}):o.tokens&&(t=t.concat(this.walkTokens(o.tokens,e)))}}return t}use(...r){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return r.forEach(t=>{const n={...t};if(n.async=this.defaults.async||n.async||!1,t.extensions&&(t.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){const a=e.renderers[i.name];a?e.renderers[i.name]=function(...o){let s=i.renderer.apply(this,o);return s===!1&&(s=a.apply(this,o)),s}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const a=e[i.level];a?a.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),n.extensions=e),t.renderer){const i=this.defaults.renderer||new oy(this.defaults);for(const a in t.renderer){if(!(a in i))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;const o=a,s=t.renderer[o],l=i[o];i[o]=(...u)=>{let c=s.apply(i,u);return c===!1&&(c=l.apply(i,u)),c||""}}n.renderer=i}if(t.tokenizer){const i=this.defaults.tokenizer||new ay(this.defaults);for(const a in t.tokenizer){if(!(a in i))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;const o=a,s=t.tokenizer[o],l=i[o];i[o]=(...u)=>{let c=s.apply(i,u);return c===!1&&(c=l.apply(i,u)),c}}n.tokenizer=i}if(t.hooks){const i=this.defaults.hooks||new Lm;for(const a in t.hooks){if(!(a in i))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;const o=a,s=t.hooks[o],l=i[o];Lm.passThroughHooks.has(a)?i[o]=u=>{if(this.defaults.async)return Promise.resolve(s.call(i,u)).then(f=>l.call(i,f));const c=s.call(i,u);return l.call(i,c)}:i[o]=(...u)=>{let c=s.apply(i,u);return c===!1&&(c=l.apply(i,u)),c}}n.hooks=i}if(t.walkTokens){const i=this.defaults.walkTokens,a=t.walkTokens;n.walkTokens=function(o){let s=[];return s.push(a.call(this,o)),i&&(s=s.concat(i.call(this,o))),s}}this.defaults={...this.defaults,...n}}),this}setOptions(r){return this.defaults={...this.defaults,...r},this}lexer(r,e){return no.lex(r,e??this.defaults)}parser(r,e){return io.parse(r,e??this.defaults)}parseMarkdown(r){return(t,n)=>{const i={...n},a={...this.defaults,...i},o=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));a.hooks&&(a.hooks.options=a,a.hooks.block=r);const s=a.hooks?a.hooks.provideLexer():r?no.lex:no.lexInline,l=a.hooks?a.hooks.provideParser():r?io.parse:io.parseInline;if(a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(t):t).then(u=>s(u,a)).then(u=>a.hooks?a.hooks.processAllTokens(u):u).then(u=>a.walkTokens?Promise.all(this.walkTokens(u,a.walkTokens)).then(()=>u):u).then(u=>l(u,a)).then(u=>a.hooks?a.hooks.postprocess(u):u).catch(o);try{a.hooks&&(t=a.hooks.preprocess(t));let u=s(t,a);a.hooks&&(u=a.hooks.processAllTokens(u)),a.walkTokens&&this.walkTokens(u,a.walkTokens);let c=l(u,a);return a.hooks&&(c=a.hooks.postprocess(c)),c}catch(u){return o(u)}}}onError(r,e){return t=>{if(t.message+=` Please report this to https://github.com/markedjs/marked.`,r){const n="

    An error occurred:

    "+Ji(t.message+"",!0)+"
    ";return e?Promise.resolve(n):n}if(e)return Promise.reject(t);throw t}}},du=new aie;function Dt(r,e){return du.parse(r,e)}Dt.options=Dt.setOptions=function(r){return du.setOptions(r),Dt.defaults=du.defaults,eB(Dt.defaults),Dt};Dt.getDefaults=qT;Dt.defaults=Mu;Dt.use=function(...r){return du.use(...r),Dt.defaults=du.defaults,eB(Dt.defaults),Dt};Dt.walkTokens=function(r,e){return du.walkTokens(r,e)};Dt.parseInline=du.parseInline;Dt.Parser=io;Dt.parser=io.parse;Dt.Renderer=oy;Dt.TextRenderer=rC;Dt.Lexer=no;Dt.lexer=no.lex;Dt.Tokenizer=ay;Dt.Hooks=Lm;Dt.parse=Dt;Dt.options;Dt.setOptions;Dt.use;Dt.walkTokens;Dt.parseInline;io.parse;no.lex;function oie(r){return Dt.parse(r,{gfm:!0,breaks:!0,async:!1})}function sie(r){return r.split(` `).filter(n=>/!\[.*\]\(.*\)/.test(n)||/\[.*\]\(.*\)/.test(n)||/(^|\s)\*.*\*(\s|$)/.test(n)||/(^|\s)_.*_(\s|$)/.test(n)||/(^|\s)\*\*.*\*\*(\s|$)/.test(n)||/(^|\s)__.*__(\s|$)/.test(n)||/(^|\s)~~.*~~(\s|$)/.test(n)||n.startsWith("![")||n.startsWith("#")||n.startsWith("> ")||n.startsWith("*")||n.startsWith("- ")||n.startsWith("1. ")||n.startsWith("```")||n.startsWith("`")||n.startsWith("[")||n.startsWith("---")).length>0}Kt.create({name:"contentPaste",addOptions(){return{enabled:!0,showConfirmation:!0,uploadFunction:null}},addProseMirrorPlugins(){const r=this;return[new Ut({key:new jt("contentPaste"),props:{handlePaste:(e,t,n)=>{var h,d;if(!this.options.enabled)return!1;const i=Array.from(((h=t.clipboardData)==null?void 0:h.files)||[]),a=Array.from(i).filter(p=>p.type.startsWith("image/"));if(a.length>0)return Mw(a,e,null,r.options),!0;const o=(d=t.clipboardData)==null?void 0:d.getData("text/plain");if(!o||!sie(o)||this.options.showConfirmation&&!confirm("Do you want to convert markdown content to HTML before pasting?"))return!1;const s=oie(o),l=document.createElement("div");l.innerHTML=s;const c=Gh.fromSchema(e.state.schema).parseSlice(l,{preserveWhitespace:!0}),f=e.state.tr.replaceSelection(c);return e.dispatch(f),!0}}})]}});const lie=ar.create({name:"tagItem",group:"inline",inline:!0,selectable:!0,atom:!0,addAttributes(){return{tagId:{default:null,parseHTML:r=>r.getAttribute("data-tag-id"),renderHTML:r=>r.tagId?{"data-tag-id":r.tagId}:{}},tagLabel:{default:"tag",parseHTML:r=>r.getAttribute("data-tag-label"),renderHTML:r=>({"data-tag-label":r.tagLabel})}}},parseHTML(){return[{tag:"span.tag-item",getAttrs:r=>{const e=r;return{tagId:e.getAttribute("data-tag-id"),tagLabel:e.getAttribute("data-tag-label")||e.innerText.replace(/^#/,"")}}}]},renderHTML({HTMLAttributes:r}){return["span",Lt(r,{class:"tag-item"}),`#${r["data-tag-label"]}`]},addCommands(){return{setTag:r=>({commands:e})=>e.insertContent({type:this.name,attrs:r})}}});k0({name:"tagSuggestion",char:"#",pluginKey:new jt("tagSuggestion"),component:D0,addOptions(){return{tags:[]}},items:({query:r,editor:e})=>{const{tags:t}=e.extensionManager.extensions.find(a=>a.name==="tagSuggestion").options;let n=Nr(t),i=n.filter(a=>a.label.toLowerCase().startsWith(r.toLowerCase())).map(a=>({...a,display:a.label}));return r.length>0&&!n.some(a=>a.label.toLowerCase()===r.toLowerCase())&&i.push({display:`New tag: "${r}"`,label:r,isNew:!0}),i},command:({editor:r,range:e,props:t})=>{const n={tagLabel:t.label,...t.id&&!t.isNew&&{tagId:t.id}};r.chain().focus().insertContentAt(e,[{type:lie.name,attrs:n},{type:"text",text:" "}]).run()},tippyOptions:{placement:"bottom-start",offset:[0,8]},allowSpaces:!1,decorationTag:"span",decorationClass:"tag-suggestion-active"});s4.extend({addInputRules(){return this.options.levels.map(r=>{let e=new RegExp(`^(#{${r}}) $`);return Mg({find:e,type:this.type,getAttributes:{level:r}})})}});const uie={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function cie(r,e){return Y(),ae("svg",uie,e[0]||(e[0]=[Z("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[Z("path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),Z("path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z"})],-1)]))}const fie=vt({name:"lucide-edit",render:cie}),hie={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function die(r,e){return Y(),ae("svg",hie,e[0]||(e[0]=[Z("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[Z("path",{d:"M16 5h6m-3-3v6m2 3.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5"}),Z("path",{d:"m21 15l-3.086-3.086a2 2 0 0 0-2.828 0L6 21"}),Z("circle",{cx:"9",cy:"9",r:"2"})],-1)]))}const jD=vt({name:"lucide-image-plus",render:die}),pie={class:"space-y-2"},vie={class:"flex items-center gap-2"},mie=["onDragstart","onDragover","onDragleave"],gie=["onClick"],yie=["src","alt"],bie=["onClick"],_ie=["title"],xie=["onBlur","onKeydown"],wie={key:0,class:"flex flex-col items-center justify-center w-full h-full text-ink-gray-4 bg-surface-gray-1 rounded-[2px]"},Sie=["title"],Tie=["src","alt"],Cie=["onClick"],Aie=["title"],Mie=["onBlur","onKeydown"],kie={key:1,class:"text-p-sm text-ink-gray-5"},Die={key:2,class:"flex flex-col items-center justify-center min-h-[200px]"},Eie={class:"text-ink-gray-4 mb-2"},Lie={key:3},Iie={class:"mb-2 text-sm"},Pie={class:"w-full bg-gray-200 rounded h-2 overflow-hidden"},Rie={key:0,class:"mt-2 text-red-500 text-xs"},Oie={class:"flex justify-end gap-2"},jie={key:0,class:"fixed inset-0 z-50 bg-gray-900/60 pointer-events-none flex items-center justify-center"},Nie=Ke({__name:"ImageGroupUploadDialog",props:{modelValue:{type:Boolean},files:{},editor:{},mode:{default:"new"},existingImages:{},initialColumns:{}},emits:["update:modelValue","close","update:files","save"],setup(r,{emit:e}){const t=r,n=e,i=de({get:()=>t.modelValue,set:G=>n("update:modelValue",G)}),a=te(!1),o=te(null),s=te(null),l=te(!1),u=te(null),c=te(""),f=te(null),h=te(!1),d=te(4),p=te(0),v=te(0),m=te(0),g=te([]),y=te([]),b=te([]);Nt(()=>t.modelValue,G=>{if(G&&t.mode==="edit"){const ee=(t.existingImages||[]).map(D),Q=(t.files||[]).map(M);b.value=[...ee,...Q],t.initialColumns&&(d.value=t.initialColumns,l.value=!0)}else G&&t.mode==="new"&&(b.value=(t.files||[]).map(M),d.value=E(b.value.length),l.value=!0)},{immediate:!0}),Nt(()=>t.existingImages,G=>{if(t.modelValue&&t.mode==="edit"){const ee=(G||[]).map(D),Q=(t.files||[]).map(M);b.value=[...ee,...Q]}},{deep:!0}),Nt(()=>t.files,G=>{t.mode==="new"&&(b.value=(G||[]).map(M))},{deep:!0}),zi(()=>{window.addEventListener("dragover",B),window.addEventListener("drop",A),window.addEventListener("dragleave",$)}),Ss(()=>{window.removeEventListener("dragover",B),window.removeEventListener("drop",A),window.removeEventListener("dragleave",$)});async function _(){const G=b.value.filter(he=>he.type==="file"&&he.file).map(he=>he.file);b.value.filter(he=>he.type==="existing"&&he.existing).map(he=>he.existing);let ee=[];G.length>0&&(ee=await re(G));const Q=new Map;G.forEach((he,Se)=>{const Fe=ee[Se];Fe!=null&&Fe.success&&Fe.file&&Q.set(he,{src:Fe.file.file_url||"",alt:Fe.file.file_name||""})});const me=[];for(const he of b.value)if(he.type==="existing"&&he.existing)me.push(he.existing);else if(he.type==="file"&&he.file){const Se=Q.get(he.file);Se&&me.push(Se)}n("save",{images:me,columns:d.value}),h.value=!1,i.value=!1}async function x(){if(!t.files||t.files.length===0)return;const ee=(await re(t.files)).filter(Q=>Q.success&&Q.file).map(Q=>{var me,he;return{src:((me=Q.file)==null?void 0:me.file_url)||"",alt:((he=Q.file)==null?void 0:he.file_name)||""}});ee.length>1&&t.editor.chain().focus().setImageGroup({images:ee,columns:d.value}).run(),h.value=!1,i.value=!1,n("close")}function w(){i.value=!1,n("close")}function S(G){if(b.value.splice(G,1),t.mode==="new"){const ee=b.value.filter(Q=>Q.type==="file"&&Q.file).map(Q=>Q.file);n("update:files",ee)}}function T(){const G=document.createElement("input");G.type="file",G.accept="image/*",G.multiple=!0,G.onchange=ee=>{const Q=ee.target.files;Q&&C(Array.from(Q))},G.click()}function C(G){const Q=G.filter(Se=>Se.type.startsWith("image/")).map(M),me=b.value.filter(Se=>Se.type==="file"&&Se.file).map(Se=>`${Se.file.name}-${Se.file.size}`),he=Q.filter(Se=>!me.includes(`${Se.file.name}-${Se.file.size}`));if(b.value.push(...he),t.mode==="new"){const Se=b.value.filter(Fe=>Fe.type==="file"&&Fe.file).map(Fe=>Fe.file);n("update:files",Se)}}function A(G){var Q;G.preventDefault(),G.stopPropagation();const ee=Array.from(((Q=G.dataTransfer)==null?void 0:Q.files)||[]);if(ee.length)C(ee);else if(o.value!==null&&s.value!==null&&o.value!==s.value){const[me]=b.value.splice(o.value,1);if(b.value.splice(s.value,0,me),t.mode==="new"){const he=b.value.filter(Se=>Se.type==="file"&&Se.file).map(Se=>Se.file);n("update:files",he)}}a.value=!1,o.value=null,s.value=null}function M(G){return{type:"file",file:G,id:`file-${G.name}-${G.size}-${Date.now()}`}}function D(G){return{type:"existing",existing:G,id:`existing-${G.src}-${Date.now()}`}}function E(G){return G<=4?G:G%4===0?4:G%3===0?3:G>10?4:3}function L(){var ee;const G=t.editor.extensionManager.extensions.find(Q=>Q.name==="imageGroup");return(ee=G==null?void 0:G.options)==null?void 0:ee.uploadFunction}function I(G){const ee=URL.createObjectURL(G);return Ss(()=>{URL.revokeObjectURL(ee)}),ee}function R(G){const ee=["image/heic","image/heif"],Q=[".heic",".heif"],me=ee.includes(G.type),he=Q.some(Se=>{var Fe;return(Fe=G.name)==null?void 0:Fe.toLowerCase().endsWith(Se)});return!me&&!he}function P(G,ee){G.preventDefault(),s.value=ee}function O(G){o.value=G}function j(){o.value=null,s.value=null}function F(G,ee){s.value===ee&&(s.value=null)}function N(G){return s.value===G&&o.value!==null&&o.value!==G}function B(G){G.preventDefault(),G.dataTransfer&&Array.from(G.dataTransfer.types).includes("Files")&&(a.value=!0)}function $(G){(G.target===window||G.relatedTarget===null)&&(a.value=!1)}const J=de(()=>({gridTemplateColumns:`repeat(${d.value||4}, minmax(0, 1fr))`})),U=de({get:()=>String(d.value??4),set:G=>{d.value=+G}}),we=[{label:"2 columns",value:"2"},{label:"3 columns",value:"3"},{label:"4 columns",value:"4"}];function Ye(G,ee){u.value=G,c.value=ee,Ca(()=>{f.value&&(f.value.focus(),f.value.select())})}function ge(G,ee){var Se;const[Q,me]=G.split("-"),he=c.value.trim();Q==="existing"?(Se=b.value[ee])!=null&&Se.existing&&(b.value[ee].existing.alt=he):Q==="file"&&b.value[ee]&&(b.value[ee].alt=he),u.value=null,c.value=""}function le(){u.value=null,c.value=""}function be(G,ee){u.value===G&&ge(G,ee)}async function re(G){const ee=L();if(!ee)throw console.error("uploadFunction not found"),new Error("Upload function not found");h.value=!0,m.value=G.length,v.value=0,p.value=0,g.value=Array(G.length).fill(null),y.value=Array(G.length).fill(null);const Q=G.map(async(he,Se)=>{try{const Fe=await ee(he);return y.value[Se]={success:!0,file:Fe},{success:!0,file:Fe}}catch(Fe){const xe=Fe;return g.value[Se]=xe,y.value[Se]={success:!1,error:xe},{success:!1,error:xe}}finally{v.value++,p.value=Math.round(v.value/m.value*100)}});return await Promise.all(Q)}return(G,ee)=>(Y(),ae(oi,null,[Ie(xN,{modelValue:i.value,"onUpdate:modelValue":ee[8]||(ee[8]=Q=>i.value=Q),options:{title:t.mode==="edit"?"Edit Images":"Upload Images",size:"3xl"},onClose:ee[9]||(ee[9]=Q=>G.$emit("close")),disableOutsideClickToClose:!0},{"body-content":_e(()=>[Z("div",pie,[Z("div",vie,[Ie(ui,{onClick:T},{prefix:_e(()=>[Ie(H(jD),{class:"size-4"})]),default:_e(()=>[ee[10]||(ee[10]=Di(" Add images ",-1))]),_:1,__:[10]}),Ie(SN,{id:"columns-select",options:we,modelValue:U.value,"onUpdate:modelValue":[ee[0]||(ee[0]=Q=>U.value=Q),ee[1]||(ee[1]=Q=>d.value=+Q)],size:"sm",variant:"subtle",class:"w-28"},null,8,["modelValue"])]),b.value&&b.value.length?(Y(),ae("div",{key:0,class:"grid gap-px mb-4",style:Sa(J.value)},[(Y(!0),ae(oi,null,cp(b.value,(Q,me)=>{var he,Se,Fe,xe;return Y(),ae("div",{key:Q.id,class:kt(["relative aspect-square w-full h-full overflow-hidden group bg-surface-white",{"ring-2 ring-primary-400 z-10":N(me)}]),draggable:!0,onDragstart:rt=>O(me),onDragover:rt=>P(rt,me),onDrop:ee[6]||(ee[6]=rt=>A(rt)),onDragend:j,onDragleave:rt=>F(rt,me)},[Z("button",{type:"button",class:"absolute top-1 right-1 z-10 bg-white/80 hover:bg-white rounded-full p-1 shadow transition-opacity opacity-0 group-hover:opacity-100 focus:opacity-100","aria-label":"Remove image",onClick:At(rt=>S(me),["stop"])},[Ie(H(C0),{class:"w-4 h-4 text-gray-700"})],8,gie),Q.type==="existing"?(Y(),ae(oi,{key:0},[Z("img",{src:(he=Q.existing)==null?void 0:he.src,alt:((Se=Q.existing)==null?void 0:Se.alt)||"",class:"object-cover w-full h-full rounded-[2px]"},null,8,yie),Z("div",{class:kt(["absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/60 to-transparent rounded-b-[2px] transition-opacity",u.value===`${Q.type}-${me}`?"opacity-100":"opacity-0 group-hover:opacity-100"])},[u.value!==`${Q.type}-${me}`?(Y(),ae("div",{key:0,class:"p-2 cursor-pointer",onClick:At(rt=>{var at;return Ye(`${Q.type}-${me}`,((at=Q.existing)==null?void 0:at.alt)||"")},["stop"])},[Z("div",{class:"text-white text-xs truncate",title:((Fe=Q.existing)==null?void 0:Fe.alt)||"Click to add caption"},qt(((xe=Q.existing)==null?void 0:xe.alt)||"Add caption..."),9,_ie)],8,bie)):(Y(),ae("div",{key:1,class:"p-2",onClick:ee[3]||(ee[3]=At(()=>{},["stop"]))},[og(Z("input",{ref_for:!0,ref:rt=>f.value=rt,"onUpdate:modelValue":ee[2]||(ee[2]=rt=>c.value=rt),onBlur:rt=>be(`${Q.type}-${me}`,me),onKeydown:[Ac(At(rt=>ge(`${Q.type}-${me}`,me),["prevent"]),["enter"]),Ac(le,["escape"])],class:"w-full text-xs bg-white/90 text-gray-900 px-1 py-0.5 rounded-sm border-none outline-none",placeholder:"Add caption...",maxlength:"200"},null,40,xie),[[Hx,c.value]])]))],2)],64)):Q.type==="file"&&Q.file?(Y(),ae(oi,{key:1},[R(Q.file)?Q.file.type.startsWith("image/")?(Y(),ae(oi,{key:1},[Z("img",{src:I(Q.file),class:"object-cover w-full h-full rounded-[2px]",alt:Q.alt||""},null,8,Tie),Z("div",{class:kt(["absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/60 to-transparent rounded-b-[2px] transition-opacity",u.value===`${Q.type}-${me}`?"opacity-100":"opacity-0 group-hover:opacity-100"])},[u.value!==`${Q.type}-${me}`?(Y(),ae("div",{key:0,class:"p-2 cursor-pointer",onClick:At(rt=>Ye(`${Q.type}-${me}`,Q.alt||""),["stop"])},[Z("div",{class:"text-white text-xs truncate",title:Q.alt||"Click to add caption"},qt(Q.alt||"Add caption..."),9,Aie)],8,Cie)):(Y(),ae("div",{key:1,class:"p-2",onClick:ee[5]||(ee[5]=At(()=>{},["stop"]))},[og(Z("input",{ref_for:!0,ref:"captionInput","onUpdate:modelValue":ee[4]||(ee[4]=rt=>c.value=rt),onBlur:rt=>be(`${Q.type}-${me}`,me),onKeydown:[Ac(At(rt=>ge(`${Q.type}-${me}`,me),["prevent"]),["enter"]),Ac(le,["escape"])],class:"w-full text-xs bg-white/90 text-gray-900 px-1 py-0.5 rounded border-none outline-none",placeholder:"Add caption...",maxlength:"200"},null,40,Mie),[[Hx,c.value]])]))],2)],64)):ct("",!0):(Y(),ae("div",wie,[Z("span",{class:"text-p-xs text-ink-gray-4 w-full text-center px-2 mt-1",title:Q.file.name},qt(Q.file.name),9,Sie)]))],64)):ct("",!0)],42,mie)}),128))],4)):ct("",!0),b.value&&b.value.length?(Y(),ae("div",kie," Upload more images by dropping them anywhere in this window. Reorder images by dragging them. Hover over an image to edit caption. ")):(Y(),ae("div",Die,[Z("div",{class:"w-full flex flex-1 flex-col items-center justify-center border border-outline-gray-2 rounded-lg bg-surface-gray-1 h-full cursor-pointer transition hover:border-primary-400 hover:bg-primary-50 text-center",onClick:T,onDragover:ee[7]||(ee[7]=At(()=>{},["prevent"])),onDrop:At(A,["prevent"])},[Z("div",Eie,[Ie(H(jD),{class:"size-6"})]),ee[11]||(ee[11]=Z("div",{class:"text-ink-gray-5 text-sm font-medium"}," Drag & drop images here or click to select ",-1))],32)])),h.value?(Y(),ae("div",Lie,[Z("div",Iie," Uploading: "+qt(v.value)+"/"+qt(m.value),1),Z("div",Pie,[Z("div",{class:"bg-surface-gray-5 h-2 transition-all",style:Sa({width:p.value+"%"})},null,4)]),g.value&&g.value.some(Q=>Q)?(Y(),ae("div",Rie," Some files failed to upload. ")):ct("",!0)])):ct("",!0)])]),actions:_e(()=>[Z("div",Oie,[Ie(ui,{variant:"ghost",disabled:h.value,onClick:w},{default:_e(()=>ee[12]||(ee[12]=[Di(" Cancel ",-1)])),_:1,__:[12]},8,["disabled"]),t.mode==="edit"?(Y(),$e(ui,{key:0,variant:"solid",loading:h.value,onClick:_},{default:_e(()=>ee[13]||(ee[13]=[Di(" Save ",-1)])),_:1,__:[13]},8,["loading"])):ct("",!0),t.mode==="new"?(Y(),$e(ui,{key:1,variant:"solid",loading:h.value,onClick:x},{default:_e(()=>ee[14]||(ee[14]=[Di(" Upload ",-1)])),_:1,__:[14]},8,["loading"])):ct("",!0)])]),_:1},8,["modelValue","options"]),(Y(),$e(VS,{to:"body"},[Ie(x3,{name:"fade","enter-active-class":"transition-opacity duration-200","leave-active-class":"transition-opacity duration-200","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:_e(()=>[a.value?(Y(),ae("div",jie,ee[15]||(ee[15]=[Z("div",{class:"text-ink-gray-1 text-base font-medium"}," Drop images anywhere ",-1)]))):ct("",!0)]),_:1})]))],64))}}),Bie={class:"w-full"},zie={key:0,class:"flex items-center mb-2 gap-2"},Fie=["onClick"],Vie=["src","alt","onClick"],$ie=["src","alt"],Hie={key:3,class:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/60 to-transparent rounded-b-[2px] opacity-0 group-hover:opacity-100 transition-opacity"},Gie={class:"p-2"},Wie=["title"],Uie=Ke({__name:"ImageGroupNodeView",props:{decorations:{},selected:{type:Boolean},updateAttributes:{type:Function},deleteNode:{type:Function},node:{},view:{},getPos:{type:Function},innerDecorations:{},editor:{},extension:{},HTMLAttributes:{}},setup(r){const e=r,t=de(()=>e.node.attrs.columns||4),n=de(()=>e.node.content.content||[]),i=de(()=>({gridTemplateColumns:`repeat(${t.value}, minmax(0, 1fr))`})),a=te(e.editor.isEditable),o=[{label:"2 columns",value:"2"},{label:"3 columns",value:"3"},{label:"4 columns",value:"4"}],s=de({get:()=>String(t.value),set:b=>e.updateAttributes({columns:+b})}),l=te(!1),u=te(0),c=de(()=>n.value.map(b=>({src:b.attrs.src,alt:b.attrs.alt||""}))),f=te(!1),h=te([]),d=de(()=>n.value.map(b=>({src:b.attrs.src,alt:b.attrs.alt||""})));zi(()=>{const b=()=>{a.value=e.editor.isEditable};e.editor.on("update",b),Ss(()=>{e.editor.off("update",b)})});function p(){h.value=[],f.value=!0}function v(){f.value=!1,h.value=[]}async function m(b){e.editor.commands.command(({tr:_,state:x})=>{const w=e.getPos();if(typeof w=="number"){const S=x.doc.nodeAt(w);if(S&&S.type.name==="imageGroup"){const T=b.images.map(M=>x.schema.nodes.image.create({src:M.src,alt:M.alt})),C={...S.attrs,columns:b.columns},A=S.type.create(C,T);return _.replaceWith(w,w+S.nodeSize,A),!0}}return!1}),f.value=!1}function g(b){e.editor.isEditable||(u.value=b,l.value=!0)}function y(b){const _=n.value.slice();_.splice(b,1),_.length===0?e.editor.commands.deleteNode("imageGroup"):(e.updateAttributes({}),e.editor.commands.command(({tr:x,state:w})=>{const S=e.getPos();if(typeof S=="number"){const T=w.doc.nodeAt(S);if(T&&T.type.name==="imageGroup"){const C=_.map(A=>w.schema.nodes.image.create(A.attrs));return x.replaceWith(S+1,S+1+T.content.size,C),!0}}return!1}))}return(b,_)=>(Y(),$e(H(i4),null,{default:_e(()=>[Z("div",Bie,[a.value?(Y(),ae("div",zie,[Ie(ui,{onClick:p},{prefix:_e(()=>[Ie(H(fie),{class:"size-4"})]),default:_e(()=>[_[3]||(_[3]=Di(" Edit ",-1))]),_:1,__:[3]}),Ie(SN,{options:o,modelValue:s.value,"onUpdate:modelValue":_[0]||(_[0]=x=>s.value=x),size:"sm",variant:"subtle",class:"w-28"},null,8,["modelValue"])])):ct("",!0),Z("div",{class:"grid gap-px",style:Sa(i.value)},[(Y(!0),ae(oi,null,cp(n.value,(x,w)=>(Y(),ae("div",{key:x.attrs.src+w,class:"relative aspect-square w-full h-full overflow-hidden bg-surface-white group"},[a.value?(Y(),ae("button",{key:0,type:"button",class:"absolute top-1 right-1 z-10 bg-white/80 hover:bg-white rounded-full p-1 shadow transition-opacity opacity-0 group-hover:opacity-100 focus:opacity-100","aria-label":"Remove image",onClick:At(S=>y(w),["stop"])},[Ie(H(C0),{class:"w-4 h-4 text-gray-700"})],8,Fie)):ct("",!0),a.value?(Y(),ae("img",{key:2,src:x.attrs.src,alt:x.attrs.alt||"",class:"object-cover w-full h-full not-prose rounded-[2px]"},null,8,$ie)):(Y(),ae("img",{key:1,src:x.attrs.src,alt:x.attrs.alt||"",class:"object-cover w-full h-full not-prose cursor-pointer rounded-[2px]",onClick:S=>g(w)},null,8,Vie)),x.attrs.alt?(Y(),ae("div",Hie,[Z("div",Gie,[Z("div",{class:"text-white text-xs truncate",title:x.attrs.alt},qt(x.attrs.alt),9,Wie)])])):ct("",!0)]))),128))],4),l.value?(Y(),$e(C4,{key:1,show:l.value,"onUpdate:show":_[1]||(_[1]=x=>l.value=x),images:c.value,initialIndex:u.value},null,8,["show","images","initialIndex"])):ct("",!0),f.value?(Y(),$e(Nie,{key:2,modelValue:f.value,"onUpdate:modelValue":_[2]||(_[2]=x=>f.value=x),files:h.value,editor:e.editor,mode:"edit",existingImages:d.value,initialColumns:t.value,onClose:v,onSave:m},null,8,["modelValue","files","editor","existingImages","initialColumns"])):ct("",!0),Je(b.$slots,"default")])]),_:3}))}});ar.create({name:"imageGroup",group:"block",content:"image+",selectable:!0,draggable:!0,isolating:!0,addOptions(){return{uploadFunction:null,HTMLAttributes:{}}},addAttributes(){return{columns:{default:4}}},parseHTML(){return[{tag:'div[data-type="image-group"]',getAttrs:r=>{if(typeof r=="string")return{};const e=r;return{columns:e.getAttribute("data-columns")?Number(e.getAttribute("data-columns")):4}}}]},renderHTML({HTMLAttributes:r,node:e}){return["div",Lt({"data-type":"image-group","data-columns":e.attrs.columns},this.options.HTMLAttributes,r),0]},addNodeView(){return IT(Uie)},addCommands(){return{setImageGroup:r=>({commands:e})=>e.insertContent({type:this.name,attrs:{columns:r.columns||4},content:r.images.map(t=>({type:"image",attrs:t}))})}}});const Yie={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function qie(r,e){return Y(),ae("svg",Yie,e[0]||(e[0]=[Z("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[Z("circle",{cx:"12",cy:"12",r:"10"}),Z("path",{d:"M12 16v-4m0-4h.01"})],-1)]))}vt({name:"lucide-info",render:qie});const Xie={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Kie(r,e){return Y(),ae("svg",Xie,e[0]||(e[0]=[Z("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m21.73 18l-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3M12 9v4m0 4h.01"},null,-1)]))}vt({name:"lucide-alert-triangle",render:Kie});/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:fB,setPrototypeOf:ND,isFrozen:Zie,getPrototypeOf:Jie,getOwnPropertyDescriptor:Qie}=Object;let{freeze:dn,seal:vi,create:hB}=Object,{apply:Fw,construct:Vw}=typeof Reflect<"u"&&Reflect;dn||(dn=function(e){return e});vi||(vi=function(e){return e});Fw||(Fw=function(e,t,n){return e.apply(t,n)});Vw||(Vw=function(e,t){return new e(...t)});const cv=pn(Array.prototype.forEach),eae=pn(Array.prototype.lastIndexOf),BD=pn(Array.prototype.pop),Ff=pn(Array.prototype.push),tae=pn(Array.prototype.splice),Im=pn(String.prototype.toLowerCase),ab=pn(String.prototype.toString),zD=pn(String.prototype.match),Vf=pn(String.prototype.replace),rae=pn(String.prototype.indexOf),nae=pn(String.prototype.trim),Si=pn(Object.prototype.hasOwnProperty),rn=pn(RegExp.prototype.test),$f=iae(TypeError);function pn(r){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i2&&arguments[2]!==void 0?arguments[2]:Im;ND&&ND(r,null);let n=e.length;for(;n--;){let i=e[n];if(typeof i=="string"){const a=t(i);a!==i&&(Zie(e)||(e[n]=a),i=a)}r[i]=!0}return r}function aae(r){for(let e=0;e/gm),cae=vi(/\$\{[\w\W]*/gm),fae=vi(/^data-[\-\w.\u00B7-\uFFFF]+$/),hae=vi(/^aria-[\-\w]+$/),dB=vi(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),dae=vi(/^(?:\w+script|data):/i),pae=vi(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),pB=vi(/^html$/i),vae=vi(/^[a-z][.\w]*(-[.\w]+)+$/i);var GD=Object.freeze({__proto__:null,ARIA_ATTR:hae,ATTR_WHITESPACE:pae,CUSTOM_ELEMENT:vae,DATA_ATTR:fae,DOCTYPE_NAME:pB,ERB_EXPR:uae,IS_ALLOWED_URI:dB,IS_SCRIPT_OR_DATA:dae,MUSTACHE_EXPR:lae,TMPLIT_EXPR:cae});const Gf={element:1,text:3,progressingInstruction:7,comment:8,document:9},mae=function(){return typeof window>"u"?null:window},gae=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(n=t.getAttribute(i));const a="dompurify"+(n?"#"+n:"");try{return e.createPolicy(a,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},WD=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function vB(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:mae();const e=je=>vB(je);if(e.version="3.2.6",e.removed=[],!r||!r.document||r.document.nodeType!==Gf.document||!r.Element)return e.isSupported=!1,e;let{document:t}=r;const n=t,i=n.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:s,Element:l,NodeFilter:u,NamedNodeMap:c=r.NamedNodeMap||r.MozNamedAttrMap,HTMLFormElement:f,DOMParser:h,trustedTypes:d}=r,p=l.prototype,v=Hf(p,"cloneNode"),m=Hf(p,"remove"),g=Hf(p,"nextSibling"),y=Hf(p,"childNodes"),b=Hf(p,"parentNode");if(typeof o=="function"){const je=t.createElement("template");je.content&&je.content.ownerDocument&&(t=je.content.ownerDocument)}let _,x="";const{implementation:w,createNodeIterator:S,createDocumentFragment:T,getElementsByTagName:C}=t,{importNode:A}=n;let M=WD();e.isSupported=typeof fB=="function"&&typeof b=="function"&&w&&w.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:D,ERB_EXPR:E,TMPLIT_EXPR:L,DATA_ATTR:I,ARIA_ATTR:R,IS_SCRIPT_OR_DATA:P,ATTR_WHITESPACE:O,CUSTOM_ELEMENT:j}=GD;let{IS_ALLOWED_URI:F}=GD,N=null;const B=ft({},[...FD,...ob,...sb,...lb,...VD]);let $=null;const J=ft({},[...$D,...ub,...HD,...fv]);let U=Object.seal(hB(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),we=null,Ye=null,ge=!0,le=!0,be=!1,re=!0,G=!1,ee=!0,Q=!1,me=!1,he=!1,Se=!1,Fe=!1,xe=!1,rt=!0,at=!1;const ht="user-content-";let fr=!0,yr=!1,en={},tn=null;const pe=ft({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let De=null;const tt=ft({},["audio","video","img","source","image","track"]);let mt=null;const or=ft({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),$r="http://www.w3.org/1998/Math/MathML",Io="http://www.w3.org/2000/svg",X="http://www.w3.org/1999/xhtml";let Ae=X,Ge=!1,xt=null;const gt=ft({},[$r,Io,X],ab);let hr=ft({},["mi","mo","mn","ms","mtext"]),Ir=ft({},["annotation-xml"]);const Po=ft({},["title","style","font","a","script"]);let Ro=null;const Va=["application/xhtml+xml","text/html"],If="text/html";let Yt=null,En=null;const x1=t.createElement("form"),zu=function(V){return V instanceof RegExp||V instanceof Function},Oo=function(){let V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(En&&En===V)){if((!V||typeof V!="object")&&(V={}),V=Ja(V),Ro=Va.indexOf(V.PARSER_MEDIA_TYPE)===-1?If:V.PARSER_MEDIA_TYPE,Yt=Ro==="application/xhtml+xml"?ab:Im,N=Si(V,"ALLOWED_TAGS")?ft({},V.ALLOWED_TAGS,Yt):B,$=Si(V,"ALLOWED_ATTR")?ft({},V.ALLOWED_ATTR,Yt):J,xt=Si(V,"ALLOWED_NAMESPACES")?ft({},V.ALLOWED_NAMESPACES,ab):gt,mt=Si(V,"ADD_URI_SAFE_ATTR")?ft(Ja(or),V.ADD_URI_SAFE_ATTR,Yt):or,De=Si(V,"ADD_DATA_URI_TAGS")?ft(Ja(tt),V.ADD_DATA_URI_TAGS,Yt):tt,tn=Si(V,"FORBID_CONTENTS")?ft({},V.FORBID_CONTENTS,Yt):pe,we=Si(V,"FORBID_TAGS")?ft({},V.FORBID_TAGS,Yt):Ja({}),Ye=Si(V,"FORBID_ATTR")?ft({},V.FORBID_ATTR,Yt):Ja({}),en=Si(V,"USE_PROFILES")?V.USE_PROFILES:!1,ge=V.ALLOW_ARIA_ATTR!==!1,le=V.ALLOW_DATA_ATTR!==!1,be=V.ALLOW_UNKNOWN_PROTOCOLS||!1,re=V.ALLOW_SELF_CLOSE_IN_ATTR!==!1,G=V.SAFE_FOR_TEMPLATES||!1,ee=V.SAFE_FOR_XML!==!1,Q=V.WHOLE_DOCUMENT||!1,Se=V.RETURN_DOM||!1,Fe=V.RETURN_DOM_FRAGMENT||!1,xe=V.RETURN_TRUSTED_TYPE||!1,he=V.FORCE_BODY||!1,rt=V.SANITIZE_DOM!==!1,at=V.SANITIZE_NAMED_PROPS||!1,fr=V.KEEP_CONTENT!==!1,yr=V.IN_PLACE||!1,F=V.ALLOWED_URI_REGEXP||dB,Ae=V.NAMESPACE||X,hr=V.MATHML_TEXT_INTEGRATION_POINTS||hr,Ir=V.HTML_INTEGRATION_POINTS||Ir,U=V.CUSTOM_ELEMENT_HANDLING||{},V.CUSTOM_ELEMENT_HANDLING&&zu(V.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(U.tagNameCheck=V.CUSTOM_ELEMENT_HANDLING.tagNameCheck),V.CUSTOM_ELEMENT_HANDLING&&zu(V.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(U.attributeNameCheck=V.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),V.CUSTOM_ELEMENT_HANDLING&&typeof V.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(U.allowCustomizedBuiltInElements=V.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),G&&(le=!1),Fe&&(Se=!0),en&&(N=ft({},VD),$=[],en.html===!0&&(ft(N,FD),ft($,$D)),en.svg===!0&&(ft(N,ob),ft($,ub),ft($,fv)),en.svgFilters===!0&&(ft(N,sb),ft($,ub),ft($,fv)),en.mathMl===!0&&(ft(N,lb),ft($,HD),ft($,fv))),V.ADD_TAGS&&(N===B&&(N=Ja(N)),ft(N,V.ADD_TAGS,Yt)),V.ADD_ATTR&&($===J&&($=Ja($)),ft($,V.ADD_ATTR,Yt)),V.ADD_URI_SAFE_ATTR&&ft(mt,V.ADD_URI_SAFE_ATTR,Yt),V.FORBID_CONTENTS&&(tn===pe&&(tn=Ja(tn)),ft(tn,V.FORBID_CONTENTS,Yt)),fr&&(N["#text"]=!0),Q&&ft(N,["html","head","body"]),N.table&&(ft(N,["tbody"]),delete we.tbody),V.TRUSTED_TYPES_POLICY){if(typeof V.TRUSTED_TYPES_POLICY.createHTML!="function")throw $f('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof V.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw $f('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');_=V.TRUSTED_TYPES_POLICY,x=_.createHTML("")}else _===void 0&&(_=gae(d,i)),_!==null&&typeof x=="string"&&(x=_.createHTML(""));dn&&dn(V),En=V}},mM=ft({},[...ob,...sb,...oae]),gM=ft({},[...lb,...sae]),pH=function(V){let ce=b(V);(!ce||!ce.tagName)&&(ce={namespaceURI:Ae,tagName:"template"});const Pe=Im(V.tagName),Ht=Im(ce.tagName);return xt[V.namespaceURI]?V.namespaceURI===Io?ce.namespaceURI===X?Pe==="svg":ce.namespaceURI===$r?Pe==="svg"&&(Ht==="annotation-xml"||hr[Ht]):!!mM[Pe]:V.namespaceURI===$r?ce.namespaceURI===X?Pe==="math":ce.namespaceURI===Io?Pe==="math"&&Ir[Ht]:!!gM[Pe]:V.namespaceURI===X?ce.namespaceURI===Io&&!Ir[Ht]||ce.namespaceURI===$r&&!hr[Ht]?!1:!gM[Pe]&&(Po[Pe]||!mM[Pe]):!!(Ro==="application/xhtml+xml"&&xt[V.namespaceURI]):!1},Wi=function(V){Ff(e.removed,{element:V});try{b(V).removeChild(V)}catch{m(V)}},Fu=function(V,ce){try{Ff(e.removed,{attribute:ce.getAttributeNode(V),from:ce})}catch{Ff(e.removed,{attribute:null,from:ce})}if(ce.removeAttribute(V),V==="is")if(Se||Fe)try{Wi(ce)}catch{}else try{ce.setAttribute(V,"")}catch{}},yM=function(V){let ce=null,Pe=null;if(he)V=""+V;else{const br=zD(V,/^[\r\n\t ]+/);Pe=br&&br[0]}Ro==="application/xhtml+xml"&&Ae===X&&(V=''+V+"");const Ht=_?_.createHTML(V):V;if(Ae===X)try{ce=new h().parseFromString(Ht,Ro)}catch{}if(!ce||!ce.documentElement){ce=w.createDocument(Ae,"template",null);try{ce.documentElement.innerHTML=Ge?x:Ht}catch{}}const Hr=ce.body||ce.documentElement;return V&&Pe&&Hr.insertBefore(t.createTextNode(Pe),Hr.childNodes[0]||null),Ae===X?C.call(ce,Q?"html":"body")[0]:Q?ce.documentElement:Hr},bM=function(V){return S.call(V.ownerDocument||V,V,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},w1=function(V){return V instanceof f&&(typeof V.nodeName!="string"||typeof V.textContent!="string"||typeof V.removeChild!="function"||!(V.attributes instanceof c)||typeof V.removeAttribute!="function"||typeof V.setAttribute!="function"||typeof V.namespaceURI!="string"||typeof V.insertBefore!="function"||typeof V.hasChildNodes!="function")},_M=function(V){return typeof s=="function"&&V instanceof s};function $a(je,V,ce){cv(je,Pe=>{Pe.call(e,V,ce,En)})}const xM=function(V){let ce=null;if($a(M.beforeSanitizeElements,V,null),w1(V))return Wi(V),!0;const Pe=Yt(V.nodeName);if($a(M.uponSanitizeElement,V,{tagName:Pe,allowedTags:N}),ee&&V.hasChildNodes()&&!_M(V.firstElementChild)&&rn(/<[/\w!]/g,V.innerHTML)&&rn(/<[/\w!]/g,V.textContent)||V.nodeType===Gf.progressingInstruction||ee&&V.nodeType===Gf.comment&&rn(/<[/\w]/g,V.data))return Wi(V),!0;if(!N[Pe]||we[Pe]){if(!we[Pe]&&SM(Pe)&&(U.tagNameCheck instanceof RegExp&&rn(U.tagNameCheck,Pe)||U.tagNameCheck instanceof Function&&U.tagNameCheck(Pe)))return!1;if(fr&&!tn[Pe]){const Ht=b(V)||V.parentNode,Hr=y(V)||V.childNodes;if(Hr&&Ht){const br=Hr.length;for(let _n=br-1;_n>=0;--_n){const Ha=v(Hr[_n],!0);Ha.__removalCount=(V.__removalCount||0)+1,Ht.insertBefore(Ha,g(V))}}}return Wi(V),!0}return V instanceof l&&!pH(V)||(Pe==="noscript"||Pe==="noembed"||Pe==="noframes")&&rn(/<\/no(script|embed|frames)/i,V.innerHTML)?(Wi(V),!0):(G&&V.nodeType===Gf.text&&(ce=V.textContent,cv([D,E,L],Ht=>{ce=Vf(ce,Ht," ")}),V.textContent!==ce&&(Ff(e.removed,{element:V.cloneNode()}),V.textContent=ce)),$a(M.afterSanitizeElements,V,null),!1)},wM=function(V,ce,Pe){if(rt&&(ce==="id"||ce==="name")&&(Pe in t||Pe in x1))return!1;if(!(le&&!Ye[ce]&&rn(I,ce))){if(!(ge&&rn(R,ce))){if(!$[ce]||Ye[ce]){if(!(SM(V)&&(U.tagNameCheck instanceof RegExp&&rn(U.tagNameCheck,V)||U.tagNameCheck instanceof Function&&U.tagNameCheck(V))&&(U.attributeNameCheck instanceof RegExp&&rn(U.attributeNameCheck,ce)||U.attributeNameCheck instanceof Function&&U.attributeNameCheck(ce))||ce==="is"&&U.allowCustomizedBuiltInElements&&(U.tagNameCheck instanceof RegExp&&rn(U.tagNameCheck,Pe)||U.tagNameCheck instanceof Function&&U.tagNameCheck(Pe))))return!1}else if(!mt[ce]){if(!rn(F,Vf(Pe,O,""))){if(!((ce==="src"||ce==="xlink:href"||ce==="href")&&V!=="script"&&rae(Pe,"data:")===0&&De[V])){if(!(be&&!rn(P,Vf(Pe,O,"")))){if(Pe)return!1}}}}}}return!0},SM=function(V){return V!=="annotation-xml"&&zD(V,j)},TM=function(V){$a(M.beforeSanitizeAttributes,V,null);const{attributes:ce}=V;if(!ce||w1(V))return;const Pe={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:$,forceKeepAttr:void 0};let Ht=ce.length;for(;Ht--;){const Hr=ce[Ht],{name:br,namespaceURI:_n,value:Ha}=Hr,Pf=Yt(br),S1=Ha;let Gr=br==="value"?S1:nae(S1);if(Pe.attrName=Pf,Pe.attrValue=Gr,Pe.keepAttr=!0,Pe.forceKeepAttr=void 0,$a(M.uponSanitizeAttribute,V,Pe),Gr=Pe.attrValue,at&&(Pf==="id"||Pf==="name")&&(Fu(br,V),Gr=ht+Gr),ee&&rn(/((--!?|])>)|<\/(style|title)/i,Gr)){Fu(br,V);continue}if(Pe.forceKeepAttr)continue;if(!Pe.keepAttr){Fu(br,V);continue}if(!re&&rn(/\/>/i,Gr)){Fu(br,V);continue}G&&cv([D,E,L],AM=>{Gr=Vf(Gr,AM," ")});const CM=Yt(V.nodeName);if(!wM(CM,Pf,Gr)){Fu(br,V);continue}if(_&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!_n)switch(d.getAttributeType(CM,Pf)){case"TrustedHTML":{Gr=_.createHTML(Gr);break}case"TrustedScriptURL":{Gr=_.createScriptURL(Gr);break}}if(Gr!==S1)try{_n?V.setAttributeNS(_n,br,Gr):V.setAttribute(br,Gr),w1(V)?Wi(V):BD(e.removed)}catch{Fu(br,V)}}$a(M.afterSanitizeAttributes,V,null)},vH=function je(V){let ce=null;const Pe=bM(V);for($a(M.beforeSanitizeShadowDOM,V,null);ce=Pe.nextNode();)$a(M.uponSanitizeShadowNode,ce,null),xM(ce),TM(ce),ce.content instanceof a&&je(ce.content);$a(M.afterSanitizeShadowDOM,V,null)};return e.sanitize=function(je){let V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ce=null,Pe=null,Ht=null,Hr=null;if(Ge=!je,Ge&&(je=""),typeof je!="string"&&!_M(je))if(typeof je.toString=="function"){if(je=je.toString(),typeof je!="string")throw $f("dirty is not a string, aborting")}else throw $f("toString is not a function");if(!e.isSupported)return je;if(me||Oo(V),e.removed=[],typeof je=="string"&&(yr=!1),yr){if(je.nodeName){const Ha=Yt(je.nodeName);if(!N[Ha]||we[Ha])throw $f("root node is forbidden and cannot be sanitized in-place")}}else if(je instanceof s)ce=yM(""),Pe=ce.ownerDocument.importNode(je,!0),Pe.nodeType===Gf.element&&Pe.nodeName==="BODY"||Pe.nodeName==="HTML"?ce=Pe:ce.appendChild(Pe);else{if(!Se&&!G&&!Q&&je.indexOf("<")===-1)return _&&xe?_.createHTML(je):je;if(ce=yM(je),!ce)return Se?null:xe?x:""}ce&&he&&Wi(ce.firstChild);const br=bM(yr?je:ce);for(;Ht=br.nextNode();)xM(Ht),TM(Ht),Ht.content instanceof a&&vH(Ht.content);if(yr)return je;if(Se){if(Fe)for(Hr=T.call(ce.ownerDocument);ce.firstChild;)Hr.appendChild(ce.firstChild);else Hr=ce;return($.shadowroot||$.shadowrootmode)&&(Hr=A.call(n,Hr,!0)),Hr}let _n=Q?ce.outerHTML:ce.innerHTML;return Q&&N["!doctype"]&&ce.ownerDocument&&ce.ownerDocument.doctype&&ce.ownerDocument.doctype.name&&rn(pB,ce.ownerDocument.doctype.name)&&(_n=" `+_n),G&&cv([D,E,L],Ha=>{_n=Vf(_n,Ha," ")}),_&&xe?_.createHTML(_n):_n},e.setConfig=function(){let je=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Oo(je),me=!0},e.clearConfig=function(){En=null,me=!1},e.isValidAttribute=function(je,V,ce){En||Oo({});const Pe=Yt(je),Ht=Yt(V);return wM(Pe,Ht,ce)},e.addHook=function(je,V){typeof V=="function"&&Ff(M[je],V)},e.removeHook=function(je,V){if(V!==void 0){const ce=eae(M[je],V);return ce===-1?void 0:tae(M[je],ce,1)[0]}return BD(M[je])},e.removeHooks=function(je){M[je]=[]},e.removeAllHooks=function(){M=WD()},e}vB();te([]);const yae={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function bae(r,e){return Y(),ae("svg",yae,e[0]||(e[0]=[Z("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[Z("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),Z("path",{d:"M15 3v18m-5-6l-3-3l3-3"})],-1)]))}vt({name:"lucide-panel-right-open",render:bae});const _ae=typeof window<"u";var UD;_ae&&((UD=window==null?void 0:window.navigator)!=null&&UD.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);const xae=Object.freeze({aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"});Object.freeze(new Set(Object.keys(xae)));const ku=typeof window<"u";var YD;ku&&(YD=window==null?void 0:window.navigator)!=null&&YD.userAgent&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function qD(r){return r!=null}const wae=Object.freeze({aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"});Object.freeze(new Set(Object.keys(wae)));const Sae=ku&&("ontouchstart"in window||Cae()>0),Tae=Sae?"pointerdown":"click";function Cae(){return typeof navigator<"u"&&(navigator.maxTouchPoints||navigator.msMaxTouchPoints)||0}function Aae(r,e,t=window.Event){const{type:n,bubbles:i=!1,cancelable:a=!1,...o}=e;if(!qD(n)||n==="")return!1;let s;return qD(t)?s=new t(n,{bubbles:i,cancelable:a}):(s=document.createEvent("HTMLEvents"),s.initEvent(n,i,a)),Object.assign(s,o),r.dispatchEvent(s)}const Mae="clickoutside",kae=new Set;ku&&document.addEventListener(Tae,r=>{const e=r.target,t=r.composedPath&&r.composedPath();kae.forEach(n=>{n!==e&&(t?!t.includes(n):!n.contains(e))&&(!n.__transferElement||n.__transferElement!==e&&!n.__transferElement.contains(e))&&Aae(n,{type:Mae})})},!0);const Dae=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]];let Pm;if(ku){for(const r of Dae)if(r[1]in document){Pm=r;break}}de(()=>!1);const Eae=new Set,Lae=new WeakMap;if(ku&&Pm){const r=Pm[2],e=Pm[4];document.addEventListener(e,()=>{if(Eae.forEach(t=>{t.value=!1}),document[r]){const t=Lae.get(document[r]);t&&(t.value=!0)}},!1)}const mB=new Map;mB.set("x",0);mB.set("y",0);var Kl=[],Iae=function(){return Kl.some(function(r){return r.activeTargets.length>0})},Pae=function(){return Kl.some(function(r){return r.skippedTargets.length>0})},XD="ResizeObserver loop completed with undelivered notifications.",Rae=function(){var r;typeof ErrorEvent=="function"?r=new ErrorEvent("error",{message:XD}):(r=document.createEvent("Event"),r.initEvent("error",!1,!1),r.message=XD),window.dispatchEvent(r)},Rd;(function(r){r.BORDER_BOX="border-box",r.CONTENT_BOX="content-box",r.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(Rd||(Rd={}));var Zl=function(r){return Object.freeze(r)},Oae=function(){function r(e,t){this.inlineSize=e,this.blockSize=t,Zl(this)}return r}(),gB=function(){function r(e,t,n,i){return this.x=e,this.y=t,this.width=n,this.height=i,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Zl(this)}return r.prototype.toJSON=function(){var e=this,t=e.x,n=e.y,i=e.top,a=e.right,o=e.bottom,s=e.left,l=e.width,u=e.height;return{x:t,y:n,top:i,right:a,bottom:o,left:s,width:l,height:u}},r.fromRect=function(e){return new r(e.x,e.y,e.width,e.height)},r}(),nC=function(r){return r instanceof SVGElement&&"getBBox"in r},yB=function(r){if(nC(r)){var e=r.getBBox(),t=e.width,n=e.height;return!t&&!n}var i=r,a=i.offsetWidth,o=i.offsetHeight;return!(a||o||r.getClientRects().length)},KD=function(r){var e;if(r instanceof Element)return!0;var t=(e=r==null?void 0:r.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(t&&r instanceof t.Element)},jae=function(r){switch(r.tagName){case"INPUT":if(r.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},td=typeof window<"u"?window:{},hv=new WeakMap,ZD=/auto|scroll/,Nae=/^tb|vertical/,Bae=/msie|trident/i.test(td.navigator&&td.navigator.userAgent),Ui=function(r){return parseFloat(r||"0")},Oc=function(r,e,t){return r===void 0&&(r=0),e===void 0&&(e=0),t===void 0&&(t=!1),new Oae((t?e:r)||0,(t?r:e)||0)},JD=Zl({devicePixelContentBoxSize:Oc(),borderBoxSize:Oc(),contentBoxSize:Oc(),contentRect:new gB(0,0,0,0)}),bB=function(r,e){if(e===void 0&&(e=!1),hv.has(r)&&!e)return hv.get(r);if(yB(r))return hv.set(r,JD),JD;var t=getComputedStyle(r),n=nC(r)&&r.ownerSVGElement&&r.getBBox(),i=!Bae&&t.boxSizing==="border-box",a=Nae.test(t.writingMode||""),o=!n&&ZD.test(t.overflowY||""),s=!n&&ZD.test(t.overflowX||""),l=n?0:Ui(t.paddingTop),u=n?0:Ui(t.paddingRight),c=n?0:Ui(t.paddingBottom),f=n?0:Ui(t.paddingLeft),h=n?0:Ui(t.borderTopWidth),d=n?0:Ui(t.borderRightWidth),p=n?0:Ui(t.borderBottomWidth),v=n?0:Ui(t.borderLeftWidth),m=f+u,g=l+c,y=v+d,b=h+p,_=s?r.offsetHeight-b-r.clientHeight:0,x=o?r.offsetWidth-y-r.clientWidth:0,w=i?m+y:0,S=i?g+b:0,T=n?n.width:Ui(t.width)-w-x,C=n?n.height:Ui(t.height)-S-_,A=T+m+x+y,M=C+g+_+b,D=Zl({devicePixelContentBoxSize:Oc(Math.round(T*devicePixelRatio),Math.round(C*devicePixelRatio),a),borderBoxSize:Oc(A,M,a),contentBoxSize:Oc(T,C,a),contentRect:new gB(f,l,T,C)});return hv.set(r,D),D},_B=function(r,e,t){var n=bB(r,t),i=n.borderBoxSize,a=n.contentBoxSize,o=n.devicePixelContentBoxSize;switch(e){case Rd.DEVICE_PIXEL_CONTENT_BOX:return o;case Rd.BORDER_BOX:return i;default:return a}},zae=function(){function r(e){var t=bB(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=Zl([t.borderBoxSize]),this.contentBoxSize=Zl([t.contentBoxSize]),this.devicePixelContentBoxSize=Zl([t.devicePixelContentBoxSize])}return r}(),xB=function(r){if(yB(r))return 1/0;for(var e=0,t=r.parentNode;t;)e+=1,t=t.parentNode;return e},Fae=function(){var r=1/0,e=[];Kl.forEach(function(a){if(a.activeTargets.length!==0){var o=[];a.activeTargets.forEach(function(s){var l=new zae(s.target),u=xB(s.target);o.push(l),s.lastReportedSize=_B(s.target,s.observedBox),ur?e.activeTargets.push(t):e.skippedTargets.push(t))})})},Vae=function(){var r=0;for(QD(r);Iae();)r=Fae(),QD(r);return Pae()&&Rae(),r>0},cb,wB=[],$ae=function(){return wB.splice(0).forEach(function(r){return r()})},Hae=function(r){if(!cb){var e=0,t=document.createTextNode(""),n={characterData:!0};new MutationObserver(function(){return $ae()}).observe(t,n),cb=function(){t.textContent="".concat(e?e--:e++)}}wB.push(r),cb()},Gae=function(r){Hae(function(){requestAnimationFrame(r)})},Rm=0,Wae=function(){return!!Rm},Uae=250,Yae={attributes:!0,characterData:!0,childList:!0,subtree:!0},eE=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],tE=function(r){return r===void 0&&(r=0),Date.now()+r},fb=!1,qae=function(){function r(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return r.prototype.run=function(e){var t=this;if(e===void 0&&(e=Uae),!fb){fb=!0;var n=tE(e);Gae(function(){var i=!1;try{i=Vae()}finally{if(fb=!1,e=n-tE(),!Wae())return;i?t.run(1e3):e>0?t.run(e):t.start()}})}},r.prototype.schedule=function(){this.stop(),this.run()},r.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,Yae)};document.body?t():td.addEventListener("DOMContentLoaded",t)},r.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),eE.forEach(function(t){return td.addEventListener(t,e.listener,!0)}))},r.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),eE.forEach(function(t){return td.removeEventListener(t,e.listener,!0)}),this.stopped=!0)},r}(),$w=new qae,rE=function(r){!Rm&&r>0&&$w.start(),Rm+=r,!Rm&&$w.stop()},Xae=function(r){return!nC(r)&&!jae(r)&&getComputedStyle(r).display==="inline"},Kae=function(){function r(e,t){this.target=e,this.observedBox=t||Rd.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return r.prototype.isActive=function(){var e=_B(this.target,this.observedBox,!0);return Xae(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},r}(),Zae=function(){function r(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t}return r}(),dv=new WeakMap,nE=function(r,e){for(var t=0;t=0&&(a&&Kl.splice(Kl.indexOf(n),1),n.observationTargets.splice(i,1),rE(-1))},r.disconnect=function(e){var t=this,n=dv.get(e);n.observationTargets.slice().forEach(function(i){return t.unobserve(e,i.target)}),n.activeTargets.splice(0,n.activeTargets.length)},r}(),Jae=function(){function r(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");pv.connect(this,e)}return r.prototype.observe=function(e,t){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!KD(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");pv.observe(this,e,t)},r.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!KD(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");pv.unobserve(this,e)},r.prototype.disconnect=function(){pv.disconnect(this)},r.toString=function(){return"function ResizeObserver () { [polyfill code] }"},r}();const Qae=new WeakMap;function eoe(r){var e;for(let t=0,n=r.length;ttoe.value);const iE="__theme_style__",hb="__theme_observer__",aE=wu(new Map),oE=new Map;Nt(aE,()=>{if(!ku)return;oE.clear();const r=document.head.querySelector(`#${iE}`);r&&document.head.removeChild(r);const e=document.createElement("style");let t=`.${hb} { width: 1px }`,n=1;for(const[i,[a,o]]of aE.entries())t+=` html.${a} .${hb}, .${o} .${hb} { width: ${++n}px }`,oE.set(n,i);e.textContent=t,e.id=iE,document.head.appendChild(e)});(function(){try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode('.vgl-layout{--vgl-placeholder-bg: red;--vgl-placeholder-opacity: 20%;--vgl-placeholder-z-index: 2;--vgl-item-resizing-z-index: 3;--vgl-item-resizing-opacity: 60%;--vgl-item-dragging-z-index: 3;--vgl-item-dragging-opacity: 100%;--vgl-resizer-size: 10px;--vgl-resizer-border-color: #444;--vgl-resizer-border-width: 2px;position:relative;box-sizing:border-box;transition:height .2s ease}.vgl-item{position:absolute;box-sizing:border-box;transition:.2s ease;transition-property:left,top,right}.vgl-item--placeholder{z-index:var(--vgl-placeholder-z-index, 2);-webkit-user-select:none;-moz-user-select:none;user-select:none;background-color:var(--vgl-placeholder-bg, red);opacity:var(--vgl-placeholder-opacity, 20%);transition-duration:.1s}.vgl-item--no-touch{touch-action:none}.vgl-item--transform{right:auto;left:0;transition-property:transform}.vgl-item--transform.vgl-item--rtl{right:0;left:auto}.vgl-item--resizing{z-index:var(--vgl-item-resizing-z-index, 3);-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--vgl-item-resizing-opacity, 60%)}.vgl-item--dragging{z-index:var(--vgl-item-dragging-z-index, 3);-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--vgl-item-dragging-opacity, 100%);transition:none}.vgl-item__resizer{position:absolute;right:0;bottom:0;box-sizing:border-box;width:var(--vgl-resizer-size);height:var(--vgl-resizer-size);cursor:se-resize}.vgl-item__resizer:before{position:absolute;top:0;right:3px;bottom:3px;left:0;content:"";border:0 solid var(--vgl-resizer-border-color);border-right-width:var(--vgl-resizer-border-width);border-bottom-width:var(--vgl-resizer-border-width)}.vgl-item__resizer--rtl{right:auto;left:0;cursor:sw-resize}.vgl-item__resizer--rtl:before{top:0;right:0;bottom:3px;left:3px;border-right-width:0;border-bottom-width:var(--vgl-resizer-border-width);border-left-width:var(--vgl-resizer-border-width)}')),document.head.appendChild(r)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var Hw=function(r,e){return Hw=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},Hw(r,e)};function z(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Hw(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var roe=function(){function r(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return r}(),noe=function(){function r(){this.browser=new roe,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow=typeof window<"u"}return r}(),Ze=new noe;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(Ze.wxa=!0,Ze.touchEventsSupported=!0):typeof document>"u"&&typeof self<"u"?Ze.worker=!0:!Ze.hasGlobalWindow||"Deno"in window?(Ze.node=!0,Ze.svgSupported=!0):ioe(navigator.userAgent,Ze);function ioe(r,e){var t=e.browser,n=r.match(/Firefox\/([\d.]+)/),i=r.match(/MSIE\s([\d.]+)/)||r.match(/Trident\/.+?rv:(([\d.]+))/),a=r.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(r);n&&(t.firefox=!0,t.version=n[1]),i&&(t.ie=!0,t.version=i[1]),a&&(t.edge=!0,t.version=a[1],t.newEdge=+a[1].split(".")[0]>18),o&&(t.weChat=!0),e.svgSupported=typeof SVGRect<"u",e.touchEventsSupported="ontouchstart"in window&&!t.ie&&!t.edge,e.pointerEventsSupported="onpointerdown"in window&&(t.edge||t.ie&&+t.version>=11),e.domSupported=typeof document<"u";var s=document.documentElement.style;e.transform3dSupported=(t.ie&&"transition"in s||t.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||t.ie&&+t.version>=9}var iC=12,SB="sans-serif",Ms=iC+"px "+SB,aoe=20,ooe=100,soe="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function loe(r){var e={};if(typeof JSON>"u")return e;for(var t=0;t=0)s=o*t.length;else for(var l=0;l>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",n[l]+":0",i[u]+":0",n[1-l]+":auto",i[1-u]+":auto",""].join("!important;"),r.appendChild(o),t.push(o)}return t}function Doe(r,e,t){for(var n=t?"invTrans":"trans",i=e[n],a=e.srcCoords,o=[],s=[],l=!0,u=0;u<4;u++){var c=r[u].getBoundingClientRect(),f=2*u,h=c.left,d=c.top;o.push(h,d),l=l&&a&&h===a[f]&&d===a[f+1],s.push(r[u].offsetLeft,r[u].offsetTop)}return l&&i?i:(e.srcCoords=o,e[n]=t?cE(s,o):cE(o,s))}function EB(r){return r.nodeName.toUpperCase()==="CANVAS"}var Eoe=/([&<>"'])/g,Loe={"&":"&","<":"<",">":">",'"':""","'":"'"};function un(r){return r==null?"":(r+"").replace(Eoe,function(e,t){return Loe[t]})}var Ioe=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,pb=[],Poe=Ze.browser.firefox&&+Ze.browser.version.split(".")[0]<39;function Kw(r,e,t,n){return t=t||{},n?hE(r,e,t):Poe&&e.layerX!=null&&e.layerX!==e.offsetX?(t.zrX=e.layerX,t.zrY=e.layerY):e.offsetX!=null?(t.zrX=e.offsetX,t.zrY=e.offsetY):hE(r,e,t),t}function hE(r,e,t){if(Ze.domSupported&&r.getBoundingClientRect){var n=e.clientX,i=e.clientY;if(EB(r)){var a=r.getBoundingClientRect();t.zrX=n-a.left,t.zrY=i-a.top;return}else if(Xw(pb,r,n,i)){t.zrX=pb[0],t.zrY=pb[1];return}}t.zrX=t.zrY=0}function fC(r){return r||window.event}function Zn(r,e,t){if(e=fC(e),e.zrX!=null)return e;var n=e.type,i=n&&n.indexOf("touch")>=0;if(i){var o=n!=="touchend"?e.targetTouches[0]:e.changedTouches[0];o&&Kw(r,o,e,t)}else{Kw(r,e,e,t);var a=Roe(e);e.zrDelta=a?a/120:-(e.detail||0)/3}var s=e.button;return e.which==null&&s!==void 0&&Ioe.test(e.type)&&(e.which=s&1?1:s&2?3:s&4?2:0),e}function Roe(r){var e=r.wheelDelta;if(e)return e;var t=r.deltaX,n=r.deltaY;if(t==null||n==null)return e;var i=Math.abs(n!==0?n:t),a=n>0?-1:n<0?1:t>0?-1:1;return 3*i*a}function Zw(r,e,t,n){r.addEventListener(e,t,n)}function Ooe(r,e,t,n){r.removeEventListener(e,t,n)}var _o=function(r){r.preventDefault(),r.stopPropagation(),r.cancelBubble=!0};function dE(r){return r.which===2||r.which===3}var joe=function(){function r(){this._track=[]}return r.prototype.recognize=function(e,t,n){return this._doTrack(e,t,n),this._recognize(e)},r.prototype.clear=function(){return this._track.length=0,this},r.prototype._doTrack=function(e,t,n){var i=e.touches;if(i){for(var a={points:[],touches:[],target:t,event:e},o=0,s=i.length;o1&&n&&n.length>1){var a=pE(n)/pE(i);!isFinite(a)&&(a=1),e.pinchScale=a;var o=Noe(n);return e.pinchX=o[0],e.pinchY=o[1],{type:"pinch",target:r[0].target,event:e}}}}};function zn(){return[1,0,0,1,0,0]}function O0(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r}function hC(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r}function fo(r,e,t){var n=e[0]*t[0]+e[2]*t[1],i=e[1]*t[0]+e[3]*t[1],a=e[0]*t[2]+e[2]*t[3],o=e[1]*t[2]+e[3]*t[3],s=e[0]*t[4]+e[2]*t[5]+e[4],l=e[1]*t[4]+e[3]*t[5]+e[5];return r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=l,r}function La(r,e,t){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4]+t[0],r[5]=e[5]+t[1],r}function Eu(r,e,t,n){n===void 0&&(n=[0,0]);var i=e[0],a=e[2],o=e[4],s=e[1],l=e[3],u=e[5],c=Math.sin(t),f=Math.cos(t);return r[0]=i*f+s*c,r[1]=-i*c+s*f,r[2]=a*f+l*c,r[3]=-a*c+f*l,r[4]=f*(o-n[0])+c*(u-n[1])+n[0],r[5]=f*(u-n[1])-c*(o-n[0])+n[1],r}function dC(r,e,t){var n=t[0],i=t[1];return r[0]=e[0]*n,r[1]=e[1]*i,r[2]=e[2]*n,r[3]=e[3]*i,r[4]=e[4]*n,r[5]=e[5]*i,r}function gf(r,e){var t=e[0],n=e[2],i=e[4],a=e[1],o=e[3],s=e[5],l=t*o-a*n;return l?(l=1/l,r[0]=o*l,r[1]=-a*l,r[2]=-n*l,r[3]=t*l,r[4]=(n*s-o*i)*l,r[5]=(a*i-t*s)*l,r):null}function Boe(r){var e=zn();return hC(e,r),e}var ze=function(){function r(e,t){this.x=e||0,this.y=t||0}return r.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},r.prototype.clone=function(){return new r(this.x,this.y)},r.prototype.set=function(e,t){return this.x=e,this.y=t,this},r.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},r.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},r.prototype.scale=function(e){this.x*=e,this.y*=e},r.prototype.scaleAndAdd=function(e,t){this.x+=e.x*t,this.y+=e.y*t},r.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},r.prototype.dot=function(e){return this.x*e.x+this.y*e.y},r.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},r.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},r.prototype.normalize=function(){var e=this.len();return this.x/=e,this.y/=e,this},r.prototype.distance=function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)},r.prototype.distanceSquare=function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},r.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},r.prototype.transform=function(e){if(e){var t=this.x,n=this.y;return this.x=e[0]*t+e[2]*n+e[4],this.y=e[1]*t+e[3]*n+e[5],this}},r.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},r.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},r.set=function(e,t,n){e.x=t,e.y=n},r.copy=function(e,t){e.x=t.x,e.y=t.y},r.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},r.lenSquare=function(e){return e.x*e.x+e.y*e.y},r.dot=function(e,t){return e.x*t.x+e.y*t.y},r.add=function(e,t,n){e.x=t.x+n.x,e.y=t.y+n.y},r.sub=function(e,t,n){e.x=t.x-n.x,e.y=t.y-n.y},r.scale=function(e,t,n){e.x=t.x*n,e.y=t.y*n},r.scaleAndAdd=function(e,t,n,i){e.x=t.x+n.x*i,e.y=t.y+n.y*i},r.lerp=function(e,t,n,i){var a=1-i;e.x=a*t.x+i*n.x,e.y=a*t.y+i*n.y},r}(),mv=Math.min,gv=Math.max,Ws=new ze,Us=new ze,Ys=new ze,qs=new ze,Wf=new ze,Uf=new ze,Ve=function(){function r(e,t,n,i){n<0&&(e=e+n,n=-n),i<0&&(t=t+i,i=-i),this.x=e,this.y=t,this.width=n,this.height=i}return r.prototype.union=function(e){var t=mv(e.x,this.x),n=mv(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=gv(e.x+e.width,this.x+this.width)-t:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=gv(e.y+e.height,this.y+this.height)-n:this.height=e.height,this.x=t,this.y=n},r.prototype.applyTransform=function(e){r.applyTransform(this,this,e)},r.prototype.calculateTransform=function(e){var t=this,n=e.width/t.width,i=e.height/t.height,a=zn();return La(a,a,[-t.x,-t.y]),dC(a,a,[n,i]),La(a,a,[e.x,e.y]),a},r.prototype.intersect=function(e,t){if(!e)return!1;e instanceof r||(e=r.create(e));var n=this,i=n.x,a=n.x+n.width,o=n.y,s=n.y+n.height,l=e.x,u=e.x+e.width,c=e.y,f=e.y+e.height,h=!(ap&&(p=b,vp&&(p=_,g=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height},r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height)},r.prototype.copy=function(e){r.copy(this,e)},r.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},r.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},r.prototype.isZero=function(){return this.width===0||this.height===0},r.create=function(e){return new r(e.x,e.y,e.width,e.height)},r.copy=function(e,t){e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height},r.applyTransform=function(e,t,n){if(!n){e!==t&&r.copy(e,t);return}if(n[1]<1e-5&&n[1]>-1e-5&&n[2]<1e-5&&n[2]>-1e-5){var i=n[0],a=n[3],o=n[4],s=n[5];e.x=t.x*i+o,e.y=t.y*a+s,e.width=t.width*i,e.height=t.height*a,e.width<0&&(e.x+=e.width,e.width=-e.width),e.height<0&&(e.y+=e.height,e.height=-e.height);return}Ws.x=Ys.x=t.x,Ws.y=qs.y=t.y,Us.x=qs.x=t.x+t.width,Us.y=Ys.y=t.y+t.height,Ws.transform(n),qs.transform(n),Us.transform(n),Ys.transform(n),e.x=mv(Ws.x,Us.x,Ys.x,qs.x),e.y=mv(Ws.y,Us.y,Ys.y,qs.y);var l=gv(Ws.x,Us.x,Ys.x,qs.x),u=gv(Ws.y,Us.y,Ys.y,qs.y);e.width=l-e.x,e.height=u-e.y},r}(),LB="silent";function zoe(r,e,t){return{type:r,event:t,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:t.zrX,offsetY:t.zrY,gestureEvent:t.gestureEvent,pinchX:t.pinchX,pinchY:t.pinchY,pinchScale:t.pinchScale,wheelDelta:t.zrDelta,zrByTouch:t.zrByTouch,which:t.which,stop:Foe}}function Foe(){_o(this.event)}var Voe=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.handler=null,t}return e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e}(gi),Yf=function(){function r(e,t){this.x=e,this.y=t}return r}(),$oe=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],mb=new Ve(0,0,0,0),IB=function(r){z(e,r);function e(t,n,i,a,o){var s=r.call(this)||this;return s._hovered=new Yf(0,0),s.storage=t,s.painter=n,s.painterRoot=a,s._pointerSize=o,i=i||new Voe,s.proxy=null,s.setHandlerProxy(i),s._draggingMgr=new Coe(s),s}return e.prototype.setHandlerProxy=function(t){this.proxy&&this.proxy.dispose(),t&&(k($oe,function(n){t.on&&t.on(n,this[n],this)},this),t.handler=this),this.proxy=t},e.prototype.mousemove=function(t){var n=t.zrX,i=t.zrY,a=PB(this,n,i),o=this._hovered,s=o.target;s&&!s.__zr&&(o=this.findHover(o.x,o.y),s=o.target);var l=this._hovered=a?new Yf(n,i):this.findHover(n,i),u=l.target,c=this.proxy;c.setCursor&&c.setCursor(u?u.cursor:"default"),s&&u!==s&&this.dispatchToElement(o,"mouseout",t),this.dispatchToElement(l,"mousemove",t),u&&u!==s&&this.dispatchToElement(l,"mouseover",t)},e.prototype.mouseout=function(t){var n=t.zrEventControl;n!=="only_globalout"&&this.dispatchToElement(this._hovered,"mouseout",t),n!=="no_globalout"&&this.trigger("globalout",{type:"globalout",event:t})},e.prototype.resize=function(){this._hovered=new Yf(0,0)},e.prototype.dispatch=function(t,n){var i=this[t];i&&i.call(this,n)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(t){var n=this.proxy;n.setCursor&&n.setCursor(t)},e.prototype.dispatchToElement=function(t,n,i){t=t||{};var a=t.target;if(!(a&&a.silent)){for(var o="on"+n,s=zoe(n,t,i);a&&(a[o]&&(s.cancelBubble=!!a[o].call(a,s)),a.trigger(n,s),a=a.__hostTarget?a.__hostTarget:a.parent,!s.cancelBubble););s.cancelBubble||(this.trigger(n,s),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(l){typeof l[o]=="function"&&l[o].call(l,s),l.trigger&&l.trigger(n,s)}))}},e.prototype.findHover=function(t,n,i){var a=this.storage.getDisplayList(),o=new Yf(t,n);if(vE(a,o,t,n,i),this._pointerSize&&!o.target){for(var s=[],l=this._pointerSize,u=l/2,c=new Ve(t-u,n-u,l,l),f=a.length-1;f>=0;f--){var h=a[f];h!==i&&!h.ignore&&!h.ignoreCoarsePointer&&(!h.parent||!h.parent.ignoreCoarsePointer)&&(mb.copy(h.getBoundingRect()),h.transform&&mb.applyTransform(h.transform),mb.intersect(c)&&s.push(h))}if(s.length)for(var d=4,p=Math.PI/12,v=Math.PI*2,m=0;m4)return;this._downPoint=null}this.dispatchToElement(a,r,e)}});function Hoe(r,e,t){if(r[r.rectHover?"rectContain":"contain"](e,t)){for(var n=r,i=void 0,a=!1;n;){if(n.ignoreClip&&(a=!0),!a){var o=n.getClipPath();if(o&&!o.contain(e,t))return!1}n.silent&&(i=!0);var s=n.__hostTarget;n=s||n.parent}return i?LB:!0}return!1}function vE(r,e,t,n,i){for(var a=r.length-1;a>=0;a--){var o=r[a],s=void 0;if(o!==i&&!o.ignore&&(s=Hoe(o,t,n))&&(!e.topTarget&&(e.topTarget=o),s!==LB)){e.target=o;break}}}function PB(r,e,t){var n=r.painter;return e<0||e>n.getWidth()||t<0||t>n.getHeight()}var RB=32,qf=7;function Goe(r){for(var e=0;r>=RB;)e|=r&1,r>>=1;return r+e}function mE(r,e,t,n){var i=e+1;if(i===t)return 1;if(n(r[i++],r[e])<0){for(;i=0;)i++;return i-e}function Woe(r,e,t){for(t--;e>>1,i(a,r[l])<0?s=l:o=l+1;var u=n-o;switch(u){case 3:r[o+3]=r[o+2];case 2:r[o+2]=r[o+1];case 1:r[o+1]=r[o];break;default:for(;u>0;)r[o+u]=r[o+u-1],u--}r[o]=a}}function gb(r,e,t,n,i,a){var o=0,s=0,l=1;if(a(r,e[t+i])>0){for(s=n-i;l0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=i,l+=i}else{for(s=i+1;ls&&(l=s);var u=o;o=i-l,l=i-u}for(o++;o>>1);a(r,e[t+c])>0?o=c+1:l=c}return l}function yb(r,e,t,n,i,a){var o=0,s=0,l=1;if(a(r,e[t+i])<0){for(s=i+1;ls&&(l=s);var u=o;o=i-l,l=i-u}else{for(s=n-i;l=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=i,l+=i}for(o++;o>>1);a(r,e[t+c])<0?l=c:o=c+1}return l}function Uoe(r,e){var t=qf,n,i,a=0,o=[];n=[],i=[];function s(d,p){n[a]=d,i[a]=p,a+=1}function l(){for(;a>1;){var d=a-2;if(d>=1&&i[d-1]<=i[d]+i[d+1]||d>=2&&i[d-2]<=i[d]+i[d-1])i[d-1]i[d+1])break;c(d)}}function u(){for(;a>1;){var d=a-2;d>0&&i[d-1]=qf||S>=qf);if(T)break;x<0&&(x=0),x+=2}if(t=x,t<1&&(t=1),p===1){for(g=0;g=0;g--)r[w+g]=r[x+g];r[_]=o[b];return}for(var S=t;;){var T=0,C=0,A=!1;do if(e(o[b],r[y])<0){if(r[_--]=r[y--],T++,C=0,--p===0){A=!0;break}}else if(r[_--]=o[b--],C++,T=0,--m===1){A=!0;break}while((T|C)=0;g--)r[w+g]=r[x+g];if(p===0){A=!0;break}}if(r[_--]=o[b--],--m===1){A=!0;break}if(C=m-gb(r[y],o,0,m,m-1,e),C!==0){for(_-=C,b-=C,m-=C,w=_+1,x=b+1,g=0;g=qf||C>=qf);if(A)break;S<0&&(S=0),S+=2}if(t=S,t<1&&(t=1),m===1){for(_-=p,y-=p,w=_+1,x=y+1,g=p-1;g>=0;g--)r[w+g]=r[x+g];r[_]=o[b]}else{if(m===0)throw new Error;for(x=_-(m-1),g=0;gs&&(l=s),gE(r,t,t+l,t+a,e),a=l}o.pushRun(t,a),o.mergeRuns(),i-=a,t+=a}while(i!==0);o.forceMergeRuns()}}var On=1,Ch=2,xc=4,yE=!1;function bb(){yE||(yE=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function bE(r,e){return r.zlevel===e.zlevel?r.z===e.z?r.z2-e.z2:r.z-e.z:r.zlevel-e.zlevel}var Yoe=function(){function r(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=bE}return r.prototype.traverse=function(e,t){for(var n=0;n0&&(c.__clipPaths=[]),isNaN(c.z)&&(bb(),c.z=0),isNaN(c.z2)&&(bb(),c.z2=0),isNaN(c.zlevel)&&(bb(),c.zlevel=0),this._displayList[this._displayListLen++]=c}var f=e.getDecalElement&&e.getDecalElement();f&&this._updateAndAddDisplayable(f,t,n);var h=e.getTextGuideLine();h&&this._updateAndAddDisplayable(h,t,n);var d=e.getTextContent();d&&this._updateAndAddDisplayable(d,t,n)}},r.prototype.addRoot=function(e){e.__zr&&e.__zr.storage===this||this._roots.push(e)},r.prototype.delRoot=function(e){if(e instanceof Array){for(var t=0,n=e.length;t=0&&this._roots.splice(i,1)},r.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},r.prototype.getRoots=function(){return this._roots},r.prototype.dispose=function(){this._displayList=null,this._roots=null},r}(),ly;ly=Ze.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(r){return setTimeout(r,16)};var nd={linear:function(r){return r},quadraticIn:function(r){return r*r},quadraticOut:function(r){return r*(2-r)},quadraticInOut:function(r){return(r*=2)<1?.5*r*r:-.5*(--r*(r-2)-1)},cubicIn:function(r){return r*r*r},cubicOut:function(r){return--r*r*r+1},cubicInOut:function(r){return(r*=2)<1?.5*r*r*r:.5*((r-=2)*r*r+2)},quarticIn:function(r){return r*r*r*r},quarticOut:function(r){return 1- --r*r*r*r},quarticInOut:function(r){return(r*=2)<1?.5*r*r*r*r:-.5*((r-=2)*r*r*r-2)},quinticIn:function(r){return r*r*r*r*r},quinticOut:function(r){return--r*r*r*r*r+1},quinticInOut:function(r){return(r*=2)<1?.5*r*r*r*r*r:.5*((r-=2)*r*r*r*r+2)},sinusoidalIn:function(r){return 1-Math.cos(r*Math.PI/2)},sinusoidalOut:function(r){return Math.sin(r*Math.PI/2)},sinusoidalInOut:function(r){return .5*(1-Math.cos(Math.PI*r))},exponentialIn:function(r){return r===0?0:Math.pow(1024,r-1)},exponentialOut:function(r){return r===1?1:1-Math.pow(2,-10*r)},exponentialInOut:function(r){return r===0?0:r===1?1:(r*=2)<1?.5*Math.pow(1024,r-1):.5*(-Math.pow(2,-10*(r-1))+2)},circularIn:function(r){return 1-Math.sqrt(1-r*r)},circularOut:function(r){return Math.sqrt(1- --r*r)},circularInOut:function(r){return(r*=2)<1?-.5*(Math.sqrt(1-r*r)-1):.5*(Math.sqrt(1-(r-=2)*r)+1)},elasticIn:function(r){var e,t=.1,n=.4;return r===0?0:r===1?1:(!t||t<1?(t=1,e=n/4):e=n*Math.asin(1/t)/(2*Math.PI),-(t*Math.pow(2,10*(r-=1))*Math.sin((r-e)*(2*Math.PI)/n)))},elasticOut:function(r){var e,t=.1,n=.4;return r===0?0:r===1?1:(!t||t<1?(t=1,e=n/4):e=n*Math.asin(1/t)/(2*Math.PI),t*Math.pow(2,-10*r)*Math.sin((r-e)*(2*Math.PI)/n)+1)},elasticInOut:function(r){var e,t=.1,n=.4;return r===0?0:r===1?1:(!t||t<1?(t=1,e=n/4):e=n*Math.asin(1/t)/(2*Math.PI),(r*=2)<1?-.5*(t*Math.pow(2,10*(r-=1))*Math.sin((r-e)*(2*Math.PI)/n)):t*Math.pow(2,-10*(r-=1))*Math.sin((r-e)*(2*Math.PI)/n)*.5+1)},backIn:function(r){var e=1.70158;return r*r*((e+1)*r-e)},backOut:function(r){var e=1.70158;return--r*r*((e+1)*r+e)+1},backInOut:function(r){var e=2.5949095;return(r*=2)<1?.5*(r*r*((e+1)*r-e)):.5*((r-=2)*r*((e+1)*r+e)+2)},bounceIn:function(r){return 1-nd.bounceOut(1-r)},bounceOut:function(r){return r<1/2.75?7.5625*r*r:r<2/2.75?7.5625*(r-=1.5/2.75)*r+.75:r<2.5/2.75?7.5625*(r-=2.25/2.75)*r+.9375:7.5625*(r-=2.625/2.75)*r+.984375},bounceInOut:function(r){return r<.5?nd.bounceIn(r*2)*.5:nd.bounceOut(r*2-1)*.5+.5}},yv=Math.pow,ys=Math.sqrt,uy=1e-8,OB=1e-4,_E=ys(3),bv=1/3,ua=Du(),ni=Du(),jc=Du();function cs(r){return r>-uy&&ruy||r<-uy}function _r(r,e,t,n,i){var a=1-i;return a*a*(a*r+3*i*e)+i*i*(i*n+3*a*t)}function xE(r,e,t,n,i){var a=1-i;return 3*(((e-r)*a+2*(t-e)*i)*a+(n-t)*i*i)}function cy(r,e,t,n,i,a){var o=n+3*(e-t)-r,s=3*(t-e*2+r),l=3*(e-r),u=r-i,c=s*s-3*o*l,f=s*l-9*o*u,h=l*l-3*s*u,d=0;if(cs(c)&&cs(f))if(cs(s))a[0]=0;else{var p=-l/s;p>=0&&p<=1&&(a[d++]=p)}else{var v=f*f-4*c*h;if(cs(v)){var m=f/c,p=-s/o+m,g=-m/2;p>=0&&p<=1&&(a[d++]=p),g>=0&&g<=1&&(a[d++]=g)}else if(v>0){var y=ys(v),b=c*s+1.5*o*(-f+y),_=c*s+1.5*o*(-f-y);b<0?b=-yv(-b,bv):b=yv(b,bv),_<0?_=-yv(-_,bv):_=yv(_,bv);var p=(-s-(b+_))/(3*o);p>=0&&p<=1&&(a[d++]=p)}else{var x=(2*c*s-3*o*f)/(2*ys(c*c*c)),w=Math.acos(x)/3,S=ys(c),T=Math.cos(w),p=(-s-2*S*T)/(3*o),g=(-s+S*(T+_E*Math.sin(w)))/(3*o),C=(-s+S*(T-_E*Math.sin(w)))/(3*o);p>=0&&p<=1&&(a[d++]=p),g>=0&&g<=1&&(a[d++]=g),C>=0&&C<=1&&(a[d++]=C)}}return d}function NB(r,e,t,n,i){var a=6*t-12*e+6*r,o=9*e+3*n-3*r-9*t,s=3*e-3*r,l=0;if(cs(o)){if(jB(a)){var u=-s/a;u>=0&&u<=1&&(i[l++]=u)}}else{var c=a*a-4*o*s;if(cs(c))i[0]=-a/(2*o);else if(c>0){var f=ys(c),u=(-a+f)/(2*o),h=(-a-f)/(2*o);u>=0&&u<=1&&(i[l++]=u),h>=0&&h<=1&&(i[l++]=h)}}return l}function Ds(r,e,t,n,i,a){var o=(e-r)*i+r,s=(t-e)*i+e,l=(n-t)*i+t,u=(s-o)*i+o,c=(l-s)*i+s,f=(c-u)*i+u;a[0]=r,a[1]=o,a[2]=u,a[3]=f,a[4]=f,a[5]=c,a[6]=l,a[7]=n}function BB(r,e,t,n,i,a,o,s,l,u,c){var f,h=.005,d=1/0,p,v,m,g;ua[0]=l,ua[1]=u;for(var y=0;y<1;y+=.05)ni[0]=_r(r,t,i,o,y),ni[1]=_r(e,n,a,s,y),m=Jl(ua,ni),m=0&&m=0&&u<=1&&(i[l++]=u)}}else{var c=o*o-4*a*s;if(cs(c)){var u=-o/(2*a);u>=0&&u<=1&&(i[l++]=u)}else if(c>0){var f=ys(c),u=(-o+f)/(2*a),h=(-o-f)/(2*a);u>=0&&u<=1&&(i[l++]=u),h>=0&&h<=1&&(i[l++]=h)}}return l}function zB(r,e,t){var n=r+t-2*e;return n===0?.5:(r-e)/n}function Nd(r,e,t,n,i){var a=(e-r)*n+r,o=(t-e)*n+e,s=(o-a)*n+a;i[0]=r,i[1]=a,i[2]=s,i[3]=s,i[4]=o,i[5]=t}function FB(r,e,t,n,i,a,o,s,l){var u,c=.005,f=1/0;ua[0]=o,ua[1]=s;for(var h=0;h<1;h+=.05){ni[0]=Ar(r,t,i,h),ni[1]=Ar(e,n,a,h);var d=Jl(ua,ni);d=0&&d=1?1:cy(0,n,a,1,l,s)&&_r(0,i,o,1,s[0])}}}var Joe=function(){function r(e){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=e.life||1e3,this._delay=e.delay||0,this.loop=e.loop||!1,this.onframe=e.onframe||tr,this.ondestroy=e.ondestroy||tr,this.onrestart=e.onrestart||tr,e.easing&&this.setEasing(e.easing)}return r.prototype.step=function(e,t){if(this._inited||(this._startTime=e+this._delay,this._inited=!0),this._paused){this._pausedTime+=t;return}var n=this._life,i=e-this._startTime-this._pausedTime,a=i/n;a<0&&(a=0),a=Math.min(a,1);var o=this.easingFunc,s=o?o(a):a;if(this.onframe(s),a===1)if(this.loop){var l=i%n;this._startTime=e-l,this._pausedTime=0,this.onrestart()}else return!0;return!1},r.prototype.pause=function(){this._paused=!0},r.prototype.resume=function(){this._paused=!1},r.prototype.setEasing=function(e){this.easing=e,this.easingFunc=Te(e)?e:nd[e]||pC(e)},r}(),VB=function(){function r(e){this.value=e}return r}(),Qoe=function(){function r(){this._len=0}return r.prototype.insert=function(e){var t=new VB(e);return this.insertEntry(t),t},r.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},r.prototype.remove=function(e){var t=e.prev,n=e.next;t?t.next=n:this.head=n,n?n.prev=t:this.tail=t,e.next=e.prev=null,this._len--},r.prototype.len=function(){return this._len},r.prototype.clear=function(){this.head=this.tail=null,this._len=0},r}(),_p=function(){function r(e){this._list=new Qoe,this._maxSize=10,this._map={},this._maxSize=e}return r.prototype.put=function(e,t){var n=this._list,i=this._map,a=null;if(i[e]==null){var o=n.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=n.head;n.remove(l),delete i[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=t:s=new VB(t),s.key=e,n.insertEntry(s),i[e]=s}return a},r.prototype.get=function(e){var t=this._map[e],n=this._list;if(t!=null)return t!==n.tail&&(n.remove(t),n.insertEntry(t)),t.value},r.prototype.clear=function(){this._list.clear(),this._map={}},r.prototype.len=function(){return this._list.len()},r}(),wE={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Pi(r){return r=Math.round(r),r<0?0:r>255?255:r}function ese(r){return r=Math.round(r),r<0?0:r>360?360:r}function Bd(r){return r<0?0:r>1?1:r}function _b(r){var e=r;return e.length&&e.charAt(e.length-1)==="%"?Pi(parseFloat(e)/100*255):Pi(parseInt(e,10))}function Ql(r){var e=r;return e.length&&e.charAt(e.length-1)==="%"?Bd(parseFloat(e)/100):Bd(parseFloat(e))}function xb(r,e,t){return t<0?t+=1:t>1&&(t-=1),t*6<1?r+(e-r)*t*6:t*2<1?e:t*3<2?r+(e-r)*(2/3-t)*6:r}function fs(r,e,t){return r+(e-r)*t}function Xn(r,e,t,n,i){return r[0]=e,r[1]=t,r[2]=n,r[3]=i,r}function Qw(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r}var $B=new _p(20),_v=null;function qu(r,e){_v&&Qw(_v,e),_v=$B.put(r,_v||e.slice())}function Fn(r,e){if(r){e=e||[];var t=$B.get(r);if(t)return Qw(e,t);r=r+"";var n=r.replace(/ /g,"").toLowerCase();if(n in wE)return Qw(e,wE[n]),qu(r,e),e;var i=n.length;if(n.charAt(0)==="#"){if(i===4||i===5){var a=parseInt(n.slice(1,4),16);if(!(a>=0&&a<=4095)){Xn(e,0,0,0,1);return}return Xn(e,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,i===5?parseInt(n.slice(4),16)/15:1),qu(r,e),e}else if(i===7||i===9){var a=parseInt(n.slice(1,7),16);if(!(a>=0&&a<=16777215)){Xn(e,0,0,0,1);return}return Xn(e,(a&16711680)>>16,(a&65280)>>8,a&255,i===9?parseInt(n.slice(7),16)/255:1),qu(r,e),e}return}var o=n.indexOf("("),s=n.indexOf(")");if(o!==-1&&s+1===i){var l=n.substr(0,o),u=n.substr(o+1,s-(o+1)).split(","),c=1;switch(l){case"rgba":if(u.length!==4)return u.length===3?Xn(e,+u[0],+u[1],+u[2],1):Xn(e,0,0,0,1);c=Ql(u.pop());case"rgb":if(u.length>=3)return Xn(e,_b(u[0]),_b(u[1]),_b(u[2]),u.length===3?c:Ql(u[3])),qu(r,e),e;Xn(e,0,0,0,1);return;case"hsla":if(u.length!==4){Xn(e,0,0,0,1);return}return u[3]=Ql(u[3]),e2(u,e),qu(r,e),e;case"hsl":if(u.length!==3){Xn(e,0,0,0,1);return}return e2(u,e),qu(r,e),e;default:return}}Xn(e,0,0,0,1)}}function e2(r,e){var t=(parseFloat(r[0])%360+360)%360/360,n=Ql(r[1]),i=Ql(r[2]),a=i<=.5?i*(n+1):i+n-i*n,o=i*2-a;return e=e||[],Xn(e,Pi(xb(o,a,t+1/3)*255),Pi(xb(o,a,t)*255),Pi(xb(o,a,t-1/3)*255),1),r.length===4&&(e[3]=r[3]),e}function tse(r){if(r){var e=r[0]/255,t=r[1]/255,n=r[2]/255,i=Math.min(e,t,n),a=Math.max(e,t,n),o=a-i,s=(a+i)/2,l,u;if(o===0)l=0,u=0;else{s<.5?u=o/(a+i):u=o/(2-a-i);var c=((a-e)/6+o/2)/o,f=((a-t)/6+o/2)/o,h=((a-n)/6+o/2)/o;e===a?l=h-f:t===a?l=1/3+c-h:n===a&&(l=2/3+f-c),l<0&&(l+=1),l>1&&(l-=1)}var d=[l*360,u,s];return r[3]!=null&&d.push(r[3]),d}}function t2(r,e){var t=Fn(r);if(t){for(var n=0;n<3;n++)e<0?t[n]=t[n]*(1-e)|0:t[n]=(255-t[n])*e+t[n]|0,t[n]>255?t[n]=255:t[n]<0&&(t[n]=0);return ho(t,t.length===4?"rgba":"rgb")}}function wb(r,e,t){if(!(!(e&&e.length)||!(r>=0&&r<=1))){t=t||[];var n=r*(e.length-1),i=Math.floor(n),a=Math.ceil(n),o=e[i],s=e[a],l=n-i;return t[0]=Pi(fs(o[0],s[0],l)),t[1]=Pi(fs(o[1],s[1],l)),t[2]=Pi(fs(o[2],s[2],l)),t[3]=Bd(fs(o[3],s[3],l)),t}}function rse(r,e,t){if(!(!(e&&e.length)||!(r>=0&&r<=1))){var n=r*(e.length-1),i=Math.floor(n),a=Math.ceil(n),o=Fn(e[i]),s=Fn(e[a]),l=n-i,u=ho([Pi(fs(o[0],s[0],l)),Pi(fs(o[1],s[1],l)),Pi(fs(o[2],s[2],l)),Bd(fs(o[3],s[3],l))],"rgba");return t?{color:u,leftIndex:i,rightIndex:a,value:n}:u}}function id(r,e,t,n){var i=Fn(r);if(r)return i=tse(i),e!=null&&(i[0]=ese(e)),t!=null&&(i[1]=Ql(t)),n!=null&&(i[2]=Ql(n)),ho(e2(i),"rgba")}function fy(r,e){var t=Fn(r);if(t&&e!=null)return t[3]=Bd(e),ho(t,"rgba")}function ho(r,e){if(!(!r||!r.length)){var t=r[0]+","+r[1]+","+r[2];return(e==="rgba"||e==="hsva"||e==="hsla")&&(t+=","+r[3]),e+"("+t+")"}}function hy(r,e){var t=Fn(r);return t?(.299*t[0]+.587*t[1]+.114*t[2])*t[3]/255+(1-t[3])*e:0}var SE=new _p(100);function r2(r){if(se(r)){var e=SE.get(r);return e||(e=t2(r,-.1),SE.put(r,e)),e}else if(P0(r)){var t=W({},r);return t.colorStops=K(r.colorStops,function(n){return{offset:n.offset,color:t2(n.color,-.1)}}),t}return r}var dy=Math.round;function zd(r){var e;if(!r||r==="transparent")r="none";else if(typeof r=="string"&&r.indexOf("rgba")>-1){var t=Fn(r);t&&(r="rgb("+t[0]+","+t[1]+","+t[2]+")",e=t[3])}return{color:r,opacity:e??1}}var TE=1e-4;function hs(r){return r-TE}function xv(r){return dy(r*1e3)/1e3}function n2(r){return dy(r*1e4)/1e4}function nse(r){return"matrix("+xv(r[0])+","+xv(r[1])+","+xv(r[2])+","+xv(r[3])+","+n2(r[4])+","+n2(r[5])+")"}var ise={left:"start",right:"end",center:"middle",middle:"middle"};function ase(r,e,t){return t==="top"?r+=e/2:t==="bottom"&&(r-=e/2),r}function ose(r){return r&&(r.shadowBlur||r.shadowOffsetX||r.shadowOffsetY)}function sse(r){var e=r.style,t=r.getGlobalScale();return[e.shadowColor,(e.shadowBlur||0).toFixed(2),(e.shadowOffsetX||0).toFixed(2),(e.shadowOffsetY||0).toFixed(2),t[0],t[1]].join(",")}function HB(r){return r&&!!r.image}function lse(r){return r&&!!r.svgElement}function vC(r){return HB(r)||lse(r)}function GB(r){return r.type==="linear"}function WB(r){return r.type==="radial"}function UB(r){return r&&(r.type==="linear"||r.type==="radial")}function j0(r){return"url(#"+r+")"}function YB(r){var e=r.getGlobalScale(),t=Math.max(e[0],e[1]);return Math.max(Math.ceil(Math.log(t)/Math.log(10)),1)}function qB(r){var e=r.x||0,t=r.y||0,n=(r.rotation||0)*Om,i=Re(r.scaleX,1),a=Re(r.scaleY,1),o=r.skewX||0,s=r.skewY||0,l=[];return(e||t)&&l.push("translate("+e+"px,"+t+"px)"),n&&l.push("rotate("+n+")"),(i!==1||a!==1)&&l.push("scale("+i+","+a+")"),(o||s)&&l.push("skew("+dy(o*Om)+"deg, "+dy(s*Om)+"deg)"),l.join(" ")}var use=function(){return Ze.hasGlobalWindow&&Te(window.btoa)?function(r){return window.btoa(unescape(encodeURIComponent(r)))}:typeof Buffer<"u"?function(r){return Buffer.from(r).toString("base64")}:function(r){return null}}(),i2=Array.prototype.slice;function Qa(r,e,t){return(e-r)*t+r}function Sb(r,e,t,n){for(var i=e.length,a=0;an?e:r,a=Math.min(t,n),o=i[a-1]||{color:[0,0,0,0],offset:0},s=a;so;if(s)n.length=o;else for(var l=a;l=1},r.prototype.getAdditiveTrack=function(){return this._additiveTrack},r.prototype.addKeyframe=function(e,t,n){this._needsSort=!0;var i=this.keyframes,a=i.length,o=!1,s=AE,l=t;if(Zr(t)){var u=dse(t);s=u,(u===1&&!lt(t[0])||u===2&&!lt(t[0][0]))&&(o=!0)}else if(lt(t)&&!Od(t))s=Sv;else if(se(t))if(!isNaN(+t))s=Sv;else{var c=Fn(t);c&&(l=c,s=Ah)}else if(P0(t)){var f=W({},l);f.colorStops=K(t.colorStops,function(d){return{offset:d.offset,color:Fn(d.color)}}),GB(t)?s=a2:WB(t)&&(s=o2),l=f}a===0?this.valType=s:(s!==this.valType||s===AE)&&(o=!0),this.discrete=this.discrete||o;var h={time:e,value:l,rawValue:t,percent:0};return n&&(h.easing=n,h.easingFunc=Te(n)?n:nd[n]||pC(n)),i.push(h),h},r.prototype.prepare=function(e,t){var n=this.keyframes;this._needsSort&&n.sort(function(v,m){return v.time-m.time});for(var i=this.valType,a=n.length,o=n[a-1],s=this.discrete,l=Tv(i),u=ME(i),c=0;c=0&&!(o[c].percent<=t);c--);c=h(c,s-2)}else{for(c=f;ct);c++);c=h(c-1,s-2)}p=o[c+1],d=o[c]}if(d&&p){this._lastFr=c,this._lastFrP=t;var m=p.percent-d.percent,g=m===0?1:h((t-d.percent)/m,1);p.easingFunc&&(g=p.easingFunc(g));var y=n?this._additiveValue:u?Xf:e[l];if((Tv(a)||u)&&!y&&(y=this._additiveValue=[]),this.discrete)e[l]=g<1?d.rawValue:p.rawValue;else if(Tv(a))a===Fm?Sb(y,d[i],p[i],g):cse(y,d[i],p[i],g);else if(ME(a)){var b=d[i],_=p[i],x=a===a2;e[l]={type:x?"linear":"radial",x:Qa(b.x,_.x,g),y:Qa(b.y,_.y,g),colorStops:K(b.colorStops,function(S,T){var C=_.colorStops[T];return{offset:Qa(S.offset,C.offset,g),color:zm(Sb([],S.color,C.color,g))}}),global:_.global},x?(e[l].x2=Qa(b.x2,_.x2,g),e[l].y2=Qa(b.y2,_.y2,g)):e[l].r=Qa(b.r,_.r,g)}else if(u)Sb(y,d[i],p[i],g),n||(e[l]=zm(y));else{var w=Qa(d[i],p[i],g);n?this._additiveValue=w:e[l]=w}n&&this._addToTarget(e)}}},r.prototype._addToTarget=function(e){var t=this.valType,n=this.propName,i=this._additiveValue;t===Sv?e[n]=e[n]+i:t===Ah?(Fn(e[n],Xf),wv(Xf,Xf,i,1),e[n]=zm(Xf)):t===Fm?wv(e[n],e[n],i,1):t===XB&&CE(e[n],e[n],i,1)},r}(),mC=function(){function r(e,t,n,i){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=t,t&&i){sC("Can' use additive animation on looped animation.");return}this._additiveAnimators=i,this._allowDiscrete=n}return r.prototype.getMaxTime=function(){return this._maxTime},r.prototype.getDelay=function(){return this._delay},r.prototype.getLoop=function(){return this._loop},r.prototype.getTarget=function(){return this._target},r.prototype.changeTarget=function(e){this._target=e},r.prototype.when=function(e,t,n){return this.whenWithKeys(e,t,et(t),n)},r.prototype.whenWithKeys=function(e,t,n,i){for(var a=this._tracks,o=0;o0&&l.addKeyframe(0,ad(u),i),this._trackKeys.push(s)}l.addKeyframe(e,ad(t[s]),i)}return this._maxTime=Math.max(this._maxTime,e),this},r.prototype.pause=function(){this._clip.pause(),this._paused=!0},r.prototype.resume=function(){this._clip.resume(),this._paused=!1},r.prototype.isPaused=function(){return!!this._paused},r.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},r.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var t=e.length,n=0;n0)){this._started=1;for(var t=this,n=[],i=this._maxTime||0,a=0;a1){var s=o.pop();a.addKeyframe(s.time,e[i]),a.prepare(this._maxTime,a.getAdditiveTrack())}}}},r}();function kc(){return new Date().getTime()}var vse=function(r){z(e,r);function e(t){var n=r.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,t=t||{},n.stage=t.stage||{},n}return e.prototype.addClip=function(t){t.animation&&this.removeClip(t),this._head?(this._tail.next=t,t.prev=this._tail,t.next=null,this._tail=t):this._head=this._tail=t,t.animation=this},e.prototype.addAnimator=function(t){t.animation=this;var n=t.getClip();n&&this.addClip(n)},e.prototype.removeClip=function(t){if(t.animation){var n=t.prev,i=t.next;n?n.next=i:this._head=i,i?i.prev=n:this._tail=n,t.next=t.prev=t.animation=null}},e.prototype.removeAnimator=function(t){var n=t.getClip();n&&this.removeClip(n),t.animation=null},e.prototype.update=function(t){for(var n=kc()-this._pausedTime,i=n-this._time,a=this._head;a;){var o=a.next,s=a.step(n,i);s&&(a.ondestroy(),this.removeClip(a)),a=o}this._time=n,t||(this.trigger("frame",i),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var t=this;this._running=!0;function n(){t._running&&(ly(n),!t._paused&&t.update())}ly(n)},e.prototype.start=function(){this._running||(this._time=kc(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=kc(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=kc()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var t=this._head;t;){var n=t.next;t.prev=t.next=t.animation=null,t=n}this._head=this._tail=null},e.prototype.isFinished=function(){return this._head==null},e.prototype.animate=function(t,n){n=n||{},this.start();var i=new mC(t,n.loop);return this.addAnimator(i),i},e}(gi),mse=300,Tb=Ze.domSupported,Cb=function(){var r=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],e=["touchstart","touchend","touchmove"],t={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},n=K(r,function(i){var a=i.replace("mouse","pointer");return t.hasOwnProperty(a)?a:i});return{mouse:r,touch:e,pointer:n}}(),kE={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},DE=!1;function s2(r){var e=r.pointerType;return e==="pen"||e==="touch"}function gse(r){r.touching=!0,r.touchTimer!=null&&(clearTimeout(r.touchTimer),r.touchTimer=null),r.touchTimer=setTimeout(function(){r.touching=!1,r.touchTimer=null},700)}function Ab(r){r&&(r.zrByTouch=!0)}function yse(r,e){return Zn(r.dom,new bse(r,e),!0)}function KB(r,e){for(var t=e,n=!1;t&&t.nodeType!==9&&!(n=t.domBelongToZr||t!==e&&t===r.painterRoot);)t=t.parentNode;return n}var bse=function(){function r(e,t){this.stopPropagation=tr,this.stopImmediatePropagation=tr,this.preventDefault=tr,this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY}return r}(),Ti={mousedown:function(r){r=Zn(this.dom,r),this.__mayPointerCapture=[r.zrX,r.zrY],this.trigger("mousedown",r)},mousemove:function(r){r=Zn(this.dom,r);var e=this.__mayPointerCapture;e&&(r.zrX!==e[0]||r.zrY!==e[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",r)},mouseup:function(r){r=Zn(this.dom,r),this.__togglePointerCapture(!1),this.trigger("mouseup",r)},mouseout:function(r){r=Zn(this.dom,r);var e=r.toElement||r.relatedTarget;KB(this,e)||(this.__pointerCapturing&&(r.zrEventControl="no_globalout"),this.trigger("mouseout",r))},wheel:function(r){DE=!0,r=Zn(this.dom,r),this.trigger("mousewheel",r)},mousewheel:function(r){DE||(r=Zn(this.dom,r),this.trigger("mousewheel",r))},touchstart:function(r){r=Zn(this.dom,r),Ab(r),this.__lastTouchMoment=new Date,this.handler.processGesture(r,"start"),Ti.mousemove.call(this,r),Ti.mousedown.call(this,r)},touchmove:function(r){r=Zn(this.dom,r),Ab(r),this.handler.processGesture(r,"change"),Ti.mousemove.call(this,r)},touchend:function(r){r=Zn(this.dom,r),Ab(r),this.handler.processGesture(r,"end"),Ti.mouseup.call(this,r),+new Date-+this.__lastTouchMomentIE||r<-IE}var Ks=[],Xu=[],kb=zn(),Db=Math.abs,ao=function(){function r(){}return r.prototype.getLocalTransform=function(e){return r.getLocalTransform(this,e)},r.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},r.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},r.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},r.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},r.prototype.needLocalTransform=function(){return Xs(this.rotation)||Xs(this.x)||Xs(this.y)||Xs(this.scaleX-1)||Xs(this.scaleY-1)||Xs(this.skewX)||Xs(this.skewY)},r.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,t=this.needLocalTransform(),n=this.transform;if(!(t||e)){n&&(LE(n),this.invTransform=null);return}n=n||zn(),t?this.getLocalTransform(n):LE(n),e&&(t?fo(n,e,n):hC(n,e)),this.transform=n,this._resolveGlobalScaleRatio(n)},r.prototype._resolveGlobalScaleRatio=function(e){var t=this.globalScaleRatio;if(t!=null&&t!==1){this.getGlobalScale(Ks);var n=Ks[0]<0?-1:1,i=Ks[1]<0?-1:1,a=((Ks[0]-n)*t+n)/Ks[0]||0,o=((Ks[1]-i)*t+i)/Ks[1]||0;e[0]*=a,e[1]*=a,e[2]*=o,e[3]*=o}this.invTransform=this.invTransform||zn(),gf(this.invTransform,e)},r.prototype.getComputedTransform=function(){for(var e=this,t=[];e;)t.push(e),e=e.parent;for(;e=t.pop();)e.updateTransform();return this.transform},r.prototype.setLocalTransform=function(e){if(e){var t=e[0]*e[0]+e[1]*e[1],n=e[2]*e[2]+e[3]*e[3],i=Math.atan2(e[1],e[0]),a=Math.PI/2+i-Math.atan2(e[3],e[2]);n=Math.sqrt(n)*Math.cos(a),t=Math.sqrt(t),this.skewX=a,this.skewY=0,this.rotation=-i,this.x=+e[4],this.y=+e[5],this.scaleX=t,this.scaleY=n,this.originX=0,this.originY=0}},r.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(e.invTransform=e.invTransform||zn(),fo(Xu,e.invTransform,t),t=Xu);var n=this.originX,i=this.originY;(n||i)&&(kb[4]=n,kb[5]=i,fo(Xu,t,kb),Xu[4]-=n,Xu[5]-=i,t=Xu),this.setLocalTransform(t)}},r.prototype.getGlobalScale=function(e){var t=this.transform;return e=e||[],t?(e[0]=Math.sqrt(t[0]*t[0]+t[1]*t[1]),e[1]=Math.sqrt(t[2]*t[2]+t[3]*t[3]),t[0]<0&&(e[0]=-e[0]),t[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},r.prototype.transformCoordToLocal=function(e,t){var n=[e,t],i=this.invTransform;return i&&Br(n,n,i),n},r.prototype.transformCoordToGlobal=function(e,t){var n=[e,t],i=this.transform;return i&&Br(n,n,i),n},r.prototype.getLineScale=function(){var e=this.transform;return e&&Db(e[0]-1)>1e-10&&Db(e[3]-1)>1e-10?Math.sqrt(Db(e[0]*e[3]-e[2]*e[1])):1},r.prototype.copyTransform=function(e){JB(this,e)},r.getLocalTransform=function(e,t){t=t||[];var n=e.originX||0,i=e.originY||0,a=e.scaleX,o=e.scaleY,s=e.anchorX,l=e.anchorY,u=e.rotation||0,c=e.x,f=e.y,h=e.skewX?Math.tan(e.skewX):0,d=e.skewY?Math.tan(-e.skewY):0;if(n||i||s||l){var p=n+s,v=i+l;t[4]=-p*a-h*v*o,t[5]=-v*o-d*p*a}else t[4]=t[5]=0;return t[0]=a,t[3]=o,t[1]=d*a,t[2]=h*o,u&&Eu(t,t,u),t[4]+=n+c,t[5]+=i+f,t},r.initDefaultProps=function(){var e=r.prototype;e.scaleX=e.scaleY=e.globalScaleRatio=1,e.x=e.y=e.originX=e.originY=e.skewX=e.skewY=e.rotation=e.anchorX=e.anchorY=0}(),r}(),Ia=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function JB(r,e){for(var t=0;t=0?parseFloat(r)/100*e:parseFloat(r):r}function vy(r,e,t){var n=e.position||"inside",i=e.distance!=null?e.distance:5,a=t.height,o=t.width,s=a/2,l=t.x,u=t.y,c="left",f="top";if(n instanceof Array)l+=Ni(n[0],t.width),u+=Ni(n[1],t.height),c=null,f=null;else switch(n){case"left":l-=i,u+=s,c="right",f="middle";break;case"right":l+=i+o,u+=s,f="middle";break;case"top":l+=o/2,u-=i,c="center",f="bottom";break;case"bottom":l+=o/2,u+=a+i,c="center";break;case"inside":l+=o/2,u+=s,c="center",f="middle";break;case"insideLeft":l+=i,u+=s,f="middle";break;case"insideRight":l+=o-i,u+=s,c="right",f="middle";break;case"insideTop":l+=o/2,u+=i,c="center";break;case"insideBottom":l+=o/2,u+=a-i,c="center",f="bottom";break;case"insideTopLeft":l+=i,u+=i;break;case"insideTopRight":l+=o-i,u+=i,c="right";break;case"insideBottomLeft":l+=i,u+=a-i,f="bottom";break;case"insideBottomRight":l+=o-i,u+=a-i,c="right",f="bottom";break}return r=r||{},r.x=l,r.y=u,r.align=c,r.verticalAlign=f,r}var Eb="__zr_normal__",Lb=Ia.concat(["ignore"]),Tse=Ea(Ia,function(r,e){return r[e]=!0,r},{ignore:!1}),Ku={},Cse=new Ve(0,0,0,0),B0=function(){function r(e){this.id=AB(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return r.prototype._init=function(e){this.attr(e)},r.prototype.drift=function(e,t,n){switch(this.draggable){case"horizontal":t=0;break;case"vertical":e=0;break}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=e,i[5]+=t,this.decomposeTransform(),this.markRedraw()},r.prototype.beforeUpdate=function(){},r.prototype.afterUpdate=function(){},r.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},r.prototype.updateInnerText=function(e){var t=this._textContent;if(t&&(!t.ignore||e)){this.textConfig||(this.textConfig={});var n=this.textConfig,i=n.local,a=t.innerTransformable,o=void 0,s=void 0,l=!1;a.parent=i?this:null;var u=!1;if(a.copyTransform(t),n.position!=null){var c=Cse;n.layoutRect?c.copy(n.layoutRect):c.copy(this.getBoundingRect()),i||c.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(Ku,n,c):vy(Ku,n,c),a.x=Ku.x,a.y=Ku.y,o=Ku.align,s=Ku.verticalAlign;var f=n.origin;if(f&&n.rotation!=null){var h=void 0,d=void 0;f==="center"?(h=c.width*.5,d=c.height*.5):(h=Ni(f[0],c.width),d=Ni(f[1],c.height)),u=!0,a.originX=-a.x+h+(i?0:c.x),a.originY=-a.y+d+(i?0:c.y)}}n.rotation!=null&&(a.rotation=n.rotation);var p=n.offset;p&&(a.x+=p[0],a.y+=p[1],u||(a.originX=-p[0],a.originY=-p[1]));var v=n.inside==null?typeof n.position=="string"&&n.position.indexOf("inside")>=0:n.inside,m=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),g=void 0,y=void 0,b=void 0;v&&this.canBeInsideText()?(g=n.insideFill,y=n.insideStroke,(g==null||g==="auto")&&(g=this.getInsideTextFill()),(y==null||y==="auto")&&(y=this.getInsideTextStroke(g),b=!0)):(g=n.outsideFill,y=n.outsideStroke,(g==null||g==="auto")&&(g=this.getOutsideFill()),(y==null||y==="auto")&&(y=this.getOutsideStroke(g),b=!0)),g=g||"#000",(g!==m.fill||y!==m.stroke||b!==m.autoStroke||o!==m.align||s!==m.verticalAlign)&&(l=!0,m.fill=g,m.stroke=y,m.autoStroke=b,m.align=o,m.verticalAlign=s,t.setDefaultTextStyle(m)),t.__dirty|=On,l&&t.dirtyStyle(!0)}},r.prototype.canBeInsideText=function(){return!0},r.prototype.getInsideTextFill=function(){return"#fff"},r.prototype.getInsideTextStroke=function(e){return"#000"},r.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?f2:c2},r.prototype.getOutsideStroke=function(e){var t=this.__zr&&this.__zr.getBackgroundColor(),n=typeof t=="string"&&Fn(t);n||(n=[255,255,255,1]);for(var i=n[3],a=this.__zr.isDarkMode(),o=0;o<3;o++)n[o]=n[o]*i+(a?0:255)*(1-i);return n[3]=1,ho(n,"rgba")},r.prototype.traverse=function(e,t){},r.prototype.attrKV=function(e,t){e==="textConfig"?this.setTextConfig(t):e==="textContent"?this.setTextContent(t):e==="clipPath"?this.setClipPath(t):e==="extra"?(this.extra=this.extra||{},W(this.extra,t)):this[e]=t},r.prototype.hide=function(){this.ignore=!0,this.markRedraw()},r.prototype.show=function(){this.ignore=!1,this.markRedraw()},r.prototype.attr=function(e,t){if(typeof e=="string")this.attrKV(e,t);else if(Me(e))for(var n=e,i=et(n),a=0;a0},r.prototype.getState=function(e){return this.states[e]},r.prototype.ensureState=function(e){var t=this.states;return t[e]||(t[e]={}),t[e]},r.prototype.clearStates=function(e){this.useState(Eb,!1,e)},r.prototype.useState=function(e,t,n,i){var a=e===Eb,o=this.hasState();if(!(!o&&a)){var s=this.currentStates,l=this.stateTransition;if(!(He(s,e)>=0&&(t||s.length===1))){var u;if(this.stateProxy&&!a&&(u=this.stateProxy(e)),u||(u=this.states&&this.states[e]),!u&&!a){sC("State "+e+" not exists.");return}a||this.saveCurrentToNormalState(u);var c=!!(u&&u.hoverLayer||i);c&&this._toggleHoverLayerFlag(!0),this._applyStateObj(e,u,this._normalState,t,!n&&!this.__inHover&&l&&l.duration>0,l);var f=this._textContent,h=this._textGuide;return f&&f.useState(e,t,n,c),h&&h.useState(e,t,n,c),a?(this.currentStates=[],this._normalState={}):t?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!c&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~On),u}}},r.prototype.useStates=function(e,t,n){if(!e.length)this.clearStates();else{var i=[],a=this.currentStates,o=e.length,s=o===a.length;if(s){for(var l=0;l0,p);var v=this._textContent,m=this._textGuide;v&&v.useStates(e,t,h),m&&m.useStates(e,t,h),this._updateAnimationTargets(),this.currentStates=e.slice(),this.markRedraw(),!h&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~On)}},r.prototype.isSilent=function(){for(var e=this.silent,t=this.parent;!e&&t;){if(t.silent){e=!0;break}t=t.parent}return e},r.prototype._updateAnimationTargets=function(){for(var e=0;e=0){var n=this.currentStates.slice();n.splice(t,1),this.useStates(n)}},r.prototype.replaceState=function(e,t,n){var i=this.currentStates.slice(),a=He(i,e),o=He(i,t)>=0;a>=0?o?i.splice(a,1):i[a]=t:n&&!o&&i.push(t),this.useStates(i)},r.prototype.toggleState=function(e,t){t?this.useState(e,!0):this.removeState(e)},r.prototype._mergeStates=function(e){for(var t={},n,i=0;i=0&&a.splice(o,1)}),this.animators.push(e),n&&n.animation.addAnimator(e),n&&n.wakeUp()},r.prototype.updateDuringAnimation=function(e){this.markRedraw()},r.prototype.stopAnimation=function(e,t){for(var n=this.animators,i=n.length,a=[],o=0;o0&&t.during&&a[0].during(function(p,v){t.during(v)});for(var h=0;h0||i.force&&!o.length){var T=void 0,C=void 0,A=void 0;if(s){C={},h&&(T={});for(var _=0;_=0&&(i.splice(a,0,t),this._doAdd(t))}return this},e.prototype.replace=function(t,n){var i=He(this._children,t);return i>=0&&this.replaceAt(n,i),this},e.prototype.replaceAt=function(t,n){var i=this._children,a=i[n];if(t&&t!==this&&t.parent!==this&&t!==a){i[n]=t,a.parent=null;var o=this.__zr;o&&a.removeSelfFromZr(o),this._doAdd(t)}return this},e.prototype._doAdd=function(t){t.parent&&t.parent.remove(t),t.parent=this;var n=this.__zr;n&&n!==t.__zr&&t.addSelfToZr(n),n&&n.refresh()},e.prototype.remove=function(t){var n=this.__zr,i=this._children,a=He(i,t);return a<0?this:(i.splice(a,1),t.parent=null,n&&t.removeSelfFromZr(n),n&&n.refresh(),this)},e.prototype.removeAll=function(){for(var t=this._children,n=this.__zr,i=0;i0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},r.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},r.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},r.prototype.refreshHover=function(){this._needsRefreshHover=!0},r.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover())},r.prototype.resize=function(e){this._disposed||(e=e||{},this.painter.resize(e.width,e.height),this.handler.resize())},r.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},r.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},r.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},r.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},r.prototype.findHover=function(e,t){if(!this._disposed)return this.handler.findHover(e,t)},r.prototype.on=function(e,t,n){return this._disposed||this.handler.on(e,t,n),this},r.prototype.off=function(e,t){this._disposed||this.handler.off(e,t)},r.prototype.trigger=function(e,t){this._disposed||this.handler.trigger(e,t)},r.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),t=0;t0){if(r<=i)return o;if(r>=a)return s}else{if(r>=i)return o;if(r<=a)return s}else{if(r===i)return o;if(r===a)return s}return(r-i)/l*u+o}function ie(r,e){switch(r){case"center":case"middle":r="50%";break;case"left":case"top":r="0%";break;case"right":case"bottom":r="100%";break}return se(r)?jse(r).match(/%$/)?parseFloat(r)/100*e:parseFloat(r):r==null?NaN:+r}function Xt(r,e,t){return e==null&&(e=10),e=Math.min(Math.max(0,e),tz),r=(+r).toFixed(e),t?r:+r}function ci(r){return r.sort(function(e,t){return e-t}),r}function pa(r){if(r=+r,isNaN(r))return 0;if(r>1e-14){for(var e=1,t=0;t<15;t++,e*=10)if(Math.round(r*e)/e===r)return t}return Nse(r)}function Nse(r){var e=r.toString().toLowerCase(),t=e.indexOf("e"),n=t>0?+e.slice(t+1):0,i=t>0?t:e.length,a=e.indexOf("."),o=a<0?0:i-1-a;return Math.max(0,o-n)}function rz(r,e){var t=Math.log,n=Math.LN10,i=Math.floor(t(r[1]-r[0])/n),a=Math.round(t(Math.abs(e[1]-e[0]))/n),o=Math.min(Math.max(-i+a,0),20);return isFinite(o)?o:20}function Bse(r,e){var t=Ea(r,function(d,p){return d+(isNaN(p)?0:p)},0);if(t===0)return[];for(var n=Math.pow(10,e),i=K(r,function(d){return(isNaN(d)?0:d)/t*n*100}),a=n*100,o=K(i,function(d){return Math.floor(d)}),s=Ea(o,function(d,p){return d+p},0),l=K(i,function(d,p){return d-o[p]});su&&(u=l[f],c=f);++o[c],l[c]=0,++s}return K(o,function(d){return d/n})}function zse(r,e){var t=Math.max(pa(r),pa(e)),n=r+e;return t>tz?n:Xt(n,t)}var NE=9007199254740991;function nz(r){var e=Math.PI*2;return(r%e+e)%e}function Fd(r){return r>-jE&&r=10&&e++,e}function iz(r,e){var t=gC(r),n=Math.pow(10,t),i=r/n,a;return i<1.5?a=1:i<2.5?a=2:i<4?a=3:i<7?a=5:a=10,r=a*n,t>=-20?+r.toFixed(t<0?-t:0):r}function Rb(r,e){var t=(r.length-1)*e+1,n=Math.floor(t),i=+r[n-1],a=t-n;return a?i+a*(r[n]-i):i}function BE(r){r.sort(function(l,u){return s(l,u,0)?-1:1});for(var e=-1/0,t=1,n=0;n=0||a&&He(a,l)<0)){var u=n.getShallow(l,e);u!=null&&(o[r[s][0]]=u)}}return o}}var fle=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],hle=mu(fle),dle=function(){function r(){}return r.prototype.getAreaStyle=function(e,t){return hle(this,e,t)},r}(),p2=new _p(50);function ple(r){if(typeof r=="string"){var e=p2.get(r);return e&&e.image}else return r}function xC(r,e,t,n,i){if(r)if(typeof r=="string"){if(e&&e.__zrImageSrc===r||!t)return e;var a=p2.get(r),o={hostEl:t,cb:n,cbPayload:i};return a?(e=a.image,!F0(e)&&a.pending.push(o)):(e=ks.loadImage(r,$E,$E),e.__zrImageSrc=r,p2.put(r,e.__cachedImgObj={image:e,pending:[o]})),e}else return r;else return e}function $E(){var r=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e=o;l++)s-=o;var u=Vn(t,e);return u>s&&(t="",u=0),s=r-u,i.ellipsis=t,i.ellipsisWidth=u,i.contentWidth=s,i.containerWidth=r,i}function mz(r,e,t){var n=t.containerWidth,i=t.font,a=t.contentWidth;if(!n){r.textLine="",r.isTruncated=!1;return}var o=Vn(e,i);if(o<=n){r.textLine=e,r.isTruncated=!1;return}for(var s=0;;s++){if(o<=a||s>=t.maxIterations){e+=t.ellipsis;break}var l=s===0?mle(e,a,t.ascCharWidth,t.cnCharWidth):o>0?Math.floor(e.length*a/o):0;e=e.substr(0,l),o=Vn(e,i)}e===""&&(e=t.placeholder),r.textLine=e,r.isTruncated=!0}function mle(r,e,t,n){for(var i=0,a=0,o=r.length;ap&&u){var v=Math.floor(p/s);c=c||h.length>v,h=h.slice(0,v)}if(r&&a&&f!=null)for(var m=vz(f,i,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),g={},y=0;ys&&jb(t,r.substring(s,u),e,o),jb(t,l[2],e,o,l[1]),s=Ob.lastIndex}si){var E=t.lines.length;w>0?(b.tokens=b.tokens.slice(0,w),g(b,x,_),t.lines=t.lines.slice(0,y+1)):t.lines=t.lines.slice(0,y),t.isTruncated=t.isTruncated||t.lines.length0&&p+n.accumWidth>n.width&&(c=e.split(` `),u=!0),n.accumWidth=p}else{var v=gz(e,l,n.width,n.breakAll,n.accumWidth);n.accumWidth=v.accumWidth+d,f=v.linesWidths,c=v.lines}}else c=e.split(` `);for(var m=0;m=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}var wle=Ea(",&?/;] ".split(""),function(r,e){return r[e]=!0,r},{});function Sle(r){return xle(r)?!!wle[r]:!0}function gz(r,e,t,n,i){for(var a=[],o=[],s="",l="",u=0,c=0,f=0;ft:i+c+d>t){c?(s||l)&&(p?(s||(s=l,l="",u=0,c=u),a.push(s),o.push(c-u),l+=h,u+=d,s="",c=u):(l&&(s+=l,l="",u=0),a.push(s),o.push(c),s=h,c=d)):p?(a.push(l),o.push(u),l=h,u=d):(a.push(h),o.push(d));continue}c+=d,p?(l+=h,u+=d):(l&&(s+=l,l="",u=0),s+=h)}return!a.length&&!s&&(s=r,l="",u=0),l&&(s+=l),s&&(a.push(s),o.push(c)),a.length===1&&(c+=i),{accumWidth:c,lines:a,linesWidths:o}}var v2="__zr_style_"+Math.round(Math.random()*10),eu={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},V0={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};eu[v2]=!0;var GE=["z","z2","invisible"],Tle=["invisible"],mi=function(r){z(e,r);function e(t){return r.call(this,t)||this}return e.prototype._init=function(t){for(var n=et(t),i=0;i1e-4){s[0]=r-t,s[1]=e-n,l[0]=r+t,l[1]=e+n;return}if(Cv[0]=Fb(i)*t+r,Cv[1]=zb(i)*n+e,Av[0]=Fb(a)*t+r,Av[1]=zb(a)*n+e,u(s,Cv,Av),c(l,Cv,Av),i=i%Js,i<0&&(i=i+Js),a=a%Js,a<0&&(a=a+Js),i>a&&!o?a+=Js:ii&&(Mv[0]=Fb(d)*t+r,Mv[1]=zb(d)*n+e,u(s,Mv,s),c(l,Mv,l))}var Tt={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Qs=[],el=[],Yi=[],No=[],qi=[],Xi=[],Vb=Math.min,$b=Math.max,tl=Math.cos,rl=Math.sin,Ya=Math.abs,m2=Math.PI,Yo=m2*2,Hb=typeof Float32Array<"u",Kf=[];function Gb(r){var e=Math.round(r/m2*1e8)/1e8;return e%2*m2}function wC(r,e){var t=Gb(r[0]);t<0&&(t+=Yo);var n=t-r[0],i=r[1];i+=n,!e&&i-t>=Yo?i=t+Yo:e&&t-i>=Yo?i=t-Yo:!e&&t>i?i=t+(Yo-Gb(t-i)):e&&t0&&(this._ux=Ya(n/py/e)||0,this._uy=Ya(n/py/t)||0)},r.prototype.setDPR=function(e){this.dpr=e},r.prototype.setContext=function(e){this._ctx=e},r.prototype.getContext=function(){return this._ctx},r.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},r.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},r.prototype.moveTo=function(e,t){return this._drawPendingPt(),this.addData(Tt.M,e,t),this._ctx&&this._ctx.moveTo(e,t),this._x0=e,this._y0=t,this._xi=e,this._yi=t,this},r.prototype.lineTo=function(e,t){var n=Ya(e-this._xi),i=Ya(t-this._yi),a=n>this._ux||i>this._uy;if(this.addData(Tt.L,e,t),this._ctx&&a&&this._ctx.lineTo(e,t),a)this._xi=e,this._yi=t,this._pendingPtDist=0;else{var o=n*n+i*i;o>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=t,this._pendingPtDist=o)}return this},r.prototype.bezierCurveTo=function(e,t,n,i,a,o){return this._drawPendingPt(),this.addData(Tt.C,e,t,n,i,a,o),this._ctx&&this._ctx.bezierCurveTo(e,t,n,i,a,o),this._xi=a,this._yi=o,this},r.prototype.quadraticCurveTo=function(e,t,n,i){return this._drawPendingPt(),this.addData(Tt.Q,e,t,n,i),this._ctx&&this._ctx.quadraticCurveTo(e,t,n,i),this._xi=n,this._yi=i,this},r.prototype.arc=function(e,t,n,i,a,o){this._drawPendingPt(),Kf[0]=i,Kf[1]=a,wC(Kf,o),i=Kf[0],a=Kf[1];var s=a-i;return this.addData(Tt.A,e,t,n,n,i,s,0,o?0:1),this._ctx&&this._ctx.arc(e,t,n,i,a,o),this._xi=tl(a)*n+e,this._yi=rl(a)*n+t,this},r.prototype.arcTo=function(e,t,n,i,a){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,t,n,i,a),this},r.prototype.rect=function(e,t,n,i){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,t,n,i),this.addData(Tt.R,e,t,n,i),this},r.prototype.closePath=function(){this._drawPendingPt(),this.addData(Tt.Z);var e=this._ctx,t=this._x0,n=this._y0;return e&&e.closePath(),this._xi=t,this._yi=n,this},r.prototype.fill=function(e){e&&e.fill(),this.toStatic()},r.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},r.prototype.len=function(){return this._len},r.prototype.setData=function(e){var t=e.length;!(this.data&&this.data.length===t)&&Hb&&(this.data=new Float32Array(t));for(var n=0;nc.length&&(this._expandData(),c=this.data);for(var f=0;f0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},r.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],t=0;t11&&(this.data=new Float32Array(e)))}},r.prototype.getBoundingRect=function(){Yi[0]=Yi[1]=qi[0]=qi[1]=Number.MAX_VALUE,No[0]=No[1]=Xi[0]=Xi[1]=-Number.MAX_VALUE;var e=this.data,t=0,n=0,i=0,a=0,o;for(o=0;on||Ya(b)>i||h===t-1)&&(v=Math.sqrt(y*y+b*b),a=m,o=g);break}case Tt.C:{var _=e[h++],x=e[h++],m=e[h++],g=e[h++],w=e[h++],S=e[h++];v=qoe(a,o,_,x,m,g,w,S,10),a=w,o=S;break}case Tt.Q:{var _=e[h++],x=e[h++],m=e[h++],g=e[h++];v=Koe(a,o,_,x,m,g,10),a=m,o=g;break}case Tt.A:var T=e[h++],C=e[h++],A=e[h++],M=e[h++],D=e[h++],E=e[h++],L=E+D;h+=1,p&&(s=tl(D)*A+T,l=rl(D)*M+C),v=$b(A,M)*Vb(Yo,Math.abs(E)),a=tl(L)*A+T,o=rl(L)*M+C;break;case Tt.R:{s=a=e[h++],l=o=e[h++];var I=e[h++],R=e[h++];v=I*2+R*2;break}case Tt.Z:{var y=s-a,b=l-o;v=Math.sqrt(y*y+b*b),a=s,o=l;break}}v>=0&&(u[f++]=v,c+=v)}return this._pathLen=c,c},r.prototype.rebuildPath=function(e,t){var n=this.data,i=this._ux,a=this._uy,o=this._len,s,l,u,c,f,h,d=t<1,p,v,m=0,g=0,y,b=0,_,x;if(!(d&&(this._pathSegLen||this._calculateLength(),p=this._pathSegLen,v=this._pathLen,y=t*v,!y)))e:for(var w=0;w0&&(e.lineTo(_,x),b=0),S){case Tt.M:s=u=n[w++],l=c=n[w++],e.moveTo(u,c);break;case Tt.L:{f=n[w++],h=n[w++];var C=Ya(f-u),A=Ya(h-c);if(C>i||A>a){if(d){var M=p[g++];if(m+M>y){var D=(y-m)/M;e.lineTo(u*(1-D)+f*D,c*(1-D)+h*D);break e}m+=M}e.lineTo(f,h),u=f,c=h,b=0}else{var E=C*C+A*A;E>b&&(_=f,x=h,b=E)}break}case Tt.C:{var L=n[w++],I=n[w++],R=n[w++],P=n[w++],O=n[w++],j=n[w++];if(d){var M=p[g++];if(m+M>y){var D=(y-m)/M;Ds(u,L,R,O,D,Qs),Ds(c,I,P,j,D,el),e.bezierCurveTo(Qs[1],el[1],Qs[2],el[2],Qs[3],el[3]);break e}m+=M}e.bezierCurveTo(L,I,R,P,O,j),u=O,c=j;break}case Tt.Q:{var L=n[w++],I=n[w++],R=n[w++],P=n[w++];if(d){var M=p[g++];if(m+M>y){var D=(y-m)/M;Nd(u,L,R,D,Qs),Nd(c,I,P,D,el),e.quadraticCurveTo(Qs[1],el[1],Qs[2],el[2]);break e}m+=M}e.quadraticCurveTo(L,I,R,P),u=R,c=P;break}case Tt.A:var F=n[w++],N=n[w++],B=n[w++],$=n[w++],J=n[w++],U=n[w++],we=n[w++],Ye=!n[w++],ge=B>$?B:$,le=Ya(B-$)>.001,be=J+U,re=!1;if(d){var M=p[g++];m+M>y&&(be=J+U*(y-m)/M,re=!0),m+=M}if(le&&e.ellipse?e.ellipse(F,N,B,$,we,J,be,Ye):e.arc(F,N,ge,J,be,Ye),re)break e;T&&(s=tl(J)*B+F,l=rl(J)*$+N),u=tl(be)*B+F,c=rl(be)*$+N;break;case Tt.R:s=u=n[w],l=c=n[w+1],f=n[w++],h=n[w++];var G=n[w++],ee=n[w++];if(d){var M=p[g++];if(m+M>y){var Q=y-m;e.moveTo(f,h),e.lineTo(f+Vb(Q,G),h),Q-=G,Q>0&&e.lineTo(f+G,h+Vb(Q,ee)),Q-=ee,Q>0&&e.lineTo(f+$b(G-Q,0),h+ee),Q-=G,Q>0&&e.lineTo(f,h+$b(ee-Q,0));break e}m+=M}e.rect(f,h,G,ee);break;case Tt.Z:if(d){var M=p[g++];if(m+M>y){var D=(y-m)/M;e.lineTo(u*(1-D)+s*D,c*(1-D)+l*D);break e}m+=M}e.closePath(),u=s,c=l}}},r.prototype.clone=function(){var e=new r,t=this.data;return e.data=t.slice?t.slice():Array.prototype.slice.call(t),e._len=this._len,e},r.CMD=Tt,r.initDefaultProps=function(){var e=r.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0}(),r}();function Jo(r,e,t,n,i,a,o){if(i===0)return!1;var s=i,l=0,u=r;if(o>e+s&&o>n+s||or+s&&a>t+s||ae+f&&c>n+f&&c>a+f&&c>s+f||cr+f&&u>t+f&&u>i+f&&u>o+f||ue+u&&l>n+u&&l>a+u||lr+u&&s>t+u&&s>i+u||st||c+ui&&(i+=Zf);var h=Math.atan2(l,s);return h<0&&(h+=Zf),h>=n&&h<=i||h+Zf>=n&&h+Zf<=i}function eo(r,e,t,n,i,a){if(a>e&&a>n||ai?s:0}var Bo=Ra.CMD,nl=Math.PI*2,Lle=1e-4;function Ile(r,e){return Math.abs(r-e)e&&u>n&&u>a&&u>s||u1&&Ple(),d=_r(e,n,a,s,Qn[0]),h>1&&(p=_r(e,n,a,s,Qn[1]))),h===2?me&&s>n&&s>a||s=0&&u<=1){for(var c=0,f=Ar(e,n,a,u),h=0;ht||s<-t)return 0;var l=Math.sqrt(t*t-s*s);sn[0]=-l,sn[1]=l;var u=Math.abs(n-i);if(u<1e-4)return 0;if(u>=nl-1e-4){n=0,i=nl;var c=a?1:-1;return o>=sn[0]+r&&o<=sn[1]+r?c:0}if(n>i){var f=n;n=i,i=f}n<0&&(n+=nl,i+=nl);for(var h=0,d=0;d<2;d++){var p=sn[d];if(p+r>o){var v=Math.atan2(s,p),c=a?1:-1;v<0&&(v=nl+v),(v>=n&&v<=i||v+nl>=n&&v+nl<=i)&&(v>Math.PI/2&&v1&&(t||(s+=eo(l,u,c,f,n,i))),m&&(l=a[p],u=a[p+1],c=l,f=u),v){case Bo.M:c=a[p++],f=a[p++],l=c,u=f;break;case Bo.L:if(t){if(Jo(l,u,a[p],a[p+1],e,n,i))return!0}else s+=eo(l,u,a[p],a[p+1],n,i)||0;l=a[p++],u=a[p++];break;case Bo.C:if(t){if(Dle(l,u,a[p++],a[p++],a[p++],a[p++],a[p],a[p+1],e,n,i))return!0}else s+=Rle(l,u,a[p++],a[p++],a[p++],a[p++],a[p],a[p+1],n,i)||0;l=a[p++],u=a[p++];break;case Bo.Q:if(t){if(yz(l,u,a[p++],a[p++],a[p],a[p+1],e,n,i))return!0}else s+=Ole(l,u,a[p++],a[p++],a[p],a[p+1],n,i)||0;l=a[p++],u=a[p++];break;case Bo.A:var g=a[p++],y=a[p++],b=a[p++],_=a[p++],x=a[p++],w=a[p++];p+=1;var S=!!(1-a[p++]);h=Math.cos(x)*b+g,d=Math.sin(x)*_+y,m?(c=h,f=d):s+=eo(l,u,h,d,n,i);var T=(n-g)*_/b+g;if(t){if(Ele(g,y,_,x,x+w,S,e,T,i))return!0}else s+=jle(g,y,_,x,x+w,S,T,i);l=Math.cos(x+w)*b+g,u=Math.sin(x+w)*_+y;break;case Bo.R:c=l=a[p++],f=u=a[p++];var C=a[p++],A=a[p++];if(h=c+C,d=f+A,t){if(Jo(c,f,h,f,e,n,i)||Jo(h,f,h,d,e,n,i)||Jo(h,d,c,d,e,n,i)||Jo(c,d,c,f,e,n,i))return!0}else s+=eo(h,f,h,d,n,i),s+=eo(c,d,c,f,n,i);break;case Bo.Z:if(t){if(Jo(l,u,c,f,e,n,i))return!0}else s+=eo(l,u,c,f,n,i);l=c,u=f;break}}return!t&&!Ile(u,f)&&(s+=eo(l,u,c,f,n,i)||0),s!==0}function Nle(r,e,t){return bz(r,0,!1,e,t)}function Ble(r,e,t,n){return bz(r,e,!0,t,n)}var my=Ce({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},eu),zle={style:Ce({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},V0.style)},Wb=Ia.concat(["invisible","culling","z","z2","zlevel","parent"]),Xe=function(r){z(e,r);function e(t){return r.call(this,t)||this}return e.prototype.update=function(){var t=this;r.prototype.update.call(this);var n=this.style;if(n.decal){var i=this._decalEl=this._decalEl||new e;i.buildPath===e.prototype.buildPath&&(i.buildPath=function(l){t.buildPath(l,t.shape)}),i.silent=!0;var a=i.style;for(var o in n)a[o]!==n[o]&&(a[o]=n[o]);a.fill=n.fill?n.decal:null,a.decal=null,a.shadowColor=null,n.strokeFirst&&(a.stroke=null);for(var s=0;s.5?c2:n>.2?Sse:f2}else if(t)return f2}return c2},e.prototype.getInsideTextStroke=function(t){var n=this.style.fill;if(se(n)){var i=this.__zr,a=!!(i&&i.isDarkMode()),o=hy(t,0)0))},e.prototype.hasFill=function(){var t=this.style,n=t.fill;return n!=null&&n!=="none"},e.prototype.getBoundingRect=function(){var t=this._rect,n=this.style,i=!t;if(i){var a=!1;this.path||(a=!0,this.createPathProxy());var o=this.path;(a||this.__dirty&xc)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),t=o.getBoundingRect()}if(this._rect=t,this.hasStroke()&&this.path&&this.path.len()>0){var s=this._rectStroke||(this._rectStroke=t.clone());if(this.__dirty||i){s.copy(t);var l=n.strokeNoScale?this.getLineScale():1,u=n.lineWidth;if(!this.hasFill()){var c=this.strokeContainThreshold;u=Math.max(u,c??4)}l>1e-10&&(s.width+=u/l,s.height+=u/l,s.x-=u/l/2,s.y-=u/l/2)}return s}return t},e.prototype.contain=function(t,n){var i=this.transformCoordToLocal(t,n),a=this.getBoundingRect(),o=this.style;if(t=i[0],n=i[1],a.contain(t,n)){var s=this.path;if(this.hasStroke()){var l=o.lineWidth,u=o.strokeNoScale?this.getLineScale():1;if(u>1e-10&&(this.hasFill()||(l=Math.max(l,this.strokeContainThreshold)),Ble(s,l/u,t,n)))return!0}if(this.hasFill())return Nle(s,t,n)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=xc,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(t){return this.animate("shape",t)},e.prototype.updateDuringAnimation=function(t){t==="style"?this.dirtyStyle():t==="shape"?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(t,n){t==="shape"?this.setShape(n):r.prototype.attrKV.call(this,t,n)},e.prototype.setShape=function(t,n){var i=this.shape;return i||(i=this.shape={}),typeof t=="string"?i[t]=n:W(i,t),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(this.__dirty&xc)},e.prototype.createStyle=function(t){return R0(my,t)},e.prototype._innerSaveToNormal=function(t){r.prototype._innerSaveToNormal.call(this,t);var n=this._normalState;t.shape&&!n.shape&&(n.shape=W({},this.shape))},e.prototype._applyStateObj=function(t,n,i,a,o,s){r.prototype._applyStateObj.call(this,t,n,i,a,o,s);var l=!(n&&a),u;if(n&&n.shape?o?a?u=n.shape:(u=W({},i.shape),W(u,n.shape)):(u=W({},a?this.shape:i.shape),W(u,n.shape)):l&&(u=i.shape),u)if(o){this.shape=W({},this.shape);for(var c={},f=et(u),h=0;h0},e.prototype.hasFill=function(){var t=this.style,n=t.fill;return n!=null&&n!=="none"},e.prototype.createStyle=function(t){return R0(Fle,t)},e.prototype.setBoundingRect=function(t){this._rect=t},e.prototype.getBoundingRect=function(){var t=this.style;if(!this._rect){var n=t.text;n!=null?n+="":n="";var i=xp(n,t.font,t.textAlign,t.textBaseline);if(i.x+=t.x||0,i.y+=t.y||0,this.hasStroke()){var a=t.lineWidth;i.x-=a/2,i.y-=a/2,i.width+=a,i.height+=a}this._rect=i}return this._rect},e.initDefaultProps=function(){var t=e.prototype;t.dirtyRectTolerance=10}(),e}(mi);Qc.prototype.type="tspan";var Vle=Ce({x:0,y:0},eu),$le={style:Ce({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},V0.style)};function Hle(r){return!!(r&&typeof r!="string"&&r.width&&r.height)}var Lr=function(r){z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.createStyle=function(t){return R0(Vle,t)},e.prototype._getSize=function(t){var n=this.style,i=n[t];if(i!=null)return i;var a=Hle(n.image)?n.image:this.__image;if(!a)return 0;var o=t==="width"?"height":"width",s=n[o];return s==null?a[t]:a[t]/a[o]*s},e.prototype.getWidth=function(){return this._getSize("width")},e.prototype.getHeight=function(){return this._getSize("height")},e.prototype.getAnimationStyleProps=function(){return $le},e.prototype.getBoundingRect=function(){var t=this.style;return this._rect||(this._rect=new Ve(t.x||0,t.y||0,this.getWidth(),this.getHeight())),this._rect},e}(mi);Lr.prototype.type="image";function Gle(r,e){var t=e.x,n=e.y,i=e.width,a=e.height,o=e.r,s,l,u,c;i<0&&(t=t+i,i=-i),a<0&&(n=n+a,a=-a),typeof o=="number"?s=l=u=c=o:o instanceof Array?o.length===1?s=l=u=c=o[0]:o.length===2?(s=u=o[0],l=c=o[1]):o.length===3?(s=o[0],l=c=o[1],u=o[2]):(s=o[0],l=o[1],u=o[2],c=o[3]):s=l=u=c=0;var f;s+l>i&&(f=s+l,s*=i/f,l*=i/f),u+c>i&&(f=u+c,u*=i/f,c*=i/f),l+u>a&&(f=l+u,l*=a/f,u*=a/f),s+c>a&&(f=s+c,s*=a/f,c*=a/f),r.moveTo(t+s,n),r.lineTo(t+i-l,n),l!==0&&r.arc(t+i-l,n+l,l,-Math.PI/2,0),r.lineTo(t+i,n+a-u),u!==0&&r.arc(t+i-u,n+a-u,u,0,Math.PI/2),r.lineTo(t+c,n+a),c!==0&&r.arc(t+c,n+a-c,c,Math.PI/2,Math.PI),r.lineTo(t,n+s),s!==0&&r.arc(t+s,n+s,s,Math.PI,Math.PI*1.5)}var Dc=Math.round;function _z(r,e,t){if(e){var n=e.x1,i=e.x2,a=e.y1,o=e.y2;r.x1=n,r.x2=i,r.y1=a,r.y2=o;var s=t&&t.lineWidth;return s&&(Dc(n*2)===Dc(i*2)&&(r.x1=r.x2=Il(n,s,!0)),Dc(a*2)===Dc(o*2)&&(r.y1=r.y2=Il(a,s,!0))),r}}function xz(r,e,t){if(e){var n=e.x,i=e.y,a=e.width,o=e.height;r.x=n,r.y=i,r.width=a,r.height=o;var s=t&&t.lineWidth;return s&&(r.x=Il(n,s,!0),r.y=Il(i,s,!0),r.width=Math.max(Il(n+a,s,!1)-r.x,a===0?0:1),r.height=Math.max(Il(i+o,s,!1)-r.y,o===0?0:1)),r}}function Il(r,e,t){if(!e)return r;var n=Dc(r*2);return(n+Dc(e))%2===0?n/2:(n+(t?1:-1))/2}var Wle=function(){function r(){this.x=0,this.y=0,this.width=0,this.height=0}return r}(),Ule={},nt=function(r){z(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new Wle},e.prototype.buildPath=function(t,n){var i,a,o,s;if(this.subPixelOptimize){var l=xz(Ule,n,this.style);i=l.x,a=l.y,o=l.width,s=l.height,l.r=n.r,n=l}else i=n.x,a=n.y,o=n.width,s=n.height;n.r?Gle(t,n):t.rect(i,a,o,s)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(Xe);nt.prototype.type="rect";var XE={fill:"#000"},KE=2,Yle={style:Ce({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},V0.style)},ot=function(r){z(e,r);function e(t){var n=r.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=XE,n.attr(t),n}return e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){r.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var t=0;t0,D=t.width!=null&&(t.overflow==="truncate"||t.overflow==="break"||t.overflow==="breakAll"),E=o.calculatedLineHeight,L=0;L=0&&(L=w[E],L.align==="right");)this._placeToken(L,t,T,g,D,"right",b),C-=L.width,D-=L.width,E--;for(M+=(a-(M-m)-(y-D)-C)/2;A<=E;)L=w[A],this._placeToken(L,t,T,g,M+L.width/2,"center",b),M+=L.width,A++;g+=T}},e.prototype._placeToken=function(t,n,i,a,o,s,l){var u=n.rich[t.styleName]||{};u.text=t.text;var c=t.verticalAlign,f=a+i/2;c==="top"?f=a+t.height/2:c==="bottom"&&(f=a+i-t.height/2);var h=!t.isLineHolder&&Ub(u);h&&this._renderBackground(u,n,s==="right"?o-t.width:s==="center"?o-t.width/2:o,f-t.height/2,t.width,t.height);var d=!!u.backgroundColor,p=t.textPadding;p&&(o=rL(o,s,p),f-=t.height/2-p[0]-t.innerHeight/2);var v=this._getOrCreateChild(Qc),m=v.createStyle();v.useStyle(m);var g=this._defaultStyle,y=!1,b=0,_=tL("fill"in u?u.fill:"fill"in n?n.fill:(y=!0,g.fill)),x=eL("stroke"in u?u.stroke:"stroke"in n?n.stroke:!d&&!l&&(!g.autoStroke||y)?(b=KE,g.stroke):null),w=u.textShadowBlur>0||n.textShadowBlur>0;m.text=t.text,m.x=o,m.y=f,w&&(m.shadowBlur=u.textShadowBlur||n.textShadowBlur||0,m.shadowColor=u.textShadowColor||n.textShadowColor||"transparent",m.shadowOffsetX=u.textShadowOffsetX||n.textShadowOffsetX||0,m.shadowOffsetY=u.textShadowOffsetY||n.textShadowOffsetY||0),m.textAlign=s,m.textBaseline="middle",m.font=t.font||Ms,m.opacity=_a(u.opacity,n.opacity,1),JE(m,u),x&&(m.lineWidth=_a(u.lineWidth,n.lineWidth,b),m.lineDash=Re(u.lineDash,n.lineDash),m.lineDashOffset=n.lineDashOffset||0,m.stroke=x),_&&(m.fill=_);var S=t.contentWidth,T=t.contentHeight;v.setBoundingRect(new Ve(Mh(m.x,S,m.textAlign),wc(m.y,T,m.textBaseline),S,T))},e.prototype._renderBackground=function(t,n,i,a,o,s){var l=t.backgroundColor,u=t.borderWidth,c=t.borderColor,f=l&&l.image,h=l&&!f,d=t.borderRadius,p=this,v,m;if(h||t.lineHeight||u&&c){v=this._getOrCreateChild(nt),v.useStyle(v.createStyle()),v.style.fill=null;var g=v.shape;g.x=i,g.y=a,g.width=o,g.height=s,g.r=d,v.dirtyShape()}if(h){var y=v.style;y.fill=l||null,y.fillOpacity=Re(t.fillOpacity,1)}else if(f){m=this._getOrCreateChild(Lr),m.onload=function(){p.dirtyStyle()};var b=m.style;b.image=l.image,b.x=i,b.y=a,b.width=o,b.height=s}if(u&&c){var y=v.style;y.lineWidth=u,y.stroke=c,y.strokeOpacity=Re(t.strokeOpacity,1),y.lineDash=t.borderDash,y.lineDashOffset=t.borderDashOffset||0,v.strokeContainThreshold=0,v.hasFill()&&v.hasStroke()&&(y.strokeFirst=!0,y.lineWidth*=2)}var _=(v||m).style;_.shadowBlur=t.shadowBlur||0,_.shadowColor=t.shadowColor||"transparent",_.shadowOffsetX=t.shadowOffsetX||0,_.shadowOffsetY=t.shadowOffsetY||0,_.opacity=_a(t.opacity,n.opacity,1)},e.makeFont=function(t){var n="";return Sz(t)&&(n=[t.fontStyle,t.fontWeight,wz(t.fontSize),t.fontFamily||"sans-serif"].join(" ")),n&&Li(n)||t.textFont||t.font},e}(mi),qle={left:!0,right:1,center:1},Xle={top:1,bottom:1,middle:1},ZE=["fontStyle","fontWeight","fontSize","fontFamily"];function wz(r){return typeof r=="string"&&(r.indexOf("px")!==-1||r.indexOf("rem")!==-1||r.indexOf("em")!==-1)?r:isNaN(+r)?iC+"px":r+"px"}function JE(r,e){for(var t=0;t=0,a=!1;if(r instanceof Xe){var o=Tz(r),s=i&&o.selectFill||o.normalFill,l=i&&o.selectStroke||o.normalStroke;if(Zu(s)||Zu(l)){n=n||{};var u=n.style||{};u.fill==="inherit"?(a=!0,n=W({},n),u=W({},u),u.fill=s):!Zu(u.fill)&&Zu(s)?(a=!0,n=W({},n),u=W({},u),u.fill=r2(s)):!Zu(u.stroke)&&Zu(l)&&(a||(n=W({},n),u=W({},u)),u.stroke=r2(l)),n.style=u}}if(n&&n.z2==null){a||(n=W({},n));var c=r.z2EmphasisLift;n.z2=r.z2+(c??bf)}return n}function rue(r,e,t){if(t&&t.z2==null){t=W({},t);var n=r.z2SelectLift;t.z2=r.z2+(n??Zle)}return t}function nue(r,e,t){var n=He(r.currentStates,e)>=0,i=r.style.opacity,a=n?null:eue(r,["opacity"],e,{opacity:1});t=t||{};var o=t.style||{};return o.opacity==null&&(t=W({},t),o=W({opacity:n?i:a.opacity*.1},o),t.style=o),t}function Yb(r,e){var t=this.states[r];if(this.style){if(r==="emphasis")return tue(this,r,e,t);if(r==="blur")return nue(this,r,t);if(r==="select")return rue(this,r,t)}return t}function gu(r){r.stateProxy=Yb;var e=r.getTextContent(),t=r.getTextGuideLine();e&&(e.stateProxy=Yb),t&&(t.stateProxy=Yb)}function sL(r,e){!Lz(r,e)&&!r.__highByOuter&&Do(r,Cz)}function lL(r,e){!Lz(r,e)&&!r.__highByOuter&&Do(r,Az)}function wo(r,e){r.__highByOuter|=1<<(e||0),Do(r,Cz)}function So(r,e){!(r.__highByOuter&=~(1<<(e||0)))&&Do(r,Az)}function kz(r){Do(r,CC)}function AC(r){Do(r,Mz)}function Dz(r){Do(r,Jle)}function Ez(r){Do(r,Qle)}function Lz(r,e){return r.__highDownSilentOnTouch&&e.zrByTouch}function Iz(r){var e=r.getModel(),t=[],n=[];e.eachComponent(function(i,a){var o=SC(a),s=i==="series",l=s?r.getViewOfSeriesModel(a):r.getViewOfComponentModel(a);!s&&n.push(l),o.isBlured&&(l.group.traverse(function(u){Mz(u)}),s&&t.push(a)),o.isBlured=!1}),k(n,function(i){i&&i.toggleBlurSeries&&i.toggleBlurSeries(t,!1,e)})}function y2(r,e,t,n){var i=n.getModel();t=t||"coordinateSystem";function a(u,c){for(var f=0;f0){var s={dataIndex:o,seriesIndex:t.seriesIndex};a!=null&&(s.dataType=a),e.push(s)}})}),e}function ru(r,e,t){Pl(r,!0),Do(r,gu),_2(r,e,t)}function uue(r){Pl(r,!1)}function $t(r,e,t,n){n?uue(r):ru(r,e,t)}function _2(r,e,t){var n=Le(r);e!=null?(n.focus=e,n.blurScope=t):n.focus&&(n.focus=null)}var cL=["emphasis","blur","select"],cue={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Fr(r,e,t,n){t=t||"itemStyle";for(var i=0;i1&&(o*=qb(p),s*=qb(p));var v=(i===a?-1:1)*qb((o*o*(s*s)-o*o*(d*d)-s*s*(h*h))/(o*o*(d*d)+s*s*(h*h)))||0,m=v*o*d/s,g=v*-s*h/o,y=(r+t)/2+Dv(f)*m-kv(f)*g,b=(e+n)/2+kv(f)*m+Dv(f)*g,_=pL([1,0],[(h-m)/o,(d-g)/s]),x=[(h-m)/o,(d-g)/s],w=[(-1*h-m)/o,(-1*d-g)/s],S=pL(x,w);if(w2(x,w)<=-1&&(S=Jf),w2(x,w)>=1&&(S=0),S<0){var T=Math.round(S/Jf*1e6)/1e6;S=Jf*2+T%2*Jf}c.addData(u,y,b,o,s,_,S,f,a)}var mue=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,gue=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function yue(r){var e=new Ra;if(!r)return e;var t=0,n=0,i=t,a=n,o,s=Ra.CMD,l=r.match(mue);if(!l)return e;for(var u=0;uL*L+I*I&&(T=A,C=M),{cx:T,cy:C,x0:-c,y0:-f,x1:T*(i/x-1),y1:C*(i/x-1)}}function Cue(r){var e;if(q(r)){var t=r.length;if(!t)return r;t===1?e=[r[0],r[0],0,0]:t===2?e=[r[0],r[0],r[1],r[1]]:t===3?e=r.concat(r[2]):e=r}else e=[r,r,r,r];return e}function Aue(r,e){var t,n=kh(e.r,0),i=kh(e.r0||0,0),a=n>0,o=i>0;if(!(!a&&!o)){if(a||(n=i,i=0),i>n){var s=n;n=i,i=s}var l=e.startAngle,u=e.endAngle;if(!(isNaN(l)||isNaN(u))){var c=e.cx,f=e.cy,h=!!e.clockwise,d=mL(u-l),p=d>Xb&&d%Xb;if(p>wi&&(d=p),!(n>wi))r.moveTo(c,f);else if(d>Xb-wi)r.moveTo(c+n*Qu(l),f+n*il(l)),r.arc(c,f,n,l,u,!h),i>wi&&(r.moveTo(c+i*Qu(u),f+i*il(u)),r.arc(c,f,i,u,l,h));else{var v=void 0,m=void 0,g=void 0,y=void 0,b=void 0,_=void 0,x=void 0,w=void 0,S=void 0,T=void 0,C=void 0,A=void 0,M=void 0,D=void 0,E=void 0,L=void 0,I=n*Qu(l),R=n*il(l),P=i*Qu(u),O=i*il(u),j=d>wi;if(j){var F=e.cornerRadius;F&&(t=Cue(F),v=t[0],m=t[1],g=t[2],y=t[3]);var N=mL(n-i)/2;if(b=Ki(N,g),_=Ki(N,y),x=Ki(N,v),w=Ki(N,m),C=S=kh(b,_),A=T=kh(x,w),(S>wi||T>wi)&&(M=n*Qu(u),D=n*il(u),E=i*Qu(l),L=i*il(l),dwi){var le=Ki(g,C),be=Ki(y,C),re=Ev(E,L,I,R,n,le,h),G=Ev(M,D,P,O,n,be,h);r.moveTo(c+re.cx+re.x0,f+re.cy+re.y0),C0&&r.arc(c+re.cx,f+re.cy,le,Wr(re.y0,re.x0),Wr(re.y1,re.x1),!h),r.arc(c,f,n,Wr(re.cy+re.y1,re.cx+re.x1),Wr(G.cy+G.y1,G.cx+G.x1),!h),be>0&&r.arc(c+G.cx,f+G.cy,be,Wr(G.y1,G.x1),Wr(G.y0,G.x0),!h))}else r.moveTo(c+I,f+R),r.arc(c,f,n,l,u,!h);if(!(i>wi)||!j)r.lineTo(c+P,f+O);else if(A>wi){var le=Ki(v,A),be=Ki(m,A),re=Ev(P,O,M,D,i,-be,h),G=Ev(I,R,E,L,i,-le,h);r.lineTo(c+re.cx+re.x0,f+re.cy+re.y0),A0&&r.arc(c+re.cx,f+re.cy,be,Wr(re.y0,re.x0),Wr(re.y1,re.x1),!h),r.arc(c,f,i,Wr(re.cy+re.y1,re.cx+re.x1),Wr(G.cy+G.y1,G.cx+G.x1),h),le>0&&r.arc(c+G.cx,f+G.cy,le,Wr(G.y1,G.x1),Wr(G.y0,G.x0),!h))}else r.lineTo(c+P,f+O),r.arc(c,f,i,u,l,h)}r.closePath()}}}var Mue=function(){function r(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return r}(),gn=function(r){z(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new Mue},e.prototype.buildPath=function(t,n){Aue(t,n)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(Xe);gn.prototype.type="sector";var kue=function(){function r(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return r}(),Tp=function(r){z(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new kue},e.prototype.buildPath=function(t,n){var i=n.cx,a=n.cy,o=Math.PI*2;t.moveTo(i+n.r,a),t.arc(i,a,n.r,0,o,!1),t.moveTo(i+n.r0,a),t.arc(i,a,n.r0,0,o,!0)},e}(Xe);Tp.prototype.type="ring";function Due(r,e,t,n){var i=[],a=[],o=[],s=[],l,u,c,f;if(n){c=[1/0,1/0],f=[-1/0,-1/0];for(var h=0,d=r.length;h=2){if(n){var a=Due(i,n,t,e.smoothConstraint);r.moveTo(i[0][0],i[0][1]);for(var o=i.length,s=0;s<(t?o:o-1);s++){var l=a[s*2],u=a[s*2+1],c=i[(s+1)%o];r.bezierCurveTo(l[0],l[1],u[0],u[1],c[0],c[1])}}else{r.moveTo(i[0][0],i[0][1]);for(var s=1,f=i.length;sol[1]){if(s=!1,a)return s;var c=Math.abs(ol[0]-al[1]),f=Math.abs(al[0]-ol[1]);Math.min(c,f)>i.len()&&(c0){var f=c.duration,h=c.delay,d=c.easing,p={duration:f,delay:h||0,easing:d,done:a,force:!!a||!!o,setToFinal:!u,scope:r,during:o};s?e.animateFrom(t,p):e.animateTo(t,p)}else e.stopAnimation(),!s&&e.attr(t),o&&o(1),a&&a()}function ut(r,e,t,n,i,a){EC("update",r,e,t,n,i,a)}function Ot(r,e,t,n,i,a){EC("enter",r,e,t,n,i,a)}function Nc(r){if(!r.__zr)return!0;for(var e=0;eMath.abs(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function bL(r){return!r.isGroup}function Hue(r){return r.shape!=null}function Mp(r,e,t){if(!r||!e)return;function n(o){var s={};return o.traverse(function(l){bL(l)&&l.anid&&(s[l.anid]=l)}),s}function i(o){var s={x:o.x,y:o.y,rotation:o.rotation};return Hue(o)&&(s.shape=W({},o.shape)),s}var a=n(r);e.traverse(function(o){if(bL(o)&&o.anid){var s=a[o.anid];if(s){var l=i(o);o.attr(i(s)),ut(o,l,t,Le(o).dataIndex)}}})}function Uz(r,e){return K(r,function(t){var n=t[0];n=by(n,e.x),n=_y(n,e.x+e.width);var i=t[1];return i=by(i,e.y),i=_y(i,e.y+e.height),[n,i]})}function Gue(r,e){var t=by(r.x,e.x),n=_y(r.x+r.width,e.x+e.width),i=by(r.y,e.y),a=_y(r.y+r.height,e.y+e.height);if(n>=t&&a>=i)return{x:t,y:i,width:n-t,height:a-i}}function kp(r,e,t){var n=W({rectHover:!0},e),i=n.style={strokeNoScale:!0};if(t=t||{x:-1,y:-1,width:2,height:2},r)return r.indexOf("image://")===0?(i.image=r.slice(8),Ce(i,t),new Lr(n)):Y0(r.replace("path://",""),n,t,"center")}function Dh(r,e,t,n,i){for(var a=0,o=i[i.length-1];a1)return!1;var m=Kb(d,p,c,f)/h;return!(m<0||m>1)}function Kb(r,e,t,n){return r*n-t*e}function Wue(r){return r<=1e-6&&r>=-1e-6}function Lu(r){var e=r.itemTooltipOption,t=r.componentModel,n=r.itemName,i=se(e)?{formatter:e}:e,a=t.mainType,o=t.componentIndex,s={componentType:a,name:n,$vars:["name"]};s[a+"Index"]=o;var l=r.formatterParamsExtra;l&&k(et(l),function(c){fe(s,c)||(s[c]=l[c],s.$vars.push(c))});var u=Le(r.el);u.componentMainType=a,u.componentIndex=o,u.tooltipConfig={name:n,option:Ce({content:n,encodeHTMLContent:!0,formatterParams:s},i)}}function _L(r,e){var t;r.isGroup&&(t=e(r)),t||r.traverse(e)}function Vs(r,e){if(r)if(q(r))for(var t=0;t=0&&s.push(l)}),s}}function $s(r,e){return Be(Be({},r,!0),e,!0)}const nce={time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst",custom:"Custom chart",chart:"Chart"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}},ice={time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图",custom:"自定义图表",chart:"图表"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}};var wy="ZH",PC="EN",Bc=PC,Um={},RC={},Qz=Ze.domSupported?function(){var r=(document.documentElement.lang||navigator.language||navigator.browserLanguage||Bc).toUpperCase();return r.indexOf(wy)>-1?wy:Bc}():Bc;function e6(r,e){r=r.toUpperCase(),RC[r]=new _t(e),Um[r]=e}function ace(r){if(se(r)){var e=Um[r.toUpperCase()]||{};return r===wy||r===PC?ke(e):Be(ke(e),ke(Um[Bc]),!1)}else return Be(ke(r),ke(Um[Bc]),!1)}function C2(r){return RC[r]}function oce(){return RC[Bc]}e6(PC,nce);e6(wy,ice);var OC=1e3,jC=OC*60,fd=jC*60,li=fd*24,CL=li*365,Eh={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},Pv="{yyyy}-{MM}-{dd}",AL={year:"{yyyy}",month:"{yyyy}-{MM}",day:Pv,hour:Pv+" "+Eh.hour,minute:Pv+" "+Eh.minute,second:Pv+" "+Eh.second,millisecond:Eh.none},Qb=["year","month","day","hour","minute","second","millisecond"],t6=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function zo(r,e){return r+="","0000".substr(0,e-r.length)+r}function zc(r){switch(r){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return r}}function sce(r){return r===zc(r)}function lce(r){switch(r){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function K0(r,e,t,n){var i=Pa(r),a=i[NC(t)](),o=i[Fc(t)]()+1,s=Math.floor((o-1)/3)+1,l=i[Z0(t)](),u=i["get"+(t?"UTC":"")+"Day"](),c=i[Wd(t)](),f=(c-1)%12+1,h=i[J0(t)](),d=i[Q0(t)](),p=i[e1(t)](),v=c>=12?"pm":"am",m=v.toUpperCase(),g=n instanceof _t?n:C2(n||Qz)||oce(),y=g.getModel("time"),b=y.get("month"),_=y.get("monthAbbr"),x=y.get("dayOfWeek"),w=y.get("dayOfWeekAbbr");return(e||"").replace(/{a}/g,v+"").replace(/{A}/g,m+"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,zo(a%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,b[o-1]).replace(/{MMM}/g,_[o-1]).replace(/{MM}/g,zo(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,zo(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,x[u]).replace(/{ee}/g,w[u]).replace(/{e}/g,u+"").replace(/{HH}/g,zo(c,2)).replace(/{H}/g,c+"").replace(/{hh}/g,zo(f+"",2)).replace(/{h}/g,f+"").replace(/{mm}/g,zo(h,2)).replace(/{m}/g,h+"").replace(/{ss}/g,zo(d,2)).replace(/{s}/g,d+"").replace(/{SSS}/g,zo(p,3)).replace(/{S}/g,p+"")}function uce(r,e,t,n,i){var a=null;if(se(t))a=t;else if(Te(t))a=t(r.value,e,{level:r.level});else{var o=W({},Eh);if(r.level>0)for(var s=0;s=0;--s)if(l[u]){a=l[u];break}a=a||o.none}if(q(a)){var f=r.level==null?0:r.level>=0?r.level:a.length+r.level;f=Math.min(f,a.length-1),a=a[f]}}return K0(new Date(r.value),a,i,n)}function r6(r,e){var t=Pa(r),n=t[Fc(e)]()+1,i=t[Z0(e)](),a=t[Wd(e)](),o=t[J0(e)](),s=t[Q0(e)](),l=t[e1(e)](),u=l===0,c=u&&s===0,f=c&&o===0,h=f&&a===0,d=h&&i===1,p=d&&n===1;return p?"year":d?"month":h?"day":f?"hour":c?"minute":u?"second":"millisecond"}function ML(r,e,t){var n=lt(r)?Pa(r):r;switch(e=e||r6(r,t),e){case"year":return n[NC(t)]();case"half-year":return n[Fc(t)]()>=6?1:0;case"quarter":return Math.floor((n[Fc(t)]()+1)/4);case"month":return n[Fc(t)]();case"day":return n[Z0(t)]();case"half-day":return n[Wd(t)]()/24;case"hour":return n[Wd(t)]();case"minute":return n[J0(t)]();case"second":return n[Q0(t)]();case"millisecond":return n[e1(t)]()}}function NC(r){return r?"getUTCFullYear":"getFullYear"}function Fc(r){return r?"getUTCMonth":"getMonth"}function Z0(r){return r?"getUTCDate":"getDate"}function Wd(r){return r?"getUTCHours":"getHours"}function J0(r){return r?"getUTCMinutes":"getMinutes"}function Q0(r){return r?"getUTCSeconds":"getSeconds"}function e1(r){return r?"getUTCMilliseconds":"getMilliseconds"}function cce(r){return r?"setUTCFullYear":"setFullYear"}function n6(r){return r?"setUTCMonth":"setMonth"}function i6(r){return r?"setUTCDate":"setDate"}function a6(r){return r?"setUTCHours":"setHours"}function o6(r){return r?"setUTCMinutes":"setMinutes"}function s6(r){return r?"setUTCSeconds":"setSeconds"}function l6(r){return r?"setUTCMilliseconds":"setMilliseconds"}function u6(r){if(!az(r))return se(r)?r:"-";var e=(r+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function c6(r,e){return r=(r||"").toLowerCase().replace(/-(.)/g,function(t,n){return n.toUpperCase()}),e&&r&&(r=r.charAt(0).toUpperCase()+r.slice(1)),r}var Sf=cC;function A2(r,e,t){var n="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function i(c){return c&&Li(c)?c:"-"}function a(c){return!!(c!=null&&!isNaN(c)&&isFinite(c))}var o=e==="time",s=r instanceof Date;if(o||s){var l=o?Pa(r):r;if(isNaN(+l)){if(s)return"-"}else return K0(l,n,t)}if(e==="ordinal")return Gw(r)?i(r):lt(r)&&a(r)?r+"":"-";var u=xo(r);return a(u)?u6(u):Gw(r)?i(r):typeof r=="boolean"?r+"":"-"}var kL=["a","b","c","d","e","f","g"],e_=function(r,e){return"{"+r+(e??"")+"}"};function f6(r,e,t){q(e)||(e=[e]);var n=e.length;if(!n)return"";for(var i=e[0].$vars||[],a=0;a
    ':'';var o=t.markerId||"markerX";return{renderMode:a,content:"{"+o+"|} ",style:i==="subItem"?{width:4,height:4,borderRadius:2,backgroundColor:n}:{width:10,height:10,borderRadius:5,backgroundColor:n}}}function yu(r,e){return e=e||"transparent",se(r)?r:Me(r)&&r.colorStops&&(r.colorStops[0]||{}).color||e}function Sy(r,e){if(e==="_blank"||e==="blank"){var t=window.open();t.opener=null,t.location.href=r}else window.open(r,e)}var Ym=k,h6=["left","right","top","bottom","width","height"],Rl=[["width","left","right"],["height","top","bottom"]];function BC(r,e,t,n,i){var a=0,o=0;n==null&&(n=1/0),i==null&&(i=1/0);var s=0;e.eachChild(function(l,u){var c=l.getBoundingRect(),f=e.childAt(u+1),h=f&&f.getBoundingRect(),d,p;if(r==="horizontal"){var v=c.width+(h?-h.x+c.x:0);d=a+v,d>n||l.newline?(a=0,d=v,o+=s+t,s=c.height):s=Math.max(s,c.height)}else{var m=c.height+(h?-h.y+c.y:0);p=o+m,p>i||l.newline?(a+=s+t,o=0,p=m,s=c.width):s=Math.max(s,c.width)}l.newline||(l.x=a,l.y=o,l.markRedraw(),r==="horizontal"?a=d+t:o=p+t)})}var iu=BC;Oe(BC,"vertical");Oe(BC,"horizontal");function dce(r,e,t){var n=e.width,i=e.height,a=ie(r.left,n),o=ie(r.top,i),s=ie(r.right,n),l=ie(r.bottom,i);return(isNaN(a)||isNaN(parseFloat(r.left)))&&(a=0),(isNaN(s)||isNaN(parseFloat(r.right)))&&(s=n),(isNaN(o)||isNaN(parseFloat(r.top)))&&(o=0),(isNaN(l)||isNaN(parseFloat(r.bottom)))&&(l=i),t=Sf(t||0),{width:Math.max(s-a-t[1]-t[3],0),height:Math.max(l-o-t[0]-t[2],0)}}function gr(r,e,t){t=Sf(t||0);var n=e.width,i=e.height,a=ie(r.left,n),o=ie(r.top,i),s=ie(r.right,n),l=ie(r.bottom,i),u=ie(r.width,n),c=ie(r.height,i),f=t[2]+t[0],h=t[1]+t[3],d=r.aspect;switch(isNaN(u)&&(u=n-s-h-a),isNaN(c)&&(c=i-l-f-o),d!=null&&(isNaN(u)&&isNaN(c)&&(d>n/i?u=n*.8:c=i*.8),isNaN(u)&&(u=d*c),isNaN(c)&&(c=u/d)),isNaN(a)&&(a=n-s-u-h),isNaN(o)&&(o=i-l-c-f),r.left||r.right){case"center":a=n/2-u/2-t[3];break;case"right":a=n-u-h;break}switch(r.top||r.bottom){case"middle":case"center":o=i/2-c/2-t[0];break;case"bottom":o=i-c-f;break}a=a||0,o=o||0,isNaN(u)&&(u=n-h-a-(s||0)),isNaN(c)&&(c=i-f-o-(l||0));var p=new Ve(a+t[3],o+t[0],u,c);return p.margin=t,p}function t1(r,e,t,n,i,a){var o=!i||!i.hv||i.hv[0],s=!i||!i.hv||i.hv[1],l=i&&i.boundingMode||"all";if(a=a||r,a.x=r.x,a.y=r.y,!o&&!s)return!1;var u;if(l==="raw")u=r.type==="group"?new Ve(0,0,+e.width||0,+e.height||0):r.getBoundingRect();else if(u=r.getBoundingRect(),r.needLocalTransform()){var c=r.getLocalTransform();u=u.clone(),u.applyTransform(c)}var f=gr(Ce({width:u.width,height:u.height},e),t,n),h=o?f.x-u.x:0,d=s?f.y-u.y:0;return l==="raw"?(a.x=h,a.y=d):(a.x+=h,a.y+=d),a===r&&r.markRedraw(),!0}function pce(r,e){return r[Rl[e][0]]!=null||r[Rl[e][1]]!=null&&r[Rl[e][2]]!=null}function Ud(r){var e=r.layoutMode||r.constructor.layoutMode;return Me(e)?e:e?{type:e}:null}function Ls(r,e,t){var n=t&&t.ignoreSize;!q(n)&&(n=[n,n]);var i=o(Rl[0],0),a=o(Rl[1],1);u(Rl[0],r,i),u(Rl[1],r,a);function o(c,f){var h={},d=0,p={},v=0,m=2;if(Ym(c,function(b){p[b]=r[b]}),Ym(c,function(b){s(e,b)&&(h[b]=p[b]=e[b]),l(h,b)&&d++,l(p,b)&&v++}),n[f])return l(e,c[1])?p[c[2]]=null:l(e,c[2])&&(p[c[1]]=null),p;if(v===m||!d)return p;if(d>=m)return h;for(var g=0;g=0;l--)s=Be(s,i[l],!0);n.defaultOption=s}return n.defaultOption},e.prototype.getReferringComponents=function(t,n){var i=t+"Index",a=t+"Id";return wp(this.ecModel,t,{index:this.get(i,!0),id:this.get(a,!0)},n)},e.prototype.getBoxLayoutParams=function(){var t=this;return{left:t.get("left"),top:t.get("top"),right:t.get("right"),bottom:t.get("bottom"),width:t.get("width"),height:t.get("height")}},e.prototype.getZLevelKey=function(){return""},e.prototype.setZLevel=function(t){this.option.zlevel=t},e.protoInitialize=function(){var t=e.prototype;t.type="component",t.id="",t.name="",t.mainType="",t.subType="",t.componentIndex=0}(),e}(_t);pz(Qe,_t);z0(Qe);tce(Qe);rce(Qe,mce);function mce(r){var e=[];return k(Qe.getClassesByMainType(r),function(t){e=e.concat(t.dependencies||t.prototype.dependencies||[])}),e=K(e,function(t){return va(t).main}),r!=="dataset"&&He(e,"dataset")<=0&&e.unshift("dataset"),e}var p6="";typeof navigator<"u"&&(p6=navigator.platform||"");var ec="rgba(0, 0, 0, 0.2)";const gce={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:ec,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:ec,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:ec,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:ec,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:ec,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:ec,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:p6.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1};var v6=ve(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),yi="original",Jr="arrayRows",bi="objectRows",Ba="keyedColumns",bs="typedArray",m6="unknown",xa="column",Cf="row",Rr={Must:1,Might:2,Not:3},g6=it();function yce(r){g6(r).datasetMap=ve()}function y6(r,e,t){var n={},i=FC(e);if(!i||!r)return n;var a=[],o=[],s=e.ecModel,l=g6(s).datasetMap,u=i.uid+"_"+t.seriesLayoutBy,c,f;r=r.slice(),k(r,function(v,m){var g=Me(v)?v:r[m]={name:v};g.type==="ordinal"&&c==null&&(c=m,f=p(g)),n[g.name]=[]});var h=l.get(u)||l.set(u,{categoryWayDim:f,valueWayDim:0});k(r,function(v,m){var g=v.name,y=p(v);if(c==null){var b=h.valueWayDim;d(n[g],b,y),d(o,b,y),h.valueWayDim+=y}else if(c===m)d(n[g],0,y),d(a,0,y);else{var b=h.categoryWayDim;d(n[g],b,y),d(o,b,y),h.categoryWayDim+=y}});function d(v,m,g){for(var y=0;ye)return r[n];return r[t-1]}function x6(r,e,t,n,i,a,o){a=a||r;var s=e(a),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(i))return u[i];var c=o==null||!n?t:Sce(n,o);if(c=c||t,!(!c||!c.length)){var f=c[l];return i&&(u[i]=f),s.paletteIdx=(l+1)%c.length,f}}function Tce(r,e){e(r).paletteIdx=0,e(r).paletteNameMap={}}var Rv,Qf,EL,LL="\0_ec_inner",Cce=1,$C=function(r){z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.init=function(t,n,i,a,o,s){a=a||{},this.option=null,this._theme=new _t(a),this._locale=new _t(o),this._optionManager=s},e.prototype.setOption=function(t,n,i){var a=RL(n);this._optionManager.setOption(t,i,a),this._resetOption(null,a)},e.prototype.resetOption=function(t,n){return this._resetOption(t,RL(n))},e.prototype._resetOption=function(t,n){var i=!1,a=this._optionManager;if(!t||t==="recreate"){var o=a.mountOption(t==="recreate");!this.option||t==="recreate"?EL(this,o):(this.restoreData(),this._mergeOption(o,n)),i=!0}if((t==="timeline"||t==="media")&&this.restoreData(),!t||t==="recreate"||t==="timeline"){var s=a.getTimelineOption(this);s&&(i=!0,this._mergeOption(s,n))}if(!t||t==="recreate"||t==="media"){var l=a.getMediaOption(this);l.length&&k(l,function(u){i=!0,this._mergeOption(u,n)},this)}return i},e.prototype.mergeOption=function(t){this._mergeOption(t,null)},e.prototype._mergeOption=function(t,n){var i=this.option,a=this._componentsMap,o=this._componentsCount,s=[],l=ve(),u=n&&n.replaceMergeMainTypeMap;yce(this),k(t,function(f,h){f!=null&&(Qe.hasClass(h)?h&&(s.push(h),l.set(h,!0)):i[h]=i[h]==null?ke(f):Be(i[h],f,!0))}),u&&u.each(function(f,h){Qe.hasClass(h)&&!l.get(h)&&(s.push(h),l.set(h,!0))}),Qe.topologicalTravel(s,Qe.getAllClassMainTypes(),c,this);function c(f){var h=xce(this,f,wt(t[f])),d=a.get(f),p=d?u&&u.get(f)?"replaceMerge":"normalMerge":"replaceAll",v=cz(d,h,p);Kse(v,f,Qe),i[f]=null,a.set(f,null),o.set(f,0);var m=[],g=[],y=0,b;k(v,function(_,x){var w=_.existing,S=_.newOption;if(!S)w&&(w.mergeOption({},this),w.optionUpdated({},!1));else{var T=f==="series",C=Qe.getClass(f,_.keyInfo.subType,!T);if(!C)return;if(f==="tooltip"){if(b)return;b=!0}if(w&&w.constructor===C)w.name=_.keyInfo.name,w.mergeOption(S,this),w.optionUpdated(S,!1);else{var A=W({componentIndex:x},_.keyInfo);w=new C(S,this,this,A),W(w,A),_.brandNew&&(w.__requireNewView=!0),w.init(S,this,this),w.optionUpdated(null,!0)}}w?(m.push(w.option),g.push(w),y++):(m.push(void 0),g.push(void 0))},this),i[f]=m,a.set(f,g),o.set(f,y),f==="series"&&Rv(this)}this._seriesIndices||Rv(this)},e.prototype.getOption=function(){var t=ke(this.option);return k(t,function(n,i){if(Qe.hasClass(i)){for(var a=wt(n),o=a.length,s=!1,l=o-1;l>=0;l--)a[l]&&!Vd(a[l])?s=!0:(a[l]=null,!s&&o--);a.length=o,t[i]=a}}),delete t[LL],t},e.prototype.getTheme=function(){return this._theme},e.prototype.getLocaleModel=function(){return this._locale},e.prototype.setUpdatePayload=function(t){this._payload=t},e.prototype.getUpdatePayload=function(){return this._payload},e.prototype.getComponent=function(t,n){var i=this._componentsMap.get(t);if(i){var a=i[n||0];if(a)return a;if(n==null){for(var o=0;o=e:t==="max"?r<=e:r===e}function Rce(r,e){return r.join(",")===e.join(",")}var _i=k,Yd=Me,OL=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function r_(r){var e=r&&r.itemStyle;if(e)for(var t=0,n=OL.length;t=0;m--){var g=r[m];if(s||(p=g.data.rawIndexOf(g.stackedByDimension,d)),p>=0){var y=g.data.getByRawIndex(g.stackResultDimension,p);if(l==="all"||l==="positive"&&y>0||l==="negative"&&y<0||l==="samesign"&&h>=0&&y>0||l==="samesign"&&h<=0&&y<0){h=zse(h,y),v=y;break}}}return n[0]=h,n[1]=v,n})})}var r1=function(){function r(e){this.data=e.data||(e.sourceFormat===Ba?{}:[]),this.sourceFormat=e.sourceFormat||m6,this.seriesLayoutBy=e.seriesLayoutBy||xa,this.startIndex=e.startIndex||0,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.metaRawOption=e.metaRawOption;var t=this.dimensionsDefine=e.dimensionsDefine;if(t)for(var n=0;nv&&(v=b)}d[0]=p,d[1]=v}},i=function(){return this._data?this._data.length/this._dimSize:0};$L=(e={},e[Jr+"_"+xa]={pure:!0,appendData:a},e[Jr+"_"+Cf]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[bi]={pure:!0,appendData:a},e[Ba]={pure:!0,appendData:function(o){var s=this._data;k(o,function(l,u){for(var c=s[u]||(s[u]=[]),f=0;f<(l||[]).length;f++)c.push(l[f])})}},e[yi]={appendData:a},e[bs]={persistent:!1,pure:!0,appendData:function(o){this._data=o},clean:function(){this._offset+=this.count(),this._data=null}},e);function a(o){for(var s=0;s=0&&(v=o.interpolatedValue[m])}return v!=null?v+"":""})}},r.prototype.getRawValue=function(e,t){return tf(this.getData(t),e)},r.prototype.formatTooltip=function(e,t,n){},r}();function UL(r){var e,t;return Me(r)?r.type&&(t=r):e=r,{text:e,frag:t}}function hd(r){return new Zce(r)}var Zce=function(){function r(e){e=e||{},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return r.prototype.perform=function(e){var t=this._upstream,n=e&&e.skip;if(this._dirty&&t){var i=this.context;i.data=i.outputData=t.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var a;this._plan&&!n&&(a=this._plan(this.context));var o=c(this._modBy),s=this._modDataCount||0,l=c(e&&e.modBy),u=e&&e.modDataCount||0;(o!==l||s!==u)&&(a="reset");function c(y){return!(y>=1)&&(y=1),y}var f;(this._dirty||a==="reset")&&(this._dirty=!1,f=this._doReset(n)),this._modBy=l,this._modDataCount=u;var h=e&&e.step;if(t?this._dueEnd=t._outputDueEnd:this._dueEnd=this._count?this._count(this.context):1/0,this._progress){var d=this._dueIndex,p=Math.min(h!=null?this._dueIndex+h:1/0,this._dueEnd);if(!n&&(f||d1&&n>0?s:o}};return a;function o(){return e=r?null:le},gte:function(r,e){return r>=e}},Qce=function(){function r(e,t){if(!lt(t)){var n="";dt(n)}this._opFn=I6[e],this._rvalFloat=xo(t)}return r.prototype.evaluate=function(e){return lt(e)?this._opFn(e,this._rvalFloat):this._opFn(xo(e),this._rvalFloat)},r}(),P6=function(){function r(e,t){var n=e==="desc";this._resultLT=n?1:-1,t==null&&(t=n?"min":"max"),this._incomparable=t==="min"?-1/0:1/0}return r.prototype.evaluate=function(e,t){var n=lt(e)?e:xo(e),i=lt(t)?t:xo(t),a=isNaN(n),o=isNaN(i);if(a&&(n=this._incomparable),o&&(i=this._incomparable),a&&o){var s=se(e),l=se(t);s&&(n=l?e:0),l&&(i=s?t:0)}return ni?-this._resultLT:0},r}(),efe=function(){function r(e,t){this._rval=t,this._isEQ=e,this._rvalTypeof=typeof t,this._rvalFloat=xo(t)}return r.prototype.evaluate=function(e){var t=e===this._rval;if(!t){var n=typeof e;n!==this._rvalTypeof&&(n==="number"||this._rvalTypeof==="number")&&(t=xo(e)===this._rvalFloat)}return this._isEQ?t:!t},r}();function tfe(r,e){return r==="eq"||r==="ne"?new efe(r==="eq",e):fe(I6,r)?new Qce(r,e):null}var rfe=function(){function r(){}return r.prototype.getRawData=function(){throw new Error("not supported")},r.prototype.getRawDataItem=function(e){throw new Error("not supported")},r.prototype.cloneRawData=function(){},r.prototype.getDimensionInfo=function(e){},r.prototype.cloneAllDimensionInfo=function(){},r.prototype.count=function(){},r.prototype.retrieveValue=function(e,t){},r.prototype.retrieveValueFromItem=function(e,t){},r.prototype.convertValue=function(e,t){return _s(e,t)},r}();function nfe(r,e){var t=new rfe,n=r.data,i=t.sourceFormat=r.sourceFormat,a=r.startIndex,o="";r.seriesLayoutBy!==xa&&dt(o);var s=[],l={},u=r.dimensionsDefine;if(u)k(u,function(v,m){var g=v.name,y={index:m,name:g,displayName:v.displayName};if(s.push(y),g!=null){var b="";fe(l,g)&&dt(b),l[g]=y}});else for(var c=0;c65535?ffe:hfe}function rc(){return[1/0,-1/0]}function dfe(r){var e=r.constructor;return e===Array?r.slice():new e(r)}function XL(r,e,t,n,i){var a=j6[t||"float"];if(i){var o=r[e],s=o&&o.length;if(s!==n){for(var l=new a(n),u=0;um[1]&&(m[1]=v)}return this._rawCount=this._count=l,{start:s,end:l}},r.prototype._initDataFromProvider=function(e,t,n){for(var i=this._provider,a=this._chunks,o=this._dimensions,s=o.length,l=this._rawExtent,u=K(o,function(y){return y.property}),c=0;cg[1]&&(g[1]=m)}}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=t,this._extent=[]},r.prototype.count=function(){return this._count},r.prototype.get=function(e,t){if(!(t>=0&&t=0&&t=this._rawCount||e<0)return-1;if(!this._indices)return e;var t=this._indices,n=t[e];if(n!=null&&ne)a=o-1;else return o}return-1},r.prototype.indicesOfNearest=function(e,t,n){var i=this._chunks,a=i[e],o=[];if(!a)return o;n==null&&(n=1/0);for(var s=1/0,l=-1,u=0,c=0,f=this.count();c=0&&l<0)&&(s=p,l=d,u=0),d===l&&(o[u++]=c))}return o.length=u,o},r.prototype.getIndices=function(){var e,t=this._indices;if(t){var n=t.constructor,i=this._count;if(n===Array){e=new n(i);for(var a=0;a=f&&y<=h||isNaN(y))&&(l[u++]=v),v++}p=!0}else if(a===2){for(var m=d[i[0]],b=d[i[1]],_=e[i[1]][0],x=e[i[1]][1],g=0;g=f&&y<=h||isNaN(y))&&(w>=_&&w<=x||isNaN(w))&&(l[u++]=v),v++}p=!0}}if(!p)if(a===1)for(var g=0;g=f&&y<=h||isNaN(y))&&(l[u++]=S)}else for(var g=0;ge[A][1])&&(T=!1)}T&&(l[u++]=t.getRawIndex(g))}return ug[1]&&(g[1]=m)}}}},r.prototype.lttbDownSample=function(e,t){var n=this.clone([e],!0),i=n._chunks,a=i[e],o=this.count(),s=0,l=Math.floor(1/t),u=this.getRawIndex(0),c,f,h,d=new(tc(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));d[s++]=u;for(var p=1;pc&&(c=f,h=_)}M>0&&Ms&&(v=s-c);for(var m=0;mp&&(p=y,d=c+m)}var b=this.getRawIndex(f),_=this.getRawIndex(d);fc-p&&(l=c-p,s.length=l);for(var v=0;vf[1]&&(f[1]=g),h[d++]=y}return a._count=d,a._indices=h,a._updateGetRawIdx(),a},r.prototype.each=function(e,t){if(this._count)for(var n=e.length,i=this._chunks,a=0,o=this.count();al&&(l=f)}return o=[s,l],this._extent[e]=o,o},r.prototype.getRawDataItem=function(e){var t=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(t);for(var n=[],i=this._chunks,a=0;a=0?this._indices[e]:-1},r.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},r.internalField=function(){function e(t,n,i,a){return _s(t[a],this._dimensions[a])}a_={arrayRows:e,objectRows:function(t,n,i,a){return _s(t[n],this._dimensions[a])},keyedColumns:e,original:function(t,n,i,a){var o=t&&(t.value==null?t:t.value);return _s(o instanceof Array?o[a]:o,this._dimensions[a])},typedArray:function(t,n,i,a){return t[a]}}}(),r}(),N6=function(){function r(e){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=e}return r.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},r.prototype._setLocalSource=function(e,t){this._sourceList=e,this._upstreamSignList=t,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},r.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},r.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},r.prototype._createSource=function(){this._setLocalSource([],[]);var e=this._sourceHost,t=this._getUpstreamSourceManagers(),n=!!t.length,i,a;if(Ov(e)){var o=e,s=void 0,l=void 0,u=void 0;if(n){var c=t[0];c.prepareSource(),u=c.getSource(),s=u.data,l=u.sourceFormat,a=[c._getVersionSign()]}else s=o.get("data",!0),l=Dn(s)?bs:yi,a=[];var f=this._getSourceMetaRawOption()||{},h=u&&u.metaRawOption||{},d=Re(f.seriesLayoutBy,h.seriesLayoutBy)||null,p=Re(f.sourceHeader,h.sourceHeader),v=Re(f.dimensions,h.dimensions),m=d!==h.seriesLayoutBy||!!p!=!!h.sourceHeader||v;i=m?[D2(s,{seriesLayoutBy:d,sourceHeader:p,dimensions:v},l)]:[]}else{var g=e;if(n){var y=this._applyTransform(t);i=y.sourceList,a=y.upstreamSignList}else{var b=g.get("source",!0);i=[D2(b,this._getSourceMetaRawOption(),null)],a=[]}}this._setLocalSource(i,a)},r.prototype._applyTransform=function(e){var t=this._sourceHost,n=t.get("transform",!0),i=t.get("fromTransformResult",!0);if(i!=null){var a="";e.length!==1&&ZL(a)}var o,s=[],l=[];return k(e,function(u){u.prepareSource();var c=u.getSource(i||0),f="";i!=null&&!c&&ZL(f),s.push(c),l.push(u._getVersionSign())}),n?o=ufe(n,s,{datasetIndex:t.componentIndex}):i!=null&&(o=[Gce(s[0])]),{sourceList:o,upstreamSignList:l}},r.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),t=0;t1||t>0&&!r.noHeader;return k(r.blocks,function(i){var a=V6(i);a>=e&&(e=a+ +(n&&(!a||L2(i)&&!i.noHeader)))}),e}return 0}function gfe(r,e,t,n){var i=e.noHeader,a=bfe(V6(e)),o=[],s=e.blocks||[];vn(!s||q(s)),s=s||[];var l=r.orderMode;if(e.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(fe(u,l)){var c=new P6(u[l],null);s.sort(function(v,m){return c.evaluate(v.sortParam,m.sortParam)})}else l==="seriesDesc"&&s.reverse()}k(s,function(v,m){var g=e.valueFormatter,y=F6(v)(g?W(W({},r),{valueFormatter:g}):r,v,m>0?a.html:0,n);y!=null&&o.push(y)});var f=r.renderMode==="richText"?o.join(a.richText):I2(n,o.join(""),i?t:a.html);if(i)return f;var h=A2(e.header,"ordinal",r.useUTC),d=z6(n,r.renderMode).nameStyle,p=B6(n);return r.renderMode==="richText"?$6(r,h,d)+a.richText+f:I2(n,'
    '+un(h)+"
    "+f,t)}function yfe(r,e,t,n){var i=r.renderMode,a=e.noName,o=e.noValue,s=!e.markerType,l=e.name,u=r.useUTC,c=e.valueFormatter||r.valueFormatter||function(_){return _=q(_)?_:[_],K(_,function(x,w){return A2(x,q(d)?d[w]:d,u)})};if(!(a&&o)){var f=s?"":r.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",i),h=a?"":A2(l,"ordinal",u),d=e.valueType,p=o?[]:c(e.value,e.dataIndex),v=!s||!a,m=!s&&a,g=z6(n,i),y=g.nameStyle,b=g.valueStyle;return i==="richText"?(s?"":f)+(a?"":$6(r,h,y))+(o?"":wfe(r,p,v,m,b)):I2(n,(s?"":f)+(a?"":_fe(h,!s,y))+(o?"":xfe(p,v,m,b)),t)}}function JL(r,e,t,n,i,a){if(r){var o=F6(r),s={useUTC:i,renderMode:t,orderMode:n,markupStyleCreator:e,valueFormatter:r.valueFormatter};return o(s,r,0,a)}}function bfe(r){return{html:vfe[r],richText:mfe[r]}}function I2(r,e,t){var n='
    ',i="margin: "+t+"px 0 0",a=B6(r);return'
    '+e+n+"
    "}function _fe(r,e,t){var n=e?"margin-left:2px":"";return''+un(r)+""}function xfe(r,e,t,n){var i=t?"10px":"20px",a=e?"float:right;margin-left:"+i:"";return r=q(r)?r:[r],''+K(r,function(o){return un(o)}).join("  ")+""}function $6(r,e,t){return r.markupStyleCreator.wrapRichTextStyle(e,t)}function wfe(r,e,t,n,i){var a=[i],o=n?10:20;return t&&a.push({padding:[0,0,0,o],align:"right"}),r.markupStyleCreator.wrapRichTextStyle(q(e)?e.join(" "):e,a)}function H6(r,e){var t=r.getData().getItemVisual(e,"style"),n=t[r.visualDrawType];return yu(n)}function G6(r,e){var t=r.get("padding");return t??(e==="richText"?[8,10]:10)}var o_=function(){function r(){this.richTextStyles={},this._nextStyleNameId=oz()}return r.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},r.prototype.makeTooltipMarker=function(e,t,n){var i=n==="richText"?this._generateStyleName():null,a=hce({color:t,type:e,renderMode:n,markerId:i});return se(a)?a:(this.richTextStyles[i]=a.style,a.content)},r.prototype.wrapRichTextStyle=function(e,t){var n={};q(t)?k(t,function(a){return W(n,a)}):W(n,t);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+e+"}"},r}();function W6(r){var e=r.series,t=r.dataIndex,n=r.multipleSeries,i=e.getData(),a=i.mapDimensionsAll("defaultedTooltip"),o=a.length,s=e.getRawValue(t),l=q(s),u=H6(e,t),c,f,h,d;if(o>1||l&&!o){var p=Sfe(s,e,t,a,u);c=p.inlineValues,f=p.inlineValueTypes,h=p.blocks,d=p.inlineValues[0]}else if(o){var v=i.getDimensionInfo(a[0]);d=c=tf(i,t,a[0]),f=v.type}else d=c=l?s[0]:s;var m=yC(e),g=m&&e.name||"",y=i.getName(t),b=n?g:y;return Cr("section",{header:g,noHeader:n||!m,sortParam:d,blocks:[Cr("nameValue",{markerType:"item",markerColor:u,name:b,noName:!Li(b),value:c,valueType:f,dataIndex:t})].concat(h||[])})}function Sfe(r,e,t,n,i){var a=e.getData(),o=Ea(r,function(f,h,d){var p=a.getDimensionInfo(d);return f=f||p&&p.tooltip!==!1&&p.displayName!=null},!1),s=[],l=[],u=[];n.length?k(n,function(f){c(tf(a,t,f),f)}):k(r,c);function c(f,h){var d=a.getDimensionInfo(h);!d||d.otherDims.tooltip===!1||(o?u.push(Cr("nameValue",{markerType:"subItem",markerColor:i,name:d.displayName,value:f,valueType:d.type})):(s.push(f),l.push(d.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:u}}var Fo=it();function jv(r,e){return r.getName(e)||r.getId(e)}var qm="__universalTransitionEnabled",It=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t._selectedDataIndicesMap={},t}return e.prototype.init=function(t,n,i){this.seriesIndex=this.componentIndex,this.dataTask=hd({count:Cfe,reset:Afe}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(t,i);var a=Fo(this).sourceManager=new N6(this);a.prepareSource();var o=this.getInitialData(t,i);eI(o,this),this.dataTask.context.data=o,Fo(this).dataBeforeProcessed=o,QL(this),this._initSelectedMapFromData(o)},e.prototype.mergeDefaultAndTheme=function(t,n){var i=Ud(this),a=i?Tf(t):{},o=this.subType;Qe.hasClass(o)&&(o+="Series"),Be(t,n.getTheme().get(this.subType)),Be(t,this.getDefaultOption()),pu(t,"label",["show"]),this.fillDataTextStyle(t.data),i&&Ls(t,a,i)},e.prototype.mergeOption=function(t,n){t=Be(this.option,t,!0),this.fillDataTextStyle(t.data);var i=Ud(this);i&&Ls(this.option,t,i);var a=Fo(this).sourceManager;a.dirty(),a.prepareSource();var o=this.getInitialData(t,n);eI(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,Fo(this).dataBeforeProcessed=o,QL(this),this._initSelectedMapFromData(o)},e.prototype.fillDataTextStyle=function(t){if(t&&!Dn(t))for(var n=["show"],i=0;ithis.getShallow("animationThreshold")&&(n=!1),!!n},e.prototype.restoreData=function(){this.dataTask.dirty()},e.prototype.getColorFromPalette=function(t,n,i){var a=this.ecModel,o=VC.prototype.getColorFromPalette.call(this,t,n,i);return o||(o=a.getColorFromPalette(t,n,i)),o},e.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},e.prototype.getProgressive=function(){return this.get("progressive")},e.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},e.prototype.select=function(t,n){this._innerSelect(this.getData(n),t)},e.prototype.unselect=function(t,n){var i=this.option.selectedMap;if(i){var a=this.option.selectedMode,o=this.getData(n);if(a==="series"||i==="all"){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var s=0;s=0&&i.push(o)}return i},e.prototype.isSelected=function(t,n){var i=this.option.selectedMap;if(!i)return!1;var a=this.getData(n);return(i==="all"||i[jv(a,t)])&&!a.getItemModel(t).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this[qm])return!0;var t=this.option.universalTransition;return t?t===!0?!0:t&&t.enabled:!1},e.prototype._innerSelect=function(t,n){var i,a,o=this.option,s=o.selectedMode,l=n.length;if(!(!s||!l)){if(s==="series")o.selectedMap="all";else if(s==="multiple"){Me(o.selectedMap)||(o.selectedMap={});for(var u=o.selectedMap,c=0;c0&&this._innerSelect(t,n)}},e.registerClass=function(t){return Qe.registerClass(t)},e.protoInitialize=function(){var t=e.prototype;t.type="series.__base__",t.seriesIndex=0,t.ignoreStyleOnData=!1,t.hasSymbolVisual=!1,t.defaultSymbol="circle",t.visualStyleAccessPath="itemStyle",t.visualDrawType="fill"}(),e}(Qe);cr(It,n1);cr(It,VC);pz(It,Qe);function QL(r){var e=r.name;yC(r)||(r.name=Tfe(r)||e)}function Tfe(r){var e=r.getRawData(),t=e.mapDimensionsAll("seriesName"),n=[];return k(t,function(i){var a=e.getDimensionInfo(i);a.displayName&&n.push(a.displayName)}),n.join(" ")}function Cfe(r){return r.model.getRawData().count()}function Afe(r){var e=r.model;return e.setData(e.getRawData().cloneShallow()),Mfe}function Mfe(r,e){e.outputData&&r.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function eI(r,e){k(jd(r.CHANGABLE_METHODS,r.DOWNSAMPLE_METHODS),function(t){r.wrapMethod(t,Oe(kfe,e))})}function kfe(r,e){var t=P2(r);return t&&t.setOutputEnd((e||this).count()),e}function P2(r){var e=(r.ecModel||{}).scheduler,t=e&&e.getPipeline(r.uid);if(t){var n=t.currentTask;if(n){var i=n.agentStubMap;i&&(n=i.get(r.uid))}return n}}var zt=function(){function r(){this.group=new Ee,this.uid=wf("viewComponent")}return r.prototype.init=function(e,t){},r.prototype.render=function(e,t,n,i){},r.prototype.dispose=function(e,t){},r.prototype.updateView=function(e,t,n,i){},r.prototype.updateLayout=function(e,t,n,i){},r.prototype.updateVisual=function(e,t,n,i){},r.prototype.toggleBlurSeries=function(e,t,n){},r.prototype.eachRendered=function(e){var t=this.group;t&&t.traverse(e)},r}();_C(zt);z0(zt);function Af(){var r=it();return function(e){var t=r(e),n=e.pipelineContext,i=!!t.large,a=!!t.progressiveRender,o=t.large=!!(n&&n.large),s=t.progressiveRender=!!(n&&n.progressiveRender);return(i!==o||a!==s)&&"reset"}}var U6=it(),Dfe=Af(),St=function(){function r(){this.group=new Ee,this.uid=wf("viewChart"),this.renderTask=hd({plan:Efe,reset:Lfe}),this.renderTask.context={view:this}}return r.prototype.init=function(e,t){},r.prototype.render=function(e,t,n,i){},r.prototype.highlight=function(e,t,n,i){var a=e.getData(i&&i.dataType);a&&rI(a,i,"emphasis")},r.prototype.downplay=function(e,t,n,i){var a=e.getData(i&&i.dataType);a&&rI(a,i,"normal")},r.prototype.remove=function(e,t){this.group.removeAll()},r.prototype.dispose=function(e,t){},r.prototype.updateView=function(e,t,n,i){this.render(e,t,n,i)},r.prototype.updateLayout=function(e,t,n,i){this.render(e,t,n,i)},r.prototype.updateVisual=function(e,t,n,i){this.render(e,t,n,i)},r.prototype.eachRendered=function(e){Vs(this.group,e)},r.markUpdateMethod=function(e,t){U6(e).updateMethod=t},r.protoInitialize=function(){var e=r.prototype;e.type="chart"}(),r}();function tI(r,e,t){r&&Hd(r)&&(e==="emphasis"?wo:So)(r,t)}function rI(r,e,t){var n=vu(r,e),i=e&&e.highlightKey!=null?hue(e.highlightKey):null;n!=null?k(wt(n),function(a){tI(r.getItemGraphicEl(a),t,i)}):r.eachItemGraphicEl(function(a){tI(a,t,i)})}_C(St);z0(St);function Efe(r){return Dfe(r.model)}function Lfe(r){var e=r.model,t=r.ecModel,n=r.api,i=r.payload,a=e.pipelineContext.progressiveRender,o=r.view,s=i&&U6(i).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](e,t,n,i),Ife[l]}var Ife={incrementalPrepareRender:{progress:function(r,e){e.view.incrementalRender(r,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(r,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}},Ty="\0__throttleOriginMethod",nI="\0__throttleRate",iI="\0__throttleType";function YC(r,e,t){var n,i=0,a=0,o=null,s,l,u,c;e=e||0;function f(){a=new Date().getTime(),o=null,r.apply(l,u||[])}var h=function(){for(var d=[],p=0;p=0?f():o=setTimeout(f,-s),i=n};return h.clear=function(){o&&(clearTimeout(o),o=null)},h.debounceNextCall=function(d){c=d},h}function Mf(r,e,t,n){var i=r[e];if(i){var a=i[Ty]||i,o=i[iI],s=i[nI];if(s!==t||o!==n){if(t==null||!n)return r[e]=a;i=r[e]=YC(a,t,n==="debounce"),i[Ty]=a,i[iI]=n,i[nI]=t}return i}}function qd(r,e){var t=r[e];t&&t[Ty]&&(t.clear&&t.clear(),r[e]=t[Ty])}var aI=it(),oI={itemStyle:mu(Jz,!0),lineStyle:mu(Zz,!0)},Pfe={lineStyle:"stroke",itemStyle:"fill"};function Y6(r,e){var t=r.visualStyleMapper||oI[e];return t||(console.warn("Unknown style type '"+e+"'."),oI.itemStyle)}function q6(r,e){var t=r.visualDrawType||Pfe[e];return t||(console.warn("Unknown style type '"+e+"'."),"fill")}var Rfe={createOnAllSeries:!0,performRawSeries:!0,reset:function(r,e){var t=r.getData(),n=r.visualStyleAccessPath||"itemStyle",i=r.getModel(n),a=Y6(r,n),o=a(i),s=i.getShallow("decal");s&&(t.setVisual("decal",s),s.dirty=!0);var l=q6(r,n),u=o[l],c=Te(u)?u:null,f=o.fill==="auto"||o.stroke==="auto";if(!o[l]||c||f){var h=r.getColorFromPalette(r.name,null,e.getSeriesCount());o[l]||(o[l]=h,t.setVisual("colorFromPalette",!0)),o.fill=o.fill==="auto"||Te(o.fill)?h:o.fill,o.stroke=o.stroke==="auto"||Te(o.stroke)?h:o.stroke}if(t.setVisual("style",o),t.setVisual("drawType",l),!e.isSeriesFiltered(r)&&c)return t.setVisual("colorFromPalette",!1),{dataEach:function(d,p){var v=r.getDataParams(p),m=W({},o);m[l]=c(v),d.setItemVisual(p,"style",m)}}}},th=new _t,Ofe={createOnAllSeries:!0,performRawSeries:!0,reset:function(r,e){if(!(r.ignoreStyleOnData||e.isSeriesFiltered(r))){var t=r.getData(),n=r.visualStyleAccessPath||"itemStyle",i=Y6(r,n),a=t.getVisual("drawType");return{dataEach:t.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[n]){th.option=l[n];var u=i(th),c=o.ensureUniqueItemVisual(s,"style");W(c,u),th.option.decal&&(o.setItemVisual(s,"decal",th.option.decal),th.option.decal.dirty=!0),a in u&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},jfe={performRawSeries:!0,overallReset:function(r){var e=ve();r.eachSeries(function(t){var n=t.getColorBy();if(!t.isColorBySeries()){var i=t.type+"-"+n,a=e.get(i);a||(a={},e.set(i,a)),aI(t).scope=a}}),r.eachSeries(function(t){if(!(t.isColorBySeries()||r.isSeriesFiltered(t))){var n=t.getRawData(),i={},a=t.getData(),o=aI(t).scope,s=t.visualStyleAccessPath||"itemStyle",l=q6(t,s);a.each(function(u){var c=a.getRawIndex(u);i[c]=u}),n.each(function(u){var c=i[u],f=a.getItemVisual(c,"colorFromPalette");if(f){var h=a.ensureUniqueItemVisual(c,"style"),d=n.getName(u)||u+"",p=n.count();h[l]=t.getColorFromPalette(d,o,p)}})}})}},Nv=Math.PI;function Nfe(r,e){e=e||{},Ce(e,{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var t=new Ee,n=new nt({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});t.add(n);var i=new ot({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),a=new nt({style:{fill:"none"},textContent:i,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});t.add(a);var o;return e.showSpinner&&(o=new U0({shape:{startAngle:-Nv/2,endAngle:-Nv/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:Nv*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:Nv*3/2}).delay(300).start("circularInOut"),t.add(o)),t.resize=function(){var s=i.getBoundingRect().width,l=e.showSpinner?e.spinnerRadius:0,u=(r.getWidth()-l*2-(e.showSpinner&&s?10:0)-s)/2-(e.showSpinner&&s?0:5+s/2)+(e.showSpinner?0:s/2)+(s?0:l),c=r.getHeight()/2;e.showSpinner&&o.setShape({cx:u,cy:c}),a.setShape({x:u-l,y:c-l,width:l*2,height:l*2}),n.setShape({x:0,y:0,width:r.getWidth(),height:r.getHeight()})},t.resize(),t}var X6=function(){function r(e,t,n,i){this._stageTaskMap=ve(),this.ecInstance=e,this.api=t,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}return r.prototype.restoreData=function(e,t){e.restoreData(t),this._stageTaskMap.each(function(n){var i=n.overallTask;i&&i.dirty()})},r.prototype.getPerformArgs=function(e,t){if(e.__pipeline){var n=this._pipelineMap.get(e.__pipeline.id),i=n.context,a=!t&&n.progressiveEnabled&&(!i||i.progressiveRender)&&e.__idxInPipeline>n.blockIndex,o=a?n.step:null,s=i&&i.modDataCount,l=s!=null?Math.ceil(s/o):null;return{step:o,modBy:l,modDataCount:s}}},r.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},r.prototype.updateStreamModes=function(e,t){var n=this._pipelineMap.get(e.uid),i=e.getData(),a=i.count(),o=n.progressiveEnabled&&t.incrementalPrepareRender&&a>=n.threshold,s=e.get("large")&&a>=e.get("largeThreshold"),l=e.get("progressiveChunkMode")==="mod"?a:null;e.pipelineContext=n.context={progressiveRender:o,modDataCount:l,large:s}},r.prototype.restorePipelines=function(e){var t=this,n=t._pipelineMap=ve();e.eachSeries(function(i){var a=i.getProgressive(),o=i.uid;n.set(o,{id:o,head:null,tail:null,threshold:i.getProgressiveThreshold(),progressiveEnabled:a&&!(i.preventIncremental&&i.preventIncremental()),blockIndex:-1,step:Math.round(a||700),count:0}),t._pipe(i,i.dataTask)})},r.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,t=this.api.getModel(),n=this.api;k(this._allHandlers,function(i){var a=e.get(i.uid)||e.set(i.uid,{}),o="";vn(!(i.reset&&i.overallReset),o),i.reset&&this._createSeriesStageTask(i,a,t,n),i.overallReset&&this._createOverallStageTask(i,a,t,n)},this)},r.prototype.prepareView=function(e,t,n,i){var a=e.renderTask,o=a.context;o.model=t,o.ecModel=n,o.api=i,a.__block=!e.incrementalPrepareRender,this._pipe(t,a)},r.prototype.performDataProcessorTasks=function(e,t){this._performStageTasks(this._dataProcessorHandlers,e,t,{block:!0})},r.prototype.performVisualTasks=function(e,t,n){this._performStageTasks(this._visualHandlers,e,t,n)},r.prototype._performStageTasks=function(e,t,n,i){i=i||{};var a=!1,o=this;k(e,function(l,u){if(!(i.visualType&&i.visualType!==l.visualType)){var c=o._stageTaskMap.get(l.uid),f=c.seriesTaskMap,h=c.overallTask;if(h){var d,p=h.agentStubMap;p.each(function(m){s(i,m)&&(m.dirty(),d=!0)}),d&&h.dirty(),o.updatePayload(h,n);var v=o.getPerformArgs(h,i.block);p.each(function(m){m.perform(v)}),h.perform(v)&&(a=!0)}else f&&f.each(function(m,g){s(i,m)&&m.dirty();var y=o.getPerformArgs(m,i.block);y.skip=!l.performRawSeries&&t.isSeriesFiltered(m.context.model),o.updatePayload(m,n),m.perform(y)&&(a=!0)})}});function s(l,u){return l.setDirty&&(!l.dirtyMap||l.dirtyMap.get(u.__pipeline.id))}this.unfinished=a||this.unfinished},r.prototype.performSeriesTasks=function(e){var t;e.eachSeries(function(n){t=n.dataTask.perform()||t}),this.unfinished=t||this.unfinished},r.prototype.plan=function(){this._pipelineMap.each(function(e){var t=e.tail;do{if(t.__block){e.blockIndex=t.__idxInPipeline;break}t=t.getUpstream()}while(t)})},r.prototype.updatePayload=function(e,t){t!=="remain"&&(e.context.payload=t)},r.prototype._createSeriesStageTask=function(e,t,n,i){var a=this,o=t.seriesTaskMap,s=t.seriesTaskMap=ve(),l=e.seriesType,u=e.getTargetSeries;e.createOnAllSeries?n.eachRawSeries(c):l?n.eachRawSeriesByType(l,c):u&&u(n,i).each(c);function c(f){var h=f.uid,d=s.set(h,o&&o.get(h)||hd({plan:$fe,reset:Hfe,count:Wfe}));d.context={model:f,ecModel:n,api:i,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:a},a._pipe(f,d)}},r.prototype._createOverallStageTask=function(e,t,n,i){var a=this,o=t.overallTask=t.overallTask||hd({reset:Bfe});o.context={ecModel:n,api:i,overallReset:e.overallReset,scheduler:a};var s=o.agentStubMap,l=o.agentStubMap=ve(),u=e.seriesType,c=e.getTargetSeries,f=!0,h=!1,d="";vn(!e.createOnAllSeries,d),u?n.eachRawSeriesByType(u,p):c?c(n,i).each(p):(f=!1,k(n.getSeries(),p));function p(v){var m=v.uid,g=l.set(m,s&&s.get(m)||(h=!0,hd({reset:zfe,onDirty:Vfe})));g.context={model:v,overallProgress:f},g.agent=o,g.__block=f,a._pipe(v,g)}h&&o.dirty()},r.prototype._pipe=function(e,t){var n=e.uid,i=this._pipelineMap.get(n);!i.head&&(i.head=t),i.tail&&i.tail.pipe(t),i.tail=t,t.__idxInPipeline=i.count++,t.__pipeline=i},r.wrapStageHandler=function(e,t){return Te(e)&&(e={overallReset:e,seriesType:Ufe(e)}),e.uid=wf("stageHandler"),t&&(e.visualType=t),e},r}();function Bfe(r){r.overallReset(r.ecModel,r.api,r.payload)}function zfe(r){return r.overallProgress&&Ffe}function Ffe(){this.agent.dirty(),this.getDownstream().dirty()}function Vfe(){this.agent&&this.agent.dirty()}function $fe(r){return r.plan?r.plan(r.model,r.ecModel,r.api,r.payload):null}function Hfe(r){r.useClearVisual&&r.data.clearAllVisual();var e=r.resetDefines=wt(r.reset(r.model,r.ecModel,r.api,r.payload));return e.length>1?K(e,function(t,n){return K6(n)}):Gfe}var Gfe=K6(0);function K6(r){return function(e,t){var n=t.data,i=t.resetDefines[r];if(i&&i.dataEach)for(var a=e.start;a0&&d===u.length-h.length){var p=u.slice(0,d);p!=="data"&&(t.mainType=p,t[h.toLowerCase()]=l,c=!0)}}s.hasOwnProperty(u)&&(n[u]=l,c=!0),c||(i[u]=l)})}return{cptQuery:t,dataQuery:n,otherQuery:i}},r.prototype.filter=function(e,t){var n=this.eventInfo;if(!n)return!0;var i=n.targetEl,a=n.packedEvent,o=n.model,s=n.view;if(!o||!s)return!0;var l=t.cptQuery,u=t.dataQuery;return c(l,o,"mainType")&&c(l,o,"subType")&&c(l,o,"index","componentIndex")&&c(l,o,"name")&&c(l,o,"id")&&c(u,a,"name")&&c(u,a,"dataIndex")&&c(u,a,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(e,t.otherQuery,i,a));function c(f,h,d,p){return f[d]==null||h[p||d]===f[d]}},r.prototype.afterTrigger=function(){this.eventInfo=null},r}(),R2=["symbol","symbolSize","symbolRotate","symbolOffset"],cI=R2.concat(["symbolKeepAspect"]),Xfe={createOnAllSeries:!0,performRawSeries:!0,reset:function(r,e){var t=r.getData();if(r.legendIcon&&t.setVisual("legendIcon",r.legendIcon),!r.hasSymbolVisual)return;for(var n={},i={},a=!1,o=0;o=0&&jl(l)?l:.5;var u=r.createRadialGradient(o,s,0,o,s,l);return u}function O2(r,e,t){for(var n=e.type==="radial"?che(r,e,t):uhe(r,e,t),i=e.colorStops,a=0;a0)?null:r==="dashed"?[4*e,2*e]:r==="dotted"?[e]:lt(r)?[r]:q(r)?r:null}function XC(r){var e=r.style,t=e.lineDash&&e.lineWidth>0&&hhe(e.lineDash,e.lineWidth),n=e.lineDashOffset;if(t){var i=e.strokeNoScale&&r.getLineScale?r.getLineScale():1;i&&i!==1&&(t=K(t,function(a){return a/i}),n/=i)}return[t,n]}var dhe=new Ra(!0);function My(r){var e=r.stroke;return!(e==null||e==="none"||!(r.lineWidth>0))}function fI(r){return typeof r=="string"&&r!=="none"}function ky(r){var e=r.fill;return e!=null&&e!=="none"}function hI(r,e){if(e.fillOpacity!=null&&e.fillOpacity!==1){var t=r.globalAlpha;r.globalAlpha=e.fillOpacity*e.opacity,r.fill(),r.globalAlpha=t}else r.fill()}function dI(r,e){if(e.strokeOpacity!=null&&e.strokeOpacity!==1){var t=r.globalAlpha;r.globalAlpha=e.strokeOpacity*e.opacity,r.stroke(),r.globalAlpha=t}else r.stroke()}function j2(r,e,t){var n=xC(e.image,e.__image,t);if(F0(n)){var i=r.createPattern(n,e.repeat||"repeat");if(typeof DOMMatrix=="function"&&i&&i.setTransform){var a=new DOMMatrix;a.translateSelf(e.x||0,e.y||0),a.rotateSelf(0,0,(e.rotation||0)*Om),a.scaleSelf(e.scaleX||1,e.scaleY||1),i.setTransform(a)}return i}}function phe(r,e,t,n){var i,a=My(t),o=ky(t),s=t.strokePercent,l=s<1,u=!e.path;(!e.silent||l)&&u&&e.createPathProxy();var c=e.path||dhe,f=e.__dirty;if(!n){var h=t.fill,d=t.stroke,p=o&&!!h.colorStops,v=a&&!!d.colorStops,m=o&&!!h.image,g=a&&!!d.image,y=void 0,b=void 0,_=void 0,x=void 0,w=void 0;(p||v)&&(w=e.getBoundingRect()),p&&(y=f?O2(r,h,w):e.__canvasFillGradient,e.__canvasFillGradient=y),v&&(b=f?O2(r,d,w):e.__canvasStrokeGradient,e.__canvasStrokeGradient=b),m&&(_=f||!e.__canvasFillPattern?j2(r,h,e):e.__canvasFillPattern,e.__canvasFillPattern=_),g&&(x=f||!e.__canvasStrokePattern?j2(r,d,e):e.__canvasStrokePattern,e.__canvasStrokePattern=_),p?r.fillStyle=y:m&&(_?r.fillStyle=_:o=!1),v?r.strokeStyle=b:g&&(x?r.strokeStyle=x:a=!1)}var S=e.getGlobalScale();c.setScale(S[0],S[1],e.segmentIgnoreThreshold);var T,C;r.setLineDash&&t.lineDash&&(i=XC(e),T=i[0],C=i[1]);var A=!0;(u||f&xc)&&(c.setDPR(r.dpr),l?c.setContext(null):(c.setContext(r),A=!1),c.reset(),e.buildPath(c,e.shape,n),c.toStatic(),e.pathUpdated()),A&&c.rebuildPath(r,l?s:1),T&&(r.setLineDash(T),r.lineDashOffset=C),n||(t.strokeFirst?(a&&dI(r,t),o&&hI(r,t)):(o&&hI(r,t),a&&dI(r,t))),T&&r.setLineDash([])}function vhe(r,e,t){var n=e.__image=xC(t.image,e.__image,e,e.onload);if(!(!n||!F0(n))){var i=t.x||0,a=t.y||0,o=e.getWidth(),s=e.getHeight(),l=n.width/n.height;if(o==null&&s!=null?o=s*l:s==null&&o!=null?s=o/l:o==null&&s==null&&(o=n.width,s=n.height),t.sWidth&&t.sHeight){var u=t.sx||0,c=t.sy||0;r.drawImage(n,u,c,t.sWidth,t.sHeight,i,a,o,s)}else if(t.sx&&t.sy){var u=t.sx,c=t.sy,f=o-u,h=s-c;r.drawImage(n,u,c,f,h,i,a,o,s)}else r.drawImage(n,i,a,o,s)}}function mhe(r,e,t){var n,i=t.text;if(i!=null&&(i+=""),i){r.font=t.font||Ms,r.textAlign=t.textAlign,r.textBaseline=t.textBaseline;var a=void 0,o=void 0;r.setLineDash&&t.lineDash&&(n=XC(e),a=n[0],o=n[1]),a&&(r.setLineDash(a),r.lineDashOffset=o),t.strokeFirst?(My(t)&&r.strokeText(i,t.x,t.y),ky(t)&&r.fillText(i,t.x,t.y)):(ky(t)&&r.fillText(i,t.x,t.y),My(t)&&r.strokeText(i,t.x,t.y)),a&&r.setLineDash([])}}var pI=["shadowBlur","shadowOffsetX","shadowOffsetY"],vI=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function rF(r,e,t,n,i){var a=!1;if(!n&&(t=t||{},e===t))return!1;if(n||e.opacity!==t.opacity){An(r,i),a=!0;var o=Math.max(Math.min(e.opacity,1),0);r.globalAlpha=isNaN(o)?eu.opacity:o}(n||e.blend!==t.blend)&&(a||(An(r,i),a=!0),r.globalCompositeOperation=e.blend||eu.blend);for(var s=0;s0&&t.unfinished);t.unfinished||this._zr.flush()}}},e.prototype.getDom=function(){return this._dom},e.prototype.getId=function(){return this.id},e.prototype.getZr=function(){return this._zr},e.prototype.isSSR=function(){return this._ssr},e.prototype.setOption=function(t,n,i){if(!this[Ur]){if(this._disposed){this.id;return}var a,o,s;if(Me(n)&&(i=n.lazyUpdate,a=n.silent,o=n.replaceMerge,s=n.transition,n=n.notMerge),this[Ur]=!0,!this._model||n){var l=new Ece(this._api),u=this._theme,c=this._model=new $C;c.scheduler=this._scheduler,c.ssr=this._ssr,c.init(null,null,null,u,this._locale,l)}this._model.setOption(t,{replaceMerge:o},B2);var f={seriesTransition:s,optionChanged:!0};if(i)this[wn]={silent:a,updateParams:f},this[Ur]=!1,this.getZr().wakeUp();else{try{ic(this),Vo.update.call(this,null,f)}catch(h){throw this[wn]=null,this[Ur]=!1,h}this._ssr||this._zr.flush(),this[wn]=null,this[Ur]=!1,rh.call(this,a),nh.call(this,a)}}},e.prototype.setTheme=function(){},e.prototype.getModel=function(){return this._model},e.prototype.getOption=function(){return this._model&&this._model.getOption()},e.prototype.getWidth=function(){return this._zr.getWidth()},e.prototype.getHeight=function(){return this._zr.getHeight()},e.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||Ze.hasGlobalWindow&&window.devicePixelRatio||1},e.prototype.getRenderedCanvas=function(t){return this.renderToCanvas(t)},e.prototype.renderToCanvas=function(t){t=t||{};var n=this._zr.painter;return n.getRenderedCanvas({backgroundColor:t.backgroundColor||this._model.get("backgroundColor"),pixelRatio:t.pixelRatio||this.getDevicePixelRatio()})},e.prototype.renderToSVGString=function(t){t=t||{};var n=this._zr.painter;return n.renderToString({useViewBox:t.useViewBox})},e.prototype.getSvgDataURL=function(){if(Ze.svgSupported){var t=this._zr,n=t.storage.getDisplayList();return k(n,function(i){i.stopAnimation(null,!0)}),t.painter.toDataURL()}},e.prototype.getDataURL=function(t){if(this._disposed){this.id;return}t=t||{};var n=t.excludeComponents,i=this._model,a=[],o=this;k(n,function(l){i.eachComponent({mainType:l},function(u){var c=o._componentsMap[u.__viewId];c.group.ignore||(a.push(c),c.group.ignore=!0)})});var s=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.renderToCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return k(a,function(l){l.group.ignore=!1}),s},e.prototype.getConnectedDataURL=function(t){if(this._disposed){this.id;return}var n=t.type==="svg",i=this.group,a=Math.min,o=Math.max,s=1/0;if(Vhe[i]){var l=s,u=s,c=-s,f=-s,h=[],d=t&&t.pixelRatio||this.getDevicePixelRatio();k(DI,function(b,_){if(b.group===i){var x=n?b.getZr().painter.getSvgDom().innerHTML:b.renderToCanvas(ke(t)),w=b.getDom().getBoundingClientRect();l=a(w.left,l),u=a(w.top,u),c=o(w.right,c),f=o(w.bottom,f),h.push({dom:x,left:w.left,top:w.top})}}),l*=d,u*=d,c*=d,f*=d;var p=c-l,v=f-u,m=ks.createCanvas(),g=OE(m,{renderer:n?"svg":"canvas"});if(g.resize({width:p,height:v}),n){var y="";return k(h,function(b){var _=b.left-l,x=b.top-u;y+=''+b.dom+""}),g.painter.getSvgRoot().innerHTML=y,t.connectedBackgroundColor&&g.painter.setBackgroundColor(t.connectedBackgroundColor),g.refreshImmediately(),g.painter.toDataURL()}else return t.connectedBackgroundColor&&g.add(new nt({shape:{x:0,y:0,width:p,height:v},style:{fill:t.connectedBackgroundColor}})),k(h,function(b){var _=new Lr({style:{x:b.left*d-l,y:b.top*d-u,image:b.dom}});g.add(_)}),g.refreshImmediately(),m.toDataURL("image/"+(t&&t.type||"png"))}else return this.getDataURL(t)},e.prototype.convertToPixel=function(t,n){return c_(this,"convertToPixel",t,n)},e.prototype.convertFromPixel=function(t,n){return c_(this,"convertFromPixel",t,n)},e.prototype.containPixel=function(t,n){if(this._disposed){this.id;return}var i=this._model,a,o=sd(i,t);return k(o,function(s,l){l.indexOf("Models")>=0&&k(s,function(u){var c=u.coordinateSystem;if(c&&c.containPoint)a=a||!!c.containPoint(n);else if(l==="seriesModels"){var f=this._chartsMap[u.__viewId];f&&f.containPoint&&(a=a||f.containPoint(n,u))}},this)},this),!!a},e.prototype.getVisual=function(t,n){var i=this._model,a=sd(i,t,{defaultMainType:"series"}),o=a.seriesModel,s=o.getData(),l=a.hasOwnProperty("dataIndexInside")?a.dataIndexInside:a.hasOwnProperty("dataIndex")?s.indexOfRawIndex(a.dataIndex):null;return l!=null?qC(s,l,n):Ep(s,n)},e.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},e.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},e.prototype._initEvents=function(){var t=this;k(Fhe,function(n){var i=function(a){var o=t.getModel(),s=a.target,l,u=n==="globalout";if(u?l={}:s&&Ol(s,function(p){var v=Le(p);if(v&&v.dataIndex!=null){var m=v.dataModel||o.getSeriesByIndex(v.seriesIndex);return l=m&&m.getDataParams(v.dataIndex,v.dataType,s)||{},!0}else if(v.eventData)return l=W({},v.eventData),!0},!0),l){var c=l.componentType,f=l.componentIndex;(c==="markLine"||c==="markPoint"||c==="markArea")&&(c="series",f=l.seriesIndex);var h=c&&f!=null&&o.getComponent(c,f),d=h&&t[h.mainType==="series"?"_chartsMap":"_componentsMap"][h.__viewId];l.event=a,l.type=n,t._$eventProcessor.eventInfo={targetEl:s,packedEvent:l,model:h,view:d},t.trigger(n,l)}};i.zrEventfulCallAtLast=!0,t._zr.on(n,i,t)}),k(Ey,function(n,i){t._messageCenter.on(i,function(a){this.trigger(i,a)},t)}),k(["selectchanged"],function(n){t._messageCenter.on(n,function(i){this.trigger(n,i)},t)}),Zfe(this._messageCenter,this,this._api)},e.prototype.isDisposed=function(){return this._disposed},e.prototype.clear=function(){if(this._disposed){this.id;return}this.setOption({series:[]},!0)},e.prototype.dispose=function(){if(this._disposed){this.id;return}this._disposed=!0;var t=this.getDom();t&&tle(this.getDom(),$he,"");var n=this,i=n._api,a=n._model;k(n._componentsViews,function(o){o.dispose(a,i)}),k(n._chartsViews,function(o){o.dispose(a,i)}),n._zr.dispose(),n._dom=n._model=n._chartsMap=n._componentsMap=n._chartsViews=n._componentsViews=n._scheduler=n._api=n._zr=n._throttledZrFlush=n._theme=n._coordSysMgr=n._messageCenter=null,delete DI[n.id]},e.prototype.resize=function(t){if(!this[Ur]){if(this._disposed){this.id;return}this._zr.resize(t);var n=this._model;if(this._loadingFX&&this._loadingFX.resize(),!!n){var i=n.resetOption("media"),a=t&&t.silent;this[wn]&&(a==null&&(a=this[wn].silent),i=!0,this[wn]=null),this[Ur]=!0;try{i&&ic(this),Vo.update.call(this,{type:"resize",animation:W({duration:0},t&&t.animation)})}catch(o){throw this[Ur]=!1,o}this[Ur]=!1,rh.call(this,a),nh.call(this,a)}}},e.prototype.showLoading=function(t,n){if(this._disposed){this.id;return}if(Me(t)&&(n=t,t=""),t=t||"default",this.hideLoading(),!!z2[t]){var i=z2[t](this._api,n),a=this._zr;this._loadingFX=i,a.add(i)}},e.prototype.hideLoading=function(){if(this._disposed){this.id;return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},e.prototype.makeActionFromEvent=function(t){var n=W({},t);return n.type=Ey[t.type],n},e.prototype.dispatchAction=function(t,n){if(this._disposed){this.id;return}if(Me(n)||(n={silent:!!n}),!!Dy[t.type]&&this._model){if(this[Ur]){this._pendingActions.push(t);return}var i=n.silent;h_.call(this,t,i);var a=n.flush;a?this._zr.flush():a!==!1&&Ze.browser.weChat&&this._throttledZrFlush(),rh.call(this,i),nh.call(this,i)}},e.prototype.updateLabelLayout=function(){Qi.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},e.prototype.appendData=function(t){if(this._disposed){this.id;return}var n=t.seriesIndex,i=this.getModel(),a=i.getSeriesByIndex(n);a.appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp()},e.internalField=function(){ic=function(f){var h=f._scheduler;h.restorePipelines(f._model),h.prepareStageTasks(),u_(f,!0),u_(f,!1),h.plan()},u_=function(f,h){for(var d=f._model,p=f._scheduler,v=h?f._componentsViews:f._chartsViews,m=h?f._componentsMap:f._chartsMap,g=f._zr,y=f._api,b=0;bh.get("hoverLayerThreshold")&&!Ze.node&&!Ze.worker&&h.eachSeries(function(m){if(!m.preventUsingHoverLayer){var g=f._chartsMap[m.__viewId];g.__alive&&g.eachRendered(function(y){y.states.emphasis&&(y.states.emphasis.hoverLayer=!0)})}})}function o(f,h){var d=f.get("blendMode")||null;h.eachRendered(function(p){p.isGroup||(p.style.blend=d)})}function s(f,h){if(!f.preventAutoZ){var d=f.get("z")||0,p=f.get("zlevel")||0;h.eachRendered(function(v){return l(v,d,p,-1/0),!0})}}function l(f,h,d,p){var v=f.getTextContent(),m=f.getTextGuideLine(),g=f.isGroup;if(g)for(var y=f.childrenRef(),b=0;b0?{duration:v,delay:d.get("delay"),easing:d.get("easing")}:null;h.eachRendered(function(g){if(g.states&&g.states.emphasis){if(Nc(g))return;if(g instanceof Xe&&due(g),g.__dirty){var y=g.prevStates;y&&g.useStates(y)}if(p){g.stateTransition=m;var b=g.getTextContent(),_=g.getTextGuideLine();b&&(b.stateTransition=m),_&&(_.stateTransition=m)}g.__dirty&&i(g)}})}MI=function(f){return new(function(h){z(d,h);function d(){return h!==null&&h.apply(this,arguments)||this}return d.prototype.getCoordinateSystems=function(){return f._coordSysMgr.getCoordinateSystems()},d.prototype.getComponentByElement=function(p){for(;p;){var v=p.__ecComponentInfo;if(v!=null)return f._model.getComponent(v.mainType,v.index);p=p.parent}},d.prototype.enterEmphasis=function(p,v){wo(p,v),Wn(f)},d.prototype.leaveEmphasis=function(p,v){So(p,v),Wn(f)},d.prototype.enterBlur=function(p){kz(p),Wn(f)},d.prototype.leaveBlur=function(p){AC(p),Wn(f)},d.prototype.enterSelect=function(p){Dz(p),Wn(f)},d.prototype.leaveSelect=function(p){Ez(p),Wn(f)},d.prototype.getModel=function(){return f.getModel()},d.prototype.getViewOfComponentModel=function(p){return f.getViewOfComponentModel(p)},d.prototype.getViewOfSeriesModel=function(p){return f.getViewOfSeriesModel(p)},d}(w6))(f)}}(),e}(gi),ZC=zhe.prototype;ZC.on=hF("on");ZC.off=hF("off");ZC.one=function(r,e,t){var n=this;function i(){for(var a=[],o=0;o=0)){EI.push(t);var a=X6.wrapStageHandler(t,i);a.__prio=e,a.__raw=t,r.push(a)}}function xF(r,e){z2[r]=e}function Yhe(r,e,t){var n=Ahe("registerMap");n&&n(r,e,t)}var qhe=lfe;Ru(KC,Rfe);Ru(a1,Ofe);Ru(a1,jfe);Ru(KC,Xfe);Ru(a1,Kfe);Ru(fF,The);bF(T6);_F(Dhe,$ce);xF("default",Nfe);za({type:tu,event:tu,update:tu},tr);za({type:Hm,event:Hm,update:Hm},tr);za({type:ld,event:ld,update:ld},tr);za({type:Gm,event:Gm,update:Gm},tr);za({type:ud,event:ud,update:ud},tr);yF("light",Yfe);yF("dark",Q6);var LI=[],Xhe={registerPreprocessor:bF,registerProcessor:_F,registerPostInit:Hhe,registerPostUpdate:Ghe,registerUpdateLifecycle:JC,registerAction:za,registerCoordinateSystem:Whe,registerLayout:Uhe,registerVisual:Ru,registerTransform:qhe,registerLoading:xF,registerMap:Yhe,registerImpl:Che,PRIORITY:Bhe,ComponentModel:Qe,ComponentView:zt,SeriesModel:It,ChartView:St,registerComponentModel:function(r){Qe.registerClass(r)},registerComponentView:function(r){zt.registerClass(r)},registerSeriesModel:function(r){It.registerClass(r)},registerChartView:function(r){St.registerClass(r)},registerSubTypeDefaulter:function(r,e){Qe.registerSubTypeDefaulter(r,e)},registerPainter:function(r,e){Pse(r,e)}};function Ue(r){if(q(r)){k(r,function(e){Ue(e)});return}He(LI,r)>=0||(LI.push(r),Te(r)&&(r={install:r}),r.install(Xhe))}function ih(r){return r==null?0:r.length||1}function II(r){return r}var To=function(){function r(e,t,n,i,a,o){this._old=e,this._new=t,this._oldKeyGetter=n||II,this._newKeyGetter=i||II,this.context=a,this._diffModeMultiple=o==="multiple"}return r.prototype.add=function(e){return this._add=e,this},r.prototype.update=function(e){return this._update=e,this},r.prototype.updateManyToOne=function(e){return this._updateManyToOne=e,this},r.prototype.updateOneToMany=function(e){return this._updateOneToMany=e,this},r.prototype.updateManyToMany=function(e){return this._updateManyToMany=e,this},r.prototype.remove=function(e){return this._remove=e,this},r.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},r.prototype._executeOneToOne=function(){var e=this._old,t=this._new,n={},i=new Array(e.length),a=new Array(t.length);this._initIndexMap(e,null,i,"_oldKeyGetter"),this._initIndexMap(t,n,a,"_newKeyGetter");for(var o=0;o1){var c=l.shift();l.length===1&&(n[s]=l[0]),this._update&&this._update(c,o)}else u===1?(n[s]=null,this._update&&this._update(l,o)):this._remove&&this._remove(o)}this._performRestAdd(a,n)},r.prototype._executeMultiple=function(){var e=this._old,t=this._new,n={},i={},a=[],o=[];this._initIndexMap(e,n,a,"_oldKeyGetter"),this._initIndexMap(t,i,o,"_newKeyGetter");for(var s=0;s1&&h===1)this._updateManyToOne&&this._updateManyToOne(c,u),i[l]=null;else if(f===1&&h>1)this._updateOneToMany&&this._updateOneToMany(c,u),i[l]=null;else if(f===1&&h===1)this._update&&this._update(c,u),i[l]=null;else if(f>1&&h>1)this._updateManyToMany&&this._updateManyToMany(c,u),i[l]=null;else if(f>1)for(var d=0;d1)for(var s=0;s30}var ah=Me,$o=K,tde=typeof Int32Array>"u"?Array:Int32Array,rde="e\0\0",PI=-1,nde=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],ide=["_approximateExtent"],RI,$v,oh,sh,v_,lh,m_,fn=function(){function r(e,t){this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","minmaxDownSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","minmaxDownSample","lttbDownSample"];var n,i=!1;SF(e)?(n=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(i=!0,n=e),n=n||["x","y"];for(var a={},o=[],s={},l=!1,u={},c=0;c=t)){var n=this._store,i=n.getProvider();this._updateOrdinalMeta();var a=this._nameList,o=this._idList,s=i.getSource().sourceFormat,l=s===yi;if(l&&!i.pure)for(var u=[],c=e;c0},r.prototype.ensureUniqueItemVisual=function(e,t){var n=this._itemVisuals,i=n[e];i||(i=n[e]={});var a=i[t];return a==null&&(a=this.getVisual(t),q(a)?a=a.slice():ah(a)&&(a=W({},a)),i[t]=a),a},r.prototype.setItemVisual=function(e,t,n){var i=this._itemVisuals[e]||{};this._itemVisuals[e]=i,ah(t)?W(i,t):i[t]=n},r.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},r.prototype.setLayout=function(e,t){ah(e)?W(this._layout,e):this._layout[e]=t},r.prototype.getLayout=function(e){return this._layout[e]},r.prototype.getItemLayout=function(e){return this._itemLayouts[e]},r.prototype.setItemLayout=function(e,t,n){this._itemLayouts[e]=n?W(this._itemLayouts[e]||{},t):t},r.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},r.prototype.setItemGraphicEl=function(e,t){var n=this.hostModel&&this.hostModel.seriesIndex;g2(n,this.dataType,e,t),this._graphicEls[e]=t},r.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},r.prototype.eachItemGraphicEl=function(e,t){k(this._graphicEls,function(n,i){n&&e&&e.call(t,n,i)})},r.prototype.cloneShallow=function(e){return e||(e=new r(this._schema?this._schema:$o(this.dimensions,this._getDimInfo,this),this.hostModel)),v_(e,this),e._store=this._store,e},r.prototype.wrapMethod=function(e,t){var n=this[e];Te(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var i=n.apply(this,arguments);return t.apply(this,[i].concat(uC(arguments)))})},r.internalField=function(){RI=function(e){var t=e._invertedIndicesMap;k(t,function(n,i){var a=e._dimInfos[i],o=a.ordinalMeta,s=e._store;if(o){n=t[i]=new tde(o.categories.length);for(var l=0;l1&&(l+="__ec__"+c),i[t]=l}}}(),r}();function Lp(r,e){HC(r)||(r=GC(r)),e=e||{};var t=e.coordDimensions||[],n=e.dimensionsDefine||r.dimensionsDefine||[],i=ve(),a=[],o=ode(r,t,n,e.dimensionsCount),s=e.canOmitUnusedDimensions&&AF(o),l=n===r.dimensionsDefine,u=l?CF(r):TF(n),c=e.encodeDefine;!c&&e.encodeDefaulter&&(c=e.encodeDefaulter(r,o));for(var f=ve(c),h=new O6(o),d=0;d0&&(n.name=i+(a-1)),a++,e.set(i,a)}}function ode(r,e,t,n){var i=Math.max(r.dimensionsDetectedCount||1,e.length,t.length,n||0);return k(e,function(a){var o;Me(a)&&(o=a.dimsDef)&&(i=Math.max(i,o.length))}),i}function sde(r,e,t){if(t||e.hasKey(r)){for(var n=0;e.hasKey(r+n);)n++;r+=n}return e.set(r,!0),r}var lde=function(){function r(e){this.coordSysDims=[],this.axisMap=ve(),this.categoryAxisMap=ve(),this.coordSysName=e}return r}();function ude(r){var e=r.get("coordinateSystem"),t=new lde(e),n=cde[e];if(n)return n(r,t,t.axisMap,t.categoryAxisMap),t}var cde={cartesian2d:function(r,e,t,n){var i=r.getReferringComponents("xAxis",lr).models[0],a=r.getReferringComponents("yAxis",lr).models[0];e.coordSysDims=["x","y"],t.set("x",i),t.set("y",a),ac(i)&&(n.set("x",i),e.firstCategoryDimIndex=0),ac(a)&&(n.set("y",a),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},singleAxis:function(r,e,t,n){var i=r.getReferringComponents("singleAxis",lr).models[0];e.coordSysDims=["single"],t.set("single",i),ac(i)&&(n.set("single",i),e.firstCategoryDimIndex=0)},polar:function(r,e,t,n){var i=r.getReferringComponents("polar",lr).models[0],a=i.findAxisModel("radiusAxis"),o=i.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],t.set("radius",a),t.set("angle",o),ac(a)&&(n.set("radius",a),e.firstCategoryDimIndex=0),ac(o)&&(n.set("angle",o),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},geo:function(r,e,t,n){e.coordSysDims=["lng","lat"]},parallel:function(r,e,t,n){var i=r.ecModel,a=i.getComponent("parallel",r.get("parallelIndex")),o=e.coordSysDims=a.dimensions.slice();k(a.parallelAxisIndex,function(s,l){var u=i.getComponent("parallelAxis",s),c=o[l];t.set(c,u),ac(u)&&(n.set(c,u),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=l))})}};function ac(r){return r.get("type")==="category"}function fde(r,e,t){t=t||{};var n=t.byIndex,i=t.stackedCoordDimension,a,o,s;hde(e)?a=e:(o=e.schema,a=o.dimensions,s=e.store);var l=!!(r&&r.get("stack")),u,c,f,h;if(k(a,function(y,b){se(y)&&(a[b]=y={name:y}),l&&!y.isExtraCoord&&(!n&&!u&&y.ordinalMeta&&(u=y),!c&&y.type!=="ordinal"&&y.type!=="time"&&(!i||i===y.coordDim)&&(c=y))}),c&&!n&&!u&&(n=!0),c){f="__\0ecstackresult_"+r.id,h="__\0ecstackedover_"+r.id,u&&(u.createInvertedIndices=!0);var d=c.coordDim,p=c.type,v=0;k(a,function(y){y.coordDim===d&&v++});var m={name:f,coordDim:d,coordDimIndex:v,type:p,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},g={name:h,coordDim:h,coordDimIndex:v+1,type:p,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};o?(s&&(m.storeDimIndex=s.ensureCalculationDimension(h,p),g.storeDimIndex=s.ensureCalculationDimension(f,p)),o.appendCalculationDimension(m),o.appendCalculationDimension(g)):(a.push(m),a.push(g))}return{stackedDimension:c&&c.name,stackedByDimension:u&&u.name,isStackedByIndex:n,stackedOverDimension:h,stackResultDimension:f}}function hde(r){return!SF(r.schema)}function Is(r,e){return!!e&&e===r.getCalculationInfo("stackedDimension")}function MF(r,e){return Is(r,e)?r.getCalculationInfo("stackResultDimension"):e}function dde(r,e){var t=r.get("coordinateSystem"),n=Dp.get(t),i;return e&&e.coordSysDims&&(i=K(e.coordSysDims,function(a){var o={name:a},s=e.axisMap.get(a);if(s){var l=s.get("type");o.type=Iy(l)}return o})),i||(i=n&&(n.getDimensionsInfo?n.getDimensionsInfo():n.dimensions.slice())||["x","y"]),i}function pde(r,e,t){var n,i;return t&&k(r,function(a,o){var s=a.coordDim,l=t.categoryAxisMap.get(s);l&&(n==null&&(n=o),a.ordinalMeta=l.getOrdinalMeta(),e&&(a.createInvertedIndices=!0)),a.otherDims.itemName!=null&&(i=!0)}),!i&&n!=null&&(r[n].otherDims.itemName=0),n}function Lo(r,e,t){t=t||{};var n=e.getSourceManager(),i,a=!1;r?(a=!0,i=GC(r)):(i=n.getSource(),a=i.sourceFormat===yi);var o=ude(e),s=dde(e,o),l=t.useEncodeDefaulter,u=Te(l)?l:l?Oe(y6,s,e):null,c={coordDimensions:s,generateCoord:t.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},f=Lp(i,c),h=pde(f.dimensions,t.createInvertedIndices,o),d=a?null:n.getSharedDataStore(f),p=fde(e,{schema:f,store:d}),v=new fn(f,e);v.setCalculationInfo(p);var m=h!=null&&vde(i)?function(g,y,b,_){return _===h?b:this.defaultDimValueGetter(g,y,b,_)}:null;return v.hasItemOption=!1,v.initData(a?i:d,null,m),v}function vde(r){if(r.sourceFormat===yi){var e=mde(r.data||[]);return!q(yf(e))}}function mde(r){for(var e=0;et[1]&&(t[1]=e[1])},r.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},r.prototype.getExtent=function(){return this._extent.slice()},r.prototype.setExtent=function(e,t){var n=this._extent;isNaN(e)||(n[0]=e),isNaN(t)||(n[1]=t)},r.prototype.isInExtentRange=function(e){return this._extent[0]<=e&&this._extent[1]>=e},r.prototype.isBlank=function(){return this._isBlank},r.prototype.setBlank=function(e){this._isBlank=e},r}();z0(Fa);var gde=0,F2=function(){function r(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this.uid=++gde}return r.createByAxisModel=function(e){var t=e.option,n=t.data,i=n&&K(n,yde);return new r({categories:i,needCollect:!i,deduplication:t.dedplication!==!1})},r.prototype.getOrdinal=function(e){return this._getOrCreateMap().get(e)},r.prototype.parseAndCollect=function(e){var t,n=this._needCollect;if(!se(e)&&!n)return e;if(n&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,t;var i=this._getOrCreateMap();return t=i.get(e),t==null&&(n?(t=this.categories.length,this.categories[t]=e,i.set(e,t)):t=NaN),t},r.prototype._getOrCreateMap=function(){return this._map||(this._map=ve(this.categories))},r}();function yde(r){return Me(r)&&r.value!=null?r.value:r+""}function V2(r){return r.type==="interval"||r.type==="log"}function bde(r,e,t,n){var i={},a=r[1]-r[0],o=i.interval=iz(a/e);t!=null&&on&&(o=i.interval=n);var s=i.intervalPrecision=kF(o),l=i.niceTickExtent=[Xt(Math.ceil(r[0]/o)*o,s),Xt(Math.floor(r[1]/o)*o,s)];return _de(l,r),i}function g_(r){var e=Math.pow(10,gC(r)),t=r/e;return t?t===2?t=3:t===3?t=5:t*=2:t=1,Xt(t*e)}function kF(r){return pa(r)+2}function OI(r,e,t){r[e]=Math.max(Math.min(r[e],t[1]),t[0])}function _de(r,e){!isFinite(r[0])&&(r[0]=e[0]),!isFinite(r[1])&&(r[1]=e[1]),OI(r,0,e),OI(r,1,e),r[0]>r[1]&&(r[0]=r[1])}function o1(r,e){return r>=e[0]&&r<=e[1]}function s1(r,e){return e[1]===e[0]?.5:(r-e[0])/(e[1]-e[0])}function l1(r,e){return r*(e[1]-e[0])+e[0]}var u1=function(r){z(e,r);function e(t){var n=r.call(this,t)||this;n.type="ordinal";var i=n.getSetting("ordinalMeta");return i||(i=new F2({})),q(i)&&(i=new F2({categories:K(i,function(a){return Me(a)?a.value:a})})),n._ordinalMeta=i,n._extent=n.getSetting("extent")||[0,i.categories.length-1],n}return e.prototype.parse=function(t){return t==null?NaN:se(t)?this._ordinalMeta.getOrdinal(t):Math.round(t)},e.prototype.contain=function(t){return t=this.parse(t),o1(t,this._extent)&&this._ordinalMeta.categories[t]!=null},e.prototype.normalize=function(t){return t=this._getTickNumber(this.parse(t)),s1(t,this._extent)},e.prototype.scale=function(t){return t=Math.round(l1(t,this._extent)),this.getRawOrdinalNumber(t)},e.prototype.getTicks=function(){for(var t=[],n=this._extent,i=n[0];i<=n[1];)t.push({value:i}),i++;return t},e.prototype.getMinorTicks=function(t){},e.prototype.setSortInfo=function(t){if(t==null){this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null;return}for(var n=t.ordinalNumbers,i=this._ordinalNumbersByTick=[],a=this._ticksByOrdinalNumber=[],o=0,s=this._ordinalMeta.categories.length,l=Math.min(s,n.length);o=0&&t=0&&t=t},e.prototype.getOrdinalMeta=function(){return this._ordinalMeta},e.prototype.calcNiceTicks=function(){},e.prototype.calcNiceExtent=function(){},e.type="ordinal",e}(Fa);Fa.registerClass(u1);var cl=Xt,Co=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="interval",t._interval=0,t._intervalPrecision=2,t}return e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return o1(t,this._extent)},e.prototype.normalize=function(t){return s1(t,this._extent)},e.prototype.scale=function(t){return l1(t,this._extent)},e.prototype.setExtent=function(t,n){var i=this._extent;isNaN(t)||(i[0]=parseFloat(t)),isNaN(n)||(i[1]=parseFloat(n))},e.prototype.unionExtent=function(t){var n=this._extent;t[0]n[1]&&(n[1]=t[1]),this.setExtent(n[0],n[1])},e.prototype.getInterval=function(){return this._interval},e.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=kF(t)},e.prototype.getTicks=function(t){var n=this._interval,i=this._extent,a=this._niceExtent,o=this._intervalPrecision,s=[];if(!n)return s;var l=1e4;i[0]l)return[];var c=s.length?s[s.length-1].value:a[1];return i[1]>c&&(t?s.push({value:cl(c+n,o)}):s.push({value:i[1]})),s},e.prototype.getMinorTicks=function(t){for(var n=this.getTicks(!0),i=[],a=this.getExtent(),o=1;oa[0]&&d0&&(a=a===null?s:Math.min(a,s))}t[n]=a}}return t}function IF(r){var e=Sde(r),t=[];return k(r,function(n){var i=n.coordinateSystem,a=i.getBaseAxis(),o=a.getExtent(),s;if(a.type==="category")s=a.getBandWidth();else if(a.type==="value"||a.type==="time"){var l=a.dim+"_"+a.index,u=e[l],c=Math.abs(o[1]-o[0]),f=a.scale.getExtent(),h=Math.abs(f[1]-f[0]);s=u?c/h*u:c}else{var d=n.getData();s=Math.abs(o[1]-o[0])/d.count()}var p=ie(n.get("barWidth"),s),v=ie(n.get("barMaxWidth"),s),m=ie(n.get("barMinWidth")||(NF(n)?.5:1),s),g=n.get("barGap"),y=n.get("barCategoryGap");t.push({bandWidth:s,barWidth:p,barMaxWidth:v,barMinWidth:m,barGap:g,barCategoryGap:y,axisKey:eA(a),stackId:EF(n)})}),PF(t)}function PF(r){var e={};k(r,function(n,i){var a=n.axisKey,o=n.bandWidth,s=e[a]||{bandWidth:o,remainedWidth:o,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},l=s.stacks;e[a]=s;var u=n.stackId;l[u]||s.autoWidthCount++,l[u]=l[u]||{width:0,maxWidth:0};var c=n.barWidth;c&&!l[u].width&&(l[u].width=c,c=Math.min(s.remainedWidth,c),s.remainedWidth-=c);var f=n.barMaxWidth;f&&(l[u].maxWidth=f);var h=n.barMinWidth;h&&(l[u].minWidth=h);var d=n.barGap;d!=null&&(s.gap=d);var p=n.barCategoryGap;p!=null&&(s.categoryGap=p)});var t={};return k(e,function(n,i){t[i]={};var a=n.stacks,o=n.bandWidth,s=n.categoryGap;if(s==null){var l=et(a).length;s=Math.max(35-l*4,15)+"%"}var u=ie(s,o),c=ie(n.gap,1),f=n.remainedWidth,h=n.autoWidthCount,d=(f-u)/(h+(h-1)*c);d=Math.max(d,0),k(a,function(g){var y=g.maxWidth,b=g.minWidth;if(g.width){var _=g.width;y&&(_=Math.min(_,y)),b&&(_=Math.max(_,b)),g.width=_,f-=_+c*_,h--}else{var _=d;y&&y<_&&(_=Math.min(y,f)),b&&b>_&&(_=b),_!==d&&(g.width=_,f-=_+c*_,h--)}}),d=(f-u)/(h+(h-1)*c),d=Math.max(d,0);var p=0,v;k(a,function(g,y){g.width||(g.width=d),v=g,p+=g.width*(1+c)}),v&&(p-=v.width*c);var m=-p/2;k(a,function(g,y){t[i][y]=t[i][y]||{bandWidth:o,offset:m,width:g.width},m+=g.width*(1+c)})}),t}function Tde(r,e,t){if(r&&e){var n=r[eA(e)];return n}}function RF(r,e){var t=LF(r,e),n=IF(t);k(t,function(i){var a=i.getData(),o=i.coordinateSystem,s=o.getBaseAxis(),l=EF(i),u=n[eA(s)][l],c=u.offset,f=u.width;a.setLayout({bandWidth:u.bandWidth,offset:c,size:f})})}function OF(r){return{seriesType:r,plan:Af(),reset:function(e){if(jF(e)){var t=e.getData(),n=e.coordinateSystem,i=n.getBaseAxis(),a=n.getOtherAxis(i),o=t.getDimensionIndex(t.mapDimension(a.dim)),s=t.getDimensionIndex(t.mapDimension(i.dim)),l=e.get("showBackground",!0),u=t.mapDimension(a.dim),c=t.getCalculationInfo("stackResultDimension"),f=Is(t,u)&&!!t.getCalculationInfo("stackedOnSeries"),h=a.isHorizontal(),d=Cde(i,a),p=NF(e),v=e.get("barMinHeight")||0,m=c&&t.getDimensionIndex(c),g=t.getLayout("size"),y=t.getLayout("offset");return{progress:function(b,_){for(var x=b.count,w=p&&ma(x*3),S=p&&l&&ma(x*3),T=p&&ma(x),C=n.master.getRect(),A=h?C.width:C.height,M,D=_.getStore(),E=0;(M=b.next())!=null;){var L=D.get(f?m:o,M),I=D.get(s,M),R=d,P=void 0;f&&(P=+L-D.get(o,M));var O=void 0,j=void 0,F=void 0,N=void 0;if(h){var B=n.dataToPoint([L,I]);if(f){var $=n.dataToPoint([P,I]);R=$[0]}O=R,j=B[1]+y,F=B[0]-R,N=g,Math.abs(F)0?t:1:t))}var Ade=function(r,e,t,n){for(;t>>1;r[i][1]i&&(this._approxInterval=i);var s=Hv.length,l=Math.min(Ade(Hv,this._approxInterval,0,s),s-1);this._interval=Hv[l][1],this._minLevelUnit=Hv[Math.max(l-1,0)][0]},e.prototype.parse=function(t){return lt(t)?t:+Pa(t)},e.prototype.contain=function(t){return o1(this.parse(t),this._extent)},e.prototype.normalize=function(t){return s1(this.parse(t),this._extent)},e.prototype.scale=function(t){return l1(t,this._extent)},e.type="time",e}(Co),Hv=[["second",OC],["minute",jC],["hour",fd],["quarter-day",fd*6],["half-day",fd*12],["day",li*1.2],["half-week",li*3.5],["week",li*7],["month",li*31],["quarter",li*95],["half-year",CL/2],["year",CL]];function Mde(r,e,t,n){var i=Pa(e),a=Pa(t),o=function(p){return ML(i,p,n)===ML(a,p,n)},s=function(){return o("year")},l=function(){return s()&&o("month")},u=function(){return l()&&o("day")},c=function(){return u()&&o("hour")},f=function(){return c()&&o("minute")},h=function(){return f()&&o("second")},d=function(){return h()&&o("millisecond")};switch(r){case"year":return s();case"month":return l();case"day":return u();case"hour":return c();case"minute":return f();case"second":return h();case"millisecond":return d()}}function kde(r,e){return r/=li,r>16?16:r>7.5?7:r>3.5?4:r>1.5?2:1}function Dde(r){var e=30*li;return r/=e,r>6?6:r>3?3:r>2?2:1}function Ede(r){return r/=fd,r>12?12:r>6?6:r>3.5?4:r>2?2:1}function jI(r,e){return r/=e?jC:OC,r>30?30:r>20?20:r>15?15:r>10?10:r>5?5:r>2?2:1}function Lde(r){return iz(r)}function Ide(r,e,t){var n=new Date(r);switch(zc(e)){case"year":case"month":n[n6(t)](0);case"day":n[i6(t)](1);case"hour":n[a6(t)](0);case"minute":n[o6(t)](0);case"second":n[s6(t)](0),n[l6(t)](0)}return n.getTime()}function Pde(r,e,t,n){var i=1e4,a=t6,o=0;function s(A,M,D,E,L,I,R){for(var P=new Date(M),O=M,j=P[E]();O1&&I===0&&D.unshift({value:D[0].value-O})}}for(var I=0;I=n[0]&&y<=n[1]&&f++)}var b=(n[1]-n[0])/e;if(f>b*1.5&&h>b/1.5||(u.push(m),f>b||r===a[d]))break}c=[]}}}for(var _=pt(K(u,function(A){return pt(A,function(M){return M.value>=n[0]&&M.value<=n[1]&&!M.notAdd})}),function(A){return A.length>0}),x=[],w=_.length-1,d=0;d<_.length;++d)for(var S=_[d],T=0;T0;)a*=10;var s=[Xt(jde(n[0]/a)*a),Xt(Ode(n[1]/a)*a)];this._interval=a,this._niceExtent=s}},e.prototype.calcNiceExtent=function(t){dd.calcNiceExtent.call(this,t),this._fixMin=t.fixMin,this._fixMax=t.fixMax},e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return t=xi(t)/xi(this.base),o1(t,this._extent)},e.prototype.normalize=function(t){return t=xi(t)/xi(this.base),s1(t,this._extent)},e.prototype.scale=function(t){return t=l1(t,this._extent),Gv(this.base,t)},e.type="log",e}(Fa),BF=rA.prototype;BF.getMinorTicks=dd.getMinorTicks;BF.getLabel=dd.getLabel;function Wv(r,e){return Rde(r,pa(e))}Fa.registerClass(rA);var Nde=function(){function r(e,t,n){this._prepareParams(e,t,n)}return r.prototype._prepareParams=function(e,t,n){n[1]0&&l>0&&!u&&(s=0),s<0&&l<0&&!c&&(l=0));var h=this._determinedMin,d=this._determinedMax;return h!=null&&(s=h,u=!0),d!=null&&(l=d,c=!0),{min:s,max:l,minFixed:u,maxFixed:c,isBlank:f}},r.prototype.modifyDataMinMax=function(e,t){this[zde[e]]=t},r.prototype.setDeterminedMinMax=function(e,t){var n=Bde[e];this[n]=t},r.prototype.freeze=function(){this.frozen=!0},r}(),Bde={min:"_determinedMin",max:"_determinedMax"},zde={min:"_dataMin",max:"_dataMax"};function zF(r,e,t){var n=r.rawExtentInfo;return n||(n=new Nde(r,e,t),r.rawExtentInfo=n,n)}function Uv(r,e){return e==null?null:Od(e)?NaN:r.parse(e)}function FF(r,e){var t=r.type,n=zF(r,e,r.getExtent()).calculate();r.setBlank(n.isBlank);var i=n.min,a=n.max,o=e.ecModel;if(o&&t==="time"){var s=LF("bar",o),l=!1;if(k(s,function(f){l=l||f.getBaseAxis()===e.axis}),l){var u=IF(s),c=Fde(i,a,e,u);i=c.min,a=c.max}}return{extent:[i,a],fixMin:n.minFixed,fixMax:n.maxFixed}}function Fde(r,e,t,n){var i=t.axis.getExtent(),a=Math.abs(i[1]-i[0]),o=Tde(n,t.axis);if(o===void 0)return{min:r,max:e};var s=1/0;k(o,function(d){s=Math.min(d.offset,s)});var l=-1/0;k(o,function(d){l=Math.max(d.offset+d.width,l)}),s=Math.abs(s),l=Math.abs(l);var u=s+l,c=e-r,f=1-(s+l)/a,h=c/f-c;return e+=h*(l/u),r-=h*(s/u),{min:r,max:e}}function nf(r,e){var t=e,n=FF(r,t),i=n.extent,a=t.get("splitNumber");r instanceof rA&&(r.base=t.get("logBase"));var o=r.type,s=t.get("interval"),l=o==="interval"||o==="time";r.setExtent(i[0],i[1]),r.calcNiceExtent({splitNumber:a,fixMin:n.fixMin,fixMax:n.fixMax,minInterval:l?t.get("minInterval"):null,maxInterval:l?t.get("maxInterval"):null}),s!=null&&r.setInterval&&r.setInterval(s)}function c1(r,e){if(e=e||r.get("type"),e)switch(e){case"category":return new u1({ordinalMeta:r.getOrdinalMeta?r.getOrdinalMeta():r.getCategories(),extent:[1/0,-1/0]});case"time":return new tA({locale:r.ecModel.getLocaleModel(),useUTC:r.ecModel.get("useUTC")});default:return new(Fa.getClass(e)||Co)}}function Vde(r){var e=r.scale.getExtent(),t=e[0],n=e[1];return!(t>0&&n>0||t<0&&n<0)}function Df(r){var e=r.getLabelModel().get("formatter"),t=r.type==="category"?r.scale.getExtent()[0]:null;return r.scale.type==="time"?function(n){return function(i,a){return r.scale.getFormattedLabel(i,a,n)}}(e):se(e)?function(n){return function(i){var a=r.scale.getLabel(i),o=n.replace("{value}",a??"");return o}}(e):Te(e)?function(n){return function(i,a){return t!=null&&(a=i.value-t),n(nA(r,i),a,i.level!=null?{level:i.level}:null)}}(e):function(n){return r.scale.getLabel(n)}}function nA(r,e){return r.type==="category"?r.scale.getLabel(e):e.value}function $de(r){var e=r.model,t=r.scale;if(!(!e.get(["axisLabel","show"])||t.isBlank())){var n,i,a=t.getExtent();t instanceof u1?i=t.count():(n=t.getTicks(),i=n.length);var o=r.getLabelModel(),s=Df(r),l,u=1;i>40&&(u=Math.ceil(i/40));for(var c=0;cr[1]&&(r[1]=i[1])})}var Ip=function(){function r(){}return r.prototype.getNeedCrossZero=function(){var e=this.option;return!e.scale},r.prototype.getCoordSysModel=function(){},r}(),Wde=1e-8;function BI(r,e){return Math.abs(r-e)i&&(n=o,i=l)}if(n)return Yde(n.exterior);var u=this.getBoundingRect();return[u.x+u.width/2,u.y+u.height/2]},e.prototype.getBoundingRect=function(t){var n=this._rect;if(n&&!t)return n;var i=[1/0,1/0],a=[-1/0,-1/0],o=this.geometries;return k(o,function(s){s.type==="polygon"?zI(s.exterior,i,a,t):k(s.points,function(l){zI(l,i,a,t)})}),isFinite(i[0])&&isFinite(i[1])&&isFinite(a[0])&&isFinite(a[1])||(i[0]=i[1]=a[0]=a[1]=0),n=new Ve(i[0],i[1],a[0]-i[0],a[1]-i[1]),t||(this._rect=n),n},e.prototype.contain=function(t){var n=this.getBoundingRect(),i=this.geometries;if(!n.contain(t[0],t[1]))return!1;e:for(var a=0,o=i.length;a>1^-(s&1),l=l>>1^-(l&1),s+=i,l+=a,i=s,a=l,n.push([s/t,l/t])}return n}function Kde(r,e){return r=Xde(r),K(pt(r.features,function(t){return t.geometry&&t.properties&&t.geometry.coordinates.length>0}),function(t){var n=t.properties,i=t.geometry,a=[];switch(i.type){case"Polygon":var o=i.coordinates;a.push(new FI(o[0],o.slice(1)));break;case"MultiPolygon":k(i.coordinates,function(l){l[0]&&a.push(new FI(l[0],l.slice(1)))});break;case"LineString":a.push(new VI([i.coordinates]));break;case"MultiLineString":a.push(new VI(i.coordinates))}var s=new HF(n[e||"name"],a,n.cp);return s.properties=n,s})}var Zd=it();function WF(r,e){var t=K(e,function(n){return r.scale.parse(n)});return r.type==="time"&&t.length>0&&(t.sort(),t.unshift(t[0]),t.push(t[t.length-1])),t}function Zde(r){var e=r.getLabelModel().get("customValues");if(e){var t=Df(r),n=r.scale.getExtent(),i=WF(r,e),a=pt(i,function(o){return o>=n[0]&&o<=n[1]});return{labels:K(a,function(o){var s={value:o};return{formattedLabel:t(s),rawLabel:r.scale.getLabel(s),tickValue:o}})}}return r.type==="category"?Qde(r):tpe(r)}function Jde(r,e){var t=r.getTickModel().get("customValues");if(t){var n=r.scale.getExtent(),i=WF(r,t);return{ticks:pt(i,function(a){return a>=n[0]&&a<=n[1]})}}return r.type==="category"?epe(r,e):{ticks:K(r.scale.getTicks(),function(a){return a.value})}}function Qde(r){var e=r.getLabelModel(),t=UF(r,e);return!e.get("show")||r.scale.isBlank()?{labels:[],labelCategoryInterval:t.labelCategoryInterval}:t}function UF(r,e){var t=YF(r,"labels"),n=iA(e),i=qF(t,n);if(i)return i;var a,o;return Te(n)?a=ZF(r,n):(o=n==="auto"?rpe(r):n,a=KF(r,o)),XF(t,n,{labels:a,labelCategoryInterval:o})}function epe(r,e){var t=YF(r,"ticks"),n=iA(e),i=qF(t,n);if(i)return i;var a,o;if((!e.get("show")||r.scale.isBlank())&&(a=[]),Te(n))a=ZF(r,n,!0);else if(n==="auto"){var s=UF(r,r.getLabelModel());o=s.labelCategoryInterval,a=K(s.labels,function(l){return l.tickValue})}else o=n,a=KF(r,o,!0);return XF(t,n,{ticks:a,tickCategoryInterval:o})}function tpe(r){var e=r.scale.getTicks(),t=Df(r);return{labels:K(e,function(n,i){return{level:n.level,formattedLabel:t(n,i),rawLabel:r.scale.getLabel(n),tickValue:n.value}})}}function YF(r,e){return Zd(r)[e]||(Zd(r)[e]=[])}function qF(r,e){for(var t=0;t40&&(s=Math.max(1,Math.floor(o/40)));for(var l=a[0],u=r.dataToCoord(l+1)-r.dataToCoord(l),c=Math.abs(u*Math.cos(n)),f=Math.abs(u*Math.sin(n)),h=0,d=0;l<=a[1];l+=s){var p=0,v=0,m=xp(t({value:l}),e.font,"center","top");p=m.width*1.3,v=m.height*1.3,h=Math.max(h,p,7),d=Math.max(d,v,7)}var g=h/c,y=d/f;isNaN(g)&&(g=1/0),isNaN(y)&&(y=1/0);var b=Math.max(0,Math.floor(Math.min(g,y))),_=Zd(r.model),x=r.getExtent(),w=_.lastAutoInterval,S=_.lastTickCount;return w!=null&&S!=null&&Math.abs(w-b)<=1&&Math.abs(S-o)<=1&&w>b&&_.axisExtent0===x[0]&&_.axisExtent1===x[1]?b=w:(_.lastTickCount=o,_.lastAutoInterval=b,_.axisExtent0=x[0],_.axisExtent1=x[1]),b}function ipe(r){var e=r.getLabelModel();return{axisRotate:r.getRotate?r.getRotate():r.isHorizontal&&!r.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}function KF(r,e,t){var n=Df(r),i=r.scale,a=i.getExtent(),o=r.getLabelModel(),s=[],l=Math.max((e||0)+1,1),u=a[0],c=i.count();u!==0&&l>1&&c/l>2&&(u=Math.round(Math.ceil(u/l)*l));var f=VF(r),h=o.get("showMinLabel")||f,d=o.get("showMaxLabel")||f;h&&u!==a[0]&&v(a[0]);for(var p=u;p<=a[1];p+=l)v(p);d&&p-l!==a[1]&&v(a[1]);function v(m){var g={value:m};s.push(t?m:{formattedLabel:n(g),rawLabel:i.getLabel(g),tickValue:m})}return s}function ZF(r,e,t){var n=r.scale,i=Df(r),a=[];return k(n.getTicks(),function(o){var s=n.getLabel(o),l=o.value;e(o.value,s)&&a.push(t?l:{formattedLabel:i(o),rawLabel:s,tickValue:l})}),a}var $I=[0,1],Gi=function(){function r(e,t,n){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=t,this._extent=n||[0,0]}return r.prototype.contain=function(e){var t=this._extent,n=Math.min(t[0],t[1]),i=Math.max(t[0],t[1]);return e>=n&&e<=i},r.prototype.containData=function(e){return this.scale.contain(e)},r.prototype.getExtent=function(){return this._extent.slice()},r.prototype.getPixelPrecision=function(e){return rz(e||this.scale.getExtent(),this._extent)},r.prototype.setExtent=function(e,t){var n=this._extent;n[0]=e,n[1]=t},r.prototype.dataToCoord=function(e,t){var n=this._extent,i=this.scale;return e=i.normalize(e),this.onBand&&i.type==="ordinal"&&(n=n.slice(),HI(n,i.count())),bt(e,$I,n,t)},r.prototype.coordToData=function(e,t){var n=this._extent,i=this.scale;this.onBand&&i.type==="ordinal"&&(n=n.slice(),HI(n,i.count()));var a=bt(e,n,$I,t);return this.scale.scale(a)},r.prototype.pointToData=function(e,t){},r.prototype.getTicksCoords=function(e){e=e||{};var t=e.tickModel||this.getTickModel(),n=Jde(this,t),i=n.ticks,a=K(i,function(s){return{coord:this.dataToCoord(this.scale.type==="ordinal"?this.scale.getRawOrdinalNumber(s):s),tickValue:s}},this),o=t.get("alignWithLabel");return ape(this,a,o,e.clamp),a},r.prototype.getMinorTicksCoords=function(){if(this.scale.type==="ordinal")return[];var e=this.model.getModel("minorTick"),t=e.get("splitNumber");t>0&&t<100||(t=5);var n=this.scale.getMinorTicks(t),i=K(n,function(a){return K(a,function(o){return{coord:this.dataToCoord(o),tickValue:o}},this)},this);return i},r.prototype.getViewLabels=function(){return Zde(this).labels},r.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},r.prototype.getTickModel=function(){return this.model.getModel("axisTick")},r.prototype.getBandWidth=function(){var e=this._extent,t=this.scale.getExtent(),n=t[1]-t[0]+(this.onBand?1:0);n===0&&(n=1);var i=Math.abs(e[1]-e[0]);return Math.abs(i)/n},r.prototype.calculateCategoryInterval=function(){return npe(this)},r}();function HI(r,e){var t=r[1]-r[0],n=e,i=t/n/2;r[0]+=i,r[1]-=i}function ape(r,e,t,n){var i=e.length;if(!r.onBand||t||!i)return;var a=r.getExtent(),o,s;if(i===1)e[0].coord=a[0],o=e[1]={coord:a[1],tickValue:e[0].tickValue};else{var l=e[i-1].tickValue-e[0].tickValue,u=(e[i-1].coord-e[0].coord)/l;k(e,function(d){d.coord-=u/2});var c=r.scale.getExtent();s=1+c[1]-e[i-1].tickValue,o={coord:e[i-1].coord+u*s,tickValue:c[1]+1},e.push(o)}var f=a[0]>a[1];h(e[0].coord,a[0])&&(n?e[0].coord=a[0]:e.shift()),n&&h(a[0],e[0].coord)&&e.unshift({coord:a[0]}),h(a[1],o.coord)&&(n?o.coord=a[1]:e.pop()),n&&h(o.coord,a[1])&&e.push({coord:a[1]});function h(d,p){return d=Xt(d),p=Xt(p),f?d>p:di&&(i+=uh);var d=Math.atan2(s,o);if(d<0&&(d+=uh),d>=n&&d<=i||d+uh>=n&&d+uh<=i)return l[0]=c,l[1]=f,u-t;var p=t*Math.cos(n)+r,v=t*Math.sin(n)+e,m=t*Math.cos(i)+r,g=t*Math.sin(i)+e,y=(p-o)*(p-o)+(v-s)*(v-s),b=(m-o)*(m-o)+(g-s)*(g-s);return y0){e=e/180*Math.PI,Ii.fromArray(r[0]),Mt.fromArray(r[1]),Jt.fromArray(r[2]),ze.sub(ga,Ii,Mt),ze.sub(ca,Jt,Mt);var t=ga.len(),n=ca.len();if(!(t<.001||n<.001)){ga.scale(1/t),ca.scale(1/n);var i=ga.dot(ca),a=Math.cos(e);if(a1&&ze.copy(ln,Jt),ln.toArray(r[1])}}}}function fpe(r,e,t){if(t<=180&&t>0){t=t/180*Math.PI,Ii.fromArray(r[0]),Mt.fromArray(r[1]),Jt.fromArray(r[2]),ze.sub(ga,Mt,Ii),ze.sub(ca,Jt,Mt);var n=ga.len(),i=ca.len();if(!(n<.001||i<.001)){ga.scale(1/n),ca.scale(1/i);var a=ga.dot(e),o=Math.cos(t);if(a=l)ze.copy(ln,Jt);else{ln.scaleAndAdd(ca,s/Math.tan(Math.PI/2-c));var f=Jt.x!==Mt.x?(ln.x-Mt.x)/(Jt.x-Mt.x):(ln.y-Mt.y)/(Jt.y-Mt.y);if(isNaN(f))return;f<0?ze.copy(ln,Mt):f>1&&ze.copy(ln,Jt)}ln.toArray(r[1])}}}}function __(r,e,t,n){var i=t==="normal",a=i?r:r.ensureState(t);a.ignore=e;var o=n.get("smooth");o&&o===!0&&(o=.3),a.shape=a.shape||{},o>0&&(a.shape.smooth=o);var s=n.getModel("lineStyle").getLineStyle();i?r.useStyle(s):a.style=s}function hpe(r,e){var t=e.smooth,n=e.points;if(n)if(r.moveTo(n[0][0],n[0][1]),t>0&&n.length>=3){var i=ss(n[0],n[1]),a=ss(n[1],n[2]);if(!i||!a){r.lineTo(n[1][0],n[1][1]),r.lineTo(n[2][0],n[2][1]);return}var o=Math.min(i,a)*t,s=Nm([],n[1],n[0],o/i),l=Nm([],n[1],n[2],o/a),u=Nm([],s,l,.5);r.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),r.bezierCurveTo(l[0],l[1],l[0],l[1],n[2][0],n[2][1])}else for(var c=1;c0){b(C*T,0,o);var A=C+w;A<0&&_(-A*T,1)}else _(-w*T,1)}}function b(w,S,T){w!==0&&(u=!0);for(var C=S;C0)for(var A=0;A0;A--){var L=T[A-1]*E;b(-L,A,o)}}}function x(w){var S=w<0?-1:1;w=Math.abs(w);for(var T=Math.ceil(w/(o-1)),C=0;C0?b(T,0,C+1):b(-T,o-C-1,o),w-=T,w<=0)return}return u}function dpe(r,e,t,n){return tV(r,"x","width",e,t)}function rV(r,e,t,n){return tV(r,"y","height",e,t)}function nV(r){var e=[];r.sort(function(v,m){return m.priority-v.priority});var t=new Ve(0,0,0,0);function n(v){if(!v.ignore){var m=v.ensureState("emphasis");m.ignore==null&&(m.ignore=!1)}v.ignore=!0}for(var i=0;i=0&&n.attr(a.oldLayoutSelect),He(h,"emphasis")>=0&&n.attr(a.oldLayoutEmphasis)),ut(n,u,t,l)}else if(n.attr(u),!xf(n).valueAnimation){var f=Re(n.style.opacity,1);n.style.opacity=0,Ot(n,{style:{opacity:f}},t,l)}if(a.oldLayout=u,n.states.select){var d=a.oldLayoutSelect={};Yv(d,u,qv),Yv(d,n.states.select,qv)}if(n.states.emphasis){var p=a.oldLayoutEmphasis={};Yv(p,u,qv),Yv(p,n.states.emphasis,qv)}Kz(n,l,c,t,t)}if(i&&!i.ignore&&!i.invisible){var a=mpe(i),o=a.oldLayout,v={points:i.shape.points};o?(i.attr({shape:o}),ut(i,{shape:v},t)):(i.setShape(v),i.style.strokePercent=0,Ot(i,{style:{strokePercent:1}},t)),a.oldLayout=v}},r}(),w_=it();function ype(r){r.registerUpdateLifecycle("series:beforeupdate",function(e,t,n){var i=w_(t).labelManager;i||(i=w_(t).labelManager=new gpe),i.clearLabels()}),r.registerUpdateLifecycle("series:layoutlabels",function(e,t,n){var i=w_(t).labelManager;n.updatedSeries.forEach(function(a){i.addLabelsOfSeries(t.getViewOfSeriesModel(a))}),i.updateLayoutConfig(t),i.layout(t),i.processLabelsOverall()})}var S_=Math.sin,T_=Math.cos,iV=Math.PI,hl=Math.PI*2,bpe=180/iV,aV=function(){function r(){}return r.prototype.reset=function(e){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,e||4)},r.prototype.moveTo=function(e,t){this._add("M",e,t)},r.prototype.lineTo=function(e,t){this._add("L",e,t)},r.prototype.bezierCurveTo=function(e,t,n,i,a,o){this._add("C",e,t,n,i,a,o)},r.prototype.quadraticCurveTo=function(e,t,n,i){this._add("Q",e,t,n,i)},r.prototype.arc=function(e,t,n,i,a,o){this.ellipse(e,t,n,n,0,i,a,o)},r.prototype.ellipse=function(e,t,n,i,a,o,s,l){var u=s-o,c=!l,f=Math.abs(u),h=hs(f-hl)||(c?u>=hl:-u>=hl),d=u>0?u%hl:u%hl+hl,p=!1;h?p=!0:hs(f)?p=!1:p=d>=iV==!!c;var v=e+n*T_(o),m=t+i*S_(o);this._start&&this._add("M",v,m);var g=Math.round(a*bpe);if(h){var y=1/this._p,b=(c?1:-1)*(hl-y);this._add("A",n,i,g,1,+c,e+n*T_(o+b),t+i*S_(o+b)),y>.01&&this._add("A",n,i,g,0,+c,v,m)}else{var _=e+n*T_(s),x=t+i*S_(s);this._add("A",n,i,g,+p,+c,_,x)}},r.prototype.rect=function(e,t,n,i){this._add("M",e,t),this._add("l",n,0),this._add("l",0,i),this._add("l",-n,0),this._add("Z")},r.prototype.closePath=function(){this._d.length>0&&this._add("Z")},r.prototype._add=function(e,t,n,i,a,o,s,l,u){for(var c=[],f=this._p,h=1;h"}function kpe(r){return""}function lA(r,e){e=e||{};var t=e.newline?` `:"";function n(i){var a=i.children,o=i.tag,s=i.attrs,l=i.text;return Mpe(o,s)+(o!=="style"?un(l):l||"")+(a?""+t+K(a,function(u){return n(u)}).join(t)+t:"")+kpe(o)}return n(r)}function Dpe(r,e,t){t=t||{};var n=t.newline?` `:"",i=" {"+n,a=n+"}",o=K(et(r),function(l){return l+i+K(et(r[l]),function(u){return u+":"+r[l][u]+";"}).join(n)+a}).join(n),s=K(et(e),function(l){return"@keyframes "+l+i+K(et(e[l]),function(u){return u+i+K(et(e[l][u]),function(c){var f=e[l][u][c];return c==="d"&&(f='path("'+f+'")'),c+":"+f+";"}).join(n)+a}).join(n)+a}).join(n);return!o&&!s?"":[""].join(n)}function G2(r){return{zrId:r,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function YI(r,e,t,n){return wr("svg","root",{width:r,height:e,xmlns:oV,"xmlns:xlink":sV,version:"1.1",baseProfile:"full",viewBox:n?"0 0 "+r+" "+e:!1},t)}var Epe=0;function uV(){return Epe++}var qI={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},ml="transform-origin";function Lpe(r,e,t){var n=W({},r.shape);W(n,e),r.buildPath(t,n);var i=new aV;return i.reset(YB(r)),t.rebuildPath(i,1),i.generateStr(),i.getStr()}function Ipe(r,e){var t=e.originX,n=e.originY;(t||n)&&(r[ml]=t+"px "+n+"px")}var Ppe={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function cV(r,e){var t=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[t]=r,t}function Rpe(r,e,t){var n=r.shape.paths,i={},a,o;if(k(n,function(l){var u=G2(t.zrId);u.animation=!0,f1(l,{},u,!0);var c=u.cssAnims,f=u.cssNodes,h=et(c),d=h.length;if(d){o=h[d-1];var p=c[o];for(var v in p){var m=p[v];i[v]=i[v]||{d:""},i[v].d+=m.d||""}for(var g in f){var y=f[g].animation;y.indexOf(o)>=0&&(a=y)}}}),!!a){e.d=!1;var s=cV(i,t);return a.replace(o,s)}}function XI(r){return se(r)?qI[r]?"cubic-bezier("+qI[r]+")":pC(r)?r:"":""}function f1(r,e,t,n){var i=r.animators,a=i.length,o=[];if(r instanceof DC){var s=Rpe(r,e,t);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var l={},u=0;u0}).length){var Ye=cV(S,t);return Ye+" "+y[0]+" both"}}for(var m in l){var s=v(l[m]);s&&o.push(s)}if(o.length){var g=t.zrId+"-cls-"+uV();t.cssNodes["."+g]={animation:o.join(",")},e.class=g}}function Ope(r,e,t){if(!r.ignore)if(r.isSilent()){var n={"pointer-events":"none"};KI(n,e,t)}else{var i=r.states.emphasis&&r.states.emphasis.style?r.states.emphasis.style:{},a=i.fill;if(!a){var o=r.style&&r.style.fill,s=r.states.select&&r.states.select.style&&r.states.select.style.fill,l=r.currentStates.indexOf("select")>=0&&s||o;l&&(a=r2(l))}var u=i.lineWidth;if(u){var c=!i.strokeNoScale&&r.transform?r.transform[0]:1;u=u/c}var n={cursor:"pointer"};a&&(n.fill=a),i.stroke&&(n.stroke=i.stroke),u&&(n["stroke-width"]=u),KI(n,e,t)}}function KI(r,e,t,n){var i=JSON.stringify(r),a=t.cssStyleCache[i];a||(a=t.zrId+"-cls-"+uV(),t.cssStyleCache[i]=a,t.cssNodes["."+a+":hover"]=r),e.class=e.class?e.class+" "+a:a}var Jd=Math.round;function fV(r){return r&&se(r.src)}function hV(r){return r&&Te(r.toDataURL)}function uA(r,e,t,n){Tpe(function(i,a){var o=i==="fill"||i==="stroke";o&&UB(a)?pV(e,r,i,n):o&&vC(a)?vV(t,r,i,n):r[i]=a,o&&n.ssr&&a==="none"&&(r["pointer-events"]="visible")},e,t,!1),$pe(t,r,n)}function cA(r,e){var t=Rse(e);t&&(t.each(function(n,i){n!=null&&(r[(UI+i).toLowerCase()]=n+"")}),e.isSilent()&&(r[UI+"silent"]="true"))}function ZI(r){return hs(r[0]-1)&&hs(r[1])&&hs(r[2])&&hs(r[3]-1)}function jpe(r){return hs(r[4])&&hs(r[5])}function fA(r,e,t){if(e&&!(jpe(e)&&ZI(e))){var n=1e4;r.transform=ZI(e)?"translate("+Jd(e[4]*n)/n+" "+Jd(e[5]*n)/n+")":nse(e)}}function JI(r,e,t){for(var n=r.points,i=[],a=0;a"u"){var m="Image width/height must been given explictly in svg-ssr renderer.";vn(h,m),vn(d,m)}else if(h==null||d==null){var g=function(A,M){if(A){var D=A.elm,E=h||M.width,L=d||M.height;A.tag==="pattern"&&(u?(L=1,E/=a.width):c&&(E=1,L/=a.height)),A.attrs.width=E,A.attrs.height=L,D&&(D.setAttribute("width",E),D.setAttribute("height",L))}},y=xC(p,null,r,function(A){l||g(w,A),g(f,A)});y&&y.width&&y.height&&(h=h||y.width,d=d||y.height)}f=wr("image","img",{href:p,width:h,height:d}),o.width=h,o.height=d}else i.svgElement&&(f=ke(i.svgElement),o.width=i.svgWidth,o.height=i.svgHeight);if(f){var b,_;l?b=_=1:u?(_=1,b=o.width/a.width):c?(b=1,_=o.height/a.height):o.patternUnits="userSpaceOnUse",b!=null&&!isNaN(b)&&(o.width=b),_!=null&&!isNaN(_)&&(o.height=_);var x=qB(i);x&&(o.patternTransform=x);var w=wr("pattern","",o,[f]),S=lA(w),T=n.patternCache,C=T[S];C||(C=n.zrId+"-p"+n.patternIdx++,T[S]=C,o.id=C,w=n.defs[C]=wr("pattern",C,o,[f])),e[t]=j0(C)}}function Hpe(r,e,t){var n=t.clipPathCache,i=t.defs,a=n[r.id];if(!a){a=t.zrId+"-c"+t.clipPathIdx++;var o={id:a};n[r.id]=a,i[a]=wr("clipPath",a,o,[dV(r,t)])}e["clip-path"]=j0(a)}function tP(r){return document.createTextNode(r)}function Tl(r,e,t){r.insertBefore(e,t)}function rP(r,e){r.removeChild(e)}function nP(r,e){r.appendChild(e)}function mV(r){return r.parentNode}function gV(r){return r.nextSibling}function C_(r,e){r.textContent=e}var iP=58,Gpe=120,Wpe=wr("","");function W2(r){return r===void 0}function oa(r){return r!==void 0}function Upe(r,e,t){for(var n={},i=e;i<=t;++i){var a=r[i].key;a!==void 0&&(n[a]=i)}return n}function Ih(r,e){var t=r.key===e.key,n=r.tag===e.tag;return n&&t}function Qd(r){var e,t=r.children,n=r.tag;if(oa(n)){var i=r.elm=lV(n);if(hA(Wpe,r),q(t))for(e=0;ea?(p=t[l+1]==null?null:t[l+1].elm,yV(r,p,t,i,l)):jy(r,e,n,a))}function Sc(r,e){var t=e.elm=r.elm,n=r.children,i=e.children;r!==e&&(hA(r,e),W2(e.text)?oa(n)&&oa(i)?n!==i&&Ype(t,n,i):oa(i)?(oa(r.text)&&C_(t,""),yV(t,null,i,0,i.length-1)):oa(n)?jy(t,n,0,n.length-1):oa(r.text)&&C_(t,""):r.text!==e.text&&(oa(n)&&jy(t,n,0,n.length-1),C_(t,e.text)))}function qpe(r,e){if(Ih(r,e))Sc(r,e);else{var t=r.elm,n=mV(t);Qd(e),n!==null&&(Tl(n,e.elm,gV(t)),jy(n,[r],0,0))}return e}var Xpe=0,Kpe=function(){function r(e,t,n){if(this.type="svg",this.refreshHover=aP(),this.configLayer=aP(),this.storage=t,this._opts=n=W({},n),this.root=e,this._id="zr"+Xpe++,this._oldVNode=YI(n.width,n.height),e&&!n.ssr){var i=this._viewport=document.createElement("div");i.style.cssText="position:relative;overflow:hidden";var a=this._svgDom=this._oldVNode.elm=lV("svg");hA(null,this._oldVNode),i.appendChild(a),e.appendChild(i)}this.resize(n.width,n.height)}return r.prototype.getType=function(){return this.type},r.prototype.getViewportRoot=function(){return this._viewport},r.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},r.prototype.getSvgDom=function(){return this._svgDom},r.prototype.refresh=function(){if(this.root){var e=this.renderToVNode({willUpdate:!0});e.attrs.style="position:absolute;left:0;top:0;user-select:none",qpe(this._oldVNode,e),this._oldVNode=e}},r.prototype.renderOneToVNode=function(e){return eP(e,G2(this._id))},r.prototype.renderToVNode=function(e){e=e||{};var t=this.storage.getDisplayList(!0),n=this._width,i=this._height,a=G2(this._id);a.animation=e.animation,a.willUpdate=e.willUpdate,a.compress=e.compress,a.emphasis=e.emphasis,a.ssr=this._opts.ssr;var o=[],s=this._bgVNode=Zpe(n,i,this._backgroundColor,a);s&&o.push(s);var l=e.compress?null:this._mainVNode=wr("g","main",{},[]);this._paintList(t,a,l?l.children:o),l&&o.push(l);var u=K(et(a.defs),function(h){return a.defs[h]});if(u.length&&o.push(wr("defs","defs",{},u)),e.animation){var c=Dpe(a.cssNodes,a.cssAnims,{newline:!0});if(c){var f=wr("style","stl",{},[],c);o.push(f)}}return YI(n,i,o,e.useViewBox)},r.prototype.renderToString=function(e){return e=e||{},lA(this.renderToVNode({animation:Re(e.cssAnimation,!0),emphasis:Re(e.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:Re(e.useViewBox,!0)}),{newline:!0})},r.prototype.setBackgroundColor=function(e){this._backgroundColor=e},r.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},r.prototype._paintList=function(e,t,n){for(var i=e.length,a=[],o=0,s,l,u=0,c=0;c=0&&!(h&&l&&h[v]===l[v]);v--);for(var m=p-1;m>v;m--)o--,s=a[o-1];for(var g=v+1;g=s)}}for(var f=this.__startIndex;f15)break}}L.prevElClipPaths&&g.restore()};if(y)if(y.length===0)T=m.__endIndex;else for(var A=d.dpr,M=0;M0&&e>i[0]){for(l=0;le);l++);s=n[i[l]]}if(i.splice(l+1,0,e),n[e]=t,!t.virtual)if(s){var u=s.dom;u.nextSibling?o.insertBefore(t.dom,u.nextSibling):o.appendChild(t.dom)}else o.firstChild?o.insertBefore(t.dom,o.firstChild):o.appendChild(t.dom);t.painter||(t.painter=this)}},r.prototype.eachLayer=function(e,t){for(var n=this._zlevelList,i=0;i0?Xv:0),this._needsManuallyCompositing),c.__builtin__||sC("ZLevel "+u+" has been used by unkown layer "+c.id),c!==a&&(c.__used=!0,c.__startIndex!==l&&(c.__dirty=!0),c.__startIndex=l,c.incremental?c.__drawIndex=-1:c.__drawIndex=l,t(l),a=c),i.__dirty&On&&!i.__inHover&&(c.__dirty=!0,c.incremental&&c.__drawIndex<0&&(c.__drawIndex=l))}t(l),this.eachBuiltinLayer(function(f,h){!f.__used&&f.getElementCount()>0&&(f.__dirty=!0,f.__startIndex=f.__endIndex=f.__drawIndex=0),f.__dirty&&f.__drawIndex<0&&(f.__drawIndex=f.__startIndex)})},r.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},r.prototype._clearLayer=function(e){e.clear()},r.prototype.setBackgroundColor=function(e){this._backgroundColor=e,k(this._layers,function(t){t.setUnpainted()})},r.prototype.configLayer=function(e,t){if(t){var n=this._layerConfig;n[e]?Be(n[e],t,!0):n[e]=t;for(var i=0;i-1&&(u.style.stroke=u.style.fill,u.style.fill="#fff",u.style.lineWidth=2),n},e.type="series.line",e.dependencies=["grid","polar"],e.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},e}(It);function af(r,e){var t=r.mapDimensionsAll("defaultedLabel"),n=t.length;if(n===1){var i=tf(r,e,t[0]);return i!=null?i+"":null}else if(n){for(var a=[],o=0;o=0&&n.push(e[a])}return n.join(" ")}var Pp=function(r){z(e,r);function e(t,n,i,a){var o=r.call(this)||this;return o.updateData(t,n,i,a),o}return e.prototype._createSymbol=function(t,n,i,a,o){this.removeAll();var s=ur(t,-1,-1,2,2,null,o);s.attr({z2:100,culling:!0,scaleX:a[0]/2,scaleY:a[1]/2}),s.drift=ave,this._symbolType=t,this.add(s)},e.prototype.stopSymbolAnimation=function(t){this.childAt(0).stopAnimation(null,t)},e.prototype.getSymbolType=function(){return this._symbolType},e.prototype.getSymbolPath=function(){return this.childAt(0)},e.prototype.highlight=function(){wo(this.childAt(0))},e.prototype.downplay=function(){So(this.childAt(0))},e.prototype.setZ=function(t,n){var i=this.childAt(0);i.zlevel=t,i.z=n},e.prototype.setDraggable=function(t,n){var i=this.childAt(0);i.draggable=t,i.cursor=!n&&t?"move":i.cursor},e.prototype.updateData=function(t,n,i,a){this.silent=!1;var o=t.getItemVisual(n,"symbol")||"circle",s=t.hostModel,l=e.getSymbolSize(t,n),u=o!==this._symbolType,c=a&&a.disableAnimation;if(u){var f=t.getItemVisual(n,"symbolKeepAspect");this._createSymbol(o,t,n,l,f)}else{var h=this.childAt(0);h.silent=!1;var d={scaleX:l[0]/2,scaleY:l[1]/2};c?h.attr(d):ut(h,d,s,n),Bi(h)}if(this._updateCommon(t,n,l,i,a),u){var h=this.childAt(0);if(!c){var d={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:h.style.opacity}};h.scaleX=h.scaleY=0,h.style.opacity=0,Ot(h,d,s,n)}}c&&this.childAt(0).stopAnimation("leave")},e.prototype._updateCommon=function(t,n,i,a,o){var s=this.childAt(0),l=t.hostModel,u,c,f,h,d,p,v,m,g;if(a&&(u=a.emphasisItemStyle,c=a.blurItemStyle,f=a.selectItemStyle,h=a.focus,d=a.blurScope,v=a.labelStatesModels,m=a.hoverScale,g=a.cursorStyle,p=a.emphasisDisabled),!a||t.hasItemOption){var y=a&&a.itemModel?a.itemModel:t.getItemModel(n),b=y.getModel("emphasis");u=b.getModel("itemStyle").getItemStyle(),f=y.getModel(["select","itemStyle"]).getItemStyle(),c=y.getModel(["blur","itemStyle"]).getItemStyle(),h=b.get("focus"),d=b.get("blurScope"),p=b.get("disabled"),v=Tr(y),m=b.getShallow("scale"),g=y.getShallow("cursor")}var _=t.getItemVisual(n,"symbolRotate");s.attr("rotation",(_||0)*Math.PI/180||0);var x=Pu(t.getItemVisual(n,"symbolOffset"),i);x&&(s.x=x[0],s.y=x[1]),g&&s.attr("cursor",g);var w=t.getItemVisual(n,"style"),S=w.fill;if(s instanceof Lr){var T=s.style;s.useStyle(W({image:T.image,x:T.x,y:T.y,width:T.width,height:T.height},w))}else s.__isEmptyBrush?s.useStyle(W({},w)):s.useStyle(w),s.style.decal=null,s.setColor(S,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var C=t.getItemVisual(n,"liftZ"),A=this._z2;C!=null?A==null&&(this._z2=s.z2,s.z2+=C):A!=null&&(s.z2=A,this._z2=null);var M=o&&o.useNameLabel;Vr(s,v,{labelFetcher:l,labelDataIndex:n,defaultText:D,inheritColor:S,defaultOpacity:w.opacity});function D(I){return M?t.getName(I):af(t,I)}this._sizeX=i[0]/2,this._sizeY=i[1]/2;var E=s.ensureState("emphasis");E.style=u,s.ensureState("select").style=f,s.ensureState("blur").style=c;var L=m==null||m===!0?Math.max(1.1,3/this._sizeY):isFinite(m)&&m>0?+m:1;E.scaleX=this._sizeX*L,E.scaleY=this._sizeY*L,this.setSymbolScale(1),$t(this,h,d,p)},e.prototype.setSymbolScale=function(t){this.scaleX=this.scaleY=t},e.prototype.fadeOut=function(t,n,i){var a=this.childAt(0),o=Le(this).dataIndex,s=i&&i.animation;if(this.silent=a.silent=!0,i&&i.fadeLabel){var l=a.getTextContent();l&&Es(l,{style:{opacity:0}},n,{dataIndex:o,removeOpt:s,cb:function(){a.removeTextContent()}})}else a.removeTextContent();Es(a,{style:{opacity:0},scaleX:0,scaleY:0},n,{dataIndex:o,cb:t,removeOpt:s})},e.getSymbolSize=function(t,n){return kf(t.getItemVisual(n,"symbolSize"))},e}(Ee);function ave(r,e){this.parent.drift(r,e)}function M_(r,e,t,n){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(n.isIgnore&&n.isIgnore(t))&&!(n.clipShape&&!n.clipShape.contain(e[0],e[1]))&&r.getItemVisual(t,"symbol")!=="none"}function lP(r){return r!=null&&!Me(r)&&(r={isIgnore:r}),r||{}}function uP(r){var e=r.hostModel,t=e.getModel("emphasis");return{emphasisItemStyle:t.getModel("itemStyle").getItemStyle(),blurItemStyle:e.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:e.getModel(["select","itemStyle"]).getItemStyle(),focus:t.get("focus"),blurScope:t.get("blurScope"),emphasisDisabled:t.get("disabled"),hoverScale:t.get("scale"),labelStatesModels:Tr(e),cursorStyle:e.get("cursor")}}var Rp=function(){function r(e){this.group=new Ee,this._SymbolCtor=e||Pp}return r.prototype.updateData=function(e,t){this._progressiveEls=null,t=lP(t);var n=this.group,i=e.hostModel,a=this._data,o=this._SymbolCtor,s=t.disableAnimation,l=uP(e),u={disableAnimation:s},c=t.getSymbolPoint||function(f){return e.getItemLayout(f)};a||n.removeAll(),e.diff(a).add(function(f){var h=c(f);if(M_(e,h,f,t)){var d=new o(e,f,l,u);d.setPosition(h),e.setItemGraphicEl(f,d),n.add(d)}}).update(function(f,h){var d=a.getItemGraphicEl(h),p=c(f);if(!M_(e,p,f,t)){n.remove(d);return}var v=e.getItemVisual(f,"symbol")||"circle",m=d&&d.getSymbolType&&d.getSymbolType();if(!d||m&&m!==v)n.remove(d),d=new o(e,f,l,u),d.setPosition(p);else{d.updateData(e,f,l,u);var g={x:p[0],y:p[1]};s?d.attr(g):ut(d,g,i)}n.add(d),e.setItemGraphicEl(f,d)}).remove(function(f){var h=a.getItemGraphicEl(f);h&&h.fadeOut(function(){n.remove(h)},i)}).execute(),this._getSymbolPoint=c,this._data=e},r.prototype.updateLayout=function(){var e=this,t=this._data;t&&t.eachItemGraphicEl(function(n,i){var a=e._getSymbolPoint(i);n.setPosition(a),n.markRedraw()})},r.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=uP(e),this._data=null,this.group.removeAll()},r.prototype.incrementalUpdate=function(e,t,n){this._progressiveEls=[],n=lP(n);function i(l){l.isGroup||(l.incremental=!0,l.ensureState("emphasis").hoverLayer=!0)}for(var a=e.start;a0?t=n[0]:n[1]<0&&(t=n[1]),t}function xV(r,e,t,n){var i=NaN;r.stacked&&(i=t.get(t.getCalculationInfo("stackedOverDimension"),n)),isNaN(i)&&(i=r.valueStart);var a=r.baseDataOffset,o=[];return o[a]=t.get(r.baseDim,n),o[1-a]=i,e.dataToPoint(o)}function sve(r,e){var t=[];return e.diff(r).add(function(n){t.push({cmd:"+",idx:n})}).update(function(n,i){t.push({cmd:"=",idx:i,idx1:n})}).remove(function(n){t.push({cmd:"-",idx:n})}).execute(),t}function lve(r,e,t,n,i,a,o,s){for(var l=sve(r,e),u=[],c=[],f=[],h=[],d=[],p=[],v=[],m=_V(i,e,o),g=r.getLayout("points")||[],y=e.getLayout("points")||[],b=0;b=i||v<0)break;if(au(g,y)){if(l){v+=a;continue}break}if(v===t)r[a>0?"moveTo":"lineTo"](g,y),f=g,h=y;else{var b=g-u,_=y-c;if(b*b+_*_<.5){v+=a;continue}if(o>0){for(var x=v+a,w=e[x*2],S=e[x*2+1];w===g&&S===y&&m=n||au(w,S))d=g,p=y;else{A=w-u,M=S-c;var L=g-u,I=w-g,R=y-c,P=S-y,O=void 0,j=void 0;if(s==="x"){O=Math.abs(L),j=Math.abs(I);var F=A>0?1:-1;d=g-F*O*o,p=y,D=g+F*j*o,E=y}else if(s==="y"){O=Math.abs(R),j=Math.abs(P);var N=M>0?1:-1;d=g,p=y-N*O*o,D=g,E=y+N*j*o}else O=Math.sqrt(L*L+R*R),j=Math.sqrt(I*I+P*P),C=j/(j+O),d=g-A*o*(1-C),p=y-M*o*(1-C),D=g+A*o*C,E=y+M*o*C,D=Ho(D,Go(w,g)),E=Ho(E,Go(S,y)),D=Go(D,Ho(w,g)),E=Go(E,Ho(S,y)),A=D-g,M=E-y,d=g-A*O/j,p=y-M*O/j,d=Ho(d,Go(u,g)),p=Ho(p,Go(c,y)),d=Go(d,Ho(u,g)),p=Go(p,Ho(c,y)),A=g-d,M=y-p,D=g+A*j/O,E=y+M*j/O}r.bezierCurveTo(f,h,d,p,g,y),f=D,h=E}else r.lineTo(g,y)}u=g,c=y,v+=a}return m}var wV=function(){function r(){this.smooth=0,this.smoothConstraint=!0}return r}(),uve=function(r){z(e,r);function e(t){var n=r.call(this,t)||this;return n.type="ec-polyline",n}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new wV},e.prototype.buildPath=function(t,n){var i=n.points,a=0,o=i.length/2;if(n.connectNulls){for(;o>0&&au(i[o*2-2],i[o*2-1]);o--);for(;a=0){var _=u?(p-l)*b+l:(d-s)*b+s;return u?[t,_]:[_,t]}s=d,l=p;break;case o.C:d=a[f++],p=a[f++],v=a[f++],m=a[f++],g=a[f++],y=a[f++];var x=u?cy(s,d,v,g,t,c):cy(l,p,m,y,t,c);if(x>0)for(var w=0;w=0){var _=u?_r(l,p,m,y,S):_r(s,d,v,g,S);return u?[t,_]:[_,t]}}s=g,l=y;break}}},e}(Xe),cve=function(r){z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(wV),SV=function(r){z(e,r);function e(t){var n=r.call(this,t)||this;return n.type="ec-polygon",n}return e.prototype.getDefaultShape=function(){return new cve},e.prototype.buildPath=function(t,n){var i=n.points,a=n.stackedOnPoints,o=0,s=i.length/2,l=n.smoothMonotone;if(n.connectNulls){for(;s>0&&au(i[s*2-2],i[s*2-1]);s--);for(;oe){a?t.push(o(a,l,e)):i&&t.push(o(i,l,0),o(i,l,e));break}else i&&(t.push(o(i,l,0)),i=null),t.push(l),a=l}return t}function dve(r,e,t){var n=r.getVisual("visualMeta");if(!(!n||!n.length||!r.count())&&e.type==="cartesian2d"){for(var i,a,o=n.length-1;o>=0;o--){var s=r.getDimensionInfo(n[o].dimension);if(i=s&&s.coordDim,i==="x"||i==="y"){a=n[o];break}}if(a){var l=e.getAxis(i),u=K(a.stops,function(b){return{coord:l.toGlobalCoord(l.dataToCoord(b.value)),color:b.color}}),c=u.length,f=a.outerColors.slice();c&&u[0].coord>u[c-1].coord&&(u.reverse(),f.reverse());var h=hve(u,i==="x"?t.getWidth():t.getHeight()),d=h.length;if(!d&&c)return u[0].coord<0?f[1]?f[1]:u[c-1].color:f[0]?f[0]:u[0].color;var p=10,v=h[0].coord-p,m=h[d-1].coord+p,g=m-v;if(g<.001)return"transparent";k(h,function(b){b.offset=(b.coord-v)/g}),h.push({offset:d?h[d-1].offset:.5,color:f[1]||"transparent"}),h.unshift({offset:d?h[0].offset:.5,color:f[0]||"transparent"});var y=new Ap(0,0,0,0,h,!0);return y[i]=v,y[i+"2"]=m,y}}}function pve(r,e,t){var n=r.get("showAllSymbol"),i=n==="auto";if(!(n&&!i)){var a=t.getAxesByScale("ordinal")[0];if(a&&!(i&&vve(a,e))){var o=e.mapDimension(a.dim),s={};return k(a.getViewLabels(),function(l){var u=a.scale.getRawOrdinalNumber(l.tickValue);s[u]=1}),function(l){return!s.hasOwnProperty(e.get(o,l))}}}}function vve(r,e){var t=r.getExtent(),n=Math.abs(t[1]-t[0])/r.scale.count();isNaN(n)&&(n=0);for(var i=e.count(),a=Math.max(1,Math.round(i/5)),o=0;on)return!1;return!0}function mve(r,e){return isNaN(r)||isNaN(e)}function gve(r){for(var e=r.length/2;e>0&&mve(r[e*2-2],r[e*2-1]);e--);return e-1}function pP(r,e){return[r[e*2],r[e*2+1]]}function yve(r,e,t){for(var n=r.length/2,i=t==="x"?0:1,a,o,s=0,l=-1,u=0;u=e||a>=e&&o<=e){l=u;break}s=u,a=o}return{range:[s,l],t:(e-a)/(o-a)}}function AV(r){if(r.get(["endLabel","show"]))return!0;for(var e=0;e0&&t.get(["emphasis","lineStyle","width"])==="bolder"){var j=p.getState("emphasis").style;j.lineWidth=+p.style.lineWidth+1}Le(p).seriesIndex=t.seriesIndex,$t(p,R,P,O);var F=dP(t.get("smooth")),N=t.get("smoothMonotone");if(p.setShape({smooth:F,smoothMonotone:N,connectNulls:S}),v){var B=s.getCalculationInfo("stackedOnSeries"),$=0;v.useStyle(Ce(u.getAreaStyle(),{fill:D,opacity:.7,lineJoin:"bevel",decal:s.getVisual("style").decal})),B&&($=dP(B.get("smooth"))),v.setShape({smooth:F,stackedOnSmooth:$,smoothMonotone:N,connectNulls:S}),Fr(v,t,"areaStyle"),Le(v).seriesIndex=t.seriesIndex,$t(v,R,P,O)}var J=this._changePolyState;s.eachItemGraphicEl(function(U){U&&(U.onHoverStateChange=J)}),this._polyline.onHoverStateChange=J,this._data=s,this._coordSys=a,this._stackedOnPoints=x,this._points=c,this._step=A,this._valueOrigin=b,t.get("triggerLineEvent")&&(this.packEventData(t,p),v&&this.packEventData(t,v))},e.prototype.packEventData=function(t,n){Le(n).eventData={componentType:"series",componentSubType:"line",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"line"}},e.prototype.highlight=function(t,n,i,a){var o=t.getData(),s=vu(o,a);if(this._changePolyState("emphasis"),!(s instanceof Array)&&s!=null&&s>=0){var l=o.getLayout("points"),u=o.getItemGraphicEl(s);if(!u){var c=l[s*2],f=l[s*2+1];if(isNaN(c)||isNaN(f)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(c,f))return;var h=t.get("zlevel")||0,d=t.get("z")||0;u=new Pp(o,s),u.x=c,u.y=f,u.setZ(h,d);var p=u.getSymbolPath().getTextContent();p&&(p.zlevel=h,p.z=d,p.z2=this._polyline.z2+1),u.__temp=!0,o.setItemGraphicEl(s,u),u.stopSymbolAnimation(!0),this.group.add(u)}u.highlight()}else St.prototype.highlight.call(this,t,n,i,a)},e.prototype.downplay=function(t,n,i,a){var o=t.getData(),s=vu(o,a);if(this._changePolyState("normal"),s!=null&&s>=0){var l=o.getItemGraphicEl(s);l&&(l.__temp?(o.setItemGraphicEl(s,null),this.group.remove(l)):l.downplay())}else St.prototype.downplay.call(this,t,n,i,a)},e.prototype._changePolyState=function(t){var n=this._polygon;gy(this._polyline,t),n&&gy(n,t)},e.prototype._newPolyline=function(t){var n=this._polyline;return n&&this._lineGroup.remove(n),n=new uve({shape:{points:t},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(n),this._polyline=n,n},e.prototype._newPolygon=function(t,n){var i=this._polygon;return i&&this._lineGroup.remove(i),i=new SV({shape:{points:t,stackedOnPoints:n},segmentIgnoreThreshold:2}),this._lineGroup.add(i),this._polygon=i,i},e.prototype._initSymbolLabelAnimation=function(t,n,i){var a,o,s=n.getBaseAxis(),l=s.inverse;n.type==="cartesian2d"?(a=s.isHorizontal(),o=!1):n.type==="polar"&&(a=s.dim==="angle",o=!0);var u=t.hostModel,c=u.get("animationDuration");Te(c)&&(c=c(null));var f=u.get("animationDelay")||0,h=Te(f)?f(null):f;t.eachItemGraphicEl(function(d,p){var v=d;if(v){var m=[d.x,d.y],g=void 0,y=void 0,b=void 0;if(i)if(o){var _=i,x=n.pointToCoord(m);a?(g=_.startAngle,y=_.endAngle,b=-x[1]/180*Math.PI):(g=_.r0,y=_.r,b=x[0])}else{var w=i;a?(g=w.x,y=w.x+w.width,b=d.x):(g=w.y+w.height,y=w.y,b=d.y)}var S=y===g?0:(b-g)/(y-g);l&&(S=1-S);var T=Te(f)?f(p):c*S+h,C=v.getSymbolPath(),A=C.getTextContent();v.attr({scaleX:0,scaleY:0}),v.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:T}),A&&A.animateFrom({style:{opacity:0}},{duration:300,delay:T}),C.disableLabelAnimation=!0}})},e.prototype._initOrUpdateEndLabel=function(t,n,i){var a=t.getModel("endLabel");if(AV(t)){var o=t.getData(),s=this._polyline,l=o.getLayout("points");if(!l){s.removeTextContent(),this._endLabel=null;return}var u=this._endLabel;u||(u=this._endLabel=new ot({z2:200}),u.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var c=gve(l);c>=0&&(Vr(s,Tr(t,"endLabel"),{inheritColor:i,labelFetcher:t,labelDataIndex:c,defaultText:function(f,h,d){return d!=null?bV(o,d):af(o,f)},enableTextSetter:!0},bve(a,n)),s.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(t,n,i,a,o,s,l){var u=this._endLabel,c=this._polyline;if(u){t<1&&a.originalX==null&&(a.originalX=u.x,a.originalY=u.y);var f=i.getLayout("points"),h=i.hostModel,d=h.get("connectNulls"),p=s.get("precision"),v=s.get("distance")||0,m=l.getBaseAxis(),g=m.isHorizontal(),y=m.inverse,b=n.shape,_=y?g?b.x:b.y+b.height:g?b.x+b.width:b.y,x=(g?v:0)*(y?-1:1),w=(g?0:-v)*(y?-1:1),S=g?"x":"y",T=yve(f,_,S),C=T.range,A=C[1]-C[0],M=void 0;if(A>=1){if(A>1&&!d){var D=pP(f,C[0]);u.attr({x:D[0]+x,y:D[1]+w}),o&&(M=h.getRawValue(C[0]))}else{var D=c.getPointOn(_,S);D&&u.attr({x:D[0]+x,y:D[1]+w});var E=h.getRawValue(C[0]),L=h.getRawValue(C[1]);o&&(M=hz(i,p,E,L,T.t))}a.lastFrameIndex=C[0]}else{var I=t===1||a.lastFrameIndex>0?C[0]:0,D=pP(f,I);o&&(M=h.getRawValue(I)),u.attr({x:D[0]+x,y:D[1]+w})}if(o){var R=xf(u);typeof R.setLabelText=="function"&&R.setLabelText(M)}}},e.prototype._doUpdateAnimation=function(t,n,i,a,o,s,l){var u=this._polyline,c=this._polygon,f=t.hostModel,h=lve(this._data,t,this._stackedOnPoints,n,this._coordSys,i,this._valueOrigin),d=h.current,p=h.stackedOnCurrent,v=h.next,m=h.stackedOnNext;if(o&&(p=Wo(h.stackedOnCurrent,h.current,i,o,l),d=Wo(h.current,null,i,o,l),m=Wo(h.stackedOnNext,h.next,i,o,l),v=Wo(h.next,null,i,o,l)),hP(d,v)>3e3||c&&hP(p,m)>3e3){u.stopAnimation(),u.setShape({points:v}),c&&(c.stopAnimation(),c.setShape({points:v,stackedOnPoints:m}));return}u.shape.__points=h.current,u.shape.points=d;var g={shape:{points:v}};h.current!==d&&(g.shape.__points=h.next),u.stopAnimation(),ut(u,g,f),c&&(c.setShape({points:d,stackedOnPoints:p}),c.stopAnimation(),ut(c,{shape:{stackedOnPoints:m}},f),u.shape.points!==c.shape.points&&(c.shape.points=u.shape.points));for(var y=[],b=h.status,_=0;_e&&(e=r[t]);return isFinite(e)?e:NaN},min:function(r){for(var e=1/0,t=0;t10&&o.type==="cartesian2d"&&a){var l=o.getBaseAxis(),u=o.getOtherAxis(l),c=l.getExtent(),f=n.getDevicePixelRatio(),h=Math.abs(c[1]-c[0])*(f||1),d=Math.round(s/h);if(isFinite(d)&&d>1){a==="lttb"?e.setData(i.lttbDownSample(i.mapDimension(u.dim),1/d)):a==="minmax"&&e.setData(i.minmaxDownSample(i.mapDimension(u.dim),1/d));var p=void 0;se(a)?p=xve[a]:Te(a)&&(p=a),p&&e.setData(i.downSample(i.mapDimension(u.dim),1/d,p,wve))}}}}}function Sve(r){r.registerChartView(_ve),r.registerSeriesModel(ive),r.registerLayout(jp("line",!0)),r.registerVisual({seriesType:"line",reset:function(e){var t=e.getData(),n=e.getModel("lineStyle").getLineStyle();n&&!n.stroke&&(n.stroke=t.getVisual("style").fill),t.setVisual("legendLineStyle",n)}}),r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC,MV("line"))}var ep=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(t,n){return Lo(null,this,{useEncodeDefaulter:!0})},e.prototype.getMarkerPosition=function(t,n,i){var a=this.coordinateSystem;if(a&&a.clampData){var o=a.clampData(t),s=a.dataToPoint(o);if(i)k(a.getAxes(),function(h,d){if(h.type==="category"&&n!=null){var p=h.getTicksCoords(),v=h.getTickModel().get("alignWithLabel"),m=o[d],g=n[d]==="x1"||n[d]==="y1";if(g&&!v&&(m+=1),p.length<2)return;if(p.length===2){s[d]=h.toGlobalCoord(h.getExtent()[g?1:0]);return}for(var y=void 0,b=void 0,_=1,x=0;xm){b=(w+y)/2;break}x===1&&(_=S-p[0].tickValue)}b==null&&(y?y&&(b=p[p.length-1].coord):b=p[0].coord),s[d]=h.toGlobalCoord(b)}});else{var l=this.getData(),u=l.getLayout("offset"),c=l.getLayout("size"),f=a.getBaseAxis().isHorizontal()?0:1;s[f]+=u+c/2}return s}return[NaN,NaN]},e.type="series.__base_bar__",e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},e}(It);It.registerClass(ep);var Tve=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(){return Lo(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},e.prototype.getProgressive=function(){return this.get("large")?this.get("progressive"):!1},e.prototype.getProgressiveThreshold=function(){var t=this.get("progressiveThreshold"),n=this.get("largeThreshold");return n>t&&(t=n),t},e.prototype.brushSelector=function(t,n,i){return i.rect(n.getItemLayout(t))},e.type="series.bar",e.dependencies=["grid","polar"],e.defaultOption=$s(ep.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),e}(ep),Cve=function(){function r(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return r}(),Ny=function(r){z(e,r);function e(t){var n=r.call(this,t)||this;return n.type="sausage",n}return e.prototype.getDefaultShape=function(){return new Cve},e.prototype.buildPath=function(t,n){var i=n.cx,a=n.cy,o=Math.max(n.r0||0,0),s=Math.max(n.r,0),l=(s-o)*.5,u=o+l,c=n.startAngle,f=n.endAngle,h=n.clockwise,d=Math.PI*2,p=h?f-cMath.PI/2&&cs)return!0;s=f}return!1},e.prototype._isOrderDifferentInView=function(t,n){for(var i=n.scale,a=i.getExtent(),o=Math.max(0,a[0]),s=Math.min(a[1],i.getOrdinalMeta().categories.length-1);o<=s;++o)if(t.ordinalNumbers[o]!==i.getRawOrdinalNumber(o))return!0},e.prototype._updateSortWithinSameData=function(t,n,i,a){if(this._isOrderChangedWithinSameData(t,n,i)){var o=this._dataSort(t,i,n);this._isOrderDifferentInView(o,i)&&(this._removeOnRenderedListener(a),a.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",axisId:i.index,sortInfo:o}))}},e.prototype._dispatchInitSort=function(t,n,i){var a=n.baseAxis,o=this._dataSort(t,a,function(s){return t.get(t.mapDimension(n.otherAxis.dim),s)});i.dispatchAction({type:"changeAxisOrder",componentType:a.dim+"Axis",isInitSort:!0,axisId:a.index,sortInfo:o})},e.prototype.remove=function(t,n){this._clear(this._model),this._removeOnRenderedListener(n)},e.prototype.dispose=function(t,n){this._removeOnRenderedListener(n)},e.prototype._removeOnRenderedListener=function(t){this._onRendered&&(t.getZr().off("rendered",this._onRendered),this._onRendered=null)},e.prototype._clear=function(t){var n=this.group,i=this._data;t&&t.isAnimationEnabled()&&i&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],i.eachItemGraphicEl(function(a){Gd(a,t,Le(a).dataIndex)})):n.removeAll(),this._data=null,this._isFirstFrame=!0},e.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},e.type="bar",e}(St),vP={cartesian2d:function(r,e){var t=e.width<0?-1:1,n=e.height<0?-1:1;t<0&&(e.x+=e.width,e.width=-e.width),n<0&&(e.y+=e.height,e.height=-e.height);var i=r.x+r.width,a=r.y+r.height,o=D_(e.x,r.x),s=E_(e.x+e.width,i),l=D_(e.y,r.y),u=E_(e.y+e.height,a),c=si?s:o,e.y=f&&l>a?u:l,e.width=c?0:s-o,e.height=f?0:u-l,t<0&&(e.x+=e.width,e.width=-e.width),n<0&&(e.y+=e.height,e.height=-e.height),c||f},polar:function(r,e){var t=e.r0<=e.r?1:-1;if(t<0){var n=e.r;e.r=e.r0,e.r0=n}var i=E_(e.r,r.r),a=D_(e.r0,r.r0);e.r=i,e.r0=a;var o=i-a<0;if(t<0){var n=e.r;e.r=e.r0,e.r0=n}return o}},mP={cartesian2d:function(r,e,t,n,i,a,o,s,l){var u=new nt({shape:W({},n),z2:1});if(u.__dataIndex=t,u.name="item",a){var c=u.shape,f=i?"height":"width";c[f]=0}return u},polar:function(r,e,t,n,i,a,o,s,l){var u=!i&&l?Ny:gn,c=new u({shape:n,z2:1});c.name="item";var f=kV(i);if(c.calculateTextPosition=Ave(f,{isRoundCap:u===Ny}),a){var h=c.shape,d=i?"r":"endAngle",p={};h[d]=i?n.r0:n.startAngle,p[d]=n[d],(s?ut:Ot)(c,{shape:p},a)}return c}};function Eve(r,e){var t=r.get("realtimeSort",!0),n=e.getBaseAxis();if(t&&n.type==="category"&&e.type==="cartesian2d")return{baseAxis:n,otherAxis:e.getOtherAxis(n)}}function gP(r,e,t,n,i,a,o,s){var l,u;a?(u={x:n.x,width:n.width},l={y:n.y,height:n.height}):(u={y:n.y,height:n.height},l={x:n.x,width:n.width}),s||(o?ut:Ot)(t,{shape:l},e,i,null);var c=e?r.baseAxis.model:null;(o?ut:Ot)(t,{shape:u},c,i)}function yP(r,e){for(var t=0;t0?1:-1,o=n.height>0?1:-1;return{x:n.x+a*i/2,y:n.y+o*i/2,width:n.width-a*i,height:n.height-o*i}},polar:function(r,e,t){var n=r.getItemLayout(e);return{cx:n.cx,cy:n.cy,r0:n.r0,r:n.r,startAngle:n.startAngle,endAngle:n.endAngle,clockwise:n.clockwise}}};function Pve(r){return r.startAngle!=null&&r.endAngle!=null&&r.startAngle===r.endAngle}function kV(r){return function(e){var t=e?"Arc":"Angle";return function(n){switch(n){case"start":case"insideStart":case"end":case"insideEnd":return n+t;default:return n}}}(r)}function _P(r,e,t,n,i,a,o,s){var l=e.getItemVisual(t,"style");if(s){if(!a.get("roundCap")){var c=r.shape,f=Bl(n.getModel("itemStyle"),c,!0);W(c,f),r.setShape(c)}}else{var u=n.get(["itemStyle","borderRadius"])||0;r.setShape("r",u)}r.useStyle(l);var h=n.getShallow("cursor");h&&r.attr("cursor",h);var d=s?o?i.r>=i.r0?"endArc":"startArc":i.endAngle>=i.startAngle?"endAngle":"startAngle":o?i.height>=0?"bottom":"top":i.width>=0?"right":"left",p=Tr(n);Vr(r,p,{labelFetcher:a,labelDataIndex:t,defaultText:af(a.getData(),t),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:d});var v=r.getTextContent();if(s&&v){var m=n.get(["label","position"]);r.textConfig.inside=m==="middle"?!0:null,Mve(r,m==="outside"?d:m,kV(o),n.get(["label","rotate"]))}Xz(v,p,a.getRawValue(t),function(y){return bV(e,y)});var g=n.getModel(["emphasis"]);$t(r,g.get("focus"),g.get("blurScope"),g.get("disabled")),Fr(r,n),Pve(i)&&(r.style.fill="none",r.style.stroke="none",k(r.states,function(y){y.style&&(y.style.fill=y.style.stroke="none")}))}function Rve(r,e){var t=r.get(["itemStyle","borderColor"]);if(!t||t==="none")return 0;var n=r.get(["itemStyle","borderWidth"])||0,i=isNaN(e.width)?Number.MAX_VALUE:Math.abs(e.width),a=isNaN(e.height)?Number.MAX_VALUE:Math.abs(e.height);return Math.min(n,i,a)}var Ove=function(){function r(){}return r}(),xP=function(r){z(e,r);function e(t){var n=r.call(this,t)||this;return n.type="largeBar",n}return e.prototype.getDefaultShape=function(){return new Ove},e.prototype.buildPath=function(t,n){for(var i=n.points,a=this.baseDimIdx,o=1-this.baseDimIdx,s=[],l=[],u=this.barWidth,c=0;c=0?t:null},30,!1);function jve(r,e,t){for(var n=r.baseDimIdx,i=1-n,a=r.shape.points,o=r.largeDataIndices,s=[],l=[],u=r.barWidth,c=0,f=a.length/3;c=s[0]&&e<=s[0]+l[0]&&t>=s[1]&&t<=s[1]+l[1])return o[c]}return-1}function DV(r,e,t){if(Ou(t,"cartesian2d")){var n=e,i=t.getArea();return{x:r?n.x:i.x,y:r?i.y:n.y,width:r?n.width:i.width,height:r?i.height:n.height}}else{var i=t.getArea(),a=e;return{cx:i.cx,cy:i.cy,r0:r?i.r0:a.r0,r:r?i.r:a.r,startAngle:r?a.startAngle:0,endAngle:r?a.endAngle:Math.PI*2}}}function Nve(r,e,t){var n=r.type==="polar"?gn:nt;return new n({shape:DV(e,t,r),silent:!0,z2:0})}function Bve(r){r.registerChartView(Dve),r.registerSeriesModel(Tve),r.registerLayout(r.PRIORITY.VISUAL.LAYOUT,Oe(RF,"bar")),r.registerLayout(r.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,OF("bar")),r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC,MV("bar")),r.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(e,t){var n=e.componentType||"series";t.eachComponent({mainType:n,query:e},function(i){e.sortInfo&&i.axis.setCategorySortInfo(e.sortInfo)})})}var TP=Math.PI*2,Qv=Math.PI/180;function EV(r,e){return gr(r.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function LV(r,e){var t=EV(r,e),n=r.get("center"),i=r.get("radius");q(i)||(i=[0,i]);var a=ie(t.width,e.getWidth()),o=ie(t.height,e.getHeight()),s=Math.min(a,o),l=ie(i[0],s/2),u=ie(i[1],s/2),c,f,h=r.coordinateSystem;if(h){var d=h.dataToPoint(n);c=d[0]||0,f=d[1]||0}else q(n)||(n=[n,n]),c=ie(n[0],a)+t.x,f=ie(n[1],o)+t.y;return{cx:c,cy:f,r0:l,r:u}}function zve(r,e,t){e.eachSeriesByType(r,function(n){var i=n.getData(),a=i.mapDimension("value"),o=EV(n,t),s=LV(n,t),l=s.cx,u=s.cy,c=s.r,f=s.r0,h=-n.get("startAngle")*Qv,d=n.get("endAngle"),p=n.get("padAngle")*Qv;d=d==="auto"?h-TP:-d*Qv;var v=n.get("minAngle")*Qv,m=v+p,g=0;i.each(a,function(P){!isNaN(P)&&g++});var y=i.getSum(a),b=Math.PI/(y||g)*2,_=n.get("clockwise"),x=n.get("roseType"),w=n.get("stillShowZeroSum"),S=i.getDataExtent(a);S[0]=0;var T=_?1:-1,C=[h,d],A=T*p/2;wC(C,!_),h=C[0],d=C[1];var M=IV(n);M.startAngle=h,M.endAngle=d,M.clockwise=_;var D=Math.abs(d-h),E=D,L=0,I=h;if(i.setLayout({viewRect:o,r:c}),i.each(a,function(P,O){var j;if(isNaN(P)){i.setItemLayout(O,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:_,cx:l,cy:u,r0:f,r:x?NaN:c});return}x!=="area"?j=y===0&&w?b:P*b:j=D/g,jj?(N=I+T*j/2,B=N):(N=I+A,B=F-A),i.setItemLayout(O,{angle:j,startAngle:N,endAngle:B,clockwise:_,cx:l,cy:u,r0:f,r:x?bt(P,S,[f,c]):c}),I=F}),Et?g:m,x=Math.abs(b.label.y-t);if(x>=_.maxY){var w=b.label.x-e-b.len2*i,S=n+b.len,T=Math.abs(w)r.unconstrainedWidth?null:d:null;n.setStyle("width",p)}var v=n.getBoundingRect();a.width=v.width;var m=(n.style.margin||0)+2.1;a.height=v.height+m,a.y-=(a.height-f)/2}}}function L_(r){return r.position==="center"}function $ve(r){var e=r.getData(),t=[],n,i,a=!1,o=(r.get("minShowLabelAngle")||0)*Fve,s=e.getLayout("viewRect"),l=e.getLayout("r"),u=s.width,c=s.x,f=s.y,h=s.height;function d(w){w.ignore=!0}function p(w){if(!w.ignore)return!0;for(var S in w.states)if(w.states[S].ignore===!1)return!0;return!1}e.each(function(w){var S=e.getItemGraphicEl(w),T=S.shape,C=S.getTextContent(),A=S.getTextGuideLine(),M=e.getItemModel(w),D=M.getModel("label"),E=D.get("position")||M.get(["emphasis","label","position"]),L=D.get("distanceToLabelLine"),I=D.get("alignTo"),R=ie(D.get("edgeDistance"),u),P=D.get("bleedMargin"),O=M.getModel("labelLine"),j=O.get("length");j=ie(j,u);var F=O.get("length2");if(F=ie(F,u),Math.abs(T.endAngle-T.startAngle)0?"right":"left":B>0?"left":"right"}var me=Math.PI,he=0,Se=D.get("rotate");if(lt(Se))he=Se*(me/180);else if(E==="center")he=0;else if(Se==="radial"||Se===!0){var Fe=B<0?-N+me:-N;he=Fe}else if(Se==="tangential"&&E!=="outside"&&E!=="outer"){var xe=Math.atan2(B,$);xe<0&&(xe=me*2+xe);var rt=$>0;rt&&(xe=me+xe),he=xe-me}if(a=!!he,C.x=J,C.y=U,C.rotation=he,C.setStyle({verticalAlign:"middle"}),ge){C.setStyle({align:Ye});var fr=C.states.select;fr&&(fr.x+=C.x,fr.y+=C.y)}else{var at=C.getBoundingRect().clone();at.applyTransform(C.getComputedTransform());var ht=(C.style.margin||0)+2.1;at.y-=ht/2,at.height+=ht,t.push({label:C,labelLine:A,position:E,len:j,len2:F,minTurnAngle:O.get("minTurnAngle"),maxSurfaceAngle:O.get("maxSurfaceAngle"),surfaceNormal:new ze(B,$),linePoints:we,textAlign:Ye,labelDistance:L,labelAlignTo:I,edgeDistance:R,bleedMargin:P,rect:at,unconstrainedWidth:at.width,labelStyleWidth:C.style.width})}S.setTextConfig({inside:ge})}}),!a&&r.get("avoidLabelOverlap")&&Vve(t,n,i,l,u,h,c,f);for(var v=0;v0){for(var c=o.getItemLayout(0),f=1;isNaN(c&&c.startAngle)&&f=a.r0}},e.type="pie",e}(St);function Ef(r,e,t){e=q(e)&&{coordDimensions:e}||W({encodeDefine:r.getEncode()},e);var n=r.getSource(),i=Lp(n,e).dimensions,a=new fn(i,r);return a.initData(n,t),a}var Bp=function(){function r(e,t){this._getDataWithEncodedVisual=e,this._getRawData=t}return r.prototype.getAllNames=function(){var e=this._getRawData();return e.mapArray(e.getName)},r.prototype.containName=function(e){var t=this._getRawData();return t.indexOfName(e)>=0},r.prototype.indexOfName=function(e){var t=this._getDataWithEncodedVisual();return t.indexOfName(e)},r.prototype.getItemVisual=function(e,t){var n=this._getDataWithEncodedVisual();return n.getItemVisual(e,t)},r}(),Wve=it(),Uve=function(r){z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.init=function(t){r.prototype.init.apply(this,arguments),this.legendVisualProvider=new Bp(ue(this.getData,this),ue(this.getRawData,this)),this._defaultLabelLine(t)},e.prototype.mergeOption=function(){r.prototype.mergeOption.apply(this,arguments)},e.prototype.getInitialData=function(){return Ef(this,{coordDimensions:["value"],encodeDefaulter:Oe(zC,this)})},e.prototype.getDataParams=function(t){var n=this.getData(),i=Wve(n),a=i.seats;if(!a){var o=[];n.each(n.mapDimension("value"),function(l){o.push(l)}),a=i.seats=Bse(o,n.hostModel.get("percentPrecision"))}var s=r.prototype.getDataParams.call(this,t);return s.percent=a[t]||0,s.$vars.push("percent"),s},e.prototype._defaultLabelLine=function(t){pu(t,"labelLine",["show"]);var n=t.labelLine,i=t.emphasis.labelLine;n.show=n.show&&t.label.show,i.show=i.show&&t.emphasis.label.show},e.type="series.pie",e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},e}(It);function Yve(r){return{seriesType:r,reset:function(e,t){var n=e.getData();n.filterSelf(function(i){var a=n.mapDimension("value"),o=n.get(a,i);return!(lt(o)&&!isNaN(o)&&o<0)})}}}function qve(r){r.registerChartView(Gve),r.registerSeriesModel(Uve),tF("pie",r.registerAction),r.registerLayout(Oe(zve,"pie")),r.registerProcessor(Np("pie")),r.registerProcessor(Yve("pie"))}var Xve=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t}return e.prototype.getInitialData=function(t,n){return Lo(null,this,{useEncodeDefaulter:!0})},e.prototype.getProgressive=function(){var t=this.option.progressive;return t??(this.option.large?5e3:this.get("progressive"))},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return t??(this.option.large?1e4:this.get("progressiveThreshold"))},e.prototype.brushSelector=function(t,n,i){return i.point(n.getItemLayout(t))},e.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},e.type="series.scatter",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:"#212121"}},universalTransition:{divideShape:"clone"}},e}(It),RV=4,Kve=function(){function r(){}return r}(),Zve=function(r){z(e,r);function e(t){var n=r.call(this,t)||this;return n._off=0,n.hoverDataIdx=-1,n}return e.prototype.getDefaultShape=function(){return new Kve},e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.buildPath=function(t,n){var i=n.points,a=n.size,o=this.symbolProxy,s=o.shape,l=t.getContext?t.getContext():t,u=l&&a[0]=0;u--){var c=u*2,f=a[c]-s/2,h=a[c+1]-l/2;if(t>=f&&n>=h&&t<=f+s&&n<=h+l)return u}return-1},e.prototype.contain=function(t,n){var i=this.transformCoordToLocal(t,n),a=this.getBoundingRect();if(t=i[0],n=i[1],a.contain(t,n)){var o=this.hoverDataIdx=this.findDataIndex(t,n);return o>=0}return this.hoverDataIdx=-1,!1},e.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var n=this.shape,i=n.points,a=n.size,o=a[0],s=a[1],l=1/0,u=1/0,c=-1/0,f=-1/0,h=0;h=0&&(u.dataIndex=f+(e.startIndex||0))})},r.prototype.remove=function(){this._clear()},r.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},r}(),Qve=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,n,i){var a=t.getData(),o=this._updateSymbolDraw(a,t);o.updateData(a,{clipShape:this._getClipShape(t)}),this._finished=!0},e.prototype.incrementalPrepareRender=function(t,n,i){var a=t.getData(),o=this._updateSymbolDraw(a,t);o.incrementalPrepareUpdate(a),this._finished=!1},e.prototype.incrementalRender=function(t,n,i){this._symbolDraw.incrementalUpdate(t,n.getData(),{clipShape:this._getClipShape(n)}),this._finished=t.end===n.getData().count()},e.prototype.updateTransform=function(t,n,i){var a=t.getData();if(this.group.dirty(),!this._finished||a.count()>1e4)return{update:!0};var o=jp("").reset(t,n,i);o.progress&&o.progress({start:0,end:a.count(),count:a.count()},a),this._symbolDraw.updateLayout(a)},e.prototype.eachRendered=function(t){this._symbolDraw&&this._symbolDraw.eachRendered(t)},e.prototype._getClipShape=function(t){if(t.get("clip",!0)){var n=t.coordinateSystem;return n&&n.getArea&&n.getArea(.1)}},e.prototype._updateSymbolDraw=function(t,n){var i=this._symbolDraw,a=n.pipelineContext,o=a.large;return(!i||o!==this._isLargeDraw)&&(i&&i.remove(),i=this._symbolDraw=o?new Jve:new Rp,this._isLargeDraw=o,this.group.removeAll()),this.group.add(i.group),i},e.prototype.remove=function(t,n){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},e.prototype.dispose=function(){},e.type="scatter",e}(St),eme=function(r){z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.type="grid",e.dependencies=["xAxis","yAxis"],e.layoutMode="box",e.defaultOption={show:!1,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},e}(Qe),Y2=function(r){z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",lr).models[0]},e.type="cartesian2dAxis",e}(Qe);cr(Y2,Ip);var OV={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},tme=Be({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},OV),dA=Be({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},OV),rme=Be({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},dA),nme=Ce({logBase:10},dA);const jV={category:tme,value:dA,time:rme,log:nme};var ime={value:1,category:1,time:1,log:1};function of(r,e,t,n){k(ime,function(i,a){var o=Be(Be({},jV[a],!0),n,!0),s=function(l){z(u,l);function u(){var c=l!==null&&l.apply(this,arguments)||this;return c.type=e+"Axis."+a,c}return u.prototype.mergeDefaultAndTheme=function(c,f){var h=Ud(this),d=h?Tf(c):{},p=f.getTheme();Be(c,p.get(a+"Axis")),Be(c,this.getDefaultOption()),c.type=AP(c),h&&Ls(c,d,h)},u.prototype.optionUpdated=function(){var c=this.option;c.type==="category"&&(this.__ordinalMeta=F2.createByAxisModel(this))},u.prototype.getCategories=function(c){var f=this.option;if(f.type==="category")return c?f.data:this.__ordinalMeta.categories},u.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},u.type=e+"Axis."+a,u.defaultOption=o,u}(t);r.registerComponentModel(s)}),r.registerSubTypeDefaulter(e+"Axis",AP)}function AP(r){return r.type||(r.data?"category":"value")}var ame=function(){function r(e){this.type="cartesian",this._dimList=[],this._axes={},this.name=e||""}return r.prototype.getAxis=function(e){return this._axes[e]},r.prototype.getAxes=function(){return K(this._dimList,function(e){return this._axes[e]},this)},r.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),pt(this.getAxes(),function(t){return t.scale.type===e})},r.prototype.addAxis=function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},r}(),q2=["x","y"];function MP(r){return r.type==="interval"||r.type==="time"}var ome=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="cartesian2d",t.dimensions=q2,t}return e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var t=this.getAxis("x").scale,n=this.getAxis("y").scale;if(!(!MP(t)||!MP(n))){var i=t.getExtent(),a=n.getExtent(),o=this.dataToPoint([i[0],a[0]]),s=this.dataToPoint([i[1],a[1]]),l=i[1]-i[0],u=a[1]-a[0];if(!(!l||!u)){var c=(s[0]-o[0])/l,f=(s[1]-o[1])/u,h=o[0]-i[0]*c,d=o[1]-a[0]*f,p=this._transform=[c,0,0,f,h,d];this._invTransform=gf([],p)}}},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},e.prototype.containPoint=function(t){var n=this.getAxis("x"),i=this.getAxis("y");return n.contain(n.toLocalCoord(t[0]))&&i.contain(i.toLocalCoord(t[1]))},e.prototype.containData=function(t){return this.getAxis("x").containData(t[0])&&this.getAxis("y").containData(t[1])},e.prototype.containZone=function(t,n){var i=this.dataToPoint(t),a=this.dataToPoint(n),o=this.getArea(),s=new Ve(i[0],i[1],a[0]-i[0],a[1]-i[1]);return o.intersect(s)},e.prototype.dataToPoint=function(t,n,i){i=i||[];var a=t[0],o=t[1];if(this._transform&&a!=null&&isFinite(a)&&o!=null&&isFinite(o))return Br(i,t,this._transform);var s=this.getAxis("x"),l=this.getAxis("y");return i[0]=s.toGlobalCoord(s.dataToCoord(a,n)),i[1]=l.toGlobalCoord(l.dataToCoord(o,n)),i},e.prototype.clampData=function(t,n){var i=this.getAxis("x").scale,a=this.getAxis("y").scale,o=i.getExtent(),s=a.getExtent(),l=i.parse(t[0]),u=a.parse(t[1]);return n=n||[],n[0]=Math.min(Math.max(Math.min(o[0],o[1]),l),Math.max(o[0],o[1])),n[1]=Math.min(Math.max(Math.min(s[0],s[1]),u),Math.max(s[0],s[1])),n},e.prototype.pointToData=function(t,n){var i=[];if(this._invTransform)return Br(i,t,this._invTransform);var a=this.getAxis("x"),o=this.getAxis("y");return i[0]=a.coordToData(a.toLocalCoord(t[0]),n),i[1]=o.coordToData(o.toLocalCoord(t[1]),n),i},e.prototype.getOtherAxis=function(t){return this.getAxis(t.dim==="x"?"y":"x")},e.prototype.getArea=function(t){t=t||0;var n=this.getAxis("x").getGlobalExtent(),i=this.getAxis("y").getGlobalExtent(),a=Math.min(n[0],n[1])-t,o=Math.min(i[0],i[1])-t,s=Math.max(n[0],n[1])-a+t,l=Math.max(i[0],i[1])-o+t;return new Ve(a,o,s,l)},e}(ame),sme=function(r){z(e,r);function e(t,n,i,a,o){var s=r.call(this,t,n,i)||this;return s.index=0,s.type=a||"value",s.position=o||"bottom",s}return e.prototype.isHorizontal=function(){var t=this.position;return t==="top"||t==="bottom"},e.prototype.getGlobalExtent=function(t){var n=this.getExtent();return n[0]=this.toGlobalCoord(n[0]),n[1]=this.toGlobalCoord(n[1]),t&&n[0]>n[1]&&n.reverse(),n},e.prototype.pointToData=function(t,n){return this.coordToData(this.toLocalCoord(t[this.dim==="x"?0:1]),n)},e.prototype.setCategorySortInfo=function(t){if(this.type!=="category")return!1;this.model.option.categorySortInfo=t,this.scale.setSortInfo(t)},e}(Gi);function X2(r,e,t){t=t||{};var n=r.coordinateSystem,i=e.axis,a={},o=i.getAxesOnZeroOf()[0],s=i.position,l=o?"onZero":s,u=i.dim,c=n.getRect(),f=[c.x,c.x+c.width,c.y,c.y+c.height],h={left:0,right:1,top:0,bottom:1,onZero:2},d=e.get("offset")||0,p=u==="x"?[f[2]-d,f[3]+d]:[f[0]-d,f[1]+d];if(o){var v=o.toGlobalCoord(o.dataToCoord(0));p[h.onZero]=Math.max(Math.min(v,p[1]),p[0])}a.position=[u==="y"?p[h[l]]:f[0],u==="x"?p[h[l]]:f[3]],a.rotation=Math.PI/2*(u==="x"?0:1);var m={top:-1,bottom:1,left:-1,right:1};a.labelDirection=a.tickDirection=a.nameDirection=m[s],a.labelOffset=o?p[h[s]]-p[h.onZero]:0,e.get(["axisTick","inside"])&&(a.tickDirection=-a.tickDirection),kr(t.labelInside,e.get(["axisLabel","inside"]))&&(a.labelDirection=-a.labelDirection);var g=e.get(["axisLabel","rotate"]);return a.labelRotate=l==="top"?-g:g,a.z2=1,a}function kP(r){return r.get("coordinateSystem")==="cartesian2d"}function DP(r){var e={xAxisModel:null,yAxisModel:null};return k(e,function(t,n){var i=n.replace(/Model$/,""),a=r.getReferringComponents(i,lr).models[0];e[n]=a}),e}var I_=Math.log;function NV(r,e,t){var n=Co.prototype,i=n.getTicks.call(t),a=n.getTicks.call(t,!0),o=i.length-1,s=n.getInterval.call(t),l=FF(r,e),u=l.extent,c=l.fixMin,f=l.fixMax;if(r.type==="log"){var h=I_(r.base);u=[I_(u[0])/h,I_(u[1])/h]}r.setExtent(u[0],u[1]),r.calcNiceExtent({splitNumber:o,fixMin:c,fixMax:f});var d=n.getExtent.call(r);c&&(u[0]=d[0]),f&&(u[1]=d[1]);var p=n.getInterval.call(r),v=u[0],m=u[1];if(c&&f)p=(m-v)/o;else if(c)for(m=u[0]+p*o;mu[0]&&isFinite(v)&&isFinite(u[0]);)p=g_(p),v=u[1]-p*o;else{var g=r.getTicks().length-1;g>o&&(p=g_(p));var y=p*o;m=Math.ceil(u[1]/p)*p,v=Xt(m-y),v<0&&u[0]>=0?(v=0,m=Xt(y)):m>0&&u[1]<=0&&(m=0,v=-Xt(y))}var b=(i[0].value-a[0].value)/s,_=(i[o].value-a[o].value)/s;n.setExtent.call(r,v+p*b,m+p*_),n.setInterval.call(r,p),(b||_)&&n.setNiceExtent.call(r,v+p,m-p)}var lme=function(){function r(e,t,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=q2,this._initCartesian(e,t,n),this.model=e}return r.prototype.getRect=function(){return this._rect},r.prototype.update=function(e,t){var n=this._axesMap;this._updateScale(e,this.model);function i(o){var s,l=et(o),u=l.length;if(u){for(var c=[],f=u-1;f>=0;f--){var h=+l[f],d=o[h],p=d.model,v=d.scale;V2(v)&&p.get("alignTicks")&&p.get("interval")==null?c.push(d):(nf(v,p),V2(v)&&(s=d))}c.length&&(s||(s=c.pop(),nf(s.scale,s.model)),k(c,function(m){NV(m.scale,m.model,s.scale)}))}}i(n.x),i(n.y);var a={};k(n.x,function(o){EP(n,"y",o,a)}),k(n.y,function(o){EP(n,"x",o,a)}),this.resize(this.model,t)},r.prototype.resize=function(e,t,n){var i=e.getBoxLayoutParams(),a=!n&&e.get("containLabel"),o=gr(i,{width:t.getWidth(),height:t.getHeight()});this._rect=o;var s=this._axesList;l(),a&&(k(s,function(u){if(!u.model.get(["axisLabel","inside"])){var c=$de(u);if(c){var f=u.isHorizontal()?"height":"width",h=u.model.get(["axisLabel","margin"]);o[f]-=c[f]+h,u.position==="top"?o.y+=c.height+h:u.position==="left"&&(o.x+=c.width+h)}}}),l()),k(this._coordsList,function(u){u.calcAffineTransform()});function l(){k(s,function(u){var c=u.isHorizontal(),f=c?[0,o.width]:[0,o.height],h=u.inverse?1:0;u.setExtent(f[h],f[1-h]),ume(u,c?o.x:o.y)})}},r.prototype.getAxis=function(e,t){var n=this._axesMap[e];if(n!=null)return n[t||0]},r.prototype.getAxes=function(){return this._axesList.slice()},r.prototype.getCartesian=function(e,t){if(e!=null&&t!=null){var n="x"+e+"y"+t;return this._coordsMap[n]}Me(e)&&(t=e.yAxisIndex,e=e.xAxisIndex);for(var i=0,a=this._coordsList;i0?"top":"bottom",a="center"):Fd(i-ds)?(o=n>0?"bottom":"top",a="center"):(o="middle",i>0&&i0?"right":"left":a=n>0?"left":"right"),{rotation:i,textAlign:a,textVerticalAlign:o}},r.makeAxisEventDataBase=function(e){var t={componentType:e.mainType,componentIndex:e.componentIndex};return t[e.mainType+"Index"]=e.componentIndex,t},r.isLabelSilent=function(e){var t=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||t&&t.show)},r}(),IP={axisLine:function(r,e,t,n){var i=e.get(["axisLine","show"]);if(i==="auto"&&r.handleAutoShown&&(i=r.handleAutoShown("axisLine")),!!i){var a=e.axis.getExtent(),o=n.transform,s=[a[0],0],l=[a[1],0],u=s[0]>l[0];o&&(Br(s,s,o),Br(l,l,o));var c=W({lineCap:"round"},e.getModel(["axisLine","lineStyle"]).getLineStyle()),f=new xr({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:c,strokeContainThreshold:r.strokeContainThreshold||5,silent:!0,z2:1});ef(f.shape,f.style.lineWidth),f.anid="line",t.add(f);var h=e.get(["axisLine","symbol"]);if(h!=null){var d=e.get(["axisLine","symbolSize"]);se(h)&&(h=[h,h]),(se(d)||lt(d))&&(d=[d,d]);var p=Pu(e.get(["axisLine","symbolOffset"])||0,d),v=d[0],m=d[1];k([{rotate:r.rotation+Math.PI/2,offset:p[0],r:0},{rotate:r.rotation-Math.PI/2,offset:p[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],function(g,y){if(h[y]!=="none"&&h[y]!=null){var b=ur(h[y],-v/2,-m/2,v,m,c.stroke,!0),_=g.r+g.offset,x=u?l:s;b.attr({rotation:g.rotate,x:x[0]+_*Math.cos(r.rotation),y:x[1]-_*Math.sin(r.rotation),silent:!0,z2:11}),t.add(b)}})}}},axisTickLabel:function(r,e,t,n){var i=hme(t,n,e,r),a=pme(t,n,e,r);if(fme(e,a,i),dme(t,n,e,r.tickDirection),e.get(["axisLabel","hideOverlap"])){var o=eV(K(a,function(s){return{label:s,priority:s.z2,defaultAttr:{ignore:s.ignore}}}));nV(o)}},axisName:function(r,e,t,n){var i=kr(r.axisName,e.get("name"));if(i){var a=e.get("nameLocation"),o=r.nameDirection,s=e.getModel("nameTextStyle"),l=e.get("nameGap")||0,u=e.axis.getExtent(),c=u[0]>u[1]?-1:1,f=[a==="start"?u[0]-c*l:a==="end"?u[1]+c*l:(u[0]+u[1])/2,RP(a)?r.labelOffset+o*l:0],h,d=e.get("nameRotate");d!=null&&(d=d*ds/180);var p;RP(a)?h=hn.innerTextLayout(r.rotation,d??r.rotation,o):(h=cme(r.rotation,a,d||0,u),p=r.axisNameAvailableWidth,p!=null&&(p=Math.abs(p/Math.sin(h.rotation)),!isFinite(p)&&(p=null)));var v=s.getFont(),m=e.get("nameTruncate",!0)||{},g=m.ellipsis,y=kr(r.nameTruncateMaxWidth,m.maxWidth,p),b=new ot({x:f[0],y:f[1],rotation:h.rotation,silent:hn.isLabelSilent(e),style:Et(s,{text:i,font:v,overflow:"truncate",width:y,ellipsis:g,fill:s.getTextColor()||e.get(["axisLine","lineStyle","color"]),align:s.get("align")||h.textAlign,verticalAlign:s.get("verticalAlign")||h.textVerticalAlign}),z2:1});if(Lu({el:b,componentModel:e,itemName:i}),b.__fullText=i,b.anid="name",e.get("triggerEvent")){var _=hn.makeAxisEventDataBase(e);_.targetType="axisName",_.name=i,Le(b).eventData=_}n.add(b),b.updateTransform(),t.add(b),b.decomposeTransform()}}};function cme(r,e,t,n){var i=nz(t-r),a,o,s=n[0]>n[1],l=e==="start"&&!s||e!=="start"&&s;return Fd(i-ds/2)?(o=l?"bottom":"top",a="center"):Fd(i-ds*1.5)?(o=l?"top":"bottom",a="center"):(o="middle",ids/2?a=l?"left":"right":a=l?"right":"left"),{rotation:i,textAlign:a,textVerticalAlign:o}}function fme(r,e,t){if(!VF(r.axis)){var n=r.get(["axisLabel","showMinLabel"]),i=r.get(["axisLabel","showMaxLabel"]);e=e||[],t=t||[];var a=e[0],o=e[1],s=e[e.length-1],l=e[e.length-2],u=t[0],c=t[1],f=t[t.length-1],h=t[t.length-2];n===!1?(Un(a),Un(u)):PP(a,o)&&(n?(Un(o),Un(c)):(Un(a),Un(u))),i===!1?(Un(s),Un(f)):PP(l,s)&&(i?(Un(l),Un(h)):(Un(s),Un(f)))}}function Un(r){r&&(r.ignore=!0)}function PP(r,e){var t=r&&r.getBoundingRect().clone(),n=e&&e.getBoundingRect().clone();if(!(!t||!n)){var i=O0([]);return Eu(i,i,-r.rotation),t.applyTransform(fo([],i,r.getLocalTransform())),n.applyTransform(fo([],i,e.getLocalTransform())),t.intersect(n)}}function RP(r){return r==="middle"||r==="center"}function BV(r,e,t,n,i){for(var a=[],o=[],s=[],l=0;l=0||r===e}function _me(r){var e=pA(r);if(e){var t=e.axisPointerModel,n=e.axis.scale,i=t.option,a=t.get("status"),o=t.get("value");o!=null&&(o=n.parse(o));var s=K2(t);a==null&&(i.status=s?"show":"hide");var l=n.getExtent().slice();l[0]>l[1]&&l.reverse(),(o==null||o>l[1])&&(o=l[1]),o0&&!p.min?p.min=0:p.min!=null&&p.min<0&&!p.max&&(p.max=0);var v=l;p.color!=null&&(v=Ce({color:p.color},l));var m=Be(ke(p),{boundaryGap:t,splitNumber:n,scale:i,axisLine:a,axisTick:o,axisLabel:s,name:p.text,showName:u,nameLocation:"end",nameGap:f,nameTextStyle:v,triggerEvent:h},!1);if(se(c)){var g=m.name;m.name=c.replace("{value}",g??"")}else Te(c)&&(m.name=c(m.name,m));var y=new _t(m,null,this.ecModel);return cr(y,Ip.prototype),y.mainType="radar",y.componentIndex=this.componentIndex,y},this);this._indicatorModels=d},e.prototype.getIndicatorModels=function(){return this._indicatorModels},e.type="radar",e.defaultOption={z:0,center:["50%","50%"],radius:"75%",startAngle:90,axisName:{show:!0},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:Be({lineStyle:{color:"#bbb"}},ch.axisLine),axisLabel:em(ch.axisLabel,!1),axisTick:em(ch.axisTick,!1),splitLine:em(ch.splitLine,!0),splitArea:em(ch.splitArea,!0),indicator:[]},e}(Qe),Pme=["axisLine","axisTickLabel","axisName"],Rme=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,n,i){var a=this.group;a.removeAll(),this._buildAxes(t),this._buildSplitLineAndArea(t)},e.prototype._buildAxes=function(t){var n=t.coordinateSystem,i=n.getIndicatorAxes(),a=K(i,function(o){var s=o.model.get("showName")?o.name:"",l=new hn(o.model,{axisName:s,position:[n.cx,n.cy],rotation:o.angle,labelDirection:-1,tickDirection:-1,nameDirection:1});return l});k(a,function(o){k(Pme,o.add,o),this.group.add(o.getGroup())},this)},e.prototype._buildSplitLineAndArea=function(t){var n=t.coordinateSystem,i=n.getIndicatorAxes();if(!i.length)return;var a=t.get("shape"),o=t.getModel("splitLine"),s=t.getModel("splitArea"),l=o.getModel("lineStyle"),u=s.getModel("areaStyle"),c=o.get("show"),f=s.get("show"),h=l.get("color"),d=u.get("color"),p=q(h)?h:[h],v=q(d)?d:[d],m=[],g=[];function y(I,R,P){var O=P%R.length;return I[O]=I[O]||[],O}if(a==="circle")for(var b=i[0].getTicksCoords(),_=n.cx,x=n.cy,w=0;w3?1.4:o>1?1.2:1.1,c=a>0?u:1/u;O_(this,"zoom","zoomOnMouseWheel",t,{scale:c,originX:s,originY:l,isAvailableBehavior:null})}if(i){var f=Math.abs(a),h=(a>0?1:-1)*(f>3?.4:f>1?.15:.05);O_(this,"scrollMove","moveOnMouseWheel",t,{scrollDelta:h,originX:s,originY:l,isAvailableBehavior:null})}}},e.prototype._pinchHandler=function(t){if(!FP(this._zr,"globalPan")){var n=t.pinchScale>1?1.1:1/1.1;O_(this,"zoom",null,t,{scale:n,originX:t.pinchX,originY:t.pinchY,isAvailableBehavior:null})}},e}(gi);function O_(r,e,t,n,i){r.pointerChecker&&r.pointerChecker(n,i.originX,i.originY)&&(_o(n.event),GV(r,e,t,n,i))}function GV(r,e,t,n,i){i.isAvailableBehavior=ue(Km,null,t,n),r.trigger(e,i)}function Km(r,e,t){var n=t[r];return!r||n&&(!se(n)||e.event[n+"Key"])}function mA(r,e,t){var n=r.target;n.x+=e,n.y+=t,n.dirty()}function gA(r,e,t,n){var i=r.target,a=r.zoomLimit,o=r.zoom=r.zoom||1;if(o*=e,a){var s=a.min||0,l=a.max||1/0;o=Math.max(Math.min(l,o),s)}var u=o/r.zoom;r.zoom=o,i.x-=(t-i.x)*(u-1),i.y-=(n-i.y)*(u-1),i.scaleX*=u,i.scaleY*=u,i.dirty()}var Vme={axisPointer:1,tooltip:1,brush:1};function h1(r,e,t){var n=e.getComponentByElement(r.topTarget),i=n&&n.coordinateSystem;return n&&n!==t&&!Vme.hasOwnProperty(n.mainType)&&i&&i.model!==t}function WV(r){if(se(r)){var e=new DOMParser;r=e.parseFromString(r,"text/xml")}var t=r;for(t.nodeType===9&&(t=t.firstChild);t.nodeName.toLowerCase()!=="svg"||t.nodeType!==1;)t=t.nextSibling;return t}var j_,By={fill:"fill",stroke:"stroke","stroke-width":"lineWidth",opacity:"opacity","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-miterlimit":"miterLimit","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","text-anchor":"textAlign",visibility:"visibility",display:"display"},VP=et(By),zy={"alignment-baseline":"textBaseline","stop-color":"stopColor"},$P=et(zy),$me=function(){function r(){this._defs={},this._root=null}return r.prototype.parse=function(e,t){t=t||{};var n=WV(e);this._defsUsePending=[];var i=new Ee;this._root=i;var a=[],o=n.getAttribute("viewBox")||"",s=parseFloat(n.getAttribute("width")||t.width),l=parseFloat(n.getAttribute("height")||t.height);isNaN(s)&&(s=null),isNaN(l)&&(l=null),Ln(n,i,null,!0,!1);for(var u=n.firstChild;u;)this._parseNode(u,i,a,null,!1,!1),u=u.nextSibling;Wme(this._defs,this._defsUsePending),this._defsUsePending=[];var c,f;if(o){var h=d1(o);h.length>=4&&(c={x:parseFloat(h[0]||0),y:parseFloat(h[1]||0),width:parseFloat(h[2]),height:parseFloat(h[3])})}if(c&&s!=null&&l!=null&&(f=YV(c,{x:0,y:0,width:s,height:l}),!t.ignoreViewBox)){var d=i;i=new Ee,i.add(d),d.scaleX=d.scaleY=f.scale,d.x=f.x,d.y=f.y}return!t.ignoreRootClip&&s!=null&&l!=null&&i.setClipPath(new nt({shape:{x:0,y:0,width:s,height:l}})),{root:i,width:s,height:l,viewBoxRect:c,viewBoxTransform:f,named:a}},r.prototype._parseNode=function(e,t,n,i,a,o){var s=e.nodeName.toLowerCase(),l,u=i;if(s==="defs"&&(a=!0),s==="text"&&(o=!0),s==="defs"||s==="switch")l=t;else{if(!a){var c=j_[s];if(c&&fe(j_,s)){l=c.call(this,e,t);var f=e.getAttribute("name");if(f){var h={name:f,namedFrom:null,svgNodeTagLower:s,el:l};n.push(h),s==="g"&&(u=h)}else i&&n.push({name:i.name,namedFrom:i,svgNodeTagLower:s,el:l});t.add(l)}}var d=HP[s];if(d&&fe(HP,s)){var p=d.call(this,e),v=e.getAttribute("id");v&&(this._defs[v]=p)}}if(l&&l.isGroup)for(var m=e.firstChild;m;)m.nodeType===1?this._parseNode(m,l,n,u,a,o):m.nodeType===3&&o&&this._parseText(m,l),m=m.nextSibling},r.prototype._parseText=function(e,t){var n=new Qc({style:{text:e.textContent},silent:!0,x:this._textX||0,y:this._textY||0});Yn(t,n),Ln(e,n,this._defsUsePending,!1,!1),Hme(n,t);var i=n.style,a=i.fontSize;a&&a<9&&(i.fontSize=9,n.scaleX*=a/9,n.scaleY*=a/9);var o=(i.fontSize||i.fontFamily)&&[i.fontStyle,i.fontWeight,(i.fontSize||12)+"px",i.fontFamily||"sans-serif"].join(" ");i.font=o;var s=n.getBoundingRect();return this._textX+=s.width,t.add(n),n},r.internalField=function(){j_={g:function(e,t){var n=new Ee;return Yn(t,n),Ln(e,n,this._defsUsePending,!1,!1),n},rect:function(e,t){var n=new nt;return Yn(t,n),Ln(e,n,this._defsUsePending,!1,!1),n.setShape({x:parseFloat(e.getAttribute("x")||"0"),y:parseFloat(e.getAttribute("y")||"0"),width:parseFloat(e.getAttribute("width")||"0"),height:parseFloat(e.getAttribute("height")||"0")}),n.silent=!0,n},circle:function(e,t){var n=new Eo;return Yn(t,n),Ln(e,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),r:parseFloat(e.getAttribute("r")||"0")}),n.silent=!0,n},line:function(e,t){var n=new xr;return Yn(t,n),Ln(e,n,this._defsUsePending,!1,!1),n.setShape({x1:parseFloat(e.getAttribute("x1")||"0"),y1:parseFloat(e.getAttribute("y1")||"0"),x2:parseFloat(e.getAttribute("x2")||"0"),y2:parseFloat(e.getAttribute("y2")||"0")}),n.silent=!0,n},ellipse:function(e,t){var n=new W0;return Yn(t,n),Ln(e,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),rx:parseFloat(e.getAttribute("rx")||"0"),ry:parseFloat(e.getAttribute("ry")||"0")}),n.silent=!0,n},polygon:function(e,t){var n=e.getAttribute("points"),i;n&&(i=UP(n));var a=new yn({shape:{points:i||[]},silent:!0});return Yn(t,a),Ln(e,a,this._defsUsePending,!1,!1),a},polyline:function(e,t){var n=e.getAttribute("points"),i;n&&(i=UP(n));var a=new bn({shape:{points:i||[]},silent:!0});return Yn(t,a),Ln(e,a,this._defsUsePending,!1,!1),a},image:function(e,t){var n=new Lr;return Yn(t,n),Ln(e,n,this._defsUsePending,!1,!1),n.setStyle({image:e.getAttribute("xlink:href")||e.getAttribute("href"),x:+e.getAttribute("x"),y:+e.getAttribute("y"),width:+e.getAttribute("width"),height:+e.getAttribute("height")}),n.silent=!0,n},text:function(e,t){var n=e.getAttribute("x")||"0",i=e.getAttribute("y")||"0",a=e.getAttribute("dx")||"0",o=e.getAttribute("dy")||"0";this._textX=parseFloat(n)+parseFloat(a),this._textY=parseFloat(i)+parseFloat(o);var s=new Ee;return Yn(t,s),Ln(e,s,this._defsUsePending,!1,!0),s},tspan:function(e,t){var n=e.getAttribute("x"),i=e.getAttribute("y");n!=null&&(this._textX=parseFloat(n)),i!=null&&(this._textY=parseFloat(i));var a=e.getAttribute("dx")||"0",o=e.getAttribute("dy")||"0",s=new Ee;return Yn(t,s),Ln(e,s,this._defsUsePending,!1,!0),this._textX+=parseFloat(a),this._textY+=parseFloat(o),s},path:function(e,t){var n=e.getAttribute("d")||"",i=Nz(n);return Yn(t,i),Ln(e,i,this._defsUsePending,!1,!1),i.silent=!0,i}}}(),r}(),HP={lineargradient:function(r){var e=parseInt(r.getAttribute("x1")||"0",10),t=parseInt(r.getAttribute("y1")||"0",10),n=parseInt(r.getAttribute("x2")||"10",10),i=parseInt(r.getAttribute("y2")||"0",10),a=new Ap(e,t,n,i);return GP(r,a),WP(r,a),a},radialgradient:function(r){var e=parseInt(r.getAttribute("cx")||"0",10),t=parseInt(r.getAttribute("cy")||"0",10),n=parseInt(r.getAttribute("r")||"0",10),i=new Vz(e,t,n);return GP(r,i),WP(r,i),i}};function GP(r,e){var t=r.getAttribute("gradientUnits");t==="userSpaceOnUse"&&(e.global=!0)}function WP(r,e){for(var t=r.firstChild;t;){if(t.nodeType===1&&t.nodeName.toLocaleLowerCase()==="stop"){var n=t.getAttribute("offset"),i=void 0;n&&n.indexOf("%")>0?i=parseInt(n,10)/100:n?i=parseFloat(n):i=0;var a={};UV(t,a,a);var o=a.stopColor||t.getAttribute("stop-color")||"#000000";e.colorStops.push({offset:i,color:o})}t=t.nextSibling}}function Yn(r,e){r&&r.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),Ce(e.__inheritedStyle,r.__inheritedStyle))}function UP(r){for(var e=d1(r),t=[],n=0;n0;a-=2){var o=n[a],s=n[a-1],l=d1(o);switch(i=i||zn(),s){case"translate":La(i,i,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":dC(i,i,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":Eu(i,i,-parseFloat(l[0])*N_,[parseFloat(l[1]||"0"),parseFloat(l[2]||"0")]);break;case"skewX":var u=Math.tan(parseFloat(l[0])*N_);fo(i,[1,0,u,1,0,0],i);break;case"skewY":var c=Math.tan(parseFloat(l[0])*N_);fo(i,[1,c,0,1,0,0],i);break;case"matrix":i[0]=parseFloat(l[0]),i[1]=parseFloat(l[1]),i[2]=parseFloat(l[2]),i[3]=parseFloat(l[3]),i[4]=parseFloat(l[4]),i[5]=parseFloat(l[5]);break}}e.setLocalTransform(i)}}var qP=/([^\s:;]+)\s*:\s*([^:;]+)/g;function UV(r,e,t){var n=r.getAttribute("style");if(n){qP.lastIndex=0;for(var i;(i=qP.exec(n))!=null;){var a=i[1],o=fe(By,a)?By[a]:null;o&&(e[o]=i[2]);var s=fe(zy,a)?zy[a]:null;s&&(t[s]=i[2])}}}function Xme(r,e,t){for(var n=0;n0,m={api:n,geo:l,mapOrGeoModel:e,data:s,isVisualEncodedByVisualMap:v,isGeo:o,transformInfoRaw:h};l.resourceType==="geoJSON"?this._buildGeoJSON(m):l.resourceType==="geoSVG"&&this._buildSVG(m),this._updateController(e,t,n),this._updateMapSelectHandler(e,u,n,i)},r.prototype._buildGeoJSON=function(e){var t=this._regionsGroupByName=ve(),n=ve(),i=this._regionsGroup,a=e.transformInfoRaw,o=e.mapOrGeoModel,s=e.data,l=e.geo.projection,u=l&&l.stream;function c(d,p){return p&&(d=p(d)),d&&[d[0]*a.scaleX+a.x,d[1]*a.scaleY+a.y]}function f(d){for(var p=[],v=!u&&l&&l.project,m=0;m=0)&&(h=i);var d=o?{normal:{align:"center",verticalAlign:"middle"}}:null;Vr(e,Tr(n),{labelFetcher:h,labelDataIndex:f,defaultText:t},d);var p=e.getTextContent();if(p&&(qV(p).ignore=p.ignore,e.textConfig&&o)){var v=e.getBoundingRect().clone();e.textConfig.layoutRect=v,e.textConfig.position=[(o[0]-v.x)/v.width*100+"%",(o[1]-v.y)/v.height*100+"%"]}e.disableLabelAnimation=!0}else e.removeTextContent(),e.removeTextConfig(),e.disableLabelAnimation=null}function QP(r,e,t,n,i,a){r.data?r.data.setItemGraphicEl(a,e):Le(e).eventData={componentType:"geo",componentIndex:i.componentIndex,geoIndex:i.componentIndex,name:t,region:n&&n.option||{}}}function eR(r,e,t,n,i){r.data||Lu({el:e,componentModel:i,itemName:t,itemTooltipOption:n.get("tooltip")})}function tR(r,e,t,n,i){e.highDownSilentOnTouch=!!i.get("selectedMode");var a=n.getModel("emphasis"),o=a.get("focus");return $t(e,o,a.get("blurScope"),a.get("disabled")),r.isGeo&&fue(e,i,t),o}function rR(r,e,t){var n=[],i;function a(){i=[]}function o(){i.length&&(n.push(i),i=[])}var s=e({polygonStart:a,polygonEnd:o,lineStart:a,lineEnd:o,point:function(l,u){isFinite(l)&&isFinite(u)&&i.push([l,u])},sphere:function(){}});return!t&&s.polygonStart(),k(r,function(l){s.lineStart();for(var u=0;u-1&&(i.style.stroke=i.style.fill,i.style.fill="#fff",i.style.lineWidth=2),i},e.type="series.map",e.dependencies=["geo"],e.layoutMode="box",e.defaultOption={z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:null,showLegendSymbol:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,selectedMode:!0,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},nameProperty:"name"},e}(It);function vge(r,e){var t={};return k(r,function(n){n.each(n.mapDimension("value"),function(i,a){var o="ec-"+n.getName(a);t[o]=t[o]||[],isNaN(i)||t[o].push(i)})}),r[0].map(r[0].mapDimension("value"),function(n,i){for(var a="ec-"+r[0].getName(i),o=0,s=1/0,l=-1/0,u=t[a].length,c=0;c1?(_.width=b,_.height=b/m):(_.height=b,_.width=b*m),_.y=y[1]-_.height/2,_.x=y[0]-_.width/2;else{var x=r.getBoxLayoutParams();x.aspect=m,_=gr(x,{width:p,height:v})}this.setViewRect(_.x,_.y,_.width,_.height),this.setCenter(r.get("center"),e),this.setZoom(r.get("zoom"))}function bge(r,e){k(e.get("geoCoord"),function(t,n){r.addGeoCoord(n,t)})}var _ge=function(){function r(){this.dimensions=KV}return r.prototype.create=function(e,t){var n=[];function i(o){return{nameProperty:o.get("nameProperty"),aspectScale:o.get("aspectScale"),projection:o.get("projection")}}e.eachComponent("geo",function(o,s){var l=o.get("map"),u=new Q2(l+s,l,W({nameMap:o.get("nameMap")},i(o)));u.zoomLimit=o.get("scaleLimit"),n.push(u),o.coordinateSystem=u,u.model=o,u.resize=oR,u.resize(o,t)}),e.eachSeries(function(o){var s=o.get("coordinateSystem");if(s==="geo"){var l=o.get("geoIndex")||0;o.coordinateSystem=n[l]}});var a={};return e.eachSeriesByType("map",function(o){if(!o.getHostGeoModel()){var s=o.getMapType();a[s]=a[s]||[],a[s].push(o)}}),k(a,function(o,s){var l=K(o,function(c){return c.get("nameMap")}),u=new Q2(s,s,W({nameMap:lC(l)},i(o[0])));u.zoomLimit=kr.apply(null,K(o,function(c){return c.get("scaleLimit")})),n.push(u),u.resize=oR,u.resize(o[0],t),k(o,function(c){c.coordinateSystem=u,bge(u,c)})}),n},r.prototype.getFilledRegions=function(e,t,n,i){for(var a=(e||[]).slice(),o=ve(),s=0;s=0;o--){var s=i[o];s.hierNode={defaultAncestor:null,ancestor:s,prelim:0,modifier:0,change:0,shift:0,i:o,thread:null},t.push(s)}}function Age(r,e){var t=r.isExpand?r.children:[],n=r.parentNode.children,i=r.hierNode.i?n[r.hierNode.i-1]:null;if(t.length){Dge(r);var a=(t[0].hierNode.prelim+t[t.length-1].hierNode.prelim)/2;i?(r.hierNode.prelim=i.hierNode.prelim+e(r,i),r.hierNode.modifier=r.hierNode.prelim-a):r.hierNode.prelim=a}else i&&(r.hierNode.prelim=i.hierNode.prelim+e(r,i));r.parentNode.hierNode.defaultAncestor=Ege(r,i,r.parentNode.hierNode.defaultAncestor||n[0],e)}function Mge(r){var e=r.hierNode.prelim+r.parentNode.hierNode.modifier;r.setLayout({x:e},!0),r.hierNode.modifier+=r.parentNode.hierNode.modifier}function lR(r){return arguments.length?r:Pge}function Ph(r,e){return r-=Math.PI/2,{x:e*Math.cos(r),y:e*Math.sin(r)}}function kge(r,e){return gr(r.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function Dge(r){for(var e=r.children,t=e.length,n=0,i=0;--t>=0;){var a=e[t];a.hierNode.prelim+=n,a.hierNode.modifier+=n,i+=a.hierNode.change,n+=a.hierNode.shift+i}}function Ege(r,e,t,n){if(e){for(var i=r,a=r,o=a.parentNode.children[0],s=e,l=i.hierNode.modifier,u=a.hierNode.modifier,c=o.hierNode.modifier,f=s.hierNode.modifier;s=B_(s),a=z_(a),s&&a;){i=B_(i),o=z_(o),i.hierNode.ancestor=r;var h=s.hierNode.prelim+f-a.hierNode.prelim-u+n(s,a);h>0&&(Ige(Lge(s,r,t),r,h),u+=h,l+=h),f+=s.hierNode.modifier,u+=a.hierNode.modifier,l+=i.hierNode.modifier,c+=o.hierNode.modifier}s&&!B_(i)&&(i.hierNode.thread=s,i.hierNode.modifier+=f-l),a&&!z_(o)&&(o.hierNode.thread=a,o.hierNode.modifier+=u-c,t=r)}return t}function B_(r){var e=r.children;return e.length&&r.isExpand?e[e.length-1]:r.hierNode.thread}function z_(r){var e=r.children;return e.length&&r.isExpand?e[0]:r.hierNode.thread}function Lge(r,e,t){return r.hierNode.ancestor.parentNode===e.parentNode?r.hierNode.ancestor:t}function Ige(r,e,t){var n=t/(e.hierNode.i-r.hierNode.i);e.hierNode.change-=n,e.hierNode.shift+=t,e.hierNode.modifier+=t,e.hierNode.prelim+=t,r.hierNode.change+=n}function Pge(r,e){return r.parentNode===e.parentNode?1:2}var Rge=function(){function r(){this.parentPoint=[],this.childPoints=[]}return r}(),Oge=function(r){z(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new Rge},e.prototype.buildPath=function(t,n){var i=n.childPoints,a=i.length,o=n.parentPoint,s=i[0],l=i[a-1];if(a===1){t.moveTo(o[0],o[1]),t.lineTo(s[0],s[1]);return}var u=n.orient,c=u==="TB"||u==="BT"?0:1,f=1-c,h=ie(n.forkPosition,1),d=[];d[c]=o[c],d[f]=o[f]+(l[f]-o[f])*h,t.moveTo(o[0],o[1]),t.lineTo(d[0],d[1]),t.moveTo(s[0],s[1]),d[c]=s[c],t.lineTo(d[0],d[1]),d[c]=l[c],t.lineTo(d[0],d[1]),t.lineTo(l[0],l[1]);for(var p=1;py.x,x||(_=_-Math.PI));var S=x?"left":"right",T=s.getModel("label"),C=T.get("rotate"),A=C*(Math.PI/180),M=m.getTextContent();M&&(m.setTextConfig({position:T.get("position")||S,rotation:C==null?-_:A,origin:"center"}),M.setStyle("verticalAlign","middle"))}var D=s.get(["emphasis","focus"]),E=D==="relative"?jd(o.getAncestorsIndices(),o.getDescendantIndices()):D==="ancestor"?o.getAncestorsIndices():D==="descendant"?o.getDescendantIndices():null;E&&(Le(t).focus=E),Nge(i,o,c,t,p,d,v,n),t.__edge&&(t.onHoverStateChange=function(L){if(L!=="blur"){var I=o.parentNode&&r.getItemGraphicEl(o.parentNode.dataIndex);I&&I.hoverState===Sp||gy(t.__edge,L)}})}function Nge(r,e,t,n,i,a,o,s){var l=e.getModel(),u=r.get("edgeShape"),c=r.get("layout"),f=r.getOrient(),h=r.get(["lineStyle","curveness"]),d=r.get("edgeForkPosition"),p=l.getModel("lineStyle").getLineStyle(),v=n.__edge;if(u==="curve")e.parentNode&&e.parentNode!==t&&(v||(v=n.__edge=new Cp({shape:eS(c,f,h,i,i)})),ut(v,{shape:eS(c,f,h,a,o)},r));else if(u==="polyline"&&c==="orthogonal"&&e!==t&&e.children&&e.children.length!==0&&e.isExpand===!0){for(var m=e.children,g=[],y=0;yt&&(t=i.height)}this.height=t+1},r.prototype.getNodeById=function(e){if(this.getId()===e)return this;for(var t=0,n=this.children,i=n.length;t=0&&this.hostTree.data.setItemLayout(this.dataIndex,e,t)},r.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},r.prototype.getModel=function(e){if(!(this.dataIndex<0)){var t=this.hostTree,n=t.data.getItemModel(this.dataIndex);return n.getModel(e)}},r.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},r.prototype.setVisual=function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,e,t)},r.prototype.getVisual=function(e){return this.hostTree.data.getItemVisual(this.dataIndex,e)},r.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},r.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},r.prototype.getChildIndex=function(){if(this.parentNode){for(var e=this.parentNode.children,t=0;t=0){var n=t.getData().tree.root,i=r.targetNode;if(se(i)&&(i=n.getNodeById(i)),i&&n.contains(i))return{node:i};var a=r.targetNodeId;if(a!=null&&(i=n.getNodeById(a)))return{node:i}}}function r$(r){for(var e=[];r;)r=r.parentNode,r&&e.push(r);return e.reverse()}function wA(r,e){var t=r$(r);return He(t,e)>=0}function p1(r,e){for(var t=[];r;){var n=r.dataIndex;t.push({name:r.name,dataIndex:n,value:e.getRawValue(n)}),r=r.parentNode}return t.reverse(),t}var Uge=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.hasSymbolVisual=!0,t.ignoreStyleOnData=!0,t}return e.prototype.getInitialData=function(t){var n={name:t.name,children:t.data},i=t.leaves||{},a=new _t(i,this,this.ecModel),o=xA.createTree(n,this,s);function s(f){f.wrapMethod("getItemModel",function(h,d){var p=o.getNodeByDataIndex(d);return p&&p.children.length&&p.isExpand||(h.parentModel=a),h})}var l=0;o.eachNode("preorder",function(f){f.depth>l&&(l=f.depth)});var u=t.expandAndCollapse,c=u&&t.initialTreeDepth>=0?t.initialTreeDepth:l;return o.root.eachNode("preorder",function(f){var h=f.hostTree.data.getRawDataItem(f.dataIndex);f.isExpand=h&&h.collapsed!=null?!h.collapsed:f.depth<=c}),o.data},e.prototype.getOrient=function(){var t=this.get("orient");return t==="horizontal"?t="LR":t==="vertical"&&(t="TB"),t},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.formatTooltip=function(t,n,i){for(var a=this.getData().tree,o=a.root.children[0],s=a.getNodeByDataIndex(t),l=s.getValue(),u=s.name;s&&s!==o;)u=s.parentNode.name+"."+u,s=s.parentNode;return Cr("nameValue",{name:u,value:l,noValue:isNaN(l)||l==null})},e.prototype.getDataParams=function(t){var n=r.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return n.treeAncestors=p1(i,this),n.collapsed=!i.isExpand,n},e.type="series.tree",e.layoutMode="box",e.defaultOption={z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},e}(It);function Yge(r,e,t){for(var n=[r],i=[],a;a=n.pop();)if(i.push(a),a.isExpand){var o=a.children;if(o.length)for(var s=0;s=0;a--)t.push(i[a])}}function qge(r,e){r.eachSeriesByType("tree",function(t){Xge(t,e)})}function Xge(r,e){var t=kge(r,e);r.layoutInfo=t;var n=r.get("layout"),i=0,a=0,o=null;n==="radial"?(i=2*Math.PI,a=Math.min(t.height,t.width)/2,o=lR(function(b,_){return(b.parentNode===_.parentNode?1:2)/b.depth})):(i=t.width,a=t.height,o=lR());var s=r.getData().tree.root,l=s.children[0];if(l){Cge(s),Yge(l,Age,o),s.hierNode.modifier=-l.hierNode.prelim,hh(l,Mge);var u=l,c=l,f=l;hh(l,function(b){var _=b.getLayout().x;_c.getLayout().x&&(c=b),b.depth>f.depth&&(f=b)});var h=u===c?1:o(u,c)/2,d=h-u.getLayout().x,p=0,v=0,m=0,g=0;if(n==="radial")p=i/(c.getLayout().x+h+d),v=a/(f.depth-1||1),hh(l,function(b){m=(b.getLayout().x+d)*p,g=(b.depth-1)*v;var _=Ph(m,g);b.setLayout({x:_.x,y:_.y,rawX:m,rawY:g},!0)});else{var y=r.getOrient();y==="RL"||y==="LR"?(v=a/(c.getLayout().x+h+d),p=i/(f.depth-1||1),hh(l,function(b){g=(b.getLayout().x+d)*v,m=y==="LR"?(b.depth-1)*p:i-(b.depth-1)*p,b.setLayout({x:m,y:g},!0)})):(y==="TB"||y==="BT")&&(p=i/(c.getLayout().x+h+d),v=a/(f.depth-1||1),hh(l,function(b){m=(b.getLayout().x+d)*p,g=y==="TB"?(b.depth-1)*v:a-(b.depth-1)*v,b.setLayout({x:m,y:g},!0)}))}}}function Kge(r){r.eachSeriesByType("tree",function(e){var t=e.getData(),n=t.tree;n.eachNode(function(i){var a=i.getModel(),o=a.getModel("itemStyle").getItemStyle(),s=t.ensureUniqueItemVisual(i.dataIndex,"style");W(s,o)})})}function Zge(r){r.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(e,t){t.eachComponent({mainType:"series",subType:"tree",query:e},function(n){var i=e.dataIndex,a=n.getData().tree,o=a.getNodeByDataIndex(i);o.isExpand=!o.isExpand})}),r.registerAction({type:"treeRoam",event:"treeRoam",update:"none"},function(e,t,n){t.eachComponent({mainType:"series",subType:"tree",query:e},function(i){var a=i.coordinateSystem,o=bA(a,e,void 0,n);i.setCenter&&i.setCenter(o.center),i.setZoom&&i.setZoom(o.zoom)})})}function Jge(r){r.registerChartView(jge),r.registerSeriesModel(Uge),r.registerLayout(qge),r.registerVisual(Kge),Zge(r)}var dR=["treemapZoomToNode","treemapRender","treemapMove"];function Qge(r){for(var e=0;e1;)a=a.parentNode;var o=k2(r.ecModel,a.name||a.dataIndex+"",n);i.setVisual("decal",o)})}var eye=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.preventUsingHoverLayer=!0,t}return e.prototype.getInitialData=function(t,n){var i={name:t.name,children:t.data};i$(i);var a=t.levels||[],o=this.designatedVisualItemStyle={},s=new _t({itemStyle:o},this,n);a=t.levels=tye(a,n);var l=K(a||[],function(f){return new _t(f,s,n)},this),u=xA.createTree(i,this,c);function c(f){f.wrapMethod("getItemModel",function(h,d){var p=u.getNodeByDataIndex(d),v=p?l[p.depth]:null;return h.parentModel=v||s,h})}return u.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.formatTooltip=function(t,n,i){var a=this.getData(),o=this.getRawValue(t),s=a.getName(t);return Cr("nameValue",{name:s,value:o})},e.prototype.getDataParams=function(t){var n=r.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return n.treeAncestors=p1(i,this),n.treePathInfo=n.treeAncestors,n},e.prototype.setLayoutInfo=function(t){this.layoutInfo=this.layoutInfo||{},W(this.layoutInfo,t)},e.prototype.mapIdToIndex=function(t){var n=this._idIndexMap;n||(n=this._idIndexMap=ve(),this._idIndexMapCount=0);var i=n.get(t);return i==null&&n.set(t,i=this._idIndexMapCount++),i},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var n=this.getRawData().tree.root;(!t||t!==n&&!n.contains(t))&&(this._viewRoot=n)},e.prototype.enableAriaDecal=function(){n$(this)},e.type="series.treemap",e.layoutMode="box",e.defaultOption={progressive:0,left:"center",top:"middle",width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.32*.32,scaleLimit:null,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",textStyle:{color:"#fff"}},emphasis:{itemStyle:{color:"rgba(0,0,0,0.9)"}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],overflow:"truncate",verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},e}(It);function i$(r){var e=0;k(r.children,function(n){i$(n);var i=n.value;q(i)&&(i=i[0]),e+=i});var t=r.value;q(t)&&(t=t[0]),(t==null||isNaN(t))&&(t=e),t<0&&(t=0),q(r.value)?r.value[0]=t:r.value=t}function tye(r,e){var t=wt(e.get("color")),n=wt(e.get(["aria","decal","decals"]));if(t){r=r||[];var i,a;k(r,function(s){var l=new _t(s),u=l.get("color"),c=l.get("decal");(l.get(["itemStyle","color"])||u&&u!=="none")&&(i=!0),(l.get(["itemStyle","decal"])||c&&c!=="none")&&(a=!0)});var o=r[0]||(r[0]={});return i||(o.color=t.slice()),!a&&n&&(o.decal=n.slice()),r}}var rye=8,pR=8,F_=5,nye=function(){function r(e){this.group=new Ee,e.add(this.group)}return r.prototype.render=function(e,t,n,i){var a=e.getModel("breadcrumb"),o=this.group;if(o.removeAll(),!(!a.get("show")||!n)){var s=a.getModel("itemStyle"),l=a.getModel("emphasis"),u=s.getModel("textStyle"),c=l.getModel(["itemStyle","textStyle"]),f={pos:{left:a.get("left"),right:a.get("right"),top:a.get("top"),bottom:a.get("bottom")},box:{width:t.getWidth(),height:t.getHeight()},emptyItemWidth:a.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(n,f,u),this._renderContent(e,f,s,l,u,c,i),t1(o,f.pos,f.box)}},r.prototype._prepare=function(e,t,n){for(var i=e;i;i=i.parentNode){var a=vr(i.getModel().get("name"),""),o=n.getTextRect(a),s=Math.max(o.width+rye*2,t.emptyItemWidth);t.totalWidth+=s+pR,t.renderList.push({node:i,text:a,width:s})}},r.prototype._renderContent=function(e,t,n,i,a,o,s){for(var l=0,u=t.emptyItemWidth,c=e.get(["breadcrumb","height"]),f=dce(t.pos,t.box),h=t.totalWidth,d=t.renderList,p=i.getModel("itemStyle").getItemStyle(),v=d.length-1;v>=0;v--){var m=d[v],g=m.node,y=m.width,b=m.text;h>f.width&&(h-=y-u,y=u,b=null);var _=new yn({shape:{points:iye(l,0,y,c,v===d.length-1,v===0)},style:Ce(n.getItemStyle(),{lineJoin:"bevel"}),textContent:new ot({style:Et(a,{text:b})}),textConfig:{position:"inside"},z2:bf*1e4,onclick:Oe(s,g)});_.disableLabelAnimation=!0,_.getTextContent().ensureState("emphasis").style=Et(o,{text:b}),_.ensureState("emphasis").style=p,$t(_,i.get("focus"),i.get("blurScope"),i.get("disabled")),this.group.add(_),aye(_,e,g),l+=y+pR}},r.prototype.remove=function(){this.group.removeAll()},r}();function iye(r,e,t,n,i,a){var o=[[i?r:r-F_,e],[r+t,e],[r+t,e+n],[i?r:r-F_,e+n]];return!a&&o.splice(2,0,[r+t+F_,e+n/2]),!i&&o.push([r,e+n/2]),o}function aye(r,e,t){Le(r).eventData={componentType:"series",componentSubType:"treemap",componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:t&&t.dataIndex,name:t&&t.name},treePathInfo:t&&p1(t,e)}}var oye=function(){function r(){this._storage=[],this._elExistsMap={}}return r.prototype.add=function(e,t,n,i,a){return this._elExistsMap[e.id]?!1:(this._elExistsMap[e.id]=!0,this._storage.push({el:e,target:t,duration:n,delay:i,easing:a}),!0)},r.prototype.finished=function(e){return this._finishedCallback=e,this},r.prototype.start=function(){for(var e=this,t=this._storage.length,n=function(){t--,t<=0&&(e._storage.length=0,e._elExistsMap={},e._finishedCallback&&e._finishedCallback())},i=0,a=this._storage.length;imR||Math.abs(t.dy)>mR)){var n=this.seriesModel.getData().tree.root;if(!n)return;var i=n.getLayout();if(!i)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:i.x+t.dx,y:i.y+t.dy,width:i.width,height:i.height}})}},e.prototype._onZoom=function(t){var n=t.originX,i=t.originY,a=t.scale;if(this._state!=="animating"){var o=this.seriesModel.getData().tree.root;if(!o)return;var s=o.getLayout();if(!s)return;var l=new Ve(s.x,s.y,s.width,s.height),u=null,c=this._controllerHost;u=c.zoomLimit;var f=c.zoom=c.zoom||1;if(f*=a,u){var h=u.min||0,d=u.max||1/0;f=Math.max(Math.min(d,f),h)}var p=f/c.zoom;c.zoom=f;var v=this.seriesModel.layoutInfo;n-=v.x,i-=v.y;var m=zn();La(m,m,[-n,-i]),dC(m,m,[p,p]),La(m,m,[n,i]),l.applyTransform(m),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:l.x,y:l.y,width:l.width,height:l.height}})}},e.prototype._initEvents=function(t){var n=this;t.on("click",function(i){if(n._state==="ready"){var a=n.seriesModel.get("nodeClick",!0);if(a){var o=n.findTarget(i.offsetX,i.offsetY);if(o){var s=o.node;if(s.getLayout().isLeafRoot)n._rootToNode(o);else if(a==="zoomToNode")n._zoomToNode(o);else if(a==="link"){var l=s.hostTree.data.getItemModel(s.dataIndex),u=l.get("link",!0),c=l.get("target",!0)||"blank";u&&Sy(u,c)}}}}},this)},e.prototype._renderBreadcrumb=function(t,n,i){var a=this;i||(i=t.get("leafDepth",!0)!=null?{node:t.getViewRoot()}:this.findTarget(n.getWidth()/2,n.getHeight()/2),i||(i={node:t.getData().tree.root})),(this._breadcrumb||(this._breadcrumb=new nye(this.group))).render(t,n,i.node,function(o){a._state!=="animating"&&(wA(t.getViewRoot(),o)?a._rootToNode({node:o}):a._zoomToNode({node:o}))})},e.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=dh(),this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},e.prototype.dispose=function(){this._clearController()},e.prototype._zoomToNode=function(t){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},e.prototype._rootToNode=function(t){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},e.prototype.findTarget=function(t,n){var i,a=this.seriesModel.getViewRoot();return a.eachNode({attr:"viewChildren",order:"preorder"},function(o){var s=this._storage.background[o.getRawIndex()];if(s){var l=s.transformCoordToLocal(t,n),u=s.shape;if(u.x<=l[0]&&l[0]<=u.x+u.width&&u.y<=l[1]&&l[1]<=u.y+u.height)i={node:o,offsetX:l[0],offsetY:l[1]};else return!1}},this),i},e.type="treemap",e}(St);function dh(){return{nodeGroup:[],background:[],content:[]}}function hye(r,e,t,n,i,a,o,s,l,u){if(!o)return;var c=o.getLayout(),f=r.getData(),h=o.getModel();if(f.setItemGraphicEl(o.dataIndex,null),!c||!c.isInView)return;var d=c.width,p=c.height,v=c.borderWidth,m=c.invisible,g=o.getRawIndex(),y=s&&s.getRawIndex(),b=o.viewChildren,_=c.upperHeight,x=b&&b.length,w=h.getModel("itemStyle"),S=h.getModel(["emphasis","itemStyle"]),T=h.getModel(["blur","itemStyle"]),C=h.getModel(["select","itemStyle"]),A=w.get("borderRadius")||0,M=U("nodeGroup",tS);if(!M)return;if(l.add(M),M.x=c.x||0,M.y=c.y||0,M.markRedraw(),Fy(M).nodeWidth=d,Fy(M).nodeHeight=p,c.isAboveViewRoot)return M;var D=U("background",vR,u,uye);D&&F(M,D,x&&c.upperLabelHeight);var E=h.getModel("emphasis"),L=E.get("focus"),I=E.get("blurScope"),R=E.get("disabled"),P=L==="ancestor"?o.getAncestorsIndices():L==="descendant"?o.getDescendantIndices():L;if(x)Hd(M)&&Pl(M,!1),D&&(Pl(D,!R),f.setItemGraphicEl(o.dataIndex,D),_2(D,P,I));else{var O=U("content",vR,u,cye);O&&N(M,O),D.disableMorphing=!0,D&&Hd(D)&&Pl(D,!1),Pl(M,!R),f.setItemGraphicEl(o.dataIndex,M);var j=h.getShallow("cursor");j&&O.attr("cursor",j),_2(M,P,I)}return M;function F(ge,le,be){var re=Le(le);if(re.dataIndex=o.dataIndex,re.seriesIndex=r.seriesIndex,le.setShape({x:0,y:0,width:d,height:p,r:A}),m)B(le);else{le.invisible=!1;var G=o.getVisual("style"),ee=G.stroke,Q=bR(w);Q.fill=ee;var me=yl(S);me.fill=S.get("borderColor");var he=yl(T);he.fill=T.get("borderColor");var Se=yl(C);if(Se.fill=C.get("borderColor"),be){var Fe=d-2*v;$(le,ee,G.opacity,{x:v,y:0,width:Fe,height:_})}else le.removeTextContent();le.setStyle(Q),le.ensureState("emphasis").style=me,le.ensureState("blur").style=he,le.ensureState("select").style=Se,gu(le)}ge.add(le)}function N(ge,le){var be=Le(le);be.dataIndex=o.dataIndex,be.seriesIndex=r.seriesIndex;var re=Math.max(d-2*v,0),G=Math.max(p-2*v,0);if(le.culling=!0,le.setShape({x:v,y:v,width:re,height:G,r:A}),m)B(le);else{le.invisible=!1;var ee=o.getVisual("style"),Q=ee.fill,me=bR(w);me.fill=Q,me.decal=ee.decal;var he=yl(S),Se=yl(T),Fe=yl(C);$(le,Q,ee.opacity,null),le.setStyle(me),le.ensureState("emphasis").style=he,le.ensureState("blur").style=Se,le.ensureState("select").style=Fe,gu(le)}ge.add(le)}function B(ge){!ge.invisible&&a.push(ge)}function $(ge,le,be,re){var G=h.getModel(re?yR:gR),ee=vr(h.get("name"),null),Q=G.getShallow("show");Vr(ge,Tr(h,re?yR:gR),{defaultText:Q?ee:null,inheritColor:le,defaultOpacity:be,labelFetcher:r,labelDataIndex:o.dataIndex});var me=ge.getTextContent();if(me){var he=me.style,Se=cC(he.padding||0);re&&(ge.setTextConfig({layoutRect:re}),me.disableLabelLayout=!0),me.beforeUpdate=function(){var xe=Math.max((re?re.width:ge.shape.width)-Se[1]-Se[3],0),rt=Math.max((re?re.height:ge.shape.height)-Se[0]-Se[2],0);(he.width!==xe||he.height!==rt)&&me.setStyle({width:xe,height:rt})},he.truncateMinChar=2,he.lineOverflow="truncate",J(he,re,c);var Fe=me.getState("emphasis");J(Fe?Fe.style:null,re,c)}}function J(ge,le,be){var re=ge?ge.text:null;if(!le&&be.isLeafRoot&&re!=null){var G=r.get("drillDownIcon",!0);ge.text=G?G+" "+re:re}}function U(ge,le,be,re){var G=y!=null&&t[ge][y],ee=i[ge];return G?(t[ge][y]=null,we(ee,G)):m||(G=new le,G instanceof mi&&(G.z2=dye(be,re)),Ye(ee,G)),e[ge][g]=G}function we(ge,le){var be=ge[g]={};le instanceof tS?(be.oldX=le.x,be.oldY=le.y):be.oldShape=W({},le.shape)}function Ye(ge,le){var be=ge[g]={},re=o.parentNode,G=le instanceof Ee;if(re&&(!n||n.direction==="drillDown")){var ee=0,Q=0,me=i.background[re.getRawIndex()];!n&&me&&me.oldShape&&(ee=me.oldShape.width,Q=me.oldShape.height),G?(be.oldX=0,be.oldY=Q):be.oldShape={x:ee,y:Q,width:0,height:0}}be.fadein=!G}}function dye(r,e){return r*lye+e}var np=k,pye=Me,Vy=-1,Sr=function(){function r(e){var t=e.mappingMethod,n=e.type,i=this.option=ke(e);this.type=n,this.mappingMethod=t,this._normalizeData=gye[t];var a=r.visualHandlers[n];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[t],t==="piecewise"?(V_(i),vye(i)):t==="category"?i.categories?mye(i):V_(i,!0):(vn(t!=="linear"||i.dataExtent),V_(i))}return r.prototype.mapValueToVisual=function(e){var t=this._normalizeData(e);return this._normalizedToVisual(t,e)},r.prototype.getNormalizer=function(){return ue(this._normalizeData,this)},r.listVisualTypes=function(){return et(r.visualHandlers)},r.isValidType=function(e){return r.visualHandlers.hasOwnProperty(e)},r.eachVisual=function(e,t,n){Me(e)?k(e,t,n):t.call(n,e)},r.mapVisual=function(e,t,n){var i,a=q(e)?[]:Me(e)?{}:(i=!0,null);return r.eachVisual(e,function(o,s){var l=t.call(n,o,s);i?a=l:a[s]=l}),a},r.retrieveVisuals=function(e){var t={},n;return e&&np(r.visualHandlers,function(i,a){e.hasOwnProperty(a)&&(t[a]=e[a],n=!0)}),n?t:null},r.prepareVisualTypes=function(e){if(q(e))e=e.slice();else if(pye(e)){var t=[];np(e,function(n,i){t.push(i)}),e=t}else return[];return e.sort(function(n,i){return i==="color"&&n!=="color"&&n.indexOf("color")===0?1:-1}),e},r.dependsOn=function(e,t){return t==="color"?!!(e&&e.indexOf(t)===0):e===t},r.findPieceIndex=function(e,t,n){for(var i,a=1/0,o=0,s=t.length;o=0;a--)n[a]==null&&(delete t[e[a]],e.pop())}function V_(r,e){var t=r.visual,n=[];Me(t)?np(t,function(a){n.push(a)}):t!=null&&n.push(t);var i={color:1,symbol:1};!e&&n.length===1&&!i.hasOwnProperty(r.type)&&(n[1]=n[0]),a$(r,n)}function rm(r){return{applyVisual:function(e,t,n){var i=this.mapValueToVisual(e);n("color",r(t("color"),i))},_normalizedToVisual:rS([0,1])}}function _R(r){var e=this.option.visual;return e[Math.round(bt(r,[0,1],[0,e.length-1],!0))]||{}}function ph(r){return function(e,t,n){n(r,this.mapValueToVisual(e))}}function Rh(r){var e=this.option.visual;return e[this.option.loop&&r!==Vy?r%e.length:r]}function bl(){return this.option.visual[0]}function rS(r){return{linear:function(e){return bt(e,r,this.option.visual,!0)},category:Rh,piecewise:function(e,t){var n=nS.call(this,t);return n==null&&(n=bt(e,r,this.option.visual,!0)),n},fixed:bl}}function nS(r){var e=this.option,t=e.pieceList;if(e.hasSpecialVisual){var n=Sr.findPieceIndex(r,t),i=t[n];if(i&&i.visual)return i.visual[this.type]}}function a$(r,e){return r.visual=e,r.type==="color"&&(r.parsedVisual=K(e,function(t){var n=Fn(t);return n||[0,0,0,1]})),e}var gye={linear:function(r){return bt(r,this.option.dataExtent,[0,1],!0)},piecewise:function(r){var e=this.option.pieceList,t=Sr.findPieceIndex(r,e,!0);if(t!=null)return bt(t,[0,e.length-1],[0,1],!0)},category:function(r){var e=this.option.categories?this.option.categoryMap[r]:r;return e??Vy},fixed:tr};function nm(r,e,t){return r?e<=t:e=t.length||v===t[v.depth]){var g=Sye(i,l,v,m,p,n);s$(v,g,t,n)}})}}}function _ye(r,e,t){var n=W({},e),i=t.designatedVisualItemStyle;return k(["color","colorAlpha","colorSaturation"],function(a){i[a]=e[a];var o=r.get(a);i[a]=null,o!=null&&(n[a]=o)}),n}function xR(r){var e=$_(r,"color");if(e){var t=$_(r,"colorAlpha"),n=$_(r,"colorSaturation");return n&&(e=id(e,null,null,n)),t&&(e=fy(e,t)),e}}function xye(r,e){return e!=null?id(e,null,null,r):null}function $_(r,e){var t=r[e];if(t!=null&&t!=="none")return t}function wye(r,e,t,n,i,a){if(!(!a||!a.length)){var o=H_(e,"color")||i.color!=null&&i.color!=="none"&&(H_(e,"colorAlpha")||H_(e,"colorSaturation"));if(o){var s=e.get("visualMin"),l=e.get("visualMax"),u=t.dataExtent.slice();s!=null&&su[1]&&(u[1]=l);var c=e.get("colorMappingBy"),f={type:o.name,dataExtent:u,visual:o.range};f.type==="color"&&(c==="index"||c==="id")?(f.mappingMethod="category",f.loop=!0):f.mappingMethod="linear";var h=new Sr(f);return o$(h).drColorMappingBy=c,h}}}function H_(r,e){var t=r.get(e);return q(t)&&t.length?{name:e,range:t}:null}function Sye(r,e,t,n,i,a){var o=W({},e);if(i){var s=i.type,l=s==="color"&&o$(i).drColorMappingBy,u=l==="index"?n:l==="id"?a.mapIdToIndex(t.getId()):t.getValue(r.get("visualDimension"));o[s]=i.mapValueToVisual(u)}return o}var ip=Math.max,$y=Math.min,wR=kr,SA=k,l$=["itemStyle","borderWidth"],Tye=["itemStyle","gapWidth"],Cye=["upperLabel","show"],Aye=["upperLabel","height"];const Mye={seriesType:"treemap",reset:function(r,e,t,n){var i=t.getWidth(),a=t.getHeight(),o=r.option,s=gr(r.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()}),l=o.size||[],u=ie(wR(s.width,l[0]),i),c=ie(wR(s.height,l[1]),a),f=n&&n.type,h=["treemapZoomToNode","treemapRootToNode"],d=rp(n,h,r),p=f==="treemapRender"||f==="treemapMove"?n.rootRect:null,v=r.getViewRoot(),m=r$(v);if(f!=="treemapMove"){var g=f==="treemapZoomToNode"?Pye(r,d,v,u,c):p?[p.width,p.height]:[u,c],y=o.sort;y&&y!=="asc"&&y!=="desc"&&(y="desc");var b={squareRatio:o.squareRatio,sort:y,leafDepth:o.leafDepth};v.hostTree.clearLayouts();var _={x:0,y:0,width:g[0],height:g[1],area:g[0]*g[1]};v.setLayout(_),u$(v,b,!1,0),_=v.getLayout(),SA(m,function(w,S){var T=(m[S+1]||v).getValue();w.setLayout(W({dataExtent:[T,T],borderWidth:0,upperHeight:0},_))})}var x=r.getData().tree.root;x.setLayout(Rye(s,p,d),!0),r.setLayoutInfo(s),c$(x,new Ve(-s.x,-s.y,i,a),m,v,0)}};function u$(r,e,t,n){var i,a;if(!r.isRemoved()){var o=r.getLayout();i=o.width,a=o.height;var s=r.getModel(),l=s.get(l$),u=s.get(Tye)/2,c=f$(s),f=Math.max(l,c),h=l-u,d=f-u;r.setLayout({borderWidth:l,upperHeight:f,upperLabelHeight:c},!0),i=ip(i-2*h,0),a=ip(a-h-d,0);var p=i*a,v=kye(r,s,p,e,t,n);if(v.length){var m={x:h,y:d,width:i,height:a},g=$y(i,a),y=1/0,b=[];b.area=0;for(var _=0,x=v.length;_=0;l--){var u=i[n==="asc"?o-l-1:l].getValue();u/t*es[1]&&(s[1]=u)})),{sum:n,dataExtent:s}}function Iye(r,e,t){for(var n=0,i=1/0,a=0,o=void 0,s=r.length;an&&(n=o));var l=r.area*r.area,u=e*e*t;return l?ip(u*n/l,l/(u*i)):1/0}function SR(r,e,t,n,i){var a=e===t.width?0:1,o=1-a,s=["x","y"],l=["width","height"],u=t[s[a]],c=e?r.area/e:0;(i||c>t[l[o]])&&(c=t[l[o]]);for(var f=0,h=r.length;fNE&&(u=NE),a=s}un&&(n=e);var a=n%2?n+2:n+3;i=[];for(var o=0;o0&&(x[0]=-x[0],x[1]=-x[1]);var S=_[0]<0?-1:1;if(a.__position!=="start"&&a.__position!=="end"){var T=-Math.atan2(_[1],_[0]);f[0].8?"left":h[0]<-.8?"right":"center",v=h[1]>.8?"top":h[1]<-.8?"bottom":"middle";break;case"start":a.x=-h[0]*g+c[0],a.y=-h[1]*y+c[1],p=h[0]>.8?"right":h[0]<-.8?"left":"center",v=h[1]>.8?"bottom":h[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":a.x=g*S+c[0],a.y=c[1]+C,p=_[0]<0?"right":"left",a.originX=-g*S,a.originY=-C;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":a.x=w[0],a.y=w[1]+C,p="center",a.originY=-C;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":a.x=-g*S+f[0],a.y=f[1]+C,p=_[0]>=0?"right":"left",a.originX=g*S,a.originY=-C;break}a.scaleX=a.scaleY=o,a.setStyle({verticalAlign:a.__verticalAlign||v,align:a.__align||p})}},e}(Ee),kA=function(){function r(e){this.group=new Ee,this._LineCtor=e||MA}return r.prototype.updateData=function(e){var t=this;this._progressiveEls=null;var n=this,i=n.group,a=n._lineData;n._lineData=e,a||i.removeAll();var o=DR(e);e.diff(a).add(function(s){t._doAdd(e,s,o)}).update(function(s,l){t._doUpdate(a,e,l,s,o)}).remove(function(s){i.remove(a.getItemGraphicEl(s))}).execute()},r.prototype.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl(function(t,n){t.updateLayout(e,n)},this)},r.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=DR(e),this._lineData=null,this.group.removeAll()},r.prototype.incrementalUpdate=function(e,t){this._progressiveEls=[];function n(s){!s.isGroup&&!Jye(s)&&(s.incremental=!0,s.ensureState("emphasis").hoverLayer=!0)}for(var i=e.start;i0}function DR(r){var e=r.hostModel,t=e.getModel("emphasis");return{lineStyle:e.getModel("lineStyle").getLineStyle(),emphasisLineStyle:t.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:e.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:e.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:t.get("disabled"),blurScope:t.get("blurScope"),focus:t.get("focus"),labelStatesModels:Tr(e)}}function ER(r){return isNaN(r[0])||isNaN(r[1])}function q_(r){return r&&!ER(r[0])&&!ER(r[1])}var X_=[],K_=[],Z_=[],lc=Ar,J_=Jl,LR=Math.abs;function IR(r,e,t){for(var n=r[0],i=r[1],a=r[2],o=1/0,s,l=t*t,u=.1,c=.1;c<=.9;c+=.1){X_[0]=lc(n[0],i[0],a[0],c),X_[1]=lc(n[1],i[1],a[1],c);var f=LR(J_(X_,e)-l);f=0?s=s+u:s=s-u:p>=0?s=s-u:s=s+u}return s}function Q_(r,e){var t=[],n=Nd,i=[[],[],[]],a=[[],[]],o=[];e/=2,r.eachEdge(function(s,l){var u=s.getLayout(),c=s.getVisual("fromSymbol"),f=s.getVisual("toSymbol");u.__original||(u.__original=[co(u[0]),co(u[1])],u[2]&&u.__original.push(co(u[2])));var h=u.__original;if(u[2]!=null){if(on(i[0],h[0]),on(i[1],h[2]),on(i[2],h[1]),c&&c!=="none"){var d=jh(s.node1),p=IR(i,h[0],d*e);n(i[0][0],i[1][0],i[2][0],p,t),i[0][0]=t[3],i[1][0]=t[4],n(i[0][1],i[1][1],i[2][1],p,t),i[0][1]=t[3],i[1][1]=t[4]}if(f&&f!=="none"){var d=jh(s.node2),p=IR(i,h[1],d*e);n(i[0][0],i[1][0],i[2][0],p,t),i[1][0]=t[1],i[2][0]=t[2],n(i[0][1],i[1][1],i[2][1],p,t),i[1][1]=t[1],i[2][1]=t[2]}on(u[0],i[0]),on(u[1],i[2]),on(u[2],i[1])}else{if(on(a[0],h[0]),on(a[1],h[1]),Ll(o,a[1],a[0]),mf(o,o),c&&c!=="none"){var d=jh(s.node1);Ww(a[0],a[0],o,d*e)}if(f&&f!=="none"){var d=jh(s.node2);Ww(a[1],a[1],o,-d*e)}on(u[0],a[0]),on(u[1],a[1])}})}function PR(r){return r.type==="view"}var Qye=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,n){var i=new Rp,a=new kA,o=this.group;this._controller=new zp(n.getZr()),this._controllerHost={target:o},o.add(i.group),o.add(a.group),this._symbolDraw=i,this._lineDraw=a,this._firstRender=!0},e.prototype.render=function(t,n,i){var a=this,o=t.coordinateSystem;this._model=t;var s=this._symbolDraw,l=this._lineDraw,u=this.group;if(PR(o)){var c={x:o.x,y:o.y,scaleX:o.scaleX,scaleY:o.scaleY};this._firstRender?u.attr(c):ut(u,c,t)}Q_(t.getGraph(),Oh(t));var f=t.getData();s.updateData(f);var h=t.getEdgeData();l.updateData(h),this._updateNodeAndLinkScale(),this._updateController(t,n,i),clearTimeout(this._layoutTimeout);var d=t.forceLayout,p=t.get(["force","layoutAnimation"]);d&&this._startForceLayoutIteration(d,p);var v=t.get("layout");f.graph.eachNode(function(b){var _=b.dataIndex,x=b.getGraphicEl(),w=b.getModel();if(x){x.off("drag").off("dragend");var S=w.get("draggable");S&&x.on("drag",function(C){switch(v){case"force":d.warmUp(),!a._layouting&&a._startForceLayoutIteration(d,p),d.setFixed(_),f.setItemLayout(_,[x.x,x.y]);break;case"circular":f.setItemLayout(_,[x.x,x.y]),b.setLayout({fixed:!0},!0),AA(t,"symbolSize",b,[C.offsetX,C.offsetY]),a.updateLayout(t);break;case"none":default:f.setItemLayout(_,[x.x,x.y]),CA(t.getGraph(),t),a.updateLayout(t);break}}).on("dragend",function(){d&&d.setUnfixed(_)}),x.setDraggable(S,!!w.get("cursor"));var T=w.get(["emphasis","focus"]);T==="adjacency"&&(Le(x).focus=b.getAdjacentDataIndices())}}),f.graph.eachEdge(function(b){var _=b.getGraphicEl(),x=b.getModel().get(["emphasis","focus"]);_&&x==="adjacency"&&(Le(_).focus={edge:[b.dataIndex],node:[b.node1.dataIndex,b.node2.dataIndex]})});var m=t.get("layout")==="circular"&&t.get(["circular","rotateLabel"]),g=f.getLayout("cx"),y=f.getLayout("cy");f.graph.eachNode(function(b){v$(b,m,g,y)}),this._firstRender=!1},e.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose(),this._controllerHost=null},e.prototype._startForceLayoutIteration=function(t,n){var i=this;(function a(){t.step(function(o){i.updateLayout(i._model),(i._layouting=!o)&&(n?i._layoutTimeout=setTimeout(a,16):a())})})()},e.prototype._updateController=function(t,n,i){var a=this,o=this._controller,s=this._controllerHost,l=this.group;if(o.setPointerChecker(function(u,c,f){var h=l.getBoundingRect();return h.applyTransform(l.transform),h.contain(c,f)&&!h1(u,i,t)}),!PR(t.coordinateSystem)){o.disable();return}o.enable(t.get("roam")),s.zoomLimit=t.get("scaleLimit"),s.zoom=t.coordinateSystem.getZoom(),o.off("pan").off("zoom").on("pan",function(u){mA(s,u.dx,u.dy),i.dispatchAction({seriesId:t.id,type:"graphRoam",dx:u.dx,dy:u.dy})}).on("zoom",function(u){gA(s,u.scale,u.originX,u.originY),i.dispatchAction({seriesId:t.id,type:"graphRoam",zoom:u.scale,originX:u.originX,originY:u.originY}),a._updateNodeAndLinkScale(),Q_(t.getGraph(),Oh(t)),a._lineDraw.updateLayout(),i.updateLabelLayout()})},e.prototype._updateNodeAndLinkScale=function(){var t=this._model,n=t.getData(),i=Oh(t);n.eachItemGraphicEl(function(a,o){a&&a.setSymbolScale(i)})},e.prototype.updateLayout=function(t){Q_(t.getGraph(),Oh(t)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},e.prototype.remove=function(){clearTimeout(this._layoutTimeout),this._layouting=!1,this._layoutTimeout=null,this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()},e.type="graph",e}(St);function uc(r){return"_EC_"+r}var e0e=function(){function r(e){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=e||!1}return r.prototype.isDirected=function(){return this._directed},r.prototype.addNode=function(e,t){e=e==null?""+t:""+e;var n=this._nodesMap;if(!n[uc(e)]){var i=new _l(e,t);return i.hostGraph=this,this.nodes.push(i),n[uc(e)]=i,i}},r.prototype.getNodeByIndex=function(e){var t=this.data.getRawIndex(e);return this.nodes[t]},r.prototype.getNodeById=function(e){return this._nodesMap[uc(e)]},r.prototype.addEdge=function(e,t,n){var i=this._nodesMap,a=this._edgesMap;if(lt(e)&&(e=this.nodes[e]),lt(t)&&(t=this.nodes[t]),e instanceof _l||(e=i[uc(e)]),t instanceof _l||(t=i[uc(t)]),!(!e||!t)){var o=e.id+"-"+t.id,s=new g$(e,t,n);return s.hostGraph=this,this._directed&&(e.outEdges.push(s),t.inEdges.push(s)),e.edges.push(s),e!==t&&t.edges.push(s),this.edges.push(s),a[o]=s,s}},r.prototype.getEdgeByIndex=function(e){var t=this.edgeData.getRawIndex(e);return this.edges[t]},r.prototype.getEdge=function(e,t){e instanceof _l&&(e=e.id),t instanceof _l&&(t=t.id);var n=this._edgesMap;return this._directed?n[e+"-"+t]:n[e+"-"+t]||n[t+"-"+e]},r.prototype.eachNode=function(e,t){for(var n=this.nodes,i=n.length,a=0;a=0&&e.call(t,n[a],a)},r.prototype.eachEdge=function(e,t){for(var n=this.edges,i=n.length,a=0;a=0&&n[a].node1.dataIndex>=0&&n[a].node2.dataIndex>=0&&e.call(t,n[a],a)},r.prototype.breadthFirstTraverse=function(e,t,n,i){if(t instanceof _l||(t=this._nodesMap[uc(t)]),!!t){for(var a=n==="out"?"outEdges":n==="in"?"inEdges":"edges",o=0;o=0&&l.node2.dataIndex>=0});for(var a=0,o=i.length;a=0&&this[r][e].setItemVisual(this.dataIndex,t,n)},getVisual:function(t){return this[r][e].getItemVisual(this.dataIndex,t)},setLayout:function(t,n){this.dataIndex>=0&&this[r][e].setItemLayout(this.dataIndex,t,n)},getLayout:function(){return this[r][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[r][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[r][e].getRawIndex(this.dataIndex)}}}cr(_l,y$("hostGraph","data"));cr(g$,y$("hostGraph","edgeData"));function b$(r,e,t,n,i){for(var a=new e0e(n),o=0;o "+h)),u++)}var d=t.get("coordinateSystem"),p;if(d==="cartesian2d"||d==="polar")p=Lo(r,t);else{var v=Dp.get(d),m=v?v.dimensions||[]:[];He(m,"value")<0&&m.concat(["value"]);var g=Lp(r,{coordDimensions:m,encodeDefine:t.getEncode()}).dimensions;p=new fn(g,t),p.initData(r)}var y=new fn(["value"],t);return y.initData(l,s),i&&i(p,y),e$({mainData:p,struct:a,structAttr:"graph",datas:{node:p,edge:y},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}var t0e=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t}return e.prototype.init=function(t){r.prototype.init.apply(this,arguments);var n=this;function i(){return n._categoriesData}this.legendVisualProvider=new Bp(i,i),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},e.prototype.mergeOption=function(t){r.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},e.prototype.mergeDefaultAndTheme=function(t){r.prototype.mergeDefaultAndTheme.apply(this,arguments),pu(t,"edgeLabel",["show"])},e.prototype.getInitialData=function(t,n){var i=t.edges||t.links||[],a=t.data||t.nodes||[],o=this;if(a&&i){Vye(this);var s=b$(a,i,this,!0,l);return k(s.edges,function(u){$ye(u.node1,u.node2,this,u.dataIndex)},this),s.data}function l(u,c){u.wrapMethod("getItemModel",function(p){var v=o._categoriesModels,m=p.getShallow("category"),g=v[m];return g&&(g.parentModel=p.parentModel,p.parentModel=g),p});var f=_t.prototype.getModel;function h(p,v){var m=f.call(this,p,v);return m.resolveParentPath=d,m}c.wrapMethod("getItemModel",function(p){return p.resolveParentPath=d,p.getModel=h,p});function d(p){if(p&&(p[0]==="label"||p[1]==="label")){var v=p.slice();return p[0]==="label"?v[0]="edgeLabel":p[1]==="label"&&(v[1]="edgeLabel"),v}return p}}},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.getCategoriesData=function(){return this._categoriesData},e.prototype.formatTooltip=function(t,n,i){if(i==="edge"){var a=this.getData(),o=this.getDataParams(t,i),s=a.graph.getEdgeByIndex(t),l=a.getName(s.node1.dataIndex),u=a.getName(s.node2.dataIndex),c=[];return l!=null&&c.push(l),u!=null&&c.push(u),Cr("nameValue",{name:c.join(" > "),value:o.value,noValue:o.value==null})}var f=W6({series:this,dataIndex:t,multipleSeries:n});return f},e.prototype._updateCategoriesData=function(){var t=K(this.option.categories||[],function(i){return i.value!=null?i:W({value:0},i)}),n=new fn(["value"],this);n.initData(t),this._categoriesData=n,this._categoriesModels=n.mapArray(function(i){return n.getItemModel(i)})},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.isAnimationEnabled=function(){return r.prototype.isAnimationEnabled.call(this)&&!(this.get("layout")==="force"&&this.get(["force","layoutAnimation"]))},e.type="series.graph",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(It),r0e={type:"graphRoam",event:"graphRoam",update:"none"};function n0e(r){r.registerChartView(Qye),r.registerSeriesModel(t0e),r.registerProcessor(jye),r.registerVisual(Nye),r.registerVisual(Bye),r.registerLayout(Hye),r.registerLayout(r.PRIORITY.VISUAL.POST_CHART_LAYOUT,Wye),r.registerLayout(Yye),r.registerCoordinateSystem("graphView",{dimensions:Fp.dimensions,create:Xye}),r.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},tr),r.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},tr),r.registerAction(r0e,function(e,t,n){t.eachComponent({mainType:"series",query:e},function(i){var a=i.coordinateSystem,o=bA(a,e,void 0,n);i.setCenter&&i.setCenter(o.center),i.setZoom&&i.setZoom(o.zoom)})})}var i0e=function(){function r(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return r}(),a0e=function(r){z(e,r);function e(t){var n=r.call(this,t)||this;return n.type="pointer",n}return e.prototype.getDefaultShape=function(){return new i0e},e.prototype.buildPath=function(t,n){var i=Math.cos,a=Math.sin,o=n.r,s=n.width,l=n.angle,u=n.x-i(l)*s*(s>=o/3?1:2),c=n.y-a(l)*s*(s>=o/3?1:2);l=n.angle-Math.PI/2,t.moveTo(u,c),t.lineTo(n.x+i(l)*s,n.y+a(l)*s),t.lineTo(n.x+i(n.angle)*o,n.y+a(n.angle)*o),t.lineTo(n.x-i(l)*s,n.y-a(l)*s),t.lineTo(u,c)},e}(Xe);function o0e(r,e){var t=r.get("center"),n=e.getWidth(),i=e.getHeight(),a=Math.min(n,i),o=ie(t[0],e.getWidth()),s=ie(t[1],e.getHeight()),l=ie(r.get("radius"),a/2);return{cx:o,cy:s,r:l}}function am(r,e){var t=r==null?"":r+"";return e&&(se(e)?t=e.replace("{value}",t):Te(e)&&(t=e(r))),t}var s0e=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,n,i){this.group.removeAll();var a=t.get(["axisLine","lineStyle","color"]),o=o0e(t,i);this._renderMain(t,n,i,a,o),this._data=t.getData()},e.prototype.dispose=function(){},e.prototype._renderMain=function(t,n,i,a,o){var s=this.group,l=t.get("clockwise"),u=-t.get("startAngle")/180*Math.PI,c=-t.get("endAngle")/180*Math.PI,f=t.getModel("axisLine"),h=f.get("roundCap"),d=h?Ny:gn,p=f.get("show"),v=f.getModel("lineStyle"),m=v.get("width"),g=[u,c];wC(g,!l),u=g[0],c=g[1];for(var y=c-u,b=u,_=[],x=0;p&&x=C&&(A===0?0:a[A-1][0])Math.PI/2&&(J+=Math.PI)):$==="tangential"?J=-T-Math.PI/2:lt($)&&(J=$*Math.PI/180),J===0?f.add(new ot({style:Et(b,{text:j,x:N,y:B,verticalAlign:I<-.8?"top":I>.8?"bottom":"middle",align:L<-.4?"left":L>.4?"right":"center"},{inheritColor:F}),silent:!0})):f.add(new ot({style:Et(b,{text:j,x:N,y:B,verticalAlign:"middle",align:"center"},{inheritColor:F}),silent:!0,originX:N,originY:B,rotation:J}))}if(y.get("show")&&R!==_){var P=y.get("distance");P=P?P+c:c;for(var U=0;U<=x;U++){L=Math.cos(T),I=Math.sin(T);var we=new xr({shape:{x1:L*(p-P)+h,y1:I*(p-P)+d,x2:L*(p-S-P)+h,y2:I*(p-S-P)+d},silent:!0,style:D});D.stroke==="auto"&&we.setStyle({stroke:a((R+U/x)/_)}),f.add(we),T+=A}T-=A}else T+=C}},e.prototype._renderPointer=function(t,n,i,a,o,s,l,u,c){var f=this.group,h=this._data,d=this._progressEls,p=[],v=t.get(["pointer","show"]),m=t.getModel("progress"),g=m.get("show"),y=t.getData(),b=y.mapDimension("value"),_=+t.get("min"),x=+t.get("max"),w=[_,x],S=[s,l];function T(A,M){var D=y.getItemModel(A),E=D.getModel("pointer"),L=ie(E.get("width"),o.r),I=ie(E.get("length"),o.r),R=t.get(["pointer","icon"]),P=E.get("offsetCenter"),O=ie(P[0],o.r),j=ie(P[1],o.r),F=E.get("keepAspect"),N;return R?N=ur(R,O-L/2,j-I,L,I,null,F):N=new a0e({shape:{angle:-Math.PI/2,width:L,r:I,x:O,y:j}}),N.rotation=-(M+Math.PI/2),N.x=o.cx,N.y=o.cy,N}function C(A,M){var D=m.get("roundCap"),E=D?Ny:gn,L=m.get("overlap"),I=L?m.get("width"):c/y.count(),R=L?o.r-I:o.r-(A+1)*I,P=L?o.r:o.r-A*I,O=new E({shape:{startAngle:s,endAngle:M,cx:o.cx,cy:o.cy,clockwise:u,r0:R,r:P}});return L&&(O.z2=bt(y.get(b,A),[_,x],[100,0],!0)),O}(g||v)&&(y.diff(h).add(function(A){var M=y.get(b,A);if(v){var D=T(A,s);Ot(D,{rotation:-((isNaN(+M)?S[0]:bt(M,w,S,!0))+Math.PI/2)},t),f.add(D),y.setItemGraphicEl(A,D)}if(g){var E=C(A,s),L=m.get("clip");Ot(E,{shape:{endAngle:bt(M,w,S,L)}},t),f.add(E),g2(t.seriesIndex,y.dataType,A,E),p[A]=E}}).update(function(A,M){var D=y.get(b,A);if(v){var E=h.getItemGraphicEl(M),L=E?E.rotation:s,I=T(A,L);I.rotation=L,ut(I,{rotation:-((isNaN(+D)?S[0]:bt(D,w,S,!0))+Math.PI/2)},t),f.add(I),y.setItemGraphicEl(A,I)}if(g){var R=d[M],P=R?R.shape.endAngle:s,O=C(A,P),j=m.get("clip");ut(O,{shape:{endAngle:bt(D,w,S,j)}},t),f.add(O),g2(t.seriesIndex,y.dataType,A,O),p[A]=O}}).execute(),y.each(function(A){var M=y.getItemModel(A),D=M.getModel("emphasis"),E=D.get("focus"),L=D.get("blurScope"),I=D.get("disabled");if(v){var R=y.getItemGraphicEl(A),P=y.getItemVisual(A,"style"),O=P.fill;if(R instanceof Lr){var j=R.style;R.useStyle(W({image:j.image,x:j.x,y:j.y,width:j.width,height:j.height},P))}else R.useStyle(P),R.type!=="pointer"&&R.setColor(O);R.setStyle(M.getModel(["pointer","itemStyle"]).getItemStyle()),R.style.fill==="auto"&&R.setStyle("fill",a(bt(y.get(b,A),w,[0,1],!0))),R.z2EmphasisLift=0,Fr(R,M),$t(R,E,L,I)}if(g){var F=p[A];F.useStyle(y.getItemVisual(A,"style")),F.setStyle(M.getModel(["progress","itemStyle"]).getItemStyle()),F.z2EmphasisLift=0,Fr(F,M),$t(F,E,L,I)}}),this._progressEls=p)},e.prototype._renderAnchor=function(t,n){var i=t.getModel("anchor"),a=i.get("show");if(a){var o=i.get("size"),s=i.get("icon"),l=i.get("offsetCenter"),u=i.get("keepAspect"),c=ur(s,n.cx-o/2+ie(l[0],n.r),n.cy-o/2+ie(l[1],n.r),o,o,null,u);c.z2=i.get("showAbove")?1:0,c.setStyle(i.getModel("itemStyle").getItemStyle()),this.group.add(c)}},e.prototype._renderTitleAndDetail=function(t,n,i,a,o){var s=this,l=t.getData(),u=l.mapDimension("value"),c=+t.get("min"),f=+t.get("max"),h=new Ee,d=[],p=[],v=t.isAnimationEnabled(),m=t.get(["pointer","showAbove"]);l.diff(this._data).add(function(g){d[g]=new ot({silent:!0}),p[g]=new ot({silent:!0})}).update(function(g,y){d[g]=s._titleEls[y],p[g]=s._detailEls[y]}).execute(),l.each(function(g){var y=l.getItemModel(g),b=l.get(u,g),_=new Ee,x=a(bt(b,[c,f],[0,1],!0)),w=y.getModel("title");if(w.get("show")){var S=w.get("offsetCenter"),T=o.cx+ie(S[0],o.r),C=o.cy+ie(S[1],o.r),A=d[g];A.attr({z2:m?0:2,style:Et(w,{x:T,y:C,text:l.getName(g),align:"center",verticalAlign:"middle"},{inheritColor:x})}),_.add(A)}var M=y.getModel("detail");if(M.get("show")){var D=M.get("offsetCenter"),E=o.cx+ie(D[0],o.r),L=o.cy+ie(D[1],o.r),I=ie(M.get("width"),o.r),R=ie(M.get("height"),o.r),P=t.get(["progress","show"])?l.getItemVisual(g,"style").fill:x,A=p[g],O=M.get("formatter");A.attr({z2:m?0:2,style:Et(M,{x:E,y:L,text:am(b,O),width:isNaN(I)?null:I,height:isNaN(R)?null:R,align:"center",verticalAlign:"middle"},{inheritColor:P})}),Xz(A,{normal:M},b,function(F){return am(F,O)}),v&&Kz(A,g,l,t,{getFormattedLabel:function(F,N,B,$,J,U){return am(U?U.interpolatedValue:b,O)}}),_.add(A)}h.add(_)}),this.group.add(h),this._titleEls=d,this._detailEls=p},e.type="gauge",e}(St),l0e=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.visualStyleAccessPath="itemStyle",t}return e.prototype.getInitialData=function(t,n){return Ef(this,["value"])},e.type="series.gauge",e.defaultOption={z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,"#E6EBF8"]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:"#63677A",width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:"#63677A",width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:"#464646",fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:"#fff",borderWidth:0,borderColor:"#5470c6"}},title:{show:!0,offsetCenter:[0,"20%"],color:"#464646",fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"#464646",fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},e}(It);function u0e(r){r.registerChartView(s0e),r.registerSeriesModel(l0e)}var c0e=["itemStyle","opacity"],f0e=function(r){z(e,r);function e(t,n){var i=r.call(this)||this,a=i,o=new bn,s=new ot;return a.setTextContent(s),i.setTextGuideLine(o),i.updateData(t,n,!0),i}return e.prototype.updateData=function(t,n,i){var a=this,o=t.hostModel,s=t.getItemModel(n),l=t.getItemLayout(n),u=s.getModel("emphasis"),c=s.get(c0e);c=c??1,i||Bi(a),a.useStyle(t.getItemVisual(n,"style")),a.style.lineJoin="round",i?(a.setShape({points:l.points}),a.style.opacity=0,Ot(a,{style:{opacity:c}},o,n)):ut(a,{style:{opacity:c},shape:{points:l.points}},o,n),Fr(a,s),this._updateLabel(t,n),$t(this,u.get("focus"),u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(t,n){var i=this,a=this.getTextGuideLine(),o=i.getTextContent(),s=t.hostModel,l=t.getItemModel(n),u=t.getItemLayout(n),c=u.label,f=t.getItemVisual(n,"style"),h=f.fill;Vr(o,Tr(l),{labelFetcher:t.hostModel,labelDataIndex:n,defaultOpacity:f.opacity,defaultText:t.getName(n)},{normal:{align:c.textAlign,verticalAlign:c.verticalAlign}}),i.setTextConfig({local:!0,inside:!!c.inside,insideStroke:h,outsideFill:h});var d=c.linePoints;a.setShape({points:d}),i.textGuideLineConfig={anchor:d?new ze(d[0][0],d[0][1]):null},ut(o,{style:{x:c.x,y:c.y}},s,n),o.attr({rotation:c.rotation,originX:c.x,originY:c.y,z2:10}),aA(i,oA(l),{stroke:h})},e}(yn),h0e=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.ignoreLabelLineUpdate=!0,t}return e.prototype.render=function(t,n,i){var a=t.getData(),o=this._data,s=this.group;a.diff(o).add(function(l){var u=new f0e(a,l);a.setItemGraphicEl(l,u),s.add(u)}).update(function(l,u){var c=o.getItemGraphicEl(u);c.updateData(a,l),s.add(c),a.setItemGraphicEl(l,c)}).remove(function(l){var u=o.getItemGraphicEl(l);Gd(u,t,l)}).execute(),this._data=a},e.prototype.remove=function(){this.group.removeAll(),this._data=null},e.prototype.dispose=function(){},e.type="funnel",e}(St),d0e=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t){r.prototype.init.apply(this,arguments),this.legendVisualProvider=new Bp(ue(this.getData,this),ue(this.getRawData,this)),this._defaultLabelLine(t)},e.prototype.getInitialData=function(t,n){return Ef(this,{coordDimensions:["value"],encodeDefaulter:Oe(zC,this)})},e.prototype._defaultLabelLine=function(t){pu(t,"labelLine",["show"]);var n=t.labelLine,i=t.emphasis.labelLine;n.show=n.show&&t.label.show,i.show=i.show&&t.emphasis.label.show},e.prototype.getDataParams=function(t){var n=this.getData(),i=r.prototype.getDataParams.call(this,t),a=n.mapDimension("value"),o=n.getSum(a);return i.percent=o?+(n.get(a,t)/o*100).toFixed(2):0,i.$vars.push("percent"),i},e.type="series.funnel",e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(It);function p0e(r,e){return gr(r.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function v0e(r,e){for(var t=r.mapDimension("value"),n=r.mapArray(t,function(l){return l}),i=[],a=e==="ascending",o=0,s=r.count();oL0e)return;var i=this._model.coordinateSystem.getSlidedAxisExpandWindow([r.offsetX,r.offsetY]);i.behavior!=="none"&&this._dispatchExpand({axisExpandWindow:i.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(r){if(!(this._mouseDownPoint||!tx(this,"mousemove"))){var e=this._model,t=e.coordinateSystem.getSlidedAxisExpandWindow([r.offsetX,r.offsetY]),n=t.behavior;n==="jump"&&this._throttledDispatchExpand.debounceNextCall(e.get("axisExpandDebounce")),this._throttledDispatchExpand(n==="none"?null:{axisExpandWindow:t.axisExpandWindow,animation:n==="jump"?null:{duration:0}})}}};function tx(r,e){var t=r._model;return t.get("axisExpandable")&&t.get("axisExpandTriggerOn")===e}var R0e=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(){r.prototype.init.apply(this,arguments),this.mergeOption({})},e.prototype.mergeOption=function(t){var n=this.option;t&&Be(n,t,!0),this._initDimensions()},e.prototype.contains=function(t,n){var i=t.get("parallelIndex");return i!=null&&n.getComponent("parallel",i)===this},e.prototype.setAxisExpand=function(t){k(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],function(n){t.hasOwnProperty(n)&&(this.option[n]=t[n])},this)},e.prototype._initDimensions=function(){var t=this.dimensions=[],n=this.parallelAxisIndex=[],i=pt(this.ecModel.queryComponents({mainType:"parallelAxis"}),function(a){return(a.get("parallelIndex")||0)===this.componentIndex},this);k(i,function(a){t.push("dim"+a.get("dim")),n.push(a.componentIndex)})},e.type="parallel",e.dependencies=["parallelAxis"],e.layoutMode="box",e.defaultOption={z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},e}(Qe),O0e=function(r){z(e,r);function e(t,n,i,a,o){var s=r.call(this,t,n,i)||this;return s.type=a||"value",s.axisIndex=o,s}return e.prototype.isHorizontal=function(){return this.coordinateSystem.getModel().get("layout")!=="horizontal"},e}(Gi);function Nu(r,e,t,n,i,a){r=r||0;var o=t[1]-t[0];if(i!=null&&(i=cc(i,[0,o])),a!=null&&(a=Math.max(a,i??0)),n==="all"){var s=Math.abs(e[1]-e[0]);s=cc(s,[0,o]),i=a=cc(s,[i,a]),n=0}e[0]=cc(e[0],t),e[1]=cc(e[1],t);var l=rx(e,n);e[n]+=r;var u=i||0,c=t.slice();l.sign<0?c[0]+=u:c[1]-=u,e[n]=cc(e[n],c);var f;return f=rx(e,n),i!=null&&(f.sign!==l.sign||f.spana&&(e[1-n]=e[n]+f.sign*a),e}function rx(r,e){var t=r[e]-r[1-e];return{span:Math.abs(t),sign:t>0?-1:t<0?1:e?-1:1}}function cc(r,e){return Math.min(e[1]!=null?e[1]:1/0,Math.max(e[0]!=null?e[0]:-1/0,r))}var nx=k,x$=Math.min,w$=Math.max,jR=Math.floor,j0e=Math.ceil,NR=Xt,N0e=Math.PI,B0e=function(){function r(e,t,n){this.type="parallel",this._axesMap=ve(),this._axesLayout={},this.dimensions=e.dimensions,this._model=e,this._init(e,t,n)}return r.prototype._init=function(e,t,n){var i=e.dimensions,a=e.parallelAxisIndex;nx(i,function(o,s){var l=a[s],u=t.getComponent("parallelAxis",l),c=this._axesMap.set(o,new O0e(o,c1(u),[0,0],u.get("type"),l)),f=c.type==="category";c.onBand=f&&u.get("boundaryGap"),c.inverse=u.get("inverse"),u.axis=c,c.model=u,c.coordinateSystem=u.coordinateSystem=this},this)},r.prototype.update=function(e,t){this._updateAxesFromSeries(this._model,e)},r.prototype.containPoint=function(e){var t=this._makeLayoutInfo(),n=t.axisBase,i=t.layoutBase,a=t.pixelDimIndex,o=e[1-a],s=e[a];return o>=n&&o<=n+t.axisLength&&s>=i&&s<=i+t.layoutLength},r.prototype.getModel=function(){return this._model},r.prototype._updateAxesFromSeries=function(e,t){t.eachSeries(function(n){if(e.contains(n,t)){var i=n.getData();nx(this.dimensions,function(a){var o=this._axesMap.get(a);o.scale.unionExtentFromData(i,i.mapDimension(a)),nf(o.scale,o.model)},this)}},this)},r.prototype.resize=function(e,t){this._rect=gr(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()}),this._layoutAxes()},r.prototype.getRect=function(){return this._rect},r.prototype._makeLayoutInfo=function(){var e=this._model,t=this._rect,n=["x","y"],i=["width","height"],a=e.get("layout"),o=a==="horizontal"?0:1,s=t[i[o]],l=[0,s],u=this.dimensions.length,c=om(e.get("axisExpandWidth"),l),f=om(e.get("axisExpandCount")||0,[0,u]),h=e.get("axisExpandable")&&u>3&&u>f&&f>1&&c>0&&s>0,d=e.get("axisExpandWindow"),p;if(d)p=om(d[1]-d[0],l),d[1]=d[0]+p;else{p=om(c*(f-1),l);var v=e.get("axisExpandCenter")||jR(u/2);d=[c*v-p/2],d[1]=d[0]+p}var m=(s-p)/(u-f);m<3&&(m=0);var g=[jR(NR(d[0]/c,1))+1,j0e(NR(d[1]/c,1))-1],y=m/c*d[0];return{layout:a,pixelDimIndex:o,layoutBase:t[n[o]],layoutLength:s,axisBase:t[n[1-o]],axisLength:t[i[1-o]],axisExpandable:h,axisExpandWidth:c,axisCollapseWidth:m,axisExpandWindow:d,axisCount:u,winInnerIndices:g,axisExpandWindow0Pos:y}},r.prototype._layoutAxes=function(){var e=this._rect,t=this._axesMap,n=this.dimensions,i=this._makeLayoutInfo(),a=i.layout;t.each(function(o){var s=[0,i.axisLength],l=o.inverse?1:0;o.setExtent(s[l],s[1-l])}),nx(n,function(o,s){var l=(i.axisExpandable?F0e:z0e)(s,i),u={horizontal:{x:l.position,y:i.axisLength},vertical:{x:0,y:l.position}},c={horizontal:N0e/2,vertical:0},f=[u[a].x+e.x,u[a].y+e.y],h=c[a],d=zn();Eu(d,d,h),La(d,d,f),this._axesLayout[o]={position:f,rotation:h,transform:d,axisNameAvailableWidth:l.axisNameAvailableWidth,axisLabelShow:l.axisLabelShow,nameTruncateMaxWidth:l.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}},this)},r.prototype.getAxis=function(e){return this._axesMap.get(e)},r.prototype.dataToPoint=function(e,t){return this.axisCoordToPoint(this._axesMap.get(t).dataToCoord(e),t)},r.prototype.eachActiveState=function(e,t,n,i){n==null&&(n=0),i==null&&(i=e.count());var a=this._axesMap,o=this.dimensions,s=[],l=[];k(o,function(m){s.push(e.mapDimension(m)),l.push(a.get(m).model)});for(var u=this.hasAxisBrushed(),c=n;ca*(1-f[0])?(u="jump",l=s-a*(1-f[2])):(l=s-a*f[1])>=0&&(l=s-a*(1-f[1]))<=0&&(l=0),l*=t.axisExpandWidth/c,l?Nu(l,i,o,"all"):u="none";else{var d=i[1]-i[0],p=o[1]*s/d;i=[w$(0,p-d/2)],i[1]=x$(o[1],i[0]+d),i[0]=i[1]-d}return{axisExpandWindow:i,behavior:u}},r}();function om(r,e){return x$(w$(r,e[0]),e[1])}function z0e(r,e){var t=e.layoutLength/(e.axisCount-1);return{position:t*r,axisNameAvailableWidth:t,axisLabelShow:!0}}function F0e(r,e){var t=e.layoutLength,n=e.axisExpandWidth,i=e.axisCount,a=e.axisCollapseWidth,o=e.winInnerIndices,s,l=a,u=!1,c;return r=0;i--)ci(n[i])},e.prototype.getActiveState=function(t){var n=this.activeIntervals;if(!n.length)return"normal";if(t==null||isNaN(+t))return"inactive";if(n.length===1){var i=n[0];if(i[0]<=t&&t<=i[1])return"active"}else for(var a=0,o=n.length;aW0e}function k$(r){var e=r.length-1;return e<0&&(e=0),[r[0],r[e]]}function D$(r,e,t,n){var i=new Ee;return i.add(new nt({name:"main",style:PA(t),silent:!0,draggable:!0,cursor:"move",drift:Oe(FR,r,e,i,["n","s","w","e"]),ondragend:Oe(_u,e,{isEnd:!0})})),k(n,function(a){i.add(new nt({name:a.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:Oe(FR,r,e,i,a),ondragend:Oe(_u,e,{isEnd:!0})}))}),i}function E$(r,e,t,n){var i=n.brushStyle.lineWidth||0,a=sf(i,U0e),o=t[0][0],s=t[1][0],l=o-i/2,u=s-i/2,c=t[0][1],f=t[1][1],h=c-a+i/2,d=f-a+i/2,p=c-o,v=f-s,m=p+i,g=v+i;Xa(r,e,"main",o,s,p,v),n.transformable&&(Xa(r,e,"w",l,u,a,g),Xa(r,e,"e",h,u,a,g),Xa(r,e,"n",l,u,m,a),Xa(r,e,"s",l,d,m,a),Xa(r,e,"nw",l,u,a,a),Xa(r,e,"ne",h,u,a,a),Xa(r,e,"sw",l,d,a,a),Xa(r,e,"se",h,d,a,a))}function uS(r,e){var t=e.__brushOption,n=t.transformable,i=e.childAt(0);i.useStyle(PA(t)),i.attr({silent:!n,cursor:n?"move":"default"}),k([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(a){var o=e.childOfName(a.join("")),s=a.length===1?cS(r,a[0]):J0e(r,a);o&&o.attr({silent:!n,invisible:!n,cursor:n?q0e[s]+"-resize":null})})}function Xa(r,e,t,n,i,a,o){var s=e.childOfName(t);s&&s.setShape(e1e(RA(r,e,[[n,i],[n+a,i+o]])))}function PA(r){return Ce({strokeNoScale:!0},r.brushStyle)}function L$(r,e,t,n){var i=[op(r,t),op(e,n)],a=[sf(r,t),sf(e,n)];return[[i[0],a[0]],[i[1],a[1]]]}function Z0e(r){return nu(r.group)}function cS(r,e){var t={w:"left",e:"right",n:"top",s:"bottom"},n={left:"w",right:"e",top:"n",bottom:"s"},i=q0(t[e],Z0e(r));return n[i]}function J0e(r,e){var t=[cS(r,e[0]),cS(r,e[1])];return(t[0]==="e"||t[0]==="w")&&t.reverse(),t.join("")}function FR(r,e,t,n,i,a){var o=t.__brushOption,s=r.toRectRange(o.range),l=I$(e,i,a);k(n,function(u){var c=Y0e[u];s[c[0]][c[1]]+=l[c[0]]}),o.range=r.fromRectRange(L$(s[0][0],s[1][0],s[0][1],s[1][1])),EA(e,t),_u(e,{isEnd:!1})}function Q0e(r,e,t,n){var i=e.__brushOption.range,a=I$(r,t,n);k(i,function(o){o[0]+=a[0],o[1]+=a[1]}),EA(r,e),_u(r,{isEnd:!1})}function I$(r,e,t){var n=r.group,i=n.transformCoordToLocal(e,t),a=n.transformCoordToLocal(0,0);return[i[0]-a[0],i[1]-a[1]]}function RA(r,e,t){var n=M$(r,e);return n&&n!==bu?n.clipPath(t,r._transform):ke(t)}function e1e(r){var e=op(r[0][0],r[1][0]),t=op(r[0][1],r[1][1]),n=sf(r[0][0],r[1][0]),i=sf(r[0][1],r[1][1]);return{x:e,y:t,width:n-e,height:i-t}}function t1e(r,e,t){if(!(!r._brushType||n1e(r,e.offsetX,e.offsetY))){var n=r._zr,i=r._covers,a=IA(r,e,t);if(!r._dragging)for(var o=0;on.getWidth()||t<0||t>n.getHeight()}var m1={lineX:HR(0),lineY:HR(1),rect:{createCover:function(r,e){function t(n){return n}return D$({toRectRange:t,fromRectRange:t},r,e,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(r){var e=k$(r);return L$(e[1][0],e[1][1],e[0][0],e[0][1])},updateCoverShape:function(r,e,t,n){E$(r,e,t,n)},updateCommon:uS,contain:hS},polygon:{createCover:function(r,e){var t=new Ee;return t.add(new bn({name:"main",style:PA(e),silent:!0})),t},getCreatingRange:function(r){return r},endCreating:function(r,e){e.remove(e.childAt(0)),e.add(new yn({name:"main",draggable:!0,drift:Oe(Q0e,r,e),ondragend:Oe(_u,r,{isEnd:!0})}))},updateCoverShape:function(r,e,t,n){e.childAt(0).setShape({points:RA(r,e,t)})},updateCommon:uS,contain:hS}};function HR(r){return{createCover:function(e,t){return D$({toRectRange:function(n){var i=[n,[0,100]];return r&&i.reverse(),i},fromRectRange:function(n){return n[r]}},e,t,[[["w"],["e"]],[["n"],["s"]]][r])},getCreatingRange:function(e){var t=k$(e),n=op(t[0][r],t[1][r]),i=sf(t[0][r],t[1][r]);return[n,i]},updateCoverShape:function(e,t,n,i){var a,o=M$(e,t);if(o!==bu&&o.getLinearBrushOtherExtent)a=o.getLinearBrushOtherExtent(r);else{var s=e._zr;a=[0,[s.getWidth(),s.getHeight()][1-r]]}var l=[n,a];r&&l.reverse(),E$(e,t,l,i)},updateCommon:uS,contain:hS}}function R$(r){return r=OA(r),function(e){return Uz(e,r)}}function O$(r,e){return r=OA(r),function(t){var n=e??t,i=n?r.width:r.height,a=n?r.x:r.y;return[a,a+(i||0)]}}function j$(r,e,t){var n=OA(r);return function(i,a){return n.contain(a[0],a[1])&&!h1(i,e,t)}}function OA(r){return Ve.create(r)}var i1e=["axisLine","axisTickLabel","axisName"],a1e=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,n){r.prototype.init.apply(this,arguments),(this._brushController=new DA(n.getZr())).on("brush",ue(this._onBrush,this))},e.prototype.render=function(t,n,i,a){if(!o1e(t,n,a)){this.axisModel=t,this.api=i,this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new Ee,this.group.add(this._axisGroup),!!t.get("show")){var s=l1e(t,n),l=s.coordinateSystem,u=t.getAreaSelectStyle(),c=u.width,f=t.axis.dim,h=l.getAxisLayout(f),d=W({strokeContainThreshold:c},h),p=new hn(t,d);k(i1e,p.add,p),this._axisGroup.add(p.getGroup()),this._refreshBrushController(d,u,t,s,c,i),Mp(o,this._axisGroup,t)}}},e.prototype._refreshBrushController=function(t,n,i,a,o,s){var l=i.axis.getExtent(),u=l[1]-l[0],c=Math.min(30,Math.abs(u)*.1),f=Ve.create({x:l[0],y:-o/2,width:u,height:o});f.x-=c,f.width+=2*c,this._brushController.mount({enableGlobalPan:!0,rotation:t.rotation,x:t.position[0],y:t.position[1]}).setPanels([{panelId:"pl",clipPath:R$(f),isTargetByCursor:j$(f,s,a),getLinearBrushOtherExtent:O$(f,0)}]).enableBrush({brushType:"lineX",brushStyle:n,removeOnClick:!0}).updateCovers(s1e(i))},e.prototype._onBrush=function(t){var n=t.areas,i=this.axisModel,a=i.axis,o=K(n,function(s){return[a.coordToData(s.range[0],!0),a.coordToData(s.range[1],!0)]});(!i.option.realtime===t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:i.id,intervals:o})},e.prototype.dispose=function(){this._brushController.dispose()},e.type="parallelAxis",e}(zt);function o1e(r,e,t){return t&&t.type==="axisAreaSelect"&&e.findComponents({mainType:"parallelAxis",query:t})[0]===r}function s1e(r){var e=r.axis;return K(r.activeIntervals,function(t){return{brushType:"lineX",panelId:"pl",range:[e.dataToCoord(t[0],!0),e.dataToCoord(t[1],!0)]}})}function l1e(r,e){return e.getComponent("parallel",r.get("parallelIndex"))}var u1e={type:"axisAreaSelect",event:"axisAreaSelected"};function c1e(r){r.registerAction(u1e,function(e,t){t.eachComponent({mainType:"parallelAxis",query:e},function(n){n.axis.model.setActiveIntervals(e.intervals)})}),r.registerAction("parallelAxisExpand",function(e,t){t.eachComponent({mainType:"parallel",query:e},function(n){n.setAxisExpand(e)})})}var f1e={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function N$(r){r.registerComponentView(I0e),r.registerComponentModel(R0e),r.registerCoordinateSystem("parallel",$0e),r.registerPreprocessor(k0e),r.registerComponentModel(sS),r.registerComponentView(a1e),of(r,"parallel",sS,f1e),c1e(r)}function h1e(r){Ue(N$),r.registerChartView(_0e),r.registerSeriesModel(S0e),r.registerVisual(r.PRIORITY.VISUAL.BRUSH,M0e)}var d1e=function(){function r(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0}return r}(),p1e=function(r){z(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new d1e},e.prototype.buildPath=function(t,n){var i=n.extent;t.moveTo(n.x1,n.y1),t.bezierCurveTo(n.cpx1,n.cpy1,n.cpx2,n.cpy2,n.x2,n.y2),n.orient==="vertical"?(t.lineTo(n.x2+i,n.y2),t.bezierCurveTo(n.cpx2+i,n.cpy2,n.cpx1+i,n.cpy1,n.x1+i,n.y1)):(t.lineTo(n.x2,n.y2+i),t.bezierCurveTo(n.cpx2,n.cpy2+i,n.cpx1,n.cpy1+i,n.x1,n.y1+i)),t.closePath()},e.prototype.highlight=function(){wo(this)},e.prototype.downplay=function(){So(this)},e}(Xe),v1e=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._focusAdjacencyDisabled=!1,t}return e.prototype.render=function(t,n,i){var a=this,o=t.getGraph(),s=this.group,l=t.layoutInfo,u=l.width,c=l.height,f=t.getData(),h=t.getData("edge"),d=t.get("orient");this._model=t,s.removeAll(),s.x=l.x,s.y=l.y,o.eachEdge(function(p){var v=new p1e,m=Le(v);m.dataIndex=p.dataIndex,m.seriesIndex=t.seriesIndex,m.dataType="edge";var g=p.getModel(),y=g.getModel("lineStyle"),b=y.get("curveness"),_=p.node1.getLayout(),x=p.node1.getModel(),w=x.get("localX"),S=x.get("localY"),T=p.node2.getLayout(),C=p.node2.getModel(),A=C.get("localX"),M=C.get("localY"),D=p.getLayout(),E,L,I,R,P,O,j,F;v.shape.extent=Math.max(1,D.dy),v.shape.orient=d,d==="vertical"?(E=(w!=null?w*u:_.x)+D.sy,L=(S!=null?S*c:_.y)+_.dy,I=(A!=null?A*u:T.x)+D.ty,R=M!=null?M*c:T.y,P=E,O=L*(1-b)+R*b,j=I,F=L*b+R*(1-b)):(E=(w!=null?w*u:_.x)+_.dx,L=(S!=null?S*c:_.y)+D.sy,I=A!=null?A*u:T.x,R=(M!=null?M*c:T.y)+D.ty,P=E*(1-b)+I*b,O=L,j=E*b+I*(1-b),F=R),v.setShape({x1:E,y1:L,x2:I,y2:R,cpx1:P,cpy1:O,cpx2:j,cpy2:F}),v.useStyle(y.getItemStyle()),GR(v.style,d,p);var N=""+g.get("value"),B=Tr(g,"edgeLabel");Vr(v,B,{labelFetcher:{getFormattedLabel:function(U,we,Ye,ge,le,be){return t.getFormattedLabel(U,we,"edge",ge,_a(le,B.normal&&B.normal.get("formatter"),N),be)}},labelDataIndex:p.dataIndex,defaultText:N}),v.setTextConfig({position:"inside"});var $=g.getModel("emphasis");Fr(v,g,"lineStyle",function(U){var we=U.getItemStyle();return GR(we,d,p),we}),s.add(v),h.setItemGraphicEl(p.dataIndex,v);var J=$.get("focus");$t(v,J==="adjacency"?p.getAdjacentDataIndices():J==="trajectory"?p.getTrajectoryDataIndices():J,$.get("blurScope"),$.get("disabled"))}),o.eachNode(function(p){var v=p.getLayout(),m=p.getModel(),g=m.get("localX"),y=m.get("localY"),b=m.getModel("emphasis"),_=m.get(["itemStyle","borderRadius"])||0,x=new nt({shape:{x:g!=null?g*u:v.x,y:y!=null?y*c:v.y,width:v.dx,height:v.dy,r:_},style:m.getModel("itemStyle").getItemStyle(),z2:10});Vr(x,Tr(m),{labelFetcher:{getFormattedLabel:function(S,T){return t.getFormattedLabel(S,T,"node")}},labelDataIndex:p.dataIndex,defaultText:p.id}),x.disableLabelAnimation=!0,x.setStyle("fill",p.getVisual("color")),x.setStyle("decal",p.getVisual("style").decal),Fr(x,m),s.add(x),f.setItemGraphicEl(p.dataIndex,x),Le(x).dataType="node";var w=b.get("focus");$t(x,w==="adjacency"?p.getAdjacentDataIndices():w==="trajectory"?p.getTrajectoryDataIndices():w,b.get("blurScope"),b.get("disabled"))}),f.eachItemGraphicEl(function(p,v){var m=f.getItemModel(v);m.get("draggable")&&(p.drift=function(g,y){a._focusAdjacencyDisabled=!0,this.shape.x+=g,this.shape.y+=y,this.dirty(),i.dispatchAction({type:"dragNode",seriesId:t.id,dataIndex:f.getRawIndex(v),localX:this.shape.x/u,localY:this.shape.y/c})},p.ondragend=function(){a._focusAdjacencyDisabled=!1},p.draggable=!0,p.cursor="move")}),!this._data&&t.isAnimationEnabled()&&s.setClipPath(m1e(s.getBoundingRect(),t,function(){s.removeClipPath()})),this._data=t.getData()},e.prototype.dispose=function(){},e.type="sankey",e}(St);function GR(r,e,t){switch(r.fill){case"source":r.fill=t.node1.getVisual("color"),r.decal=t.node1.getVisual("style").decal;break;case"target":r.fill=t.node2.getVisual("color"),r.decal=t.node2.getVisual("style").decal;break;case"gradient":var n=t.node1.getVisual("color"),i=t.node2.getVisual("color");se(n)&&se(i)&&(r.fill=new Ap(0,0,+(e==="horizontal"),+(e==="vertical"),[{color:n,offset:0},{color:i,offset:1}]))}}function m1e(r,e,t){var n=new nt({shape:{x:r.x-10,y:r.y-10,width:0,height:r.height+20}});return Ot(n,{shape:{width:r.width+20}},e,t),n}var g1e=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(t,n){var i=t.edges||t.links||[],a=t.data||t.nodes||[],o=t.levels||[];this.levelModels=[];for(var s=this.levelModels,l=0;l=0&&(s[o[l].depth]=new _t(o[l],this,n));var u=b$(a,i,this,!0,c);return u.data;function c(f,h){f.wrapMethod("getItemModel",function(d,p){var v=d.parentModel,m=v.getData().getItemLayout(p);if(m){var g=m.depth,y=v.levelModels[g];y&&(d.parentModel=y)}return d}),h.wrapMethod("getItemModel",function(d,p){var v=d.parentModel,m=v.getGraph().getEdgeByIndex(p),g=m.node1.getLayout();if(g){var y=g.depth,b=v.levelModels[y];b&&(d.parentModel=b)}return d})}},e.prototype.setNodePosition=function(t,n){var i=this.option.data||this.option.nodes,a=i[t];a.localX=n[0],a.localY=n[1]},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.formatTooltip=function(t,n,i){function a(d){return isNaN(d)||d==null}if(i==="edge"){var o=this.getDataParams(t,i),s=o.data,l=o.value,u=s.source+" -- "+s.target;return Cr("nameValue",{name:u,value:l,noValue:a(l)})}else{var c=this.getGraph().getNodeByIndex(t),f=c.getLayout().value,h=this.getDataParams(t,i).data.name;return Cr("nameValue",{name:h!=null?h+"":null,value:f,noValue:a(f)})}},e.prototype.optionUpdated=function(){},e.prototype.getDataParams=function(t,n){var i=r.prototype.getDataParams.call(this,t,n);if(i.value==null&&n==="node"){var a=this.getGraph().getNodeByIndex(t),o=a.getLayout().value;i.value=o}return i},e.type="series.sankey",e.defaultOption={z:2,coordinateSystem:"view",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,label:{show:!0,position:"right",fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:"#212121"}},animationEasing:"linear",animationDuration:1e3},e}(It);function y1e(r,e){r.eachSeriesByType("sankey",function(t){var n=t.get("nodeWidth"),i=t.get("nodeGap"),a=b1e(t,e);t.layoutInfo=a;var o=a.width,s=a.height,l=t.getGraph(),u=l.nodes,c=l.edges;x1e(u);var f=pt(u,function(v){return v.getLayout().value===0}),h=f.length!==0?0:t.get("layoutIterations"),d=t.get("orient"),p=t.get("nodeAlign");_1e(u,c,n,i,o,s,h,d,p)})}function b1e(r,e){return gr(r.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function _1e(r,e,t,n,i,a,o,s,l){w1e(r,e,t,i,a,s,l),A1e(r,e,a,i,n,o,s),O1e(r,s)}function x1e(r){k(r,function(e){var t=xs(e.outEdges,Hy),n=xs(e.inEdges,Hy),i=e.getValue()||0,a=Math.max(t,n,i);e.setLayout({value:a},!0)})}function w1e(r,e,t,n,i,a,o){for(var s=[],l=[],u=[],c=[],f=0,h=0;h=0;g&&m.depth>d&&(d=m.depth),v.setLayout({depth:g?m.depth:f},!0),a==="vertical"?v.setLayout({dy:t},!0):v.setLayout({dx:t},!0);for(var y=0;yf-1?d:f-1;o&&o!=="left"&&S1e(r,o,a,S);var T=a==="vertical"?(i-t)/S:(n-t)/S;C1e(r,T,a)}function B$(r){var e=r.hostGraph.data.getRawDataItem(r.dataIndex);return e.depth!=null&&e.depth>=0}function S1e(r,e,t,n){if(e==="right"){for(var i=[],a=r,o=0;a.length;){for(var s=0;s0;a--)l*=.99,D1e(s,l,o),ix(s,i,t,n,o),R1e(s,l,o),ix(s,i,t,n,o)}function M1e(r,e){var t=[],n=e==="vertical"?"y":"x",i=d2(r,function(a){return a.getLayout()[n]});return i.keys.sort(function(a,o){return a-o}),k(i.keys,function(a){t.push(i.buckets.get(a))}),t}function k1e(r,e,t,n,i,a){var o=1/0;k(r,function(s){var l=s.length,u=0;k(s,function(f){u+=f.getLayout().value});var c=a==="vertical"?(n-(l-1)*i)/u:(t-(l-1)*i)/u;c0&&(s=l.getLayout()[a]+u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),c=l.getLayout()[a]+l.getLayout()[h]+e;var p=i==="vertical"?n:t;if(u=c-e-p,u>0){s=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0),c=s;for(var d=f-2;d>=0;--d)l=o[d],u=l.getLayout()[a]+l.getLayout()[h]+e-c,u>0&&(s=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),c=l.getLayout()[a]}})}function D1e(r,e,t){k(r.slice().reverse(),function(n){k(n,function(i){if(i.outEdges.length){var a=xs(i.outEdges,E1e,t)/xs(i.outEdges,Hy);if(isNaN(a)){var o=i.outEdges.length;a=o?xs(i.outEdges,L1e,t)/o:0}if(t==="vertical"){var s=i.getLayout().x+(a-Ps(i,t))*e;i.setLayout({x:s},!0)}else{var l=i.getLayout().y+(a-Ps(i,t))*e;i.setLayout({y:l},!0)}}})})}function E1e(r,e){return Ps(r.node2,e)*r.getValue()}function L1e(r,e){return Ps(r.node2,e)}function I1e(r,e){return Ps(r.node1,e)*r.getValue()}function P1e(r,e){return Ps(r.node1,e)}function Ps(r,e){return e==="vertical"?r.getLayout().x+r.getLayout().dx/2:r.getLayout().y+r.getLayout().dy/2}function Hy(r){return r.getValue()}function xs(r,e,t){for(var n=0,i=r.length,a=-1;++ao&&(o=l)}),k(n,function(s){var l=new Sr({type:"color",mappingMethod:"linear",dataExtent:[a,o],visual:e.get("color")}),u=l.mapValueToVisual(s.getLayout().value),c=s.getModel().get(["itemStyle","color"]);c!=null?(s.setVisual("color",c),s.setVisual("style",{fill:c})):(s.setVisual("color",u),s.setVisual("style",{fill:u}))})}i.length&&k(i,function(s){var l=s.getModel().get("lineStyle");s.setVisual("style",l)})})}function N1e(r){r.registerChartView(v1e),r.registerSeriesModel(g1e),r.registerLayout(y1e),r.registerVisual(j1e),r.registerAction({type:"dragNode",event:"dragnode",update:"update"},function(e,t){t.eachComponent({mainType:"series",subType:"sankey",query:e},function(n){n.setNodePosition(e.dataIndex,[e.localX,e.localY])})})}var z$=function(){function r(){}return r.prototype._hasEncodeRule=function(e){var t=this.getEncode();return t&&t.get(e)!=null},r.prototype.getInitialData=function(e,t){var n,i=t.getComponent("xAxis",this.get("xAxisIndex")),a=t.getComponent("yAxis",this.get("yAxisIndex")),o=i.get("type"),s=a.get("type"),l;o==="category"?(e.layout="horizontal",n=i.getOrdinalMeta(),l=!this._hasEncodeRule("x")):s==="category"?(e.layout="vertical",n=a.getOrdinalMeta(),l=!this._hasEncodeRule("y")):e.layout=e.layout||"horizontal";var u=["x","y"],c=e.layout==="horizontal"?0:1,f=this._baseAxisDim=u[c],h=u[1-c],d=[i,a],p=d[c].get("type"),v=d[1-c].get("type"),m=e.data;if(m&&l){var g=[];k(m,function(_,x){var w;q(_)?(w=_.slice(),_.unshift(x)):q(_.value)?(w=W({},_),w.value=w.value.slice(),_.value.unshift(x)):w=_,g.push(w)}),e.data=g}var y=this.defaultValueDimensions,b=[{name:f,type:Iy(p),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:h,type:Iy(v),dimsDef:y.slice()}];return Ef(this,{coordDimensions:b,dimensionsCount:y.length+1,encodeDefaulter:Oe(y6,b,this)})},r.prototype.getBaseAxis=function(){var e=this._baseAxisDim;return this.ecModel.getComponent(e+"Axis",this.get(e+"AxisIndex")).axis},r}(),F$=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.defaultValueDimensions=[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],t.visualDrawType="stroke",t}return e.type="series.boxplot",e.dependencies=["xAxis","yAxis","grid"],e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}},animationDuration:800},e}(It);cr(F$,z$,!0);var B1e=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,n,i){var a=t.getData(),o=this.group,s=this._data;this._data||o.removeAll();var l=t.get("layout")==="horizontal"?1:0;a.diff(s).add(function(u){if(a.hasValue(u)){var c=a.getItemLayout(u),f=WR(c,a,u,l,!0);a.setItemGraphicEl(u,f),o.add(f)}}).update(function(u,c){var f=s.getItemGraphicEl(c);if(!a.hasValue(u)){o.remove(f);return}var h=a.getItemLayout(u);f?(Bi(f),V$(h,f,a,u)):f=WR(h,a,u,l),o.add(f),a.setItemGraphicEl(u,f)}).remove(function(u){var c=s.getItemGraphicEl(u);c&&o.remove(c)}).execute(),this._data=a},e.prototype.remove=function(t){var n=this.group,i=this._data;this._data=null,i&&i.eachItemGraphicEl(function(a){a&&n.remove(a)})},e.type="boxplot",e}(St),z1e=function(){function r(){}return r}(),F1e=function(r){z(e,r);function e(t){var n=r.call(this,t)||this;return n.type="boxplotBoxPath",n}return e.prototype.getDefaultShape=function(){return new z1e},e.prototype.buildPath=function(t,n){var i=n.points,a=0;for(t.moveTo(i[a][0],i[a][1]),a++;a<4;a++)t.lineTo(i[a][0],i[a][1]);for(t.closePath();av){var _=[g,b];n.push(_)}}}return{boxData:t,outliers:n}}var Y1e={type:"echarts:boxplot",transform:function(e){var t=e.upstream;if(t.sourceFormat!==Jr){var n="";dt(n)}var i=U1e(t.getRawData(),e.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:i.boxData},{data:i.outliers}]}};function q1e(r){r.registerSeriesModel(F$),r.registerChartView(B1e),r.registerLayout($1e),r.registerTransform(Y1e)}var X1e=["itemStyle","borderColor"],K1e=["itemStyle","borderColor0"],Z1e=["itemStyle","borderColorDoji"],J1e=["itemStyle","color"],Q1e=["itemStyle","color0"];function jA(r,e){return e.get(r>0?J1e:Q1e)}function NA(r,e){return e.get(r===0?Z1e:r>0?X1e:K1e)}var ebe={seriesType:"candlestick",plan:Af(),performRawSeries:!0,reset:function(r,e){if(!e.isSeriesFiltered(r)){var t=r.pipelineContext.large;return!t&&{progress:function(n,i){for(var a;(a=n.next())!=null;){var o=i.getItemModel(a),s=i.getItemLayout(a).sign,l=o.getItemStyle();l.fill=jA(s,o),l.stroke=NA(s,o)||l.fill;var u=i.ensureUniqueItemVisual(a,"style");W(u,l)}}}}}},tbe=["color","borderColor"],rbe=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,n,i){this.group.removeClipPath(),this._progressiveEls=null,this._updateDrawMode(t),this._isLargeDraw?this._renderLarge(t):this._renderNormal(t)},e.prototype.incrementalPrepareRender=function(t,n,i){this._clear(),this._updateDrawMode(t)},e.prototype.incrementalRender=function(t,n,i,a){this._progressiveEls=[],this._isLargeDraw?this._incrementalRenderLarge(t,n):this._incrementalRenderNormal(t,n)},e.prototype.eachRendered=function(t){Vs(this._progressiveEls||this.group,t)},e.prototype._updateDrawMode=function(t){var n=t.pipelineContext.large;(this._isLargeDraw==null||n!==this._isLargeDraw)&&(this._isLargeDraw=n,this._clear())},e.prototype._renderNormal=function(t){var n=t.getData(),i=this._data,a=this.group,o=n.getLayout("isSimpleBox"),s=t.get("clip",!0),l=t.coordinateSystem,u=l.getArea&&l.getArea();this._data||a.removeAll(),n.diff(i).add(function(c){if(n.hasValue(c)){var f=n.getItemLayout(c);if(s&&UR(u,f))return;var h=ax(f,c,!0);Ot(h,{shape:{points:f.ends}},t,c),ox(h,n,c,o),a.add(h),n.setItemGraphicEl(c,h)}}).update(function(c,f){var h=i.getItemGraphicEl(f);if(!n.hasValue(c)){a.remove(h);return}var d=n.getItemLayout(c);if(s&&UR(u,d)){a.remove(h);return}h?(ut(h,{shape:{points:d.ends}},t,c),Bi(h)):h=ax(d),ox(h,n,c,o),a.add(h),n.setItemGraphicEl(c,h)}).remove(function(c){var f=i.getItemGraphicEl(c);f&&a.remove(f)}).execute(),this._data=n},e.prototype._renderLarge=function(t){this._clear(),YR(t,this.group);var n=t.get("clip",!0)?Op(t.coordinateSystem,!1,t):null;n?this.group.setClipPath(n):this.group.removeClipPath()},e.prototype._incrementalRenderNormal=function(t,n){for(var i=n.getData(),a=i.getLayout("isSimpleBox"),o;(o=t.next())!=null;){var s=i.getItemLayout(o),l=ax(s);ox(l,i,o,a),l.incremental=!0,this.group.add(l),this._progressiveEls.push(l)}},e.prototype._incrementalRenderLarge=function(t,n){YR(n,this.group,this._progressiveEls,!0)},e.prototype.remove=function(t){this._clear()},e.prototype._clear=function(){this.group.removeAll(),this._data=null},e.type="candlestick",e}(St),nbe=function(){function r(){}return r}(),ibe=function(r){z(e,r);function e(t){var n=r.call(this,t)||this;return n.type="normalCandlestickBox",n}return e.prototype.getDefaultShape=function(){return new nbe},e.prototype.buildPath=function(t,n){var i=n.points;this.__simpleBox?(t.moveTo(i[4][0],i[4][1]),t.lineTo(i[6][0],i[6][1])):(t.moveTo(i[0][0],i[0][1]),t.lineTo(i[1][0],i[1][1]),t.lineTo(i[2][0],i[2][1]),t.lineTo(i[3][0],i[3][1]),t.closePath(),t.moveTo(i[4][0],i[4][1]),t.lineTo(i[5][0],i[5][1]),t.moveTo(i[6][0],i[6][1]),t.lineTo(i[7][0],i[7][1]))},e}(Xe);function ax(r,e,t){var n=r.ends;return new ibe({shape:{points:t?abe(n,r):n},z2:100})}function UR(r,e){for(var t=!0,n=0;nx?M[a]:A[a],ends:L,brushRect:j(w,S,b)})}function P(N,B){var $=[];return $[i]=B,$[a]=N,isNaN(B)||isNaN(N)?[NaN,NaN]:e.dataToPoint($)}function O(N,B,$){var J=B.slice(),U=B.slice();J[i]=Wm(J[i]+n/2,1,!1),U[i]=Wm(U[i]-n/2,1,!0),$?N.push(J,U):N.push(U,J)}function j(N,B,$){var J=P(N,$),U=P(B,$);return J[i]-=n/2,U[i]-=n/2,{x:J[0],y:J[1],width:n,height:U[1]-J[1]}}function F(N){return N[i]=Wm(N[i],1),N}}function p(v,m){for(var g=ma(v.count*4),y=0,b,_=[],x=[],w,S=m.getStore(),T=!!r.get(["itemStyle","borderColorDoji"]);(w=v.next())!=null;){var C=S.get(s,w),A=S.get(u,w),M=S.get(c,w),D=S.get(f,w),E=S.get(h,w);if(isNaN(C)||isNaN(D)||isNaN(E)){g[y++]=NaN,y+=3;continue}g[y++]=qR(S,w,A,M,c,T),_[i]=C,_[a]=D,b=e.dataToPoint(_,null,x),g[y++]=b?b[0]:NaN,g[y++]=b?b[1]:NaN,_[a]=E,b=e.dataToPoint(_,null,x),g[y++]=b?b[1]:NaN}m.setLayout("largePoints",g)}}};function qR(r,e,t,n,i,a){var o;return t>n?o=-1:t0?r.get(i,e-1)<=n?1:-1:1,o}function ube(r,e){var t=r.getBaseAxis(),n,i=t.type==="category"?t.getBandWidth():(n=t.getExtent(),Math.abs(n[1]-n[0])/e.count()),a=ie(Re(r.get("barMaxWidth"),i),i),o=ie(Re(r.get("barMinWidth"),1),i),s=r.get("barWidth");return s!=null?ie(s,i):Math.max(Math.min(i/2,a),o)}function cbe(r){r.registerChartView(rbe),r.registerSeriesModel($$),r.registerPreprocessor(sbe),r.registerVisual(ebe),r.registerLayout(lbe)}function XR(r,e){var t=e.rippleEffectColor||e.color;r.eachChild(function(n){n.attr({z:e.z,zlevel:e.zlevel,style:{stroke:e.brushType==="stroke"?t:null,fill:e.brushType==="fill"?t:null}})})}var fbe=function(r){z(e,r);function e(t,n){var i=r.call(this)||this,a=new Pp(t,n),o=new Ee;return i.add(a),i.add(o),i.updateData(t,n),i}return e.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},e.prototype.startEffectAnimation=function(t){for(var n=t.symbolType,i=t.color,a=t.rippleNumber,o=this.childAt(1),s=0;s0&&(s=this._getLineLength(a)/c*1e3),s!==this._period||l!==this._loop||u!==this._roundTrip){a.stopAnimation();var h=void 0;Te(f)?h=f(i):h=f,a.__t>0&&(h=-s*a.__t),this._animateSymbol(a,s,h,l,u)}this._period=s,this._loop=l,this._roundTrip=u}},e.prototype._animateSymbol=function(t,n,i,a,o){if(n>0){t.__t=0;var s=this,l=t.animate("",a).when(o?n*2:n,{__t:o?2:1}).delay(i).during(function(){s._updateSymbolPosition(t)});a||l.done(function(){s.remove(t)}),l.start()}},e.prototype._getLineLength=function(t){return ss(t.__p1,t.__cp1)+ss(t.__cp1,t.__p2)},e.prototype._updateAnimationPoints=function(t,n){t.__p1=n[0],t.__p2=n[1],t.__cp1=n[2]||[(n[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2]},e.prototype.updateData=function(t,n,i){this.childAt(0).updateData(t,n,i),this._updateEffectSymbol(t,n)},e.prototype._updateSymbolPosition=function(t){var n=t.__p1,i=t.__p2,a=t.__cp1,o=t.__t<1?t.__t:2-t.__t,s=[t.x,t.y],l=s.slice(),u=Ar,c=Jw;s[0]=u(n[0],a[0],i[0],o),s[1]=u(n[1],a[1],i[1],o);var f=t.__t<1?c(n[0],a[0],i[0],o):c(i[0],a[0],n[0],1-o),h=t.__t<1?c(n[1],a[1],i[1],o):c(i[1],a[1],n[1],1-o);t.rotation=-Math.atan2(h,f)-Math.PI/2,(this._symbolType==="line"||this._symbolType==="rect"||this._symbolType==="roundRect")&&(t.__lastT!==void 0&&t.__lastT=0&&!(a[l]<=n);l--);l=Math.min(l,o-2)}else{for(l=s;ln);l++);l=Math.min(l-1,o-2)}var c=(n-a[l])/(a[l+1]-a[l]),f=i[l],h=i[l+1];t.x=f[0]*(1-c)+c*h[0],t.y=f[1]*(1-c)+c*h[1];var d=t.__t<1?h[0]-f[0]:f[0]-h[0],p=t.__t<1?h[1]-f[1]:f[1]-h[1];t.rotation=-Math.atan2(p,d)-Math.PI/2,this._lastFrame=l,this._lastFramePercent=n,t.ignore=!1}},e}(H$),mbe=function(){function r(){this.polyline=!1,this.curveness=0,this.segs=[]}return r}(),gbe=function(r){z(e,r);function e(t){var n=r.call(this,t)||this;return n._off=0,n.hoverDataIdx=-1,n}return e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new mbe},e.prototype.buildPath=function(t,n){var i=n.segs,a=n.curveness,o;if(n.polyline)for(o=this._off;o0){t.moveTo(i[o++],i[o++]);for(var l=1;l0){var d=(u+f)/2-(c-h)*a,p=(c+h)/2-(f-u)*a;t.quadraticCurveTo(d,p,f,h)}else t.lineTo(f,h)}this.incremental&&(this._off=o,this.notClear=!0)},e.prototype.findDataIndex=function(t,n){var i=this.shape,a=i.segs,o=i.curveness,s=this.style.lineWidth;if(i.polyline)for(var l=0,u=0;u0)for(var f=a[u++],h=a[u++],d=1;d0){var m=(f+p)/2-(h-v)*o,g=(h+v)/2-(p-f)*o;if(yz(f,h,m,g,p,v,s,t,n))return l}else if(Jo(f,h,p,v,s,t,n))return l;l++}return-1},e.prototype.contain=function(t,n){var i=this.transformCoordToLocal(t,n),a=this.getBoundingRect();if(t=i[0],n=i[1],a.contain(t,n)){var o=this.hoverDataIdx=this.findDataIndex(t,n);return o>=0}return this.hoverDataIdx=-1,!1},e.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var n=this.shape,i=n.segs,a=1/0,o=1/0,s=-1/0,l=-1/0,u=0;u0&&(o.dataIndex=l+e.__startIndex)})},r.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},r}(),W$={seriesType:"lines",plan:Af(),reset:function(r){var e=r.coordinateSystem;if(e){var t=r.get("polyline"),n=r.pipelineContext.large;return{progress:function(i,a){var o=[];if(n){var s=void 0,l=i.end-i.start;if(t){for(var u=0,c=i.start;c0&&(c||u.configLayer(s,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(l/10+.9,1),0)})),o.updateData(a);var f=t.get("clip",!0)&&Op(t.coordinateSystem,!1,t);f?this.group.setClipPath(f):this.group.removeClipPath(),this._lastZlevel=s,this._finished=!0},e.prototype.incrementalPrepareRender=function(t,n,i){var a=t.getData(),o=this._updateLineDraw(a,t);o.incrementalPrepareUpdate(a),this._clearLayer(i),this._finished=!1},e.prototype.incrementalRender=function(t,n,i){this._lineDraw.incrementalUpdate(t,n.getData()),this._finished=t.end===n.getData().count()},e.prototype.eachRendered=function(t){this._lineDraw&&this._lineDraw.eachRendered(t)},e.prototype.updateTransform=function(t,n,i){var a=t.getData(),o=t.pipelineContext;if(!this._finished||o.large||o.progressiveRender)return{update:!0};var s=W$.reset(t,n,i);s.progress&&s.progress({start:0,end:a.count(),count:a.count()},a),this._lineDraw.updateLayout(),this._clearLayer(i)},e.prototype._updateLineDraw=function(t,n){var i=this._lineDraw,a=this._showEffect(n),o=!!n.get("polyline"),s=n.pipelineContext,l=s.large;return(!i||a!==this._hasEffet||o!==this._isPolyline||l!==this._isLargeDraw)&&(i&&i.remove(),i=this._lineDraw=l?new ybe:new kA(o?a?vbe:G$:a?H$:MA),this._hasEffet=a,this._isPolyline=o,this._isLargeDraw=l),this.group.add(i.group),i},e.prototype._showEffect=function(t){return!!t.get(["effect","show"])},e.prototype._clearLayer=function(t){var n=t.getZr(),i=n.painter.getType()==="svg";!i&&this._lastZlevel!=null&&n.painter.getLayer(this._lastZlevel).clear(!0)},e.prototype.remove=function(t,n){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(n)},e.prototype.dispose=function(t,n){this.remove(t,n)},e.type="lines",e}(St),_be=typeof Uint32Array>"u"?Array:Uint32Array,xbe=typeof Float64Array>"u"?Array:Float64Array;function KR(r){var e=r.data;e&&e[0]&&e[0][0]&&e[0][0].coord&&(r.data=K(e,function(t){var n=[t[0].coord,t[1].coord],i={coords:n};return t[0].name&&(i.fromName=t[0].name),t[1].name&&(i.toName=t[1].name),lC([i,t[0],t[1]])}))}var wbe=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.visualStyleAccessPath="lineStyle",t.visualDrawType="stroke",t}return e.prototype.init=function(t){t.data=t.data||[],KR(t);var n=this._processFlatCoordsArray(t.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(t.data=new Float32Array(n.count)),r.prototype.init.apply(this,arguments)},e.prototype.mergeOption=function(t){if(KR(t),t.data){var n=this._processFlatCoordsArray(t.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(t.data=new Float32Array(n.count))}r.prototype.mergeOption.apply(this,arguments)},e.prototype.appendData=function(t){var n=this._processFlatCoordsArray(t.data);n.flatCoords&&(this._flatCoords?(this._flatCoords=jd(this._flatCoords,n.flatCoords),this._flatCoordsOffset=jd(this._flatCoordsOffset,n.flatCoordsOffset)):(this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset),t.data=new Float32Array(n.count)),this.getRawData().appendData(t.data)},e.prototype._getCoordsFromItemModel=function(t){var n=this.getData().getItemModel(t),i=n.option instanceof Array?n.option:n.getShallow("coords");return i},e.prototype.getLineCoordsCount=function(t){return this._flatCoordsOffset?this._flatCoordsOffset[t*2+1]:this._getCoordsFromItemModel(t).length},e.prototype.getLineCoords=function(t,n){if(this._flatCoordsOffset){for(var i=this._flatCoordsOffset[t*2],a=this._flatCoordsOffset[t*2+1],o=0;o ")})},e.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},e.prototype.getProgressive=function(){var t=this.option.progressive;return t??(this.option.large?1e4:this.get("progressive"))},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return t??(this.option.large?2e4:this.get("progressiveThreshold"))},e.prototype.getZLevelKey=function(){var t=this.getModel("effect"),n=t.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:t.get("show")&&n>0?n+"":""},e.type="series.lines",e.dependencies=["grid","polar","geo","calendar"],e.defaultOption={coordinateSystem:"geo",z:2,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}},e}(It);function sm(r){return r instanceof Array||(r=[r,r]),r}var Sbe={seriesType:"lines",reset:function(r){var e=sm(r.get("symbol")),t=sm(r.get("symbolSize")),n=r.getData();n.setVisual("fromSymbol",e&&e[0]),n.setVisual("toSymbol",e&&e[1]),n.setVisual("fromSymbolSize",t&&t[0]),n.setVisual("toSymbolSize",t&&t[1]);function i(a,o){var s=a.getItemModel(o),l=sm(s.getShallow("symbol",!0)),u=sm(s.getShallow("symbolSize",!0));l[0]&&a.setItemVisual(o,"fromSymbol",l[0]),l[1]&&a.setItemVisual(o,"toSymbol",l[1]),u[0]&&a.setItemVisual(o,"fromSymbolSize",u[0]),u[1]&&a.setItemVisual(o,"toSymbolSize",u[1])}return{dataEach:n.hasItemOption?i:null}}};function Tbe(r){r.registerChartView(bbe),r.registerSeriesModel(wbe),r.registerLayout(W$),r.registerVisual(Sbe)}var Cbe=256,Abe=function(){function r(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var e=ks.createCanvas();this.canvas=e}return r.prototype.update=function(e,t,n,i,a,o){var s=this._getBrush(),l=this._getGradient(a,"inRange"),u=this._getGradient(a,"outOfRange"),c=this.pointSize+this.blurSize,f=this.canvas,h=f.getContext("2d"),d=e.length;f.width=t,f.height=n;for(var p=0;p0){var D=o(b)?l:u;b>0&&(b=b*A+T),x[w++]=D[M],x[w++]=D[M+1],x[w++]=D[M+2],x[w++]=D[M+3]*b*256}else w+=4}return h.putImageData(_,0,0),f},r.prototype._getBrush=function(){var e=this._brushCanvas||(this._brushCanvas=ks.createCanvas()),t=this.pointSize+this.blurSize,n=t*2;e.width=n,e.height=n;var i=e.getContext("2d");return i.clearRect(0,0,n,n),i.shadowOffsetX=n,i.shadowBlur=this.blurSize,i.shadowColor="#000",i.beginPath(),i.arc(-t,t,this.pointSize,0,Math.PI*2,!0),i.closePath(),i.fill(),e},r.prototype._getGradient=function(e,t){for(var n=this._gradientPixels,i=n[t]||(n[t]=new Uint8ClampedArray(256*4)),a=[0,0,0,0],o=0,s=0;s<256;s++)e[t](s/255,!0,a),i[o++]=a[0],i[o++]=a[1],i[o++]=a[2],i[o++]=a[3];return i},r}();function Mbe(r,e,t){var n=r[1]-r[0];e=K(e,function(o){return{interval:[(o.interval[0]-r[0])/n,(o.interval[1]-r[0])/n]}});var i=e.length,a=0;return function(o){var s;for(s=a;s=0;s--){var l=e[s].interval;if(l[0]<=o&&o<=l[1]){a=s;break}}return s>=0&&s=e[0]&&n<=e[1]}}function ZR(r){var e=r.dimensions;return e[0]==="lng"&&e[1]==="lat"}var Dbe=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,n,i){var a;n.eachComponent("visualMap",function(s){s.eachTargetSeries(function(l){l===t&&(a=s)})}),this._progressiveEls=null,this.group.removeAll();var o=t.coordinateSystem;o.type==="cartesian2d"||o.type==="calendar"?this._renderOnCartesianAndCalendar(t,i,0,t.getData().count()):ZR(o)&&this._renderOnGeo(o,t,a,i)},e.prototype.incrementalPrepareRender=function(t,n,i){this.group.removeAll()},e.prototype.incrementalRender=function(t,n,i,a){var o=n.coordinateSystem;o&&(ZR(o)?this.render(n,i,a):(this._progressiveEls=[],this._renderOnCartesianAndCalendar(n,a,t.start,t.end,!0)))},e.prototype.eachRendered=function(t){Vs(this._progressiveEls||this.group,t)},e.prototype._renderOnCartesianAndCalendar=function(t,n,i,a,o){var s=t.coordinateSystem,l=Ou(s,"cartesian2d"),u,c,f,h;if(l){var d=s.getAxis("x"),p=s.getAxis("y");u=d.getBandWidth()+.5,c=p.getBandWidth()+.5,f=d.scale.getExtent(),h=p.scale.getExtent()}for(var v=this.group,m=t.getData(),g=t.getModel(["emphasis","itemStyle"]).getItemStyle(),y=t.getModel(["blur","itemStyle"]).getItemStyle(),b=t.getModel(["select","itemStyle"]).getItemStyle(),_=t.get(["itemStyle","borderRadius"]),x=Tr(t),w=t.getModel("emphasis"),S=w.get("focus"),T=w.get("blurScope"),C=w.get("disabled"),A=l?[m.mapDimension("x"),m.mapDimension("y"),m.mapDimension("value")]:[m.mapDimension("time"),m.mapDimension("value")],M=i;Mf[1]||Ih[1])continue;var R=s.dataToPoint([L,I]);D=new nt({shape:{x:R[0]-u/2,y:R[1]-c/2,width:u,height:c},style:E})}else{if(isNaN(m.get(A[1],M)))continue;D=new nt({z2:1,shape:s.dataToRect([m.get(A[0],M)]).contentShape,style:E})}if(m.hasItemOption){var P=m.getItemModel(M),O=P.getModel("emphasis");g=O.getModel("itemStyle").getItemStyle(),y=P.getModel(["blur","itemStyle"]).getItemStyle(),b=P.getModel(["select","itemStyle"]).getItemStyle(),_=P.get(["itemStyle","borderRadius"]),S=O.get("focus"),T=O.get("blurScope"),C=O.get("disabled"),x=Tr(P)}D.shape.r=_;var j=t.getRawValue(M),F="-";j&&j[2]!=null&&(F=j[2]+""),Vr(D,x,{labelFetcher:t,labelDataIndex:M,defaultOpacity:E.opacity,defaultText:F}),D.ensureState("emphasis").style=g,D.ensureState("blur").style=y,D.ensureState("select").style=b,$t(D,S,T,C),D.incremental=o,o&&(D.states.emphasis.hoverLayer=!0),v.add(D),m.setItemGraphicEl(M,D),this._progressiveEls&&this._progressiveEls.push(D)}},e.prototype._renderOnGeo=function(t,n,i,a){var o=i.targetVisuals.inRange,s=i.targetVisuals.outOfRange,l=n.getData(),u=this._hmLayer||this._hmLayer||new Abe;u.blurSize=n.get("blurSize"),u.pointSize=n.get("pointSize"),u.minOpacity=n.get("minOpacity"),u.maxOpacity=n.get("maxOpacity");var c=t.getViewRect().clone(),f=t.getRoamTransform();c.applyTransform(f);var h=Math.max(c.x,0),d=Math.max(c.y,0),p=Math.min(c.width+c.x,a.getWidth()),v=Math.min(c.height+c.y,a.getHeight()),m=p-h,g=v-d,y=[l.mapDimension("lng"),l.mapDimension("lat"),l.mapDimension("value")],b=l.mapArray(y,function(S,T,C){var A=t.dataToPoint([S,T]);return A[0]-=h,A[1]-=d,A.push(C),A}),_=i.getExtent(),x=i.type==="visualMap.continuous"?kbe(_,i.option.range):Mbe(_,i.getPieceList(),i.option.selected);u.update(b,m,g,o.color.getNormalizer(),{inRange:o.color.getColorMapper(),outOfRange:s.color.getColorMapper()},x);var w=new Lr({style:{width:m,height:g,x:h,y:d,image:u.canvas},silent:!0});this.group.add(w)},e.type="heatmap",e}(St),Ebe=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(t,n){return Lo(null,this,{generateCoord:"value"})},e.prototype.preventIncremental=function(){var t=Dp.get(this.get("coordinateSystem"));if(t&&t.dimensions)return t.dimensions[0]==="lng"&&t.dimensions[1]==="lat"},e.type="series.heatmap",e.dependencies=["grid","geo","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:"#212121"}}},e}(It);function Lbe(r){r.registerChartView(Dbe),r.registerSeriesModel(Ebe)}var Ibe=["itemStyle","borderWidth"],JR=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],ux=new Eo,Pbe=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,n,i){var a=this.group,o=t.getData(),s=this._data,l=t.coordinateSystem,u=l.getBaseAxis(),c=u.isHorizontal(),f=l.master.getRect(),h={ecSize:{width:i.getWidth(),height:i.getHeight()},seriesModel:t,coordSys:l,coordSysExtent:[[f.x,f.x+f.width],[f.y,f.y+f.height]],isHorizontal:c,valueDim:JR[+c],categoryDim:JR[1-+c]};o.diff(s).add(function(p){if(o.hasValue(p)){var v=eO(o,p),m=QR(o,p,v,h),g=tO(o,h,m);o.setItemGraphicEl(p,g),a.add(g),nO(g,h,m)}}).update(function(p,v){var m=s.getItemGraphicEl(v);if(!o.hasValue(p)){a.remove(m);return}var g=eO(o,p),y=QR(o,p,g,h),b=Z$(o,y);m&&b!==m.__pictorialShapeStr&&(a.remove(m),o.setItemGraphicEl(p,null),m=null),m?Fbe(m,h,y):m=tO(o,h,y,!0),o.setItemGraphicEl(p,m),m.__pictorialSymbolMeta=y,a.add(m),nO(m,h,y)}).remove(function(p){var v=s.getItemGraphicEl(p);v&&rO(s,p,v.__pictorialSymbolMeta.animationModel,v)}).execute();var d=t.get("clip",!0)?Op(t.coordinateSystem,!1,t):null;return d?a.setClipPath(d):a.removeClipPath(),this._data=o,this.group},e.prototype.remove=function(t,n){var i=this.group,a=this._data;t.get("animation")?a&&a.eachItemGraphicEl(function(o){rO(a,Le(o).dataIndex,t,o)}):i.removeAll()},e.type="pictorialBar",e}(St);function QR(r,e,t,n){var i=r.getItemLayout(e),a=t.get("symbolRepeat"),o=t.get("symbolClip"),s=t.get("symbolPosition")||"start",l=t.get("symbolRotate"),u=(l||0)*Math.PI/180||0,c=t.get("symbolPatternSize")||2,f=t.isAnimationEnabled(),h={dataIndex:e,layout:i,itemModel:t,symbolType:r.getItemVisual(e,"symbol")||"circle",style:r.getItemVisual(e,"style"),symbolClip:o,symbolRepeat:a,symbolRepeatDirection:t.get("symbolRepeatDirection"),symbolPatternSize:c,rotation:u,animationModel:f?t:null,hoverScale:f&&t.get(["emphasis","scale"]),z2:t.getShallow("z",!0)||0};Rbe(t,a,i,n,h),Obe(r,e,i,a,o,h.boundingLength,h.pxSign,c,n,h),jbe(t,h.symbolScale,u,n,h);var d=h.symbolSize,p=Pu(t.get("symbolOffset"),d);return Nbe(t,d,i,a,o,p,s,h.valueLineWidth,h.boundingLength,h.repeatCutLength,n,h),h}function Rbe(r,e,t,n,i){var a=n.valueDim,o=r.get("symbolBoundingData"),s=n.coordSys.getOtherAxis(n.coordSys.getBaseAxis()),l=s.toGlobalCoord(s.dataToCoord(0)),u=1-+(t[a.wh]<=0),c;if(q(o)){var f=[cx(s,o[0])-l,cx(s,o[1])-l];f[1]=0?1:-1:c>0?1:-1}function cx(r,e){return r.toGlobalCoord(r.dataToCoord(r.scale.parse(e)))}function Obe(r,e,t,n,i,a,o,s,l,u){var c=l.valueDim,f=l.categoryDim,h=Math.abs(t[f.wh]),d=r.getItemVisual(e,"symbolSize"),p;q(d)?p=d.slice():d==null?p=["100%","100%"]:p=[d,d],p[f.index]=ie(p[f.index],h),p[c.index]=ie(p[c.index],n?h:Math.abs(a)),u.symbolSize=p;var v=u.symbolScale=[p[0]/s,p[1]/s];v[c.index]*=(l.isHorizontal?-1:1)*o}function jbe(r,e,t,n,i){var a=r.get(Ibe)||0;a&&(ux.attr({scaleX:e[0],scaleY:e[1],rotation:t}),ux.updateTransform(),a/=ux.getLineScale(),a*=e[n.valueDim.index]),i.valueLineWidth=a||0}function Nbe(r,e,t,n,i,a,o,s,l,u,c,f){var h=c.categoryDim,d=c.valueDim,p=f.pxSign,v=Math.max(e[d.index]+s,0),m=v;if(n){var g=Math.abs(l),y=kr(r.get("symbolMargin"),"15%")+"",b=!1;y.lastIndexOf("!")===y.length-1&&(b=!0,y=y.slice(0,y.length-1));var _=ie(y,e[d.index]),x=Math.max(v+_*2,0),w=b?0:_*2,S=az(n),T=S?n:iO((g+w)/x),C=g-T*v;_=C/2/(b?T:Math.max(T-1,1)),x=v+_*2,w=b?0:_*2,!S&&n!=="fixed"&&(T=u?iO((Math.abs(u)+w)/x):0),m=T*x-w,f.repeatTimes=T,f.symbolMargin=_}var A=p*(m/2),M=f.pathPosition=[];M[h.index]=t[h.wh]/2,M[d.index]=o==="start"?A:o==="end"?l-A:l/2,a&&(M[0]+=a[0],M[1]+=a[1]);var D=f.bundlePosition=[];D[h.index]=t[h.xy],D[d.index]=t[d.xy];var E=f.barRectShape=W({},t);E[d.wh]=p*Math.max(Math.abs(t[d.wh]),Math.abs(M[d.index]+A)),E[h.wh]=t[h.wh];var L=f.clipShape={};L[h.xy]=-t[h.xy],L[h.wh]=c.ecSize[h.wh],L[d.xy]=0,L[d.wh]=t[d.wh]}function U$(r){var e=r.symbolPatternSize,t=ur(r.symbolType,-e/2,-e/2,e,e);return t.attr({culling:!0}),t.type!=="image"&&t.setStyle({strokeNoScale:!0}),t}function Y$(r,e,t,n){var i=r.__pictorialBundle,a=t.symbolSize,o=t.valueLineWidth,s=t.pathPosition,l=e.valueDim,u=t.repeatTimes||0,c=0,f=a[e.valueDim.index]+o+t.symbolMargin*2;for(BA(r,function(v){v.__pictorialAnimationIndex=c,v.__pictorialRepeatTimes=u,c0:g<0)&&(y=u-1-v),m[l.index]=f*(y-u/2+.5)+s[l.index],{x:m[0],y:m[1],scaleX:t.symbolScale[0],scaleY:t.symbolScale[1],rotation:t.rotation}}}function q$(r,e,t,n){var i=r.__pictorialBundle,a=r.__pictorialMainPath;a?Vc(a,null,{x:t.pathPosition[0],y:t.pathPosition[1],scaleX:t.symbolScale[0],scaleY:t.symbolScale[1],rotation:t.rotation},t,n):(a=r.__pictorialMainPath=U$(t),i.add(a),Vc(a,{x:t.pathPosition[0],y:t.pathPosition[1],scaleX:0,scaleY:0,rotation:t.rotation},{scaleX:t.symbolScale[0],scaleY:t.symbolScale[1]},t,n))}function X$(r,e,t){var n=W({},e.barRectShape),i=r.__pictorialBarRect;i?Vc(i,null,{shape:n},e,t):(i=r.__pictorialBarRect=new nt({z2:2,shape:n,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),i.disableMorphing=!0,r.add(i))}function K$(r,e,t,n){if(t.symbolClip){var i=r.__pictorialClipPath,a=W({},t.clipShape),o=e.valueDim,s=t.animationModel,l=t.dataIndex;if(i)ut(i,{shape:a},s,l);else{a[o.wh]=0,i=new nt({shape:a}),r.__pictorialBundle.setClipPath(i),r.__pictorialClipPath=i;var u={};u[o.wh]=t.clipShape[o.wh],Iu[n?"updateProps":"initProps"](i,{shape:u},s,l)}}}function eO(r,e){var t=r.getItemModel(e);return t.getAnimationDelayParams=Bbe,t.isAnimationEnabled=zbe,t}function Bbe(r){return{index:r.__pictorialAnimationIndex,count:r.__pictorialRepeatTimes}}function zbe(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function tO(r,e,t,n){var i=new Ee,a=new Ee;return i.add(a),i.__pictorialBundle=a,a.x=t.bundlePosition[0],a.y=t.bundlePosition[1],t.symbolRepeat?Y$(i,e,t):q$(i,e,t),X$(i,t,n),K$(i,e,t,n),i.__pictorialShapeStr=Z$(r,t),i.__pictorialSymbolMeta=t,i}function Fbe(r,e,t){var n=t.animationModel,i=t.dataIndex,a=r.__pictorialBundle;ut(a,{x:t.bundlePosition[0],y:t.bundlePosition[1]},n,i),t.symbolRepeat?Y$(r,e,t,!0):q$(r,e,t,!0),X$(r,t,!0),K$(r,e,t,!0)}function rO(r,e,t,n){var i=n.__pictorialBarRect;i&&i.removeTextContent();var a=[];BA(n,function(o){a.push(o)}),n.__pictorialMainPath&&a.push(n.__pictorialMainPath),n.__pictorialClipPath&&(t=null),k(a,function(o){Es(o,{scaleX:0,scaleY:0},t,e,function(){n.parent&&n.parent.remove(n)})}),r.setItemGraphicEl(e,null)}function Z$(r,e){return[r.getItemVisual(e.dataIndex,"symbol")||"none",!!e.symbolRepeat,!!e.symbolClip].join(":")}function BA(r,e,t){k(r.__pictorialBundle.children(),function(n){n!==r.__pictorialBarRect&&e.call(t,n)})}function Vc(r,e,t,n,i,a){e&&r.attr(e),n.symbolClip&&!i?t&&r.attr(t):t&&Iu[i?"updateProps":"initProps"](r,t,n.animationModel,n.dataIndex,a)}function nO(r,e,t){var n=t.dataIndex,i=t.itemModel,a=i.getModel("emphasis"),o=a.getModel("itemStyle").getItemStyle(),s=i.getModel(["blur","itemStyle"]).getItemStyle(),l=i.getModel(["select","itemStyle"]).getItemStyle(),u=i.getShallow("cursor"),c=a.get("focus"),f=a.get("blurScope"),h=a.get("scale");BA(r,function(v){if(v instanceof Lr){var m=v.style;v.useStyle(W({image:m.image,x:m.x,y:m.y,width:m.width,height:m.height},t.style))}else v.useStyle(t.style);var g=v.ensureState("emphasis");g.style=o,h&&(g.scaleX=v.scaleX*1.1,g.scaleY=v.scaleY*1.1),v.ensureState("blur").style=s,v.ensureState("select").style=l,u&&(v.cursor=u),v.z2=t.z2});var d=e.valueDim.posDesc[+(t.boundingLength>0)],p=r.__pictorialBarRect;p.ignoreClip=!0,Vr(p,Tr(i),{labelFetcher:e.seriesModel,labelDataIndex:n,defaultText:af(e.seriesModel.getData(),n),inheritColor:t.style.fill,defaultOpacity:t.style.opacity,defaultOutsidePosition:d}),$t(r,c,f,a.get("disabled"))}function iO(r){var e=Math.round(r);return Math.abs(r-e)<1e-4?e:Math.ceil(r)}var Vbe=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t.defaultSymbol="roundRect",t}return e.prototype.getInitialData=function(t){return t.stack=null,r.prototype.getInitialData.apply(this,arguments)},e.type="series.pictorialBar",e.dependencies=["grid"],e.defaultOption=$s(ep.defaultOption,{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",clip:!1,progressive:0,emphasis:{scale:!1},select:{itemStyle:{borderColor:"#212121"}}}),e}(ep);function $be(r){r.registerChartView(Pbe),r.registerSeriesModel(Vbe),r.registerLayout(r.PRIORITY.VISUAL.LAYOUT,Oe(RF,"pictorialBar")),r.registerLayout(r.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,OF("pictorialBar"))}var Hbe=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._layers=[],t}return e.prototype.render=function(t,n,i){var a=t.getData(),o=this,s=this.group,l=t.getLayerSeries(),u=a.getLayout("layoutInfo"),c=u.rect,f=u.boundaryGap;s.x=0,s.y=c.y+f[0];function h(m){return m.name}var d=new To(this._layersSeries||[],l,h,h),p=[];d.add(ue(v,this,"add")).update(ue(v,this,"update")).remove(ue(v,this,"remove")).execute();function v(m,g,y){var b=o._layers;if(m==="remove"){s.remove(b[g]);return}for(var _=[],x=[],w,S=l[g].indices,T=0;Ta&&(a=s),n.push(s)}for(var u=0;ua&&(a=f)}return{y0:i,max:a}}function qbe(r){r.registerChartView(Hbe),r.registerSeriesModel(Wbe),r.registerLayout(Ube),r.registerProcessor(Np("themeRiver"))}var Xbe=2,Kbe=4,oO=function(r){z(e,r);function e(t,n,i,a){var o=r.call(this)||this;o.z2=Xbe,o.textConfig={inside:!0},Le(o).seriesIndex=n.seriesIndex;var s=new ot({z2:Kbe,silent:t.getModel().get(["label","silent"])});return o.setTextContent(s),o.updateData(!0,t,n,i,a),o}return e.prototype.updateData=function(t,n,i,a,o){this.node=n,n.piece=this,i=i||this._seriesModel,a=a||this._ecModel;var s=this;Le(s).dataIndex=n.dataIndex;var l=n.getModel(),u=l.getModel("emphasis"),c=n.getLayout(),f=W({},c);f.label=null;var h=n.getVisual("style");h.lineJoin="bevel";var d=n.getVisual("decal");d&&(h.decal=rf(d,o));var p=Bl(l.getModel("itemStyle"),f,!0);W(f,p),k(mn,function(y){var b=s.ensureState(y),_=l.getModel([y,"itemStyle"]);b.style=_.getItemStyle();var x=Bl(_,f);x&&(b.shape=x)}),t?(s.setShape(f),s.shape.r=c.r0,Ot(s,{shape:{r:c.r}},i,n.dataIndex)):(ut(s,{shape:f},i),Bi(s)),s.useStyle(h),this._updateLabel(i);var v=l.getShallow("cursor");v&&s.attr("cursor",v),this._seriesModel=i||this._seriesModel,this._ecModel=a||this._ecModel;var m=u.get("focus"),g=m==="relative"?jd(n.getAncestorsIndices(),n.getDescendantIndices()):m==="ancestor"?n.getAncestorsIndices():m==="descendant"?n.getDescendantIndices():m;$t(this,g,u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(t){var n=this,i=this.node.getModel(),a=i.getModel("label"),o=this.node.getLayout(),s=o.endAngle-o.startAngle,l=(o.startAngle+o.endAngle)/2,u=Math.cos(l),c=Math.sin(l),f=this,h=f.getTextContent(),d=this.node.dataIndex,p=a.get("minAngle")/180*Math.PI,v=a.get("show")&&!(p!=null&&Math.abs(s)L&&!Fd(R-L)&&R0?(o.virtualPiece?o.virtualPiece.updateData(!1,y,t,n,i):(o.virtualPiece=new oO(y,t,n,i),c.add(o.virtualPiece)),b.piece.off("click"),o.virtualPiece.on("click",function(_){o._rootToNode(b.parentNode)})):o.virtualPiece&&(c.remove(o.virtualPiece),o.virtualPiece=null)}},e.prototype._initEvents=function(){var t=this;this.group.off("click"),this.group.on("click",function(n){var i=!1,a=t.seriesModel.getViewRoot();a.eachNode(function(o){if(!i&&o.piece&&o.piece===n.target){var s=o.getModel().get("nodeClick");if(s==="rootToNode")t._rootToNode(o);else if(s==="link"){var l=o.getModel(),u=l.get("link");if(u){var c=l.get("target",!0)||"_blank";Sy(u,c)}}i=!0}})})},e.prototype._rootToNode=function(t){t!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:dS,from:this.uid,seriesId:this.seriesModel.id,targetNode:t})},e.prototype.containPoint=function(t,n){var i=n.getData(),a=i.getItemLayout(0);if(a){var o=t[0]-a.cx,s=t[1]-a.cy,l=Math.sqrt(o*o+s*s);return l<=a.r&&l>=a.r0}},e.type="sunburst",e}(St),e_e=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.ignoreStyleOnData=!0,t}return e.prototype.getInitialData=function(t,n){var i={name:t.name,children:t.data};J$(i);var a=this._levelModels=K(t.levels||[],function(l){return new _t(l,this,n)},this),o=xA.createTree(i,this,s);function s(l){l.wrapMethod("getItemModel",function(u,c){var f=o.getNodeByDataIndex(c),h=a[f.depth];return h&&(u.parentModel=h),u})}return o.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.getDataParams=function(t){var n=r.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return n.treePathInfo=p1(i,this),n},e.prototype.getLevelModel=function(t){return this._levelModels&&this._levelModels[t.depth]},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var n=this.getRawData().tree.root;(!t||t!==n&&!n.contains(t))&&(this._viewRoot=n)},e.prototype.enableAriaDecal=function(){n$(this)},e.type="series.sunburst",e.defaultOption={z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,stillShowZeroSum:!0,nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{rotate:"radial",show:!0,opacity:1,align:"center",position:"inside",distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:"descendant"},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,data:[],sort:"desc"},e}(It);function J$(r){var e=0;k(r.children,function(n){J$(n);var i=n.value;q(i)&&(i=i[0]),e+=i});var t=r.value;q(t)&&(t=t[0]),(t==null||isNaN(t))&&(t=e),t<0&&(t=0),q(r.value)?r.value[0]=t:r.value=t}var lO=Math.PI/180;function t_e(r,e,t){e.eachSeriesByType(r,function(n){var i=n.get("center"),a=n.get("radius");q(a)||(a=[0,a]),q(i)||(i=[i,i]);var o=t.getWidth(),s=t.getHeight(),l=Math.min(o,s),u=ie(i[0],o),c=ie(i[1],s),f=ie(a[0],l/2),h=ie(a[1],l/2),d=-n.get("startAngle")*lO,p=n.get("minAngle")*lO,v=n.getData().tree.root,m=n.getViewRoot(),g=m.depth,y=n.get("sort");y!=null&&Q$(m,y);var b=0;k(m.children,function(R){!isNaN(R.getValue())&&b++});var _=m.getValue(),x=Math.PI/(_||b)*2,w=m.depth>0,S=m.height-(w?-1:1),T=(h-f)/(S||1),C=n.get("clockwise"),A=n.get("stillShowZeroSum"),M=C?1:-1,D=function(R,P){if(R){var O=P;if(R!==v){var j=R.getValue(),F=_===0&&A?x:j*x;F1;)o=o.parentNode;var s=i.getColorFromPalette(o.name||o.dataIndex+"",e);return n.depth>1&&se(s)&&(s=t2(s,(n.depth-1)/(a-1)*.5)),s}r.eachSeriesByType("sunburst",function(n){var i=n.getData(),a=i.tree;a.eachNode(function(o){var s=o.getModel(),l=s.getModel("itemStyle").getItemStyle();l.fill||(l.fill=t(o,n,a.root.height));var u=i.ensureUniqueItemVisual(o.dataIndex,"style");W(u,l)})})}function i_e(r){r.registerChartView(Qbe),r.registerSeriesModel(e_e),r.registerLayout(Oe(t_e,"sunburst")),r.registerProcessor(Oe(Np,"sunburst")),r.registerVisual(n_e),Jbe(r)}var uO={color:"fill",borderColor:"stroke"},a_e={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},po=it(),o_e=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},e.prototype.getInitialData=function(t,n){return Lo(null,this)},e.prototype.getDataParams=function(t,n,i){var a=r.prototype.getDataParams.call(this,t,n);return i&&(a.info=po(i).info),a},e.type="series.custom",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,clip:!1},e}(It);function s_e(r,e){return e=e||[0,0],K(["x","y"],function(t,n){var i=this.getAxis(t),a=e[n],o=r[n]/2;return i.type==="category"?i.getBandWidth():Math.abs(i.dataToCoord(a-o)-i.dataToCoord(a+o))},this)}function l_e(r){var e=r.master.getRect();return{coordSys:{type:"cartesian2d",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(t){return r.dataToPoint(t)},size:ue(s_e,r)}}}function u_e(r,e){return e=e||[0,0],K([0,1],function(t){var n=e[t],i=r[t]/2,a=[],o=[];return a[t]=n-i,o[t]=n+i,a[1-t]=o[1-t]=e[1-t],Math.abs(this.dataToPoint(a)[t]-this.dataToPoint(o)[t])},this)}function c_e(r){var e=r.getBoundingRect();return{coordSys:{type:"geo",x:e.x,y:e.y,width:e.width,height:e.height,zoom:r.getZoom()},api:{coord:function(t){return r.dataToPoint(t)},size:ue(u_e,r)}}}function f_e(r,e){var t=this.getAxis(),n=e instanceof Array?e[0]:e,i=(r instanceof Array?r[0]:r)/2;return t.type==="category"?t.getBandWidth():Math.abs(t.dataToCoord(n-i)-t.dataToCoord(n+i))}function h_e(r){var e=r.getRect();return{coordSys:{type:"singleAxis",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(t){return r.dataToPoint(t)},size:ue(f_e,r)}}}function d_e(r,e){return e=e||[0,0],K(["Radius","Angle"],function(t,n){var i="get"+t+"Axis",a=this[i](),o=e[n],s=r[n]/2,l=a.type==="category"?a.getBandWidth():Math.abs(a.dataToCoord(o-s)-a.dataToCoord(o+s));return t==="Angle"&&(l=l*Math.PI/180),l},this)}function p_e(r){var e=r.getRadiusAxis(),t=r.getAngleAxis(),n=e.getExtent();return n[0]>n[1]&&n.reverse(),{coordSys:{type:"polar",cx:r.cx,cy:r.cy,r:n[1],r0:n[0]},api:{coord:function(i){var a=e.dataToRadius(i[0]),o=t.dataToAngle(i[1]),s=r.coordToPoint([a,o]);return s.push(a,o*Math.PI/180),s},size:ue(d_e,r)}}}function v_e(r){var e=r.getRect(),t=r.getRangeInfo();return{coordSys:{type:"calendar",x:e.x,y:e.y,width:e.width,height:e.height,cellWidth:r.getCellWidth(),cellHeight:r.getCellHeight(),rangeInfo:{start:t.start,end:t.end,weeks:t.weeks,dayCount:t.allDay}},api:{coord:function(n,i){return r.dataToPoint(n,i)}}}}function e8(r,e,t,n){return r&&(r.legacy||r.legacy!==!1&&!t&&!n&&e!=="tspan"&&(e==="text"||fe(r,"text")))}function t8(r,e,t){var n=r,i,a,o;if(e==="text")o=n;else{o={},fe(n,"text")&&(o.text=n.text),fe(n,"rich")&&(o.rich=n.rich),fe(n,"textFill")&&(o.fill=n.textFill),fe(n,"textStroke")&&(o.stroke=n.textStroke),fe(n,"fontFamily")&&(o.fontFamily=n.fontFamily),fe(n,"fontSize")&&(o.fontSize=n.fontSize),fe(n,"fontStyle")&&(o.fontStyle=n.fontStyle),fe(n,"fontWeight")&&(o.fontWeight=n.fontWeight),a={type:"text",style:o,silent:!0},i={};var s=fe(n,"textPosition");t?i.position=s?n.textPosition:"inside":s&&(i.position=n.textPosition),fe(n,"textPosition")&&(i.position=n.textPosition),fe(n,"textOffset")&&(i.offset=n.textOffset),fe(n,"textRotation")&&(i.rotation=n.textRotation),fe(n,"textDistance")&&(i.distance=n.textDistance)}return cO(o,r),k(o.rich,function(l){cO(l,l)}),{textConfig:i,textContent:a}}function cO(r,e){e&&(e.font=e.textFont||e.font,fe(e,"textStrokeWidth")&&(r.lineWidth=e.textStrokeWidth),fe(e,"textAlign")&&(r.align=e.textAlign),fe(e,"textVerticalAlign")&&(r.verticalAlign=e.textVerticalAlign),fe(e,"textLineHeight")&&(r.lineHeight=e.textLineHeight),fe(e,"textWidth")&&(r.width=e.textWidth),fe(e,"textHeight")&&(r.height=e.textHeight),fe(e,"textBackgroundColor")&&(r.backgroundColor=e.textBackgroundColor),fe(e,"textPadding")&&(r.padding=e.textPadding),fe(e,"textBorderColor")&&(r.borderColor=e.textBorderColor),fe(e,"textBorderWidth")&&(r.borderWidth=e.textBorderWidth),fe(e,"textBorderRadius")&&(r.borderRadius=e.textBorderRadius),fe(e,"textBoxShadowColor")&&(r.shadowColor=e.textBoxShadowColor),fe(e,"textBoxShadowBlur")&&(r.shadowBlur=e.textBoxShadowBlur),fe(e,"textBoxShadowOffsetX")&&(r.shadowOffsetX=e.textBoxShadowOffsetX),fe(e,"textBoxShadowOffsetY")&&(r.shadowOffsetY=e.textBoxShadowOffsetY))}function fO(r,e,t){var n=r;n.textPosition=n.textPosition||t.position||"inside",t.offset!=null&&(n.textOffset=t.offset),t.rotation!=null&&(n.textRotation=t.rotation),t.distance!=null&&(n.textDistance=t.distance);var i=n.textPosition.indexOf("inside")>=0,a=r.fill||"#000";hO(n,e);var o=n.textFill==null;return i?o&&(n.textFill=t.insideFill||"#fff",!n.textStroke&&t.insideStroke&&(n.textStroke=t.insideStroke),!n.textStroke&&(n.textStroke=a),n.textStrokeWidth==null&&(n.textStrokeWidth=2)):(o&&(n.textFill=r.fill||t.outsideFill||"#000"),!n.textStroke&&t.outsideStroke&&(n.textStroke=t.outsideStroke)),n.text=e.text,n.rich=e.rich,k(e.rich,function(s){hO(s,s)}),n}function hO(r,e){e&&(fe(e,"fill")&&(r.textFill=e.fill),fe(e,"stroke")&&(r.textStroke=e.fill),fe(e,"lineWidth")&&(r.textStrokeWidth=e.lineWidth),fe(e,"font")&&(r.font=e.font),fe(e,"fontStyle")&&(r.fontStyle=e.fontStyle),fe(e,"fontWeight")&&(r.fontWeight=e.fontWeight),fe(e,"fontSize")&&(r.fontSize=e.fontSize),fe(e,"fontFamily")&&(r.fontFamily=e.fontFamily),fe(e,"align")&&(r.textAlign=e.align),fe(e,"verticalAlign")&&(r.textVerticalAlign=e.verticalAlign),fe(e,"lineHeight")&&(r.textLineHeight=e.lineHeight),fe(e,"width")&&(r.textWidth=e.width),fe(e,"height")&&(r.textHeight=e.height),fe(e,"backgroundColor")&&(r.textBackgroundColor=e.backgroundColor),fe(e,"padding")&&(r.textPadding=e.padding),fe(e,"borderColor")&&(r.textBorderColor=e.borderColor),fe(e,"borderWidth")&&(r.textBorderWidth=e.borderWidth),fe(e,"borderRadius")&&(r.textBorderRadius=e.borderRadius),fe(e,"shadowColor")&&(r.textBoxShadowColor=e.shadowColor),fe(e,"shadowBlur")&&(r.textBoxShadowBlur=e.shadowBlur),fe(e,"shadowOffsetX")&&(r.textBoxShadowOffsetX=e.shadowOffsetX),fe(e,"shadowOffsetY")&&(r.textBoxShadowOffsetY=e.shadowOffsetY),fe(e,"textShadowColor")&&(r.textShadowColor=e.textShadowColor),fe(e,"textShadowBlur")&&(r.textShadowBlur=e.textShadowBlur),fe(e,"textShadowOffsetX")&&(r.textShadowOffsetX=e.textShadowOffsetX),fe(e,"textShadowOffsetY")&&(r.textShadowOffsetY=e.textShadowOffsetY))}var r8={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},dO=et(r8);Ea(Ia,function(r,e){return r[e]=1,r},{});Ia.join(", ");var Gy=["","style","shape","extra"],lf=it();function zA(r,e,t,n,i){var a=r+"Animation",o=_f(r,n,i)||{},s=lf(e).userDuring;return o.duration>0&&(o.during=s?ue(__e,{el:e,userDuring:s}):null,o.setToFinal=!0,o.scope=r),W(o,t[a]),o}function Zm(r,e,t,n){n=n||{};var i=n.dataIndex,a=n.isInit,o=n.clearStyle,s=t.isAnimationEnabled(),l=lf(r),u=e.style;l.userDuring=e.during;var c={},f={};if(w_e(r,e,f),vO("shape",e,f),vO("extra",e,f),!a&&s&&(x_e(r,e,c),pO("shape",r,e,c),pO("extra",r,e,c),S_e(r,e,u,c)),f.style=u,m_e(r,f,o),y_e(r,e),s)if(a){var h={};k(Gy,function(p){var v=p?e[p]:e;v&&v.enterFrom&&(p&&(h[p]=h[p]||{}),W(p?h[p]:h,v.enterFrom))});var d=zA("enter",r,e,t,i);d.duration>0&&r.animateFrom(h,d)}else g_e(r,e,i||0,t,c);n8(r,e),u?r.dirty():r.markRedraw()}function n8(r,e){for(var t=lf(r).leaveToProps,n=0;n0&&r.animateFrom(i,a)}}function y_e(r,e){fe(e,"silent")&&(r.silent=e.silent),fe(e,"ignore")&&(r.ignore=e.ignore),r instanceof mi&&fe(e,"invisible")&&(r.invisible=e.invisible),r instanceof Xe&&fe(e,"autoBatch")&&(r.autoBatch=e.autoBatch)}var ea={},b_e={setTransform:function(r,e){return ea.el[r]=e,this},getTransform:function(r){return ea.el[r]},setShape:function(r,e){var t=ea.el,n=t.shape||(t.shape={});return n[r]=e,t.dirtyShape&&t.dirtyShape(),this},getShape:function(r){var e=ea.el.shape;if(e)return e[r]},setStyle:function(r,e){var t=ea.el,n=t.style;return n&&(n[r]=e,t.dirtyStyle&&t.dirtyStyle()),this},getStyle:function(r){var e=ea.el.style;if(e)return e[r]},setExtra:function(r,e){var t=ea.el.extra||(ea.el.extra={});return t[r]=e,this},getExtra:function(r){var e=ea.el.extra;if(e)return e[r]}};function __e(){var r=this,e=r.el;if(e){var t=lf(e).userDuring,n=r.userDuring;if(t!==n){r.el=r.userDuring=null;return}ea.el=e,n(b_e)}}function pO(r,e,t,n){var i=t[r];if(i){var a=e[r],o;if(a){var s=t.transition,l=i.transition;if(l)if(!o&&(o=n[r]={}),ou(l))W(o,a);else for(var u=wt(l),c=0;c=0){!o&&(o=n[r]={});for(var d=et(a),c=0;c=0)){var h=r.getAnimationStyleProps(),d=h?h.style:null;if(d){!a&&(a=n.style={});for(var p=et(t),u=0;u=0?e.getStore().get(P,I):void 0}var O=e.get(R.name,I),j=R&&R.ordinalMeta;return j?j.categories[O]:O}function w(L,I){I==null&&(I=u);var R=e.getItemVisual(I,"style"),P=R&&R.fill,O=R&&R.opacity,j=y(I,ps).getItemStyle();P!=null&&(j.fill=P),O!=null&&(j.opacity=O);var F={inheritColor:se(P)?P:"#000"},N=b(I,ps),B=Et(N,null,F,!1,!0);B.text=N.getShallow("show")?Re(r.getFormattedLabel(I,ps),af(e,I)):null;var $=xy(N,F,!1);return C(L,j),j=fO(j,B,$),L&&T(j,L),j.legacy=!0,j}function S(L,I){I==null&&(I=u);var R=y(I,vo).getItemStyle(),P=b(I,vo),O=Et(P,null,null,!0,!0);O.text=P.getShallow("show")?_a(r.getFormattedLabel(I,vo),r.getFormattedLabel(I,ps),af(e,I)):null;var j=xy(P,null,!0);return C(L,R),R=fO(R,O,j),L&&T(R,L),R.legacy=!0,R}function T(L,I){for(var R in I)fe(I,R)&&(L[R]=I[R])}function C(L,I){L&&(L.textFill&&(I.textFill=L.textFill),L.textPosition&&(I.textPosition=L.textPosition))}function A(L,I){if(I==null&&(I=u),fe(uO,L)){var R=e.getItemVisual(I,"style");return R?R[uO[L]]:null}if(fe(a_e,L))return e.getItemVisual(I,L)}function M(L){if(a.type==="cartesian2d"){var I=a.getBaseAxis();return wde(Ce({axis:I},L))}}function D(){return t.getCurrentSeriesIndices()}function E(L){return IC(L,t)}}function P_e(r){var e={};return k(r.dimensions,function(t){var n=r.getDimensionInfo(t);if(!n.isExtraCoord){var i=n.coordDim,a=e[i]=e[i]||[];a[n.coordDimIndex]=r.getDimensionIndex(t)}}),e}function px(r,e,t,n,i,a,o){if(!n){a.remove(e);return}var s=GA(r,e,t,n,i,a);return s&&o.setItemGraphicEl(t,s),s&&$t(s,n.focus,n.blurScope,n.emphasisDisabled),s}function GA(r,e,t,n,i,a){var o=-1,s=e;e&&s8(e,n,i)&&(o=He(a.childrenRef(),e),e=null);var l=!e,u=e;u?u.clearStates():(u=$A(n),s&&D_e(s,u)),n.morph===!1?u.disableMorphing=!0:u.disableMorphing&&(u.disableMorphing=!1),qn.normal.cfg=qn.normal.conOpt=qn.emphasis.cfg=qn.emphasis.conOpt=qn.blur.cfg=qn.blur.conOpt=qn.select.cfg=qn.select.conOpt=null,qn.isLegacy=!1,O_e(u,t,n,i,l,qn),R_e(u,t,n,i,l),HA(r,u,t,n,qn,i,l),fe(n,"info")&&(po(u).info=n.info);for(var c=0;c=0?a.replaceAt(u,o):a.add(u),u}function s8(r,e,t){var n=po(r),i=e.type,a=e.shape,o=e.style;return t.isUniversalTransitionEnabled()||i!=null&&i!==n.customGraphicType||i==="path"&&F_e(a)&&l8(a)!==n.customPathData||i==="image"&&fe(o,"image")&&o.image!==n.customImagePath}function R_e(r,e,t,n,i){var a=t.clipPath;if(a===!1)r&&r.getClipPath()&&r.removeClipPath();else if(a){var o=r.getClipPath();o&&s8(o,a,n)&&(o=null),o||(o=$A(a),r.setClipPath(o)),HA(null,o,e,a,null,n,i)}}function O_e(r,e,t,n,i,a){if(!r.isGroup){gO(t,null,a),gO(t,vo,a);var o=a.normal.conOpt,s=a.emphasis.conOpt,l=a.blur.conOpt,u=a.select.conOpt;if(o!=null||s!=null||u!=null||l!=null){var c=r.getTextContent();if(o===!1)c&&r.removeTextContent();else{o=a.normal.conOpt=o||{type:"text"},c?c.clearStates():(c=$A(o),r.setTextContent(c)),HA(null,c,e,o,null,n,i);for(var f=o&&o.style,h=0;h=c;d--){var p=e.childAt(d);N_e(e,p,i)}}}function N_e(r,e,t){e&&g1(e,po(r).option,t)}function B_e(r){new To(r.oldChildren,r.newChildren,yO,yO,r).add(bO).update(bO).remove(z_e).execute()}function yO(r,e){var t=r&&r.name;return t??M_e+e}function bO(r,e){var t=this.context,n=r!=null?t.newChildren[r]:null,i=e!=null?t.oldChildren[e]:null;GA(t.api,i,t.dataIndex,n,t.seriesModel,t.group)}function z_e(r){var e=this.context,t=e.oldChildren[r];t&&g1(t,po(t).option,e.seriesModel)}function l8(r){return r&&(r.pathData||r.d)}function F_e(r){return r&&(fe(r,"pathData")||fe(r,"d"))}function V_e(r){r.registerChartView(E_e),r.registerSeriesModel(o_e)}var Cl=it(),_O=ke,vx=ue,UA=function(){function r(){this._dragging=!1,this.animationThreshold=15}return r.prototype.render=function(e,t,n,i){var a=t.get("value"),o=t.get("status");if(this._axisModel=e,this._axisPointerModel=t,this._api=n,!(!i&&this._lastValue===a&&this._lastStatus===o)){this._lastValue=a,this._lastStatus=o;var s=this._group,l=this._handle;if(!o||o==="hide"){s&&s.hide(),l&&l.hide();return}s&&s.show(),l&&l.show();var u={};this.makeElOption(u,a,e,t,n);var c=u.graphicKey;c!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=c;var f=this._moveAnimation=this.determineAnimation(e,t);if(!s)s=this._group=new Ee,this.createPointerEl(s,u,e,t),this.createLabelEl(s,u,e,t),n.getZr().add(s);else{var h=Oe(xO,t,f);this.updatePointerEl(s,u,h),this.updateLabelEl(s,u,h,t)}SO(s,t,!0),this._renderHandle(a)}},r.prototype.remove=function(e){this.clear(e)},r.prototype.dispose=function(e){this.clear(e)},r.prototype.determineAnimation=function(e,t){var n=t.get("animation"),i=e.axis,a=i.type==="category",o=t.get("snap");if(!o&&!a)return!1;if(n==="auto"||n==null){var s=this.animationThreshold;if(a&&i.getBandWidth()>s)return!0;if(o){var l=pA(e).seriesDataCount,u=i.getExtent();return Math.abs(u[0]-u[1])/l>s}return!1}return n===!0},r.prototype.makeElOption=function(e,t,n,i,a){},r.prototype.createPointerEl=function(e,t,n,i){var a=t.pointer;if(a){var o=Cl(e).pointerEl=new Iu[a.type](_O(t.pointer));e.add(o)}},r.prototype.createLabelEl=function(e,t,n,i){if(t.label){var a=Cl(e).labelEl=new ot(_O(t.label));e.add(a),wO(a,i)}},r.prototype.updatePointerEl=function(e,t,n){var i=Cl(e).pointerEl;i&&t.pointer&&(i.setStyle(t.pointer.style),n(i,{shape:t.pointer.shape}))},r.prototype.updateLabelEl=function(e,t,n,i){var a=Cl(e).labelEl;a&&(a.setStyle(t.label.style),n(a,{x:t.label.x,y:t.label.y}),wO(a,i))},r.prototype._renderHandle=function(e){if(!(this._dragging||!this.updateHandleTransform)){var t=this._axisPointerModel,n=this._api.getZr(),i=this._handle,a=t.getModel("handle"),o=t.get("status");if(!a.get("show")||!o||o==="hide"){i&&n.remove(i),this._handle=null;return}var s;this._handle||(s=!0,i=this._handle=kp(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){_o(u.event)},onmousedown:vx(this._onHandleDragMove,this,0,0),drift:vx(this._onHandleDragMove,this),ondragend:vx(this._onHandleDragEnd,this)}),n.add(i)),SO(i,t,!1),i.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=a.get("size");q(l)||(l=[l,l]),i.scaleX=l[0]/2,i.scaleY=l[1]/2,Mf(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,s)}},r.prototype._moveHandleToValue=function(e,t){xO(this._axisPointerModel,!t&&this._moveAnimation,this._handle,mx(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},r.prototype._onHandleDragMove=function(e,t){var n=this._handle;if(n){this._dragging=!0;var i=this.updateHandleTransform(mx(n),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(mx(i)),Cl(n).lastProp=null,this._doDispatchAxisPointer()}},r.prototype._doDispatchAxisPointer=function(){var e=this._handle;if(e){var t=this._payloadInfo,n=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:n.axis.dim,axisIndex:n.componentIndex}]})}},r.prototype._onHandleDragEnd=function(){this._dragging=!1;var e=this._handle;if(e){var t=this._axisPointerModel.get("value");this._moveHandleToValue(t),this._api.dispatchAction({type:"hideTip"})}},r.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),n=this._group,i=this._handle;t&&n&&(this._lastGraphicKey=null,n&&t.remove(n),i&&t.remove(i),this._group=null,this._handle=null,this._payloadInfo=null),qd(this,"_doDispatchAxisPointer")},r.prototype.doClear=function(){},r.prototype.buildLabel=function(e,t,n){return n=n||0,{x:e[n],y:e[1-n],width:t[n],height:t[1-n]}},r}();function xO(r,e,t,n){u8(Cl(t).lastProp,n)||(Cl(t).lastProp=n,e?ut(t,n,r):(t.stopAnimation(),t.attr(n)))}function u8(r,e){if(Me(r)&&Me(e)){var t=!0;return k(e,function(n,i){t=t&&u8(r[i],n)}),!!t}else return r===e}function wO(r,e){r[e.get(["label","show"])?"show":"hide"]()}function mx(r){return{x:r.x||0,y:r.y||0,rotation:r.rotation||0}}function SO(r,e,t){var n=e.get("z"),i=e.get("zlevel");r&&r.traverse(function(a){a.type!=="group"&&(n!=null&&(a.z=n),i!=null&&(a.zlevel=i),a.silent=t)})}function YA(r){var e=r.get("type"),t=r.getModel(e+"Style"),n;return e==="line"?(n=t.getLineStyle(),n.fill=null):e==="shadow"&&(n=t.getAreaStyle(),n.stroke=null),n}function c8(r,e,t,n,i){var a=t.get("value"),o=f8(a,e.axis,e.ecModel,t.get("seriesDataIndices"),{precision:t.get(["label","precision"]),formatter:t.get(["label","formatter"])}),s=t.getModel("label"),l=Sf(s.get("padding")||0),u=s.getFont(),c=xp(o,u),f=i.position,h=c.width+l[1]+l[3],d=c.height+l[0]+l[2],p=i.align;p==="right"&&(f[0]-=h),p==="center"&&(f[0]-=h/2);var v=i.verticalAlign;v==="bottom"&&(f[1]-=d),v==="middle"&&(f[1]-=d/2),$_e(f,h,d,n);var m=s.get("backgroundColor");(!m||m==="auto")&&(m=e.get(["axisLine","lineStyle","color"])),r.label={x:f[0],y:f[1],style:Et(s,{text:o,font:u,fill:s.getTextColor(),padding:l,backgroundColor:m}),z2:10}}function $_e(r,e,t,n){var i=n.getWidth(),a=n.getHeight();r[0]=Math.min(r[0]+e,i)-e,r[1]=Math.min(r[1]+t,a)-t,r[0]=Math.max(r[0],0),r[1]=Math.max(r[1],0)}function f8(r,e,t,n,i){r=e.scale.parse(r);var a=e.scale.getLabel({value:r},{precision:i.precision}),o=i.formatter;if(o){var s={value:nA(e,{value:r}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};k(n,function(l){var u=t.getSeriesByIndex(l.seriesIndex),c=l.dataIndexInside,f=u&&u.getDataParams(c);f&&s.seriesData.push(f)}),se(o)?a=o.replace("{value}",a):Te(o)&&(a=o(s))}return a}function qA(r,e,t){var n=zn();return Eu(n,n,t.rotation),La(n,n,t.position),Ri([r.dataToCoord(e),(t.labelOffset||0)+(t.labelDirection||1)*(t.labelMargin||0)],n)}function h8(r,e,t,n,i,a){var o=hn.innerTextLayout(t.rotation,0,t.labelDirection);t.labelMargin=i.get(["label","margin"]),c8(e,n,i,a,{position:qA(n.axis,r,t),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function XA(r,e,t){return t=t||0,{x1:r[t],y1:r[1-t],x2:e[t],y2:e[1-t]}}function d8(r,e,t){return t=t||0,{x:r[t],y:r[1-t],width:e[t],height:e[1-t]}}function TO(r,e,t,n,i,a){return{cx:r,cy:e,r0:t,r:n,startAngle:i,endAngle:a,clockwise:!0}}var H_e=function(r){z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.makeElOption=function(t,n,i,a,o){var s=i.axis,l=s.grid,u=a.get("type"),c=CO(l,s).getOtherAxis(s).getGlobalExtent(),f=s.toGlobalCoord(s.dataToCoord(n,!0));if(u&&u!=="none"){var h=YA(a),d=G_e[u](s,f,c);d.style=h,t.graphicKey=d.type,t.pointer=d}var p=X2(l.model,i);h8(n,t,p,i,a,o)},e.prototype.getHandleTransform=function(t,n,i){var a=X2(n.axis.grid.model,n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=qA(n.axis,t,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,n,i,a){var o=i.axis,s=o.grid,l=o.getGlobalExtent(!0),u=CO(s,o).getOtherAxis(o).getGlobalExtent(),c=o.dim==="x"?0:1,f=[t.x,t.y];f[c]+=n[c],f[c]=Math.min(l[1],f[c]),f[c]=Math.max(l[0],f[c]);var h=(u[1]+u[0])/2,d=[h,h];d[c]=f[c];var p=[{verticalAlign:"middle"},{align:"center"}];return{x:f[0],y:f[1],rotation:t.rotation,cursorPoint:d,tooltipOption:p[c]}},e}(UA);function CO(r,e){var t={};return t[e.dim+"AxisIndex"]=e.index,r.getCartesian(t)}var G_e={line:function(r,e,t){var n=XA([e,t[0]],[e,t[1]],AO(r));return{type:"Line",subPixelOptimize:!0,shape:n}},shadow:function(r,e,t){var n=Math.max(1,r.getBandWidth()),i=t[1]-t[0];return{type:"Rect",shape:d8([e-n/2,t[0]],[n,i],AO(r))}}};function AO(r){return r.dim==="x"?0:1}var W_e=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="axisPointer",e.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},e}(Qe),oo=it(),U_e=k;function p8(r,e,t){if(!Ze.node){var n=e.getZr();oo(n).records||(oo(n).records={}),Y_e(n,e);var i=oo(n).records[r]||(oo(n).records[r]={});i.handler=t}}function Y_e(r,e){if(oo(r).initialized)return;oo(r).initialized=!0,t("click",Oe(MO,"click")),t("mousemove",Oe(MO,"mousemove")),t("globalout",X_e);function t(n,i){r.on(n,function(a){var o=K_e(e);U_e(oo(r).records,function(s){s&&i(s,a,o.dispatchAction)}),q_e(o.pendings,e)})}}function q_e(r,e){var t=r.showTip.length,n=r.hideTip.length,i;t?i=r.showTip[t-1]:n&&(i=r.hideTip[n-1]),i&&(i.dispatchAction=null,e.dispatchAction(i))}function X_e(r,e,t){r.handler("leave",null,t)}function MO(r,e,t,n){e.handler(r,t,n)}function K_e(r){var e={showTip:[],hideTip:[]},t=function(n){var i=e[n.type];i?i.push(n):(n.dispatchAction=t,r.dispatchAction(n))};return{dispatchAction:t,pendings:e}}function mS(r,e){if(!Ze.node){var t=e.getZr(),n=(oo(t).records||{})[r];n&&(oo(t).records[r]=null)}}var Z_e=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,n,i){var a=n.getComponent("tooltip"),o=t.get("triggerOn")||a&&a.get("triggerOn")||"mousemove|click";p8("axisPointer",i,function(s,l,u){o!=="none"&&(s==="leave"||o.indexOf(s)>=0)&&u({type:"updateAxisPointer",currTrigger:s,x:l&&l.offsetX,y:l&&l.offsetY})})},e.prototype.remove=function(t,n){mS("axisPointer",n)},e.prototype.dispose=function(t,n){mS("axisPointer",n)},e.type="axisPointer",e}(zt);function v8(r,e){var t=[],n=r.seriesIndex,i;if(n==null||!(i=e.getSeriesByIndex(n)))return{point:[]};var a=i.getData(),o=vu(a,r);if(o==null||o<0||q(o))return{point:[]};var s=a.getItemGraphicEl(o),l=i.coordinateSystem;if(i.getTooltipPosition)t=i.getTooltipPosition(o)||[];else if(l&&l.dataToPoint)if(r.isStacked){var u=l.getBaseAxis(),c=l.getOtherAxis(u),f=c.dim,h=u.dim,d=f==="x"||f==="radius"?1:0,p=a.mapDimension(h),v=[];v[d]=a.get(p,o),v[1-d]=a.get(a.getCalculationInfo("stackResultDimension"),o),t=l.dataToPoint(v)||[]}else t=l.dataToPoint(a.getValues(K(l.dimensions,function(g){return a.mapDimension(g)}),o))||[];else if(s){var m=s.getBoundingRect().clone();m.applyTransform(s.transform),t=[m.x+m.width/2,m.y+m.height/2]}return{point:t,el:s}}var kO=it();function J_e(r,e,t){var n=r.currTrigger,i=[r.x,r.y],a=r,o=r.dispatchAction||ue(t.dispatchAction,t),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){Jm(i)&&(i=v8({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},e).point);var l=Jm(i),u=a.axesInfo,c=s.axesInfo,f=n==="leave"||Jm(i),h={},d={},p={list:[],map:{}},v={showPointer:Oe(exe,d),showTooltip:Oe(txe,p)};k(s.coordSysMap,function(g,y){var b=l||g.containPoint(i);k(s.coordSysAxesInfo[y],function(_,x){var w=_.axis,S=axe(u,_);if(!f&&b&&(!u||S)){var T=S&&S.value;T==null&&!l&&(T=w.pointToData(i)),T!=null&&DO(_,T,v,!1,h)}})});var m={};return k(c,function(g,y){var b=g.linkGroup;b&&!d[y]&&k(b.axesInfo,function(_,x){var w=d[x];if(_!==g&&w){var S=w.value;b.mapper&&(S=g.axis.scale.parse(b.mapper(S,EO(_),EO(g)))),m[g.key]=S}})}),k(m,function(g,y){DO(c[y],g,v,!0,h)}),rxe(d,c,h),nxe(p,i,r,o),ixe(c,o,t),h}}function DO(r,e,t,n,i){var a=r.axis;if(!(a.scale.isBlank()||!a.containData(e))){if(!r.involveSeries){t.showPointer(r,e);return}var o=Q_e(e,r),s=o.payloadBatch,l=o.snapToValue;s[0]&&i.seriesIndex==null&&W(i,s[0]),!n&&r.snap&&a.containData(l)&&l!=null&&(e=l),t.showPointer(r,e,s),t.showTooltip(r,o,l)}}function Q_e(r,e){var t=e.axis,n=t.dim,i=r,a=[],o=Number.MAX_VALUE,s=-1;return k(e.seriesModels,function(l,u){var c=l.getData().mapDimensionsAll(n),f,h;if(l.getAxisTooltipData){var d=l.getAxisTooltipData(c,r,t);h=d.dataIndices,f=d.nestestValue}else{if(h=l.getData().indicesOfNearest(c[0],r,t.type==="category"?.5:null),!h.length)return;f=l.getData().get(c[0],h[0])}if(!(f==null||!isFinite(f))){var p=r-f,v=Math.abs(p);v<=o&&((v=0&&s<0)&&(o=v,s=p,i=f,a.length=0),k(h,function(m){a.push({seriesIndex:l.seriesIndex,dataIndexInside:m,dataIndex:l.getData().getRawIndex(m)})}))}}),{payloadBatch:a,snapToValue:i}}function exe(r,e,t,n){r[e.key]={value:t,payloadBatch:n}}function txe(r,e,t,n){var i=t.payloadBatch,a=e.axis,o=a.model,s=e.axisPointerModel;if(!(!e.triggerTooltip||!i.length)){var l=e.coordSys.model,u=tp(l),c=r.map[u];c||(c=r.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},r.list.push(c)),c.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:n,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:i.slice()})}}function rxe(r,e,t){var n=t.axesInfo=[];k(e,function(i,a){var o=i.axisPointerModel.option,s=r[a];s?(!i.useHandle&&(o.status="show"),o.value=s.value,o.seriesDataIndices=(s.payloadBatch||[]).slice()):!i.useHandle&&(o.status="hide"),o.status==="show"&&n.push({axisDim:i.axis.dim,axisIndex:i.axis.model.componentIndex,value:o.value})})}function nxe(r,e,t,n){if(Jm(e)||!r.list.length){n({type:"hideTip"});return}var i=((r.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};n({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:t.tooltipOption,position:t.position,dataIndexInside:i.dataIndexInside,dataIndex:i.dataIndex,seriesIndex:i.seriesIndex,dataByCoordSys:r.list})}function ixe(r,e,t){var n=t.getZr(),i="axisPointerLastHighlights",a=kO(n)[i]||{},o=kO(n)[i]={};k(r,function(u,c){var f=u.axisPointerModel.option;f.status==="show"&&u.triggerEmphasis&&k(f.seriesDataIndices,function(h){var d=h.seriesIndex+" | "+h.dataIndex;o[d]=h})});var s=[],l=[];k(a,function(u,c){!o[c]&&l.push(u)}),k(o,function(u,c){!a[c]&&s.push(u)}),l.length&&t.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&t.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function axe(r,e){for(var t=0;t<(r||[]).length;t++){var n=r[t];if(e.axis.dim===n.axisDim&&e.axis.model.componentIndex===n.axisIndex)return n}}function EO(r){var e=r.axis.model,t={},n=t.axisDim=r.axis.dim;return t.axisIndex=t[n+"AxisIndex"]=e.componentIndex,t.axisName=t[n+"AxisName"]=e.name,t.axisId=t[n+"AxisId"]=e.id,t}function Jm(r){return!r||r[0]==null||isNaN(r[0])||r[1]==null||isNaN(r[1])}function Vp(r){ju.registerAxisPointerClass("CartesianAxisPointer",H_e),r.registerComponentModel(W_e),r.registerComponentView(Z_e),r.registerPreprocessor(function(e){if(e){(!e.axisPointer||e.axisPointer.length===0)&&(e.axisPointer={});var t=e.axisPointer.link;t&&!q(t)&&(e.axisPointer.link=[t])}}),r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC,function(e,t){e.getComponent("axisPointer").coordSysAxesInfo=vme(e,t)}),r.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},J_e)}function oxe(r){Ue(HV),Ue(Vp)}var sxe=function(r){z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.makeElOption=function(t,n,i,a,o){var s=i.axis;s.dim==="angle"&&(this.animationThreshold=Math.PI/18);var l=s.polar,u=l.getOtherAxis(s),c=u.getExtent(),f=s.dataToCoord(n),h=a.get("type");if(h&&h!=="none"){var d=YA(a),p=uxe[h](s,l,f,c);p.style=d,t.graphicKey=p.type,t.pointer=p}var v=a.get(["label","margin"]),m=lxe(n,i,a,l,v);c8(t,i,a,o,m)},e}(UA);function lxe(r,e,t,n,i){var a=e.axis,o=a.dataToCoord(r),s=n.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l=n.getRadiusAxis().getExtent(),u,c,f;if(a.dim==="radius"){var h=zn();Eu(h,h,s),La(h,h,[n.cx,n.cy]),u=Ri([o,-i],h);var d=e.getModel("axisLabel").get("rotate")||0,p=hn.innerTextLayout(s,d*Math.PI/180,-1);c=p.textAlign,f=p.textVerticalAlign}else{var v=l[1];u=n.coordToPoint([v+i,o]);var m=n.cx,g=n.cy;c=Math.abs(u[0]-m)/v<.3?"center":u[0]>m?"left":"right",f=Math.abs(u[1]-g)/v<.3?"middle":u[1]>g?"top":"bottom"}return{position:u,align:c,verticalAlign:f}}var uxe={line:function(r,e,t,n){return r.dim==="angle"?{type:"Line",shape:XA(e.coordToPoint([n[0],t]),e.coordToPoint([n[1],t]))}:{type:"Circle",shape:{cx:e.cx,cy:e.cy,r:t}}},shadow:function(r,e,t,n){var i=Math.max(1,r.getBandWidth()),a=Math.PI/180;return r.dim==="angle"?{type:"Sector",shape:TO(e.cx,e.cy,n[0],n[1],(-t-i/2)*a,(-t+i/2)*a)}:{type:"Sector",shape:TO(e.cx,e.cy,t-i/2,t+i/2,0,Math.PI*2)}}},cxe=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.findAxisModel=function(t){var n,i=this.ecModel;return i.eachComponent(t,function(a){a.getCoordSysModel()===this&&(n=a)},this),n},e.type="polar",e.dependencies=["radiusAxis","angleAxis"],e.defaultOption={z:0,center:["50%","50%"],radius:"80%"},e}(Qe),KA=function(r){z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",lr).models[0]},e.type="polarAxis",e}(Qe);cr(KA,Ip);var fxe=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="angleAxis",e}(KA),hxe=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="radiusAxis",e}(KA),ZA=function(r){z(e,r);function e(t,n){return r.call(this,"radius",t,n)||this}return e.prototype.pointToData=function(t,n){return this.polar.pointToData(t,n)[this.dim==="radius"?0:1]},e}(Gi);ZA.prototype.dataToRadius=Gi.prototype.dataToCoord;ZA.prototype.radiusToData=Gi.prototype.coordToData;var dxe=it(),JA=function(r){z(e,r);function e(t,n){return r.call(this,"angle",t,n||[0,360])||this}return e.prototype.pointToData=function(t,n){return this.polar.pointToData(t,n)[this.dim==="radius"?0:1]},e.prototype.calculateCategoryInterval=function(){var t=this,n=t.getLabelModel(),i=t.scale,a=i.getExtent(),o=i.count();if(a[1]-a[0]<1)return 0;var s=a[0],l=t.dataToCoord(s+1)-t.dataToCoord(s),u=Math.abs(l),c=xp(s==null?"":s+"",n.getFont(),"center","top"),f=Math.max(c.height,7),h=f/u;isNaN(h)&&(h=1/0);var d=Math.max(0,Math.floor(h)),p=dxe(t.model),v=p.lastAutoInterval,m=p.lastTickCount;return v!=null&&m!=null&&Math.abs(v-d)<=1&&Math.abs(m-o)<=1&&v>d?d=v:(p.lastTickCount=o,p.lastAutoInterval=d),d},e}(Gi);JA.prototype.dataToAngle=Gi.prototype.dataToCoord;JA.prototype.angleToData=Gi.prototype.coordToData;var m8=["radius","angle"],pxe=function(){function r(e){this.dimensions=m8,this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new ZA,this._angleAxis=new JA,this.axisPointerEnabled=!0,this.name=e||"",this._radiusAxis.polar=this._angleAxis.polar=this}return r.prototype.containPoint=function(e){var t=this.pointToCoord(e);return this._radiusAxis.contain(t[0])&&this._angleAxis.contain(t[1])},r.prototype.containData=function(e){return this._radiusAxis.containData(e[0])&&this._angleAxis.containData(e[1])},r.prototype.getAxis=function(e){var t="_"+e+"Axis";return this[t]},r.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},r.prototype.getAxesByScale=function(e){var t=[],n=this._angleAxis,i=this._radiusAxis;return n.scale.type===e&&t.push(n),i.scale.type===e&&t.push(i),t},r.prototype.getAngleAxis=function(){return this._angleAxis},r.prototype.getRadiusAxis=function(){return this._radiusAxis},r.prototype.getOtherAxis=function(e){var t=this._angleAxis;return e===t?this._radiusAxis:t},r.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},r.prototype.getTooltipAxes=function(e){var t=e!=null&&e!=="auto"?this.getAxis(e):this.getBaseAxis();return{baseAxes:[t],otherAxes:[this.getOtherAxis(t)]}},r.prototype.dataToPoint=function(e,t){return this.coordToPoint([this._radiusAxis.dataToRadius(e[0],t),this._angleAxis.dataToAngle(e[1],t)])},r.prototype.pointToData=function(e,t){var n=this.pointToCoord(e);return[this._radiusAxis.radiusToData(n[0],t),this._angleAxis.angleToData(n[1],t)]},r.prototype.pointToCoord=function(e){var t=e[0]-this.cx,n=e[1]-this.cy,i=this.getAngleAxis(),a=i.getExtent(),o=Math.min(a[0],a[1]),s=Math.max(a[0],a[1]);i.inverse?o=s-360:s=o+360;var l=Math.sqrt(t*t+n*n);t/=l,n/=l;for(var u=Math.atan2(-n,t)/Math.PI*180,c=us;)u+=c*360;return[l,u]},r.prototype.coordToPoint=function(e){var t=e[0],n=e[1]/180*Math.PI,i=Math.cos(n)*t+this.cx,a=-Math.sin(n)*t+this.cy;return[i,a]},r.prototype.getArea=function(){var e=this.getAngleAxis(),t=this.getRadiusAxis(),n=t.getExtent().slice();n[0]>n[1]&&n.reverse();var i=e.getExtent(),a=Math.PI/180,o=1e-4;return{cx:this.cx,cy:this.cy,r0:n[0],r:n[1],startAngle:-i[0]*a,endAngle:-i[1]*a,clockwise:e.inverse,contain:function(s,l){var u=s-this.cx,c=l-this.cy,f=u*u+c*c,h=this.r,d=this.r0;return h!==d&&f-o<=h*h&&f+o>=d*d}}},r.prototype.convertToPixel=function(e,t,n){var i=LO(t);return i===this?this.dataToPoint(n):null},r.prototype.convertFromPixel=function(e,t,n){var i=LO(t);return i===this?this.pointToData(n):null},r}();function LO(r){var e=r.seriesModel,t=r.polarModel;return t&&t.coordinateSystem||e&&e.coordinateSystem}function vxe(r,e,t){var n=e.get("center"),i=t.getWidth(),a=t.getHeight();r.cx=ie(n[0],i),r.cy=ie(n[1],a);var o=r.getRadiusAxis(),s=Math.min(i,a)/2,l=e.get("radius");l==null?l=[0,"100%"]:q(l)||(l=[0,l]);var u=[ie(l[0],s),ie(l[1],s)];o.inverse?o.setExtent(u[1],u[0]):o.setExtent(u[0],u[1])}function mxe(r,e){var t=this,n=t.getAngleAxis(),i=t.getRadiusAxis();if(n.scale.setExtent(1/0,-1/0),i.scale.setExtent(1/0,-1/0),r.eachSeries(function(s){if(s.coordinateSystem===t){var l=s.getData();k(Py(l,"radius"),function(u){i.scale.unionExtentFromData(l,u)}),k(Py(l,"angle"),function(u){n.scale.unionExtentFromData(l,u)})}}),nf(n.scale,n.model),nf(i.scale,i.model),n.type==="category"&&!n.onBand){var a=n.getExtent(),o=360/n.scale.count();n.inverse?a[1]+=o:a[1]-=o,n.setExtent(a[0],a[1])}}function gxe(r){return r.mainType==="angleAxis"}function IO(r,e){var t;if(r.type=e.get("type"),r.scale=c1(e),r.onBand=e.get("boundaryGap")&&r.type==="category",r.inverse=e.get("inverse"),gxe(e)){r.inverse=r.inverse!==e.get("clockwise");var n=e.get("startAngle"),i=(t=e.get("endAngle"))!==null&&t!==void 0?t:n+(r.inverse?-360:360);r.setExtent(n,i)}e.axis=r,r.model=e}var yxe={dimensions:m8,create:function(r,e){var t=[];return r.eachComponent("polar",function(n,i){var a=new pxe(i+"");a.update=mxe;var o=a.getRadiusAxis(),s=a.getAngleAxis(),l=n.findAxisModel("radiusAxis"),u=n.findAxisModel("angleAxis");IO(o,l),IO(s,u),vxe(a,n,e),t.push(a),n.coordinateSystem=a,a.model=n}),r.eachSeries(function(n){if(n.get("coordinateSystem")==="polar"){var i=n.getReferringComponents("polar",lr).models[0];n.coordinateSystem=i.coordinateSystem}}),t}},bxe=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function lm(r,e,t){e[1]>e[0]&&(e=e.slice().reverse());var n=r.coordToPoint([e[0],t]),i=r.coordToPoint([e[1],t]);return{x1:n[0],y1:n[1],x2:i[0],y2:i[1]}}function um(r){var e=r.getRadiusAxis();return e.inverse?0:1}function PO(r){var e=r[0],t=r[r.length-1];e&&t&&Math.abs(Math.abs(e.coord-t.coord)-360)<1e-4&&r.pop()}var _xe=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.axisPointerClass="PolarAxisPointer",t}return e.prototype.render=function(t,n){if(this.group.removeAll(),!!t.get("show")){var i=t.axis,a=i.polar,o=a.getRadiusAxis().getExtent(),s=i.getTicksCoords(),l=i.getMinorTicksCoords(),u=K(i.getViewLabels(),function(c){c=ke(c);var f=i.scale,h=f.type==="ordinal"?f.getRawOrdinalNumber(c.tickValue):c.tickValue;return c.coord=i.dataToCoord(h),c});PO(u),PO(s),k(bxe,function(c){t.get([c,"show"])&&(!i.scale.isBlank()||c==="axisLine")&&xxe[c](this.group,t,a,s,l,o,u)},this)}},e.type="angleAxis",e}(ju),xxe={axisLine:function(r,e,t,n,i,a){var o=e.getModel(["axisLine","lineStyle"]),s=t.getAngleAxis(),l=Math.PI/180,u=s.getExtent(),c=um(t),f=c?0:1,h,d=Math.abs(u[1]-u[0])===360?"Circle":"Arc";a[f]===0?h=new Iu[d]({shape:{cx:t.cx,cy:t.cy,r:a[c],startAngle:-u[0]*l,endAngle:-u[1]*l,clockwise:s.inverse},style:o.getLineStyle(),z2:1,silent:!0}):h=new Tp({shape:{cx:t.cx,cy:t.cy,r:a[c],r0:a[f]},style:o.getLineStyle(),z2:1,silent:!0}),h.style.fill=null,r.add(h)},axisTick:function(r,e,t,n,i,a){var o=e.getModel("axisTick"),s=(o.get("inside")?-1:1)*o.get("length"),l=a[um(t)],u=K(n,function(c){return new xr({shape:lm(t,[l,l+s],c.coord)})});r.add(si(u,{style:Ce(o.getModel("lineStyle").getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])})}))},minorTick:function(r,e,t,n,i,a){if(i.length){for(var o=e.getModel("axisTick"),s=e.getModel("minorTick"),l=(o.get("inside")?-1:1)*s.get("length"),u=a[um(t)],c=[],f=0;fg?"left":"right",_=Math.abs(m[1]-y)/v<.3?"middle":m[1]>y?"top":"bottom";if(s&&s[p]){var x=s[p];Me(x)&&x.textStyle&&(d=new _t(x.textStyle,l,l.ecModel))}var w=new ot({silent:hn.isLabelSilent(e),style:Et(d,{x:m[0],y:m[1],fill:d.getTextColor()||e.get(["axisLine","lineStyle","color"]),text:f.formattedLabel,align:b,verticalAlign:_})});if(r.add(w),c){var S=hn.makeAxisEventDataBase(e);S.targetType="axisLabel",S.value=f.rawLabel,Le(w).eventData=S}},this)},splitLine:function(r,e,t,n,i,a){var o=e.getModel("splitLine"),s=o.getModel("lineStyle"),l=s.get("color"),u=0;l=l instanceof Array?l:[l];for(var c=[],f=0;f=0?"p":"n",I=C;x&&(n[c][E]||(n[c][E]={p:C,n:C}),I=n[c][E][L]);var R=void 0,P=void 0,O=void 0,j=void 0;if(p.dim==="radius"){var F=p.dataToCoord(D)-C,N=l.dataToCoord(E);Math.abs(F)=j})}}})}function kxe(r){var e={};k(r,function(n,i){var a=n.getData(),o=n.coordinateSystem,s=o.getBaseAxis(),l=y8(o,s),u=s.getExtent(),c=s.type==="category"?s.getBandWidth():Math.abs(u[1]-u[0])/a.count(),f=e[l]||{bandWidth:c,remainedWidth:c,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},h=f.stacks;e[l]=f;var d=g8(n);h[d]||f.autoWidthCount++,h[d]=h[d]||{width:0,maxWidth:0};var p=ie(n.get("barWidth"),c),v=ie(n.get("barMaxWidth"),c),m=n.get("barGap"),g=n.get("barCategoryGap");p&&!h[d].width&&(p=Math.min(f.remainedWidth,p),h[d].width=p,f.remainedWidth-=p),v&&(h[d].maxWidth=v),m!=null&&(f.gap=m),g!=null&&(f.categoryGap=g)});var t={};return k(e,function(n,i){t[i]={};var a=n.stacks,o=n.bandWidth,s=ie(n.categoryGap,o),l=ie(n.gap,1),u=n.remainedWidth,c=n.autoWidthCount,f=(u-s)/(c+(c-1)*l);f=Math.max(f,0),k(a,function(v,m){var g=v.maxWidth;g&&g=t.y&&e[1]<=t.y+t.height:n.contain(n.toLocalCoord(e[1]))&&e[0]>=t.y&&e[0]<=t.y+t.height},r.prototype.pointToData=function(e){var t=this.getAxis();return[t.coordToData(t.toLocalCoord(e[t.orient==="horizontal"?0:1]))]},r.prototype.dataToPoint=function(e){var t=this.getAxis(),n=this.getRect(),i=[],a=t.orient==="horizontal"?0:1;return e instanceof Array&&(e=e[0]),i[a]=t.toGlobalCoord(t.dataToCoord(+e)),i[1-a]=a===0?n.y+n.height/2:n.x+n.width/2,i},r.prototype.convertToPixel=function(e,t,n){var i=RO(t);return i===this?this.dataToPoint(n):null},r.prototype.convertFromPixel=function(e,t,n){var i=RO(t);return i===this?this.pointToData(n):null},r}();function RO(r){var e=r.seriesModel,t=r.singleAxisModel;return t&&t.coordinateSystem||e&&e.coordinateSystem}function zxe(r,e){var t=[];return r.eachComponent("singleAxis",function(n,i){var a=new Bxe(n,r,e);a.name="single_"+i,a.resize(n,e),n.coordinateSystem=a,t.push(a)}),r.eachSeries(function(n){if(n.get("coordinateSystem")==="singleAxis"){var i=n.getReferringComponents("singleAxis",lr).models[0];n.coordinateSystem=i&&i.coordinateSystem}}),t}var Fxe={create:zxe,dimensions:b8},OO=["x","y"],Vxe=["width","height"],$xe=function(r){z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.makeElOption=function(t,n,i,a,o){var s=i.axis,l=s.coordinateSystem,u=gx(l,1-Yy(s)),c=l.dataToPoint(n)[0],f=a.get("type");if(f&&f!=="none"){var h=YA(a),d=Hxe[f](s,c,u);d.style=h,t.graphicKey=d.type,t.pointer=d}var p=gS(i);h8(n,t,p,i,a,o)},e.prototype.getHandleTransform=function(t,n,i){var a=gS(n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=qA(n.axis,t,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,n,i,a){var o=i.axis,s=o.coordinateSystem,l=Yy(o),u=gx(s,l),c=[t.x,t.y];c[l]+=n[l],c[l]=Math.min(u[1],c[l]),c[l]=Math.max(u[0],c[l]);var f=gx(s,1-l),h=(f[1]+f[0])/2,d=[h,h];return d[l]=c[l],{x:c[0],y:c[1],rotation:t.rotation,cursorPoint:d,tooltipOption:{verticalAlign:"middle"}}},e}(UA),Hxe={line:function(r,e,t){var n=XA([e,t[0]],[e,t[1]],Yy(r));return{type:"Line",subPixelOptimize:!0,shape:n}},shadow:function(r,e,t){var n=r.getBandWidth(),i=t[1]-t[0];return{type:"Rect",shape:d8([e-n/2,t[0]],[n,i],Yy(r))}}};function Yy(r){return r.isHorizontal()?0:1}function gx(r,e){var t=r.getRect();return[t[OO[e]],t[OO[e]]+t[Vxe[e]]]}var Gxe=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="single",e}(zt);function Wxe(r){Ue(Vp),ju.registerAxisPointerClass("SingleAxisPointer",$xe),r.registerComponentView(Gxe),r.registerComponentView(Oxe),r.registerComponentModel(Qm),of(r,"single",Qm,Qm.defaultOption),r.registerCoordinateSystem("single",Fxe)}var Uxe=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,n,i){var a=Tf(t);r.prototype.init.apply(this,arguments),jO(t,a)},e.prototype.mergeOption=function(t){r.prototype.mergeOption.apply(this,arguments),jO(this.option,t)},e.prototype.getCellSize=function(){return this.option.cellSize},e.type="calendar",e.defaultOption={z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},e}(Qe);function jO(r,e){var t=r.cellSize,n;q(t)?n=t:n=r.cellSize=[t,t],n.length===1&&(n[1]=n[0]);var i=K([0,1],function(a){return pce(e,a)&&(n[a]="auto"),n[a]!=null&&n[a]!=="auto"});Ls(r,e,{type:"box",ignoreSize:i})}var Yxe=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,n,i){var a=this.group;a.removeAll();var o=t.coordinateSystem,s=o.getRangeInfo(),l=o.getOrient(),u=n.getLocaleModel();this._renderDayRect(t,s,a),this._renderLines(t,s,l,a),this._renderYearText(t,s,l,a),this._renderMonthText(t,u,l,a),this._renderWeekText(t,u,s,l,a)},e.prototype._renderDayRect=function(t,n,i){for(var a=t.coordinateSystem,o=t.getModel("itemStyle").getItemStyle(),s=a.getCellWidth(),l=a.getCellHeight(),u=n.start.time;u<=n.end.time;u=a.getNextNDay(u,1).time){var c=a.dataToRect([u],!1).tl,f=new nt({shape:{x:c[0],y:c[1],width:s,height:l},cursor:"default",style:o});i.add(f)}},e.prototype._renderLines=function(t,n,i,a){var o=this,s=t.coordinateSystem,l=t.getModel(["splitLine","lineStyle"]).getLineStyle(),u=t.get(["splitLine","show"]),c=l.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var f=n.start,h=0;f.time<=n.end.time;h++){p(f.formatedDate),h===0&&(f=s.getDateInfo(n.start.y+"-"+n.start.m));var d=f.date;d.setMonth(d.getMonth()+1),f=s.getDateInfo(d)}p(s.getNextNDay(n.end.time,1).formatedDate);function p(v){o._firstDayOfMonth.push(s.getDateInfo(v)),o._firstDayPoints.push(s.dataToRect([v],!1).tl);var m=o._getLinePointsOfOneWeek(t,v,i);o._tlpoints.push(m[0]),o._blpoints.push(m[m.length-1]),u&&o._drawSplitline(m,l,a)}u&&this._drawSplitline(o._getEdgesPoints(o._tlpoints,c,i),l,a),u&&this._drawSplitline(o._getEdgesPoints(o._blpoints,c,i),l,a)},e.prototype._getEdgesPoints=function(t,n,i){var a=[t[0].slice(),t[t.length-1].slice()],o=i==="horizontal"?0:1;return a[0][o]=a[0][o]-n/2,a[1][o]=a[1][o]+n/2,a},e.prototype._drawSplitline=function(t,n,i){var a=new bn({z2:20,shape:{points:t},style:n});i.add(a)},e.prototype._getLinePointsOfOneWeek=function(t,n,i){for(var a=t.coordinateSystem,o=a.getDateInfo(n),s=[],l=0;l<7;l++){var u=a.getNextNDay(o.time,l),c=a.dataToRect([u.time],!1);s[2*u.day]=c.tl,s[2*u.day+1]=c[i==="horizontal"?"bl":"tr"]}return s},e.prototype._formatterLabel=function(t,n){return se(t)&&t?fce(t,n):Te(t)?t(n):n.nameMap},e.prototype._yearTextPositionControl=function(t,n,i,a,o){var s=n[0],l=n[1],u=["center","bottom"];a==="bottom"?(l+=o,u=["center","top"]):a==="left"?s-=o:a==="right"?(s+=o,u=["center","top"]):l-=o;var c=0;return(a==="left"||a==="right")&&(c=Math.PI/2),{rotation:c,x:s,y:l,style:{align:u[0],verticalAlign:u[1]}}},e.prototype._renderYearText=function(t,n,i,a){var o=t.getModel("yearLabel");if(o.get("show")){var s=o.get("margin"),l=o.get("position");l||(l=i!=="horizontal"?"top":"left");var u=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],c=(u[0][0]+u[1][0])/2,f=(u[0][1]+u[1][1])/2,h=i==="horizontal"?0:1,d={top:[c,u[h][1]],bottom:[c,u[1-h][1]],left:[u[1-h][0],f],right:[u[h][0],f]},p=n.start.y;+n.end.y>+n.start.y&&(p=p+"-"+n.end.y);var v=o.get("formatter"),m={start:n.start.y,end:n.end.y,nameMap:p},g=this._formatterLabel(v,m),y=new ot({z2:30,style:Et(o,{text:g}),silent:o.get("silent")});y.attr(this._yearTextPositionControl(y,d[l],i,l,s)),a.add(y)}},e.prototype._monthTextPositionControl=function(t,n,i,a,o){var s="left",l="top",u=t[0],c=t[1];return i==="horizontal"?(c=c+o,n&&(s="center"),a==="start"&&(l="bottom")):(u=u+o,n&&(l="middle"),a==="start"&&(s="right")),{x:u,y:c,align:s,verticalAlign:l}},e.prototype._renderMonthText=function(t,n,i,a){var o=t.getModel("monthLabel");if(o.get("show")){var s=o.get("nameMap"),l=o.get("margin"),u=o.get("position"),c=o.get("align"),f=[this._tlpoints,this._blpoints];(!s||se(s))&&(s&&(n=C2(s)||n),s=n.get(["time","monthAbbr"])||[]);var h=u==="start"?0:1,d=i==="horizontal"?0:1;l=u==="start"?-l:l;for(var p=c==="center",v=o.get("silent"),m=0;m=i.start.time&&n.times.end.time&&t.reverse(),t},r.prototype._getRangeInfo=function(e){var t=[this.getDateInfo(e[0]),this.getDateInfo(e[1])],n;t[0].time>t[1].time&&(n=!0,t.reverse());var i=Math.floor(t[1].time/yx)-Math.floor(t[0].time/yx)+1,a=new Date(t[0].time),o=a.getDate(),s=t[1].date.getDate();a.setDate(o+i-1);var l=a.getDate();if(l!==s)for(var u=a.getTime()-t[1].time>0?1:-1;(l=a.getDate())!==s&&(a.getTime()-t[1].time)*u>0;)i-=u,a.setDate(l-u);var c=Math.floor((i+t[0].day+6)/7),f=n?-c+1:c-1;return n&&t.reverse(),{range:[t[0].formatedDate,t[1].formatedDate],start:t[0],end:t[1],allDay:i,weeks:c,nthWeek:f,fweek:t[0].day,lweek:t[1].day}},r.prototype._getDateByWeeksAndDay=function(e,t,n){var i=this._getRangeInfo(n);if(e>i.weeks||e===0&&ti.lweek)return null;var a=(e-1)*7-i.fweek+t,o=new Date(i.start.time);return o.setDate(+i.start.d+a),this.getDateInfo(o)},r.create=function(e,t){var n=[];return e.eachComponent("calendar",function(i){var a=new r(i);n.push(a),i.coordinateSystem=a}),e.eachSeries(function(i){i.get("coordinateSystem")==="calendar"&&(i.coordinateSystem=n[i.get("calendarIndex")||0])}),n},r.dimensions=["time","value"],r}();function NO(r){var e=r.calendarModel,t=r.seriesModel,n=e?e.coordinateSystem:t?t.coordinateSystem:null;return n}function Xxe(r){r.registerComponentModel(Uxe),r.registerComponentView(Yxe),r.registerCoordinateSystem("calendar",qxe)}function Kxe(r,e){var t=r.existing;if(e.id=r.keyInfo.id,!e.type&&t&&(e.type=t.type),e.parentId==null){var n=e.parentOption;n?e.parentId=n.id:t&&(e.parentId=t.parentId)}e.parentOption=null}function BO(r,e){var t;return k(e,function(n){r[n]!=null&&r[n]!=="auto"&&(t=!0)}),t}function Zxe(r,e,t){var n=W({},t),i=r[e],a=t.$action||"merge";a==="merge"?i?(Be(i,n,!0),Ls(i,n,{ignoreSize:!0}),d6(t,i),cm(t,i),cm(t,i,"shape"),cm(t,i,"style"),cm(t,i,"extra"),t.clipPath=i.clipPath):r[e]=n:a==="replace"?r[e]=n:a==="remove"&&i&&(r[e]=null)}var _8=["transition","enterFrom","leaveTo"],Jxe=_8.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function cm(r,e,t){if(t&&(!r[t]&&e[t]&&(r[t]={}),r=r[t],e=e[t]),!(!r||!e))for(var n=t?_8:Jxe,i=0;i=0;c--){var f=i[c],h=vr(f.id,null),d=h!=null?o.get(h):null;if(d){var p=d.parent,g=ei(p),y=p===a?{width:s,height:l}:{width:g.width,height:g.height},b={},_=t1(d,f,y,null,{hv:f.hv,boundingMode:f.bounding},b);if(!ei(d).isNew&&_){for(var x=f.transition,w={},S=0;S=0)?w[T]=C:d[T]=C}ut(d,w,t,0)}else d.attr(b)}}},e.prototype._clear=function(){var t=this,n=this._elMap;n.each(function(i){eg(i,ei(i).option,n,t._lastGraphicModel)}),this._elMap=ve()},e.prototype.dispose=function(){this._clear()},e.type="graphic",e}(zt);function yS(r){var e=fe(zO,r)?zO[r]:LC(r),t=new e({});return ei(t).type=r,t}function FO(r,e,t,n){var i=yS(t);return e.add(i),n.set(r,i),ei(i).id=r,ei(i).isNew=!0,i}function eg(r,e,t,n){var i=r&&r.parent;i&&(r.type==="group"&&r.traverse(function(a){eg(a,e,t,n)}),g1(r,e,n),t.removeKey(ei(r).id))}function VO(r,e,t,n){r.isGroup||k([["cursor",mi.prototype.cursor],["zlevel",n||0],["z",t||0],["z2",0]],function(i){var a=i[0];fe(e,a)?r[a]=Re(e[a],i[1]):r[a]==null&&(r[a]=i[1])}),k(et(e),function(i){if(i.indexOf("on")===0){var a=e[i];r[i]=Te(a)?a:null}}),fe(e,"draggable")&&(r.draggable=e.draggable),e.name!=null&&(r.name=e.name),e.id!=null&&(r.id=e.id)}function rwe(r){return r=W({},r),k(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(h6),function(e){delete r[e]}),r}function nwe(r,e,t){var n=Le(r).eventData;!r.silent&&!r.ignore&&!n&&(n=Le(r).eventData={componentType:"graphic",componentIndex:e.componentIndex,name:r.name}),n&&(n.info=t.info)}function iwe(r){r.registerComponentModel(ewe),r.registerComponentView(twe),r.registerPreprocessor(function(e){var t=e.graphic;q(t)?!t[0]||!t[0].elements?e.graphic=[{elements:t}]:e.graphic=[e.graphic[0]]:t&&!t.elements&&(e.graphic=[{elements:[t]}])})}var $O=["x","y","radius","angle","single"],awe=["cartesian2d","polar","singleAxis"];function owe(r){var e=r.get("coordinateSystem");return He(awe,e)>=0}function vs(r){return r+"Axis"}function swe(r,e){var t=ve(),n=[],i=ve();r.eachComponent({mainType:"dataZoom",query:e},function(c){i.get(c.uid)||s(c)});var a;do a=!1,r.eachComponent("dataZoom",o);while(a);function o(c){!i.get(c.uid)&&l(c)&&(s(c),a=!0)}function s(c){i.set(c.uid,!0),n.push(c),u(c)}function l(c){var f=!1;return c.eachTargetAxis(function(h,d){var p=t.get(h);p&&p[d]&&(f=!0)}),f}function u(c){c.eachTargetAxis(function(f,h){(t.get(f)||t.set(f,[]))[h]=!0})}return n}function x8(r){var e=r.ecModel,t={infoList:[],infoMap:ve()};return r.eachTargetAxis(function(n,i){var a=e.getComponent(vs(n),i);if(a){var o=a.getCoordSysModel();if(o){var s=o.uid,l=t.infoMap.get(s);l||(l={model:o,axisModels:[]},t.infoList.push(l),t.infoMap.set(s,l)),l.axisModels.push(a)}}}),t}var bx=function(){function r(){this.indexList=[],this.indexMap=[]}return r.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},r}(),sp=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._autoThrottle=!0,t._noTarget=!0,t._rangePropMode=["percent","percent"],t}return e.prototype.init=function(t,n,i){var a=HO(t);this.settledOption=a,this.mergeDefaultAndTheme(t,i),this._doInit(a)},e.prototype.mergeOption=function(t){var n=HO(t);Be(this.option,t,!0),Be(this.settledOption,n,!0),this._doInit(n)},e.prototype._doInit=function(t){var n=this.option;this._setDefaultThrottle(t),this._updateRangeUse(t);var i=this.settledOption;k([["start","startValue"],["end","endValue"]],function(a,o){this._rangePropMode[o]==="value"&&(n[a[0]]=i[a[0]]=null)},this),this._resetTarget()},e.prototype._resetTarget=function(){var t=this.get("orient",!0),n=this._targetAxisInfoMap=ve(),i=this._fillSpecifiedTargetAxis(n);i?this._orient=t||this._makeAutoOrientByTargetAxis():(this._orient=t||"horizontal",this._fillAutoTargetAxisByOrient(n,this._orient)),this._noTarget=!0,n.each(function(a){a.indexList.length&&(this._noTarget=!1)},this)},e.prototype._fillSpecifiedTargetAxis=function(t){var n=!1;return k($O,function(i){var a=this.getReferringComponents(vs(i),ele);if(a.specified){n=!0;var o=new bx;k(a.models,function(s){o.add(s.componentIndex)}),t.set(i,o)}},this),n},e.prototype._fillAutoTargetAxisByOrient=function(t,n){var i=this.ecModel,a=!0;if(a){var o=n==="vertical"?"y":"x",s=i.findComponents({mainType:o+"Axis"});l(s,o)}if(a){var s=i.findComponents({mainType:"singleAxis",filter:function(c){return c.get("orient",!0)===n}});l(s,"single")}function l(u,c){var f=u[0];if(f){var h=new bx;if(h.add(f.componentIndex),t.set(c,h),a=!1,c==="x"||c==="y"){var d=f.getReferringComponents("grid",lr).models[0];d&&k(u,function(p){f.componentIndex!==p.componentIndex&&d===p.getReferringComponents("grid",lr).models[0]&&h.add(p.componentIndex)})}}}a&&k($O,function(u){if(a){var c=i.findComponents({mainType:vs(u),filter:function(h){return h.get("type",!0)==="category"}});if(c[0]){var f=new bx;f.add(c[0].componentIndex),t.set(u,f),a=!1}}},this)},e.prototype._makeAutoOrientByTargetAxis=function(){var t;return this.eachTargetAxis(function(n){!t&&(t=n)},this),t==="y"?"vertical":"horizontal"},e.prototype._setDefaultThrottle=function(t){if(t.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var n=this.ecModel.option;this.option.throttle=n.animation&&n.animationDurationUpdate>0?100:20}},e.prototype._updateRangeUse=function(t){var n=this._rangePropMode,i=this.get("rangeMode");k([["start","startValue"],["end","endValue"]],function(a,o){var s=t[a[0]]!=null,l=t[a[1]]!=null;s&&!l?n[o]="percent":!s&&l?n[o]="value":i?n[o]=i[o]:s&&(n[o]="percent")})},e.prototype.noTarget=function(){return this._noTarget},e.prototype.getFirstTargetAxisModel=function(){var t;return this.eachTargetAxis(function(n,i){t==null&&(t=this.ecModel.getComponent(vs(n),i))},this),t},e.prototype.eachTargetAxis=function(t,n){this._targetAxisInfoMap.each(function(i,a){k(i.indexList,function(o){t.call(n,a,o)})})},e.prototype.getAxisProxy=function(t,n){var i=this.getAxisModel(t,n);if(i)return i.__dzAxisProxy},e.prototype.getAxisModel=function(t,n){var i=this._targetAxisInfoMap.get(t);if(i&&i.indexMap[n])return this.ecModel.getComponent(vs(t),n)},e.prototype.setRawRange=function(t){var n=this.option,i=this.settledOption;k([["start","startValue"],["end","endValue"]],function(a){(t[a[0]]!=null||t[a[1]]!=null)&&(n[a[0]]=i[a[0]]=t[a[0]],n[a[1]]=i[a[1]]=t[a[1]])},this),this._updateRangeUse(t)},e.prototype.setCalculatedRange=function(t){var n=this.option;k(["start","startValue","end","endValue"],function(i){n[i]=t[i]})},e.prototype.getPercentRange=function(){var t=this.findRepresentativeAxisProxy();if(t)return t.getDataPercentWindow()},e.prototype.getValueRange=function(t,n){if(t==null&&n==null){var i=this.findRepresentativeAxisProxy();if(i)return i.getDataValueWindow()}else return this.getAxisProxy(t,n).getDataValueWindow()},e.prototype.findRepresentativeAxisProxy=function(t){if(t)return t.__dzAxisProxy;for(var n,i=this._targetAxisInfoMap.keys(),a=0;ao[1];if(b&&!_&&!x)return!0;b&&(m=!0),_&&(p=!0),x&&(v=!0)}return m&&p&&v})}else Tc(c,function(d){if(a==="empty")l.setData(u=u.map(d,function(v){return s(v)?v:NaN}));else{var p={};p[d]=o,u.selectRange(p)}});Tc(c,function(d){u.setApproximateExtent(o,d)})}});function s(l){return l>=o[0]&&l<=o[1]}},r.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},t=this._dataZoomModel,n=this._dataExtent;Tc(["min","max"],function(i){var a=t.get(i+"Span"),o=t.get(i+"ValueSpan");o!=null&&(o=this.getAxisModel().axis.scale.parse(o)),o!=null?a=bt(n[0]+o,n,[0,100],!0):a!=null&&(o=bt(a,[0,100],n,!0)-n[0]),e[i+"Span"]=a,e[i+"ValueSpan"]=o},this)},r.prototype._setAxisModel=function(){var e=this.getAxisModel(),t=this._percentWindow,n=this._valueWindow;if(t){var i=rz(n,[0,500]);i=Math.min(i,20);var a=e.axis.scale.rawExtentInfo;t[0]!==0&&a.setDeterminedMinMax("min",+n[0].toFixed(i)),t[1]!==100&&a.setDeterminedMinMax("max",+n[1].toFixed(i)),a.freeze()}},r}();function fwe(r,e,t){var n=[1/0,-1/0];Tc(t,function(o){Gde(n,o.getData(),e)});var i=r.getAxisModel(),a=zF(i.axis.scale,i,n).calculate();return[a.min,a.max]}var hwe={getTargetSeries:function(r){function e(i){r.eachComponent("dataZoom",function(a){a.eachTargetAxis(function(o,s){var l=r.getComponent(vs(o),s);i(o,s,l,a)})})}e(function(i,a,o,s){o.__dzAxisProxy=null});var t=[];e(function(i,a,o,s){o.__dzAxisProxy||(o.__dzAxisProxy=new cwe(i,a,s,r),t.push(o.__dzAxisProxy))});var n=ve();return k(t,function(i){k(i.getTargetSeriesModels(),function(a){n.set(a.uid,a)})}),n},overallReset:function(r,e){r.eachComponent("dataZoom",function(t){t.eachTargetAxis(function(n,i){t.getAxisProxy(n,i).reset(t)}),t.eachTargetAxis(function(n,i){t.getAxisProxy(n,i).filterData(t,e)})}),r.eachComponent("dataZoom",function(t){var n=t.findRepresentativeAxisProxy();if(n){var i=n.getDataPercentWindow(),a=n.getDataValueWindow();t.setCalculatedRange({start:i[0],end:i[1],startValue:a[0],endValue:a[1]})}})}};function dwe(r){r.registerAction("dataZoom",function(e,t){var n=swe(t,e);k(n,function(i){i.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})})}var WO=!1;function eM(r){WO||(WO=!0,r.registerProcessor(r.PRIORITY.PROCESSOR.FILTER,hwe),dwe(r),r.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function pwe(r){r.registerComponentModel(lwe),r.registerComponentView(uwe),eM(r)}var ii=function(){function r(){}return r}(),w8={};function Cc(r,e){w8[r]=e}function S8(r){return w8[r]}var vwe=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.optionUpdated=function(){r.prototype.optionUpdated.apply(this,arguments);var t=this.ecModel;k(this.option.feature,function(n,i){var a=S8(i);a&&(a.getDefaultOption&&(a.defaultOption=a.getDefaultOption(t)),Be(n,a.defaultOption))})},e.type="toolbox",e.layoutMode={type:"box",ignoreSize:!0},e.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},tooltip:{show:!1,position:"bottom"}},e}(Qe);function mwe(r,e,t){var n=e.getBoxLayoutParams(),i=e.get("padding"),a={width:t.getWidth(),height:t.getHeight()},o=gr(n,a,i);iu(e.get("orient"),r,e.get("itemGap"),o.width,o.height),t1(r,n,a,i)}function T8(r,e){var t=Sf(e.get("padding")),n=e.getItemStyle(["color","opacity"]);return n.fill=e.get("backgroundColor"),r=new nt({shape:{x:r.x-t[3],y:r.y-t[0],width:r.width+t[1]+t[3],height:r.height+t[0]+t[2],r:e.get("borderRadius")},style:n,silent:!0,z2:-1}),r}var gwe=function(r){z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.render=function(t,n,i,a){var o=this.group;if(o.removeAll(),!t.get("show"))return;var s=+t.get("itemSize"),l=t.get("orient")==="vertical",u=t.get("feature")||{},c=this._features||(this._features={}),f=[];k(u,function(p,v){f.push(v)}),new To(this._featureNames||[],f).add(h).update(h).remove(Oe(h,null)).execute(),this._featureNames=f;function h(p,v){var m=f[p],g=f[v],y=u[m],b=new _t(y,t,t.ecModel),_;if(a&&a.newTitle!=null&&a.featureName===m&&(y.title=a.newTitle),m&&!g){if(ywe(m))_={onclick:b.option.onclick,featureName:m};else{var x=S8(m);if(!x)return;_=new x}c[m]=_}else if(_=c[g],!_)return;_.uid=wf("toolbox-feature"),_.model=b,_.ecModel=n,_.api=i;var w=_ instanceof ii;if(!m&&g){w&&_.dispose&&_.dispose(n,i);return}if(!b.get("show")||w&&_.unusable){w&&_.remove&&_.remove(n,i);return}d(b,_,m),b.setIconStatus=function(S,T){var C=this.option,A=this.iconPaths;C.iconStatus=C.iconStatus||{},C.iconStatus[S]=T,A[S]&&(T==="emphasis"?wo:So)(A[S])},_ instanceof ii&&_.render&&_.render(b,n,i,a)}function d(p,v,m){var g=p.getModel("iconStyle"),y=p.getModel(["emphasis","iconStyle"]),b=v instanceof ii&&v.getIcons?v.getIcons():p.get("icon"),_=p.get("title")||{},x,w;se(b)?(x={},x[m]=b):x=b,se(_)?(w={},w[m]=_):w=_;var S=p.iconPaths={};k(x,function(T,C){var A=kp(T,{},{x:-s/2,y:-s/2,width:s,height:s});A.setStyle(g.getItemStyle());var M=A.ensureState("emphasis");M.style=y.getItemStyle();var D=new ot({style:{text:w[C],align:y.get("textAlign"),borderRadius:y.get("textBorderRadius"),padding:y.get("textPadding"),fill:null,font:IC({fontStyle:y.get("textFontStyle"),fontFamily:y.get("textFontFamily"),fontSize:y.get("textFontSize"),fontWeight:y.get("textFontWeight")},n)},ignore:!0});A.setTextContent(D),Lu({el:A,componentModel:t,itemName:C,formatterParamsExtra:{title:w[C]}}),A.__title=w[C],A.on("mouseover",function(){var E=y.getItemStyle(),L=l?t.get("right")==null&&t.get("left")!=="right"?"right":"left":t.get("bottom")==null&&t.get("top")!=="bottom"?"bottom":"top";D.setStyle({fill:y.get("textFill")||E.fill||E.stroke||"#000",backgroundColor:y.get("textBackgroundColor")}),A.setTextConfig({position:y.get("textPosition")||L}),D.ignore=!t.get("showTitle"),i.enterEmphasis(this)}).on("mouseout",function(){p.get(["iconStatus",C])!=="emphasis"&&i.leaveEmphasis(this),D.hide()}),(p.get(["iconStatus",C])==="emphasis"?wo:So)(A),o.add(A),A.on("click",ue(v.onclick,v,n,i,C)),S[C]=A})}mwe(o,t,i),o.add(T8(o.getBoundingRect(),t)),l||o.eachChild(function(p){var v=p.__title,m=p.ensureState("emphasis"),g=m.textConfig||(m.textConfig={}),y=p.getTextContent(),b=y&&y.ensureState("emphasis");if(b&&!Te(b)&&v){var _=b.style||(b.style={}),x=xp(v,ot.makeFont(_)),w=p.x+o.x,S=p.y+o.y+s,T=!1;S+x.height>i.getHeight()&&(g.position="top",T=!0);var C=T?-5-x.height:s+10;w+x.width/2>i.getWidth()?(g.position=["100%",C],_.align="right"):w-x.width/2<0&&(g.position=[0,C],_.align="left")}})},e.prototype.updateView=function(t,n,i,a){k(this._features,function(o){o instanceof ii&&o.updateView&&o.updateView(o.model,n,i,a)})},e.prototype.remove=function(t,n){k(this._features,function(i){i instanceof ii&&i.remove&&i.remove(t,n)}),this.group.removeAll()},e.prototype.dispose=function(t,n){k(this._features,function(i){i instanceof ii&&i.dispose&&i.dispose(t,n)})},e.type="toolbox",e}(zt);function ywe(r){return r.indexOf("my")===0}var bwe=function(r){z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.onclick=function(t,n){var i=this.model,a=i.get("name")||t.get("title.0.text")||"echarts",o=n.getZr().painter.getType()==="svg",s=o?"svg":i.get("type",!0)||"png",l=n.getConnectedDataURL({type:s,backgroundColor:i.get("backgroundColor",!0)||t.get("backgroundColor")||"#fff",connectedBackgroundColor:i.get("connectedBackgroundColor"),excludeComponents:i.get("excludeComponents"),pixelRatio:i.get("pixelRatio")}),u=Ze.browser;if(typeof MouseEvent=="function"&&(u.newEdge||!u.ie&&!u.edge)){var c=document.createElement("a");c.download=a+"."+s,c.target="_blank",c.href=l;var f=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});c.dispatchEvent(f)}else if(window.navigator.msSaveOrOpenBlob||o){var h=l.split(","),d=h[0].indexOf("base64")>-1,p=o?decodeURIComponent(h[1]):h[1];d&&(p=window.atob(p));var v=a+"."+s;if(window.navigator.msSaveOrOpenBlob){for(var m=p.length,g=new Uint8Array(m);m--;)g[m]=p.charCodeAt(m);var y=new Blob([g]);window.navigator.msSaveOrOpenBlob(y,v)}else{var b=document.createElement("iframe");document.body.appendChild(b);var _=b.contentWindow,x=_.document;x.open("image/svg+xml","replace"),x.write(p),x.close(),_.focus(),x.execCommand("SaveAs",!0,v),document.body.removeChild(b)}}else{var w=i.get("lang"),S='',T=window.open();T.document.write(S),T.document.title=a}},e.getDefaultOption=function(t){var n={show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:t.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],lang:t.getLocaleModel().get(["toolbox","saveAsImage","lang"])};return n},e}(ii),UO="__ec_magicType_stack__",_we=[["line","bar"],["stack"]],xwe=function(r){z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getIcons=function(){var t=this.model,n=t.get("icon"),i={};return k(t.get("type"),function(a){n[a]&&(i[a]=n[a])}),i},e.getDefaultOption=function(t){var n={show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:t.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}};return n},e.prototype.onclick=function(t,n,i){var a=this.model,o=a.get(["seriesIndex",i]);if(YO[i]){var s={series:[]},l=function(f){var h=f.subType,d=f.id,p=YO[i](h,d,f,a);p&&(Ce(p,f.option),s.series.push(p));var v=f.coordinateSystem;if(v&&v.type==="cartesian2d"&&(i==="line"||i==="bar")){var m=v.getAxesByScale("ordinal")[0];if(m){var g=m.dim,y=g+"Axis",b=f.getReferringComponents(y,lr).models[0],_=b.componentIndex;s[y]=s[y]||[];for(var x=0;x<=_;x++)s[y][_]=s[y][_]||{};s[y][_].boundaryGap=i==="bar"}}};k(_we,function(f){He(f,i)>=0&&k(f,function(h){a.setIconStatus(h,"normal")})}),a.setIconStatus(i,"emphasis"),t.eachComponent({mainType:"series",query:o==null?null:{seriesIndex:o}},l);var u,c=i;i==="stack"&&(u=Be({stack:a.option.title.tiled,tiled:a.option.title.stack},a.option.title),a.get(["iconStatus",i])!=="emphasis"&&(c="tiled")),n.dispatchAction({type:"changeMagicType",currentType:c,newOption:s,newTitle:u,featureName:"magicType"})}},e}(ii),YO={line:function(r,e,t,n){if(r==="bar")return Be({id:e,type:"line",data:t.get("data"),stack:t.get("stack"),markPoint:t.get("markPoint"),markLine:t.get("markLine")},n.get(["option","line"])||{},!0)},bar:function(r,e,t,n){if(r==="line")return Be({id:e,type:"bar",data:t.get("data"),stack:t.get("stack"),markPoint:t.get("markPoint"),markLine:t.get("markLine")},n.get(["option","bar"])||{},!0)},stack:function(r,e,t,n){var i=t.get("stack")===UO;if(r==="line"||r==="bar")return n.setIconStatus("stack",i?"normal":"emphasis"),Be({id:e,stack:i?"":UO},n.get(["option","stack"])||{},!0)}};za({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(r,e){e.mergeOption(r.newOption)});var y1=new Array(60).join("-"),uf=" ";function wwe(r){var e={},t=[],n=[];return r.eachRawSeries(function(i){var a=i.coordinateSystem;if(a&&(a.type==="cartesian2d"||a.type==="polar")){var o=a.getBaseAxis();if(o.type==="category"){var s=o.dim+"_"+o.index;e[s]||(e[s]={categoryAxis:o,valueAxis:a.getOtherAxis(o),series:[]},n.push({axisDim:o.dim,axisIndex:o.index})),e[s].series.push(i)}else t.push(i)}else t.push(i)}),{seriesGroupByCategoryAxis:e,other:t,meta:n}}function Swe(r){var e=[];return k(r,function(t,n){var i=t.categoryAxis,a=t.valueAxis,o=a.dim,s=[" "].concat(K(t.series,function(d){return d.name})),l=[i.model.getCategories()];k(t.series,function(d){var p=d.getRawData();l.push(d.getRawData().mapArray(p.mapDimension(o),function(v){return v}))});for(var u=[s.join(uf)],c=0;c=0)return!0}var bS=new RegExp("["+uf+"]+","g");function Mwe(r){for(var e=r.split(/\n+/g),t=qy(e.shift()).split(bS),n=[],i=K(t,function(l){return{name:l,data:[]}}),a=0;a=0;a--){var o=t[a];if(o[i])break}if(a<0){var s=r.queryComponents({mainType:"dataZoom",subType:"select",id:i})[0];if(s){var l=s.getPercentRange();t[0][i]={dataZoomId:i,start:l[0],end:l[1]}}}}),t.push(e)}function Pwe(r){var e=tM(r),t=e[e.length-1];e.length>1&&e.pop();var n={};return C8(t,function(i,a){for(var o=e.length-1;o>=0;o--)if(i=e[o][a],i){n[a]=i;break}}),n}function Rwe(r){A8(r).snapshots=null}function Owe(r){return tM(r).length}function tM(r){var e=A8(r);return e.snapshots||(e.snapshots=[{}]),e.snapshots}var jwe=function(r){z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.onclick=function(t,n){Rwe(t),n.dispatchAction({type:"restore",from:this.uid})},e.getDefaultOption=function(t){var n={show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:t.getLocaleModel().get(["toolbox","restore","title"])};return n},e}(ii);za({type:"restore",event:"restore",update:"prepareAndUpdate"},function(r,e){e.resetOption("recreate")});var Nwe=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],rM=function(){function r(e,t,n){var i=this;this._targetInfoList=[];var a=qO(t,e);k(Bwe,function(o,s){(!n||!n.include||He(n.include,s)>=0)&&o(a,i._targetInfoList)})}return r.prototype.setOutputRanges=function(e,t){return this.matchOutputRanges(e,t,function(n,i,a){if((n.coordRanges||(n.coordRanges=[])).push(i),!n.coordRange){n.coordRange=i;var o=_x[n.brushType](0,a,i);n.__rangeOffset={offset:JO[n.brushType](o.values,n.range,[1,1]),xyMinMax:o.xyMinMax}}}),e},r.prototype.matchOutputRanges=function(e,t,n){k(e,function(i){var a=this.findTargetInfo(i,t);a&&a!==!0&&k(a.coordSyses,function(o){var s=_x[i.brushType](1,o,i.range,!0);n(i,s.values,o,t)})},this)},r.prototype.setInputRanges=function(e,t){k(e,function(n){var i=this.findTargetInfo(n,t);if(n.range=n.range||[],i&&i!==!0){n.panelId=i.panelId;var a=_x[n.brushType](0,i.coordSys,n.coordRange),o=n.__rangeOffset;n.range=o?JO[n.brushType](a.values,o.offset,zwe(a.xyMinMax,o.xyMinMax)):a.values}},this)},r.prototype.makePanelOpts=function(e,t){return K(this._targetInfoList,function(n){var i=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:t?t(n):null,clipPath:R$(i),isTargetByCursor:j$(i,e,n.coordSysModel),getLinearBrushOtherExtent:O$(i)}})},r.prototype.controlSeries=function(e,t,n){var i=this.findTargetInfo(e,n);return i===!0||i&&He(i.coordSyses,t.coordinateSystem)>=0},r.prototype.findTargetInfo=function(e,t){for(var n=this._targetInfoList,i=qO(t,e),a=0;ar[1]&&r.reverse(),r}function qO(r,e){return sd(r,e,{includeMainTypes:Nwe})}var Bwe={grid:function(r,e){var t=r.xAxisModels,n=r.yAxisModels,i=r.gridModels,a=ve(),o={},s={};!t&&!n&&!i||(k(t,function(l){var u=l.axis.grid.model;a.set(u.id,u),o[u.id]=!0}),k(n,function(l){var u=l.axis.grid.model;a.set(u.id,u),s[u.id]=!0}),k(i,function(l){a.set(l.id,l),o[l.id]=!0,s[l.id]=!0}),a.each(function(l){var u=l.coordinateSystem,c=[];k(u.getCartesians(),function(f,h){(He(t,f.getAxis("x").model)>=0||He(n,f.getAxis("y").model)>=0)&&c.push(f)}),e.push({panelId:"grid--"+l.id,gridModel:l,coordSysModel:l,coordSys:c[0],coordSyses:c,getPanelRect:KO.grid,xAxisDeclared:o[l.id],yAxisDeclared:s[l.id]})}))},geo:function(r,e){k(r.geoModels,function(t){var n=t.coordinateSystem;e.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:n,coordSyses:[n],getPanelRect:KO.geo})})}},XO=[function(r,e){var t=r.xAxisModel,n=r.yAxisModel,i=r.gridModel;return!i&&t&&(i=t.axis.grid.model),!i&&n&&(i=n.axis.grid.model),i&&i===e.gridModel},function(r,e){var t=r.geoModel;return t&&t===e.geoModel}],KO={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var r=this.coordSys,e=r.getBoundingRect().clone();return e.applyTransform(nu(r)),e}},_x={lineX:Oe(ZO,0),lineY:Oe(ZO,1),rect:function(r,e,t,n){var i=r?e.pointToData([t[0][0],t[1][0]],n):e.dataToPoint([t[0][0],t[1][0]],n),a=r?e.pointToData([t[0][1],t[1][1]],n):e.dataToPoint([t[0][1],t[1][1]],n),o=[_S([i[0],a[0]]),_S([i[1],a[1]])];return{values:o,xyMinMax:o}},polygon:function(r,e,t,n){var i=[[1/0,-1/0],[1/0,-1/0]],a=K(t,function(o){var s=r?e.pointToData(o,n):e.dataToPoint(o,n);return i[0][0]=Math.min(i[0][0],s[0]),i[1][0]=Math.min(i[1][0],s[1]),i[0][1]=Math.max(i[0][1],s[0]),i[1][1]=Math.max(i[1][1],s[1]),s});return{values:a,xyMinMax:i}}};function ZO(r,e,t,n){var i=t.getAxis(["x","y"][r]),a=_S(K([0,1],function(s){return e?i.coordToData(i.toLocalCoord(n[s]),!0):i.toGlobalCoord(i.dataToCoord(n[s]))})),o=[];return o[r]=a,o[1-r]=[NaN,NaN],{values:a,xyMinMax:o}}var JO={lineX:Oe(QO,0),lineY:Oe(QO,1),rect:function(r,e,t){return[[r[0][0]-t[0]*e[0][0],r[0][1]-t[0]*e[0][1]],[r[1][0]-t[1]*e[1][0],r[1][1]-t[1]*e[1][1]]]},polygon:function(r,e,t){return K(r,function(n,i){return[n[0]-t[0]*e[i][0],n[1]-t[1]*e[i][1]]})}};function QO(r,e,t,n){return[e[0]-n[r]*t[0],e[1]-n[r]*t[1]]}function zwe(r,e){var t=ej(r),n=ej(e),i=[t[0]/n[0],t[1]/n[1]];return isNaN(i[0])&&(i[0]=1),isNaN(i[1])&&(i[1]=1),i}function ej(r){return r?[r[0][1]-r[0][0],r[1][1]-r[1][0]]:[NaN,NaN]}var xS=k,Fwe=Xse("toolbox-dataZoom_"),Vwe=function(r){z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.render=function(t,n,i,a){this._brushController||(this._brushController=new DA(i.getZr()),this._brushController.on("brush",ue(this._onBrush,this)).mount()),Gwe(t,n,this,a,i),Hwe(t,n)},e.prototype.onclick=function(t,n,i){$we[i].call(this)},e.prototype.remove=function(t,n){this._brushController&&this._brushController.unmount()},e.prototype.dispose=function(t,n){this._brushController&&this._brushController.dispose()},e.prototype._onBrush=function(t){var n=t.areas;if(!t.isEnd||!n.length)return;var i={},a=this.ecModel;this._brushController.updateCovers([]);var o=new rM(nM(this.model),a,{include:["grid"]});o.matchOutputRanges(n,a,function(u,c,f){if(f.type==="cartesian2d"){var h=u.brushType;h==="rect"?(s("x",f,c[0]),s("y",f,c[1])):s({lineX:"x",lineY:"y"}[h],f,c)}}),Iwe(a,i),this._dispatchZoomAction(i);function s(u,c,f){var h=c.getAxis(u),d=h.model,p=l(u,d,a),v=p.findRepresentativeAxisProxy(d).getMinMaxSpan();(v.minValueSpan!=null||v.maxValueSpan!=null)&&(f=Nu(0,f.slice(),h.scale.getExtent(),0,v.minValueSpan,v.maxValueSpan)),p&&(i[p.id]={dataZoomId:p.id,startValue:f[0],endValue:f[1]})}function l(u,c,f){var h;return f.eachComponent({mainType:"dataZoom",subType:"select"},function(d){var p=d.getAxisModel(u,c.componentIndex);p&&(h=d)}),h}},e.prototype._dispatchZoomAction=function(t){var n=[];xS(t,function(i,a){n.push(ke(i))}),n.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:n})},e.getDefaultOption=function(t){var n={show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:t.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:"rgba(210,219,238,0.2)"}};return n},e}(ii),$we={zoom:function(){var r=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:r})},back:function(){this._dispatchZoomAction(Pwe(this.ecModel))}};function nM(r){var e={xAxisIndex:r.get("xAxisIndex",!0),yAxisIndex:r.get("yAxisIndex",!0),xAxisId:r.get("xAxisId",!0),yAxisId:r.get("yAxisId",!0)};return e.xAxisIndex==null&&e.xAxisId==null&&(e.xAxisIndex="all"),e.yAxisIndex==null&&e.yAxisId==null&&(e.yAxisIndex="all"),e}function Hwe(r,e){r.setIconStatus("back",Owe(e)>1?"emphasis":"normal")}function Gwe(r,e,t,n,i){var a=t._isZoomActive;n&&n.type==="takeGlobalCursor"&&(a=n.key==="dataZoomSelect"?n.dataZoomSelectActive:!1),t._isZoomActive=a,r.setIconStatus("zoom",a?"emphasis":"normal");var o=new rM(nM(r),e,{include:["grid"]}),s=o.makePanelOpts(i,function(l){return l.xAxisDeclared&&!l.yAxisDeclared?"lineX":!l.xAxisDeclared&&l.yAxisDeclared?"lineY":"rect"});t._brushController.setPanels(s).enableBrush(a&&s.length?{brushType:"auto",brushStyle:r.getModel("brushStyle").getItemStyle()}:!1)}_ce("dataZoom",function(r){var e=r.getComponent("toolbox",0),t=["feature","dataZoom"];if(!e||e.get(t)==null)return;var n=e.getModel(t),i=[],a=nM(n),o=sd(r,a);xS(o.xAxisModels,function(l){return s(l,"xAxis","xAxisIndex")}),xS(o.yAxisModels,function(l){return s(l,"yAxis","yAxisIndex")});function s(l,u,c){var f=l.componentIndex,h={type:"select",$fromToolbox:!0,filterMode:n.get("filterMode",!0)||"filter",id:Fwe+u+f};h[c]=f,i.push(h)}return i});function Wwe(r){r.registerComponentModel(vwe),r.registerComponentView(gwe),Cc("saveAsImage",bwe),Cc("magicType",xwe),Cc("dataView",Ewe),Cc("dataZoom",Vwe),Cc("restore",jwe),Ue(pwe)}var Uwe=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="tooltip",e.dependencies=["axisPointer"],e.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},e}(Qe);function M8(r){var e=r.get("confine");return e!=null?!!e:r.get("renderMode")==="richText"}function k8(r){if(Ze.domSupported){for(var e=document.documentElement.style,t=0,n=r.length;t-1?(s+="top:50%",l+="translateY(-50%) rotate("+(u=a==="left"?-225:-45)+"deg)"):(s+="left:50%",l+="translateX(-50%) rotate("+(u=a==="top"?225:45)+"deg)");var c=u*Math.PI/180,f=o+i,h=f*Math.abs(Math.cos(c))+f*Math.abs(Math.sin(c)),d=Math.round(((h-Math.SQRT2*i)/2+Math.SQRT2*i-(h-f)/2)*100)/100;s+=";"+a+":-"+d+"px";var p=e+" solid "+i+"px;",v=["position:absolute;width:"+o+"px;height:"+o+"px;z-index:-1;",s+";"+l+";","border-bottom:"+p,"border-right:"+p,"background-color:"+n+";"];return'
    '}function Qwe(r,e){var t="cubic-bezier(0.23,1,0.32,1)",n=" "+r/2+"s "+t,i="opacity"+n+",visibility"+n;return e||(n=" "+r+"s "+t,i+=Ze.transformSupported?","+iM+n:",left"+n+",top"+n),Xwe+":"+i}function tj(r,e,t){var n=r.toFixed(0)+"px",i=e.toFixed(0)+"px";if(!Ze.transformSupported)return t?"top:"+i+";left:"+n+";":[["top",i],["left",n]];var a=Ze.transform3dSupported,o="translate"+(a?"3d":"")+"("+n+","+i+(a?",0":"")+")";return t?"top:0;left:0;"+iM+":"+o+";":[["top",0],["left",0],[D8,o]]}function e2e(r){var e=[],t=r.get("fontSize"),n=r.getTextColor();n&&e.push("color:"+n),e.push("font:"+r.getFont());var i=Re(r.get("lineHeight"),Math.round(t*3/2));t&&e.push("line-height:"+i+"px");var a=r.get("textShadowColor"),o=r.get("textShadowBlur")||0,s=r.get("textShadowOffsetX")||0,l=r.get("textShadowOffsetY")||0;return a&&o&&e.push("text-shadow:"+s+"px "+l+"px "+o+"px "+a),k(["decoration","align"],function(u){var c=r.get(u);c&&e.push("text-"+u+":"+c)}),e.join(";")}function t2e(r,e,t){var n=[],i=r.get("transitionDuration"),a=r.get("backgroundColor"),o=r.get("shadowBlur"),s=r.get("shadowColor"),l=r.get("shadowOffsetX"),u=r.get("shadowOffsetY"),c=r.getModel("textStyle"),f=G6(r,"html"),h=l+"px "+u+"px "+o+"px "+s;return n.push("box-shadow:"+h),e&&i&&n.push(Qwe(i,t)),a&&n.push("background-color:"+a),k(["width","color","radius"],function(d){var p="border-"+d,v=c6(p),m=r.get(v);m!=null&&n.push(p+":"+m+(d==="color"?"":"px"))}),n.push(e2e(c)),f!=null&&n.push("padding:"+Sf(f).join("px ")+"px"),n.join(";")+";"}function rj(r,e,t,n,i){var a=e&&e.painter;if(t){var o=a&&a.getViewportRoot();o&&Moe(r,o,t,n,i)}else{r[0]=n,r[1]=i;var s=a&&a.getViewportRootOffset();s&&(r[0]+=s.offsetLeft,r[1]+=s.offsetTop)}r[2]=r[0]/e.getWidth(),r[3]=r[1]/e.getHeight()}var r2e=function(){function r(e,t){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,Ze.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var i=this._zr=e.getZr(),a=t.appendTo,o=a&&(se(a)?document.querySelector(a):Jc(a)?a:Te(a)&&a(e.getDom()));rj(this._styleCoord,i,o,e.getWidth()/2,e.getHeight()/2),(o||e.getDom()).appendChild(n),this._api=e,this._container=o;var s=this;n.onmouseenter=function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},n.onmousemove=function(l){if(l=l||window.event,!s._enterable){var u=i.handler,c=i.painter.getViewportRoot();Zn(c,l,!0),u.dispatch("mousemove",l)}},n.onmouseleave=function(){s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}return r.prototype.update=function(e){if(!this._container){var t=this._api.getDom(),n=qwe(t,"position"),i=t.style;i.position!=="absolute"&&n!=="absolute"&&(i.position="relative")}var a=e.get("alwaysShowContent");a&&this._moveIfResized(),this._alwaysShowContent=a,this.el.className=e.get("className")||""},r.prototype.show=function(e,t){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,i=n.style,a=this._styleCoord;n.innerHTML?i.cssText=Kwe+t2e(e,!this._firstShow,this._longHide)+tj(a[0],a[1],!0)+("border-color:"+yu(t)+";")+(e.get("extraCssText")||"")+(";pointer-events:"+(this._enterable?"auto":"none")):i.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},r.prototype.setContent=function(e,t,n,i,a){var o=this.el;if(e==null){o.innerHTML="";return}var s="";if(se(a)&&n.get("trigger")==="item"&&!M8(n)&&(s=Jwe(n,i,a)),se(e))o.innerHTML=e+s;else if(e){o.innerHTML="",q(e)||(e=[e]);for(var l=0;l=0?this._tryShow(a,o):i==="leave"&&this._hide(o))},this))},e.prototype._keepShow=function(){var t=this._tooltipModel,n=this._ecModel,i=this._api,a=t.get("triggerOn");if(this._lastX!=null&&this._lastY!=null&&a!=="none"&&a!=="click"){var o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!i.isDisposed()&&o.manuallyShowTip(t,n,i,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})})}},e.prototype.manuallyShowTip=function(t,n,i,a){if(!(a.from===this.uid||Ze.node||!i.getDom())){var o=aj(a,i);this._ticket="";var s=a.dataByCoordSys,l=u2e(a,n,i);if(l){var u=l.el.getBoundingRect().clone();u.applyTransform(l.el.transform),this._tryShow({offsetX:u.x+u.width/2,offsetY:u.y+u.height/2,target:l.el,position:a.position,positionDefault:"bottom"},o)}else if(a.tooltip&&a.x!=null&&a.y!=null){var c=i2e;c.x=a.x,c.y=a.y,c.update(),Le(c).tooltipConfig={name:null,option:a.tooltip},this._tryShow({offsetX:a.x,offsetY:a.y,target:c},o)}else if(s)this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,dataByCoordSys:s,tooltipOption:a.tooltipOption},o);else if(a.seriesIndex!=null){if(this._manuallyAxisShowTip(t,n,i,a))return;var f=v8(a,n),h=f.point[0],d=f.point[1];h!=null&&d!=null&&this._tryShow({offsetX:h,offsetY:d,target:f.el,position:a.position,positionDefault:"bottom"},o)}else a.x!=null&&a.y!=null&&(i.dispatchAction({type:"updateAxisPointer",x:a.x,y:a.y}),this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,target:i.getZr().findHover(a.x,a.y).target},o))}},e.prototype.manuallyHideTip=function(t,n,i,a){var o=this._tooltipContent;this._tooltipModel&&o.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,a.from!==this.uid&&this._hide(aj(a,i))},e.prototype._manuallyAxisShowTip=function(t,n,i,a){var o=a.seriesIndex,s=a.dataIndex,l=n.getComponent("axisPointer").coordSysAxesInfo;if(!(o==null||s==null||l==null)){var u=n.getSeriesByIndex(o);if(u){var c=u.getData(),f=vh([c.getItemModel(s),u,(u.coordinateSystem||{}).model],this._tooltipModel);if(f.get("trigger")==="axis")return i.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:s,position:a.position}),!0}}},e.prototype._tryShow=function(t,n){var i=t.target,a=this._tooltipModel;if(a){this._lastX=t.offsetX,this._lastY=t.offsetY;var o=t.dataByCoordSys;if(o&&o.length)this._showAxisTooltip(o,t);else if(i){var s=Le(i);if(s.ssrType==="legend")return;this._lastDataByCoordSys=null;var l,u;Ol(i,function(c){if(Le(c).dataIndex!=null)return l=c,!0;if(Le(c).tooltipConfig!=null)return u=c,!0},!0),l?this._showSeriesItemTooltip(t,l,n):u?this._showComponentItemTooltip(t,u,n):this._hide(n)}else this._lastDataByCoordSys=null,this._hide(n)}},e.prototype._showOrMove=function(t,n){var i=t.get("showDelay");n=ue(n,this),clearTimeout(this._showTimout),i>0?this._showTimout=setTimeout(n,i):n()},e.prototype._showAxisTooltip=function(t,n){var i=this._ecModel,a=this._tooltipModel,o=[n.offsetX,n.offsetY],s=vh([n.tooltipOption],a),l=this._renderMode,u=[],c=Cr("section",{blocks:[],noHeader:!0}),f=[],h=new o_;k(t,function(y){k(y.dataByAxis,function(b){var _=i.getComponent(b.axisDim+"Axis",b.axisIndex),x=b.value;if(!(!_||x==null)){var w=f8(x,_.axis,i,b.seriesDataIndices,b.valueLabelOpt),S=Cr("section",{header:w,noHeader:!Li(w),sortBlocks:!0,blocks:[]});c.blocks.push(S),k(b.seriesDataIndices,function(T){var C=i.getSeriesByIndex(T.seriesIndex),A=T.dataIndexInside,M=C.getDataParams(A);if(!(M.dataIndex<0)){M.axisDim=b.axisDim,M.axisIndex=b.axisIndex,M.axisType=b.axisType,M.axisId=b.axisId,M.axisValue=nA(_.axis,{value:x}),M.axisValueLabel=w,M.marker=h.makeTooltipMarker("item",yu(M.color),l);var D=UL(C.formatTooltip(A,!0,null)),E=D.frag;if(E){var L=vh([C],a).get("valueFormatter");S.blocks.push(L?W({valueFormatter:L},E):E)}D.text&&f.push(D.text),u.push(M)}})}})}),c.blocks.reverse(),f.reverse();var d=n.position,p=s.get("order"),v=JL(c,h,l,p,i.get("useUTC"),s.get("textStyle"));v&&f.unshift(v);var m=l==="richText"?` `:"
    ",g=f.join(m);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(t,u)?this._updatePosition(s,d,o[0],o[1],this._tooltipContent,u):this._showTooltipContent(s,g,u,Math.random()+"",o[0],o[1],d,null,h)})},e.prototype._showSeriesItemTooltip=function(t,n,i){var a=this._ecModel,o=Le(n),s=o.seriesIndex,l=a.getSeriesByIndex(s),u=o.dataModel||l,c=o.dataIndex,f=o.dataType,h=u.getData(f),d=this._renderMode,p=t.positionDefault,v=vh([h.getItemModel(c),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,p?{position:p}:null),m=v.get("trigger");if(!(m!=null&&m!=="item")){var g=u.getDataParams(c,f),y=new o_;g.marker=y.makeTooltipMarker("item",yu(g.color),d);var b=UL(u.formatTooltip(c,!1,f)),_=v.get("order"),x=v.get("valueFormatter"),w=b.frag,S=w?JL(x?W({valueFormatter:x},w):w,y,d,_,a.get("useUTC"),v.get("textStyle")):b.text,T="item_"+u.name+"_"+c;this._showOrMove(v,function(){this._showTooltipContent(v,S,g,T,t.offsetX,t.offsetY,t.position,t.target,y)}),i({type:"showTip",dataIndexInside:c,dataIndex:h.getRawIndex(c),seriesIndex:s,from:this.uid})}},e.prototype._showComponentItemTooltip=function(t,n,i){var a=this._renderMode==="html",o=Le(n),s=o.tooltipConfig,l=s.option||{},u=l.encodeHTMLContent;if(se(l)){var c=l;l={content:c,formatter:c},u=!0}u&&a&&l.content&&(l=ke(l),l.content=un(l.content));var f=[l],h=this._ecModel.getComponent(o.componentMainType,o.componentIndex);h&&f.push(h),f.push({formatter:l.content});var d=t.positionDefault,p=vh(f,this._tooltipModel,d?{position:d}:null),v=p.get("content"),m=Math.random()+"",g=new o_;this._showOrMove(p,function(){var y=ke(p.get("formatterParams")||{});this._showTooltipContent(p,v,y,m,t.offsetX,t.offsetY,t.position,n,g)}),i({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(t,n,i,a,o,s,l,u,c){if(this._ticket="",!(!t.get("showContent")||!t.get("show"))){var f=this._tooltipContent;f.setEnterable(t.get("enterable"));var h=t.get("formatter");l=l||t.get("position");var d=n,p=this._getNearestPoint([o,s],i,t.get("trigger"),t.get("borderColor")),v=p.color;if(h)if(se(h)){var m=t.ecModel.get("useUTC"),g=q(i)?i[0]:i,y=g&&g.axisType&&g.axisType.indexOf("time")>=0;d=h,y&&(d=K0(g.axisValue,d,m)),d=f6(d,i,!0)}else if(Te(h)){var b=ue(function(_,x){_===this._ticket&&(f.setContent(x,c,t,v,l),this._updatePosition(t,l,o,s,f,i,u))},this);this._ticket=a,d=h(i,a,b)}else d=h;f.setContent(d,c,t,v,l),f.show(t,v),this._updatePosition(t,l,o,s,f,i,u)}},e.prototype._getNearestPoint=function(t,n,i,a){if(i==="axis"||q(n))return{color:a||(this._renderMode==="html"?"#fff":"none")};if(!q(n))return{color:a||n.color||n.borderColor}},e.prototype._updatePosition=function(t,n,i,a,o,s,l){var u=this._api.getWidth(),c=this._api.getHeight();n=n||t.get("position");var f=o.getSize(),h=t.get("align"),d=t.get("verticalAlign"),p=l&&l.getBoundingRect().clone();if(l&&p.applyTransform(l.transform),Te(n)&&(n=n([i,a],s,o.el,p,{viewSize:[u,c],contentSize:f.slice()})),q(n))i=ie(n[0],u),a=ie(n[1],c);else if(Me(n)){var v=n;v.width=f[0],v.height=f[1];var m=gr(v,{width:u,height:c});i=m.x,a=m.y,h=null,d=null}else if(se(n)&&l){var g=l2e(n,p,f,t.get("borderWidth"));i=g[0],a=g[1]}else{var g=o2e(i,a,o,u,c,h?null:20,d?null:20);i=g[0],a=g[1]}if(h&&(i-=oj(h)?f[0]/2:h==="right"?f[0]:0),d&&(a-=oj(d)?f[1]/2:d==="bottom"?f[1]:0),M8(t)){var g=s2e(i,a,o,u,c);i=g[0],a=g[1]}o.moveTo(i,a)},e.prototype._updateContentNotChangedOnAxis=function(t,n){var i=this._lastDataByCoordSys,a=this._cbParamsList,o=!!i&&i.length===t.length;return o&&k(i,function(s,l){var u=s.dataByAxis||[],c=t[l]||{},f=c.dataByAxis||[];o=o&&u.length===f.length,o&&k(u,function(h,d){var p=f[d]||{},v=h.seriesDataIndices||[],m=p.seriesDataIndices||[];o=o&&h.value===p.value&&h.axisType===p.axisType&&h.axisId===p.axisId&&v.length===m.length,o&&k(v,function(g,y){var b=m[y];o=o&&g.seriesIndex===b.seriesIndex&&g.dataIndex===b.dataIndex}),a&&k(h.seriesDataIndices,function(g){var y=g.seriesIndex,b=n[y],_=a[y];b&&_&&_.data!==b.data&&(o=!1)})})}),this._lastDataByCoordSys=t,this._cbParamsList=n,!!o},e.prototype._hide=function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},e.prototype.dispose=function(t,n){Ze.node||!n.getDom()||(qd(this,"_updatePosition"),this._tooltipContent.dispose(),mS("itemTooltip",n))},e.type="tooltip",e}(zt);function vh(r,e,t){var n=e.ecModel,i;t?(i=new _t(t,n,n),i=new _t(e.option,i,n)):i=e;for(var a=r.length-1;a>=0;a--){var o=r[a];o&&(o instanceof _t&&(o=o.get("tooltip",!0)),se(o)&&(o={formatter:o}),o&&(i=new _t(o,i,n)))}return i}function aj(r,e){return r.dispatchAction||ue(e.dispatchAction,e)}function o2e(r,e,t,n,i,a,o){var s=t.getSize(),l=s[0],u=s[1];return a!=null&&(r+l+a+2>n?r-=l+a:r+=a),o!=null&&(e+u+o>i?e-=u+o:e+=o),[r,e]}function s2e(r,e,t,n,i){var a=t.getSize(),o=a[0],s=a[1];return r=Math.min(r+o,n)-o,e=Math.min(e+s,i)-s,r=Math.max(r,0),e=Math.max(e,0),[r,e]}function l2e(r,e,t,n){var i=t[0],a=t[1],o=Math.ceil(Math.SQRT2*n)+8,s=0,l=0,u=e.width,c=e.height;switch(r){case"inside":s=e.x+u/2-i/2,l=e.y+c/2-a/2;break;case"top":s=e.x+u/2-i/2,l=e.y-a-o;break;case"bottom":s=e.x+u/2-i/2,l=e.y+c+o;break;case"left":s=e.x-i-o,l=e.y+c/2-a/2;break;case"right":s=e.x+u+o,l=e.y+c/2-a/2}return[s,l]}function oj(r){return r==="center"||r==="middle"}function u2e(r,e,t){var n=bC(r).queryOptionMap,i=n.keys()[0];if(!(!i||i==="series")){var a=wp(e,i,n.get(i),{useDefault:!1,enableAll:!1,enableNone:!1}),o=a.models[0];if(o){var s=t.getViewOfComponentModel(o),l;if(s.group.traverse(function(u){var c=Le(u).tooltipConfig;if(c&&c.name===r.name)return l=u,!0}),l)return{componentMainType:i,componentIndex:o.componentIndex,el:l}}}}function c2e(r){Ue(Vp),r.registerComponentModel(Uwe),r.registerComponentView(a2e),r.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},tr),r.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},tr)}var f2e=["rect","polygon","keep","clear"];function h2e(r,e){var t=wt(r?r.brush:[]);if(t.length){var n=[];k(t,function(l){var u=l.hasOwnProperty("toolbox")?l.toolbox:[];u instanceof Array&&(n=n.concat(u))});var i=r&&r.toolbox;q(i)&&(i=i[0]),i||(i={feature:{}},r.toolbox=[i]);var a=i.feature||(i.feature={}),o=a.brush||(a.brush={}),s=o.type||(o.type=[]);s.push.apply(s,n),d2e(s),e&&!s.length&&s.push.apply(s,f2e)}}function d2e(r){var e={};k(r,function(t){e[t]=1}),r.length=0,k(e,function(t,n){r.push(n)})}var sj=k;function lj(r){if(r){for(var e in r)if(r.hasOwnProperty(e))return!0}}function wS(r,e,t){var n={};return sj(e,function(a){var o=n[a]=i();sj(r[a],function(s,l){if(Sr.isValidType(l)){var u={type:l,visual:s};t&&t(u,a),o[l]=new Sr(u),l==="opacity"&&(u=ke(u),u.type="colorAlpha",o.__hidden.__alphaForOpacity=new Sr(u))}})}),n;function i(){var a=function(){};a.prototype.__hidden=a.prototype;var o=new a;return o}}function L8(r,e,t){var n;k(t,function(i){e.hasOwnProperty(i)&&lj(e[i])&&(n=!0)}),n&&k(t,function(i){e.hasOwnProperty(i)&&lj(e[i])?r[i]=ke(e[i]):delete r[i]})}function p2e(r,e,t,n,i,a){var o={};k(r,function(f){var h=Sr.prepareVisualTypes(e[f]);o[f]=h});var s;function l(f){return qC(t,s,f)}function u(f,h){eF(t,s,f,h)}t.each(c);function c(f,h){s=f;var d=t.getRawDataItem(s);if(!(d&&d.visualMap===!1))for(var p=n.call(i,f),v=e[p],m=o[p],g=0,y=m.length;ge[0][1]&&(e[0][1]=a[0]),a[1]e[1][1]&&(e[1][1]=a[1])}return e&&dj(e)}};function dj(r){return new Ve(r[0][0],r[1][0],r[0][1]-r[0][0],r[1][1]-r[1][0])}var w2e=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,n){this.ecModel=t,this.api=n,this.model,(this._brushController=new DA(n.getZr())).on("brush",ue(this._onBrush,this)).mount()},e.prototype.render=function(t,n,i,a){this.model=t,this._updateController(t,n,i,a)},e.prototype.updateTransform=function(t,n,i,a){I8(n),this._updateController(t,n,i,a)},e.prototype.updateVisual=function(t,n,i,a){this.updateTransform(t,n,i,a)},e.prototype.updateView=function(t,n,i,a){this._updateController(t,n,i,a)},e.prototype._updateController=function(t,n,i,a){(!a||a.$from!==t.id)&&this._brushController.setPanels(t.brushTargetManager.makePanelOpts(i)).enableBrush(t.brushOption).updateCovers(t.areas.slice())},e.prototype.dispose=function(){this._brushController.dispose()},e.prototype._onBrush=function(t){var n=this.model.id,i=this.model.brushTargetManager.setOutputRanges(t.areas,this.ecModel);(!t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:n,areas:ke(i),$from:n}),t.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:n,areas:ke(i),$from:n})},e.type="brush",e}(zt),S2e="#ddd",T2e=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.areas=[],t.brushOption={},t}return e.prototype.optionUpdated=function(t,n){var i=this.option;!n&&L8(i,t,["inBrush","outOfBrush"]);var a=i.inBrush=i.inBrush||{};i.outOfBrush=i.outOfBrush||{color:S2e},a.hasOwnProperty("liftZ")||(a.liftZ=5)},e.prototype.setAreas=function(t){t&&(this.areas=K(t,function(n){return pj(this.option,n)},this))},e.prototype.setBrushOption=function(t){this.brushOption=pj(this.option,t),this.brushType=this.brushOption.brushType},e.type="brush",e.dependencies=["geo","grid","xAxis","yAxis","parallel","series"],e.defaultOption={seriesIndex:"all",brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(210,219,238,0.3)",borderColor:"#D2DBEE"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},e}(Qe);function pj(r,e){return Be({brushType:r.brushType,brushMode:r.brushMode,transformable:r.transformable,brushStyle:new _t(r.brushStyle).getItemStyle(),removeOnClick:r.removeOnClick,z:r.z},e,!0)}var C2e=["rect","polygon","lineX","lineY","keep","clear"],A2e=function(r){z(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.render=function(t,n,i){var a,o,s;n.eachComponent({mainType:"brush"},function(l){a=l.brushType,o=l.brushOption.brushMode||"single",s=s||!!l.areas.length}),this._brushType=a,this._brushMode=o,k(t.get("type",!0),function(l){t.setIconStatus(l,(l==="keep"?o==="multiple":l==="clear"?s:l===a)?"emphasis":"normal")})},e.prototype.updateView=function(t,n,i){this.render(t,n,i)},e.prototype.getIcons=function(){var t=this.model,n=t.get("icon",!0),i={};return k(t.get("type",!0),function(a){n[a]&&(i[a]=n[a])}),i},e.prototype.onclick=function(t,n,i){var a=this._brushType,o=this._brushMode;i==="clear"?(n.dispatchAction({type:"axisAreaSelect",intervals:[]}),n.dispatchAction({type:"brush",command:"clear",areas:[]})):n.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:i==="keep"?a:a===i?!1:i,brushMode:i==="keep"?o==="multiple"?"single":"multiple":o}})},e.getDefaultOption=function(t){var n={show:!0,type:C2e.slice(),icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:t.getLocaleModel().get(["toolbox","brush","title"])};return n},e}(ii);function M2e(r){r.registerComponentView(w2e),r.registerComponentModel(T2e),r.registerPreprocessor(h2e),r.registerVisual(r.PRIORITY.VISUAL.BRUSH,g2e),r.registerAction({type:"brush",event:"brush",update:"updateVisual"},function(e,t){t.eachComponent({mainType:"brush",query:e},function(n){n.setAreas(e.areas)})}),r.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},tr),r.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},tr),Cc("brush",A2e)}var k2e=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.layoutMode={type:"box",ignoreSize:!0},t}return e.type="title",e.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},e}(Qe),D2e=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,n,i){if(this.group.removeAll(),!!t.get("show")){var a=this.group,o=t.getModel("textStyle"),s=t.getModel("subtextStyle"),l=t.get("textAlign"),u=Re(t.get("textBaseline"),t.get("textVerticalAlign")),c=new ot({style:Et(o,{text:t.get("text"),fill:o.getTextColor()},{disableBox:!0}),z2:10}),f=c.getBoundingRect(),h=t.get("subtext"),d=new ot({style:Et(s,{text:h,fill:s.getTextColor(),y:f.height+t.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),p=t.get("link"),v=t.get("sublink"),m=t.get("triggerEvent",!0);c.silent=!p&&!m,d.silent=!v&&!m,p&&c.on("click",function(){Sy(p,"_"+t.get("target"))}),v&&d.on("click",function(){Sy(v,"_"+t.get("subtarget"))}),Le(c).eventData=Le(d).eventData=m?{componentType:"title",componentIndex:t.componentIndex}:null,a.add(c),h&&a.add(d);var g=a.getBoundingRect(),y=t.getBoxLayoutParams();y.width=g.width,y.height=g.height;var b=gr(y,{width:i.getWidth(),height:i.getHeight()},t.get("padding"));l||(l=t.get("left")||t.get("right"),l==="middle"&&(l="center"),l==="right"?b.x+=b.width:l==="center"&&(b.x+=b.width/2)),u||(u=t.get("top")||t.get("bottom"),u==="center"&&(u="middle"),u==="bottom"?b.y+=b.height:u==="middle"&&(b.y+=b.height/2),u=u||"top"),a.x=b.x,a.y=b.y,a.markRedraw();var _={align:l,verticalAlign:u};c.setStyle(_),d.setStyle(_),g=a.getBoundingRect();var x=b.margin,w=t.getItemStyle(["color","opacity"]);w.fill=t.get("backgroundColor");var S=new nt({shape:{x:g.x-x[3],y:g.y-x[0],width:g.width+x[1]+x[3],height:g.height+x[0]+x[2],r:t.get("borderRadius")},style:w,subPixelOptimize:!0,silent:!0});a.add(S)}},e.type="title",e}(zt);function E2e(r){r.registerComponentModel(k2e),r.registerComponentView(D2e)}var vj=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.layoutMode="box",t}return e.prototype.init=function(t,n,i){this.mergeDefaultAndTheme(t,i),this._initData()},e.prototype.mergeOption=function(t){r.prototype.mergeOption.apply(this,arguments),this._initData()},e.prototype.setCurrentIndex=function(t){t==null&&(t=this.option.currentIndex);var n=this._data.count();this.option.loop?t=(t%n+n)%n:(t>=n&&(t=n-1),t<0&&(t=0)),this.option.currentIndex=t},e.prototype.getCurrentIndex=function(){return this.option.currentIndex},e.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},e.prototype.setPlayState=function(t){this.option.autoPlay=!!t},e.prototype.getPlayState=function(){return!!this.option.autoPlay},e.prototype._initData=function(){var t=this.option,n=t.data||[],i=t.axisType,a=this._names=[],o;i==="category"?(o=[],k(n,function(u,c){var f=vr(yf(u),""),h;Me(u)?(h=ke(u),h.value=c):h=c,o.push(h),a.push(f)})):o=n;var s={category:"ordinal",time:"time",value:"number"}[i]||"number",l=this._data=new fn([{name:"value",type:s}],this);l.initData(o,a)},e.prototype.getData=function(){return this._data},e.prototype.getCategories=function(){if(this.get("axisType")==="category")return this._names.slice()},e.type="timeline",e.defaultOption={z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},e}(Qe),P8=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="timeline.slider",e.defaultOption=$s(vj.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:"#DAE1F5"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#A4B1D7"},itemStyle:{color:"#A4B1D7",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:15,color:"#316bf3",borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0, 0, 0, 0.3)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z",prevIcon:"M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z",prevBtnSize:18,nextBtnSize:18,color:"#A4B1D7",borderColor:"#A4B1D7",borderWidth:1},emphasis:{label:{show:!0,color:"#6f778d"},itemStyle:{color:"#316BF3"},controlStyle:{color:"#316BF3",borderColor:"#316BF3",borderWidth:2}},progress:{lineStyle:{color:"#316BF3"},itemStyle:{color:"#316BF3"},label:{color:"#6f778d"}},data:[]}),e}(vj);cr(P8,n1.prototype);var L2e=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="timeline",e}(zt),I2e=function(r){z(e,r);function e(t,n,i,a){var o=r.call(this,t,n,i)||this;return o.type=a||"value",o}return e.prototype.getLabelModel=function(){return this.model.getModel("label")},e.prototype.isHorizontal=function(){return this.model.get("orient")==="horizontal"},e}(Gi),Sx=Math.PI,mj=it(),P2e=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,n){this.api=n},e.prototype.render=function(t,n,i){if(this.model=t,this.api=i,this.ecModel=n,this.group.removeAll(),t.get("show",!0)){var a=this._layout(t,i),o=this._createGroup("_mainGroup"),s=this._createGroup("_labelGroup"),l=this._axis=this._createAxis(a,t);t.formatTooltip=function(u){var c=l.scale.getLabel({value:u});return Cr("nameValue",{noName:!0,value:c})},k(["AxisLine","AxisTick","Control","CurrentPointer"],function(u){this["_render"+u](a,o,l,t)},this),this._renderAxisLabel(a,s,l,t),this._position(a,t)}this._doPlayStop(),this._updateTicksStatus()},e.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},e.prototype.dispose=function(){this._clearTimer()},e.prototype._layout=function(t,n){var i=t.get(["label","position"]),a=t.get("orient"),o=O2e(t,n),s;i==null||i==="auto"?s=a==="horizontal"?o.y+o.height/2=0||s==="+"?"left":"right"},u={horizontal:s>=0||s==="+"?"top":"bottom",vertical:"middle"},c={horizontal:0,vertical:Sx/2},f=a==="vertical"?o.height:o.width,h=t.getModel("controlStyle"),d=h.get("show",!0),p=d?h.get("itemSize"):0,v=d?h.get("itemGap"):0,m=p+v,g=t.get(["label","rotate"])||0;g=g*Sx/180;var y,b,_,x=h.get("position",!0),w=d&&h.get("showPlayBtn",!0),S=d&&h.get("showPrevBtn",!0),T=d&&h.get("showNextBtn",!0),C=0,A=f;x==="left"||x==="bottom"?(w&&(y=[0,0],C+=m),S&&(b=[C,0],C+=m),T&&(_=[A-p,0],A-=m)):(w&&(y=[A-p,0],A-=m),S&&(b=[0,0],C+=m),T&&(_=[A-p,0],A-=m));var M=[C,A];return t.get("inverse")&&M.reverse(),{viewRect:o,mainLength:f,orient:a,rotation:c[a],labelRotation:g,labelPosOpt:s,labelAlign:t.get(["label","align"])||l[a],labelBaseline:t.get(["label","verticalAlign"])||t.get(["label","baseline"])||u[a],playPosition:y,prevBtnPosition:b,nextBtnPosition:_,axisExtent:M,controlSize:p,controlGap:v}},e.prototype._position=function(t,n){var i=this._mainGroup,a=this._labelGroup,o=t.viewRect;if(t.orient==="vertical"){var s=zn(),l=o.x,u=o.y+o.height;La(s,s,[-l,-u]),Eu(s,s,-Sx/2),La(s,s,[l,u]),o=o.clone(),o.applyTransform(s)}var c=y(o),f=y(i.getBoundingRect()),h=y(a.getBoundingRect()),d=[i.x,i.y],p=[a.x,a.y];p[0]=d[0]=c[0][0];var v=t.labelPosOpt;if(v==null||se(v)){var m=v==="+"?0:1;b(d,f,c,1,m),b(p,h,c,1,1-m)}else{var m=v>=0?0:1;b(d,f,c,1,m),p[1]=d[1]+v}i.setPosition(d),a.setPosition(p),i.rotation=a.rotation=t.rotation,g(i),g(a);function g(_){_.originX=c[0][0]-_.x,_.originY=c[1][0]-_.y}function y(_){return[[_.x,_.x+_.width],[_.y,_.y+_.height]]}function b(_,x,w,S,T){_[S]+=w[S][T]-x[S][T]}},e.prototype._createAxis=function(t,n){var i=n.getData(),a=n.get("axisType"),o=R2e(n,a);o.getTicks=function(){return i.mapArray(["value"],function(u){return{value:u}})};var s=i.getDataExtent("value");o.setExtent(s[0],s[1]),o.calcNiceTicks();var l=new I2e("value",o,t.axisExtent,a);return l.model=n,l},e.prototype._createGroup=function(t){var n=this[t]=new Ee;return this.group.add(n),n},e.prototype._renderAxisLine=function(t,n,i,a){var o=i.getExtent();if(a.get(["lineStyle","show"])){var s=new xr({shape:{x1:o[0],y1:0,x2:o[1],y2:0},style:W({lineCap:"round"},a.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});n.add(s);var l=this._progressLine=new xr({shape:{x1:o[0],x2:this._currentPointer?this._currentPointer.x:o[0],y1:0,y2:0},style:Ce({lineCap:"round",lineWidth:s.style.lineWidth},a.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});n.add(l)}},e.prototype._renderAxisTick=function(t,n,i,a){var o=this,s=a.getData(),l=i.scale.getTicks();this._tickSymbols=[],k(l,function(u){var c=i.dataToCoord(u.value),f=s.getItemModel(u.value),h=f.getModel("itemStyle"),d=f.getModel(["emphasis","itemStyle"]),p=f.getModel(["progress","itemStyle"]),v={x:c,y:0,onclick:ue(o._changeTimeline,o,u.value)},m=gj(f,h,n,v);m.ensureState("emphasis").style=d.getItemStyle(),m.ensureState("progress").style=p.getItemStyle(),ru(m);var g=Le(m);f.get("tooltip")?(g.dataIndex=u.value,g.dataModel=a):g.dataIndex=g.dataModel=null,o._tickSymbols.push(m)})},e.prototype._renderAxisLabel=function(t,n,i,a){var o=this,s=i.getLabelModel();if(s.get("show")){var l=a.getData(),u=i.getViewLabels();this._tickLabels=[],k(u,function(c){var f=c.tickValue,h=l.getItemModel(f),d=h.getModel("label"),p=h.getModel(["emphasis","label"]),v=h.getModel(["progress","label"]),m=i.dataToCoord(c.tickValue),g=new ot({x:m,y:0,rotation:t.labelRotation-t.rotation,onclick:ue(o._changeTimeline,o,f),silent:!1,style:Et(d,{text:c.formattedLabel,align:t.labelAlign,verticalAlign:t.labelBaseline})});g.ensureState("emphasis").style=Et(p),g.ensureState("progress").style=Et(v),n.add(g),ru(g),mj(g).dataIndex=f,o._tickLabels.push(g)})}},e.prototype._renderControl=function(t,n,i,a){var o=t.controlSize,s=t.rotation,l=a.getModel("controlStyle").getItemStyle(),u=a.getModel(["emphasis","controlStyle"]).getItemStyle(),c=a.getPlayState(),f=a.get("inverse",!0);h(t.nextBtnPosition,"next",ue(this._changeTimeline,this,f?"-":"+")),h(t.prevBtnPosition,"prev",ue(this._changeTimeline,this,f?"+":"-")),h(t.playPosition,c?"stop":"play",ue(this._handlePlayClick,this,!c),!0);function h(d,p,v,m){if(d){var g=Ni(Re(a.get(["controlStyle",p+"BtnSize"]),o),o),y=[0,-g/2,g,g],b=j2e(a,p+"Icon",y,{x:d[0],y:d[1],originX:o/2,originY:0,rotation:m?-s:0,rectHover:!0,style:l,onclick:v});b.ensureState("emphasis").style=u,n.add(b),ru(b)}}},e.prototype._renderCurrentPointer=function(t,n,i,a){var o=a.getData(),s=a.getCurrentIndex(),l=o.getItemModel(s).getModel("checkpointStyle"),u=this,c={onCreate:function(f){f.draggable=!0,f.drift=ue(u._handlePointerDrag,u),f.ondragend=ue(u._handlePointerDragend,u),yj(f,u._progressLine,s,i,a,!0)},onUpdate:function(f){yj(f,u._progressLine,s,i,a)}};this._currentPointer=gj(l,l,this._mainGroup,{},this._currentPointer,c)},e.prototype._handlePlayClick=function(t){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:t,from:this.uid})},e.prototype._handlePointerDrag=function(t,n,i){this._clearTimer(),this._pointerChangeTimeline([i.offsetX,i.offsetY])},e.prototype._handlePointerDragend=function(t){this._pointerChangeTimeline([t.offsetX,t.offsetY],!0)},e.prototype._pointerChangeTimeline=function(t,n){var i=this._toAxisCoord(t)[0],a=this._axis,o=ci(a.getExtent().slice());i>o[1]&&(i=o[1]),i=0&&(o[a]=+o[a].toFixed(h)),[o,f]}var Tx={min:Oe(dm,"min"),max:Oe(dm,"max"),average:Oe(dm,"average"),median:Oe(dm,"median")};function lp(r,e){if(e){var t=r.getData(),n=r.coordinateSystem,i=n&&n.dimensions;if(!$2e(e)&&!q(e.coord)&&q(i)){var a=R8(e,t,n,r);if(e=ke(e),e.type&&Tx[e.type]&&a.baseAxis&&a.valueAxis){var o=He(i,a.baseAxis.dim),s=He(i,a.valueAxis.dim),l=Tx[e.type](t,a.baseDataDim,a.valueDataDim,o,s);e.coord=l[0],e.value=l[1]}else e.coord=[e.xAxis!=null?e.xAxis:e.radiusAxis,e.yAxis!=null?e.yAxis:e.angleAxis]}if(e.coord==null||!q(i))e.coord=[];else for(var u=e.coord,c=0;c<2;c++)Tx[u[c]]&&(u[c]=oM(t,t.mapDimension(i[c]),u[c]));return e}}function R8(r,e,t,n){var i={};return r.valueIndex!=null||r.valueDim!=null?(i.valueDataDim=r.valueIndex!=null?e.getDimension(r.valueIndex):r.valueDim,i.valueAxis=t.getAxis(H2e(n,i.valueDataDim)),i.baseAxis=t.getOtherAxis(i.valueAxis),i.baseDataDim=e.mapDimension(i.baseAxis.dim)):(i.baseAxis=n.getBaseAxis(),i.valueAxis=t.getOtherAxis(i.baseAxis),i.baseDataDim=e.mapDimension(i.baseAxis.dim),i.valueDataDim=e.mapDimension(i.valueAxis.dim)),i}function H2e(r,e){var t=r.getData().getDimensionInfo(e);return t&&t.coordDim}function up(r,e){return r&&r.containData&&e.coord&&!TS(e)?r.containData(e.coord):!0}function G2e(r,e,t){return r&&r.containZone&&e.coord&&t.coord&&!TS(e)&&!TS(t)?r.containZone(e.coord,t.coord):!0}function O8(r,e){return r?function(t,n,i,a){var o=a<2?t.coord&&t.coord[a]:t.value;return _s(o,e[a])}:function(t,n,i,a){return _s(t.value,e[a])}}function oM(r,e,t){if(t==="average"){var n=0,i=0;return r.each(e,function(a,o){isNaN(a)||(n+=a,i++)}),n/i}else return t==="median"?r.getMedian(e):r.getDataExtent(e)[t==="max"?1:0]}var Cx=it(),sM=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(){this.markerGroupMap=ve()},e.prototype.render=function(t,n,i){var a=this,o=this.markerGroupMap;o.each(function(s){Cx(s).keep=!1}),n.eachSeries(function(s){var l=Mo.getMarkerModelFromSeries(s,a.type);l&&a.renderSeries(s,l,n,i)}),o.each(function(s){!Cx(s).keep&&a.group.remove(s.group)})},e.prototype.markKeep=function(t){Cx(t).keep=!0},e.prototype.toggleBlurSeries=function(t,n){var i=this;k(t,function(a){var o=Mo.getMarkerModelFromSeries(a,i.type);if(o){var s=o.getData();s.eachItemGraphicEl(function(l){l&&(n?kz(l):AC(l))})}})},e.type="marker",e}(zt);function _j(r,e,t){var n=e.coordinateSystem;r.each(function(i){var a=r.getItemModel(i),o,s=ie(a.get("x"),t.getWidth()),l=ie(a.get("y"),t.getHeight());if(!isNaN(s)&&!isNaN(l))o=[s,l];else if(e.getMarkerPosition)o=e.getMarkerPosition(r.getValues(r.dimensions,i));else if(n){var u=r.get(n.dimensions[0],i),c=r.get(n.dimensions[1],i);o=n.dataToPoint([u,c])}isNaN(s)||(o[0]=s),isNaN(l)||(o[1]=l),r.setItemLayout(i,o)})}var W2e=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.updateTransform=function(t,n,i){n.eachSeries(function(a){var o=Mo.getMarkerModelFromSeries(a,"markPoint");o&&(_j(o.getData(),a,i),this.markerGroupMap.get(a.id).updateLayout())},this)},e.prototype.renderSeries=function(t,n,i,a){var o=t.coordinateSystem,s=t.id,l=t.getData(),u=this.markerGroupMap,c=u.get(s)||u.set(s,new Rp),f=U2e(o,t,n);n.setData(f),_j(n.getData(),t,a),f.each(function(h){var d=f.getItemModel(h),p=d.getShallow("symbol"),v=d.getShallow("symbolSize"),m=d.getShallow("symbolRotate"),g=d.getShallow("symbolOffset"),y=d.getShallow("symbolKeepAspect");if(Te(p)||Te(v)||Te(m)||Te(g)){var b=n.getRawValue(h),_=n.getDataParams(h);Te(p)&&(p=p(b,_)),Te(v)&&(v=v(b,_)),Te(m)&&(m=m(b,_)),Te(g)&&(g=g(b,_))}var x=d.getModel("itemStyle").getItemStyle(),w=Ep(l,"color");x.fill||(x.fill=w),f.setItemVisual(h,{symbol:p,symbolSize:v,symbolRotate:m,symbolOffset:g,symbolKeepAspect:y,style:x})}),c.updateData(f),this.group.add(c.group),f.eachItemGraphicEl(function(h){h.traverse(function(d){Le(d).dataModel=n})}),this.markKeep(c),c.group.silent=n.get("silent")||t.get("silent")},e.type="markPoint",e}(sM);function U2e(r,e,t){var n;r?n=K(r&&r.dimensions,function(s){var l=e.getData().getDimensionInfo(e.getData().mapDimension(s))||{};return W(W({},l),{name:s,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new fn(n,t),a=K(t.get("data"),Oe(lp,e));r&&(a=pt(a,Oe(up,r)));var o=O8(!!r,n);return i.initData(a,null,o),i}function Y2e(r){r.registerComponentModel(V2e),r.registerComponentView(W2e),r.registerPreprocessor(function(e){aM(e.series,"markPoint")&&(e.markPoint=e.markPoint||{})})}var q2e=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.createMarkerModelFromSeries=function(t,n,i){return new e(t,n,i)},e.type="markLine",e.defaultOption={z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},e}(Mo),pm=it(),X2e=function(r,e,t,n){var i=r.getData(),a;if(q(n))a=n;else{var o=n.type;if(o==="min"||o==="max"||o==="average"||o==="median"||n.xAxis!=null||n.yAxis!=null){var s=void 0,l=void 0;if(n.yAxis!=null||n.xAxis!=null)s=e.getAxis(n.yAxis!=null?"y":"x"),l=kr(n.yAxis,n.xAxis);else{var u=R8(n,i,e,r);s=u.valueAxis;var c=MF(i,u.valueDataDim);l=oM(i,c,o)}var f=s.dim==="x"?0:1,h=1-f,d=ke(n),p={coord:[]};d.type=null,d.coord=[],d.coord[h]=-1/0,p.coord[h]=1/0;var v=t.get("precision");v>=0&<(l)&&(l=+l.toFixed(Math.min(v,20))),d.coord[f]=p.coord[f]=l,a=[d,p,{type:o,valueIndex:n.valueIndex,value:l}]}else a=[]}var m=[lp(r,a[0]),lp(r,a[1]),W({},a[2])];return m[2].type=m[2].type||null,Be(m[2],m[0]),Be(m[2],m[1]),m};function Xy(r){return!isNaN(r)&&!isFinite(r)}function xj(r,e,t,n){var i=1-r,a=n.dimensions[r];return Xy(e[i])&&Xy(t[i])&&e[r]===t[r]&&n.getAxis(a).containData(e[r])}function K2e(r,e){if(r.type==="cartesian2d"){var t=e[0].coord,n=e[1].coord;if(t&&n&&(xj(1,t,n,r)||xj(0,t,n,r)))return!0}return up(r,e[0])&&up(r,e[1])}function Ax(r,e,t,n,i){var a=n.coordinateSystem,o=r.getItemModel(e),s,l=ie(o.get("x"),i.getWidth()),u=ie(o.get("y"),i.getHeight());if(!isNaN(l)&&!isNaN(u))s=[l,u];else{if(n.getMarkerPosition)s=n.getMarkerPosition(r.getValues(r.dimensions,e));else{var c=a.dimensions,f=r.get(c[0],e),h=r.get(c[1],e);s=a.dataToPoint([f,h])}if(Ou(a,"cartesian2d")){var d=a.getAxis("x"),p=a.getAxis("y"),c=a.dimensions;Xy(r.get(c[0],e))?s[0]=d.toGlobalCoord(d.getExtent()[t?0:1]):Xy(r.get(c[1],e))&&(s[1]=p.toGlobalCoord(p.getExtent()[t?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}r.setItemLayout(e,s)}var Z2e=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.updateTransform=function(t,n,i){n.eachSeries(function(a){var o=Mo.getMarkerModelFromSeries(a,"markLine");if(o){var s=o.getData(),l=pm(o).from,u=pm(o).to;l.each(function(c){Ax(l,c,!0,a,i),Ax(u,c,!1,a,i)}),s.each(function(c){s.setItemLayout(c,[l.getItemLayout(c),u.getItemLayout(c)])}),this.markerGroupMap.get(a.id).updateLayout()}},this)},e.prototype.renderSeries=function(t,n,i,a){var o=t.coordinateSystem,s=t.id,l=t.getData(),u=this.markerGroupMap,c=u.get(s)||u.set(s,new kA);this.group.add(c.group);var f=J2e(o,t,n),h=f.from,d=f.to,p=f.line;pm(n).from=h,pm(n).to=d,n.setData(p);var v=n.get("symbol"),m=n.get("symbolSize"),g=n.get("symbolRotate"),y=n.get("symbolOffset");q(v)||(v=[v,v]),q(m)||(m=[m,m]),q(g)||(g=[g,g]),q(y)||(y=[y,y]),f.from.each(function(_){b(h,_,!0),b(d,_,!1)}),p.each(function(_){var x=p.getItemModel(_).getModel("lineStyle").getLineStyle();p.setItemLayout(_,[h.getItemLayout(_),d.getItemLayout(_)]),x.stroke==null&&(x.stroke=h.getItemVisual(_,"style").fill),p.setItemVisual(_,{fromSymbolKeepAspect:h.getItemVisual(_,"symbolKeepAspect"),fromSymbolOffset:h.getItemVisual(_,"symbolOffset"),fromSymbolRotate:h.getItemVisual(_,"symbolRotate"),fromSymbolSize:h.getItemVisual(_,"symbolSize"),fromSymbol:h.getItemVisual(_,"symbol"),toSymbolKeepAspect:d.getItemVisual(_,"symbolKeepAspect"),toSymbolOffset:d.getItemVisual(_,"symbolOffset"),toSymbolRotate:d.getItemVisual(_,"symbolRotate"),toSymbolSize:d.getItemVisual(_,"symbolSize"),toSymbol:d.getItemVisual(_,"symbol"),style:x})}),c.updateData(p),f.line.eachItemGraphicEl(function(_){Le(_).dataModel=n,_.traverse(function(x){Le(x).dataModel=n})});function b(_,x,w){var S=_.getItemModel(x);Ax(_,x,w,t,a);var T=S.getModel("itemStyle").getItemStyle();T.fill==null&&(T.fill=Ep(l,"color")),_.setItemVisual(x,{symbolKeepAspect:S.get("symbolKeepAspect"),symbolOffset:Re(S.get("symbolOffset",!0),y[w?0:1]),symbolRotate:Re(S.get("symbolRotate",!0),g[w?0:1]),symbolSize:Re(S.get("symbolSize"),m[w?0:1]),symbol:Re(S.get("symbol",!0),v[w?0:1]),style:T})}this.markKeep(c),c.group.silent=n.get("silent")||t.get("silent")},e.type="markLine",e}(sM);function J2e(r,e,t){var n;r?n=K(r&&r.dimensions,function(u){var c=e.getData().getDimensionInfo(e.getData().mapDimension(u))||{};return W(W({},c),{name:u,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new fn(n,t),a=new fn(n,t),o=new fn([],t),s=K(t.get("data"),Oe(X2e,e,r,t));r&&(s=pt(s,Oe(K2e,r)));var l=O8(!!r,n);return i.initData(K(s,function(u){return u[0]}),null,l),a.initData(K(s,function(u){return u[1]}),null,l),o.initData(K(s,function(u){return u[2]})),o.hasItemOption=!0,{from:i,to:a,line:o}}function Q2e(r){r.registerComponentModel(q2e),r.registerComponentView(Z2e),r.registerPreprocessor(function(e){aM(e.series,"markLine")&&(e.markLine=e.markLine||{})})}var eSe=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.createMarkerModelFromSeries=function(t,n,i){return new e(t,n,i)},e.type="markArea",e.defaultOption={z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},e}(Mo),vm=it(),tSe=function(r,e,t,n){var i=n[0],a=n[1];if(!(!i||!a)){var o=lp(r,i),s=lp(r,a),l=o.coord,u=s.coord;l[0]=kr(l[0],-1/0),l[1]=kr(l[1],-1/0),u[0]=kr(u[0],1/0),u[1]=kr(u[1],1/0);var c=lC([{},o,s]);return c.coord=[o.coord,s.coord],c.x0=o.x,c.y0=o.y,c.x1=s.x,c.y1=s.y,c}};function Ky(r){return!isNaN(r)&&!isFinite(r)}function wj(r,e,t,n){var i=1-r;return Ky(e[i])&&Ky(t[i])}function rSe(r,e){var t=e.coord[0],n=e.coord[1],i={coord:t,x:e.x0,y:e.y0},a={coord:n,x:e.x1,y:e.y1};return Ou(r,"cartesian2d")?t&&n&&(wj(1,t,n)||wj(0,t,n))?!0:G2e(r,i,a):up(r,i)||up(r,a)}function Sj(r,e,t,n,i){var a=n.coordinateSystem,o=r.getItemModel(e),s,l=ie(o.get(t[0]),i.getWidth()),u=ie(o.get(t[1]),i.getHeight());if(!isNaN(l)&&!isNaN(u))s=[l,u];else{if(n.getMarkerPosition){var c=r.getValues(["x0","y0"],e),f=r.getValues(["x1","y1"],e),h=a.clampData(c),d=a.clampData(f),p=[];t[0]==="x0"?p[0]=h[0]>d[0]?f[0]:c[0]:p[0]=h[0]>d[0]?c[0]:f[0],t[1]==="y0"?p[1]=h[1]>d[1]?f[1]:c[1]:p[1]=h[1]>d[1]?c[1]:f[1],s=n.getMarkerPosition(p,t,!0)}else{var v=r.get(t[0],e),m=r.get(t[1],e),g=[v,m];a.clampData&&a.clampData(g,g),s=a.dataToPoint(g,!0)}if(Ou(a,"cartesian2d")){var y=a.getAxis("x"),b=a.getAxis("y"),v=r.get(t[0],e),m=r.get(t[1],e);Ky(v)?s[0]=y.toGlobalCoord(y.getExtent()[t[0]==="x0"?0:1]):Ky(m)&&(s[1]=b.toGlobalCoord(b.getExtent()[t[1]==="y0"?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}return s}var Tj=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],nSe=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.updateTransform=function(t,n,i){n.eachSeries(function(a){var o=Mo.getMarkerModelFromSeries(a,"markArea");if(o){var s=o.getData();s.each(function(l){var u=K(Tj,function(f){return Sj(s,l,f,a,i)});s.setItemLayout(l,u);var c=s.getItemGraphicEl(l);c.setShape("points",u)})}},this)},e.prototype.renderSeries=function(t,n,i,a){var o=t.coordinateSystem,s=t.id,l=t.getData(),u=this.markerGroupMap,c=u.get(s)||u.set(s,{group:new Ee});this.group.add(c.group),this.markKeep(c);var f=iSe(o,t,n);n.setData(f),f.each(function(h){var d=K(Tj,function(T){return Sj(f,h,T,t,a)}),p=o.getAxis("x").scale,v=o.getAxis("y").scale,m=p.getExtent(),g=v.getExtent(),y=[p.parse(f.get("x0",h)),p.parse(f.get("x1",h))],b=[v.parse(f.get("y0",h)),v.parse(f.get("y1",h))];ci(y),ci(b);var _=!(m[0]>y[1]||m[1]b[1]||g[1]=0},e.prototype.getOrient=function(){return this.get("orient")==="vertical"?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},e.type="legend.plain",e.dependencies=["series"],e.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},e}(Qe),fc=Oe,AS=k,mm=Ee,j8=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.newlineDisabled=!1,t}return e.prototype.init=function(){this.group.add(this._contentGroup=new mm),this.group.add(this._selectorGroup=new mm),this._isFirstRender=!0},e.prototype.getContentGroup=function(){return this._contentGroup},e.prototype.getSelectorGroup=function(){return this._selectorGroup},e.prototype.render=function(t,n,i){var a=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!t.get("show",!0)){var o=t.get("align"),s=t.get("orient");(!o||o==="auto")&&(o=t.get("left")==="right"&&s==="vertical"?"right":"left");var l=t.get("selector",!0),u=t.get("selectorPosition",!0);l&&(!u||u==="auto")&&(u=s==="horizontal"?"end":"start"),this.renderInner(o,t,n,i,l,s,u);var c=t.getBoxLayoutParams(),f={width:i.getWidth(),height:i.getHeight()},h=t.get("padding"),d=gr(c,f,h),p=this.layoutInner(t,o,d,a,l,u),v=gr(Ce({width:p.width,height:p.height},c),f,h);this.group.x=v.x-p.x,this.group.y=v.y-p.y,this.group.markRedraw(),this.group.add(this._backgroundEl=T8(p,t))}},e.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},e.prototype.renderInner=function(t,n,i,a,o,s,l){var u=this.getContentGroup(),c=ve(),f=n.get("selectedMode"),h=[];i.eachRawSeries(function(d){!d.get("legendHoverLink")&&h.push(d.id)}),AS(n.getData(),function(d,p){var v=d.get("name");if(!this.newlineDisabled&&(v===""||v===` `)){var m=new mm;m.newline=!0,u.add(m);return}var g=i.getSeriesByName(v)[0];if(!c.get(v))if(g){var y=g.getData(),b=y.getVisual("legendLineStyle")||{},_=y.getVisual("legendIcon"),x=y.getVisual("style"),w=this._createItem(g,v,p,d,n,t,b,x,_,f,a);w.on("click",fc(Cj,v,null,a,h)).on("mouseover",fc(MS,g.name,null,a,h)).on("mouseout",fc(kS,g.name,null,a,h)),i.ssr&&w.eachChild(function(S){var T=Le(S);T.seriesIndex=g.seriesIndex,T.dataIndex=p,T.ssrType="legend"}),c.set(v,!0)}else i.eachRawSeries(function(S){if(!c.get(v)&&S.legendVisualProvider){var T=S.legendVisualProvider;if(!T.containName(v))return;var C=T.indexOfName(v),A=T.getItemVisual(C,"style"),M=T.getItemVisual(C,"legendIcon"),D=Fn(A.fill);D&&D[3]===0&&(D[3]=.2,A=W(W({},A),{fill:ho(D,"rgba")}));var E=this._createItem(S,v,p,d,n,t,{},A,M,f,a);E.on("click",fc(Cj,null,v,a,h)).on("mouseover",fc(MS,null,v,a,h)).on("mouseout",fc(kS,null,v,a,h)),i.ssr&&E.eachChild(function(L){var I=Le(L);I.seriesIndex=S.seriesIndex,I.dataIndex=p,I.ssrType="legend"}),c.set(v,!0)}},this)},this),o&&this._createSelector(o,n,a,s,l)},e.prototype._createSelector=function(t,n,i,a,o){var s=this.getSelectorGroup();AS(t,function(u){var c=u.type,f=new ot({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:c==="all"?"legendAllSelect":"legendInverseSelect",legendId:n.id})}});s.add(f);var h=n.getModel("selectorLabel"),d=n.getModel(["emphasis","selectorLabel"]);Vr(f,{normal:h,emphasis:d},{defaultText:u.title}),ru(f)})},e.prototype._createItem=function(t,n,i,a,o,s,l,u,c,f,h){var d=t.visualDrawType,p=o.get("itemWidth"),v=o.get("itemHeight"),m=o.isSelected(n),g=a.get("symbolRotate"),y=a.get("symbolKeepAspect"),b=a.get("icon");c=b||c||"roundRect";var _=sSe(c,a,l,u,d,m,h),x=new mm,w=a.getModel("textStyle");if(Te(t.getLegendIcon)&&(!b||b==="inherit"))x.add(t.getLegendIcon({itemWidth:p,itemHeight:v,icon:c,iconRotate:g,itemStyle:_.itemStyle,lineStyle:_.lineStyle,symbolKeepAspect:y}));else{var S=b==="inherit"&&t.getData().getVisual("symbol")?g==="inherit"?t.getData().getVisual("symbolRotate"):g:0;x.add(lSe({itemWidth:p,itemHeight:v,icon:c,iconRotate:S,itemStyle:_.itemStyle,symbolKeepAspect:y}))}var T=s==="left"?p+5:-5,C=s,A=o.get("formatter"),M=n;se(A)&&A?M=A.replace("{name}",n??""):Te(A)&&(M=A(n));var D=m?w.getTextColor():a.get("inactiveColor");x.add(new ot({style:Et(w,{text:M,x:T,y:v/2,fill:D,align:C,verticalAlign:"middle"},{inheritColor:D})}));var E=new nt({shape:x.getBoundingRect(),style:{fill:"transparent"}}),L=a.getModel("tooltip");return L.get("show")&&Lu({el:E,componentModel:o,itemName:n,itemTooltipOption:L.option}),x.add(E),x.eachChild(function(I){I.silent=!0}),E.silent=!f,this.getContentGroup().add(x),ru(x),x.__legendDataIndex=i,x},e.prototype.layoutInner=function(t,n,i,a,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();iu(t.get("orient"),l,t.get("itemGap"),i.width,i.height);var c=l.getBoundingRect(),f=[-c.x,-c.y];if(u.markRedraw(),l.markRedraw(),o){iu("horizontal",u,t.get("selectorItemGap",!0));var h=u.getBoundingRect(),d=[-h.x,-h.y],p=t.get("selectorButtonGap",!0),v=t.getOrient().index,m=v===0?"width":"height",g=v===0?"height":"width",y=v===0?"y":"x";s==="end"?d[v]+=c[m]+p:f[v]+=h[m]+p,d[1-v]+=c[g]/2-h[g]/2,u.x=d[0],u.y=d[1],l.x=f[0],l.y=f[1];var b={x:0,y:0};return b[m]=c[m]+p+h[m],b[g]=Math.max(c[g],h[g]),b[y]=Math.min(0,h[y]+d[1-v]),b}else return l.x=f[0],l.y=f[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e}(zt);function sSe(r,e,t,n,i,a,o){function s(m,g){m.lineWidth==="auto"&&(m.lineWidth=g.lineWidth>0?2:0),AS(m,function(y,b){m[b]==="inherit"&&(m[b]=g[b])})}var l=e.getModel("itemStyle"),u=l.getItemStyle(),c=r.lastIndexOf("empty",0)===0?"fill":"stroke",f=l.getShallow("decal");u.decal=!f||f==="inherit"?n.decal:rf(f,o),u.fill==="inherit"&&(u.fill=n[i]),u.stroke==="inherit"&&(u.stroke=n[c]),u.opacity==="inherit"&&(u.opacity=(i==="fill"?n:t).opacity),s(u,n);var h=e.getModel("lineStyle"),d=h.getLineStyle();if(s(d,t),u.fill==="auto"&&(u.fill=n.fill),u.stroke==="auto"&&(u.stroke=n.fill),d.stroke==="auto"&&(d.stroke=n.fill),!a){var p=e.get("inactiveBorderWidth"),v=u[c];u.lineWidth=p==="auto"?n.lineWidth>0&&v?2:0:u.lineWidth,u.fill=e.get("inactiveColor"),u.stroke=e.get("inactiveBorderColor"),d.stroke=h.get("inactiveColor"),d.lineWidth=h.get("inactiveWidth")}return{itemStyle:u,lineStyle:d}}function lSe(r){var e=r.icon||"roundRect",t=ur(e,0,0,r.itemWidth,r.itemHeight,r.itemStyle.fill,r.symbolKeepAspect);return t.setStyle(r.itemStyle),t.rotation=(r.iconRotate||0)*Math.PI/180,t.setOrigin([r.itemWidth/2,r.itemHeight/2]),e.indexOf("empty")>-1&&(t.style.stroke=t.style.fill,t.style.fill="#fff",t.style.lineWidth=2),t}function Cj(r,e,t,n){kS(r,e,t,n),t.dispatchAction({type:"legendToggleSelect",name:r??e}),MS(r,e,t,n)}function N8(r){for(var e=r.getZr().storage.getDisplayList(),t,n=0,i=e.length;ni[o],m=[-d.x,-d.y];n||(m[a]=c[u]);var g=[0,0],y=[-p.x,-p.y],b=Re(t.get("pageButtonGap",!0),t.get("itemGap",!0));if(v){var _=t.get("pageButtonPosition",!0);_==="end"?y[a]+=i[o]-p[o]:g[a]+=p[o]+b}y[1-a]+=d[s]/2-p[s]/2,c.setPosition(m),f.setPosition(g),h.setPosition(y);var x={x:0,y:0};if(x[o]=v?i[o]:d[o],x[s]=Math.max(d[s],p[s]),x[l]=Math.min(0,p[l]+y[1-a]),f.__rectSize=i[o],v){var w={x:0,y:0};w[o]=Math.max(i[o]-p[o]-b,0),w[s]=x[s],f.setClipPath(new nt({shape:w})),f.__rectSize=w[o]}else h.eachChild(function(T){T.attr({invisible:!0,silent:!0})});var S=this._getPageInfo(t);return S.pageIndex!=null&&ut(c,{x:S.contentPosition[0],y:S.contentPosition[1]},v?t:null),this._updatePageInfoView(t,S),x},e.prototype._pageGo=function(t,n,i){var a=this._getPageInfo(n)[t];a!=null&&i.dispatchAction({type:"legendScroll",scrollDataIndex:a,legendId:n.id})},e.prototype._updatePageInfoView=function(t,n){var i=this._controllerGroup;k(["pagePrev","pageNext"],function(c){var f=c+"DataIndex",h=n[f]!=null,d=i.childOfName(c);d&&(d.setStyle("fill",h?t.get("pageIconColor",!0):t.get("pageIconInactiveColor",!0)),d.cursor=h?"pointer":"default")});var a=i.childOfName("pageText"),o=t.get("pageFormatter"),s=n.pageIndex,l=s!=null?s+1:0,u=n.pageCount;a&&o&&a.setStyle("text",se(o)?o.replace("{current}",l==null?"":l+"").replace("{total}",u==null?"":u+""):o({current:l,total:u}))},e.prototype._getPageInfo=function(t){var n=t.get("scrollDataIndex",!0),i=this.getContentGroup(),a=this._containerGroup.__rectSize,o=t.getOrient().index,s=Mx[o],l=kx[o],u=this._findTargetItemIndex(n),c=i.children(),f=c[u],h=c.length,d=h?1:0,p={contentPosition:[i.x,i.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!f)return p;var v=_(f);p.contentPosition[o]=-v.s;for(var m=u+1,g=v,y=v,b=null;m<=h;++m)b=_(c[m]),(!b&&y.e>g.s+a||b&&!x(b,g.s))&&(y.i>g.i?g=y:g=b,g&&(p.pageNextDataIndex==null&&(p.pageNextDataIndex=g.i),++p.pageCount)),y=b;for(var m=u-1,g=v,y=v,b=null;m>=-1;--m)b=_(c[m]),(!b||!x(y,b.s))&&g.i=S&&w.s<=S+a}},e.prototype._findTargetItemIndex=function(t){if(!this._showController)return 0;var n,i=this.getContentGroup(),a;return i.eachChild(function(o,s){var l=o.__legendDataIndex;a==null&&l!=null&&(a=s),l===t&&(n=s)}),n??a},e.type="legend.scroll",e}(j8);function dSe(r){r.registerAction("legendScroll","legendscroll",function(e,t){var n=e.scrollDataIndex;n!=null&&t.eachComponent({mainType:"legend",subType:"scroll",query:e},function(i){i.setScrollDataIndex(n)})})}function pSe(r){Ue(B8),r.registerComponentModel(fSe),r.registerComponentView(hSe),dSe(r)}function vSe(r){Ue(B8),Ue(pSe)}var mSe=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="dataZoom.inside",e.defaultOption=$s(sp.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e}(sp),lM=it();function gSe(r,e,t){lM(r).coordSysRecordMap.each(function(n){var i=n.dataZoomInfoMap.get(e.uid);i&&(i.getRange=t)})}function ySe(r,e){for(var t=lM(r).coordSysRecordMap,n=t.keys(),i=0;in[t+e]&&(e=s),i=i&&o.get("preventDefaultMouseMove",!0)}),{controlType:e,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!i}}}function SSe(r){r.registerProcessor(r.PRIORITY.PROCESSOR.FILTER,function(e,t){var n=lM(t),i=n.coordSysRecordMap||(n.coordSysRecordMap=ve());i.each(function(a){a.dataZoomInfoMap=null}),e.eachComponent({mainType:"dataZoom",subType:"inside"},function(a){var o=x8(a);k(o.infoList,function(s){var l=s.model.uid,u=i.get(l)||i.set(l,bSe(t,s.model)),c=u.dataZoomInfoMap||(u.dataZoomInfoMap=ve());c.set(a.uid,{dzReferCoordSysInfo:s,model:a,getRange:null})})}),i.each(function(a){var o=a.controller,s,l=a.dataZoomInfoMap;if(l){var u=l.keys()[0];u!=null&&(s=l.get(u))}if(!s){z8(i,a);return}var c=wSe(l);o.enable(c.controlType,c.opt),o.setPointerChecker(a.containsPoint),Mf(a,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var TSe=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="dataZoom.inside",t}return e.prototype.render=function(t,n,i){if(r.prototype.render.apply(this,arguments),t.noTarget()){this._clear();return}this.range=t.getPercentRange(),gSe(i,t,{pan:ue(Dx.pan,this),zoom:ue(Dx.zoom,this),scrollMove:ue(Dx.scrollMove,this)})},e.prototype.dispose=function(){this._clear(),r.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){ySe(this.api,this.dataZoomModel),this.range=null},e.type="dataZoom.inside",e}(QA),Dx={zoom:function(r,e,t,n){var i=this.range,a=i.slice(),o=r.axisModels[0];if(o){var s=Ex[e](null,[n.originX,n.originY],o,t,r),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],u=Math.max(1/n.scale,0);a[0]=(a[0]-l)*u+l,a[1]=(a[1]-l)*u+l;var c=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(Nu(0,a,[0,100],0,c.minSpan,c.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:Dj(function(r,e,t,n,i,a){var o=Ex[n]([a.oldX,a.oldY],[a.newX,a.newY],e,i,t);return o.signal*(r[1]-r[0])*o.pixel/o.pixelLength}),scrollMove:Dj(function(r,e,t,n,i,a){var o=Ex[n]([0,0],[a.scrollDelta,a.scrollDelta],e,i,t);return o.signal*(r[1]-r[0])*a.scrollDelta})};function Dj(r){return function(e,t,n,i){var a=this.range,o=a.slice(),s=e.axisModels[0];if(s){var l=r(o,s,e,t,n,i);if(Nu(l,o,[0,100],"all"),this.range=o,a[0]!==o[0]||a[1]!==o[1])return o}}}var Ex={grid:function(r,e,t,n,i){var a=t.axis,o={},s=i.model.coordinateSystem.getRect();return r=r||[0,0],a.dim==="x"?(o.pixel=e[0]-r[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=e[1]-r[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o},polar:function(r,e,t,n,i){var a=t.axis,o={},s=i.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return r=r?s.pointToCoord(r):[0,0],e=s.pointToCoord(e),t.mainType==="radiusAxis"?(o.pixel=e[0]-r[0],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?1:-1):(o.pixel=e[1]-r[1],o.pixelLength=u[1]-u[0],o.pixelStart=u[0],o.signal=a.inverse?-1:1),o},singleAxis:function(r,e,t,n,i){var a=t.axis,o=i.model.coordinateSystem.getRect(),s={};return r=r||[0,0],a.orient==="horizontal"?(s.pixel=e[0]-r[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=e[1]-r[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s}};function F8(r){eM(r),r.registerComponentModel(mSe),r.registerComponentView(TSe),SSe(r)}var CSe=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="dataZoom.slider",e.layoutMode="box",e.defaultOption=$s(sp.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleLabel:{show:!0},handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),e}(sp),yh=nt,Ej=7,ASe=1,Lx=30,MSe=7,bh="horizontal",Lj="vertical",kSe=5,DSe=["line","bar","candlestick","scatter"],ESe={easing:"cubicOut",duration:100,delay:0},LSe=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._displayables={},t}return e.prototype.init=function(t,n){this.api=n,this._onBrush=ue(this._onBrush,this),this._onBrushEnd=ue(this._onBrushEnd,this)},e.prototype.render=function(t,n,i,a){if(r.prototype.render.apply(this,arguments),Mf(this,"_dispatchZoomAction",t.get("throttle"),"fixRate"),this._orient=t.getOrient(),t.get("show")===!1){this.group.removeAll();return}if(t.noTarget()){this._clear(),this.group.removeAll();return}(!a||a.type!=="dataZoom"||a.from!==this.uid)&&this._buildView(),this._updateView()},e.prototype.dispose=function(){this._clear(),r.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){qd(this,"_dispatchZoomAction");var t=this.api.getZr();t.off("mousemove",this._onBrush),t.off("mouseup",this._onBrushEnd)},e.prototype._buildView=function(){var t=this.group;t.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var n=this._displayables.sliderGroup=new Ee;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),t.add(n),this._positionGroup()},e.prototype._resetLocation=function(){var t=this.dataZoomModel,n=this.api,i=t.get("brushSelect"),a=i?MSe:0,o=this._findCoordRect(),s={width:n.getWidth(),height:n.getHeight()},l=this._orient===bh?{right:s.width-o.x-o.width,top:s.height-Lx-Ej-a,width:o.width,height:Lx}:{right:Ej,top:o.y,width:Lx,height:o.height},u=Tf(t.option);k(["right","top","width","height"],function(f){u[f]==="ph"&&(u[f]=l[f])});var c=gr(u,s);this._location={x:c.x,y:c.y},this._size=[c.width,c.height],this._orient===Lj&&this._size.reverse()},e.prototype._positionGroup=function(){var t=this.group,n=this._location,i=this._orient,a=this.dataZoomModel.getFirstTargetAxisModel(),o=a&&a.get("inverse"),s=this._displayables.sliderGroup,l=(this._dataShadowInfo||{}).otherAxisInverse;s.attr(i===bh&&!o?{scaleY:l?1:-1,scaleX:1}:i===bh&&o?{scaleY:l?1:-1,scaleX:-1}:i===Lj&&!o?{scaleY:l?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:l?-1:1,scaleX:-1,rotation:Math.PI/2});var u=t.getBoundingRect([s]);t.x=n.x-u.x,t.y=n.y-u.y,t.markRedraw()},e.prototype._getViewExtent=function(){return[0,this._size[0]]},e.prototype._renderBackground=function(){var t=this.dataZoomModel,n=this._size,i=this._displayables.sliderGroup,a=t.get("brushSelect");i.add(new yh({silent:!0,shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:t.get("backgroundColor")},z2:-40}));var o=new yh({shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:"transparent"},z2:0,onclick:ue(this._onClickPanel,this)}),s=this.api.getZr();a?(o.on("mousedown",this._onBrushStart,this),o.cursor="crosshair",s.on("mousemove",this._onBrush),s.on("mouseup",this._onBrushEnd)):(s.off("mousemove",this._onBrush),s.off("mouseup",this._onBrushEnd)),i.add(o)},e.prototype._renderDataShadow=function(){var t=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],!t)return;var n=this._size,i=this._shadowSize||[],a=t.series,o=a.getRawData(),s=a.getShadowDim&&a.getShadowDim(),l=s&&o.getDimensionInfo(s)?a.getShadowDim():t.otherDim;if(l==null)return;var u=this._shadowPolygonPts,c=this._shadowPolylinePts;if(o!==this._shadowData||l!==this._shadowDim||n[0]!==i[0]||n[1]!==i[1]){var f=o.getDataExtent(l),h=(f[1]-f[0])*.3;f=[f[0]-h,f[1]+h];var d=[0,n[1]],p=[0,n[0]],v=[[n[0],0],[0,0]],m=[],g=p[1]/(o.count()-1),y=0,b=Math.round(o.count()/n[0]),_;o.each([l],function(C,A){if(b>0&&A%b){y+=g;return}var M=C==null||isNaN(C)||C==="",D=M?0:bt(C,f,d,!0);M&&!_&&A?(v.push([v[v.length-1][0],0]),m.push([m[m.length-1][0],0])):!M&&_&&(v.push([y,0]),m.push([y,0])),v.push([y,D]),m.push([y,D]),y+=g,_=M}),u=this._shadowPolygonPts=v,c=this._shadowPolylinePts=m}this._shadowData=o,this._shadowDim=l,this._shadowSize=[n[0],n[1]];var x=this.dataZoomModel;function w(C){var A=x.getModel(C?"selectedDataBackground":"dataBackground"),M=new Ee,D=new yn({shape:{points:u},segmentIgnoreThreshold:1,style:A.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),E=new bn({shape:{points:c},segmentIgnoreThreshold:1,style:A.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return M.add(D),M.add(E),M}for(var S=0;S<3;S++){var T=w(S===1);this._displayables.sliderGroup.add(T),this._displayables.dataShadowSegs.push(T)}},e.prototype._prepareDataShadowInfo=function(){var t=this.dataZoomModel,n=t.get("showDataShadow");if(n!==!1){var i,a=this.ecModel;return t.eachTargetAxis(function(o,s){var l=t.getAxisProxy(o,s).getTargetSeriesModels();k(l,function(u){if(!i&&!(n!==!0&&He(DSe,u.get("type"))<0)){var c=a.getComponent(vs(o),s).axis,f=ISe(o),h,d=u.coordinateSystem;f!=null&&d.getOtherAxis&&(h=d.getOtherAxis(c).inverse),f=u.getData().mapDimension(f),i={thisAxis:c,series:u,thisDim:o,otherDim:f,otherAxisInverse:h}}},this)},this),i}},e.prototype._renderHandle=function(){var t=this.group,n=this._displayables,i=n.handles=[null,null],a=n.handleLabels=[null,null],o=this._displayables.sliderGroup,s=this._size,l=this.dataZoomModel,u=this.api,c=l.get("borderRadius")||0,f=l.get("brushSelect"),h=n.filler=new yh({silent:f,style:{fill:l.get("fillerColor")},textConfig:{position:"inside"}});o.add(h),o.add(new yh({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:s[0],height:s[1],r:c},style:{stroke:l.get("dataBackgroundColor")||l.get("borderColor"),lineWidth:ASe,fill:"rgba(0,0,0,0)"}})),k([0,1],function(b){var _=l.get("handleIcon");!Ay[_]&&_.indexOf("path://")<0&&_.indexOf("image://")<0&&(_="path://"+_);var x=ur(_,-1,0,2,2,null,!0);x.attr({cursor:Ij(this._orient),draggable:!0,drift:ue(this._onDragMove,this,b),ondragend:ue(this._onDragEnd,this),onmouseover:ue(this._showDataInfo,this,!0),onmouseout:ue(this._showDataInfo,this,!1),z2:5});var w=x.getBoundingRect(),S=l.get("handleSize");this._handleHeight=ie(S,this._size[1]),this._handleWidth=w.width/w.height*this._handleHeight,x.setStyle(l.getModel("handleStyle").getItemStyle()),x.style.strokeNoScale=!0,x.rectHover=!0,x.ensureState("emphasis").style=l.getModel(["emphasis","handleStyle"]).getItemStyle(),ru(x);var T=l.get("handleColor");T!=null&&(x.style.fill=T),o.add(i[b]=x);var C=l.getModel("textStyle"),A=l.get("handleLabel")||{},M=A.show||!1;t.add(a[b]=new ot({silent:!0,invisible:!M,style:Et(C,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:C.getTextColor(),font:C.getFont()}),z2:10}))},this);var d=h;if(f){var p=ie(l.get("moveHandleSize"),s[1]),v=n.moveHandle=new nt({style:l.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:s[1]-.5,height:p}}),m=p*.8,g=n.moveHandleIcon=ur(l.get("moveHandleIcon"),-m/2,-m/2,m,m,"#fff",!0);g.silent=!0,g.y=s[1]+p/2-.5,v.ensureState("emphasis").style=l.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var y=Math.min(s[1]/2,Math.max(p,10));d=n.moveZone=new nt({invisible:!0,shape:{y:s[1]-y,height:p+y}}),d.on("mouseover",function(){u.enterEmphasis(v)}).on("mouseout",function(){u.leaveEmphasis(v)}),o.add(v),o.add(g),o.add(d)}d.attr({draggable:!0,cursor:Ij(this._orient),drift:ue(this._onDragMove,this,"all"),ondragstart:ue(this._showDataInfo,this,!0),ondragend:ue(this._onDragEnd,this),onmouseover:ue(this._showDataInfo,this,!0),onmouseout:ue(this._showDataInfo,this,!1)})},e.prototype._resetInterval=function(){var t=this._range=this.dataZoomModel.getPercentRange(),n=this._getViewExtent();this._handleEnds=[bt(t[0],[0,100],n,!0),bt(t[1],[0,100],n,!0)]},e.prototype._updateInterval=function(t,n){var i=this.dataZoomModel,a=this._handleEnds,o=this._getViewExtent(),s=i.findRepresentativeAxisProxy().getMinMaxSpan(),l=[0,100];Nu(n,a,o,i.get("zoomLock")?"all":t,s.minSpan!=null?bt(s.minSpan,l,o,!0):null,s.maxSpan!=null?bt(s.maxSpan,l,o,!0):null);var u=this._range,c=this._range=ci([bt(a[0],o,l,!0),bt(a[1],o,l,!0)]);return!u||u[0]!==c[0]||u[1]!==c[1]},e.prototype._updateView=function(t){var n=this._displayables,i=this._handleEnds,a=ci(i.slice()),o=this._size;k([0,1],function(d){var p=n.handles[d],v=this._handleHeight;p.attr({scaleX:v/2,scaleY:v/2,x:i[d]+(d?-1:1),y:o[1]/2-v/2})},this),n.filler.setShape({x:a[0],y:0,width:a[1]-a[0],height:o[1]});var s={x:a[0],width:a[1]-a[0]};n.moveHandle&&(n.moveHandle.setShape(s),n.moveZone.setShape(s),n.moveZone.getBoundingRect(),n.moveHandleIcon&&n.moveHandleIcon.attr("x",s.x+s.width/2));for(var l=n.dataShadowSegs,u=[0,a[0],a[1],o[0]],c=0;cn[0]||i[1]<0||i[1]>n[1])){var a=this._handleEnds,o=(a[0]+a[1])/2,s=this._updateInterval("all",i[0]-o);this._updateView(),s&&this._dispatchZoomAction(!1)}},e.prototype._onBrushStart=function(t){var n=t.offsetX,i=t.offsetY;this._brushStart=new ze(n,i),this._brushing=!0,this._brushStartTime=+new Date},e.prototype._onBrushEnd=function(t){if(this._brushing){var n=this._displayables.brushRect;if(this._brushing=!1,!!n){n.attr("ignore",!0);var i=n.shape,a=+new Date;if(!(a-this._brushStartTime<200&&Math.abs(i.width)<5)){var o=this._getViewExtent(),s=[0,100];this._range=ci([bt(i.x,o,s,!0),bt(i.x+i.width,o,s,!0)]),this._handleEnds=[i.x,i.x+i.width],this._updateView(),this._dispatchZoomAction(!1)}}}},e.prototype._onBrush=function(t){this._brushing&&(_o(t.event),this._updateBrushRect(t.offsetX,t.offsetY))},e.prototype._updateBrushRect=function(t,n){var i=this._displayables,a=this.dataZoomModel,o=i.brushRect;o||(o=i.brushRect=new yh({silent:!0,style:a.getModel("brushStyle").getItemStyle()}),i.sliderGroup.add(o)),o.attr("ignore",!1);var s=this._brushStart,l=this._displayables.sliderGroup,u=l.transformCoordToLocal(t,n),c=l.transformCoordToLocal(s.x,s.y),f=this._size;u[0]=Math.max(Math.min(f[0],u[0]),0),o.setShape({x:c[0],y:0,width:u[0]-c[0],height:f[1]})},e.prototype._dispatchZoomAction=function(t){var n=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:t?ESe:null,start:n[0],end:n[1]})},e.prototype._findCoordRect=function(){var t,n=x8(this.dataZoomModel).infoList;if(!t&&n.length){var i=n[0].model.coordinateSystem;t=i.getRect&&i.getRect()}if(!t){var a=this.api.getWidth(),o=this.api.getHeight();t={x:a*.2,y:o*.2,width:a*.6,height:o*.6}}return t},e.type="dataZoom.slider",e}(QA);function ISe(r){var e={x:"y",y:"x",radius:"angle",angle:"radius"};return e[r]}function Ij(r){return r==="vertical"?"ns-resize":"ew-resize"}function V8(r){r.registerComponentModel(CSe),r.registerComponentView(LSe),eM(r)}function PSe(r){Ue(F8),Ue(V8)}var $8={get:function(r,e,t){var n=ke((RSe[r]||{})[e]);return t&&q(n)?n[n.length-1]:n}},RSe={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}},Pj=Sr.mapVisual,OSe=Sr.eachVisual,jSe=q,Rj=k,NSe=ci,BSe=bt,Zy=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.stateList=["inRange","outOfRange"],t.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],t.layoutMode={type:"box",ignoreSize:!0},t.dataBound=[-1/0,1/0],t.targetVisuals={},t.controllerVisuals={},t}return e.prototype.init=function(t,n,i){this.mergeDefaultAndTheme(t,i)},e.prototype.optionUpdated=function(t,n){var i=this.option;!n&&L8(i,t,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},e.prototype.resetVisual=function(t){var n=this.stateList;t=ue(t,this),this.controllerVisuals=wS(this.option.controller,n,t),this.targetVisuals=wS(this.option.target,n,t)},e.prototype.getItemSymbol=function(){return null},e.prototype.getTargetSeriesIndices=function(){var t=this.option.seriesIndex,n=[];return t==null||t==="all"?this.ecModel.eachSeries(function(i,a){n.push(a)}):n=wt(t),n},e.prototype.eachTargetSeries=function(t,n){k(this.getTargetSeriesIndices(),function(i){var a=this.ecModel.getSeriesByIndex(i);a&&t.call(n,a)},this)},e.prototype.isTargetSeries=function(t){var n=!1;return this.eachTargetSeries(function(i){i===t&&(n=!0)}),n},e.prototype.formatValueText=function(t,n,i){var a=this.option,o=a.precision,s=this.dataBound,l=a.formatter,u;i=i||["<",">"],q(t)&&(t=t.slice(),u=!0);var c=n?t:u?[f(t[0]),f(t[1])]:f(t);if(se(l))return l.replace("{value}",u?c[0]:c).replace("{value2}",u?c[1]:c);if(Te(l))return u?l(t[0],t[1]):l(t);if(u)return t[0]===s[0]?i[0]+" "+c[1]:t[1]===s[1]?i[1]+" "+c[0]:c[0]+" - "+c[1];return c;function f(h){return h===s[0]?"min":h===s[1]?"max":(+h).toFixed(Math.min(o,20))}},e.prototype.resetExtent=function(){var t=this.option,n=NSe([t.min,t.max]);this._dataExtent=n},e.prototype.getDataDimensionIndex=function(t){var n=this.option.dimension;if(n!=null)return t.getDimensionIndex(n);for(var i=t.dimensions,a=i.length-1;a>=0;a--){var o=i[a],s=t.getDimensionInfo(o);if(!s.isCalculationCoord)return s.storeDimIndex}},e.prototype.getExtent=function(){return this._dataExtent.slice()},e.prototype.completeVisualOption=function(){var t=this.ecModel,n=this.option,i={inRange:n.inRange,outOfRange:n.outOfRange},a=n.target||(n.target={}),o=n.controller||(n.controller={});Be(a,i),Be(o,i);var s=this.isCategory();l.call(this,a),l.call(this,o),u.call(this,a,"inRange","outOfRange"),c.call(this,o);function l(f){jSe(n.color)&&!f.inRange&&(f.inRange={color:n.color.slice().reverse()}),f.inRange=f.inRange||{color:t.get("gradientColor")}}function u(f,h,d){var p=f[h],v=f[d];p&&!v&&(v=f[d]={},Rj(p,function(m,g){if(Sr.isValidType(g)){var y=$8.get(g,"inactive",s);y!=null&&(v[g]=y,g==="color"&&!v.hasOwnProperty("opacity")&&!v.hasOwnProperty("colorAlpha")&&(v.opacity=[0,0]))}}))}function c(f){var h=(f.inRange||{}).symbol||(f.outOfRange||{}).symbol,d=(f.inRange||{}).symbolSize||(f.outOfRange||{}).symbolSize,p=this.get("inactiveColor"),v=this.getItemSymbol(),m=v||"roundRect";Rj(this.stateList,function(g){var y=this.itemSize,b=f[g];b||(b=f[g]={color:s?p:[p]}),b.symbol==null&&(b.symbol=h&&ke(h)||(s?m:[m])),b.symbolSize==null&&(b.symbolSize=d&&ke(d)||(s?y[0]:[y[0],y[0]])),b.symbol=Pj(b.symbol,function(w){return w==="none"?m:w});var _=b.symbolSize;if(_!=null){var x=-1/0;OSe(_,function(w){w>x&&(x=w)}),b.symbolSize=Pj(_,function(w){return BSe(w,[0,x],[0,y[0]],!0)})}},this)}},e.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},e.prototype.isCategory=function(){return!!this.option.categories},e.prototype.setSelected=function(t){},e.prototype.getSelected=function(){return null},e.prototype.getValueState=function(t){return null},e.prototype.getVisualMeta=function(t){return null},e.type="visualMap",e.dependencies=["series"],e.defaultOption={show:!0,z:4,seriesIndex:"all",min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,textStyle:{color:"#333"}},e}(Qe),Oj=[20,140],zSe=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.optionUpdated=function(t,n){r.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(i){i.mappingMethod="linear",i.dataExtent=this.getExtent()}),this._resetRange()},e.prototype.resetItemSize=function(){r.prototype.resetItemSize.apply(this,arguments);var t=this.itemSize;(t[0]==null||isNaN(t[0]))&&(t[0]=Oj[0]),(t[1]==null||isNaN(t[1]))&&(t[1]=Oj[1])},e.prototype._resetRange=function(){var t=this.getExtent(),n=this.option.range;!n||n.auto?(t.auto=1,this.option.range=t):q(n)&&(n[0]>n[1]&&n.reverse(),n[0]=Math.max(n[0],t[0]),n[1]=Math.min(n[1],t[1]))},e.prototype.completeVisualOption=function(){r.prototype.completeVisualOption.apply(this,arguments),k(this.stateList,function(t){var n=this.option.controller[t].symbolSize;n&&n[0]!==n[1]&&(n[0]=n[1]/3)},this)},e.prototype.setSelected=function(t){this.option.range=t.slice(),this._resetRange()},e.prototype.getSelected=function(){var t=this.getExtent(),n=ci((this.get("range")||[]).slice());return n[0]>t[1]&&(n[0]=t[1]),n[1]>t[1]&&(n[1]=t[1]),n[0]=i[1]||t<=n[1])?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var n=[];return this.eachTargetSeries(function(i){var a=[],o=i.getData();o.each(this.getDataDimensionIndex(o),function(s,l){t[0]<=s&&s<=t[1]&&a.push(l)},this),n.push({seriesId:i.id,dataIndex:a})},this),n},e.prototype.getVisualMeta=function(t){var n=jj(this,"outOfRange",this.getExtent()),i=jj(this,"inRange",this.option.range.slice()),a=[];function o(d,p){a.push({value:d,color:t(d,p)})}for(var s=0,l=0,u=i.length,c=n.length;lt[1])break;a.push({color:this.getControllerVisual(l,"color",n),offset:s/i})}return a.push({color:this.getControllerVisual(t[1],"color",n),offset:1}),a},e.prototype._createBarPoints=function(t,n){var i=this.visualMapModel.itemSize;return[[i[0]-n[0],t[0]],[i[0],t[0]],[i[0],t[1]],[i[0]-n[1],t[1]]]},e.prototype._createBarGroup=function(t){var n=this._orient,i=this.visualMapModel.get("inverse");return new Ee(n==="horizontal"&&!i?{scaleX:t==="bottom"?1:-1,rotation:Math.PI/2}:n==="horizontal"&&i?{scaleX:t==="bottom"?-1:1,rotation:-Math.PI/2}:n==="vertical"&&!i?{scaleX:t==="left"?1:-1,scaleY:-1}:{scaleX:t==="left"?1:-1})},e.prototype._updateHandle=function(t,n){if(this._useHandle){var i=this._shapes,a=this.visualMapModel,o=i.handleThumbs,s=i.handleLabels,l=a.itemSize,u=a.getExtent(),c=this._applyTransform("left",i.mainGroup);FSe([0,1],function(f){var h=o[f];h.setStyle("fill",n.handlesColor[f]),h.y=t[f];var d=ta(t[f],[0,l[1]],u,!0),p=this.getControllerVisual(d,"symbolSize");h.scaleX=h.scaleY=p/l[0],h.x=l[0]-p/2;var v=Ri(i.handleLabelPoints[f],nu(h,this.group));if(this._orient==="horizontal"){var m=c==="left"||c==="top"?(l[0]-p)/2:(l[0]-p)/-2;v[1]+=m}s[f].setStyle({x:v[0],y:v[1],text:a.formatValueText(this._dataInterval[f]),verticalAlign:"middle",align:this._orient==="vertical"?this._applyTransform("left",i.mainGroup):"center"})},this)}},e.prototype._showIndicator=function(t,n,i,a){var o=this.visualMapModel,s=o.getExtent(),l=o.itemSize,u=[0,l[1]],c=this._shapes,f=c.indicator;if(f){f.attr("invisible",!1);var h={convertOpacityToAlpha:!0},d=this.getControllerVisual(t,"color",h),p=this.getControllerVisual(t,"symbolSize"),v=ta(t,s,u,!0),m=l[0]-p/2,g={x:f.x,y:f.y};f.y=v,f.x=m;var y=Ri(c.indicatorLabelPoint,nu(f,this.group)),b=c.indicatorLabel;b.attr("invisible",!1);var _=this._applyTransform("left",c.mainGroup),x=this._orient,w=x==="horizontal";b.setStyle({text:(i||"")+o.formatValueText(n),verticalAlign:w?_:"middle",align:w?"center":_});var S={x:m,y:v,style:{fill:d}},T={style:{x:y[0],y:y[1]}};if(o.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var C={duration:100,easing:"cubicInOut",additive:!0};f.x=g.x,f.y=g.y,f.animateTo(S,C),b.animateTo(T,C)}else f.attr(S),b.attr(T);this._firstShowIndicator=!1;var A=this._shapes.handleLabels;if(A)for(var M=0;Mo[1]&&(f[1]=1/0),n&&(f[0]===-1/0?this._showIndicator(c,f[1],"< ",l):f[1]===1/0?this._showIndicator(c,f[0],"> ",l):this._showIndicator(c,c,"≈ ",l));var h=this._hoverLinkDataIndices,d=[];(n||Fj(i))&&(d=this._hoverLinkDataIndices=i.findTargetDataIndices(f));var p=Jse(h,d);this._dispatchHighDown("downplay",tg(p[0],i)),this._dispatchHighDown("highlight",tg(p[1],i))}},e.prototype._hoverLinkFromSeriesMouseOver=function(t){var n;if(Ol(t.target,function(l){var u=Le(l);if(u.dataIndex!=null)return n=u,!0},!0),!!n){var i=this.ecModel.getSeriesByIndex(n.seriesIndex),a=this.visualMapModel;if(a.isTargetSeries(i)){var o=i.getData(n.dataType),s=o.getStore().get(a.getDataDimensionIndex(o),n.dataIndex);isNaN(s)||this._showIndicator(s,s)}}},e.prototype._hideIndicator=function(){var t=this._shapes;t.indicator&&t.indicator.attr("invisible",!0),t.indicatorLabel&&t.indicatorLabel.attr("invisible",!0);var n=this._shapes.handleLabels;if(n)for(var i=0;i=0&&(a.dimension=o,n.push(a))}}),r.getData().setVisual("visualMeta",n)}}];function qSe(r,e,t,n){for(var i=e.targetVisuals[n],a=Sr.prepareVisualTypes(i),o={color:Ep(r.getData(),"color")},s=0,l=a.length;s0:e.splitNumber>0)||e.calculable)?"continuous":"piecewise"}),r.registerAction(WSe,USe),k(YSe,function(e){r.registerVisual(r.PRIORITY.VISUAL.COMPONENT,e)}),r.registerPreprocessor(XSe))}function U8(r){r.registerComponentModel(zSe),r.registerComponentView(HSe),W8(r)}var KSe=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._pieceList=[],t}return e.prototype.optionUpdated=function(t,n){r.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var i=this._mode=this._determineMode();this._pieceList=[],ZSe[this._mode].call(this,this._pieceList),this._resetSelected(t,n);var a=this.option.categories;this.resetVisual(function(o,s){i==="categories"?(o.mappingMethod="category",o.categories=ke(a)):(o.dataExtent=this.getExtent(),o.mappingMethod="piecewise",o.pieceList=K(this._pieceList,function(l){return l=ke(l),s!=="inRange"&&(l.visual=null),l}))})},e.prototype.completeVisualOption=function(){var t=this.option,n={},i=Sr.listVisualTypes(),a=this.isCategory();k(t.pieces,function(s){k(i,function(l){s.hasOwnProperty(l)&&(n[l]=1)})}),k(n,function(s,l){var u=!1;k(this.stateList,function(c){u=u||o(t,c,l)||o(t.target,c,l)},this),!u&&k(this.stateList,function(c){(t[c]||(t[c]={}))[l]=$8.get(l,c==="inRange"?"active":"inactive",a)})},this);function o(s,l,u){return s&&s[l]&&s[l].hasOwnProperty(u)}r.prototype.completeVisualOption.apply(this,arguments)},e.prototype._resetSelected=function(t,n){var i=this.option,a=this._pieceList,o=(n?i:t).selected||{};if(i.selected=o,k(a,function(l,u){var c=this.getSelectedMapKey(l);o.hasOwnProperty(c)||(o[c]=!0)},this),i.selectedMode==="single"){var s=!1;k(a,function(l,u){var c=this.getSelectedMapKey(l);o[c]&&(s?o[c]=!1:s=!0)},this)}},e.prototype.getItemSymbol=function(){return this.get("itemSymbol")},e.prototype.getSelectedMapKey=function(t){return this._mode==="categories"?t.value+"":t.index+""},e.prototype.getPieceList=function(){return this._pieceList},e.prototype._determineMode=function(){var t=this.option;return t.pieces&&t.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},e.prototype.setSelected=function(t){this.option.selected=ke(t)},e.prototype.getValueState=function(t){var n=Sr.findPieceIndex(t,this._pieceList);return n!=null&&this.option.selected[this.getSelectedMapKey(this._pieceList[n])]?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var n=[],i=this._pieceList;return this.eachTargetSeries(function(a){var o=[],s=a.getData();s.each(this.getDataDimensionIndex(s),function(l,u){var c=Sr.findPieceIndex(l,i);c===t&&o.push(u)},this),n.push({seriesId:a.id,dataIndex:o})},this),n},e.prototype.getRepresentValue=function(t){var n;if(this.isCategory())n=t.value;else if(t.value!=null)n=t.value;else{var i=t.interval||[];n=i[0]===-1/0&&i[1]===1/0?0:(i[0]+i[1])/2}return n},e.prototype.getVisualMeta=function(t){if(this.isCategory())return;var n=[],i=["",""],a=this;function o(c,f){var h=a.getRepresentValue({interval:c});f||(f=a.getValueState(h));var d=t(h,f);c[0]===-1/0?i[0]=d:c[1]===1/0?i[1]=d:n.push({value:c[0],color:d},{value:c[1],color:d})}var s=this._pieceList.slice();if(!s.length)s.push({interval:[-1/0,1/0]});else{var l=s[0].interval[0];l!==-1/0&&s.unshift({interval:[-1/0,l]}),l=s[s.length-1].interval[1],l!==1/0&&s.push({interval:[l,1/0]})}var u=-1/0;return k(s,function(c){var f=c.interval;f&&(f[0]>u&&o([u,f[0]],"outOfRange"),o(f.slice()),u=f[1])},this),{stops:n,outerColors:i}},e.type="visualMap.piecewise",e.defaultOption=$s(Zy.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),e}(Zy),ZSe={splitNumber:function(r){var e=this.option,t=Math.min(e.precision,20),n=this.getExtent(),i=e.splitNumber;i=Math.max(parseInt(i,10),1),e.splitNumber=i;for(var a=(n[1]-n[0])/i;+a.toFixed(t)!==a&&t<5;)t++;e.precision=t,a=+a.toFixed(t),e.minOpen&&r.push({interval:[-1/0,n[0]],close:[0,0]});for(var o=0,s=n[0];o","≥"][n[0]]];t.text=t.text||this.formatValueText(t.value!=null?t.value:t.interval,!1,i)},this)}};function Gj(r,e){var t=r.inverse;(r.orient==="vertical"?!t:t)&&e.reverse()}var JSe=function(r){z(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.doRender=function(){var t=this.group;t.removeAll();var n=this.visualMapModel,i=n.get("textGap"),a=n.textStyleModel,o=a.getFont(),s=a.getTextColor(),l=this._getItemAlign(),u=n.itemSize,c=this._getViewData(),f=c.endsText,h=kr(n.get("showLabel",!0),!f),d=!n.get("selectedMode");f&&this._renderEndsText(t,f[0],u,h,l),k(c.viewPieceList,function(p){var v=p.piece,m=new Ee;m.onclick=ue(this._onItemClick,this,v),this._enableHoverLink(m,p.indexInModelPieceList);var g=n.getRepresentValue(v);if(this._createItemSymbol(m,g,[0,0,u[0],u[1]],d),h){var y=this.visualMapModel.getValueState(g);m.add(new ot({style:{x:l==="right"?-i:u[0]+i,y:u[1]/2,text:v.text,verticalAlign:"middle",align:l,font:o,fill:s,opacity:y==="outOfRange"?.5:1},silent:d}))}t.add(m)},this),f&&this._renderEndsText(t,f[1],u,h,l),iu(n.get("orient"),t,n.get("itemGap")),this.renderBackground(t),this.positionGroup(t)},e.prototype._enableHoverLink=function(t,n){var i=this;t.on("mouseover",function(){return a("highlight")}).on("mouseout",function(){return a("downplay")});var a=function(o){var s=i.visualMapModel;s.option.hoverLink&&i.api.dispatchAction({type:o,batch:tg(s.findTargetDataIndices(n),s)})}},e.prototype._getItemAlign=function(){var t=this.visualMapModel,n=t.option;if(n.orient==="vertical")return G8(t,this.api,t.itemSize);var i=n.align;return(!i||i==="auto")&&(i="left"),i},e.prototype._renderEndsText=function(t,n,i,a,o){if(n){var s=new Ee,l=this.visualMapModel.textStyleModel;s.add(new ot({style:Et(l,{x:a?o==="right"?i[0]:0:i[0]/2,y:i[1]/2,verticalAlign:"middle",align:a?o:"center",text:n})})),t.add(s)}},e.prototype._getViewData=function(){var t=this.visualMapModel,n=K(t.getPieceList(),function(s,l){return{piece:s,indexInModelPieceList:l}}),i=t.get("text"),a=t.get("orient"),o=t.get("inverse");return(a==="horizontal"?o:!o)?n.reverse():i&&(i=i.slice().reverse()),{viewPieceList:n,endsText:i}},e.prototype._createItemSymbol=function(t,n,i,a){var o=ur(this.getControllerVisual(n,"symbol"),i[0],i[1],i[2],i[3],this.getControllerVisual(n,"color"));o.silent=a,t.add(o)},e.prototype._onItemClick=function(t){var n=this.visualMapModel,i=n.option,a=i.selectedMode;if(a){var o=ke(i.selected),s=n.getSelectedMapKey(t);a==="single"||a===!0?(o[s]=!0,k(o,function(l,u){o[u]=u===s})):o[s]=!o[s],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:o})}},e.type="visualMap.piecewise",e}(H8);function Y8(r){r.registerComponentModel(KSe),r.registerComponentView(JSe),W8(r)}function QSe(r){Ue(U8),Ue(Y8)}var eTe={label:{enabled:!0},decal:{show:!1}},Wj=it(),tTe={};function rTe(r,e){var t=r.getModel("aria");if(!t.get("enabled"))return;var n=ke(eTe);Be(n.label,r.getLocaleModel().get("aria"),!1),Be(t.option,n,!1),i(),a();function i(){var u=t.getModel("decal"),c=u.get("show");if(c){var f=ve();r.eachSeries(function(h){if(!h.isColorBySeries()){var d=f.get(h.type);d||(d={},f.set(h.type,d)),Wj(h).scope=d}}),r.eachRawSeries(function(h){if(r.isSeriesFiltered(h))return;if(Te(h.enableAriaDecal)){h.enableAriaDecal();return}var d=h.getData();if(h.isColorBySeries()){var y=k2(h.ecModel,h.name,tTe,r.getSeriesCount()),b=d.getVisual("decal");d.setVisual("decal",_(b,y))}else{var p=h.getRawData(),v={},m=Wj(h).scope;d.each(function(x){var w=d.getRawIndex(x);v[w]=x});var g=p.count();p.each(function(x){var w=v[x],S=p.getName(x)||x+"",T=k2(h.ecModel,S,m,g),C=d.getItemVisual(w,"decal");d.setItemVisual(w,"decal",_(C,T))})}function _(x,w){var S=x?W(W({},w),x):w;return S.dirty=!0,S}})}}function a(){var u=e.getZr().dom;if(u){var c=r.getLocaleModel().get("aria"),f=t.getModel("label");if(f.option=Ce(f.option,c),!!f.get("enabled")){if(u.setAttribute("role","img"),f.get("description")){u.setAttribute("aria-label",f.get("description"));return}var h=r.getSeriesCount(),d=f.get(["data","maxCount"])||10,p=f.get(["series","maxCount"])||10,v=Math.min(h,p),m;if(!(h<1)){var g=s();if(g){var y=f.get(["general","withTitle"]);m=o(y,{title:g})}else m=f.get(["general","withoutTitle"]);var b=[],_=h>1?f.get(["series","multiple","prefix"]):f.get(["series","single","prefix"]);m+=o(_,{seriesCount:h}),r.eachSeries(function(T,C){if(C1?f.get(["series","multiple",D]):f.get(["series","single",D]),A=o(A,{seriesId:T.seriesIndex,seriesName:T.get("name"),seriesType:l(T.subType)});var E=T.getData();if(E.count()>d){var L=f.get(["data","partialData"]);A+=o(L,{displayCnt:d})}else A+=f.get(["data","allData"]);for(var I=f.get(["data","separator","middle"]),R=f.get(["data","separator","end"]),P=f.get(["data","excludeDimensionId"]),O=[],j=0;j":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},aTe=function(){function r(e){var t=this._condVal=se(e)?new RegExp(e):yoe(e)?e:null;if(t==null){var n="";dt(n)}}return r.prototype.evaluate=function(e){var t=typeof e;return se(t)?this._condVal.test(e):lt(t)?this._condVal.test(e+""):!1},r}(),oTe=function(){function r(){}return r.prototype.evaluate=function(){return this.value},r}(),sTe=function(){function r(){}return r.prototype.evaluate=function(){for(var e=this.children,t=0;t2&&n.push(i),i=[E,L]}function c(E,L,I,R){Lc(E,I)&&Lc(L,R)||i.push(E,L,I,R,I,R)}function f(E,L,I,R,P,O){var j=Math.abs(L-E),F=Math.tan(j/4)*4/3,N=LT:M2&&n.push(i),n}function ES(r,e,t,n,i,a,o,s,l,u){if(Lc(r,t)&&Lc(e,n)&&Lc(i,o)&&Lc(a,s)){l.push(o,s);return}var c=2/u,f=c*c,h=o-r,d=s-e,p=Math.sqrt(h*h+d*d);h/=p,d/=p;var v=t-r,m=n-e,g=i-o,y=a-s,b=v*v+m*m,_=g*g+y*y;if(b=0&&T=0){l.push(o,s);return}var C=[],A=[];Ds(r,t,i,o,.5,C),Ds(e,n,a,s,.5,A),ES(C[0],A[0],C[1],A[1],C[2],A[2],C[3],A[3],l,u),ES(C[4],A[4],C[5],A[5],C[6],A[6],C[7],A[7],l,u)}function xTe(r,e){var t=DS(r),n=[];e=e||1;for(var i=0;i0)for(var u=0;uMath.abs(u),f=X8([l,u],c?0:1,e),h=(c?s:u)/f.length,d=0;di,o=X8([n,i],a?0:1,e),s=a?"width":"height",l=a?"height":"width",u=a?"x":"y",c=a?"y":"x",f=r[s]/o.length,h=0;h1?null:new ze(v*l+r,v*u+e)}function TTe(r,e,t){var n=new ze;ze.sub(n,t,e),n.normalize();var i=new ze;ze.sub(i,r,e);var a=i.dot(n);return a}function dc(r,e){var t=r[r.length-1];t&&t[0]===e[0]&&t[1]===e[1]||r.push(e)}function CTe(r,e,t){for(var n=r.length,i=[],a=0;ao?(u.x=c.x=s+a/2,u.y=l,c.y=l+o):(u.y=c.y=l+o/2,u.x=s,c.x=s+a),CTe(e,u,c)}function Jy(r,e,t,n){if(t===1)n.push(e);else{var i=Math.floor(t/2),a=r(e);Jy(r,a[0],i,n),Jy(r,a[1],t-i,n)}return n}function ATe(r,e){for(var t=[],n=0;n0;u/=2){var c=0,f=0;(r&u)>0&&(c=1),(e&u)>0&&(f=1),s+=u*u*(3*c^f),f===0&&(c===1&&(r=u-1-r,e=u-1-e),l=r,r=e,e=l)}return s}function t0(r){var e=1/0,t=1/0,n=-1/0,i=-1/0,a=K(r,function(s){var l=s.getBoundingRect(),u=s.getComputedTransform(),c=l.x+l.width/2+(u?u[4]:0),f=l.y+l.height/2+(u?u[5]:0);return e=Math.min(c,e),t=Math.min(f,t),n=Math.max(c,n),i=Math.max(f,i),[c,f]}),o=K(a,function(s,l){return{cp:s,z:OTe(s[0],s[1],e,t,n,i),path:r[l]}});return o.sort(function(s,l){return s.z-l.z}).map(function(s){return s.path})}function J8(r){return DTe(r.path,r.count)}function LS(){return{fromIndividuals:[],toIndividuals:[],count:0}}function jTe(r,e,t){var n=[];function i(x){for(var w=0;w=0;i--)if(!t[i].many.length){var l=t[s].many;if(l.length<=1)if(s)s=0;else return t;var a=l.length,u=Math.ceil(a/2);t[i].many=l.slice(u,a),t[s].many=l.slice(0,u),s++}return t}var BTe={clone:function(r){for(var e=[],t=1-Math.pow(1-r.path.style.opacity,1/r.count),n=0;n0))return;var s=n.getModel("universalTransition").get("delay"),l=Object.assign({setToFinal:!0},o),u,c;e3(r)&&(u=r,c=e),e3(e)&&(u=e,c=r);function f(g,y,b,_,x){var w=g.many,S=g.one;if(w.length===1&&!x){var T=y?w[0]:S,C=y?S:w[0];if(Qy(T))f({many:[T],one:C},!0,b,_,!0);else{var A=s?Ce({delay:s(b,_)},l):l;cM(T,C,A),a(T,C,T,C,A)}}else for(var M=Ce({dividePath:BTe[t],individualDelay:s&&function(P,O,j,F){return s(P+b,_)}},l),D=y?jTe(w,S,M):NTe(S,w,M),E=D.fromIndividuals,L=D.toIndividuals,I=E.length,R=0;Re.length,d=u?t3(c,u):t3(h?e:r,[h?r:e]),p=0,v=0;vQ8))for(var a=n.getIndices(),o=0;o0&&w.group.traverse(function(T){T instanceof Xe&&!T.animators.length&&T.animateFrom({style:{opacity:0}},S)})})}function o3(r){var e=r.getModel("universalTransition").get("seriesKey");return e||r.id}function s3(r){return q(r)?r.sort().join(","):r}function Qo(r){if(r.hostModel)return r.hostModel.getModel("universalTransition").get("divideShape")}function WTe(r,e){var t=ve(),n=ve(),i=ve();return k(r.oldSeries,function(a,o){var s=r.oldDataGroupIds[o],l=r.oldData[o],u=o3(a),c=s3(u);n.set(c,{dataGroupId:s,data:l}),q(u)&&k(u,function(f){i.set(f,{key:c,dataGroupId:s,data:l})})}),k(e.updatedSeries,function(a){if(a.isUniversalTransitionEnabled()&&a.isAnimationEnabled()){var o=a.get("dataGroupId"),s=a.getData(),l=o3(a),u=s3(l),c=n.get(u);if(c)t.set(u,{oldSeries:[{dataGroupId:c.dataGroupId,divide:Qo(c.data),data:c.data}],newSeries:[{dataGroupId:o,divide:Qo(s),data:s}]});else if(q(l)){var f=[];k(l,function(p){var v=n.get(p);v.data&&f.push({dataGroupId:v.dataGroupId,divide:Qo(v.data),data:v.data})}),f.length&&t.set(u,{oldSeries:f,newSeries:[{dataGroupId:o,data:s,divide:Qo(s)}]})}else{var h=i.get(l);if(h){var d=t.get(h.key);d||(d={oldSeries:[{dataGroupId:h.dataGroupId,data:h.data,divide:Qo(h.data)}],newSeries:[]},t.set(h.key,d)),d.newSeries.push({dataGroupId:o,data:s,divide:Qo(s)})}}}}),t}function l3(r,e){for(var t=0;t=0&&i.push({dataGroupId:e.oldDataGroupIds[s],data:e.oldData[s],divide:Qo(e.oldData[s]),groupIdDim:o.dimension})}),k(wt(r.to),function(o){var s=l3(t.updatedSeries,o);if(s>=0){var l=t.updatedSeries[s].getData();a.push({dataGroupId:e.oldDataGroupIds[s],data:l,divide:Qo(l),groupIdDim:o.dimension})}}),i.length>0&&a.length>0&&eH(i,a,n)}function YTe(r){r.registerUpdateLifecycle("series:beforeupdate",function(e,t,n){k(wt(n.seriesTransition),function(i){k(wt(i.to),function(a){for(var o=n.updatedSeries,s=0;snew Promise((e,t)=>{const n=new FileReader;n.onloadend=()=>{n.result==null?t(new Error("FileReader result is null")):typeof n.result=="string"&&e(n.result)},n.readAsDataURL(r)});function Bu(r){return new Promise((e,t)=>{r.oncomplete=r.onsuccess=()=>e(r.result),r.onabort=r.onerror=()=>t(r.error)})}function XTe(r,e){let t;const n=()=>{if(t)return t;const i=indexedDB.open(r);return i.onupgradeneeded=()=>i.result.createObjectStore(e),t=Bu(i),t.then(a=>{a.onclose=()=>t=void 0},()=>{}),t};return(i,a)=>n().then(o=>a(o.transaction(e,i).objectStore(e)))}let jx;function $p(){return jx||(jx=XTe("keyval-store","keyval")),jx}function KTe(r,e=$p()){return e("readonly",t=>Bu(t.get(r)))}function ZTe(r,e,t=$p()){return t("readwrite",n=>(n.put(e,r),Bu(n.transaction)))}function JTe(r,e=$p()){return e("readwrite",t=>(r.forEach(n=>t.put(n[1],n[0])),Bu(t.transaction)))}function QTe(r,e=$p()){return e("readwrite",t=>(t.delete(r),Bu(t.transaction)))}function eCe(r,e){return r.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},Bu(r.transaction)}function tCe(r=$p()){return r("readonly",e=>{if(e.getAllKeys)return Bu(e.getAllKeys());const t=[];return eCe(e,n=>t.push(n.key)).then(()=>t)})}wu({});wu({});const Oa=Object.create(null);Oa.open="0";Oa.close="1";Oa.ping="2";Oa.pong="3";Oa.message="4";Oa.upgrade="5";Oa.noop="6";const rg=Object.create(null);Object.keys(Oa).forEach(r=>{rg[Oa[r]]=r});const IS={type:"error",data:"parser error"},tH=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",rH=typeof ArrayBuffer=="function",nH=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer,fM=({type:r,data:e},t,n)=>tH&&e instanceof Blob?t?n(e):u3(e,n):rH&&(e instanceof ArrayBuffer||nH(e))?t?n(e):u3(new Blob([e]),n):n(Oa[r]+(e||"")),u3=(r,e)=>{const t=new FileReader;return t.onload=function(){const n=t.result.split(",")[1];e("b"+(n||""))},t.readAsDataURL(r)};function c3(r){return r instanceof Uint8Array?r:r instanceof ArrayBuffer?new Uint8Array(r):new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}let Nx;function rCe(r,e){if(tH&&r.data instanceof Blob)return r.data.arrayBuffer().then(c3).then(e);if(rH&&(r.data instanceof ArrayBuffer||nH(r.data)))return e(c3(r.data));fM(r,!1,t=>{Nx||(Nx=new TextEncoder),e(Nx.encode(t))})}const f3="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Nh=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let r=0;r{let e=r.length*.75,t=r.length,n,i=0,a,o,s,l;r[r.length-1]==="="&&(e--,r[r.length-2]==="="&&e--);const u=new ArrayBuffer(e),c=new Uint8Array(u);for(n=0;n>4,c[i++]=(o&15)<<4|s>>2,c[i++]=(s&3)<<6|l&63;return u},iCe=typeof ArrayBuffer=="function",hM=(r,e)=>{if(typeof r!="string")return{type:"message",data:iH(r,e)};const t=r.charAt(0);return t==="b"?{type:"message",data:aCe(r.substring(1),e)}:rg[t]?r.length>1?{type:rg[t],data:r.substring(1)}:{type:rg[t]}:IS},aCe=(r,e)=>{if(iCe){const t=nCe(r);return iH(t,e)}else return{base64:!0,data:r}},iH=(r,e)=>{switch(e){case"blob":return r instanceof Blob?r:new Blob([r]);case"arraybuffer":default:return r instanceof ArrayBuffer?r:r.buffer}},aH="",oCe=(r,e)=>{const t=r.length,n=new Array(t);let i=0;r.forEach((a,o)=>{fM(a,!1,s=>{n[o]=s,++i===t&&e(n.join(aH))})})},sCe=(r,e)=>{const t=r.split(aH),n=[];for(let i=0;i{const n=t.length;let i;if(n<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,n);else if(n<65536){i=new Uint8Array(3);const a=new DataView(i.buffer);a.setUint8(0,126),a.setUint16(1,n)}else{i=new Uint8Array(9);const a=new DataView(i.buffer);a.setUint8(0,127),a.setBigUint64(1,BigInt(n))}r.data&&typeof r.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(t)})}})}let Bx;function gm(r){return r.reduce((e,t)=>e+t.length,0)}function ym(r,e){if(r[0].length===e)return r.shift();const t=new Uint8Array(e);let n=0;for(let i=0;iMath.pow(2,21)-1){s.enqueue(IS);break}i=c*Math.pow(2,32)+u.getUint32(4),n=3}else{if(gm(t)r){s.enqueue(IS);break}}}})}const oH=4;function mr(r){if(r)return cCe(r)}function cCe(r){for(var e in mr.prototype)r[e]=mr.prototype[e];return r}mr.prototype.on=mr.prototype.addEventListener=function(r,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(e),this};mr.prototype.once=function(r,e){function t(){this.off(r,t),e.apply(this,arguments)}return t.fn=e,this.on(r,t),this};mr.prototype.off=mr.prototype.removeListener=mr.prototype.removeAllListeners=mr.prototype.removeEventListener=function(r,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+r];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var n,i=0;iPromise.resolve().then(e):(e,t)=>t(e,0),ai=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),fCe="arraybuffer";function sH(r,...e){return e.reduce((t,n)=>(r.hasOwnProperty(n)&&(t[n]=r[n]),t),{})}const hCe=ai.setTimeout,dCe=ai.clearTimeout;function _1(r,e){e.useNativeTimers?(r.setTimeoutFn=hCe.bind(ai),r.clearTimeoutFn=dCe.bind(ai)):(r.setTimeoutFn=ai.setTimeout.bind(ai),r.clearTimeoutFn=ai.clearTimeout.bind(ai))}const pCe=1.33;function vCe(r){return typeof r=="string"?mCe(r):Math.ceil((r.byteLength||r.size)*pCe)}function mCe(r){let e=0,t=0;for(let n=0,i=r.length;n=57344?t+=3:(n++,t+=4);return t}function lH(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function gCe(r){let e="";for(let t in r)r.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(r[t]));return e}function yCe(r){let e={},t=r.split("&");for(let n=0,i=t.length;n{this.readyState="paused",e()};if(this._polling||!this.writable){let n=0;this._polling&&(n++,this.once("pollComplete",function(){--n||t()})),this.writable||(n++,this.once("drain",function(){--n||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=n=>{if(this.readyState==="opening"&&n.type==="open"&&this.onOpen(),n.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(n)};sCe(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,oCe(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=lH()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}}let uH=!1;try{uH=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const xCe=uH;function wCe(){}class SCe extends _Ce{constructor(e){if(super(e),typeof location<"u"){const t=location.protocol==="https:";let n=location.port;n||(n=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||n!==e.port}}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",(i,a)=>{this.onError("xhr post error",i,a)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,n)=>{this.onError("xhr poll error",t,n)}),this.pollXhr=e}}class wa extends mr{constructor(e,t,n){super(),this.createRequest=e,_1(this,n),this._opts=n,this._method=n.method||"GET",this._uri=t,this._data=n.data!==void 0?n.data:null,this._create()}_create(){var e;const t=sH(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const n=this._xhr=this.createRequest(t);try{n.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&n.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(n),"withCredentials"in n&&(n.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(n.timeout=this._opts.requestTimeout),n.onreadystatechange=()=>{var i;n.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(n.getResponseHeader("set-cookie"))),n.readyState===4&&(n.status===200||n.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof n.status=="number"?n.status:0)},0))},n.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=wa.requestsCount++,wa.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=wCe,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete wa.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}wa.requestsCount=0;wa.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",h3);else if(typeof addEventListener=="function"){const r="onpagehide"in ai?"pagehide":"unload";addEventListener(r,h3,!1)}}function h3(){for(let r in wa.requests)wa.requests.hasOwnProperty(r)&&wa.requests[r].abort()}const TCe=function(){const r=cH({xdomain:!1});return r&&r.responseType!==null}();class CCe extends SCe{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=TCe&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new wa(cH,this.uri(),e)}}function cH(r){const e=r.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||xCe))return new XMLHttpRequest}catch{}if(!e)try{return new ai[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const fH=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class ACe extends dM{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,n=fH?{}:sH(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,n)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t{try{this.doWrite(n,a)}catch{}i&&b1(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=lH()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const zx=ai.WebSocket||ai.MozWebSocket;class MCe extends ACe{createSocket(e,t,n){return fH?new zx(e,t,n):t?new zx(e,t):new zx(e)}doWrite(e,t){this.ws.send(t)}}class kCe extends dM{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const t=uCe(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),i=lCe();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();const a=()=>{n.read().then(({done:s,value:l})=>{s||(this.onPacket(l),a())}).catch(s=>{})};a();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t{i&&b1(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const DCe={websocket:MCe,webtransport:kCe,polling:CCe},ECe=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,LCe=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function PS(r){if(r.length>8e3)throw"URI too long";const e=r,t=r.indexOf("["),n=r.indexOf("]");t!=-1&&n!=-1&&(r=r.substring(0,t)+r.substring(t,n).replace(/:/g,";")+r.substring(n,r.length));let i=ECe.exec(r||""),a={},o=14;for(;o--;)a[LCe[o]]=i[o]||"";return t!=-1&&n!=-1&&(a.source=e,a.host=a.host.substring(1,a.host.length-1).replace(/;/g,":"),a.authority=a.authority.replace("[","").replace("]","").replace(/;/g,":"),a.ipv6uri=!0),a.pathNames=ICe(a,a.path),a.queryKey=PCe(a,a.query),a}function ICe(r,e){const t=/\/{2,9}/g,n=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&n.splice(0,1),e.slice(-1)=="/"&&n.splice(n.length-1,1),n}function PCe(r,e){const t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(n,i,a){i&&(t[i]=a)}),t}const RS=typeof addEventListener=="function"&&typeof removeEventListener=="function",ng=[];RS&&addEventListener("offline",()=>{ng.forEach(r=>r())},!1);class ws extends mr{constructor(e,t){if(super(),this.binaryType=fCe,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(t=e,e=null),e){const n=PS(e);t.hostname=n.host,t.secure=n.protocol==="https"||n.protocol==="wss",t.port=n.port,n.query&&(t.query=n.query)}else t.host&&(t.hostname=PS(t.host).host);_1(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(n=>{const i=n.prototype.name;this.transports.push(i),this._transportsByName[i]=n}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=yCe(this.opts.query)),RS&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},ng.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=oH,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](n)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&ws.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",t=>this._onClose("transport close",t))}onOpen(){this.readyState="open",ws.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let n=0;n0&&t>this._maxPayload)return this.writeBuffer.slice(0,n);t+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,b1(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,n){return this._sendPacket("message",e,t,n),this}send(e,t,n){return this._sendPacket("message",e,t,n),this}_sendPacket(e,t,n,i){if(typeof t=="function"&&(i=t,t=void 0),typeof n=="function"&&(i=n,n=null),this.readyState==="closing"||this.readyState==="closed")return;n=n||{},n.compress=n.compress!==!1;const a={type:e,data:t,options:n};this.emitReserved("packetCreate",a),this.writeBuffer.push(a),i&&this.once("flush",i),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?n():e()}):this.upgrading?n():e()),this}_onError(e){if(ws.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),RS&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const n=ng.indexOf(this._offlineEventListener);n!==-1&&ng.splice(n,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}ws.protocol=oH;class RCe extends ws{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e{n||(t.send([{type:"ping",data:"probe"}]),t.once("packet",f=>{if(!n)if(f.type==="pong"&&f.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;ws.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{n||this.readyState!=="closed"&&(c(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=t.name,this.emitReserved("upgradeError",h)}}))};function a(){n||(n=!0,c(),t.close(),t=null)}const o=f=>{const h=new Error("probe error: "+f);h.transport=t.name,a(),this.emitReserved("upgradeError",h)};function s(){o("transport closed")}function l(){o("socket closed")}function u(f){t&&f.name!==t.name&&a()}const c=()=>{t.removeListener("open",i),t.removeListener("error",o),t.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};t.once("open",i),t.once("error",o),t.once("close",s),this.once("close",l),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{n||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let n=0;nDCe[i]).filter(i=>!!i)),super(e,n)}};function jCe(r,e="",t){let n=r;t=t||typeof location<"u"&&location,r==null&&(r=t.protocol+"//"+t.host),typeof r=="string"&&(r.charAt(0)==="/"&&(r.charAt(1)==="/"?r=t.protocol+r:r=t.host+r),/^(https?|wss?):\/\//.test(r)||(typeof t<"u"?r=t.protocol+"//"+r:r="https://"+r),n=PS(r)),n.port||(/^(http|ws)$/.test(n.protocol)?n.port="80":/^(http|ws)s$/.test(n.protocol)&&(n.port="443")),n.path=n.path||"/";const a=n.host.indexOf(":")!==-1?"["+n.host+"]":n.host;return n.id=n.protocol+"://"+a+":"+n.port+e,n.href=n.protocol+"://"+a+(t&&t.port===n.port?"":":"+n.port),n}const NCe=typeof ArrayBuffer=="function",BCe=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,hH=Object.prototype.toString,zCe=typeof Blob=="function"||typeof Blob<"u"&&hH.call(Blob)==="[object BlobConstructor]",FCe=typeof File=="function"||typeof File<"u"&&hH.call(File)==="[object FileConstructor]";function pM(r){return NCe&&(r instanceof ArrayBuffer||BCe(r))||zCe&&r instanceof Blob||FCe&&r instanceof File}function ig(r,e){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let t=0,n=r.length;t=0&&r.num{delete this.acks[e];for(let s=0;s{this.io.clearTimeoutFn(a),t.apply(this,s)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...t){return new Promise((n,i)=>{const a=(o,s)=>o?i(o):n(s);a.withError=!0,t.push(a),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...a)=>n!==this._queue[0]?void 0:(i!==null?n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(i)):(this._queue.shift(),t&&t(null,...a)),n.pending=!1,this._drainQueue())),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:yt.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(n=>String(n.id)===e)){const n=this.acks[e];delete this.acks[e],n.withError&&n.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case yt.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case yt.EVENT:case yt.BINARY_EVENT:this.onevent(e);break;case yt.ACK:case yt.BINARY_ACK:this.onack(e);break;case yt.DISCONNECT:this.ondisconnect();break;case yt.CONNECT_ERROR:this.destroy();const n=new Error(e.data.message);n.data=e.data.data,this.emitReserved("connect_error",n);break}}onevent(e){const t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let n=!1;return function(...i){n||(n=!0,t.packet({type:yt.ACK,id:e,data:i}))}}onack(e){const t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:yt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n0&&r.jitter<=1?r.jitter:0,this.attempts=0}Lf.prototype.duration=function(){var r=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*r);r=Math.floor(e*10)&1?r+t:r-t}return Math.min(r,this.max)|0};Lf.prototype.reset=function(){this.attempts=0};Lf.prototype.setMin=function(r){this.ms=r};Lf.prototype.setMax=function(r){this.max=r};Lf.prototype.setJitter=function(r){this.jitter=r};class NS extends mr{constructor(e,t){var n;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,_1(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((n=t.randomizationFactor)!==null&&n!==void 0?n:.5),this.backoff=new Lf({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;const i=t.parser||YCe;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new OCe(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const i=Mi(t,"open",function(){n.onopen(),e&&e()}),a=s=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",s),e?e(s):this.maybeReconnectOnOpen()},o=Mi(t,"error",a);if(this._timeout!==!1){const s=this._timeout,l=this.setTimeoutFn(()=>{i(),a(new Error("timeout")),t.close()},s);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(Mi(e,"ping",this.onping.bind(this)),Mi(e,"data",this.ondata.bind(this)),Mi(e,"error",this.onerror.bind(this)),Mi(e,"close",this.onclose.bind(this)),Mi(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){b1(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new dH(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const n of t)if(this.nsps[n].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let n=0;ne()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var n;this.cleanup(),(n=this.engine)===null||n===void 0||n.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},t);this.opts.autoUnref&&n.unref(),this.subs.push(()=>{this.clearTimeoutFn(n)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const _h={};function Fx(r,e){typeof r=="object"&&(e=r,r=void 0),e=e||{};const t=jCe(r,e.path||"/socket.io"),n=t.source,i=t.id,a=t.path,o=_h[i]&&a in _h[i].nsps,s=e.forceNew||e["force new connection"]||e.multiplex===!1||o;let l;return s?l=new NS(n,e):(_h[i]||(_h[i]=new NS(n,e)),l=_h[i]),t.query&&!e.query&&(e.query=t.queryKey),l.socket(t.path,e)}Object.assign(Fx,{Manager:NS,Socket:dH,io:Fx,connect:Fx});class XCe{constructor(){this.memoryStore={},this.useIndexedDB=typeof window<"u"&&!!window.indexedDB}set(e,t){if(!this.validateKey(e))return Promise.resolve(null);try{return this.useIndexedDB?ZTe(e,JSON.stringify(t)):(this.memoryStore[e]=JSON.stringify(t),Promise.resolve())}catch(n){return this.handleError(n,"save to")}}setMany(e){try{if(this.useIndexedDB){let t=[];for(const[n,i]of Object.entries(e))t.push([n,JSON.stringify(i)]);return JTe(t)}for(const[t,n]of Object.entries(e))this.memoryStore[t]=JSON.stringify(n);return Promise.resolve()}catch(t){return this.handleError(t,"save to")}}delete(e){if(!this.validateKey(e))return Promise.resolve(null);try{return this.useIndexedDB?QTe(e):(delete this.memoryStore[e],Promise.resolve())}catch(t){return this.handleError(t,"delete from")}}get(e){if(!this.validateKey(e))return Promise.resolve(null);if(this.useIndexedDB)return KTe(e).then(t=>{if(!t)return null;try{return JSON.parse(t)}catch(n){return this.handleError(n,"parse data from")}});try{const t=this.memoryStore[e];return Promise.resolve(t?JSON.parse(t):null)}catch(t){return this.handleError(t,"parse data from")}}async keys(){try{return this.useIndexedDB?tCe():Promise.resolve(Object.keys(this.memoryStore))}catch(e){return console.error(`Failed to get keys from ${this.useIndexedDB?"IndexedDB":"memory store"}:`,e),Promise.resolve([])}}validateKey(e){return!!e}handleError(e,t){return console.error(`Failed to ${t} ${this.useIndexedDB?"IndexedDB":"memory store"}:`,e),Promise.resolve(null)}}let vc=new XCe;class KCe{constructor(){this.cacheTimeout=5*60*1e3,this.storePrefix="doc:",this.docs=new Map,this.lastFetched=new Map}setCacheTimeout(e){if(e<1)throw new Error("Cache timeout must be at least 1 minute");this.cacheTimeout=e*60*1e3}async setDoc(e){if(!(e!=null&&e.doctype)||!(e!=null&&e.name))throw new Error("Invalid doc: must have doctype and name");e.name=e.name.toString();const t=this.getKey(e.doctype,e.name);try{await vc.set(this.storePrefix+t,e),this.docs.has(t)||this.docs.set(t,te(null));const n=this.docs.get(t);n&&(n.value=e),this.lastFetched.set(t,Date.now())}catch(n){throw console.error("Failed to set doc in IDB:",n),n}}getDoc(e,t){const n=Nr(t);if(!e||!n)throw new Error("doctype and name are required");const i=this.getKey(e,n);return this.docs.has(i)?this.isStale(i)&&this.loadDoc(i,!1):(this.docs.set(i,te(null)),this.loadDoc(i,!0)),this.docs.get(i)}async loadDoc(e,t){try{!t&&this.isStale(e)&&await this.cleanup(e);const n=await vc.get(this.storePrefix+e);if(n){const i=this.docs.get(e);i&&(i.value=n),this.lastFetched.set(e,Date.now())}}catch(n){throw console.error("Failed to load doc from IDB:",n),n}}async setDocs(e){const t={};for(const n of e){if(!(n!=null&&n.doctype)||!(n!=null&&n.name))continue;n.name=n.name.toString();const i=this.getKey(n.doctype,n.name);this.docs.has(i)||this.docs.set(i,te(null));const a=this.docs.get(i);a&&(a.value=n),this.lastFetched.set(i,Date.now()),t[this.storePrefix+i]=n}await vc.setMany(t)}async invalidateDoc(e,t){if(!e||!t)return;const n=this.getKey(e,t);await this.cleanup(n)}removeDoc(e,t){return this.invalidateDoc(e,t)}getKey(e,t){return`${e.trim()}/${t.trim()}`}isStale(e){const t=this.lastFetched.get(e);return t?Date.now()-t>this.cacheTimeout:!0}async cleanup(e){this.docs.delete(e),this.lastFetched.delete(e),await vc.delete(this.storePrefix+e)}async clearAll(){try{const t=(await vc.keys()).filter(n=>n.startsWith(this.storePrefix));await Promise.all(t.map(n=>vc.delete(n))),this.docs.clear(),this.lastFetched.clear()}catch(e){throw console.error("Failed to clear all docs:",e),e}}}const ZCe=new KCe;class JCe{constructor(){this.byDocType={}}addList(e,t){this.ensureList(e),this.byDocType[e].push(t)}updateRows(e){for(let t of e)this.updateRow(t.doctype,t)}updateRow(e,t){this.ensureList(e),this.byDocType[e].forEach(n=>{n.updateRow(t)})}removeRow(e,t){this.ensureList(e),this.byDocType[e].forEach(n=>{n.removeRow(t)})}ensureList(e){this.byDocType[e]||(this.byDocType[e]=[])}}const QCe=new JCe;rU({options:{fetch:(...r)=>fetch(...r),beforeFetch({options:r}){return r.headers=eAe(r.headers||{}),{options:r}},afterFetch(r){let e=JSON.parse(r.data);if(e.debug){let t=r.response.url.replace(window.location.origin,"");console.group(t);for(let n of e.debug)console.log(n==null?void 0:n.message);console.groupEnd()}if(e.docs){let t=e.docs;for(let n of t)n.name=n.name.toString();ZCe.setDocs(t),QCe.updateRows(t)}return r.data=e.data,r},onFetchError(r){var e;if((e=r.response)!=null&&e.ok&&r.error)return console.error(`Fetch request succeeded but there was a programming error: `,r.error),r;try{let i=JSON.parse(r.data).errors[0],a=i.message?`: ${i.message}`:i.exception?" (Traceback)":"",o=new Error(`${i.type}${a}`);return o.title=i.title,o.type=i.type,o.exception=i.exception,r.error=o,r}catch(t){return console.log("Error parsing error response:",t),r}}}});function eAe(r){let e=null,t=null;typeof window<"u"&&(e=window.location.hostname,t=window.csrf_token!=="{{ csrf_token }}"?window.csrf_token:null);const n={Accept:"application/json","Content-Type":"application/json; charset=utf-8"};return e&&(n["X-Frappe-Site-Name"]=e),t&&(n["X-Frappe-CSRF-Token"]=t),{...r,...n}}const tAe={class:"p-8"},rAe={class:"mb-6 p-4 bg-white border rounded shadow"},nAe={class:"space-y-3"},cAe={__name:"SimpleDemo",setup(r){return console.log("SimpleDemo component loaded"),console.log("Button component:",ui),(e,t)=>(Y(),ae("div",tAe,[t[3]||(t[3]=kM('

    Frappe UI Test

    Basic HTML + TailwindCSS

    If you can see this styled text, TailwindCSS is working!

    ',2)),Z("div",rAe,[t[2]||(t[2]=Z("h2",{class:"text-lg font-semibold mb-2"},"Frappe UI Components",-1)),Z("div",nAe,[Ie(H(ui),null,{default:_e(()=>t[0]||(t[0]=[Di("Simple Frappe Button",-1)])),_:1,__:[0]}),Ie(H(ui),{variant:"solid",theme:"blue"},{default:_e(()=>t[1]||(t[1]=[Di("Blue Button",-1)])),_:1,__:[1]})])]),t[4]||(t[4]=kM('

    Theme Colors Test

    Primary color background and text

    ',1))]))}};export{cAe as default};